widelands-dev team mailing list archive
-
widelands-dev team
-
Mailing list archive
-
Message #07080
Re: [Merge] lp:~widelands-dev/widelands/travis-clang-warnings into lp:widelands
Expect a commit in some minutes
Diff comments:
>
> === modified file 'src/ai/ai_help_structs.h'
> --- src/ai/ai_help_structs.h 2016-03-12 20:06:24 +0000
> +++ src/ai/ai_help_structs.h 2016-04-02 16:49:56 +0000
> @@ -351,8 +350,8 @@
> uint16_t mines_percent; // % of res it can mine
> uint32_t current_stats;
>
> - std::vector<int16_t> inputs;
> - std::vector<int16_t> outputs;
> + std::vector<Widelands::DescriptionIndex> inputs;
> + std::vector<Widelands::DescriptionIndex> outputs;
Yes, will commit some commetns for this one
> std::vector<Widelands::DescriptionIndex> critical_building_material;
>
> bool produces_building_material;
>
> === modified file 'src/editor/ui_menus/editor_tool_change_resources_options_menu.cc'
> --- src/editor/ui_menus/editor_tool_change_resources_options_menu.cc 2016-03-14 18:10:09 +0000
> +++ src/editor/ui_menus/editor_tool_change_resources_options_menu.cc 2016-04-02 16:49:56 +0000
> @@ -197,10 +197,7 @@
> case Change_By_Increase: change_by += change_by < 63; break;
> case Change_By_Decrease: change_by -= 1 < change_by; break;
> case Set_To_Increase: set_to += set_to < 63; break;
> - case Set_To_Decrease: set_to -= 0 < set_to; break;
> - default:
> - NEVER_HERE();
> - break;
> + case Set_To_Decrease: set_to -= 0 < set_to;
NOOP - No-operation Mnenomic from Assembler, meaning an Operation that does nothing.
Sometimes needed for technical reasons.
But is thins case we could just write
set_to < set_to;
which would always be false ?
...
Wait a minute: that is this confusing operator precedence and
C/C++ not having a real boolean. This actually is:
if (set_to >0) { set_to -= 1; }
So the code is OK, yet confusing.
> }
> increase_tool_.set_change_by(change_by);
> increase_tool_.decrease_tool().set_change_by(change_by);
>
> === modified file 'src/scripting/lua_globals.cc'
> --- src/scripting/lua_globals.cc 2015-02-28 17:43:48 +0000
> +++ src/scripting/lua_globals.cc 2016-04-02 16:49:56 +0000
> @@ -104,7 +104,6 @@
> case LUA_TTHREAD:
> case LUA_TLIGHTUSERDATA:
> report_error(L, "Cannot format the given type %s at index %i", lua_typename(L, i), i);
> - break;
On my way
>
> default:
> {
--
https://code.launchpad.net/~widelands-dev/widelands/travis-clang-warnings/+merge/290697
Your team Widelands Developers is subscribed to branch lp:~widelands-dev/widelands/travis-clang-warnings.
References