From: mpi Date: Wed, 7 Jan 2015 10:32:13 +0000 (+0000) Subject: Only MS IntelliMouse have a Z axis, prevent a false positive triggered X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=8f1a9338a92ed5243c71abdcaf910bea0d2be8a0;p=openbsd Only MS IntelliMouse have a Z axis, prevent a false positive triggered by -Wuninitialized reported by jsg@. ok stsp@ --- diff --git a/sys/dev/pckbc/pms.c b/sys/dev/pckbc/pms.c index 79a5404443f..7b8a3b67576 100644 --- a/sys/dev/pckbc/pms.c +++ b/sys/dev/pckbc/pms.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pms.c,v 1.54 2014/08/29 20:09:09 shadchin Exp $ */ +/* $OpenBSD: pms.c,v 1.55 2015/01/07 10:32:13 mpi Exp $ */ /* $NetBSD: psm.c,v 1.11 2000/06/05 22:20:57 sommerfeld Exp $ */ /*- @@ -614,14 +614,10 @@ pms_proc_mouse(struct pms_softc *sc) dy = (sc->packet[0] & PMS_PS2_YNEG) ? (int)sc->packet[2] - 256 : sc->packet[2]; - switch (sc->protocol->type) { - case PMS_STANDARD: - dz = 0; - break; - case PMS_INTELLI: + if (sc->protocol->type == PMS_INTELLI) dz = (signed char)sc->packet[3]; - break; - } + else + dz = 0; wsmouse_input(sc->sc_wsmousedev, buttons, dx, dy, dz, 0, WSMOUSE_INPUT_DELTA);