[UDFS] Fix macros to support 'bit' being a complex expression
authorHervé Poussineau <hpoussin@reactos.org>
Sun, 7 Apr 2019 17:08:53 +0000 (19:08 +0200)
committerHervé Poussineau <hpoussin@reactos.org>
Sun, 7 Apr 2019 17:28:18 +0000 (19:28 +0200)
This is for example used in udf_info/mount.cpp:
    UDFSetUsedBits(new_bm, i & ~(d-1), d);

drivers/filesystems/udfs/udf_info/udf_info.h

index 2aeeb01..2c97192 100644 (file)
@@ -1184,13 +1184,13 @@ UDFClrBits__(
 #define UDFSetBits(arr, bit, bc) \
 {uint32 j;                       \
     for(j=0;j<bc;j++) {          \
 #define UDFSetBits(arr, bit, bc) \
 {uint32 j;                       \
     for(j=0;j<bc;j++) {          \
-        UDFSetBit(arr, bit+j);   \
+        UDFSetBit(arr, (bit)+j); \
 }}
 
 #define UDFClrBits(arr, bit, bc) \
 {uint32 j;                       \
     for(j=0;j<bc;j++) {          \
 }}
 
 #define UDFClrBits(arr, bit, bc) \
 {uint32 j;                       \
     for(j=0;j<bc;j++) {          \
-        UDFClrBit(arr, bit+j);   \
+        UDFClrBit(arr, (bit)+j); \
 }}
 
 #endif // _X86_
 }}
 
 #endif // _X86_