diff options
| author | Shauren <shauren.trinity@gmail.com> | 2020-08-04 15:42:08 +0200 |
|---|---|---|
| committer | Shauren <shauren.trinity@gmail.com> | 2020-08-04 15:42:08 +0200 |
| commit | b3db50a3b41b2db209327387f59afa1c40532773 (patch) | |
| tree | 66be105dd675c640a5b11b77e8bba4ee287d2493 | |
| parent | df8d50c06a6776312d5bd912dd6a5273a190a1e4 (diff) | |
Core/Misc: Fix compile errors found with msvc /permissive-
| -rw-r--r-- | dep/g3dlite/G3D-v9.0 hotfix10.diff | 25 | ||||
| -rw-r--r-- | dep/g3dlite/include/G3D/g3dmath.h | 1 | ||||
| -rw-r--r-- | dep/g3dlite/source/debugAssert.cpp | 2 | ||||
| -rw-r--r-- | src/common/Debugging/WheatyExceptionReport.cpp | 6 | ||||
| -rw-r--r-- | src/common/Debugging/WheatyExceptionReport.h | 4 | ||||
| -rw-r--r-- | src/server/game/Warden/WardenMac.cpp | 10 | ||||
| -rw-r--r-- | src/server/game/Warden/WardenWin.cpp | 10 | ||||
| -rw-r--r-- | src/server/worldserver/Main.cpp | 4 |
8 files changed, 44 insertions, 18 deletions
diff --git a/dep/g3dlite/G3D-v9.0 hotfix10.diff b/dep/g3dlite/G3D-v9.0 hotfix10.diff new file mode 100644 index 00000000000..b02e2242be4 --- /dev/null +++ b/dep/g3dlite/G3D-v9.0 hotfix10.diff @@ -0,0 +1,25 @@ +diff --git a/dep/g3dlite/include/G3D/g3dmath.h b/dep/g3dlite/include/G3D/g3dmath.h +index 54cc6ed370..002cd3858d 100644 +--- a/dep/g3dlite/include/G3D/g3dmath.h ++++ b/dep/g3dlite/include/G3D/g3dmath.h +@@ -27,6 +27,7 @@ + #include "G3D/platform.h" + #include <ctype.h> + #include <float.h> ++#include <algorithm> + #include <limits> + #include <stdlib.h> + #include <stdint.h> +diff --git a/dep/g3dlite/source/debugAssert.cpp b/dep/g3dlite/source/debugAssert.cpp +index cfccf9a0cc..3c3e43a0af 100644 +--- a/dep/g3dlite/source/debugAssert.cpp ++++ b/dep/g3dlite/source/debugAssert.cpp +@@ -99,7 +99,7 @@ static void createErrorMessage( + } + + // Make sure the message got translated into something. +- LPTSTR realLastErr; ++ LPCTSTR realLastErr; + if (NULL != formatMsg) { + realLastErr = formatMsg; + } else { diff --git a/dep/g3dlite/include/G3D/g3dmath.h b/dep/g3dlite/include/G3D/g3dmath.h index 54cc6ed3704..002cd3858d8 100644 --- a/dep/g3dlite/include/G3D/g3dmath.h +++ b/dep/g3dlite/include/G3D/g3dmath.h @@ -27,6 +27,7 @@ #include "G3D/platform.h" #include <ctype.h> #include <float.h> +#include <algorithm> #include <limits> #include <stdlib.h> #include <stdint.h> diff --git a/dep/g3dlite/source/debugAssert.cpp b/dep/g3dlite/source/debugAssert.cpp index cfccf9a0cc5..3c3e43a0af9 100644 --- a/dep/g3dlite/source/debugAssert.cpp +++ b/dep/g3dlite/source/debugAssert.cpp @@ -99,7 +99,7 @@ static void createErrorMessage( } // Make sure the message got translated into something. - LPTSTR realLastErr; + LPCTSTR realLastErr; if (NULL != formatMsg) { realLastErr = formatMsg; } else { diff --git a/src/common/Debugging/WheatyExceptionReport.cpp b/src/common/Debugging/WheatyExceptionReport.cpp index db2d050794f..c4de34bb38c 100644 --- a/src/common/Debugging/WheatyExceptionReport.cpp +++ b/src/common/Debugging/WheatyExceptionReport.cpp @@ -14,7 +14,7 @@ #pragma warning(disable:4311) #include <windows.h> #include <tlhelp32.h> -#include <stdio.h> +#include <cstdio> #include <tchar.h> #define _NO_CVCONST_H #include <dbghelp.h> @@ -610,7 +610,7 @@ PEXCEPTION_POINTERS pExceptionInfo) // Given an exception code, returns a pointer to a static string with a // description of the exception //====================================================================== -LPTSTR WheatyExceptionReport::GetExceptionString(DWORD dwCode) +LPCTSTR WheatyExceptionReport::GetExceptionString(DWORD dwCode) { #define EXCEPTION(x) case EXCEPTION_##x: return _T(#x); @@ -947,7 +947,7 @@ DWORD dwTypeIndex, DWORD_PTR offset, bool & bHandled, char const* Name, -char* /*suffix*/, +char const* /*suffix*/, bool newSymbol, bool logChildren) { diff --git a/src/common/Debugging/WheatyExceptionReport.h b/src/common/Debugging/WheatyExceptionReport.h index 54cc836e7b7..a3cb4b2f04c 100644 --- a/src/common/Debugging/WheatyExceptionReport.h +++ b/src/common/Debugging/WheatyExceptionReport.h @@ -153,7 +153,7 @@ class WheatyExceptionReport static BOOL _GetProcessorName(TCHAR* sProcessorName, DWORD maxcount); // Helper functions - static LPTSTR GetExceptionString(DWORD dwCode); + static LPCTSTR GetExceptionString(DWORD dwCode); static BOOL GetLogicalAddress(PVOID addr, PTSTR szModule, DWORD len, DWORD& section, DWORD_PTR& offset); @@ -163,7 +163,7 @@ class WheatyExceptionReport static bool FormatSymbolValue(PSYMBOL_INFO, STACKFRAME64 *); - static void DumpTypeIndex(DWORD64, DWORD, DWORD_PTR, bool &, char const*, char*, bool, bool); + static void DumpTypeIndex(DWORD64, DWORD, DWORD_PTR, bool &, char const*, char const*, bool, bool); static void FormatOutputValue(char * pszCurrBuffer, BasicType basicType, DWORD64 length, PVOID pAddress, size_t bufferSize, size_t countOverride = 0); diff --git a/src/server/game/Warden/WardenMac.cpp b/src/server/game/Warden/WardenMac.cpp index 36ea7cf218a..7fac1f46a58 100644 --- a/src/server/game/Warden/WardenMac.cpp +++ b/src/server/game/Warden/WardenMac.cpp @@ -55,15 +55,15 @@ void WardenMac::Init(WorldSession* pClient, SessionKey const& K) _inputCrypto.Init(_inputKey); _outputCrypto.Init(_outputKey); TC_LOG_DEBUG("warden", "Server side warden for client %u initializing...", pClient->GetAccountId()); - TC_LOG_DEBUG("warden", "C->S Key: %s", ByteArrayToHexStr(_inputKey, 16).c_str()); - TC_LOG_DEBUG("warden", "S->C Key: %s", ByteArrayToHexStr(_outputKey, 16).c_str()); - TC_LOG_DEBUG("warden", " Seed: %s", ByteArrayToHexStr(_seed, 16).c_str()); + TC_LOG_DEBUG("warden", "C->S Key: %s", ByteArrayToHexStr(_inputKey).c_str()); + TC_LOG_DEBUG("warden", "S->C Key: %s", ByteArrayToHexStr(_outputKey).c_str()); + TC_LOG_DEBUG("warden", " Seed: %s", ByteArrayToHexStr(_seed).c_str()); TC_LOG_DEBUG("warden", "Loading Module..."); _module = GetModuleForClient(); - TC_LOG_DEBUG("warden", "Module Key: %s", ByteArrayToHexStr(_module->Key, 16).c_str()); - TC_LOG_DEBUG("warden", "Module ID: %s", ByteArrayToHexStr(_module->Id, 16).c_str()); + TC_LOG_DEBUG("warden", "Module Key: %s", ByteArrayToHexStr(_module->Key).c_str()); + TC_LOG_DEBUG("warden", "Module ID: %s", ByteArrayToHexStr(_module->Id).c_str()); RequestModule(); } diff --git a/src/server/game/Warden/WardenWin.cpp b/src/server/game/Warden/WardenWin.cpp index 3f219f11db8..a4b3e2c31fe 100644 --- a/src/server/game/Warden/WardenWin.cpp +++ b/src/server/game/Warden/WardenWin.cpp @@ -52,15 +52,15 @@ void WardenWin::Init(WorldSession* session, SessionKey const& K) _inputCrypto.Init(_inputKey); _outputCrypto.Init(_outputKey); TC_LOG_DEBUG("warden", "Server side warden for client %u initializing...", session->GetAccountId()); - TC_LOG_DEBUG("warden", "C->S Key: %s", ByteArrayToHexStr(_inputKey, 16).c_str()); - TC_LOG_DEBUG("warden", "S->C Key: %s", ByteArrayToHexStr(_outputKey, 16).c_str()); - TC_LOG_DEBUG("warden", " Seed: %s", ByteArrayToHexStr(_seed, 16).c_str()); + TC_LOG_DEBUG("warden", "C->S Key: %s", ByteArrayToHexStr(_inputKey).c_str()); + TC_LOG_DEBUG("warden", "S->C Key: %s", ByteArrayToHexStr(_outputKey).c_str()); + TC_LOG_DEBUG("warden", " Seed: %s", ByteArrayToHexStr(_seed).c_str()); TC_LOG_DEBUG("warden", "Loading Module..."); _module = GetModuleForClient(); - TC_LOG_DEBUG("warden", "Module Key: %s", ByteArrayToHexStr(_module->Key, 16).c_str()); - TC_LOG_DEBUG("warden", "Module ID: %s", ByteArrayToHexStr(_module->Id, 16).c_str()); + TC_LOG_DEBUG("warden", "Module Key: %s", ByteArrayToHexStr(_module->Key).c_str()); + TC_LOG_DEBUG("warden", "Module ID: %s", ByteArrayToHexStr(_module->Id).c_str()); RequestModule(); } diff --git a/src/server/worldserver/Main.cpp b/src/server/worldserver/Main.cpp index 45564e3cdf9..98dc8913c45 100644 --- a/src/server/worldserver/Main.cpp +++ b/src/server/worldserver/Main.cpp @@ -370,7 +370,7 @@ void ShutdownCLIThread(std::thread* cliThread) { // if CancelSynchronousIo() fails, print the error and try with old way DWORD errorCode = GetLastError(); - LPSTR errorBuffer; + LPCSTR errorBuffer; DWORD formatReturnCode = FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_IGNORE_INSERTS, nullptr, errorCode, 0, (LPTSTR)&errorBuffer, 0, nullptr); @@ -380,7 +380,7 @@ void ShutdownCLIThread(std::thread* cliThread) TC_LOG_DEBUG("server.worldserver", "Error cancelling I/O of CliThread, error code %u, detail: %s", uint32(errorCode), errorBuffer); if (!formatReturnCode) - LocalFree(errorBuffer); + LocalFree((LPSTR)errorBuffer); // send keyboard input to safely unblock the CLI thread INPUT_RECORD b[4]; |
