From 60e4e5783d4163d5007f1e0af6f45c8cbb4a3ddb Mon Sep 17 00:00:00 2001 From: Peter Krempa Date: Thu, 15 Jan 2015 14:40:48 +0100 Subject: 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. --- src/util/virjson.c | 2 +- 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); -- cgit v1.2.1