summaryrefslogtreecommitdiffstats
path: root/qapi/qapi-dealloc-visitor.c
diff options
context:
space:
mode:
authorEric Blake <eblake@redhat.com>2016-01-29 06:48:56 -0700
committerTimothy Pearson <tpearson@raptorengineering.com>2019-11-29 19:32:24 -0600
commitd99865847c55f0dc6e23e59c246c3c72a3fab527 (patch)
treea16a558f606b510ee725c380be96a1a0ba98ee8f /qapi/qapi-dealloc-visitor.c
parentba40fb4d39a4df33a15cb0b5cf882a4296c89f98 (diff)
downloadhqemu-d99865847c55f0dc6e23e59c246c3c72a3fab527.zip
hqemu-d99865847c55f0dc6e23e59c246c3c72a3fab527.tar.gz
qapi: Swap 'name' in visit_* callbacks to match public API
As explained in the previous patches, matching argument order of 'name, &value' to JSON's "name":value makes sense. However, while the last two patches were easy with Coccinelle, I ended up doing this one all by hand. Now all the visitor callbacks match the main interface. The compiler is able to enforce that all clients match the changed interface in visitor-impl.h, even where two pointers are being swapped, because only one of the two pointers is const (if that were not the case, then C's looseness on treating 'char *' like 'void *' would have made review a bit harder). Signed-off-by: Eric Blake <eblake@redhat.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <1454075341-13658-21-git-send-email-eblake@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
Diffstat (limited to 'qapi/qapi-dealloc-visitor.c')
-rw-r--r--qapi/qapi-dealloc-visitor.c25
1 files changed, 12 insertions, 13 deletions
diff --git a/qapi/qapi-dealloc-visitor.c b/qapi/qapi-dealloc-visitor.c
index 2c257d8..556137e 100644
--- a/qapi/qapi-dealloc-visitor.c
+++ b/qapi/qapi-dealloc-visitor.c
@@ -59,8 +59,8 @@ static void *qapi_dealloc_pop(QapiDeallocVisitor *qov)
return value;
}
-static void qapi_dealloc_start_struct(Visitor *v, void **obj, const char *kind,
- const char *name, size_t unused,
+static void qapi_dealloc_start_struct(Visitor *v, const char *name, void **obj,
+ const char *kind, size_t unused,
Error **errp)
{
QapiDeallocVisitor *qov = to_qov(v);
@@ -128,7 +128,7 @@ static void qapi_dealloc_end_list(Visitor *v, Error **errp)
assert(obj == NULL); /* should've been list head tracker with no payload */
}
-static void qapi_dealloc_type_str(Visitor *v, char **obj, const char *name,
+static void qapi_dealloc_type_str(Visitor *v, const char *name, char **obj,
Error **errp)
{
if (obj) {
@@ -136,38 +136,37 @@ static void qapi_dealloc_type_str(Visitor *v, char **obj, const char *name,
}
}
-static void qapi_dealloc_type_int64(Visitor *v, int64_t *obj, const char *name,
+static void qapi_dealloc_type_int64(Visitor *v, const char *name, int64_t *obj,
Error **errp)
{
}
-static void qapi_dealloc_type_uint64(Visitor *v, uint64_t *obj,
- const char *name, Error **errp)
+static void qapi_dealloc_type_uint64(Visitor *v, const char *name,
+ uint64_t *obj, Error **errp)
{
}
-static void qapi_dealloc_type_bool(Visitor *v, bool *obj, const char *name,
+static void qapi_dealloc_type_bool(Visitor *v, const char *name, bool *obj,
Error **errp)
{
}
-static void qapi_dealloc_type_number(Visitor *v, double *obj, const char *name,
+static void qapi_dealloc_type_number(Visitor *v, const char *name, double *obj,
Error **errp)
{
}
-static void qapi_dealloc_type_anything(Visitor *v, QObject **obj,
- const char *name, Error **errp)
+static void qapi_dealloc_type_anything(Visitor *v, const char *name,
+ QObject **obj, Error **errp)
{
if (obj) {
qobject_decref(*obj);
}
}
-static void qapi_dealloc_type_enum(Visitor *v, int *obj,
+static void qapi_dealloc_type_enum(Visitor *v, const char *name, int *obj,
const char * const strings[],
- const char *kind, const char *name,
- Error **errp)
+ const char *kind, Error **errp)
{
}
OpenPOWER on IntegriCloud