Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Nov 4, 2015, 10:25:42 PM (9 years ago)
Author:
landauf
Message:

replace 'NULL' by 'nullptr'

Location:
code/branches/cpp11_v2/src/libraries/util
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • code/branches/cpp11_v2/src/libraries/util/Clipboard.cc

    r8858 r10765  
    9393            {
    9494                HANDLE hData = GetClipboardData(CF_TEXT);
    95                 if (hData == NULL)
     95                if (hData == nullptr)
    9696                    return "";
    9797                std::string output(static_cast<char*>(GlobalLock(hData)));
  • code/branches/cpp11_v2/src/libraries/util/DestructionHelper.h

    r8423 r10765  
    3636    /** Deletes an object and resets the pointer
    3737    @param object
    38         Pointer to an object. Handing over NULL is safe.
     38        Pointer to an object. Handing over nullptr is safe.
    3939    */
    4040    template <class T>
     
    4242    {
    4343        delete *object;
    44         *object = NULL;
     44        *object = nullptr;
    4545    }
    4646
  • code/branches/cpp11_v2/src/libraries/util/SharedPtr.h

    r10745 r10765  
    215215
    216216        public:
    217             /// Default constructor, the pointer is set to NULL.
     217            /// Default constructor, the pointer is set to nullptr.
    218218            inline SharedPtr() : pointer_(0), counter_(0)
    219219            {
     
    310310            }
    311311
    312             /// Returns true if the pointer is not NULL.
     312            /// Returns true if the pointer is not nullptr.
    313313            inline operator bool() const
    314314            {
  • code/branches/cpp11_v2/src/libraries/util/SignalHandler.cc

    r9682 r10765  
    4444namespace orxonox
    4545{
    46     SignalHandler* SignalHandler::singletonPtr_s = NULL;
     46    SignalHandler* SignalHandler::singletonPtr_s = nullptr;
    4747}
    4848
     
    175175        dup2( gdbErr[1], STDERR_FILENO );
    176176
    177         execlp( "sh", "sh", "-c", "gdb", static_cast<void*>(NULL));
     177        execlp( "sh", "sh", "-c", "gdb", static_cast<void*>(nullptr));
    178178      }
    179179
     
    186186        perror("pipe failed!\n");
    187187        kill( gdbPid, SIGTERM );
    188         waitpid( gdbPid, NULL, 0 );
     188        waitpid( gdbPid, nullptr, 0 );
    189189        exit(EXIT_FAILURE);
    190190      }
     
    196196        perror("fork failed!\n");
    197197        kill( gdbPid, SIGTERM );
    198         waitpid( gdbPid, NULL, 0 );
     198        waitpid( gdbPid, nullptr, 0 );
    199199        exit(EXIT_FAILURE);
    200200      }
     
    297297
    298298
    299       waitpid( sigPid, NULL, 0 );
    300       waitpid( gdbPid, NULL, 0 );
     299      waitpid( sigPid, nullptr, 0 );
     300      waitpid( gdbPid, nullptr, 0 );
    301301
    302302      int wsRemoved = 0;
     
    312312        bt.erase(0, 1);
    313313
    314       time_t now = time(NULL);
     314      time_t now = time(nullptr);
    315315
    316316      std::string timeString =
     
    388388    SignalHandler::SignalHandler()
    389389    {
    390         this->prevExceptionFilter_ = NULL;
     390        this->prevExceptionFilter_ = nullptr;
    391391    }
    392392
     
    394394    SignalHandler::~SignalHandler()
    395395    {
    396         if (this->prevExceptionFilter_ != NULL)
     396        if (this->prevExceptionFilter_ != nullptr)
    397397        {
    398398            // Remove the unhandled exception filter function
    399399            SetUnhandledExceptionFilter(this->prevExceptionFilter_);
    400             this->prevExceptionFilter_ = NULL;
     400            this->prevExceptionFilter_ = nullptr;
    401401        }
    402402    }
     
    408408
    409409        // don't register twice
    410         assert(this->prevExceptionFilter_ == NULL);
    411 
    412         if (this->prevExceptionFilter_ == NULL)
     410        assert(this->prevExceptionFilter_ == nullptr);
     411
     412        if (this->prevExceptionFilter_ == nullptr)
    413413        {
    414414            // Install the unhandled exception filter function
     
    441441            std::ofstream crashlog(SignalHandler::getInstance().filename_.c_str());
    442442
    443             time_t now = time(NULL);
     443            time_t now = time(nullptr);
    444444
    445445            crashlog << "=======================================================" << endl;
     
    480480    }
    481481
    482     /// Returns the stack trace for either the current function, or, if @a pExceptionInfo is not NULL, for the given exception context.
     482    /// Returns the stack trace for either the current function, or, if @a pExceptionInfo is not nullptr, for the given exception context.
    483483    /* static */ std::string SignalHandler::getStackTrace(PEXCEPTION_POINTERS pExceptionInfo)
    484484    {
     
    625625#ifdef ORXONOX_COMPILER_GCC
    626626                int status;
    627                 char* demangled = __cxxabiv1::__cxa_demangle(symbol->Name, NULL, NULL, &status);
     627                char* demangled = __cxxabiv1::__cxa_demangle(symbol->Name, nullptr, nullptr, &status);
    628628                if (demangled)
    629629                {
     
    684684        HMODULE hModule;
    685685
    686         std::string output = (GetModuleFileName(NULL, szModule, MAX_PATH) ? SignalHandler::getModuleName(szModule) : "Application");
     686        std::string output = (GetModuleFileName(nullptr, szModule, MAX_PATH) ? SignalHandler::getModuleName(szModule) : "Application");
    687687        output += " caused ";
    688688
  • code/branches/cpp11_v2/src/libraries/util/SignalHandler.h

    r9550 r10765  
    113113            void doCatch(const std::string& appName, const std::string& filename);
    114114
    115             static std::string getStackTrace(PEXCEPTION_POINTERS pExceptionInfo = NULL);
     115            static std::string getStackTrace(PEXCEPTION_POINTERS pExceptionInfo = nullptr);
    116116            static std::string getExceptionType(PEXCEPTION_POINTERS pExceptionInfo);
    117117
  • code/branches/cpp11_v2/src/libraries/util/Singleton.h

    r10624 r10765  
    6666    And don't forget to initialize the static singleton pointer in the source (*.cc) %file:
    6767    @code
    68     TestSingleton* TestSingleton::singletonPtr_s = NULL;
     68    TestSingleton* TestSingleton::singletonPtr_s = nullptr;
    6969    @endcode
    7070
     
    118118        static T& getInstance()
    119119        {
    120             OrxVerify(T::singletonPtr_s != NULL, "T=" << typeid(T).name());
     120            OrxVerify(T::singletonPtr_s != nullptr, "T=" << typeid(T).name());
    121121            return *T::singletonPtr_s;
    122122        }
     
    125125        static bool exists()
    126126        {
    127             return (T::singletonPtr_s != NULL);
     127            return (T::singletonPtr_s != nullptr);
    128128        }
    129129
     
    132132        Singleton()
    133133        {
    134             OrxVerify(T::singletonPtr_s == NULL, "T=" << typeid(T).name());
     134            OrxVerify(T::singletonPtr_s == nullptr, "T=" << typeid(T).name());
    135135            T::singletonPtr_s = static_cast<T*>(this);
    136136        }
     
    139139        virtual ~Singleton()
    140140        {
    141             OrxVerify(T::singletonPtr_s != NULL, "T=" << typeid(T).name());
    142             T::singletonPtr_s = NULL;
     141            OrxVerify(T::singletonPtr_s != nullptr, "T=" << typeid(T).name());
     142            T::singletonPtr_s = nullptr;
    143143        }
    144144
  • code/branches/cpp11_v2/src/libraries/util/SmallObjectAllocator.cc

    r7401 r10765  
    9797                setNext(block + i * this->chunkSize_, block + (i + 1) * this->chunkSize_);
    9898
    99             // the next_ pointer of the last chunk must point to NULL
     99            // the next_ pointer of the last chunk must point to nullptr
    100100            setNext(block + (this->numChunksPerBlock_ - 1) * this->chunkSize_, 0);
    101101
Note: See TracChangeset for help on using the changeset viewer.