summaryrefslogtreecommitdiff
path: root/qapi/qmp-input-visitor.c
diff options
context:
space:
mode:
authorEric Blake <eblake@redhat.com>2016-01-29 06:48:56 -0700
committerMarkus Armbruster <armbru@redhat.com>2016-02-08 17:29:56 +0100
commit0b2a0d6bb2446060944061e53e87d0c7addede79 (patch)
treecad44bc332e2b6032155f8fe3731be4b134aefe1 /qapi/qmp-input-visitor.c
parentd7bce9999df85c56c8cb1fcffd944d51bff8ff48 (diff)
downloadqemu-0b2a0d6bb2446060944061e53e87d0c7addede79.zip
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/qmp-input-visitor.c')
-rw-r--r--qapi/qmp-input-visitor.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/qapi/qmp-input-visitor.c b/qapi/qmp-input-visitor.c
index 5eb67dfc30..f3a0fd55c9 100644
--- a/qapi/qmp-input-visitor.c
+++ b/qapi/qmp-input-visitor.c
@@ -115,8 +115,8 @@ static void qmp_input_pop(QmpInputVisitor *qiv, Error **errp)
qiv->nb_stack--;
}
-static void qmp_input_start_struct(Visitor *v, void **obj, const char *kind,
- const char *name, size_t size, Error **errp)
+static void qmp_input_start_struct(Visitor *v, const char *name, void **obj,
+ const char *kind, size_t size, Error **errp)
{
QmpInputVisitor *qiv = to_qiv(v);
QObject *qobj = qmp_input_get_object(qiv, name, true);
@@ -209,8 +209,8 @@ static void qmp_input_end_list(Visitor *v, Error **errp)
qmp_input_pop(qiv, errp);
}
-static void qmp_input_get_next_type(Visitor *v, QType *type, bool promote_int,
- const char *name, Error **errp)
+static void qmp_input_get_next_type(Visitor *v, const char *name, QType *type,
+ bool promote_int, Error **errp)
{
QmpInputVisitor *qiv = to_qiv(v);
QObject *qobj = qmp_input_get_object(qiv, name, false);
@@ -225,7 +225,7 @@ static void qmp_input_get_next_type(Visitor *v, QType *type, bool promote_int,
}
}
-static void qmp_input_type_int64(Visitor *v, int64_t *obj, const char *name,
+static void qmp_input_type_int64(Visitor *v, const char *name, int64_t *obj,
Error **errp)
{
QmpInputVisitor *qiv = to_qiv(v);
@@ -240,7 +240,7 @@ static void qmp_input_type_int64(Visitor *v, int64_t *obj, const char *name,
*obj = qint_get_int(qint);
}
-static void qmp_input_type_uint64(Visitor *v, uint64_t *obj, const char *name,
+static void qmp_input_type_uint64(Visitor *v, const char *name, uint64_t *obj,
Error **errp)
{
/* FIXME: qobject_to_qint mishandles values over INT64_MAX */
@@ -256,7 +256,7 @@ static void qmp_input_type_uint64(Visitor *v, uint64_t *obj, const char *name,
*obj = qint_get_int(qint);
}
-static void qmp_input_type_bool(Visitor *v, bool *obj, const char *name,
+static void qmp_input_type_bool(Visitor *v, const char *name, bool *obj,
Error **errp)
{
QmpInputVisitor *qiv = to_qiv(v);
@@ -271,7 +271,7 @@ static void qmp_input_type_bool(Visitor *v, bool *obj, const char *name,
*obj = qbool_get_bool(qbool);
}
-static void qmp_input_type_str(Visitor *v, char **obj, const char *name,
+static void qmp_input_type_str(Visitor *v, const char *name, char **obj,
Error **errp)
{
QmpInputVisitor *qiv = to_qiv(v);
@@ -286,7 +286,7 @@ static void qmp_input_type_str(Visitor *v, char **obj, const char *name,
*obj = g_strdup(qstring_get_str(qstr));
}
-static void qmp_input_type_number(Visitor *v, double *obj, const char *name,
+static void qmp_input_type_number(Visitor *v, const char *name, double *obj,
Error **errp)
{
QmpInputVisitor *qiv = to_qiv(v);
@@ -310,7 +310,7 @@ static void qmp_input_type_number(Visitor *v, double *obj, const char *name,
"number");
}
-static void qmp_input_type_any(Visitor *v, QObject **obj, const char *name,
+static void qmp_input_type_any(Visitor *v, const char *name, QObject **obj,
Error **errp)
{
QmpInputVisitor *qiv = to_qiv(v);
@@ -320,7 +320,7 @@ static void qmp_input_type_any(Visitor *v, QObject **obj, const char *name,
*obj = qobj;
}
-static void qmp_input_optional(Visitor *v, bool *present, const char *name)
+static void qmp_input_optional(Visitor *v, const char *name, bool *present)
{
QmpInputVisitor *qiv = to_qiv(v);
QObject *qobj = qmp_input_get_object(qiv, name, true);