[libvirt] [PATCH 12/25] util: json: Make first argument of virJSONValueObjectForeachKeyValue const

Peter Krempa pkrempa at redhat.com
Mon Jul 25 18:11:57 UTC 2016


The iterator function (second argument) already requires that the object
is handled as 'const' thus we won't modify the object itself.
---
 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 1022cfc..afc98e3 100644
--- a/src/util/virjson.c
+++ b/src/util/virjson.c
@@ -1220,7 +1220,7 @@ virJSONValueObjectIsNull(virJSONValuePtr object,
  * during iteration and -1 on generic errors.
  */
 int
-virJSONValueObjectForeachKeyValue(virJSONValuePtr object,
+virJSONValueObjectForeachKeyValue(const virJSONValue *object,
                                   virJSONValueObjectIteratorFunc cb,
                                   void *opaque)
 {
diff --git a/src/util/virjson.h b/src/util/virjson.h
index 66ed48a..a5aef39 100644
--- a/src/util/virjson.h
+++ b/src/util/virjson.h
@@ -167,7 +167,7 @@ typedef int (*virJSONValueObjectIteratorFunc)(const char *key,
                                               const virJSONValue *value,
                                               void *opaque);

-int virJSONValueObjectForeachKeyValue(virJSONValuePtr object,
+int virJSONValueObjectForeachKeyValue(const virJSONValue *object,
                                       virJSONValueObjectIteratorFunc cb,
                                       void *opaque);

-- 
2.9.0




More information about the libvir-list mailing list