mirror of
https://github.com/vlang/v.git
synced 2025-09-13 22:42:26 +03:00
examples: fix warnings about 0 assignments to reference fields (#21133)
This commit is contained in:
parent
1400f649c9
commit
00860ebc6b
12 changed files with 9 additions and 30 deletions
|
@ -172,9 +172,7 @@ fn (mut app App) update() {
|
|||
}
|
||||
|
||||
fn main() {
|
||||
mut app := &App{
|
||||
gg: 0
|
||||
}
|
||||
mut app := &App{}
|
||||
mut font_path := os.resource_abs_path(os.join_path('..', 'assets', 'fonts', 'RobotoMono-Regular.ttf'))
|
||||
$if android {
|
||||
font_path = 'fonts/RobotoMono-Regular.ttf'
|
||||
|
|
|
@ -37,7 +37,6 @@ fn frame(mut app App) {
|
|||
|
||||
fn main() {
|
||||
mut app := App{
|
||||
gg: 0
|
||||
a: automaton.gun()
|
||||
}
|
||||
app.gg = gg.new_context(
|
||||
|
|
|
@ -17,9 +17,7 @@ mut:
|
|||
|
||||
fn main() {
|
||||
mut font_path := os.resource_abs_path(os.join_path('..', 'assets', 'fonts', 'RobotoMono-Regular.ttf'))
|
||||
mut app := &App{
|
||||
gg: 0
|
||||
}
|
||||
mut app := &App{}
|
||||
app.gg = gg.new_context(
|
||||
bg_color: gx.rgb(174, 198, 255)
|
||||
width: 600
|
||||
|
|
|
@ -25,7 +25,6 @@ fn main() {
|
|||
}
|
||||
}
|
||||
mut app := &App{
|
||||
gg: 0
|
||||
pixels: pixels
|
||||
}
|
||||
app.gg = gg.new_context(
|
||||
|
|
|
@ -61,9 +61,7 @@ mut:
|
|||
}
|
||||
|
||||
fn main() {
|
||||
mut app := &App{
|
||||
gg: 0
|
||||
}
|
||||
mut app := &App{}
|
||||
mut font_path := os.resource_abs_path(os.join_path('..', 'assets', 'fonts', 'RobotoMono-Regular.ttf'))
|
||||
$if android {
|
||||
font_path = 'fonts/RobotoMono-Regular.ttf'
|
||||
|
|
|
@ -14,9 +14,7 @@ mut:
|
|||
}
|
||||
|
||||
fn main() {
|
||||
mut app := &App{
|
||||
gg: 0
|
||||
}
|
||||
mut app := &App{}
|
||||
app.gg = gg.new_context(
|
||||
bg_color: gx.white
|
||||
width: win_width
|
||||
|
|
|
@ -43,7 +43,6 @@ mut:
|
|||
|
||||
fn main() {
|
||||
mut app := &App{
|
||||
gg: 0
|
||||
stars: []Star{len: max_stars}
|
||||
v_letters: []VLetter{len: max_v_letters}
|
||||
}
|
||||
|
|
|
@ -22,9 +22,7 @@ mut:
|
|||
}
|
||||
|
||||
fn main() {
|
||||
mut app := &App{
|
||||
gg: 0
|
||||
}
|
||||
mut app := &App{}
|
||||
app.gg = gg.new_context(
|
||||
width: win_width
|
||||
height: win_height
|
||||
|
|
|
@ -14,9 +14,7 @@ mut:
|
|||
}
|
||||
|
||||
fn main() {
|
||||
mut context := &Context{
|
||||
gg: 0
|
||||
}
|
||||
mut context := &Context{}
|
||||
context.gg = gg.new_context(
|
||||
width: size
|
||||
height: size
|
||||
|
|
|
@ -195,9 +195,7 @@ const font = $embed_file('../assets/fonts/RobotoMono-Regular.ttf')
|
|||
|
||||
// setup
|
||||
fn main() {
|
||||
mut app := App{
|
||||
gg: 0
|
||||
}
|
||||
mut app := App{}
|
||||
app.reset_game()
|
||||
app.best.load()
|
||||
|
||||
|
|
|
@ -33,9 +33,7 @@ fn my_audio_stream_callback(buffer &f32, num_frames int, num_channels int, mut a
|
|||
|
||||
fn main() {
|
||||
println(credits)
|
||||
mut state := &AppState{
|
||||
gg: 0
|
||||
}
|
||||
mut state := &AppState{}
|
||||
audio.setup(
|
||||
stream_userdata_cb: my_audio_stream_callback
|
||||
user_data: state
|
||||
|
|
|
@ -115,9 +115,7 @@ fn my_event_manager(mut ev gg.Event, mut app App_data) {
|
|||
}
|
||||
|
||||
fn main() {
|
||||
mut app := &App_data{
|
||||
gg: 0
|
||||
}
|
||||
mut app := &App_data{}
|
||||
app.gg = gg.new_context(
|
||||
width: win_width
|
||||
height: win_height
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue