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/include/Ice | |
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/include/Ice')
-rw-r--r-- | cpp/include/Ice/IconvStringConverter.h | 7 | ||||
-rw-r--r-- | cpp/include/Ice/InputStream.h | 8 | ||||
-rw-r--r-- | cpp/include/Ice/OutputStream.h | 10 | ||||
-rw-r--r-- | cpp/include/Ice/Proxy.h | 10 | ||||
-rw-r--r-- | cpp/include/Ice/StreamHelpers.h | 2 |
5 files changed, 19 insertions, 18 deletions
diff --git a/cpp/include/Ice/IconvStringConverter.h b/cpp/include/Ice/IconvStringConverter.h index 81aaf544f2e..a7cee796db8 100644 --- a/cpp/include/Ice/IconvStringConverter.h +++ b/cpp/include/Ice/IconvStringConverter.h @@ -267,7 +267,7 @@ IconvStringConverter<charT>::toUTF8(const charT* sourceStart, #else char* inbuf = reinterpret_cast<char*>(const_cast<charT*>(sourceStart)); #endif - size_t inbytesleft = (sourceEnd - sourceStart) * sizeof(charT); + size_t inbytesleft = static_cast<size_t>(sourceEnd - sourceStart) * sizeof(charT); char* outbuf = 0; size_t count = 0; @@ -311,7 +311,8 @@ IconvStringConverter<charT>::fromUTF8(const Ice::Byte* sourceStart, const Ice::B #else char* inbuf = reinterpret_cast<char*>(const_cast<Ice::Byte*>(sourceStart)); #endif - size_t inbytesleft = sourceEnd - sourceStart; + assert(sourceEnd > sourceStart); + size_t inbytesleft = static_cast<size_t>(sourceEnd - sourceStart); char* outbuf = 0; size_t outbytesleft = 0; @@ -325,7 +326,7 @@ IconvStringConverter<charT>::fromUTF8(const Ice::Byte* sourceStart, const Ice::B size_t bytesused = 0; if(outbuf != 0) { - bytesused = outbuf - reinterpret_cast<const char*>(target.data()); + bytesused = static_cast<size_t>(outbuf - reinterpret_cast<const char*>(target.data())); } const size_t increment = std::max<size_t>(inbytesleft, 4); diff --git a/cpp/include/Ice/InputStream.h b/cpp/include/Ice/InputStream.h index c9ffe9c20b0..4c00ef0fa8c 100644 --- a/cpp/include/Ice/InputStream.h +++ b/cpp/include/Ice/InputStream.h @@ -382,7 +382,7 @@ public: _currentEncaps = new Encaps(); _currentEncaps->previous = oldEncaps; } - _currentEncaps->start = i - b.begin(); + _currentEncaps->start = static_cast<size_t>(i - b.begin()); // // I don't use readSize() and writeSize() for encapsulations, @@ -484,7 +484,7 @@ public: { // Skip the optional content of the encapsulation if we are expecting an // empty encapsulation. - i += sz - sizeof(Ice::Int) - 2; + i += static_cast<size_t>(sz) - sizeof(Ice::Int) - 2; } return encoding; } @@ -511,7 +511,7 @@ public: } read(encoding); - i += sz - sizeof(Int) - 2; + i += static_cast<size_t>(sz) - sizeof(Int) - 2; return encoding; } @@ -1174,7 +1174,7 @@ public: */ size_type pos() { - return i - b.begin(); + return static_cast<size_t>(i - b.begin()); } /** diff --git a/cpp/include/Ice/OutputStream.h b/cpp/include/Ice/OutputStream.h index 4d119a850e4..886ec28fa49 100644 --- a/cpp/include/Ice/OutputStream.h +++ b/cpp/include/Ice/OutputStream.h @@ -261,8 +261,8 @@ public: } Container::size_type position = b.size(); - resize(position + sz); - memcpy(&b[position], &v[0], sz); + resize(position + static_cast<size_t>(sz)); + memcpy(&b[position], &v[0], static_cast<size_t>(sz)); } /** @@ -680,8 +680,8 @@ public: if(sz > 0) { Container::size_type position = b.size(); - resize(position + sz); - memcpy(&b[position], v.data(), sz); + resize(position + static_cast<size_t>(sz)); + memcpy(&b[position], v.data(), static_cast<size_t>(sz)); } } } @@ -706,7 +706,7 @@ public: if(sz > 0) { Container::size_type position = b.size(); - resize(position + sz); + resize(position + static_cast<size_t>(sz)); memcpy(&b[position], vdata, vsize); } } diff --git a/cpp/include/Ice/Proxy.h b/cpp/include/Ice/Proxy.h index 4056f04a515..a5bf67c494c 100644 --- a/cpp/include/Ice/Proxy.h +++ b/cpp/include/Ice/Proxy.h @@ -1063,7 +1063,7 @@ public: } /** - * Flushes any pending batched requests for this communicator. The call blocks until the flush is complete. + * Flushes asynchronously any pending batched requests for this communicator. * @param ex The exception callback. * @param sent The sent callback. * @return A function that can be called to cancel the invocation locally. @@ -1079,7 +1079,7 @@ public: } /** - * Flushes any pending batched requests for this communicator. The call blocks until the flush is complete. + * Flushes asynchronously any pending batched requests for this communicator. * @return The future object for the invocation. */ template<template<typename> class P = std::promise> auto @@ -2741,7 +2741,7 @@ public: } /** - * Flushes any pending batched requests for this proxy. The call blocks until the flush is complete. + * Flushes asynchronously any pending batched requests for this proxy. * @return The asynchronous result object for the invocation. */ ::Ice::AsyncResultPtr begin_ice_flushBatchRequests() @@ -2750,7 +2750,7 @@ public: } /** - * Flushes any pending batched requests for this proxy. The call blocks until the flush is complete. + * Flushes asynchronously any pending batched requests for this proxy. * @param cb Asynchronous callback object. * @param cookie User-defined data to associate with the invocation. * @return The asynchronous result object for the invocation. @@ -2762,7 +2762,7 @@ public: } /** - * Flushes any pending batched requests for this proxy. The call blocks until the flush is complete. + * Flushes asynchronously any pending batched requests for this proxy. * @param cb Asynchronous callback object. * @param cookie User-defined data to associate with the invocation. * @return The asynchronous result object for the invocation. diff --git a/cpp/include/Ice/StreamHelpers.h b/cpp/include/Ice/StreamHelpers.h index 5c5fd267e02..16292f9d9f7 100644 --- a/cpp/include/Ice/StreamHelpers.h +++ b/cpp/include/Ice/StreamHelpers.h @@ -583,7 +583,7 @@ struct StreamHelper<T, StreamHelperCategorySequence> read(S* stream, T& v) { Int sz = stream->readAndCheckSeqSize(StreamableTraits<typename T::value_type>::minWireSize); - T(sz).swap(v); + T(static_cast<size_t>(sz)).swap(v); for(typename T::iterator p = v.begin(); p != v.end(); ++p) { stream->read(*p); |