Skip to content

Commit

Permalink
all: fix all remaining unsafe 0 (#14856)
Browse files Browse the repository at this point in the history
  • Loading branch information
yuyi98 committed Jun 26, 2022
1 parent cb60392 commit 5a79a54
Show file tree
Hide file tree
Showing 9 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion examples/term.ui/event_viewer.v
Expand Up @@ -2,7 +2,7 @@ import term.ui as tui

struct App {
mut:
tui &tui.Context = 0
tui &tui.Context = unsafe { 0 }
}

fn event(e &tui.Event, x voidptr) {
Expand Down
2 changes: 1 addition & 1 deletion examples/term.ui/pong.v
Expand Up @@ -242,7 +242,7 @@ fn (mut b Ball) update(dt f32) {
[heap]
struct Game {
mut:
app &App = 0
app &App = unsafe { 0 }
players []Player
ball Ball
}
Expand Down
2 changes: 1 addition & 1 deletion examples/term.ui/rectangles.v
Expand Up @@ -12,7 +12,7 @@ mut:

struct App {
mut:
tui &tui.Context = 0
tui &tui.Context = unsafe { 0 }
rects []Rect
cur_rect Rect
is_drag bool
Expand Down
2 changes: 1 addition & 1 deletion examples/term.ui/term_drawing.v
Expand Up @@ -90,7 +90,7 @@ const (

struct App {
mut:
ui &ui.Context = 0
ui &ui.Context = unsafe { 0 }
header_text []string
mouse_pos Point
msg string
Expand Down
4 changes: 2 additions & 2 deletions examples/term.ui/text_editor.v
Expand Up @@ -57,8 +57,8 @@ pub:

struct App {
mut:
tui &tui.Context = 0
ed &Buffer = 0
tui &tui.Context = unsafe { 0 }
ed &Buffer = unsafe { 0 }
current_file int
files []string
status string
Expand Down
2 changes: 1 addition & 1 deletion examples/term.ui/vyper.v
Expand Up @@ -259,7 +259,7 @@ fn (mut r Rat) randomize() {
[heap]
struct App {
mut:
termui &termui.Context = 0
termui &termui.Context = unsafe { 0 }
snake Snake
rat Rat
width int
Expand Down
2 changes: 1 addition & 1 deletion vlib/net/html/tag.v
Expand Up @@ -16,7 +16,7 @@ pub mut:
children []&Tag
attributes map[string]string // attributes will be like map[name]value
last_attribute string
parent &Tag = 0
parent &Tag = unsafe { 0 }
position_in_parent int
closed bool
close_type CloseTagType = .in_name
Expand Down
2 changes: 1 addition & 1 deletion vlib/picohttpparser/response.v
Expand Up @@ -6,7 +6,7 @@ pub:
date &u8 = unsafe { 0 }
buf_start &u8 = unsafe { 0 }
pub mut:
buf &u8 = 0
buf &u8 = unsafe { 0 }
}

[inline]
Expand Down
2 changes: 1 addition & 1 deletion vlib/x/ttf/render_bmp.v
Expand Up @@ -19,7 +19,7 @@ import math
pub struct BitMap {
pub mut:
tf &TTF_File
buf &u8 = 0 // pointer to the memory buffer
buf &u8 = unsafe { 0 } // pointer to the memory buffer
buf_size int // allocated buf size in bytes
width int = 1 // width of the buffer
height int = 1 // height of the buffer
Expand Down

0 comments on commit 5a79a54

Please sign in to comment.