diff --git a/src/CBot/CBotCStack.cpp b/src/CBot/CBotCStack.cpp index 47a701bf..90580036 100644 --- a/src/CBot/CBotCStack.cpp +++ b/src/CBot/CBotCStack.cpp @@ -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 } //////////////////////////////////////////////////////////////////////////////// diff --git a/src/CBot/CBotClass.cpp b/src/CBot/CBotClass.cpp index 48e74395..34a3b333 100644 --- a/src/CBot/CBotClass.cpp +++ b/src/CBot/CBotClass.cpp @@ -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 ); diff --git a/src/CBot/CBotInstr/CBotExprVar.cpp b/src/CBot/CBotInstr/CBotExprVar.cpp index 7f2d14ac..98f47cf5 100644 --- a/src/CBot/CBotInstr/CBotExprVar.cpp +++ b/src/CBot/CBotInstr/CBotExprVar.cpp @@ -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; } diff --git a/src/CBot/CBotInstr/CBotFunction.cpp b/src/CBot/CBotInstr/CBotFunction.cpp index f024d7d2..9a4129aa 100644 --- a/src/CBot/CBotInstr/CBotFunction.cpp +++ b/src/CBot/CBotInstr/CBotFunction.cpp @@ -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 ! diff --git a/src/CBot/CBotInstr/CBotInstr.cpp b/src/CBot/CBotInstr/CBotInstr.cpp index 6a93260e..93029496 100644 --- a/src/CBot/CBotInstr/CBotInstr.cpp +++ b/src/CBot/CBotInstr/CBotInstr.cpp @@ -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 } diff --git a/src/CBot/CBotInstr/CBotLeftExpr.cpp b/src/CBot/CBotInstr/CBotLeftExpr.cpp index 9bc5ef92..4ac6a4e4 100644 --- a/src/CBot/CBotInstr/CBotLeftExpr.cpp +++ b/src/CBot/CBotInstr/CBotLeftExpr.cpp @@ -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; } diff --git a/src/CBot/CBotProgram.cpp b/src/CBot/CBotProgram.cpp index a02e8e0f..f65d8e29 100644 --- a/src/CBot/CBotProgram.cpp +++ b/src/CBot/CBotProgram.cpp @@ -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); diff --git a/src/CBot/CBotStack.cpp b/src/CBot/CBotStack.cpp index fb69c5e3..545c49f9 100644 --- a/src/CBot/CBotStack.cpp +++ b/src/CBot/CBotStack.cpp @@ -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 } //////////////////////////////////////////////////////////////////////////////// diff --git a/src/CBot/CBotStack.h b/src/CBot/CBotStack.h index b5afe4d5..5e40fc3e 100644 --- a/src/CBot/CBotStack.h +++ b/src/CBot/CBotStack.h @@ -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; diff --git a/src/CBot/CBotTypResult.cpp b/src/CBot/CBotTypResult.cpp index c4f9ee2f..554b66b8 100644 --- a/src/CBot/CBotTypResult.cpp +++ b/src/CBot/CBotTypResult.cpp @@ -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; } diff --git a/src/CBot/CBotVar/CBotVar.cpp b/src/CBot/CBotVar/CBotVar.cpp index fc41945a..80d04db8 100644 --- a/src/CBot/CBotVar/CBotVar.cpp +++ b/src/CBot/CBotVar/CBotVar.cpp @@ -68,24 +68,6 @@ CBotVar::~CBotVar( ) delete m_next; } -//////////////////////////////////////////////////////////////////////////////// -void CBotVar::debug() -{ -// const char* p = static_cast( m_token->GetString()); - std::string s = GetValString(); -// const char* v = static_cast (s); - - if ( m_type.Eq(CBotTypClass) ) - { - CBotVar* pv = (static_cast(this))->m_pVar; - while (pv != nullptr) - { - pv->debug(); - pv = pv->GetNext(); - } - } -} - //////////////////////////////////////////////////////////////////////////////// void CBotVar::ConstructorSet() { diff --git a/src/CBot/CBotVar/CBotVar.h b/src/CBot/CBotVar/CBotVar.h index 6f95db48..d3202f46 100644 --- a/src/CBot/CBotVar/CBotVar.h +++ b/src/CBot/CBotVar/CBotVar.h @@ -547,11 +547,6 @@ public: */ static bool RestoreState(FILE* pf, CBotVar* &pVar); - /*! - * \brief debug - */ - void debug(); - /*! * \brief Maj * \param pUser