diff options
author | Markus Armbruster <armbru@redhat.com> | 2015-03-17 11:54:50 +0100 |
---|---|---|
committer | Markus Armbruster <armbru@redhat.com> | 2015-06-22 18:20:40 +0200 |
commit | c6bd8c706a799eb0fece99f468aaa22b818036f3 (patch) | |
tree | f6f5c9119c642fee35cdd98957c3bfd30527a76d /qapi/string-input-visitor.c | |
parent | 75158ebbe259f0bd8bf435e8f4827a43ec89c877 (diff) |
qerror: Clean up QERR_ macros to expand into a single string
These macros expand into error class enumeration constant, comma,
string. Unclean. Has been that way since commit 13f59ae.
The error class is always ERROR_CLASS_GENERIC_ERROR since the previous
commit.
Clean up as follows:
* Prepend every use of a QERR_ macro by ERROR_CLASS_GENERIC_ERROR, and
delete it from the QERR_ macro. No change after preprocessing.
* Rewrite error_set(ERROR_CLASS_GENERIC_ERROR, ...) into
error_setg(...). Again, no change after preprocessing.
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Luiz Capitulino <lcapitulino@redhat.com>
Diffstat (limited to 'qapi/string-input-visitor.c')
-rw-r--r-- | qapi/string-input-visitor.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/qapi/string-input-visitor.c b/qapi/string-input-visitor.c index d8a8db02ed..bbd6a5456c 100644 --- a/qapi/string-input-visitor.c +++ b/qapi/string-input-visitor.c @@ -185,8 +185,8 @@ static void parse_type_int(Visitor *v, int64_t *obj, const char *name, StringInputVisitor *siv = DO_UPCAST(StringInputVisitor, visitor, v); if (!siv->string) { - error_set(errp, QERR_INVALID_PARAMETER_TYPE, name ? name : "null", - "integer"); + error_setg(errp, QERR_INVALID_PARAMETER_TYPE, name ? name : "null", + "integer"); return; } @@ -217,8 +217,8 @@ static void parse_type_int(Visitor *v, int64_t *obj, const char *name, return; error: - error_set(errp, QERR_INVALID_PARAMETER_VALUE, name, - "an int64 value or range"); + error_setg(errp, QERR_INVALID_PARAMETER_VALUE, name, + "an int64 value or range"); } static void parse_type_size(Visitor *v, uint64_t *obj, const char *name, @@ -231,8 +231,8 @@ static void parse_type_size(Visitor *v, uint64_t *obj, const char *name, if (siv->string) { parse_option_size(name, siv->string, &val, &err); } else { - error_set(errp, QERR_INVALID_PARAMETER_TYPE, name ? name : "null", - "size"); + error_setg(errp, QERR_INVALID_PARAMETER_TYPE, name ? name : "null", + "size"); return; } if (err) { @@ -263,8 +263,8 @@ static void parse_type_bool(Visitor *v, bool *obj, const char *name, } } - error_set(errp, QERR_INVALID_PARAMETER_TYPE, name ? name : "null", - "boolean"); + error_setg(errp, QERR_INVALID_PARAMETER_TYPE, name ? name : "null", + "boolean"); } static void parse_type_str(Visitor *v, char **obj, const char *name, @@ -274,8 +274,8 @@ static void parse_type_str(Visitor *v, char **obj, const char *name, if (siv->string) { *obj = g_strdup(siv->string); } else { - error_set(errp, QERR_INVALID_PARAMETER_TYPE, name ? name : "null", - "string"); + error_setg(errp, QERR_INVALID_PARAMETER_TYPE, name ? name : "null", + "string"); } } @@ -291,8 +291,8 @@ static void parse_type_number(Visitor *v, double *obj, const char *name, val = strtod(siv->string, &endp); } if (!siv->string || errno || endp == siv->string || *endp) { - error_set(errp, QERR_INVALID_PARAMETER_TYPE, name ? name : "null", - "number"); + error_setg(errp, QERR_INVALID_PARAMETER_TYPE, name ? name : "null", + "number"); return; } |