dcerpc.idl: use logical dcerpc_object ordering
authorDavid Disseldorp <ddiss@samba.org>
Mon, 6 Jan 2014 05:20:08 +0000 (06:20 +0100)
committerGünther Deschner <gd@samba.org>
Thu, 16 Jan 2014 15:22:53 +0000 (16:22 +0100)
commite891652339bbfa192f88c9d22d78c78ed0fc8511
tree387323fef0ea35fcfe2cd26c02171433da93f0df
parent1a0eddbe6c3e89097ff35d5c38e411e09e3f4d30
dcerpc.idl: use logical dcerpc_object ordering

This IDL code:
typedef [nodiscriminant] union {
[default] dcerpc_empty empty;
[case(LIBNDR_FLAG_OBJECT_PRESENT)] GUID object;
} dcerpc_object;

Compiles into the following default-before-case marshalling code:
switch (level) {
default: {
NDR_CHECK(ndr_push_dcerpc_empty(ndr, NDR_SCALARS, &r->empty));
break; }

case LIBNDR_FLAG_OBJECT_PRESENT: {
NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->object));
break; }

}

The default entry before case does not change the flow of execution but
is more logical when present at the end of the switch statement.

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
librpc/idl/dcerpc.idl