summaryrefslogtreecommitdiffstats
path: root/lib/libusbhid/data.c
diff options
context:
space:
mode:
authorthompsa <thompsa@FreeBSD.org>2010-05-13 02:03:00 +0000
committerthompsa <thompsa@FreeBSD.org>2010-05-13 02:03:00 +0000
commit1518781968e8c6fe764f24f5d854ab56c9531591 (patch)
tree00eccdae2f4113bb7717a802cd36a9946d51c521 /lib/libusbhid/data.c
parent93177a0de2e9025f66b80a280911343c680fd979 (diff)
downloadFreeBSD-src-1518781968e8c6fe764f24f5d854ab56c9531591.zip
FreeBSD-src-1518781968e8c6fe764f24f5d854ab56c9531591.tar.gz
Use fixed width integer types for parsing the binary hid data.
PR: usb/146367 Submitted by: Hans Petter Selasky
Diffstat (limited to 'lib/libusbhid/data.c')
-rw-r--r--lib/libusbhid/data.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/libusbhid/data.c b/lib/libusbhid/data.c
index afc5a21..3b90ac6 100644
--- a/lib/libusbhid/data.c
+++ b/lib/libusbhid/data.c
@@ -34,7 +34,7 @@ __FBSDID("$FreeBSD$");
#include <stdlib.h>
#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_item_t *h)
}
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;
OpenPOWER on IntegriCloud