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

checker: warn when casting number or a voidptr to reference type outside unsafe (#7900)

This commit is contained in:
Nick Treleaven
2021-01-05 18:07:45 +00:00
committed by GitHub
parent 3e04dfc79f
commit 8fc33bc27d
7 changed files with 30 additions and 27 deletions

View File

@@ -143,7 +143,7 @@ fn mysubstr(s byteptr, from int, len int) string {
}
fn rw_callback(loop &C.picoev_loop, fd int, events int, cb_arg voidptr) {
mut p := &Picoev(cb_arg)
mut p := unsafe {&Picoev(cb_arg)}
if (events & C.PICOEV_TIMEOUT) != 0 {
close_conn(loop, fd)
p.idx[fd] = 0