Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 2, 2011, 5:00:20 AM (14 years ago)
Author:
rgrieder
Message:

Replaced code like
bool b = someFunction(); assert(b);
with
OrxVerify(someFunction(), "");
to remove warnings in release mode.

Location:
code/trunk/src/libraries
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • code/trunk/src/libraries/core/ThreadPool.cc

    r7284 r8373  
    2828
    2929#include "ThreadPool.h"
     30
     31#include "util/OrxAssert.h"
    3032#include "Thread.h"
    31 #include <cassert>
    3233
    3334namespace orxonox
     
    4041    ThreadPool::~ThreadPool()
    4142    {
    42         unsigned int a = this->setNrOfThreads(0);
    43         assert(a == 0);
     43        OrxVerify(this->setNrOfThreads(0) == 0, "" );
    4444    }
    4545
     
    8888            if ( ! (*it)->isWorking() )
    8989            {
    90                 bool b = (*it)->evaluateExecutor( executor );
    91                 assert(b); // if b is false then there is some code error
     90                // If that fails, then there is some code error
     91                OrxVerify( (*it)->evaluateExecutor( executor ), "" );
    9292                return true;
    9393            }
     
    9696        {
    9797            addThreads( 1 );
    98             bool b = this->threadPool_.back()->evaluateExecutor( executor ); // access the last element
    99             assert(b);
     98            OrxVerify( this->threadPool_.back()->evaluateExecutor( executor ), "" ); // access the last element
    10099            return true;
    101100        }
  • code/trunk/src/libraries/network/GamestateManager.cc

    r8327 r8373  
    5454#include "util/Debug.h"
    5555#include "util/Clock.h"
     56#include "util/OrxAssert.h"
    5657// #include "TrafficControl.h"
    5758
     
    108109    // now push only the most recent gamestates we received (ignore obsolete ones)
    109110    for(it = gamestateQueue.begin(); it!=gamestateQueue.end(); it++){
    110       bool b = processGamestate(it->second);
    111       assert(b);
     111      OrxVerify(processGamestate(it->second), "");
    112112      sendAck( it->second->getID(), it->second->getPeerID() );
    113113      delete it->second;
     
    252252
    253253
    254 //     bool b = gs->compressData();
    255 //     assert(b);
     254//     OrxVerify(gs->compressData(), "");
    256255    clock.capture();
    257256    COUT(5) << "diff and compress time: " << clock.getDeltaTime() << endl;
     
    363362    if(gs->isCompressed())
    364363    {
    365        bool b = gs->decompressData();
    366        assert(b);
     364       OrxVerify(gs->decompressData(), "");
    367365    }
    368366    assert(!gs->isDiffed());
  • code/trunk/src/libraries/network/packet/Gamestate.cc

    r8327 r8373  
    3232
    3333#include "util/Debug.h"
     34#include "util/OrxAssert.h"
    3435#include "core/GameMode.h"
    3536#include "core/ObjectList.h"
     
    201202    {
    202203//       COUT(4) << "updating object of classid " << objectheader.getClassID() << endl;
    203       bool b = s->updateData(mem, mode);
    204       assert(b);
     204      OrxVerify(s->updateData(mem, mode), "");
    205205    }
    206206  }
Note: See TracChangeset for help on using the changeset viewer.