diff --git a/JsonGenerator/JsonValue.h b/JsonGenerator/JsonValue.h index 236d52c9..0e08bcf2 100644 --- a/JsonGenerator/JsonValue.h +++ b/JsonGenerator/JsonValue.h @@ -76,7 +76,7 @@ namespace ArduinoJson operator float() { - return (float)_content.asDouble; + return static_cast(_content.asDouble); } operator int() diff --git a/JsonGeneratorTests/JsonArrayTests.cpp b/JsonGeneratorTests/JsonArrayTests.cpp index 3b3f21f2..4db61298 100644 --- a/JsonGeneratorTests/JsonArrayTests.cpp +++ b/JsonGeneratorTests/JsonArrayTests.cpp @@ -26,7 +26,7 @@ namespace JsonGeneratorTests TEST_METHOD(Null) { - array.add((char*) 0); + array.add(static_cast(0)); outputMustBe("[null]"); } diff --git a/JsonGeneratorTests/JsonObject_PrintTo_Tests.cpp b/JsonGeneratorTests/JsonObject_PrintTo_Tests.cpp index ac818dbc..d2388f2c 100644 --- a/JsonGeneratorTests/JsonObject_PrintTo_Tests.cpp +++ b/JsonGeneratorTests/JsonObject_PrintTo_Tests.cpp @@ -102,7 +102,7 @@ namespace JsonGeneratorTests TEST_METHOD(OneNull) { - object["key"] = (char*) 0; + object["key"] = static_cast(0); outputMustBe("{\"key\":null}"); } diff --git a/JsonGeneratorTests/JsonValue_Cast_Tests.cpp b/JsonGeneratorTests/JsonValue_Cast_Tests.cpp index 2266bdb5..fc8bf2fa 100644 --- a/JsonGeneratorTests/JsonValue_Cast_Tests.cpp +++ b/JsonGeneratorTests/JsonValue_Cast_Tests.cpp @@ -72,7 +72,9 @@ namespace JsonGeneratorTests { value = expected; const Printable& actual = value; - Assert::AreEqual((void*) &expected, (void*) &actual); + Assert::AreEqual( + reinterpret_cast(&expected), + reinterpret_cast(&actual)); } }; } diff --git a/JsonGeneratorTests/JsonValue_PrintTo_Tests.cpp b/JsonGeneratorTests/JsonValue_PrintTo_Tests.cpp index 87c8380d..e9faa6f3 100644 --- a/JsonGeneratorTests/JsonValue_PrintTo_Tests.cpp +++ b/JsonGeneratorTests/JsonValue_PrintTo_Tests.cpp @@ -70,7 +70,7 @@ namespace JsonGeneratorTests TEST_METHOD(Short) { - setValueTo((short)314); + setValueTo(static_cast(314)); outputMustBe("314"); }