more fixes for --cpu:avr [backport] (#12748)

This commit is contained in:
Andreas Rumpf 2019-11-27 16:24:21 +01:00 • committed by GitHub
commit fd85a5ae05
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 8 additions and 5 deletions

View file

@ -137,10 +137,10 @@ const
]
proc msbit(x: uint32): int {.inline.} =
let a = if x <= 0xff_ff:
let a = if x <= 0xff_ff'u32:
(if x <= 0xff: 0 else: 8)
else:
(if x <= 0xff_ff_ff: 16 else: 24)
(if x <= 0xff_ff_ff'u32: 16 else: 24)
result = int(fsLookupTable[byte(x shr a)]) + a
proc lsbit(x: uint32): int {.inline.} =