Core: Fix casting binding

This commit is contained in:
Krzosa Karol
2023-04-21 11:32:38 +02:00
parent 51cebbf4d0
commit 29238b6cc5
4 changed files with 11 additions and 5 deletions

View File

@@ -23,11 +23,12 @@ IntegerToString :: (value: int, result: *U8, base: int): *U8
ptr1 := result
tmp_char: U8
tmp_value: int
str := "zyxwvutsrqponmlkjihgfedcba9876543210123456789abcdefghijklmnopqrstuvwxyz"
for value != 0
tmp_value = value
value /= base
*ptr++ = "zyxwvutsrqponmlkjihgfedcba9876543210123456789abcdefghijklmnopqrstuvwxyz"[35 + (tmp_value - value * base)]
*ptr++ = str[35 + (tmp_value - value * base)]
// Apply negative sign
if tmp_value < 0