From 0b2a0d6bb2446060944061e53e87d0c7addede79 Mon Sep 17 00:00:00 2001 From: Eric Blake Date: Fri, 29 Jan 2016 06:48:56 -0700 Subject: qapi: Swap 'name' in visit_* callbacks to match public API MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Marc-André Lureau Message-Id: <1454075341-13658-21-git-send-email-eblake@redhat.com> Signed-off-by: Markus Armbruster --- qapi/string-input-visitor.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'qapi/string-input-visitor.c') diff --git a/qapi/string-input-visitor.c b/qapi/string-input-visitor.c index 4c2344771b..cdf129cb7d 100644 --- a/qapi/string-input-visitor.c +++ b/qapi/string-input-visitor.c @@ -185,7 +185,7 @@ end_list(Visitor *v, Error **errp) siv->head = true; } -static void parse_type_int64(Visitor *v, int64_t *obj, const char *name, +static void parse_type_int64(Visitor *v, const char *name, int64_t *obj, Error **errp) { StringInputVisitor *siv = to_siv(v); @@ -227,13 +227,13 @@ error: "an int64 value or range"); } -static void parse_type_uint64(Visitor *v, uint64_t *obj, const char *name, +static void parse_type_uint64(Visitor *v, const char *name, uint64_t *obj, Error **errp) { /* FIXME: parse_type_int64 mishandles values over INT64_MAX */ int64_t i; Error *err = NULL; - parse_type_int64(v, &i, name, &err); + parse_type_int64(v, name, &i, &err); if (err) { error_propagate(errp, err); } else { @@ -241,7 +241,7 @@ static void parse_type_uint64(Visitor *v, uint64_t *obj, const char *name, } } -static void parse_type_size(Visitor *v, uint64_t *obj, const char *name, +static void parse_type_size(Visitor *v, const char *name, uint64_t *obj, Error **errp) { StringInputVisitor *siv = to_siv(v); @@ -263,7 +263,7 @@ static void parse_type_size(Visitor *v, uint64_t *obj, const char *name, *obj = val; } -static void parse_type_bool(Visitor *v, bool *obj, const char *name, +static void parse_type_bool(Visitor *v, const char *name, bool *obj, Error **errp) { StringInputVisitor *siv = to_siv(v); @@ -287,7 +287,7 @@ static void parse_type_bool(Visitor *v, bool *obj, const char *name, "boolean"); } -static void parse_type_str(Visitor *v, char **obj, const char *name, +static void parse_type_str(Visitor *v, const char *name, char **obj, Error **errp) { StringInputVisitor *siv = to_siv(v); @@ -299,7 +299,7 @@ static void parse_type_str(Visitor *v, char **obj, const char *name, } } -static void parse_type_number(Visitor *v, double *obj, const char *name, +static void parse_type_number(Visitor *v, const char *name, double *obj, Error **errp) { StringInputVisitor *siv = to_siv(v); @@ -319,7 +319,7 @@ static void parse_type_number(Visitor *v, double *obj, const char *name, *obj = val; } -static void parse_optional(Visitor *v, bool *present, const char *name) +static void parse_optional(Visitor *v, const char *name, bool *present) { StringInputVisitor *siv = to_siv(v); -- cgit v1.2.3