summaryrefslogtreecommitdiffstats
path: root/lib/libusbhid
diff options
context:
space:
mode:
authorn_hibma <n_hibma@FreeBSD.org>2000-08-26 13:53:27 +0000
committern_hibma <n_hibma@FreeBSD.org>2000-08-26 13:53:27 +0000
commit23d99a41e28b4f074b716c47bed22a5e7e19f160 (patch)
tree110bcbaefa7e647db5357e474cfb70f763f325ba /lib/libusbhid
parent55b1f4b48e81b1b4d81b8974eaf6ec8722dee29c (diff)
downloadFreeBSD-src-23d99a41e28b4f074b716c47bed22a5e7e19f160.zip
FreeBSD-src-23d99a41e28b4f074b716c47bed22a5e7e19f160.tar.gz
Sync with NetBSD:
Print unknown usages with 4 digits. Mask in page extraction.
Diffstat (limited to 'lib/libusbhid')
-rw-r--r--lib/libusbhid/libusb.h4
-rw-r--r--lib/libusbhid/libusbhid.h4
-rw-r--r--lib/libusbhid/usage.c6
-rw-r--r--lib/libusbhid/usbhid.h4
4 files changed, 9 insertions, 9 deletions
diff --git a/lib/libusbhid/libusb.h b/lib/libusbhid/libusb.h
index 65b996f..854eda8 100644
--- a/lib/libusbhid/libusb.h
+++ b/lib/libusbhid/libusb.h
@@ -1,4 +1,4 @@
-/* $NetBSD: usb.h,v 1.7 2000/04/02 11:10:53 augustss Exp $ */
+/* $NetBSD: usb.h,v 1.8 2000/08/13 22:22:02 augustss Exp $ */
/*
* Copyright (c) 1999 Lennart Augustsson <augustss@netbsd.org>
@@ -72,7 +72,7 @@ typedef struct hid_item {
struct hid_item *next;
} hid_item_t;
-#define HID_PAGE(u) ((u) >> 16)
+#define HID_PAGE(u) (((u) >> 16) & 0xffff)
#define HID_USAGE(u) ((u) & 0xffff)
/* Obtaining a report descriptor, descr.c: */
diff --git a/lib/libusbhid/libusbhid.h b/lib/libusbhid/libusbhid.h
index 65b996f..854eda8 100644
--- a/lib/libusbhid/libusbhid.h
+++ b/lib/libusbhid/libusbhid.h
@@ -1,4 +1,4 @@
-/* $NetBSD: usb.h,v 1.7 2000/04/02 11:10:53 augustss Exp $ */
+/* $NetBSD: usb.h,v 1.8 2000/08/13 22:22:02 augustss Exp $ */
/*
* Copyright (c) 1999 Lennart Augustsson <augustss@netbsd.org>
@@ -72,7 +72,7 @@ typedef struct hid_item {
struct hid_item *next;
} hid_item_t;
-#define HID_PAGE(u) ((u) >> 16)
+#define HID_PAGE(u) (((u) >> 16) & 0xffff)
#define HID_USAGE(u) ((u) & 0xffff)
/* Obtaining a report descriptor, descr.c: */
diff --git a/lib/libusbhid/usage.c b/lib/libusbhid/usage.c
index afb990a..28d8c3b 100644
--- a/lib/libusbhid/usage.c
+++ b/lib/libusbhid/usage.c
@@ -1,4 +1,4 @@
-/* $NetBSD: usage.c,v 1.5 2000/04/02 11:10:53 augustss Exp $ */
+/* $NetBSD: usage.c,v 1.6 2000/08/13 22:22:02 augustss Exp $ */
/*
* Copyright (c) 1999 Lennart Augustsson <augustss@netbsd.org>
@@ -165,7 +165,7 @@ hid_usage_page(int i)
for (k = 0; k < npages; k++)
if (pages[k].usage == i)
return pages[k].name;
- sprintf(b, "0x%02x", i);
+ sprintf(b, "0x%04x", i);
return b;
}
@@ -192,6 +192,6 @@ hid_usage_in_page(unsigned int u)
return pages[k].page_contents[j].name;
}
bad:
- sprintf(b, "0x%02x", i);
+ sprintf(b, "0x%04x", i);
return b;
}
diff --git a/lib/libusbhid/usbhid.h b/lib/libusbhid/usbhid.h
index 65b996f..854eda8 100644
--- a/lib/libusbhid/usbhid.h
+++ b/lib/libusbhid/usbhid.h
@@ -1,4 +1,4 @@
-/* $NetBSD: usb.h,v 1.7 2000/04/02 11:10:53 augustss Exp $ */
+/* $NetBSD: usb.h,v 1.8 2000/08/13 22:22:02 augustss Exp $ */
/*
* Copyright (c) 1999 Lennart Augustsson <augustss@netbsd.org>
@@ -72,7 +72,7 @@ typedef struct hid_item {
struct hid_item *next;
} hid_item_t;
-#define HID_PAGE(u) ((u) >> 16)
+#define HID_PAGE(u) (((u) >> 16) & 0xffff)
#define HID_USAGE(u) ((u) & 0xffff)
/* Obtaining a report descriptor, descr.c: */
OpenPOWER on IntegriCloud