Merge lp:~widelands-dev/widelands/compiler_warnings into lp:widelands
- compiler_warnings
- Merge into trunk
Status: | Merged |
---|---|
Merged at revision: | 7642 |
Proposed branch: | lp:~widelands-dev/widelands/compiler_warnings |
Merge into: | lp:widelands |
Diff against target: |
880 lines (+96/-98) 28 files modified
src/ai/ai_help_structs.h (+2/-2) src/economy/cmd_call_economy_balance.cc (+1/-1) src/economy/cmd_call_economy_balance.h (+1/-1) src/game_io/game_cmd_queue_packet.cc (+1/-1) src/logic/bob.cc (+2/-2) src/logic/cmd_calculate_statistics.h (+1/-1) src/logic/cmd_delete_message.h (+1/-1) src/logic/cmd_incorporate.h (+1/-1) src/logic/cmd_luacoroutine.h (+1/-1) src/logic/cmd_luascript.h (+1/-1) src/logic/cmd_queue.cc (+2/-5) src/logic/cmd_queue.h (+6/-6) src/logic/constructionsite.cc (+0/-1) src/logic/dismantlesite.cc (+0/-1) src/logic/immovable.cc (+8/-4) src/logic/immovable.h (+1/-1) src/logic/instances.cc (+2/-2) src/logic/instances.h (+10/-11) src/logic/playercommand.cc (+10/-10) src/logic/playercommand.h (+29/-29) src/logic/replay_game_controller.h (+1/-1) src/logic/soldier.cc (+6/-6) src/logic/soldier.h (+2/-2) src/logic/worker.cc (+2/-2) src/network/netclient.cc (+2/-2) src/network/nethost.cc (+1/-1) src/network/network.cc (+1/-1) src/network/network.h (+1/-1) |
To merge this branch: | bzr merge lp:~widelands-dev/widelands/compiler_warnings |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
TiborB | Approve | ||
GunChleoc | Needs Resubmitting | ||
Review via email:
|
Commit message
Description of the change
Fixed compiler warnings.
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
TiborB (tiborb95) wrote : | # |
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
GunChleoc (gunchleoc) wrote : | # |
I will redesign this - the reason that I left them as signed int is that this is the way they are saved. It is better if I change the packets though.
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
GunChleoc (gunchleoc) wrote : | # |
This should be ready for review again. I found a nice article on comparing signed and unsigned values:
http://
So, I made the remaining comparisions safe (where it was not easy or not possible to change the data type).
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
TiborB (tiborb95) wrote : | # |
I believe m_walkstart, m_walkstart, m_combat_walkend and m_combat_walkstart can also be easily changed to uint32_t... have you considered it?
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
GunChleoc (gunchleoc) wrote : | # |
Variables like that are all over the code base, we actually have an open bug for this. It isn't always as easy as it looks though, I tried fixing them in the network code and it stopped working. So, better take this in small bits and pieces - resulting bugs might be hard to track down.
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
TiborB (tiborb95) wrote : | # |
OK, if you tried and it was complicated - good for me..
Preview Diff
1 | === modified file 'src/ai/ai_help_structs.h' | |||
2 | --- src/ai/ai_help_structs.h 2015-11-21 18:25:56 +0000 | |||
3 | +++ src/ai/ai_help_structs.h 2015-11-25 10:54:29 +0000 | |||
4 | @@ -446,8 +446,8 @@ | |||
5 | 446 | 446 | ||
6 | 447 | // used to track amount of wares produced by building | 447 | // used to track amount of wares produced by building |
7 | 448 | uint32_t stocklevel_; | 448 | uint32_t stocklevel_; |
10 | 449 | int32_t stocklevel_time; // time when stocklevel_ was last time recalculated | 449 | uint32_t stocklevel_time; // time when stocklevel_ was last time recalculated |
11 | 450 | int32_t last_dismantle_time_; | 450 | uint32_t last_dismantle_time_; |
12 | 451 | int32_t construction_decision_time_; | 451 | int32_t construction_decision_time_; |
13 | 452 | 452 | ||
14 | 453 | uint32_t unoccupied_count_; | 453 | uint32_t unoccupied_count_; |
15 | 454 | 454 | ||
16 | === modified file 'src/economy/cmd_call_economy_balance.cc' | |||
17 | --- src/economy/cmd_call_economy_balance.cc 2015-10-24 15:42:37 +0000 | |||
18 | +++ src/economy/cmd_call_economy_balance.cc 2015-11-25 10:54:29 +0000 | |||
19 | @@ -31,7 +31,7 @@ | |||
20 | 31 | namespace Widelands { | 31 | namespace Widelands { |
21 | 32 | 32 | ||
22 | 33 | CmdCallEconomyBalance::CmdCallEconomyBalance | 33 | CmdCallEconomyBalance::CmdCallEconomyBalance |
24 | 34 | (int32_t const starttime, Economy * const economy, uint32_t const timerid) | 34 | (uint32_t const starttime, Economy * const economy, uint32_t const timerid) |
25 | 35 | : GameLogicCommand(starttime) | 35 | : GameLogicCommand(starttime) |
26 | 36 | { | 36 | { |
27 | 37 | m_flag = economy->get_arbitrary_flag(); | 37 | m_flag = economy->get_arbitrary_flag(); |
28 | 38 | 38 | ||
29 | === modified file 'src/economy/cmd_call_economy_balance.h' | |||
30 | --- src/economy/cmd_call_economy_balance.h 2014-09-19 12:54:54 +0000 | |||
31 | +++ src/economy/cmd_call_economy_balance.h 2015-11-25 10:54:29 +0000 | |||
32 | @@ -33,7 +33,7 @@ | |||
33 | 33 | struct CmdCallEconomyBalance : public GameLogicCommand { | 33 | struct CmdCallEconomyBalance : public GameLogicCommand { |
34 | 34 | CmdCallEconomyBalance () : GameLogicCommand(0), m_timerid(0) {} ///< for load and save | 34 | CmdCallEconomyBalance () : GameLogicCommand(0), m_timerid(0) {} ///< for load and save |
35 | 35 | 35 | ||
37 | 36 | CmdCallEconomyBalance (int32_t starttime, Economy *, uint32_t timerid); | 36 | CmdCallEconomyBalance (uint32_t starttime, Economy *, uint32_t timerid); |
38 | 37 | 37 | ||
39 | 38 | void execute (Game &) override; | 38 | void execute (Game &) override; |
40 | 39 | 39 | ||
41 | 40 | 40 | ||
42 | === modified file 'src/game_io/game_cmd_queue_packet.cc' | |||
43 | --- src/game_io/game_cmd_queue_packet.cc 2015-10-24 15:42:37 +0000 | |||
44 | +++ src/game_io/game_cmd_queue_packet.cc 2015-11-25 10:54:29 +0000 | |||
45 | @@ -94,7 +94,7 @@ | |||
46 | 94 | // Write all commands | 94 | // Write all commands |
47 | 95 | 95 | ||
48 | 96 | // Find all the items in the current cmdqueue | 96 | // Find all the items in the current cmdqueue |
50 | 97 | int32_t time = game.get_gametime(); | 97 | uint32_t time = game.get_gametime(); |
51 | 98 | size_t nhandled = 0; | 98 | size_t nhandled = 0; |
52 | 99 | 99 | ||
53 | 100 | while (nhandled < cmdq.m_ncmds) { | 100 | while (nhandled < cmdq.m_ncmds) { |
54 | 101 | 101 | ||
55 | === modified file 'src/logic/bob.cc' | |||
56 | --- src/logic/bob.cc 2015-10-25 08:06:00 +0000 | |||
57 | +++ src/logic/bob.cc 2015-11-25 10:54:29 +0000 | |||
58 | @@ -760,7 +760,7 @@ | |||
59 | 760 | 760 | ||
60 | 761 | void Bob::move_update(Game & game, State &) | 761 | void Bob::move_update(Game & game, State &) |
61 | 762 | { | 762 | { |
63 | 763 | if (m_walkend <= game.get_gametime()) { | 763 | if (static_cast<uint32_t>(m_walkend) <= game.get_gametime()) { |
64 | 764 | end_walk(); | 764 | end_walk(); |
65 | 765 | return pop_task(game); | 765 | return pop_task(game); |
66 | 766 | } else | 766 | } else |
67 | @@ -822,7 +822,7 @@ | |||
68 | 822 | spos.y += end.field->get_height() * HEIGHT_FACTOR; | 822 | spos.y += end.field->get_height() * HEIGHT_FACTOR; |
69 | 823 | spos.y -= start.field->get_height() * HEIGHT_FACTOR; | 823 | spos.y -= start.field->get_height() * HEIGHT_FACTOR; |
70 | 824 | 824 | ||
72 | 825 | assert(m_walkstart <= game.get_gametime()); | 825 | assert(static_cast<uint32_t>(m_walkstart) <= game.get_gametime()); |
73 | 826 | assert(m_walkstart < m_walkend); | 826 | assert(m_walkstart < m_walkend); |
74 | 827 | float f = | 827 | float f = |
75 | 828 | static_cast<float>(game.get_gametime() - m_walkstart) | 828 | static_cast<float>(game.get_gametime() - m_walkstart) |
76 | 829 | 829 | ||
77 | === modified file 'src/logic/cmd_calculate_statistics.h' | |||
78 | --- src/logic/cmd_calculate_statistics.h 2015-01-31 16:03:59 +0000 | |||
79 | +++ src/logic/cmd_calculate_statistics.h 2015-11-25 10:54:29 +0000 | |||
80 | @@ -28,7 +28,7 @@ | |||
81 | 28 | 28 | ||
82 | 29 | struct CmdCalculateStatistics : public GameLogicCommand { | 29 | struct CmdCalculateStatistics : public GameLogicCommand { |
83 | 30 | CmdCalculateStatistics() : GameLogicCommand(0) {} // For savegame loading | 30 | CmdCalculateStatistics() : GameLogicCommand(0) {} // For savegame loading |
85 | 31 | CmdCalculateStatistics(int32_t const _duetime) : | 31 | CmdCalculateStatistics(uint32_t const _duetime) : |
86 | 32 | GameLogicCommand(_duetime) {} | 32 | GameLogicCommand(_duetime) {} |
87 | 33 | 33 | ||
88 | 34 | // Write these commands to a file (for savegames) | 34 | // Write these commands to a file (for savegames) |
89 | 35 | 35 | ||
90 | === modified file 'src/logic/cmd_delete_message.h' | |||
91 | --- src/logic/cmd_delete_message.h 2014-09-29 12:37:07 +0000 | |||
92 | +++ src/logic/cmd_delete_message.h 2015-11-25 10:54:29 +0000 | |||
93 | @@ -37,7 +37,7 @@ | |||
94 | 37 | /// the savegame. | 37 | /// the savegame. |
95 | 38 | struct CmdDeleteMessage : public Command { | 38 | struct CmdDeleteMessage : public Command { |
96 | 39 | CmdDeleteMessage | 39 | CmdDeleteMessage |
98 | 40 | (int32_t const t, PlayerNumber const p, MessageId const m) | 40 | (uint32_t const t, PlayerNumber const p, MessageId const m) |
99 | 41 | : Command(t), player(p), message(m) | 41 | : Command(t), player(p), message(m) |
100 | 42 | {} | 42 | {} |
101 | 43 | 43 | ||
102 | 44 | 44 | ||
103 | === modified file 'src/logic/cmd_incorporate.h' | |||
104 | --- src/logic/cmd_incorporate.h 2014-10-03 17:26:18 +0000 | |||
105 | +++ src/logic/cmd_incorporate.h 2015-11-25 10:54:29 +0000 | |||
106 | @@ -27,7 +27,7 @@ | |||
107 | 27 | 27 | ||
108 | 28 | struct CmdIncorporate : public GameLogicCommand { | 28 | struct CmdIncorporate : public GameLogicCommand { |
109 | 29 | CmdIncorporate() : GameLogicCommand(0), worker(nullptr) {} // For savegame loading | 29 | CmdIncorporate() : GameLogicCommand(0), worker(nullptr) {} // For savegame loading |
111 | 30 | CmdIncorporate (int32_t const t, Worker * const w) | 30 | CmdIncorporate (uint32_t const t, Worker * const w) |
112 | 31 | : GameLogicCommand(t), worker(w) | 31 | : GameLogicCommand(t), worker(w) |
113 | 32 | {} | 32 | {} |
114 | 33 | 33 | ||
115 | 34 | 34 | ||
116 | === modified file 'src/logic/cmd_luacoroutine.h' | |||
117 | --- src/logic/cmd_luacoroutine.h 2015-01-31 16:03:59 +0000 | |||
118 | +++ src/logic/cmd_luacoroutine.h 2015-11-25 10:54:29 +0000 | |||
119 | @@ -29,7 +29,7 @@ | |||
120 | 29 | 29 | ||
121 | 30 | struct CmdLuaCoroutine : public GameLogicCommand { | 30 | struct CmdLuaCoroutine : public GameLogicCommand { |
122 | 31 | CmdLuaCoroutine() : GameLogicCommand(0), m_cr(nullptr) {} // For savegame loading | 31 | CmdLuaCoroutine() : GameLogicCommand(0), m_cr(nullptr) {} // For savegame loading |
124 | 32 | CmdLuaCoroutine(int32_t const _duetime, LuaCoroutine * const cr) : | 32 | CmdLuaCoroutine(uint32_t const _duetime, LuaCoroutine * const cr) : |
125 | 33 | GameLogicCommand(_duetime), m_cr(cr) {} | 33 | GameLogicCommand(_duetime), m_cr(cr) {} |
126 | 34 | 34 | ||
127 | 35 | ~CmdLuaCoroutine() { | 35 | ~CmdLuaCoroutine() { |
128 | 36 | 36 | ||
129 | === modified file 'src/logic/cmd_luascript.h' | |||
130 | --- src/logic/cmd_luascript.h 2014-09-19 12:54:54 +0000 | |||
131 | +++ src/logic/cmd_luascript.h 2015-11-25 10:54:29 +0000 | |||
132 | @@ -29,7 +29,7 @@ | |||
133 | 29 | struct CmdLuaScript : public GameLogicCommand { | 29 | struct CmdLuaScript : public GameLogicCommand { |
134 | 30 | CmdLuaScript() : GameLogicCommand(0) {} // For savegame loading | 30 | CmdLuaScript() : GameLogicCommand(0) {} // For savegame loading |
135 | 31 | CmdLuaScript | 31 | CmdLuaScript |
137 | 32 | (int32_t const _duetime, const std::string& script) : | 32 | (uint32_t const _duetime, const std::string& script) : |
138 | 33 | GameLogicCommand(_duetime), script_(script) {} | 33 | GameLogicCommand(_duetime), script_(script) {} |
139 | 34 | 34 | ||
140 | 35 | // Write these commands to a file (for savegames) | 35 | // Write these commands to a file (for savegames) |
141 | 36 | 36 | ||
142 | === modified file 'src/logic/cmd_queue.cc' | |||
143 | --- src/logic/cmd_queue.cc 2015-11-14 15:58:29 +0000 | |||
144 | +++ src/logic/cmd_queue.cc 2015-11-25 10:54:29 +0000 | |||
145 | @@ -98,9 +98,8 @@ | |||
146 | 98 | ++ m_ncmds; | 98 | ++ m_ncmds; |
147 | 99 | } | 99 | } |
148 | 100 | 100 | ||
150 | 101 | int32_t CmdQueue::run_queue(int32_t const interval, uint32_t & game_time_var) { | 101 | void CmdQueue::run_queue(int32_t const interval, uint32_t & game_time_var) { |
151 | 102 | uint32_t const final = game_time_var + interval; | 102 | uint32_t const final = game_time_var + interval; |
152 | 103 | int32_t cnt = 0; | ||
153 | 104 | 103 | ||
154 | 105 | while (game_time_var < final) { | 104 | while (game_time_var < final) { |
155 | 106 | std::priority_queue<CmdItem> & current_cmds = m_cmds[game_time_var % CMD_QUEUE_BUCKET_SIZE]; | 105 | std::priority_queue<CmdItem> & current_cmds = m_cmds[game_time_var % CMD_QUEUE_BUCKET_SIZE]; |
156 | @@ -131,8 +130,6 @@ | |||
157 | 131 | 130 | ||
158 | 132 | assert(final - game_time_var == 0); | 131 | assert(final - game_time_var == 0); |
159 | 133 | game_time_var = final; | 132 | game_time_var = final; |
160 | 134 | |||
161 | 135 | return cnt; | ||
162 | 136 | } | 133 | } |
163 | 137 | 134 | ||
164 | 138 | 135 | ||
165 | @@ -173,7 +170,7 @@ | |||
166 | 173 | uint16_t const packet_version = fr.unsigned_16(); | 170 | uint16_t const packet_version = fr.unsigned_16(); |
167 | 174 | if (packet_version == kCurrentPacketVersion) { | 171 | if (packet_version == kCurrentPacketVersion) { |
168 | 175 | set_duetime(fr.unsigned_32()); | 172 | set_duetime(fr.unsigned_32()); |
170 | 176 | int32_t const gametime = egbase.get_gametime(); | 173 | uint32_t const gametime = egbase.get_gametime(); |
171 | 177 | if (duetime() < gametime) | 174 | if (duetime() < gametime) |
172 | 178 | throw GameDataError | 175 | throw GameDataError |
173 | 179 | ("duetime (%i) < gametime (%i)", duetime(), gametime); | 176 | ("duetime (%i) < gametime (%i)", duetime(), gametime); |
174 | 180 | 177 | ||
175 | === modified file 'src/logic/cmd_queue.h' | |||
176 | --- src/logic/cmd_queue.h 2015-11-14 15:58:29 +0000 | |||
177 | +++ src/logic/cmd_queue.h 2015-11-25 10:54:29 +0000 | |||
178 | @@ -85,17 +85,17 @@ | |||
179 | 85 | * the same for all parallel simulation. | 85 | * the same for all parallel simulation. |
180 | 86 | */ | 86 | */ |
181 | 87 | struct Command { | 87 | struct Command { |
183 | 88 | Command (const int32_t _duetime) : m_duetime(_duetime) {} | 88 | Command (const uint32_t _duetime) : m_duetime(_duetime) {} |
184 | 89 | virtual ~Command (); | 89 | virtual ~Command (); |
185 | 90 | 90 | ||
186 | 91 | virtual void execute (Game &) = 0; | 91 | virtual void execute (Game &) = 0; |
187 | 92 | virtual uint8_t id() const = 0; | 92 | virtual uint8_t id() const = 0; |
188 | 93 | 93 | ||
191 | 94 | int32_t duetime() const {return m_duetime;} | 94 | uint32_t duetime() const {return m_duetime;} |
192 | 95 | void set_duetime(int32_t const t) {m_duetime = t;} | 95 | void set_duetime(uint32_t const t) {m_duetime = t;} |
193 | 96 | 96 | ||
194 | 97 | private: | 97 | private: |
196 | 98 | int32_t m_duetime; | 98 | uint32_t m_duetime; |
197 | 99 | }; | 99 | }; |
198 | 100 | 100 | ||
199 | 101 | 101 | ||
200 | @@ -107,7 +107,7 @@ | |||
201 | 107 | * for all instances of a game to ensure parallel simulation. | 107 | * for all instances of a game to ensure parallel simulation. |
202 | 108 | */ | 108 | */ |
203 | 109 | struct GameLogicCommand : public Command { | 109 | struct GameLogicCommand : public Command { |
205 | 110 | GameLogicCommand (int32_t const _duetime) : Command(_duetime) {} | 110 | GameLogicCommand (uint32_t const _duetime) : Command(_duetime) {} |
206 | 111 | 111 | ||
207 | 112 | // Write these commands to a file (for savegames) | 112 | // Write these commands to a file (for savegames) |
208 | 113 | virtual void write | 113 | virtual void write |
209 | @@ -158,7 +158,7 @@ | |||
210 | 158 | // the internal time as well. the game_time_var represents the current game | 158 | // the internal time as well. the game_time_var represents the current game |
211 | 159 | // time, which we update and with which we must mess around (to run all | 159 | // time, which we update and with which we must mess around (to run all |
212 | 160 | // queued cmd.s) and which we update (add the interval) | 160 | // queued cmd.s) and which we update (add the interval) |
214 | 161 | int32_t run_queue(int32_t interval, uint32_t & game_time_var); | 161 | void run_queue(int32_t interval, uint32_t & game_time_var); |
215 | 162 | 162 | ||
216 | 163 | void flush(); // delete all commands in the queue now | 163 | void flush(); // delete all commands in the queue now |
217 | 164 | 164 | ||
218 | 165 | 165 | ||
219 | === modified file 'src/logic/constructionsite.cc' | |||
220 | --- src/logic/constructionsite.cc 2015-11-11 09:53:54 +0000 | |||
221 | +++ src/logic/constructionsite.cc 2015-11-25 10:54:29 +0000 | |||
222 | @@ -322,7 +322,6 @@ | |||
223 | 322 | void ConstructionSite::draw | 322 | void ConstructionSite::draw |
224 | 323 | (const EditorGameBase & game, RenderTarget & dst, const FCoords& coords, const Point& pos) | 323 | (const EditorGameBase & game, RenderTarget & dst, const FCoords& coords, const Point& pos) |
225 | 324 | { | 324 | { |
226 | 325 | assert(0 <= game.get_gametime()); | ||
227 | 326 | const uint32_t gametime = game.get_gametime(); | 325 | const uint32_t gametime = game.get_gametime(); |
228 | 327 | uint32_t tanim = gametime - m_animstart; | 326 | uint32_t tanim = gametime - m_animstart; |
229 | 328 | 327 | ||
230 | 329 | 328 | ||
231 | === modified file 'src/logic/dismantlesite.cc' | |||
232 | --- src/logic/dismantlesite.cc 2015-11-11 09:53:54 +0000 | |||
233 | +++ src/logic/dismantlesite.cc 2015-11-25 10:54:29 +0000 | |||
234 | @@ -232,7 +232,6 @@ | |||
235 | 232 | void DismantleSite::draw | 232 | void DismantleSite::draw |
236 | 233 | (const EditorGameBase& game, RenderTarget& dst, const FCoords& coords, const Point& pos) | 233 | (const EditorGameBase& game, RenderTarget& dst, const FCoords& coords, const Point& pos) |
237 | 234 | { | 234 | { |
238 | 235 | assert(0 <= game.get_gametime()); | ||
239 | 236 | const uint32_t gametime = game.get_gametime(); | 235 | const uint32_t gametime = game.get_gametime(); |
240 | 237 | uint32_t tanim = gametime - m_animstart; | 236 | uint32_t tanim = gametime - m_animstart; |
241 | 238 | 237 | ||
242 | 239 | 238 | ||
243 | === modified file 'src/logic/immovable.cc' | |||
244 | --- src/logic/immovable.cc 2015-11-14 15:58:29 +0000 | |||
245 | +++ src/logic/immovable.cc 2015-11-25 10:54:29 +0000 | |||
246 | @@ -524,7 +524,7 @@ | |||
247 | 524 | ============================== | 524 | ============================== |
248 | 525 | */ | 525 | */ |
249 | 526 | 526 | ||
251 | 527 | constexpr uint8_t kCurrentPacketVersionImmovable = 6; | 527 | constexpr uint8_t kCurrentPacketVersionImmovable = 7; |
252 | 528 | 528 | ||
253 | 529 | // Supporting older versions for map loading | 529 | // Supporting older versions for map loading |
254 | 530 | void Immovable::Loader::load(FileRead & fr, uint8_t const packet_version) | 530 | void Immovable::Loader::load(FileRead & fr, uint8_t const packet_version) |
255 | @@ -596,9 +596,13 @@ | |||
256 | 596 | } | 596 | } |
257 | 597 | } | 597 | } |
258 | 598 | 598 | ||
260 | 599 | imm.m_program_step = fr.signed_32(); | 599 | if (packet_version > 6) { |
261 | 600 | imm.m_program_step = fr.unsigned_32(); | ||
262 | 601 | } else { | ||
263 | 602 | imm.m_program_step = fr.signed_32(); | ||
264 | 603 | } | ||
265 | 600 | 604 | ||
267 | 601 | if (packet_version >= 3 && packet_version <= 5){ | 605 | if (packet_version >= 3 && packet_version <= 5) { |
268 | 602 | imm.m_reserved_by_worker = fr.unsigned_8(); | 606 | imm.m_reserved_by_worker = fr.unsigned_8(); |
269 | 603 | } | 607 | } |
270 | 604 | if (packet_version >= 4) { | 608 | if (packet_version >= 4) { |
271 | @@ -661,7 +665,7 @@ | |||
272 | 661 | fw.string(m_program ? m_program->name() : ""); | 665 | fw.string(m_program ? m_program->name() : ""); |
273 | 662 | 666 | ||
274 | 663 | fw.unsigned_32(m_program_ptr); | 667 | fw.unsigned_32(m_program_ptr); |
276 | 664 | fw.signed_32(m_program_step); | 668 | fw.unsigned_32(m_program_step); |
277 | 665 | 669 | ||
278 | 666 | if (m_action_data) { | 670 | if (m_action_data) { |
279 | 667 | fw.c_string(m_action_data->name()); | 671 | fw.c_string(m_action_data->name()); |
280 | 668 | 672 | ||
281 | === modified file 'src/logic/immovable.h' | |||
282 | --- src/logic/immovable.h 2015-11-11 09:52:55 +0000 | |||
283 | +++ src/logic/immovable.h 2015-11-25 10:54:29 +0000 | |||
284 | @@ -239,7 +239,7 @@ | |||
285 | 239 | #else | 239 | #else |
286 | 240 | uint32_t m_anim_construction_total; | 240 | uint32_t m_anim_construction_total; |
287 | 241 | uint32_t m_anim_construction_done; | 241 | uint32_t m_anim_construction_done; |
289 | 242 | int32_t m_program_step; ///< time of next step | 242 | uint32_t m_program_step; ///< time of next step |
290 | 243 | #endif | 243 | #endif |
291 | 244 | std::string m_construct_string; | 244 | std::string m_construct_string; |
292 | 245 | 245 | ||
293 | 246 | 246 | ||
294 | === modified file 'src/logic/instances.cc' | |||
295 | --- src/logic/instances.cc 2015-11-20 18:16:22 +0000 | |||
296 | +++ src/logic/instances.cc 2015-11-25 10:54:29 +0000 | |||
297 | @@ -40,7 +40,7 @@ | |||
298 | 40 | namespace Widelands { | 40 | namespace Widelands { |
299 | 41 | 41 | ||
300 | 42 | CmdDestroyMapObject::CmdDestroyMapObject | 42 | CmdDestroyMapObject::CmdDestroyMapObject |
302 | 43 | (int32_t const t, MapObject & o) | 43 | (uint32_t const t, MapObject & o) |
303 | 44 | : GameLogicCommand(t), obj_serial(o.serial()) | 44 | : GameLogicCommand(t), obj_serial(o.serial()) |
304 | 45 | {} | 45 | {} |
305 | 46 | 46 | ||
306 | @@ -90,7 +90,7 @@ | |||
307 | 90 | fw.unsigned_32(mos.get_object_file_index_or_zero(egbase.objects().get_object(obj_serial))); | 90 | fw.unsigned_32(mos.get_object_file_index_or_zero(egbase.objects().get_object(obj_serial))); |
308 | 91 | } | 91 | } |
309 | 92 | 92 | ||
311 | 93 | CmdAct::CmdAct(int32_t const t, MapObject & o, int32_t const a) : | 93 | CmdAct::CmdAct(uint32_t const t, MapObject & o, int32_t const a) : |
312 | 94 | GameLogicCommand(t), obj_serial(o.serial()), arg(a) | 94 | GameLogicCommand(t), obj_serial(o.serial()), arg(a) |
313 | 95 | {} | 95 | {} |
314 | 96 | 96 | ||
315 | 97 | 97 | ||
316 | === modified file 'src/logic/instances.h' | |||
317 | --- src/logic/instances.h 2015-10-24 21:42:55 +0000 | |||
318 | +++ src/logic/instances.h 2015-11-25 10:54:29 +0000 | |||
319 | @@ -307,15 +307,6 @@ | |||
320 | 307 | HeaderFleet = 11, | 307 | HeaderFleet = 11, |
321 | 308 | }; | 308 | }; |
322 | 309 | 309 | ||
323 | 310 | protected: | ||
324 | 311 | /** | ||
325 | 312 | * MapObjects like trees are reserved by a worker that is walking | ||
326 | 313 | * towards them, so that e.g. two lumberjacks don't attempt to | ||
327 | 314 | * work on the same tree simultaneously or two hunters try to hunt | ||
328 | 315 | * the same animal. | ||
329 | 316 | */ | ||
330 | 317 | bool m_reserved_by_worker; | ||
331 | 318 | |||
332 | 319 | public: | 310 | public: |
333 | 320 | 311 | ||
334 | 321 | /** | 312 | /** |
335 | @@ -394,6 +385,14 @@ | |||
336 | 394 | Serial m_serial; | 385 | Serial m_serial; |
337 | 395 | LogSink * m_logsink; | 386 | LogSink * m_logsink; |
338 | 396 | 387 | ||
339 | 388 | /** | ||
340 | 389 | * MapObjects like trees are reserved by a worker that is walking | ||
341 | 390 | * towards them, so that e.g. two lumberjacks don't attempt to | ||
342 | 391 | * work on the same tree simultaneously or two hunters try to hunt | ||
343 | 392 | * the same animal. | ||
344 | 393 | */ | ||
345 | 394 | bool m_reserved_by_worker; | ||
346 | 395 | |||
347 | 397 | private: | 396 | private: |
348 | 398 | DISALLOW_COPY_AND_ASSIGN(MapObject); | 397 | DISALLOW_COPY_AND_ASSIGN(MapObject); |
349 | 399 | }; | 398 | }; |
350 | @@ -515,7 +514,7 @@ | |||
351 | 515 | 514 | ||
352 | 516 | struct CmdDestroyMapObject : public GameLogicCommand { | 515 | struct CmdDestroyMapObject : public GameLogicCommand { |
353 | 517 | CmdDestroyMapObject() : GameLogicCommand(0), obj_serial(0) {} ///< For savegame loading | 516 | CmdDestroyMapObject() : GameLogicCommand(0), obj_serial(0) {} ///< For savegame loading |
355 | 518 | CmdDestroyMapObject (int32_t t, MapObject &); | 517 | CmdDestroyMapObject (uint32_t t, MapObject &); |
356 | 519 | void execute (Game &) override; | 518 | void execute (Game &) override; |
357 | 520 | 519 | ||
358 | 521 | void write(FileWrite &, EditorGameBase &, MapObjectSaver &) override; | 520 | void write(FileWrite &, EditorGameBase &, MapObjectSaver &) override; |
359 | @@ -529,7 +528,7 @@ | |||
360 | 529 | 528 | ||
361 | 530 | struct CmdAct : public GameLogicCommand { | 529 | struct CmdAct : public GameLogicCommand { |
362 | 531 | CmdAct() : GameLogicCommand(0), obj_serial(0), arg(0) {} ///< For savegame loading | 530 | CmdAct() : GameLogicCommand(0), obj_serial(0), arg(0) {} ///< For savegame loading |
364 | 532 | CmdAct (int32_t t, MapObject &, int32_t a); | 531 | CmdAct (uint32_t t, MapObject &, int32_t a); |
365 | 533 | 532 | ||
366 | 534 | void execute (Game &) override; | 533 | void execute (Game &) override; |
367 | 535 | 534 | ||
368 | 536 | 535 | ||
369 | === modified file 'src/logic/playercommand.cc' | |||
370 | --- src/logic/playercommand.cc 2015-11-11 09:52:55 +0000 | |||
371 | +++ src/logic/playercommand.cc 2015-11-25 10:54:29 +0000 | |||
372 | @@ -93,7 +93,7 @@ | |||
373 | 93 | 93 | ||
374 | 94 | /*** class PlayerCommand ***/ | 94 | /*** class PlayerCommand ***/ |
375 | 95 | 95 | ||
377 | 96 | PlayerCommand::PlayerCommand (const int32_t time, const PlayerNumber s) | 96 | PlayerCommand::PlayerCommand (const uint32_t time, const PlayerNumber s) |
378 | 97 | : GameLogicCommand (time), m_sender(s), m_cmdserial(0) | 97 | : GameLogicCommand (time), m_sender(s), m_cmdserial(0) |
379 | 98 | {} | 98 | {} |
380 | 99 | 99 | ||
381 | @@ -330,7 +330,7 @@ | |||
382 | 330 | 330 | ||
383 | 331 | /*** class Cmd_BuildRoad ***/ | 331 | /*** class Cmd_BuildRoad ***/ |
384 | 332 | 332 | ||
386 | 333 | CmdBuildRoad::CmdBuildRoad (int32_t t, int32_t p, Path & pa) : | 333 | CmdBuildRoad::CmdBuildRoad (uint32_t t, int32_t p, Path & pa) : |
387 | 334 | PlayerCommand(t, p), | 334 | PlayerCommand(t, p), |
388 | 335 | path (&pa), | 335 | path (&pa), |
389 | 336 | start (pa.get_start()), | 336 | start (pa.get_start()), |
390 | @@ -1122,7 +1122,7 @@ | |||
391 | 1122 | 1122 | ||
392 | 1123 | /*** class Cmd_SetWarePriority ***/ | 1123 | /*** class Cmd_SetWarePriority ***/ |
393 | 1124 | CmdSetWarePriority::CmdSetWarePriority | 1124 | CmdSetWarePriority::CmdSetWarePriority |
395 | 1125 | (const int32_t _duetime, const PlayerNumber _sender, | 1125 | (const uint32_t _duetime, const PlayerNumber _sender, |
396 | 1126 | PlayerImmovable & imm, | 1126 | PlayerImmovable & imm, |
397 | 1127 | const int32_t type, const DescriptionIndex index, const int32_t priority) | 1127 | const int32_t type, const DescriptionIndex index, const int32_t priority) |
398 | 1128 | : | 1128 | : |
399 | @@ -1201,7 +1201,7 @@ | |||
400 | 1201 | 1201 | ||
401 | 1202 | /*** class Cmd_SetWareMaxFill ***/ | 1202 | /*** class Cmd_SetWareMaxFill ***/ |
402 | 1203 | CmdSetWareMaxFill::CmdSetWareMaxFill | 1203 | CmdSetWareMaxFill::CmdSetWareMaxFill |
404 | 1204 | (const int32_t _duetime, const PlayerNumber _sender, | 1204 | (const uint32_t _duetime, const PlayerNumber _sender, |
405 | 1205 | PlayerImmovable & imm, | 1205 | PlayerImmovable & imm, |
406 | 1206 | const DescriptionIndex index, const uint32_t max_fill) | 1206 | const DescriptionIndex index, const uint32_t max_fill) |
407 | 1207 | : | 1207 | : |
408 | @@ -1274,7 +1274,7 @@ | |||
409 | 1274 | 1274 | ||
410 | 1275 | 1275 | ||
411 | 1276 | CmdChangeTargetQuantity::CmdChangeTargetQuantity | 1276 | CmdChangeTargetQuantity::CmdChangeTargetQuantity |
413 | 1277 | (const int32_t _duetime, const PlayerNumber _sender, | 1277 | (const uint32_t _duetime, const PlayerNumber _sender, |
414 | 1278 | const uint32_t _economy, const DescriptionIndex _ware_type) | 1278 | const uint32_t _economy, const DescriptionIndex _ware_type) |
415 | 1279 | : | 1279 | : |
416 | 1280 | PlayerCommand(_duetime, _sender), | 1280 | PlayerCommand(_duetime, _sender), |
417 | @@ -1319,7 +1319,7 @@ | |||
418 | 1319 | 1319 | ||
419 | 1320 | 1320 | ||
420 | 1321 | CmdSetWareTargetQuantity::CmdSetWareTargetQuantity | 1321 | CmdSetWareTargetQuantity::CmdSetWareTargetQuantity |
422 | 1322 | (const int32_t _duetime, const PlayerNumber _sender, | 1322 | (const uint32_t _duetime, const PlayerNumber _sender, |
423 | 1323 | const uint32_t _economy, | 1323 | const uint32_t _economy, |
424 | 1324 | const DescriptionIndex _ware_type, | 1324 | const DescriptionIndex _ware_type, |
425 | 1325 | const uint32_t _permanent) | 1325 | const uint32_t _permanent) |
426 | @@ -1381,7 +1381,7 @@ | |||
427 | 1381 | 1381 | ||
428 | 1382 | 1382 | ||
429 | 1383 | CmdResetWareTargetQuantity::CmdResetWareTargetQuantity | 1383 | CmdResetWareTargetQuantity::CmdResetWareTargetQuantity |
431 | 1384 | (const int32_t _duetime, const PlayerNumber _sender, | 1384 | (const uint32_t _duetime, const PlayerNumber _sender, |
432 | 1385 | const uint32_t _economy, | 1385 | const uint32_t _economy, |
433 | 1386 | const DescriptionIndex _ware_type) | 1386 | const DescriptionIndex _ware_type) |
434 | 1387 | : | 1387 | : |
435 | @@ -1437,7 +1437,7 @@ | |||
436 | 1437 | 1437 | ||
437 | 1438 | 1438 | ||
438 | 1439 | CmdSetWorkerTargetQuantity::CmdSetWorkerTargetQuantity | 1439 | CmdSetWorkerTargetQuantity::CmdSetWorkerTargetQuantity |
440 | 1440 | (const int32_t _duetime, const PlayerNumber _sender, | 1440 | (const uint32_t _duetime, const PlayerNumber _sender, |
441 | 1441 | const uint32_t _economy, | 1441 | const uint32_t _economy, |
442 | 1442 | const DescriptionIndex _ware_type, | 1442 | const DescriptionIndex _ware_type, |
443 | 1443 | const uint32_t _permanent) | 1443 | const uint32_t _permanent) |
444 | @@ -1499,7 +1499,7 @@ | |||
445 | 1499 | 1499 | ||
446 | 1500 | 1500 | ||
447 | 1501 | CmdResetWorkerTargetQuantity::CmdResetWorkerTargetQuantity | 1501 | CmdResetWorkerTargetQuantity::CmdResetWorkerTargetQuantity |
449 | 1502 | (const int32_t _duetime, const PlayerNumber _sender, | 1502 | (const uint32_t _duetime, const PlayerNumber _sender, |
450 | 1503 | const uint32_t _economy, | 1503 | const uint32_t _economy, |
451 | 1504 | const DescriptionIndex _ware_type) | 1504 | const DescriptionIndex _ware_type) |
452 | 1505 | : | 1505 | : |
453 | @@ -1894,7 +1894,7 @@ | |||
454 | 1894 | 1894 | ||
455 | 1895 | /*** struct Cmd_SetStockPolicy ***/ | 1895 | /*** struct Cmd_SetStockPolicy ***/ |
456 | 1896 | CmdSetStockPolicy::CmdSetStockPolicy | 1896 | CmdSetStockPolicy::CmdSetStockPolicy |
458 | 1897 | (int32_t time, PlayerNumber p, | 1897 | (uint32_t time, PlayerNumber p, |
459 | 1898 | Warehouse & wh, bool isworker, DescriptionIndex ware, | 1898 | Warehouse & wh, bool isworker, DescriptionIndex ware, |
460 | 1899 | Warehouse::StockPolicy policy) | 1899 | Warehouse::StockPolicy policy) |
461 | 1900 | : PlayerCommand(time, p) | 1900 | : PlayerCommand(time, p) |
462 | 1901 | 1901 | ||
463 | === modified file 'src/logic/playercommand.h' | |||
464 | --- src/logic/playercommand.h 2015-11-11 09:53:54 +0000 | |||
465 | +++ src/logic/playercommand.h 2015-11-25 10:54:29 +0000 | |||
466 | @@ -44,7 +44,7 @@ | |||
467 | 44 | */ | 44 | */ |
468 | 45 | class PlayerCommand : public GameLogicCommand { | 45 | class PlayerCommand : public GameLogicCommand { |
469 | 46 | public: | 46 | public: |
471 | 47 | PlayerCommand (int32_t time, PlayerNumber); | 47 | PlayerCommand (uint32_t time, PlayerNumber); |
472 | 48 | 48 | ||
473 | 49 | /// For savegame loading | 49 | /// For savegame loading |
474 | 50 | PlayerCommand() : GameLogicCommand(0), m_sender(0), m_cmdserial(0) {} | 50 | PlayerCommand() : GameLogicCommand(0), m_sender(0), m_cmdserial(0) {} |
475 | @@ -68,7 +68,7 @@ | |||
476 | 68 | struct CmdBulldoze:public PlayerCommand { | 68 | struct CmdBulldoze:public PlayerCommand { |
477 | 69 | CmdBulldoze() : PlayerCommand(), serial(0), recurse(0) {} // For savegame loading | 69 | CmdBulldoze() : PlayerCommand(), serial(0), recurse(0) {} // For savegame loading |
478 | 70 | CmdBulldoze | 70 | CmdBulldoze |
480 | 71 | (const int32_t t, const int32_t p, | 71 | (const uint32_t t, const int32_t p, |
481 | 72 | PlayerImmovable & pi, | 72 | PlayerImmovable & pi, |
482 | 73 | const bool _recurse = false) | 73 | const bool _recurse = false) |
483 | 74 | : PlayerCommand(t, p), serial(pi.serial()), recurse(_recurse) | 74 | : PlayerCommand(t, p), serial(pi.serial()), recurse(_recurse) |
484 | @@ -92,7 +92,7 @@ | |||
485 | 92 | struct CmdBuild:public PlayerCommand { | 92 | struct CmdBuild:public PlayerCommand { |
486 | 93 | CmdBuild() : PlayerCommand() {} // For savegame loading | 93 | CmdBuild() : PlayerCommand() {} // For savegame loading |
487 | 94 | CmdBuild | 94 | CmdBuild |
489 | 95 | (const int32_t _duetime, | 95 | (const uint32_t _duetime, |
490 | 96 | const int32_t p, | 96 | const int32_t p, |
491 | 97 | const Coords c, | 97 | const Coords c, |
492 | 98 | const DescriptionIndex i) | 98 | const DescriptionIndex i) |
493 | @@ -116,7 +116,7 @@ | |||
494 | 116 | 116 | ||
495 | 117 | struct CmdBuildFlag:public PlayerCommand { | 117 | struct CmdBuildFlag:public PlayerCommand { |
496 | 118 | CmdBuildFlag() : PlayerCommand() {} // For savegame loading | 118 | CmdBuildFlag() : PlayerCommand() {} // For savegame loading |
498 | 119 | CmdBuildFlag (const int32_t t, const int32_t p, const Coords c) : | 119 | CmdBuildFlag (const uint32_t t, const int32_t p, const Coords c) : |
499 | 120 | PlayerCommand(t, p), coords(c) | 120 | PlayerCommand(t, p), coords(c) |
500 | 121 | {} | 121 | {} |
501 | 122 | 122 | ||
502 | @@ -137,7 +137,7 @@ | |||
503 | 137 | struct CmdBuildRoad:public PlayerCommand { | 137 | struct CmdBuildRoad:public PlayerCommand { |
504 | 138 | CmdBuildRoad() : | 138 | CmdBuildRoad() : |
505 | 139 | PlayerCommand(), path(nullptr), start(), nsteps(0), steps(nullptr) {} // For savegame loading | 139 | PlayerCommand(), path(nullptr), start(), nsteps(0), steps(nullptr) {} // For savegame loading |
507 | 140 | CmdBuildRoad (int32_t, int32_t, Path &); | 140 | CmdBuildRoad (uint32_t, int32_t, Path &); |
508 | 141 | CmdBuildRoad (StreamRead &); | 141 | CmdBuildRoad (StreamRead &); |
509 | 142 | 142 | ||
510 | 143 | virtual ~CmdBuildRoad (); | 143 | virtual ~CmdBuildRoad (); |
511 | @@ -159,7 +159,7 @@ | |||
512 | 159 | 159 | ||
513 | 160 | struct CmdFlagAction : public PlayerCommand { | 160 | struct CmdFlagAction : public PlayerCommand { |
514 | 161 | CmdFlagAction() : PlayerCommand(), serial(0) {} // For savegame loading | 161 | CmdFlagAction() : PlayerCommand(), serial(0) {} // For savegame loading |
516 | 162 | CmdFlagAction (const int32_t t, const int32_t p, const Flag & f) : | 162 | CmdFlagAction (const uint32_t t, const int32_t p, const Flag & f) : |
517 | 163 | PlayerCommand(t, p), serial(f.serial()) | 163 | PlayerCommand(t, p), serial(f.serial()) |
518 | 164 | {} | 164 | {} |
519 | 165 | 165 | ||
520 | @@ -180,7 +180,7 @@ | |||
521 | 180 | 180 | ||
522 | 181 | struct CmdStartStopBuilding : public PlayerCommand { | 181 | struct CmdStartStopBuilding : public PlayerCommand { |
523 | 182 | CmdStartStopBuilding() : PlayerCommand(), serial(0) {} // For savegame loading | 182 | CmdStartStopBuilding() : PlayerCommand(), serial(0) {} // For savegame loading |
525 | 183 | CmdStartStopBuilding (const int32_t t, const PlayerNumber p, Building & b) | 183 | CmdStartStopBuilding (const uint32_t t, const PlayerNumber p, Building & b) |
526 | 184 | : PlayerCommand(t, p), serial(b.serial()) | 184 | : PlayerCommand(t, p), serial(b.serial()) |
527 | 185 | {} | 185 | {} |
528 | 186 | 186 | ||
529 | @@ -200,7 +200,7 @@ | |||
530 | 200 | 200 | ||
531 | 201 | struct CmdMilitarySiteSetSoldierPreference : public PlayerCommand { | 201 | struct CmdMilitarySiteSetSoldierPreference : public PlayerCommand { |
532 | 202 | CmdMilitarySiteSetSoldierPreference() : PlayerCommand(), serial(0) {} // For savegame loading | 202 | CmdMilitarySiteSetSoldierPreference() : PlayerCommand(), serial(0) {} // For savegame loading |
534 | 203 | CmdMilitarySiteSetSoldierPreference (const int32_t t, const PlayerNumber p, Building & b, uint8_t prefs) | 203 | CmdMilitarySiteSetSoldierPreference (const uint32_t t, const PlayerNumber p, Building & b, uint8_t prefs) |
535 | 204 | : PlayerCommand(t, p), serial(b.serial()), preference(prefs) | 204 | : PlayerCommand(t, p), serial(b.serial()), preference(prefs) |
536 | 205 | {} | 205 | {} |
537 | 206 | 206 | ||
538 | @@ -220,7 +220,7 @@ | |||
539 | 220 | }; | 220 | }; |
540 | 221 | struct CmdStartOrCancelExpedition : public PlayerCommand { | 221 | struct CmdStartOrCancelExpedition : public PlayerCommand { |
541 | 222 | CmdStartOrCancelExpedition() : PlayerCommand() {} // For savegame loading | 222 | CmdStartOrCancelExpedition() : PlayerCommand() {} // For savegame loading |
543 | 223 | CmdStartOrCancelExpedition (int32_t const t, PlayerNumber const p, Building & b) | 223 | CmdStartOrCancelExpedition (uint32_t const t, PlayerNumber const p, Building & b) |
544 | 224 | : PlayerCommand(t, p), serial(b.serial()) | 224 | : PlayerCommand(t, p), serial(b.serial()) |
545 | 225 | {} | 225 | {} |
546 | 226 | 226 | ||
547 | @@ -241,7 +241,7 @@ | |||
548 | 241 | struct CmdEnhanceBuilding:public PlayerCommand { | 241 | struct CmdEnhanceBuilding:public PlayerCommand { |
549 | 242 | CmdEnhanceBuilding() : PlayerCommand(), serial(0) {} // For savegame loading | 242 | CmdEnhanceBuilding() : PlayerCommand(), serial(0) {} // For savegame loading |
550 | 243 | CmdEnhanceBuilding | 243 | CmdEnhanceBuilding |
552 | 244 | (const int32_t _duetime, | 244 | (const uint32_t _duetime, |
553 | 245 | const int32_t p, | 245 | const int32_t p, |
554 | 246 | Building & b, | 246 | Building & b, |
555 | 247 | const DescriptionIndex i) | 247 | const DescriptionIndex i) |
556 | @@ -267,7 +267,7 @@ | |||
557 | 267 | struct CmdDismantleBuilding:public PlayerCommand { | 267 | struct CmdDismantleBuilding:public PlayerCommand { |
558 | 268 | CmdDismantleBuilding() : PlayerCommand(), serial(0) {} // For savegame loading | 268 | CmdDismantleBuilding() : PlayerCommand(), serial(0) {} // For savegame loading |
559 | 269 | CmdDismantleBuilding | 269 | CmdDismantleBuilding |
561 | 270 | (const int32_t t, const int32_t p, | 270 | (const uint32_t t, const int32_t p, |
562 | 271 | PlayerImmovable & pi) | 271 | PlayerImmovable & pi) |
563 | 272 | : PlayerCommand(t, p), serial(pi.serial()) | 272 | : PlayerCommand(t, p), serial(pi.serial()) |
564 | 273 | {} | 273 | {} |
565 | @@ -290,7 +290,7 @@ | |||
566 | 290 | struct CmdEvictWorker : public PlayerCommand { | 290 | struct CmdEvictWorker : public PlayerCommand { |
567 | 291 | CmdEvictWorker() : PlayerCommand(), serial(0) {} // For savegame loading | 291 | CmdEvictWorker() : PlayerCommand(), serial(0) {} // For savegame loading |
568 | 292 | CmdEvictWorker | 292 | CmdEvictWorker |
570 | 293 | (const int32_t t, const int32_t p, | 293 | (const uint32_t t, const int32_t p, |
571 | 294 | Worker & w) | 294 | Worker & w) |
572 | 295 | : PlayerCommand(t, p), serial(w.serial()) | 295 | : PlayerCommand(t, p), serial(w.serial()) |
573 | 296 | {} | 296 | {} |
574 | @@ -313,7 +313,7 @@ | |||
575 | 313 | struct CmdShipScoutDirection : public PlayerCommand { | 313 | struct CmdShipScoutDirection : public PlayerCommand { |
576 | 314 | CmdShipScoutDirection() : PlayerCommand(), serial(0) {} // For savegame loading | 314 | CmdShipScoutDirection() : PlayerCommand(), serial(0) {} // For savegame loading |
577 | 315 | CmdShipScoutDirection | 315 | CmdShipScoutDirection |
579 | 316 | (int32_t const t, PlayerNumber const p, Serial s, WalkingDir direction) | 316 | (uint32_t const t, PlayerNumber const p, Serial s, WalkingDir direction) |
580 | 317 | : PlayerCommand(t, p), serial(s), dir(direction) | 317 | : PlayerCommand(t, p), serial(s), dir(direction) |
581 | 318 | {} | 318 | {} |
582 | 319 | 319 | ||
583 | @@ -335,7 +335,7 @@ | |||
584 | 335 | struct CmdShipConstructPort : public PlayerCommand { | 335 | struct CmdShipConstructPort : public PlayerCommand { |
585 | 336 | CmdShipConstructPort() : PlayerCommand(), serial(0) {} // For savegame loading | 336 | CmdShipConstructPort() : PlayerCommand(), serial(0) {} // For savegame loading |
586 | 337 | CmdShipConstructPort | 337 | CmdShipConstructPort |
588 | 338 | (int32_t const t, PlayerNumber const p, Serial s, Coords c) | 338 | (uint32_t const t, PlayerNumber const p, Serial s, Coords c) |
589 | 339 | : PlayerCommand(t, p), serial(s), coords(c) | 339 | : PlayerCommand(t, p), serial(s), coords(c) |
590 | 340 | {} | 340 | {} |
591 | 341 | 341 | ||
592 | @@ -357,7 +357,7 @@ | |||
593 | 357 | struct CmdShipExploreIsland : public PlayerCommand { | 357 | struct CmdShipExploreIsland : public PlayerCommand { |
594 | 358 | CmdShipExploreIsland() : PlayerCommand(), serial(0) {} // For savegame loading | 358 | CmdShipExploreIsland() : PlayerCommand(), serial(0) {} // For savegame loading |
595 | 359 | CmdShipExploreIsland | 359 | CmdShipExploreIsland |
597 | 360 | (int32_t const t, PlayerNumber const p, Serial s, IslandExploreDirection direction) | 360 | (uint32_t const t, PlayerNumber const p, Serial s, IslandExploreDirection direction) |
598 | 361 | : PlayerCommand(t, p), serial(s), island_explore_direction(direction) | 361 | : PlayerCommand(t, p), serial(s), island_explore_direction(direction) |
599 | 362 | {} | 362 | {} |
600 | 363 | 363 | ||
601 | @@ -379,7 +379,7 @@ | |||
602 | 379 | struct CmdShipSink : public PlayerCommand { | 379 | struct CmdShipSink : public PlayerCommand { |
603 | 380 | CmdShipSink() : PlayerCommand(), serial(0) {} // For savegame loading | 380 | CmdShipSink() : PlayerCommand(), serial(0) {} // For savegame loading |
604 | 381 | CmdShipSink | 381 | CmdShipSink |
606 | 382 | (int32_t const t, PlayerNumber const p, Serial s) | 382 | (uint32_t const t, PlayerNumber const p, Serial s) |
607 | 383 | : PlayerCommand(t, p), serial(s) | 383 | : PlayerCommand(t, p), serial(s) |
608 | 384 | {} | 384 | {} |
609 | 385 | 385 | ||
610 | @@ -400,7 +400,7 @@ | |||
611 | 400 | struct CmdShipCancelExpedition : public PlayerCommand { | 400 | struct CmdShipCancelExpedition : public PlayerCommand { |
612 | 401 | CmdShipCancelExpedition() : PlayerCommand(), serial(0) {} // For savegame loading | 401 | CmdShipCancelExpedition() : PlayerCommand(), serial(0) {} // For savegame loading |
613 | 402 | CmdShipCancelExpedition | 402 | CmdShipCancelExpedition |
615 | 403 | (int32_t const t, PlayerNumber const p, Serial s) | 403 | (uint32_t const t, PlayerNumber const p, Serial s) |
616 | 404 | : PlayerCommand(t, p), serial(s) | 404 | : PlayerCommand(t, p), serial(s) |
617 | 405 | {} | 405 | {} |
618 | 406 | 406 | ||
619 | @@ -428,7 +428,7 @@ | |||
620 | 428 | m_priority(0) | 428 | m_priority(0) |
621 | 429 | {} | 429 | {} |
622 | 430 | CmdSetWarePriority | 430 | CmdSetWarePriority |
624 | 431 | (int32_t duetime, PlayerNumber sender, | 431 | (uint32_t duetime, PlayerNumber sender, |
625 | 432 | PlayerImmovable &, | 432 | PlayerImmovable &, |
626 | 433 | int32_t type, DescriptionIndex index, int32_t priority); | 433 | int32_t type, DescriptionIndex index, int32_t priority); |
627 | 434 | 434 | ||
628 | @@ -453,7 +453,7 @@ | |||
629 | 453 | struct CmdSetWareMaxFill : public PlayerCommand { | 453 | struct CmdSetWareMaxFill : public PlayerCommand { |
630 | 454 | CmdSetWareMaxFill() : PlayerCommand(), m_serial(0), m_index(), m_max_fill(0) {} // For savegame loading | 454 | CmdSetWareMaxFill() : PlayerCommand(), m_serial(0), m_index(), m_max_fill(0) {} // For savegame loading |
631 | 455 | CmdSetWareMaxFill | 455 | CmdSetWareMaxFill |
633 | 456 | (int32_t duetime, PlayerNumber, | 456 | (uint32_t duetime, PlayerNumber, |
634 | 457 | PlayerImmovable &, | 457 | PlayerImmovable &, |
635 | 458 | DescriptionIndex, uint32_t maxfill); | 458 | DescriptionIndex, uint32_t maxfill); |
636 | 459 | 459 | ||
637 | @@ -477,7 +477,7 @@ | |||
638 | 477 | struct CmdChangeTargetQuantity : public PlayerCommand { | 477 | struct CmdChangeTargetQuantity : public PlayerCommand { |
639 | 478 | CmdChangeTargetQuantity() : PlayerCommand(), m_economy(0), m_ware_type() {} // For savegame loading. | 478 | CmdChangeTargetQuantity() : PlayerCommand(), m_economy(0), m_ware_type() {} // For savegame loading. |
640 | 479 | CmdChangeTargetQuantity | 479 | CmdChangeTargetQuantity |
642 | 480 | (int32_t duetime, PlayerNumber sender, | 480 | (uint32_t duetime, PlayerNumber sender, |
643 | 481 | uint32_t economy, DescriptionIndex index); | 481 | uint32_t economy, DescriptionIndex index); |
644 | 482 | 482 | ||
645 | 483 | // Write/Read these commands to/from a file (for savegames). | 483 | // Write/Read these commands to/from a file (for savegames). |
646 | @@ -501,7 +501,7 @@ | |||
647 | 501 | struct CmdSetWareTargetQuantity : public CmdChangeTargetQuantity { | 501 | struct CmdSetWareTargetQuantity : public CmdChangeTargetQuantity { |
648 | 502 | CmdSetWareTargetQuantity() : CmdChangeTargetQuantity(), m_permanent(0) {} | 502 | CmdSetWareTargetQuantity() : CmdChangeTargetQuantity(), m_permanent(0) {} |
649 | 503 | CmdSetWareTargetQuantity | 503 | CmdSetWareTargetQuantity |
651 | 504 | (int32_t duetime, PlayerNumber sender, | 504 | (uint32_t duetime, PlayerNumber sender, |
652 | 505 | uint32_t economy, DescriptionIndex index, | 505 | uint32_t economy, DescriptionIndex index, |
653 | 506 | uint32_t permanent); | 506 | uint32_t permanent); |
654 | 507 | 507 | ||
655 | @@ -523,7 +523,7 @@ | |||
656 | 523 | struct CmdResetWareTargetQuantity : public CmdChangeTargetQuantity { | 523 | struct CmdResetWareTargetQuantity : public CmdChangeTargetQuantity { |
657 | 524 | CmdResetWareTargetQuantity() : CmdChangeTargetQuantity() {} | 524 | CmdResetWareTargetQuantity() : CmdChangeTargetQuantity() {} |
658 | 525 | CmdResetWareTargetQuantity | 525 | CmdResetWareTargetQuantity |
660 | 526 | (int32_t duetime, PlayerNumber sender, | 526 | (uint32_t duetime, PlayerNumber sender, |
661 | 527 | uint32_t economy, DescriptionIndex index); | 527 | uint32_t economy, DescriptionIndex index); |
662 | 528 | 528 | ||
663 | 529 | // Write/Read these commands to/from a file (for savegames). | 529 | // Write/Read these commands to/from a file (for savegames). |
664 | @@ -541,7 +541,7 @@ | |||
665 | 541 | struct CmdSetWorkerTargetQuantity : public CmdChangeTargetQuantity { | 541 | struct CmdSetWorkerTargetQuantity : public CmdChangeTargetQuantity { |
666 | 542 | CmdSetWorkerTargetQuantity() : CmdChangeTargetQuantity(), m_permanent(0) {} | 542 | CmdSetWorkerTargetQuantity() : CmdChangeTargetQuantity(), m_permanent(0) {} |
667 | 543 | CmdSetWorkerTargetQuantity | 543 | CmdSetWorkerTargetQuantity |
669 | 544 | (int32_t duetime, PlayerNumber sender, | 544 | (uint32_t duetime, PlayerNumber sender, |
670 | 545 | uint32_t economy, DescriptionIndex index, | 545 | uint32_t economy, DescriptionIndex index, |
671 | 546 | uint32_t permanent); | 546 | uint32_t permanent); |
672 | 547 | 547 | ||
673 | @@ -563,7 +563,7 @@ | |||
674 | 563 | struct CmdResetWorkerTargetQuantity : public CmdChangeTargetQuantity { | 563 | struct CmdResetWorkerTargetQuantity : public CmdChangeTargetQuantity { |
675 | 564 | CmdResetWorkerTargetQuantity() : CmdChangeTargetQuantity() {} | 564 | CmdResetWorkerTargetQuantity() : CmdChangeTargetQuantity() {} |
676 | 565 | CmdResetWorkerTargetQuantity | 565 | CmdResetWorkerTargetQuantity |
678 | 566 | (int32_t duetime, PlayerNumber sender, | 566 | (uint32_t duetime, PlayerNumber sender, |
679 | 567 | uint32_t economy, DescriptionIndex index); | 567 | uint32_t economy, DescriptionIndex index); |
680 | 568 | 568 | ||
681 | 569 | // Write/Read these commands to/from a file (for savegames). | 569 | // Write/Read these commands to/from a file (for savegames). |
682 | @@ -581,7 +581,7 @@ | |||
683 | 581 | struct CmdChangeTrainingOptions : public PlayerCommand { | 581 | struct CmdChangeTrainingOptions : public PlayerCommand { |
684 | 582 | CmdChangeTrainingOptions() : PlayerCommand(), serial(0), attribute(0), value(0) {} // For savegame loading | 582 | CmdChangeTrainingOptions() : PlayerCommand(), serial(0), attribute(0), value(0) {} // For savegame loading |
685 | 583 | CmdChangeTrainingOptions | 583 | CmdChangeTrainingOptions |
687 | 584 | (const int32_t t, | 584 | (const uint32_t t, |
688 | 585 | const PlayerNumber p, | 585 | const PlayerNumber p, |
689 | 586 | TrainingSite & ts, | 586 | TrainingSite & ts, |
690 | 587 | const int32_t at, | 587 | const int32_t at, |
691 | @@ -609,7 +609,7 @@ | |||
692 | 609 | struct CmdDropSoldier : public PlayerCommand { | 609 | struct CmdDropSoldier : public PlayerCommand { |
693 | 610 | CmdDropSoldier () : PlayerCommand(), serial(0), soldier(0) {} // for savegames | 610 | CmdDropSoldier () : PlayerCommand(), serial(0), soldier(0) {} // for savegames |
694 | 611 | CmdDropSoldier | 611 | CmdDropSoldier |
696 | 612 | (const int32_t t, | 612 | (const uint32_t t, |
697 | 613 | const int32_t p, | 613 | const int32_t p, |
698 | 614 | Building & b, | 614 | Building & b, |
699 | 615 | const int32_t _soldier) | 615 | const int32_t _soldier) |
700 | @@ -635,7 +635,7 @@ | |||
701 | 635 | struct CmdChangeSoldierCapacity : public PlayerCommand { | 635 | struct CmdChangeSoldierCapacity : public PlayerCommand { |
702 | 636 | CmdChangeSoldierCapacity () : PlayerCommand(), serial(0), val(0) {} // for savegames | 636 | CmdChangeSoldierCapacity () : PlayerCommand(), serial(0), val(0) {} // for savegames |
703 | 637 | CmdChangeSoldierCapacity | 637 | CmdChangeSoldierCapacity |
705 | 638 | (const int32_t t, const int32_t p, Building & b, const int32_t i) | 638 | (const uint32_t t, const int32_t p, Building & b, const int32_t i) |
706 | 639 | : PlayerCommand(t, p), serial(b.serial()), val(i) | 639 | : PlayerCommand(t, p), serial(b.serial()), val(i) |
707 | 640 | {} | 640 | {} |
708 | 641 | 641 | ||
709 | @@ -658,7 +658,7 @@ | |||
710 | 658 | /////////////TESTING STUFF | 658 | /////////////TESTING STUFF |
711 | 659 | struct CmdEnemyFlagAction : public PlayerCommand { | 659 | struct CmdEnemyFlagAction : public PlayerCommand { |
712 | 660 | CmdEnemyFlagAction() : PlayerCommand(), serial(0), number(0) {} // For savegame loading | 660 | CmdEnemyFlagAction() : PlayerCommand(), serial(0), number(0) {} // For savegame loading |
714 | 661 | CmdEnemyFlagAction(int32_t t, int32_t p, const Flag& f, uint32_t num) | 661 | CmdEnemyFlagAction(uint32_t t, int32_t p, const Flag& f, uint32_t num) |
715 | 662 | : PlayerCommand(t, p), serial(f.serial()), number(num) { | 662 | : PlayerCommand(t, p), serial(f.serial()), number(num) { |
716 | 663 | } | 663 | } |
717 | 664 | 664 | ||
718 | @@ -733,7 +733,7 @@ | |||
719 | 733 | */ | 733 | */ |
720 | 734 | struct CmdSetStockPolicy : PlayerCommand { | 734 | struct CmdSetStockPolicy : PlayerCommand { |
721 | 735 | CmdSetStockPolicy | 735 | CmdSetStockPolicy |
723 | 736 | (int32_t time, PlayerNumber p, | 736 | (uint32_t time, PlayerNumber p, |
724 | 737 | Warehouse & wh, bool isworker, DescriptionIndex ware, | 737 | Warehouse & wh, bool isworker, DescriptionIndex ware, |
725 | 738 | Warehouse::StockPolicy policy); | 738 | Warehouse::StockPolicy policy); |
726 | 739 | 739 | ||
727 | 740 | 740 | ||
728 | === modified file 'src/logic/replay_game_controller.h' | |||
729 | --- src/logic/replay_game_controller.h 2015-03-01 09:21:20 +0000 | |||
730 | +++ src/logic/replay_game_controller.h 2015-11-25 10:54:29 +0000 | |||
731 | @@ -46,7 +46,7 @@ | |||
732 | 46 | 46 | ||
733 | 47 | private: | 47 | private: |
734 | 48 | struct CmdReplayEnd : public Widelands::Command { | 48 | struct CmdReplayEnd : public Widelands::Command { |
736 | 49 | CmdReplayEnd (int32_t const _duetime) : Widelands::Command(_duetime) {} | 49 | CmdReplayEnd (uint32_t const _duetime) : Widelands::Command(_duetime) {} |
737 | 50 | virtual void execute (Widelands::Game & game); | 50 | virtual void execute (Widelands::Game & game); |
738 | 51 | virtual uint8_t id() const; | 51 | virtual uint8_t id() const; |
739 | 52 | }; | 52 | }; |
740 | 53 | 53 | ||
741 | === modified file 'src/logic/soldier.cc' | |||
742 | --- src/logic/soldier.cc 2015-10-25 08:06:00 +0000 | |||
743 | +++ src/logic/soldier.cc 2015-11-25 10:54:29 +0000 | |||
744 | @@ -1317,7 +1317,7 @@ | |||
745 | 1317 | 1317 | ||
746 | 1318 | void Soldier::move_in_battle_update(Game & game, State &) | 1318 | void Soldier::move_in_battle_update(Game & game, State &) |
747 | 1319 | { | 1319 | { |
749 | 1320 | if (static_cast<int32_t>(game.get_gametime() - m_combat_walkend) >= 0) { | 1320 | if (game.get_gametime() >= m_combat_walkend) { |
750 | 1321 | switch (m_combat_walking) { | 1321 | switch (m_combat_walking) { |
751 | 1322 | case CD_NONE: | 1322 | case CD_NONE: |
752 | 1323 | break; | 1323 | break; |
753 | @@ -1590,7 +1590,7 @@ | |||
754 | 1590 | signal_handled(); | 1590 | signal_handled(); |
755 | 1591 | } | 1591 | } |
756 | 1592 | 1592 | ||
758 | 1593 | if (state.ivar1 > game.get_gametime()) | 1593 | if ((state.ivar1 >= 0) && (static_cast<uint32_t>(state.ivar1) > game.get_gametime())) |
759 | 1594 | return schedule_act(game, state.ivar1 - game.get_gametime()); | 1594 | return schedule_act(game, state.ivar1 - game.get_gametime()); |
760 | 1595 | 1595 | ||
761 | 1596 | // When task updated, dead is near! | 1596 | // When task updated, dead is near! |
762 | @@ -1804,8 +1804,8 @@ | |||
763 | 1804 | 1804 | ||
764 | 1805 | soldier.m_combat_walking = static_cast<CombatWalkingDir>(fr.unsigned_8()); | 1805 | soldier.m_combat_walking = static_cast<CombatWalkingDir>(fr.unsigned_8()); |
765 | 1806 | if (soldier.m_combat_walking != CD_NONE) { | 1806 | if (soldier.m_combat_walking != CD_NONE) { |
768 | 1807 | soldier.m_combat_walkstart = fr.signed_32(); | 1807 | soldier.m_combat_walkstart = fr.unsigned_32(); |
769 | 1808 | soldier.m_combat_walkend = fr.signed_32(); | 1808 | soldier.m_combat_walkend = fr.unsigned_32(); |
770 | 1809 | } | 1809 | } |
771 | 1810 | 1810 | ||
772 | 1811 | m_battle = fr.unsigned_32(); | 1811 | m_battle = fr.unsigned_32(); |
773 | @@ -1856,8 +1856,8 @@ | |||
774 | 1856 | 1856 | ||
775 | 1857 | fw.unsigned_8(m_combat_walking); | 1857 | fw.unsigned_8(m_combat_walking); |
776 | 1858 | if (m_combat_walking != CD_NONE) { | 1858 | if (m_combat_walking != CD_NONE) { |
779 | 1859 | fw.signed_32(m_combat_walkstart); | 1859 | fw.unsigned_32(m_combat_walkstart); |
780 | 1860 | fw.signed_32(m_combat_walkend); | 1860 | fw.unsigned_32(m_combat_walkend); |
781 | 1861 | } | 1861 | } |
782 | 1862 | 1862 | ||
783 | 1863 | fw.unsigned_32(mos.get_object_file_index_or_zero(m_battle)); | 1863 | fw.unsigned_32(mos.get_object_file_index_or_zero(m_battle)); |
784 | 1864 | 1864 | ||
785 | === modified file 'src/logic/soldier.h' | |||
786 | --- src/logic/soldier.h 2015-10-21 16:43:30 +0000 | |||
787 | +++ src/logic/soldier.h 2015-11-25 10:54:29 +0000 | |||
788 | @@ -278,8 +278,8 @@ | |||
789 | 278 | /// the new states. I thought that it is cleaner to have this variable | 278 | /// the new states. I thought that it is cleaner to have this variable |
790 | 279 | /// separate. | 279 | /// separate. |
791 | 280 | CombatWalkingDir m_combat_walking; | 280 | CombatWalkingDir m_combat_walking; |
794 | 281 | int32_t m_combat_walkstart; | 281 | uint32_t m_combat_walkstart; |
795 | 282 | int32_t m_combat_walkend; | 282 | uint32_t m_combat_walkend; |
796 | 283 | 283 | ||
797 | 284 | /** | 284 | /** |
798 | 285 | * If the soldier is involved in a challenge, it is assigned a battle | 285 | * If the soldier is involved in a challenge, it is assigned a battle |
799 | 286 | 286 | ||
800 | === modified file 'src/logic/worker.cc' | |||
801 | --- src/logic/worker.cc 2015-11-11 09:56:22 +0000 | |||
802 | +++ src/logic/worker.cc 2015-11-25 10:54:29 +0000 | |||
803 | @@ -1938,7 +1938,7 @@ | |||
804 | 1938 | for (;;) { | 1938 | for (;;) { |
805 | 1939 | const WorkerProgram & program = dynamic_cast<const WorkerProgram&>(*state.program); | 1939 | const WorkerProgram & program = dynamic_cast<const WorkerProgram&>(*state.program); |
806 | 1940 | 1940 | ||
808 | 1941 | if (static_cast<uint32_t>(state.ivar1) >= program.get_size()) | 1941 | if ((state.ivar1 >= 0) && (static_cast<uint32_t>(state.ivar1) >= program.get_size())) |
809 | 1942 | return pop_task(game); | 1942 | return pop_task(game); |
810 | 1943 | 1943 | ||
811 | 1944 | const Action & action = *program.get_action(state.ivar1); | 1944 | const Action & action = *program.get_action(state.ivar1); |
812 | @@ -2613,7 +2613,7 @@ | |||
813 | 2613 | } | 2613 | } |
814 | 2614 | } | 2614 | } |
815 | 2615 | 2615 | ||
817 | 2616 | if (state.ivar1 < game.get_gametime()) { // time to die? | 2616 | if ((state.ivar1 < 0) || (static_cast<uint32_t>(state.ivar1) < game.get_gametime())) { // time to die? |
818 | 2617 | molog("[fugitive]: die\n"); | 2617 | molog("[fugitive]: die\n"); |
819 | 2618 | return schedule_destroy(game); | 2618 | return schedule_destroy(game); |
820 | 2619 | } | 2619 | } |
821 | 2620 | 2620 | ||
822 | === modified file 'src/network/netclient.cc' | |||
823 | --- src/network/netclient.cc 2015-11-08 17:31:06 +0000 | |||
824 | +++ src/network/netclient.cc 2015-11-25 10:54:29 +0000 | |||
825 | @@ -82,7 +82,7 @@ | |||
826 | 82 | bool server_is_waiting; | 82 | bool server_is_waiting; |
827 | 83 | 83 | ||
828 | 84 | /// Data for the last time message we sent. | 84 | /// Data for the last time message we sent. |
830 | 85 | int32_t lasttimestamp; | 85 | uint32_t lasttimestamp; |
831 | 86 | uint32_t lasttimestamp_realtime; | 86 | uint32_t lasttimestamp_realtime; |
832 | 87 | 87 | ||
833 | 88 | /// The real target speed, in milliseconds per second. | 88 | /// The real target speed, in milliseconds per second. |
834 | @@ -253,7 +253,7 @@ | |||
835 | 253 | 253 | ||
836 | 254 | if | 254 | if |
837 | 255 | (d->server_is_waiting && | 255 | (d->server_is_waiting && |
839 | 256 | d->game->get_gametime() == d->time.networktime()) | 256 | d->game->get_gametime() == static_cast<uint32_t>(d->time.networktime())) |
840 | 257 | { | 257 | { |
841 | 258 | send_time(); | 258 | send_time(); |
842 | 259 | d->server_is_waiting = false; | 259 | d->server_is_waiting = false; |
843 | 260 | 260 | ||
844 | === modified file 'src/network/nethost.cc' | |||
845 | --- src/network/nethost.cc 2015-11-08 17:31:06 +0000 | |||
846 | +++ src/network/nethost.cc 2015-11-25 10:54:29 +0000 | |||
847 | @@ -2458,7 +2458,7 @@ | |||
848 | 2458 | 2458 | ||
849 | 2459 | void NetHost::syncreport() | 2459 | void NetHost::syncreport() |
850 | 2460 | { | 2460 | { |
852 | 2461 | assert(d->game->get_gametime() == d->syncreport_time); | 2461 | assert(d->game->get_gametime() == static_cast<uint32_t>(d->syncreport_time)); |
853 | 2462 | 2462 | ||
854 | 2463 | d->syncreport = d->game->get_sync_hash(); | 2463 | d->syncreport = d->game->get_sync_hash(); |
855 | 2464 | d->syncreport_arrived = true; | 2464 | d->syncreport_arrived = true; |
856 | 2465 | 2465 | ||
857 | === modified file 'src/network/network.cc' | |||
858 | --- src/network/network.cc 2015-11-08 17:31:06 +0000 | |||
859 | +++ src/network/network.cc 2015-11-25 10:54:29 +0000 | |||
860 | @@ -24,7 +24,7 @@ | |||
861 | 24 | 24 | ||
862 | 25 | 25 | ||
863 | 26 | 26 | ||
865 | 27 | CmdNetCheckSync::CmdNetCheckSync(int32_t const dt, SyncCallback * const cb) : | 27 | CmdNetCheckSync::CmdNetCheckSync(uint32_t const dt, SyncCallback * const cb) : |
866 | 28 | Command (dt), m_callback(cb) | 28 | Command (dt), m_callback(cb) |
867 | 29 | {} | 29 | {} |
868 | 30 | 30 | ||
869 | 31 | 31 | ||
870 | === modified file 'src/network/network.h' | |||
871 | --- src/network/network.h 2015-11-08 17:31:06 +0000 | |||
872 | +++ src/network/network.h 2015-11-25 10:54:29 +0000 | |||
873 | @@ -45,7 +45,7 @@ | |||
874 | 45 | * to schedule taking a synchronization hash. | 45 | * to schedule taking a synchronization hash. |
875 | 46 | */ | 46 | */ |
876 | 47 | struct CmdNetCheckSync : public Widelands::Command { | 47 | struct CmdNetCheckSync : public Widelands::Command { |
878 | 48 | CmdNetCheckSync (int32_t dt, SyncCallback *); | 48 | CmdNetCheckSync (uint32_t dt, SyncCallback *); |
879 | 49 | 49 | ||
880 | 50 | void execute (Widelands::Game &) override; | 50 | void execute (Widelands::Game &) override; |
881 | 51 | 51 |
I am bit nervous about all that static_casts. All variable that can be reworked to uint32_t should be reworked. I know this might be a lot of work...
Alternativelly I would vote for assert(x>=0) before all (remaining) static_casts. To be on safe side...