Changeset 10765 for code/branches/cpp11_v2/src/libraries/util
- Timestamp:
- Nov 4, 2015, 10:25:42 PM (9 years ago)
- 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 93 93 { 94 94 HANDLE hData = GetClipboardData(CF_TEXT); 95 if (hData == NULL)95 if (hData == nullptr) 96 96 return ""; 97 97 std::string output(static_cast<char*>(GlobalLock(hData))); -
code/branches/cpp11_v2/src/libraries/util/DestructionHelper.h
r8423 r10765 36 36 /** Deletes an object and resets the pointer 37 37 @param object 38 Pointer to an object. Handing over NULLis safe.38 Pointer to an object. Handing over nullptr is safe. 39 39 */ 40 40 template <class T> … … 42 42 { 43 43 delete *object; 44 *object = NULL;44 *object = nullptr; 45 45 } 46 46 -
code/branches/cpp11_v2/src/libraries/util/SharedPtr.h
r10745 r10765 215 215 216 216 public: 217 /// Default constructor, the pointer is set to NULL.217 /// Default constructor, the pointer is set to nullptr. 218 218 inline SharedPtr() : pointer_(0), counter_(0) 219 219 { … … 310 310 } 311 311 312 /// Returns true if the pointer is not NULL.312 /// Returns true if the pointer is not nullptr. 313 313 inline operator bool() const 314 314 { -
code/branches/cpp11_v2/src/libraries/util/SignalHandler.cc
r9682 r10765 44 44 namespace orxonox 45 45 { 46 SignalHandler* SignalHandler::singletonPtr_s = NULL;46 SignalHandler* SignalHandler::singletonPtr_s = nullptr; 47 47 } 48 48 … … 175 175 dup2( gdbErr[1], STDERR_FILENO ); 176 176 177 execlp( "sh", "sh", "-c", "gdb", static_cast<void*>( NULL));177 execlp( "sh", "sh", "-c", "gdb", static_cast<void*>(nullptr)); 178 178 } 179 179 … … 186 186 perror("pipe failed!\n"); 187 187 kill( gdbPid, SIGTERM ); 188 waitpid( gdbPid, NULL, 0 );188 waitpid( gdbPid, nullptr, 0 ); 189 189 exit(EXIT_FAILURE); 190 190 } … … 196 196 perror("fork failed!\n"); 197 197 kill( gdbPid, SIGTERM ); 198 waitpid( gdbPid, NULL, 0 );198 waitpid( gdbPid, nullptr, 0 ); 199 199 exit(EXIT_FAILURE); 200 200 } … … 297 297 298 298 299 waitpid( sigPid, NULL, 0 );300 waitpid( gdbPid, NULL, 0 );299 waitpid( sigPid, nullptr, 0 ); 300 waitpid( gdbPid, nullptr, 0 ); 301 301 302 302 int wsRemoved = 0; … … 312 312 bt.erase(0, 1); 313 313 314 time_t now = time( NULL);314 time_t now = time(nullptr); 315 315 316 316 std::string timeString = … … 388 388 SignalHandler::SignalHandler() 389 389 { 390 this->prevExceptionFilter_ = NULL;390 this->prevExceptionFilter_ = nullptr; 391 391 } 392 392 … … 394 394 SignalHandler::~SignalHandler() 395 395 { 396 if (this->prevExceptionFilter_ != NULL)396 if (this->prevExceptionFilter_ != nullptr) 397 397 { 398 398 // Remove the unhandled exception filter function 399 399 SetUnhandledExceptionFilter(this->prevExceptionFilter_); 400 this->prevExceptionFilter_ = NULL;400 this->prevExceptionFilter_ = nullptr; 401 401 } 402 402 } … … 408 408 409 409 // 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) 413 413 { 414 414 // Install the unhandled exception filter function … … 441 441 std::ofstream crashlog(SignalHandler::getInstance().filename_.c_str()); 442 442 443 time_t now = time( NULL);443 time_t now = time(nullptr); 444 444 445 445 crashlog << "=======================================================" << endl; … … 480 480 } 481 481 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. 483 483 /* static */ std::string SignalHandler::getStackTrace(PEXCEPTION_POINTERS pExceptionInfo) 484 484 { … … 625 625 #ifdef ORXONOX_COMPILER_GCC 626 626 int status; 627 char* demangled = __cxxabiv1::__cxa_demangle(symbol->Name, NULL, NULL, &status);627 char* demangled = __cxxabiv1::__cxa_demangle(symbol->Name, nullptr, nullptr, &status); 628 628 if (demangled) 629 629 { … … 684 684 HMODULE hModule; 685 685 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"); 687 687 output += " caused "; 688 688 -
code/branches/cpp11_v2/src/libraries/util/SignalHandler.h
r9550 r10765 113 113 void doCatch(const std::string& appName, const std::string& filename); 114 114 115 static std::string getStackTrace(PEXCEPTION_POINTERS pExceptionInfo = NULL);115 static std::string getStackTrace(PEXCEPTION_POINTERS pExceptionInfo = nullptr); 116 116 static std::string getExceptionType(PEXCEPTION_POINTERS pExceptionInfo); 117 117 -
code/branches/cpp11_v2/src/libraries/util/Singleton.h
r10624 r10765 66 66 And don't forget to initialize the static singleton pointer in the source (*.cc) %file: 67 67 @code 68 TestSingleton* TestSingleton::singletonPtr_s = NULL;68 TestSingleton* TestSingleton::singletonPtr_s = nullptr; 69 69 @endcode 70 70 … … 118 118 static T& getInstance() 119 119 { 120 OrxVerify(T::singletonPtr_s != NULL, "T=" << typeid(T).name());120 OrxVerify(T::singletonPtr_s != nullptr, "T=" << typeid(T).name()); 121 121 return *T::singletonPtr_s; 122 122 } … … 125 125 static bool exists() 126 126 { 127 return (T::singletonPtr_s != NULL);127 return (T::singletonPtr_s != nullptr); 128 128 } 129 129 … … 132 132 Singleton() 133 133 { 134 OrxVerify(T::singletonPtr_s == NULL, "T=" << typeid(T).name());134 OrxVerify(T::singletonPtr_s == nullptr, "T=" << typeid(T).name()); 135 135 T::singletonPtr_s = static_cast<T*>(this); 136 136 } … … 139 139 virtual ~Singleton() 140 140 { 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; 143 143 } 144 144 -
code/branches/cpp11_v2/src/libraries/util/SmallObjectAllocator.cc
r7401 r10765 97 97 setNext(block + i * this->chunkSize_, block + (i + 1) * this->chunkSize_); 98 98 99 // the next_ pointer of the last chunk must point to NULL99 // the next_ pointer of the last chunk must point to nullptr 100 100 setNext(block + (this->numChunksPerBlock_ - 1) * this->chunkSize_, 0); 101 101
Note: See TracChangeset
for help on using the changeset viewer.