1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

ci: fix all -cstrict warnings with gcc and clang (#9792)

This commit is contained in:
spaceface
2021-04-19 14:38:48 +02:00
committed by GitHub
parent dde3189e66
commit 73352583e7
37 changed files with 295 additions and 296 deletions

View File

@@ -336,8 +336,8 @@ pub fn new_context(cfg Config) &Context {
event_userdata_cb: gg_event_fn
fail_userdata_cb: gg_fail_fn
cleanup_userdata_cb: gg_cleanup_fn
window_title: cfg.window_title.str
html5_canvas_name: cfg.window_title.str
window_title: &char(cfg.window_title.str)
html5_canvas_name: &char(cfg.window_title.str)
width: cfg.width
height: cfg.height
sample_count: cfg.sample_count

View File

@@ -146,7 +146,7 @@ pub fn (mut img Image) init_sokol_image() &Image {
num_mipmaps: 0
wrap_u: .clamp_to_edge
wrap_v: .clamp_to_edge
label: &byte(0)
label: &char(0)
d3d11_texture: 0
}
img_desc.data.subimage[0][0] = C.sg_range{

View File

@@ -189,7 +189,7 @@ pub fn (ctx &Context) draw_text(x int, y int, text_ string, cfg gx.TextCfg) {
// }
ctx.set_cfg(cfg)
scale := if ctx.ft.scale == 0 { f32(1) } else { ctx.ft.scale }
C.fonsDrawText(ctx.ft.fons, x * scale, y * scale, text_.str, 0) // TODO: check offsets/alignment
C.fonsDrawText(ctx.ft.fons, x * scale, y * scale, &char(text_.str), 0) // TODO: check offsets/alignment
}
pub fn (ctx &Context) draw_text_def(x int, y int, text string) {
@@ -215,7 +215,7 @@ pub fn (ctx &Context) text_width(s string) int {
return 0
}
mut buf := [4]f32{}
C.fonsTextBounds(ctx.ft.fons, 0, 0, s.str, 0, &buf[0])
C.fonsTextBounds(ctx.ft.fons, 0, 0, &char(s.str), 0, &buf[0])
if s.ends_with(' ') {
return int((buf[2] - buf[0]) / ctx.scale) +
ctx.text_width('i') // TODO fix this in fontstash?
@@ -236,7 +236,7 @@ pub fn (ctx &Context) text_height(s string) int {
return 0
}
mut buf := [4]f32{}
C.fonsTextBounds(ctx.ft.fons, 0, 0, s.str, 0, &buf[0])
C.fonsTextBounds(ctx.ft.fons, 0, 0, &char(s.str), 0, &buf[0])
return int((buf[3] - buf[1]) / ctx.scale)
}
@@ -246,7 +246,7 @@ pub fn (ctx &Context) text_size(s string) (int, int) {
return 0, 0
}
mut buf := [4]f32{}
C.fonsTextBounds(ctx.ft.fons, 0, 0, s.str, 0, &buf[0])
C.fonsTextBounds(ctx.ft.fons, 0, 0, &char(s.str), 0, &buf[0])
return int((buf[2] - buf[0]) / ctx.scale), int((buf[3] - buf[1]) / ctx.scale)
}