From patchwork Tue Jun 16 14:40:57 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Markus Armbruster X-Patchwork-Id: 485046 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id A1C3C14027C for ; Wed, 17 Jun 2015 00:52:16 +1000 (AEST) Received: from localhost ([::1]:40743 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z4sDm-0004La-Td for incoming@patchwork.ozlabs.org; Tue, 16 Jun 2015 10:52:14 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46056) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z4sDK-0003T9-Qd for qemu-devel@nongnu.org; Tue, 16 Jun 2015 10:51:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z4sDJ-00032U-Ts for qemu-devel@nongnu.org; Tue, 16 Jun 2015 10:51:46 -0400 Received: from mx1.redhat.com ([209.132.183.28]:50071) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z4s2z-0005cQ-4D for qemu-devel@nongnu.org; Tue, 16 Jun 2015 10:41:05 -0400 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (Postfix) with ESMTPS id B9E793702EA; Tue, 16 Jun 2015 14:41:04 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-116-35.ams2.redhat.com [10.36.116.35]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t5GEf27Q032560 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 16 Jun 2015 10:41:04 -0400 Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id C185B30438F8; Tue, 16 Jun 2015 16:40:59 +0200 (CEST) From: Markus Armbruster To: qemu-devel@nongnu.org Date: Tue, 16 Jun 2015 16:40:57 +0200 Message-Id: <1434465658-20782-15-git-send-email-armbru@redhat.com> In-Reply-To: <1434465658-20782-1-git-send-email-armbru@redhat.com> References: <1434465658-20782-1-git-send-email-armbru@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: mdroth@linux.vnet.ibm.com Subject: [Qemu-devel] [PATCH v2 14/15] qapi-types: Split generate_fwd_builtin() off generate_fwd_struct() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Signed-off-by: Markus Armbruster Reviewed-by: Eric Blake --- scripts/qapi-types.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/scripts/qapi-types.py b/scripts/qapi-types.py index c408542..12fb2ef 100644 --- a/scripts/qapi-types.py +++ b/scripts/qapi-types.py @@ -12,9 +12,8 @@ from ordereddict import OrderedDict from qapi import * -def generate_fwd_struct(name, builtin_type=False): - if builtin_type: - return mcgen(''' +def generate_fwd_builtin(name): + return mcgen(''' typedef struct %(name)sList { @@ -25,9 +24,10 @@ typedef struct %(name)sList struct %(name)sList *next; } %(name)sList; ''', - type=c_type(name), - name=name) + type=c_type(name), + name=name) +def generate_fwd_struct(name): return mcgen(''' typedef struct %(name)s %(name)s; @@ -332,7 +332,7 @@ exprs = parse_schema(input_file) fdecl.write(guardstart("QAPI_TYPES_BUILTIN_STRUCT_DECL")) for typename in builtin_types.keys(): - fdecl.write(generate_fwd_struct(typename, builtin_type=True)) + fdecl.write(generate_fwd_builtin(typename)) fdecl.write(guardend("QAPI_TYPES_BUILTIN_STRUCT_DECL")) for expr in exprs: