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

@@ -30,8 +30,9 @@ pub fn vhash() string {
mut buf := [50]byte{}
buf[0] = 0
unsafe {
C.snprintf(charptr(&buf[0]), 50, '%s', C.V_COMMIT_HASH)
return tos_clone(buf)
bp := &buf[0]
C.snprintf(charptr(bp), 50, '%s', C.V_COMMIT_HASH)
return tos_clone(bp)
}
}
@@ -98,8 +99,9 @@ pub fn githash(should_get_from_filesystem bool) string {
mut buf := [50]byte{}
buf[0] = 0
unsafe {
C.snprintf(charptr(&buf[0]), 50, '%s', C.V_CURRENT_COMMIT_HASH)
return tos_clone(buf)
bp := &buf[0]
C.snprintf(charptr(bp), 50, '%s', C.V_CURRENT_COMMIT_HASH)
return tos_clone(bp)
}
}