aboutsummaryrefslogtreecommitdiff
path: root/scripts/qapi-event.py
diff options
context:
space:
mode:
authorEric Blake <eblake@redhat.com>2015-09-29 16:21:08 -0600
committerMarkus Armbruster <armbru@redhat.com>2015-10-12 18:46:49 +0200
commit2a0f50e8d973b01eda4c63bac4a5c79ea0f584ef (patch)
tree0b06661adc5bcf9f9c57cea9e3eb28cb7a5532aa /scripts/qapi-event.py
parent376863ef4895ae709aadb6f26365a5973310ef09 (diff)
qapi: Consistent generated code: prefer error 'err'
We had some pointless differences in the generated code for visit, command marshalling, and events; unifying them makes it easier for future patches to consolidate to common helper functions. This is one patch of a series to clean up these differences. This patch consistently names the local error variable 'err' rather than 'local_err'. No change in semantics to the generated code. Signed-off-by: Eric Blake <eblake@redhat.com> Message-Id: <1443565276-4535-11-git-send-email-eblake@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
Diffstat (limited to 'scripts/qapi-event.py')
-rw-r--r--scripts/qapi-event.py18
1 files changed, 9 insertions, 9 deletions
diff --git a/scripts/qapi-event.py b/scripts/qapi-event.py
index d15fad98f3..d41af40799 100644
--- a/scripts/qapi-event.py
+++ b/scripts/qapi-event.py
@@ -34,7 +34,7 @@ def gen_event_send(name, arg_type):
%(proto)s
{
QDict *qmp;
- Error *local_err = NULL;
+ Error *err = NULL;
QMPEventFuncEmit emit;
''',
proto=gen_event_send_proto(name, arg_type))
@@ -67,8 +67,8 @@ def gen_event_send(name, arg_type):
g_assert(v);
/* Fake visit, as if all members are under a structure */
- visit_start_struct(v, NULL, "", "%(name)s", 0, &local_err);
- if (local_err) {
+ visit_start_struct(v, NULL, "", "%(name)s", 0, &err);
+ if (err) {
goto clean;
}
@@ -90,8 +90,8 @@ def gen_event_send(name, arg_type):
cast = ''
ret += mcgen('''
- visit_type_%(c_type)s(v, %(cast)s&%(c_name)s, "%(name)s", &local_err);
- if (local_err) {
+ visit_type_%(c_type)s(v, %(cast)s&%(c_name)s, "%(name)s", &err);
+ if (err) {
goto clean;
}
''',
@@ -108,8 +108,8 @@ def gen_event_send(name, arg_type):
ret += mcgen('''
- visit_end_struct(v, &local_err);
- if (local_err) {
+ visit_end_struct(v, &err);
+ if (err) {
goto clean;
}
@@ -120,7 +120,7 @@ def gen_event_send(name, arg_type):
''')
ret += mcgen('''
- emit(%(c_enum)s, qmp, &local_err);
+ emit(%(c_enum)s, qmp, &err);
''',
c_enum=c_enum_const(event_enum_name, name))
@@ -131,7 +131,7 @@ def gen_event_send(name, arg_type):
qmp_output_visitor_cleanup(qov);
''')
ret += mcgen('''
- error_propagate(errp, local_err);
+ error_propagate(errp, err);
QDECREF(qmp);
}
''')