Skip to content

Commit 7a0ec31

Browse files
fix signed compare warning in typemapper.hpp (#27)
typemapper.hpp:71:39: warning: comparison of integer expressions of different signedness: 'long long unsigned int' and 'int' [-Wsign-compare]
1 parent fc19e3c commit 7a0ec31

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

include/jsonrpccxx/typemapper.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ namespace jsonrpccxx {
6868
if (x.get<long long int>() < 0)
6969
throw JsonRpcException(invalid_params, "invalid parameter: must be " + type_name(expectedType) + ", but is " + type_name(x.type()), index);
7070
} else if (x.type() == json::value_t::number_unsigned && expectedType == json::value_t::number_integer) {
71-
if (x.get<long long unsigned>() > std::numeric_limits<T>::max()) {
71+
if (x.get<long long unsigned>() > (long long unsigned)std::numeric_limits<T>::max()) {
7272
throw JsonRpcException(invalid_params, "invalid parameter: exceeds value range of " + type_name(expectedType), index);
7373
}
7474
}

0 commit comments

Comments
 (0)