From ccd70540e3efbb6082d8d9171a52adc31c5a5eb8 Mon Sep 17 00:00:00 2001 From: Tomasz Maciejewski Date: Sun, 28 Feb 2016 12:56:04 +0100 Subject: [PATCH] remove C-style casting --- src/lib_json/json_value.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib_json/json_value.cpp b/src/lib_json/json_value.cpp index f598491..719d78f 100644 --- a/src/lib_json/json_value.cpp +++ b/src/lib_json/json_value.cpp @@ -86,7 +86,7 @@ static inline char* duplicateStringValue(const char* value, size_t length) { // Avoid an integer overflow in the call to malloc below by limiting length // to a sane value. - if (length >= (size_t)Value::maxInt) + if (length >= static_cast(Value::maxInt)) length = Value::maxInt - 1; char* newString = static_cast(malloc(length + 1)); @@ -108,7 +108,7 @@ static inline char* duplicateAndPrefixStringValue( { // Avoid an integer overflow in the call to malloc below by limiting length // to a sane value. - JSON_ASSERT_MESSAGE(length <= (unsigned)Value::maxInt - sizeof(unsigned) - 1U, + JSON_ASSERT_MESSAGE(length <= static_cast(Value::maxInt) - sizeof(unsigned) - 1U, "in Json::Value::duplicateAndPrefixStringValue(): " "length too big for prefixing"); unsigned actualLength = length + static_cast(sizeof(unsigned)) + 1U;