Merge lp:~widelands-dev/widelands/compiler_warnings_200809 into lp:widelands

Proposed by GunChleoc
Status: Merged
Merged at revision: 8864
Proposed branch: lp:~widelands-dev/widelands/compiler_warnings_200809
Merge into: lp:widelands
Diff against target: 166 lines (+13/-14)
10 files modified
src/ai/defaultai.cc (+1/-0)
src/logic/map_objects/tribes/ship.cc (+0/-1)
src/ui_basic/fileview_panel.cc (+4/-4)
src/ui_basic/fileview_panel.h (+1/-1)
src/wui/game_client_disconnected.h (+1/-1)
src/wui/interactive_player.cc (+1/-0)
src/wui/interactive_spectator.cc (+1/-0)
src/wui/seafaring_statistics_menu.cc (+2/-5)
src/wui/waresdisplay.cc (+1/-1)
src/wui/watchwindow.h (+1/-1)
To merge this branch: bzr merge lp:~widelands-dev/widelands/compiler_warnings_200809
Reviewer Review Type Date Requested Status
Klaus Halfmann review, compile, testcases Approve
Review via email: mp+355875@code.launchpad.net

Commit message

Fixed most compiler warnings for clang.

To post a comment you must log in.
Revision history for this message
bunnybot (widelandsofficial) wrote :

Continuous integration builds have changed state:

Travis build 4077. State: passed. Details: https://travis-ci.org/widelands/widelands/builds/435064780.
Appveyor build 3873. State: success. Details: https://ci.appveyor.com/project/widelands-dev/widelands/build/_widelands_dev_widelands_compiler_warnings_200809-3873.

Revision history for this message
Klaus Halfmann (klaus-halfmann) wrote :

OK this just makes the compiler happy, will compile this
after merging with bug-1699852-compiler-warning. WHich should actually get rid
of all warnings (Wow!).

review: Approve (review)
Revision history for this message
Klaus Halfmann (klaus-halfmann) wrote :

OK, only one warning left.

