summaryrefslogtreecommitdiff
path: root/lib/jsonParse.impl.cpp
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2021-11-26 20:21:12 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2021-11-26 20:21:12 +0000
commit239b3ab10b460da34c490a7e06a21c984e21ffb6 (patch)
tree4ce09f5d091ffbcf063a9d0fc076659dfe9e3142 /lib/jsonParse.impl.cpp
parentDon't run the app by default (diff)
downloadilt-239b3ab10b460da34c490a7e06a21c984e21ffb6.tar.bz2
ilt-239b3ab10b460da34c490a7e06a21c984e21ffb6.tar.xz
ilt-239b3ab10b460da34c490a7e06a21c984e21ffb6.zip
Enable all Jason Turner recommended warnings
Diffstat (limited to 'lib/jsonParse.impl.cpp')
-rw-r--r--lib/jsonParse.impl.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/lib/jsonParse.impl.cpp b/lib/jsonParse.impl.cpp
index 0913847..ce1020f 100644
--- a/lib/jsonParse.impl.cpp
+++ b/lib/jsonParse.impl.cpp
@@ -19,24 +19,24 @@ void
json::jsonParser::appendEscape(unsigned long cp, std::string & str)
{
if (cp <= 0x7F) {
- str += (char)cp;
+ str += static_cast<char>(cp);
}
else if (cp <= 0x7FF) {
- str += char((cp >> 6) + 192);
- str += char((cp & 63) + 128);
+ str += static_cast<char>((cp >> 6) + 192);
+ str += static_cast<char>((cp & 63) + 128);
}
else if ((0xd800 <= cp && cp <= 0xdfff) || cp > 0x10FFFF) {
throw std::range_error("Invalid UTF-8 sequence");
}
else if (cp <= 0xFFFF) {
- str += char((cp >> 12) + 224);
- str += char(((cp >> 6) & 63) + 128);
- str += char((cp & 63) + 128);
+ str += static_cast<char>((cp >> 12) + 224);
+ str += static_cast<char>(((cp >> 6) & 63) + 128);
+ str += static_cast<char>((cp & 63) + 128);
}
else {
- str += char((cp >> 18) + 240);
- str += char(((cp >> 12) & 63) + 128);
- str += char(((cp >> 6) & 63) + 128);
- str += char((cp & 63) + 128);
+ str += static_cast<char>((cp >> 18) + 240);
+ str += static_cast<char>(((cp >> 12) & 63) + 128);
+ str += static_cast<char>(((cp >> 6) & 63) + 128);
+ str += static_cast<char>((cp & 63) + 128);
}
}