PERFORCE change 177886 for review
Hans Petter Selasky
hselasky at FreeBSD.org
Fri May 7 08:01:31 UTC 2010
http://p4web.freebsd.org/@@177886?ac=10
Change 177886 by hselasky at hselasky_laptop001 on 2010/05/07 08:00:59
Follow up patch. Use strong types. "int" might not always be 32-bit.
PR: usb/146367
Affected files ...
.. //depot/projects/usb/src/lib/libusbhid/data.c#6 edit
.. //depot/projects/usb/src/lib/libusbhid/usbhid.h#7 edit
Differences ...
==== //depot/projects/usb/src/lib/libusbhid/data.c#6 (text+ko) ====
@@ -34,7 +34,7 @@
#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 @@
}
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;
==== //depot/projects/usb/src/lib/libusbhid/usbhid.h#7 (text+ko) ====
@@ -29,7 +29,7 @@
*
*/
-#include <sys/types.h>
+#include <stdint.h>
typedef struct report_desc *report_desc_t;
@@ -102,7 +102,7 @@
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
More information about the p4-projects
mailing list