mirror of
https://gitlab.com/qemu-project/qemu
synced 2024-09-06 18:05:37 +00:00
qapi-types: Split generate_fwd_builtin() off generate_fwd_struct()
Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com>
This commit is contained in:
parent
ae0a7a1090
commit
c5ecd7e18f
|
@ -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 @@ def generate_fwd_struct(name, builtin_type=False):
|
|||
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 @@ def generate_type_cleanup(name):
|
|||
|
||||
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:
|
||||
|
|
Loading…
Reference in a new issue