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

Kees Bakker notifications at github.com
Mon Jan 7 11:52:10 CET 2019

Ok, I'll verify that and update the commitOn Jan 7, 2019 09:55, Sebastian Meiling <notifications at github.com> wrote:@smlng requested changes on this pull request.

minor, otherwise (as before) ACK

In drivers/bmx055/bmx055_saul.c:
> @@ -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 #10711, that makes it explicit we want a single value, compare to gyros and mags that actually expect a triplet of int16_ts

—You are receiving this because you authored the thread.Reply to this email directly, view it on GitHub, or mute the thread.

You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190107/bf96743d/attachment.html>

More information about the notifications mailing list