diff --git a/gameheaders/stratagus-game-launcher.h b/gameheaders/stratagus-game-launcher.h index 8772b83866..4df276852e 100644 --- a/gameheaders/stratagus-game-launcher.h +++ b/gameheaders/stratagus-game-launcher.h @@ -384,9 +384,9 @@ static void ExtractData(char *extractor_tool, } } else { // we cannot test if this is an innoextract installer, assume not but maybe warn - if (datafile.compare("INSTALL.EXE") == 0 || datafile.compare("install.exe") == 0 - || datafile.compare("INSTALL.exe") == 0 || datafile.compare("SETUP.EXE") == 0 - || datafile.compare("setup.exe") == 0 || datafile.compare("SETUP.exe") == 0) { + if (datafile == "INSTALL.EXE" || datafile == "install.exe" + || datafile == "INSTALL.exe" || datafile == "SETUP.EXE" + || datafile == "setup.exe" || datafile == "SETUP.exe") { // probably not a packaged installer } else { // warn diff --git a/src/action/actions.cpp b/src/action/actions.cpp index 74ed143557..c33705bea6 100644 --- a/src/action/actions.cpp +++ b/src/action/actions.cpp @@ -33,11 +33,6 @@ -- Includes ----------------------------------------------------------------------------*/ -#include - -#include "stratagus.h" -#include "version.h" - #include "actions.h" #include "action/action_attack.h" @@ -58,7 +53,6 @@ #include "action/action_train.h" #include "action/action_unload.h" #include "action/action_upgradeto.h" - #include "animation/animation_die.h" #include "commands.h" #include "game.h" @@ -71,19 +65,23 @@ #include "player.h" #include "script.h" #include "spells.h" +#include "stratagus.h" #include "unit.h" #include "unit_find.h" #include "unit_manager.h" #include "unittype.h" +#include "version.h" #ifdef USE_STACKTRACE -#include -#include -#include +# include +# include +# include #else -#include "st_backtrace.h" +# include "st_backtrace.h" #endif +#include + /*---------------------------------------------------------------------------- -- Variables ----------------------------------------------------------------------------*/ diff --git a/src/ai/ai_force.cpp b/src/ai/ai_force.cpp index 1b37dc10ce..abfcba055a 100644 --- a/src/ai/ai_force.cpp +++ b/src/ai/ai_force.cpp @@ -412,10 +412,9 @@ bool AiForce::NewRallyPoint(const Vec2i &startPos, Vec2i *resultPos) void AiForce::Attack(const Vec2i &pos) { - bool isDefenceForce = false; RemoveDeadUnit(); - if (Units.size() == 0) { + if (Units.empty()) { this->Attacking = false; this->State = AiForceAttackingState::Waiting; return; @@ -424,7 +423,7 @@ void AiForce::Attack(const Vec2i &pos) // Remember the original force position so we can return there after attack if (this->Role == AiForceRole::Defend || (this->Role == AiForceRole::Attack && this->State == AiForceAttackingState::Waiting)) { - this->HomePos = this->Units[this->Units.size() - 1]->tilePos; + this->HomePos = this->Units.back()->tilePos; } this->Attacking = true; } @@ -436,6 +435,7 @@ void AiForce::Attack(const Vec2i &pos) const bool isTransporter = ranges::any_of(this->Units, [](const CUnit *unit) { return unit->Type->CanTransport() && unit->IsAgressive() == false; }); + bool isDefenceForce = false; if (Map.Info.IsPointOnMap(goalPos) == false) { /* Search in entire map */ const CUnit *enemy = nullptr; diff --git a/src/animation/animation_die.cpp b/src/animation/animation_die.cpp index 53e843ee74..dc6b34f2c3 100644 --- a/src/animation/animation_die.cpp +++ b/src/animation/animation_die.cpp @@ -33,13 +33,12 @@ -- Includes ----------------------------------------------------------------------------*/ -#include "stratagus.h" - #include "animation/animation_die.h" +#include "stratagus.h" #include "unit.h" -#include +#include void CAnimation_Die::Action(CUnit &unit, int & /*move*/, int /*scale*/) const /* override */ { diff --git a/src/animation/animation_setplayervar.cpp b/src/animation/animation_setplayervar.cpp index 97c240ce7d..5a5382afd5 100644 --- a/src/animation/animation_setplayervar.cpp +++ b/src/animation/animation_setplayervar.cpp @@ -33,15 +33,14 @@ -- Includes ----------------------------------------------------------------------------*/ -#include "stratagus.h" - #include "animation/animation_setplayervar.h" #include "animation.h" +#include "stratagus.h" #include "unit.h" +#include #include -#include /** ** Gets the player data. diff --git a/src/animation/animation_setvar.cpp b/src/animation/animation_setvar.cpp index d6340ad019..92a7da9d6a 100644 --- a/src/animation/animation_setvar.cpp +++ b/src/animation/animation_setvar.cpp @@ -33,16 +33,14 @@ -- Includes ----------------------------------------------------------------------------*/ -#include "stratagus.h" - #include "animation/animation_setvar.h" #include "actions.h" +#include "map.h" #include "unit.h" #include "unit_manager.h" -#include "map.h" -#include +#include #include void CAnimation_SetVar::Action(CUnit &unit, int & /*move*/, int /*scale*/) const /* override */ diff --git a/src/game/replay.cpp b/src/game/replay.cpp index 0a9921a2aa..32a4f993d1 100644 --- a/src/game/replay.cpp +++ b/src/game/replay.cpp @@ -32,8 +32,6 @@ // Includes //---------------------------------------------------------------------------- -#include "stratagus.h" - #include "replay.h" #include "actions.h" @@ -56,8 +54,8 @@ #include "unittype.h" #include "version.h" +#include #include -#include extern fs::path ExpandPath(const std::string &path); extern void StartMap(const std::string &filename, bool clean); diff --git a/src/game/savegame.cpp b/src/game/savegame.cpp index ec1ffa9947..db0bb0a741 100644 --- a/src/game/savegame.cpp +++ b/src/game/savegame.cpp @@ -54,7 +54,7 @@ #include "upgrade.h" #include "version.h" -#include +#include extern void StartMap(const std::string &filename, bool clean); diff --git a/src/include/interface.h b/src/include/interface.h index ac6cfa94b3..d2049c723e 100644 --- a/src/include/interface.h +++ b/src/include/interface.h @@ -39,8 +39,10 @@ #include "icons.h" #endif +#include "stratagus.h" #include "unitsound.h" #include "vec2i.h" + #include #include diff --git a/src/include/iolib.h b/src/include/iolib.h index 8b1e5bbe1e..16ca55fff1 100644 --- a/src/include/iolib.h +++ b/src/include/iolib.h @@ -37,6 +37,7 @@ ----------------------------------------------------------------------------*/ #include "filesystem.h" +#include "stratagus.h" #include #include diff --git a/src/include/luacallback.h b/src/include/luacallback.h index 4c8951cfbe..5ad80307be 100644 --- a/src/include/luacallback.h +++ b/src/include/luacallback.h @@ -30,6 +30,7 @@ #define LUA_CALLBACK_HEADER_FILE #include +#include #include #include #include diff --git a/src/include/sdl2_helper.h b/src/include/sdl2_helper.h index 0632e4e79a..ee8a3a0c76 100644 --- a/src/include/sdl2_helper.h +++ b/src/include/sdl2_helper.h @@ -29,6 +29,7 @@ #include #include +#include //@{ diff --git a/src/include/unitptr.h b/src/include/unitptr.h index 565309815f..f3bf836605 100644 --- a/src/include/unitptr.h +++ b/src/include/unitptr.h @@ -32,6 +32,8 @@ //@{ +#include + class CUnit; diff --git a/src/include/unittype.h b/src/include/unittype.h index 177b08ccb0..0242294751 100644 --- a/src/include/unittype.h +++ b/src/include/unittype.h @@ -52,6 +52,7 @@ #include "luacallback.h" #include "missileconfig.h" #include "spells.h" +#include "stratagus.h" #include "util.h" #include "vec2i.h" diff --git a/src/include/upgrade_structs.h b/src/include/upgrade_structs.h index 7a579b5087..020d0be34f 100644 --- a/src/include/upgrade_structs.h +++ b/src/include/upgrade_structs.h @@ -37,6 +37,9 @@ -- Includes ----------------------------------------------------------------------------*/ +#include "settings.h" + +#include #include #include diff --git a/src/include/util.h b/src/include/util.h index 2b0ea321ce..13f05e94da 100644 --- a/src/include/util.h +++ b/src/include/util.h @@ -82,7 +82,7 @@ extern uint32_t fletcher32(const std::string &content); -- Strings ----------------------------------------------------------------------------*/ -#include +#include #ifndef _TRUNCATE #define _TRUNCATE ((size_t)-1) diff --git a/src/map/fow.cpp b/src/map/fow.cpp index f1a9d769f2..8a809f9380 100644 --- a/src/map/fow.cpp +++ b/src/map/fow.cpp @@ -34,18 +34,17 @@ -- Includes ----------------------------------------------------------------------------*/ -#include -#include - -#include "stratagus.h" - #include "fow.h" + +#include "../video/intern_video.h" #include "map.h" #include "player.h" +#include "stratagus.h" #include "tile.h" #include "ui.h" #include "viewport.h" -#include "../video/intern_video.h" + +#include /*---------------------------------------------------------------------------- -- Defines diff --git a/src/map/fow_utils.cpp b/src/map/fow_utils.cpp index 01fe7b1665..3ddbf90813 100644 --- a/src/map/fow_utils.cpp +++ b/src/map/fow_utils.cpp @@ -33,12 +33,12 @@ -- Includes ----------------------------------------------------------------------------*/ -#include -#include +#include "fow_utils.h" #include "stratagus.h" -#include "fow_utils.h" +#include +#include /*---------------------------------------------------------------------------- -- Defines diff --git a/src/map/map_wall.cpp b/src/map/map_wall.cpp index 1ea7a4ebc3..f71ed14bb5 100644 --- a/src/map/map_wall.cpp +++ b/src/map/map_wall.cpp @@ -33,16 +33,16 @@ -- Includes ----------------------------------------------------------------------------*/ -#include - -#include "stratagus.h" -#include "map.h" #include "fov.h" +#include "map.h" +#include "player.h" +#include "stratagus.h" #include "tileset.h" #include "ui.h" -#include "player.h" #include "unittype.h" +#include + /*---------------------------------------------------------------------------- -- Functions ----------------------------------------------------------------------------*/ diff --git a/src/map/script_tileset.cpp b/src/map/script_tileset.cpp index 7eca3eb27c..4790a7997c 100644 --- a/src/map/script_tileset.cpp +++ b/src/map/script_tileset.cpp @@ -42,8 +42,8 @@ #include "video.h" #include +#include #include -#include #include /*---------------------------------------------------------------------------- diff --git a/src/map/tileset.cpp b/src/map/tileset.cpp index 32bd271af4..d6b4c166f8 100644 --- a/src/map/tileset.cpp +++ b/src/map/tileset.cpp @@ -185,7 +185,7 @@ #include "tileset.h" -#include +#include /*---------------------------------------------------------------------------- -- Variables diff --git a/src/missile/missile.cpp b/src/missile/missile.cpp index 4432a2509a..33a8cb7457 100644 --- a/src/missile/missile.cpp +++ b/src/missile/missile.cpp @@ -33,10 +33,6 @@ -- Includes ----------------------------------------------------------------------------*/ -#include - -#include "stratagus.h" - #include "missile.h" #include "action/action_spellcast.h" @@ -57,6 +53,8 @@ #include "unittype.h" #include "video.h" +#include + /*---------------------------------------------------------------------------- -- Declarations ----------------------------------------------------------------------------*/ diff --git a/src/missile/missile_parabolic.cpp b/src/missile/missile_parabolic.cpp index aac0b696e2..908e173d96 100644 --- a/src/missile/missile_parabolic.cpp +++ b/src/missile/missile_parabolic.cpp @@ -33,16 +33,14 @@ -- Includes ----------------------------------------------------------------------------*/ -#include - -#include "stratagus.h" - -#include "missile.h" - #include "luacallback.h" #include "map.h" +#include "missile.h" +#include "stratagus.h" #include "unit_find.h" +#include + /** ** Calculate parabolic trajectories. ** diff --git a/src/missile/missile_tracer.cpp b/src/missile/missile_tracer.cpp index 61a065eb0e..661b64b979 100644 --- a/src/missile/missile_tracer.cpp +++ b/src/missile/missile_tracer.cpp @@ -33,17 +33,14 @@ -- Includes ----------------------------------------------------------------------------*/ -#include - -#include "stratagus.h" - -#include "missile.h" - #include "luacallback.h" #include "map.h" +#include "missile.h" #include "unit.h" #include "unit_find.h" +#include + /** ** Handle tracer missile. ** diff --git a/src/network/net_lowlevel.cpp b/src/network/net_lowlevel.cpp index 750938382a..06a5936aac 100644 --- a/src/network/net_lowlevel.cpp +++ b/src/network/net_lowlevel.cpp @@ -37,9 +37,9 @@ #include "net_lowlevel.h" -#include +#include +#include #include -#include //---------------------------------------------------------------------------- // Declarations diff --git a/src/network/netsockets.cpp b/src/network/netsockets.cpp index 9f2ef37fb0..8566b1ec2e 100644 --- a/src/network/netsockets.cpp +++ b/src/network/netsockets.cpp @@ -38,7 +38,7 @@ #include "network/netsockets.h" #include "net_lowlevel.h" -#include +#include // // CHost diff --git a/src/network/network.cpp b/src/network/network.cpp index 0cbcd0a41f..98e5607a14 100644 --- a/src/network/network.cpp +++ b/src/network/network.cpp @@ -222,9 +222,6 @@ #include "online_service.h" #include "stratagus.h" -#include -#include - #include "network.h" #include "actions.h" @@ -244,7 +241,9 @@ #include "unittype.h" #include "video.h" +#include #include +#include //---------------------------------------------------------------------------- // Declaration diff --git a/src/network/online_service.cpp b/src/network/online_service.cpp index 2781cde1c1..26cf666db0 100644 --- a/src/network/online_service.cpp +++ b/src/network/online_service.cpp @@ -1981,7 +1981,7 @@ class C2S_SID_AUTH_INFO : public OnlineState // Connect std::string localHost = CNetworkParameter::Instance.localHost; - if (!localHost.compare("127.0.0.1")) { + if (localHost == "127.0.0.1") { localHost = "0.0.0.0"; } if (!ctx.getTCPSocket().IsValid()) { @@ -2022,7 +2022,7 @@ class C2S_SID_AUTH_INFO : public OnlineState // (UINT32) Language code buffer.serialize32(0x00); // (UINT32) Local IP - if (CNetworkParameter::Instance.localHost.compare("127.0.0.1")) { + if (CNetworkParameter::Instance.localHost != "127.0.0.1") { // user set a custom local ip, use that #ifdef USE_WIN32 uint32_t addr = inet_addr(CNetworkParameter::Instance.localHost.c_str()); diff --git a/src/particle/chunkparticle.cpp b/src/particle/chunkparticle.cpp index 6e13880490..045a183c8a 100644 --- a/src/particle/chunkparticle.cpp +++ b/src/particle/chunkparticle.cpp @@ -29,12 +29,11 @@ //@{ -#include - -#include "stratagus.h" #include "particle.h" +#include "stratagus.h" #include "video.h" +#include static const int gravity = 32 * 12; diff --git a/src/particle/radialparticle.cpp b/src/particle/radialparticle.cpp index f0c0628752..948991b020 100644 --- a/src/particle/radialparticle.cpp +++ b/src/particle/radialparticle.cpp @@ -29,10 +29,10 @@ //@{ -#include - -#include "stratagus.h" #include "particle.h" +#include "stratagus.h" + +#include CRadialParticle::CRadialParticle(CPosition position, GraphicAnimation *animation, int maxSpeed, int drawlevel) : CParticle(position, drawlevel) diff --git a/src/pathfinder/astar.cpp b/src/pathfinder/astar.cpp index 4c9f410d78..701caee3e0 100644 --- a/src/pathfinder/astar.cpp +++ b/src/pathfinder/astar.cpp @@ -60,7 +60,7 @@ # include "viewport.h" #endif -#include +#include /*---------------------------------------------------------------------------- -- Declarations diff --git a/src/stratagus/iolib.cpp b/src/stratagus/iolib.cpp index a4b4c54014..c3a04b3608 100644 --- a/src/stratagus/iolib.cpp +++ b/src/stratagus/iolib.cpp @@ -45,10 +45,10 @@ #include +#include +#include #include #include -#include -#include #ifdef USE_ZLIB #include diff --git a/src/stratagus/parameters.cpp b/src/stratagus/parameters.cpp index 267f493cf6..503e50a7da 100644 --- a/src/stratagus/parameters.cpp +++ b/src/stratagus/parameters.cpp @@ -34,7 +34,7 @@ #include "filesystem.h" #include "parameters.h" -#include +#include #ifdef USE_WIN32 #include diff --git a/src/stratagus/stratagus.cpp b/src/stratagus/stratagus.cpp index 6f3b78e23e..89a6ab2afc 100644 --- a/src/stratagus/stratagus.cpp +++ b/src/stratagus/stratagus.cpp @@ -164,7 +164,7 @@ #pragma comment(lib, "Imm32.lib") #endif -#include +#include #ifdef USE_BEOS #include @@ -221,8 +221,8 @@ extern void beos_init(int argc, char **argv); #include "st_backtrace.h" #endif -#include -#include +#include +#include #ifdef USE_WIN32 # include diff --git a/src/stratagus/util.cpp b/src/stratagus/util.cpp index 09f3a0fe8c..5b8dbebdf1 100644 --- a/src/stratagus/util.cpp +++ b/src/stratagus/util.cpp @@ -27,24 +27,18 @@ // 02111-1307, USA. // -#if __has_include() -#include // from_chars -#endif - -#include -#include +#include "util.h" #include "stratagus.h" -#include "util.h" - #include - -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include #ifndef __APPLE__ #include #endif @@ -61,6 +55,10 @@ #include "st_backtrace.h" #endif +#if __has_include() +#include // from_chars +#endif + /*---------------------------------------------------------------------------- -- Random ----------------------------------------------------------------------------*/ @@ -342,7 +340,7 @@ int to_number(std::string_view s, int base) ** an 'argument required' error. */ -#include +#include int opterr = 1; int optind = 1; diff --git a/src/ui/botpanel.cpp b/src/ui/botpanel.cpp index 08e9e49fc9..44e44632f8 100644 --- a/src/ui/botpanel.cpp +++ b/src/ui/botpanel.cpp @@ -56,7 +56,7 @@ #include "upgrade.h" #include "video.h" -#include +#include #include #include #include diff --git a/src/ui/button_checks.cpp b/src/ui/button_checks.cpp index e1c4e4a618..ca8a7c4960 100644 --- a/src/ui/button_checks.cpp +++ b/src/ui/button_checks.cpp @@ -45,7 +45,8 @@ #include "unittype.h" #include "upgrade.h" -#include +#include + /*---------------------------------------------------------------------------- -- Functions ----------------------------------------------------------------------------*/ @@ -399,7 +400,7 @@ bool ButtonCheckSingleResearch(const CUnit &unit, const ButtonAction &button) */ bool ButtonCheckDebug(const CUnit &, const ButtonAction &button) { - if(!button.AllowStr.compare("single-player-walls")) { /// Check if enabled walls for singleplayer games + if (button.AllowStr == "single-player-walls") { /// Check if enabled walls for singleplayer games return !IsNetworkGame() && EnableWallsInSinglePlayer; } return false; diff --git a/src/ui/mouse.cpp b/src/ui/mouse.cpp index b47cbe5937..3f7b4c86a5 100644 --- a/src/ui/mouse.cpp +++ b/src/ui/mouse.cpp @@ -36,12 +36,6 @@ -- Includes ----------------------------------------------------------------------------*/ -#include -#include - -#include "stratagus.h" -#include "ui.h" - #include "action/action_build.h" #include "action/action_train.h" #include "actions.h" @@ -57,7 +51,10 @@ #include "player.h" #include "sound.h" #include "spells.h" +#include "stratagus.h" +#include "tileset.h" #include "translate.h" +#include "ui.h" #include "unit.h" #include "unit_find.h" #include "unitsound.h" @@ -65,9 +62,9 @@ #include "video.h" #include "widgets.h" -#include "tileset.h" - +#include #include +#include /*---------------------------------------------------------------------------- -- Variables diff --git a/src/ui/ui.cpp b/src/ui/ui.cpp index f792caf948..902c109f85 100644 --- a/src/ui/ui.cpp +++ b/src/ui/ui.cpp @@ -49,7 +49,7 @@ #include "unit.h" #include "video.h" -#include +#include /*---------------------------------------------------------------------------- -- Variables diff --git a/src/unit/build.cpp b/src/unit/build.cpp index 4ae747e19c..cf029b4d8e 100644 --- a/src/unit/build.cpp +++ b/src/unit/build.cpp @@ -150,9 +150,9 @@ bool CBuildRestrictionDistance::Check(const CUnit *builder, const CUnitType &typ (this->RestrictType == unit->Type || (!this->RestrictType && this->RestrictTypeOwner.size() > 0)) && // RestrictTypeOwner is not set or unit belongs to a suitable player (this->RestrictTypeOwner.empty() || - (!this->RestrictTypeOwner.compare("self") && player == unit->Player) || - (!this->RestrictTypeOwner.compare("allied") && (player == unit->Player || player->IsAllied(*unit->Player))) || - (!this->RestrictTypeOwner.compare("enemy") && player->IsEnemy(*unit->Player)))) { + (this->RestrictTypeOwner == "self" && player == unit->Player) || + (this->RestrictTypeOwner == "allied" && (player == unit->Player || player->IsAllied(*unit->Player))) || + (this->RestrictTypeOwner == "enemy" && player->IsEnemy(*unit->Player)))) { switch (this->DistanceType) { case EComparison::GreaterThan: @@ -202,22 +202,22 @@ bool CBuildRestrictionHasUnit::Check(const CUnit *builder, const CUnitType &type Vec2i pos2(0, 0); CPlayer* player = builder != nullptr ? builder->Player : ThisPlayer; int count = 0; - if (this->RestrictTypeOwner.size() == 0 || !this->RestrictTypeOwner.compare("self")) { + if (this->RestrictTypeOwner.empty() || this->RestrictTypeOwner == "self") { count = player->GetUnitTotalCount(*this->RestrictType); - } else if (!this->RestrictTypeOwner.compare("allied")) { + } else if (this->RestrictTypeOwner == "allied") { count = player->GetUnitTotalCount(*this->RestrictType); for (int i = 0; i < NumPlayers; i++) { if (player->IsAllied(Players[i])) { count += Players[i].GetUnitTotalCount(*this->RestrictType); } } - } else if (!this->RestrictTypeOwner.compare("enemy")) { + } else if (this->RestrictTypeOwner == "enemy") { for (int i = 0; i < NumPlayers; i++) { if (player->IsEnemy(Players[i])) { count += Players[i].GetUnitTotalCount(*this->RestrictType); } } - } else if (!this->RestrictTypeOwner.compare("any")) { + } else if (this->RestrictTypeOwner == "any") { for (int i = 0; i < NumPlayers; i++) { count += Players[i].GetUnitTotalCount(*this->RestrictType); } @@ -277,10 +277,10 @@ bool CBuildRestrictionSurroundedBy::Check(const CUnit *builder, const CUnitType // unit has RestrictType or no RestrictType was set, but a RestrictTypeOwner (this->RestrictType == unit->Type || (!this->RestrictType && this->RestrictTypeOwner.size() > 0)) && // RestrictTypeOwner is not set or unit belongs to a suitable player - (this->RestrictTypeOwner.size() == 0 || - (!this->RestrictTypeOwner.compare("self") && builder->Player == unit->Player) || - (!this->RestrictTypeOwner.compare("allied") && (builder->Player == unit->Player || builder->Player->IsAllied(*unit->Player))) || - (!this->RestrictTypeOwner.compare("enemy") && builder->Player->IsEnemy(*unit->Player)))) { + (this->RestrictTypeOwner.empty() || + (this->RestrictTypeOwner == "self" && builder->Player == unit->Player) || + (this->RestrictTypeOwner == "allied" && (builder->Player == unit->Player || builder->Player->IsAllied(*unit->Player))) || + (this->RestrictTypeOwner == "enemy" && builder->Player->IsEnemy(*unit->Player)))) { switch (this->DistanceType) { case EComparison::GreaterThan: diff --git a/src/unit/unit.cpp b/src/unit/unit.cpp index 950b9da2b8..4baccae999 100644 --- a/src/unit/unit.cpp +++ b/src/unit/unit.cpp @@ -66,8 +66,7 @@ #include "upgrade.h" #include "video.h" -#include - +#include /*---------------------------------------------------------------------------- -- Documentation diff --git a/src/unit/unit_find.cpp b/src/unit/unit_find.cpp index b67bed2aa5..7d32590f9a 100644 --- a/src/unit/unit_find.cpp +++ b/src/unit/unit_find.cpp @@ -33,10 +33,6 @@ -- Includes ----------------------------------------------------------------------------*/ -#include - -#include "stratagus.h" - #include "unit_find.h" #include "actions.h" @@ -50,6 +46,8 @@ #include "unit_manager.h" #include "unittype.h" +#include + /*---------------------------------------------------------------------------- -- Finding units ----------------------------------------------------------------------------*/ diff --git a/src/unit/unit_save.cpp b/src/unit/unit_save.cpp index ae0a09ff77..e4b82c698f 100644 --- a/src/unit/unit_save.cpp +++ b/src/unit/unit_save.cpp @@ -49,7 +49,7 @@ #include "spells.h" #include "unittype.h" -#include +#include /*---------------------------------------------------------------------------- -- Functions diff --git a/src/unit/unittype.cpp b/src/unit/unittype.cpp index 0b925c861a..94fdbac11e 100644 --- a/src/unit/unittype.cpp +++ b/src/unit/unittype.cpp @@ -33,8 +33,6 @@ -- Includes ----------------------------------------------------------------------------*/ -#include "stratagus.h" - #include "unittype.h" #include "animation.h" @@ -56,11 +54,10 @@ #include "util.h" #include "video.h" +#include #include -#include - -#include #include +#include /*---------------------------------------------------------------------------- -- Documentation diff --git a/src/video/movie.cpp b/src/video/movie.cpp index e1080c159e..ec5e6e5eef 100644 --- a/src/video/movie.cpp +++ b/src/video/movie.cpp @@ -509,12 +509,12 @@ SDL_Surface *Movie::getSurface() const /* override */ #else -#include -#include -#include - #include "stratagus.h" +#include +#include +#include + /** ** Play a video file. ** diff --git a/src/video/renderer.h b/src/video/renderer.h index 1a2f47d794..052b93598c 100644 --- a/src/video/renderer.h +++ b/src/video/renderer.h @@ -1,7 +1,8 @@ #ifndef __RENDERER_H__ #define __RENDERER_H__ -#include +#include +#include struct CPrimitives { virtual void DrawPixel(Uint32 color, int x, int y) = 0; diff --git a/src/win32/SetupConsole_win32.cpp b/src/win32/SetupConsole_win32.cpp index 66e5c8b78d..3bda7c6458 100644 --- a/src/win32/SetupConsole_win32.cpp +++ b/src/win32/SetupConsole_win32.cpp @@ -16,18 +16,23 @@ */ +#include "SetupConsole_win32.h" + #include -#include +#include +#include #include -#include #include #ifdef __cplusplus -#include +# include +# include +# include +#else +# include +# include #endif -#include "SetupConsole_win32.h" - /* * Microsoft systems were and always are one big mess where even standard output does not work :-( * There are at least 4 different I/O API levels and each WINAPI function initilize correctly just one... diff --git a/tests/network/test_net_lowlevel.cpp b/tests/network/test_net_lowlevel.cpp index 16bd34092b..d286d1cd83 100644 --- a/tests/network/test_net_lowlevel.cpp +++ b/tests/network/test_net_lowlevel.cpp @@ -31,7 +31,8 @@ #include "stratagus.h" #include "net_lowlevel.h" -#include + +#include #include class AutoNetwork