Skip to content

Commit

Permalink
examples, v.builder: fix `v -cstrict -cc gcc-11 examples/sokol/partic…
Browse files Browse the repository at this point in the history
…les` and the same but with clang-18 too
  • Loading branch information
spytheman committed Mar 6, 2025
1 parent cac026a commit 86740bb
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
8 changes: 4 additions & 4 deletions examples/sokol/particles/modules/particle/system.v
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ pub fn (mut s System) update(dt f64) {
moved++
}
}
$if trace_moves_spool_to_sbin ? {
if moved != 0 {
if moved != 0 {
$if trace_moves_spool_to_sbin ? {
eprintln('${moved:4} particles s.pool -> s.bin')
}
}
Expand Down Expand Up @@ -88,8 +88,8 @@ pub fn (mut s System) explode(x f32, y f32) {
moved++
reserve--
}
$if trace_moves_sbin_to_spool ? {
if moved != 0 {
if moved != 0 {
$if trace_moves_sbin_to_spool ? {
eprintln('${moved:4} particles s.bin -> s.pool')
}
}
Expand Down
4 changes: 2 additions & 2 deletions examples/sokol/particles/particles.v
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ fn (mut a App) run() {
init_userdata_cb: init
frame_userdata_cb: frame
event_userdata_cb: event
window_title: title.str
html5_canvas_name: title.str
window_title: &char(title.str)
html5_canvas_name: &char(title.str)
cleanup_userdata_cb: cleanup
}
sapp.run(&desc)
Expand Down
2 changes: 2 additions & 0 deletions vlib/v/builder/cc.v
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,8 @@ fn (mut v Builder) setup_ccompiler_options(ccompiler string) {
'-Wno-int-to-pointer-cast', // gcc version of the above
'-Wno-trigraphs', // see stackoverflow.com/a/8435413
'-Wno-missing-braces', // see stackoverflow.com/q/13746033
'-Wno-enum-conversion', // silences `.dst_factor_rgb = sokol__gfx__BlendFactor__one_minus_src_alpha`
'-Wno-enum-compare', // silences `if (ev->mouse_button == sokol__sapp__MouseButton__left) {`
// enable additional warnings:
'-Wno-unknown-warning', // if a C compiler does not understand a certain flag, it should just ignore it
'-Wno-unknown-warning-option', // clang equivalent of the above
Expand Down

0 comments on commit 86740bb

Please sign in to comment.