diff options
author | leak <leak@bitmx.net> | 2014-06-01 20:55:31 +0200 |
---|---|---|
committer | leak <leak@bitmx.net> | 2014-06-01 20:55:31 +0200 |
commit | 68e22ad311ed19d3ad4460f2d178a46eda19ed65 (patch) | |
tree | 65aa11a1e296c38e6bcbba67dbaf2640a495c38f | |
parent | 35aa142f6aa748db1febe901b2446fe53b9abbe0 (diff) |
Replaced ACE based typedefs for fixed width ints with C++11 versions
-rw-r--r-- | dep/g3dlite/Readme.txt | 1 | ||||
-rw-r--r-- | dep/g3dlite/include/G3D/g3dmath.h | 2 | ||||
-rw-r--r-- | src/server/authserver/PrecompiledHeaders/authPCH.h | 2 | ||||
-rw-r--r-- | src/server/authserver/Realms/RealmList.cpp | 2 | ||||
-rw-r--r-- | src/server/collision/BoundingIntervalHierarchy.h | 4 | ||||
-rw-r--r-- | src/server/collision/Models/ModelInstance.cpp | 4 | ||||
-rw-r--r-- | src/server/collision/VMapDefinitions.h | 1 | ||||
-rw-r--r-- | src/server/game/Events/GameEventMgr.cpp | 12 | ||||
-rw-r--r-- | src/server/game/PrecompiledHeaders/gamePCH.h | 4 | ||||
-rw-r--r-- | src/server/scripts/Commands/cs_debug.cpp | 8 | ||||
-rw-r--r-- | src/server/scripts/Commands/cs_mmaps.cpp | 4 | ||||
-rw-r--r-- | src/server/shared/Define.h | 45 | ||||
-rw-r--r-- | src/server/worldserver/PrecompiledHeaders/worldPCH.h | 3 |
13 files changed, 46 insertions, 46 deletions
diff --git a/dep/g3dlite/Readme.txt b/dep/g3dlite/Readme.txt index 7988d1f314e..739f6985090 100644 --- a/dep/g3dlite/Readme.txt +++ b/dep/g3dlite/Readme.txt @@ -9,3 +9,4 @@ G3D-v8.0_hotfix5.diff - 2013-02-27 - fix compilation in cygwin environments G3D-v8.0_hotfix6.diff - 2013-03-08 - fix compilation in mingw G3D-v8.0_hotfix7.diff - 2013-08-31 - fix typo in Matrix4 == operator G3D-v8.0_hotfix8.diff - 2013-09-01 - fix typo in Vector3int32 += operator +G3D-v8.0_hotfix9.diff - 2014-06-01 - only VS < 10 don't ship inttypes.h diff --git a/dep/g3dlite/include/G3D/g3dmath.h b/dep/g3dlite/include/G3D/g3dmath.h index b0c98aeaf04..4be723ca30c 100644 --- a/dep/g3dlite/include/G3D/g3dmath.h +++ b/dep/g3dlite/include/G3D/g3dmath.h @@ -30,7 +30,7 @@ #include <limits> #include <stdlib.h> -#ifdef _MSC_VER +#if defined(_MSC_VER) && (_MSC_VER < 1000) // Visual Studio is missing inttypes.h # ifndef PRId64 # define PRId64 "I64d" diff --git a/src/server/authserver/PrecompiledHeaders/authPCH.h b/src/server/authserver/PrecompiledHeaders/authPCH.h index 0ec181d9c63..61059ae91b0 100644 --- a/src/server/authserver/PrecompiledHeaders/authPCH.h +++ b/src/server/authserver/PrecompiledHeaders/authPCH.h @@ -1,7 +1,7 @@ +#include "Common.h" #include "Configuration/Config.h" #include "Database/DatabaseEnv.h" #include "Log.h" #include "RealmList.h" #include "AuthServer.h" #include "AuthSession.h" -#include "Common.h" diff --git a/src/server/authserver/Realms/RealmList.cpp b/src/server/authserver/Realms/RealmList.cpp index 7ed9021dd21..94d52fb3138 100644 --- a/src/server/authserver/Realms/RealmList.cpp +++ b/src/server/authserver/Realms/RealmList.cpp @@ -102,7 +102,7 @@ void RealmList::UpdateRealms(bool init) (allowedSecurityLevel <= SEC_ADMINISTRATOR ? AccountTypes(allowedSecurityLevel) : SEC_ADMINISTRATOR), pop, build); if (init) - TC_LOG_INFO("server.authserver", "Added realm \"%s\" at %s:%u.", name.c_str(), m_realms[name].ExternalAddress.to_string(), port); + TC_LOG_INFO("server.authserver", "Added realm \"%s\" at %s:%u.", name.c_str(), m_realms[name].ExternalAddress.to_string().c_str(), port); } while (result->NextRow()); } diff --git a/src/server/collision/BoundingIntervalHierarchy.h b/src/server/collision/BoundingIntervalHierarchy.h index 4d38bfc18c4..491a299ca68 100644 --- a/src/server/collision/BoundingIntervalHierarchy.h +++ b/src/server/collision/BoundingIntervalHierarchy.h @@ -177,7 +177,7 @@ class BIH { uint32 tn = tree[node]; uint32 axis = (tn & (3 << 30)) >> 30; - bool BVH2 = tn & (1 << 29); + bool BVH2 = (tn & (1 << 29)) != 0; int offset = tn & ~(7 << 29); if (!BVH2) { @@ -271,7 +271,7 @@ class BIH { uint32 tn = tree[node]; uint32 axis = (tn & (3 << 30)) >> 30; - bool BVH2 = tn & (1 << 29); + bool BVH2 = (tn & (1 << 29)) != 0; int offset = tn & ~(7 << 29); if (!BVH2) { diff --git a/src/server/collision/Models/ModelInstance.cpp b/src/server/collision/Models/ModelInstance.cpp index 3262c154965..475984c4fd3 100644 --- a/src/server/collision/Models/ModelInstance.cpp +++ b/src/server/collision/Models/ModelInstance.cpp @@ -167,7 +167,7 @@ namespace VMAP check += fread(&spawn.iPos, sizeof(float), 3, rf); check += fread(&spawn.iRot, sizeof(float), 3, rf); check += fread(&spawn.iScale, sizeof(float), 1, rf); - bool has_bound = (spawn.flags & MOD_HAS_BOUND); + bool has_bound = (spawn.flags & MOD_HAS_BOUND) != 0; if (has_bound) // only WMOs have bound in MPQ, only available after computation { Vector3 bLow, bHigh; @@ -206,7 +206,7 @@ namespace VMAP check += fwrite(&spawn.iPos, sizeof(float), 3, wf); check += fwrite(&spawn.iRot, sizeof(float), 3, wf); check += fwrite(&spawn.iScale, sizeof(float), 1, wf); - bool has_bound = (spawn.flags & MOD_HAS_BOUND); + bool has_bound = (spawn.flags & MOD_HAS_BOUND) != 0; if (has_bound) // only WMOs have bound in MPQ, only available after computation { check += fwrite(&spawn.iBound.low(), sizeof(float), 3, wf); diff --git a/src/server/collision/VMapDefinitions.h b/src/server/collision/VMapDefinitions.h index 0bc74df51ec..8cd965ddffd 100644 --- a/src/server/collision/VMapDefinitions.h +++ b/src/server/collision/VMapDefinitions.h @@ -19,6 +19,7 @@ #ifndef _VMAPDEFINITIONS_H #define _VMAPDEFINITIONS_H #include <cstring> +#include <cstdio> #define LIQUID_TILE_SIZE (533.333f / 128.f) diff --git a/src/server/game/Events/GameEventMgr.cpp b/src/server/game/Events/GameEventMgr.cpp index e4522536a81..5669f36a939 100644 --- a/src/server/game/Events/GameEventMgr.cpp +++ b/src/server/game/Events/GameEventMgr.cpp @@ -1163,7 +1163,7 @@ void GameEventMgr::GameEventSpawn(int16 event_id) if (internal_event_id < 0 || internal_event_id >= int32(mGameEventCreatureGuids.size())) { - TC_LOG_ERROR("gameevent", "GameEventMgr::GameEventSpawn attempt access to out of range mGameEventCreatureGuids element %i (size: " SIZEFMTD ")", + TC_LOG_ERROR("gameevent", "GameEventMgr::GameEventSpawn attempt access to out of range mGameEventCreatureGuids element %i (size: %zu)", internal_event_id, mGameEventCreatureGuids.size()); return; } @@ -1190,7 +1190,7 @@ void GameEventMgr::GameEventSpawn(int16 event_id) if (internal_event_id < 0 || internal_event_id >= int32(mGameEventGameobjectGuids.size())) { - TC_LOG_ERROR("gameevent", "GameEventMgr::GameEventSpawn attempt access to out of range mGameEventGameobjectGuids element %i (size: " SIZEFMTD ")", + TC_LOG_ERROR("gameevent", "GameEventMgr::GameEventSpawn attempt access to out of range mGameEventGameobjectGuids element %i (size: %zu)", internal_event_id, mGameEventGameobjectGuids.size()); return; } @@ -1223,7 +1223,7 @@ void GameEventMgr::GameEventSpawn(int16 event_id) if (internal_event_id < 0 || internal_event_id >= int32(mGameEventPoolIds.size())) { - TC_LOG_ERROR("gameevent", "GameEventMgr::GameEventSpawn attempt access to out of range mGameEventPoolIds element %u (size: " SIZEFMTD ")", + TC_LOG_ERROR("gameevent", "GameEventMgr::GameEventSpawn attempt access to out of range mGameEventPoolIds element %u (size: %zu)", internal_event_id, mGameEventPoolIds.size()); return; } @@ -1238,7 +1238,7 @@ void GameEventMgr::GameEventUnspawn(int16 event_id) if (internal_event_id < 0 || internal_event_id >= int32(mGameEventCreatureGuids.size())) { - TC_LOG_ERROR("gameevent", "GameEventMgr::GameEventUnspawn attempt access to out of range mGameEventCreatureGuids element %i (size: " SIZEFMTD ")", + TC_LOG_ERROR("gameevent", "GameEventMgr::GameEventUnspawn attempt access to out of range mGameEventCreatureGuids element %i (size: %zu)", internal_event_id, mGameEventCreatureGuids.size()); return; } @@ -1260,7 +1260,7 @@ void GameEventMgr::GameEventUnspawn(int16 event_id) if (internal_event_id < 0 || internal_event_id >= int32(mGameEventGameobjectGuids.size())) { - TC_LOG_ERROR("gameevent", "GameEventMgr::GameEventUnspawn attempt access to out of range mGameEventGameobjectGuids element %i (size: " SIZEFMTD ")", + TC_LOG_ERROR("gameevent", "GameEventMgr::GameEventUnspawn attempt access to out of range mGameEventGameobjectGuids element %i (size: %zu)", internal_event_id, mGameEventGameobjectGuids.size()); return; } @@ -1281,7 +1281,7 @@ void GameEventMgr::GameEventUnspawn(int16 event_id) } if (internal_event_id < 0 || internal_event_id >= int32(mGameEventPoolIds.size())) { - TC_LOG_ERROR("gameevent", "GameEventMgr::GameEventUnspawn attempt access to out of range mGameEventPoolIds element %u (size: " SIZEFMTD ")", internal_event_id, mGameEventPoolIds.size()); + TC_LOG_ERROR("gameevent", "GameEventMgr::GameEventUnspawn attempt access to out of range mGameEventPoolIds element %u (size: %zu)", internal_event_id, mGameEventPoolIds.size()); return; } diff --git a/src/server/game/PrecompiledHeaders/gamePCH.h b/src/server/game/PrecompiledHeaders/gamePCH.h index 68f628430c4..d389c4b360c 100644 --- a/src/server/game/PrecompiledHeaders/gamePCH.h +++ b/src/server/game/PrecompiledHeaders/gamePCH.h @@ -1,9 +1,7 @@ //add here most rarely modified headers to speed up debug build compilation -#include "WorldSocket.h" // must be first to make ACE happy with ACE includes in it - #include "Common.h" - +#include "WorldSocket.h" #include "MapManager.h" #include "Log.h" #include "ObjectAccessor.h" diff --git a/src/server/scripts/Commands/cs_debug.cpp b/src/server/scripts/Commands/cs_debug.cpp index f18f9b4499c..d0050a0d4fd 100644 --- a/src/server/scripts/Commands/cs_debug.cpp +++ b/src/server/scripts/Commands/cs_debug.cpp @@ -745,14 +745,14 @@ public: if (item->GetOwnerGUID() != player->GetGUID()) { - handler->PSendSysMessage("queue(" SIZEFMTD "): For the item with guid %d, the owner's guid (%d) and the player's guid (%d) don't match!", i, item->GetGUIDLow(), GUID_LOPART(item->GetOwnerGUID()), player->GetGUIDLow()); + handler->PSendSysMessage("queue(%zu): For the item with guid %d, the owner's guid (%d) and the player's guid (%d) don't match!", i, item->GetGUIDLow(), GUID_LOPART(item->GetOwnerGUID()), player->GetGUIDLow()); error = true; continue; } if (item->GetQueuePos() != i) { - handler->PSendSysMessage("queue(" SIZEFMTD "): For the item with guid %d, the queuepos doesn't match it's position in the queue!", i, item->GetGUIDLow()); + handler->PSendSysMessage("queue(%zu): For the item with guid %d, the queuepos doesn't match it's position in the queue!", i, item->GetGUIDLow()); error = true; continue; } @@ -764,14 +764,14 @@ public: if (test == NULL) { - handler->PSendSysMessage("queue(" SIZEFMTD "): The bag(%d) and slot(%d) values for the item with guid %d are incorrect, the player doesn't have any item at that position!", i, item->GetBagSlot(), item->GetSlot(), item->GetGUIDLow()); + handler->PSendSysMessage("queue(%zu): The bag(%d) and slot(%d) values for the item with guid %d are incorrect, the player doesn't have any item at that position!", i, item->GetBagSlot(), item->GetSlot(), item->GetGUIDLow()); error = true; continue; } if (test != item) { - handler->PSendSysMessage("queue(" SIZEFMTD "): The bag(%d) and slot(%d) values for the item with guid %d are incorrect, an item which guid is %d is there instead!", i, item->GetBagSlot(), item->GetSlot(), item->GetGUIDLow(), test->GetGUIDLow()); + handler->PSendSysMessage("queue(%zu): The bag(%d) and slot(%d) values for the item with guid %d are incorrect, an item which guid is %d is there instead!", i, item->GetBagSlot(), item->GetSlot(), item->GetGUIDLow(), test->GetGUIDLow()); error = true; continue; } diff --git a/src/server/scripts/Commands/cs_mmaps.cpp b/src/server/scripts/Commands/cs_mmaps.cpp index d89edd4d925..0be5994e8ed 100644 --- a/src/server/scripts/Commands/cs_mmaps.cpp +++ b/src/server/scripts/Commands/cs_mmaps.cpp @@ -98,7 +98,7 @@ public: Movement::PointsArray const& pointPath = path.GetPath(); handler->PSendSysMessage("%s's path to %s:", target->GetName().c_str(), player->GetName().c_str()); handler->PSendSysMessage("Building: %s", useStraightPath ? "StraightPath" : "SmoothPath"); - handler->PSendSysMessage("Result: %s - Length: " SIZEFMTD " - Type: %u", (result ? "true" : "false"), pointPath.size(), path.GetPathType()); + handler->PSendSysMessage("Result: %s - Length: %zu - Type: %u", (result ? "true" : "false"), pointPath.size(), path.GetPathType()); G3D::Vector3 const &start = path.GetStartPosition(); G3D::Vector3 const &end = path.GetEndPosition(); @@ -273,7 +273,7 @@ public: if (!creatureList.empty()) { - handler->PSendSysMessage("Found " SIZEFMTD " Creatures.", creatureList.size()); + handler->PSendSysMessage("Found %zu Creatures.", creatureList.size()); uint32 paths = 0; uint32 uStartTime = getMSTime(); diff --git a/src/server/shared/Define.h b/src/server/shared/Define.h index e43853e5bb0..0678d84decd 100644 --- a/src/server/shared/Define.h +++ b/src/server/shared/Define.h @@ -19,23 +19,26 @@ #ifndef TRINITY_DEFINE_H #define TRINITY_DEFINE_H -#include "CompilerDefs.h" - -#include <ace/Basic_Types.h> -#include <ace/ACE_export.h> +#if COMPILER_GNU == COMPILER_GNU +# if !defined(__STDC_FORMAT_MACROS) +# define __STDC_FORMAT_MACROS +# endif +#endif #include <cstddef> +#include <cinttypes> +#include "CompilerDefs.h" #define TRINITY_LITTLEENDIAN 0 #define TRINITY_BIGENDIAN 1 #if !defined(TRINITY_ENDIAN) -# if defined (ACE_BIG_ENDIAN) +# if defined (BOOST_ENDIAN_BIG_BYTE) # define TRINITY_ENDIAN TRINITY_BIGENDIAN -# else //ACE_BYTE_ORDER != ACE_BIG_ENDIAN +# else # define TRINITY_ENDIAN TRINITY_LITTLEENDIAN -# endif //ACE_BYTE_ORDER -#endif //TRINITY_ENDIAN +# endif +#endif #if PLATFORM == PLATFORM_WINDOWS # define TRINITY_PATH_MAX MAX_PATH @@ -70,21 +73,19 @@ # define ATTR_DEPRECATED #endif //COMPILER == COMPILER_GNU -#define UI64FMTD ACE_UINT64_FORMAT_SPECIFIER -#define UI64LIT(N) ACE_UINT64_LITERAL(N) - -#define SI64FMTD ACE_INT64_FORMAT_SPECIFIER -#define SI64LIT(N) ACE_INT64_LITERAL(N) +#define UI64FMTD PRIu64 +#define UI64LIT(N) UINT64_C(N) -#define SIZEFMTD ACE_SIZE_T_FORMAT_SPECIFIER +#define SI64FMTD PRId64 +#define SI64LIT(N) INT64_C(N) -typedef ACE_INT64 int64; -typedef ACE_INT32 int32; -typedef ACE_INT16 int16; -typedef ACE_INT8 int8; -typedef ACE_UINT64 uint64; -typedef ACE_UINT32 uint32; -typedef ACE_UINT16 uint16; -typedef ACE_UINT8 uint8; +typedef int64_t int64; +typedef int32_t int32; +typedef int16_t int16; +typedef int8_t int8; +typedef uint64_t uint64; +typedef uint32_t uint32; +typedef uint16_t uint16; +typedef uint8_t uint8; #endif //TRINITY_DEFINE_H diff --git a/src/server/worldserver/PrecompiledHeaders/worldPCH.h b/src/server/worldserver/PrecompiledHeaders/worldPCH.h index f94dd953bba..889e3855995 100644 --- a/src/server/worldserver/PrecompiledHeaders/worldPCH.h +++ b/src/server/worldserver/PrecompiledHeaders/worldPCH.h @@ -1,6 +1,5 @@ -#include "WorldSocket.h" // must be first to make ACE happy with ACE includes in it - #include "Common.h" +#include "WorldSocket.h" #include "World.h" #include "Log.h" #include "Database/DatabaseEnv.h" |