Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jul 18, 2009, 4:03:59 PM (15 years ago)
Author:
rgrieder
Message:

Found even more casts. They sure aren't all of them, but I hope to have caught every pointer C-style cast because they can be very dangerous.
Note: I didn't do the pointer casts in the network library because that would have taken way too long.

Location:
code/trunk/src/orxonox/objects
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • code/trunk/src/orxonox/objects/Scene.cc

    r3280 r3301  
    325325    {
    326326        // get the WorldEntity pointers
    327         WorldEntity* object0 = (WorldEntity*)colObj0->getUserPointer();
     327        WorldEntity* object0 = static_cast<WorldEntity*>(colObj0->getUserPointer());
    328328        assert(dynamic_cast<WorldEntity*>(object0));
    329         WorldEntity* object1 = (WorldEntity*)colObj1->getUserPointer();
     329        WorldEntity* object1 = static_cast<WorldEntity*>(colObj1->getUserPointer());
    330330        assert(dynamic_cast<WorldEntity*>(object1));
    331331
  • code/trunk/src/orxonox/objects/collisionshapes/CollisionShape.h

    r2662 r3301  
    6363            virtual void setScale3D(const Vector3& scale);
    6464            virtual void setScale(float scale);
    65             inline const Vector3& getScale3D(void) const
     65            inline const Vector3& getScale3D() const
    6666                { return this->scale_; }
    6767
  • code/trunk/src/orxonox/objects/controllers/WaypointPatrolController.cc

    r3196 r3301  
    8585
    8686        Vector3 myposition = this->getControllableEntity()->getPosition();
    87         float shortestsqdistance = (unsigned int)-1;
     87        float shortestsqdistance = static_cast<unsigned int>(-1);
    8888
    8989        for (ObjectList<Pawn>::iterator it = ObjectList<Pawn>::begin(); it != ObjectList<Pawn>::end(); ++it)
  • code/trunk/src/orxonox/objects/gametypes/TeamDeathmatch.cc

    r3300 r3301  
    7474                playersperteam[it->second]++;
    7575
    76         unsigned int minplayers = (unsigned int)-1;
     76        unsigned int minplayers = static_cast<unsigned int>(-1);
    7777        size_t minplayersteam = 0;
    7878        for (size_t i = 0; i < this->teams_; ++i)
  • code/trunk/src/orxonox/objects/gametypes/UnderAttack.cc

    r3300 r3301  
    5151
    5252        this->setConfigValues();
    53         this->timesequence_ = static_cast<this->gameTime_);
     53        this->timesequence_ = static_cast<int>(this->gameTime_);
    5454    }
    5555
  • code/trunk/src/orxonox/objects/weaponsystem/Munition.cc

    r3196 r3301  
    354354            return false;
    355355
    356         if (amount <= (unsigned int)needed_magazines)
     356        if (amount <= static_cast<unsigned int>(needed_magazines))
    357357        {
    358358            // We need more magazines than we get, so just add them
  • code/trunk/src/orxonox/objects/weaponsystem/WeaponSystem.h

    r3196 r3301  
    8484
    8585            static const unsigned int MAX_FIRE_MODES = 8;
    86             static const unsigned int FIRE_MODE_UNASSIGNED = (unsigned int)-1;
     86            static const unsigned int FIRE_MODE_UNASSIGNED = static_cast<unsigned int>(-1);
    8787
    8888            static const unsigned int MAX_WEAPON_MODES = 8;
    89             static const unsigned int WEAPON_MODE_UNASSIGNED = (unsigned int)-1;
     89            static const unsigned int WEAPON_MODE_UNASSIGNED = static_cast<unsigned int>(-1);
    9090
    9191        private:
  • code/trunk/src/orxonox/objects/worldentities/ParticleEmitter.h

    r3300 r3301  
    6666                { this->LOD_ = static_cast<LODParticle::Value>(level); this->LODchanged(); }
    6767            inline unsigned int getLODxml() const
    68                 { return (unsigned int)this->LOD_; }
     68                { return static_cast<unsigned int>(this->LOD_); }
    6969
    7070            void sourceChanged();
  • code/trunk/src/orxonox/objects/worldentities/WorldEntity.h

    r3196 r3301  
    148148            inline void setScale3D(float x, float y, float z)
    149149                { this->setScale3D(Vector3(x, y, z)); }
    150             const Vector3& getScale3D(void) const;
     150            const Vector3& getScale3D() const;
    151151            const Vector3& getWorldScale3D() const;
    152152
     
    457457    inline const Quaternion& WorldEntity::getOrientation() const
    458458        { return this->node_->getOrientation(); }
    459     inline const Vector3& WorldEntity::getScale3D(void) const
     459    inline const Vector3& WorldEntity::getScale3D() const
    460460        { return this->node_->getScale(); }
    461461#endif
Note: See TracChangeset for help on using the changeset viewer.