From e2e78437b472dc40e605cdcd895804105a680a1f Mon Sep 17 00:00:00 2001 From: Thierry Bultel Date: Wed, 4 Jul 2018 12:38:27 +0200 Subject: Fixed compilation warnings with latest jsonc Change-Id: I87a8c0ba3fdccf6bddd6f4fb7982225c1399f130 Signed-off-by: Thierry Bultel --- ahl-binding/role.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'ahl-binding/role.cpp') diff --git a/ahl-binding/role.cpp b/ahl-binding/role.cpp index 5215a60..5b2f95e 100644 --- a/ahl-binding/role.cpp +++ b/ahl-binding/role.cpp @@ -168,8 +168,9 @@ void role_t::invoke(afb_request* req) return; } - json_object* jaction = json_object_object_get(arg, "action"); - if (jaction == nullptr) + json_object* jaction; + json_bool ret = json_object_object_get_ex(arg, "action", &jaction); + if (!ret) { afb_request_fail(req, "No valid action!", nullptr); return; @@ -248,8 +249,9 @@ void role_t::volume(afb_request* r, json_object* o) AFB_DYNAPI_NOTICE(ahl_binding_t::instance().handle(), "Granted special audio-mixer permission to change volume"); } - json_object* value = json_object_object_get(o, "value"); - if(!value) + json_object* value; + json_bool ret = json_object_object_get_ex(o, "value", &value); + if (!ret) { afb_request_fail(r, "No value given!", nullptr); return; -- cgit 1.2.3-korg