aboutsummaryrefslogtreecommitdiff
path: root/scripts/qapi-commands.py
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/qapi-commands.py')
-rw-r--r--scripts/qapi-commands.py16
1 files changed, 5 insertions, 11 deletions
diff --git a/scripts/qapi-commands.py b/scripts/qapi-commands.py
index a68517a83a..cbff3560f4 100644
--- a/scripts/qapi-commands.py
+++ b/scripts/qapi-commands.py
@@ -91,18 +91,12 @@ def gen_visitor_input_vars_decl(args):
bool has_%(argname)s = false;
''',
argname=c_name(memb.name))
- if is_c_ptr(memb.type.c_type()):
- ret += mcgen('''
-%(argtype)s %(argname)s = NULL;
-''',
- argname=c_name(memb.name),
- argtype=memb.type.c_type())
- else:
- ret += mcgen('''
-%(argtype)s %(argname)s = {0};
+ ret += mcgen('''
+%(c_type)s %(c_name)s = %(c_null)s;
''',
- argname=c_name(memb.name),
- argtype=memb.type.c_type())
+ c_name=c_name(memb.name),
+ c_type=memb.type.c_type(),
+ c_null=memb.type.c_null())
pop_indent()
return ret