summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorOkan Demirmen <okan@cvs.openbsd.org>2017-04-26 21:10:55 +0000
committerOkan Demirmen <okan@cvs.openbsd.org>2017-04-26 21:10:55 +0000
commit027f7ec92b62991c6307abb32aeb141d2b078f75 (patch)
tree27c857f24a400a13a571b8a082591f0ec582c49b /app
parent0a44bdc49a532c93b21718d3883d7da59e334740 (diff)
Switch bwidth type; unfortunately X11 is inconsistent.
Diffstat (limited to 'app')
-rw-r--r--app/cwm/calmwm.h4
-rw-r--r--app/cwm/client.c12
-rw-r--r--app/cwm/parse.y4
3 files changed, 10 insertions, 10 deletions
diff --git a/app/cwm/calmwm.h b/app/cwm/calmwm.h
index d86408e4c..10e74737e 100644
--- a/app/cwm/calmwm.h
+++ b/app/cwm/calmwm.h
@@ -15,7 +15,7 @@
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
- * $OpenBSD: calmwm.h,v 1.336 2016/12/06 21:54:10 okan Exp $
+ * $OpenBSD: calmwm.h,v 1.337 2017/04/26 21:10:54 okan Exp $
*/
#ifndef _CALMWM_H_
@@ -119,7 +119,7 @@ struct client_ctx {
struct group_ctx *gc;
Window win;
Colormap colormap;
- unsigned int bwidth; /* border width */
+ int bwidth; /* border width */
struct geom geom, savegeom, fullgeom;
struct {
long flags; /* defined hints */
diff --git a/app/cwm/client.c b/app/cwm/client.c
index 4065041bb..e4d264440 100644
--- a/app/cwm/client.c
+++ b/app/cwm/client.c
@@ -15,7 +15,7 @@
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
- * $OpenBSD: client.c,v 1.237 2017/04/24 13:31:19 okan Exp $
+ * $OpenBSD: client.c,v 1.238 2017/04/26 21:10:54 okan Exp $
*/
#include <sys/types.h>
@@ -545,7 +545,7 @@ client_draw_border(struct client_ctx *cc)
if (cc->flags & CLIENT_URGENCY)
pixel = sc->xftcolor[CWM_COLOR_BORDER_URGENCY].pixel;
- XSetWindowBorderWidth(X_Dpy, cc->win, cc->bwidth);
+ XSetWindowBorderWidth(X_Dpy, cc->win, (unsigned int)cc->bwidth);
XSetWindowBorder(X_Dpy, cc->win, pixel);
}
@@ -743,13 +743,13 @@ client_placecalc(struct client_ctx *cc)
wmax = DisplayWidth(X_Dpy, sc->which);
hmax = DisplayHeight(X_Dpy, sc->which);
- if (cc->geom.x + ((int)cc->bwidth * 2) >= wmax)
+ if (cc->geom.x + (cc->bwidth * 2) >= wmax)
cc->geom.x = wmax - (cc->bwidth * 2);
- if (cc->geom.x + cc->geom.w - ((int)cc->bwidth * 2) < 0)
+ if (cc->geom.x + cc->geom.w - (cc->bwidth * 2) < 0)
cc->geom.x = -cc->geom.w;
- if (cc->geom.y + ((int)cc->bwidth * 2) >= hmax)
+ if (cc->geom.y + (cc->bwidth * 2) >= hmax)
cc->geom.y = hmax - (cc->bwidth * 2);
- if (cc->geom.y + cc->geom.h - ((int)cc->bwidth * 2) < 0)
+ if (cc->geom.y + cc->geom.h - (cc->bwidth * 2) < 0)
cc->geom.y = -cc->geom.h;
} else {
struct geom area;
diff --git a/app/cwm/parse.y b/app/cwm/parse.y
index 65db97bd8..e7eaf182e 100644
--- a/app/cwm/parse.y
+++ b/app/cwm/parse.y
@@ -1,4 +1,4 @@
-/* $OpenBSD: parse.y,v 1.67 2016/12/01 17:17:27 okan Exp $ */
+/* $OpenBSD: parse.y,v 1.68 2017/04/26 21:10:54 okan Exp $ */
/*
* Copyright (c) 2002, 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -116,7 +116,7 @@ main : FONTNAME STRING {
conf->stickygroups = $2;
}
| BORDERWIDTH NUMBER {
- if ($2 < 0 || $2 > UINT_MAX) {
+ if ($2 < 0 || $2 > INT_MAX) {
yyerror("invalid borderwidth");
YYERROR;
}