]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Fix an OSX/clang compilation warning
authorNick Mathewson <nickm@torproject.org>
Fri, 15 Apr 2016 00:13:34 +0000 (20:13 -0400)
committerNick Mathewson <nickm@torproject.org>
Mon, 9 May 2016 18:04:54 +0000 (14:04 -0400)
src/ext/timeouts/timeout.c

index dbc24fa00aa10a68582d4471882d8f736e5b24d2..f528576ffb1da49b7327cf88236f95d4f1fc91ee 100644 (file)
@@ -300,7 +300,7 @@ TIMEOUT_PUBLIC void timeouts_del(struct timeouts *T, struct timeout *to) {
 
                if (to->pending != &T->expired && TAILQ_EMPTY(to->pending)) {
                        ptrdiff_t index = to->pending - &T->wheel[0][0];
-                       int wheel = index / WHEEL_LEN;
+                       int wheel = (int) (index / WHEEL_LEN);
                        int slot = index % WHEEL_LEN;
 
                        T->pending[wheel] &= ~(WHEEL_C(1) << slot);
@@ -435,7 +435,7 @@ TIMEOUT_PUBLIC void timeouts_update(struct timeouts *T, abstime_t curtime) {
                        pending = rotl(((UINT64_C(1) << _elapsed) - 1), oslot);
 
                        nslot = WHEEL_MASK & (curtime >> (wheel * WHEEL_BIT));
-                       pending |= rotr(rotl(((WHEEL_C(1) << _elapsed) - 1), nslot), _elapsed);
+                       pending |= rotr(rotl(((WHEEL_C(1) << _elapsed) - 1), nslot), (int)_elapsed);
                        pending |= WHEEL_C(1) << nslot;
                }