Revert "Fix ToString usage"

This reverts commit 4990376607.
This commit is contained in:
Alexander Ivanov 2018-03-14 17:34:20 +02:00
parent 4990376607
commit a26bc1e418
1 changed files with 3 additions and 2 deletions

View File

@ -63,7 +63,7 @@ proc `mod`*(a, b: TTInt): TTInt =
var tmp = a
tmp.inplaceDiv(b, result)
proc ToString(a: TTInt): stdString {.importcpp, header: TTMATH_HEADER.}
proc ToString(a: TTInt, s: stdString) {.importcpp, header: TTMATH_HEADER.}
proc initInt[T](a: int64): T {.importcpp: "'0((int)#)".}
proc initUInt[T](a: uint64): T {.importcpp: "'0((int)#)".}
@ -109,7 +109,8 @@ proc getInt*(a: Int): int {.importcpp: "ToInt", header: TTMATH_HEADER.}
proc getUInt*(a: UInt): uint64 {.importcpp: "ToUInt", header: TTMATH_HEADER.}
proc `$`*(a: Int or UInt): string =
let tmp = a.ToString()
var tmp: stdString
a.ToString(tmp)
var tmps: cstring
{.emit: """
`tmps` = const_cast<char*>(`tmp`.c_str());