[HarfBuzz] harfbuzz: Branch 'bitops'

Behdad Esfahbod behdad at kemper.freedesktop.org
Sat Feb 17 02:20:28 UTC 2018


 src/hb-private.hh |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

New commits:
commit 4e517ecb6b7c27d4053a6476bb9262858e2567ed
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Fri Feb 16 18:20:12 2018 -0800

    Another bitops fallback impl fix

diff --git a/src/hb-private.hh b/src/hb-private.hh
index c9e5a5ca..8461f641 100644
--- a/src/hb-private.hh
+++ b/src/hb-private.hh
@@ -402,28 +402,28 @@ _hb_bit_storage (T v)
     /* "bithacks" */
     const unsigned int b[] = {0x2, 0xC, 0xF0, 0xFF00, 0xFFFF0000};
     const unsigned int S[] = {1, 2, 4, 8, 16};
-    unsigned int r = 1;
+    unsigned int r = 0;
     for (int i = 4; i >= 0; i--)
       if (v & b[i])
       {
 	v >>= S[i];
 	r |= S[i];
       }
-    return r;
+    return r + 1;
   }
   if (sizeof (T) <= 8)
   {
     /* "bithacks" */
     const uint64_t b[] = {0x2, 0xC, 0xF0, 0xFF00, 0xFFFF0000, 0xFFFFFFFF00000000};
     const unsigned int S[] = {1, 2, 4, 8, 16, 32};
-    unsigned int r = 1;
+    unsigned int r = 0;
     for (int i = 5; i >= 0; i--)
       if (v & b[i])
       {
 	v >>= S[i];
 	r |= S[i];
       }
-    return r;
+    return r + 1;
   }
   if (sizeof (T) == 16)
   {


More information about the HarfBuzz mailing list