fix same CI warnings

This commit is contained in:
2019-09-05 18:14:55 +07:00
parent c69c95ebc6
commit 0ae038b51e
6 changed files with 13 additions and 17 deletions

View File

@@ -87,12 +87,7 @@ elseif(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
/we4554 # check operator precedence for possible error; use parentheses to clarify precedence
/w14100 # unreferenced formal parameter
/w14189 # local variable is initialized but not referenced
/we4456 # declaration of 'var' hides previous local declaration
)
if(CMAKE_CXX_FLAGS_RELWITHDEBINFO)
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} /Ob2")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /Ob2")
endif()
/we4456) # declaration of 'var' hides previous local declaration
endif()
string(REPLACE ";" " " E2D_SHARED_CXX_FLAGS "${E2D_SHARED_CXX_FLAGS}")

View File

@@ -53,8 +53,8 @@ namespace
});
}
owner.for_joined_components<spine_player_evt, spine_player>([
](ecs::entity e, const spine_player_evt& pe, spine_player& p) {
owner.for_joined_components<spine_player_evt>([
](ecs::entity e, const spine_player_evt& pe) {
for ( const auto& evt : pe.events() ) {
if ( auto complete_evt = std::get_if<spine_player_evt::complete_evt>(&evt);
complete_evt && complete_evt->message() == "to_walk" )

View File

@@ -724,7 +724,7 @@ typedef struct {
BYTE Reserved[190];
#if defined(__GNUC__) && __GNUC__<3
char CodingHistory[0]; // history
#elif 1 // change to 0 if compiler fails the following line
#elif 0 // change to 0 if compiler fails the following line
char CodingHistory[]; // history
#else
char CodingHistory[1]; // history
@@ -762,7 +762,7 @@ typedef struct
char URL[1024]; // uniform resource locator
#if defined(__GNUC__) && __GNUC__<3
char TagText[0]; // free form text for scripts or tags
#elif 1 // change to 0 if compiler fails the following line
#elif 0 // change to 0 if compiler fails the following line
char TagText[]; // free form text for scripts or tags
#else
char TagText[1]; // free form text for scripts or tags
@@ -785,7 +785,7 @@ typedef struct
DWORD dwCuePoints;
#if defined(__GNUC__) && __GNUC__<3
TAG_CUE_POINT CuePoints[0];
#elif 1 // change to 0 if compiler fails the following line
#elif 0 // change to 0 if compiler fails the following line
TAG_CUE_POINT CuePoints[];
#else
TAG_CUE_POINT CuePoints[1];
@@ -816,7 +816,7 @@ typedef struct
DWORD cbSamplerData;
#if defined(__GNUC__) && __GNUC__<3
TAG_SMPL_LOOP SampleLoops[0];
#elif 1 // change to 0 if compiler fails the following line
#elif 0 // change to 0 if compiler fails the following line
TAG_SMPL_LOOP SampleLoops[];
#else
TAG_SMPL_LOOP SampleLoops[1];

View File

@@ -724,7 +724,7 @@ typedef struct {
BYTE Reserved[190];
#if defined(__GNUC__) && __GNUC__<3
char CodingHistory[0]; // history
#elif 1 // change to 0 if compiler fails the following line
#elif 0 // change to 0 if compiler fails the following line
char CodingHistory[]; // history
#else
char CodingHistory[1]; // history
@@ -762,7 +762,7 @@ typedef struct
char URL[1024]; // uniform resource locator
#if defined(__GNUC__) && __GNUC__<3
char TagText[0]; // free form text for scripts or tags
#elif 1 // change to 0 if compiler fails the following line
#elif 0 // change to 0 if compiler fails the following line
char TagText[]; // free form text for scripts or tags
#else
char TagText[1]; // free form text for scripts or tags
@@ -785,7 +785,7 @@ typedef struct
DWORD dwCuePoints;
#if defined(__GNUC__) && __GNUC__<3
TAG_CUE_POINT CuePoints[0];
#elif 1 // change to 0 if compiler fails the following line
#elif 0 // change to 0 if compiler fails the following line
TAG_CUE_POINT CuePoints[];
#else
TAG_CUE_POINT CuePoints[1];
@@ -816,7 +816,7 @@ typedef struct
DWORD cbSamplerData;
#if defined(__GNUC__) && __GNUC__<3
TAG_SMPL_LOOP SampleLoops[0];
#elif 1 // change to 0 if compiler fails the following line
#elif 0 // change to 0 if compiler fails the following line
TAG_SMPL_LOOP SampleLoops[];
#else
TAG_SMPL_LOOP SampleLoops[1];

View File

@@ -1100,6 +1100,7 @@ namespace e2d
if ( tex->decl().is_compressed() ) {
const v2u block_size = tex->decl().block_size();
E2D_UNUSED(block_size);
E2D_ASSERT(region.position.x % block_size.x == 0 && region.position.y % block_size.y == 0);
E2D_ASSERT(region.size.x % block_size.x == 0 && region.size.y % block_size.y == 0);
opengl::with_gl_bind_texture(state_->dbg(), tex->state().id(),

View File

@@ -231,7 +231,7 @@ TEST_CASE("intrusive_ptr") {
REQUIRE(obj_t::dtor_counter == 4u);
}
{
std::make_unique<obj_t>(10);
E2D_UNUSED(std::make_unique<obj_t>(10));
intrusive_ptr<const obj_t> p1(new derived2_t());
intrusive_ptr<const derived2_t> p2 = static_pointer_cast<const derived2_t>(p1);
REQUIRE(p2->i == 21);