From: Eric Blake Date: Thu, 14 Jul 2016 03:50:14 +0000 (-0600) Subject: qapi: Special case c_name() for empty type X-Git-Tag: v2.7.0-rc0~13^2~10 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=cd50a2564560986e865ff64fa73b59d2564076f0;p=thirdparty%2Fqemu.git qapi: Special case c_name() for empty type Commit 7ce106a rendered QAPISchemaObjectType.c_name() redundant, since it now does nothing more than delegate to its superclass. However, rather than deleting it, we can restore part of the assertion that was removed in that commit, to prove that we never emit the empty type directly in generated code, but rather special-case it as a built-in that makes other aspects of code generation easier to reason about. Reported-by: Markus Armbruster Signed-off-by: Eric Blake Message-Id: <1468468228-27827-4-git-send-email-eblake@redhat.com> Reviewed-by: Markus Armbruster Signed-off-by: Markus Armbruster --- diff --git a/scripts/qapi.py b/scripts/qapi.py index 0635bbb0c3e..68ee31903ed 100644 --- a/scripts/qapi.py +++ b/scripts/qapi.py @@ -1000,6 +1000,7 @@ class QAPISchemaObjectType(QAPISchemaType): return self.name.startswith('q_') def c_name(self): + assert self.name != 'q_empty' return QAPISchemaType.c_name(self) def c_type(self):