summaryrefslogtreecommitdiff
path: root/cpp/src/IceUtil/StringConverter.cpp
diff options
context:
space:
mode:
authorJose <jose@zeroc.com>2019-06-22 00:29:53 +0200
committerJose <jose@zeroc.com>2019-06-22 00:29:53 +0200
commitc5959fd09de61604bedd75354401df6a57395d65 (patch)
tree3b0227f631c8b20fb1a1a274b92f63f52f34af2c /cpp/src/IceUtil/StringConverter.cpp
parentSmall fix (diff)
parentEnable -Wconversion with clang - Close #363 (diff)
downloadice-c5959fd09de61604bedd75354401df6a57395d65.tar.bz2
ice-c5959fd09de61604bedd75354401df6a57395d65.tar.xz
ice-c5959fd09de61604bedd75354401df6a57395d65.zip
Merge remote-tracking branch 'origin/3.7' into swift
Diffstat (limited to 'cpp/src/IceUtil/StringConverter.cpp')
-rw-r--r--cpp/src/IceUtil/StringConverter.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/cpp/src/IceUtil/StringConverter.cpp b/cpp/src/IceUtil/StringConverter.cpp
index 52f12c88cf2..73fee027596 100644
--- a/cpp/src/IceUtil/StringConverter.cpp
+++ b/cpp/src/IceUtil/StringConverter.cpp
@@ -92,7 +92,7 @@ public:
do
{
assert(factor <= 4);
- const size_t chunkSize = std::max<size_t>((sourceEnd - sourceStart) * factor, 4);
+ const size_t chunkSize = std::max<size_t>(static_cast<size_t>(sourceEnd - sourceStart) * factor, 4);
++factor; // at the next round, we'll allocate more bytes per remaining source character
targetStart = reinterpret_cast<char*>(buffer.getMoreBytes(chunkSize, reinterpret_cast<Byte*>(targetNext)));
@@ -145,7 +145,7 @@ public:
virtual void fromUTF8(const Byte* sourceStart, const Byte* sourceEnd, wstring& target) const
{
- const size_t sourceSize = sourceEnd - sourceStart;
+ const size_t sourceSize = static_cast<size_t>(sourceEnd - sourceStart);
if(sourceSize == 0)
{
@@ -173,7 +173,7 @@ public:
throw IllegalConversionException(__FILE__, __LINE__, "codecvt.in failure");
}
- target.resize(targetNext - targetStart);
+ target.resize(static_cast<size_t>(targetNext - targetStart));
}
}
@@ -275,7 +275,7 @@ public:
size_t bytesUsed = 0;
if(firstUnused != 0)
{
- bytesUsed = firstUnused - reinterpret_cast<const Byte*>(_buffer.data());
+ bytesUsed = static_cast<size_t>(firstUnused - reinterpret_cast<const Byte*>(_buffer.data()));
}
if(_buffer.size() < howMany + bytesUsed)
@@ -289,7 +289,7 @@ public:
void swap(string& other, const Byte* tail)
{
assert(tail >= reinterpret_cast<const Byte*>(_buffer.data()));
- _buffer.resize(tail - reinterpret_cast<const Byte*>(_buffer.data()));
+ _buffer.resize(static_cast<size_t>(tail - reinterpret_cast<const Byte*>(_buffer.data())));
other.swap(_buffer);
}