From c5ecd7e18f912ab5e91f09b0333fb07567885d42 Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Fri, 12 Jun 2015 09:22:32 +0200 Subject: qapi-types: Split generate_fwd_builtin() off generate_fwd_struct() 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 c408542d46..12fb2eff04 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: -- cgit v1.2.3