Almost none of our virJSONValue*Get* functions accept const virJSONValue
pointers and it wouldn't even make sense since we sometimes modify what
we get. And because there is no reason for preventing callers of
virJSONValueObjectForeachKeyValue from modifying the values they get in
each iteration we can just stop doing it.
Signed-off-by: Jiri Denemark <jdenemar(a)redhat.com>
---
src/util/virjson.c | 2 +-
src/util/virjson.h | 4 ++--
src/util/virqemu.c | 16 ++++++++--------
src/util/virqemu.h | 10 +++++-----
src/util/virstoragefile.c | 2 +-
5 files changed, 17 insertions(+), 17 deletions(-)
diff --git a/src/util/virjson.c b/src/util/virjson.c
index b42211c0d..3804e7e97 100644
--- a/src/util/virjson.c
+++ b/src/util/virjson.c
@@ -1321,7 +1321,7 @@ virJSONValueObjectIsNull(virJSONValuePtr object,
* during iteration and -1 on generic errors.
*/
int
-virJSONValueObjectForeachKeyValue(const virJSONValue *object,
+virJSONValueObjectForeachKeyValue(virJSONValuePtr object,
virJSONValueObjectIteratorFunc cb,
void *opaque)
{
diff --git a/src/util/virjson.h b/src/util/virjson.h
index 5b4f17253..122de96c5 100644
--- a/src/util/virjson.h
+++ b/src/util/virjson.h
@@ -172,10 +172,10 @@ char *virJSONValueToString(virJSONValuePtr object,
bool pretty);
typedef int (*virJSONValueObjectIteratorFunc)(const char *key,
- const virJSONValue *value,
+ virJSONValuePtr value,
void *opaque);
-int virJSONValueObjectForeachKeyValue(const virJSONValue *object,
+int virJSONValueObjectForeachKeyValue(virJSONValuePtr object,
virJSONValueObjectIteratorFunc cb,
void *opaque);
diff --git a/src/util/virqemu.c b/src/util/virqemu.c
index 7849d8b3e..2e9e65f9e 100644
--- a/src/util/virqemu.c
+++ b/src/util/virqemu.c
@@ -42,7 +42,7 @@ struct virQEMUCommandLineJSONIteratorData {
static int
virQEMUBuildCommandLineJSONRecurse(const char *key,
- const virJSONValue *value,
+ virJSONValuePtr value,
virBufferPtr buf,
virQEMUBuildCommandLineJSONArrayFormatFunc arrayFunc,
bool nested);
@@ -51,7 +51,7 @@ virQEMUBuildCommandLineJSONRecurse(const char *key,
int
virQEMUBuildCommandLineJSONArrayBitmap(const char *key,
- const virJSONValue *array,
+ virJSONValuePtr array,
virBufferPtr buf)
{
ssize_t pos = -1;
@@ -81,10 +81,10 @@ virQEMUBuildCommandLineJSONArrayBitmap(const char *key,
int
virQEMUBuildCommandLineJSONArrayNumbered(const char *key,
- const virJSONValue *array,
+ virJSONValuePtr array,
virBufferPtr buf)
{
- const virJSONValue *member;
+ virJSONValuePtr member;
char *prefix = NULL;
size_t i;
int ret = 0;
@@ -114,7 +114,7 @@ virQEMUBuildCommandLineJSONArrayNumbered(const char *key,
/* internal iterator to handle nested object formatting */
static int
virQEMUBuildCommandLineJSONIterate(const char *key,
- const virJSONValue *value,
+ virJSONValuePtr value,
void *opaque)
{
struct virQEMUCommandLineJSONIteratorData *data = opaque;
@@ -140,7 +140,7 @@ virQEMUBuildCommandLineJSONIterate(const char *key,
static int
virQEMUBuildCommandLineJSONRecurse(const char *key,
- const virJSONValue *value,
+ virJSONValuePtr value,
virBufferPtr buf,
virQEMUBuildCommandLineJSONArrayFormatFunc arrayFunc,
bool nested)
@@ -225,7 +225,7 @@ virQEMUBuildCommandLineJSONRecurse(const char *key,
* Returns 0 on success -1 on error.
*/
int
-virQEMUBuildCommandLineJSON(const virJSONValue *value,
+virQEMUBuildCommandLineJSON(virJSONValuePtr value,
virBufferPtr buf,
virQEMUBuildCommandLineJSONArrayFormatFunc array)
{
@@ -264,7 +264,7 @@ virQEMUBuildObjectCommandlineFromJSON(const char *type,
char *
-virQEMUBuildDriveCommandlineFromJSON(const virJSONValue *srcdef)
+virQEMUBuildDriveCommandlineFromJSON(virJSONValuePtr srcdef)
{
virBuffer buf = VIR_BUFFER_INITIALIZER;
char *ret = NULL;
diff --git a/src/util/virqemu.h b/src/util/virqemu.h
index f3c2b6956..539d62ab1 100644
--- a/src/util/virqemu.h
+++ b/src/util/virqemu.h
@@ -30,16 +30,16 @@
# include "virstorageencryption.h"
typedef int (*virQEMUBuildCommandLineJSONArrayFormatFunc)(const char *key,
- const virJSONValue *array,
+ virJSONValuePtr array,
virBufferPtr buf);
int virQEMUBuildCommandLineJSONArrayBitmap(const char *key,
- const virJSONValue *array,
+ virJSONValuePtr array,
virBufferPtr buf);
int virQEMUBuildCommandLineJSONArrayNumbered(const char *key,
- const virJSONValue *array,
+ virJSONValuePtr array,
virBufferPtr buf);
-int virQEMUBuildCommandLineJSON(const virJSONValue *value,
+int virQEMUBuildCommandLineJSON(virJSONValuePtr value,
virBufferPtr buf,
virQEMUBuildCommandLineJSONArrayFormatFunc array);
@@ -47,7 +47,7 @@ char *virQEMUBuildObjectCommandlineFromJSON(const char *type,
const char *alias,
virJSONValuePtr props);
-char *virQEMUBuildDriveCommandlineFromJSON(const virJSONValue *src);
+char *virQEMUBuildDriveCommandlineFromJSON(virJSONValuePtr src);
void virQEMUBuildBufferEscapeComma(virBufferPtr buf, const char *str);
void virQEMUBuildLuksOpts(virBufferPtr buf,
diff --git a/src/util/virstoragefile.c b/src/util/virstoragefile.c
index f750e121a..9ec005d50 100644
--- a/src/util/virstoragefile.c
+++ b/src/util/virstoragefile.c
@@ -2990,7 +2990,7 @@ static const struct virStorageSourceJSONDriverParser jsonParsers[] =
{
static int
virStorageSourceParseBackingJSONDeflattenWorker(const char *key,
- const virJSONValue *value,
+ virJSONValuePtr value,
void *opaque)
{
virJSONValuePtr retobj = opaque;
--
2.11.0