If needed 'virJSONValueIsNull' can be easily replaced by 'virJSONValueGetType(obj) == VIR_JSON_TYPE_NULL'. 'virJSONValueObjectIsNull' has confusing name because it checks that a virJSONValue of OBJECT type has a key which is NULL, not that the object itself is NULL. This can be replaced according to the needs e.g. by virJSONValueObjectHasKey or the above check. Both are unused. Signed-off-by: Peter Krempa <pkrempa@xxxxxxxxxx> --- src/libvirt_private.syms | 2 -- src/util/virjson.c | 19 ------------------- src/util/virjson.h | 2 -- 3 files changed, 23 deletions(-) diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index bf5d0f54f3..435ee8054c 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -2524,7 +2524,6 @@ virJSONValueGetString; virJSONValueGetType; virJSONValueHashFree; virJSONValueIsArray; -virJSONValueIsNull; virJSONValueIsObject; virJSONValueNewArray; virJSONValueNewBoolean; @@ -2565,7 +2564,6 @@ virJSONValueObjectGetString; virJSONValueObjectGetStringArray; virJSONValueObjectGetValue; virJSONValueObjectHasKey; -virJSONValueObjectIsNull; virJSONValueObjectKeysNumber; virJSONValueObjectPrependString; virJSONValueObjectRemoveKey; diff --git a/src/util/virjson.c b/src/util/virjson.c index 719f4de1bf..1c6fef22da 100644 --- a/src/util/virjson.c +++ b/src/util/virjson.c @@ -1136,13 +1136,6 @@ virJSONValueGetBoolean(virJSONValue *val, } -bool -virJSONValueIsNull(virJSONValue *val) -{ - return val->type == VIR_JSON_TYPE_NULL; -} - - const char * virJSONValueObjectGetString(virJSONValue *object, const char *key) @@ -1296,18 +1289,6 @@ virJSONValueObjectStealObject(virJSONValue *object, } -int -virJSONValueObjectIsNull(virJSONValue *object, - const char *key) -{ - virJSONValue *val = virJSONValueObjectGet(object, key); - - if (!val) - return -1; - - return virJSONValueIsNull(val); -} - char ** virJSONValueObjectGetStringArray(virJSONValue *object, const char *key) { diff --git a/src/util/virjson.h b/src/util/virjson.h index cb2315d13e..24ac51f4f8 100644 --- a/src/util/virjson.h +++ b/src/util/virjson.h @@ -99,7 +99,6 @@ int virJSONValueGetNumberLong(virJSONValue *object, long long *value); int virJSONValueGetNumberUlong(virJSONValue *object, unsigned long long *value); int virJSONValueGetNumberDouble(virJSONValue *object, double *value); int virJSONValueGetBoolean(virJSONValue *object, bool *value); -bool virJSONValueIsNull(virJSONValue *object); virJSONValue *virJSONValueObjectGetObject(virJSONValue *object, const char *key); virJSONValue *virJSONValueObjectGetArray(virJSONValue *object, @@ -118,7 +117,6 @@ int virJSONValueObjectGetNumberLong(virJSONValue *object, const char *key, long int virJSONValueObjectGetNumberUlong(virJSONValue *object, const char *key, unsigned long long *value); int virJSONValueObjectGetNumberDouble(virJSONValue *object, const char *key, double *value); int virJSONValueObjectGetBoolean(virJSONValue *object, const char *key, bool *value); -int virJSONValueObjectIsNull(virJSONValue *object, const char *key); int virJSONValueObjectAppendString(virJSONValue *object, const char *key, const char *value); int virJSONValueObjectAppendStringPrintf(virJSONValue *object, const char *key, const char *fmt, ...) -- 2.31.1