Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Aug 30, 2010, 8:07:38 PM (14 years ago)
Author:
rgrieder
Message:

There is no such word as "casted".
Also inserted 4 static_casts and replaced dynamic_cast with orxonox_cast in WeakPtr and SmartPtr.
Moreover found some weird code in Iterator.h with casting. Casting a NULL pointer always yields another NULL pointer.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/trunk/src/libraries/core/Iterator.h

    r7268 r7271  
    3232
    3333    The Iterator of a given class allows to iterate through an ObjectList. Objects in
    34     this list are casted to the template argument of the Iterator.
     34    this list are cast to the template argument of the Iterator.
    3535
    3636    Usage:
     
    9595            inline Iterator(ObjectListElement<O>* element)
    9696            {
    97                 this->element_ = (element) ? static_cast<ObjectListBaseElement*>(element) : 0;
     97                this->element_ = element;
    9898                this->list_ = ClassIdentifier<O>::getIdentifier()->getObjects();
    9999                this->list_->registerIterator(this);
     
    107107            inline Iterator(const ObjectListIterator<O>& other)
    108108            {
    109                 this->element_ = (other.element_) ? static_cast<ObjectListBaseElement*>(other.element_) : 0;
     109                this->element_ = other.element_;
    110110                this->list_ = ClassIdentifier<O>::getIdentifier()->getObjects();
    111111                this->list_->registerIterator(this);
     
    162162                    this->list_->unregisterIterator(this);
    163163
    164                 this->element_ = (element) ? static_cast<ObjectListBaseElement*>(element) : 0;
     164                this->element_ = element;
    165165                this->list_ = ClassIdentifier<O>::getIdentifier()->getObjects();
    166166                this->list_->registerIterator(this);
     
    179179                    this->list_->unregisterIterator(this);
    180180
    181                 this->element_ = (other.element_) ? static_cast<ObjectListBaseElement*>(other.element_) : 0;
     181                this->element_ = other.element_;
    182182                this->list_ = ClassIdentifier<O>::getIdentifier()->getObjects();
    183183                this->list_->registerIterator(this);
Note: See TracChangeset for help on using the changeset viewer.