WireCmd: factor code to [de]serialize structs and methods

Methods, when their arguments are stored in a structure, are very
similar to structures (duh?) Take advantage of this to factor the
[de]serialization code between them and not just memcpy structures
around. This will allow structures to contain objects, and pointers to
other structures / array of objects etc.
This commit is contained in:
Corentin Wallez
2018-06-08 18:30:50 +02:00
committed by Corentin Wallez
parent 82565b340f
commit 40e72d79ca
2 changed files with 296 additions and 205 deletions

View File

@@ -128,7 +128,8 @@ def link_object(obj, types):
if arg.annotation != 'value':
if not 'length' in a:
if arg.type.category == 'structure':
arg.length = "constant_one"
arg.length = "constant"
arg.constant_length = 1
else:
assert(false)
elif a['length'] == 'strlen':