Merge lp:~mxsscott/widelands/warnings into lp:widelands
Status: | Merged | ||||
---|---|---|---|---|---|
Merged at revision: | 6482 | ||||
Proposed branch: | lp:~mxsscott/widelands/warnings | ||||
Merge into: | lp:widelands | ||||
Diff against target: |
739 lines (+145/-96) 23 files modified
src/compile_diagnostics.h (+41/-0) src/editor/editorinteractive.cc (+1/-3) src/graphic/graphic.cc (+19/-28) src/graphic/graphic.h (+6/-6) src/graphic/render/gl_surface.cc (+0/-2) src/graphic/render/sdl_surface.cc (+12/-3) src/graphic/text/rt_render.cc (+11/-6) src/graphic/text/sdl_ttf_font_impl.cc (+2/-2) src/io/filesystem/disk_filesystem.cc (+7/-10) src/logic/editor_game_base.cc (+1/-1) src/minizip/unzip.cc (+4/-0) src/network/internet_gaming.cc (+3/-0) src/network/nethost.cc (+2/-0) src/network/network_lan_promotion.cc (+14/-19) src/s2map.cc (+10/-8) src/scripting/pluto.cc (+5/-0) src/ui_basic/listselect.cc (+0/-1) src/ui_basic/panel.cc (+0/-2) src/ui_fsmenu/base.cc (+0/-2) src/ui_fsmenu/internet_lobby.cc (+3/-0) src/ui_fsmenu/netsetup_lan.cc (+4/-0) src/wui/waresdisplay.cc (+0/-2) src/wui/waresqueuedisplay.cc (+0/-1) |
||||
To merge this branch: | bzr merge lp:~mxsscott/widelands/warnings | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Widelands Developers | Pending | ||
Review via email: mp+142035@code.launchpad.net |
Description of the change
Fix or suppress GCC warnings visible when compiling with GCC 4.7.2
Specifically:
* compile_
* gl_surface.cc: Asserts that will never be false because variable is unsigned.
* panel.cc: Always-true asserts due to unsigned type.
* editorinteracti
* listselect.cc: Unused variable
* waresdisplay.cc: Unused variable
* waresqueuedispl
* graphic.cc: Unused variable and parameter and code that would never be executed.
* graphic.h: Unused parameter. Reorder members to match constructor initialization list
* ui_fsmenu/base.cc: Unused variable. pull_section() does have side effects, but in this case it is irrelevant as gr_x() and gr_y() in the initializer list will have the same impact. Suspect this existed before gr_x() and gr_y() were put into the initializer.
* sdl_surface.cc: cast struct initializers appropriately.
* rt_render.cc: cast appropriately to avoid signed/unsigned comparison.
* Question existence / correctness of method - seems to be very similar to Rect::contains() but very slightly different in handling of bottom & right edge.
* Comment out render() parameter name (unused parameter).
* Provide initialisation of all struct members.
* sdl_ttf_
* disk_filesystem.cc: Be specific about the lines to ignore warnings on.
* scripting/pluto.cc: Suppress warnings about unused-variables (at top of file)
* minizip/unzip.cc: Suppress warnings about old-style-cast (above the non-modification notice)
* internet_gaming.cc: Suppress warning about old-style-cast
* internet_lobby.cc: Suppress warning about old-style-cast
* network_
* netsetup_lan.cc: Suppress warning about old-style-cast
* nethost.cc: Add deletion of 'tips' variable, which (a) fixes a memory leak and (b) silences a warning about an unused variable (it isn't really unused, since it registers itself with the loaderUI in its constructor)
* s2map.cc: Use of setiosflags() instead of hex() and dec() silences the sign promotion warnings
Nice to see someone tackling the remaining warnings. :)
I leave reviewing the code to someone better suited for the task, but here's a few comments:
Could you elaborate a bit more on the warnings which are silenced? For minizip and similar I fully understand since we don't want to diverge from upstream (and ideally shouldn't need to include them), however I wonder about the rest.
Regarding the silencing macro, it seems nice and straight-forward to use. However, the original (http:// dbp-consulting. com/tutorials/ SuppressingGCCW arnings. html) doesn't seem to mention a license nor terms of use for it. Any thoughts on this? At any rate I assume it would be considered a derivate work of the original, which could cause all sorts of problems. Maybe I'm overreacting a bit, but I would like to see that clarified a bit more.