Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Nov 6, 2015, 10:54:34 PM (9 years ago)
Author:
landauf
Message:

replace '0' by 'nullptr'

Location:
code/branches/cpp11_v2/src/libraries/core/class
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • code/branches/cpp11_v2/src/libraries/core/class/Identifiable.cc

    r10624 r10768  
    4848    Identifiable::Identifiable()
    4949    {
    50         this->identifier_ = 0;
     50        this->identifier_ = nullptr;
    5151        this->objectPointers_.reserve(6); // Optimisation
    5252
  • code/branches/cpp11_v2/src/libraries/core/class/Identifier.cc

    r10624 r10768  
    117117            orxout(user_error) << "Aborting..." << endl;
    118118            abort();
    119             return 0;
     119            return nullptr;
    120120        }
    121121    }
     
    393393            return it->second;
    394394        else
    395             return 0;
     395            return nullptr;
    396396    }
    397397
     
    407407            return it->second;
    408408        else
    409             return 0;
     409            return nullptr;
    410410    }
    411411
     
    438438            return it->second;
    439439        else
    440             return 0;
     440            return nullptr;
    441441    }
    442442
  • code/branches/cpp11_v2/src/libraries/core/class/Identifier.h

    r10765 r10768  
    5656    object->getIdentifier()->getName();                                         // returns "MyClass"
    5757
    58     Identifiable* other = object->getIdentifier()->fabricate(0);                // fabricates a new instance of MyClass
     58    Identifiable* other = object->getIdentifier()->fabricate(nullptr);                // fabricates a new instance of MyClass
    5959
    6060
     
    137137
    138138            /// Returns true if the Identifier has a Factory.
    139             inline bool hasFactory() const { return (this->factory_ != 0); }
     139            inline bool hasFactory() const { return (this->factory_ != nullptr); }
    140140
    141141            Identifiable* fabricate(Context* context);
     
    297297
    298298            virtual bool canDynamicCastObjectToIdentifierClass(Identifiable* object) const
    299                 { return dynamic_cast<T*>(object) != 0; }
     299                { return dynamic_cast<T*>(object) != nullptr; }
    300300
    301301            virtual void destroyObjects();
     
    408408    void ClassIdentifier<T>::destroyObjects()
    409409    {
    410         this->destroyObjects((T*)0);
     410        this->destroyObjects((T*)nullptr);
    411411    }
    412412
  • code/branches/cpp11_v2/src/libraries/core/class/IdentifierManager.cc

    r10765 r10768  
    4444namespace orxonox
    4545{
    46     IdentifierManager* IdentifierManager::singletonPtr_s = 0;
     46    IdentifierManager* IdentifierManager::singletonPtr_s = nullptr;
    4747
    4848    IdentifierManager::IdentifierManager()
     
    221221            return it->second;
    222222        else
    223             return 0;
     223            return nullptr;
    224224    }
    225225
     
    235235            return it->second;
    236236        else
    237             return 0;
     237            return nullptr;
    238238    }
    239239
     
    249249            return it->second;
    250250        else
    251             return 0;
     251            return nullptr;
    252252    }
    253253
     
    263263            if ((*it)->getTypeInfo() == typeInfo)
    264264                return (*it);
    265         return 0;
     265        return nullptr;
    266266    }
    267267
  • code/branches/cpp11_v2/src/libraries/core/class/SubclassIdentifier.h

    r10765 r10768  
    189189                    orxout(user_error) << "Aborting..." << endl;
    190190                    abort();
    191                     return 0;
     191                    return nullptr;
    192192                }
    193193            }
  • code/branches/cpp11_v2/src/libraries/core/class/Super.h

    r10624 r10768  
    9494            static void superCheck() \
    9595            { \
    96                 SuperFunctionCondition<functionnumber, T, 0, templatehack2>::apply(static_cast<T*>(0)); \
     96                SuperFunctionCondition<functionnumber, T, 0, templatehack2>::apply(static_cast<T*>(nullptr)); \
    9797                SuperFunctionCondition<functionnumber + 1, T, 0, templatehack2>::superCheck(); \
    9898            } \
     
    108108                    { \
    109109                        delete ((ClassIdentifier<T>*)(*it))->superFunctionCaller_##functionname##_; \
    110                         ((ClassIdentifier<T>*)(*it))->superFunctionCaller_##functionname##_ = 0; \
     110                        ((ClassIdentifier<T>*)(*it))->superFunctionCaller_##functionname##_ = nullptr; \
    111111                        ((ClassIdentifier<T>*)(*it))->bSuperFunctionCaller_##functionname##_isFallback_ = false; \
    112112                    } \
     
    154154                // This call to the apply-function is the whole check. By calling the function with
    155155                // a T* pointer, the right function get's called.
    156                 SuperFunctionCondition<functionnumber, T, 0, templatehack2>::apply(static_cast<T*>(0));
     156                SuperFunctionCondition<functionnumber, T, 0, templatehack2>::apply(static_cast<T*>(nullptr));
    157157
    158158                // Go go the superCheck for of next super-function (functionnumber + 1)
     
    178178                        // Delete the fallback caller an prepare to get a real caller
    179179                        delete ((ClassIdentifier<T>*)(*it))->superFunctionCaller_##functionname##_;
    180                         ((ClassIdentifier<T>*)(*it))->superFunctionCaller_##functionname##_ = 0;
     180                        ((ClassIdentifier<T>*)(*it))->superFunctionCaller_##functionname##_ = nullptr;
    181181                        ((ClassIdentifier<T>*)(*it))->bSuperFunctionCaller_##functionname##_isFallback_ = false;
    182182                    }
Note: See TracChangeset for help on using the changeset viewer.