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

Proposed by GunChleoc
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
Reviewer Review Type Date Requested Status
TiborB Approve
GunChleoc Needs Resubmitting
Review via email: mp+278240@code.launchpad.net

Description of the change

Fixed compiler warnings.

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

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...

Revision history for this message
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.

Revision history for this message
GunChleoc (gunchleoc) wrote :

This should be ready for review again. I found a nice article on comparing signed and unsigned values:

http://jwwalker.com/pages/safe-compare.html

So, I made the remaining comparisions safe (where it was not easy or not possible to change the data type).

review: Needs Resubmitting
Revision history for this message
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?

Revision history for this message
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.

Revision history for this message
TiborB (tiborb95) wrote :

OK, if you tried and it was complicated - good for me..

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/ai/ai_help_structs.h'
--- src/ai/ai_help_structs.h 2015-11-21 18:25:56 +0000
+++ src/ai/ai_help_structs.h 2015-11-25 10:54:29 +0000
@@ -446,8 +446,8 @@
446446
447 // used to track amount of wares produced by building447 // used to track amount of wares produced by building
448 uint32_t stocklevel_;448 uint32_t stocklevel_;
449 int32_t stocklevel_time; // time when stocklevel_ was last time recalculated449 uint32_t stocklevel_time; // time when stocklevel_ was last time recalculated
450 int32_t last_dismantle_time_;450 uint32_t last_dismantle_time_;
451 int32_t construction_decision_time_;451 int32_t construction_decision_time_;
452452
453 uint32_t unoccupied_count_;453 uint32_t unoccupied_count_;
454454
=== modified file 'src/economy/cmd_call_economy_balance.cc'
--- src/economy/cmd_call_economy_balance.cc 2015-10-24 15:42:37 +0000
+++ src/economy/cmd_call_economy_balance.cc 2015-11-25 10:54:29 +0000
@@ -31,7 +31,7 @@
31namespace Widelands {31namespace Widelands {
3232
33CmdCallEconomyBalance::CmdCallEconomyBalance33CmdCallEconomyBalance::CmdCallEconomyBalance
34 (int32_t const starttime, Economy * const economy, uint32_t const timerid)34 (uint32_t const starttime, Economy * const economy, uint32_t const timerid)
35 : GameLogicCommand(starttime)35 : GameLogicCommand(starttime)
36{36{
37 m_flag = economy->get_arbitrary_flag();37 m_flag = economy->get_arbitrary_flag();
3838
=== modified file 'src/economy/cmd_call_economy_balance.h'
--- src/economy/cmd_call_economy_balance.h 2014-09-19 12:54:54 +0000
+++ src/economy/cmd_call_economy_balance.h 2015-11-25 10:54:29 +0000
@@ -33,7 +33,7 @@
33struct CmdCallEconomyBalance : public GameLogicCommand {33struct CmdCallEconomyBalance : public GameLogicCommand {
34 CmdCallEconomyBalance () : GameLogicCommand(0), m_timerid(0) {} ///< for load and save34 CmdCallEconomyBalance () : GameLogicCommand(0), m_timerid(0) {} ///< for load and save
3535
36 CmdCallEconomyBalance (int32_t starttime, Economy *, uint32_t timerid);36 CmdCallEconomyBalance (uint32_t starttime, Economy *, uint32_t timerid);
3737
38 void execute (Game &) override;38 void execute (Game &) override;
3939
4040
=== modified file 'src/game_io/game_cmd_queue_packet.cc'
--- src/game_io/game_cmd_queue_packet.cc 2015-10-24 15:42:37 +0000
+++ src/game_io/game_cmd_queue_packet.cc 2015-11-25 10:54:29 +0000
@@ -94,7 +94,7 @@
94 // Write all commands94 // Write all commands
9595
96 // Find all the items in the current cmdqueue96 // Find all the items in the current cmdqueue
97 int32_t time = game.get_gametime();97 uint32_t time = game.get_gametime();
98 size_t nhandled = 0;98 size_t nhandled = 0;
9999
100 while (nhandled < cmdq.m_ncmds) {100 while (nhandled < cmdq.m_ncmds) {
101101
=== modified file 'src/logic/bob.cc'
--- src/logic/bob.cc 2015-10-25 08:06:00 +0000
+++ src/logic/bob.cc 2015-11-25 10:54:29 +0000
@@ -760,7 +760,7 @@
760760
761void Bob::move_update(Game & game, State &)761void Bob::move_update(Game & game, State &)
762{762{
763 if (m_walkend <= game.get_gametime()) {763 if (static_cast<uint32_t>(m_walkend) <= game.get_gametime()) {
764 end_walk();764 end_walk();
765 return pop_task(game);765 return pop_task(game);
766 } else766 } else
@@ -822,7 +822,7 @@
822 spos.y += end.field->get_height() * HEIGHT_FACTOR;822 spos.y += end.field->get_height() * HEIGHT_FACTOR;
823 spos.y -= start.field->get_height() * HEIGHT_FACTOR;823 spos.y -= start.field->get_height() * HEIGHT_FACTOR;
824824
825 assert(m_walkstart <= game.get_gametime());825 assert(static_cast<uint32_t>(m_walkstart) <= game.get_gametime());
826 assert(m_walkstart < m_walkend);826 assert(m_walkstart < m_walkend);
827 float f =827 float f =
828 static_cast<float>(game.get_gametime() - m_walkstart)828 static_cast<float>(game.get_gametime() - m_walkstart)
829829
=== modified file 'src/logic/cmd_calculate_statistics.h'
--- src/logic/cmd_calculate_statistics.h 2015-01-31 16:03:59 +0000
+++ src/logic/cmd_calculate_statistics.h 2015-11-25 10:54:29 +0000
@@ -28,7 +28,7 @@
2828
29struct CmdCalculateStatistics : public GameLogicCommand {29struct CmdCalculateStatistics : public GameLogicCommand {
30 CmdCalculateStatistics() : GameLogicCommand(0) {} // For savegame loading30 CmdCalculateStatistics() : GameLogicCommand(0) {} // For savegame loading
31 CmdCalculateStatistics(int32_t const _duetime) :31 CmdCalculateStatistics(uint32_t const _duetime) :
32 GameLogicCommand(_duetime) {}32 GameLogicCommand(_duetime) {}
3333
34 // Write these commands to a file (for savegames)34 // Write these commands to a file (for savegames)
3535
=== modified file 'src/logic/cmd_delete_message.h'
--- src/logic/cmd_delete_message.h 2014-09-29 12:37:07 +0000
+++ src/logic/cmd_delete_message.h 2015-11-25 10:54:29 +0000
@@ -37,7 +37,7 @@
37/// the savegame.37/// the savegame.
38struct CmdDeleteMessage : public Command {38struct CmdDeleteMessage : public Command {
39 CmdDeleteMessage39 CmdDeleteMessage
40 (int32_t const t, PlayerNumber const p, MessageId const m)40 (uint32_t const t, PlayerNumber const p, MessageId const m)
41 : Command(t), player(p), message(m)41 : Command(t), player(p), message(m)
42 {}42 {}
4343
4444
=== modified file 'src/logic/cmd_incorporate.h'
--- src/logic/cmd_incorporate.h 2014-10-03 17:26:18 +0000
+++ src/logic/cmd_incorporate.h 2015-11-25 10:54:29 +0000
@@ -27,7 +27,7 @@
2727
28struct CmdIncorporate : public GameLogicCommand {28struct CmdIncorporate : public GameLogicCommand {
29 CmdIncorporate() : GameLogicCommand(0), worker(nullptr) {} // For savegame loading29 CmdIncorporate() : GameLogicCommand(0), worker(nullptr) {} // For savegame loading
30 CmdIncorporate (int32_t const t, Worker * const w)30 CmdIncorporate (uint32_t const t, Worker * const w)
31 : GameLogicCommand(t), worker(w)31 : GameLogicCommand(t), worker(w)
32 {}32 {}
3333
3434
=== modified file 'src/logic/cmd_luacoroutine.h'
--- src/logic/cmd_luacoroutine.h 2015-01-31 16:03:59 +0000
+++ src/logic/cmd_luacoroutine.h 2015-11-25 10:54:29 +0000
@@ -29,7 +29,7 @@
2929
30struct CmdLuaCoroutine : public GameLogicCommand {30struct CmdLuaCoroutine : public GameLogicCommand {
31 CmdLuaCoroutine() : GameLogicCommand(0), m_cr(nullptr) {} // For savegame loading31 CmdLuaCoroutine() : GameLogicCommand(0), m_cr(nullptr) {} // For savegame loading
32 CmdLuaCoroutine(int32_t const _duetime, LuaCoroutine * const cr) :32 CmdLuaCoroutine(uint32_t const _duetime, LuaCoroutine * const cr) :
33 GameLogicCommand(_duetime), m_cr(cr) {}33 GameLogicCommand(_duetime), m_cr(cr) {}
3434
35 ~CmdLuaCoroutine() {35 ~CmdLuaCoroutine() {
3636
=== modified file 'src/logic/cmd_luascript.h'
--- src/logic/cmd_luascript.h 2014-09-19 12:54:54 +0000
+++ src/logic/cmd_luascript.h 2015-11-25 10:54:29 +0000
@@ -29,7 +29,7 @@
29struct CmdLuaScript : public GameLogicCommand {29struct CmdLuaScript : public GameLogicCommand {
30 CmdLuaScript() : GameLogicCommand(0) {} // For savegame loading30 CmdLuaScript() : GameLogicCommand(0) {} // For savegame loading
31 CmdLuaScript31 CmdLuaScript
32 (int32_t const _duetime, const std::string& script) :32 (uint32_t const _duetime, const std::string& script) :
33 GameLogicCommand(_duetime), script_(script) {}33 GameLogicCommand(_duetime), script_(script) {}
3434
35 // Write these commands to a file (for savegames)35 // Write these commands to a file (for savegames)
3636
=== modified file 'src/logic/cmd_queue.cc'
--- src/logic/cmd_queue.cc 2015-11-14 15:58:29 +0000
+++ src/logic/cmd_queue.cc 2015-11-25 10:54:29 +0000
@@ -98,9 +98,8 @@
98 ++ m_ncmds;98 ++ m_ncmds;
99}99}
100100
101int32_t CmdQueue::run_queue(int32_t const interval, uint32_t & game_time_var) {101void CmdQueue::run_queue(int32_t const interval, uint32_t & game_time_var) {
102 uint32_t const final = game_time_var + interval;102 uint32_t const final = game_time_var + interval;
103 int32_t cnt = 0;
104103
105 while (game_time_var < final) {104 while (game_time_var < final) {
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];
@@ -131,8 +130,6 @@
131130
132 assert(final - game_time_var == 0);131 assert(final - game_time_var == 0);
133 game_time_var = final;132 game_time_var = final;
134
135 return cnt;
136}133}
137134
138135
@@ -173,7 +170,7 @@
173 uint16_t const packet_version = fr.unsigned_16();170 uint16_t const packet_version = fr.unsigned_16();
174 if (packet_version == kCurrentPacketVersion) {171 if (packet_version == kCurrentPacketVersion) {
175 set_duetime(fr.unsigned_32());172 set_duetime(fr.unsigned_32());
176 int32_t const gametime = egbase.get_gametime();173 uint32_t const gametime = egbase.get_gametime();
177 if (duetime() < gametime)174 if (duetime() < gametime)
178 throw GameDataError175 throw GameDataError
179 ("duetime (%i) < gametime (%i)", duetime(), gametime);176 ("duetime (%i) < gametime (%i)", duetime(), gametime);
180177
=== modified file 'src/logic/cmd_queue.h'
--- src/logic/cmd_queue.h 2015-11-14 15:58:29 +0000
+++ src/logic/cmd_queue.h 2015-11-25 10:54:29 +0000
@@ -85,17 +85,17 @@
85 * the same for all parallel simulation.85 * the same for all parallel simulation.
86 */86 */
87struct Command {87struct Command {
88 Command (const int32_t _duetime) : m_duetime(_duetime) {}88 Command (const uint32_t _duetime) : m_duetime(_duetime) {}
89 virtual ~Command ();89 virtual ~Command ();
9090
91 virtual void execute (Game &) = 0;91 virtual void execute (Game &) = 0;
92 virtual uint8_t id() const = 0;92 virtual uint8_t id() const = 0;
9393
94 int32_t duetime() const {return m_duetime;}94 uint32_t duetime() const {return m_duetime;}
95 void set_duetime(int32_t const t) {m_duetime = t;}95 void set_duetime(uint32_t const t) {m_duetime = t;}
9696
97private:97private:
98 int32_t m_duetime;98 uint32_t m_duetime;
99};99};
100100
101101
@@ -107,7 +107,7 @@
107 * for all instances of a game to ensure parallel simulation.107 * for all instances of a game to ensure parallel simulation.
108 */108 */
109struct GameLogicCommand : public Command {109struct GameLogicCommand : public Command {
110 GameLogicCommand (int32_t const _duetime) : Command(_duetime) {}110 GameLogicCommand (uint32_t const _duetime) : Command(_duetime) {}
111111
112 // Write these commands to a file (for savegames)112 // Write these commands to a file (for savegames)
113 virtual void write113 virtual void write
@@ -158,7 +158,7 @@
158 // the internal time as well. the game_time_var represents the current game158 // the internal time as well. the game_time_var represents the current game
159 // time, which we update and with which we must mess around (to run all159 // time, which we update and with which we must mess around (to run all
160 // queued cmd.s) and which we update (add the interval)160 // queued cmd.s) and which we update (add the interval)
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);
162162
163 void flush(); // delete all commands in the queue now163 void flush(); // delete all commands in the queue now
164164
165165
=== modified file 'src/logic/constructionsite.cc'
--- src/logic/constructionsite.cc 2015-11-11 09:53:54 +0000
+++ src/logic/constructionsite.cc 2015-11-25 10:54:29 +0000
@@ -322,7 +322,6 @@
322void ConstructionSite::draw322void ConstructionSite::draw
323 (const EditorGameBase & game, RenderTarget & dst, const FCoords& coords, const Point& pos)323 (const EditorGameBase & game, RenderTarget & dst, const FCoords& coords, const Point& pos)
324{324{
325 assert(0 <= game.get_gametime());
326 const uint32_t gametime = game.get_gametime();325 const uint32_t gametime = game.get_gametime();
327 uint32_t tanim = gametime - m_animstart;326 uint32_t tanim = gametime - m_animstart;
328327
329328
=== modified file 'src/logic/dismantlesite.cc'
--- src/logic/dismantlesite.cc 2015-11-11 09:53:54 +0000
+++ src/logic/dismantlesite.cc 2015-11-25 10:54:29 +0000
@@ -232,7 +232,6 @@
232void DismantleSite::draw232void DismantleSite::draw
233 (const EditorGameBase& game, RenderTarget& dst, const FCoords& coords, const Point& pos)233 (const EditorGameBase& game, RenderTarget& dst, const FCoords& coords, const Point& pos)
234{234{
235 assert(0 <= game.get_gametime());
236 const uint32_t gametime = game.get_gametime();235 const uint32_t gametime = game.get_gametime();
237 uint32_t tanim = gametime - m_animstart;236 uint32_t tanim = gametime - m_animstart;
238237
239238
=== modified file 'src/logic/immovable.cc'
--- src/logic/immovable.cc 2015-11-14 15:58:29 +0000
+++ src/logic/immovable.cc 2015-11-25 10:54:29 +0000
@@ -524,7 +524,7 @@
524==============================524==============================
525*/525*/
526526
527constexpr uint8_t kCurrentPacketVersionImmovable = 6;527constexpr uint8_t kCurrentPacketVersionImmovable = 7;
528528
529// Supporting older versions for map loading529// Supporting older versions for map loading
530void Immovable::Loader::load(FileRead & fr, uint8_t const packet_version)530void Immovable::Loader::load(FileRead & fr, uint8_t const packet_version)
@@ -596,9 +596,13 @@
596 }596 }
597 }597 }
598598
599 imm.m_program_step = fr.signed_32();599 if (packet_version > 6) {
600 imm.m_program_step = fr.unsigned_32();
601 } else {
602 imm.m_program_step = fr.signed_32();
603 }
600604
601 if (packet_version >= 3 && packet_version <= 5){605 if (packet_version >= 3 && packet_version <= 5) {
602 imm.m_reserved_by_worker = fr.unsigned_8();606 imm.m_reserved_by_worker = fr.unsigned_8();
603 }607 }
604 if (packet_version >= 4) {608 if (packet_version >= 4) {
@@ -661,7 +665,7 @@
661 fw.string(m_program ? m_program->name() : "");665 fw.string(m_program ? m_program->name() : "");
662666
663 fw.unsigned_32(m_program_ptr);667 fw.unsigned_32(m_program_ptr);
664 fw.signed_32(m_program_step);668 fw.unsigned_32(m_program_step);
665669
666 if (m_action_data) {670 if (m_action_data) {
667 fw.c_string(m_action_data->name());671 fw.c_string(m_action_data->name());
668672
=== modified file 'src/logic/immovable.h'
--- src/logic/immovable.h 2015-11-11 09:52:55 +0000
+++ src/logic/immovable.h 2015-11-25 10:54:29 +0000
@@ -239,7 +239,7 @@
239#else239#else
240 uint32_t m_anim_construction_total;240 uint32_t m_anim_construction_total;
241 uint32_t m_anim_construction_done;241 uint32_t m_anim_construction_done;
242 int32_t m_program_step; ///< time of next step242 uint32_t m_program_step; ///< time of next step
243#endif243#endif
244 std::string m_construct_string;244 std::string m_construct_string;
245245
246246
=== modified file 'src/logic/instances.cc'
--- src/logic/instances.cc 2015-11-20 18:16:22 +0000
+++ src/logic/instances.cc 2015-11-25 10:54:29 +0000
@@ -40,7 +40,7 @@
40namespace Widelands {40namespace Widelands {
4141
42CmdDestroyMapObject::CmdDestroyMapObject42CmdDestroyMapObject::CmdDestroyMapObject
43 (int32_t const t, MapObject & o)43 (uint32_t const t, MapObject & o)
44 : GameLogicCommand(t), obj_serial(o.serial())44 : GameLogicCommand(t), obj_serial(o.serial())
45{}45{}
4646
@@ -90,7 +90,7 @@
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)));
91}91}
9292
93CmdAct::CmdAct(int32_t const t, MapObject & o, int32_t const a) :93CmdAct::CmdAct(uint32_t const t, MapObject & o, int32_t const a) :
94 GameLogicCommand(t), obj_serial(o.serial()), arg(a)94 GameLogicCommand(t), obj_serial(o.serial()), arg(a)
95{}95{}
9696
9797
=== modified file 'src/logic/instances.h'
--- src/logic/instances.h 2015-10-24 21:42:55 +0000
+++ src/logic/instances.h 2015-11-25 10:54:29 +0000
@@ -307,15 +307,6 @@
307 HeaderFleet = 11,307 HeaderFleet = 11,
308 };308 };
309309
310 protected:
311 /**
312 * MapObjects like trees are reserved by a worker that is walking
313 * towards them, so that e.g. two lumberjacks don't attempt to
314 * work on the same tree simultaneously or two hunters try to hunt
315 * the same animal.
316 */
317 bool m_reserved_by_worker;
318
319 public:310 public:
320311
321 /**312 /**
@@ -394,6 +385,14 @@
394 Serial m_serial;385 Serial m_serial;
395 LogSink * m_logsink;386 LogSink * m_logsink;
396387
388 /**
389 * MapObjects like trees are reserved by a worker that is walking
390 * towards them, so that e.g. two lumberjacks don't attempt to
391 * work on the same tree simultaneously or two hunters try to hunt
392 * the same animal.
393 */
394 bool m_reserved_by_worker;
395
397private:396private:
398 DISALLOW_COPY_AND_ASSIGN(MapObject);397 DISALLOW_COPY_AND_ASSIGN(MapObject);
399};398};
@@ -515,7 +514,7 @@
515514
516struct CmdDestroyMapObject : public GameLogicCommand {515struct CmdDestroyMapObject : public GameLogicCommand {
517 CmdDestroyMapObject() : GameLogicCommand(0), obj_serial(0) {} ///< For savegame loading516 CmdDestroyMapObject() : GameLogicCommand(0), obj_serial(0) {} ///< For savegame loading
518 CmdDestroyMapObject (int32_t t, MapObject &);517 CmdDestroyMapObject (uint32_t t, MapObject &);
519 void execute (Game &) override;518 void execute (Game &) override;
520519
521 void write(FileWrite &, EditorGameBase &, MapObjectSaver &) override;520 void write(FileWrite &, EditorGameBase &, MapObjectSaver &) override;
@@ -529,7 +528,7 @@
529528
530struct CmdAct : public GameLogicCommand {529struct CmdAct : public GameLogicCommand {
531 CmdAct() : GameLogicCommand(0), obj_serial(0), arg(0) {} ///< For savegame loading530 CmdAct() : GameLogicCommand(0), obj_serial(0), arg(0) {} ///< For savegame loading
532 CmdAct (int32_t t, MapObject &, int32_t a);531 CmdAct (uint32_t t, MapObject &, int32_t a);
533532
534 void execute (Game &) override;533 void execute (Game &) override;
535534
536535
=== modified file 'src/logic/playercommand.cc'
--- src/logic/playercommand.cc 2015-11-11 09:52:55 +0000
+++ src/logic/playercommand.cc 2015-11-25 10:54:29 +0000
@@ -93,7 +93,7 @@
9393
94/*** class PlayerCommand ***/94/*** class PlayerCommand ***/
9595
96PlayerCommand::PlayerCommand (const int32_t time, const PlayerNumber s)96PlayerCommand::PlayerCommand (const uint32_t time, const PlayerNumber s)
97 : GameLogicCommand (time), m_sender(s), m_cmdserial(0)97 : GameLogicCommand (time), m_sender(s), m_cmdserial(0)
98{}98{}
9999
@@ -330,7 +330,7 @@
330330
331/*** class Cmd_BuildRoad ***/331/*** class Cmd_BuildRoad ***/
332332
333CmdBuildRoad::CmdBuildRoad (int32_t t, int32_t p, Path & pa) :333CmdBuildRoad::CmdBuildRoad (uint32_t t, int32_t p, Path & pa) :
334PlayerCommand(t, p),334PlayerCommand(t, p),
335path (&pa),335path (&pa),
336start (pa.get_start()),336start (pa.get_start()),
@@ -1122,7 +1122,7 @@
11221122
1123/*** class Cmd_SetWarePriority ***/1123/*** class Cmd_SetWarePriority ***/
1124CmdSetWarePriority::CmdSetWarePriority1124CmdSetWarePriority::CmdSetWarePriority
1125 (const int32_t _duetime, const PlayerNumber _sender,1125 (const uint32_t _duetime, const PlayerNumber _sender,
1126 PlayerImmovable & imm,1126 PlayerImmovable & imm,
1127 const int32_t type, const DescriptionIndex index, const int32_t priority)1127 const int32_t type, const DescriptionIndex index, const int32_t priority)
1128 :1128 :
@@ -1201,7 +1201,7 @@
12011201
1202/*** class Cmd_SetWareMaxFill ***/1202/*** class Cmd_SetWareMaxFill ***/
1203CmdSetWareMaxFill::CmdSetWareMaxFill1203CmdSetWareMaxFill::CmdSetWareMaxFill
1204 (const int32_t _duetime, const PlayerNumber _sender,1204 (const uint32_t _duetime, const PlayerNumber _sender,
1205 PlayerImmovable & imm,1205 PlayerImmovable & imm,
1206 const DescriptionIndex index, const uint32_t max_fill)1206 const DescriptionIndex index, const uint32_t max_fill)
1207 :1207 :
@@ -1274,7 +1274,7 @@
12741274
12751275
1276CmdChangeTargetQuantity::CmdChangeTargetQuantity1276CmdChangeTargetQuantity::CmdChangeTargetQuantity
1277 (const int32_t _duetime, const PlayerNumber _sender,1277 (const uint32_t _duetime, const PlayerNumber _sender,
1278 const uint32_t _economy, const DescriptionIndex _ware_type)1278 const uint32_t _economy, const DescriptionIndex _ware_type)
1279 :1279 :
1280 PlayerCommand(_duetime, _sender),1280 PlayerCommand(_duetime, _sender),
@@ -1319,7 +1319,7 @@
13191319
13201320
1321CmdSetWareTargetQuantity::CmdSetWareTargetQuantity1321CmdSetWareTargetQuantity::CmdSetWareTargetQuantity
1322 (const int32_t _duetime, const PlayerNumber _sender,1322 (const uint32_t _duetime, const PlayerNumber _sender,
1323 const uint32_t _economy,1323 const uint32_t _economy,
1324 const DescriptionIndex _ware_type,1324 const DescriptionIndex _ware_type,
1325 const uint32_t _permanent)1325 const uint32_t _permanent)
@@ -1381,7 +1381,7 @@
13811381
13821382
1383CmdResetWareTargetQuantity::CmdResetWareTargetQuantity1383CmdResetWareTargetQuantity::CmdResetWareTargetQuantity
1384 (const int32_t _duetime, const PlayerNumber _sender,1384 (const uint32_t _duetime, const PlayerNumber _sender,
1385 const uint32_t _economy,1385 const uint32_t _economy,
1386 const DescriptionIndex _ware_type)1386 const DescriptionIndex _ware_type)
1387 :1387 :
@@ -1437,7 +1437,7 @@
14371437
14381438
1439CmdSetWorkerTargetQuantity::CmdSetWorkerTargetQuantity1439CmdSetWorkerTargetQuantity::CmdSetWorkerTargetQuantity
1440 (const int32_t _duetime, const PlayerNumber _sender,1440 (const uint32_t _duetime, const PlayerNumber _sender,
1441 const uint32_t _economy,1441 const uint32_t _economy,
1442 const DescriptionIndex _ware_type,1442 const DescriptionIndex _ware_type,
1443 const uint32_t _permanent)1443 const uint32_t _permanent)
@@ -1499,7 +1499,7 @@
14991499
15001500
1501CmdResetWorkerTargetQuantity::CmdResetWorkerTargetQuantity1501CmdResetWorkerTargetQuantity::CmdResetWorkerTargetQuantity
1502 (const int32_t _duetime, const PlayerNumber _sender,1502 (const uint32_t _duetime, const PlayerNumber _sender,
1503 const uint32_t _economy,1503 const uint32_t _economy,
1504 const DescriptionIndex _ware_type)1504 const DescriptionIndex _ware_type)
1505 :1505 :
@@ -1894,7 +1894,7 @@
18941894
1895/*** struct Cmd_SetStockPolicy ***/1895/*** struct Cmd_SetStockPolicy ***/
1896CmdSetStockPolicy::CmdSetStockPolicy1896CmdSetStockPolicy::CmdSetStockPolicy
1897 (int32_t time, PlayerNumber p,1897 (uint32_t time, PlayerNumber p,
1898 Warehouse & wh, bool isworker, DescriptionIndex ware,1898 Warehouse & wh, bool isworker, DescriptionIndex ware,
1899 Warehouse::StockPolicy policy)1899 Warehouse::StockPolicy policy)
1900: PlayerCommand(time, p)1900: PlayerCommand(time, p)
19011901
=== modified file 'src/logic/playercommand.h'
--- src/logic/playercommand.h 2015-11-11 09:53:54 +0000
+++ src/logic/playercommand.h 2015-11-25 10:54:29 +0000
@@ -44,7 +44,7 @@
44 */44 */
45class PlayerCommand : public GameLogicCommand {45class PlayerCommand : public GameLogicCommand {
46public:46public:
47 PlayerCommand (int32_t time, PlayerNumber);47 PlayerCommand (uint32_t time, PlayerNumber);
4848
49 /// For savegame loading49 /// For savegame loading
50 PlayerCommand() : GameLogicCommand(0), m_sender(0), m_cmdserial(0) {}50 PlayerCommand() : GameLogicCommand(0), m_sender(0), m_cmdserial(0) {}
@@ -68,7 +68,7 @@
68struct CmdBulldoze:public PlayerCommand {68struct CmdBulldoze:public PlayerCommand {
69 CmdBulldoze() : PlayerCommand(), serial(0), recurse(0) {} // For savegame loading69 CmdBulldoze() : PlayerCommand(), serial(0), recurse(0) {} // For savegame loading
70 CmdBulldoze70 CmdBulldoze
71 (const int32_t t, const int32_t p,71 (const uint32_t t, const int32_t p,
72 PlayerImmovable & pi,72 PlayerImmovable & pi,
73 const bool _recurse = false)73 const bool _recurse = false)
74 : PlayerCommand(t, p), serial(pi.serial()), recurse(_recurse)74 : PlayerCommand(t, p), serial(pi.serial()), recurse(_recurse)
@@ -92,7 +92,7 @@
92struct CmdBuild:public PlayerCommand {92struct CmdBuild:public PlayerCommand {
93 CmdBuild() : PlayerCommand() {} // For savegame loading93 CmdBuild() : PlayerCommand() {} // For savegame loading
94 CmdBuild94 CmdBuild
95 (const int32_t _duetime,95 (const uint32_t _duetime,
96 const int32_t p,96 const int32_t p,
97 const Coords c,97 const Coords c,
98 const DescriptionIndex i)98 const DescriptionIndex i)
@@ -116,7 +116,7 @@
116116
117struct CmdBuildFlag:public PlayerCommand {117struct CmdBuildFlag:public PlayerCommand {
118 CmdBuildFlag() : PlayerCommand() {} // For savegame loading118 CmdBuildFlag() : PlayerCommand() {} // For savegame loading
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) :
120 PlayerCommand(t, p), coords(c)120 PlayerCommand(t, p), coords(c)
121 {}121 {}
122122
@@ -137,7 +137,7 @@
137struct CmdBuildRoad:public PlayerCommand {137struct CmdBuildRoad:public PlayerCommand {
138 CmdBuildRoad() :138 CmdBuildRoad() :
139 PlayerCommand(), path(nullptr), start(), nsteps(0), steps(nullptr) {} // For savegame loading139 PlayerCommand(), path(nullptr), start(), nsteps(0), steps(nullptr) {} // For savegame loading
140 CmdBuildRoad (int32_t, int32_t, Path &);140 CmdBuildRoad (uint32_t, int32_t, Path &);
141 CmdBuildRoad (StreamRead &);141 CmdBuildRoad (StreamRead &);
142142
143 virtual ~CmdBuildRoad ();143 virtual ~CmdBuildRoad ();
@@ -159,7 +159,7 @@
159159
160struct CmdFlagAction : public PlayerCommand {160struct CmdFlagAction : public PlayerCommand {
161 CmdFlagAction() : PlayerCommand(), serial(0) {} // For savegame loading161 CmdFlagAction() : PlayerCommand(), serial(0) {} // For savegame loading
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) :
163 PlayerCommand(t, p), serial(f.serial())163 PlayerCommand(t, p), serial(f.serial())
164 {}164 {}
165165
@@ -180,7 +180,7 @@
180180
181struct CmdStartStopBuilding : public PlayerCommand {181struct CmdStartStopBuilding : public PlayerCommand {
182 CmdStartStopBuilding() : PlayerCommand(), serial(0) {} // For savegame loading182 CmdStartStopBuilding() : PlayerCommand(), serial(0) {} // For savegame loading
183 CmdStartStopBuilding (const int32_t t, const PlayerNumber p, Building & b)183 CmdStartStopBuilding (const uint32_t t, const PlayerNumber p, Building & b)
184 : PlayerCommand(t, p), serial(b.serial())184 : PlayerCommand(t, p), serial(b.serial())
185 {}185 {}
186186
@@ -200,7 +200,7 @@
200200
201struct CmdMilitarySiteSetSoldierPreference : public PlayerCommand {201struct CmdMilitarySiteSetSoldierPreference : public PlayerCommand {
202 CmdMilitarySiteSetSoldierPreference() : PlayerCommand(), serial(0) {} // For savegame loading202 CmdMilitarySiteSetSoldierPreference() : PlayerCommand(), serial(0) {} // For savegame loading
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)
204 : PlayerCommand(t, p), serial(b.serial()), preference(prefs)204 : PlayerCommand(t, p), serial(b.serial()), preference(prefs)
205 {}205 {}
206206
@@ -220,7 +220,7 @@
220};220};
221struct CmdStartOrCancelExpedition : public PlayerCommand {221struct CmdStartOrCancelExpedition : public PlayerCommand {
222 CmdStartOrCancelExpedition() : PlayerCommand() {} // For savegame loading222 CmdStartOrCancelExpedition() : PlayerCommand() {} // For savegame loading
223 CmdStartOrCancelExpedition (int32_t const t, PlayerNumber const p, Building & b)223 CmdStartOrCancelExpedition (uint32_t const t, PlayerNumber const p, Building & b)
224 : PlayerCommand(t, p), serial(b.serial())224 : PlayerCommand(t, p), serial(b.serial())
225 {}225 {}
226226
@@ -241,7 +241,7 @@
241struct CmdEnhanceBuilding:public PlayerCommand {241struct CmdEnhanceBuilding:public PlayerCommand {
242 CmdEnhanceBuilding() : PlayerCommand(), serial(0) {} // For savegame loading242 CmdEnhanceBuilding() : PlayerCommand(), serial(0) {} // For savegame loading
243 CmdEnhanceBuilding243 CmdEnhanceBuilding
244 (const int32_t _duetime,244 (const uint32_t _duetime,
245 const int32_t p,245 const int32_t p,
246 Building & b,246 Building & b,
247 const DescriptionIndex i)247 const DescriptionIndex i)
@@ -267,7 +267,7 @@
267struct CmdDismantleBuilding:public PlayerCommand {267struct CmdDismantleBuilding:public PlayerCommand {
268 CmdDismantleBuilding() : PlayerCommand(), serial(0) {} // For savegame loading268 CmdDismantleBuilding() : PlayerCommand(), serial(0) {} // For savegame loading
269 CmdDismantleBuilding269 CmdDismantleBuilding
270 (const int32_t t, const int32_t p,270 (const uint32_t t, const int32_t p,
271 PlayerImmovable & pi)271 PlayerImmovable & pi)
272 : PlayerCommand(t, p), serial(pi.serial())272 : PlayerCommand(t, p), serial(pi.serial())
273 {}273 {}
@@ -290,7 +290,7 @@
290struct CmdEvictWorker : public PlayerCommand {290struct CmdEvictWorker : public PlayerCommand {
291 CmdEvictWorker() : PlayerCommand(), serial(0) {} // For savegame loading291 CmdEvictWorker() : PlayerCommand(), serial(0) {} // For savegame loading
292 CmdEvictWorker292 CmdEvictWorker
293 (const int32_t t, const int32_t p,293 (const uint32_t t, const int32_t p,
294 Worker & w)294 Worker & w)
295 : PlayerCommand(t, p), serial(w.serial())295 : PlayerCommand(t, p), serial(w.serial())
296 {}296 {}
@@ -313,7 +313,7 @@
313struct CmdShipScoutDirection : public PlayerCommand {313struct CmdShipScoutDirection : public PlayerCommand {
314 CmdShipScoutDirection() : PlayerCommand(), serial(0) {} // For savegame loading314 CmdShipScoutDirection() : PlayerCommand(), serial(0) {} // For savegame loading
315 CmdShipScoutDirection315 CmdShipScoutDirection
316 (int32_t const t, PlayerNumber const p, Serial s, WalkingDir direction)316 (uint32_t const t, PlayerNumber const p, Serial s, WalkingDir direction)
317 : PlayerCommand(t, p), serial(s), dir(direction)317 : PlayerCommand(t, p), serial(s), dir(direction)
318 {}318 {}
319319
@@ -335,7 +335,7 @@
335struct CmdShipConstructPort : public PlayerCommand {335struct CmdShipConstructPort : public PlayerCommand {
336 CmdShipConstructPort() : PlayerCommand(), serial(0) {} // For savegame loading336 CmdShipConstructPort() : PlayerCommand(), serial(0) {} // For savegame loading
337 CmdShipConstructPort337 CmdShipConstructPort
338 (int32_t const t, PlayerNumber const p, Serial s, Coords c)338 (uint32_t const t, PlayerNumber const p, Serial s, Coords c)
339 : PlayerCommand(t, p), serial(s), coords(c)339 : PlayerCommand(t, p), serial(s), coords(c)
340 {}340 {}
341341
@@ -357,7 +357,7 @@
357struct CmdShipExploreIsland : public PlayerCommand {357struct CmdShipExploreIsland : public PlayerCommand {
358 CmdShipExploreIsland() : PlayerCommand(), serial(0) {} // For savegame loading358 CmdShipExploreIsland() : PlayerCommand(), serial(0) {} // For savegame loading
359 CmdShipExploreIsland359 CmdShipExploreIsland
360 (int32_t const t, PlayerNumber const p, Serial s, IslandExploreDirection direction)360 (uint32_t const t, PlayerNumber const p, Serial s, IslandExploreDirection direction)
361 : PlayerCommand(t, p), serial(s), island_explore_direction(direction)361 : PlayerCommand(t, p), serial(s), island_explore_direction(direction)
362 {}362 {}
363363
@@ -379,7 +379,7 @@
379struct CmdShipSink : public PlayerCommand {379struct CmdShipSink : public PlayerCommand {
380 CmdShipSink() : PlayerCommand(), serial(0) {} // For savegame loading380 CmdShipSink() : PlayerCommand(), serial(0) {} // For savegame loading
381 CmdShipSink381 CmdShipSink
382 (int32_t const t, PlayerNumber const p, Serial s)382 (uint32_t const t, PlayerNumber const p, Serial s)
383 : PlayerCommand(t, p), serial(s)383 : PlayerCommand(t, p), serial(s)
384 {}384 {}
385385
@@ -400,7 +400,7 @@
400struct CmdShipCancelExpedition : public PlayerCommand {400struct CmdShipCancelExpedition : public PlayerCommand {
401 CmdShipCancelExpedition() : PlayerCommand(), serial(0) {} // For savegame loading401 CmdShipCancelExpedition() : PlayerCommand(), serial(0) {} // For savegame loading
402 CmdShipCancelExpedition402 CmdShipCancelExpedition
403 (int32_t const t, PlayerNumber const p, Serial s)403 (uint32_t const t, PlayerNumber const p, Serial s)
404 : PlayerCommand(t, p), serial(s)404 : PlayerCommand(t, p), serial(s)
405 {}405 {}
406406
@@ -428,7 +428,7 @@
428 m_priority(0)428 m_priority(0)
429 {}429 {}
430 CmdSetWarePriority430 CmdSetWarePriority
431 (int32_t duetime, PlayerNumber sender,431 (uint32_t duetime, PlayerNumber sender,
432 PlayerImmovable &,432 PlayerImmovable &,
433 int32_t type, DescriptionIndex index, int32_t priority);433 int32_t type, DescriptionIndex index, int32_t priority);
434434
@@ -453,7 +453,7 @@
453struct CmdSetWareMaxFill : public PlayerCommand {453struct CmdSetWareMaxFill : public PlayerCommand {
454 CmdSetWareMaxFill() : PlayerCommand(), m_serial(0), m_index(), m_max_fill(0) {} // For savegame loading454 CmdSetWareMaxFill() : PlayerCommand(), m_serial(0), m_index(), m_max_fill(0) {} // For savegame loading
455 CmdSetWareMaxFill455 CmdSetWareMaxFill
456 (int32_t duetime, PlayerNumber,456 (uint32_t duetime, PlayerNumber,
457 PlayerImmovable &,457 PlayerImmovable &,
458 DescriptionIndex, uint32_t maxfill);458 DescriptionIndex, uint32_t maxfill);
459459
@@ -477,7 +477,7 @@
477struct CmdChangeTargetQuantity : public PlayerCommand {477struct CmdChangeTargetQuantity : public PlayerCommand {
478 CmdChangeTargetQuantity() : PlayerCommand(), m_economy(0), m_ware_type() {} // For savegame loading.478 CmdChangeTargetQuantity() : PlayerCommand(), m_economy(0), m_ware_type() {} // For savegame loading.
479 CmdChangeTargetQuantity479 CmdChangeTargetQuantity
480 (int32_t duetime, PlayerNumber sender,480 (uint32_t duetime, PlayerNumber sender,
481 uint32_t economy, DescriptionIndex index);481 uint32_t economy, DescriptionIndex index);
482482
483 // Write/Read these commands to/from a file (for savegames).483 // Write/Read these commands to/from a file (for savegames).
@@ -501,7 +501,7 @@
501struct CmdSetWareTargetQuantity : public CmdChangeTargetQuantity {501struct CmdSetWareTargetQuantity : public CmdChangeTargetQuantity {
502 CmdSetWareTargetQuantity() : CmdChangeTargetQuantity(), m_permanent(0) {}502 CmdSetWareTargetQuantity() : CmdChangeTargetQuantity(), m_permanent(0) {}
503 CmdSetWareTargetQuantity503 CmdSetWareTargetQuantity
504 (int32_t duetime, PlayerNumber sender,504 (uint32_t duetime, PlayerNumber sender,
505 uint32_t economy, DescriptionIndex index,505 uint32_t economy, DescriptionIndex index,
506 uint32_t permanent);506 uint32_t permanent);
507507
@@ -523,7 +523,7 @@
523struct CmdResetWareTargetQuantity : public CmdChangeTargetQuantity {523struct CmdResetWareTargetQuantity : public CmdChangeTargetQuantity {
524 CmdResetWareTargetQuantity() : CmdChangeTargetQuantity() {}524 CmdResetWareTargetQuantity() : CmdChangeTargetQuantity() {}
525 CmdResetWareTargetQuantity525 CmdResetWareTargetQuantity
526 (int32_t duetime, PlayerNumber sender,526 (uint32_t duetime, PlayerNumber sender,
527 uint32_t economy, DescriptionIndex index);527 uint32_t economy, DescriptionIndex index);
528528
529 // Write/Read these commands to/from a file (for savegames).529 // Write/Read these commands to/from a file (for savegames).
@@ -541,7 +541,7 @@
541struct CmdSetWorkerTargetQuantity : public CmdChangeTargetQuantity {541struct CmdSetWorkerTargetQuantity : public CmdChangeTargetQuantity {
542 CmdSetWorkerTargetQuantity() : CmdChangeTargetQuantity(), m_permanent(0) {}542 CmdSetWorkerTargetQuantity() : CmdChangeTargetQuantity(), m_permanent(0) {}
543 CmdSetWorkerTargetQuantity543 CmdSetWorkerTargetQuantity
544 (int32_t duetime, PlayerNumber sender,544 (uint32_t duetime, PlayerNumber sender,
545 uint32_t economy, DescriptionIndex index,545 uint32_t economy, DescriptionIndex index,
546 uint32_t permanent);546 uint32_t permanent);
547547
@@ -563,7 +563,7 @@
563struct CmdResetWorkerTargetQuantity : public CmdChangeTargetQuantity {563struct CmdResetWorkerTargetQuantity : public CmdChangeTargetQuantity {
564 CmdResetWorkerTargetQuantity() : CmdChangeTargetQuantity() {}564 CmdResetWorkerTargetQuantity() : CmdChangeTargetQuantity() {}
565 CmdResetWorkerTargetQuantity565 CmdResetWorkerTargetQuantity
566 (int32_t duetime, PlayerNumber sender,566 (uint32_t duetime, PlayerNumber sender,
567 uint32_t economy, DescriptionIndex index);567 uint32_t economy, DescriptionIndex index);
568568
569 // Write/Read these commands to/from a file (for savegames).569 // Write/Read these commands to/from a file (for savegames).
@@ -581,7 +581,7 @@
581struct CmdChangeTrainingOptions : public PlayerCommand {581struct CmdChangeTrainingOptions : public PlayerCommand {
582 CmdChangeTrainingOptions() : PlayerCommand(), serial(0), attribute(0), value(0) {} // For savegame loading582 CmdChangeTrainingOptions() : PlayerCommand(), serial(0), attribute(0), value(0) {} // For savegame loading
583 CmdChangeTrainingOptions583 CmdChangeTrainingOptions
584 (const int32_t t,584 (const uint32_t t,
585 const PlayerNumber p,585 const PlayerNumber p,
586 TrainingSite & ts,586 TrainingSite & ts,
587 const int32_t at,587 const int32_t at,
@@ -609,7 +609,7 @@
609struct CmdDropSoldier : public PlayerCommand {609struct CmdDropSoldier : public PlayerCommand {
610 CmdDropSoldier () : PlayerCommand(), serial(0), soldier(0) {} // for savegames610 CmdDropSoldier () : PlayerCommand(), serial(0), soldier(0) {} // for savegames
611 CmdDropSoldier611 CmdDropSoldier
612 (const int32_t t,612 (const uint32_t t,
613 const int32_t p,613 const int32_t p,
614 Building & b,614 Building & b,
615 const int32_t _soldier)615 const int32_t _soldier)
@@ -635,7 +635,7 @@
635struct CmdChangeSoldierCapacity : public PlayerCommand {635struct CmdChangeSoldierCapacity : public PlayerCommand {
636 CmdChangeSoldierCapacity () : PlayerCommand(), serial(0), val(0) {} // for savegames636 CmdChangeSoldierCapacity () : PlayerCommand(), serial(0), val(0) {} // for savegames
637 CmdChangeSoldierCapacity637 CmdChangeSoldierCapacity
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)
639 : PlayerCommand(t, p), serial(b.serial()), val(i)639 : PlayerCommand(t, p), serial(b.serial()), val(i)
640 {}640 {}
641641
@@ -658,7 +658,7 @@
658/////////////TESTING STUFF658/////////////TESTING STUFF
659struct CmdEnemyFlagAction : public PlayerCommand {659struct CmdEnemyFlagAction : public PlayerCommand {
660 CmdEnemyFlagAction() : PlayerCommand(), serial(0), number(0) {} // For savegame loading660 CmdEnemyFlagAction() : PlayerCommand(), serial(0), number(0) {} // For savegame loading
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)
662 : PlayerCommand(t, p), serial(f.serial()), number(num) {662 : PlayerCommand(t, p), serial(f.serial()), number(num) {
663 }663 }
664664
@@ -733,7 +733,7 @@
733 */733 */
734struct CmdSetStockPolicy : PlayerCommand {734struct CmdSetStockPolicy : PlayerCommand {
735 CmdSetStockPolicy735 CmdSetStockPolicy
736 (int32_t time, PlayerNumber p,736 (uint32_t time, PlayerNumber p,
737 Warehouse & wh, bool isworker, DescriptionIndex ware,737 Warehouse & wh, bool isworker, DescriptionIndex ware,
738 Warehouse::StockPolicy policy);738 Warehouse::StockPolicy policy);
739739
740740
=== modified file 'src/logic/replay_game_controller.h'
--- src/logic/replay_game_controller.h 2015-03-01 09:21:20 +0000
+++ src/logic/replay_game_controller.h 2015-11-25 10:54:29 +0000
@@ -46,7 +46,7 @@
4646
47private:47private:
48 struct CmdReplayEnd : public Widelands::Command {48 struct CmdReplayEnd : public Widelands::Command {
49 CmdReplayEnd (int32_t const _duetime) : Widelands::Command(_duetime) {}49 CmdReplayEnd (uint32_t const _duetime) : Widelands::Command(_duetime) {}
50 virtual void execute (Widelands::Game & game);50 virtual void execute (Widelands::Game & game);
51 virtual uint8_t id() const;51 virtual uint8_t id() const;
52 };52 };
5353
=== modified file 'src/logic/soldier.cc'
--- src/logic/soldier.cc 2015-10-25 08:06:00 +0000
+++ src/logic/soldier.cc 2015-11-25 10:54:29 +0000
@@ -1317,7 +1317,7 @@
13171317
1318void Soldier::move_in_battle_update(Game & game, State &)1318void Soldier::move_in_battle_update(Game & game, State &)
1319{1319{
1320 if (static_cast<int32_t>(game.get_gametime() - m_combat_walkend) >= 0) {1320 if (game.get_gametime() >= m_combat_walkend) {
1321 switch (m_combat_walking) {1321 switch (m_combat_walking) {
1322 case CD_NONE:1322 case CD_NONE:
1323 break;1323 break;
@@ -1590,7 +1590,7 @@
1590 signal_handled();1590 signal_handled();
1591 }1591 }
15921592
1593 if (state.ivar1 > game.get_gametime())1593 if ((state.ivar1 >= 0) && (static_cast<uint32_t>(state.ivar1) > game.get_gametime()))
1594 return schedule_act(game, state.ivar1 - game.get_gametime());1594 return schedule_act(game, state.ivar1 - game.get_gametime());
15951595
1596 // When task updated, dead is near!1596 // When task updated, dead is near!
@@ -1804,8 +1804,8 @@
18041804
1805 soldier.m_combat_walking = static_cast<CombatWalkingDir>(fr.unsigned_8());1805 soldier.m_combat_walking = static_cast<CombatWalkingDir>(fr.unsigned_8());
1806 if (soldier.m_combat_walking != CD_NONE) {1806 if (soldier.m_combat_walking != CD_NONE) {
1807 soldier.m_combat_walkstart = fr.signed_32();1807 soldier.m_combat_walkstart = fr.unsigned_32();
1808 soldier.m_combat_walkend = fr.signed_32();1808 soldier.m_combat_walkend = fr.unsigned_32();
1809 }1809 }
18101810
1811 m_battle = fr.unsigned_32();1811 m_battle = fr.unsigned_32();
@@ -1856,8 +1856,8 @@
18561856
1857 fw.unsigned_8(m_combat_walking);1857 fw.unsigned_8(m_combat_walking);
1858 if (m_combat_walking != CD_NONE) {1858 if (m_combat_walking != CD_NONE) {
1859 fw.signed_32(m_combat_walkstart);1859 fw.unsigned_32(m_combat_walkstart);
1860 fw.signed_32(m_combat_walkend);1860 fw.unsigned_32(m_combat_walkend);
1861 }1861 }
18621862
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));
18641864
=== modified file 'src/logic/soldier.h'
--- src/logic/soldier.h 2015-10-21 16:43:30 +0000
+++ src/logic/soldier.h 2015-11-25 10:54:29 +0000
@@ -278,8 +278,8 @@
278 /// the new states. I thought that it is cleaner to have this variable278 /// the new states. I thought that it is cleaner to have this variable
279 /// separate.279 /// separate.
280 CombatWalkingDir m_combat_walking;280 CombatWalkingDir m_combat_walking;
281 int32_t m_combat_walkstart;281 uint32_t m_combat_walkstart;
282 int32_t m_combat_walkend;282 uint32_t m_combat_walkend;
283283
284 /**284 /**
285 * If the soldier is involved in a challenge, it is assigned a battle285 * If the soldier is involved in a challenge, it is assigned a battle
286286
=== modified file 'src/logic/worker.cc'
--- src/logic/worker.cc 2015-11-11 09:56:22 +0000
+++ src/logic/worker.cc 2015-11-25 10:54:29 +0000
@@ -1938,7 +1938,7 @@
1938 for (;;) {1938 for (;;) {
1939 const WorkerProgram & program = dynamic_cast<const WorkerProgram&>(*state.program);1939 const WorkerProgram & program = dynamic_cast<const WorkerProgram&>(*state.program);
19401940
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()))
1942 return pop_task(game);1942 return pop_task(game);
19431943
1944 const Action & action = *program.get_action(state.ivar1);1944 const Action & action = *program.get_action(state.ivar1);
@@ -2613,7 +2613,7 @@
2613 }2613 }
2614 }2614 }
26152615
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?
2617 molog("[fugitive]: die\n");2617 molog("[fugitive]: die\n");
2618 return schedule_destroy(game);2618 return schedule_destroy(game);
2619 }2619 }
26202620
=== modified file 'src/network/netclient.cc'
--- src/network/netclient.cc 2015-11-08 17:31:06 +0000
+++ src/network/netclient.cc 2015-11-25 10:54:29 +0000
@@ -82,7 +82,7 @@
82 bool server_is_waiting;82 bool server_is_waiting;
8383
84 /// Data for the last time message we sent.84 /// Data for the last time message we sent.
85 int32_t lasttimestamp;85 uint32_t lasttimestamp;
86 uint32_t lasttimestamp_realtime;86 uint32_t lasttimestamp_realtime;
8787
88 /// The real target speed, in milliseconds per second.88 /// The real target speed, in milliseconds per second.
@@ -253,7 +253,7 @@
253253
254 if254 if
255 (d->server_is_waiting &&255 (d->server_is_waiting &&
256 d->game->get_gametime() == d->time.networktime())256 d->game->get_gametime() == static_cast<uint32_t>(d->time.networktime()))
257 {257 {
258 send_time();258 send_time();
259 d->server_is_waiting = false;259 d->server_is_waiting = false;
260260
=== modified file 'src/network/nethost.cc'
--- src/network/nethost.cc 2015-11-08 17:31:06 +0000
+++ src/network/nethost.cc 2015-11-25 10:54:29 +0000
@@ -2458,7 +2458,7 @@
24582458
2459void NetHost::syncreport()2459void NetHost::syncreport()
2460{2460{
2461 assert(d->game->get_gametime() == d->syncreport_time);2461 assert(d->game->get_gametime() == static_cast<uint32_t>(d->syncreport_time));
24622462
2463 d->syncreport = d->game->get_sync_hash();2463 d->syncreport = d->game->get_sync_hash();
2464 d->syncreport_arrived = true;2464 d->syncreport_arrived = true;
24652465
=== modified file 'src/network/network.cc'
--- src/network/network.cc 2015-11-08 17:31:06 +0000
+++ src/network/network.cc 2015-11-25 10:54:29 +0000
@@ -24,7 +24,7 @@
2424
2525
2626
27CmdNetCheckSync::CmdNetCheckSync(int32_t const dt, SyncCallback * const cb) :27CmdNetCheckSync::CmdNetCheckSync(uint32_t const dt, SyncCallback * const cb) :
28Command (dt), m_callback(cb)28Command (dt), m_callback(cb)
29{}29{}
3030
3131
=== modified file 'src/network/network.h'
--- src/network/network.h 2015-11-08 17:31:06 +0000
+++ src/network/network.h 2015-11-25 10:54:29 +0000
@@ -45,7 +45,7 @@
45 * to schedule taking a synchronization hash.45 * to schedule taking a synchronization hash.
46 */46 */
47struct CmdNetCheckSync : public Widelands::Command {47struct CmdNetCheckSync : public Widelands::Command {
48 CmdNetCheckSync (int32_t dt, SyncCallback *);48 CmdNetCheckSync (uint32_t dt, SyncCallback *);
4949
50 void execute (Widelands::Game &) override;50 void execute (Widelands::Game &) override;
5151

Subscribers

People subscribed via source and target branches

to status/vote changes: