提交 c1cb4cb9 编写于 作者: J Jiri Denemark

virjson: Remove const from virJSONValueObjectForeachKeyValue

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: NJiri Denemark <jdenemar@redhat.com>
上级 20e64d34
......@@ -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)
{
......
......@@ -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);
......
......@@ -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;
......
......@@ -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,
......
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册