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:
parent
ca30397e7a
commit
cb60392302
@ -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]
|
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]
|
second_hand []f32 = [f32(345.8), 38.5, 350, 34.3, 354.2000, 38.5, 358.75, 427, 341.25, 427]
|
||||||
mut:
|
mut:
|
||||||
gg &gg.Context = 0
|
gg &gg.Context = unsafe { 0 }
|
||||||
draw_flag bool = true
|
draw_flag bool = true
|
||||||
dpi_scale f32 = 1.0
|
dpi_scale f32 = 1.0
|
||||||
}
|
}
|
||||||
|
@ -6,8 +6,8 @@ import rand
|
|||||||
|
|
||||||
struct App {
|
struct App {
|
||||||
mut:
|
mut:
|
||||||
gg &gg.Context = 0
|
gg &gg.Context = unsafe { 0 }
|
||||||
ui &objects.UIParams = 0
|
ui &objects.UIParams = unsafe { 0 }
|
||||||
rockets []objects.Rocket
|
rockets []objects.Rocket
|
||||||
frames [][]objects.Rocket
|
frames [][]objects.Rocket
|
||||||
// i thought about using a fixed fifo queue for the frames but the array
|
// i thought about using a fixed fifo queue for the frames but the array
|
||||||
|
@ -31,7 +31,7 @@ fn (v &ViewRect) height() f64 {
|
|||||||
|
|
||||||
struct AppState {
|
struct AppState {
|
||||||
mut:
|
mut:
|
||||||
gg &gg.Context = 0
|
gg &gg.Context = unsafe { 0 }
|
||||||
iidx int
|
iidx int
|
||||||
pixels &u32 = unsafe { vcalloc(pwidth * pheight * sizeof(u32)) }
|
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
|
npixels &u32 = unsafe { vcalloc(pwidth * pheight * sizeof(u32)) } // all drawing happens here, results are swapped at the end
|
||||||
|
@ -9,7 +9,7 @@ const pbytes = 4
|
|||||||
|
|
||||||
struct AppState {
|
struct AppState {
|
||||||
mut:
|
mut:
|
||||||
gg &gg.Context = 0
|
gg &gg.Context = unsafe { 0 }
|
||||||
istream_idx int
|
istream_idx int
|
||||||
pixels [pheight][pwidth]u32
|
pixels [pheight][pwidth]u32
|
||||||
}
|
}
|
||||||
|
@ -19,7 +19,7 @@ pub:
|
|||||||
request_chan chan &sim.SimRequest
|
request_chan chan &sim.SimRequest
|
||||||
result_chan chan &sim.SimResult
|
result_chan chan &sim.SimResult
|
||||||
pub mut:
|
pub mut:
|
||||||
gg &gg.Context = 0
|
gg &gg.Context = unsafe { 0 }
|
||||||
iidx int
|
iidx int
|
||||||
pixels []u32
|
pixels []u32
|
||||||
}
|
}
|
||||||
|
@ -18,7 +18,7 @@ struct Point {
|
|||||||
|
|
||||||
struct App {
|
struct App {
|
||||||
mut:
|
mut:
|
||||||
tui &tui.Context = 0
|
tui &tui.Context = unsafe { 0 }
|
||||||
points []Point
|
points []Point
|
||||||
color tui.Color = colors[0]
|
color tui.Color = colors[0]
|
||||||
color_idx int
|
color_idx int
|
||||||
|
@ -19,11 +19,11 @@ const (
|
|||||||
[heap]
|
[heap]
|
||||||
struct App {
|
struct App {
|
||||||
mut:
|
mut:
|
||||||
tui &ui.Context = 0
|
tui &ui.Context = unsafe { 0 }
|
||||||
mode Mode = Mode.menu
|
mode Mode = Mode.menu
|
||||||
width int
|
width int
|
||||||
height int
|
height int
|
||||||
game &Game = 0
|
game &Game = unsafe { 0 }
|
||||||
dt f32
|
dt f32
|
||||||
ticks i64
|
ticks i64
|
||||||
}
|
}
|
||||||
|
@ -32,7 +32,7 @@ pub enum BodyType {
|
|||||||
pub struct Client {
|
pub struct Client {
|
||||||
mut:
|
mut:
|
||||||
conn net.TcpConn
|
conn net.TcpConn
|
||||||
ssl_conn &openssl.SSLConn = 0
|
ssl_conn &openssl.SSLConn = unsafe { 0 }
|
||||||
reader io.BufferedReader
|
reader io.BufferedReader
|
||||||
pub:
|
pub:
|
||||||
server string
|
server string
|
||||||
|
@ -3,8 +3,8 @@ module picohttpparser
|
|||||||
pub struct Response {
|
pub struct Response {
|
||||||
fd int
|
fd int
|
||||||
pub:
|
pub:
|
||||||
date &u8 = 0
|
date &u8 = unsafe { 0 }
|
||||||
buf_start &u8 = 0
|
buf_start &u8 = unsafe { 0 }
|
||||||
pub mut:
|
pub mut:
|
||||||
buf &u8 = 0
|
buf &u8 = 0
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user