[haiku-commits] haiku: hrev53275 - in src: add-ons/kernel/drivers/input/usb_hid add-ons/accelerants/common system/libroot/posix/stdlib

  • From: waddlesplash <waddlesplash@xxxxxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Wed, 17 Jul 2019 18:11:42 -0400 (EDT)

hrev53275 adds 1 changeset to branch 'master'
old head: e081b9cd7ef168847177a491da56ccb1c69d57cb
new head: 79d1ca0fa900e6394c3cab29d18d8b7bbf548040
overview: 
https://git.haiku-os.org/haiku/log/?qt=range&q=79d1ca0fa900+%5Ee081b9cd7ef1

----------------------------------------------------------------------------

79d1ca0fa900: PVS V564: use of bitwise operators on booleans
  
  Change-Id: I0a0cd7ddba0abaef27700f1ba05bf99bb8c7a400
  Reviewed-on: https://review.haiku-os.org/c/1607
  Reviewed-by: waddlesplash <waddlesplash@xxxxxxxxx>

                             [ Adrien Destugues <pulkomandy@xxxxxxxxxxxxx> ]

----------------------------------------------------------------------------

Revision:    hrev53275
Commit:      79d1ca0fa900e6394c3cab29d18d8b7bbf548040
URL:         https://git.haiku-os.org/haiku/commit/?id=79d1ca0fa900
Author:      Adrien Destugues <pulkomandy@xxxxxxxxxxxxx>
Date:        Tue Jul 16 18:40:02 2019 UTC
Committer:   waddlesplash <waddlesplash@xxxxxxxxx>
Commit-Date: Wed Jul 17 22:11:40 2019 UTC

----------------------------------------------------------------------------

3 files changed, 4 insertions(+), 4 deletions(-)
src/add-ons/accelerants/common/i2c.c                              | 2 +-
.../kernel/drivers/input/usb_hid/TabletProtocolHandler.cpp        | 4 ++--
src/system/libroot/posix/stdlib/strtod.c                          | 2 +-

----------------------------------------------------------------------------

diff --git a/src/add-ons/accelerants/common/i2c.c 
b/src/add-ons/accelerants/common/i2c.c
index c828a9614e..e6515674a5 100644
--- a/src/add-ons/accelerants/common/i2c.c
+++ b/src/add-ons/accelerants/common/i2c.c
@@ -273,7 +273,7 @@ send_slave_address(const i2c_bus *bus, int slaveAddress, 
bool isWrite)
        status_t status;
 
        TRACE("%s: 0x%X\n", __func__, slaveAddress);
-       status = send_byte(bus, (slaveAddress & 0xfe) | !isWrite, true);
+       status = send_byte(bus, (slaveAddress & 0xfe) | (isWrite ? 0 : 1), 
true);
        if (status != B_OK)
                return status;
 
diff --git a/src/add-ons/kernel/drivers/input/usb_hid/TabletProtocolHandler.cpp 
b/src/add-ons/kernel/drivers/input/usb_hid/TabletProtocolHandler.cpp
index af67fa33f9..ad23564db6 100644
--- a/src/add-ons/kernel/drivers/input/usb_hid/TabletProtocolHandler.cpp
+++ b/src/add-ons/kernel/drivers/input/usb_hid/TabletProtocolHandler.cpp
@@ -290,11 +290,11 @@ TabletProtocolHandler::_ReadReport(void *buffer, uint32 
*cookie)
 
        bool inRange = true;
        if (fRange != NULL && fRange->Extract() == B_OK && fRange->Valid())
-               inRange = fRange->Data() & 1 != 0;
+               inRange = ((fRange->Data() & 1) != 0);
 
        bool eraser = false;
        if (fEraser != NULL && fEraser->Extract() == B_OK && fEraser->Valid())
-               eraser = (fEraser->Data() & 1) != 0;
+               eraser = ((fEraser->Data() & 1) != 0);
 
        fReport.DoneProcessing();
        TRACE("got tablet report\n");
diff --git a/src/system/libroot/posix/stdlib/strtod.c 
b/src/system/libroot/posix/stdlib/strtod.c
index 7eadb13c4e..b578cefcd0 100644
--- a/src/system/libroot/posix/stdlib/strtod.c
+++ b/src/system/libroot/posix/stdlib/strtod.c
@@ -542,7 +542,7 @@ lo0bits(ULong *y)
        if (!(x & 1)) {
                k++;
                x >>= 1;
-               if (!x & 1)
+               if (!(x & 1))
                        return 32;
        }
        *y = x;


Other related posts:

  • » [haiku-commits] haiku: hrev53275 - in src: add-ons/kernel/drivers/input/usb_hid add-ons/accelerants/common system/libroot/posix/stdlib - waddlesplash