Skip to content

Commit ccd7054

Browse files
committed
remove C-style casting
1 parent b4d2b65 commit ccd7054

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/lib_json/json_value.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ static inline char* duplicateStringValue(const char* value,
8686
size_t length) {
8787
// Avoid an integer overflow in the call to malloc below by limiting length
8888
// to a sane value.
89-
if (length >= (size_t)Value::maxInt)
89+
if (length >= static_cast<size_t>(Value::maxInt))
9090
length = Value::maxInt - 1;
9191

9292
char* newString = static_cast<char*>(malloc(length + 1));
@@ -108,7 +108,7 @@ static inline char* duplicateAndPrefixStringValue(
108108
{
109109
// Avoid an integer overflow in the call to malloc below by limiting length
110110
// to a sane value.
111-
JSON_ASSERT_MESSAGE(length <= (unsigned)Value::maxInt - sizeof(unsigned) - 1U,
111+
JSON_ASSERT_MESSAGE(length <= static_cast<unsigned>(Value::maxInt) - sizeof(unsigned) - 1U,
112112
"in Json::Value::duplicateAndPrefixStringValue(): "
113113
"length too big for prefixing");
114114
unsigned actualLength = length + static_cast<unsigned>(sizeof(unsigned)) + 1U;

0 commit comments

Comments
 (0)