summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilip Guenther <guenther@cvs.openbsd.org>2016-02-10 05:49:51 +0000
committerPhilip Guenther <guenther@cvs.openbsd.org>2016-02-10 05:49:51 +0000
commit7150eb3de381ea36cb360b8972c9ef81b143c268 (patch)
treed2b41f773c1a23cc852a8f54ee5e8e07edfed433
parent2552db1a3d486f404a30f2dc9bb1dd95fd3d0e63 (diff)
Permit negative x and y coordinates in mouse.scale for uts and ums.
Needed by some touchscreens. no objection matthieu@
-rw-r--r--sbin/wsconsctl/util.c16
-rw-r--r--sys/dev/hid/hidms.c6
-rw-r--r--sys/dev/usb/uts.c6
3 files changed, 14 insertions, 14 deletions
diff --git a/sbin/wsconsctl/util.c b/sbin/wsconsctl/util.c
index 5d4eb531418..0e505f2f656 100644
--- a/sbin/wsconsctl/util.c
+++ b/sbin/wsconsctl/util.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: util.c,v 1.62 2013/11/17 13:41:26 kettenis Exp $ */
+/* $OpenBSD: util.c,v 1.63 2016/02/10 05:49:50 guenther Exp $ */
/* $NetBSD: util.c,v 1.8 2000/03/14 08:11:53 sato Exp $ */
/*-
@@ -419,37 +419,37 @@ rd_field(struct field *f, char *val, int merge)
val = (void *)strtok(val, ",");
if (val != NULL) {
wmcoords.minx = (int)strtonum(val,
- 0, 32768, &errstr);
+ -32768, 32767, &errstr);
val = (void *)strtok(NULL, ",");
}
if (!errstr && val != NULL) {
wmcoords.maxx = (int)strtonum(val,
- 0, 32768, &errstr);
+ -32768, 32767, &errstr);
val = (void *)strtok(NULL, ",");
}
if (!errstr && val != NULL) {
wmcoords.miny = (int)strtonum(val,
- 0, 32768, &errstr);
+ -32768, 32767, &errstr);
val = (void *)strtok(NULL, ",");
}
if (!errstr && val != NULL) {
wmcoords.maxy = (int)strtonum(val,
- 0, 32768, &errstr);
+ -32768, 32767, &errstr);
val = (void *)strtok(NULL, ",");
}
if (!errstr && val != NULL) {
wmcoords.swapxy = (int)strtonum(val,
- 0, 32768, &errstr);
+ -32768, 32767, &errstr);
val = (void *)strtok(NULL, ",");
}
if (!errstr && val != NULL) {
wmcoords.resx = (int)strtonum(val,
- 0, 32768, &errstr);
+ 0, 32767, &errstr);
val = (void *)strtok(NULL, ",");
}
if (!errstr && val != NULL) {
wmcoords.resy = (int)strtonum(val,
- 0, 32768, &errstr);
+ 0, 32767, &errstr);
val = (void *)strtok(NULL, ",");
}
if (errstr)
diff --git a/sys/dev/hid/hidms.c b/sys/dev/hid/hidms.c
index e52c3cb7622..bc9b39d4fc8 100644
--- a/sys/dev/hid/hidms.c
+++ b/sys/dev/hid/hidms.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: hidms.c,v 1.1 2016/01/08 15:54:13 jcs Exp $ */
+/* $OpenBSD: hidms.c,v 1.2 2016/02/10 05:49:50 guenther Exp $ */
/* $NetBSD: ums.c,v 1.60 2003/03/11 16:44:00 augustss Exp $ */
/*
@@ -429,8 +429,8 @@ hidms_ioctl(struct hidms *ms, u_long cmd, caddr_t data, int flag,
switch (cmd) {
case WSMOUSEIO_SCALIBCOORDS:
- if (!(wsmc->minx >= 0 && wsmc->maxx >= 0 &&
- wsmc->miny >= 0 && wsmc->maxy >= 0 &&
+ if (!(wsmc->minx >= -32768 && wsmc->maxx >= -32768 &&
+ wsmc->miny >= -32768 && wsmc->maxy >= -32768 &&
wsmc->resx >= 0 && wsmc->resy >= 0 &&
wsmc->minx < 32768 && wsmc->maxx < 32768 &&
wsmc->miny < 32768 && wsmc->maxy < 32768 &&
diff --git a/sys/dev/usb/uts.c b/sys/dev/usb/uts.c
index 0c83fe7189a..cc13d844f33 100644
--- a/sys/dev/usb/uts.c
+++ b/sys/dev/usb/uts.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uts.c,v 1.36 2015/03/14 03:38:50 jsg Exp $ */
+/* $OpenBSD: uts.c,v 1.37 2016/02/10 05:49:50 guenther Exp $ */
/*
* Copyright (c) 2007 Robert Nagy <robert@openbsd.org>
@@ -325,8 +325,8 @@ uts_ioctl(void *v, u_long cmd, caddr_t data, int flag, struct proc *l)
switch (cmd) {
case WSMOUSEIO_SCALIBCOORDS:
- if (!(wsmc->minx >= 0 && wsmc->maxx >= 0 &&
- wsmc->miny >= 0 && wsmc->maxy >= 0 &&
+ if (!(wsmc->minx >= -32768 && wsmc->maxx >= 0 &&
+ wsmc->miny >= -32768 && wsmc->maxy >= 0 &&
wsmc->resx >= 0 && wsmc->resy >= 0 &&
wsmc->minx < 32768 && wsmc->maxx < 32768 &&
wsmc->miny < 32768 && wsmc->maxy < 32768 &&