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>
This commit is contained in:
Frediano Ziglio 2018-09-28 14:22:16 +01:00
parent 979717350d
commit 8a68e67afa
4 changed files with 0 additions and 27 deletions

View File

@ -454,9 +454,3 @@ virtual
~~~~~~~
TODO
fixedsize
~~~~~~~~~
TODO

View File

@ -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()

View File

@ -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()

View File

@ -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: