summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrediano Ziglio <fziglio@redhat.com>2018-09-28 14:05:45 +0100
committerFrediano Ziglio <fziglio@redhat.com>2018-10-15 10:58:38 +0100
commit979717350d1f6b0d849673ca42505d18261d4bca (patch)
tree48cd14538105fad902302db17106d6e1cf78c657
parentb9dca950fbc6bc9014ce7d43dd0b80517e8d05f5 (diff)
codegen: Remove bytes_count attribute
This attribute was used only in SPICE version 1. Its usage was confusing, and was replaced by the simple usage of array size. Generated code does not change. Signed-off-by: Frediano Ziglio <fziglio@redhat.com> Acked-by: Christophe Fergeau <cfergeau@redhat.com>
-rw-r--r--docs/spice_protocol.txt5
-rw-r--r--python_modules/demarshal.py5
-rw-r--r--python_modules/marshal.py4
-rw-r--r--python_modules/ptypes.py4
4 files changed, 1 insertions, 17 deletions
diff --git a/docs/spice_protocol.txt b/docs/spice_protocol.txt
index 53700db..18b636f 100644
--- a/docs/spice_protocol.txt
+++ b/docs/spice_protocol.txt
@@ -450,11 +450,6 @@ minor
TODO
-bytes_count
-~~~~~~~~~~~
-
-TODO
-
virtual
~~~~~~~
diff --git a/python_modules/demarshal.py b/python_modules/demarshal.py
index 5a237a6..541137e 100644
--- a/python_modules/demarshal.py
+++ b/python_modules/demarshal.py
@@ -940,10 +940,7 @@ def write_member_parser(writer, container, member, dest, scope):
writer.statement("*(%s *)end = consume_%s(&in)" % (t.c_type(), t.primitive_type()))
writer.increment("end", t.sizeof())
else:
- if member.has_attr("bytes_count"):
- dest_var = dest.get_ref(member.attributes["bytes_count"][0])
- else:
- dest_var = dest.get_ref(member.name)
+ dest_var = dest.get_ref(member.name)
writer.assign(dest_var, "consume_%s(&in)" % (t.primitive_type()))
#TODO validate e.g. flags and enums
elif t.is_array():
diff --git a/python_modules/marshal.py b/python_modules/marshal.py
index 94ff055..940c925 100644
--- a/python_modules/marshal.py
+++ b/python_modules/marshal.py
@@ -321,10 +321,6 @@ def write_member_marshaller(writer, container, member, src, scope):
elif t.is_primitive():
if member.has_attr("zero"):
writer.statement("spice_marshaller_add_%s(m, 0)" % (t.primitive_type()))
- elif member.has_attr("bytes_count"):
- var = "%s__ref" % member.name
- scope.variable_def("void *", var)
- writer.statement("%s = spice_marshaller_add_%s(m, %s)" % (var, t.primitive_type(), 0))
else:
writer.statement("spice_marshaller_add_%s(m, %s)" % (t.primitive_type(), src.get_ref(member.name)))
diff --git a/python_modules/ptypes.py b/python_modules/ptypes.py
index 91c185d..4b74225 100644
--- a/python_modules/ptypes.py
+++ b/python_modules/ptypes.py
@@ -109,9 +109,6 @@ valid_attributes=set([
'zero',
# specify minor version required for these members
'minor',
- # this member contains the byte count for an array.
- # the argument is the member name for item count (not bytes)
- 'bytes_count',
# this attribute does not exist on the network, fill just structure with the value
'virtual',
# for a switch this indicates that on network
@@ -126,7 +123,6 @@ attributes_with_arguments=set([
'outvar',
'ifdef',
'minor',
- 'bytes_count',
'virtual',
])