Merge lp:~widelands-dev/widelands/codecheck into lp:widelands
- codecheck
- Merge into trunk
Status: | Merged |
---|---|
Merged at revision: | 8398 |
Proposed branch: | lp:~widelands-dev/widelands/codecheck |
Merge into: | lp:widelands |
Diff against target: |
536 lines (+113/-108) 16 files modified
.travis.sh (+16/-1) cmake/codecheck/rules/camel_case_for_classes (+44/-28) cmake/codecheck/rules/missing_space_starting_comment (+26/-1) cmake/codecheck/rules/upcast_without_macro (+0/-32) cmake/codecheck/run_tests.py (+5/-4) data/scripting/richtext.lua (+13/-1) doc/sphinx/source/conf.py (+1/-16) doc/sphinx/source/lua_tribes_workers.rst.org (+0/-1) src/build_info.h (+3/-3) src/io/filesystem/filesystem.h (+1/-1) src/logic/game.cc (+0/-1) src/logic/playercommand.h (+0/-1) src/profile/profile.cc (+1/-1) src/profile/profile.h (+2/-4) src/ui_basic/fullscreen_window.h (+1/-1) src/ui_basic/slider.cc (+0/-12) |
To merge this branch: | bzr merge lp:~widelands-dev/widelands/codecheck |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
GunChleoc | Approve | ||
Review via email: mp+326647@code.launchpad.net |
Commit message
Test more on travis
- Enable building documentation with warnings as errors on travis.
- Enable running running the test suite of our lints on travis.
- Remove dynamic_cast<> lint - I no longer am a fan of upcast().
- Fix test suite & docs errors.
- Use mathjax for latex in docs instead of imgmath.
Description of the change
SirVer (sirver) wrote : | # |
bunnybot (widelandsofficial) wrote : | # |
Continuous integration builds have changed state:
Travis build 2416. State: failed. Details: https:/
Appveyor build 2243. State: success. Details: https:/
SirVer (sirver) wrote : | # |
Okay, this is ready for review now.
Hans Joachim Desserud (hjd) : | # |
Hans Joachim Desserud (hjd) wrote : | # |
Nice intiative :)
Btw, I experimented a bit with cppcheck here the other day. We don't need to decide it in this merge proposal, but that might be something to consider to get more checks run at build time. Now, the full report with all checks enabled takes hours, so that's an obvious no-go. However, the default set (don't know how minimal this is) runs through the source code in 20-25 seconds on my laptop:
$ time cppcheck --verbose --quiet -i src/third_party/ src/
[src/editor/
[src/ui_
[src/wui/
real 0m23,087s
user 0m22,848s
sys 0m0,052s
Remove --quiet to see more details on what it processes. Also note that I was able to ignore issues in third_party modules, something I also tried (but failed to get working) with the full run in utils/create_
As mentioned above I don't know how much this actually checks, though I suppose there should be a list list of which ones are enabled by default. It is also possible to enable additional checks one by one, but the more we add the more the run time is going to increase. Lastly (and a bit related) to the question below is whether this would fail the build or not. If someone needs to read the logs to discover new issues we might just run a check every once in a while instead of each and every build. Thoughts?
bunnybot (widelandsofficial) wrote : | # |
Continuous integration builds have changed state:
Travis build 2424. State: passed. Details: https:/
Appveyor build 2251. State: success. Details: https:/
SirVer (sirver) wrote : | # |
> Nice intiative :)
Thanks, but this also scratches two concrete itches I had:
1) I added a new lint in another branch and found out that you cannot reliably run the lint tests anymore because some fail.
2) Errors in the docs trigger an email per hour that ends up in my inbox. There are currently errors in the docs and I'd like the email flood to stop.
cppcheck is orthogonal to these things - but I agree that it would be useful.
And yes, errors in the docs and in the lint testsuite will now break the build.
kaputtnik (franku) wrote : | # |
> - Use mathjax for latex in docs instead of imgmath.
We may need to adjust the website code to get pretty output for formulas then. See the image with current (above) and after the switch to mathjax (bottom) for a comparison: http://
kaputtnik (franku) wrote : | # |
I've made a website-branch to fix displaying of formulas when switching to mathjax:
https:/
This works fine except for the coloring of formulas. As far i remember i added the coloring for better contrast, but my test with the above website-branch shows good contrast for the formulas. So i don't know if we want the coloring anymore. If not you could remove the last lines in doc/sphinx/
GunChleoc (gunchleoc) wrote : | # |
cppcheck would be nice, but only without failing the builds - the 3 memory leaks cited above are false positives. We'd have to completely redesign the memory handling in the Panel class to get rid of those warnings. Since it has proven to work fine across many years, I am very reluctant to invest development time into that one, because we have more important fish to fry.
I would love to get the full cppcheck as clean as reasonably possible though, because there is good potential for catching some bugs there.
GunChleoc (gunchleoc) wrote : | # |
2 nits:
In cmake/codecheck
"Use CapitalLetterWi
-> "Use CapitalLetterWi
src/build_info.h
/// \return the build id which is automagically created from the checkout's
-> checkouts (plural, not genitive)
SirVer (sirver) wrote : | # |
> I've made a website-branch to fix displaying of formulas when switching to mathjax:
> https:/
Thanks! I think mathjax is a better solution for typesetting formulas (I switched my personal blog also from images to mathjax). It transfers better to mobile and allows for better customizations by the client, i.e. the users viewing the page. It is also possible to decipher for see-impaired users.
> This works fine except for the coloring of formulas. As far i remember i added the coloring for better contrast, but my test with the above website-branch shows good contrast for the formulas. So i don't know if we want the coloring anymore. If not you could remove the last lines in doc/sphinx/
I removed the lines.
> -> checkouts (plural, not genitive)
I actually think this should be the genitive. But I just removed the word "revision number or the VERSION file."
GunChleoc (gunchleoc) wrote : | # |
You're right, I overlooked that the comment continues in the following line.
@bunnybot merge
Preview Diff
1 | === modified file '.travis.sh' |
2 | --- .travis.sh 2017-06-27 16:45:47 +0000 |
3 | +++ .travis.sh 2017-07-04 19:18:17 +0000 |
4 | @@ -34,6 +34,7 @@ |
5 | libsdl2-image-dev \ |
6 | libsdl2-mixer-dev \ |
7 | libsdl2-ttf-dev \ |
8 | + python-pip \ |
9 | zlib1g-dev \ |
10 | ; do sleep 10; done |
11 | |
12 | @@ -42,8 +43,22 @@ |
13 | cd build |
14 | cmake .. -DCMAKE_BUILD_TYPE:STRING="$BUILD_TYPE" |
15 | |
16 | -# Any codecheck warning is an error in Debug builds. Keep the codebase clean!! |
17 | if [ "$BUILD_TYPE" == "Debug" ]; then |
18 | + |
19 | + # Build the documentation. Any warning is an error. |
20 | + sudo pip install sphinx |
21 | + pushd ../doc/sphinx |
22 | + mkdir source/_static |
23 | + ./extract_rst.py |
24 | + sphinx-build -W -b json -d build/doctrees source build/json |
25 | + popd |
26 | + |
27 | + # Run the codecheck test suite. |
28 | + pushd ../cmake/codecheck |
29 | + ./run_tests.py |
30 | + popd |
31 | + |
32 | + # Any codecheck warning is an error in Debug builds. Keep the codebase clean!! |
33 | # Suppress color output. |
34 | TERM=dumb make -j1 codecheck 2>&1 | tee codecheck.out |
35 | if grep '^[/_.a-zA-Z]\+:[0-9]\+:' codecheck.out; then |
36 | |
37 | === modified file 'cmake/codecheck/rules/camel_case_for_classes' |
38 | --- cmake/codecheck/rules/camel_case_for_classes 2014-09-18 15:53:08 +0000 |
39 | +++ cmake/codecheck/rules/camel_case_for_classes 2017-07-04 19:18:17 +0000 |
40 | @@ -4,39 +4,55 @@ |
41 | |
42 | strip_comments_and_strings = True |
43 | |
44 | + |
45 | def evaluate_matches(lines, fn): |
46 | - errors = [] |
47 | - |
48 | - for lineno, line in enumerate(lines): |
49 | - |
50 | - # Exception for Microsoft fix in src/network/network_system.h |
51 | - if line.count("in_port_t = uint16_t") or line.count("in_addr_t = uint32_t"): |
52 | - continue |
53 | - |
54 | - if re.match("(^\s*((class|struct)\s+((\S+_)|([a-z]\S+)).*{)|((enum)\s+((\S+_)|(([abd-z])|(c(?!lass))\S+)).*{)|((using)\s+((\S+_)|([a-z]\S+)).*=).*$)", line): |
55 | - |
56 | - errors.append((fn, lineno+1, "Use CapitalLetterWithCamelCase when naming an enum class, struct, or \"using\".")) |
57 | - |
58 | - return errors |
59 | + errors = [] |
60 | + |
61 | + for lineno, line in enumerate(lines): |
62 | + |
63 | + # Exception for Microsoft fix in src/network/network_system.h |
64 | + if line.count('in_port_t = uint16_t') or line.count('in_addr_t = uint32_t'): |
65 | + continue |
66 | + |
67 | + words = line.strip().split() |
68 | + if (len(words) < 2 or words[0] not in ['class', 'struct', 'enum', 'using'] |
69 | + or words[1] == '{'): |
70 | + continue |
71 | + if words[0] == 'using' and words[1] == 'namespace' or words[1].startswith('std::'): |
72 | + continue |
73 | + if words[0] == 'enum': |
74 | + if words[1] == 'class': |
75 | + words.pop(1) |
76 | + if len(words) < 2: |
77 | + continue |
78 | + if words[0] in ['class', 'struct', 'enum'] and words[-1] != '{': |
79 | + continue |
80 | + if re.match(r"([A-Z][a-z0-9]*)+", words[1]): |
81 | + continue |
82 | + errors.append( |
83 | + (fn, lineno + 1, |
84 | + "Use CapitalLetterWithCamelCase when naming an enum class, class, struct, or \"using\".")) |
85 | + |
86 | + return errors |
87 | # /end evaluate_matches |
88 | |
89 | forbidden = [ |
90 | - "class my_class", |
91 | - "class myClass", |
92 | - "struct my_struct", |
93 | - "struct myStruct", |
94 | - "using my_typedef", |
95 | - "using myTypedef", |
96 | - "enum class my_enum", |
97 | - "enum class myEnum" |
98 | - "enum my_enum", |
99 | - "enum myEnum" |
100 | + 'class my_class {', |
101 | + 'class myClass {', |
102 | + 'struct my_struct {', |
103 | + 'struct myStruct {', |
104 | + 'using my_typedef {', |
105 | + 'using myTypedef {', |
106 | + 'enum class my_enum {', |
107 | + 'enum class myEnum {' |
108 | + 'enum my_enum {', |
109 | + 'enum myEnum {' |
110 | ] |
111 | |
112 | allowed = [ |
113 | - "class MyClass", |
114 | - "struct MyStruct", |
115 | - "using MyTypedef", |
116 | - "enum class MyEnum", |
117 | - "enum MyEnum" |
118 | + 'class MyClass {', |
119 | + 'struct MyStruct {', |
120 | + 'using MyTypedef {', |
121 | + 'enum class MyEnum {', |
122 | + 'enum MyEnum {' |
123 | ] |
124 | |
125 | === modified file 'cmake/codecheck/rules/missing_space_starting_comment' |
126 | --- cmake/codecheck/rules/missing_space_starting_comment 2016-02-18 18:22:10 +0000 |
127 | +++ cmake/codecheck/rules/missing_space_starting_comment 2017-07-04 19:18:17 +0000 |
128 | @@ -5,11 +5,36 @@ |
129 | Comments should all start with a blank space |
130 | """ |
131 | |
132 | -error_msg = "Comments need to start with a space." |
133 | |
134 | strip_comments_and_strings = False |
135 | regexp = r"""((^|\s)//[^\s/<!])|((^|\s)//<[^\s])|((^|\s)//!<[^\s])""" |
136 | |
137 | +def is_space(s, index): |
138 | + if index >= len(s): |
139 | + return True |
140 | + return s[index] == " " |
141 | + |
142 | +def evaluate_matches(lines, fn): |
143 | + errors = [] |
144 | + for lineno, line in enumerate(lines): |
145 | + line = line.strip() |
146 | + if not line.startswith('//'): |
147 | + continue |
148 | + if line.startswith('///!<') and is_space(line, 5): |
149 | + continue |
150 | + if line.startswith('//!<') and is_space(line, 4): |
151 | + continue |
152 | + if line.startswith('///<') and is_space(line, 4): |
153 | + continue |
154 | + if line.startswith('///') and is_space(line, 3): |
155 | + continue |
156 | + if line.startswith('//<') and is_space(line, 3): |
157 | + continue |
158 | + if line.startswith('//') and is_space(line, 2): |
159 | + continue |
160 | + errors.append((fn, lineno+1, "Comments need to start with a space.")) |
161 | + return errors |
162 | + |
163 | |
164 | forbidden = [ |
165 | '//spaceless comment', |
166 | |
167 | === removed file 'cmake/codecheck/rules/upcast_without_macro' |
168 | --- cmake/codecheck/rules/upcast_without_macro 2016-01-30 19:08:48 +0000 |
169 | +++ cmake/codecheck/rules/upcast_without_macro 1970-01-01 00:00:00 +0000 |
170 | @@ -1,32 +0,0 @@ |
171 | -#!/usr/bin/python |
172 | - |
173 | -""" |
174 | -This catches upcasts like this: Some_Type * const an_identifier = |
175 | -dynamic_cast<Some_Type *>(source) This is unnecessarily verbose and should be |
176 | -abbreviated with the upcast macro: upcast(Some_Type, an_identifier, source) |
177 | -""" |
178 | - |
179 | -regexp=r"""(^(<?!#define)\s*|[^:][^_a-zA-Z0-9]|:[^: ]) *(([_a-zA-Z][_a-zA-Z0-9]* *::)* *[_a-zA-Z][_a-zA-Z0-9]*(( +const)? *\*)*) *(const *)?\* *const +[_a-zA-Z][_a-zA-Z0-9]* *= *dynamic_cast *< *\2 *(const *)?\* *>""" |
180 | - |
181 | -error_msg = "Your upcast is ugly. Use upcast() macro!" |
182 | - |
183 | -forbidden = [ |
184 | - ' B_t * const hej = dynamic_cast<B_t *>(du);', |
185 | - 'if (B_t const * const hej = dynamic_cast<B_t *>(du)) {', |
186 | - 'B_t const*const hej=dynamic_cast < B_t* >(du)) {', |
187 | - 'const B_t *const hej=dynamic_cast<B_t*>', |
188 | - 'MN:B_t *const hej=dynamic_cast<B_t*>', |
189 | - 'MN::B_t *const hej=dynamic_cast<MN::B_t*>', |
190 | - ' B_t const * const hej=dynamic_cast<B_t const*>', |
191 | - 'B_t const * const hej=dynamic_cast<B_t const*>', |
192 | -] |
193 | - |
194 | - |
195 | -allowed = [ |
196 | - 'Some_Type ha = dynamic_cast<Some_Type>', |
197 | - 'Some_Type ha = dynamic_cast<Some_Typ>', |
198 | - 'const B_t * hej = dymamic_cast<B_t *>', |
199 | - 'MN::B_t *const hej=dynamic_cast<B_t*>', |
200 | -] |
201 | - |
202 | - |
203 | |
204 | === modified file 'cmake/codecheck/run_tests.py' |
205 | --- cmake/codecheck/run_tests.py 2012-06-08 22:19:16 +0000 |
206 | +++ cmake/codecheck/run_tests.py 2017-07-04 19:18:17 +0000 |
207 | @@ -2,6 +2,7 @@ |
208 | # encoding: utf-8 |
209 | # |
210 | |
211 | +import sys |
212 | import unittest |
213 | |
214 | from CodeCheck import CodeChecker, Preprocessor |
215 | @@ -53,7 +54,7 @@ |
216 | unittest.TestCase.__init__(self) |
217 | self.before = before |
218 | self.after = after |
219 | - |
220 | + |
221 | def runTest(self): |
222 | preprocessor = Preprocessor() |
223 | after = preprocessor.get_preprocessed_data("test", self.before, True, False) |
224 | @@ -61,7 +62,7 @@ |
225 | "Stripping comments from %r failed. Expected %r, got %r" |
226 | % (self.before, self.after, after) |
227 | ) |
228 | - |
229 | + |
230 | comment_tests = [ |
231 | # Let's get the basics right. |
232 | ("a b c", |
233 | @@ -97,5 +98,5 @@ |
234 | |
235 | for before, after in comment_tests: |
236 | suite.addTest(CommentsTest(before, after.splitlines(True))) |
237 | - |
238 | - unittest.TextTestRunner(verbosity=1).run(suite) |
239 | + success = unittest.TextTestRunner(verbosity=1).run(suite).wasSuccessful() |
240 | + sys.exit(0 if success else 1) |
241 | |
242 | === modified file 'data/scripting/richtext.lua' |
243 | --- data/scripting/richtext.lua 2017-05-12 14:11:11 +0000 |
244 | +++ data/scripting/richtext.lua 2017-07-04 19:18:17 +0000 |
245 | @@ -12,6 +12,7 @@ |
246 | |
247 | -- RST |
248 | -- .. function:: localize_list(items, listtype, former_textdomain) |
249 | +-- :noindex: |
250 | -- |
251 | -- Turns an array of string items into a localized string list with |
252 | -- appropriate concatenation. |
253 | @@ -53,6 +54,7 @@ |
254 | |
255 | -- RST |
256 | -- .. function:: rt(text_or_attributes[, text = nil]) |
257 | +-- :noindex: |
258 | -- |
259 | -- Wraps a block of text into Lua rich text. |
260 | -- Only call this once for the whole text that gets sent to the backend. |
261 | @@ -83,6 +85,7 @@ |
262 | |
263 | -- RST |
264 | -- .. function:: img(src[, attributes = nil]) |
265 | +-- :noindex: |
266 | -- |
267 | -- Turns an image src path into an image tag for richtext. |
268 | -- |
269 | @@ -113,6 +116,7 @@ |
270 | |
271 | -- RST |
272 | -- .. function:: h1(text_or_color[, text = nil]) |
273 | +-- :noindex: |
274 | -- |
275 | -- Returns a paragraph formatted as a big heading with a small gap after it. |
276 | -- The mnemonic comes from HTML. |
277 | @@ -128,6 +132,7 @@ |
278 | |
279 | -- RST |
280 | -- .. function:: h2(text) |
281 | +-- :noindex: |
282 | -- |
283 | -- Like :func:`h1` but smaller. |
284 | -- |
285 | @@ -138,6 +143,7 @@ |
286 | |
287 | -- RST |
288 | -- .. function:: h3(text) |
289 | +-- :noindex: |
290 | -- |
291 | -- Like :func:`h2` but smaller. |
292 | -- |
293 | @@ -149,6 +155,7 @@ |
294 | |
295 | -- RST |
296 | -- .. function:: h4(text) |
297 | +-- :noindex: |
298 | -- |
299 | -- Like :func:`h3` but smaller. |
300 | -- |
301 | @@ -160,6 +167,7 @@ |
302 | |
303 | -- RST |
304 | -- .. function:: p(text_or_attributes[, text = nil]) |
305 | +-- :noindex: |
306 | -- |
307 | -- Returns one paragraph with text followed by a small vertical gap. Options |
308 | -- can be given as first argument similar to :func:`rt`. |
309 | @@ -177,7 +185,7 @@ |
310 | |
311 | |
312 | -- RST |
313 | --- .. function:: p(text_or_attributes[, text = nil]) |
314 | +-- .. function:: p_font(text_or_attributes[, text = nil]) |
315 | -- |
316 | -- Returns one paragraph with text followed by a small vertical gap. Options |
317 | -- can be given as first argument similar to :func:`rt`. |
318 | @@ -275,6 +283,7 @@ |
319 | |
320 | -- RST |
321 | -- .. function:: dl(dt, dd) |
322 | +-- :noindex: |
323 | -- |
324 | -- This function imitates a HTML description list |
325 | -- :arg dt: "description term", will be rendered in bold. |
326 | @@ -337,6 +346,7 @@ |
327 | |
328 | -- RST |
329 | -- .. function:: a(link) |
330 | +-- :noindex: |
331 | -- |
332 | -- This function imitates a HTML link. We can't do real links yet, so the text just gets underlines. |
333 | -- :arg link: the text to format |
334 | @@ -349,6 +359,7 @@ |
335 | |
336 | -- RST |
337 | -- .. function:: b(link) |
338 | +-- :noindex: |
339 | -- |
340 | -- This makes the text bold. |
341 | -- :arg link: the text to format |
342 | @@ -361,6 +372,7 @@ |
343 | |
344 | -- RST |
345 | -- .. function:: i(link) |
346 | +-- :noindex: |
347 | -- |
348 | -- This makes the text italic. |
349 | -- :arg link: the text to format |
350 | |
351 | === modified file 'doc/sphinx/source/conf.py' |
352 | --- doc/sphinx/source/conf.py 2016-08-07 08:27:55 +0000 |
353 | +++ doc/sphinx/source/conf.py 2017-07-04 19:18:17 +0000 |
354 | @@ -25,7 +25,7 @@ |
355 | |
356 | # Add any Sphinx extension module names here, as strings. They can be extensions |
357 | # coming with Sphinx (named 'sphinx.ext.*') or your custom ones. |
358 | -extensions = ['sphinx.ext.imgmath'] |
359 | +extensions = ['sphinx.ext.mathjax'] |
360 | |
361 | # Add any paths that contain templates here, relative to this directory. |
362 | templates_path = ['_templates'] |
363 | @@ -231,18 +231,3 @@ |
364 | u'The Widelands Development Team', 'Widelands', 'One line description of project.', |
365 | 'Miscellaneous'), |
366 | ] |
367 | - |
368 | -# Documents to append as an appendix to all manuals. |
369 | -#texinfo_appendices = [] |
370 | - |
371 | -# If false, no module index is generated. |
372 | -#texinfo_domain_indices = True |
373 | - |
374 | -# How to display URL addresses: 'footnote', 'no', or 'inline'. |
375 | -#texinfo_show_urls = 'footnote' |
376 | - |
377 | -# Options for displaying formulas |
378 | -# http://www.nongnu.org/dvipng/dvipng_4.html#Command_002dline-options |
379 | -# Use one of 'dvispnames' or 'svgnames' for coloring from |
380 | -# http://mirrors.ctan.org/macros/latex/contrib/xcolor/xcolor.pdf |
381 | -imgmath_dvipng_args = ['-gamma', '1.5', '-D', '110', '-bg', 'Transparent', '-fg', 'Cerulean'] |
382 | |
383 | === modified file 'doc/sphinx/source/lua_tribes_workers.rst.org' |
384 | --- doc/sphinx/source/lua_tribes_workers.rst.org 2017-04-21 18:40:38 +0000 |
385 | +++ doc/sphinx/source/lua_tribes_workers.rst.org 2017-07-04 19:18:17 +0000 |
386 | @@ -73,7 +73,6 @@ |
387 | programs that define which type of space or resource the worker has to find |
388 | on the map in order to do his work, and what that work is, including any |
389 | animations and sounds played. |
390 | - See :doc:`worker_program`. |
391 | |
392 | TODO(GunChleoc): create Worker Program Reference |
393 | |
394 | |
395 | === modified file 'src/build_info.h' |
396 | --- src/build_info.h 2017-04-22 08:02:21 +0000 |
397 | +++ src/build_info.h 2017-07-04 19:18:17 +0000 |
398 | @@ -27,11 +27,11 @@ |
399 | // also need updating. |
400 | constexpr uint16_t kWidelandsCopyrightEnd = 2017; |
401 | |
402 | -///\return the build id which is automagically created from the checkout's |
403 | -/// revision number or the VERSION file |
404 | +/// \return the build id which is automagically created from the revision number |
405 | +/// or the VERSION file |
406 | const std::string& build_id(); |
407 | |
408 | -///\return the build type, which is set during compile time (either manually |
409 | +/// \return the build type, which is set during compile time (either manually |
410 | /// or to a default value) |
411 | const std::string& build_type(); |
412 | |
413 | |
414 | === modified file 'src/io/filesystem/filesystem.h' |
415 | --- src/io/filesystem/filesystem.h 2017-01-25 18:55:59 +0000 |
416 | +++ src/io/filesystem/filesystem.h 2017-07-04 19:18:17 +0000 |
417 | @@ -135,7 +135,7 @@ |
418 | FileSystem(); |
419 | |
420 | /// How to address the fs' topmost component (e.g. "" on Unix, "D:" on win32) |
421 | - ///\warning This is should \e not contain filesep! |
422 | + /// \warning This is should \e not contain filesep! |
423 | std::string root_; |
424 | |
425 | #ifdef _WIN32 |
426 | |
427 | === modified file 'src/logic/game.cc' |
428 | --- src/logic/game.cc 2017-06-25 08:20:25 +0000 |
429 | +++ src/logic/game.cc 2017-07-04 19:18:17 +0000 |
430 | @@ -720,7 +720,6 @@ |
431 | *new CmdChangeSoldierCapacity(get_gametime(), b.owner().player_number(), b, val)); |
432 | } |
433 | |
434 | -/////////////////////// TESTING STUFF |
435 | void Game::send_player_enemyflagaction(const Flag& flag, |
436 | PlayerNumber const who_attacks, |
437 | uint32_t const num_soldiers) { |
438 | |
439 | === modified file 'src/logic/playercommand.h' |
440 | --- src/logic/playercommand.h 2017-06-24 08:47:46 +0000 |
441 | +++ src/logic/playercommand.h 2017-07-04 19:18:17 +0000 |
442 | @@ -729,7 +729,6 @@ |
443 | int32_t val; |
444 | }; |
445 | |
446 | -/////////////TESTING STUFF |
447 | struct CmdEnemyFlagAction : public PlayerCommand { |
448 | CmdEnemyFlagAction() : PlayerCommand(), serial(0), number(0) { |
449 | } // For savegame loading |
450 | |
451 | === modified file 'src/profile/profile.cc' |
452 | --- src/profile/profile.cc 2017-01-25 18:55:59 +0000 |
453 | +++ src/profile/profile.cc 2017-07-04 19:18:17 +0000 |
454 | @@ -65,7 +65,7 @@ |
455 | |
456 | Profile g_options(Profile::err_log); |
457 | |
458 | -Section::Value::Value(const string& nname, const char* const nval) : used_(false), name_(nname) { |
459 | +Section::Value::Value(const std::string& nname, const char* const nval) : used_(false), name_(nname) { |
460 | set_string(nval); |
461 | } |
462 | |
463 | |
464 | === modified file 'src/profile/profile.h' |
465 | --- src/profile/profile.h 2017-06-25 19:12:30 +0000 |
466 | +++ src/profile/profile.h 2017-07-04 19:18:17 +0000 |
467 | @@ -57,9 +57,7 @@ |
468 | friend class Profile; |
469 | |
470 | struct Value { |
471 | - using string = std::string; |
472 | - |
473 | - Value(const string& name, const char* const value); |
474 | + Value(const std::string& name, const char* const value); |
475 | Value(const Value&); |
476 | Value(Value&& other); |
477 | |
478 | @@ -93,7 +91,7 @@ |
479 | |
480 | private: |
481 | bool used_; |
482 | - string name_; |
483 | + std::string name_; |
484 | std::unique_ptr<char[]> value_; |
485 | |
486 | Value() = default; |
487 | |
488 | === modified file 'src/ui_basic/fullscreen_window.h' |
489 | --- src/ui_basic/fullscreen_window.h 2017-02-23 19:38:51 +0000 |
490 | +++ src/ui_basic/fullscreen_window.h 2017-07-04 19:18:17 +0000 |
491 | @@ -70,7 +70,7 @@ |
492 | FullscreenWindow(); |
493 | virtual ~FullscreenWindow(); |
494 | |
495 | - ///\return the size for texts fitting to current resolution |
496 | + /// \return the size for texts fitting to current resolution |
497 | int fs_small(); |
498 | int fs_big(); |
499 | |
500 | |
501 | === modified file 'src/ui_basic/slider.cc' |
502 | --- src/ui_basic/slider.cc 2017-05-21 18:15:17 +0000 |
503 | +++ src/ui_basic/slider.cc 2017-07-04 19:18:17 +0000 |
504 | @@ -348,10 +348,6 @@ |
505 | Slider::layout(); |
506 | } |
507 | |
508 | -//////////////////////////////////////////////////////////////////////////////// |
509 | -// HORIZONTAL // |
510 | -//////////////////////////////////////////////////////////////////////////////// |
511 | - |
512 | /** |
513 | * \brief Redraw the slide bar. The horizontal bar is painted. |
514 | * |
515 | @@ -422,10 +418,6 @@ |
516 | Slider::layout(); |
517 | } |
518 | |
519 | -//////////////////////////////////////////////////////////////////////////////// |
520 | -// VERTICAL // |
521 | -//////////////////////////////////////////////////////////////////////////////// |
522 | - |
523 | /** |
524 | * \brief Redraw the slide bar. The vertical bar is painted. |
525 | * |
526 | @@ -487,10 +479,6 @@ |
527 | return false; |
528 | } |
529 | |
530 | -//////////////////////////////////////////////////////////////////////////////// |
531 | -// DISCRETE // |
532 | -//////////////////////////////////////////////////////////////////////////////// |
533 | - |
534 | DiscreteSlider::DiscreteSlider(Panel* const parent, |
535 | const int32_t x, |
536 | const int32_t y, |
This is not yet for review. I want to see this fail on travis before fixing the errors.