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

examples: fix unsafe 0

This commit is contained in:
Alexander Medvednikov 2022-06-26 07:12:15 +03:00
parent ca30397e7a
commit cb60392302
9 changed files with 12 additions and 12 deletions

View File

@ -42,7 +42,7 @@ struct App {
minute_hand []f32 = [f32(334.25), 40.25, 350, 24.5, 365.75, 40.25, 365.75, 427, 334.25, 427]
second_hand []f32 = [f32(345.8), 38.5, 350, 34.3, 354.2000, 38.5, 358.75, 427, 341.25, 427]
mut:
gg &gg.Context = 0
gg &gg.Context = unsafe { 0 }
draw_flag bool = true
dpi_scale f32 = 1.0
}

View File

@ -6,8 +6,8 @@ import rand
struct App {
mut:
gg &gg.Context = 0
ui &objects.UIParams = 0
gg &gg.Context = unsafe { 0 }
ui &objects.UIParams = unsafe { 0 }
rockets []objects.Rocket
frames [][]objects.Rocket
// i thought about using a fixed fifo queue for the frames but the array

View File

@ -31,7 +31,7 @@ fn (v &ViewRect) height() f64 {
struct AppState {
mut:
gg &gg.Context = 0
gg &gg.Context = unsafe { 0 }
iidx int
pixels &u32 = unsafe { vcalloc(pwidth * pheight * sizeof(u32)) }
npixels &u32 = unsafe { vcalloc(pwidth * pheight * sizeof(u32)) } // all drawing happens here, results are swapped at the end

View File

@ -9,7 +9,7 @@ const pbytes = 4
struct AppState {
mut:
gg &gg.Context = 0
gg &gg.Context = unsafe { 0 }
istream_idx int
pixels [pheight][pwidth]u32
}

View File

@ -19,7 +19,7 @@ pub:
request_chan chan &sim.SimRequest
result_chan chan &sim.SimResult
pub mut:
gg &gg.Context = 0
gg &gg.Context = unsafe { 0 }
iidx int
pixels []u32
}

View File

@ -18,7 +18,7 @@ struct Point {
struct App {
mut:
tui &tui.Context = 0
tui &tui.Context = unsafe { 0 }
points []Point
color tui.Color = colors[0]
color_idx int

View File

@ -19,11 +19,11 @@ const (
[heap]
struct App {
mut:
tui &ui.Context = 0
tui &ui.Context = unsafe { 0 }
mode Mode = Mode.menu
width int
height int
game &Game = 0
game &Game = unsafe { 0 }
dt f32
ticks i64
}

View File

@ -32,7 +32,7 @@ pub enum BodyType {
pub struct Client {
mut:
conn net.TcpConn
ssl_conn &openssl.SSLConn = 0
ssl_conn &openssl.SSLConn = unsafe { 0 }
reader io.BufferedReader
pub:
server string

View File

@ -3,8 +3,8 @@ module picohttpparser
pub struct Response {
fd int
pub:
date &u8 = 0
buf_start &u8 = 0
date &u8 = unsafe { 0 }
buf_start &u8 = unsafe { 0 }
pub mut:
buf &u8 = 0
}