From 7001266b52649f9036b0e4b44673402763842290 Mon Sep 17 00:00:00 2001 From: Niels Lohmann Date: Fri, 24 Dec 2021 14:59:42 +0100 Subject: [PATCH] :rotating_light: fix warnings --- test/src/unit-regression1.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/test/src/unit-regression1.cpp b/test/src/unit-regression1.cpp index 3971addca..9839e088e 100644 --- a/test/src/unit-regression1.cpp +++ b/test/src/unit-regression1.cpp @@ -170,7 +170,7 @@ TEST_CASE("regression tests 1") json::number_float_t f1{j1}; CHECK(std::isnan(f1)); - json j2 = json::number_float_t(NAN); + json j2 = static_cast(NAN); CHECK(j2.is_number_float()); json::number_float_t f2{j2}; CHECK(std::isnan(f2)); @@ -183,7 +183,7 @@ TEST_CASE("regression tests 1") json::number_float_t f1{j1}; CHECK(!std::isfinite(f1)); - json j2 = json::number_float_t(INFINITY); + json j2 = json::static_cast(INFINITY); CHECK(j2.is_number_float()); json::number_float_t f2{j2}; CHECK(!std::isfinite(f2)); @@ -567,17 +567,17 @@ TEST_CASE("regression tests 1") SECTION("issue #378 - locale-independent num-to-str") { - setlocale(LC_NUMERIC, "de_DE.UTF-8"); + static_cast(setlocale(LC_NUMERIC, "de_DE.UTF-8")); // verify that dumped correctly with '.' and no grouping const json j1 = 12345.67; CHECK(json(12345.67).dump() == "12345.67"); - setlocale(LC_NUMERIC, "C"); + static_cast(setlocale(LC_NUMERIC, "C")); } SECTION("issue #379 - locale-independent str-to-num") { - setlocale(LC_NUMERIC, "de_DE.UTF-8"); + static_cast(setlocale(LC_NUMERIC, "de_DE.UTF-8")); // verify that parsed correctly despite using strtod internally CHECK(json::parse("3.14").get() == 3.14); @@ -910,7 +910,7 @@ TEST_CASE("regression tests 1") ++i; } - std::remove("test.json"); + static_cast(std::remove("test.json")); } }