[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 22/33] qapi-commands: Fix gen_err_check(e) for e and
From: |
Markus Armbruster |
Subject: |
[Qemu-devel] [PULL 22/33] qapi-commands: Fix gen_err_check(e) for e and e != 'local_err' |
Date: |
Fri, 4 Sep 2015 16:21:29 +0200 |
gen_err_check() hard-codes 'local_err' instead of substituting the
argument. Currently harmless, since all callers pass either None or
'local_err'.
Signed-off-by: Markus Armbruster <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
---
scripts/qapi-commands.py | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/scripts/qapi-commands.py b/scripts/qapi-commands.py
index 69029f5..3965ca8 100644
--- a/scripts/qapi-commands.py
+++ b/scripts/qapi-commands.py
@@ -29,14 +29,15 @@ def generate_command_decl(name, args, ret_type):
ret_type=c_type(ret_type), name=c_name(name),
args=arglist).strip()
-def gen_err_check(errvar):
- if errvar:
- return mcgen('''
-if (local_err) {
+def gen_err_check(err):
+ if not err:
+ return ''
+ return mcgen('''
+if (%(err)s) {
goto out;
}
-''')
- return ''
+''',
+ err=err)
def gen_sync_call(name, args, ret_type):
ret = ""
--
2.4.3
- [Qemu-devel] [PULL 14/33] qapi: Document that input visitor semantics are prone to leaks, (continued)
- [Qemu-devel] [PULL 14/33] qapi: Document that input visitor semantics are prone to leaks, Markus Armbruster, 2015/09/04
- [Qemu-devel] [PULL 13/33] tests/qapi-schema: Document events with base don't work, Markus Armbruster, 2015/09/04
- [Qemu-devel] [PULL 15/33] qapi: Document shortcoming with union 'data' branch, Markus Armbruster, 2015/09/04
- [Qemu-devel] [PULL 06/33] qapi: Drop unused and useless parameters and variables, Markus Armbruster, 2015/09/04
- [Qemu-devel] [PULL 23/33] qapi-commands: Inline gen_marshal_output_call(), Markus Armbruster, 2015/09/04
- [Qemu-devel] [PULL 27/33] qapi: Drop one of two "simple union must not have base" checks, Markus Armbruster, 2015/09/04
- [Qemu-devel] [PULL 25/33] qapi-commands: Drop useless initialization, Markus Armbruster, 2015/09/04
- [Qemu-devel] [PULL 02/33] qapi: Clean up cgen() and mcgen(), Markus Armbruster, 2015/09/04
- [Qemu-devel] [PULL 22/33] qapi-commands: Fix gen_err_check(e) for e and e != 'local_err',
Markus Armbruster <=
- [Qemu-devel] [PULL 08/33] qapi: Generate a nicer struct for flat unions, Markus Armbruster, 2015/09/04
- [Qemu-devel] [PULL 12/33] tests/qapi-schema: Document alternate's enum lacks visit function, Markus Armbruster, 2015/09/04
- [Qemu-devel] [PULL 16/33] qapi: Document flaws in checking of names, Markus Armbruster, 2015/09/04
- [Qemu-devel] [PULL 30/33] qapi: Fix errors for non-string, non-dictionary members, Markus Armbruster, 2015/09/04
- [Qemu-devel] [PULL 29/33] tests/qapi-schema: Cover non-string, non-dictionary members, Markus Armbruster, 2015/09/04
- [Qemu-devel] [PULL 24/33] qapi-commands: Don't feed output of mcgen() to mcgen() again, Markus Armbruster, 2015/09/04
- [Qemu-devel] [PULL 28/33] tests/qapi-schema: Cover two more syntax errors, Markus Armbruster, 2015/09/04
- [Qemu-devel] [PULL 19/33] qapi-tests: New tests for union, alternate command arguments, Markus Armbruster, 2015/09/04
- [Qemu-devel] [PULL 09/33] qapi-visit: Fix generated code when schema has forward refs, Markus Armbruster, 2015/09/04
- [Qemu-devel] [PULL 21/33] qapi: Command returning anonymous type doesn't work, outlaw, Markus Armbruster, 2015/09/04