src/graphic/image_io.cc:99:6: warning: disabled expansion of recursive macro [-Wdisabled-macro-expansion]
        if (setjmp(png_jmpbuf(png_ptr))) { // NOLINT

I see no sematic changes.

Ran 42 tests in 1196.210s

all fine.

@bunnybot merge

review: Approve (review, compile, testcases)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/ai/defaultai.cc'
2--- src/ai/defaultai.cc 2018-07-13 19:29:51 +0000
3+++ src/ai/defaultai.cc 2018-09-29 18:47:59 +0000
4@@ -201,6 +201,7 @@
5 break;
6 }
7 }
8+ break;
9 default:
10 // Do nothing
11 break;
12
13=== modified file 'src/logic/map_objects/tribes/ship.cc'
14--- src/logic/map_objects/tribes/ship.cc 2018-09-25 06:32:35 +0000
15+++ src/logic/map_objects/tribes/ship.cc 2018-09-29 18:47:59 +0000
16@@ -702,7 +702,6 @@
17 start_task_idle(game, descr().main_animation(), 1500);
18 return;
19 }
20- FALLS_THROUGH;
21 case ShipStates::kSinkRequest:
22 case ShipStates::kSinkAnimation:
23 break;
24
25=== modified file 'src/ui_basic/fileview_panel.cc'
26--- src/ui_basic/fileview_panel.cc 2018-07-08 09:18:33 +0000
27+++ src/ui_basic/fileview_panel.cc 2018-09-29 18:47:59 +0000
28@@ -36,7 +36,7 @@
29 padding_(5),
30 contents_width_(0),
31 contents_height_(0),
32- style_(scrollbar_style) {
33+ panel_style_(scrollbar_style) {
34 layout();
35 }
36
37@@ -56,7 +56,7 @@
38 size_t index = boxes_.size() - 1;
39
40 UI::MultilineTextarea* textarea =
41- new UI::MultilineTextarea(boxes_.at(index).get(), 0, 0, Scrollbar::kSize, 0, style_, content);
42+ new UI::MultilineTextarea(boxes_.at(index).get(), 0, 0, Scrollbar::kSize, 0, panel_style_, content);
43
44 textviews_.push_back(std::unique_ptr<UI::MultilineTextarea>(std::move(textarea)));
45 add((boost::format("about_%" PRIuS) % index).str(), title, boxes_.at(index).get(), "");
46@@ -80,9 +80,9 @@
47
48 // If there is a border, we have less space for the contents
49 contents_width_ =
50- std::max(0, style_ == UI::PanelStyle::kFsMenu ? get_w() - padding_ : get_w() - 2 * padding_);
51+ std::max(0, panel_style_ == UI::PanelStyle::kFsMenu ? get_w() - padding_ : get_w() - 2 * padding_);
52
53- contents_height_ = std::max(0, style_ == UI::PanelStyle::kFsMenu ?
54+ contents_height_ = std::max(0, panel_style_ == UI::PanelStyle::kFsMenu ?
55 get_inner_h() - 2 * padding_ - UI::kTabPanelButtonHeight :
56 get_inner_h() - 3 * padding_ - UI::kTabPanelButtonHeight);
57
58
59=== modified file 'src/ui_basic/fileview_panel.h'
60--- src/ui_basic/fileview_panel.h 2018-04-27 06:11:05 +0000
61+++ src/ui_basic/fileview_panel.h 2018-09-29 18:47:59 +0000
62@@ -47,7 +47,7 @@
63 const int padding_;
64 int contents_width_;
65 int contents_height_;
66- const UI::PanelStyle style_;
67+ const UI::PanelStyle panel_style_;
68
69 // Tab contents
70 std::vector<std::unique_ptr<Box>> boxes_;
71
72=== modified file 'src/wui/game_client_disconnected.h'
73--- src/wui/game_client_disconnected.h 2018-09-14 23:52:30 +0000
74+++ src/wui/game_client_disconnected.h 2018-09-29 18:47:59 +0000
75@@ -26,8 +26,8 @@
76 #include "ui_basic/multilinetextarea.h"
77 #include "ui_basic/unique_window.h"
78
79-class GameHost;
80 class InteractiveGameBase;
81+struct GameHost;
82
83 /**
84 * Dialog that offers to replace a player with an AI or exit the game.
85
86=== modified file 'src/wui/interactive_player.cc'
87--- src/wui/interactive_player.cc 2018-09-25 06:32:35 +0000
88+++ src/wui/interactive_player.cc 2018-09-29 18:47:59 +0000
89@@ -479,6 +479,7 @@
90 }
91 return dynamic_cast<GameChatMenu*>(chat_.window)->enter_chat_message();
92 }
93+ break;
94 default:
95 break;
96 }
97
98=== modified file 'src/wui/interactive_spectator.cc'
99--- src/wui/interactive_spectator.cc 2018-09-25 06:32:35 +0000
100+++ src/wui/interactive_spectator.cc 2018-09-29 18:47:59 +0000
101@@ -257,6 +257,7 @@
102 }
103 return dynamic_cast<GameChatMenu*>(chat_.window)->enter_chat_message();
104 }
105+ break;
106 default:
107 break;
108 }
109
110=== modified file 'src/wui/seafaring_statistics_menu.cc'
111--- src/wui/seafaring_statistics_menu.cc 2018-05-13 07:15:39 +0000
112+++ src/wui/seafaring_statistics_menu.cc 2018-09-29 18:47:59 +0000
113@@ -225,9 +225,8 @@
114 return pgettext("ship_state", "Founding a Colony");
115 case SeafaringStatisticsMenu::ShipFilterStatus::kAll:
116 return "All"; // The user shouldn't see this, so we don't localize
117- default:
118- NEVER_HERE();
119 }
120+ NEVER_HERE();
121 }
122
123 const Image*
124@@ -254,8 +253,6 @@
125 case SeafaringStatisticsMenu::ShipFilterStatus::kAll:
126 filename = "images/wui/ship/ship_scout_ne.png";
127 break;
128- default:
129- NEVER_HERE();
130 }
131 return g_gr->images().get(filename);
132 }
133@@ -418,7 +415,7 @@
134 case SDLK_KP_PERIOD:
135 if (code.mod & KMOD_NUM)
136 break;
137- /* no break */
138+ FALLS_THROUGH;
139 default:
140 break; // not handled
141 }
142
143=== modified file 'src/wui/waresdisplay.cc'
144--- src/wui/waresdisplay.cc 2018-09-12 05:57:57 +0000
145+++ src/wui/waresdisplay.cc 2018-09-29 18:47:59 +0000
146@@ -385,7 +385,7 @@
147 remove_all_warelists();
148 }
149
150-const char* unit_suffixes[] = {
151+static const char* unit_suffixes[] = {
152 "%1%",
153 /** TRANSLATORS: This is a large number with a suffix (e.g. 50k = 50,000). */
154 /** TRANSLATORS: Space is limited, use only 1 letter for the suffix and no whitespace. */
155
156=== modified file 'src/wui/watchwindow.h'
157--- src/wui/watchwindow.h 2018-04-29 09:20:29 +0000
158+++ src/wui/watchwindow.h 2018-09-29 18:47:59 +0000
159@@ -38,7 +38,7 @@
160 uint32_t w,
161 uint32_t h,
162 bool single_window_ = false);
163- ~WatchWindow();
164+ ~WatchWindow() override;
165
166 boost::signals2::signal<void(Vector2f)> warp_mainview;
167

Subscribers

People subscribed via source and target branches

to status/vote changes: