Replaced old style casts (issue #28)

This commit is contained in:
Benoit Blanchon
2014-10-10 18:44:04 +02:00
parent e725b756a6
commit dae0dc5ebb
5 changed files with 7 additions and 5 deletions

View File

@ -76,7 +76,7 @@ namespace ArduinoJson
operator float() operator float()
{ {
return (float)_content.asDouble; return static_cast<float>(_content.asDouble);
} }
operator int() operator int()

View File

@ -26,7 +26,7 @@ namespace JsonGeneratorTests
TEST_METHOD(Null) TEST_METHOD(Null)
{ {
array.add((char*) 0); array.add(static_cast<char*>(0));
outputMustBe("[null]"); outputMustBe("[null]");
} }

View File

@ -102,7 +102,7 @@ namespace JsonGeneratorTests
TEST_METHOD(OneNull) TEST_METHOD(OneNull)
{ {
object["key"] = (char*) 0; object["key"] = static_cast<char*>(0);
outputMustBe("{\"key\":null}"); outputMustBe("{\"key\":null}");
} }

View File

@ -72,7 +72,9 @@ namespace JsonGeneratorTests
{ {
value = expected; value = expected;
const Printable& actual = value; const Printable& actual = value;
Assert::AreEqual((void*) &expected, (void*) &actual); Assert::AreEqual(
reinterpret_cast<const void*>(&expected),
reinterpret_cast<const void*>(&actual));
} }
}; };
} }

View File

@ -70,7 +70,7 @@ namespace JsonGeneratorTests
TEST_METHOD(Short) TEST_METHOD(Short)
{ {
setValueTo((short)314); setValueTo(static_cast<short>(314));
outputMustBe("314"); outputMustBe("314");
} }