diff options
author | Thierry Bultel <thierry.bultel@iot.bzh> | 2018-07-04 12:38:27 +0200 |
---|---|---|
committer | Thierry Bultel <thierry.bultel@iot.bzh> | 2018-07-04 12:38:27 +0200 |
commit | cf9c83ca5375f7daa199866545f00e211d038b15 (patch) | |
tree | 3724154f1692310c9bda68ed1aa9e753a4419267 /ahl-binding/jsonc_utils.hpp | |
parent | 56f9d67e5856aed4f6349769fd262217497f6bc5 (diff) |
Fixed compilation warnings with latest jsonc
Change-Id: I87a8c0ba3fdccf6bddd6f4fb7982225c1399f130
Signed-off-by: Thierry Bultel <thierry.bultel@iot.bzh>
Diffstat (limited to 'ahl-binding/jsonc_utils.hpp')
-rw-r--r-- | ahl-binding/jsonc_utils.hpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/ahl-binding/jsonc_utils.hpp b/ahl-binding/jsonc_utils.hpp index 5e82fca..097eda4 100644 --- a/ahl-binding/jsonc_utils.hpp +++ b/ahl-binding/jsonc_utils.hpp @@ -81,11 +81,15 @@ inline std::string& jcast<std::string>(std::string& v, json_object* o) template<class T> inline T& jcast(T& v, json_object* o, std::string field) { - return jcast<T>(v, json_object_object_get(o, field.c_str())); + json_object * value; + json_object_object_get_ex(o, field.c_str(), &value); + return jcast<T>(v, value); } template<class T> inline T& jcast_array(T& v, json_object* o, std::string field) { - return jcast_array<T>(v, json_object_object_get(o, field.c_str())); + json_object * value; + json_object_object_get_ex(o, field.c_str(), &value); + return jcast_array<T>(v, value); } |