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() {
|
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'
|
||||||
|
|
|
@ -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(
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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(
|
||||||
|
|
|
@ -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'
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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()
|
||||||
|
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue