From c6bd8c706a799eb0fece99f468aaa22b818036f3 Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Tue, 17 Mar 2015 11:54:50 +0100 Subject: 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 Reviewed-by: Stefan Hajnoczi Reviewed-by: Eric Blake Reviewed-by: Luiz Capitulino --- qapi/qapi-visit-core.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'qapi/qapi-visit-core.c') diff --git a/qapi/qapi-visit-core.c b/qapi/qapi-visit-core.c index a18ba1670f..5a7c900504 100644 --- a/qapi/qapi-visit-core.c +++ b/qapi/qapi-visit-core.c @@ -110,8 +110,8 @@ void visit_type_uint8(Visitor *v, uint8_t *obj, const char *name, Error **errp) value = *obj; v->type_int(v, &value, name, errp); if (value < 0 || value > UINT8_MAX) { - error_set(errp, QERR_INVALID_PARAMETER_VALUE, name ? name : "null", - "uint8_t"); + error_setg(errp, QERR_INVALID_PARAMETER_VALUE, + name ? name : "null", "uint8_t"); return; } *obj = value; @@ -128,8 +128,8 @@ void visit_type_uint16(Visitor *v, uint16_t *obj, const char *name, Error **errp value = *obj; v->type_int(v, &value, name, errp); if (value < 0 || value > UINT16_MAX) { - error_set(errp, QERR_INVALID_PARAMETER_VALUE, name ? name : "null", - "uint16_t"); + error_setg(errp, QERR_INVALID_PARAMETER_VALUE, + name ? name : "null", "uint16_t"); return; } *obj = value; @@ -146,8 +146,8 @@ void visit_type_uint32(Visitor *v, uint32_t *obj, const char *name, Error **errp value = *obj; v->type_int(v, &value, name, errp); if (value < 0 || value > UINT32_MAX) { - error_set(errp, QERR_INVALID_PARAMETER_VALUE, name ? name : "null", - "uint32_t"); + error_setg(errp, QERR_INVALID_PARAMETER_VALUE, + name ? name : "null", "uint32_t"); return; } *obj = value; @@ -177,8 +177,8 @@ void visit_type_int8(Visitor *v, int8_t *obj, const char *name, Error **errp) value = *obj; v->type_int(v, &value, name, errp); if (value < INT8_MIN || value > INT8_MAX) { - error_set(errp, QERR_INVALID_PARAMETER_VALUE, name ? name : "null", - "int8_t"); + error_setg(errp, QERR_INVALID_PARAMETER_VALUE, + name ? name : "null", "int8_t"); return; } *obj = value; @@ -195,8 +195,8 @@ void visit_type_int16(Visitor *v, int16_t *obj, const char *name, Error **errp) value = *obj; v->type_int(v, &value, name, errp); if (value < INT16_MIN || value > INT16_MAX) { - error_set(errp, QERR_INVALID_PARAMETER_VALUE, name ? name : "null", - "int16_t"); + error_setg(errp, QERR_INVALID_PARAMETER_VALUE, + name ? name : "null", "int16_t"); return; } *obj = value; @@ -213,8 +213,8 @@ void visit_type_int32(Visitor *v, int32_t *obj, const char *name, Error **errp) value = *obj; v->type_int(v, &value, name, errp); if (value < INT32_MIN || value > INT32_MAX) { - error_set(errp, QERR_INVALID_PARAMETER_VALUE, name ? name : "null", - "int32_t"); + error_setg(errp, QERR_INVALID_PARAMETER_VALUE, + name ? name : "null", "int32_t"); return; } *obj = value; @@ -271,7 +271,7 @@ void output_type_enum(Visitor *v, int *obj, const char * const strings[], assert(strings); while (strings[i++] != NULL); if (value < 0 || value >= i - 1) { - error_set(errp, QERR_INVALID_PARAMETER, name ? name : "null"); + error_setg(errp, QERR_INVALID_PARAMETER, name ? name : "null"); return; } @@ -303,7 +303,7 @@ void input_type_enum(Visitor *v, int *obj, const char * const strings[], } if (strings[value] == NULL) { - error_set(errp, QERR_INVALID_PARAMETER, enum_str); + error_setg(errp, QERR_INVALID_PARAMETER, enum_str); g_free(enum_str); return; } -- cgit v1.2.3-55-g7522