mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 07:30:42 +01:00
Replaced ACE based typedefs for fixed width ints with C++11 versions
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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());
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
#ifndef _VMAPDEFINITIONS_H
|
||||
#define _VMAPDEFINITIONS_H
|
||||
#include <cstring>
|
||||
#include <cstdio>
|
||||
|
||||
#define LIQUID_TILE_SIZE (533.333f / 128.f)
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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 UI64FMTD PRIu64
|
||||
#define UI64LIT(N) UINT64_C(N)
|
||||
|
||||
#define SI64FMTD ACE_INT64_FORMAT_SPECIFIER
|
||||
#define SI64LIT(N) ACE_INT64_LITERAL(N)
|
||||
#define SI64FMTD PRId64
|
||||
#define SI64LIT(N) INT64_C(N)
|
||||
|
||||
#define SIZEFMTD ACE_SIZE_T_FORMAT_SPECIFIER
|
||||
|
||||
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
|
||||
|
||||
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user