diff options
author | lloyd <[email protected]> | 2011-04-18 18:35:38 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2011-04-18 18:35:38 +0000 |
commit | c4bedb32c0547e8f6b67ece566050073726120f5 (patch) | |
tree | 17183000888bda5156637360d10d9901ced3565b /src/utils | |
parent | 06a32c91e639cc2b0c636553a8aa395aa90d4d37 (diff) |
Maintainer mode warning cleanups, mostly for C style casts which I
added to the flags here.
Diffstat (limited to 'src/utils')
-rw-r--r-- | src/utils/cpuid.cpp | 2 | ||||
-rw-r--r-- | src/utils/mlock.cpp | 4 | ||||
-rw-r--r-- | src/utils/simd_32/simd_sse.h | 6 |
3 files changed, 6 insertions, 6 deletions
diff --git a/src/utils/cpuid.cpp b/src/utils/cpuid.cpp index ce3822d55..468ae9d3d 100644 --- a/src/utils/cpuid.cpp +++ b/src/utils/cpuid.cpp @@ -162,7 +162,7 @@ void CPUID::initialize() u32bit cpuid[4] = { 0 }; CALL_CPUID(1, cpuid); - x86_processor_flags = ((u64bit)cpuid[2] << 32) | cpuid[3]; + x86_processor_flags = (static_cast<u64bit>(cpuid[2]) << 32) | cpuid[3]; #if defined(BOTAN_TARGET_ARCH_IS_AMD64) /* diff --git a/src/utils/mlock.cpp b/src/utils/mlock.cpp index cd92860df..800425665 100644 --- a/src/utils/mlock.cpp +++ b/src/utils/mlock.cpp @@ -31,7 +31,7 @@ bool has_mlock() bool lock_mem(void* ptr, size_t bytes) { #if defined(BOTAN_TARGET_OS_HAS_POSIX_MLOCK) - return (::mlock((char*)ptr, bytes) == 0); + return (::mlock(static_cast<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, size_t bytes) void unlock_mem(void* ptr, size_t bytes) { #if defined(BOTAN_TARGET_OS_HAS_POSIX_MLOCK) - ::munlock((char*)ptr, bytes); + ::munlock(static_cast<char*>(ptr), bytes); #elif defined(BOTAN_TARGET_OS_HAS_WIN32_VIRTUAL_LOCK) ::VirtualUnlock(ptr, bytes); #endif diff --git a/src/utils/simd_32/simd_sse.h b/src/utils/simd_32/simd_sse.h index 1cb52105c..61fce99a9 100644 --- a/src/utils/simd_32/simd_sse.h +++ b/src/utils/simd_32/simd_sse.h @@ -22,7 +22,7 @@ class SIMD_SSE2 SIMD_SSE2(const u32bit B[4]) { - reg = _mm_loadu_si128((const __m128i*)B); + reg = _mm_loadu_si128(reinterpret_cast<const __m128i*>(B)); } SIMD_SSE2(u32bit B0, u32bit B1, u32bit B2, u32bit B3) @@ -37,7 +37,7 @@ class SIMD_SSE2 static SIMD_SSE2 load_le(const void* in) { - return _mm_loadu_si128((const __m128i*)in); + return _mm_loadu_si128(reinterpret_cast<const __m128i*>(in)); } static SIMD_SSE2 load_be(const void* in) @@ -47,7 +47,7 @@ class SIMD_SSE2 void store_le(byte out[]) const { - _mm_storeu_si128((__m128i*)out, reg); + _mm_storeu_si128(reinterpret_cast<__m128i*>(out), reg); } void store_be(byte out[]) const |