🚨 fix warnings

This commit is contained in:
Niels Lohmann 2021-12-24 14:59:42 +01:00
parent 6e6a82fd66
commit 7001266b52
No known key found for this signature in database
GPG Key ID: 7F3CEA63AE251B69

View File

@ -170,7 +170,7 @@ TEST_CASE("regression tests 1")
json::number_float_t f1{j1}; json::number_float_t f1{j1};
CHECK(std::isnan(f1)); CHECK(std::isnan(f1));
json j2 = json::number_float_t(NAN); json j2 = static_cast<json::number_float_t>(NAN);
CHECK(j2.is_number_float()); CHECK(j2.is_number_float());
json::number_float_t f2{j2}; json::number_float_t f2{j2};
CHECK(std::isnan(f2)); CHECK(std::isnan(f2));
@ -183,7 +183,7 @@ TEST_CASE("regression tests 1")
json::number_float_t f1{j1}; json::number_float_t f1{j1};
CHECK(!std::isfinite(f1)); CHECK(!std::isfinite(f1));
json j2 = json::number_float_t(INFINITY); json j2 = json::static_cast<json::number_float_t>(INFINITY);
CHECK(j2.is_number_float()); CHECK(j2.is_number_float());
json::number_float_t f2{j2}; json::number_float_t f2{j2};
CHECK(!std::isfinite(f2)); CHECK(!std::isfinite(f2));
@ -567,17 +567,17 @@ TEST_CASE("regression tests 1")
SECTION("issue #378 - locale-independent num-to-str") SECTION("issue #378 - locale-independent num-to-str")
{ {
setlocale(LC_NUMERIC, "de_DE.UTF-8"); static_cast<void>(setlocale(LC_NUMERIC, "de_DE.UTF-8"));
// verify that dumped correctly with '.' and no grouping // verify that dumped correctly with '.' and no grouping
const json j1 = 12345.67; const json j1 = 12345.67;
CHECK(json(12345.67).dump() == "12345.67"); CHECK(json(12345.67).dump() == "12345.67");
setlocale(LC_NUMERIC, "C"); static_cast<void>(setlocale(LC_NUMERIC, "C"));
} }
SECTION("issue #379 - locale-independent str-to-num") SECTION("issue #379 - locale-independent str-to-num")
{ {
setlocale(LC_NUMERIC, "de_DE.UTF-8"); static_cast<void>(setlocale(LC_NUMERIC, "de_DE.UTF-8"));
// verify that parsed correctly despite using strtod internally // verify that parsed correctly despite using strtod internally
CHECK(json::parse("3.14").get<double>() == 3.14); CHECK(json::parse("3.14").get<double>() == 3.14);
@ -910,7 +910,7 @@ TEST_CASE("regression tests 1")
++i; ++i;
} }
std::remove("test.json"); static_cast<void>(std::remove("test.json"));
} }
} }