# HG changeset patch # User David Demelier # Date 1504612210 -7200 # Node ID c8bc2c7f29295e331c9488e539d48f3567ddf0c4 # Parent 2562eb64860deaf483b22d391f79daa444f05a62 Common: fix get_uint narrowing error diff -r 2562eb64860d -r c8bc2c7f2929 libcommon/malikania/util.cpp --- a/libcommon/malikania/util.cpp Tue Sep 05 13:49:46 2017 +0200 +++ b/libcommon/malikania/util.cpp Tue Sep 05 13:50:10 2017 +0200 @@ -407,9 +407,9 @@ return value; } -int get_uint(const nlohmann::json &object, - const nlohmann::json::json_pointer& pointer, - unsigned value) noexcept +unsigned get_uint(const nlohmann::json &object, + const nlohmann::json::json_pointer& pointer, + unsigned value) noexcept { try { auto v = object.at(pointer); diff -r 2562eb64860d -r c8bc2c7f2929 libcommon/malikania/util.hpp --- a/libcommon/malikania/util.hpp Tue Sep 05 13:49:46 2017 +0200 +++ b/libcommon/malikania/util.hpp Tue Sep 05 13:50:10 2017 +0200 @@ -305,9 +305,9 @@ * \param def the default value * \return an integer */ -int get_uint(const nlohmann::json& object, - const nlohmann::json::json_pointer& pointer, - unsigned def = 0) noexcept; +unsigned get_uint(const nlohmann::json& object, + const nlohmann::json::json_pointer& pointer, + unsigned def = 0) noexcept; /** * Get a size object at the given pointer or a default value.