diff options
| author | Alexander Larsson <alexl@redhat.com> | 2010-07-05 12:13:45 +0200 |
|---|---|---|
| committer | Marc-André Lureau <marcandre.lureau@gmail.com> | 2012-03-20 15:25:47 +0100 |
| commit | ad7e75325d0d2bd92e5f6e862f8b435b4dab09f9 (patch) | |
| tree | 1cb96b41fae2ccacc8c5804ed2a7d4164f73f874 /python_modules/demarshal.py | |
| parent | 71bf95171d488fa13dfc88a102612dd9f2e8cd85 (diff) | |
| download | spice-common-ad7e75325d0d2bd92e5f6e862f8b435b4dab09f9.tar.gz spice-common-ad7e75325d0d2bd92e5f6e862f8b435b4dab09f9.tar.xz spice-common-ad7e75325d0d2bd92e5f6e862f8b435b4dab09f9.zip | |
marshaller: Make @nonnull a propagated attribute
This cleans up some stuff
Diffstat (limited to 'python_modules/demarshal.py')
| -rw-r--r-- | python_modules/demarshal.py | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/python_modules/demarshal.py b/python_modules/demarshal.py index 5a8f8ff..5709567 100644 --- a/python_modules/demarshal.py +++ b/python_modules/demarshal.py @@ -82,7 +82,6 @@ class ItemInfo: self.prefix = prefix self.subprefix = prefix self.position = position - self.non_null = False self.member = None def nw_size(self): @@ -103,7 +102,6 @@ class MemberItemInfo(ItemInfo): self.type = member.member_type self.prefix = member.name self.subprefix = member.name - self.non_null = member.has_attr("nonnull") self.position = "(%s + %s)" % (start, container.get_nw_offset(member, "", "__nw_size")) self.member = member @@ -123,7 +121,6 @@ def write_validate_switch_member(writer, container, switch_member, scope, parent with writer.if_block(check, not first, False) as if_scope: item.type = c.member.member_type item.subprefix = item.prefix + "_" + m.name - item.non_null = c.member.has_attr("nonnull") sub_want_extra_size = want_extra_size if sub_want_extra_size and not m.contains_extra_size() and not m.is_extra_size(): writer.assign(item.extra_size(), 0) @@ -192,7 +189,7 @@ def write_validate_pointer_item(writer, container, item, scope, parent_scope, st target_type = item.type.target_type v = write_read_primitive_item(writer, item, scope) - if item.non_null: + if item.type.has_attr("nonnull"): writer.error_check("%s == 0" % v) # pointer target is struct, or array of primitives |
