diff --git a/src/CFGFileParser.h b/src/CFGFileParser.h index e99f13963a12ce59067872ea3ff21c319848fce0..914fb0d628d7d6997a0c7b5ab4f060d4ba9930ef 100644 --- a/src/CFGFileParser.h +++ b/src/CFGFileParser.h @@ -22,7 +22,7 @@ typedef std::unordered_map<fast_string,fast_string,std::function<decltype(despai struct BrowserConfiguration{ stringmap GlobalSettings; // fast allocation! - static void* operator new(size_t n) { if (void *mem = tlsf_malloc(n)) return mem; throw std::bad_alloc {}; } + static void* operator new(std::size_t n) { if (void *mem = tlsf_malloc(n)) return mem; throw std::bad_alloc {}; } static void operator delete(void *p){tlsf_free(p);} void clear(); }; @@ -31,7 +31,7 @@ class CFGFileParser { public: CFGFileParser(const char* filename); ~CFGFileParser(); - static void* operator new(size_t n){ if (void *mem = tlsf_malloc(n)) return mem; throw std::bad_alloc {}; } + static void* operator new(std::size_t n){ if (void *mem = tlsf_malloc(n)) return mem; throw std::bad_alloc {}; } static void operator delete(void *p){tlsf_free(p);} private: FILE *cfg_file; diff --git a/src/TLSFAlloc.h b/src/TLSFAlloc.h index eb4ecdadfa4f20f12d42ba2fdfeeea0d4c8c5820..a4ad820ffb37b38ee609b3d6ad451ef6d8b60fa6 100644 --- a/src/TLSFAlloc.h +++ b/src/TLSFAlloc.h @@ -42,7 +42,7 @@ namespace despair { ptr ret = (ptr)(tlsf_malloc(num*sizeof(T))); std::cerr << " allocated at: " << (void*)ret << std::endl; return ret; #else - ptr ret = reinterpret_cast<ptr>(tlsf_malloc(num*sizeof(T))); return ret; + ptr ret = static_cast<ptr>(tlsf_malloc(num*sizeof(T))); return ret; #endif } // initialize elements of allocated storage p with value value