examples: fix warnings about 0 assignments to reference fields (#21133)

This commit is contained in:
Turiiya 2024-03-29 09:35:37 +01:00 committed by GitHub
parent 1400f649c9
commit 00860ebc6b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 9 additions and 30 deletions

View file

@ -172,9 +172,7 @@ fn (mut app App) update() {
} }
fn main() { fn main() {
mut app := &App{ mut app := &App{}
gg: 0
}
mut font_path := os.resource_abs_path(os.join_path('..', 'assets', 'fonts', 'RobotoMono-Regular.ttf')) mut font_path := os.resource_abs_path(os.join_path('..', 'assets', 'fonts', 'RobotoMono-Regular.ttf'))
$if android { $if android {
font_path = 'fonts/RobotoMono-Regular.ttf' font_path = 'fonts/RobotoMono-Regular.ttf'

View file

@ -37,7 +37,6 @@ fn frame(mut app App) {
fn main() { fn main() {
mut app := App{ mut app := App{
gg: 0
a: automaton.gun() a: automaton.gun()
} }
app.gg = gg.new_context( app.gg = gg.new_context(

View file

@ -17,9 +17,7 @@ mut:
fn main() { fn main() {
mut font_path := os.resource_abs_path(os.join_path('..', 'assets', 'fonts', 'RobotoMono-Regular.ttf')) mut font_path := os.resource_abs_path(os.join_path('..', 'assets', 'fonts', 'RobotoMono-Regular.ttf'))
mut app := &App{ mut app := &App{}
gg: 0
}
app.gg = gg.new_context( app.gg = gg.new_context(
bg_color: gx.rgb(174, 198, 255) bg_color: gx.rgb(174, 198, 255)
width: 600 width: 600

View file

@ -25,7 +25,6 @@ fn main() {
} }
} }
mut app := &App{ mut app := &App{
gg: 0
pixels: pixels pixels: pixels
} }
app.gg = gg.new_context( app.gg = gg.new_context(

View file

@ -61,9 +61,7 @@ mut:
} }
fn main() { fn main() {
mut app := &App{ mut app := &App{}
gg: 0
}
mut font_path := os.resource_abs_path(os.join_path('..', 'assets', 'fonts', 'RobotoMono-Regular.ttf')) mut font_path := os.resource_abs_path(os.join_path('..', 'assets', 'fonts', 'RobotoMono-Regular.ttf'))
$if android { $if android {
font_path = 'fonts/RobotoMono-Regular.ttf' font_path = 'fonts/RobotoMono-Regular.ttf'

View file

@ -14,9 +14,7 @@ mut:
} }
fn main() { fn main() {
mut app := &App{ mut app := &App{}
gg: 0
}
app.gg = gg.new_context( app.gg = gg.new_context(
bg_color: gx.white bg_color: gx.white
width: win_width width: win_width

View file

@ -43,7 +43,6 @@ mut:
fn main() { fn main() {
mut app := &App{ mut app := &App{
gg: 0
stars: []Star{len: max_stars} stars: []Star{len: max_stars}
v_letters: []VLetter{len: max_v_letters} v_letters: []VLetter{len: max_v_letters}
} }

View file

@ -22,9 +22,7 @@ mut:
} }
fn main() { fn main() {
mut app := &App{ mut app := &App{}
gg: 0
}
app.gg = gg.new_context( app.gg = gg.new_context(
width: win_width width: win_width
height: win_height height: win_height

View file

@ -14,9 +14,7 @@ mut:
} }
fn main() { fn main() {
mut context := &Context{ mut context := &Context{}
gg: 0
}
context.gg = gg.new_context( context.gg = gg.new_context(
width: size width: size
height: size height: size

View file

@ -195,9 +195,7 @@ const font = $embed_file('../assets/fonts/RobotoMono-Regular.ttf')
// setup // setup
fn main() { fn main() {
mut app := App{ mut app := App{}
gg: 0
}
app.reset_game() app.reset_game()
app.best.load() app.best.load()

View file

@ -33,9 +33,7 @@ fn my_audio_stream_callback(buffer &f32, num_frames int, num_channels int, mut a
fn main() { fn main() {
println(credits) println(credits)
mut state := &AppState{ mut state := &AppState{}
gg: 0
}
audio.setup( audio.setup(
stream_userdata_cb: my_audio_stream_callback stream_userdata_cb: my_audio_stream_callback
user_data: state user_data: state

View file

@ -115,9 +115,7 @@ fn my_event_manager(mut ev gg.Event, mut app App_data) {
} }
fn main() { fn main() {
mut app := &App_data{ mut app := &App_data{}
gg: 0
}
app.gg = gg.new_context( app.gg = gg.new_context(
width: win_width width: win_width
height: win_height height: win_height