]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Fixup timing wheel warnings related to recent WHEEL_BIT change.
authorNick Mathewson <nickm@torproject.org>
Tue, 17 Apr 2018 16:45:53 +0000 (12:45 -0400)
committerNick Mathewson <nickm@torproject.org>
Tue, 17 Apr 2018 16:45:53 +0000 (12:45 -0400)
src/ext/timeouts/timeout.c

index 713ec219ce2a7bf022f27c37082bd5314c6e6757..d4b514d2c5fd71e6b84fe3dca0c6c2bd3c850629 100644 (file)
 #else
 #define ctz(n) ctz32(n)
 #define clz(n) clz32(n)
-#define fls(n) ((int)(32 - clz32(n)))
+#define fls(n) ((int)(32 - clz32((uint32_t)n)))
 #endif
 
 #if WHEEL_BIT == 6
@@ -432,7 +432,7 @@ TIMEOUT_PUBLIC void timeouts_update(struct timeouts *T, abstime_t curtime) {
                         * or can be replaced with a simpler operation.
                         */
                        oslot = WHEEL_MASK & (T->curtime >> (wheel * WHEEL_BIT));
-                       pending = rotl(((UINT64_C(1) << _elapsed) - 1), oslot);
+                       pending = rotl(((WHEEL_C(1) << _elapsed) - 1), oslot);
 
                        nslot = WHEEL_MASK & (curtime >> (wheel * WHEEL_BIT));
                        pending |= rotr(rotl(((WHEEL_C(1) << _elapsed) - 1), nslot), (int)_elapsed);