changeset 109:c8bc2c7f2929

Common: fix get_uint narrowing error
author David Demelier <markand@malikania.fr>
date Tue, 05 Sep 2017 13:50:10 +0200
parents 2562eb64860d
children 119bcc5a727e
files libcommon/malikania/util.cpp libcommon/malikania/util.hpp
diffstat 2 files changed, 6 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- 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);
--- 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.