aboutsummaryrefslogtreecommitdiff
path: root/scripts/qapi-event.py
diff options
context:
space:
mode:
authorEric Blake <eblake@redhat.com>2015-05-14 06:50:48 -0600
committerMarkus Armbruster <armbru@redhat.com>2015-05-14 18:20:42 +0200
commit18df515ebbefa9f13474b128b8050d5fa346ea1e (patch)
tree98ab9f86e6ffadc62bf753da6090078f64184c4f /scripts/qapi-event.py
parent47299262de424af0cb69965d082e5e70b2314183 (diff)
qapi: Rename identical c_fun()/c_var() into c_name()
Now that the two functions are identical, we only need one of them, and we might as well give it a more descriptive name. Basically, the function serves as the translation from a QAPI name into a (portion of a) C identifier, without regards to whether it is a variable or function name. Signed-off-by: Eric Blake <eblake@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
Diffstat (limited to 'scripts/qapi-event.py')
-rw-r--r--scripts/qapi-event.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/scripts/qapi-event.py b/scripts/qapi-event.py
index 47dc041805..c4612e396e 100644
--- a/scripts/qapi-event.py
+++ b/scripts/qapi-event.py
@@ -17,17 +17,17 @@ import getopt
import errno
def _generate_event_api_name(event_name, params):
- api_name = "void qapi_event_send_%s(" % c_fun(event_name).lower();
+ api_name = "void qapi_event_send_%s(" % c_name(event_name).lower();
l = len(api_name)
if params:
for argname, argentry, optional in parse_args(params):
if optional:
- api_name += "bool has_%s,\n" % c_var(argname)
+ api_name += "bool has_%s,\n" % c_name(argname)
api_name += "".ljust(l)
api_name += "%s %s,\n" % (c_type(argentry, is_param=True),
- c_var(argname))
+ c_name(argname))
api_name += "".ljust(l)
api_name += "Error **errp)"
@@ -98,7 +98,7 @@ def generate_event_implement(api_name, event_name, params):
ret += mcgen("""
if (has_%(var)s) {
""",
- var = c_var(argname))
+ var = c_name(argname))
push_indent()
if argentry == "str":
@@ -113,7 +113,7 @@ def generate_event_implement(api_name, event_name, params):
}
""",
var_type = var_type,
- var = c_var(argname),
+ var = c_name(argname),
type = type_name(argentry),
name = argname)