From 94a357482be6b104fb282fc1efc11976e9877287 Mon Sep 17 00:00:00 2001 From: Kim Woelders Date: Wed, 16 Mar 2016 19:54:34 +0100 Subject: [PATCH] Fix "assuming signed overflow does not occur" warning. --- src/lib/updates.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/lib/updates.c b/src/lib/updates.c index 8d31433..8167284 100644 --- a/src/lib/updates.c +++ b/src/lib/updates.c @@ -109,26 +109,27 @@ __imlib_MergeUpdate(ImlibUpdate * u, int w, int h, int hgapmax) { if (T(x, y).used & T_USED) { - int xx, yy, ww, hh, ok; + int xx, yy, ww, hh, ok, xww; for (xx = x + 1, ww = 1; (T(xx, y).used & T_USED) && (xx < tw); xx++, ww++); + xww = x + ww; for (yy = y + 1, hh = 1, ok = 1; (yy < th) && (ok); yy++, hh++) { - for (xx = x; xx < (x + ww); xx++) + for (xx = x; xx < xww; xx++) { if (!(T(xx, yy).used & T_USED)) { ok = 0; - xx = x + ww; hh--; + break; } } } for (yy = y; yy < (y + hh); yy++) { - for (xx = x; xx < (x + ww); xx++) + for (xx = x; xx < xww; xx++) T(xx, yy).used = T_UNUSED; } nu = __imlib_AddUpdate(nu, (x << TB), (y << TB),