summaryrefslogtreecommitdiff
path: root/lib/jsonParse-persistence.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-persistence.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-persistence.cpp')
-rw-r--r--lib/jsonParse-persistence.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/jsonParse-persistence.cpp b/lib/jsonParse-persistence.cpp
index 5062796..a9b9a83 100644
--- a/lib/jsonParse-persistence.cpp
+++ b/lib/jsonParse-persistence.cpp
@@ -97,7 +97,7 @@ namespace Persistence {
wrh(std::ostream & strm, char ch)
{
using namespace std::literals;
- strm << R"(\u)"sv << std::setw(4) << std::hex << (int)ch << std::setw(1);
+ strm << R"(\u)"sv << std::setw(4) << std::hex << static_cast<int>(ch) << std::setw(1);
}
static inline void
wre(std::ostream & strm, char e)
@@ -116,7 +116,7 @@ namespace Persistence {
static constexpr OutFuncs outFuncs {[]() {
OutFuncs outFuncs;
outFuncs.fill(&wrv);
- for (int x = 0; x < 0x20; x += 1) {
+ for (auto x = 0U; x < 0x20U; x += 1) {
outFuncs[x] = &wrh;
}
outFuncs['\"'] = &wre<'"'>;
@@ -160,7 +160,8 @@ namespace Persistence {
strm << value;
}
- void JsonWritePersistence::pushValue(std::nullptr_t) const
+ void
+ JsonWritePersistence::pushValue(std::nullptr_t) const
{
strm << "null";
}
@@ -170,7 +171,7 @@ namespace Persistence {
{
strm << '"';
std::for_each(value.begin(), value.end(), [this](char ch) {
- outFuncs[(unsigned char)ch](strm, ch);
+ outFuncs[static_cast<unsigned char>(ch)](strm, ch);
});
strm << '"';
}