kwo pushed a commit to branch master.

http://git.enlightenment.org/legacy/imlib2.git/commit/?id=94a357482be6b104fb282fc1efc11976e9877287

commit 94a357482be6b104fb282fc1efc11976e9877287
Author: Kim Woelders <k...@woelders.dk>
Date:   Wed Mar 16 19:54:34 2016 +0100

    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),

-- 


Reply via email to