aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorEric Blake <eblake@redhat.com>2016-07-13 21:50:17 -0600
committerMarkus Armbruster <armbru@redhat.com>2016-07-19 13:21:08 +0200
commitfa274ed6fb788866ed3a2cfd54a2ddf78f04f2c0 (patch)
treea68c8e3cf3482573f6deb33e5653f00374cc8117 /scripts
parentb6167706829c6e0d3572daa2b6769594ced276f7 (diff)
downloadqemu-fa274ed6fb788866ed3a2cfd54a2ddf78f04f2c0.zip
qemu-fa274ed6fb788866ed3a2cfd54a2ddf78f04f2c0.tar.gz
qemu-fa274ed6fb788866ed3a2cfd54a2ddf78f04f2c0.tar.bz2
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. Signed-off-by: Eric Blake <eblake@redhat.com> Message-Id: <1468468228-27827-7-git-send-email-eblake@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/qapi-commands.py4
-rw-r--r--scripts/qapi-visit.py8
-rw-r--r--scripts/qapi.py8
3 files changed, 9 insertions, 11 deletions
diff --git a/scripts/qapi-commands.py b/scripts/qapi-commands.py
index c93470c..333a46f 100644
--- a/scripts/qapi-commands.py
+++ b/scripts/qapi-commands.py
@@ -46,8 +46,10 @@ def gen_call(name, arg_type, ret_type):
''',
c_name=c_name(name), args=argstr, lhs=lhs)
if ret_type:
- ret += gen_err_check()
ret += mcgen('''
+ if (err) {
+ goto out;
+ }
qmp_marshal_output_%(c_name)s(retval, ret, &err);
''',
diff --git a/scripts/qapi-visit.py b/scripts/qapi-visit.py
index 0b9e298..96f2491 100644
--- a/scripts/qapi-visit.py
+++ b/scripts/qapi-visit.py
@@ -47,9 +47,11 @@ void visit_type_%(c_name)s_members(Visitor *v, %(c_name)s *obj, Error **errp)
if base:
ret += mcgen('''
visit_type_%(c_type)s_members(v, (%(c_type)s *)obj, &err);
+ if (err) {
+ goto out;
+ }
''',
c_type=base.c_name())
- ret += gen_err_check()
for memb in members:
if memb.optional:
@@ -60,10 +62,12 @@ void visit_type_%(c_name)s_members(Visitor *v, %(c_name)s *obj, Error **errp)
push_indent()
ret += mcgen('''
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_name=c_name(memb.name))
- ret += gen_err_check()
if memb.optional:
pop_indent()
ret += mcgen('''
diff --git a/scripts/qapi.py b/scripts/qapi.py
index 27284be..9c48f6d 100644
--- a/scripts/qapi.py
+++ b/scripts/qapi.py
@@ -1656,14 +1656,6 @@ def gen_params(arg_type, extra):
return ret
-def gen_err_check():
- return mcgen('''
- if (err) {
- goto out;
- }
-''')
-
-
#
# Common command line parsing
#