diff options
author | Piotr Dziwinski <piotrdz@gmail.com> | 2013-11-25 20:03:06 +0100 |
---|---|---|
committer | Piotr Dziwinski <piotrdz@gmail.com> | 2013-11-25 20:03:06 +0100 |
commit | aab79c6b5dc33f2a0f88b42a5308e79aeeb92b2c (patch) | |
tree | dca3e7e48129e1270053b678f7dd70b8dae1e6f5 /src/CBot/CBot.cpp | |
parent | 405db2d70ca108a0422538a4f30072f1831f473b (diff) | |
download | colobot-aab79c6b5dc33f2a0f88b42a5308e79aeeb92b2c.tar.gz colobot-aab79c6b5dc33f2a0f88b42a5308e79aeeb92b2c.tar.bz2 colobot-aab79c6b5dc33f2a0f88b42a5308e79aeeb92b2c.zip |
Changed ASM_TRAP() to assert(0)
Diffstat (limited to 'src/CBot/CBot.cpp')
-rw-r--r-- | src/CBot/CBot.cpp | 29 |
1 files changed, 16 insertions, 13 deletions
diff --git a/src/CBot/CBot.cpp b/src/CBot/CBot.cpp index 513b803..403be6e 100644 --- a/src/CBot/CBot.cpp +++ b/src/CBot/CBot.cpp @@ -33,6 +33,9 @@ #include "CBot.h" +#include <cassert> + + CBotInstr::CBotInstr() { name = "CBotInstr"; @@ -285,7 +288,7 @@ CBotInstr* CBotInstr::Compile(CBotToken* &p, CBotCStack* pStack) bool CBotInstr::Execute(CBotStack* &pj) { CBotString ClassManquante = name; - ASM_TRAP(); // should never go through this routine + assert(0); // should never go through this routine // but use the routines of the subclasses return false; } @@ -300,26 +303,26 @@ bool CBotInstr::Execute(CBotStack* &pj, CBotVar* pVar) void CBotInstr::RestoreState(CBotStack* &pj, bool bMain) { CBotString ClassManquante = name; - ASM_TRAP(); // should never go through this routine + assert(0); // should never go through this routine // but use the routines of the subclasses } bool CBotInstr::ExecuteVar(CBotVar* &pVar, CBotCStack* &pile) { - ASM_TRAP(); // dad do not know, see the girls + assert(0); // dad do not know, see the girls return false; } bool CBotInstr::ExecuteVar(CBotVar* &pVar, CBotStack* &pile, CBotToken* prevToken, bool bStep, bool bExtend) { - ASM_TRAP(); // dad do not know, see the girls + assert(0); // dad do not know, see the girls return false; } void CBotInstr::RestoreStateVar(CBotStack* &pile, bool bMain) { - ASM_TRAP(); // dad do not know, see the girls + assert(0); // dad do not know, see the girls } // this routine is defined only for the subclass CBotCase @@ -531,7 +534,7 @@ void CBotLeftExprVar::RestoreState(CBotStack* &pj, bool bMain) CBotVar* var1; var1 = pj->FindVar(m_token.GetString()); - if (var1 == NULL) ASM_TRAP(); + if (var1 == NULL) assert(0); var1->SetUniqNum(m_nIdent); // with the unique identifier } @@ -1747,7 +1750,7 @@ bool CBotExpression::Execute(CBotStack* &pj) pile2->SetVar(result); break; default: - ASM_TRAP(); + assert(0); } if (!IsInit) pile2->SetError(TX_NOTINIT, m_leftop->GetToken()); @@ -2270,7 +2273,7 @@ CBotIndexExpr::~CBotIndexExpr() bool CBotIndexExpr::ExecuteVar(CBotVar* &pVar, CBotCStack* &pile) { if (pVar->GetType(1) != CBotTypArrayPointer) - ASM_TRAP(); + assert(0); pVar = (static_cast<CBotVarArray*>(pVar))->GetItem(0, false); // at compile time makes the element [0] if (pVar == NULL) @@ -2291,7 +2294,7 @@ bool CBotIndexExpr::ExecuteVar(CBotVar* &pVar, CBotStack* &pile, CBotToken* prev CBotStack* pj = pile; if (pVar->GetType(1) != CBotTypArrayPointer) - ASM_TRAP(); + assert(0); pile = pile->AddStack(); @@ -2372,7 +2375,7 @@ void CBotFieldExpr::SetUniqNum(int num) bool CBotFieldExpr::ExecuteVar(CBotVar* &pVar, CBotCStack* &pile) { if (pVar->GetType(1) != CBotTypPointer) - ASM_TRAP(); + assert(0); pVar = pVar->GetItemRef(m_nIdent); if (pVar == NULL) @@ -2395,7 +2398,7 @@ bool CBotFieldExpr::ExecuteVar(CBotVar* &pVar, CBotStack* &pile, CBotToken* prev if (pVar->GetType(1) != CBotTypPointer) - ASM_TRAP(); + assert(0); CBotVarClass* pItem = pVar->GetPointer(); if (pItem == NULL) @@ -2648,7 +2651,7 @@ bool CBotLeftExpr::ExecuteVar(CBotVar* &pVar, CBotStack* &pile, CBotToken* prevT if (pVar == NULL) { #ifdef _DEBUG - ASM_TRAP(); + assert(0); #endif pile->SetError(2, &m_token); return false; @@ -3289,7 +3292,7 @@ bool CBotExprVar::ExecuteVar(CBotVar* &pVar, CBotStack* &pj, CBotToken* prevToke if (pVar == NULL) { #ifdef _DEBUG - ASM_TRAP(); + assert(0); #endif pj->SetError(1, &m_token); return false; |