summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrediano Ziglio <fziglio@redhat.com>2018-09-28 14:22:16 +0100
committerFrediano Ziglio <fziglio@redhat.com>2018-10-15 10:58:38 +0100
commit8a68e67afa48370adfae846b71dc4b86f70c7c0b (patch)
treee6f65c76acdd0c3d186ebe1c71d4aa96f9cec050
parent979717350d1f6b0d849673ca42505d18261d4bca (diff)
codegen: Remove fixedsize attribute
This attribute was used only in SPICE version 1. The intention was use fixed size for switch type in the protocol. However this does not bring any improvement, just increase network bytes used. 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.txt6
-rw-r--r--python_modules/demarshal.py7
-rw-r--r--python_modules/marshal.py8
-rw-r--r--python_modules/ptypes.py6
4 files changed, 0 insertions, 27 deletions
diff --git a/docs/spice_protocol.txt b/docs/spice_protocol.txt
index 18b636f..421393d 100644
--- a/docs/spice_protocol.txt
+++ b/docs/spice_protocol.txt
@@ -454,9 +454,3 @@ virtual
~~~~~~~
TODO
-
-fixedsize
-~~~~~~~~~
-
-TODO
-
diff --git a/python_modules/demarshal.py b/python_modules/demarshal.py
index 541137e..5209272 100644
--- a/python_modules/demarshal.py
+++ b/python_modules/demarshal.py
@@ -729,10 +729,6 @@ def write_switch_parser(writer, container, switch, dest, scope):
var = container.lookup_member(switch.variable)
var_type = var.member_type
- if switch.has_attr("fixedsize"):
- scope.variable_def("uint8_t *", "in_save")
- writer.assign("in_save", "in")
-
first = True
for c in switch.cases:
check = c.get_check(dest.get_ref(switch.variable), var_type)
@@ -775,9 +771,6 @@ def write_switch_parser(writer, container, switch, dest, scope):
writer.newline()
- if switch.has_attr("fixedsize"):
- writer.assign("in", "in_save + %s" % switch.get_fixed_nw_size())
-
def write_parse_ptr_function(writer, target_type):
if target_type.is_array():
parse_function = "parse_array_%s" % target_type.element_type.primitive_type()
diff --git a/python_modules/marshal.py b/python_modules/marshal.py
index 940c925..4e98993 100644
--- a/python_modules/marshal.py
+++ b/python_modules/marshal.py
@@ -289,15 +289,7 @@ def write_switch_marshaller(writer, container, switch, src, scope):
else:
writer.todo("Can't handle type %s" % m.member_type)
- if switch.has_attr("fixedsize"):
- remaining = switch.get_fixed_nw_size() - t.get_fixed_nw_size()
- if remaining != 0:
- writer.statement("spice_marshaller_reserve_space(m, %s)" % remaining)
-
first = False
- if switch.has_attr("fixedsize"):
- with writer.block(" else"):
- writer.statement("spice_marshaller_reserve_space(m, %s)" % switch.get_fixed_nw_size())
writer.newline()
diff --git a/python_modules/ptypes.py b/python_modules/ptypes.py
index 4b74225..f39f044 100644
--- a/python_modules/ptypes.py
+++ b/python_modules/ptypes.py
@@ -111,9 +111,6 @@ valid_attributes=set([
'minor',
# this attribute does not exist on the network, fill just structure with the value
'virtual',
- # for a switch this indicates that on network
- # it will occupy always the same size (maximum size required for all members)
- 'fixedsize',
])
attributes_with_arguments=set([
@@ -737,9 +734,6 @@ class Switch(Containee):
return True
def is_fixed_nw_size(self):
- if self.has_attr("fixedsize"):
- return True
-
size = None
has_default = False
for c in self.cases: