Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 2506


Ignore:
Timestamp:
Dec 17, 2008, 6:18:41 PM (16 years ago)
Author:
rgrieder
Message:

Changed all C-Style casts with C++ casts that I was able to find with a regex.

Location:
code/branches/presentation/src
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • code/branches/presentation/src/core/Iterator.h

    r2171 r2506  
    9696            inline Iterator(ObjectListElement<O>* element)
    9797            {
    98                 this->element_ = (element) ? (ObjectListBaseElement*)element : 0;
     98                this->element_ = (element) ? static_cast<ObjectListBaseElement*<(element) : 0;
    9999                this->list_ = ClassIdentifier<O>::getIdentifier()->getObjects();
    100100                this->iterator_ = this->list_->registerIterator(this);
     
    108108            inline Iterator(const ObjectListIterator<O>& other)
    109109            {
    110                 this->element_ = (other.element_) ? (ObjectListBaseElement*)other.element_ : 0;
     110                this->element_ = (other.element_) ? static_cast<ObjectListBaseElement*>(other.element_) : 0;
    111111                this->list_ = ClassIdentifier<O>::getIdentifier()->getObjects();
    112112                this->iterator_ = this->list_->registerIterator(this);
     
    163163                    this->list_->unregisterIterator(this->iterator_);
    164164
    165                 this->element_ = (element) ? (ObjectListBaseElement*)element : 0;
     165                this->element_ = (element) ? static_cast<ObjectListBaseElement*>(element) : 0;
    166166                this->list_ = ClassIdentifier<O>::getIdentifier()->getObjects();
    167167                this->iterator_ = this->list_->registerIterator(this);
  • code/branches/presentation/src/network/packet/DeleteObjects.cc

    r2371 r2506  
    6565  data_ = new uint8_t[size];
    6666  uint8_t *tdata = data_;
    67   *(ENUM::Type *)(tdata) = ENUM::DeleteObjects;
     67  *reinterpret_cast<ENUM::Type*>(tdata) = ENUM::DeleteObjects;
    6868  tdata += sizeof(ENUM::Type);
    6969  *(uint32_t *)tdata = number;
     
    7272    unsigned int temp = Synchronisable::popDeletedObject();
    7373//     assert(temp<10000); //ugly hack
    74     *(uint32_t *)(tdata) = temp;
     74    *reinterpret_cast<uint32_t*>(tdata) = temp;
    7575    COUT(3) << temp << " ";
    7676    tdata += sizeof(uint32_t);
  • code/branches/presentation/src/orxonox/objects/controllers/ArtificialController.cc

    r2493 r2506  
    8888        {
    8989//            if (it->getTeamNr() != this->getTeamNr())
    90             if ((ControllableEntity*)(*it) != this->getControllableEntity())
     90            if (static_cast<ControllableEntity*>(*it) != this->getControllableEntity())
    9191            {
    9292                float speed = this->getControllableEntity()->getVelocity().length();
  • code/branches/presentation/src/orxonox/objects/worldentities/pawns/Pawn.h

    r2501 r2506  
    8787
    8888            inline const WorldEntity* getWorldEntity() const
    89                 { return (WorldEntity*)this; }
     89                { return const_cast<Pawn*>(this); }
    9090
    9191            inline void setSpawnParticleSource(const std::string& source)
  • code/branches/presentation/src/orxonox/tools/Timer.h

    r2485 r2506  
    160160                this->bLoop_ = bLoop;
    161161                executor->setObject(object);
    162                 this->executor_ = (Executor*)executor;
     162                this->executor_ = static_cast<Executor*>(executor);
    163163                this->bActive_ = true;
    164164
     
    198198                this->setInterval(interval);
    199199                this->bLoop_ = bLoop;
    200                 this->executor_ = (Executor*)executor;
     200                this->executor_ = static_cast<Executor*>(executor);
    201201                this->bActive_ = true;
    202202
Note: See TracChangeset for help on using the changeset viewer.