ao_hmc5883: Add explicit casts for -Wconversion
authorKeith Packard <keithp@keithp.com>
Fri, 28 Jan 2022 17:29:06 +0000 (09:29 -0800)
committerKeith Packard <keithp@keithp.com>
Thu, 17 Feb 2022 01:26:49 +0000 (17:26 -0800)
No bugs noted.

Signed-off-by: Keith Packard <keithp@keithp.com>
src/drivers/ao_hmc5883.c

index 55a193ac5adb58236acb51be0e3a3f9eb78fe5e5..fc339334c51889181cae88d37f80bf33a20ef3f6 100644 (file)
@@ -87,7 +87,7 @@ ao_hmc5883_sample(struct ao_hmc5883_sample *sample)
        /* byte swap */
        while (i--) {
                uint16_t        t = *d;
-               *d++ = (t >> 8) | (t << 8);
+               *d++ = (uint16_t) ((t >> 8) | (t << 8));
        }
 #endif
 }