diff options
author | Aleksander Morgado <aleksander@aleksander.es> | 2014-12-12 09:21:15 +0100 |
---|---|---|
committer | Aleksander Morgado <aleksander@aleksander.es> | 2014-12-12 09:21:15 +0100 |
commit | b9c3701e3371984736240d2dded70c2d52f3b46e (patch) | |
tree | d70ad25a58d5a923225febd6e0786ee55119a07f /build-aux/qmi-codegen/VariableSequence.py | |
parent | 3853840a31906b50051f20146e669d85f3e46903 (diff) |
qmi-codegen: fix public struct type generation
This change triggers an API break.
When building structs to be included in the public header, we were just relying
on using the 'public_format' of each variable. This is an error, as the variable
may be more complex than just public/private. E.g. could be another struct, or
an array, or a fixed sized string, as in the example.
In particular, this bug currently affects one public type, where one of its
elements changes from being just a pointer to a string to a fixed sized array of
4 bytes.
The following type is changed from:
typedef struct _QmiMessageNasGetCellLocationInfoOutputGeranInfoCellElement {
guint32 cell_id;
gchar * plmn;
guint16 lac;
guint16 geran_absolute_rf_channel_number;
guint8 base_station_identity_code;
guint16 rx_level;
} QmiMessageNasGetCellLocationInfoOutputGeranInfoCellElement;
To:
typedef struct _QmiMessageNasGetCellLocationInfoOutputGeranInfoCellElement {
guint32 cell_id;
gchar plmn[4];
guint16 lac;
guint16 geran_absolute_rf_channel_number;
guint8 base_station_identity_code;
guint16 rx_level;
} QmiMessageNasGetCellLocationInfoOutputGeranInfoCellElement;
Thanks to Joseba Sanjuan <joseba.sanjuan@gmail.com> for finding the bug.
Diffstat (limited to 'build-aux/qmi-codegen/VariableSequence.py')
-rw-r--r-- | build-aux/qmi-codegen/VariableSequence.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/build-aux/qmi-codegen/VariableSequence.py b/build-aux/qmi-codegen/VariableSequence.py index c69a0e6..e0d2e00 100644 --- a/build-aux/qmi-codegen/VariableSequence.py +++ b/build-aux/qmi-codegen/VariableSequence.py @@ -120,10 +120,10 @@ class VariableSequence(Variable): """ Variable declaration """ - def build_variable_declaration(self, line_prefix, variable_name): + def build_variable_declaration(self, public, line_prefix, variable_name): built = '' for member in self.members: - built += member['object'].build_variable_declaration(line_prefix, variable_name + '_' + member['name']) + built += member['object'].build_variable_declaration(public, line_prefix, variable_name + '_' + member['name']) return built |