1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

builtin: add V64_PRINTFORMAT (part 2)

This commit is contained in:
Delyan Angelov 2020-03-01 16:48:54 +02:00 committed by GitHub
parent 2700fd712b
commit 615a4b3452
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -158,7 +158,7 @@ pub fn (n i64) hex() string {
hex := malloc(len)
// TODO
//count := C.sprintf(charptr(hex), '0x%'C.PRIx64, n)
count := C.sprintf(charptr(hex), '0x%llx', n)
count := C.sprintf(charptr(hex), C.V64_PRINTFORMAT, n)
return tos(hex, count)
}
@ -166,7 +166,7 @@ pub fn (n u64) hex() string {
len := if n > 0 { n.str().len + 3 } else { 19 }
hex := malloc(len)
//count := C.sprintf(charptr(hex), '0x%'C.PRIx64, n)
count := C.sprintf(charptr(hex), '0x%llx', n)
count := C.sprintf(charptr(hex), C.V64_PRINTFORMAT, n)
//count := C.sprintf(charptr(hex), '0x%lx', n)
return tos(hex, count)
}