Skip to content

Commit 00860eb

Browse files
authored
examples: fix warnings about 0 assignments to reference fields (#21133)
1 parent 1400f64 commit 00860eb

File tree

12 files changed

+9
-30
lines changed

12 files changed

+9
-30
lines changed

examples/flappylearning/game.v

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -172,9 +172,7 @@ fn (mut app App) update() {
172172
}
173173

174174
fn main() {
175-
mut app := &App{
176-
gg: 0
177-
}
175+
mut app := &App{}
178176
mut font_path := os.resource_abs_path(os.join_path('..', 'assets', 'fonts', 'RobotoMono-Regular.ttf'))
179177
$if android {
180178
font_path = 'fonts/RobotoMono-Regular.ttf'

examples/game_of_life/life_gg.v

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ fn frame(mut app App) {
3737

3838
fn main() {
3939
mut app := App{
40-
gg: 0
4140
a: automaton.gun()
4241
}
4342
app.gg = gg.new_context(

examples/gg/drag_n_drop.v

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,7 @@ mut:
1717

1818
fn main() {
1919
mut font_path := os.resource_abs_path(os.join_path('..', 'assets', 'fonts', 'RobotoMono-Regular.ttf'))
20-
mut app := &App{
21-
gg: 0
22-
}
20+
mut app := &App{}
2321
app.gg = gg.new_context(
2422
bg_color: gx.rgb(174, 198, 255)
2523
width: 600

examples/gg/draw_pixels.v

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ fn main() {
2525
}
2626
}
2727
mut app := &App{
28-
gg: 0
2928
pixels: pixels
3029
}
3130
app.gg = gg.new_context(

examples/gg/raven_text_rendering.v

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,7 @@ mut:
6161
}
6262

6363
fn main() {
64-
mut app := &App{
65-
gg: 0
66-
}
64+
mut app := &App{}
6765
mut font_path := os.resource_abs_path(os.join_path('..', 'assets', 'fonts', 'RobotoMono-Regular.ttf'))
6866
$if android {
6967
font_path = 'fonts/RobotoMono-Regular.ttf'

examples/gg/rectangles.v

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,7 @@ mut:
1414
}
1515

1616
fn main() {
17-
mut app := &App{
18-
gg: 0
19-
}
17+
mut app := &App{}
2018
app.gg = gg.new_context(
2119
bg_color: gx.white
2220
width: win_width

examples/gg/stars.v

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ mut:
4343

4444
fn main() {
4545
mut app := &App{
46-
gg: 0
4746
stars: []Star{len: max_stars}
4847
v_letters: []VLetter{len: max_v_letters}
4948
}

examples/gg/worker_thread.v

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,7 @@ mut:
2222
}
2323

2424
fn main() {
25-
mut app := &App{
26-
gg: 0
27-
}
25+
mut app := &App{}
2826
app.gg = gg.new_context(
2927
width: win_width
3028
height: win_height

examples/hot_reload/graph.v

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,7 @@ mut:
1414
}
1515

1616
fn main() {
17-
mut context := &Context{
18-
gg: 0
19-
}
17+
mut context := &Context{}
2018
context.gg = gg.new_context(
2119
width: size
2220
height: size

examples/snek/snek.v

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -195,9 +195,7 @@ const font = $embed_file('../assets/fonts/RobotoMono-Regular.ttf')
195195

196196
// setup
197197
fn main() {
198-
mut app := App{
199-
gg: 0
200-
}
198+
mut app := App{}
201199
app.reset_game()
202200
app.best.load()
203201

0 commit comments

Comments
 (0)