]> CyberLeo.Net >> Repos - FreeBSD/stable/9.git/commit
MFC r305345:
authordim <dim@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Wed, 7 Sep 2016 19:02:47 +0000 (19:02 +0000)
committerdim <dim@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Wed, 7 Sep 2016 19:02:47 +0000 (19:02 +0000)
commit1ab5e83e54ace2843b90d235a860a38731b195f2
tree43d9813edd5ac6e55ce4c9856b3cbefa2e7e9cdf
parent2e5962e719e8e4e13078debb9e4d815e4126ffaa
MFC r305345:

With clang 3.9.0, compiling ppbus(4) results in the following warnings:

sys/dev/ppbus/ppb_1284.c:296:46: error: implicit conversion from 'int'
to 'char' changes value from 144 to -112 [-Werror,-Wconstant-conversion]
if ((error = do_peripheral_wait(bus, SELECT | nBUSY, 0))) {
     ~~~~~~~~~~~~~~~~~~      ~~~~~~~^~~~~~~
sys/dev/ppbus/ppb_1284.c:785:48: error: implicit conversion from 'int'
to 'char' changes value from 240 to -16 [-Werror,-Wconstant-conversion]
if (do_1284_wait(bus, nACK | SELECT | PERROR | nBUSY,
    ~~~~~~~~~~~~      ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
sys/dev/ppbus/ppb_1284.c:786:29: error: implicit conversion from 'int'
to 'char' changes value from 240 to -16 [-Werror,-Wconstant-conversion]
nACK | SELECT | PERROR | nBUSY)) {
~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~

This is because nBUSY is 0x80, so the plain char argument is wrapped to
a negative value.  Fix this in a minimal fashion, by using uint8_t in a
few places.

Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D7771

git-svn-id: svn://svn.freebsd.org/base/stable/9@305555 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
sys/dev/ppbus/ppb_1284.c
sys/dev/ppbus/ppb_base.c
sys/dev/ppbus/ppbconf.h