mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-02-06 08:59:11 +01:00
Core/Misc: Use ASSERT (custom, better macro) instead of the C macro assert()
This commit is contained in:
@@ -20,7 +20,7 @@
|
||||
#define _REFERENCE_H
|
||||
|
||||
#include "Dynamic/LinkedList.h"
|
||||
#include <assert.h>
|
||||
#include "Errors.h" // for ASSERT
|
||||
|
||||
//=====================================================
|
||||
|
||||
@@ -45,7 +45,7 @@ template <class TO, class FROM> class Reference : public LinkedListElement
|
||||
// Create new link
|
||||
void link(TO* toObj, FROM* fromObj)
|
||||
{
|
||||
assert(fromObj); // fromObj MUST not be NULL
|
||||
ASSERT(fromObj); // fromObj MUST not be NULL
|
||||
if (isValid())
|
||||
unlink();
|
||||
if (toObj != NULL)
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
#include "Common.h"
|
||||
#include "utf8.h"
|
||||
#include "SFMT.h"
|
||||
#include "Errors.h" // for ASSERT
|
||||
#include <ace/TSS_T.h>
|
||||
#include <ace/INET_Addr.h>
|
||||
|
||||
@@ -28,19 +29,19 @@ static SFMTRandTSS sfmtRand;
|
||||
|
||||
int32 irand(int32 min, int32 max)
|
||||
{
|
||||
assert(max >= min);
|
||||
ASSERT(max >= min);
|
||||
return int32(sfmtRand->IRandom(min, max));
|
||||
}
|
||||
|
||||
uint32 urand(uint32 min, uint32 max)
|
||||
{
|
||||
assert(max >= min);
|
||||
ASSERT(max >= min);
|
||||
return sfmtRand->URandom(min, max);
|
||||
}
|
||||
|
||||
float frand(float min, float max)
|
||||
{
|
||||
assert(max >= min);
|
||||
ASSERT(max >= min);
|
||||
return float(sfmtRand->Random() * (max - min) + min);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user