Port rpmostree-json-parsing to C++

Prep for using https://cxx.rs/
This commit is contained in:
Colin Walters 2020-12-21 16:08:51 +00:00 committed by OpenShift Merge Robot
parent df9c60ea62
commit d5f518c785
2 changed files with 3 additions and 3 deletions

View File

@ -18,7 +18,7 @@
librpmostreepriv_sources = \
src/libpriv/rpmostree-postprocess.cxx \
src/libpriv/rpmostree-postprocess.h \
src/libpriv/rpmostree-json-parsing.c \
src/libpriv/rpmostree-json-parsing.cxx \
src/libpriv/rpmostree-json-parsing.h \
src/libpriv/rpmostree-util.cxx \
src/libpriv/rpmostree-util.h \

View File

@ -57,7 +57,7 @@ _rpmostree_jsonutil_object_require_string_member (JsonObject *object,
if (!_rpmostree_jsonutil_object_get_optional_string_member (object, member_name, &ret, error))
return NULL;
if (!ret)
return glnx_null_throw (error, "Member '%s' not found", member_name);
return (char*)glnx_null_throw (error, "Member '%s' not found", member_name);
return ret;
}
@ -141,7 +141,7 @@ _rpmostree_jsonutil_array_require_string_element (JsonArray *array,
{
const char *ret = json_array_get_string_element (array, i);
if (!ret)
return glnx_null_throw (error, "Element at index %u is not a string", i);
return (char*)glnx_null_throw (error, "Element at index %u is not a string", i);
return ret;
}