[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

@ -16,10 +16,10 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "WaypointManager.h"
#include "Database/DatabaseEnv.h"
#include "GridDefines.h"
#include "Policies/SingletonImp.h"
#include "WaypointManager.h"
#include "ProgressBar.h"
#include "MapManager.h"
#include "ObjectMgr.h"
@ -125,7 +125,7 @@ void WaypointManager::Load()
WaypointPath &path = m_pathMap[id];
// the cleanup queries make sure the following is true
ASSERT(point >= 1 && point <= path.size());
MANGOS_ASSERT(point >= 1 && point <= path.size());
WaypointNode &node = path[point-1];
@ -298,7 +298,7 @@ void WaypointManager::Load()
WaypointPath &path = m_pathTemplateMap[entry];
// the cleanup queries make sure the following is true
ASSERT(point >= 1 && point <= path.size());
MANGOS_ASSERT(point >= 1 && point <= path.size());
WaypointNode &node = path[point-1];
@ -408,7 +408,7 @@ void WaypointManager::Cleanup()
sLog.outErrorDb("Table `creature_movement` was auto corrected for using points out of order (invalid or points missing)");
ASSERT(!(result = WorldDatabase.Query("SELECT 1 from creature_movement As T WHERE point <> (SELECT COUNT(*) FROM creature_movement WHERE id = T.id AND point <= T.point) LIMIT 1")));
MANGOS_ASSERT(!(result = WorldDatabase.Query("SELECT 1 from creature_movement As T WHERE point <> (SELECT COUNT(*) FROM creature_movement WHERE id = T.id AND point <= T.point) LIMIT 1")));
}
if (QueryResult *result = WorldDatabase.Query("SELECT 1 from creature_movement_template As T WHERE point <> (SELECT COUNT(*) FROM creature_movement_template WHERE entry = T.entry AND point <= T.point) LIMIT 1"))
@ -423,7 +423,7 @@ void WaypointManager::Cleanup()
sLog.outErrorDb("Table `creature_movement_template` was auto corrected for using points out of order (invalid or points missing)");
ASSERT(!(result = WorldDatabase.Query("SELECT 1 from creature_movement_template As T WHERE point <> (SELECT COUNT(*) FROM creature_movement_template WHERE entry = T.entry AND point <= T.point) LIMIT 1")));
MANGOS_ASSERT(!(result = WorldDatabase.Query("SELECT 1 from creature_movement_template As T WHERE point <> (SELECT COUNT(*) FROM creature_movement_template WHERE entry = T.entry AND point <= T.point) LIMIT 1")));
}
}