Removed some unused CBot code

dev-time-step
krzys-h 2015-12-21 16:46:40 +01:00
parent 73f8bd5490
commit 76c04e10d5
12 changed files with 0 additions and 90 deletions

View File

@ -322,10 +322,6 @@ void CBotCStack::AddVar(CBotVar* pVar)
while ( *pp != nullptr ) pp = &(*pp)->m_next;
*pp = pVar; // added after
#ifdef _DEBUG
if ( pVar->GetUniqNum() == 0 ) assert(0);
#endif
}
////////////////////////////////////////////////////////////////////////////////

View File

@ -213,7 +213,6 @@ bool CBotClass::AddItem(std::string name,
CBotTypResult type,
int mPrivate)
{
CBotToken token(name, std::string());
CBotClass* pClass = type.GetClass();
CBotVar* pVar = CBotVar::Create( name, type );

View File

@ -286,9 +286,6 @@ bool CBotExprVar::ExecuteVar(CBotVar* &pVar, CBotStack* &pj, CBotToken* prevToke
pVar = pj->FindVar(m_nIdent, true); // tries with the variable update if necessary
if (pVar == nullptr)
{
#ifdef _DEBUG
assert(0);
#endif
pj->SetError(1, &m_token);
return false;
}

View File

@ -338,10 +338,6 @@ bad:
return pStack->ReturnFunc(nullptr, pStk);
}
#ifdef _DEBUG
static int xx = 0;
#endif
////////////////////////////////////////////////////////////////////////////////
bool CBotFunction::Execute(CBotVar** ppVars, CBotStack* &pj, CBotVar* pInstance)
{
@ -652,9 +648,6 @@ int CBotFunction::DoCall(long& nIdent, const std::string& name, CBotVar** ppVars
{
if ( !pStk3->IsOk() && pt->m_pProg != m_pProg )
{
#ifdef _DEBUG
if ( m_pProg->GetFunctions()->GetName() == "LaCommande" ) return false;
#endif
pStk3->SetPosError(pToken); // indicates the error on the procedure call
}
return false; // interrupt !

View File

@ -284,7 +284,6 @@ CBotInstr* CBotInstr::Compile(CBotToken* &p, CBotCStack* pStack)
////////////////////////////////////////////////////////////////////////////////
bool CBotInstr::Execute(CBotStack* &pj)
{
std::string ClassManquante = name;
assert(0); // should never go through this routine
// but use the routines of the subclasses
return false;
@ -301,7 +300,6 @@ bool CBotInstr::Execute(CBotStack* &pj, CBotVar* pVar)
////////////////////////////////////////////////////////////////////////////////
void CBotInstr::RestoreState(CBotStack* &pj, bool bMain)
{
std::string ClassManquante = name;
assert(0); // should never go through this routine
// but use the routines of the subclasses
}

View File

@ -222,9 +222,6 @@ bool CBotLeftExpr::ExecuteVar(CBotVar* &pVar, CBotStack* &pile, CBotToken* prevT
pVar = pile->FindVar(m_nIdent);
if (pVar == nullptr)
{
#ifdef _DEBUG
assert(0);
#endif
pile->SetError(2, &m_token);
return false;
}

View File

@ -245,16 +245,8 @@ bool CBotProgram::Run(void* pUser, int timer)
ok = m_pStack->Execute();
if ( ok )
{
#ifdef _DEBUG
CBotVar* ppVar[3];
ppVar[0] = CBotVar::Create("aa", CBotTypInt);
ppVar[1] = CBotVar::Create("bb", CBotTypInt);
ppVar[2] = nullptr;
ok = m_pRun->Execute(ppVar, m_pStack, m_pInstance);
#else
// returns to normal execution
ok = m_pRun->Execute(nullptr, m_pStack, m_pInstance);
#endif
}
#else
ok = m_pRun->Execute(nullptr, m_pStack, m_pInstance);

View File

@ -75,15 +75,6 @@ CBotStack* CBotStack::FirstStack()
pp->m_bOver = true;
pp ++;
}
#ifdef _DEBUG
int n = 1;
pp = p;
for ( i = 0 ; i< MAXSTACK+10 ; i++ )
{
pp->m_index = n++;
pp ++;
}
#endif
m_error = 0; // avoids deadlocks because m_error is static
return p;
@ -124,16 +115,10 @@ void CBotStack::Delete()
CBotStack* p = m_prev;
bool bOver = m_bOver;
#ifdef _DEBUG
int n = m_index;
#endif
// clears the freed block
memset(this, 0, sizeof(CBotStack));
m_bOver = bOver;
#ifdef _DEBUG
m_index = n;
#endif
if ( p == nullptr )
free( this );
@ -148,16 +133,10 @@ CBotStack* CBotStack::AddStack(CBotInstr* instr, UnknownEnumBlock bBlock)
return m_next; // included in an existing stack
}
#ifdef _DEBUG
int n = 0;
#endif
CBotStack* p = this;
do
{
p ++;
#ifdef _DEBUG
n ++;
#endif
}
while ( p->m_prev != nullptr );
@ -734,10 +713,6 @@ void CBotStack::AddVar(CBotVar* pVar)
while ( *pp != nullptr ) pp = &(*pp)->m_next;
*pp = pVar; // added after
#ifdef _DEBUG
if ( pVar->GetUniqNum() == 0 ) assert(0);
#endif
}
////////////////////////////////////////////////////////////////////////////////

View File

@ -230,9 +230,6 @@ private:
CBotStack* m_prev;
friend class CBotInstArray;
#ifdef _DEBUG
int m_index;
#endif
int m_state;
int m_step;
static int m_error;

View File

@ -113,17 +113,6 @@ CBotTypResult::~CBotTypResult()
////////////////////////////////////////////////////////////////////////////////
int CBotTypResult::GetType(int mode) const
{
#ifdef _DEBUG
if ( m_type == CBotTypPointer ||
m_type == CBotTypClass ||
m_type == CBotTypIntrinsic )
if ( m_pClass == nullptr ) assert(0);
if ( m_type == CBotTypArrayPointer )
if ( m_pNext == nullptr ) assert(0);
#endif
if ( mode == 3 && m_type == CBotTypNullPointer ) return CBotTypPointer;
return m_type;
}

View File

@ -68,24 +68,6 @@ CBotVar::~CBotVar( )
delete m_next;
}
////////////////////////////////////////////////////////////////////////////////
void CBotVar::debug()
{
// const char* p = static_cast<const char*>( m_token->GetString());
std::string s = GetValString();
// const char* v = static_cast<const char*> (s);
if ( m_type.Eq(CBotTypClass) )
{
CBotVar* pv = (static_cast<CBotVarClass*>(this))->m_pVar;
while (pv != nullptr)
{
pv->debug();
pv = pv->GetNext();
}
}
}
////////////////////////////////////////////////////////////////////////////////
void CBotVar::ConstructorSet()
{

View File

@ -547,11 +547,6 @@ public:
*/
static bool RestoreState(FILE* pf, CBotVar* &pVar);
/*!
* \brief debug
*/
void debug();
/*!
* \brief Maj
* \param pUser