diff options
author | lloyd <[email protected]> | 2012-04-20 00:28:47 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2012-04-20 00:28:47 +0000 |
commit | c40782923f9974aa5bfdadd6d4b08ea79f9244f7 (patch) | |
tree | aa5b1e05d4735f1d7dad83031d1c1c9c12bae59b /src/alloc | |
parent | 538804d54463fca05621990662f34a6251f0adf7 (diff) |
Avoid a few maintainer mode flag warnings. Remove -Weffc++ from the
list of maintainer mode flags. It produces some very useful warnings,
but also a lot of noisy junk that I really don't care about.
Diffstat (limited to 'src/alloc')
-rw-r--r-- | src/alloc/alloc_mmap/mmap_mem.cpp | 6 | ||||
-rw-r--r-- | src/alloc/secmem.h | 9 |
2 files changed, 9 insertions, 6 deletions
diff --git a/src/alloc/alloc_mmap/mmap_mem.cpp b/src/alloc/alloc_mmap/mmap_mem.cpp index e4b602764..17c189e9b 100644 --- a/src/alloc/alloc_mmap/mmap_mem.cpp +++ b/src/alloc/alloc_mmap/mmap_mem.cpp @@ -128,15 +128,17 @@ void MemoryMapping_Allocator::dealloc_block(void* ptr, size_t n) const byte PATTERNS[] = { 0x00, 0xF5, 0x5A, 0xAF, 0x00 }; + // The char* casts are for Solaris, args are void* on most other systems + for(size_t i = 0; i != sizeof(PATTERNS); ++i) { std::memset(ptr, PATTERNS[i], n); - if(::msync((char*)ptr, n, MS_SYNC)) + if(::msync(static_cast<char*>(ptr), n, MS_SYNC)) throw MemoryMapping_Failed("Sync operation failed"); } - if(::munmap((char*)ptr, n)) + if(::munmap(static_cast<char*>(ptr), n)) throw MemoryMapping_Failed("Could not unmap file"); } diff --git a/src/alloc/secmem.h b/src/alloc/secmem.h index 2552343d6..884f2ebc0 100644 --- a/src/alloc/secmem.h +++ b/src/alloc/secmem.h @@ -172,11 +172,12 @@ class MemoryRegion * Copy constructor * @param other the other region to copy */ - MemoryRegion(const MemoryRegion<T>& other) + MemoryRegion(const MemoryRegion<T>& other) : + buf(0), + used(0), + allocated(0), + alloc(other.alloc) { - buf = 0; - used = allocated = 0; - alloc = other.alloc; resize(other.size()); copy(&other[0], other.size()); } |