summaryrefslogtreecommitdiff
path: root/src/common
diff options
context:
space:
mode:
authorFrancesco Borzì <borzifrancesco@gmail.com>2024-07-31 01:06:46 +0200
committerGitHub <noreply@github.com>2024-07-30 20:06:46 -0300
commit02a05fbd4c640b33b1e03075681f169db2fb6ab2 (patch)
treecfe8879750af8cd87d3ebbea244dd88c52e47275 /src/common
parent06a608d244cf24d5077cbcdf547993d2a0e30659 (diff)
refactor(src/common): remove unused imports (#19506)
* refactor(src/common): remove unused imports * fix: build * chore: fix build * chore: size_t -> std::size_t * chore: fix fuckup from previous commit * chore: fix build * chore: fix build * chore: fix build * chore: fix build with std::size_t * chore: fix build * chore: fix build * chore: fix build * chore: fix build * chore: fix build * chore: fix build * chore: fix build * chore: fix build * chore: fix build * chore: fix build * chore: fix build * chore: fix build
Diffstat (limited to 'src/common')
-rw-r--r--src/common/Asio/AsioHacksFwd.h2
-rw-r--r--src/common/Asio/Resolver.h1
-rw-r--r--src/common/Collision/DynamicTree.cpp2
-rw-r--r--src/common/Collision/Management/IMMAPMgr.h3
-rw-r--r--src/common/Collision/Management/MMapFactory.cpp2
-rw-r--r--src/common/Collision/Management/MMapFactory.h4
-rw-r--r--src/common/Collision/Management/MMapMgr.cpp2
-rw-r--r--src/common/Collision/Management/MMapMgr.h3
-rw-r--r--src/common/Collision/Management/VMapFactory.h2
-rw-r--r--src/common/Collision/Management/VMapMgr2.h1
-rw-r--r--src/common/Collision/Models/WorldModel.h1
-rw-r--r--src/common/Collision/RegularGrid.h1
-rw-r--r--src/common/Collision/VMapDefinitions.h1
-rw-r--r--src/common/Collision/VMapTools.h1
-rw-r--r--src/common/Common.h3
-rw-r--r--src/common/Configuration/Config.cpp14
-rw-r--r--src/common/Configuration/Config.h1
-rw-r--r--src/common/Cryptography/AES.cpp2
-rw-r--r--src/common/Cryptography/AES.h8
-rw-r--r--src/common/Cryptography/ARC4.cpp4
-rw-r--r--src/common/Cryptography/ARC4.h4
-rw-r--r--src/common/Cryptography/Authentication/AuthCrypt.cpp4
-rw-r--r--src/common/Cryptography/Authentication/AuthCrypt.h4
-rw-r--r--src/common/Cryptography/Authentication/AuthDefines.h2
-rw-r--r--src/common/Cryptography/Authentication/SRP6.cpp6
-rw-r--r--src/common/Cryptography/Authentication/SRP6.h6
-rw-r--r--src/common/Cryptography/BigNumber.cpp2
-rw-r--r--src/common/Cryptography/BigNumber.h4
-rw-r--r--src/common/Cryptography/CryptoConstants.h8
-rw-r--r--src/common/Cryptography/CryptoGenerics.h2
-rw-r--r--src/common/Cryptography/CryptoHash.h8
-rw-r--r--src/common/Cryptography/CryptoRandom.cpp2
-rw-r--r--src/common/Cryptography/CryptoRandom.h4
-rw-r--r--src/common/Cryptography/HMAC.h12
-rw-r--r--src/common/Cryptography/OpenSSLCrypto.cpp1
-rw-r--r--src/common/Cryptography/SessionKeyGenerator.h7
-rw-r--r--src/common/Cryptography/TOTP.h2
-rw-r--r--src/common/DataStores/DBCFileLoader.cpp2
-rw-r--r--src/common/DataStores/DBCFileLoader.h14
-rw-r--r--src/common/Debugging/WheatyExceptionReport.cpp10
-rw-r--r--src/common/Debugging/WheatyExceptionReport.h2
-rw-r--r--src/common/Define.h1
-rw-r--r--src/common/Dynamic/FactoryHolder.h1
-rw-r--r--src/common/Dynamic/ObjectRegistry.h3
-rw-r--r--src/common/Dynamic/TypeContainer.h4
-rw-r--r--src/common/Dynamic/TypeContainerFunctions.h13
-rw-r--r--src/common/Dynamic/TypeContainerFunctionsPtr.h10
-rw-r--r--src/common/Dynamic/TypeContainerVisitor.h1
-rw-r--r--src/common/Logging/Appender.h1
-rw-r--r--src/common/Logging/AppenderConsole.h1
-rw-r--r--src/common/Logging/AppenderFile.cpp2
-rw-r--r--src/common/Logging/AppenderFile.h1
-rw-r--r--src/common/Logging/Log.cpp4
-rw-r--r--src/common/Logging/Log.h1
-rw-r--r--src/common/Logging/LogOperation.h1
-rw-r--r--src/common/Logging/enuminfo_AppenderConsole.cpp6
-rw-r--r--src/common/Logging/enuminfo_LogCommon.cpp18
-rw-r--r--src/common/Metric/Metric.h2
-rw-r--r--src/common/Threading/MPSCQueue.h2
-rw-r--r--src/common/Threading/PCQueue.h5
-rw-r--r--src/common/Threading/ThreadingModel.h2
-rw-r--r--src/common/Utilities/AsyncCallbackProcessor.h1
-rw-r--r--src/common/Utilities/ByteConverter.h2
-rw-r--r--src/common/Utilities/CircularBuffer.h14
-rw-r--r--src/common/Utilities/Containers.h6
-rw-r--r--src/common/Utilities/EventProcessor.h1
-rw-r--r--src/common/Utilities/Geometry.h2
-rw-r--r--src/common/Utilities/IteratorPair.h1
-rw-r--r--src/common/Utilities/MathUtil.h2
-rw-r--r--src/common/Utilities/Physics.h3
-rw-r--r--src/common/Utilities/Random.cpp2
-rw-r--r--src/common/Utilities/Random.h2
-rw-r--r--src/common/Utilities/SFMTRand.cpp10
-rw-r--r--src/common/Utilities/SFMTRand.h8
-rw-r--r--src/common/Utilities/SmartEnum.h12
-rw-r--r--src/common/Utilities/StartProcess.h1
-rw-r--r--src/common/Utilities/StringConvert.h2
-rw-r--r--src/common/Utilities/TaskScheduler.cpp2
-rw-r--r--src/common/Utilities/TaskScheduler.h5
-rw-r--r--src/common/Utilities/Tokenize.cpp4
-rw-r--r--src/common/Utilities/Tokenize.h1
-rw-r--r--src/common/Utilities/Tuples.h2
-rw-r--r--src/common/Utilities/Util.cpp24
-rw-r--r--src/common/Utilities/Util.h20
84 files changed, 152 insertions, 218 deletions
diff --git a/src/common/Asio/AsioHacksFwd.h b/src/common/Asio/AsioHacksFwd.h
index fa49b351db..8746a92fd2 100644
--- a/src/common/Asio/AsioHacksFwd.h
+++ b/src/common/Asio/AsioHacksFwd.h
@@ -18,8 +18,6 @@
#ifndef AsioHacksFwd_h__
#define AsioHacksFwd_h__
-#include <boost/version.hpp>
-
/**
Collection of forward declarations to improve compile time
*/
diff --git a/src/common/Asio/Resolver.h b/src/common/Asio/Resolver.h
index 45b3c5b79e..a49b8fcda5 100644
--- a/src/common/Asio/Resolver.h
+++ b/src/common/Asio/Resolver.h
@@ -18,7 +18,6 @@
#ifndef Resolver_h__
#define Resolver_h__
-#include "IoContext.h"
#include "Optional.h"
#include <boost/asio/ip/tcp.hpp>
#include <string>
diff --git a/src/common/Collision/DynamicTree.cpp b/src/common/Collision/DynamicTree.cpp
index e7538a32ad..aef80fa914 100644
--- a/src/common/Collision/DynamicTree.cpp
+++ b/src/common/Collision/DynamicTree.cpp
@@ -40,7 +40,7 @@ namespace
template<> struct HashTrait< GameObjectModel>
{
- static size_t hashCode(const GameObjectModel& g) { return (size_t)(void*)&g; }
+ static std::size_t hashCode(const GameObjectModel& g) { return (size_t)(void*)&g; }
};
template<> struct PositionTrait< GameObjectModel>
diff --git a/src/common/Collision/Management/IMMAPMgr.h b/src/common/Collision/Management/IMMAPMgr.h
index 7ffb7d10e9..e68f0ff488 100644
--- a/src/common/Collision/Management/IMMAPMgr.h
+++ b/src/common/Collision/Management/IMMAPMgr.h
@@ -18,9 +18,6 @@
#ifndef _IMMAPMANAGER_H
#define _IMMAPMANAGER_H
-#include "Define.h"
-#include <string>
-
// Interface for IMMapManger
namespace MMAP
{
diff --git a/src/common/Collision/Management/MMapFactory.cpp b/src/common/Collision/Management/MMapFactory.cpp
index af0a46cab6..70a57726dd 100644
--- a/src/common/Collision/Management/MMapFactory.cpp
+++ b/src/common/Collision/Management/MMapFactory.cpp
@@ -17,8 +17,6 @@
#include "MMapFactory.h"
#include <cstring>
-#include <set>
-
namespace MMAP
{
// ######################## MMapFactory ########################
diff --git a/src/common/Collision/Management/MMapFactory.h b/src/common/Collision/Management/MMapFactory.h
index 61c6010807..08136b6fc9 100644
--- a/src/common/Collision/Management/MMapFactory.h
+++ b/src/common/Collision/Management/MMapFactory.h
@@ -18,11 +18,7 @@
#ifndef _MMAP_FACTORY_H
#define _MMAP_FACTORY_H
-#include "DetourAlloc.h"
-#include "DetourExtended.h"
-#include "DetourNavMesh.h"
#include "MMapMgr.h"
-#include <unordered_map>
namespace MMAP
{
diff --git a/src/common/Collision/Management/MMapMgr.cpp b/src/common/Collision/Management/MMapMgr.cpp
index 622220c5a3..bb67910573 100644
--- a/src/common/Collision/Management/MMapMgr.cpp
+++ b/src/common/Collision/Management/MMapMgr.cpp
@@ -174,7 +174,7 @@ namespace MMAP
unsigned char* data = (unsigned char*)dtAlloc(fileHeader.size, DT_ALLOC_PERM);
ASSERT(data);
- size_t result = fread(data, fileHeader.size, 1, file);
+ std::size_t result = fread(data, fileHeader.size, 1, file);
if (!result)
{
LOG_ERROR("maps", "MMAP:loadMap: Bad header or data in mmap {:03}{:02}{:02}.mmtile", mapId, x, y);
diff --git a/src/common/Collision/Management/MMapMgr.h b/src/common/Collision/Management/MMapMgr.h
index d6ca2c44cb..013f34292a 100644
--- a/src/common/Collision/Management/MMapMgr.h
+++ b/src/common/Collision/Management/MMapMgr.h
@@ -22,12 +22,11 @@
#include "DetourAlloc.h"
#include "DetourExtended.h"
#include "DetourNavMesh.h"
-#include <shared_mutex>
#include <unordered_map>
#include <vector>
// memory management
-inline void* dtCustomAlloc(size_t size, dtAllocHint /*hint*/)
+inline void* dtCustomAlloc(std::size_t size, dtAllocHint /*hint*/)
{
return (void*)new unsigned char[size];
}
diff --git a/src/common/Collision/Management/VMapFactory.h b/src/common/Collision/Management/VMapFactory.h
index 512ccb2523..aa6ebd4ee8 100644
--- a/src/common/Collision/Management/VMapFactory.h
+++ b/src/common/Collision/Management/VMapFactory.h
@@ -18,8 +18,6 @@
#ifndef _VMAPFACTORY_H
#define _VMAPFACTORY_H
-#include "IVMapMgr.h"
-
// This is the access point to the VMapMgr.
namespace VMAP
{
diff --git a/src/common/Collision/Management/VMapMgr2.h b/src/common/Collision/Management/VMapMgr2.h
index 4c37a95b41..f025c8086c 100644
--- a/src/common/Collision/Management/VMapMgr2.h
+++ b/src/common/Collision/Management/VMapMgr2.h
@@ -18,7 +18,6 @@
#ifndef _VMAPMANAGER2_H
#define _VMAPMANAGER2_H
-#include "Common.h"
#include "IVMapMgr.h"
#include <mutex>
#include <unordered_map>
diff --git a/src/common/Collision/Models/WorldModel.h b/src/common/Collision/Models/WorldModel.h
index b1a268318c..df1bd47512 100644
--- a/src/common/Collision/Models/WorldModel.h
+++ b/src/common/Collision/Models/WorldModel.h
@@ -21,7 +21,6 @@
#include "BoundingIntervalHierarchy.h"
#include "Define.h"
#include <G3D/AABox.h>
-#include <G3D/HashTrait.h>
#include <G3D/Ray.h>
#include <G3D/Vector3.h>
diff --git a/src/common/Collision/RegularGrid.h b/src/common/Collision/RegularGrid.h
index 7de66a39a0..1a24c4258e 100644
--- a/src/common/Collision/RegularGrid.h
+++ b/src/common/Collision/RegularGrid.h
@@ -1,7 +1,6 @@
#ifndef _REGULAR_GRID_H
#define _REGULAR_GRID_H
-#include <G3D/BoundsTrait.h>
#include <G3D/PositionTrait.h>
#include <G3D/Ray.h>
#include <G3D/Table.h>
diff --git a/src/common/Collision/VMapDefinitions.h b/src/common/Collision/VMapDefinitions.h
index c2094a722b..eee744fe45 100644
--- a/src/common/Collision/VMapDefinitions.h
+++ b/src/common/Collision/VMapDefinitions.h
@@ -17,7 +17,6 @@
#ifndef _VMAPDEFINITIONS_H
#define _VMAPDEFINITIONS_H
-#include <cstring>
#define LIQUID_TILE_SIZE (533.333f / 128.f)
diff --git a/src/common/Collision/VMapTools.h b/src/common/Collision/VMapTools.h
index 42350df676..f200e3647b 100644
--- a/src/common/Collision/VMapTools.h
+++ b/src/common/Collision/VMapTools.h
@@ -18,7 +18,6 @@
#ifndef _VMAPTOOLS_H
#define _VMAPTOOLS_H
-#include "Define.h"
#include <G3D/AABox.h>
#include <G3D/CollisionDetection.h>
diff --git a/src/common/Common.h b/src/common/Common.h
index 5f1267199d..cd50104c88 100644
--- a/src/common/Common.h
+++ b/src/common/Common.h
@@ -19,10 +19,7 @@
#define AZEROTHCORE_COMMON_H
#include "Define.h"
-#include <array>
-#include <memory>
#include <string>
-#include <utility>
#if AC_PLATFORM == AC_PLATFORM_WINDOWS
#include <ws2tcpip.h>
diff --git a/src/common/Configuration/Config.cpp b/src/common/Configuration/Config.cpp
index 0cd69584d3..2261c14b10 100644
--- a/src/common/Configuration/Config.cpp
+++ b/src/common/Configuration/Config.cpp
@@ -46,9 +46,9 @@ namespace
// Check system configs like *server.conf*
bool IsAppConfig(std::string_view fileName)
{
- size_t foundAuth = fileName.find("authserver.conf");
- size_t foundWorld = fileName.find("worldserver.conf");
- size_t foundImport = fileName.find("dbimport.conf");
+ std::size_t foundAuth = fileName.find("authserver.conf");
+ std::size_t foundWorld = fileName.find("worldserver.conf");
+ std::size_t foundImport = fileName.find("dbimport.conf");
return foundAuth != std::string_view::npos || foundWorld != std::string_view::npos || foundImport != std::string_view::npos;
}
@@ -56,8 +56,8 @@ namespace
// Check logging system configs like Appender.* and Logger.*
bool IsLoggingSystemOptions(std::string_view optionName)
{
- size_t foundAppender = optionName.find("Appender.");
- size_t foundLogger = optionName.find("Logger.");
+ std::size_t foundAppender = optionName.find("Appender.");
+ std::size_t foundLogger = optionName.find("Logger.");
return foundAppender != std::string_view::npos || foundLogger != std::string_view::npos;
}
@@ -223,7 +223,7 @@ namespace
std::string result;
const char* str = key.c_str();
- size_t n = key.length();
+ std::size_t n = key.length();
char curr;
bool isEnd;
@@ -231,7 +231,7 @@ namespace
bool currIsNumeric;
bool nextIsNumeric;
- for (size_t i = 0; i < n; ++i)
+ for (std::size_t i = 0; i < n; ++i)
{
curr = str[i];
if (curr == ' ' || curr == '.' || curr == '-')
diff --git a/src/common/Configuration/Config.h b/src/common/Configuration/Config.h
index c7708290e7..ccb35132dd 100644
--- a/src/common/Configuration/Config.h
+++ b/src/common/Configuration/Config.h
@@ -18,7 +18,6 @@
#ifndef CONFIG_H
#define CONFIG_H
-#include "Define.h"
#include <stdexcept>
#include <string_view>
#include <vector>
diff --git a/src/common/Cryptography/AES.cpp b/src/common/Cryptography/AES.cpp
index 31e0847005..f4061cdcbc 100644
--- a/src/common/Cryptography/AES.cpp
+++ b/src/common/Cryptography/AES.cpp
@@ -37,7 +37,7 @@ void Acore::Crypto::AES::Init(Key const& key)
ASSERT(status);
}
-bool Acore::Crypto::AES::Process(IV const& iv, uint8* data, size_t length, Tag& tag)
+bool Acore::Crypto::AES::Process(IV const& iv, uint8* data, std::size_t length, Tag& tag)
{
ASSERT(length <= static_cast<size_t>(std::numeric_limits<int>::max()));
int len = static_cast<int>(length);
diff --git a/src/common/Cryptography/AES.h b/src/common/Cryptography/AES.h
index c73aeebea2..c49f181831 100644
--- a/src/common/Cryptography/AES.h
+++ b/src/common/Cryptography/AES.h
@@ -27,9 +27,9 @@ namespace Acore::Crypto
class AC_COMMON_API AES
{
public:
- static constexpr size_t IV_SIZE_BYTES = 12;
- static constexpr size_t KEY_SIZE_BYTES = 16;
- static constexpr size_t TAG_SIZE_BYTES = 12;
+ static constexpr std::size_t IV_SIZE_BYTES = 12;
+ static constexpr std::size_t KEY_SIZE_BYTES = 16;
+ static constexpr std::size_t TAG_SIZE_BYTES = 12;
using IV = std::array<uint8, IV_SIZE_BYTES>;
using Key = std::array<uint8, KEY_SIZE_BYTES>;
@@ -40,7 +40,7 @@ namespace Acore::Crypto
void Init(Key const& key);
- bool Process(IV const& iv, uint8* data, size_t length, Tag& tag);
+ bool Process(IV const& iv, uint8* data, std::size_t length, Tag& tag);
private:
EVP_CIPHER_CTX* _ctx;
diff --git a/src/common/Cryptography/ARC4.cpp b/src/common/Cryptography/ARC4.cpp
index 90535f7477..10a7ad490c 100644
--- a/src/common/Cryptography/ARC4.cpp
+++ b/src/common/Cryptography/ARC4.cpp
@@ -40,7 +40,7 @@ Acore::Crypto::ARC4::~ARC4()
#endif
}
-void Acore::Crypto::ARC4::Init(uint8 const* seed, size_t len)
+void Acore::Crypto::ARC4::Init(uint8 const* seed, std::size_t len)
{
int result1 = EVP_CIPHER_CTX_set_key_length(_ctx, len);
ASSERT(result1 == 1);
@@ -48,7 +48,7 @@ void Acore::Crypto::ARC4::Init(uint8 const* seed, size_t len)
ASSERT(result2 == 1);
}
-void Acore::Crypto::ARC4::UpdateData(uint8* data, size_t len)
+void Acore::Crypto::ARC4::UpdateData(uint8* data, std::size_t len)
{
int outlen = 0;
int result1 = EVP_EncryptUpdate(_ctx, data, &outlen, data, len);
diff --git a/src/common/Cryptography/ARC4.h b/src/common/Cryptography/ARC4.h
index f598589a29..7f4f0dc532 100644
--- a/src/common/Cryptography/ARC4.h
+++ b/src/common/Cryptography/ARC4.h
@@ -30,12 +30,12 @@ namespace Acore::Crypto
ARC4();
~ARC4();
- void Init(uint8 const* seed, size_t len);
+ void Init(uint8 const* seed, std::size_t len);
template <typename Container>
void Init(Container const& c) { Init(std::data(c), std::size(c)); }
- void UpdateData(uint8* data, size_t len);
+ void UpdateData(uint8* data, std::size_t len);
template <typename Container>
void UpdateData(Container& c) { UpdateData(std::data(c), std::size(c)); }
diff --git a/src/common/Cryptography/Authentication/AuthCrypt.cpp b/src/common/Cryptography/Authentication/AuthCrypt.cpp
index 21115ed155..26084f76ab 100644
--- a/src/common/Cryptography/Authentication/AuthCrypt.cpp
+++ b/src/common/Cryptography/Authentication/AuthCrypt.cpp
@@ -35,13 +35,13 @@ void AuthCrypt::Init(SessionKey const& K)
_initialized = true;
}
-void AuthCrypt::DecryptRecv(uint8* data, size_t len)
+void AuthCrypt::DecryptRecv(uint8* data, std::size_t len)
{
ASSERT(_initialized);
_clientDecrypt.UpdateData(data, len);
}
-void AuthCrypt::EncryptSend(uint8* data, size_t len)
+void AuthCrypt::EncryptSend(uint8* data, std::size_t len)
{
ASSERT(_initialized);
_serverEncrypt.UpdateData(data, len);
diff --git a/src/common/Cryptography/Authentication/AuthCrypt.h b/src/common/Cryptography/Authentication/AuthCrypt.h
index 88239a9e36..3a7ff89df9 100644
--- a/src/common/Cryptography/Authentication/AuthCrypt.h
+++ b/src/common/Cryptography/Authentication/AuthCrypt.h
@@ -27,8 +27,8 @@ public:
AuthCrypt() = default;
void Init(SessionKey const& K);
- void DecryptRecv(uint8* data, size_t len);
- void EncryptSend(uint8* data, size_t len);
+ void DecryptRecv(uint8* data, std::size_t len);
+ void EncryptSend(uint8* data, std::size_t len);
bool IsInitialized() const { return _initialized; }
diff --git a/src/common/Cryptography/Authentication/AuthDefines.h b/src/common/Cryptography/Authentication/AuthDefines.h
index 85d0dbf494..3de2a02fbe 100644
--- a/src/common/Cryptography/Authentication/AuthDefines.h
+++ b/src/common/Cryptography/Authentication/AuthDefines.h
@@ -21,7 +21,7 @@
#include "Define.h"
#include <array>
-constexpr size_t SESSION_KEY_LENGTH = 40;
+constexpr std::size_t SESSION_KEY_LENGTH = 40;
using SessionKey = std::array<uint8, SESSION_KEY_LENGTH>;
#endif
diff --git a/src/common/Cryptography/Authentication/SRP6.cpp b/src/common/Cryptography/Authentication/SRP6.cpp
index 20e05f5b2b..e89ac99a74 100644
--- a/src/common/Cryptography/Authentication/SRP6.cpp
+++ b/src/common/Cryptography/Authentication/SRP6.cpp
@@ -51,14 +51,14 @@ using SRP6 = Acore::Crypto::SRP6;
{
// split S into two buffers
std::array<uint8, EPHEMERAL_KEY_LENGTH / 2> buf0{}, buf1{};
- for (size_t i = 0; i < EPHEMERAL_KEY_LENGTH / 2; ++i)
+ for (std::size_t i = 0; i < EPHEMERAL_KEY_LENGTH / 2; ++i)
{
buf0[i] = S[2 * i + 0];
buf1[i] = S[2 * i + 1];
}
// find position of first nonzero byte
- size_t p = 0;
+ std::size_t p = 0;
while (p < EPHEMERAL_KEY_LENGTH && !S[p])
++p;
@@ -73,7 +73,7 @@ using SRP6 = Acore::Crypto::SRP6;
// stick the two hashes back together
SessionKey K;
- for (size_t i = 0; i < SHA1::DIGEST_LENGTH; ++i)
+ for (std::size_t i = 0; i < SHA1::DIGEST_LENGTH; ++i)
{
K[2 * i + 0] = hash0[i];
K[2 * i + 1] = hash1[i];
diff --git a/src/common/Cryptography/Authentication/SRP6.h b/src/common/Cryptography/Authentication/SRP6.h
index 734ef12980..d7f288dc39 100644
--- a/src/common/Cryptography/Authentication/SRP6.h
+++ b/src/common/Cryptography/Authentication/SRP6.h
@@ -28,13 +28,13 @@ namespace Acore::Crypto
class AC_COMMON_API SRP6
{
public:
- static constexpr size_t SALT_LENGTH = 32;
+ static constexpr std::size_t SALT_LENGTH = 32;
using Salt = std::array<uint8, SALT_LENGTH>;
- static constexpr size_t VERIFIER_LENGTH = 32;
+ static constexpr std::size_t VERIFIER_LENGTH = 32;
using Verifier = std::array<uint8, VERIFIER_LENGTH>;
- static constexpr size_t EPHEMERAL_KEY_LENGTH = 32;
+ static constexpr std::size_t EPHEMERAL_KEY_LENGTH = 32;
using EphemeralKey = std::array<uint8, EPHEMERAL_KEY_LENGTH>;
static std::array<uint8, 1> const g;
diff --git a/src/common/Cryptography/BigNumber.cpp b/src/common/Cryptography/BigNumber.cpp
index 1cd8d6a199..decfeecbe5 100644
--- a/src/common/Cryptography/BigNumber.cpp
+++ b/src/common/Cryptography/BigNumber.cpp
@@ -195,7 +195,7 @@ bool BigNumber::IsNegative() const
return BN_is_negative(_bn);
}
-void BigNumber::GetBytes(uint8* buf, size_t bufsize, bool littleEndian) const
+void BigNumber::GetBytes(uint8* buf, std::size_t bufsize, bool littleEndian) const
{
#if defined(OPENSSL_VERSION_NUMBER) && OPENSSL_VERSION_NUMBER < 0x10100000L
int nBytes = GetNumBytes();
diff --git a/src/common/Cryptography/BigNumber.h b/src/common/Cryptography/BigNumber.h
index 259fa92ed2..591da4e67a 100644
--- a/src/common/Cryptography/BigNumber.h
+++ b/src/common/Cryptography/BigNumber.h
@@ -34,7 +34,7 @@ public:
BigNumber(int32 v) : BigNumber() { SetDword(v); }
BigNumber(std::string const& v) : BigNumber() { SetHexStr(v); }
- template <size_t Size>
+ template <std::size_t Size>
BigNumber(std::array<uint8, Size> const& v, bool littleEndian = true) : BigNumber() { SetBinary(v.data(), Size, littleEndian); }
~BigNumber();
@@ -116,7 +116,7 @@ public:
[[nodiscard]] uint32 AsDword() const;
- void GetBytes(uint8* buf, size_t bufsize, bool littleEndian = true) const;
+ void GetBytes(uint8* buf, std::size_t bufsize, bool littleEndian = true) const;
[[nodiscard]] std::vector<uint8> ToByteVector(int32 minSize = 0, bool littleEndian = true) const;
template <std::size_t Size>
diff --git a/src/common/Cryptography/CryptoConstants.h b/src/common/Cryptography/CryptoConstants.h
index 3ba8b55d6a..7fadc4f366 100644
--- a/src/common/Cryptography/CryptoConstants.h
+++ b/src/common/Cryptography/CryptoConstants.h
@@ -18,15 +18,13 @@
#ifndef AZEROTHCORE_CRYPTO_CONSTANTS_H
#define AZEROTHCORE_CRYPTO_CONSTANTS_H
-#include "Define.h"
-
namespace Acore::Crypto
{
struct Constants
{
- static constexpr size_t MD5_DIGEST_LENGTH_BYTES = 16;
- static constexpr size_t SHA1_DIGEST_LENGTH_BYTES = 20;
- static constexpr size_t SHA256_DIGEST_LENGTH_BYTES = 32;
+ static constexpr std::size_t MD5_DIGEST_LENGTH_BYTES = 16;
+ static constexpr std::size_t SHA1_DIGEST_LENGTH_BYTES = 20;
+ static constexpr std::size_t SHA256_DIGEST_LENGTH_BYTES = 32;
};
}
diff --git a/src/common/Cryptography/CryptoGenerics.h b/src/common/Cryptography/CryptoGenerics.h
index d4b799747c..3e84c6b3ec 100644
--- a/src/common/Cryptography/CryptoGenerics.h
+++ b/src/common/Cryptography/CryptoGenerics.h
@@ -47,7 +47,7 @@ namespace Acore::Impl
static void SplitFromBack(std::vector<uint8>& data, Container& tail)
{
ASSERT(data.size() >= std::size(tail));
- for (size_t i = 1, N = std::size(tail); i <= N; ++i)
+ for (std::size_t i = 1, N = std::size(tail); i <= N; ++i)
{
tail[N - i] = data.back();
data.pop_back();
diff --git a/src/common/Cryptography/CryptoHash.h b/src/common/Cryptography/CryptoHash.h
index 1763351bc7..6b98c5cd5b 100644
--- a/src/common/Cryptography/CryptoHash.h
+++ b/src/common/Cryptography/CryptoHash.h
@@ -43,14 +43,14 @@ namespace Acore::Impl
#endif
};
- template <GenericHashImpl::HashCreator HashCreator, size_t DigestLength>
+ template <GenericHashImpl::HashCreator HashCreator, std::size_t DigestLength>
class GenericHash
{
public:
- static constexpr size_t DIGEST_LENGTH = DigestLength;
+ static constexpr std::size_t DIGEST_LENGTH = DigestLength;
using Digest = std::array<uint8, DIGEST_LENGTH>;
- static Digest GetDigestOf(uint8 const* data, size_t len)
+ static Digest GetDigestOf(uint8 const* data, std::size_t len)
{
GenericHash hash;
hash.UpdateData(data, len);
@@ -112,7 +112,7 @@ namespace Acore::Impl
return *this;
}
- void UpdateData(uint8 const* data, size_t len)
+ void UpdateData(uint8 const* data, std::size_t len)
{
int result = EVP_DigestUpdate(_ctx, data, len);
ASSERT(result == 1);
diff --git a/src/common/Cryptography/CryptoRandom.cpp b/src/common/Cryptography/CryptoRandom.cpp
index 35d78f7444..c44f73eab5 100644
--- a/src/common/Cryptography/CryptoRandom.cpp
+++ b/src/common/Cryptography/CryptoRandom.cpp
@@ -19,7 +19,7 @@
#include "Errors.h"
#include <openssl/rand.h>
-void Acore::Crypto::GetRandomBytes(uint8* buf, size_t len)
+void Acore::Crypto::GetRandomBytes(uint8* buf, std::size_t len)
{
int result = RAND_bytes(buf, len);
ASSERT(result == 1, "Not enough randomness in OpenSSL's entropy pool. What in the world are you running on?");
diff --git a/src/common/Cryptography/CryptoRandom.h b/src/common/Cryptography/CryptoRandom.h
index 07f87df00d..7554735ad5 100644
--- a/src/common/Cryptography/CryptoRandom.h
+++ b/src/common/Cryptography/CryptoRandom.h
@@ -23,7 +23,7 @@
namespace Acore::Crypto
{
- AC_COMMON_API void GetRandomBytes(uint8* buf, size_t len);
+ AC_COMMON_API void GetRandomBytes(uint8* buf, std::size_t len);
template <typename Container>
void GetRandomBytes(Container& c)
@@ -31,7 +31,7 @@ namespace Acore::Crypto
GetRandomBytes(std::data(c), std::size(c));
}
- template <size_t S>
+ template <std::size_t S>
std::array<uint8, S> GetRandomBytes()
{
std::array<uint8, S> arr;
diff --git a/src/common/Cryptography/HMAC.h b/src/common/Cryptography/HMAC.h
index ebfc1e14ba..6830c6131f 100644
--- a/src/common/Cryptography/HMAC.h
+++ b/src/common/Cryptography/HMAC.h
@@ -29,15 +29,15 @@ class BigNumber;
namespace Acore::Impl
{
- template <GenericHashImpl::HashCreator HashCreator, size_t DigestLength>
+ template <GenericHashImpl::HashCreator HashCreator, std::size_t DigestLength>
class GenericHMAC
{
public:
- static constexpr size_t DIGEST_LENGTH = DigestLength;
+ static constexpr std::size_t DIGEST_LENGTH = DigestLength;
using Digest = std::array<uint8, DIGEST_LENGTH>;
template <typename Container>
- static Digest GetDigestOf(Container const& seed, uint8 const* data, size_t len)
+ static Digest GetDigestOf(Container const& seed, uint8 const* data, std::size_t len)
{
GenericHMAC hash(seed);
hash.UpdateData(data, len);
@@ -54,7 +54,7 @@ namespace Acore::Impl
return hash.GetDigest();
}
- GenericHMAC(uint8 const* seed, size_t len) : _ctx(GenericHashImpl::MakeCTX()), _key(EVP_PKEY_new_mac_key(EVP_PKEY_HMAC, nullptr, seed, len))
+ GenericHMAC(uint8 const* seed, std::size_t len) : _ctx(GenericHashImpl::MakeCTX()), _key(EVP_PKEY_new_mac_key(EVP_PKEY_HMAC, nullptr, seed, len))
{
int result = EVP_DigestSignInit(_ctx, nullptr, HashCreator(), nullptr, _key);
ASSERT(result == 1);
@@ -105,7 +105,7 @@ namespace Acore::Impl
return *this;
}
- void UpdateData(uint8 const* data, size_t len)
+ void UpdateData(uint8 const* data, std::size_t len)
{
int result = EVP_DigestSignUpdate(_ctx, data, len);
ASSERT(result == 1);
@@ -120,7 +120,7 @@ namespace Acore::Impl
void Finalize()
{
- size_t length = DIGEST_LENGTH;
+ std::size_t length = DIGEST_LENGTH;
int result = EVP_DigestSignFinal(_ctx, _digest.data(), &length);
ASSERT(result == 1);
ASSERT(length == DIGEST_LENGTH);
diff --git a/src/common/Cryptography/OpenSSLCrypto.cpp b/src/common/Cryptography/OpenSSLCrypto.cpp
index 036a94c0e7..1a69a0c0f8 100644
--- a/src/common/Cryptography/OpenSSLCrypto.cpp
+++ b/src/common/Cryptography/OpenSSLCrypto.cpp
@@ -16,7 +16,6 @@
*/
#include "OpenSSLCrypto.h"
-#include "Errors.h"
#include <openssl/crypto.h> // NOTE: this import is NEEDED (even though some IDEs report it as unused)
#if defined(OPENSSL_VERSION_NUMBER) && OPENSSL_VERSION_NUMBER < 0x1010000fL
diff --git a/src/common/Cryptography/SessionKeyGenerator.h b/src/common/Cryptography/SessionKeyGenerator.h
index 43dca3f235..bafd9ce014 100644
--- a/src/common/Cryptography/SessionKeyGenerator.h
+++ b/src/common/Cryptography/SessionKeyGenerator.h
@@ -18,9 +18,6 @@
#ifndef AZEROTHCORE_SESSIONKEYGENERATOR_HPP
#define AZEROTHCORE_SESSIONKEYGENERATOR_HPP
-#include "CryptoHash.h"
-#include <cstring>
-
template <typename Hash>
class SessionKeyGenerator
{
@@ -30,8 +27,8 @@ public:
o0it(o0.begin())
{
uint8 const* data = std::data(buf);
- size_t const len = std::size(buf);
- size_t const halflen = (len / 2);
+ std::size_t const len = std::size(buf);
+ std::size_t const halflen = (len / 2);
o1 = Hash::GetDigestOf(data, halflen);
o2 = Hash::GetDigestOf(data + halflen, len - halflen);
diff --git a/src/common/Cryptography/TOTP.h b/src/common/Cryptography/TOTP.h
index ddcaf75734..56ddccb6be 100644
--- a/src/common/Cryptography/TOTP.h
+++ b/src/common/Cryptography/TOTP.h
@@ -26,7 +26,7 @@ namespace Acore::Crypto
{
struct AC_COMMON_API TOTP
{
- static constexpr size_t RECOMMENDED_SECRET_LENGTH = 20;
+ static constexpr std::size_t RECOMMENDED_SECRET_LENGTH = 20;
using Secret = std::vector<uint8>;
static uint32 GenerateToken(Secret const& key, time_t timestamp);
diff --git a/src/common/DataStores/DBCFileLoader.cpp b/src/common/DataStores/DBCFileLoader.cpp
index 80bb213b57..dfabe1630d 100644
--- a/src/common/DataStores/DBCFileLoader.cpp
+++ b/src/common/DataStores/DBCFileLoader.cpp
@@ -120,7 +120,7 @@ DBCFileLoader::~DBCFileLoader()
delete[] fieldsOffset;
}
-DBCFileLoader::Record DBCFileLoader::getRecord(size_t id)
+DBCFileLoader::Record DBCFileLoader::getRecord(std::size_t id)
{
ASSERT(data);
return Record(*this, data + id * recordSize);
diff --git a/src/common/DataStores/DBCFileLoader.h b/src/common/DataStores/DBCFileLoader.h
index c6781d40fa..ffe52e9a03 100644
--- a/src/common/DataStores/DBCFileLoader.h
+++ b/src/common/DataStores/DBCFileLoader.h
@@ -46,7 +46,7 @@ public:
class Record
{
public:
- [[nodiscard]] float getFloat(size_t field) const
+ [[nodiscard]] float getFloat(std::size_t field) const
{
ASSERT(field < file.fieldCount);
float val = *reinterpret_cast<float*>(offset + file.GetOffset(field));
@@ -54,7 +54,7 @@ public:
return val;
}
- [[nodiscard]] uint32 getUInt(size_t field) const
+ [[nodiscard]] uint32 getUInt(std::size_t field) const
{
ASSERT(field < file.fieldCount);
uint32 val = *reinterpret_cast<uint32*>(offset + file.GetOffset(field));
@@ -62,16 +62,16 @@ public:
return val;
}
- [[nodiscard]] uint8 getUInt8(size_t field) const
+ [[nodiscard]] uint8 getUInt8(std::size_t field) const
{
ASSERT(field < file.fieldCount);
return *reinterpret_cast<uint8*>(offset + file.GetOffset(field));
}
- [[nodiscard]] const char* getString(size_t field) const
+ [[nodiscard]] const char* getString(std::size_t field) const
{
ASSERT(field < file.fieldCount);
- size_t stringOffset = getUInt(field);
+ std::size_t stringOffset = getUInt(field);
ASSERT(stringOffset < file.stringSize);
return reinterpret_cast<char*>(file.stringTable + stringOffset);
}
@@ -85,12 +85,12 @@ public:
};
// Get record by id
- Record getRecord(size_t id);
+ Record getRecord(std::size_t id);
[[nodiscard]] uint32 GetNumRows() const { return recordCount; }
[[nodiscard]] uint32 GetRowSize() const { return recordSize; }
[[nodiscard]] uint32 GetCols() const { return fieldCount; }
- [[nodiscard]] uint32 GetOffset(size_t id) const { return (fieldsOffset != nullptr && id < fieldCount) ? fieldsOffset[id] : 0; }
+ [[nodiscard]] uint32 GetOffset(std::size_t id) const { return (fieldsOffset != nullptr && id < fieldCount) ? fieldsOffset[id] : 0; }
[[nodiscard]] bool IsLoaded() const { return data != nullptr; }
char* AutoProduceData(char const* fmt, uint32& count, char**& indexTable);
char* AutoProduceStrings(char const* fmt, char* dataTable);
diff --git a/src/common/Debugging/WheatyExceptionReport.cpp b/src/common/Debugging/WheatyExceptionReport.cpp
index be56630025..57ba80cae7 100644
--- a/src/common/Debugging/WheatyExceptionReport.cpp
+++ b/src/common/Debugging/WheatyExceptionReport.cpp
@@ -260,13 +260,13 @@ BOOL WheatyExceptionReport::_GetProcessorName(TCHAR* sProcessorName, DWORD maxco
return TRUE;
}
-template<size_t size>
+template<std::size_t size>
void ToTchar(wchar_t const* src, TCHAR (&dst)[size], std::true_type)
{
wcstombs_s(nullptr, dst, src, size);
}
-template<size_t size>
+template<std::size_t size>
void ToTchar(wchar_t const* src, TCHAR (&dst)[size], std::false_type)
{
wcscpy_s(dst, src);
@@ -1455,8 +1455,8 @@ void WheatyExceptionReport::FormatOutputValue(char* pszCurrBuffer,
BasicType basicType,
DWORD64 length,
PVOID pAddress,
- size_t bufferSize,
- size_t countOverride)
+ std::size_t bufferSize,
+ std::size_t countOverride)
{
__try
{
@@ -1677,7 +1677,7 @@ void WheatyExceptionReport::PrintSymbolDetail()
}
// Add appropriate indentation level (since this routine is recursive)
- for (size_t i = 0; i < symbolDetails.size(); i++)
+ for (std::size_t i = 0; i < symbolDetails.size(); i++)
{
Log(_T("\t"));
}
diff --git a/src/common/Debugging/WheatyExceptionReport.h b/src/common/Debugging/WheatyExceptionReport.h
index 3d6fb27575..94e91e8699 100644
--- a/src/common/Debugging/WheatyExceptionReport.h
+++ b/src/common/Debugging/WheatyExceptionReport.h
@@ -164,7 +164,7 @@ private:
static void DumpTypeIndex(DWORD64, DWORD, DWORD_PTR, bool&, char const*, char*, bool, bool);
- static void FormatOutputValue(char* pszCurrBuffer, BasicType basicType, DWORD64 length, PVOID pAddress, size_t bufferSize, size_t countOverride = 0);
+ static void FormatOutputValue(char* pszCurrBuffer, BasicType basicType, DWORD64 length, PVOID pAddress, std::size_t bufferSize, std::size_t countOverride = 0);
static BasicType GetBasicType(DWORD typeIndex, DWORD64 modBase);
static DWORD_PTR DereferenceUnsafePointer(DWORD_PTR address);
diff --git a/src/common/Define.h b/src/common/Define.h
index 1da537e411..09cd43544f 100644
--- a/src/common/Define.h
+++ b/src/common/Define.h
@@ -21,7 +21,6 @@
#include "CompilerDefs.h"
#include <cinttypes>
#include <climits>
-#include <cstddef>
#define ACORE_LITTLEENDIAN 0
#define ACORE_BIGENDIAN 1
diff --git a/src/common/Dynamic/FactoryHolder.h b/src/common/Dynamic/FactoryHolder.h
index 093f6e4f3c..245bd02825 100644
--- a/src/common/Dynamic/FactoryHolder.h
+++ b/src/common/Dynamic/FactoryHolder.h
@@ -20,7 +20,6 @@
#include "Define.h"
#include "ObjectRegistry.h"
-#include "TypeList.h"
/** FactoryHolder holds a factory object of a specific type
*/
diff --git a/src/common/Dynamic/ObjectRegistry.h b/src/common/Dynamic/ObjectRegistry.h
index fe8c64dd74..31adcd8f16 100644
--- a/src/common/Dynamic/ObjectRegistry.h
+++ b/src/common/Dynamic/ObjectRegistry.h
@@ -18,12 +18,9 @@
#ifndef ACORE_OBJECTREGISTRY_H
#define ACORE_OBJECTREGISTRY_H
-#include "Define.h"
#include <map>
#include <memory>
#include <string>
-#include <unordered_map>
-#include <vector>
/** ObjectRegistry holds all registry item of the same type
*/
diff --git a/src/common/Dynamic/TypeContainer.h b/src/common/Dynamic/TypeContainer.h
index 2a69bd61e9..7e8ef91bca 100644
--- a/src/common/Dynamic/TypeContainer.h
+++ b/src/common/Dynamic/TypeContainer.h
@@ -23,12 +23,10 @@
* types of object at the same time.
*/
-#include "Define.h"
#include "Dynamic/TypeList.h"
#include "GridRefMgr.h"
#include <map>
#include <unordered_map>
-#include <vector>
/*
* @class ContainerMapList is a mulit-type container for map elements
@@ -102,7 +100,7 @@ template<class OBJECT_TYPES>
class TypeMapContainer
{
public:
- template<class SPECIFIC_TYPE> [[nodiscard]] size_t Count() const { return Acore::Count(i_elements, (SPECIFIC_TYPE*)nullptr); }
+ template<class SPECIFIC_TYPE> [[nodiscard]] std::size_t Count() const { return Acore::Count(i_elements, (SPECIFIC_TYPE*)nullptr); }
/// inserts a specific object into the container
template<class SPECIFIC_TYPE>
diff --git a/src/common/Dynamic/TypeContainerFunctions.h b/src/common/Dynamic/TypeContainerFunctions.h
index e34d914bea..12094a4909 100644
--- a/src/common/Dynamic/TypeContainerFunctions.h
+++ b/src/common/Dynamic/TypeContainerFunctions.h
@@ -24,10 +24,7 @@
* to access or mutate the container.
*/
-#include "Define.h"
#include "Dynamic/TypeList.h"
-#include <map>
-#include <unordered_map>
namespace Acore
{
@@ -159,31 +156,31 @@ namespace Acore
/* ContainerMapList Helpers */
// count functions
template<class SPECIFIC_TYPE>
- size_t Count(const ContainerMapList<SPECIFIC_TYPE>& elements, SPECIFIC_TYPE* /*fake*/)
+ std::size_t Count(const ContainerMapList<SPECIFIC_TYPE>& elements, SPECIFIC_TYPE* /*fake*/)
{
return elements._element.getSize();
}
template<class SPECIFIC_TYPE>
- size_t Count(const ContainerMapList<TypeNull>& /*elements*/, SPECIFIC_TYPE* /*fake*/)
+ std::size_t Count(const ContainerMapList<TypeNull>& /*elements*/, SPECIFIC_TYPE* /*fake*/)
{
return 0;
}
template<class SPECIFIC_TYPE, class T>
- size_t Count(const ContainerMapList<T>& /*elements*/, SPECIFIC_TYPE* /*fake*/)
+ std::size_t Count(const ContainerMapList<T>& /*elements*/, SPECIFIC_TYPE* /*fake*/)
{
return 0;
}
template<class SPECIFIC_TYPE, class T>
- size_t Count(const ContainerMapList<TypeList<SPECIFIC_TYPE, T>>& elements, SPECIFIC_TYPE* fake)
+ std::size_t Count(const ContainerMapList<TypeList<SPECIFIC_TYPE, T>>& elements, SPECIFIC_TYPE* fake)
{
return Count(elements._elements, fake);
}
template<class SPECIFIC_TYPE, class H, class T>
- size_t Count(const ContainerMapList<TypeList<H, T>>& elements, SPECIFIC_TYPE* fake)
+ std::size_t Count(const ContainerMapList<TypeList<H, T>>& elements, SPECIFIC_TYPE* fake)
{
return Count(elements._TailElements, fake);
}
diff --git a/src/common/Dynamic/TypeContainerFunctionsPtr.h b/src/common/Dynamic/TypeContainerFunctionsPtr.h
index 836aef7697..37be105cee 100644
--- a/src/common/Dynamic/TypeContainerFunctionsPtr.h
+++ b/src/common/Dynamic/TypeContainerFunctionsPtr.h
@@ -32,27 +32,27 @@ namespace Acore
{
/* ContainerMapList Helpers */
// count functions
- // template<class SPECIFIC_TYPE> size_t Count(const ContainerMapList<SPECIFIC_TYPE> &elements, CountedPtr<SPECIFIC_TYPE>* /*fake*/)
+ // template<class SPECIFIC_TYPE> std::size_t Count(const ContainerMapList<SPECIFIC_TYPE> &elements, CountedPtr<SPECIFIC_TYPE>* /*fake*/)
// {
// return elements._element.size();
// };
//
- // template<class SPECIFIC_TYPE> size_t Count(const ContainerMapList<TypeNull> &elements, CountedPtr<SPECIFIC_TYPE>* /*fake*/)
+ // template<class SPECIFIC_TYPE> std::size_t Count(const ContainerMapList<TypeNull> &elements, CountedPtr<SPECIFIC_TYPE>* /*fake*/)
// {
// return 0;
// }
//
- // template<class SPECIFIC_TYPE, class T> size_t Count(const ContainerMapList<T> &elements, CountedPtr<SPECIFIC_TYPE>* /*fake*/)
+ // template<class SPECIFIC_TYPE, class T> std::size_t Count(const ContainerMapList<T> &elements, CountedPtr<SPECIFIC_TYPE>* /*fake*/)
// {
// return 0;
// }
//
- // template<class SPECIFIC_TYPE, class T> size_t Count(const ContainerMapList<TypeList<SPECIFIC_TYPE, T> >&elements, SPECIFIC_TYPE* fake)
+ // template<class SPECIFIC_TYPE, class T> std::size_t Count(const ContainerMapList<TypeList<SPECIFIC_TYPE, T> >&elements, SPECIFIC_TYPE* fake)
// {
// return Count(elements._elements, fake);
// }
//
- // template<class SPECIFIC_TYPE, class H, class T> size_t Count(const ContainerMapList<TypeList<H, T> >&elements, SPECIFIC_TYPE* fake)
+ // template<class SPECIFIC_TYPE, class H, class T> std::size_t Count(const ContainerMapList<TypeList<H, T> >&elements, SPECIFIC_TYPE* fake)
// {
// return Count(elements._TailElements, fake);
// }
diff --git a/src/common/Dynamic/TypeContainerVisitor.h b/src/common/Dynamic/TypeContainerVisitor.h
index cab848b4be..1553d918af 100644
--- a/src/common/Dynamic/TypeContainerVisitor.h
+++ b/src/common/Dynamic/TypeContainerVisitor.h
@@ -24,7 +24,6 @@
* to overload its types as a visit method is called.
*/
-#include "Define.h"
#include "Dynamic/TypeContainer.h"
// forward declaration
diff --git a/src/common/Logging/Appender.h b/src/common/Logging/Appender.h
index 23f2d47f65..0d5e028019 100644
--- a/src/common/Logging/Appender.h
+++ b/src/common/Logging/Appender.h
@@ -22,7 +22,6 @@
#include "LogCommon.h"
#include <stdexcept>
#include <string>
-#include <vector>
struct LogMessage;
diff --git a/src/common/Logging/AppenderConsole.h b/src/common/Logging/AppenderConsole.h
index 9da2a6ec5b..d60553523a 100644
--- a/src/common/Logging/AppenderConsole.h
+++ b/src/common/Logging/AppenderConsole.h
@@ -19,6 +19,7 @@
#define APPENDERCONSOLE_H
#include "Appender.h"
+#include <vector>
// EnumUtils: DESCRIBE THIS
enum ColorTypes
diff --git a/src/common/Logging/AppenderFile.cpp b/src/common/Logging/AppenderFile.cpp
index 3357b2cf30..81b84cb985 100644
--- a/src/common/Logging/AppenderFile.cpp
+++ b/src/common/Logging/AppenderFile.cpp
@@ -44,7 +44,7 @@ AppenderFile::AppenderFile(uint8 id, std::string const& name, LogLevel level, Ap
if (flags & APPENDER_FLAGS_USE_TIMESTAMP)
{
- size_t dot_pos = _fileName.find_last_of('.');
+ std::size_t dot_pos = _fileName.find_last_of('.');
if (dot_pos != std::string::npos)
{
_fileName.insert(dot_pos, sLog->GetLogsTimestamp());
diff --git a/src/common/Logging/AppenderFile.h b/src/common/Logging/AppenderFile.h
index cb1d0424fc..38b21065a8 100644
--- a/src/common/Logging/AppenderFile.h
+++ b/src/common/Logging/AppenderFile.h
@@ -20,6 +20,7 @@
#include "Appender.h"
#include <atomic>
+#include <vector>
class AppenderFile : public Appender
{
diff --git a/src/common/Logging/Log.cpp b/src/common/Logging/Log.cpp
index 6fd65216ca..37809458b8 100644
--- a/src/common/Logging/Log.cpp
+++ b/src/common/Logging/Log.cpp
@@ -73,7 +73,7 @@ void Log::CreateAppenderFromConfig(std::string const& appenderName)
std::vector<std::string_view> tokens = Acore::Tokenize(options, ',', true);
- size_t const size = tokens.size();
+ std::size_t const size = tokens.size();
std::string name = appenderName.substr(9);
if (size < 2)
@@ -265,7 +265,7 @@ Logger const* Log::GetLoggerByType(std::string const& type) const
}
std::string parentLogger = LOGGER_ROOT;
- size_t found = type.find_last_of('.');
+ std::size_t found = type.find_last_of('.');
if (found != std::string::npos)
{
parentLogger = type.substr(0, found);
diff --git a/src/common/Logging/Log.h b/src/common/Logging/Log.h
index f80869399c..f60bb03678 100644
--- a/src/common/Logging/Log.h
+++ b/src/common/Logging/Log.h
@@ -21,7 +21,6 @@
#include "Define.h"
#include "LogCommon.h"
#include "StringFormat.h"
-#include <memory>
#include <unordered_map>
#include <vector>
diff --git a/src/common/Logging/LogOperation.h b/src/common/Logging/LogOperation.h
index 77d403d5c2..9c24ca5b7a 100644
--- a/src/common/Logging/LogOperation.h
+++ b/src/common/Logging/LogOperation.h
@@ -18,7 +18,6 @@
#ifndef LOGOPERATION_H
#define LOGOPERATION_H
-#include "Define.h"
#include <memory>
class Logger;
diff --git a/src/common/Logging/enuminfo_AppenderConsole.cpp b/src/common/Logging/enuminfo_AppenderConsole.cpp
index c747a1befa..28031a58b9 100644
--- a/src/common/Logging/enuminfo_AppenderConsole.cpp
+++ b/src/common/Logging/enuminfo_AppenderConsole.cpp
@@ -51,10 +51,10 @@ AC_API_EXPORT EnumText EnumUtils<ColorTypes>::ToString(ColorTypes value)
}
template <>
-AC_API_EXPORT size_t EnumUtils<ColorTypes>::Count() { return 15; }
+AC_API_EXPORT std::size_t EnumUtils<ColorTypes>::Count() { return 15; }
template <>
-AC_API_EXPORT ColorTypes EnumUtils<ColorTypes>::FromIndex(size_t index)
+AC_API_EXPORT ColorTypes EnumUtils<ColorTypes>::FromIndex(std::size_t index)
{
switch (index)
{
@@ -78,7 +78,7 @@ AC_API_EXPORT ColorTypes EnumUtils<ColorTypes>::FromIndex(size_t index)
}
template <>
-AC_API_EXPORT size_t EnumUtils<ColorTypes>::ToIndex(ColorTypes value)
+AC_API_EXPORT std::size_t EnumUtils<ColorTypes>::ToIndex(ColorTypes value)
{
switch (value)
{
diff --git a/src/common/Logging/enuminfo_LogCommon.cpp b/src/common/Logging/enuminfo_LogCommon.cpp
index 2e42655635..e06d5fc26c 100644
--- a/src/common/Logging/enuminfo_LogCommon.cpp
+++ b/src/common/Logging/enuminfo_LogCommon.cpp
@@ -43,10 +43,10 @@ AC_API_EXPORT EnumText EnumUtils<LogLevel>::ToString(LogLevel value)
}
template <>
-AC_API_EXPORT size_t EnumUtils<LogLevel>::Count() { return 7; }
+AC_API_EXPORT std::size_t EnumUtils<LogLevel>::Count() { return 7; }
template <>
-AC_API_EXPORT LogLevel EnumUtils<LogLevel>::FromIndex(size_t index)
+AC_API_EXPORT LogLevel EnumUtils<LogLevel>::FromIndex(std::size_t index)
{
switch (index)
{
@@ -62,7 +62,7 @@ AC_API_EXPORT LogLevel EnumUtils<LogLevel>::FromIndex(size_t index)
}
template <>
-AC_API_EXPORT size_t EnumUtils<LogLevel>::ToIndex(LogLevel value)
+AC_API_EXPORT std::size_t EnumUtils<LogLevel>::ToIndex(LogLevel value)
{
switch (value)
{
@@ -94,10 +94,10 @@ AC_API_EXPORT EnumText EnumUtils<AppenderType>::ToString(AppenderType value)
}
template <>
-AC_API_EXPORT size_t EnumUtils<AppenderType>::Count() { return 4; }
+AC_API_EXPORT std::size_t EnumUtils<AppenderType>::Count() { return 4; }
template <>
-AC_API_EXPORT AppenderType EnumUtils<AppenderType>::FromIndex(size_t index)
+AC_API_EXPORT AppenderType EnumUtils<AppenderType>::FromIndex(std::size_t index)
{
switch (index)
{
@@ -110,7 +110,7 @@ AC_API_EXPORT AppenderType EnumUtils<AppenderType>::FromIndex(size_t index)
}
template <>
-AC_API_EXPORT size_t EnumUtils<AppenderType>::ToIndex(AppenderType value)
+AC_API_EXPORT std::size_t EnumUtils<AppenderType>::ToIndex(AppenderType value)
{
switch (value)
{
@@ -141,10 +141,10 @@ AC_API_EXPORT EnumText EnumUtils<AppenderFlags>::ToString(AppenderFlags value)
}
template <>
-AC_API_EXPORT size_t EnumUtils<AppenderFlags>::Count() { return 6; }
+AC_API_EXPORT std::size_t EnumUtils<AppenderFlags>::Count() { return 6; }
template <>
-AC_API_EXPORT AppenderFlags EnumUtils<AppenderFlags>::FromIndex(size_t index)
+AC_API_EXPORT AppenderFlags EnumUtils<AppenderFlags>::FromIndex(std::size_t index)
{
switch (index)
{
@@ -159,7 +159,7 @@ AC_API_EXPORT AppenderFlags EnumUtils<AppenderFlags>::FromIndex(size_t index)
}
template <>
-AC_API_EXPORT size_t EnumUtils<AppenderFlags>::ToIndex(AppenderFlags value)
+AC_API_EXPORT std::size_t EnumUtils<AppenderFlags>::ToIndex(AppenderFlags value)
{
switch (value)
{
diff --git a/src/common/Metric/Metric.h b/src/common/Metric/Metric.h
index ed841a1e9b..fda4048d6a 100644
--- a/src/common/Metric/Metric.h
+++ b/src/common/Metric/Metric.h
@@ -22,11 +22,9 @@
#include "Duration.h"
#include "MPSCQueue.h"
#include <functional>
-#include <iosfwd>
#include <memory>
#include <string>
#include <unordered_map>
-#include <utility>
#include <vector>
namespace Acore::Asio
diff --git a/src/common/Threading/MPSCQueue.h b/src/common/Threading/MPSCQueue.h
index ce26db40b8..15176178b0 100644
--- a/src/common/Threading/MPSCQueue.h
+++ b/src/common/Threading/MPSCQueue.h
@@ -19,8 +19,6 @@
#define MPSCQueue_h__
#include <atomic>
-#include <memory>
-#include <utility>
namespace Acore::Impl
{
diff --git a/src/common/Threading/PCQueue.h b/src/common/Threading/PCQueue.h
index 6484053655..57f3b08efb 100644
--- a/src/common/Threading/PCQueue.h
+++ b/src/common/Threading/PCQueue.h
@@ -18,11 +18,8 @@
#ifndef _PCQ_H
#define _PCQ_H
-#include <atomic>
#include <condition_variable>
-#include <mutex>
#include <queue>
-#include <type_traits>
template <typename T>
class ProducerConsumerQueue
@@ -51,7 +48,7 @@ public:
return _queue.empty();
}
- [[nodiscard]] size_t Size() const
+ [[nodiscard]] std::size_t Size() const
{
return _queue.size();
}
diff --git a/src/common/Threading/ThreadingModel.h b/src/common/Threading/ThreadingModel.h
index 69d4f5b8ed..a23884df39 100644
--- a/src/common/Threading/ThreadingModel.h
+++ b/src/common/Threading/ThreadingModel.h
@@ -23,8 +23,6 @@
*
*/
-#include "Define.h"
-
namespace Acore
{
template<typename MUTEX>
diff --git a/src/common/Utilities/AsyncCallbackProcessor.h b/src/common/Utilities/AsyncCallbackProcessor.h
index 54b981cbcb..68566809a6 100644
--- a/src/common/Utilities/AsyncCallbackProcessor.h
+++ b/src/common/Utilities/AsyncCallbackProcessor.h
@@ -18,7 +18,6 @@
#ifndef AsyncCallbackProcessor_h__
#define AsyncCallbackProcessor_h__
-#include "Define.h"
#include <algorithm>
#include <vector>
diff --git a/src/common/Utilities/ByteConverter.h b/src/common/Utilities/ByteConverter.h
index 4a96d773cb..ff0818bd6b 100644
--- a/src/common/Utilities/ByteConverter.h
+++ b/src/common/Utilities/ByteConverter.h
@@ -27,7 +27,7 @@
namespace ByteConverter
{
- template<size_t T>
+ template<std::size_t T>
inline void convert(char* val)
{
std::swap(*val, *(val + T - 1));
diff --git a/src/common/Utilities/CircularBuffer.h b/src/common/Utilities/CircularBuffer.h
index 898ab1a11e..4c23099c9e 100644
--- a/src/common/Utilities/CircularBuffer.h
+++ b/src/common/Utilities/CircularBuffer.h
@@ -17,7 +17,7 @@ template <typename T>
class CircularBuffer
{
public:
- explicit CircularBuffer(size_t size) :
+ explicit CircularBuffer(std::size_t size) :
buf_(std::unique_ptr<T[]>(new T[size])),
max_size_(size)
{
@@ -52,14 +52,14 @@ public:
return full_;
}
- [[nodiscard]] size_t capacity() const
+ [[nodiscard]] std::size_t capacity() const
{
return max_size_;
}
- [[nodiscard]] size_t size() const
+ [[nodiscard]] std::size_t size() const
{
- size_t size = max_size_;
+ std::size_t size = max_size_;
if (!full_)
{
@@ -95,9 +95,9 @@ public:
private:
std::mutex mutex_;
std::unique_ptr<T[]> buf_;
- size_t head_ = 0;
- size_t tail_ = 0;
- const size_t max_size_;
+ std::size_t head_ = 0;
+ std::size_t tail_ = 0;
+ const std::size_t max_size_;
bool full_ = false;
};
#endif
diff --git a/src/common/Utilities/Containers.h b/src/common/Utilities/Containers.h
index c77a48be7e..3a5c3b1809 100644
--- a/src/common/Utilities/Containers.h
+++ b/src/common/Utilities/Containers.h
@@ -23,8 +23,6 @@
#include <algorithm>
#include <iterator>
#include <stdexcept>
-#include <type_traits>
-#include <utility>
#include <vector>
namespace Acore
@@ -51,13 +49,13 @@ namespace Acore
using reference = T&;
using difference_type = std::ptrdiff_t;
- CheckedBufferOutputIterator(T* buf, size_t n) : _buf(buf), _end(buf + n) {}
+ CheckedBufferOutputIterator(T* buf, std::size_t n) : _buf(buf), _end(buf + n) {}
T& operator*() const { check(); return *_buf; }
CheckedBufferOutputIterator& operator++() { check(); ++_buf; return *this; }
CheckedBufferOutputIterator operator++(int) { CheckedBufferOutputIterator v = *this; operator++(); return v; }
- [[nodiscard]] size_t remaining() const { return (_end - _buf); }
+ [[nodiscard]] std::size_t remaining() const { return (_end - _buf); }
private:
T* _buf;
diff --git a/src/common/Utilities/EventProcessor.h b/src/common/Utilities/EventProcessor.h
index 0ebd48077b..3e7896bb33 100644
--- a/src/common/Utilities/EventProcessor.h
+++ b/src/common/Utilities/EventProcessor.h
@@ -22,7 +22,6 @@
#include "Duration.h"
#include "Random.h"
#include <map>
-#include <type_traits>
class EventProcessor;
diff --git a/src/common/Utilities/Geometry.h b/src/common/Utilities/Geometry.h
index f5912c8381..75affe53bc 100644
--- a/src/common/Utilities/Geometry.h
+++ b/src/common/Utilities/Geometry.h
@@ -24,9 +24,7 @@
#ifndef _ACORE_GEOMETRY_H
#define _ACORE_GEOMETRY_H
-#include "Define.h"
#include <cstdlib>
-#include <iostream>
#include <math.h>
[[nodiscard]] inline float getAngle(float startX, float startY, float destX, float destY)
diff --git a/src/common/Utilities/IteratorPair.h b/src/common/Utilities/IteratorPair.h
index c1e512c28b..385c77a864 100644
--- a/src/common/Utilities/IteratorPair.h
+++ b/src/common/Utilities/IteratorPair.h
@@ -18,7 +18,6 @@
#ifndef IteratorPair_h__
#define IteratorPair_h__
-#include "Define.h"
#include <utility>
namespace Acore
diff --git a/src/common/Utilities/MathUtil.h b/src/common/Utilities/MathUtil.h
index fad8317c30..f1df43e7db 100644
--- a/src/common/Utilities/MathUtil.h
+++ b/src/common/Utilities/MathUtil.h
@@ -58,7 +58,7 @@ inline T mean(Container&& c)
template <typename T>
inline T median(std::vector<T> a)
{
- size_t n = a.size();
+ std::size_t n = a.size();
// If size of the arr[] is even
if (n % 2 == 0)
{
diff --git a/src/common/Utilities/Physics.h b/src/common/Utilities/Physics.h
index 8aff22f683..3f4d93a67d 100644
--- a/src/common/Utilities/Physics.h
+++ b/src/common/Utilities/Physics.h
@@ -25,9 +25,6 @@
#define _ACORE_PHYSICS_H
#include "Geometry.h"
-#include <cmath>
-#include <cstdlib>
-#include <iostream>
using namespace std;
diff --git a/src/common/Utilities/Random.cpp b/src/common/Utilities/Random.cpp
index f80e023079..40090caa15 100644
--- a/src/common/Utilities/Random.cpp
+++ b/src/common/Utilities/Random.cpp
@@ -86,7 +86,7 @@ double rand_chance()
return urd(engine);
}
-uint32 urandweighted(size_t count, double const* chances)
+uint32 urandweighted(std::size_t count, double const* chances)
{
std::discrete_distribution<uint32> dd(chances, chances + count);
return dd(engine);
diff --git a/src/common/Utilities/Random.h b/src/common/Utilities/Random.h
index 9b1867e281..07bc91d3ae 100644
--- a/src/common/Utilities/Random.h
+++ b/src/common/Utilities/Random.h
@@ -47,7 +47,7 @@ AC_COMMON_API double rand_norm();
AC_COMMON_API double rand_chance();
/* Return a random number in the range 0..count (exclusive) with each value having a different chance of happening */
-AC_COMMON_API uint32 urandweighted(size_t count, double const* chances);
+AC_COMMON_API uint32 urandweighted(std::size_t count, double const* chances);
/* Return true if a random roll fits in the specified chance (range 0-100). */
inline bool roll_chance_f(float chance)
diff --git a/src/common/Utilities/SFMTRand.cpp b/src/common/Utilities/SFMTRand.cpp
index fccd41aab8..c109924dbb 100644
--- a/src/common/Utilities/SFMTRand.cpp
+++ b/src/common/Utilities/SFMTRand.cpp
@@ -26,7 +26,7 @@
#include <mm_malloc.h>
#elif defined(__GNUC__)
static __inline__ void *__attribute__((__always_inline__, __nodebug__, __malloc__))
- _mm_malloc(size_t __size, size_t __align)
+ _mm_malloc(std::size_t __size, std::size_t __align)
{
if (__align == 1)
{
@@ -78,7 +78,7 @@ uint32 SFMTRand::RandomUInt32() // Output random bits
return sfmt_genrand_uint32(&_state);
}
-void* SFMTRand::operator new(size_t size, std::nothrow_t const&)
+void* SFMTRand::operator new(std::size_t size, std::nothrow_t const&)
{
return _mm_malloc(size, 16);
}
@@ -88,7 +88,7 @@ void SFMTRand::operator delete(void* ptr, std::nothrow_t const&)
_mm_free(ptr);
}
-void* SFMTRand::operator new(size_t size)
+void* SFMTRand::operator new(std::size_t size)
{
return _mm_malloc(size, 16);
}
@@ -98,7 +98,7 @@ void SFMTRand::operator delete(void* ptr)
_mm_free(ptr);
}
-void* SFMTRand::operator new[](size_t size, std::nothrow_t const&)
+void* SFMTRand::operator new[](std::size_t size, std::nothrow_t const&)
{
return _mm_malloc(size, 16);
}
@@ -108,7 +108,7 @@ void SFMTRand::operator delete[](void* ptr, std::nothrow_t const&)
_mm_free(ptr);
}
-void* SFMTRand::operator new[](size_t size)
+void* SFMTRand::operator new[](std::size_t size)
{
return _mm_malloc(size, 16);
}
diff --git a/src/common/Utilities/SFMTRand.h b/src/common/Utilities/SFMTRand.h
index 30981b47df..e24cfe198d 100644
--- a/src/common/Utilities/SFMTRand.h
+++ b/src/common/Utilities/SFMTRand.h
@@ -30,13 +30,13 @@ class SFMTRand
public:
SFMTRand();
uint32 RandomUInt32(); // Output random bits
- void* operator new(size_t size, std::nothrow_t const&);
+ void* operator new(std::size_t size, std::nothrow_t const&);
void operator delete(void* ptr, std::nothrow_t const&);
- void* operator new(size_t size);
+ void* operator new(std::size_t size);
void operator delete(void* ptr);
- void* operator new[](size_t size, std::nothrow_t const&);
+ void* operator new[](std::size_t size, std::nothrow_t const&);
void operator delete[](void* ptr, std::nothrow_t const&);
- void* operator new[](size_t size);
+ void* operator new[](std::size_t size);
void operator delete[](void* ptr);
private:
sfmt_t _state;
diff --git a/src/common/Utilities/SmartEnum.h b/src/common/Utilities/SmartEnum.h
index e6e0be2572..fd00b83625 100644
--- a/src/common/Utilities/SmartEnum.h
+++ b/src/common/Utilities/SmartEnum.h
@@ -37,10 +37,10 @@ namespace Acore::Impl::EnumUtilsImpl
template <typename Enum>
struct EnumUtils
{
- static size_t Count();
+ static std::size_t Count();
static EnumText ToString(Enum value);
- static Enum FromIndex(size_t index);
- static size_t ToIndex(Enum index);
+ static Enum FromIndex(std::size_t index);
+ static std::size_t ToIndex(Enum index);
};
}
@@ -48,11 +48,11 @@ class EnumUtils
{
public:
template <typename Enum>
- static size_t Count() { return Acore::Impl::EnumUtilsImpl::EnumUtils<Enum>::Count(); }
+ static std::size_t Count() { return Acore::Impl::EnumUtilsImpl::EnumUtils<Enum>::Count(); }
template <typename Enum>
static EnumText ToString(Enum value) { return Acore::Impl::EnumUtilsImpl::EnumUtils<Enum>::ToString(value); }
template <typename Enum>
- static Enum FromIndex(size_t index) { return Acore::Impl::EnumUtilsImpl::EnumUtils<Enum>::FromIndex(index); }
+ static Enum FromIndex(std::size_t index) { return Acore::Impl::EnumUtilsImpl::EnumUtils<Enum>::FromIndex(index); }
template <typename Enum>
static uint32 ToIndex(Enum value) { return Acore::Impl::EnumUtilsImpl::EnumUtils<Enum>::ToIndex(value);}
@@ -84,7 +84,7 @@ public:
using difference_type = std::ptrdiff_t;
Iterator() : _index(EnumUtils::Count<Enum>()) {}
- explicit Iterator(size_t index) : _index(index) { }
+ explicit Iterator(std::size_t index) : _index(index) { }
bool operator==(const Iterator& other) const { return other._index == _index; }
bool operator!=(const Iterator& other) const { return !operator==(other); }
diff --git a/src/common/Utilities/StartProcess.h b/src/common/Utilities/StartProcess.h
index 6b564cb9e1..6de13d1be9 100644
--- a/src/common/Utilities/StartProcess.h
+++ b/src/common/Utilities/StartProcess.h
@@ -20,7 +20,6 @@
#include "Define.h"
#include <future>
-#include <memory>
#include <string>
#include <vector>
diff --git a/src/common/Utilities/StringConvert.h b/src/common/Utilities/StringConvert.h
index bd02cf3ea2..4f51b9746e 100644
--- a/src/common/Utilities/StringConvert.h
+++ b/src/common/Utilities/StringConvert.h
@@ -219,7 +219,7 @@ namespace Acore::Impl::StringConvertImpl
}
tmp.append(str);
- size_t n;
+ std::size_t n;
T val = static_cast<T>(std::stold(tmp, &n));
if (n != tmp.length())
{
diff --git a/src/common/Utilities/TaskScheduler.cpp b/src/common/Utilities/TaskScheduler.cpp
index 1d0bf89e6e..1e4e0222da 100644
--- a/src/common/Utilities/TaskScheduler.cpp
+++ b/src/common/Utilities/TaskScheduler.cpp
@@ -31,7 +31,7 @@ TaskScheduler& TaskScheduler::Update(success_t const& callback)
return *this;
}
-TaskScheduler& TaskScheduler::Update(size_t const milliseconds, success_t const& callback)
+TaskScheduler& TaskScheduler::Update(std::size_t const milliseconds, success_t const& callback)
{
return Update(std::chrono::milliseconds(milliseconds), callback);
}
diff --git a/src/common/Utilities/TaskScheduler.h b/src/common/Utilities/TaskScheduler.h
index a256be6801..145489e086 100644
--- a/src/common/Utilities/TaskScheduler.h
+++ b/src/common/Utilities/TaskScheduler.h
@@ -19,14 +19,11 @@
#define _TASK_SCHEDULER_H_
#include "Util.h"
-#include <algorithm>
#include <chrono>
#include <functional>
-#include <memory>
#include <optional>
#include <queue>
#include <set>
-#include <utility>
#include <vector>
class TaskContext;
@@ -209,7 +206,7 @@ public:
/// Update the scheduler with a difftime in ms.
/// Calls the optional callback on successfully finish.
- TaskScheduler& Update(size_t const milliseconds, success_t const& callback = EmptyCallback);
+ TaskScheduler& Update(std::size_t const milliseconds, success_t const& callback = EmptyCallback);
/// Update the scheduler with a difftime.
/// Calls the optional callback on successfully finish.
diff --git a/src/common/Utilities/Tokenize.cpp b/src/common/Utilities/Tokenize.cpp
index 98ba213a61..3ceb57f087 100644
--- a/src/common/Utilities/Tokenize.cpp
+++ b/src/common/Utilities/Tokenize.cpp
@@ -21,8 +21,8 @@ std::vector<std::string_view> Acore::Tokenize(std::string_view str, char sep, bo
{
std::vector<std::string_view> tokens;
- size_t start = 0;
- for (size_t end = str.find(sep); end != std::string_view::npos; end = str.find(sep, start))
+ std::size_t start = 0;
+ for (std::size_t end = str.find(sep); end != std::string_view::npos; end = str.find(sep, start))
{
if (keepEmpty || (start < end))
{
diff --git a/src/common/Utilities/Tokenize.h b/src/common/Utilities/Tokenize.h
index a871c83be9..6ee20ca53e 100644
--- a/src/common/Utilities/Tokenize.h
+++ b/src/common/Utilities/Tokenize.h
@@ -18,7 +18,6 @@
#ifndef _ACORE_TOKENIZE_H_
#define _ACORE_TOKENIZE_H_
-#include "Common.h"
#include <string_view>
#include <vector>
diff --git a/src/common/Utilities/Tuples.h b/src/common/Utilities/Tuples.h
index 886faac51d..f648e20e64 100644
--- a/src/common/Utilities/Tuples.h
+++ b/src/common/Utilities/Tuples.h
@@ -48,7 +48,7 @@ namespace Acore
namespace Impl
{
- template <class T, class Tuple, size_t... I>
+ template <class T, class Tuple, std::size_t... I>
T* new_from_tuple(Tuple&& args, std::index_sequence<I...>)
{
return new T(std::get<I>(std::forward<Tuple>(args))...);
diff --git a/src/common/Utilities/Util.cpp b/src/common/Utilities/Util.cpp
index ee397dd4dd..0652e56673 100644
--- a/src/common/Utilities/Util.cpp
+++ b/src/common/Utilities/Util.cpp
@@ -33,10 +33,10 @@ void stripLineInvisibleChars(std::string& str)
{
static std::string const invChars = " \t\7\n";
- size_t wpos = 0;
+ std::size_t wpos = 0;
bool space = false;
- for (size_t pos = 0; pos < str.size(); ++pos)
+ for (std::size_t pos = 0; pos < str.size(); ++pos)
{
if (invChars.find(str[pos]) != std::string::npos)
{
@@ -242,7 +242,7 @@ uint32 GetPID()
return uint32(pid);
}
-size_t utf8length(std::string& utf8str)
+std::size_t utf8length(std::string& utf8str)
{
try
{
@@ -255,11 +255,11 @@ size_t utf8length(std::string& utf8str)
}
}
-void utf8truncate(std::string& utf8str, size_t len)
+void utf8truncate(std::string& utf8str, std::size_t len)
{
try
{
- size_t wlen = utf8::distance(utf8str.c_str(), utf8str.c_str() + utf8str.size());
+ std::size_t wlen = utf8::distance(utf8str.c_str(), utf8str.c_str() + utf8str.size());
if (wlen <= len)
{
return;
@@ -278,7 +278,7 @@ void utf8truncate(std::string& utf8str, size_t len)
}
}
-bool Utf8toWStr(char const* utf8str, size_t csize, wchar_t* wstr, size_t& wsize)
+bool Utf8toWStr(char const* utf8str, std::size_t csize, wchar_t* wstr, std::size_t& wsize)
{
try
{
@@ -330,7 +330,7 @@ bool Utf8toWStr(std::string_view utf8str, std::wstring& wstr)
return true;
}
-bool WStrToUtf8(wchar_t const* wstr, size_t size, std::string& utf8str)
+bool WStrToUtf8(wchar_t const* wstr, std::size_t size, std::string& utf8str)
{
try
{
@@ -512,14 +512,14 @@ void vutf8printf(FILE* out, const char* str, va_list* ap)
char temp_buf[32 * 1024];
wchar_t wtemp_buf[32 * 1024];
- size_t temp_len = vsnprintf(temp_buf, 32 * 1024, str, *ap);
+ std::size_t temp_len = vsnprintf(temp_buf, 32 * 1024, str, *ap);
//vsnprintf returns -1 if the buffer is too small
- if (temp_len == size_t(-1))
+ if (temp_len == std::size_t(-1))
{
temp_len = 32 * 1024 - 1;
}
- size_t wtemp_len = 32 * 1024 - 1;
+ std::size_t wtemp_len = 32 * 1024 - 1;
Utf8toWStr(temp_buf, temp_len, wtemp_buf, wtemp_len);
CharToOemBuffW(&wtemp_buf[0], &temp_buf[0], uint32(wtemp_len + 1));
@@ -542,7 +542,7 @@ bool Utf8ToUpperOnlyLatin(std::string& utf8String)
return WStrToUtf8(wstr, utf8String);
}
-std::string Acore::Impl::ByteArrayToHexStr(uint8 const* bytes, size_t arrayLen, bool reverse /* = false */)
+std::string Acore::Impl::ByteArrayToHexStr(uint8 const* bytes, std::size_t arrayLen, bool reverse /* = false */)
{
int32 init = 0;
int32 end = arrayLen;
@@ -566,7 +566,7 @@ std::string Acore::Impl::ByteArrayToHexStr(uint8 const* bytes, size_t arrayLen,
return ss.str();
}
-void Acore::Impl::HexStrToByteArray(std::string_view str, uint8* out, size_t outlen, bool reverse /*= false*/)
+void Acore::Impl::HexStrToByteArray(std::string_view str, uint8* out, std::size_t outlen, bool reverse /*= false*/)
{
ASSERT(str.size() == (2 * outlen));
diff --git a/src/common/Utilities/Util.h b/src/common/Utilities/Util.h
index ddc72c10d9..e5ced06991 100644
--- a/src/common/Utilities/Util.h
+++ b/src/common/Utilities/Util.h
@@ -85,9 +85,9 @@ inline T RoundToInterval(T& num, T floor, T ceil)
AC_COMMON_API bool Utf8toWStr(std::string_view utf8str, std::wstring& wstr);
// in wsize==max size of buffer, out wsize==real string size
-AC_COMMON_API bool Utf8toWStr(char const* utf8str, size_t csize, wchar_t* wstr, size_t& wsize);
+AC_COMMON_API bool Utf8toWStr(char const* utf8str, std::size_t csize, wchar_t* wstr, std::size_t& wsize);
-inline bool Utf8toWStr(std::string_view utf8str, wchar_t* wstr, size_t& wsize)
+inline bool Utf8toWStr(std::string_view utf8str, wchar_t* wstr, std::size_t& wsize)
{
return Utf8toWStr(utf8str.data(), utf8str.size(), wstr, wsize);
}
@@ -95,11 +95,11 @@ inline bool Utf8toWStr(std::string_view utf8str, wchar_t* wstr, size_t& wsize)
AC_COMMON_API bool WStrToUtf8(std::wstring_view wstr, std::string& utf8str);
// size==real string size
-AC_COMMON_API bool WStrToUtf8(wchar_t const* wstr, size_t size, std::string& utf8str);
+AC_COMMON_API bool WStrToUtf8(wchar_t const* wstr, std::size_t size, std::string& utf8str);
// set string to "" if invalid utf8 sequence
-size_t utf8length(std::string& utf8str);
-void utf8truncate(std::string& utf8str, size_t len);
+std::size_t utf8length(std::string& utf8str);
+void utf8truncate(std::string& utf8str, std::size_t len);
inline bool isBasicLatinCharacter(wchar_t wchar)
{
@@ -373,8 +373,8 @@ uint32 GetPID();
namespace Acore::Impl
{
- AC_COMMON_API std::string ByteArrayToHexStr(uint8 const* bytes, size_t length, bool reverse = false);
- AC_COMMON_API void HexStrToByteArray(std::string_view str, uint8* out, size_t outlen, bool reverse = false);
+ AC_COMMON_API std::string ByteArrayToHexStr(uint8 const* bytes, std::size_t length, bool reverse = false);
+ AC_COMMON_API void HexStrToByteArray(std::string_view str, uint8* out, std::size_t outlen, bool reverse = false);
}
template<typename Container>
@@ -383,13 +383,13 @@ std::string ByteArrayToHexStr(Container const& c, bool reverse = false)
return Acore::Impl::ByteArrayToHexStr(std::data(c), std::size(c), reverse);
}
-template<size_t Size>
+template<std::size_t Size>
void HexStrToByteArray(std::string_view str, std::array<uint8, Size>& buf, bool reverse = false)
{
Acore::Impl::HexStrToByteArray(str, buf.data(), Size, reverse);
}
-template<size_t Size>
+template<std::size_t Size>
std::array<uint8, Size> HexStrToByteArray(std::string_view str, bool reverse = false)
{
std::array<uint8, Size> arr;
@@ -433,7 +433,7 @@ public:
m_list.remove(t);
return *this;
}
- size_t size()
+ std::size_t size()
{
return m_list.size();
}