[riot-notifications] [RIOT-OS/RIOT] drivers/bmx055: eliminate some casts (#10704)

Sebastian Meiling notifications at github.com
Mon Jan 7 09:55:42 CET 2019


smlng requested changes on this pull request.

minor, otherwise (as before) ACK

> @@ -24,7 +24,9 @@
 
 static int read_mag(const void *dev, phydat_t *res)
 {
-    if (bmx055_mag_read((bmx055_t *)dev, (int16_t *)res) != BMX055_OK) {
+    const bmx055_t *mydev = (const bmx055_t *)dev;
+
+    if (bmx055_mag_read(mydev, res->val) != BMX055_OK) {

to me it would be even better to use `&res->val[0]` as you did in https://github.com/RIOT-OS/RIOT/pull/10711, that makes it explicit we want a single value, compare to gyros and mags that actually expect a triplet of `int16_t`s

-- 
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/10704#pullrequestreview-189718651
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190107/09b564ef/attachment.html>


More information about the notifications mailing list