From 6e70817f41d123accc9185d6b5e35fc58b380287 Mon Sep 17 00:00:00 2001 From: Aleksander Morgado Date: Thu, 24 Feb 2022 11:23:37 +0100 Subject: 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. --- build-aux/qmi-codegen/VariableArray.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'build-aux') 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) -- cgit v1.2.1