Fix warnings in character set conversion functions

consistent_macro_prefix
Martchus 5 years ago
parent 89a4c2f33a
commit d9f2ad7260
  1. 2
      CMakeLists.txt
  2. 6
      conversion/stringconversion.cpp

@ -136,7 +136,7 @@ set(META_APP_URL "https://github.com/${META_APP_AUTHOR}/${META_PROJECT_NAME}")
set(META_APP_DESCRIPTION "Useful C++ classes and routines such as argument parser, IO and conversion utilities")
set(META_VERSION_MAJOR 4)
set(META_VERSION_MINOR 14)
set(META_VERSION_PATCH 1)
set(META_VERSION_PATCH 2)
# find required 3rd party libraries
include(3rdParty)

@ -44,7 +44,7 @@ struct Factor {
: factor(factor){};
size_t operator()(size_t value)
{
return value * factor;
return static_cast<size_t>(value * factor);
}
float factor;
};
@ -90,11 +90,11 @@ public:
if (bytesWritten == static_cast<size_t>(-1)) {
if (errno == EINVAL) {
// ignore incomplete multibyte sequence in the input
bytesWritten = currentOutputOffset - outputBuffer;
bytesWritten = static_cast<size_t>(currentOutputOffset - outputBuffer);
break;
} else if (errno == E2BIG) {
// output buffer has no more room for next converted character
bytesWritten = currentOutputOffset - outputBuffer;
bytesWritten = static_cast<size_t>(currentOutputOffset - outputBuffer);
outputBytesLeft = (outputSize += m_outputSizeHint(inputBytesLeft)) - bytesWritten;
outputBuffer = reinterpret_cast<char *>(realloc(outputBuffer, outputSize));
} else /*if(errno == EILSEQ)*/ {

Loading…
Cancel
Save