]> xenbits.xensource.com Git - libvirt.git/commitdiff
util: json: Make first argument of virJSONValueObjectForeachKeyValue const
authorPeter Krempa <pkrempa@redhat.com>
Fri, 22 Jul 2016 14:56:37 +0000 (16:56 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Wed, 27 Jul 2016 07:39:42 +0000 (09:39 +0200)
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
src/util/virjson.h

index 1022cfc4b9276d9a1c154c87b3630c34c24a0b1d..afc98e3e84612894e679bd15c8dc68bee0c9d9f7 100644 (file)
@@ -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)
 {
index 66ed48aad5cae5bcec8e507567f8dfea72a3ce71..a5aef3957c6a47d6b11dabbdd85047aafcd8f0da 100644 (file)
@@ -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);