From owner-cvs-all@FreeBSD.ORG Fri Dec 30 09:35:11 2005 Return-Path: X-Original-To: cvs-all@FreeBSD.org Delivered-To: cvs-all@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C59C116A41F; Fri, 30 Dec 2005 09:35:11 +0000 (GMT) (envelope-from nate@root.org) Received: from www.cryptography.com (li-22.members.linode.com [64.5.53.22]) by mx1.FreeBSD.org (Postfix) with ESMTP id D4BED43D60; Fri, 30 Dec 2005 09:35:10 +0000 (GMT) (envelope-from nate@root.org) Received: from [172.16.1.113] (ip-207-145-170-192.lax.megapath.net [207.145.170.192]) by www.cryptography.com (8.12.8/8.12.8) with ESMTP id jBU9ZR9e003472 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Fri, 30 Dec 2005 01:35:28 -0800 Message-ID: <43B4FDD5.1060000@root.org> Date: Fri, 30 Dec 2005 01:28:53 -0800 From: Nate Lawson User-Agent: Mozilla Thunderbird 1.0.6 (Windows/20050716) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Alexander Leidinger References: <20051229183552.205C316A432@hub.freebsd.org> <43B4385D.9030206@root.org> <20051229222645.05311b1f@Magellan.Leidinger.net> In-Reply-To: <20051229222645.05311b1f@Magellan.Leidinger.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: cvs-src@FreeBSD.org, src-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/sys/dev/usb ums.c X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Dec 2005 09:35:11 -0000 Alexander Leidinger wrote: > On Thu, 29 Dec 2005 11:26:21 -0800 > Nate Lawson wrote: > > >>>Index: src/sys/dev/usb/ums.c >>>diff -u src/sys/dev/usb/ums.c:1.79 src/sys/dev/usb/ums.c:1.80 >>>--- src/sys/dev/usb/ums.c:1.79 Thu Dec 29 17:44:40 2005 >>>+++ src/sys/dev/usb/ums.c Thu Dec 29 18:35:28 2005 >>>@@ -425,7 +425,7 @@ >>> struct ums_softc *sc = addr; >>> u_char *ibuf; >>> int dx, dy, dz, dt; >>>- u_char buttons = 0; >>>+ int buttons = 0; >>> int i; >>> >>> #define UMS_BUT(i) ((i) < 3 ? (((i) + 2) % 3) : (i)) >> >>I think the UMS_BUT macro operates on only 2 bits. Are you sure that's >>still right? > > > The UMS_BUT macro in NetBSD is different, but I don't know if this is > because of the uhidevs changes (which we don't have) or not. The change > in NetBSD only changed the MAX_BUTTONS define, not the UMS_BUT macro. > > I also don't see where it only operates on 2 bits (BTW.: MAX_BUTTONS was > changed from decimal 7 to decimal 31)... if I rewrite it as a function > it looks like: > int ums_but(int i) { > if (i < 3) { > return (i + 2) % 3; > } else { > return i; > } > } > Or did I miscounted the parenthesis? I meant that this maps 0:2, 1:0, 2:1, 3:3, 4:4, ... Or in other words, it only operates on 2-bit values (0-3). I don't know if that's an issue or not, I just was wondering if that also needed to be expanded. -- Nate