Merge lp:~widelands-dev/widelands/bug-986611-cppcheck-pass-by-reference into lp:widelands
- bug-986611-cppcheck-pass-by-reference
- Merge into trunk
Proposed by
GunChleoc
Status: | Merged | ||||
---|---|---|---|---|---|
Merged at revision: | 8389 | ||||
Proposed branch: | lp:~widelands-dev/widelands/bug-986611-cppcheck-pass-by-reference | ||||
Merge into: | lp:widelands | ||||
Diff against target: |
315 lines (+29/-30) 20 files modified
src/base/i18n.cc (+2/-2) src/base/i18n.h (+2/-2) src/editor/tools/tool_action.h (+1/-1) src/graphic/text/rt_errors_impl.h (+1/-1) src/graphic/text/rt_parse.h (+1/-1) src/graphic/text/textstream.cc (+2/-2) src/graphic/text/textstream.h (+2/-3) src/logic/map_objects/map_object.h (+1/-1) src/logic/map_objects/tribes/tribe_basic_info.h (+1/-1) src/network/gamehost.cc (+2/-2) src/network/gamehost.h (+2/-2) src/network/internet_gaming.cc (+3/-3) src/network/internet_gaming.h (+1/-1) src/notifications/notifications_impl.h (+1/-1) src/wlapplication.h (+1/-1) src/wui/game_debug_ui.cc (+2/-2) src/wui/game_main_menu_save_game.cc (+1/-1) src/wui/game_main_menu_save_game.h (+1/-1) src/wui/game_message_menu.cc (+1/-1) src/wui/game_message_menu.h (+1/-1) |
||||
To merge this branch: | bzr merge lp:~widelands-dev/widelands/bug-986611-cppcheck-pass-by-reference | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
SirVer | Needs Fixing | ||
Review via email:
|
Commit message
Pass function arguments per const reference where possible.
Description of the change
This cleanup should gain us a bit of performance. Changes are pretty trivial (argument -> (const) argument&)
To post a comment you must log in.
Revision history for this message
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
SirVer (sirver) : | # |
review:
Needs Fixing
Revision history for this message
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
GunChleoc (gunchleoc) wrote : | # |
Revision history for this message
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
bunnybot (widelandsofficial) wrote : | # |
Continuous integration builds have changed state:
Travis build 2360. State: passed. Details: https:/
Appveyor build 2188. State: success. Details: https:/
Revision history for this message
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
GunChleoc (gunchleoc) wrote : | # |
@bunnybot merge
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'src/base/i18n.cc' | |||
2 | --- src/base/i18n.cc 2017-01-25 18:55:59 +0000 | |||
3 | +++ src/base/i18n.cc 2017-06-25 21:56:19 +0000 | |||
4 | @@ -76,7 +76,7 @@ | |||
5 | 76 | /** | 76 | /** |
6 | 77 | * Set the localedir. This should usually only be done once | 77 | * Set the localedir. This should usually only be done once |
7 | 78 | */ | 78 | */ |
9 | 79 | void set_localedir(std::string dname) { | 79 | void set_localedir(const std::string& dname) { |
10 | 80 | localedir = dname; | 80 | localedir = dname; |
11 | 81 | } | 81 | } |
12 | 82 | 82 | ||
13 | @@ -157,7 +157,7 @@ | |||
14 | 157 | * Set the locale to the given string. | 157 | * Set the locale to the given string. |
15 | 158 | * Code inspired by wesnoth.org | 158 | * Code inspired by wesnoth.org |
16 | 159 | */ | 159 | */ |
18 | 160 | void set_locale(std::string name) { | 160 | void set_locale(const std::string& name) { |
19 | 161 | const std::map<std::string, std::string> kAlternatives = { | 161 | const std::map<std::string, std::string> kAlternatives = { |
20 | 162 | {"ar", "ar,ar_AR,ar_AE,ar_BH,ar_DZ,ar_EG,ar_IN,ar_IQ,ar_JO,ar_KW,ar_LB,ar_LY,ar_MA,ar_OM,ar_" | 162 | {"ar", "ar,ar_AR,ar_AE,ar_BH,ar_DZ,ar_EG,ar_IN,ar_IQ,ar_JO,ar_KW,ar_LB,ar_LY,ar_MA,ar_OM,ar_" |
21 | 163 | "QA,ar_SA,ar_SD,ar_SY,ar_TN,ar_YE"}, | 163 | "QA,ar_SA,ar_SD,ar_SY,ar_TN,ar_YE"}, |
22 | 164 | 164 | ||
23 | === modified file 'src/base/i18n.h' | |||
24 | --- src/base/i18n.h 2017-06-24 08:47:46 +0000 | |||
25 | +++ src/base/i18n.h 2017-06-25 21:56:19 +0000 | |||
26 | @@ -52,10 +52,10 @@ | |||
27 | 52 | }; | 52 | }; |
28 | 53 | 53 | ||
29 | 54 | void init_locale(); | 54 | void init_locale(); |
31 | 55 | void set_locale(std::string); | 55 | void set_locale(const std::string&); |
32 | 56 | const std::string& get_locale(); | 56 | const std::string& get_locale(); |
33 | 57 | 57 | ||
35 | 58 | void set_localedir(std::string); | 58 | void set_localedir(const std::string&); |
36 | 59 | const std::string& get_localedir(); | 59 | const std::string& get_localedir(); |
37 | 60 | 60 | ||
38 | 61 | // Localize a list of 'items'. The last 2 items are concatenated with "and" or | 61 | // Localize a list of 'items'. The last 2 items are concatenated with "and" or |
39 | 62 | 62 | ||
40 | === modified file 'src/editor/tools/tool_action.h' | |||
41 | --- src/editor/tools/tool_action.h 2017-01-25 18:55:59 +0000 | |||
42 | +++ src/editor/tools/tool_action.h 2017-06-25 21:56:19 +0000 | |||
43 | @@ -46,7 +46,7 @@ | |||
44 | 46 | Widelands::Map& m, | 46 | Widelands::Map& m, |
45 | 47 | Widelands::NodeAndTriangle<> c, | 47 | Widelands::NodeAndTriangle<> c, |
46 | 48 | EditorInteractive& p, | 48 | EditorInteractive& p, |
48 | 49 | EditorActionArgs nargs) | 49 | const EditorActionArgs& nargs) |
49 | 50 | : tool(t), i(ind), map(m), center(c), parent(p) { | 50 | : tool(t), i(ind), map(m), center(c), parent(p) { |
50 | 51 | args = new EditorActionArgs(parent); | 51 | args = new EditorActionArgs(parent); |
51 | 52 | *args = nargs; | 52 | *args = nargs; |
52 | 53 | 53 | ||
53 | === modified file 'src/graphic/text/rt_errors_impl.h' | |||
54 | --- src/graphic/text/rt_errors_impl.h 2017-01-25 18:55:59 +0000 | |||
55 | +++ src/graphic/text/rt_errors_impl.h 2017-06-25 21:56:19 +0000 | |||
56 | @@ -28,7 +28,7 @@ | |||
57 | 28 | 28 | ||
58 | 29 | struct SyntaxErrorImpl : public SyntaxError { | 29 | struct SyntaxErrorImpl : public SyntaxError { |
59 | 30 | SyntaxErrorImpl( | 30 | SyntaxErrorImpl( |
61 | 31 | size_t line, size_t col, std::string expected, std::string got, std::string next_chars) | 31 | size_t line, size_t col, const std::string& expected, const std::string& got, const std::string& next_chars) |
62 | 32 | : SyntaxError( | 32 | : SyntaxError( |
63 | 33 | (boost::format( | 33 | (boost::format( |
64 | 34 | "Syntax error at %1%:%2%: expected %3%, got '%4%'. String continues with: '%5%'") % | 34 | "Syntax error at %1%:%2%: expected %3%, got '%4%'. String continues with: '%5%'") % |
65 | 35 | 35 | ||
66 | === modified file 'src/graphic/text/rt_parse.h' | |||
67 | --- src/graphic/text/rt_parse.h 2017-06-24 08:47:46 +0000 | |||
68 | +++ src/graphic/text/rt_parse.h 2017-06-25 21:56:19 +0000 | |||
69 | @@ -104,7 +104,7 @@ | |||
70 | 104 | } | 104 | } |
71 | 105 | explicit Child(Tag* t) : tag(t) { | 105 | explicit Child(Tag* t) : tag(t) { |
72 | 106 | } | 106 | } |
74 | 107 | explicit Child(std::string t) : tag(nullptr), text(t) { | 107 | explicit Child(const std::string& t) : tag(nullptr), text(t) { |
75 | 108 | } | 108 | } |
76 | 109 | ~Child() { | 109 | ~Child() { |
77 | 110 | if (tag) | 110 | if (tag) |
78 | 111 | 111 | ||
79 | === modified file 'src/graphic/text/textstream.cc' | |||
80 | --- src/graphic/text/textstream.cc 2017-05-31 21:27:07 +0000 | |||
81 | +++ src/graphic/text/textstream.cc 2017-06-25 21:56:19 +0000 | |||
82 | @@ -29,7 +29,7 @@ | |||
83 | 29 | namespace RT { | 29 | namespace RT { |
84 | 30 | 30 | ||
85 | 31 | struct EndOfTextImpl : public EndOfText { | 31 | struct EndOfTextImpl : public EndOfText { |
87 | 32 | EndOfTextImpl(size_t pos, std::string text) | 32 | EndOfTextImpl(size_t pos, const std::string& text) |
88 | 33 | : EndOfText( | 33 | : EndOfText( |
89 | 34 | (format("Unexpected End of Text, starting at %1%. Text is: '%2%'") % pos % text).str()) { | 34 | (format("Unexpected End of Text, starting at %1%. Text is: '%2%'") % pos % text).str()) { |
90 | 35 | } | 35 | } |
91 | @@ -133,7 +133,7 @@ | |||
92 | 133 | /* | 133 | /* |
93 | 134 | * Parse till any of the chars is found or the end of the string has been hit. | 134 | * Parse till any of the chars is found or the end of the string has been hit. |
94 | 135 | */ | 135 | */ |
96 | 136 | std::string TextStream::till_any_or_end(std::string chars) { | 136 | std::string TextStream::till_any_or_end(const std::string& chars) { |
97 | 137 | std::string rv; | 137 | std::string rv; |
98 | 138 | try { | 138 | try { |
99 | 139 | rv = till_any(chars); | 139 | rv = till_any(chars); |
100 | 140 | 140 | ||
101 | === modified file 'src/graphic/text/textstream.h' | |||
102 | --- src/graphic/text/textstream.h 2017-06-25 19:12:30 +0000 | |||
103 | +++ src/graphic/text/textstream.h 2017-06-25 21:56:19 +0000 | |||
104 | @@ -28,8 +28,7 @@ | |||
105 | 28 | 28 | ||
106 | 29 | class TextStream { | 29 | class TextStream { |
107 | 30 | public: | 30 | public: |
110 | 31 | explicit TextStream(std::string text) | 31 | explicit TextStream(const std::string& text) : text_(text), line_(1), col_(0), pos_(0), end_(text.size()) { |
109 | 32 | : text_(text), line_(1), col_(0), pos_(0), end_(text.size()) { | ||
111 | 33 | } | 32 | } |
112 | 34 | 33 | ||
113 | 35 | size_t line() const { | 34 | size_t line() const { |
114 | @@ -46,7 +45,7 @@ | |||
115 | 46 | void expect(std::string, bool = true); | 45 | void expect(std::string, bool = true); |
116 | 47 | 46 | ||
117 | 48 | std::string till_any(std::string); | 47 | std::string till_any(std::string); |
119 | 49 | std::string till_any_or_end(std::string); | 48 | std::string till_any_or_end(const std::string&); |
120 | 50 | std::string parse_string(); | 49 | std::string parse_string(); |
121 | 51 | 50 | ||
122 | 52 | void skip(size_t d) { | 51 | void skip(size_t d) { |
123 | 53 | 52 | ||
124 | === modified file 'src/logic/map_objects/map_object.h' | |||
125 | --- src/logic/map_objects/map_object.h 2017-06-25 19:12:30 +0000 | |||
126 | +++ src/logic/map_objects/map_object.h 2017-06-25 21:56:19 +0000 | |||
127 | @@ -241,7 +241,7 @@ | |||
128 | 241 | }; | 241 | }; |
129 | 242 | 242 | ||
130 | 243 | struct LogSink { | 243 | struct LogSink { |
132 | 244 | virtual void log(std::string str) = 0; | 244 | virtual void log(const std::string& str) = 0; |
133 | 245 | virtual ~LogSink() { | 245 | virtual ~LogSink() { |
134 | 246 | } | 246 | } |
135 | 247 | }; | 247 | }; |
136 | 248 | 248 | ||
137 | === modified file 'src/logic/map_objects/tribes/tribe_basic_info.h' | |||
138 | --- src/logic/map_objects/tribes/tribe_basic_info.h 2017-06-24 08:47:46 +0000 | |||
139 | +++ src/logic/map_objects/tribes/tribe_basic_info.h 2017-06-25 21:56:19 +0000 | |||
140 | @@ -34,7 +34,7 @@ | |||
141 | 34 | 34 | ||
142 | 35 | /// Script path and localized name for a starting condition | 35 | /// Script path and localized name for a starting condition |
143 | 36 | struct Initialization { | 36 | struct Initialization { |
145 | 37 | Initialization(std::string init_script, std::string init_descname, std::string init_tooltip) | 37 | Initialization(const std::string& init_script, const std::string& init_descname, const std::string& init_tooltip) |
146 | 38 | : script(init_script), descname(init_descname), tooltip(init_tooltip) { | 38 | : script(init_script), descname(init_descname), tooltip(init_tooltip) { |
147 | 39 | } | 39 | } |
148 | 40 | std::string script; | 40 | std::string script; |
149 | 41 | 41 | ||
150 | === modified file 'src/network/gamehost.cc' | |||
151 | --- src/network/gamehost.cc 2017-06-24 08:47:46 +0000 | |||
152 | +++ src/network/gamehost.cc 2017-06-25 21:56:19 +0000 | |||
153 | @@ -909,7 +909,7 @@ | |||
154 | 909 | * - -1 if no client was found | 909 | * - -1 if no client was found |
155 | 910 | * - -2 if the host is the client (has no client number) | 910 | * - -2 if the host is the client (has no client number) |
156 | 911 | */ | 911 | */ |
158 | 912 | int32_t GameHost::check_client(std::string name) { | 912 | int32_t GameHost::check_client(const std::string& name) { |
159 | 913 | // Check if the client is the host him-/herself | 913 | // Check if the client is the host him-/herself |
160 | 914 | if (d->localplayername == name) { | 914 | if (d->localplayername == name) { |
161 | 915 | return -2; | 915 | return -2; |
162 | @@ -939,7 +939,7 @@ | |||
163 | 939 | * If the host sends a chat message with formation /kick <name> <reason> | 939 | * If the host sends a chat message with formation /kick <name> <reason> |
164 | 940 | * This function will handle this command and try to kick the user. | 940 | * This function will handle this command and try to kick the user. |
165 | 941 | */ | 941 | */ |
167 | 942 | void GameHost::kick_user(uint32_t client, std::string reason) { | 942 | void GameHost::kick_user(uint32_t client, const std::string& reason) { |
168 | 943 | disconnect_client(client, "KICKED", true, reason); | 943 | disconnect_client(client, "KICKED", true, reason); |
169 | 944 | } | 944 | } |
170 | 945 | 945 | ||
171 | 946 | 946 | ||
172 | === modified file 'src/network/gamehost.h' | |||
173 | --- src/network/gamehost.h 2017-06-05 07:33:18 +0000 | |||
174 | +++ src/network/gamehost.h 2017-06-25 21:56:19 +0000 | |||
175 | @@ -87,8 +87,8 @@ | |||
176 | 87 | void send(ChatMessage msg); | 87 | void send(ChatMessage msg); |
177 | 88 | 88 | ||
178 | 89 | // Host command related stuff | 89 | // Host command related stuff |
181 | 90 | int32_t check_client(std::string name); | 90 | int32_t check_client(const std::string& name); |
182 | 91 | void kick_user(uint32_t, std::string); | 91 | void kick_user(uint32_t, const std::string&); |
183 | 92 | void split_command_array(const std::string& cmdarray, | 92 | void split_command_array(const std::string& cmdarray, |
184 | 93 | std::string& cmd, | 93 | std::string& cmd, |
185 | 94 | std::string& arg1, | 94 | std::string& arg1, |
186 | 95 | 95 | ||
187 | === modified file 'src/network/internet_gaming.cc' | |||
188 | --- src/network/internet_gaming.cc 2017-06-04 16:01:13 +0000 | |||
189 | +++ src/network/internet_gaming.cc 2017-06-25 21:56:19 +0000 | |||
190 | @@ -803,10 +803,10 @@ | |||
191 | 803 | } | 803 | } |
192 | 804 | 804 | ||
193 | 805 | /// formates a chat message and adds it to the list of chat messages | 805 | /// formates a chat message and adds it to the list of chat messages |
196 | 806 | void InternetGaming::format_and_add_chat(std::string from, | 806 | void InternetGaming::format_and_add_chat(const std::string& from, |
197 | 807 | std::string to, | 807 | const std::string& to, |
198 | 808 | bool system, | 808 | bool system, |
200 | 809 | std::string msg) { | 809 | const std::string& msg) { |
201 | 810 | ChatMessage c; | 810 | ChatMessage c; |
202 | 811 | if (!system && from.empty()) { | 811 | if (!system && from.empty()) { |
203 | 812 | std::string unkown_string = (boost::format("<%s>") % _("unknown")).str(); | 812 | std::string unkown_string = (boost::format("<%s>") % _("unknown")).str(); |
204 | 813 | 813 | ||
205 | === modified file 'src/network/internet_gaming.h' | |||
206 | --- src/network/internet_gaming.h 2017-06-03 05:27:36 +0000 | |||
207 | +++ src/network/internet_gaming.h 2017-06-25 21:56:19 +0000 | |||
208 | @@ -153,7 +153,7 @@ | |||
209 | 153 | bool str2bool(std::string); | 153 | bool str2bool(std::string); |
210 | 154 | std::string bool2str(bool); | 154 | std::string bool2str(bool); |
211 | 155 | 155 | ||
213 | 156 | void format_and_add_chat(std::string from, std::string to, bool system, std::string msg); | 156 | void format_and_add_chat(const std::string& from, const std::string& to, bool system, const std::string& msg); |
214 | 157 | 157 | ||
215 | 158 | /// The connection to the metaserver | 158 | /// The connection to the metaserver |
216 | 159 | std::unique_ptr<NetClient> net; | 159 | std::unique_ptr<NetClient> net; |
217 | 160 | 160 | ||
218 | === modified file 'src/notifications/notifications_impl.h' | |||
219 | --- src/notifications/notifications_impl.h 2017-02-14 18:11:53 +0000 | |||
220 | +++ src/notifications/notifications_impl.h 2017-06-25 21:56:19 +0000 | |||
221 | @@ -35,7 +35,7 @@ | |||
222 | 35 | // Subscribes to a notification type and unsubscribes on destruction. | 35 | // Subscribes to a notification type and unsubscribes on destruction. |
223 | 36 | template <typename T> class Subscriber { | 36 | template <typename T> class Subscriber { |
224 | 37 | public: | 37 | public: |
226 | 38 | Subscriber(uint32_t id, std::function<void(const T&)> callback) : id_(id), callback_(callback) { | 38 | Subscriber(uint32_t id, const std::function<void(const T&)>& callback) : id_(id), callback_(callback) { |
227 | 39 | } | 39 | } |
228 | 40 | 40 | ||
229 | 41 | ~Subscriber(); | 41 | ~Subscriber(); |
230 | 42 | 42 | ||
231 | === modified file 'src/wlapplication.h' | |||
232 | --- src/wlapplication.h 2017-01-25 18:55:59 +0000 | |||
233 | +++ src/wlapplication.h 2017-06-25 21:56:19 +0000 | |||
234 | @@ -46,7 +46,7 @@ | |||
235 | 46 | struct ParameterError : public std::runtime_error { | 46 | struct ParameterError : public std::runtime_error { |
236 | 47 | explicit ParameterError() : std::runtime_error("") { | 47 | explicit ParameterError() : std::runtime_error("") { |
237 | 48 | } | 48 | } |
239 | 49 | explicit ParameterError(std::string text) : std::runtime_error(text) { | 49 | explicit ParameterError(const std::string& text) : std::runtime_error(text) { |
240 | 50 | } | 50 | } |
241 | 51 | }; | 51 | }; |
242 | 52 | 52 | ||
243 | 53 | 53 | ||
244 | === modified file 'src/wui/game_debug_ui.cc' | |||
245 | --- src/wui/game_debug_ui.cc 2017-02-23 19:38:51 +0000 | |||
246 | +++ src/wui/game_debug_ui.cc 2017-06-25 21:56:19 +0000 | |||
247 | @@ -47,7 +47,7 @@ | |||
248 | 47 | MapObjectDebugPanel(UI::Panel& parent, const Widelands::EditorGameBase&, Widelands::MapObject&); | 47 | MapObjectDebugPanel(UI::Panel& parent, const Widelands::EditorGameBase&, Widelands::MapObject&); |
249 | 48 | ~MapObjectDebugPanel(); | 48 | ~MapObjectDebugPanel(); |
250 | 49 | 49 | ||
252 | 50 | void log(std::string str) override; | 50 | void log(const std::string& str) override; |
253 | 51 | 51 | ||
254 | 52 | private: | 52 | private: |
255 | 53 | const Widelands::EditorGameBase& egbase_; | 53 | const Widelands::EditorGameBase& egbase_; |
256 | @@ -85,7 +85,7 @@ | |||
257 | 85 | Append the string to the log textarea. | 85 | Append the string to the log textarea. |
258 | 86 | =============== | 86 | =============== |
259 | 87 | */ | 87 | */ |
261 | 88 | void MapObjectDebugPanel::log(std::string str) { | 88 | void MapObjectDebugPanel::log(const std::string& str) { |
262 | 89 | log_.set_text((log_.get_text() + str).c_str()); | 89 | log_.set_text((log_.get_text() + str).c_str()); |
263 | 90 | } | 90 | } |
264 | 91 | 91 | ||
265 | 92 | 92 | ||
266 | === modified file 'src/wui/game_main_menu_save_game.cc' | |||
267 | --- src/wui/game_main_menu_save_game.cc 2017-02-26 12:16:09 +0000 | |||
268 | +++ src/wui/game_main_menu_save_game.cc 2017-06-25 21:56:19 +0000 | |||
269 | @@ -197,7 +197,7 @@ | |||
270 | 197 | edit_box_changed(); | 197 | edit_box_changed(); |
271 | 198 | } | 198 | } |
272 | 199 | 199 | ||
274 | 200 | void GameMainMenuSaveGame::select_by_name(std::string name) { | 200 | void GameMainMenuSaveGame::select_by_name(const std::string& name) { |
275 | 201 | for (uint32_t idx = 0; idx < ls_.size(); idx++) { | 201 | for (uint32_t idx = 0; idx < ls_.size(); idx++) { |
276 | 202 | const std::string val = ls_[idx]; | 202 | const std::string val = ls_[idx]; |
277 | 203 | if (name == val) { | 203 | if (name == val) { |
278 | 204 | 204 | ||
279 | === modified file 'src/wui/game_main_menu_save_game.h' | |||
280 | --- src/wui/game_main_menu_save_game.h 2017-01-25 18:55:59 +0000 | |||
281 | +++ src/wui/game_main_menu_save_game.h 2017-06-25 21:56:19 +0000 | |||
282 | @@ -36,7 +36,7 @@ | |||
283 | 36 | GameMainMenuSaveGame(InteractiveGameBase&, UI::UniqueWindow::Registry& registry); | 36 | GameMainMenuSaveGame(InteractiveGameBase&, UI::UniqueWindow::Registry& registry); |
284 | 37 | 37 | ||
285 | 38 | void fill_list(); | 38 | void fill_list(); |
287 | 39 | void select_by_name(std::string name); | 39 | void select_by_name(const std::string& name); |
288 | 40 | 40 | ||
289 | 41 | protected: | 41 | protected: |
290 | 42 | void die() override; | 42 | void die() override; |
291 | 43 | 43 | ||
292 | === modified file 'src/wui/game_message_menu.cc' | |||
293 | --- src/wui/game_message_menu.cc 2017-06-23 08:33:03 +0000 | |||
294 | +++ src/wui/game_message_menu.cc 2017-06-25 21:56:19 +0000 | |||
295 | @@ -555,7 +555,7 @@ | |||
296 | 555 | /** | 555 | /** |
297 | 556 | * Get the filename for a message category's icon | 556 | * Get the filename for a message category's icon |
298 | 557 | */ | 557 | */ |
300 | 558 | std::string GameMessageMenu::display_message_type_icon(Widelands::Message message) { | 558 | std::string GameMessageMenu::display_message_type_icon(const Widelands::Message& message) { |
301 | 559 | switch (message.message_type_category()) { | 559 | switch (message.message_type_category()) { |
302 | 560 | case Widelands::Message::Type::kGeologists: | 560 | case Widelands::Message::Type::kGeologists: |
303 | 561 | return "images/wui/fieldaction/menu_geologist.png"; | 561 | return "images/wui/fieldaction/menu_geologist.png"; |
304 | 562 | 562 | ||
305 | === modified file 'src/wui/game_message_menu.h' | |||
306 | --- src/wui/game_message_menu.h 2017-01-26 09:28:40 +0000 | |||
307 | +++ src/wui/game_message_menu.h 2017-06-25 21:56:19 +0000 | |||
308 | @@ -67,7 +67,7 @@ | |||
309 | 67 | void filter_messages(Widelands::Message::Type); | 67 | void filter_messages(Widelands::Message::Type); |
310 | 68 | void toggle_filter_messages_button(UI::Button&, Widelands::Message::Type); | 68 | void toggle_filter_messages_button(UI::Button&, Widelands::Message::Type); |
311 | 69 | void set_filter_messages_tooltips(); | 69 | void set_filter_messages_tooltips(); |
313 | 70 | std::string display_message_type_icon(Widelands::Message); | 70 | std::string display_message_type_icon(const Widelands::Message&); |
314 | 71 | void update_record(UI::Table<uintptr_t>::EntryRecord& er, const Widelands::Message&); | 71 | void update_record(UI::Table<uintptr_t>::EntryRecord& er, const Widelands::Message&); |
315 | 72 | void update_archive_button_tooltip(); | 72 | void update_archive_button_tooltip(); |
316 | 73 | 73 |
Thanks for the review - I have reverted those changes.