[colobot] 165/377: Removed some unused CBot code

Didier Raboud odyx at moszumanska.debian.org
Wed Mar 30 13:34:11 UTC 2016


This is an automated email from the git hooks/post-receive script.

odyx pushed a commit to branch debian/master
in repository colobot.

commit 76c04e10d5a624b03764824fdc7575131b15235d
Author: krzys-h <krzys_h at interia.pl>
Date:   Mon Dec 21 16:46:40 2015 +0100

    Removed some unused CBot code
---
 src/CBot/CBotCStack.cpp             |  4 ----
 src/CBot/CBotClass.cpp              |  1 -
 src/CBot/CBotInstr/CBotExprVar.cpp  |  3 ---
 src/CBot/CBotInstr/CBotFunction.cpp |  7 -------
 src/CBot/CBotInstr/CBotInstr.cpp    |  2 --
 src/CBot/CBotInstr/CBotLeftExpr.cpp |  3 ---
 src/CBot/CBotProgram.cpp            |  8 --------
 src/CBot/CBotStack.cpp              | 25 -------------------------
 src/CBot/CBotStack.h                |  3 ---
 src/CBot/CBotTypResult.cpp          | 11 -----------
 src/CBot/CBotVar/CBotVar.cpp        | 18 ------------------
 src/CBot/CBotVar/CBotVar.h          |  5 -----
 12 files changed, 90 deletions(-)

diff --git a/src/CBot/CBotCStack.cpp b/src/CBot/CBotCStack.cpp
index 47a701b..9058003 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 48e7439..34a3b33 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 7f2d14a..98f47cf 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 f024d7d..9a4129a 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 6a93260..9302949 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 9bc5ef9..4ac6a4e 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 a02e8e0..f65d8e2 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 fb69c5e..545c49f 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 b5afe4d..5e40fc3 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 c4f9ee2..554b66b 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 fc41945..80d04db 100644
--- a/src/CBot/CBotVar/CBotVar.cpp
+++ b/src/CBot/CBotVar/CBotVar.cpp
@@ -69,24 +69,6 @@ CBotVar::~CBotVar( )
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-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()
 {
     // nop
diff --git a/src/CBot/CBotVar/CBotVar.h b/src/CBot/CBotVar/CBotVar.h
index 6f95db4..d3202f4 100644
--- a/src/CBot/CBotVar/CBotVar.h
+++ b/src/CBot/CBotVar/CBotVar.h
@@ -548,11 +548,6 @@ public:
     static bool RestoreState(FILE* pf, CBotVar* &pVar);
 
     /*!
-     * \brief debug
-     */
-    void debug();
-
-    /*!
      * \brief Maj
      * \param pUser
      * \param bContinue

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/colobot.git



More information about the Pkg-games-commits mailing list