[PATCH v2 6/6] idl: use logical dcerpc_object ordering
David Disseldorp
ddiss at samba.org
Thu Jan 16 09:48:12 MST 2014
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 at samba.org>
---
librpc/idl/dcerpc.idl | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/librpc/idl/dcerpc.idl b/librpc/idl/dcerpc.idl
index 32f9514..dc8a24f 100644
--- a/librpc/idl/dcerpc.idl
+++ b/librpc/idl/dcerpc.idl
@@ -48,8 +48,8 @@ interface dcerpc
} dcerpc_empty;
typedef [nodiscriminant] union {
- [default] dcerpc_empty empty;
[case(LIBNDR_FLAG_OBJECT_PRESENT)] GUID object;
+ [default] dcerpc_empty empty;
} dcerpc_object;
typedef struct {
--
1.8.1.4
More information about the samba-technical
mailing list