[riot-notifications] [RIOT-OS/RIOT] bmp180: Fixes conversion bug (#11154)

Kees Bakker notifications at github.com
Mon Mar 11 22:45:11 CET 2019


keestux commented on this pull request.



> @@ -193,7 +193,7 @@ static int _read_ut(const bmp180_t *dev, int32_t *output)
         i2c_release(DEV_I2C);
         return -1;
     }
-    *output = ((uint16_t)ut[0] << 8) | ut[1];
+    *output = ((uint16_t)ut[0] << 8) | ((uint16_t)ut[1]);

Adding a type cast isn't going to change the code. There is already an implicit cast due to the type of the left side of the or.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/11154#pullrequestreview-213101824
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190311/9031e62d/attachment.html>


More information about the notifications mailing list