diff options
author | Nick Mathewson <nickm@torproject.org> | 2018-01-03 08:59:52 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2018-01-03 08:59:52 -0500 |
commit | c9b3f6352f68a03b5380db0e459a8cd6407c5603 (patch) | |
tree | 32ccc6fe7ac503fb1fa1863779993b12a40b3bdf /src | |
parent | 6e5e4f92ab8f63dfaed00a3dfeab7222c3e153a3 (diff) | |
parent | accd0ea65bb817ad8f2361c5ca06c40ac9a9a11f (diff) | |
download | tor-c9b3f6352f68a03b5380db0e459a8cd6407c5603.tar.gz tor-c9b3f6352f68a03b5380db0e459a8cd6407c5603.zip |
Merge branch 'bug24633_029' into maint-0.2.9
Diffstat (limited to 'src')
-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 a018f33b95..45466f6cb3 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) |