diff options
author | Nick Mathewson <nickm@torproject.org> | 2018-01-03 09:00:00 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2018-01-03 09:00:00 -0500 |
commit | 451c852a0f75fe9ac6935851e763a948c1c5b197 (patch) | |
tree | 5150cf06fdd052b3d7146caa65679ffde0e1214c /src/ext | |
parent | 2aa1767b25e6b2b04892696c4c00e0257feb3812 (diff) | |
parent | c1d98c75e305eaf63e81903ca5a4eb68dcae515b (diff) | |
download | tor-451c852a0f75fe9ac6935851e763a948c1c5b197.tar.gz tor-451c852a0f75fe9ac6935851e763a948c1c5b197.zip |
Merge branch 'maint-0.3.1' into maint-0.3.2
Diffstat (limited to 'src/ext')
-rw-r--r-- | src/ext/timeouts/timeout-bitops.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/ext/timeouts/timeout-bitops.c b/src/ext/timeouts/timeout-bitops.c index e99af8f9c4..68db817933 100644 --- a/src/ext/timeouts/timeout-bitops.c +++ b/src/ext/timeouts/timeout-bitops.c @@ -40,7 +40,7 @@ static __inline int clz32(unsigned long val) { DWORD zeros = 0; _BitScanReverse(&zeros, val); - return zeros; + return 31 - zeros; } #ifdef _WIN64 /* According to the documentation, these only exist on Win64. */ @@ -54,7 +54,7 @@ static __inline int clz64(uint64_t val) { DWORD zeros = 0; _BitScanReverse64(&zeros, val); - return zeros; + return 63 - zeros; } #else static __inline int ctz64(uint64_t val) |