[PATCH 3/5] util: json: Make argument of virJSONValueArraySize const

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 3ffa19f..9f2e1cf 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 1996a91..c0aefba 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);

-- 
2.2.1

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]