Skip to content

Commit f38b101

Browse files
committed
fontstash: fix new number cast compiler warning/error
silences "cannot cast a number to a type reference, use `nil` or a voidptr cast first: `&Type(voidptr(123))`"
1 parent 1797fd6 commit f38b101

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

wraps/fontstash/fontstash.c.v

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ pub fn (s &Context) set_font(font_id int) {
202202
// The function returns the `x` coordinate of the resulting render.
203203
@[inline]
204204
pub fn (s &Context) draw_text(x f32, y f32, text string) f32 {
205-
return C.fonsDrawText(s, x, y, &char(text.str), &char(0))
205+
return C.fonsDrawText(s, x, y, &char(text.str), &char(unsafe { nil }))
206206
}
207207

208208
// text_bounds fills the `bounds` argument with the pixel dimensions
@@ -216,7 +216,7 @@ pub fn (s &Context) draw_text(x f32, y f32, text string) f32 {
216216
// `bounds[3]` is the `y` coordinate of the bottom-right point.
217217
@[inline]
218218
pub fn (s &Context) text_bounds(x f32, y f32, text string, bounds &f32) f32 {
219-
return C.fonsTextBounds(s, x, y, &char(text.str), &char(0), bounds)
219+
return C.fonsTextBounds(s, x, y, &char(text.str), &char(unsafe { nil }), bounds)
220220
}
221221

222222
// line_bounds fills `miny` and `maxy` with the values of the `minimum`

0 commit comments

Comments
 (0)