[10432] Rename ASSERT -> MANGOS_ASSERT and related fixes

ASSERT hard use in predictable way because diff. 3rd party libs code
redefine it inf different ways and hard make sure that used in end
of mangos define version. This is real detected problem make some
expected assert checks ignored and so bugs not detected as expected from code.

In addition made related changes:
* Common.h header expected to be first include in any src/game/header except most simple cases.
* Related FILE.h header expected to be first include in FILE.cpp
* Fixed some absent includes and type forwards for safe build without PCH enabled.
* Avoid using MANGOS_ASSERT in src/framework code
This commit is contained in:
VladimirMangos 2010-09-02 04:18:55 +04:00
parent 32e3e252fb
commit acd0716297
77 changed files with 309 additions and 260 deletions

View file

@ -26,6 +26,8 @@
#include "GameSystem/GridReference.h"
#include "Timer.h"
#include <cassert>
class GridInfo
{
public:
@ -96,15 +98,15 @@ class MANGOS_DLL_DECL NGrid
const GridType& operator()(uint32 x, uint32 y) const
{
ASSERT(x < N);
ASSERT(y < N);
assert(x < N);
assert(y < N);
return i_cells[x][y];
}
GridType& operator()(uint32 x, uint32 y)
{
ASSERT(x < N);
ASSERT(y < N);
assert(x < N);
assert(y < N);
return i_cells[x][y];
}
@ -185,8 +187,8 @@ class MANGOS_DLL_DECL NGrid
GridType& getGridType(const uint32& x, const uint32& y)
{
ASSERT(x < N);
ASSERT(y < N);
assert(x < N);
assert(y < N);
return i_cells[x][y];
}

View file

@ -24,6 +24,7 @@
* types of object at the same time.
*/
#include <cassert>
#include <map>
#include <vector>
#include "Platform/Define.h"
@ -89,7 +90,7 @@ class TypeUnorderedMapContainer
}
else
{
ASSERT(i->second == obj && "Object with certain key already in but objects are different!");
assert(i->second == obj && "Object with certain key already in but objects are different!");
return false;
}
}

View file

@ -54,7 +54,7 @@ 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();