diff options
author | Jack Lloyd <[email protected]> | 2018-10-01 05:28:59 -0400 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2018-10-01 05:28:59 -0400 |
commit | b96189789154222a8de57e31deb457be4208b4b3 (patch) | |
tree | 3e507015919fe4c73ccdabd3903fdcf178d5fd1b /src/lib/utils | |
parent | 388530b25b3de0e33f85612d91721dc190b3347d (diff) |
Fix more MSVC warnings
Diffstat (limited to 'src/lib/utils')
-rw-r--r-- | src/lib/utils/mem_pool/mem_pool.cpp | 2 | ||||
-rw-r--r-- | src/lib/utils/os_utils.cpp | 9 |
2 files changed, 6 insertions, 5 deletions
diff --git a/src/lib/utils/mem_pool/mem_pool.cpp b/src/lib/utils/mem_pool/mem_pool.cpp index d25343383..e052c10e7 100644 --- a/src/lib/utils/mem_pool/mem_pool.cpp +++ b/src/lib/utils/mem_pool/mem_pool.cpp @@ -63,7 +63,7 @@ Memory_Pool::Memory_Pool(uint8_t* pool, void* Memory_Pool::allocate(size_t req) { - const size_t alignment = (1 << m_align_bit); + const size_t alignment = (static_cast<size_t>(1) << m_align_bit); if(req > m_pool_size) return nullptr; diff --git a/src/lib/utils/os_utils.cpp b/src/lib/utils/os_utils.cpp index 7d50dac77..86e5443c3 100644 --- a/src/lib/utils/os_utils.cpp +++ b/src/lib/utils/os_utils.cpp @@ -216,20 +216,21 @@ uint64_t OS::get_system_timestamp_ns() size_t OS::system_page_size() { + const size_t default_page_size = 4096; + #if defined(BOTAN_TARGET_OS_HAS_POSIX1) long p = ::sysconf(_SC_PAGESIZE); if(p > 1) return static_cast<size_t>(p); else - return 4096; + return default_page_size; #elif defined(BOTAN_TARGET_OS_HAS_VIRTUAL_LOCK) SYSTEM_INFO sys_info; ::GetSystemInfo(&sys_info); return sys_info.dwPageSize; +#else + return default_page_size; #endif - - // default value - return 4096; } size_t OS::get_memory_locking_limit() |