mirror of
https://github.com/bblanchon/ArduinoJson.git
synced 2025-07-29 18:27:37 +02:00
Replaced old style casts (issue #28)
This commit is contained in:
@ -76,7 +76,7 @@ namespace ArduinoJson
|
||||
|
||||
operator float()
|
||||
{
|
||||
return (float)_content.asDouble;
|
||||
return static_cast<float>(_content.asDouble);
|
||||
}
|
||||
|
||||
operator int()
|
||||
|
@ -26,7 +26,7 @@ namespace JsonGeneratorTests
|
||||
|
||||
TEST_METHOD(Null)
|
||||
{
|
||||
array.add((char*) 0);
|
||||
array.add(static_cast<char*>(0));
|
||||
|
||||
outputMustBe("[null]");
|
||||
}
|
||||
|
@ -102,7 +102,7 @@ namespace JsonGeneratorTests
|
||||
|
||||
TEST_METHOD(OneNull)
|
||||
{
|
||||
object["key"] = (char*) 0;
|
||||
object["key"] = static_cast<char*>(0);
|
||||
outputMustBe("{\"key\":null}");
|
||||
}
|
||||
|
||||
|
@ -72,7 +72,9 @@ namespace JsonGeneratorTests
|
||||
{
|
||||
value = expected;
|
||||
const Printable& actual = value;
|
||||
Assert::AreEqual((void*) &expected, (void*) &actual);
|
||||
Assert::AreEqual(
|
||||
reinterpret_cast<const void*>(&expected),
|
||||
reinterpret_cast<const void*>(&actual));
|
||||
}
|
||||
};
|
||||
}
|
||||
|
@ -70,7 +70,7 @@ namespace JsonGeneratorTests
|
||||
|
||||
TEST_METHOD(Short)
|
||||
{
|
||||
setValueTo((short)314);
|
||||
setValueTo(static_cast<short>(314));
|
||||
outputMustBe("314");
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user