From 8a3f0cfd5b56821f1c6119254a7e1d955c6e7048 Mon Sep 17 00:00:00 2001 From: Darryl Pogue Date: Sun, 23 Oct 2011 20:52:33 -0700 Subject: [PATCH] Get rid of DEL() and FREE() macros. Part of CoreLibExe must die. --- .../Plasma/Apps/plClientPatcher/UruPlayer.cpp | 6 +- Sources/Plasma/Apps/plUruLauncher/Main.cpp | 2 +- Sources/Plasma/CoreLib/hsMalloc.h | 3 - Sources/Plasma/CoreLib/hsStlUtils.h | 4 +- Sources/Plasma/CoreLib/hsUtils.cpp | 2 +- .../FeatureLib/pfCharacter/pfMarkerMgr.cpp | 10 +-- .../pfConsole/pfConsoleCommands.cpp | 6 +- .../pfGameMgr/BlueSpiral/pfGmBlueSpiral.cpp | 2 +- .../ClimbingWall/pfGmClimbingWall.cpp | 4 +- .../FeatureLib/pfGameMgr/Heek/pfGmHeek.cpp | 4 +- .../pfGameMgr/Marker/pfGmMarker.cpp | 6 +- .../pfGameMgr/TicTacToe/pfGmTicTacToe.cpp | 4 +- .../pfGameMgr/VarSync/pfGmVarSync.cpp | 2 +- .../Plasma/FeatureLib/pfGameMgr/pfGameMgr.cpp | 16 ++--- .../pfGameScoreMgr/pfGameScoreMgr.cpp | 2 +- .../pfLocalizationDataMgr.cpp | 6 +- .../pfPython/cyAccountManagement.cpp | 2 +- .../Plasma/FeatureLib/pfPython/cyMiscGlue.cpp | 4 +- .../Plasma/FeatureLib/pfPython/pyAgeVault.cpp | 6 +- .../FeatureLib/pfPython/pyDniInfoSource.cpp | 2 +- Sources/Plasma/FeatureLib/pfPython/pySDL.cpp | 2 +- .../Plasma/FeatureLib/pfPython/pyVault.cpp | 6 +- .../pfPython/pyVaultChronicleNode.cpp | 12 ++-- .../FeatureLib/pfPython/pyVaultImageNode.cpp | 2 +- .../FeatureLib/pfPython/pyVaultNode.cpp | 12 ++-- .../pfPython/pyVaultPlayerInfoNode.cpp | 12 ++-- .../FeatureLib/pfPython/pyVaultPlayerNode.cpp | 4 +- .../FeatureLib/pfPython/pyVaultSDLNode.cpp | 2 +- .../pfPython/pyVaultTextNoteNode.cpp | 6 +- .../pnAsyncCoreExe/Private/Nt/pnAceNt.cpp | 2 +- .../pnAsyncCoreExe/Private/Nt/pnAceNtFile.cpp | 2 +- .../Private/Nt/pnAceNtSocket.cpp | 6 +- .../Private/W9x/pnAceW9xFile.cpp | 2 +- .../Private/W9x/pnAceW9xSocket.cpp | 8 +-- .../Private/W9x/pnAceW9xThread.cpp | 2 +- .../Private/Win32/pnAceW32Dns.cpp | 2 +- .../Private/Win32/pnAceW32Thread.cpp | 2 +- .../NucleusLib/pnAsyncCoreExe/pnAceIo.cpp | 2 +- .../NucleusLib/pnAsyncCoreExe/pnAceLog.cpp | 6 +- .../NucleusLib/pnAsyncCoreExe/pnAceThread.cpp | 2 +- .../NucleusLib/pnAsyncCoreExe/pnAceTimer.cpp | 4 +- .../pnCrashExe/Win32/pnCreError.cpp | 16 ++--- .../NucleusLib/pnIni/Private/pnIniCore.cpp | 10 +-- .../pnIniExe/Private/Win32/pnW32IniChange.cpp | 2 +- .../NucleusLib/pnIniExe/Private/pnIniSrv.cpp | 2 +- Sources/Plasma/NucleusLib/pnMail/pnMail.cpp | 6 +- .../NucleusLib/pnNetCli/pnNcChannel.cpp | 2 +- .../Plasma/NucleusLib/pnNetCli/pnNcCli.cpp | 14 ++--- .../Plasma/NucleusLib/pnNetDiag/pnNdDns.cpp | 4 +- .../Plasma/NucleusLib/pnNetDiag/pnNdIcmp.cpp | 2 +- .../Plasma/NucleusLib/pnNetDiag/pnNdTcp.cpp | 16 ++--- .../Plasma/NucleusLib/pnNetDiag/pnNetDiag.cpp | 4 +- .../Plasma/NucleusLib/pnNetDiag/pnNetSys.cpp | 2 +- .../Plasma/NucleusLib/pnNetLog/pnNlCli.cpp | 2 +- .../pnNetProtocol/Private/pnNpCommon.cpp | 12 ++-- .../pnNetProtocol/Private/pnNpCommon.h | 8 +-- .../Plasma/NucleusLib/pnOraLib/pnOraLib.cpp | 6 +- .../NucleusLib/pnSimpleNet/pnSimpleNet.cpp | 10 +-- .../NucleusLib/pnSqlLib/Private/pnSqlConn.cpp | 14 ++--- .../pnUtils/Private/Win32/pnUtW32Sync.cpp | 4 +- .../NucleusLib/pnUtils/Private/pnUtCmd.cpp | 8 +-- .../NucleusLib/pnUtils/Private/pnUtCrypt.cpp | 4 +- .../NucleusLib/pnUtils/Private/pnUtHash.h | 6 +- .../NucleusLib/pnUtils/Private/pnUtList.h | 2 +- .../NucleusLib/pnUtils/Private/pnUtPriQ.h | 4 +- .../NucleusLib/pnUtils/Private/pnUtRef.h | 2 +- .../NucleusLib/pnUtils/Private/pnUtSkipList.h | 6 +- .../pnUtils/Private/pnUtSpareList.cpp | 2 +- .../NucleusLib/pnUtils/Private/pnUtSubst.h | 4 +- .../plAudioCore/plBufferedFileReader.cpp | 2 +- .../PubUtilLib/plAudioCore/plOGGCodec.cpp | 6 +- .../PubUtilLib/plAvatar/plAvatarClothing.cpp | 4 +- .../PubUtilLib/plCompression/plZlibStream.cpp | 8 +-- .../Plasma/PubUtilLib/plFile/plFileUtils.cpp | 4 +- .../PubUtilLib/plMessage/plConsoleMsg.h | 4 +- .../plNetClient/plNetCliAgeJoiner.cpp | 2 +- .../plNetClient/plNetCliAgeLeaver.cpp | 2 +- .../plNetClient/plNetClientMgrSend.cpp | 4 +- .../plNetClient/plNetLinkingMgr.cpp | 8 +-- .../plNetClientComm/plNetClientComm.cpp | 4 +- .../plNetGameLib/Private/plNglAuth.cpp | 14 ++--- .../plNetGameLib/Private/plNglCsr.cpp | 4 +- .../plNetGameLib/Private/plNglFile.cpp | 4 +- .../plNetGameLib/Private/plNglGame.cpp | 8 +-- .../PubUtilLib/plPhysX/plSimulationMgr.cpp | 8 +-- .../PubUtilLib/plStatusLog/plStatusLog.cpp | 2 +- .../PubUtilLib/plVault/plVaultClientApi.cpp | 62 +++++++++---------- .../PubUtilLib/plVault/plVaultNodeAccess.cpp | 12 ++-- 88 files changed, 262 insertions(+), 265 deletions(-) diff --git a/Sources/Plasma/Apps/plClientPatcher/UruPlayer.cpp b/Sources/Plasma/Apps/plClientPatcher/UruPlayer.cpp index aec0008d..00f61137 100644 --- a/Sources/Plasma/Apps/plClientPatcher/UruPlayer.cpp +++ b/Sources/Plasma/Apps/plClientPatcher/UruPlayer.cpp @@ -654,7 +654,7 @@ static void ProcessManifest (void * param) { } } } - DEL(mr); + delete mr; AtomicAdd(&s_perf[kPerfThreadTaskCount], -1); } @@ -920,7 +920,7 @@ void UruPrepProc (void * param) { while(ManifestFile *mf = s_manifestQueue.Head()) { - DEL(mf); + delete mf; } // If s_patchError, we don't wait around for s_numFiles // to drop to zero because it never does for reasons @@ -1030,4 +1030,4 @@ void UruStartProc (void * param) { { info->startCallback(kStatusError, nil); } -} \ No newline at end of file +} diff --git a/Sources/Plasma/Apps/plUruLauncher/Main.cpp b/Sources/Plasma/Apps/plUruLauncher/Main.cpp index a6289566..f5965ce1 100644 --- a/Sources/Plasma/Apps/plUruLauncher/Main.cpp +++ b/Sources/Plasma/Apps/plUruLauncher/Main.cpp @@ -409,7 +409,7 @@ static void DispatchEvents (HWND hwnd) { DISPATCH(SetBytesRemaining); DEFAULT_FATAL(event->type); } - DEL(event); // unlinks from list + delete event; // unlinks from list } #undef DISPATCH } diff --git a/Sources/Plasma/CoreLib/hsMalloc.h b/Sources/Plasma/CoreLib/hsMalloc.h index 98f87de0..99df0dbb 100644 --- a/Sources/Plasma/CoreLib/hsMalloc.h +++ b/Sources/Plasma/CoreLib/hsMalloc.h @@ -52,7 +52,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "HeadSpin.h" - /**************************************************************************** * * Allocation functions @@ -168,7 +167,6 @@ inline void CDECL operator delete (void *, void *) {} #define ALLOC(b) MemAlloc(b, 0, __FILE__, __LINE__) #define ALLOCZERO(b) MemAlloc(b, kMemZero, __FILE__, __LINE__) #define ALLOCFLAGS(b, f) MemAlloc(b, (f), __FILE__, __LINE__) -#define FREE(p) MemFree(p, 0) #define FREEFLAGS(p, f) MemFree(p, (f)) #define REALLOC(p, b) MemRealloc(p, b, 0, __FILE__, __LINE__) #define REALLOCFLAGS(p, b, f) MemRealloc(p, b, (f), __FILE__, __LINE__) @@ -185,7 +183,6 @@ inline void CDECL operator delete (void *, void *) {} #define NEW(t) new(MemAlloc(sizeof(t), 0, __FILE__, __LINE__)) t #define NEWFLAGS(t, f) new(MemAlloc(sizeof(t), (f), __FILE__, __LINE__)) t #define NEWZERO(t) new(MemAlloc(sizeof(t), kMemZero, __FILE__, __LINE__)) t -#define DEL(t) delete (t) #endif // __cplusplus diff --git a/Sources/Plasma/CoreLib/hsStlUtils.h b/Sources/Plasma/CoreLib/hsStlUtils.h index 77e4dab5..94429bec 100644 --- a/Sources/Plasma/CoreLib/hsStlUtils.h +++ b/Sources/Plasma/CoreLib/hsStlUtils.h @@ -114,12 +114,12 @@ public: void deallocate(pointer _Ptr, size_type) { // deallocate object at _Ptr, ignore size - FREE(_Ptr); + free(_Ptr); } pointer allocate(size_type _Count) { // allocate array of _Count elements - return (pointer)ALLOC(_Count * sizeof(_Ty)); + return (pointer)malloc(_Count * sizeof(_Ty)); } pointer allocate(size_type _Count, const void*) diff --git a/Sources/Plasma/CoreLib/hsUtils.cpp b/Sources/Plasma/CoreLib/hsUtils.cpp index 42d6dc59..f03e430d 100644 --- a/Sources/Plasma/CoreLib/hsUtils.cpp +++ b/Sources/Plasma/CoreLib/hsUtils.cpp @@ -237,7 +237,7 @@ char* hsStrcpy(char dst[], const char src[]) if (dst == nil) { int count = hsStrlen(src); - dst = (char *)ALLOC(count + 1); + dst = (char *)malloc(count + 1); memcpy(dst, src, count); dst[count] = 0; return dst; diff --git a/Sources/Plasma/FeatureLib/pfCharacter/pfMarkerMgr.cpp b/Sources/Plasma/FeatureLib/pfCharacter/pfMarkerMgr.cpp index 021194d1..677e74a3 100644 --- a/Sources/Plasma/FeatureLib/pfCharacter/pfMarkerMgr.cpp +++ b/Sources/Plasma/FeatureLib/pfCharacter/pfMarkerMgr.cpp @@ -103,7 +103,7 @@ void pfMarkerMgr::IShutdown() while (curMarker != fMarkers.end()) { curMarker->second->Remove(); - DEL(curMarker->second); + delete curMarker->second; ++curMarker; } fMarkers.clear(); @@ -165,7 +165,7 @@ void pfMarkerMgr::AddMarker(double x, double y, double z, uint32_t id, bool just { // delete existing one if we're changing its location fMarkers[id]->Remove(); - DEL(fMarkers[id]); + delete fMarkers[id]; } hsPoint3 pos((float)x, (float)y, (float)z); @@ -178,7 +178,7 @@ void pfMarkerMgr::RemoveMarker(uint32_t id) if (fMarkers.find(id) == fMarkers.end()) return; fMarkers[id]->Remove(); - DEL(fMarkers[id]); + delete fMarkers[id]; fMarkers.erase(id); } @@ -188,7 +188,7 @@ void pfMarkerMgr::RemoveAllMarkers() while (curMarker != fMarkers.end()) { curMarker->second->Remove(); - DEL(curMarker->second); + delete curMarker->second; ++curMarker; } fMarkers.clear(); @@ -326,4 +326,4 @@ hsBool pfMarkerMgr::MsgReceive(plMessage* msg) } return hsKeyedObject::MsgReceive(msg); -} \ No newline at end of file +} diff --git a/Sources/Plasma/FeatureLib/pfConsole/pfConsoleCommands.cpp b/Sources/Plasma/FeatureLib/pfConsole/pfConsoleCommands.cpp index 7c2da5d2..d4c536f0 100644 --- a/Sources/Plasma/FeatureLib/pfConsole/pfConsoleCommands.cpp +++ b/Sources/Plasma/FeatureLib/pfConsole/pfConsoleCommands.cpp @@ -6090,7 +6090,7 @@ PF_CONSOLE_CMD(Age, ShowSDL, "", "Prints the age SDL values") plStateDataRecord * rec = NEWZERO(plStateDataRecord); if (!VaultAgeGetAgeSDL(rec)) { PrintString("Age SDL not found"); - DEL(rec); + delete rec; return; } @@ -6106,14 +6106,14 @@ PF_CONSOLE_CMD(Age, ShowSDL, "", "Prints the age SDL values") char * str = simple->GetAsString(j); StrPack(line, str, arrsize(line)); StrPack(line, ",", arrsize(line)); - FREE(str); + free(str); } PrintString(line); plStatusLog::AddLineS("ShowSDL.log", "%s", line); } } - DEL(rec); + delete rec; } PF_CONSOLE_CMD( Age, GetElapsedDays, "string agedefnfile", "Gets the elapsed days and fractions" ) diff --git a/Sources/Plasma/FeatureLib/pfGameMgr/BlueSpiral/pfGmBlueSpiral.cpp b/Sources/Plasma/FeatureLib/pfGameMgr/BlueSpiral/pfGmBlueSpiral.cpp index 4d183385..3121767e 100644 --- a/Sources/Plasma/FeatureLib/pfGameMgr/BlueSpiral/pfGmBlueSpiral.cpp +++ b/Sources/Plasma/FeatureLib/pfGameMgr/BlueSpiral/pfGmBlueSpiral.cpp @@ -203,7 +203,7 @@ pfGmBlueSpiral::pfGmBlueSpiral ( //============================================================================ pfGmBlueSpiral::~pfGmBlueSpiral () { - DEL(internal); + delete internal; } //============================================================================ diff --git a/Sources/Plasma/FeatureLib/pfGameMgr/ClimbingWall/pfGmClimbingWall.cpp b/Sources/Plasma/FeatureLib/pfGameMgr/ClimbingWall/pfGmClimbingWall.cpp index 2058ec84..d367aaf1 100644 --- a/Sources/Plasma/FeatureLib/pfGameMgr/ClimbingWall/pfGmClimbingWall.cpp +++ b/Sources/Plasma/FeatureLib/pfGameMgr/ClimbingWall/pfGmClimbingWall.cpp @@ -211,7 +211,7 @@ pfGmClimbingWall::pfGmClimbingWall ( //============================================================================ pfGmClimbingWall::~pfGmClimbingWall () { - DEL(internal); + delete internal; } //============================================================================ @@ -347,4 +347,4 @@ void pfGmClimbingWall::Panic () { msg.transId = 0; GameMgrSend(&msg); -} \ No newline at end of file +} diff --git a/Sources/Plasma/FeatureLib/pfGameMgr/Heek/pfGmHeek.cpp b/Sources/Plasma/FeatureLib/pfGameMgr/Heek/pfGmHeek.cpp index 1824bbdd..348a1e50 100644 --- a/Sources/Plasma/FeatureLib/pfGameMgr/Heek/pfGmHeek.cpp +++ b/Sources/Plasma/FeatureLib/pfGameMgr/Heek/pfGmHeek.cpp @@ -245,7 +245,7 @@ pfGmHeek::pfGmHeek ( //============================================================================ pfGmHeek::~pfGmHeek () { - DEL(internal); + delete internal; } //============================================================================ @@ -343,4 +343,4 @@ void pfGmHeek::SequenceFinished (EHeekSeqFinished seq) { msg.seqFinished = (uint8_t)seq; GameMgrSend(&msg); -} \ No newline at end of file +} diff --git a/Sources/Plasma/FeatureLib/pfGameMgr/Marker/pfGmMarker.cpp b/Sources/Plasma/FeatureLib/pfGameMgr/Marker/pfGmMarker.cpp index c82fedd3..46d8459d 100644 --- a/Sources/Plasma/FeatureLib/pfGameMgr/Marker/pfGmMarker.cpp +++ b/Sources/Plasma/FeatureLib/pfGameMgr/Marker/pfGmMarker.cpp @@ -229,7 +229,7 @@ void IMarker::RecvGameDeleted (const Srv2Cli_Marker_GameDeleted & msg, void * pa gameCliMsg->Send(gameCli->GetReceiver()); if (!msg.failed) - DEL(gameCli); // we're done + delete gameCli; // we're done } //============================================================================ @@ -280,7 +280,7 @@ pfGmMarker::pfGmMarker ( //============================================================================ pfGmMarker::~pfGmMarker () { - DEL(internal); + delete internal; } //============================================================================ @@ -464,4 +464,4 @@ void pfGmMarker::CaptureMarker (unsigned long markerID) { msg.markerID = markerID; GameMgrSend(&msg); -} \ No newline at end of file +} diff --git a/Sources/Plasma/FeatureLib/pfGameMgr/TicTacToe/pfGmTicTacToe.cpp b/Sources/Plasma/FeatureLib/pfGameMgr/TicTacToe/pfGmTicTacToe.cpp index 1dc6734c..e9b1056c 100644 --- a/Sources/Plasma/FeatureLib/pfGameMgr/TicTacToe/pfGmTicTacToe.cpp +++ b/Sources/Plasma/FeatureLib/pfGameMgr/TicTacToe/pfGmTicTacToe.cpp @@ -174,7 +174,7 @@ void ITicTacToe::RecvGameOver (const Srv2Cli_TTT_GameOver & msg, void * param) { gameCliMsg->Set(gameCli, msg); gameCliMsg->Send(gameCli->GetReceiver()); - DEL(gameCli); // we're done + delete gameCli; // we're done } //============================================================================ @@ -210,7 +210,7 @@ pfGmTicTacToe::pfGmTicTacToe ( //============================================================================ pfGmTicTacToe::~pfGmTicTacToe () { - DEL(internal); + delete internal; } //============================================================================ diff --git a/Sources/Plasma/FeatureLib/pfGameMgr/VarSync/pfGmVarSync.cpp b/Sources/Plasma/FeatureLib/pfGameMgr/VarSync/pfGmVarSync.cpp index 87a48e01..9a8d9530 100644 --- a/Sources/Plasma/FeatureLib/pfGameMgr/VarSync/pfGmVarSync.cpp +++ b/Sources/Plasma/FeatureLib/pfGameMgr/VarSync/pfGmVarSync.cpp @@ -202,7 +202,7 @@ pfGmVarSync::pfGmVarSync ( //============================================================================ pfGmVarSync::~pfGmVarSync () { - DEL(internal); + delete internal; } //============================================================================ diff --git a/Sources/Plasma/FeatureLib/pfGameMgr/pfGameMgr.cpp b/Sources/Plasma/FeatureLib/pfGameMgr/pfGameMgr.cpp index fce0029f..3f67bff2 100644 --- a/Sources/Plasma/FeatureLib/pfGameMgr/pfGameMgr.cpp +++ b/Sources/Plasma/FeatureLib/pfGameMgr/pfGameMgr.cpp @@ -148,7 +148,7 @@ static ARRAYOBJ(plKey) s_receivers; static void ShutdownFactories () { while (Factory * factory = s_factories.Head()) - DEL(factory); + delete factory; } //============================================================================ @@ -200,7 +200,7 @@ void IGameMgr::RecvGameInstance (const Srv2Cli_GameMgr_GameInstance & msg, void cli = internal->gameCli; } - DEL(state); + delete state; } //============================================================================ @@ -228,7 +228,7 @@ void IGameMgr::Recv (GameMsgHeader * msg) { void * param; if (TransState * trans = s_trans.Find(msg->transId)) { param = trans->param; - DEL(trans); + delete trans; } else { param = nil; @@ -280,13 +280,13 @@ pfGameMgrMsg::pfGameMgrMsg () { //============================================================================ pfGameMgrMsg::~pfGameMgrMsg () { - FREE(netMsg); + free(netMsg); } //============================================================================ void pfGameMgrMsg::Set (const GameMsgHeader & msg) { - netMsg = (GameMsgHeader *)ALLOC(msg.messageBytes); + netMsg = (GameMsgHeader *)malloc(msg.messageBytes); MemCopy(netMsg, &msg, msg.messageBytes); } @@ -307,13 +307,13 @@ pfGameCliMsg::pfGameCliMsg () { //============================================================================ pfGameCliMsg::~pfGameCliMsg () { - FREE(netMsg); + free(netMsg); } //============================================================================ void pfGameCliMsg::Set (pfGameCli * cli, const GameMsgHeader & msg) { - netMsg = (GameMsgHeader *)ALLOC(msg.messageBytes); + netMsg = (GameMsgHeader *)malloc(msg.messageBytes); MemCopy(netMsg, &msg, msg.messageBytes); gameCli = cli; } @@ -475,7 +475,7 @@ pfGameCli::pfGameCli ( //============================================================================ pfGameCli::~pfGameCli () { - DEL(internal); + delete internal; } //============================================================================ diff --git a/Sources/Plasma/FeatureLib/pfGameScoreMgr/pfGameScoreMgr.cpp b/Sources/Plasma/FeatureLib/pfGameScoreMgr/pfGameScoreMgr.cpp index fe3178bb..23538b5a 100644 --- a/Sources/Plasma/FeatureLib/pfGameScoreMgr/pfGameScoreMgr.cpp +++ b/Sources/Plasma/FeatureLib/pfGameScoreMgr/pfGameScoreMgr.cpp @@ -112,7 +112,7 @@ void pfGameScoreMgr::RemoveCachedScore(unsigned scoreId) { if (GameScoreLink * link = fScores.Find(scoreId)) { - DEL(link); + delete link; } } diff --git a/Sources/Plasma/FeatureLib/pfLocalizationMgr/pfLocalizationDataMgr.cpp b/Sources/Plasma/FeatureLib/pfLocalizationMgr/pfLocalizationDataMgr.cpp index 3fbe47af..29b1636d 100644 --- a/Sources/Plasma/FeatureLib/pfLocalizationMgr/pfLocalizationDataMgr.cpp +++ b/Sources/Plasma/FeatureLib/pfLocalizationMgr/pfLocalizationDataMgr.cpp @@ -155,15 +155,15 @@ struct LocAgeInfo ////////////////////////////////////////////////////////////////////// static void * XMLCALL XmlMalloc (size_t size) { - return ALLOC(size); + return malloc(size); } static void * XMLCALL XmlRealloc (void * ptr, size_t size) { - return REALLOC(ptr, size); + return realloc(ptr, size); } static void XMLCALL XmlFree (void * ptr) { - FREE(ptr); + free(ptr); } XML_Memory_Handling_Suite gHeapAllocator = { diff --git a/Sources/Plasma/FeatureLib/pfPython/cyAccountManagement.cpp b/Sources/Plasma/FeatureLib/pfPython/cyAccountManagement.cpp index a8df3047..738dca11 100644 --- a/Sources/Plasma/FeatureLib/pfPython/cyAccountManagement.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/cyAccountManagement.cpp @@ -137,5 +137,5 @@ void cyAccountManagement::ChangePassword(const char* password) { wchar_t* wpassword = StrDupToUnicode(password); NetCommChangeMyPassword(wpassword); - FREE(wpassword); + free(wpassword); } diff --git a/Sources/Plasma/FeatureLib/pfPython/cyMiscGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/cyMiscGlue.cpp index 59851db6..90c539e8 100644 --- a/Sources/Plasma/FeatureLib/pfPython/cyMiscGlue.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/cyMiscGlue.cpp @@ -259,7 +259,7 @@ PYTHON_GLOBAL_METHOD_DEFINITION(PtSendRTChat, args, "Params: fromPlayer,toPlayer wchar_t* msg = TRACKED_NEW wchar_t[size + 1]; msg[size] = 0; PyUnicode_AsWideChar((PyUnicodeObject*)message, msg, size); uint32_t retval = cyMisc::SendRTChat(*fromPlayer, toPlayerList, msg, msgFlags); - DEL(msg); + delete msg; return PyLong_FromUnsignedLong(retval); } else @@ -553,4 +553,4 @@ void cyMisc::AddPlasmaMethods(std::vector &methods) AddPlasmaMethods2(methods); AddPlasmaMethods3(methods); AddPlasmaMethods4(methods); -} \ No newline at end of file +} diff --git a/Sources/Plasma/FeatureLib/pfPython/pyAgeVault.cpp b/Sources/Plasma/FeatureLib/pfPython/pyAgeVault.cpp index ea96a038..64f429e7 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyAgeVault.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyAgeVault.cpp @@ -220,8 +220,8 @@ void pyAgeVault::AddChronicleEntry( const char * name, uint32_t type, const char VaultAddAgeChronicleEntry(wEntryName, type, wEntryValue); - FREE(wEntryName); - FREE(wEntryValue); + free(wEntryName); + free(wEntryValue); } // AGE DEVICES. AKA IMAGERS, WHATEVER. @@ -311,7 +311,7 @@ PyObject * pyAgeVault::GetAgeSDL() const { plStateDataRecord * rec = NEWZERO(plStateDataRecord); if (!VaultAgeGetAgeSDL(rec)) { - DEL(rec); + delete rec; PYTHON_RETURN_NONE; } else { diff --git a/Sources/Plasma/FeatureLib/pfPython/pyDniInfoSource.cpp b/Sources/Plasma/FeatureLib/pfPython/pyDniInfoSource.cpp index 64f0edbe..a761e26c 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyDniInfoSource.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyDniInfoSource.cpp @@ -51,7 +51,7 @@ pyDniInfoSource::pyDniInfoSource() {} pyDniInfoSource::~pyDniInfoSource() { - FREE(fAgeName); + free(fAgeName); } PyObject* pyDniInfoSource::GetAgeCoords( void ) diff --git a/Sources/Plasma/FeatureLib/pfPython/pySDL.cpp b/Sources/Plasma/FeatureLib/pfPython/pySDL.cpp index e9867870..92bdc663 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pySDL.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pySDL.cpp @@ -56,7 +56,7 @@ pySDLStateDataRecord::pySDLStateDataRecord( plStateDataRecord * rec ) } pySDLStateDataRecord::~pySDLStateDataRecord() { - DEL(fRec); + delete fRec; } plStateDataRecord * pySDLStateDataRecord::GetRec() const diff --git a/Sources/Plasma/FeatureLib/pfPython/pyVault.cpp b/Sources/Plasma/FeatureLib/pfPython/pyVault.cpp index 860f861c..e4e05880 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyVault.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyVault.cpp @@ -369,8 +369,8 @@ void pyVault::AddChronicleEntry( const char * name, uint32_t type, const char * // Maybe we should insert a dummy into the tree? (currently hard) VaultAddChronicleEntryAndWait(wEntryName, type, wEntryValue); - FREE(wEntryName); - FREE(wEntryValue); + free(wEntryName); + free(wEntryValue); } @@ -452,7 +452,7 @@ PyObject* pyVault::GetPsnlAgeSDL() const if (sdl.GetStateDataRecord(rec, plSDL::kKeepDirty)) result = pySDLStateDataRecord::New(rec); else - DEL(rec); + delete rec; rvnSdl->DecRef(); } rvnInfo->DecRef(); diff --git a/Sources/Plasma/FeatureLib/pfPython/pyVaultChronicleNode.cpp b/Sources/Plasma/FeatureLib/pfPython/pyVaultChronicleNode.cpp index 8f3c2dfe..48c45c34 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyVaultChronicleNode.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyVaultChronicleNode.cpp @@ -70,8 +70,8 @@ pyVaultChronicleNode::pyVaultChronicleNode(int n) } pyVaultChronicleNode::~pyVaultChronicleNode () { - FREE(ansiName); - FREE(ansiValue); + free(ansiName); + free(ansiValue); } @@ -86,7 +86,7 @@ void pyVaultChronicleNode::Chronicle_SetName( const char * text ) wchar_t * wStr = StrDupToUnicode(text); VaultChronicleNode chron(fNode); chron.SetEntryName(wStr); - FREE(wStr); + free(wStr); } const char * pyVaultChronicleNode::Chronicle_GetName( void ) @@ -94,7 +94,7 @@ const char * pyVaultChronicleNode::Chronicle_GetName( void ) if (!fNode) return ""; - FREE(ansiName); + free(ansiName); VaultChronicleNode chron(fNode); ansiName = StrDupToAnsi(chron.entryName); @@ -109,7 +109,7 @@ void pyVaultChronicleNode::Chronicle_SetValue( const char * text ) wchar_t * wStr = StrDupToUnicode(text); VaultChronicleNode chron(fNode); chron.SetEntryValue(wStr); - FREE(wStr); + free(wStr); } const char * pyVaultChronicleNode::Chronicle_GetValue( void ) @@ -117,7 +117,7 @@ const char * pyVaultChronicleNode::Chronicle_GetValue( void ) if (!fNode) return ""; - FREE(ansiValue); + free(ansiValue); ansiValue = nil; VaultChronicleNode chron(fNode); diff --git a/Sources/Plasma/FeatureLib/pfPython/pyVaultImageNode.cpp b/Sources/Plasma/FeatureLib/pfPython/pyVaultImageNode.cpp index b2c8eb56..408012d9 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyVaultImageNode.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyVaultImageNode.cpp @@ -245,7 +245,7 @@ void pyVaultImageNode::SetImageFromScrShot() else { access.SetImageData(nil, 0); access.SetImageType(VaultImageNode::kNone); - DEL(fMipmap); + delete fMipmap; fMipmap = nil; } } diff --git a/Sources/Plasma/FeatureLib/pfPython/pyVaultNode.cpp b/Sources/Plasma/FeatureLib/pfPython/pyVaultNode.cpp index c37fe5b8..d030a55d 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyVaultNode.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyVaultNode.cpp @@ -154,7 +154,7 @@ void pyVaultNode::pyVaultNodeOperationCallback::VaultOperationComplete( uint32_t } } - DEL(this); // commit hara-kiri + delete this; // commit hara-kiri } void pyVaultNode::pyVaultNodeOperationCallback::SetNode (RelVaultNode * rvn) { @@ -191,8 +191,8 @@ pyVaultNode::~pyVaultNode() { if (fNode) fNode->DecRef("pyVaultNode"); - FREE(fCreateAgeGuid); - FREE(fCreateAgeName); + free(fCreateAgeGuid); + free(fCreateAgeName); } @@ -335,7 +335,7 @@ const char * pyVaultNode::GetCreateAgeGuid( void ) return fCreateAgeGuid; if (fNode) { - fCreateAgeGuid = (char*)ALLOC(64); + fCreateAgeGuid = (char*)malloc(64); GuidToString(fNode->createAgeUuid, fCreateAgeGuid, 64); } @@ -383,7 +383,7 @@ void pyVaultNode::SetCreatorNodeID( uint32_t v ) void pyVaultNode::SetCreateAgeName( const char * v ) { - FREE(fCreateAgeName); + free(fCreateAgeName); fCreateAgeName = nil; ASSERT(fNode); @@ -394,7 +394,7 @@ void pyVaultNode::SetCreateAgeName( const char * v ) void pyVaultNode::SetCreateAgeGuid( const char * v ) { - FREE(fCreateAgeGuid); + free(fCreateAgeGuid); fCreateAgeGuid = nil; ASSERT(fNode); diff --git a/Sources/Plasma/FeatureLib/pfPython/pyVaultPlayerInfoNode.cpp b/Sources/Plasma/FeatureLib/pfPython/pyVaultPlayerInfoNode.cpp index b51d974b..5558939f 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyVaultPlayerInfoNode.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyVaultPlayerInfoNode.cpp @@ -70,8 +70,8 @@ pyVaultPlayerInfoNode::pyVaultPlayerInfoNode() } pyVaultPlayerInfoNode::~pyVaultPlayerInfoNode () { - FREE(ansiPlayerName); - FREE(ansiAgeInstName); + free(ansiPlayerName); + free(ansiAgeInstName); } //================================================================== @@ -103,7 +103,7 @@ void pyVaultPlayerInfoNode::Player_SetPlayerName( const char * name ) wchar_t * wStr = StrDupToUnicode(name); VaultPlayerInfoNode playerInfo(fNode); playerInfo.SetPlayerName(wStr); - FREE(wStr); + free(wStr); } const char * pyVaultPlayerInfoNode::Player_GetPlayerName( void ) @@ -115,7 +115,7 @@ const char * pyVaultPlayerInfoNode::Player_GetPlayerName( void ) if (!playerInfo.playerName) return ""; - FREE(ansiPlayerName); + free(ansiPlayerName); ansiPlayerName = StrDupToAnsi(playerInfo.playerName); return ansiPlayerName; } @@ -129,7 +129,7 @@ void pyVaultPlayerInfoNode::Player_SetAgeInstanceName( const char * agename ) wchar_t * wStr = StrDupToUnicode(agename); VaultPlayerInfoNode playerInfo(fNode); playerInfo.SetAgeInstName(wStr); - FREE(wStr); + free(wStr); } const char * pyVaultPlayerInfoNode::Player_GetAgeInstanceName( void ) @@ -141,7 +141,7 @@ const char * pyVaultPlayerInfoNode::Player_GetAgeInstanceName( void ) if (!playerInfo.ageInstName) return ""; - FREE(ansiAgeInstName); + free(ansiAgeInstName); ansiAgeInstName = StrDupToAnsi(playerInfo.ageInstName); return ansiAgeInstName; } diff --git a/Sources/Plasma/FeatureLib/pfPython/pyVaultPlayerNode.cpp b/Sources/Plasma/FeatureLib/pfPython/pyVaultPlayerNode.cpp index 77ec989c..61ef3cb9 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyVaultPlayerNode.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyVaultPlayerNode.cpp @@ -189,7 +189,7 @@ PyObject *pyVaultPlayerNode::GetLinkToMyNeighborhood() return result; } - DEL(link); + delete link; PYTHON_RETURN_NONE; } @@ -202,7 +202,7 @@ PyObject *pyVaultPlayerNode::GetLinkToCity() return result; } - DEL(link); + delete link; PYTHON_RETURN_NONE; } diff --git a/Sources/Plasma/FeatureLib/pfPython/pyVaultSDLNode.cpp b/Sources/Plasma/FeatureLib/pfPython/pyVaultSDLNode.cpp index c0b9d65e..28a7700b 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyVaultSDLNode.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyVaultSDLNode.cpp @@ -97,7 +97,7 @@ PyObject * pyVaultSDLNode::GetStateDataRecord() const if (sdl.GetStateDataRecord(rec)) return pySDLStateDataRecord::New(rec); else - DEL(rec); + delete rec; PYTHON_RETURN_NONE; } diff --git a/Sources/Plasma/FeatureLib/pfPython/pyVaultTextNoteNode.cpp b/Sources/Plasma/FeatureLib/pfPython/pyVaultTextNoteNode.cpp index adfd9dde..a1e924e6 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyVaultTextNoteNode.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyVaultTextNoteNode.cpp @@ -103,7 +103,7 @@ std::string pyVaultTextNoteNode::Note_GetTitle( void ) std::string result; aStr = StrDupToAnsi(textNote.noteTitle); result = aStr; - FREE(aStr); + free(aStr); return result; } return ""; @@ -130,7 +130,7 @@ void pyVaultTextNoteNode::Note_SetText( const char * text ) wStr = StrDupToUnicode(text); VaultTextNoteNode textNote(fNode); textNote.SetNoteText(wStr); - FREE(wStr); + free(wStr); } void pyVaultTextNoteNode::Note_SetTextW( const wchar_t * text ) @@ -153,7 +153,7 @@ std::string pyVaultTextNoteNode::Note_GetText( void ) std::string result; aStr = StrDupToAnsi(textNote.noteText); result = aStr; - FREE(aStr); + free(aStr); return result; } return ""; diff --git a/Sources/Plasma/NucleusLib/pnAsyncCoreExe/Private/Nt/pnAceNt.cpp b/Sources/Plasma/NucleusLib/pnAsyncCoreExe/Private/Nt/pnAceNt.cpp index 3419784f..eaa7e257 100644 --- a/Sources/Plasma/NucleusLib/pnAsyncCoreExe/Private/Nt/pnAceNt.cpp +++ b/Sources/Plasma/NucleusLib/pnAsyncCoreExe/Private/Nt/pnAceNt.cpp @@ -102,7 +102,7 @@ void CNtWaitHandle::IncRef () { //=========================================================================== void CNtWaitHandle::DecRef () { if (!InterlockedDecrement(&m_refCount)) - DEL(this); + delete this; } //=========================================================================== diff --git a/Sources/Plasma/NucleusLib/pnAsyncCoreExe/Private/Nt/pnAceNtFile.cpp b/Sources/Plasma/NucleusLib/pnAsyncCoreExe/Private/Nt/pnAceNtFile.cpp index 71263045..f27a4ca4 100644 --- a/Sources/Plasma/NucleusLib/pnAsyncCoreExe/Private/Nt/pnAceNtFile.cpp +++ b/Sources/Plasma/NucleusLib/pnAsyncCoreExe/Private/Nt/pnAceNtFile.cpp @@ -384,7 +384,7 @@ void INtFileDelete ( } file->critsect.Leave(); - DEL(file); + delete file; } //=========================================================================== diff --git a/Sources/Plasma/NucleusLib/pnAsyncCoreExe/Private/Nt/pnAceNtSocket.cpp b/Sources/Plasma/NucleusLib/pnAsyncCoreExe/Private/Nt/pnAceNtSocket.cpp index c0a48e4e..094864de 100644 --- a/Sources/Plasma/NucleusLib/pnAsyncCoreExe/Private/Nt/pnAceNtSocket.cpp +++ b/Sources/Plasma/NucleusLib/pnAsyncCoreExe/Private/Nt/pnAceNtSocket.cpp @@ -600,7 +600,7 @@ static void ListenPrepareListeners (fd_set * readfds) { // destroy unused ports if (!port->listenCount) { - DEL(port); + delete port; continue; } @@ -980,7 +980,7 @@ void INtSocketOpCompleteSocketConnect (NtOpConnAttempt * op) { // and because connection attempts are not waitable ASSERT(!op->link.IsLinked()); ASSERT(!op->signalComplete); - DEL(op); + delete op; PerfSubCounter(kAsyncPerfSocketConnAttemptsOutCurr, 1); } @@ -1259,7 +1259,7 @@ void NtSocketDelete (AsyncSocket conn) { return; } - DEL(sock); + delete sock; } //=========================================================================== diff --git a/Sources/Plasma/NucleusLib/pnAsyncCoreExe/Private/W9x/pnAceW9xFile.cpp b/Sources/Plasma/NucleusLib/pnAsyncCoreExe/Private/W9x/pnAceW9xFile.cpp index bb7ec9f8..8ba35921 100644 --- a/Sources/Plasma/NucleusLib/pnAsyncCoreExe/Private/W9x/pnAceW9xFile.cpp +++ b/Sources/Plasma/NucleusLib/pnAsyncCoreExe/Private/W9x/pnAceW9xFile.cpp @@ -190,7 +190,7 @@ void CFile::Complete (void * op, CCritSect * critSect, AsyncId asyncId) { //=========================================================================== void CFile::Delete (void * op) { FileOp * fileOp = (FileOp *)op; - DEL(fileOp); + delete fileOp; } //=========================================================================== diff --git a/Sources/Plasma/NucleusLib/pnAsyncCoreExe/Private/W9x/pnAceW9xSocket.cpp b/Sources/Plasma/NucleusLib/pnAsyncCoreExe/Private/W9x/pnAceW9xSocket.cpp index 2e556479..07114d11 100644 --- a/Sources/Plasma/NucleusLib/pnAsyncCoreExe/Private/W9x/pnAceW9xSocket.cpp +++ b/Sources/Plasma/NucleusLib/pnAsyncCoreExe/Private/W9x/pnAceW9xSocket.cpp @@ -457,13 +457,13 @@ void CSocket::OnConnect () { ); // Delete the connect command - DEL(command); + delete command; // Handle failure to connect if (error) { // Destroy the socket - DEL(this); + delete this; } @@ -643,7 +643,7 @@ void CSocket::ProcessQueue () { } // Delete the command - DEL(command); + delete command; } @@ -1105,7 +1105,7 @@ void W9xSocketDelete ( // Delete the object s_critSect.Enter(); - DEL(object); + delete object; s_critSect.Leave(); } diff --git a/Sources/Plasma/NucleusLib/pnAsyncCoreExe/Private/W9x/pnAceW9xThread.cpp b/Sources/Plasma/NucleusLib/pnAsyncCoreExe/Private/W9x/pnAceW9xThread.cpp index 0da9fadf..f6a134f7 100644 --- a/Sources/Plasma/NucleusLib/pnAsyncCoreExe/Private/W9x/pnAceW9xThread.cpp +++ b/Sources/Plasma/NucleusLib/pnAsyncCoreExe/Private/W9x/pnAceW9xThread.cpp @@ -234,7 +234,7 @@ static unsigned CALLBACK W9xThreadProc (AsyncThread *) { if (rec) { s_dispInProcList.Link(rec); rec->Complete(&s_critSect); - DEL(rec); + delete rec; timeout = 0; } else { diff --git a/Sources/Plasma/NucleusLib/pnAsyncCoreExe/Private/Win32/pnAceW32Dns.cpp b/Sources/Plasma/NucleusLib/pnAsyncCoreExe/Private/Win32/pnAceW32Dns.cpp index 9a9f7629..9bbcf829 100644 --- a/Sources/Plasma/NucleusLib/pnAsyncCoreExe/Private/Win32/pnAceW32Dns.cpp +++ b/Sources/Plasma/NucleusLib/pnAsyncCoreExe/Private/Win32/pnAceW32Dns.cpp @@ -132,7 +132,7 @@ static void LookupProcess (Lookup * lookup, unsigned error) { // section because it isn't linked into an ioConn opList // and because connection attempts are not waitable ASSERT(!lookup->link.IsLinked()); - DEL(lookup); + delete lookup; PerfSubCounter(kAsyncPerfNameLookupAttemptsCurr, 1); } diff --git a/Sources/Plasma/NucleusLib/pnAsyncCoreExe/Private/Win32/pnAceW32Thread.cpp b/Sources/Plasma/NucleusLib/pnAsyncCoreExe/Private/Win32/pnAceW32Thread.cpp index d6c0a0b3..e4e930d9 100644 --- a/Sources/Plasma/NucleusLib/pnAsyncCoreExe/Private/Win32/pnAceW32Thread.cpp +++ b/Sources/Plasma/NucleusLib/pnAsyncCoreExe/Private/Win32/pnAceW32Thread.cpp @@ -148,7 +148,7 @@ static unsigned THREADCALL ThreadTaskProc (AsyncThread * thread) { #endif task->taskList->DecRef("task"); - DEL(task); + delete task; } } PerfSubCounter(kAsyncPerfThreadTaskThreadsActive, 1); diff --git a/Sources/Plasma/NucleusLib/pnAsyncCoreExe/pnAceIo.cpp b/Sources/Plasma/NucleusLib/pnAsyncCoreExe/pnAceIo.cpp index 316148f0..65248800 100644 --- a/Sources/Plasma/NucleusLib/pnAsyncCoreExe/pnAceIo.cpp +++ b/Sources/Plasma/NucleusLib/pnAsyncCoreExe/pnAceIo.cpp @@ -553,7 +553,7 @@ void AsyncSocketUnregisterNotifyProc ( s_notifyProcLock.LeaveWrite(); // perform memory deallocation outside the lock - DEL(scan); + delete scan; } //=========================================================================== diff --git a/Sources/Plasma/NucleusLib/pnAsyncCoreExe/pnAceLog.cpp b/Sources/Plasma/NucleusLib/pnAsyncCoreExe/pnAceLog.cpp index a488f763..8266236b 100644 --- a/Sources/Plasma/NucleusLib/pnAsyncCoreExe/pnAceLog.cpp +++ b/Sources/Plasma/NucleusLib/pnAsyncCoreExe/pnAceLog.cpp @@ -145,7 +145,7 @@ static void LogFileNotifyProc ( ) { switch (code) { case kNotifyFileWrite: - FREE(notify->param); + free(notify->param); AtomicAdd(&s_opsPending, -1); break; @@ -171,7 +171,7 @@ static void AllocLogBuffer_CS (unsigned index) { //============================================================================ static void FreeLogBuffer_CS (unsigned index) { if (s_logBuf[index]) { - FREE(s_logBuf[index]); + free(s_logBuf[index]); s_logBuf[index] = nil; } } @@ -279,7 +279,7 @@ static void WriteLogFile_CS (unsigned index, bool close) { s_logBuf[index] ); if (flags == kAsyncFileRwSync) - DEL(s_logBuf[index]); + delete s_logBuf[index]; else AtomicAdd(&s_opsPending, 1); s_logWritePos[index] += s_logPos[index]; diff --git a/Sources/Plasma/NucleusLib/pnAsyncCoreExe/pnAceThread.cpp b/Sources/Plasma/NucleusLib/pnAsyncCoreExe/pnAceThread.cpp index 0fa74139..191f33b7 100644 --- a/Sources/Plasma/NucleusLib/pnAsyncCoreExe/pnAceThread.cpp +++ b/Sources/Plasma/NucleusLib/pnAsyncCoreExe/pnAceThread.cpp @@ -75,7 +75,7 @@ static unsigned CALLBACK CreateThreadProc (LPVOID param) { unsigned result = thread->proc(thread); // Cleanup thread - DEL(thread); + delete thread; PerfSubCounter(kAsyncPerfThreadsCurr, 1); return result; diff --git a/Sources/Plasma/NucleusLib/pnAsyncCoreExe/pnAceTimer.cpp b/Sources/Plasma/NucleusLib/pnAsyncCoreExe/pnAceTimer.cpp index f6d3aa1e..ae76e31b 100644 --- a/Sources/Plasma/NucleusLib/pnAsyncCoreExe/pnAceTimer.cpp +++ b/Sources/Plasma/NucleusLib/pnAsyncCoreExe/pnAceTimer.cpp @@ -133,7 +133,7 @@ static inline unsigned RunTimers () { while (AsyncTimer * t = s_timerDelete.Head()) { if (t->destroyProc) CallTimerProc(t, t->destroyProc); - DEL(t); + delete t; } // Get first timer to run @@ -225,7 +225,7 @@ void TimerDestroy (unsigned exitThreadWaitMs) { while (AsyncTimer * t = s_timerDelete.Head()) { if (t->destroyProc) CallTimerProc(t, t->destroyProc); - DEL(t); + delete t; } s_timerCrit.Leave(); diff --git a/Sources/Plasma/NucleusLib/pnCrashExe/Win32/pnCreError.cpp b/Sources/Plasma/NucleusLib/pnCrashExe/Win32/pnCreError.cpp index ca55b435..5a1ecb25 100644 --- a/Sources/Plasma/NucleusLib/pnCrashExe/Win32/pnCreError.cpp +++ b/Sources/Plasma/NucleusLib/pnCrashExe/Win32/pnCreError.cpp @@ -65,7 +65,7 @@ struct Module { wchar_t * name; wchar_t * buildString; - ~Module () { FREE(name); FREE(buildString); } + ~Module () { free(name); free(buildString); } }; struct EmailParams : AtomicRef { @@ -77,12 +77,12 @@ struct EmailParams : AtomicRef { char * replyTo; ~EmailParams () { - FREE(smtp); - FREE(sender); - FREE(recipients); - FREE(username); - FREE(password); - FREE(replyTo); + free(smtp); + free(sender); + free(recipients); + free(username); + free(password); + free(replyTo); } }; @@ -975,7 +975,7 @@ void CrashRemoveModule ( Module * module = (Module *) param; SAFE_CRITSECT_ENTER(); { - DEL(module); + delete module; } SAFE_CRITSECT_LEAVE(); } diff --git a/Sources/Plasma/NucleusLib/pnIni/Private/pnIniCore.cpp b/Sources/Plasma/NucleusLib/pnIni/Private/pnIniCore.cpp index 769fab9f..ea3ab967 100644 --- a/Sources/Plasma/NucleusLib/pnIni/Private/pnIniCore.cpp +++ b/Sources/Plasma/NucleusLib/pnIni/Private/pnIniCore.cpp @@ -90,7 +90,7 @@ IniValue::~IniValue () { wchar_t ** cur = fArgs.Ptr(); wchar_t ** end = fArgs.Term(); for (; cur < end; ++cur) - FREE(*cur); + free(*cur); } //=========================================================================== @@ -124,7 +124,7 @@ IniKey::~IniKey () { IniValue ** cur = fValues.Ptr(); IniValue ** end = fValues.Term(); for (; cur < end; ++cur) - DEL(*cur); + delete *cur; } //=========================================================================== @@ -430,12 +430,12 @@ static bool ParseFile ( } } - FREE(src); + free(src); buffer = (uint8_t *) dst; } ParseBuffer(ini, (const wchar_t *) buffer); - FREE(buffer); + free(buffer); result = true; } @@ -464,7 +464,7 @@ Ini * IniOpen ( //=========================================================================== void IniClose (Ini * ini) { - DEL(ini); + delete ini; } //=========================================================================== diff --git a/Sources/Plasma/NucleusLib/pnIniExe/Private/Win32/pnW32IniChange.cpp b/Sources/Plasma/NucleusLib/pnIniExe/Private/Win32/pnW32IniChange.cpp index 6ab1a455..86871bca 100644 --- a/Sources/Plasma/NucleusLib/pnIniExe/Private/Win32/pnW32IniChange.cpp +++ b/Sources/Plasma/NucleusLib/pnIniExe/Private/Win32/pnW32IniChange.cpp @@ -366,7 +366,7 @@ void IniChangeRemove ( s_lock.LeaveWrite(); // Delete object outside critical section - DEL(change); + delete change; } //=========================================================================== diff --git a/Sources/Plasma/NucleusLib/pnIniExe/Private/pnIniSrv.cpp b/Sources/Plasma/NucleusLib/pnIniExe/Private/pnIniSrv.cpp index ef1fd932..09f7f332 100644 --- a/Sources/Plasma/NucleusLib/pnIniExe/Private/pnIniSrv.cpp +++ b/Sources/Plasma/NucleusLib/pnIniExe/Private/pnIniSrv.cpp @@ -114,7 +114,7 @@ static void IAddAddressBlock(ADDRESS_BLOCK_TABLE & addrList, NetAddressNode star if ( (addrBlock->startAddress & CLASS_C_SUBNET_MASK) != (addrBlock->endAddress & CLASS_C_SUBNET_MASK) ) { LogMsg(kLogDebug, L"IniSrv: Error creating privileged address block - start address and end address aren't from the same subnet."); - DEL(addrBlock); + delete addrBlock; } else { addrBlock->SetValue(startAddr & CLASS_C_SUBNET_MASK); diff --git a/Sources/Plasma/NucleusLib/pnMail/pnMail.cpp b/Sources/Plasma/NucleusLib/pnMail/pnMail.cpp index 7e587f90..1c6f4866 100644 --- a/Sources/Plasma/NucleusLib/pnMail/pnMail.cpp +++ b/Sources/Plasma/NucleusLib/pnMail/pnMail.cpp @@ -353,7 +353,7 @@ static void DestroyTransaction (MailTransaction * transaction) { ); } - DEL(transaction); + delete transaction; } //=========================================================================== @@ -448,7 +448,7 @@ static void __cdecl Send ( char * packed; const unsigned kStackBufSize = 8 * 1024; if (bytes > kStackBufSize) - packed = (char *) ALLOC(bytes); + packed = (char *) malloc(bytes); else packed = (char *) _alloca(bytes); @@ -467,7 +467,7 @@ static void __cdecl Send ( // Free the string if (bytes > kStackBufSize) - FREE(packed); + free(packed); } //=========================================================================== diff --git a/Sources/Plasma/NucleusLib/pnNetCli/pnNcChannel.cpp b/Sources/Plasma/NucleusLib/pnNetCli/pnNcChannel.cpp index 0ffde2eb..82236330 100644 --- a/Sources/Plasma/NucleusLib/pnNetCli/pnNcChannel.cpp +++ b/Sources/Plasma/NucleusLib/pnNetCli/pnNcChannel.cpp @@ -110,7 +110,7 @@ ChannelCrit::~ChannelCrit () { channel->DecRef("ChannelLink"); } - DEL(s_channels); + delete s_channels; s_channels = nil; } LeaveSafe(); diff --git a/Sources/Plasma/NucleusLib/pnNetCli/pnNcCli.cpp b/Sources/Plasma/NucleusLib/pnNetCli/pnNcCli.cpp index 1203cfd1..6b4bf263 100644 --- a/Sources/Plasma/NucleusLib/pnNetCli/pnNcCli.cpp +++ b/Sources/Plasma/NucleusLib/pnNetCli/pnNcCli.cpp @@ -195,7 +195,7 @@ static void PutBufferOnWire (NetCli * cli, void * data, unsigned bytes) { temp = ALLOCA(uint8_t, bytes); else // uint8_t count is large, use heap-based buffer - temp = heap = (uint8_t *)ALLOC(bytes); + temp = heap = (uint8_t *)malloc(bytes); MemCopy(temp, data, bytes); CryptEncrypt(cli->cryptOut, bytes, temp); @@ -205,7 +205,7 @@ static void PutBufferOnWire (NetCli * cli, void * data, unsigned bytes) { AsyncSocketSend(cli->sock, data, bytes); // free heap buffer (if any) - FREE(heap); + free(heap); } //============================================================================ @@ -227,10 +227,10 @@ static void AddToSendBuffer ( if (bytes > arrsize(cli->sendBuffer)) { // Let the OS fragment oversize buffers FlushSendBuffer(cli); - void * heap = ALLOC(bytes); + void * heap = malloc(bytes); MemCopy(heap, data, bytes); PutBufferOnWire(cli, heap, bytes); - FREE(heap); + free(heap); } else { for (;;) { @@ -1079,7 +1079,7 @@ void NetCliDelete ( cli->input.Clear(); cli->recvBuffer.Clear(); - DEL(cli); + delete cli; } //============================================================================ @@ -1120,7 +1120,7 @@ bool NetCliDispatch ( temp = ALLOCA(uint8_t, bytes); else // uint8_t count is large, use heap-based buffer - temp = heap = (uint8_t *)ALLOC(bytes); + temp = heap = (uint8_t *)malloc(bytes); MemCopy(temp, data, bytes); CryptDecrypt(cli->cryptIn, bytes, temp); @@ -1153,7 +1153,7 @@ bool NetCliDispatch ( #endif // free heap buffer (if any) - FREE(heap); + free(heap); cli->input.Compact(); return cli->recvDispatch; diff --git a/Sources/Plasma/NucleusLib/pnNetDiag/pnNdDns.cpp b/Sources/Plasma/NucleusLib/pnNetDiag/pnNdDns.cpp index 1aa55869..ff5a10f3 100644 --- a/Sources/Plasma/NucleusLib/pnNetDiag/pnNdDns.cpp +++ b/Sources/Plasma/NucleusLib/pnNetDiag/pnNdDns.cpp @@ -113,7 +113,7 @@ static void LookupCallback ( ); } p->diag->DecRef("DNS"); - DEL(p); + delete p; } @@ -190,5 +190,5 @@ void NetDiagDns ( 0, dnsParam ); - FREE(host); + free(host); } diff --git a/Sources/Plasma/NucleusLib/pnNetDiag/pnNdIcmp.cpp b/Sources/Plasma/NucleusLib/pnNetDiag/pnNdIcmp.cpp index 0d3eb406..4adf4bde 100644 --- a/Sources/Plasma/NucleusLib/pnNetDiag/pnNdIcmp.cpp +++ b/Sources/Plasma/NucleusLib/pnNetDiag/pnNdIcmp.cpp @@ -173,7 +173,7 @@ static void __cdecl PingThreadProc (void * param) { p->callback(p->diag, p->protocol, result, p->param); p->diag->DecRef("ICMP"); - DEL(p); + delete p; } diff --git a/Sources/Plasma/NucleusLib/pnNetDiag/pnNdTcp.cpp b/Sources/Plasma/NucleusLib/pnNetDiag/pnNdTcp.cpp index e8fd3bec..d078539f 100644 --- a/Sources/Plasma/NucleusLib/pnNetDiag/pnNdTcp.cpp +++ b/Sources/Plasma/NucleusLib/pnNetDiag/pnNdTcp.cpp @@ -167,7 +167,7 @@ static bool Recv_PingReply ( if (trans) { unsigned replyAtMs = TimeGetMs(); trans->conn->dump(L"[TCP] Reply from SrvAuth. ms=%u", replyAtMs - trans->pingAtMs); - DEL(trans); + delete trans; return true; } else { @@ -209,7 +209,7 @@ static unsigned TimerCallback (void *) { if (!curr->conn->error) curr->conn->error = error; curr->conn->dump(L"[TCP] No reply from SrvAuth: %u, %s (ms=%u)", error, NetErrorToString(error), diff); - DEL(curr); + delete curr; } }} {for (FileTrans * next, * curr = s_fileTrans.Head(); curr; curr = next) { @@ -219,7 +219,7 @@ static unsigned TimerCallback (void *) { if (!curr->conn->error) curr->conn->error = error; curr->conn->dump(L"[TCP] No reply from SrvFile: %u, %s (ms=%u)", error, NetErrorToString(error), diff); - DEL(curr); + delete curr; } }} } @@ -244,7 +244,7 @@ static void AuthPingProc (void * param) { for (;;) { if (conn->done) { conn->pingsCompleted = kMaxPings; - DEL(trans); + delete trans; break; } while (++s_transId == 0) @@ -352,7 +352,7 @@ static void NotifyAuthConnSocketDisconnect (AuthConn * conn) { while (AuthTrans * trans = authTrans.Head()) { conn->dump(L"[TCP] No reply from SrvAuth: %u, %s", conn->error, NetErrorToString(conn->error)); - DEL(trans); + delete trans; } conn->DecRef("Connected"); @@ -419,7 +419,7 @@ static bool Recv_File2Cli_ManifestReply (FileConn * conn, const File2Cli_Manifes if (trans) { unsigned replyAtMs = TimeGetMs(); trans->conn->dump(L"[TCP] Reply from SrvFile. ms=%u", replyAtMs - trans->pingAtMs); - DEL(trans); + delete trans; return true; } else { @@ -443,7 +443,7 @@ static void FilePingProc (void * param) { for (;;) { if (conn->done) { conn->pingsCompleted = kMaxPings; - DEL(trans); + delete trans; break; } while (++s_transId == 0) @@ -523,7 +523,7 @@ static void NotifyFileConnSocketDisconnect (FileConn * conn) { while (FileTrans * trans = fileTrans.Head()) { conn->dump(L"[TCP] No reply from SrvFile: %u, %s", conn->error, NetErrorToString(conn->error)); - DEL(trans); + delete trans; } conn->DecRef("Connected"); diff --git a/Sources/Plasma/NucleusLib/pnNetDiag/pnNetDiag.cpp b/Sources/Plasma/NucleusLib/pnNetDiag/pnNetDiag.cpp index 8f333258..14a77572 100644 --- a/Sources/Plasma/NucleusLib/pnNetDiag/pnNetDiag.cpp +++ b/Sources/Plasma/NucleusLib/pnNetDiag/pnNetDiag.cpp @@ -82,7 +82,7 @@ const wchar_t g_version[] = L"solvent"; NetDiag::~NetDiag () { for (unsigned srv = 0; srv < kNumDiagSrvs; ++srv) - FREE(hosts[srv]); + free(hosts[srv]); } //============================================================================ @@ -90,7 +90,7 @@ void NetDiag::SetHost (unsigned srv, const wchar_t host[]) { critsect.Enter(); { - FREE(hosts[srv]); + free(hosts[srv]); if (host) hosts[srv] = StrDup(host); diff --git a/Sources/Plasma/NucleusLib/pnNetDiag/pnNetSys.cpp b/Sources/Plasma/NucleusLib/pnNetDiag/pnNetSys.cpp index 8fa972aa..cc9a4fce 100644 --- a/Sources/Plasma/NucleusLib/pnNetDiag/pnNetSys.cpp +++ b/Sources/Plasma/NucleusLib/pnNetDiag/pnNetSys.cpp @@ -172,6 +172,6 @@ void NetDiagSys ( dump(L"[SYS] Error getting adaper list"); callback(diag, kNetProtocolNil, kNetErrFileNotFound, param); } - FREE(pInfo); + free(pInfo); } } diff --git a/Sources/Plasma/NucleusLib/pnNetLog/pnNlCli.cpp b/Sources/Plasma/NucleusLib/pnNetLog/pnNlCli.cpp index bfe37d16..d668c5a4 100644 --- a/Sources/Plasma/NucleusLib/pnNetLog/pnNlCli.cpp +++ b/Sources/Plasma/NucleusLib/pnNetLog/pnNlCli.cpp @@ -416,7 +416,7 @@ bool LogMsgTrans::OnTransReply ( AddEventNode(msgBuffer); } else { - FREE(msgBuffer); + free(msgBuffer); } return true; } diff --git a/Sources/Plasma/NucleusLib/pnNetProtocol/Private/pnNpCommon.cpp b/Sources/Plasma/NucleusLib/pnNetProtocol/Private/pnNpCommon.cpp index efe04d3b..af371b59 100644 --- a/Sources/Plasma/NucleusLib/pnNetProtocol/Private/pnNpCommon.cpp +++ b/Sources/Plasma/NucleusLib/pnNetProtocol/Private/pnNpCommon.cpp @@ -89,7 +89,7 @@ static inline void IReadArray (T ** buf, unsigned * elems, uint8_t ** buffer, un ASSERT(bytes % sizeof(T) == 0); *elems = bytes / sizeof(T); T * src = (T *)*buffer; - DEL(*buf); + delete *buf; *buf = (T *)ALLOC(bytes); MemCopy(*buf, src, bytes); *buffer += bytes; @@ -168,7 +168,7 @@ static inline void ICopyValue (T * plhs, const T & rhs) { //============================================================================ template static inline void ICopyString (T ** plhs, const T rhs[]) { - FREE(*plhs); + free(*plhs); if (rhs) *plhs = StrDup(rhs); else @@ -177,7 +177,7 @@ static inline void ICopyString (T ** plhs, const T rhs[]) { //============================================================================ static inline void ICopyString (wchar_t ** plhs, const wchar_t rhs[]) { - FREE(*plhs); + free(*plhs); if (rhs) *plhs = StrDup(rhs); else @@ -250,7 +250,7 @@ unsigned NetGameScore::Read(const uint8_t inbuffer[], unsigned bufsz, uint8_t** IReadString(&tempstr, &buffer, &bufsz); StrCopy(gameName, tempstr, arrsize(gameName)); - DEL(tempstr); + delete tempstr; if (end) *end = buffer; @@ -302,7 +302,7 @@ unsigned NetGameRank::Read(const uint8_t inbuffer[], unsigned bufsz, uint8_t** e IReadString(&tempstr, &buffer, &bufsz); StrCopy(name, tempstr, arrsize(name)); - DEL(tempstr); + delete tempstr; if (end) *end = buffer; @@ -341,7 +341,7 @@ static void DeallocNodeFields (NetVaultNode * node) { if (fieldFlag > node->fieldFlags) break; - #define DELFIELD(f, v) case (uint64_t)(NetVaultNode::f): DEL(node->v); node->v = nil; break + #define DELFIELD(f, v) case (uint64_t)(NetVaultNode::f): delete node->v; node->v = nil; break switch (fieldFlag & node->fieldFlags) { DELFIELD(kCreateAgeName, createAgeName); DELFIELD(kString64_1, string64_1); diff --git a/Sources/Plasma/NucleusLib/pnNetProtocol/Private/pnNpCommon.h b/Sources/Plasma/NucleusLib/pnNetProtocol/Private/pnNpCommon.h index bd4aa8fc..a1da7276 100644 --- a/Sources/Plasma/NucleusLib/pnNetProtocol/Private/pnNpCommon.h +++ b/Sources/Plasma/NucleusLib/pnNetProtocol/Private/pnNpCommon.h @@ -334,7 +334,7 @@ inline void IVaultNodeSetString ( const char src[], unsigned chars ) { - FREE(*pdst); + free(*pdst); if (src && src[0]) *pdst = StrDupLen(src, chars); else @@ -351,7 +351,7 @@ inline void IVaultNodeSetString ( const wchar_t src[], unsigned chars ) { - FREE(*pdst); + free(*pdst); if (src && src[0]) *pdst = StrDupLen(src, chars); else @@ -382,7 +382,7 @@ inline void IVaultNodeSetBlob ( const uint8_t src[], unsigned srcLen ) { - FREE(*pdst); + free(*pdst); if (src) { *pdst = (uint8_t*)MEMDUP(src, srcLen); *pdstLen = srcLen; @@ -495,4 +495,4 @@ public: private: const uint8_t * m_pos; const uint8_t * m_end; -}; \ No newline at end of file +}; diff --git a/Sources/Plasma/NucleusLib/pnOraLib/pnOraLib.cpp b/Sources/Plasma/NucleusLib/pnOraLib/pnOraLib.cpp index 21161972..a9eb58b0 100644 --- a/Sources/Plasma/NucleusLib/pnOraLib/pnOraLib.cpp +++ b/Sources/Plasma/NucleusLib/pnOraLib/pnOraLib.cpp @@ -260,7 +260,7 @@ void OraConnPool::Shutdown () { } critsect.Leave(); - DEL(data); + delete data; } //============================================================================ @@ -298,7 +298,7 @@ OraConn * OraConnPool::GetConn (const wchar_t tag[]) { for (;;) { if (!oraConn || !oraConn->occiConn) { - DEL(oraConn); + delete oraConn; oraConn = nil; LogMsg(kLogError, L"OraConnPool::GetConn: Failed to aquire a database connection"); break; @@ -331,7 +331,7 @@ void OraConnPool::FreeConn (OraConn *& oraConn) { LogMsg(kLogPerf, L"OraFreeConn: %u, %p, %s", connCount, oraConn, oraConn->tag); #endif - DEL(oraConn); + delete oraConn; try { occiConn->commit(); diff --git a/Sources/Plasma/NucleusLib/pnSimpleNet/pnSimpleNet.cpp b/Sources/Plasma/NucleusLib/pnSimpleNet/pnSimpleNet.cpp index bae79439..de13808b 100644 --- a/Sources/Plasma/NucleusLib/pnSimpleNet/pnSimpleNet.cpp +++ b/Sources/Plasma/NucleusLib/pnSimpleNet/pnSimpleNet.cpp @@ -135,7 +135,7 @@ static void NotifyConnSocketConnect (SimpleNetConn * conn) { kNetSuccess ); - DEL(conn->connectParam); + delete conn->connectParam; conn->connectParam = nil; } @@ -154,7 +154,7 @@ static void NotifyConnSocketConnectFailed (SimpleNetConn * conn) { kNetErrConnectFailed ); - DEL(conn->connectParam); + delete conn->connectParam; conn->connectParam = nil; conn->DecRef("Connecting"); @@ -401,8 +401,8 @@ static void Connect (const NetAddress & addr, ConnectParam * cp) { } s_critsect.Leave(); - DEL(conn); - DEL(cp); + delete conn; + delete cp; } //============================================================================ @@ -417,7 +417,7 @@ static void AsyncLookupCallback ( if (!addrCount) { if (cp->callback) cp->callback(cp->param, nil, kNetErrNameLookupFailed); - DEL(cp); + delete cp; return; } diff --git a/Sources/Plasma/NucleusLib/pnSqlLib/Private/pnSqlConn.cpp b/Sources/Plasma/NucleusLib/pnSqlLib/Private/pnSqlConn.cpp index bd7e8a40..2fe918bc 100644 --- a/Sources/Plasma/NucleusLib/pnSqlLib/Private/pnSqlConn.cpp +++ b/Sources/Plasma/NucleusLib/pnSqlLib/Private/pnSqlConn.cpp @@ -513,7 +513,7 @@ void SqlStmt::Reset () { } #endif // ORACLE_FREE_DRIVER - FREE(data); + free(data); data = nil; debug[0] = 0; } @@ -562,7 +562,7 @@ SqlConn::SqlConn ( SqlConn::~SqlConn () { ASSERT(!freeStmts.Head()); ASSERT(!stmts.Head()); - DEL(connectStr); + delete connectStr; SQLFreeHandle(SQL_HANDLE_ENV, henv); AsyncThreadTaskListDestroy(taskList, kNetErrRemoteShutdown); AtomicAdd(&s_perf[kSqlConnPerfConnDesired], - (long) desiredConns); @@ -598,7 +598,7 @@ bool SqlConn::GrowConnections_CS (unsigned attempts) { // If the connection failed then bail if (!result) { - DEL(stmt); + delete stmt; return false; } @@ -695,7 +695,7 @@ void SqlConn::CheckDead_CS () { // Deallocate the statement if it's bogus if (dead) { - DEL(stmt); + delete stmt; AsyncGrowConnections_CS(); } else { @@ -846,7 +846,7 @@ void SqlConnDestroy (SqlConn * conn) { break; } - DEL(conn); + delete conn; } //============================================================================ @@ -873,11 +873,11 @@ void SqlConnFreeStmt (SqlStmt * stmt) { conn->critsect.Enter(); { if (stmt->flags & kStmtFlagDelete) { - DEL(stmt); + delete stmt; conn->AsyncGrowConnections_CS(); } else if (dead) { - DEL(stmt); + delete stmt; conn->AsyncCheckDead_CS(); } else { diff --git a/Sources/Plasma/NucleusLib/pnUtils/Private/Win32/pnUtW32Sync.cpp b/Sources/Plasma/NucleusLib/pnUtils/Private/Win32/pnUtW32Sync.cpp index 0a59fac1..a6610717 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/Private/Win32/pnUtW32Sync.cpp +++ b/Sources/Plasma/NucleusLib/pnUtils/Private/Win32/pnUtW32Sync.cpp @@ -166,7 +166,7 @@ CLockWaitSetAllocator::CLockWaitSetAllocator (CLockWaitSetAllocator * prev) { //=========================================================================== CLockWaitSetAllocator::~CLockWaitSetAllocator () { - DEL(m_prev); + delete m_prev; } //=========================================================================== @@ -207,7 +207,7 @@ void CLockWaitSetAllocator::Shutdown () { // Free all allocators while (s_allocator) { CLockWaitSetAllocator * prev = s_allocator->m_prev; - DEL(s_allocator); + delete s_allocator; s_allocator = prev; } diff --git a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtCmd.cpp b/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtCmd.cpp index d250e04d..af502188 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtCmd.cpp +++ b/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtCmd.cpp @@ -78,7 +78,7 @@ struct CmdArgData { ~CmdArgData () { if (buffer) - FREE(buffer); + free(buffer); } }; @@ -218,7 +218,7 @@ void CICmdParser::Error (const CmdTokState * state, ECmdError errorCode, const w state->parser->OnError(buffer, errorCode, arg, value); // Free memory - FREE(buffer); + free(buffer); } @@ -350,7 +350,7 @@ bool CICmdParser::ProcessValue (CmdTokState * state, unsigned index, const wchar case kCmdTypeString: if (arg.buffer) - FREE(arg.buffer); + free(arg.buffer); arg.buffer = StrDup(str); arg.val.strVal = arg.buffer; break; @@ -539,7 +539,7 @@ CCmdParser::CCmdParser (const CmdArgDef def[], unsigned defCount) { //=========================================================================== CCmdParser::~CCmdParser () { - DEL(fParser); + delete fParser; } //=========================================================================== diff --git a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtCrypt.cpp b/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtCrypt.cpp index 99896d07..41936e3c 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtCrypt.cpp +++ b/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtCrypt.cpp @@ -254,8 +254,8 @@ void CryptKeyClose ( if (!key) return; - DEL(key->handle); - DEL(key); + delete key->handle; + delete key; } //============================================================================ diff --git a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtHash.h b/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtHash.h index c9e9145e..b2237185 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtHash.h +++ b/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtHash.h @@ -341,7 +341,7 @@ void TBaseHashTable::Clear () { //=========================================================================== template void TBaseHashTable::Delete (T * object) { - DEL(object); + delete object; } //=========================================================================== @@ -555,7 +555,7 @@ template T * THashTable::Unduplicate (T * object, const K & key) { T * existing = Find(key); if (existing) { - DEL(object); + delete object; return existing; } else { @@ -730,7 +730,7 @@ public: } void SetString (const C str[]) { // deprecated if (this->m_str) - FREE(const_cast(this->m_str)); + free(const_cast(this->m_str)); if (str) this->m_str = StrDup(str); else diff --git a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtList.h b/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtList.h index a416b2df..337585a8 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtList.h +++ b/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtList.h @@ -485,7 +485,7 @@ void TList::Clear () { //=========================================================================== template void TList::Delete (T * node) { - DEL(node); + delete node; } //=========================================================================== diff --git a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtPriQ.h b/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtPriQ.h index 2e7bd421..a6852ac4 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtPriQ.h +++ b/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtPriQ.h @@ -143,7 +143,7 @@ inline void TPriorityQueue::Clear () { // Deleting an object could cause other objects in the queue to be deleted // so we can't make any assumptions about indices or counts of items in the array while (C * head = Dequeue()) - DEL(head); + delete head; m_array.Clear(); } @@ -164,7 +164,7 @@ C * TPriorityQueue::Delete (C * object) { unsigned index = priority->GetIndex(); // delete the object - DEL(object); + delete object; // return the next object in that queue if (queue && (index < queue->Count())) diff --git a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtRef.h b/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtRef.h index d4f543db..2473c415 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtRef.h +++ b/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtRef.h @@ -168,7 +168,7 @@ public: } inline virtual void OnZeroRef () { - DEL(this); + delete this; } protected: diff --git a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtSkipList.h b/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtSkipList.h index e2968e6c..19bbc38c 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtSkipList.h +++ b/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtSkipList.h @@ -175,7 +175,7 @@ typename TSkipList::Node* TSkipList::Alloc template void TSkipList::FreeNode (TNode * node) { - FREE(node); + free(node); } //============================================================================ @@ -243,7 +243,7 @@ void TSkipList::Clear () { Node * ptr = m_head->next[0]; while (ptr != m_stop) { Node * next = ptr->next[0]; - DEL(ptr->object); + delete ptr->object; FreeNode(ptr); ptr = next; } @@ -259,7 +259,7 @@ template void TSkipList::Delete (T * object) { Unlink(object); - DEL(object); + delete object; } //============================================================================ diff --git a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtSpareList.cpp b/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtSpareList.cpp index 62408dc1..bf506e84 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtSpareList.cpp +++ b/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtSpareList.cpp @@ -159,7 +159,7 @@ void CBaseSpareList::CleanUp (const char typeName[]) { // walk chain of AllocNodes and free each of them while (m_allocHead) { AllocNode * allocNext = m_allocHead->allocNext; - FREE(m_allocHead); + free(m_allocHead); m_allocHead = allocNext; } diff --git a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtSubst.h b/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtSubst.h index f1985b12..0490e76c 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtSubst.h +++ b/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtSubst.h @@ -65,7 +65,7 @@ struct SubstParsedData { } ~SubstBlock() { - FREE(data); + free(data); } }; @@ -74,7 +74,7 @@ struct SubstParsedData { ~SubstParsedData() { for (unsigned i = 0; i < blocks.Count(); ++i) { SubstBlock * block = blocks[i]; - DEL(block); + delete block; } } }; diff --git a/Sources/Plasma/PubUtilLib/plAudioCore/plBufferedFileReader.cpp b/Sources/Plasma/PubUtilLib/plAudioCore/plBufferedFileReader.cpp index 99056781..af5205bb 100644 --- a/Sources/Plasma/PubUtilLib/plAudioCore/plBufferedFileReader.cpp +++ b/Sources/Plasma/PubUtilLib/plAudioCore/plBufferedFileReader.cpp @@ -115,7 +115,7 @@ void plBufferedFileReader::Close( void ) { //plProfile_DelMem( SndBufferedMem, fBufferSize ); - DEL(fBuffer);; + delete fBuffer; fBuffer = nil; fBufferSize = 0; fCursor = 0; diff --git a/Sources/Plasma/PubUtilLib/plAudioCore/plOGGCodec.cpp b/Sources/Plasma/PubUtilLib/plAudioCore/plOGGCodec.cpp index 3431a60f..5fb0cd21 100644 --- a/Sources/Plasma/PubUtilLib/plAudioCore/plOGGCodec.cpp +++ b/Sources/Plasma/PubUtilLib/plAudioCore/plOGGCodec.cpp @@ -82,7 +82,7 @@ void plOGGCodec::BuildActualWaveHeader() int factdata = 0; int size = fDataSize+48; // size of data with header except for first four bytes - fHeadBuf = (uint8_t *) ALLOC(56); + fHeadBuf = (uint8_t *)malloc(56); memcpy(fHeadBuf, "RIFF", 4); memcpy(fHeadBuf+4, &size, 4); memcpy(fHeadBuf+8, "WAVE", 4); @@ -189,12 +189,12 @@ plOGGCodec::~plOGGCodec() void plOGGCodec::Close( void ) { // plNetClientApp::StaticDebugMsg("Ogg Close, t=%f, start", hsTimer::GetSeconds()); - FREE(fHeadBuf); + free(fHeadBuf); fHeadBuf = nil; if( fOggFile != nil ) { ov_clear( fOggFile ); - DEL(fOggFile); + delete fOggFile; fOggFile = nil; } diff --git a/Sources/Plasma/PubUtilLib/plAvatar/plAvatarClothing.cpp b/Sources/Plasma/PubUtilLib/plAvatar/plAvatarClothing.cpp index 39715c0a..244d01f6 100644 --- a/Sources/Plasma/PubUtilLib/plAvatar/plAvatarClothing.cpp +++ b/Sources/Plasma/PubUtilLib/plAvatar/plAvatarClothing.cpp @@ -973,7 +973,7 @@ void plClothingOutfit::WriteToVault(const ARRAY(plStateDataRecord*) & SDRs) // Cleanup morph SDRs {for (unsigned i = 0; i < morphs.Count(); ++i) { - DEL(morphs[i]); + delete morphs[i]; }} rvn->DecRef(); @@ -1614,7 +1614,7 @@ void plClothingMgr::GetClosetItems(hsTArray &out) plStateDataRecord * rec = NEWZERO(plStateDataRecord); if (sdl.GetStateDataRecord(rec, 0)) plClothingSDLModifier::HandleSingleSDR(rec, nil, &out[i]); - DEL(rec); + delete rec; } if (out.GetCount()) { diff --git a/Sources/Plasma/PubUtilLib/plCompression/plZlibStream.cpp b/Sources/Plasma/PubUtilLib/plCompression/plZlibStream.cpp index b1735a5b..b88ec047 100644 --- a/Sources/Plasma/PubUtilLib/plCompression/plZlibStream.cpp +++ b/Sources/Plasma/PubUtilLib/plCompression/plZlibStream.cpp @@ -44,12 +44,12 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com voidpf ZlibAlloc(voidpf opaque, uInt items, uInt size) { - return ALLOC(items*size); + return malloc(items*size); } void ZlibFree(voidpf opaque, voidpf address) { - FREE(address); + free(address); } plZlibStream::plZlibStream() : fOutput(nil), fZStream(nil), fHeader(kNeedMoreData), fDecompressedOk(false) @@ -85,14 +85,14 @@ hsBool plZlibStream::Close() if (fOutput) { fOutput->Close(); - DEL(fOutput); + delete fOutput; fOutput = nil; } if (fZStream) { z_streamp zstream = (z_streamp)fZStream; inflateEnd(zstream); - DEL(zstream); + delete zstream; fZStream = nil; } diff --git a/Sources/Plasma/PubUtilLib/plFile/plFileUtils.cpp b/Sources/Plasma/PubUtilLib/plFile/plFileUtils.cpp index 0897bab2..55240ee3 100644 --- a/Sources/Plasma/PubUtilLib/plFile/plFileUtils.cpp +++ b/Sources/Plasma/PubUtilLib/plFile/plFileUtils.cpp @@ -542,14 +542,14 @@ bool plFileUtils::GetSecureEncryptionKey(const wchar_t* filename, uint32_t* key, file.Open(keyFile.c_str(), L"rb"); unsigned bytesToRead = length * sizeof(uint32_t); - uint8_t* buffer = (uint8_t*)ALLOC(bytesToRead); + uint8_t* buffer = (uint8_t*)malloc(bytesToRead); unsigned bytesRead = file.Read(bytesToRead, buffer); file.Close(); unsigned memSize = min(bytesToRead, bytesRead); memcpy(key, buffer, memSize); - FREE(buffer); + free(buffer); return true; } diff --git a/Sources/Plasma/PubUtilLib/plMessage/plConsoleMsg.h b/Sources/Plasma/PubUtilLib/plMessage/plConsoleMsg.h index 2b3d7203..d37cd606 100644 --- a/Sources/Plasma/PubUtilLib/plMessage/plConsoleMsg.h +++ b/Sources/Plasma/PubUtilLib/plMessage/plConsoleMsg.h @@ -70,7 +70,7 @@ public: plMessage(nil, nil, nil), fCmd( cmd ), fString(hsStrcpy(str)) { SetBCastFlag( kBCastByExactType ); } - ~plConsoleMsg() { FREE(fString); } + ~plConsoleMsg() { free(fString); } CLASSNAME_REGISTER( plConsoleMsg ); GETINTERFACE_ANY( plConsoleMsg, plMessage ); @@ -79,7 +79,7 @@ public: const char *GetString( void ) const { return fString; }; void SetCmd (uint32_t cmd) { fCmd = cmd; } - void SetString (const char str[]) { FREE(fString); fString = hsStrcpy(str); } + void SetString (const char str[]) { free(fString); fString = hsStrcpy(str); } virtual void Read(hsStream* s, hsResMgr* mgr) { diff --git a/Sources/Plasma/PubUtilLib/plNetClient/plNetCliAgeJoiner.cpp b/Sources/Plasma/PubUtilLib/plNetClient/plNetCliAgeJoiner.cpp index f5955522..18dbfafc 100644 --- a/Sources/Plasma/PubUtilLib/plNetClient/plNetCliAgeJoiner.cpp +++ b/Sources/Plasma/PubUtilLib/plNetClient/plNetCliAgeJoiner.cpp @@ -198,7 +198,7 @@ void plNCAgeJoiner::Complete (bool success, const char msg[]) { notify.msg = msg; callback(this, kAgeJoinerComplete, ¬ify, userState); - DEL(this); + delete this; } } diff --git a/Sources/Plasma/PubUtilLib/plNetClient/plNetCliAgeLeaver.cpp b/Sources/Plasma/PubUtilLib/plNetClient/plNetCliAgeLeaver.cpp index c52ce77a..c498cd83 100644 --- a/Sources/Plasma/PubUtilLib/plNetClient/plNetCliAgeLeaver.cpp +++ b/Sources/Plasma/PubUtilLib/plNetClient/plNetCliAgeLeaver.cpp @@ -139,7 +139,7 @@ void plNCAgeLeaver::Complete (bool success, const char msg[]) { notify.msg = msg; callback(this, kAgeLeaveComplete, ¬ify, userState); - DEL(this); + delete this; } } diff --git a/Sources/Plasma/PubUtilLib/plNetClient/plNetClientMgrSend.cpp b/Sources/Plasma/PubUtilLib/plNetClient/plNetClientMgrSend.cpp index 43edf393..d8ccaf07 100644 --- a/Sources/Plasma/PubUtilLib/plNetClient/plNetClientMgrSend.cpp +++ b/Sources/Plasma/PubUtilLib/plNetClient/plNetClientMgrSend.cpp @@ -172,7 +172,7 @@ void plNetClientMgr::ISendCCRPetition(plCCRPetitionMsg* petMsg) wchar_t * wStr = StrDupToUnicode(buf.c_str()); NetCliAuthSendCCRPetition(wStr); - FREE(wStr); + free(wStr); } // @@ -470,5 +470,5 @@ void plNetClientMgr::StoreSDLState(const plStateDataRecord* sdRec, const plUoid& } SendMsg(msg); - DEL(msg); + delete msg; } diff --git a/Sources/Plasma/PubUtilLib/plNetClient/plNetLinkingMgr.cpp b/Sources/Plasma/PubUtilLib/plNetClient/plNetLinkingMgr.cpp index 6bb680c9..9daa5c15 100644 --- a/Sources/Plasma/PubUtilLib/plNetClient/plNetLinkingMgr.cpp +++ b/Sources/Plasma/PubUtilLib/plNetClient/plNetLinkingMgr.cpp @@ -116,7 +116,7 @@ struct NlmLeaveAgeOp : NlmOp { struct NlmOpNode { LINK(NlmOpNode) link; NlmOp * op; - ~NlmOpNode () { DEL(op); } + ~NlmOpNode () { delete op; } }; @@ -173,7 +173,7 @@ void plNetLinkingMgr::NCAgeJoinerCallback ( // Pull our wait op off exec queue if (NlmOpWaitOp * waitOp = (NlmOpWaitOp *) userState) - DEL(waitOp->node); + delete waitOp->node; } break; @@ -195,7 +195,7 @@ void plNetLinkingMgr::NCAgeLeaverCallback ( // Pull our wait op off exec queue if (NlmOpWaitOp * waitOp = (NlmOpWaitOp *) userState) - DEL(waitOp->node); + delete waitOp->node; } break; @@ -260,7 +260,7 @@ void plNetLinkingMgr::ExecNextOp () { break; } - DEL(opNode); + delete opNode; } diff --git a/Sources/Plasma/PubUtilLib/plNetClientComm/plNetClientComm.cpp b/Sources/Plasma/PubUtilLib/plNetClientComm/plNetClientComm.cpp index f5662b5b..03aaf49b 100644 --- a/Sources/Plasma/PubUtilLib/plNetClientComm/plNetClientComm.cpp +++ b/Sources/Plasma/PubUtilLib/plNetClientComm/plNetClientComm.cpp @@ -551,7 +551,7 @@ static void INetCliAuthGetPublicAgeListCallback ( msg->ages.Set(ages.Ptr(), ages.Count()); msg->Send(); - DEL(cp); + delete cp; } //============================================================================ @@ -1180,7 +1180,7 @@ void NetCommRemoveMsgHandler ( continue; // We found a matching handler, delete it - DEL(handler); + delete handler; } } diff --git a/Sources/Plasma/PubUtilLib/plNetGameLib/Private/plNglAuth.cpp b/Sources/Plasma/PubUtilLib/plNetGameLib/Private/plNglAuth.cpp index 1806c19c..21a7fafd 100644 --- a/Sources/Plasma/PubUtilLib/plNetGameLib/Private/plNglAuth.cpp +++ b/Sources/Plasma/PubUtilLib/plNetGameLib/Private/plNglAuth.cpp @@ -3634,7 +3634,7 @@ bool FileDownloadRequestTrans::Recv ( writeTrans->writer = m_writer; writeTrans->bytes = reply.chunkSize; writeTrans->offset = reply.chunkOffset; - writeTrans->data = (uint8_t *)ALLOC(reply.chunkSize); + writeTrans->data = (uint8_t *)malloc(reply.chunkSize); MemCopy(writeTrans->data, reply.chunkData, reply.chunkSize); NetTransSend(writeTrans); } @@ -3664,7 +3664,7 @@ bool FileDownloadRequestTrans::Recv ( //============================================================================ RcvdFileDownloadChunkTrans::~RcvdFileDownloadChunkTrans () { - FREE(data); + free(data); } //============================================================================ @@ -3687,7 +3687,7 @@ void RcvdFileDownloadChunkTrans::Post () { //============================================================================ RcvdPropagatedBufferTrans::~RcvdPropagatedBufferTrans () { - FREE(bufferData); + free(bufferData); } //============================================================================ @@ -3845,10 +3845,10 @@ VaultInitAgeTrans::VaultInitAgeTrans ( //============================================================================ VaultInitAgeTrans::~VaultInitAgeTrans () { - FREE(m_ageFilename); - FREE(m_ageInstName); - FREE(m_ageUserName); - FREE(m_ageDesc); + free(m_ageFilename); + free(m_ageInstName); + free(m_ageUserName); + free(m_ageDesc); } //============================================================================ diff --git a/Sources/Plasma/PubUtilLib/plNetGameLib/Private/plNglCsr.cpp b/Sources/Plasma/PubUtilLib/plNetGameLib/Private/plNglCsr.cpp index f2a0064e..4d0e28ec 100644 --- a/Sources/Plasma/PubUtilLib/plNetGameLib/Private/plNglCsr.cpp +++ b/Sources/Plasma/PubUtilLib/plNetGameLib/Private/plNglCsr.cpp @@ -108,7 +108,7 @@ struct ConnectedNotifyTrans : NetNotifyTrans { , m_latestBuildId(lbi) { } ~ConnectedNotifyTrans () { - DEL(m_connectParam); + delete m_connectParam; } void Post (); }; @@ -543,7 +543,7 @@ CliCsConn::~CliCsConn () { if (cli) NetCliDelete(cli, true); - DEL(connectParam); + delete connectParam; AtomicAdd(&s_perf[kPerfConnCount], -1); } diff --git a/Sources/Plasma/PubUtilLib/plNetGameLib/Private/plNglFile.cpp b/Sources/Plasma/PubUtilLib/plNetGameLib/Private/plNglFile.cpp index 59ffc4e3..e8d00ff0 100644 --- a/Sources/Plasma/PubUtilLib/plNetGameLib/Private/plNglFile.cpp +++ b/Sources/Plasma/PubUtilLib/plNetGameLib/Private/plNglFile.cpp @@ -1195,7 +1195,7 @@ bool DownloadRequestTrans::Recv ( RcvdFileDownloadChunkTrans * writeTrans = NEW(RcvdFileDownloadChunkTrans); writeTrans->writer = m_writer; writeTrans->bytes = byteCount; - writeTrans->data = (uint8_t *)ALLOC(byteCount); + writeTrans->data = (uint8_t *)malloc(byteCount); MemCopy(writeTrans->data, data, byteCount); NetTransSend(writeTrans); } @@ -1217,7 +1217,7 @@ bool DownloadRequestTrans::Recv ( //============================================================================ RcvdFileDownloadChunkTrans::~RcvdFileDownloadChunkTrans () { - FREE(data); + free(data); } //============================================================================ diff --git a/Sources/Plasma/PubUtilLib/plNetGameLib/Private/plNglGame.cpp b/Sources/Plasma/PubUtilLib/plNetGameLib/Private/plNglGame.cpp index baa81fe5..f5e223df 100644 --- a/Sources/Plasma/PubUtilLib/plNetGameLib/Private/plNglGame.cpp +++ b/Sources/Plasma/PubUtilLib/plNetGameLib/Private/plNglGame.cpp @@ -456,7 +456,7 @@ static bool Recv_PropagateBuffer ( RcvdPropagatedBufferTrans * trans = NEW(RcvdPropagatedBufferTrans); trans->bufferType = reply.type; trans->bufferBytes = reply.bytes; - trans->bufferData = (uint8_t *)ALLOC(reply.bytes); + trans->bufferData = (uint8_t *)malloc(reply.bytes); MemCopy(trans->bufferData, reply.buffer, reply.bytes); NetTransSend(trans); @@ -473,7 +473,7 @@ static bool Recv_GameMgrMsg ( RcvdGameMgrMsgTrans * trans = NEW(RcvdGameMgrMsgTrans); trans->bufferBytes = reply.bytes; - trans->bufferData = (uint8_t *)ALLOC(reply.bytes); + trans->bufferData = (uint8_t *)malloc(reply.bytes); MemCopy(trans->bufferData, reply.buffer, reply.bytes); NetTransSend(trans); @@ -570,7 +570,7 @@ bool JoinAgeRequestTrans::Recv ( //============================================================================ RcvdPropagatedBufferTrans::~RcvdPropagatedBufferTrans () { - FREE(bufferData); + free(bufferData); } //============================================================================ @@ -587,7 +587,7 @@ void RcvdPropagatedBufferTrans::Post () { //============================================================================ RcvdGameMgrMsgTrans::~RcvdGameMgrMsgTrans () { - FREE(bufferData); + free(bufferData); } //============================================================================ diff --git a/Sources/Plasma/PubUtilLib/plPhysX/plSimulationMgr.cpp b/Sources/Plasma/PubUtilLib/plPhysX/plSimulationMgr.cpp index d6691e3d..4a0b012b 100644 --- a/Sources/Plasma/PubUtilLib/plPhysX/plSimulationMgr.cpp +++ b/Sources/Plasma/PubUtilLib/plPhysX/plSimulationMgr.cpp @@ -297,16 +297,16 @@ class ErrorStream : public NxUserOutputStream static class HeapAllocator : public NxUserAllocator { public: void * malloc (NxU32 size) { - return ALLOC(size); + return malloc(size); } void * mallocDEBUG (NxU32 size, const char * fileName, int line) { return MemAlloc(size, 0, fileName, line); } void * realloc (void * memory, NxU32 size) { - return REALLOC(memory, size); + return realloc(memory, size); } void free (void * memory) { - FREE(memory); + free(memory); } } gHeapAllocator; @@ -380,7 +380,7 @@ void plSimulationMgr::Init() { // There was an error when creating the PhysX simulation // ...then get rid of the simulation instance - DEL(gTheInstance); // clean up the memory we allocated + delete gTheInstance; // clean up the memory we allocated gTheInstance = nil; } } diff --git a/Sources/Plasma/PubUtilLib/plStatusLog/plStatusLog.cpp b/Sources/Plasma/PubUtilLib/plStatusLog/plStatusLog.cpp index 9059b06d..34f0558c 100644 --- a/Sources/Plasma/PubUtilLib/plStatusLog/plStatusLog.cpp +++ b/Sources/Plasma/PubUtilLib/plStatusLog/plStatusLog.cpp @@ -119,7 +119,7 @@ plStatusLogMgr::~plStatusLogMgr() fDisplays->IUnlink(); if( log->fFlags & plStatusLog::kDeleteForMe ) - DEL(log); + delete log; } } diff --git a/Sources/Plasma/PubUtilLib/plVault/plVaultClientApi.cpp b/Sources/Plasma/PubUtilLib/plVault/plVaultClientApi.cpp index 2fffcae1..01cc74d1 100644 --- a/Sources/Plasma/PubUtilLib/plVault/plVaultClientApi.cpp +++ b/Sources/Plasma/PubUtilLib/plVault/plVaultClientApi.cpp @@ -308,7 +308,7 @@ static void VaultNodeAddedDownloadCallback(ENetError result, void * param) { } } - DEL(notify); + delete notify; } } @@ -796,7 +796,7 @@ void VaultCreateNodeTrans::Complete (ENetError result) { node ); - DEL(this); + delete this; } @@ -821,7 +821,7 @@ void VaultFindNodeTrans::VaultNodeFound ( nodeIdCount, nodeIds ); - DEL(trans); + delete trans; } @@ -870,7 +870,7 @@ void VaultDownloadTrans::VaultNodeFetched ( trans->cbParam ); - DEL(trans); + delete trans; } } @@ -921,7 +921,7 @@ void VaultDownloadTrans::VaultNodeRefsFetched ( trans->cbParam ); - DEL(trans); + delete trans; } } @@ -950,7 +950,7 @@ void VaultAgeInitTrans::AgeInitCallback ( ageInfoVaultId ); - DEL(trans); + delete trans; } @@ -992,7 +992,7 @@ void AddChildNodeFetchTrans::VaultNodeRefsFetched ( trans->result, trans->cbParam ); - DEL(trans); + delete trans; } } @@ -1016,7 +1016,7 @@ void AddChildNodeFetchTrans::VaultNodeFetched ( trans->result, trans->cbParam ); - DEL(trans); + delete trans; } } @@ -1072,14 +1072,14 @@ void IRelVaultNode::Unlink (RelVaultNode * other) { link->link.Unlink(); // remove us from other's tables. link->node->state->Unlink(node); - DEL(link); + delete link; } if (nil != (link = children.Find(other->nodeId))) { // make them non-findable in our children table link->link.Unlink(); // remove us from other's tables. link->node->state->Unlink(node); - DEL(link); + delete link; } } @@ -1096,7 +1096,7 @@ RelVaultNode::RelVaultNode () { //============================================================================ RelVaultNode::~RelVaultNode () { - DEL(state); + delete state; } //============================================================================ @@ -1474,7 +1474,7 @@ void VaultRegisterCallback (VaultCallback * cb) { //============================================================================ void VaultUnregisterCallback (VaultCallback * cb) { ASSERT(cb->internal); - DEL(cb->internal); + delete cb->internal; cb->internal = nil; } @@ -1510,7 +1510,7 @@ void VaultDestroy () { for (; link; link = next) { next = s_nodes.Next(link); link->node->state->UnlinkFromRelatives(); - DEL(link); + delete link; } } @@ -2809,7 +2809,7 @@ namespace _VaultRegisterOwnedAge { void* fAgeInfoId; ~_Params() { - DEL(fSpawn); + delete fSpawn; } }; @@ -2831,7 +2831,7 @@ namespace _VaultRegisterOwnedAge { void _CreateAgeLinkNode(ENetError result, void* state, void* param, RelVaultNode* node) { if (IS_NET_ERROR(result)) { LogMsg(kLogError, "VaultRegisterOwnedAge: Failed to create AgeLink (async)"); - DEL(param); + delete param; return; } @@ -2868,13 +2868,13 @@ namespace _VaultRegisterOwnedAge { // Don't leak memory agesIOwn->DecRef(); plyrInfo->DecRef(); - DEL(p); + delete p; } void _DownloadCallback(ENetError result, void* param) { if (IS_NET_ERROR(result)) { LogMsg(kLogError, "VaultRegisterOwnedAge: Failed to download age vault (async)"); - DEL(param); + delete param; } else VaultCreateNode(plVault::kNodeType_AgeLink, (FVaultCreateNodeCallback)_CreateAgeLinkNode, nil, param); } @@ -3183,14 +3183,14 @@ namespace _VaultRegisterVisitAge { void* fAgeInfoId; ~_Params() { - DEL(fSpawn); + delete fSpawn; } }; void _CreateAgeLinkNode(ENetError result, void* state, void* param, RelVaultNode* node) { if (IS_NET_ERROR(result)) { LogMsg(kLogError, "RegisterVisitAge: Failed to create AgeLink (async)"); - DEL(param); + delete param; return; } @@ -3225,13 +3225,13 @@ namespace _VaultRegisterVisitAge { msg->Send(); //Don't leak memory - DEL(param); + delete param; } void _DownloadCallback(ENetError result, void* param) { if (IS_NET_ERROR(result)) { LogMsg(kLogError, "RegisterVisitAge: Failed to download age vault (async)"); - DEL(param); + delete param; return; } @@ -3242,7 +3242,7 @@ namespace _VaultRegisterVisitAge { void _InitAgeCallback(ENetError result, void* state, void* param, uint32_t ageVaultId, uint32_t ageInfoId) { if (IS_NET_ERROR(result)) { LogMsg(kLogError, "RegisterVisitAge: Failed to init age vault (async)"); - DEL(param); + delete param; return; } @@ -3607,7 +3607,7 @@ bool VaultAmOwnerOfCurrentAge () { plAgeInfoStruct info; info.SetAgeFilename(ageFilename); - FREE(ageFilename); + free(ageFilename); if (RelVaultNode * rvnLink = VaultGetOwnedAgeLinkIncRef(&info)) { @@ -3979,7 +3979,7 @@ void VaultAgeRemoveDevice (const wchar_t deviceName[]) { device->DecRef(); if (DeviceInbox * deviceInbox = s_ageDeviceInboxes.Find(CHashKeyStr(deviceName))) - DEL(device); + delete device; } templateNode->DecRef(); folder->DecRef(); @@ -4098,7 +4098,7 @@ RelVaultNode * VaultAgeGetDeviceInboxIncRef (const wchar_t deviceName[]) { //============================================================================ void VaultClearDeviceInboxMap () { while (DeviceInbox * inbox = s_ageDeviceInboxes.Head()) { - DEL(inbox); + delete inbox; } } @@ -4782,7 +4782,7 @@ namespace _VaultCreateChildAge { void _CreateNodeCallback(ENetError result, void* state, void* param, RelVaultNode* node) { if (IS_NET_ERROR(result)) { LogMsg(kLogError, "CreateChildAge: Failed to create AgeLink (async)"); - DEL(param); + delete param; return; } @@ -4799,13 +4799,13 @@ namespace _VaultCreateChildAge { msg->GetArgs()->AddInt(plNetCommon::VaultTaskArgs::kAgeLinkNode, node->nodeId); msg->Send(); - DEL(param); + delete param; } void _DownloadCallback(ENetError result, void* param) { if (IS_NET_ERROR(result)) { LogMsg(kLogError, "CreateChildAge: Failed to download age vault (async)"); - DEL(param); + delete param; return; } @@ -4820,7 +4820,7 @@ namespace _VaultCreateChildAge { void _InitAgeCallback(ENetError result, void* state, void* param, uint32_t ageVaultId, uint32_t ageInfoId) { if (IS_NET_ERROR(result)) { LogMsg(kLogError, "CreateChildAge: Failed to init age (async)"); - DEL(param); + delete param; return; } @@ -4999,7 +4999,7 @@ void VaultCull (unsigned vaultId) { if (RelVaultNodeLink * link = s_nodes.Find(vaultId)) { LogMsg(kLogDebug, L"Vault: Culling node %u", link->node->nodeId); link->node->state->UnlinkFromRelatives(); - DEL(link); + delete link; } // Remove all orphaned nodes from the global table @@ -5022,7 +5022,7 @@ void VaultCull (unsigned vaultId) { if (!foundRoot) { LogMsg(kLogDebug, L"Vault: Culling node %u", link->node->nodeId); link->node->state->UnlinkFromRelatives(); - DEL(link); + delete link; } } } diff --git a/Sources/Plasma/PubUtilLib/plVault/plVaultNodeAccess.cpp b/Sources/Plasma/PubUtilLib/plVault/plVaultNodeAccess.cpp index d99e3280..99ce12b3 100644 --- a/Sources/Plasma/PubUtilLib/plVault/plVaultNodeAccess.cpp +++ b/Sources/Plasma/PubUtilLib/plVault/plVaultNodeAccess.cpp @@ -491,7 +491,7 @@ bool VaultTextNoteNode::GetVisitInfo (plAgeInfoStruct * info) { } } - FREE(mem); + free(mem); return true; } #endif @@ -539,7 +539,7 @@ bool VaultSDLNode::GetStateDataRecord (plStateDataRecord * rec, unsigned readOpt return false; rec->SetDescriptor(sdlRecName, sdlRecVersion); - FREE(sdlRecName); + free(sdlRecName); // Note: Setting from default here results in a bug causing age SDL to // be incorrectly shown when immediately linking back to an age you linked @@ -576,7 +576,7 @@ void VaultSDLNode::SetStateDataRecord (const plStateDataRecord * rec, unsigned w IVaultNodeSetBlob(kSDLData, base, &sdlData, &sdlDataLen, buf, bytes); - FREE(heap); + free(heap); } #endif // def CLIENT @@ -586,7 +586,7 @@ void VaultSDLNode::InitStateDataRecord (const wchar_t sdlRecName[], unsigned wri { plStateDataRecord * rec = NEWZERO(plStateDataRecord); bool exists = GetStateDataRecord(rec, 0); - DEL(rec); + delete rec; if (exists) return; } @@ -640,11 +640,11 @@ void VaultImageNode::StuffImage (plMipmap * src) { plJPEG::Instance().SetWriteQuality(30/*percent*/); if (plJPEG::Instance().WriteToStream(&ramStream, src)) { unsigned bytes = ramStream.GetEOF(); - uint8_t * buffer = (uint8_t *)ALLOC(bytes); + uint8_t * buffer = (uint8_t *)malloc(bytes); ramStream.CopyToMem(buffer); IVaultNodeSetBlob(kImageData, base, &imgData, &imgDataLen, buffer, bytes); SetImageType(kJPEG); - FREE(buffer); + free(buffer); } else { IVaultNodeSetBlob(kImageData, base, &imgData, &imgDataLen, nil, 0);