diff --git a/Sources/Plasma/CoreLib/HeadSpin.h b/Sources/Plasma/CoreLib/HeadSpin.h index 69c6d7f7..b84140fc 100644 --- a/Sources/Plasma/CoreLib/HeadSpin.h +++ b/Sources/Plasma/CoreLib/HeadSpin.h @@ -239,6 +239,9 @@ inline double hsSwapEndianDouble(double dvalue) * ***/ #define arrsize(a) (sizeof(a) / sizeof((a)[0])) +/* TODO: Use this safer version when MSVC finally supports constexpr */ +//template +//constexpr size_t arrsize(_T (&)[_Sz]) { return _Sz; } /**************************************************************************** diff --git a/Sources/Plasma/NucleusLib/pnAsyncCoreExe/Private/Win32/pnAceW32Dns.cpp b/Sources/Plasma/NucleusLib/pnAsyncCoreExe/Private/Win32/pnAceW32Dns.cpp index ce0a9027..e3b4338e 100644 --- a/Sources/Plasma/NucleusLib/pnAsyncCoreExe/Private/Win32/pnAceW32Dns.cpp +++ b/Sources/Plasma/NucleusLib/pnAsyncCoreExe/Private/Win32/pnAceW32Dns.cpp @@ -102,7 +102,9 @@ static void LookupProcess (Lookup * lookup, unsigned error) { in_addr const * const * const inAddr = (in_addr **) host.h_addr_list; // allocate a buffer large enough to hold all the addresses - size_t count = arrsize(inAddr); + size_t count = 0; + while (inAddr[count]) + ++count; plNetAddress* addrs = new plNetAddress[count]; // fill in address data diff --git a/Sources/Plasma/PubUtilLib/plNetClientComm/plNetClientComm.cpp b/Sources/Plasma/PubUtilLib/plNetClientComm/plNetClientComm.cpp index d16634e7..d5d7447f 100644 --- a/Sources/Plasma/PubUtilLib/plNetClientComm/plNetClientComm.cpp +++ b/Sources/Plasma/PubUtilLib/plNetClientComm/plNetClientComm.cpp @@ -561,20 +561,6 @@ static void INetAuthFileListRequestCallback ( msg->Send(); } -//============================================================================ -static void INetCliAuthFileRequestCallback ( - ENetError result, - void * param, - const wchar_t filename[], - hsStream * writer -) { - plNetCommFileDownloadMsg * msg = new plNetCommFileDownloadMsg; - msg->result = result; - msg->writer = writer; - StrCopy(msg->filename, filename, arrsize(filename)); - msg->Send(); -} - //============================================================================ static void INetCliGameJoinAgeRequestCallback ( ENetError result,