diff options
author | Alexander Larsson <alexl@redhat.com> | 2010-07-07 20:40:06 +0200 |
---|---|---|
committer | Alexander Larsson <alexl@redhat.com> | 2010-07-07 23:12:42 +0200 |
commit | 26c1a0767f3fdcd0211b6b4c91a63ac9bc7abc6f (patch) | |
tree | 65483a711da7036621b81e1127fb7650709a1c9e /python_modules/ptypes.py | |
parent | bda492f4aa28c8921e7277c8c0dcfdc59b19c88f (diff) | |
download | spice-26c1a0767f3fdcd0211b6b4c91a63ac9bc7abc6f.tar.gz spice-26c1a0767f3fdcd0211b6b4c91a63ac9bc7abc6f.tar.xz spice-26c1a0767f3fdcd0211b6b4c91a63ac9bc7abc6f.zip |
codegen: support @chunk on non-pointer arrays
This is similar to @as_ptr, but generates a single chunk of data.
Diffstat (limited to 'python_modules/ptypes.py')
-rw-r--r-- | python_modules/ptypes.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/python_modules/ptypes.py b/python_modules/ptypes.py index f02437ab..68cf3dfe 100644 --- a/python_modules/ptypes.py +++ b/python_modules/ptypes.py @@ -60,7 +60,7 @@ class FixedSize: # only to attributes that affect pointer or array attributes, as these # are member local types, unlike e.g. a Struct that may be used by # other members -propagated_attributes=["ptr_array", "c_ptr", "nonnull"] +propagated_attributes=["ptr_array", "c_ptr", "nonnull", "chunk"] class Type: def __init__(self): @@ -428,7 +428,7 @@ class ArrayType(Type): return self.has_attr("ptr_array") def contains_extra_size(self): - return self.element_type.contains_extra_size() + return self.element_type.contains_extra_size() or self.has_attr("chunk") def sizeof(self): return "%s * %s" % (self.element_type.sizeof(), self.size) |