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-types.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'scripts/qapi-types.py') diff --git a/scripts/qapi-types.py b/scripts/qapi-types.py index 2bf8145..e74cabe 100644 --- a/scripts/qapi-types.py +++ b/scripts/qapi-types.py @@ -68,11 +68,11 @@ def generate_struct_fields(members): ret += mcgen(''' bool has_%(c_name)s; ''', - c_name=c_var(argname)) + c_name=c_name(argname)) ret += mcgen(''' %(c_type)s %(c_name)s; ''', - c_type=c_type(argentry), c_name=c_var(argname)) + c_type=c_type(argentry), c_name=c_name(argname)) return ret @@ -184,7 +184,7 @@ const int %(name)s_qtypes[QTYPE_MAX] = { ''', qtype = qtype, abbrev = de_camel_case(name).upper(), - enum = c_fun(de_camel_case(key),False).upper()) + enum = c_name(de_camel_case(key),False).upper()) ret += mcgen(''' }; @@ -221,7 +221,7 @@ struct %(name)s %(c_type)s %(c_name)s; ''', c_type=c_type(typeinfo[key]), - c_name=c_fun(key)) + c_name=c_name(key)) ret += mcgen(''' }; -- cgit v1.1