Dan Hipschman : rpcrt4: Fix bug calculating union switch type.

Alexandre Julliard julliard at wine.codeweavers.com
Tue Jun 19 06:42:34 CDT 2007


Module: wine
Branch: master
Commit: 6fd05b1dc7c83743bae5fb1e04941ec3bd560490
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=6fd05b1dc7c83743bae5fb1e04941ec3bd560490

Author: Dan Hipschman <dsh at linux.ucla.edu>
Date:   Mon Jun 18 18:40:08 2007 -0700

rpcrt4: Fix bug calculating union switch type.

---

 dlls/rpcrt4/ndr_marshall.c |   10 +++++-----
 dlls/rpcrt4/tests/server.c |    2 --
 2 files changed, 5 insertions(+), 7 deletions(-)

diff --git a/dlls/rpcrt4/ndr_marshall.c b/dlls/rpcrt4/ndr_marshall.c
index 62ff179..3f8742c 100644
--- a/dlls/rpcrt4/ndr_marshall.c
+++ b/dlls/rpcrt4/ndr_marshall.c
@@ -4301,7 +4301,7 @@ unsigned char *  WINAPI NdrEncapsulatedUnionMarshall(PMIDL_STUB_MESSAGE pStubMsg
     pFormat++;
 
     switch_type = *pFormat & 0xf;
-    increment = *pFormat & 0xf0 >> 4;
+    increment = (*pFormat & 0xf0) >> 4;
     pFormat++;
 
     ALIGN_POINTER(pStubMsg->Buffer, increment);
@@ -4333,7 +4333,7 @@ unsigned char *  WINAPI NdrEncapsulatedUnionUnmarshall(PMIDL_STUB_MESSAGE pStubM
     pFormat++;
 
     switch_type = *pFormat & 0xf;
-    increment = *pFormat & 0xf0 >> 4;
+    increment = (*pFormat & 0xf0) >> 4;
     pFormat++;
 
     ALIGN_POINTER(pStubMsg->Buffer, increment);
@@ -4365,7 +4365,7 @@ void WINAPI NdrEncapsulatedUnionBufferSize(PMIDL_STUB_MESSAGE pStubMsg,
     pFormat++;
 
     switch_type = *pFormat & 0xf;
-    increment = *pFormat & 0xf0 >> 4;
+    increment = (*pFormat & 0xf0) >> 4;
     pFormat++;
 
     ALIGN_LENGTH(pStubMsg->BufferLength, increment);
@@ -4390,7 +4390,7 @@ ULONG WINAPI NdrEncapsulatedUnionMemorySize(PMIDL_STUB_MESSAGE pStubMsg,
     ULONG switch_value;
 
     switch_type = *pFormat & 0xf;
-    increment = *pFormat & 0xf0 >> 4;
+    increment = (*pFormat & 0xf0) >> 4;
     pFormat++;
 
     ALIGN_POINTER(pStubMsg->Buffer, increment);
@@ -4417,7 +4417,7 @@ void WINAPI NdrEncapsulatedUnionFree(PMIDL_STUB_MESSAGE pStubMsg,
     pFormat++;
 
     switch_type = *pFormat & 0xf;
-    increment = *pFormat & 0xf0 >> 4;
+    increment = (*pFormat & 0xf0) >> 4;
     pFormat++;
 
     switch_value = get_discriminant(switch_type, pMemory);
diff --git a/dlls/rpcrt4/tests/server.c b/dlls/rpcrt4/tests/server.c
index 44040df..65226db 100644
--- a/dlls/rpcrt4/tests/server.c
+++ b/dlls/rpcrt4/tests/server.c
@@ -396,7 +396,6 @@ union_tests(void)
   i = 11;
   ok(square_sun(&su) == 121.0, "RPC square_sun\n");
 
-todo_wine {
   eu.t = ENCU_I;
   eu.tagged_union.i = 7;
   ok(square_encu(&eu) == 49.0, "RPC square_encu\n");
@@ -405,7 +404,6 @@ todo_wine {
   eu.tagged_union.f = 3.0;
   ok(square_encu(&eu) == 9.0, "RPC square_encu\n");
 }
-}
 
 static test_list_t *
 null_list(void)




More information about the wine-cvs mailing list