From owner-svn-src-all@FreeBSD.ORG Thu May 13 02:03:00 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C44F7106564A; Thu, 13 May 2010 02:03:00 +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 B20308FC16; Thu, 13 May 2010 02:03:00 +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 o4D2305W089608; Thu, 13 May 2010 02:03:00 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4D2305O089605; Thu, 13 May 2010 02:03:00 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <201005130203.o4D2305O089605@svn.freebsd.org> From: Andrew Thompson Date: Thu, 13 May 2010 02:03:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208023 - head/lib/libusbhid X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 May 2010 02:03:00 -0000 Author: thompsa Date: Thu May 13 02:03:00 2010 New Revision: 208023 URL: http://svn.freebsd.org/changeset/base/208023 Log: Use fixed width integer types for parsing the binary hid data. PR: usb/146367 Submitted by: Hans Petter Selasky Modified: head/lib/libusbhid/data.c head/lib/libusbhid/usbhid.h Modified: head/lib/libusbhid/data.c ============================================================================== --- head/lib/libusbhid/data.c Thu May 13 01:50:29 2010 (r208022) +++ head/lib/libusbhid/data.c Thu May 13 02:03:00 2010 (r208023) @@ -34,7 +34,7 @@ __FBSDID("$FreeBSD$"); #include #include "usbhid.h" -int +int32_t hid_get_data(const void *p, const hid_item_t *h) { const uint8_t *buf; @@ -78,12 +78,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) { uint8_t *buf; uint32_t hpos; uint32_t hsize; - int i, end, offs, mask; + uint32_t mask; + int i; + int end; + int offs; buf = p; Modified: head/lib/libusbhid/usbhid.h ============================================================================== --- head/lib/libusbhid/usbhid.h Thu May 13 01:50:29 2010 (r208022) +++ head/lib/libusbhid/usbhid.h Thu May 13 02:03:00 2010 (r208023) @@ -29,7 +29,7 @@ * */ -#include +#include typedef struct report_desc *report_desc_t; @@ -102,7 +102,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