Date: Mon, 30 Jan 2017 02:32:33 +0000 (UTC) From: Justin Hibbits <jhibbits@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312977 - head/sys/dev/adb Message-ID: <201701300232.v0U2WXMT014486@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: jhibbits Date: Mon Jan 30 02:32:33 2017 New Revision: 312977 URL: https://svnweb.freebsd.org/changeset/base/312977 Log: Force the setting of bit 7 in the sysmouse packet byte 1 to be unsigned. Clang complains about the shift of (1 << 7) into a int8_t changing the value: warning: implicit conversion from 'int' to 'int8_t' (aka 'signed char') changes value from 128 to -128 [-Wconstant-conversion] Squash this warning by forcing clang to see it as an unsigned bit. This seems odd, given that it's still a conversion of 128->-128, but I'm guessing the explicit unsigned attribute notifies clang that sign really doesn't matter in this case. Reported by: Mark Millard <markmi AT dsl-only DOT net> MFC after: 2 weeks Modified: head/sys/dev/adb/adb_mouse.c Modified: head/sys/dev/adb/adb_mouse.c ============================================================================== --- head/sys/dev/adb/adb_mouse.c Mon Jan 30 02:25:55 2017 (r312976) +++ head/sys/dev/adb/adb_mouse.c Mon Jan 30 02:32:33 2017 (r312977) @@ -520,7 +520,7 @@ ams_read(struct cdev *dev, struct uio *u } } - sc->packet[0] = 1 << 7; + sc->packet[0] = 1U << 7; sc->packet[0] |= (!(sc->buttons & 1)) << 2; sc->packet[0] |= (!(sc->buttons & 4)) << 1; sc->packet[0] |= (!(sc->buttons & 2));
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201701300232.v0U2WXMT014486>