Răsfoiți Sursa

Merge pull request #61 from blackberry-gaming/next-sgrenier

Next sgrenier
Steve Grenier 14 ani în urmă
părinte
comite
e414cff5a0
3 a modificat fișierele cu 15 adăugiri și 14 ștergeri
  1. 1 0
      gameplay/src/Base.h
  2. 8 8
      gameplay/src/DebugNew.cpp
  3. 6 6
      gameplay/src/DebugNew.h

+ 1 - 0
gameplay/src/Base.h

@@ -34,6 +34,7 @@ using std::isspace;
 using std::isdigit;
 using std::toupper;
 using std::tolower;
+using std::size_t;
 
 // Common
 #ifndef NULL

+ 8 - 8
gameplay/src/DebugNew.cpp

@@ -18,39 +18,39 @@ struct MemoryAllocationRecord
 MemoryAllocationRecord* __memoryAllocations = 0;
 int __memoryAllocationCount = 0;
 
-void* debugAlloc(size_t size, const char* file, int line);
+void* debugAlloc(std::size_t size, const char* file, int line);
 void debugFree(void* p);
 
 #ifdef _MSC_VER
 #pragma warning( disable : 4290 )
 #endif
 
-void* operator new (size_t size, const char* file, int line)
+void* operator new (std::size_t size, const char* file, int line)
 {
     return debugAlloc(size, file, line);
 }
 
-void* operator new[] (size_t size, const char* file, int line)
+void* operator new[] (std::size_t size, const char* file, int line)
 {
     return operator new (size, file, line);
 }
 
-void* operator new (size_t size) throw(bad_alloc)
+void* operator new (std::size_t size) throw(std::bad_alloc)
 {
     return operator new (size, "", 0);
 }
 
-void* operator new[] (size_t size) throw(bad_alloc)
+void* operator new[] (std::size_t size) throw(std::bad_alloc)
 {
     return operator new (size, "", 0);
 }
 
-void* operator new (size_t size, const nothrow_t&) throw()
+void* operator new (std::size_t size, const std::nothrow_t&) throw()
 {
     return operator new (size, "", 0);
 }
 
-void* operator new[] (size_t size, const nothrow_t&) throw()
+void* operator new[] (std::size_t size, const std::nothrow_t&) throw()
 {
     return operator new (size, "", 0);
 }
@@ -82,7 +82,7 @@ void operator delete[] (void* p, const char* file, int line) throw()
 // Include Base.h (needed for logging macros) AFTER new operator impls
 #include "Base.h"
 
-void* debugAlloc(size_t size, const char* file, int line)
+void* debugAlloc(std::size_t size, const char* file, int line)
 {
     // Allocate memory + size for a MemoryAlloctionRecord
     unsigned char* mem = (unsigned char*)malloc(size + sizeof(MemoryAllocationRecord));

+ 6 - 6
gameplay/src/DebugNew.h

@@ -18,12 +18,12 @@ extern void printMemoryLeaks();
 #ifdef _MSC_VER
 #pragma warning( disable : 4290 ) // C++ exception specification ignored.
 #endif
-void* operator new (size_t size, const char* file, int line);
-void* operator new[] (size_t size, const char* file, int line);
-void* operator new (size_t size) throw(bad_alloc);
-void* operator new[] (size_t size) throw(bad_alloc);
-void* operator new (size_t size, const nothrow_t&) throw();
-void* operator new[] (size_t size, const nothrow_t&) throw();
+void* operator new (std::size_t size, const char* file, int line);
+void* operator new[] (std::size_t size, const char* file, int line);
+void* operator new (std::size_t size) throw(std::bad_alloc);
+void* operator new[] (std::size_t size) throw(std::bad_alloc);
+void* operator new (std::size_t size, const std::nothrow_t&) throw();
+void* operator new[] (std::size_t size, const std::nothrow_t&) throw();
 void operator delete (void* p) throw();
 void operator delete[] (void* p) throw();
 void operator delete (void* p, const char* file, int line) throw();