cedric pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=3fadc0d5affd866d66b25b1a67c15a9a9db9474a

commit 3fadc0d5affd866d66b25b1a67c15a9a9db9474a
Author: Cedric BAIL <ced...@osg.samsung.com>
Date:   Mon Jun 5 12:00:13 2017 -0700

    draw: silence warning in a tricky loop/switch statement.
---
 src/static_libs/draw/draw.h | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/src/static_libs/draw/draw.h b/src/static_libs/draw/draw.h
index f25f66d97c..e4f64340f4 100644
--- a/src/static_libs/draw/draw.h
+++ b/src/static_libs/draw/draw.h
@@ -98,16 +98,26 @@ draw_memset32(uint32_t *dest, uint32_t value, int length)
    if (length <= 0)
      return;
 
+   // Cute hack to align future memcopy operation
+   // and do unroll the loop a bit. Not sure it is
+   // the most efficient, but will do for now.
    n = (length + 7) / 8;
    switch (length & 0x07)
      {
         case 0: do { *dest++ = value;
+           EINA_FALLTHROUGH;
         case 7:      *dest++ = value;
+           EINA_FALLTHROUGH;
         case 6:      *dest++ = value;
+           EINA_FALLTHROUGH;
         case 5:      *dest++ = value;
+           EINA_FALLTHROUGH;
         case 4:      *dest++ = value;
+           EINA_FALLTHROUGH;
         case 3:      *dest++ = value;
+           EINA_FALLTHROUGH;
         case 2:      *dest++ = value;
+           EINA_FALLTHROUGH;
         case 1:      *dest++ = value;
         } while (--n > 0);
      }

-- 


Reply via email to