From d5f518c785a9e62e9666fbb621466c98c5450c99 Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Mon, 21 Dec 2020 16:08:51 +0000 Subject: [PATCH] Port rpmostree-json-parsing to C++ Prep for using https://cxx.rs/ --- Makefile-libpriv.am | 2 +- .../{rpmostree-json-parsing.c => rpmostree-json-parsing.cxx} | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) rename src/libpriv/{rpmostree-json-parsing.c => rpmostree-json-parsing.cxx} (97%) diff --git a/Makefile-libpriv.am b/Makefile-libpriv.am index ada52deb..53320de4 100644 --- a/Makefile-libpriv.am +++ b/Makefile-libpriv.am @@ -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 \ diff --git a/src/libpriv/rpmostree-json-parsing.c b/src/libpriv/rpmostree-json-parsing.cxx similarity index 97% rename from src/libpriv/rpmostree-json-parsing.c rename to src/libpriv/rpmostree-json-parsing.cxx index decc8d27..f7646a70 100644 --- a/src/libpriv/rpmostree-json-parsing.c +++ b/src/libpriv/rpmostree-json-parsing.cxx @@ -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; }