Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 29 Dec 2005 19:25:48 +0100
From:      Florent Thoumie <flz@xbsd.org>
To:        cvs-src@freebsd.org
Cc:        src-committers@freebsd.org, Alexander Leidinger <netchild@freebsd.org>, cvs-all@freebsd.org
Subject:   Re: cvs commit: src/sys/dev/usb ums.c
Message-ID:  <200512291925.53102.flz@xbsd.org>
In-Reply-To: <200512291918.52021.flz@xbsd.org>
References:  <200512291744.jBTHifRr067385@repoman.freebsd.org> <200512291918.52021.flz@xbsd.org>

index | next in thread | previous in thread | raw e-mail

[-- Attachment #1 --]
On Thursday 29 December 2005 19:18, Florent Thoumie wrote:
> On Thursday 29 December 2005 18:44, Alexander Leidinger wrote:
> > netchild    2005-12-29 17:44:40 UTC
> >
> >   FreeBSD src repository
> >
> >   Modified files:
> >     sys/dev/usb          ums.c
> >   Log:
> >   Merge NetBSD rev. 1.61:
> >    - Support more than 7 buttons for USB mice. Patch from NetBSD
> > kern/30248.
>
> 	I was looking at this PR two or three days ago and I found this in ums.c
> 	which made me think this simple patch could be harmful.
>
> 	u_char buttons = 0;
>         int i;
> 	[...]
> 	#define UMS_BUT(i) ((i) < 3 ? (((i) + 2) % 3) : (i))
> 	[...]
>         for (i = 0; i < sc->nbuttons; i++)
>                 if (hid_get_data(ibuf, &sc->sc_loc_btn[i]))
>                         buttons |= (1 << UMS_BUT(i));
>
> 	I think this won't fit in u_char, what about uint32_t ?

	Or a mere int actually.

-- 
Florent Thoumie
flz@FreeBSD.org
FreeBSD Committer

[-- Attachment #2 --]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (FreeBSD)

iD8DBQBDtCoxMxEkbVFH3PQRAnjmAJoDT3kxzU7u+9uvCADoUGScuOz25gCfRe6+
hm8L+rybcCFt72rGf4Te+fk=
=FX53
-----END PGP SIGNATURE-----
help

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200512291925.53102.flz>