summaryrefslogtreecommitdiff
path: root/src/ext
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2018-01-03 08:59:59 -0500
committerNick Mathewson <nickm@torproject.org>2018-01-03 08:59:59 -0500
commitc1d98c75e305eaf63e81903ca5a4eb68dcae515b (patch)
tree7e96fd981897b84f8f549de8b36844ff07958d68 /src/ext
parentfb5877b9721dcc0d140c2c7c8d16d0b656bbf5d7 (diff)
parentbbc9ff160e7071b7a2fa9ab200b6496580975b06 (diff)
downloadtor-c1d98c75e305eaf63e81903ca5a4eb68dcae515b.tar.gz
tor-c1d98c75e305eaf63e81903ca5a4eb68dcae515b.zip
Merge branch 'maint-0.3.0' into maint-0.3.1
Diffstat (limited to 'src/ext')
-rw-r--r--src/ext/timeouts/timeout-bitops.c4
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)