diff options
author | Jose <jose@zeroc.com> | 2019-06-21 22:22:14 +0200 |
---|---|---|
committer | Jose <jose@zeroc.com> | 2019-06-21 22:22:14 +0200 |
commit | d1b7c66fab777fe72e5cf77fd284218e2080b017 (patch) | |
tree | b48615b2d9d2f59195c8a560e07585b9cbb77cb5 /cpp/src/Ice/Instance.cpp | |
parent | Add ice_isFixed - Close #356 (diff) | |
download | ice-d1b7c66fab777fe72e5cf77fd284218e2080b017.tar.bz2 ice-d1b7c66fab777fe72e5cf77fd284218e2080b017.tar.xz ice-d1b7c66fab777fe72e5cf77fd284218e2080b017.zip |
Enable -Wconversion with clang - Close #363
Diffstat (limited to 'cpp/src/Ice/Instance.cpp')
-rw-r--r-- | cpp/src/Ice/Instance.cpp | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/cpp/src/Ice/Instance.cpp b/cpp/src/Ice/Instance.cpp index 8d448ee0ddb..1d1d8ce262f 100644 --- a/cpp/src/Ice/Instance.cpp +++ b/cpp/src/Ice/Instance.cpp @@ -1033,7 +1033,7 @@ IceInternal::Instance::Instance(const CommunicatorPtr& communicator, const Initi throw SyscallException(__FILE__, __LINE__, getSystemErrno()); } - if(initgroups(pw->pw_name, pw->pw_gid) == -1) + if(initgroups(pw->pw_name, static_cast<int>(pw->pw_gid)) == -1) { throw SyscallException(__FILE__, __LINE__, getSystemErrno()); } @@ -1107,8 +1107,13 @@ IceInternal::Instance::Instance(const CommunicatorPtr& communicator, const Initi #endif if(!logfile.empty()) { - _initData.logger = ICE_MAKE_SHARED(LoggerI, _initData.properties->getProperty("Ice.ProgramName"), logfile, true, - _initData.properties->getPropertyAsIntWithDefault("Ice.LogFile.SizeMax", 0)); + Int sz = _initData.properties->getPropertyAsIntWithDefault("Ice.LogFile.SizeMax", 0); + if(sz < 0) + { + sz = 0; + } + _initData.logger = ICE_MAKE_SHARED(LoggerI, _initData.properties->getProperty("Ice.ProgramName"), + logfile, true, static_cast<size_t>(sz)); } else { @@ -1165,7 +1170,7 @@ IceInternal::Instance::Instance(const CommunicatorPtr& communicator, const Initi Int num = _initData.properties->getPropertyAsIntWithDefault("Ice.BatchAutoFlushSize", 1024); // 1MB default if(num < 1) { - const_cast<size_t&>(_batchAutoFlushSize) = num; + const_cast<size_t&>(_batchAutoFlushSize) = static_cast<size_t>(num); } else if(static_cast<size_t>(num) > static_cast<size_t>(0x7fffffff / 1024)) { |