From 6b8ec0360c5f0a057dbcd87cc7eca7591461bd24 Mon Sep 17 00:00:00 2001 From: emax Date: Wed, 11 Feb 2004 21:09:13 +0000 Subject: [PATCH] Do not cast dval. Make global _usage_page unsigned. Reviewed by: imp (mentor) --- lib/libusbhid/parse.c | 3 +-- lib/libusbhid/usbhid.h | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/libusbhid/parse.c b/lib/libusbhid/parse.c index 65e13c129b36..3abc036644ba 100644 --- a/lib/libusbhid/parse.c +++ b/lib/libusbhid/parse.c @@ -213,12 +213,11 @@ hid_get_item_raw(hid_data_t s, hid_item_t *h) dval = 0; break; case 1: - dval = (int8_t)*data++; + dval = *data++; break; case 2: dval = *data++; dval |= *data++ << 8; - dval = (int16_t)dval; break; case 4: dval = *data++; diff --git a/lib/libusbhid/usbhid.h b/lib/libusbhid/usbhid.h index 536bf749ffbd..ed652718863c 100644 --- a/lib/libusbhid/usbhid.h +++ b/lib/libusbhid/usbhid.h @@ -45,7 +45,7 @@ typedef enum hid_kind { typedef struct hid_item { /* Global */ - int _usage_page; + unsigned int _usage_page; int logical_minimum; int logical_maximum; int physical_minimum;