From 18df515ebbefa9f13474b128b8050d5fa346ea1e Mon Sep 17 00:00:00 2001 From: Eric Blake Date: Thu, 14 May 2015 06:50:48 -0600 Subject: 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 Signed-off-by: Markus Armbruster --- scripts/qapi-event.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'scripts/qapi-event.py') diff --git a/scripts/qapi-event.py b/scripts/qapi-event.py index 47dc041..c4612e3 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) -- cgit v1.1