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

checker: disallow implicit conversion from fixed array to fooptr (#8823)

This commit is contained in:
Nick Treleaven
2021-02-25 23:28:47 +00:00
committed by GitHub
parent 639061be6c
commit c03798e390
7 changed files with 42 additions and 18 deletions

View File

@ -147,9 +147,13 @@ pub fn (n Number) str() string {
// .hexstr returns a hexadecimal representation of the bignum `n`
pub fn (n Number) hexstr() string {
mut buf := [8192]byte{}
// NB: C.bignum_to_string(), returns the HEXADECIMAL representation of the bignum n
C.bignum_to_string(&n, buf, 8192)
s := unsafe { tos_clone(buf) }
mut s := ''
unsafe {
bp := &buf[0]
// NB: C.bignum_to_string(), returns the HEXADECIMAL representation of the bignum n
C.bignum_to_string(&n, bp, 8192)
s = tos_clone(bp)
}
if s.len == 0 {
return '0'
}