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

vfmt: voidptr(0) => unsafe { nil } (p.1)

This commit is contained in:
Alexander Medvednikov
2022-07-21 20:45:57 +03:00
parent be9f8cc777
commit caa0c2f153
17 changed files with 153 additions and 123 deletions

View File

@ -130,7 +130,7 @@ fn print_backtrace_skipping_top_frames_linux(skipframes int) bool {
fn break_if_debugger_attached() {
unsafe {
mut ptr := &voidptr(0)
*ptr = voidptr(0)
*ptr = nil
//_ = ptr
}
}

View File

@ -17,6 +17,10 @@ pub fn ptr_str(ptr voidptr) string {
return buf1
}
// pub fn nil_str(x voidptr) string {
// return 'nil'
//}
// str returns string equivalent of x
pub fn (x isize) str() string {
return i64(x).str()