Received: from eggs.gnu.org ([2001:4830:134:3::10]:55559) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bNXfc-0002Aq-UG for qemu-devel@nongnu.org; Wed, 13 Jul 2016 23:50:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bNXfb-0007cO-6R for qemu-devel@nongnu.org; Wed, 13 Jul 2016 23:50:39 -0400 Received: from mx1.redhat.com ([209.132.183.28]:54066) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bNXfb-0007cK-0Z for qemu-devel@nongnu.org; Wed, 13 Jul 2016 23:50:39 -0400 From: Eric Blake Date: Wed, 13 Jul 2016 21:50:14 -0600 Message-Id: <1468468228-27827-4-git-send-email-eblake@redhat.com> In-Reply-To: <1468468228-27827-1-git-send-email-eblake@redhat.com> References: <1468468228-27827-1-git-send-email-eblake@redhat.com> Subject: [Qemu-devel] [PATCH v9 03/17] qapi: Special case c_name() for empty type List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: armbru@redhat.com, berrange@redhat.com, Michael Roth 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 --- v9: new patch --- scripts/qapi.py | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/qapi.py b/scripts/qapi.py index 0635bbb..68ee319 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): -- 2.5.5