Skip to content

Commit cb60392

Browse files
committed
examples: fix unsafe 0
1 parent ca30397 commit cb60392

File tree

9 files changed

+12
-12
lines changed

9 files changed

+12
-12
lines changed

examples/clock/clock.v

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ struct App {
4242
minute_hand []f32 = [f32(334.25), 40.25, 350, 24.5, 365.75, 40.25, 365.75, 427, 334.25, 427]
4343
second_hand []f32 = [f32(345.8), 38.5, 350, 34.3, 354.2000, 38.5, 358.75, 427, 341.25, 427]
4444
mut:
45-
gg &gg.Context = 0
45+
gg &gg.Context = unsafe { 0 }
4646
draw_flag bool = true
4747
dpi_scale f32 = 1.0
4848
}

examples/fireworks/fireworks.v

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ import rand
66

77
struct App {
88
mut:
9-
gg &gg.Context = 0
10-
ui &objects.UIParams = 0
9+
gg &gg.Context = unsafe { 0 }
10+
ui &objects.UIParams = unsafe { 0 }
1111
rockets []objects.Rocket
1212
frames [][]objects.Rocket
1313
// i thought about using a fixed fifo queue for the frames but the array

examples/gg/mandelbrot.v

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ fn (v &ViewRect) height() f64 {
3131

3232
struct AppState {
3333
mut:
34-
gg &gg.Context = 0
34+
gg &gg.Context = unsafe { 0 }
3535
iidx int
3636
pixels &u32 = unsafe { vcalloc(pwidth * pheight * sizeof(u32)) }
3737
npixels &u32 = unsafe { vcalloc(pwidth * pheight * sizeof(u32)) } // all drawing happens here, results are swapped at the end

examples/gg/random.v

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const pbytes = 4
99

1010
struct AppState {
1111
mut:
12-
gg &gg.Context = 0
12+
gg &gg.Context = unsafe { 0 }
1313
istream_idx int
1414
pixels [pheight][pwidth]u32
1515
}

examples/pendulum-simulation/modules/sim/anim/app.v

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ pub:
1919
request_chan chan &sim.SimRequest
2020
result_chan chan &sim.SimResult
2121
pub mut:
22-
gg &gg.Context = 0
22+
gg &gg.Context = unsafe { 0 }
2323
iidx int
2424
pixels []u32
2525
}

examples/term.ui/cursor_chaser.v

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ struct Point {
1818

1919
struct App {
2020
mut:
21-
tui &tui.Context = 0
21+
tui &tui.Context = unsafe { 0 }
2222
points []Point
2323
color tui.Color = colors[0]
2424
color_idx int

examples/term.ui/pong.v

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ const (
1919
[heap]
2020
struct App {
2121
mut:
22-
tui &ui.Context = 0
22+
tui &ui.Context = unsafe { 0 }
2323
mode Mode = Mode.menu
2424
width int
2525
height int
26-
game &Game = 0
26+
game &Game = unsafe { 0 }
2727
dt f32
2828
ticks i64
2929
}

vlib/net/smtp/smtp.v

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ pub enum BodyType {
3232
pub struct Client {
3333
mut:
3434
conn net.TcpConn
35-
ssl_conn &openssl.SSLConn = 0
35+
ssl_conn &openssl.SSLConn = unsafe { 0 }
3636
reader io.BufferedReader
3737
pub:
3838
server string

vlib/picohttpparser/response.v

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ module picohttpparser
33
pub struct Response {
44
fd int
55
pub:
6-
date &u8 = 0
7-
buf_start &u8 = 0
6+
date &u8 = unsafe { 0 }
7+
buf_start &u8 = unsafe { 0 }
88
pub mut:
99
buf &u8 = 0
1010
}

0 commit comments

Comments
 (0)