Date: Fri, 7 May 2010 08:01:31 GMT From: Hans Petter Selasky <hselasky@FreeBSD.org> To: Perforce Change Reviews <perforce@FreeBSD.org> Subject: PERFORCE change 177886 for review Message-ID: <201005070801.o4781VW4059922@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://p4web.freebsd.org/@@177886?ac=10 Change 177886 by hselasky@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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201005070801.o4781VW4059922>