[riot-notifications] [RIOT-OS/RIOT] tests/driver_hts221: cleanup temperature display logic (#12165)

benpicco notifications at github.com
Tue Sep 3 21:35:57 CEST 2019


benpicco requested changes on this pull request.



> @@ -52,12 +53,8 @@ int main(void)
         if (hts221_read_temperature(&dev, &temp) != HTS221_OK) {
             puts(" -- failed to read temperature!");
         }
-        bool negative = (temp < 0);
-        if (negative) {
-            temp = -temp;
-        }
-        printf("H: %u.%u%%, T:%c%u.%u°C\n", (hum / 10), (hum % 10),
-               (negative ? '-' : ' '), (temp / 10), (temp % 10));
+        printf("H: %u.%u%%, T: %d.%d°C\n", (hum / 10), (hum % 10),

```suggestion
        printf("H: %d.%d%%, T: %d.%d°C\n", (hum / 10), (hum % 10),
```
Not sure why this gets promoted to signed, but this way Travis should be happy.

-- 
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/12165#pullrequestreview-283215730
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190903/0ed0acff/attachment.htm>


More information about the notifications mailing list