mirror of
https://github.com/yuzu-emu/unicorn.git
synced 2025-01-26 22:20:59 +00:00
qapi: Drop useless gen_err_check()
Ever since commit 12f254f removed the last parameterization of gen_err_check(), it no longer makes sense to hide the three lines of generated C code behind a macro call. Just inline it into the remaining users. No change to generated code. Backports commit fa274ed6fb788866ed3a2cfd54a2ddf78f04f2c0 from qemu
This commit is contained in:
parent
d7014c66df
commit
b5220a6867
|
@ -46,9 +46,11 @@ void visit_type_%(c_name)s_members(Visitor *v, %(c_name)s *obj, Error **errp)
|
||||||
if base:
|
if base:
|
||||||
ret += mcgen('''
|
ret += mcgen('''
|
||||||
visit_type_%(c_type)s_members(v, (%(c_type)s *)obj, &err);
|
visit_type_%(c_type)s_members(v, (%(c_type)s *)obj, &err);
|
||||||
|
if (err) {
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
''',
|
''',
|
||||||
c_type=base.c_name())
|
c_type=base.c_name())
|
||||||
ret += gen_err_check()
|
|
||||||
|
|
||||||
for memb in members:
|
for memb in members:
|
||||||
if memb.optional:
|
if memb.optional:
|
||||||
|
@ -59,10 +61,12 @@ void visit_type_%(c_name)s_members(Visitor *v, %(c_name)s *obj, Error **errp)
|
||||||
push_indent()
|
push_indent()
|
||||||
ret += mcgen('''
|
ret += mcgen('''
|
||||||
visit_type_%(c_type)s(v, "%(name)s", &obj->%(c_name)s, &err);
|
visit_type_%(c_type)s(v, "%(name)s", &obj->%(c_name)s, &err);
|
||||||
|
if (err) {
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
''',
|
''',
|
||||||
c_type=memb.type.c_name(), name=memb.name,
|
c_type=memb.type.c_name(), name=memb.name,
|
||||||
c_name=c_name(memb.name))
|
c_name=c_name(memb.name))
|
||||||
ret += gen_err_check()
|
|
||||||
if memb.optional:
|
if memb.optional:
|
||||||
pop_indent()
|
pop_indent()
|
||||||
ret += mcgen('''
|
ret += mcgen('''
|
||||||
|
|
|
@ -1669,14 +1669,6 @@ def gen_params(arg_type, extra):
|
||||||
return ret
|
return ret
|
||||||
|
|
||||||
|
|
||||||
def gen_err_check(label='out', skiperr=False):
|
|
||||||
return mcgen('''
|
|
||||||
if (err) {
|
|
||||||
goto out;
|
|
||||||
}
|
|
||||||
''')
|
|
||||||
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# Common command line parsing
|
# Common command line parsing
|
||||||
#
|
#
|
||||||
|
|
Loading…
Reference in a new issue