Changed ASM_TRAP() to assert(0)
parent
405db2d70c
commit
aab79c6b5d
|
@ -33,6 +33,9 @@
|
||||||
|
|
||||||
#include "CBot.h"
|
#include "CBot.h"
|
||||||
|
|
||||||
|
#include <cassert>
|
||||||
|
|
||||||
|
|
||||||
CBotInstr::CBotInstr()
|
CBotInstr::CBotInstr()
|
||||||
{
|
{
|
||||||
name = "CBotInstr";
|
name = "CBotInstr";
|
||||||
|
@ -285,7 +288,7 @@ CBotInstr* CBotInstr::Compile(CBotToken* &p, CBotCStack* pStack)
|
||||||
bool CBotInstr::Execute(CBotStack* &pj)
|
bool CBotInstr::Execute(CBotStack* &pj)
|
||||||
{
|
{
|
||||||
CBotString ClassManquante = name;
|
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
|
// but use the routines of the subclasses
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -300,26 +303,26 @@ bool CBotInstr::Execute(CBotStack* &pj, CBotVar* pVar)
|
||||||
void CBotInstr::RestoreState(CBotStack* &pj, bool bMain)
|
void CBotInstr::RestoreState(CBotStack* &pj, bool bMain)
|
||||||
{
|
{
|
||||||
CBotString ClassManquante = name;
|
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
|
// but use the routines of the subclasses
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool CBotInstr::ExecuteVar(CBotVar* &pVar, CBotCStack* &pile)
|
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;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CBotInstr::ExecuteVar(CBotVar* &pVar, CBotStack* &pile, CBotToken* prevToken, bool bStep, bool bExtend)
|
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;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CBotInstr::RestoreStateVar(CBotStack* &pile, bool bMain)
|
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
|
// this routine is defined only for the subclass CBotCase
|
||||||
|
@ -531,7 +534,7 @@ void CBotLeftExprVar::RestoreState(CBotStack* &pj, bool bMain)
|
||||||
CBotVar* var1;
|
CBotVar* var1;
|
||||||
|
|
||||||
var1 = pj->FindVar(m_token.GetString());
|
var1 = pj->FindVar(m_token.GetString());
|
||||||
if (var1 == NULL) ASM_TRAP();
|
if (var1 == NULL) assert(0);
|
||||||
|
|
||||||
var1->SetUniqNum(m_nIdent); // with the unique identifier
|
var1->SetUniqNum(m_nIdent); // with the unique identifier
|
||||||
}
|
}
|
||||||
|
@ -1747,7 +1750,7 @@ bool CBotExpression::Execute(CBotStack* &pj)
|
||||||
pile2->SetVar(result);
|
pile2->SetVar(result);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
ASM_TRAP();
|
assert(0);
|
||||||
}
|
}
|
||||||
if (!IsInit)
|
if (!IsInit)
|
||||||
pile2->SetError(TX_NOTINIT, m_leftop->GetToken());
|
pile2->SetError(TX_NOTINIT, m_leftop->GetToken());
|
||||||
|
@ -2270,7 +2273,7 @@ CBotIndexExpr::~CBotIndexExpr()
|
||||||
bool CBotIndexExpr::ExecuteVar(CBotVar* &pVar, CBotCStack* &pile)
|
bool CBotIndexExpr::ExecuteVar(CBotVar* &pVar, CBotCStack* &pile)
|
||||||
{
|
{
|
||||||
if (pVar->GetType(1) != CBotTypArrayPointer)
|
if (pVar->GetType(1) != CBotTypArrayPointer)
|
||||||
ASM_TRAP();
|
assert(0);
|
||||||
|
|
||||||
pVar = (static_cast<CBotVarArray*>(pVar))->GetItem(0, false); // at compile time makes the element [0]
|
pVar = (static_cast<CBotVarArray*>(pVar))->GetItem(0, false); // at compile time makes the element [0]
|
||||||
if (pVar == NULL)
|
if (pVar == NULL)
|
||||||
|
@ -2291,7 +2294,7 @@ bool CBotIndexExpr::ExecuteVar(CBotVar* &pVar, CBotStack* &pile, CBotToken* prev
|
||||||
CBotStack* pj = pile;
|
CBotStack* pj = pile;
|
||||||
|
|
||||||
if (pVar->GetType(1) != CBotTypArrayPointer)
|
if (pVar->GetType(1) != CBotTypArrayPointer)
|
||||||
ASM_TRAP();
|
assert(0);
|
||||||
|
|
||||||
pile = pile->AddStack();
|
pile = pile->AddStack();
|
||||||
|
|
||||||
|
@ -2372,7 +2375,7 @@ void CBotFieldExpr::SetUniqNum(int num)
|
||||||
bool CBotFieldExpr::ExecuteVar(CBotVar* &pVar, CBotCStack* &pile)
|
bool CBotFieldExpr::ExecuteVar(CBotVar* &pVar, CBotCStack* &pile)
|
||||||
{
|
{
|
||||||
if (pVar->GetType(1) != CBotTypPointer)
|
if (pVar->GetType(1) != CBotTypPointer)
|
||||||
ASM_TRAP();
|
assert(0);
|
||||||
|
|
||||||
pVar = pVar->GetItemRef(m_nIdent);
|
pVar = pVar->GetItemRef(m_nIdent);
|
||||||
if (pVar == NULL)
|
if (pVar == NULL)
|
||||||
|
@ -2395,7 +2398,7 @@ bool CBotFieldExpr::ExecuteVar(CBotVar* &pVar, CBotStack* &pile, CBotToken* prev
|
||||||
|
|
||||||
|
|
||||||
if (pVar->GetType(1) != CBotTypPointer)
|
if (pVar->GetType(1) != CBotTypPointer)
|
||||||
ASM_TRAP();
|
assert(0);
|
||||||
|
|
||||||
CBotVarClass* pItem = pVar->GetPointer();
|
CBotVarClass* pItem = pVar->GetPointer();
|
||||||
if (pItem == NULL)
|
if (pItem == NULL)
|
||||||
|
@ -2648,7 +2651,7 @@ bool CBotLeftExpr::ExecuteVar(CBotVar* &pVar, CBotStack* &pile, CBotToken* prevT
|
||||||
if (pVar == NULL)
|
if (pVar == NULL)
|
||||||
{
|
{
|
||||||
#ifdef _DEBUG
|
#ifdef _DEBUG
|
||||||
ASM_TRAP();
|
assert(0);
|
||||||
#endif
|
#endif
|
||||||
pile->SetError(2, &m_token);
|
pile->SetError(2, &m_token);
|
||||||
return false;
|
return false;
|
||||||
|
@ -3289,7 +3292,7 @@ bool CBotExprVar::ExecuteVar(CBotVar* &pVar, CBotStack* &pj, CBotToken* prevToke
|
||||||
if (pVar == NULL)
|
if (pVar == NULL)
|
||||||
{
|
{
|
||||||
#ifdef _DEBUG
|
#ifdef _DEBUG
|
||||||
ASM_TRAP();
|
assert(0);
|
||||||
#endif
|
#endif
|
||||||
pj->SetError(1, &m_token);
|
pj->SetError(1, &m_token);
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -32,13 +32,6 @@
|
||||||
#define EOX (reinterpret_cast<CBotStack*>(-1)) /// \def tag special condition
|
#define EOX (reinterpret_cast<CBotStack*>(-1)) /// \def tag special condition
|
||||||
|
|
||||||
|
|
||||||
// fix for MSVC instruction __asm int 3 (setting a trap)
|
|
||||||
#if defined(__MINGW32__) || defined(__GNUC__)
|
|
||||||
#define ASM_TRAP() asm("int $3");
|
|
||||||
#else
|
|
||||||
#define ASM_TRAP() __asm int 3;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////
|
||||||
// forward declaration
|
// forward declaration
|
||||||
|
|
||||||
|
|
|
@ -20,6 +20,9 @@
|
||||||
|
|
||||||
#include "CBot.h"
|
#include "CBot.h"
|
||||||
|
|
||||||
|
#include <cassert>
|
||||||
|
|
||||||
|
|
||||||
// various constructors / destructors
|
// various constructors / destructors
|
||||||
// \TODO translation:to liberate all according to esteblished tree
|
// \TODO translation:to liberate all according to esteblished tree
|
||||||
// pour libérer tout selon l'arbre établi
|
// pour libérer tout selon l'arbre établi
|
||||||
|
@ -1046,7 +1049,7 @@ bool CBotDefParam::Execute(CBotVar** ppVars, CBotStack* &pj)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
ASM_TRAP();
|
assert(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
newvar->SetUniqNum(p->m_nIdent);
|
newvar->SetUniqNum(p->m_nIdent);
|
||||||
|
|
|
@ -18,6 +18,8 @@
|
||||||
|
|
||||||
|
|
||||||
#include "CBot.h"
|
#include "CBot.h"
|
||||||
|
|
||||||
|
#include <cassert>
|
||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
|
|
||||||
|
@ -80,12 +82,12 @@ CBotStack* CBotStack::FirstStack()
|
||||||
CBotStack::CBotStack(CBotStack* ppapa)
|
CBotStack::CBotStack(CBotStack* ppapa)
|
||||||
{
|
{
|
||||||
// constructor must exist or the destructor is never called!
|
// constructor must exist or the destructor is never called!
|
||||||
ASM_TRAP();
|
assert(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
CBotStack::~CBotStack()
|
CBotStack::~CBotStack()
|
||||||
{
|
{
|
||||||
ASM_TRAP(); // use Delete () instead
|
assert(0); // use Delete () instead
|
||||||
}
|
}
|
||||||
|
|
||||||
void CBotStack::Delete()
|
void CBotStack::Delete()
|
||||||
|
@ -693,7 +695,7 @@ void CBotStack::AddVar(CBotVar* pVar)
|
||||||
*pp = pVar; // added after
|
*pp = pVar; // added after
|
||||||
|
|
||||||
#ifdef _DEBUG
|
#ifdef _DEBUG
|
||||||
if ( pVar->GetUniqNum() == 0 ) ASM_TRAP();
|
if ( pVar->GetUniqNum() == 0 ) assert(0);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1091,7 +1093,7 @@ bool CBotVar::RestoreState(FILE* pf, CBotVar* &pVar)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
ASM_TRAP();
|
assert(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( pPrev != NULL ) pPrev->m_next = pNew;
|
if ( pPrev != NULL ) pPrev->m_next = pNew;
|
||||||
|
@ -1388,7 +1390,7 @@ void CBotCStack::AddVar(CBotVar* pVar)
|
||||||
*pp = pVar; // added after
|
*pp = pVar; // added after
|
||||||
|
|
||||||
#ifdef _DEBUG
|
#ifdef _DEBUG
|
||||||
if ( pVar->GetUniqNum() == 0 ) ASM_TRAP();
|
if ( pVar->GetUniqNum() == 0 ) assert(0);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -20,6 +20,8 @@
|
||||||
|
|
||||||
#include "CBot.h"
|
#include "CBot.h"
|
||||||
|
|
||||||
|
#include <cassert>
|
||||||
|
|
||||||
// various constructors
|
// various constructors
|
||||||
|
|
||||||
CBotTwoOpExpr::CBotTwoOpExpr()
|
CBotTwoOpExpr::CBotTwoOpExpr()
|
||||||
|
@ -466,7 +468,7 @@ bool CBotTwoOpExpr::Execute(CBotStack* &pStack)
|
||||||
if ( !IsNan(left, right, &err) ) result->SL(left , right);
|
if ( !IsNan(left, right, &err) ) result->SL(left , right);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
ASM_TRAP();
|
assert(0);
|
||||||
}
|
}
|
||||||
delete temp;
|
delete temp;
|
||||||
|
|
||||||
|
|
|
@ -21,8 +21,10 @@
|
||||||
// it never creates an instance of the class mother CBotVar
|
// it never creates an instance of the class mother CBotVar
|
||||||
|
|
||||||
#include "CBot.h"
|
#include "CBot.h"
|
||||||
#include <math.h>
|
|
||||||
#include <stdio.h>
|
#include <cassert>
|
||||||
|
#include <cmath>
|
||||||
|
#include <cstdio>
|
||||||
|
|
||||||
long CBotVar::m_identcpt = 0;
|
long CBotVar::m_identcpt = 0;
|
||||||
|
|
||||||
|
@ -124,7 +126,7 @@ void CBotVarClass::InitCBotVarClass( const CBotToken* name, CBotTypResult& type
|
||||||
!type.Eq(CBotTypIntrinsic) && // by convenience there accepts these types
|
!type.Eq(CBotTypIntrinsic) && // by convenience there accepts these types
|
||||||
!type.Eq(CBotTypPointer) &&
|
!type.Eq(CBotTypPointer) &&
|
||||||
!type.Eq(CBotTypArrayPointer) &&
|
!type.Eq(CBotTypArrayPointer) &&
|
||||||
!type.Eq(CBotTypArrayBody)) ASM_TRAP();
|
!type.Eq(CBotTypArrayBody)) assert(0);
|
||||||
|
|
||||||
m_token = new CBotToken(name);
|
m_token = new CBotToken(name);
|
||||||
m_next = NULL;
|
m_next = NULL;
|
||||||
|
@ -169,7 +171,7 @@ void CBotVarClass::InitCBotVarClass( const CBotToken* name, CBotTypResult& type
|
||||||
CBotVarClass::~CBotVarClass( )
|
CBotVarClass::~CBotVarClass( )
|
||||||
{
|
{
|
||||||
if ( m_CptUse != 0 )
|
if ( m_CptUse != 0 )
|
||||||
ASM_TRAP();
|
assert(0);
|
||||||
|
|
||||||
if ( m_pParent ) delete m_pParent;
|
if ( m_pParent ) delete m_pParent;
|
||||||
m_pParent = NULL;
|
m_pParent = NULL;
|
||||||
|
@ -242,7 +244,7 @@ void CBotVar::SetUniqNum(long n)
|
||||||
{
|
{
|
||||||
m_ident = n;
|
m_ident = n;
|
||||||
|
|
||||||
if ( n == 0 ) ASM_TRAP();
|
if ( n == 0 ) assert(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
long CBotVar::NextUniqNum()
|
long CBotVar::NextUniqNum()
|
||||||
|
@ -267,7 +269,7 @@ bool CBotVar::Save1State(FILE* pf)
|
||||||
// this routine "virtual" must never be called,
|
// this routine "virtual" must never be called,
|
||||||
// there must be a routine for each of the subclasses (CBotVarInt, CBotVarFloat, etc)
|
// there must be a routine for each of the subclasses (CBotVarInt, CBotVarFloat, etc)
|
||||||
// ( see the type in m_type )
|
// ( see the type in m_type )
|
||||||
ASM_TRAP();
|
assert(0);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -335,7 +337,7 @@ CBotVar* CBotVar::Create(const CBotToken* name, CBotTypResult type)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ASM_TRAP();
|
assert(0);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -406,7 +408,7 @@ CBotVar* CBotVar::Create( const char* n, CBotTypResult type)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ASM_TRAP();
|
assert(0);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -519,25 +521,25 @@ CBotToken* CBotVar::GetToken()
|
||||||
|
|
||||||
CBotVar* CBotVar::GetItem(const char* name)
|
CBotVar* CBotVar::GetItem(const char* name)
|
||||||
{
|
{
|
||||||
ASM_TRAP();
|
assert(0);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
CBotVar* CBotVar::GetItemRef(int nIdent)
|
CBotVar* CBotVar::GetItemRef(int nIdent)
|
||||||
{
|
{
|
||||||
ASM_TRAP();
|
assert(0);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
CBotVar* CBotVar::GetItemList()
|
CBotVar* CBotVar::GetItemList()
|
||||||
{
|
{
|
||||||
ASM_TRAP();
|
assert(0);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
CBotVar* CBotVar::GetItem(int row, bool bGrow)
|
CBotVar* CBotVar::GetItem(int row, bool bGrow)
|
||||||
{
|
{
|
||||||
ASM_TRAP();
|
assert(0);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -617,7 +619,7 @@ void CBotVar::SetVal(CBotVar* var)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
ASM_TRAP();
|
assert(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
m_binit = var->m_binit; // copie l'état nan s'il y a
|
m_binit = var->m_binit; // copie l'état nan s'il y a
|
||||||
|
@ -651,12 +653,12 @@ int CBotVar::GetPrivate()
|
||||||
|
|
||||||
void CBotVar::SetPointer(CBotVar* pVarClass)
|
void CBotVar::SetPointer(CBotVar* pVarClass)
|
||||||
{
|
{
|
||||||
ASM_TRAP();
|
assert(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
CBotVarClass* CBotVar::GetPointer()
|
CBotVarClass* CBotVar::GetPointer()
|
||||||
{
|
{
|
||||||
ASM_TRAP();
|
assert(0);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -665,167 +667,167 @@ CBotVarClass* CBotVar::GetPointer()
|
||||||
|
|
||||||
int CBotVar::GetValInt()
|
int CBotVar::GetValInt()
|
||||||
{
|
{
|
||||||
ASM_TRAP();
|
assert(0);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
float CBotVar::GetValFloat()
|
float CBotVar::GetValFloat()
|
||||||
{
|
{
|
||||||
ASM_TRAP();
|
assert(0);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CBotVar::SetValInt(int c, const char* s)
|
void CBotVar::SetValInt(int c, const char* s)
|
||||||
{
|
{
|
||||||
ASM_TRAP();
|
assert(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CBotVar::SetValFloat(float c)
|
void CBotVar::SetValFloat(float c)
|
||||||
{
|
{
|
||||||
ASM_TRAP();
|
assert(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CBotVar::Mul(CBotVar* left, CBotVar* right)
|
void CBotVar::Mul(CBotVar* left, CBotVar* right)
|
||||||
{
|
{
|
||||||
ASM_TRAP();
|
assert(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CBotVar::Power(CBotVar* left, CBotVar* right)
|
void CBotVar::Power(CBotVar* left, CBotVar* right)
|
||||||
{
|
{
|
||||||
ASM_TRAP();
|
assert(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
int CBotVar::Div(CBotVar* left, CBotVar* right)
|
int CBotVar::Div(CBotVar* left, CBotVar* right)
|
||||||
{
|
{
|
||||||
ASM_TRAP();
|
assert(0);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int CBotVar::Modulo(CBotVar* left, CBotVar* right)
|
int CBotVar::Modulo(CBotVar* left, CBotVar* right)
|
||||||
{
|
{
|
||||||
ASM_TRAP();
|
assert(0);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CBotVar::Add(CBotVar* left, CBotVar* right)
|
void CBotVar::Add(CBotVar* left, CBotVar* right)
|
||||||
{
|
{
|
||||||
ASM_TRAP();
|
assert(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CBotVar::Sub(CBotVar* left, CBotVar* right)
|
void CBotVar::Sub(CBotVar* left, CBotVar* right)
|
||||||
{
|
{
|
||||||
ASM_TRAP();
|
assert(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CBotVar::Lo(CBotVar* left, CBotVar* right)
|
bool CBotVar::Lo(CBotVar* left, CBotVar* right)
|
||||||
{
|
{
|
||||||
ASM_TRAP();
|
assert(0);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CBotVar::Hi(CBotVar* left, CBotVar* right)
|
bool CBotVar::Hi(CBotVar* left, CBotVar* right)
|
||||||
{
|
{
|
||||||
ASM_TRAP();
|
assert(0);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CBotVar::Ls(CBotVar* left, CBotVar* right)
|
bool CBotVar::Ls(CBotVar* left, CBotVar* right)
|
||||||
{
|
{
|
||||||
ASM_TRAP();
|
assert(0);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CBotVar::Hs(CBotVar* left, CBotVar* right)
|
bool CBotVar::Hs(CBotVar* left, CBotVar* right)
|
||||||
{
|
{
|
||||||
ASM_TRAP();
|
assert(0);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CBotVar::Eq(CBotVar* left, CBotVar* right)
|
bool CBotVar::Eq(CBotVar* left, CBotVar* right)
|
||||||
{
|
{
|
||||||
ASM_TRAP();
|
assert(0);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CBotVar::Ne(CBotVar* left, CBotVar* right)
|
bool CBotVar::Ne(CBotVar* left, CBotVar* right)
|
||||||
{
|
{
|
||||||
ASM_TRAP();
|
assert(0);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CBotVar::And(CBotVar* left, CBotVar* right)
|
void CBotVar::And(CBotVar* left, CBotVar* right)
|
||||||
{
|
{
|
||||||
ASM_TRAP();
|
assert(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CBotVar::Or(CBotVar* left, CBotVar* right)
|
void CBotVar::Or(CBotVar* left, CBotVar* right)
|
||||||
{
|
{
|
||||||
ASM_TRAP();
|
assert(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CBotVar::XOr(CBotVar* left, CBotVar* right)
|
void CBotVar::XOr(CBotVar* left, CBotVar* right)
|
||||||
{
|
{
|
||||||
ASM_TRAP();
|
assert(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CBotVar::ASR(CBotVar* left, CBotVar* right)
|
void CBotVar::ASR(CBotVar* left, CBotVar* right)
|
||||||
{
|
{
|
||||||
ASM_TRAP();
|
assert(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CBotVar::SR(CBotVar* left, CBotVar* right)
|
void CBotVar::SR(CBotVar* left, CBotVar* right)
|
||||||
{
|
{
|
||||||
ASM_TRAP();
|
assert(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CBotVar::SL(CBotVar* left, CBotVar* right)
|
void CBotVar::SL(CBotVar* left, CBotVar* right)
|
||||||
{
|
{
|
||||||
ASM_TRAP();
|
assert(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CBotVar::Neg()
|
void CBotVar::Neg()
|
||||||
{
|
{
|
||||||
ASM_TRAP();
|
assert(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CBotVar::Not()
|
void CBotVar::Not()
|
||||||
{
|
{
|
||||||
ASM_TRAP();
|
assert(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CBotVar::Inc()
|
void CBotVar::Inc()
|
||||||
{
|
{
|
||||||
ASM_TRAP();
|
assert(0);
|
||||||
}
|
}
|
||||||
void CBotVar::Dec()
|
void CBotVar::Dec()
|
||||||
{
|
{
|
||||||
ASM_TRAP();
|
assert(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CBotVar::Copy(CBotVar* pSrc, bool bName)
|
void CBotVar::Copy(CBotVar* pSrc, bool bName)
|
||||||
{
|
{
|
||||||
ASM_TRAP();
|
assert(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CBotVar::SetValString(const char* p)
|
void CBotVar::SetValString(const char* p)
|
||||||
{
|
{
|
||||||
ASM_TRAP();
|
assert(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
CBotString CBotVar::GetValString()
|
CBotString CBotVar::GetValString()
|
||||||
{
|
{
|
||||||
ASM_TRAP();
|
assert(0);
|
||||||
return CBotString();
|
return CBotString();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CBotVar::SetClass(CBotClass* pClass)
|
void CBotVar::SetClass(CBotClass* pClass)
|
||||||
{
|
{
|
||||||
ASM_TRAP();
|
assert(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
CBotClass* CBotVar::GetClass()
|
CBotClass* CBotVar::GetClass()
|
||||||
{
|
{
|
||||||
ASM_TRAP();
|
assert(0);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1398,7 +1400,7 @@ void CBotVarClass::Copy(CBotVar* pSrc, bool bName)
|
||||||
pSrc = pSrc->GetPointer(); // if source given by a pointer
|
pSrc = pSrc->GetPointer(); // if source given by a pointer
|
||||||
|
|
||||||
if ( pSrc->GetType() != CBotTypClass )
|
if ( pSrc->GetType() != CBotTypClass )
|
||||||
ASM_TRAP();
|
assert(0);
|
||||||
|
|
||||||
CBotVarClass* p = static_cast<CBotVarClass*>(pSrc);
|
CBotVarClass* p = static_cast<CBotVarClass*>(pSrc);
|
||||||
|
|
||||||
|
@ -1410,7 +1412,7 @@ void CBotVarClass::Copy(CBotVar* pSrc, bool bName)
|
||||||
m_pClass = p->m_pClass;
|
m_pClass = p->m_pClass;
|
||||||
if ( p->m_pParent )
|
if ( p->m_pParent )
|
||||||
{
|
{
|
||||||
ASM_TRAP(); // "que faire du pParent";
|
assert(0); // "que faire du pParent";
|
||||||
}
|
}
|
||||||
|
|
||||||
// m_next = NULL;
|
// m_next = NULL;
|
||||||
|
@ -1768,7 +1770,7 @@ bool CBotVarClass::Ne(CBotVar* left, CBotVar* right)
|
||||||
CBotVarArray::CBotVarArray(const CBotToken* name, CBotTypResult& type )
|
CBotVarArray::CBotVarArray(const CBotToken* name, CBotTypResult& type )
|
||||||
{
|
{
|
||||||
if ( !type.Eq(CBotTypArrayPointer) &&
|
if ( !type.Eq(CBotTypArrayPointer) &&
|
||||||
!type.Eq(CBotTypArrayBody)) ASM_TRAP();
|
!type.Eq(CBotTypArrayBody)) assert(0);
|
||||||
|
|
||||||
m_token = new CBotToken(name);
|
m_token = new CBotToken(name);
|
||||||
m_next = NULL;
|
m_next = NULL;
|
||||||
|
@ -1791,7 +1793,7 @@ CBotVarArray::~CBotVarArray()
|
||||||
void CBotVarArray::Copy(CBotVar* pSrc, bool bName)
|
void CBotVarArray::Copy(CBotVar* pSrc, bool bName)
|
||||||
{
|
{
|
||||||
if ( pSrc->GetType() != CBotTypArrayPointer )
|
if ( pSrc->GetType() != CBotTypArrayPointer )
|
||||||
ASM_TRAP();
|
assert(0);
|
||||||
|
|
||||||
CBotVarArray* p = static_cast<CBotVarArray*>(pSrc);
|
CBotVarArray* p = static_cast<CBotVarArray*>(pSrc);
|
||||||
|
|
||||||
|
@ -1825,7 +1827,7 @@ void CBotVarArray::SetPointer(CBotVar* pVarClass)
|
||||||
|
|
||||||
if ( !pVarClass->m_type.Eq(CBotTypClass) &&
|
if ( !pVarClass->m_type.Eq(CBotTypClass) &&
|
||||||
!pVarClass->m_type.Eq(CBotTypArrayBody))
|
!pVarClass->m_type.Eq(CBotTypArrayBody))
|
||||||
ASM_TRAP();
|
assert(0);
|
||||||
|
|
||||||
(static_cast<CBotVarClass*>(pVarClass))->IncrementUse(); // incement the reference
|
(static_cast<CBotVarClass*>(pVarClass))->IncrementUse(); // incement the reference
|
||||||
}
|
}
|
||||||
|
@ -1882,7 +1884,7 @@ CBotVarPointer::CBotVarPointer(const CBotToken* name, CBotTypResult& type )
|
||||||
if ( !type.Eq(CBotTypPointer) &&
|
if ( !type.Eq(CBotTypPointer) &&
|
||||||
!type.Eq(CBotTypNullPointer) &&
|
!type.Eq(CBotTypNullPointer) &&
|
||||||
!type.Eq(CBotTypClass) && // for convenience accepts Class and Intrinsic
|
!type.Eq(CBotTypClass) && // for convenience accepts Class and Intrinsic
|
||||||
!type.Eq(CBotTypIntrinsic) ) ASM_TRAP();
|
!type.Eq(CBotTypIntrinsic) ) assert(0);
|
||||||
|
|
||||||
m_token = new CBotToken(name);
|
m_token = new CBotToken(name);
|
||||||
m_next = NULL;
|
m_next = NULL;
|
||||||
|
@ -1965,7 +1967,7 @@ void CBotVarPointer::SetPointer(CBotVar* pVarClass)
|
||||||
|
|
||||||
// if ( pVarClass->GetType() != CBotTypClass )
|
// if ( pVarClass->GetType() != CBotTypClass )
|
||||||
if ( !pVarClass->m_type.Eq(CBotTypClass) )
|
if ( !pVarClass->m_type.Eq(CBotTypClass) )
|
||||||
ASM_TRAP();
|
assert(0);
|
||||||
|
|
||||||
(static_cast<CBotVarClass*>(pVarClass))->IncrementUse(); // increment the reference
|
(static_cast<CBotVarClass*>(pVarClass))->IncrementUse(); // increment the reference
|
||||||
m_pClass = (static_cast<CBotVarClass*>(pVarClass))->m_pClass;
|
m_pClass = (static_cast<CBotVarClass*>(pVarClass))->m_pClass;
|
||||||
|
@ -2034,7 +2036,7 @@ void CBotVarPointer::Copy(CBotVar* pSrc, bool bName)
|
||||||
{
|
{
|
||||||
if ( pSrc->GetType() != CBotTypPointer &&
|
if ( pSrc->GetType() != CBotTypPointer &&
|
||||||
pSrc->GetType() != CBotTypNullPointer)
|
pSrc->GetType() != CBotTypNullPointer)
|
||||||
ASM_TRAP();
|
assert(0);
|
||||||
|
|
||||||
CBotVarPointer* p = static_cast<CBotVarPointer*>(pSrc);
|
CBotVarPointer* p = static_cast<CBotVarPointer*>(pSrc);
|
||||||
|
|
||||||
|
@ -2162,11 +2164,11 @@ int CBotTypResult::GetType(int mode) const
|
||||||
m_type == CBotTypClass ||
|
m_type == CBotTypClass ||
|
||||||
m_type == CBotTypIntrinsic )
|
m_type == CBotTypIntrinsic )
|
||||||
|
|
||||||
if ( m_pClass == NULL ) ASM_TRAP();
|
if ( m_pClass == NULL ) assert(0);
|
||||||
|
|
||||||
|
|
||||||
if ( m_type == CBotTypArrayPointer )
|
if ( m_type == CBotTypArrayPointer )
|
||||||
if ( m_pNext == NULL ) ASM_TRAP();
|
if ( m_pNext == NULL ) assert(0);
|
||||||
#endif
|
#endif
|
||||||
if ( mode == 3 && m_type == CBotTypNullPointer ) return CBotTypPointer;
|
if ( mode == 3 && m_type == CBotTypNullPointer ) return CBotTypPointer;
|
||||||
return m_type;
|
return m_type;
|
||||||
|
|
Loading…
Reference in New Issue