Welcome to little lamb

Code » limb » commit 2be693b

mkrabintables: Fix some bitshifts

author Olivier Brunel
2023-02-22 07:41:31 UTC
committer Olivier Brunel
2023-02-22 07:41:31 UTC
parent 30b1210502d69621fc6e50ef78f7ca2a8acd75b0

mkrabintables: Fix some bitshifts

src/tools/mkrabintables.c +3 -3

diff --git a/src/tools/mkrabintables.c b/src/tools/mkrabintables.c
index 6812b8c..a09fa07 100644
--- a/src/tools/mkrabintables.c
+++ b/src/tools/mkrabintables.c
@@ -31,7 +31,7 @@ polymod(u64 nh, u64 nl, u64 d)
             }
     }
     for (i = 63; i >= k; --i)
-        if (nl & 1LL << i)
+        if (nl & 1ULL << i)
             nl ^= d >> (63 - i);
     return nl;
 }
@@ -43,7 +43,7 @@ polymmult(u64 x, u64 y, u64 d)
     if (x & 1)
         l = y;
     for (int i = 1; i < 64; ++i)
-        if (x & (1LL << i)) {
+        if (x & (1ULL << i)) {
             h ^= y >> (64 - i);
             l ^= y << i;
         }
@@ -56,7 +56,7 @@ init_tables(struct rabin *r)
     int i;
     int xshift = msb64(RABIN_FINGERPRINT) - 1;
 
-    u64 T1 = polymod(0, 1LL << xshift, RABIN_FINGERPRINT);
+    u64 T1 = polymod(0, 1ULL << xshift, RABIN_FINGERPRINT);
     for (i = 0; i < 256; ++i) {
         r->T[i] = polymmult(i, T1, RABIN_FINGERPRINT) | ((u64) i << xshift);
     }