From 0a3c36fcd9d98d2e209a5a47b476a40ff71d54ff Mon Sep 17 00:00:00 2001 From: speedie Date: Sat, 1 Apr 2023 15:03:42 +0200 Subject: [PATCH] make GCC a bit happier --- libs/draw.c | 2 +- libs/img-c.c | 12 ++++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/libs/draw.c b/libs/draw.c index d414489..2509d22 100644 --- a/libs/draw.c +++ b/libs/draw.c @@ -377,7 +377,7 @@ drawmenu(void) // why have an empty line? if ((hideprompt && hideinput && hidemode && hidematchcount #if USEIMAGE - ) && !image || hideimage) { + ) && (!image || hideimage)) { #else )) { #endif diff --git a/libs/img-c.c b/libs/img-c.c index 2ab101f..f6859e1 100644 --- a/libs/img-c.c +++ b/libs/img-c.c @@ -345,19 +345,23 @@ resizetoimageheight(int imageheight) lines = reallines; int wtr = 0; - if (lines * bh < imageheight + imagegaps * 2) + if (lines * bh < imageheight + imagegaps * 2) { lines = (imageheight + imagegaps * 2) / bh; + } - if (hideprompt && hideinput && hidemode && hidematchcount) + if (hideprompt && hideinput && hidemode && hidematchcount) { wtr = bh; + } mh = MAX((lines + 1) * bh, ((lines + 1) * bh) - wtr); - if (mh - bh < imageheight + imagegaps * 2) + if (mh - bh < imageheight + imagegaps * 2) { mh = (imageheight + imagegaps * 2 + bh) - wtr; + } - if (!win || omh == mh) + if (!win || omh == mh) { return; + } XResizeWindow(dpy, win, mw, mh); drw_resize(drw, mw, mh);