Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/wscons don't forget to store bounds rectangle in raw...



details:   https://anonhg.NetBSD.org/src/rev/b631aea427e9
branches:  trunk
changeset: 352538:b631aea427e9
user:      macallan <macallan%NetBSD.org@localhost>
date:      Thu Apr 06 20:44:39 2017 +0000

description:
don't forget to store bounds rectangle in raw mode

diffstat:

 sys/dev/wscons/tpcalib.c |  34 ++++++++++++++++++----------------
 1 files changed, 18 insertions(+), 16 deletions(-)

diffs (63 lines):

diff -r 3f886bb2b08b -r b631aea427e9 sys/dev/wscons/tpcalib.c
--- a/sys/dev/wscons/tpcalib.c  Thu Apr 06 20:06:44 2017 +0000
+++ b/sys/dev/wscons/tpcalib.c  Thu Apr 06 20:44:39 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: tpcalib.c,v 1.11 2007/03/04 06:02:51 christos Exp $    */
+/*     $NetBSD: tpcalib.c,v 1.12 2017/04/06 20:44:39 macallan Exp $    */
 
 /*
  * Copyright (c) 1999-2003 TAKEMURA Shin All rights reserved.
@@ -28,7 +28,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: tpcalib.c,v 1.11 2007/03/04 06:02:51 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tpcalib.c,v 1.12 2017/04/06 20:44:39 macallan Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_tpcalib.h"
@@ -101,7 +101,8 @@
                d = (const struct wsmouse_calibcoords *)data;
                if (d->samplelen == WSMOUSE_CALIBCOORDS_RESET) {
                        tpcalib_reset(sc);
-               } else
+               } 
+               if (d->samplelen > 0) {
                        if (mra_Y_AX1_BX2_C(&d->samples[0].x, s,
                                    &d->samples[0].rawx, s,
                                    &d->samples[0].rawy, s,
@@ -116,20 +117,21 @@
                                tpcalib_reset(sc);
 
                                return (EINVAL);
-                       } else {
-                               sc->sc_minx = d->minx;
-                               sc->sc_maxx = d->maxx;
-                               sc->sc_miny = d->miny;
-                               sc->sc_maxy = d->maxy;
-                               sc->sc_saved = *d;
-                               DPRINTF(("tpcalib: x=%d~%d y=%d~%d\n",
-                                   sc->sc_minx, sc->sc_maxx,
-                                   sc->sc_miny, sc->sc_maxy));
-                               DPRINTF(("tpcalib: Ax=%d Bx=%d Cx=%d\n",
-                                   sc->sc_ax, sc->sc_bx, sc->sc_cx));
-                               DPRINTF(("tpcalib: Ay=%d By=%d Cy=%d\n",
-                                   sc->sc_ay, sc->sc_by, sc->sc_cy));
                        }
+               }
+               sc->sc_minx = d->minx;
+               sc->sc_maxx = d->maxx;
+               sc->sc_miny = d->miny;
+               sc->sc_maxy = d->maxy;
+               sc->sc_saved = *d;
+               DPRINTF(("tpcalib: x=%d~%d y=%d~%d\n",
+                   sc->sc_minx, sc->sc_maxx,
+                   sc->sc_miny, sc->sc_maxy));
+               DPRINTF(("tpcalib: Ax=%d Bx=%d Cx=%d\n",
+                   sc->sc_ax, sc->sc_bx, sc->sc_cx));
+               DPRINTF(("tpcalib: Ay=%d By=%d Cy=%d\n",
+                   sc->sc_ay, sc->sc_by, sc->sc_cy));
+               
                break;
 
        case WSMOUSEIO_GCALIBCOORDS:



Home | Main Index | Thread Index | Old Index