summaryrefslogtreecommitdiff
path: root/cffi/vengine_cpy.py
diff options
context:
space:
mode:
authorArmin Rigo <arigo@tunes.org>2020-05-20 23:29:46 +0200
committerArmin Rigo <arigo@tunes.org>2020-05-20 23:29:46 +0200
commitbb48fdcc86c5bd2c211fba2ac4cffe8b6efb49e2 (patch)
treedd4e9101065c0a799cca5c03f31c3c310ef15d9a /cffi/vengine_cpy.py
parent680aa960da02dfa304c6b889489c05c38de89318 (diff)
downloadcffi-bb48fdcc86c5bd2c211fba2ac4cffe8b6efb49e2.tar.gz
#453
Special-case typedefs of arrays with '...' length, so that they can be used through recompiler.py as if they had a specified length in most cases.
Diffstat (limited to 'cffi/vengine_cpy.py')
-rw-r--r--cffi/vengine_cpy.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/cffi/vengine_cpy.py b/cffi/vengine_cpy.py
index cb344ce..6de0df0 100644
--- a/cffi/vengine_cpy.py
+++ b/cffi/vengine_cpy.py
@@ -762,7 +762,7 @@ class VCPythonEngine(object):
if isinstance(tp, model.ArrayType):
tp_ptr = model.PointerType(tp.item)
self._generate_cpy_const(False, name, tp, vartp=tp_ptr,
- size_too = (tp.length == '...'))
+ size_too = tp.length_is_unknown())
else:
tp_ptr = model.PointerType(tp)
self._generate_cpy_const(False, name, tp_ptr, category='var')
@@ -774,7 +774,7 @@ class VCPythonEngine(object):
value = getattr(library, name)
if isinstance(tp, model.ArrayType): # int a[5] is "constant" in the
# sense that "a=..." is forbidden
- if tp.length == '...':
+ if tp.length_is_unknown():
assert isinstance(value, tuple)
(value, size) = value
BItemType = self.ffi._get_cached_btype(tp.item)