summaryrefslogtreecommitdiff
path: root/build-aux
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@aleksander.es>2022-02-24 11:23:37 +0100
committerAleksander Morgado <aleksander@aleksander.es>2022-02-26 23:10:21 +0100
commit6e70817f41d123accc9185d6b5e35fc58b380287 (patch)
tree0becfd8c6dbe53e1f8ddaedb278d1cab7eebc9e7 /build-aux
parent38012d9ba40cccbbfdcd1475312b05b2492067b0 (diff)
downloadlibqmi-6e70817f41d123accc9185d6b5e35fc58b380287.tar.gz
build-aux,codegen: disallow arrays of arrays, use an intermediate struct always
This is required since we're going to return C arrays in our API.
Diffstat (limited to 'build-aux')
-rw-r--r--build-aux/qmi-codegen/VariableArray.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/build-aux/qmi-codegen/VariableArray.py b/build-aux/qmi-codegen/VariableArray.py
index 701eee45..d2fd803c 100644
--- a/build-aux/qmi-codegen/VariableArray.py
+++ b/build-aux/qmi-codegen/VariableArray.py
@@ -50,6 +50,10 @@ class VariableArray(Variable):
# if the variable is from an Input container.
self.container_type = container_type
+ # Disallow arrays of arrays, always use an intermediate struct
+ if dictionary['array-element']['format'] == 'array':
+ raise ValueError('Arrays of arrays not allowed in %s array: use an intermediate struct instead' % self.name)
+
# Load variable type of this array
if 'name' in dictionary['array-element']:
self.array_element = VariableFactory.create_variable(self.service, dictionary['array-element'], array_element_type + ' ' + dictionary['array-element']['name'], self.container_type)