Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 18 May 2010 03:16:02 +0000 (UTC)
From:      Andrew Thompson <thompsa@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
Subject:   svn commit: r208248 - stable/8/lib/libusbhid
Message-ID:  <201005180316.o4I3G2nY023030@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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 <stdlib.h>
 #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 <sys/cdefs.h>
+#include <sys/types.h>
 
 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



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