From fcfaf2a844432a6bd01147ff58ac7197a00999cb Mon Sep 17 00:00:00 2001 From: Frank Fischer Date: Thu, 12 Feb 2015 12:47:58 +0100 Subject: [PATCH] fix conditions for int size in 'math.nextPowerOfTwo' #2110 --- lib/pure/math.nim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/pure/math.nim b/lib/pure/math.nim index b9e057e781..62ea1f7560 100644 --- a/lib/pure/math.nim +++ b/lib/pure/math.nim @@ -93,9 +93,9 @@ proc nextPowerOfTwo*(x: int): int {.noSideEffect.} = result = x - 1 when defined(cpu64): result = result or (result shr 32) - when sizeof(int) > 16: + when sizeof(int) > 2: result = result or (result shr 16) - when sizeof(int) > 8: + when sizeof(int) > 1: result = result or (result shr 8) result = result or (result shr 4) result = result or (result shr 2)