From owner-svn-src-stable-8@FreeBSD.ORG Tue May 18 03:16:02 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BBA531065674; Tue, 18 May 2010 03:16:02 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A91BF8FC13; Tue, 18 May 2010 03:16:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4I3G2FF023033; Tue, 18 May 2010 03:16:02 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4I3G2nY023030; Tue, 18 May 2010 03:16:02 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <201005180316.o4I3G2nY023030@svn.freebsd.org> From: Andrew Thompson Date: Tue, 18 May 2010 03:16:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208248 - stable/8/lib/libusbhid X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 May 2010 03:16:02 -0000 Author: thompsa Date: Tue May 18 03:16:02 2010 New Revision: 208248 URL: http://svn.freebsd.org/changeset/base/208248 Log: MFC r208023 Use fixed width integer types for parsing the binary hid data. Modified: stable/8/lib/libusbhid/data.c stable/8/lib/libusbhid/usbhid.h Directory Properties: stable/8/lib/libusbhid/ (props changed) Modified: stable/8/lib/libusbhid/data.c ============================================================================== --- stable/8/lib/libusbhid/data.c Tue May 18 02:31:37 2010 (r208247) +++ stable/8/lib/libusbhid/data.c Tue May 18 03:16:02 2010 (r208248) @@ -33,7 +33,7 @@ __FBSDID("$FreeBSD$"); #include #include "usbhid.h" -int +int32_t hid_get_data(const void *p, const hid_item_t *h) { const unsigned char *buf; @@ -68,12 +68,15 @@ hid_get_data(const void *p, const hid_it } void -hid_set_data(void *p, const hid_item_t *h, int data) +hid_set_data(void *p, const hid_item_t *h, int32_t data) { unsigned char *buf; unsigned int hpos; unsigned int hsize; - int i, end, offs, mask; + uint32_t mask; + int i; + int end; + int offs; buf = p; hpos = h->pos; /* bit position of data */ Modified: stable/8/lib/libusbhid/usbhid.h ============================================================================== --- stable/8/lib/libusbhid/usbhid.h Tue May 18 02:31:37 2010 (r208247) +++ stable/8/lib/libusbhid/usbhid.h Tue May 18 03:16:02 2010 (r208248) @@ -30,6 +30,7 @@ */ #include +#include typedef struct report_desc *report_desc_t; @@ -105,7 +106,7 @@ int hid_parse_usage_in_page(const char * int hid_parse_usage_page(const char *name); /* Extracting/insertion of data, data.c: */ -int hid_get_data(const void *p, const hid_item_t *h); -void hid_set_data(void *p, const hid_item_t *h, int data); +int32_t hid_get_data(const void *p, const hid_item_t *h); +void hid_set_data(void *p, const hid_item_t *h, int32_t data); __END_DECLS