diff options
author | Andrei Karas <akaras@inbox.ru> | 2017-07-06 22:22:23 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2017-07-06 22:22:23 +0300 |
commit | 5d80bf4f75f838867d3186de315225ec8265eae2 (patch) | |
tree | 6647243e0be8c0f3632b3b43b487bd81e8f27afa /src/debug | |
parent | c3d07bbf19a83f74748d0df628c6d4be9d7f7a20 (diff) | |
download | plus-5d80bf4f75f838867d3186de315225ec8265eae2.tar.gz plus-5d80bf4f75f838867d3186de315225ec8265eae2.tar.bz2 plus-5d80bf4f75f838867d3186de315225ec8265eae2.tar.xz plus-5d80bf4f75f838867d3186de315225ec8265eae2.zip |
Fix different issues in debug_new.cpp
Diffstat (limited to 'src/debug')
-rw-r--r-- | src/debug/debug_new.cpp | 23 | ||||
-rw-r--r-- | src/debug/fast_mutex.h | 2 |
2 files changed, 18 insertions, 7 deletions
diff --git a/src/debug/debug_new.cpp b/src/debug/debug_new.cpp index 0daa66fe1..594796570 100644 --- a/src/debug/debug_new.cpp +++ b/src/debug/debug_new.cpp @@ -34,6 +34,14 @@ * @date 2016-10-14 */ +#include "localconsts.h" + +PRAGMACLANG6GCC(GCC diagnostic push) +PRAGMACLANG6GCC(GCC diagnostic ignored "-Wold-style-cast") + +PRAGMA45(GCC diagnostic push) +PRAGMA45(GCC diagnostic ignored "-Wcast-qual") + #include <new> // std::bad_alloc/nothrow_t #include <assert.h> // assert #include <stdio.h> // fprintf/stderr @@ -199,9 +207,9 @@ * * Value of the padding bytes at the end of a memory block. */ -#ifndef _DEBUG_NEW_TAILCHECK_CHAR -#define _DEBUG_NEW_TAILCHECK_CHAR 0xCC -#endif +//#ifndef _DEBUG_NEW_TAILCHECK_CHAR +//#define _DEBUG_NEW_TAILCHECK_CHAR 0xCC +//#endif /** * @def _DEBUG_NEW_USE_ADDR2LINE @@ -1036,7 +1044,7 @@ void* operator new[](size_t size, const char* file, int line) * insufficient (#_DEBUG_NEW_STD_OPER_NEW is 0) * @throw bad_alloc memory is insufficient (#_DEBUG_NEW_STD_OPER_NEW is 1) */ -void* operator new(size_t size) throw(std::bad_alloc) +void* operator new(size_t size) { return operator new(size, (char*)_DEBUG_NEW_CALLER_ADDRESS, 0); } @@ -1049,7 +1057,7 @@ void* operator new(size_t size) throw(std::bad_alloc) * insufficient (#_DEBUG_NEW_STD_OPER_NEW is 0) * @throw bad_alloc memory is insufficient (#_DEBUG_NEW_STD_OPER_NEW is 1) */ -void* operator new[](size_t size) throw(std::bad_alloc) +void* operator new[](size_t size) { return operator new[](size, (char*)_DEBUG_NEW_CALLER_ADDRESS, 0); } @@ -1183,4 +1191,7 @@ void operator delete[](void* ptr, const std::nothrow_t&) _NOEXCEPT // This is to make Doxygen happy #undef _DEBUG_NEW_REMEMBER_STACK_TRACE -#define _DEBUG_NEW_REMEMBER_STACK_TRACE 0 +//#define _DEBUG_NEW_REMEMBER_STACK_TRACE 0 + +PRAGMA45(GCC diagnostic pop) +PRAGMACLANG6GCC(GCC diagnostic pop) diff --git a/src/debug/fast_mutex.h b/src/debug/fast_mutex.h index bd9fc37d3..39b5fcdc2 100644 --- a/src/debug/fast_mutex.h +++ b/src/debug/fast_mutex.h @@ -237,7 +237,7 @@ NVWA_NAMESPACE_BEGIN : _M_locked(false) # endif { - ::pthread_mutex_init(&_M_mtx_impl, NULL); + ::pthread_mutex_init(&_M_mtx_impl, _NULLPTR); # if _FAST_MUTEX_CHECK_INITIALIZATION _M_initialized = true; # endif |