summaryrefslogtreecommitdiff
path: root/sys/dev/adb
diff options
context:
space:
mode:
authorchristos <christos@NetBSD.org>2011-08-18 02:18:40 +0000
committerchristos <christos@NetBSD.org>2011-08-18 02:18:40 +0000
commit0d2b8be669f83db1daebe20b044a540c4b0496e2 (patch)
treef2ff33ef5fd00589746d08690a541d6d9171ac4f /sys/dev/adb
parent3e0a2e777701917a16883a830ca71e10c78b9f42 (diff)
Fix gcc-4.5 warnings. If you still see them, e-mail them to me.
Diffstat (limited to 'sys/dev/adb')
-rw-r--r--sys/dev/adb/adb_kbd.c8
-rw-r--r--sys/dev/adb/adb_ms.c26
2 files changed, 18 insertions, 16 deletions
diff --git a/sys/dev/adb/adb_kbd.c b/sys/dev/adb/adb_kbd.c
index 1d5ab17d0b1..28bcefb0012 100644
--- a/sys/dev/adb/adb_kbd.c
+++ b/sys/dev/adb/adb_kbd.c
@@ -1,4 +1,4 @@
-/* $NetBSD: adb_kbd.c,v 1.14 2011/07/28 16:28:12 macallan Exp $ */
+/* $NetBSD: adb_kbd.c,v 1.15 2011/08/18 02:18:40 christos Exp $ */
/*
* Copyright (C) 1998 Colin Wood
@@ -32,7 +32,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: adb_kbd.c,v 1.14 2011/07/28 16:28:12 macallan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: adb_kbd.c,v 1.15 2011/08/18 02:18:40 christos Exp $");
#include <sys/param.h>
#include <sys/device.h>
@@ -667,14 +667,14 @@ adbkbd_setup_sysctl(struct adbkbd_softc *sc)
CTL_MACHDEP, CTL_CREATE, CTL_EOL);
ret = sysctl_createv(NULL, 0, NULL,
- (const struct sysctlnode **)&node,
+ (void *)&node,
CTLFLAG_READWRITE | CTLFLAG_OWNDESC,
CTLTYPE_INT, "middle", "middle mouse button", adbkbd_sysctl_mid,
1, sc, 0, CTL_MACHDEP, me->sysctl_num, CTL_CREATE,
CTL_EOL);
ret = sysctl_createv(NULL, 0, NULL,
- (const struct sysctlnode **)&node,
+ (void *)&node,
CTLFLAG_READWRITE | CTLFLAG_OWNDESC,
CTLTYPE_INT, "right", "right mouse button", adbkbd_sysctl_right,
2, sc, 0, CTL_MACHDEP, me->sysctl_num, CTL_CREATE,
diff --git a/sys/dev/adb/adb_ms.c b/sys/dev/adb/adb_ms.c
index b607f7c5c09..ea7ca77bfea 100644
--- a/sys/dev/adb/adb_ms.c
+++ b/sys/dev/adb/adb_ms.c
@@ -1,4 +1,4 @@
-/* $NetBSD: adb_ms.c,v 1.11 2011/08/01 12:28:53 mbalmer Exp $ */
+/* $NetBSD: adb_ms.c,v 1.12 2011/08/18 02:18:40 christos Exp $ */
/*
* Copyright (C) 1998 Colin Wood
@@ -32,7 +32,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: adb_ms.c,v 1.11 2011/08/01 12:28:53 mbalmer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: adb_ms.c,v 1.12 2011/08/18 02:18:40 christos Exp $");
#include <sys/param.h>
#include <sys/device.h>
@@ -179,17 +179,17 @@ adbms_attach(device_t parent, device_t self, void *aux)
/* print out the type of mouse we have */
switch (sc->sc_adbdev->handler_id) {
case ADBMS_100DPI:
- printf("%d-button, %d dpi mouse\n", sc->sc_buttons,
- (int)(sc->sc_res));
+ printf("%d-button, %u dpi mouse\n", sc->sc_buttons,
+ sc->sc_res);
break;
case ADBMS_200DPI:
sc->sc_res = 200;
- printf("%d-button, %d dpi mouse\n", sc->sc_buttons,
- (int)(sc->sc_res));
+ printf("%d-button, %u dpi mouse\n", sc->sc_buttons,
+ sc->sc_res);
break;
case ADBMS_MSA3:
- printf("Mouse Systems A3 mouse, %d-button, %d dpi\n",
- sc->sc_buttons, (int)(sc->sc_res));
+ printf("Mouse Systems A3 mouse, %d-button, %u dpi\n",
+ sc->sc_buttons, sc->sc_res);
break;
case ADBMS_USPEED:
printf("MicroSpeed mouse, default parameters\n");
@@ -235,8 +235,8 @@ adbms_attach(device_t parent, device_t self, void *aux)
printf("unknown device");
break;
}
- printf(" <%s> %d-button, %d dpi\n", sc->sc_devid,
- sc->sc_buttons, (int)(sc->sc_res));
+ printf(" <%s> %d-button, %u dpi\n", sc->sc_devid,
+ sc->sc_buttons, sc->sc_res);
}
break;
default:
@@ -390,6 +390,7 @@ adbms_init_mouse(struct adbms_softc *sc)
memcpy(buffer, sc->sc_buffer, len);
if (sc->sc_msg_len == 8) {
+ uint16_t res;
/* we have a true EMP device */
#ifdef ADB_PRINT_EMP
@@ -397,10 +398,11 @@ adbms_init_mouse(struct adbms_softc *sc)
buffer[0], buffer[1], buffer[2], buffer[3],
buffer[4], buffer[5], buffer[6], buffer[7]);
#endif
+ memcpy(sc->sc_devid, &buffer[0], 4);
+ memcpy(&res, &buffer[4], sizeof(res));
+ sc->sc_res = res;
sc->sc_class = buffer[6];
sc->sc_buttons = buffer[7];
- sc->sc_res = (int)*(short *)&buffer[4];
- memcpy(sc->sc_devid, &(buffer[0]), 4);
} else if (buffer[0] == 0x9a &&
((buffer[1] == 0x20) || (buffer[1] == 0x21))) {
/*