jsonrpcx / json-rpc-cxx

JSON-RPC for modern C++
MIT License
251 stars 44 forks source link

fix signed compare warning in typemapper.hpp #27

Closed guruofquality closed 3 years ago

guruofquality commented 3 years ago

typemapper.hpp:71:39: warning: comparison of integer expressions of different signedness: 'long long unsigned int' and 'int' [-Wsign-compare]

The range check creates a sign compare warning when T is signed. The fix here was to simply cast the result of std::numeric_limits<T>::max() to match the long long unsigned type. Which the result should always fit into.

cinemast commented 3 years ago

Thanks!