From a7c31816288a8f20fc387d69d441413e7a8c9ff1 Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Wed, 29 Apr 2015 15:35:04 -0600 Subject: qobject: Clean up around qtype_code QTYPE_NONE is a sentinel value. No QObject has this type code. Document it properly. Fix dump_qobject() to abort() on QTYPE_NONE, just like for any other invalid type code. Fix to_json() to abort() on all invalid type codes, not just QTYPE_MAX. Clean up Property member qtype's type: it's a qtype_code. Signed-off-by: Markus Armbruster Reviewed-by: Eric Blake Signed-off-by: Luiz Capitulino --- qobject/qjson.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'qobject') diff --git a/qobject/qjson.c b/qobject/qjson.c index 12c576d548..f2857c13ea 100644 --- a/qobject/qjson.c +++ b/qobject/qjson.c @@ -260,9 +260,8 @@ static void to_json(const QObject *obj, QString *str, int pretty, int indent) } case QTYPE_QERROR: /* XXX: should QError be emitted? */ - case QTYPE_NONE: break; - case QTYPE_MAX: + default: abort(); } } -- cgit v1.2.1