checker: do not allow &u8(0), force nil like we do with &Type(0)

This commit is contained in:
Alexander Medvednikov 2025-05-03 22:37:51 +03:00
parent 3ab660b4c6
commit 7d57a19d7e
52 changed files with 184 additions and 118 deletions

View file

@ -72,7 +72,7 @@ fn main() {
error_code := C.wkhtmltopdf_http_error_code(converter)
println('wkhtmltopdf_http_error_code: ${error_code}')
if result {
pdata := &char(0)
pdata := &char(unsafe { nil })
ppdata := &pdata
size := C.wkhtmltopdf_get_output(converter, voidptr(ppdata))
println('wkhtmltopdf_get_output: ${size} bytes')

View file

@ -37,7 +37,7 @@ fn create_texture(w int, h int, buf &u8) (gfx.Image, gfx.Sampler) {
height: h
num_mipmaps: 0
// usage: .dynamic
label: &char(0)
label: &char(unsafe { nil })
d3d11_texture: 0
}
// comment, if .dynamic is enabled

View file

@ -61,7 +61,7 @@ fn create_texture(w int, h int, buf &u8) (gfx.Image, gfx.Sampler) {
height: h
num_mipmaps: 0
// usage: .dynamic
label: &char(0)
label: &char(unsafe { nil })
d3d11_texture: 0
}
// comment if .dynamic is enabled

View file

@ -64,7 +64,7 @@ fn create_texture(w int, h int, buf &u8) (gfx.Image, gfx.Sampler) {
// usage: .dynamic
// wrap_u: .clamp_to_edge
// wrap_v: .clamp_to_edge
label: &char(0)
label: &char(unsafe { nil })
d3d11_texture: 0
}
// comment if .dynamic is enabled

View file

@ -75,7 +75,7 @@ fn create_texture(w int, h int, buf byteptr) (gfx.Image, gfx.Sampler) {
//usage: .dynamic
// wrap_u: .clamp_to_edge
// wrap_v: .clamp_to_edge
label: &char(0)
label: &char(unsafe { nil })
d3d11_texture: 0
}
// vfmt on

View file

@ -29,7 +29,7 @@ pub fn create_texture(w int, h int, buf &u8) (gfx.Image, gfx.Sampler) {
// usage: .dynamic
// wrap_u: .clamp_to_edge
// wrap_v: .clamp_to_edge
label: &char(0)
label: &char(unsafe { nil })
d3d11_texture: 0
}
// comment if .dynamic is enabled

View file

@ -119,7 +119,7 @@ fn create_texture(w int, h int, buf &u8) (gfx.Image, gfx.Sampler) {
height: h
num_mipmaps: 0
// usage: .dynamic
label: &u8(0)
label: &u8(unsafe { nil })
d3d11_texture: 0
}
// comment if .dynamic is enabled