diff --git a/cpp/src/Ice/ReferenceFactory.cpp b/cpp/src/Ice/ReferenceFactory.cpp index 5ca25388d60..aad4e826417 100644 --- a/cpp/src/Ice/ReferenceFactory.cpp +++ b/cpp/src/Ice/ReferenceFactory.cpp @@ -857,7 +857,7 @@ IceInternal::ReferenceFactory::create( { int locatorCacheTimeoutValue = properties->getPropertyAsIntWithDefault( property, - chrono::duration_cast>(locatorCacheTimeout).count()); + static_cast(locatorCacheTimeout.count())); if (locatorCacheTimeoutValue < -1) { locatorCacheTimeoutValue = -1; @@ -874,7 +874,7 @@ IceInternal::ReferenceFactory::create( { int invocationTimeoutValue = properties->getPropertyAsIntWithDefault( property, - chrono::duration_cast>(invocationTimeout).count()); + static_cast(invocationTimeout.count())); if (invocationTimeoutValue < 1 && invocationTimeoutValue != -1) { invocationTimeoutValue = -1; diff --git a/cpp/src/IceGrid/Util.cpp b/cpp/src/IceGrid/Util.cpp index 6ffcbec9698..1ae21618e8a 100644 --- a/cpp/src/IceGrid/Util.cpp +++ b/cpp/src/IceGrid/Util.cpp @@ -363,7 +363,7 @@ IceGrid::getMMVersion(const string& o) int IceGrid::secondsToInt(const std::chrono::seconds& sec) { - return chrono::duration_cast>(sec).count(); + return static_cast(sec.count()); } void diff --git a/matlab/src/ObjectPrx.cpp b/matlab/src/ObjectPrx.cpp index 1892d1b9523..8335fa95820 100644 --- a/matlab/src/ObjectPrx.cpp +++ b/matlab/src/ObjectPrx.cpp @@ -543,7 +543,7 @@ extern "C" mxArray* Ice_ObjectPrx_ice_getLocatorCacheTimeout(void* self) { chrono::seconds timeout = restoreProxy(self)->ice_getLocatorCacheTimeout(); - return createResultValue(createInt(chrono::duration_cast>(timeout).count())); + return createResultValue(createInt(static_cast(timeout.count()))); } mxArray* Ice_ObjectPrx_ice_locatorCacheTimeout(void* self, void** r, int t) @@ -564,7 +564,7 @@ extern "C" mxArray* Ice_ObjectPrx_ice_getInvocationTimeout(void* self) { chrono::milliseconds timeout = restoreProxy(self)->ice_getInvocationTimeout(); - return createResultValue(createInt(chrono::duration_cast>(timeout).count())); + return createResultValue(createInt(static_cast>(timeout.count()))); } mxArray* Ice_ObjectPrx_ice_invocationTimeout(void* self, void** r, int t) diff --git a/php/src/Proxy.cpp b/php/src/Proxy.cpp index bba3c4a97a4..6ea581b9dd7 100644 --- a/php/src/Proxy.cpp +++ b/php/src/Proxy.cpp @@ -421,7 +421,7 @@ ZEND_METHOD(Ice_ObjectPrx, ice_getLocatorCacheTimeout) try { chrono::seconds timeout = _this->proxy->ice_getLocatorCacheTimeout(); - ZVAL_LONG(return_value, chrono::duration_cast>(timeout).count()); + ZVAL_LONG(return_value, static_cast(timeout.count())); } catch (...) { @@ -1254,7 +1254,7 @@ ZEND_METHOD(Ice_ObjectPrx, ice_getInvocationTimeout) try { chrono::milliseconds timeout = _this->proxy->ice_getInvocationTimeout(); - ZVAL_LONG(return_value, chrono::duration_cast>(timeout).count()); + ZVAL_LONG(return_value, static_cast(timeout.count())); } catch (...) { diff --git a/python/modules/IcePy/Proxy.cpp b/python/modules/IcePy/Proxy.cpp index bdb9e14035b..325e75dd523 100644 --- a/python/modules/IcePy/Proxy.cpp +++ b/python/modules/IcePy/Proxy.cpp @@ -612,7 +612,7 @@ proxyIceGetLocatorCacheTimeout(ProxyObject* self, PyObject* /*args*/) try { chrono::seconds timeout = (*self->proxy)->ice_getLocatorCacheTimeout(); - return PyLong_FromLong(chrono::duration_cast>(timeout).count()); + return PyLong_FromLong(static_cast(timeout.count())); } catch (...) { @@ -629,7 +629,7 @@ proxyIceGetInvocationTimeout(ProxyObject* self, PyObject* /*args*/) try { chrono::milliseconds timeout = (*self->proxy)->ice_getInvocationTimeout(); - return PyLong_FromLong(chrono::duration_cast>(timeout).count()); + return PyLong_FromLong(static_cast(timeout.count())); } catch (...) { diff --git a/ruby/src/IceRuby/Proxy.cpp b/ruby/src/IceRuby/Proxy.cpp index 6d8ff678d8a..876d57dd176 100644 --- a/ruby/src/IceRuby/Proxy.cpp +++ b/ruby/src/IceRuby/Proxy.cpp @@ -367,7 +367,7 @@ IceRuby_ObjectPrx_ice_getLocatorCacheTimeout(VALUE self) { Ice::ObjectPrx p = getProxy(self); chrono::seconds timeout = p->ice_getLocatorCacheTimeout(); - return INT2FIX(chrono::duration_cast>(timeout).count()); + return INT2FIX(static_cast(timeout.count())); } ICE_RUBY_CATCH return Qnil; @@ -380,7 +380,7 @@ IceRuby_ObjectPrx_ice_getInvocationTimeout(VALUE self) { Ice::ObjectPrx p = getProxy(self); chrono::milliseconds timeout = p->ice_getInvocationTimeout(); - return INT2FIX(chrono::duration_cast>(timeout).count()); + return INT2FIX(static_cast(timeout.count())); } ICE_RUBY_CATCH return Qnil; diff --git a/swift/src/IceImpl/ObjectPrx.mm b/swift/src/IceImpl/ObjectPrx.mm index 2e3c7e84994..967fcfad1ca 100644 --- a/swift/src/IceImpl/ObjectPrx.mm +++ b/swift/src/IceImpl/ObjectPrx.mm @@ -125,7 +125,7 @@ - (instancetype)ice_endpoints:(NSArray*)endpoints error:(NSError** - (int32_t)ice_getLocatorCacheTimeout { - return std::chrono::duration_cast>(_prx->ice_getLocatorCacheTimeout()).count(); + return static_cast(_prx->ice_getLocatorCacheTimeout().count()); } - (instancetype)ice_locatorCacheTimeout:(int32_t)timeout error:(NSError**)error @@ -144,7 +144,7 @@ - (instancetype)ice_locatorCacheTimeout:(int32_t)timeout error:(NSError**)error - (int32_t)ice_getInvocationTimeout { - return std::chrono::duration_cast>(_prx->ice_getInvocationTimeout()).count(); + return static_cast(_prx->ice_getInvocationTimeout().count()); } - (instancetype)ice_invocationTimeout:(int32_t)timeout error:(NSError**)error