summaryrefslogtreecommitdiff
path: root/src/utils
diff options
context:
space:
mode:
Diffstat (limited to 'src/utils')
-rw-r--r--src/utils/base64.cpp12
-rw-r--r--src/utils/stringutils.cpp4
2 files changed, 8 insertions, 8 deletions
diff --git a/src/utils/base64.cpp b/src/utils/base64.cpp
index cd7d59cdb..094cd6227 100644
--- a/src/utils/base64.cpp
+++ b/src/utils/base64.cpp
@@ -128,18 +128,18 @@ unsigned char *php3_base64_decode(const unsigned char *string,
switch (i % 4)
{
case 0:
- result[j] = ch << 2;
+ result[j] = static_cast<unsigned char>(ch << 2);
break;
case 1:
- result[j++] |= ch >> 4;
- result[j] = (ch & 0x0f) << 4;
+ result[j++] |= static_cast<unsigned char>(ch >> 4);
+ result[j] = static_cast<unsigned char>((ch & 0x0f) << 4);
break;
case 2:
- result[j++] |= ch >>2;
- result[j] = (ch & 0x03) << 6;
+ result[j++] |= static_cast<unsigned char>(ch >>2);
+ result[j] = static_cast<unsigned char>((ch & 0x03) << 6);
break;
case 3:
- result[j++] |= ch;
+ result[j++] |= static_cast<unsigned char>(ch);
break;
default:
break;
diff --git a/src/utils/stringutils.cpp b/src/utils/stringutils.cpp
index 1808ea173..d55e4e650 100644
--- a/src/utils/stringutils.cpp
+++ b/src/utils/stringutils.cpp
@@ -267,7 +267,7 @@ std::string extractNameFromSprite(std::string str)
pos2 = pos3;
}
if (pos2 == std::string::npos)
- pos2 = -1;
+ pos2 = static_cast<size_t>(-1);
int size = static_cast<int>(pos1) - static_cast<int>(pos2) - 1;
if (size > 0)
@@ -290,7 +290,7 @@ std::string removeSpriteIndex(std::string str)
pos2 = pos3;
}
if (pos2 == std::string::npos)
- pos2 = -1;
+ pos2 = static_cast<size_t>(-1);
int size = static_cast<int>(pos1) - static_cast<int>(pos2) - 1;
if (size > 0)