mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-20 09:17:36 +01:00
Various cleanups and fixes due to feedback
This commit is contained in:
@@ -35,13 +35,13 @@ bool ConfigMgr::LoadInitial(char const* file)
|
||||
|
||||
try
|
||||
{
|
||||
ptree temp;
|
||||
boost::property_tree::ini_parser::read_ini(file, temp);
|
||||
ptree fullTree;
|
||||
boost::property_tree::ini_parser::read_ini(file, fullTree);
|
||||
|
||||
|
||||
for (auto bla : temp)
|
||||
// Since we're using only one section per config file, we skip the section and have direct property access
|
||||
for (auto section : fullTree)
|
||||
{
|
||||
_config = bla.second;
|
||||
_config = section.second;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -168,7 +168,7 @@ bool BigNumber::isZero() const
|
||||
return BN_is_zero(_bn);
|
||||
}
|
||||
|
||||
std::unique_ptr<uint8> BigNumber::AsByteArray(int32 minSize, bool littleEndian)
|
||||
std::unique_ptr<uint8[]> BigNumber::AsByteArray(int32 minSize, bool littleEndian)
|
||||
{
|
||||
int length = (minSize >= GetNumBytes()) ? minSize : GetNumBytes();
|
||||
|
||||
@@ -184,7 +184,7 @@ std::unique_ptr<uint8> BigNumber::AsByteArray(int32 minSize, bool littleEndian)
|
||||
if (littleEndian)
|
||||
std::reverse(array, array + length);
|
||||
|
||||
std::unique_ptr<uint8> ret(array);
|
||||
std::unique_ptr<uint8[]> ret(array);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
@@ -88,7 +88,7 @@ class BigNumber
|
||||
|
||||
uint32 AsDword();
|
||||
|
||||
std::unique_ptr<uint8> AsByteArray(int32 minSize = 0, bool littleEndian = true);
|
||||
std::unique_ptr<uint8[]> AsByteArray(int32 minSize = 0, bool littleEndian = true);
|
||||
|
||||
char * AsHexStr() const;
|
||||
char * AsDecStr() const;
|
||||
|
||||
@@ -139,16 +139,13 @@ void stripLineInvisibleChars(std::string &str)
|
||||
|
||||
}
|
||||
|
||||
#if (defined(WIN32) || defined(_WIN32) || defined(__WIN32__))
|
||||
struct tm* localtime_r(const time_t* time, struct tm *result)
|
||||
{
|
||||
#if (defined(WIN32) || defined(_WIN32) || defined(__WIN32__))
|
||||
localtime_s(result, time);
|
||||
return result;
|
||||
#else
|
||||
return localtime_r(&time, &result); // POSIX
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
std::string secsToTimeString(uint64 timeInSecs, bool shortText, bool hoursOnly)
|
||||
{
|
||||
|
||||
@@ -171,7 +171,7 @@ int Master::Run()
|
||||
|
||||
std::thread worldThread(WorldThread);
|
||||
|
||||
std::thread* cliThread = NULL;
|
||||
std::thread* cliThread = nullptr;
|
||||
|
||||
#ifdef _WIN32
|
||||
if (sConfigMgr->GetBoolDefault("Console.Enable", true) && (m_ServiceStatus == -1)/* need disable console in service mode*/)
|
||||
|
||||
Reference in New Issue
Block a user