diff options
author | Peter Krempa <pkrempa@redhat.com> | 2015-01-15 14:40:48 +0100 |
---|---|---|
committer | Peter Krempa <pkrempa@redhat.com> | 2015-01-23 13:18:04 +0100 |
commit | 60e4e5783d4163d5007f1e0af6f45c8cbb4a3ddb (patch) | |
tree | 0f01fce51a569f6ec46c43dcf40e4136c9101044 | |
parent | 165c34778bcb4cdc74846338c0224cba4f8cafc2 (diff) | |
download | libvirt-60e4e5783d4163d5007f1e0af6f45c8cbb4a3ddb.tar.gz |
util: json: Make argument of virJSONValueArraySize const
The function doesn't allow to modify the array in any way, thus the
argument can be const.
-rw-r--r-- | src/util/virjson.c | 2 | ||||
-rw-r--r-- | src/util/virjson.h | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/util/virjson.c b/src/util/virjson.c index 3ffa19f7db..9f2e1cfce2 100644 --- a/src/util/virjson.c +++ b/src/util/virjson.c @@ -797,7 +797,7 @@ virJSONValueIsArray(virJSONValuePtr array) int -virJSONValueArraySize(virJSONValuePtr array) +virJSONValueArraySize(const virJSONValue *array) { if (array->type != VIR_JSON_TYPE_ARRAY) return -1; diff --git a/src/util/virjson.h b/src/util/virjson.h index 1996a91104..c0aefba1d5 100644 --- a/src/util/virjson.h +++ b/src/util/virjson.h @@ -105,7 +105,7 @@ int virJSONValueObjectHasKey(virJSONValuePtr object, const char *key); virJSONValuePtr virJSONValueObjectGet(virJSONValuePtr object, const char *key); bool virJSONValueIsArray(virJSONValuePtr array); -int virJSONValueArraySize(virJSONValuePtr object); +int virJSONValueArraySize(const virJSONValue *array); virJSONValuePtr virJSONValueArrayGet(virJSONValuePtr object, unsigned int element); virJSONValuePtr virJSONValueArraySteal(virJSONValuePtr object, unsigned int element); |