Merge lp:~ab-tools/widelands/msvs2010-compileerrors into lp:widelands

Proposed by Andreas Breitschopp
Status: Merged
Merged at revision: 6400
Proposed branch: lp:~ab-tools/widelands/msvs2010-compileerrors
Merge into: lp:widelands
Diff against target: 52 lines (+5/-5)
3 files modified
src/io/filesystem/filesystem.cc (+1/-0)
src/logic/world.cc (+3/-3)
src/wui/overlay_manager.cc (+1/-2)
To merge this branch: bzr merge lp:~ab-tools/widelands/msvs2010-compileerrors
Reviewer Review Type Date Requested Status
Widelands Developers Pending
Review via email: mp+109357@code.launchpad.net

Description of the change

Fixing MSVS 2010 compile errors as discussed here:
http://wl.widelands.org/forum/topic/1064/?page=1#post-8178

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

Some of these fixes are quite strange, but they compile on my system, so I went ahead and merged them. Thanks Andreas!

Revision history for this message
Peter Waller (peter.waller) wrote :

This merge introduces the following codecheck failures:

src/logic/world.cc:862: Multiline conditional should break after conditional. if (a) blah... -> if (a) \n blah
src/logic/world.cc:862: Parenthesis not closed before end of line must be at line begin
src/logic/world.cc:863: Found '{', but only closing tokens are allowed after closing parenthesis with corresponding opening parenthesis on an earlier line

Revision history for this message
Andreas Breitschopp (ab-tools) wrote :

Hello Holger,

you're welcome, thanks for merging!

I guess especially the change regarding "std::swap" looks strange - if somebody is interested why, here is the explanation from Microsoft why "<Overlay_Manager::Registered_Overlays>" is not necessary and also not allowed anymore with the VS 2010 compiler version:
http://connect.microsoft.com/VisualStudio/feedback/details/499152/valid-c-program-using-std-swap-fails-to-compile-in-vc10

Best regards
Andreas

Revision history for this message
Andreas Breitschopp (ab-tools) wrote :

Hello Peter,

I'll look at that today evening why it conplains about the code style at this position.

Best regards
Andreas

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/io/filesystem/filesystem.cc'
2--- src/io/filesystem/filesystem.cc 2012-03-04 22:49:05 +0000
3+++ src/io/filesystem/filesystem.cc 2012-06-08 13:07:23 +0000
4@@ -40,6 +40,7 @@
5 #include <string>
6 #include <vector>
7 #include <list>
8+#include <iterator>
9
10 #ifdef WIN32
11 #include "log.h"
12
13=== modified file 'src/logic/world.cc'
14--- src/logic/world.cc 2012-02-15 21:25:34 +0000
15+++ src/logic/world.cc 2012-06-08 13:07:23 +0000
16@@ -813,7 +813,6 @@
17
18 ==============================================================================
19 */
20-
21 Terrain_Descr::Terrain_Descr
22 (char const * const directory,
23 Section * const s,
24@@ -860,11 +859,12 @@
25 uint32_t i = 0;
26 int32_t cur_res = 0;
27 while (i <= str1.size()) {
28- if (str1[i] == ' ' || str1[i] == ' ' || str1[i] == '\t') {
29+ if (i != str1.size() &&
30+ (str1[i] == ' ' || str1[i] == ' ' || str1[i] == '\t')) {
31 ++i;
32 continue;
33 }
34- if (str1[i] == ',' || i == str1.size()) {
35+ if (i == str1.size() || str1[i] == ',') {
36 const int32_t res = resources->get_index(curres.c_str());;
37 if (res == -1)
38 throw game_data_error
39
40=== modified file 'src/wui/overlay_manager.cc'
41--- src/wui/overlay_manager.cc 2012-02-15 21:25:34 +0000
42+++ src/wui/overlay_manager.cc 2012-06-08 13:07:23 +0000
43@@ -202,8 +202,7 @@
44 if (jt->first == it->first) {
45 // There are several overlays registered for this location.
46 if (jt->second.level < it->second.level) {
47- std::swap<Overlay_Manager::Registered_Overlays>
48- (it->second, jt->second);
49+ std::swap(it->second, jt->second);
50 it = overlay_map.lower_bound(c);
51 } else ++it;
52 } else break; // it is the last element, break this loop.

Subscribers

People subscribed via source and target branches

to status/vote changes: