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/util
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • code/branches/cpp11_v2/src/libraries/util/Math.h

    r10742 r10768  
    200200    template <> inline long double          zeroise<long double>()          { return 0; }
    201201    template <> inline bool                 zeroise<bool>()                 { return 0; }
    202     template <> inline void*                zeroise<void*>()                { return 0; }
     202    template <> inline void*                zeroise<void*>()                { return nullptr; }
    203203    template <> inline std::string          zeroise<std::string>()          { return std::string(); }
    204204    template <> inline orxonox::Radian      zeroise<orxonox::Radian>()      { return orxonox::Radian(0.0f); }
  • code/branches/cpp11_v2/src/libraries/util/MultiType.h

    r10197 r10768  
    266266
    267267            /// Default constructor: Assigns no value and no type. The type will be determined by the first assignment of a value.
    268             inline MultiType()                       : value_(0) { }
     268            inline MultiType()                       : value_(nullptr) { }
    269269            /// Constructor: Assigns the given value and sets the type.
    270270            template <typename V>
    271             inline MultiType(const V& value)         : value_(0) { this->set(value); }
     271            inline MultiType(const V& value)         : value_(nullptr) { this->set(value); }
    272272            /// Copyconstructor: Assigns value and type of the other MultiType.
    273             inline MultiType(const MultiType& other) : value_(0) { this->set(other); }
     273            inline MultiType(const MultiType& other) : value_(nullptr) { this->set(other); }
    274274
    275275            /// Destructor: Deletes the MT_Value.
     
    325325                if (this->value_)
    326326                    delete this->value_;
    327                 this->value_ = (other.value_) ? other.value_->clone() : 0;
     327                this->value_ = (other.value_) ? other.value_->clone() : nullptr;
    328328            }
    329329
     
    332332
    333333            /// Resets value and type. Type will be void afterwards and null() returns true.
    334             inline void reset() { if (this->value_) delete this->value_; this->value_ = 0; }
     334            inline void reset() { if (this->value_) delete this->value_; this->value_ = nullptr; }
    335335            /// Resets the value and changes the internal type to T.
    336336            template <typename T> inline void reset() { this->assignValue(typename Loki::TypeTraits<T>::UnqualifiedReferredType()); }
     
    486486    template <> inline long double          MultiType::get() const { return (this->value_ ? this->value_->get<long double>()          : 0); }
    487487    template <> inline bool                 MultiType::get() const { return (this->value_ ? this->value_->get<bool>()                 : 0); }
    488     template <> inline void*                MultiType::get() const { return (this->value_ ? this->value_->get<void*>()                : 0); }
     488    template <> inline void*                MultiType::get() const { return (this->value_ ? this->value_->get<void*>()                : nullptr); }
    489489    template <> inline std::string          MultiType::get() const { return (this->value_ ? this->value_->get<std::string>()          : NilValue<std::string>()); }
    490490    template <> inline orxonox::Vector2     MultiType::get() const { return (this->value_ ? this->value_->get<orxonox::Vector2>()     : NilValue<orxonox::Vector2>()); }
  • code/branches/cpp11_v2/src/libraries/util/MultiTypeValue.h

    r9550 r10768  
    7777        inline bool getValue(long double*          value) const { return convertValue<T, long double         >(value, value_, 0); } ///< Assigns the value to the given pointer. The value gets converted if the types don't match.
    7878        inline bool getValue(bool*                 value) const { return convertValue<T, bool                >(value, value_, 0); } ///< Assigns the value to the given pointer. The value gets converted if the types don't match.
    79         inline bool getValue(void**                value) const { return convertValue<T, void*               >(value, value_, 0); } ///< Assigns the value to the given pointer. The value gets converted if the types don't match.
     79        inline bool getValue(void**                value) const { return convertValue<T, void*               >(value, value_, nullptr); } ///< Assigns the value to the given pointer. The value gets converted if the types don't match.
    8080        inline bool getValue(std::string*          value) const { return convertValue<T, std::string         >(value, value_, NilValue<std::string>         ()); } ///< Assigns the value to the given pointer. The value gets converted if the types don't match.
    8181        inline bool getValue(orxonox::Vector2*     value) const { return convertValue<T, orxonox::Vector2    >(value, value_, NilValue<orxonox::Vector2>    ()); } ///< Assigns the value to the given pointer. The value gets converted if the types don't match.
  • code/branches/cpp11_v2/src/libraries/util/SharedPtr.h

    r10765 r10768  
    216216        public:
    217217            /// Default constructor, the pointer is set to nullptr.
    218             inline SharedPtr() : pointer_(0), counter_(0)
     218            inline SharedPtr() : pointer_(nullptr), counter_(nullptr)
    219219            {
    220220            }
    221221
    222222            /// Constructor, creates a SharedPtr that points to @a pointer, increments the counter.
    223             inline SharedPtr(T* pointer) : pointer_(pointer), counter_(0)
     223            inline SharedPtr(T* pointer) : pointer_(pointer), counter_(nullptr)
    224224            {
    225225                if (this->pointer_)
     
    293293            inline T* operator->() const
    294294            {
    295                 assert(this->pointer_ != 0);
     295                assert(this->pointer_ != nullptr);
    296296                return this->pointer_;
    297297            }
     
    300300            inline T& operator*() const
    301301            {
    302                 assert(this->pointer_ != 0);
     302                assert(this->pointer_ != nullptr);
    303303                return *this->pointer_;
    304304            }
     
    313313            inline operator bool() const
    314314            {
    315                 return (this->pointer_ != 0);
     315                return (this->pointer_ != nullptr);
    316316            }
    317317
  • code/branches/cpp11_v2/src/libraries/util/SignalHandler.cc

    r10765 r10768  
    127127      }
    128128      // if the signalhandler has already been destroyed then don't do anything
    129       if( SignalHandler::singletonPtr_s == 0 )
     129      if( SignalHandler::singletonPtr_s == nullptr )
    130130      {
    131131        orxout(user_error) << "Received signal " << sigName.c_str() << endl << "Can't write backtrace because SignalHandler is already destroyed" << endl;
     
    430430
    431431            // if the signalhandler has already been destroyed then don't do anything
    432             if (SignalHandler::singletonPtr_s == 0)
     432            if (SignalHandler::singletonPtr_s == nullptr)
    433433            {
    434434                orxout(user_error) << "Caught an unhandled exception" << endl << "Can't write backtrace because SignalHandler is already destroyed" << endl;
  • code/branches/cpp11_v2/src/libraries/util/SmallObjectAllocator.cc

    r10765 r10768  
    4545        this->chunkSize_ = std::max(objectSize, sizeof(Chunk)); // the chunk's size will be the maximum of the object's size and the size of a Chunk object itself
    4646        this->numChunksPerBlock_ = numObjects;
    47         this->first_ = 0;
     47        this->first_ = nullptr;
    4848    }
    4949
     
    9898
    9999            // the next_ pointer of the last chunk must point to nullptr
    100             setNext(block + (this->numChunksPerBlock_ - 1) * this->chunkSize_, 0);
     100            setNext(block + (this->numChunksPerBlock_ - 1) * this->chunkSize_, nullptr);
    101101
    102102            // The second chunk in the block is assigned to the first_ pointer
  • code/branches/cpp11_v2/src/libraries/util/output/OutputManager.cc

    r9550 r10768  
    5757
    5858        this->isInitialized_ = false;
    59         this->memoryWriterInstance_ = 0;
    60         this->consoleWriterInstance_ = 0;
    61         this->logWriterInstance_ = 0;
     59        this->memoryWriterInstance_ = nullptr;
     60        this->consoleWriterInstance_ = nullptr;
     61        this->logWriterInstance_ = nullptr;
    6262
    6363        // register 'undefined' context in order to give it always the first context-ID
Note: See TracChangeset for help on using the changeset viewer.