Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/usb Fix dval signdedness confusion, as was recently ...
details: https://anonhg.NetBSD.org/src/rev/116d1649401e
branches: trunk
changeset: 342641:116d1649401e
user: jakllsch <jakllsch%NetBSD.org@localhost>
date: Sat Jan 02 20:57:10 2016 +0000
description:
Fix dval signdedness confusion, as was recently done in libusbhid.
diffstat:
sys/dev/usb/hid.c | 8 +++++---
1 files changed, 5 insertions(+), 3 deletions(-)
diffs (39 lines):
diff -r 52795161fa38 -r 116d1649401e sys/dev/usb/hid.c
--- a/sys/dev/usb/hid.c Sat Jan 02 20:49:39 2016 +0000
+++ b/sys/dev/usb/hid.c Sat Jan 02 20:57:10 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: hid.c,v 1.38 2016/01/02 20:49:39 jakllsch Exp $ */
+/* $NetBSD: hid.c,v 1.39 2016/01/02 20:57:10 jakllsch Exp $ */
/* $FreeBSD: src/sys/dev/usb/hid.c,v 1.11 1999/11/17 22:33:39 n_hibma Exp $ */
/*
@@ -32,7 +32,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: hid.c,v 1.38 2016/01/02 20:49:39 jakllsch Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hid.c,v 1.39 2016/01/02 20:57:10 jakllsch Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -171,17 +171,19 @@
dval = 0;
break;
case 1:
- dval = /*(int8_t)*/ *data++;
+ dval = (int8_t)*data++;
break;
case 2:
dval = *data++;
dval |= *data++ << 8;
+ dval = (int16_t)dval;
break;
case 4:
dval = *data++;
dval |= *data++ << 8;
dval |= *data++ << 16;
dval |= *data++ << 24;
+ dval = (int32_t)dval;
break;
default:
printf("BAD LENGTH %d\n", bSize);
Home |
Main Index |
Thread Index |
Old Index