pod-builder: make more generic builder

Make a vararg based builder that produces much smaller code.
Catch demarshal errors.
Simplify array handling
This commit is contained in:
Wim Taymans 2017-03-07 17:23:35 +01:00
parent f92b68c3c3
commit 78a3cd61b8
9 changed files with 862 additions and 637 deletions

View file

@ -402,9 +402,10 @@ on_context_data (SpaSource *source,
pinos_log_debug ("context %p: object demarshal %u, %u", this, id, opcode);
demarshal = proxy->demarshal;
if (demarshal[opcode])
demarshal[opcode] (proxy, message, size);
else
if (demarshal[opcode]) {
if (!demarshal[opcode] (proxy, message, size))
pinos_log_error ("context %p: invalid message received", this);
} else
pinos_log_error ("context %p: function %d not implemented", this, opcode);
}