render / rpms / libvirt

Forked from rpms/libvirt 10 months ago
Clone
6ae9ed
From c0d35995c15a2c2a341d112cf74bcd943b2dc92f Mon Sep 17 00:00:00 2001
6ae9ed
Message-Id: <c0d35995c15a2c2a341d112cf74bcd943b2dc92f@dist-git>
6ae9ed
From: Peter Krempa <pkrempa@redhat.com>
6ae9ed
Date: Tue, 2 Aug 2016 13:41:41 +0200
6ae9ed
Subject: [PATCH] util: json: Make first argument of
6ae9ed
 virJSONValueObjectForeachKeyValue const
6ae9ed
6ae9ed
The iterator function (second argument) already requires that the object
6ae9ed
is handled as 'const' thus we won't modify the object itself.
6ae9ed
6ae9ed
(cherry picked from commit bc4339719eb8eb5c83127d6f152f9e77915a7b9c)
6ae9ed
6ae9ed
https://bugzilla.redhat.com/show_bug.cgi?id=1134878 [JSON backing]
6ae9ed
https://bugzilla.redhat.com/show_bug.cgi?id=1247521 [gluster multi-host]
6ae9ed
---
6ae9ed
 src/util/virjson.c | 2 +-
6ae9ed
 src/util/virjson.h | 2 +-
6ae9ed
 2 files changed, 2 insertions(+), 2 deletions(-)
6ae9ed
6ae9ed
diff --git a/src/util/virjson.c b/src/util/virjson.c
6ae9ed
index 1022cfc..afc98e3 100644
6ae9ed
--- a/src/util/virjson.c
6ae9ed
+++ b/src/util/virjson.c
6ae9ed
@@ -1220,7 +1220,7 @@ virJSONValueObjectIsNull(virJSONValuePtr object,
6ae9ed
  * during iteration and -1 on generic errors.
6ae9ed
  */
6ae9ed
 int
6ae9ed
-virJSONValueObjectForeachKeyValue(virJSONValuePtr object,
6ae9ed
+virJSONValueObjectForeachKeyValue(const virJSONValue *object,
6ae9ed
                                   virJSONValueObjectIteratorFunc cb,
6ae9ed
                                   void *opaque)
6ae9ed
 {
6ae9ed
diff --git a/src/util/virjson.h b/src/util/virjson.h
6ae9ed
index 66ed48a..a5aef39 100644
6ae9ed
--- a/src/util/virjson.h
6ae9ed
+++ b/src/util/virjson.h
6ae9ed
@@ -167,7 +167,7 @@ typedef int (*virJSONValueObjectIteratorFunc)(const char *key,
6ae9ed
                                               const virJSONValue *value,
6ae9ed
                                               void *opaque);
6ae9ed
 
6ae9ed
-int virJSONValueObjectForeachKeyValue(virJSONValuePtr object,
6ae9ed
+int virJSONValueObjectForeachKeyValue(const virJSONValue *object,
6ae9ed
                                       virJSONValueObjectIteratorFunc cb,
6ae9ed
                                       void *opaque);
6ae9ed
 
6ae9ed
-- 
6ae9ed
2.9.2
6ae9ed