aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorlloyd <[email protected]>2010-09-07 13:05:01 +0000
committerlloyd <[email protected]>2010-09-07 13:05:01 +0000
commitad3427826a6dc2113142f1fbee158d79cd3e046d (patch)
tree4c39050119a164eb6396a3d05e52fdedc3dc5171 /src
parent6948821a25bcca3efea8eb2c32d5a0cb9d627efe (diff)
Cast the first argument to msync, munmap, mlock, and munlock to char*
to fix compilation on Solaris. Everybody else, including POSIX.1, uses void* here, but as usual Solaris likes to be special.
Diffstat (limited to 'src')
-rw-r--r--src/alloc/alloc_mmap/mmap_mem.cpp4
-rw-r--r--src/utils/mlock.cpp4
2 files changed, 4 insertions, 4 deletions
diff --git a/src/alloc/alloc_mmap/mmap_mem.cpp b/src/alloc/alloc_mmap/mmap_mem.cpp
index a2059a6ea..2b27b2908 100644
--- a/src/alloc/alloc_mmap/mmap_mem.cpp
+++ b/src/alloc/alloc_mmap/mmap_mem.cpp
@@ -120,11 +120,11 @@ void MemoryMapping_Allocator::dealloc_block(void* ptr, u32bit n)
{
std::memset(ptr, PATTERNS[j], n);
- if(::msync(ptr, n, MS_SYNC))
+ if(::msync((char*)ptr, n, MS_SYNC))
throw MemoryMapping_Failed("Sync operation failed");
}
- if(::munmap(ptr, n))
+ if(::munmap((char*)ptr, n))
throw MemoryMapping_Failed("Could not unmap file");
}
diff --git a/src/utils/mlock.cpp b/src/utils/mlock.cpp
index bc6ddc67e..ce5ae8aed 100644
--- a/src/utils/mlock.cpp
+++ b/src/utils/mlock.cpp
@@ -31,7 +31,7 @@ bool has_mlock()
bool lock_mem(void* ptr, u32bit bytes)
{
#if defined(BOTAN_TARGET_OS_HAS_POSIX_MLOCK)
- return (::mlock(ptr, bytes) == 0);
+ return (::mlock((char*)ptr, bytes) == 0);
#elif defined(BOTAN_TARGET_OS_HAS_WIN32_VIRTUAL_LOCK)
return (::VirtualLock(ptr, bytes) != 0);
#else
@@ -45,7 +45,7 @@ bool lock_mem(void* ptr, u32bit bytes)
void unlock_mem(void* ptr, u32bit bytes)
{
#if defined(BOTAN_TARGET_OS_HAS_POSIX_MLOCK)
- ::munlock(ptr, bytes);
+ ::munlock((char*)ptr, bytes);
#elif defined(BOTAN_TARGET_OS_HAS_WIN32_VIRTUAL_LOCK)
::VirtualUnlock(ptr, bytes);
#endif