From 1fb05957ed1454c6aa97d862f3cafc5721d7e473 Mon Sep 17 00:00:00 2001 From: zachir Date: Wed, 26 Jan 2022 23:58:58 -0600 Subject: dmenu.c: fix warning about INTERSECT with bool vs int --- dmenu.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dmenu.c b/dmenu.c index 3240aee..0f4d6b4 100644 --- a/dmenu.c +++ b/dmenu.c @@ -23,6 +23,8 @@ /* macros */ #define INTERSECT(x,y,w,h,r) (MAX(0, MIN((x)+(w),(r).x_org+(r).width) - MAX((x),(r).x_org)) \ * MAX(0, MIN((y)+(h),(r).y_org+(r).height) - MAX((y),(r).y_org))) +#define INTERSECTBOOL(x,y,w,h,r) (MAX(0, MIN((x)+(w),(r).x_org+(r).width) - MAX((x),(r).x_org)) \ + && MAX(0, MIN((y)+(h),(r).y_org+(r).height) - MAX((y),(r).y_org))) #define LENGTH(X) (sizeof X / sizeof X[0]) #define TEXTW(X) (drw_fontset_getwidth(drw, (X)) + lrpad) @@ -1052,7 +1054,7 @@ setup(void) /* no focused window is on screen, so use pointer location instead */ if (mon < 0 && !area && XQueryPointer(dpy, root, &dw, &dw, &x, &y, &di, &di, &du)) for (i = 0; i < n; i++) - if (INTERSECT(x, y, 1, 1, info[i])) + if (INTERSECTBOOL(x, y, 1, 1, info[i])) break; if (centered) { -- cgit v1.2.3