kernel32: Add parentheses to clarify the precedence between '&' and '||'.

Francois Gouget fgouget at free.fr
Thu Sep 8 18:45:30 CDT 2011


---

I'm pretty sure the '&' and '&&'/'||' precedence works as expected and 
that it is even specified in the C standard. But I'm still a bit uneasy 
when I see these two being mixed without parentheses. So I propose the 
following patch (there's another four in case this one is deemed 
acceptable).

 dlls/kernel32/volume.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/dlls/kernel32/volume.c b/dlls/kernel32/volume.c
index 4a2a7b5..a937f6b 100644
--- a/dlls/kernel32/volume.c
+++ b/dlls/kernel32/volume.c
@@ -612,7 +612,7 @@ static DWORD VOLUME_GetSuperblockSerial( const UNICODE_STRING *device, HANDLE ha
              * Me$$ysoft chose to reverse the serial number in NT4/W2K.
              * It's true and nobody will ever be able to change it.
              */
-            if (GetVersion() & 0x80000000 || type == FS_UDF)
+            if ((GetVersion() & 0x80000000) || type == FS_UDF)
                 return (sum[3] << 24) | (sum[2] << 16) | (sum[1] << 8) | sum[0];
             else
                 return (sum[0] << 24) | (sum[1] << 16) | (sum[2] << 8) | sum[3];
-- 
1.7.5.4



More information about the wine-patches mailing list