diff options
author | Eric Blake <eblake@redhat.com> | 2015-05-14 06:50:48 -0600 |
---|---|---|
committer | Markus Armbruster <armbru@redhat.com> | 2015-05-14 18:20:42 +0200 |
commit | 18df515ebbefa9f13474b128b8050d5fa346ea1e (patch) | |
tree | 98ab9f86e6ffadc62bf753da6090078f64184c4f /scripts/qapi-visit.py | |
parent | 47299262de424af0cb69965d082e5e70b2314183 (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-visit.py')
-rw-r--r-- | scripts/qapi-visit.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/scripts/qapi-visit.py b/scripts/qapi-visit.py index 0e67b336fc..ba623b10b8 100644 --- a/scripts/qapi-visit.py +++ b/scripts/qapi-visit.py @@ -66,7 +66,7 @@ if (err) { goto out; } ''', - type=type_name(base), c_name=c_var('base')) + type=type_name(base), c_name=c_name('base')) for argname, argentry, optional in parse_args(members): if optional: @@ -74,13 +74,13 @@ if (err) { visit_optional(m, &(*obj)->has_%(c_name)s, "%(name)s", &err); if (!err && (*obj)->has_%(c_name)s) { ''', - c_name=c_var(argname), name=argname) + c_name=c_name(argname), name=argname) push_indent() ret += mcgen(''' visit_type_%(type)s(m, &(*obj)->%(c_name)s, "%(name)s", &err); ''', - type=type_name(argentry), c_name=c_var(argname), + type=type_name(argentry), c_name=c_name(argname), name=argname) if optional: @@ -222,7 +222,7 @@ void visit_type_%(name)s(Visitor *m, %(name)s **obj, const char *name, Error **e ''', enum_full_value = enum_full_value, c_type = type_name(members[key]), - c_name = c_fun(key)) + c_name = c_name(key)) ret += mcgen(''' default: @@ -323,7 +323,7 @@ void visit_type_%(name)s(Visitor *m, %(name)s **obj, const char *name, Error **e ''', enum_full_value = enum_full_value, c_type=type_name(members[key]), - c_name=c_fun(key)) + c_name=c_name(key)) ret += mcgen(''' default: |