Browse Source

Fix/remove some incorrect uses of the arrsize macro

Michael Hansen 10 years ago
parent
commit
5feefe8ea4
  1. 3
      Sources/Plasma/CoreLib/HeadSpin.h
  2. 4
      Sources/Plasma/NucleusLib/pnAsyncCoreExe/Private/Win32/pnAceW32Dns.cpp
  3. 14
      Sources/Plasma/PubUtilLib/plNetClientComm/plNetClientComm.cpp

3
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 <typename _T, size_t _Sz>
//constexpr size_t arrsize(_T (&)[_Sz]) { return _Sz; }
/****************************************************************************

4
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

14
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,

Loading…
Cancel
Save