]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s4/torture/smb2: cppcheck: Fix shiftTooManyBitsSigned error
authorNoel Power <noel.power@suse.com>
Wed, 22 May 2019 13:07:28 +0000 (13:07 +0000)
committerAndreas Schneider <asn@cryptomilk.org>
Tue, 4 Jun 2019 22:13:07 +0000 (22:13 +0000)
Fixes

source4/torture/smb2/notify.c:974: error: shiftTooManyBitsSigned: Shifting signed 32-bit value by 31 bits is undefined behaviour <--[cppcheck]
source4/torture/smb2/notify.c:994: error: shiftTooManyBitsSigned: Shifting signed 32-bit value by 31 bits is undefined behaviour <--[cppcheck]
source4/torture/smb2/notify.c:1002: error: shiftTooManyBitsSigned: Shifting signed 32-bit value by 31 bits is undefined behaviour <--[cppcheck]
source4/torture/smb2/notify.c:1011: error: shiftTooManyBitsSigned: Shifting signed 32-bit value by 31 bits is undefined behaviour <--[cppcheck]
source4/torture/smb2/notify.c:1025: error: shiftTooManyBitsSigned: Shifting signed 32-bit value by 31 bits is undefined behaviour <--[cppcheck]
source4/torture/smb2/notify.c:1040: error: shiftTooManyBitsSigned: Shifting signed 32-bit value by 31 bits is undefined behaviour <--[cppcheck]
source4/torture/smb2/notify.c:1048: error: shiftTooManyBitsSigned: Shifting signed 32-bit value by 31 bits is undefined behaviour <--[cppcheck]
source4/torture/smb2/notify.c:1062: error: shiftTooManyBitsSigned: Shifting signed 32-bit value by 31 bits is undefined behaviour <--[cppcheck]
source4/torture/smb2/notify.c:1081: error: shiftTooManyBitsSigned: Shifting signed 32-bit value by 31 bits is undefined behaviour <--[cppcheck]
source4/torture/smb2/notify.c:1096: error: shiftTooManyBitsSigned: Shifting signed 32-bit value by 31 bits is undefined behaviour <--[cppcheck]
source4/torture/smb2/notify.c:1112: error: shiftTooManyBitsSigned: Shifting signed 32-bit value by 31 bits is undefined behaviour <--[cppcheck]
source4/torture/smb2/notify.c:1125: error: shiftTooManyBitsSigned: Shifting signed 32-bit value by 31 bits is undefined behaviour <--[cppcheck]

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
source4/torture/smb2/notify.c

index 9b8a44fd49bb9f76acdf51d607590d57cee12394..d8aa44f5d4c1af89cac5549a539f7586a8103d95 100644 (file)
@@ -913,7 +913,7 @@ static bool torture_smb2_notify_mask(struct torture_context *torture,
                h1 = io.smb2.out.file.handle; \
                setup \
                notify.smb2.in.file.handle = h1;        \
-               notify.smb2.in.completion_filter = (1<<i); \
+               notify.smb2.in.completion_filter = ((uint32_t)1<<i); \
                /* cancel initial requests so the buffer is setup */    \
                req = smb2_notify_send(tree1, &(notify.smb2)); \
                smb2_cancel(req); \
@@ -965,7 +965,7 @@ static bool torture_smb2_notify_mask(struct torture_context *torture,
                               notify.smb2.out.changes[0].name.s);      \
                        ret = false; \
                } \
-               mask |= (1<<i); \
+               mask |= ((uint32_t)1<<i); \
        } \
        } while (0); \
        } while (0);