diff options
author | Aleksander Morgado <aleksander@aleksander.es> | 2015-08-02 09:28:18 +0200 |
---|---|---|
committer | Aleksander Morgado <aleksander@aleksander.es> | 2015-08-02 09:28:18 +0200 |
commit | a3cfd87ac31b2901f0aad4c8522aadf901828d4b (patch) | |
tree | 5e51f53b64c4943d206cccf37d047765e4ee2cfd /build-aux | |
parent | 4fbbfa903f760ca9366b152db8aac227710586be (diff) |
qmi-codegen: avoid variable names like 'new'
For C++ compatibility, we should not generate variables with the names of
protected C++ keywords, like 'new'. Currently this was happening in the "DMS Set
Service Programming Code" method, where we had a TLV named "New". Instead of
renaming the TLV, which would change the name of the getter method as well, we
will force prepending the "value_" string to the variable names of the getter
and setter methods.
https://bugs.freedesktop.org/show_bug.cgi?id=91479
Diffstat (limited to 'build-aux')
-rw-r--r-- | build-aux/qmi-codegen/Field.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/build-aux/qmi-codegen/Field.py b/build-aux/qmi-codegen/Field.py index c64bf29..1c4ac90 100644 --- a/build-aux/qmi-codegen/Field.py +++ b/build-aux/qmi-codegen/Field.py @@ -96,7 +96,7 @@ class Field: container """ def emit_getter(self, hfile, cfile): - input_variable_name = utils.build_underscore_name(self.name) + input_variable_name = 'value_' + utils.build_underscore_name(self.name) variable_getter_dec = self.variable.build_getter_declaration(' ', input_variable_name) variable_getter_doc = self.variable.build_getter_documentation(' * ', input_variable_name) variable_getter_imp = self.variable.build_getter_implementation(' ', 'self->' + self.variable_name, input_variable_name, True) @@ -160,7 +160,7 @@ class Field: container """ def emit_setter(self, hfile, cfile): - input_variable_name = utils.build_underscore_name(self.name) + input_variable_name = 'value_' + utils.build_underscore_name(self.name) variable_setter_dec = self.variable.build_setter_declaration(' ', input_variable_name) variable_setter_doc = self.variable.build_setter_documentation(' * ', input_variable_name) variable_setter_imp = self.variable.build_setter_implementation(' ', input_variable_name, 'self->' + self.variable_name) |