diff options
author | Jose <jose@zeroc.com> | 2019-06-22 00:29:53 +0200 |
---|---|---|
committer | Jose <jose@zeroc.com> | 2019-06-22 00:29:53 +0200 |
commit | c5959fd09de61604bedd75354401df6a57395d65 (patch) | |
tree | 3b0227f631c8b20fb1a1a274b92f63f52f34af2c /cpp/src/IceDB/IceDB.cpp | |
parent | Small fix (diff) | |
parent | Enable -Wconversion with clang - Close #363 (diff) | |
download | ice-c5959fd09de61604bedd75354401df6a57395d65.tar.bz2 ice-c5959fd09de61604bedd75354401df6a57395d65.tar.xz ice-c5959fd09de61604bedd75354401df6a57395d65.zip |
Merge remote-tracking branch 'origin/3.7' into swift
Diffstat (limited to 'cpp/src/IceDB/IceDB.cpp')
-rw-r--r-- | cpp/src/IceDB/IceDB.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/cpp/src/IceDB/IceDB.cpp b/cpp/src/IceDB/IceDB.cpp index bce0ab96f0e..03701eff884 100644 --- a/cpp/src/IceDB/IceDB.cpp +++ b/cpp/src/IceDB/IceDB.cpp @@ -165,7 +165,8 @@ Env::Env(const string& path, MDB_dbi maxDbs, size_t mapSize, unsigned int maxRea GetSystemInfo(&si); pageSize = si.dwPageSize; #else - pageSize = sysconf(_SC_PAGESIZE); + long sz = sysconf(_SC_PAGESIZE); + pageSize = static_cast<size_t>(sz == -1 ? 4096 : sz); #endif size_t remainder = mapSize % pageSize; if(remainder != 0) @@ -194,7 +195,7 @@ Env::Env(const string& path, MDB_dbi maxDbs, size_t mapSize, unsigned int maxRea throw LMDBException(__FILE__, __LINE__, rc); } - size_t envMaxKeySize = mdb_env_get_maxkeysize(_menv); + size_t envMaxKeySize = static_cast<size_t>(mdb_env_get_maxkeysize(_menv)); if(maxKeySize > envMaxKeySize) { throw BadEnvException(__FILE__, __LINE__, envMaxKeySize); @@ -497,5 +498,5 @@ IceDB::getMapSize(int configValue) const size_t defaultMapSize = 100; #endif - return ((configValue <= 0) ? defaultMapSize : configValue) * 1024 * 1024; + return ((configValue <= 0) ? defaultMapSize : static_cast<size_t>(configValue)) * 1024 * 1024; } |