diff --git a/Sources/Plasma/CoreLib/HeadSpin.h b/Sources/Plasma/CoreLib/HeadSpin.h index 201075d8..513d153f 100644 --- a/Sources/Plasma/CoreLib/HeadSpin.h +++ b/Sources/Plasma/CoreLib/HeadSpin.h @@ -212,27 +212,6 @@ inline double hsSwapEndianDouble(double dvalue) #define hsToLEDouble(n) hsSwapEndianDouble(n) #endif -inline void hsSwap(int32_t& a, int32_t& b) -{ - int32_t c = a; - a = b; - b = c; -} - -inline void hsSwap(uint32_t& a, uint32_t& b) -{ - uint32_t c = a; - a = b; - b = c; -} - -inline void hsSwap(float& a, float& b) -{ - float c = a; - a = b; - b = c; -} - //=========================================================================== // Define a NOOP (null) statement //=========================================================================== @@ -242,21 +221,6 @@ inline void hsSwap(float& a, float& b) # define NULL_STMT ((void)0) #endif -/**************************************************************************** -* -* SWAP -* Swaps the values of two variables -* -***/ - -//=========================================================================== -template -void SWAP (T & a, T & b) { - T temp = a; - a = b; - b = temp; -} - /**************************************************************************** * diff --git a/Sources/Plasma/NucleusLib/pnUtils/pnUtSort.h b/Sources/Plasma/NucleusLib/pnUtils/pnUtSort.h index dd20e76c..4f639670 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/pnUtSort.h +++ b/Sources/Plasma/NucleusLib/pnUtils/pnUtSort.h @@ -97,7 +97,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com T * mid = lo + (hi - lo) / 2; \ \ /* Swap it to the beginning of the array */ \ - SWAP(*mid, *lo); \ + std::swap(*mid, *lo); \ \ /* Partition the array into three pieces, one consisting of */ \ /* elements <= the partitioning element, one of elements */ \ @@ -134,7 +134,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com /* val(loPart) > val(lo) */ \ /* val(hiPart) < val(lo) */ \ \ - SWAP(*loPart, *hiPart); \ + std::swap(*loPart, *hiPart); \ \ /* val(loPart) < val(lo) */ \ /* val(hiPart) > val(lo) */ \ @@ -145,7 +145,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com /* val(i) >= val(lo) for loPart <= i <= hi */ \ \ /* Put the partitioning element in place */ \ - SWAP(*lo, *hiPart); \ + std::swap(*lo, *hiPart); \ \ /* val(i) <= val(hiPart) for lo <= i < hiPart */ \ /* val(i) == val(lo) for hiPart <= i < loPart */ \ diff --git a/Sources/Plasma/PubUtilLib/plNetGameLib/Private/plNglFile.cpp b/Sources/Plasma/PubUtilLib/plNetGameLib/Private/plNglFile.cpp index cff25405..276c98a7 100644 --- a/Sources/Plasma/PubUtilLib/plNetGameLib/Private/plNglFile.cpp +++ b/Sources/Plasma/PubUtilLib/plNetGameLib/Private/plNglFile.cpp @@ -760,7 +760,7 @@ void CliFileConn::Destroy () { { hsLockForWriting lock(sockLock); - SWAP(oldSock, sock); + std::swap(oldSock, sock); } if (oldSock) diff --git a/Sources/Plasma/PubUtilLib/plNetGameLib/Private/plNglGame.cpp b/Sources/Plasma/PubUtilLib/plNetGameLib/Private/plNglGame.cpp index 6ecf1dfc..d24a1f80 100644 --- a/Sources/Plasma/PubUtilLib/plNetGameLib/Private/plNglGame.cpp +++ b/Sources/Plasma/PubUtilLib/plNetGameLib/Private/plNglGame.cpp @@ -218,7 +218,7 @@ static bool ConnEncrypt (ENetError error, void * param) { if (IS_NET_SUCCESS(error)) { s_critsect.Enter(); { - SWAP(s_active, conn); + std::swap(s_active, conn); } s_critsect.Leave(); } diff --git a/Sources/Plasma/PubUtilLib/plNetGameLib/Private/plNglGateKeeper.cpp b/Sources/Plasma/PubUtilLib/plNetGameLib/Private/plNglGateKeeper.cpp index 3d5673c3..4264c46e 100644 --- a/Sources/Plasma/PubUtilLib/plNetGameLib/Private/plNglGateKeeper.cpp +++ b/Sources/Plasma/PubUtilLib/plNetGameLib/Private/plNglGateKeeper.cpp @@ -267,7 +267,7 @@ static bool ConnEncrypt (ENetError error, void * param) { s_critsect.Enter(); { - SWAP(s_active, conn); + std::swap(s_active, conn); } s_critsect.Leave();