mirror of
https://github.com/nim-lang/Nim.git
synced 2026-02-17 08:34:20 +00:00
in prepration for the upcoming different integer inference rules
This commit is contained in:
@@ -669,7 +669,7 @@ proc astGenRepr*(n: NimNode): string {.compileTime, benign.} =
|
||||
t = x
|
||||
result = newString(len)
|
||||
for j in countdown(len-1, 0):
|
||||
result[j] = HexChars[t and 0xF]
|
||||
result[j] = HexChars[int(t and 0xF)]
|
||||
t = t shr 4
|
||||
# handle negative overflow
|
||||
if t == 0 and x < 0: t = -1
|
||||
|
||||
@@ -888,7 +888,7 @@ proc toHex*(x: BiggestInt, len: Positive): string {.noSideEffect,
|
||||
n = x
|
||||
result = newString(len)
|
||||
for j in countdown(len-1, 0):
|
||||
result[j] = HexChars[n and 0xF]
|
||||
result[j] = HexChars[int(n and 0xF)]
|
||||
n = n shr 4
|
||||
# handle negative overflow
|
||||
if n == 0 and x < 0: n = -1
|
||||
|
||||
Reference in New Issue
Block a user