Use fixed width integer types for parsing the binary hid data.
PR: usb/146367 Submitted by: Hans Petter Selasky
This commit is contained in:
parent
be73c87b5c
commit
ff7ad950be
@ -34,7 +34,7 @@ __FBSDID("$FreeBSD$");
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include "usbhid.h"
|
#include "usbhid.h"
|
||||||
|
|
||||||
int
|
int32_t
|
||||||
hid_get_data(const void *p, const hid_item_t *h)
|
hid_get_data(const void *p, const hid_item_t *h)
|
||||||
{
|
{
|
||||||
const uint8_t *buf;
|
const uint8_t *buf;
|
||||||
@ -78,12 +78,15 @@ hid_get_data(const void *p, const hid_item_t *h)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
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;
|
uint8_t *buf;
|
||||||
uint32_t hpos;
|
uint32_t hpos;
|
||||||
uint32_t hsize;
|
uint32_t hsize;
|
||||||
int i, end, offs, mask;
|
uint32_t mask;
|
||||||
|
int i;
|
||||||
|
int end;
|
||||||
|
int offs;
|
||||||
|
|
||||||
buf = p;
|
buf = p;
|
||||||
|
|
||||||
|
@ -29,7 +29,7 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
typedef struct report_desc *report_desc_t;
|
typedef struct report_desc *report_desc_t;
|
||||||
|
|
||||||
@ -102,7 +102,7 @@ int hid_parse_usage_in_page(const char *name);
|
|||||||
int hid_parse_usage_page(const char *name);
|
int hid_parse_usage_page(const char *name);
|
||||||
|
|
||||||
/* Extracting/insertion of data, data.c: */
|
/* Extracting/insertion of data, data.c: */
|
||||||
int hid_get_data(const void *p, const hid_item_t *h);
|
int32_t hid_get_data(const void *p, const hid_item_t *h);
|
||||||
void hid_set_data(void *p, const hid_item_t *h, int data);
|
void hid_set_data(void *p, const hid_item_t *h, int32_t data);
|
||||||
|
|
||||||
__END_DECLS
|
__END_DECLS
|
||||||
|
Loading…
x
Reference in New Issue
Block a user