Move from sentinel-terminated slices to sentinel-terminated pointers ([:0] -> [*:0])

This commit is contained in:
Not-Nik 2024-07-09 21:59:38 +02:00
parent 19db777449
commit a03b65a76c
Failed to generate hash of commit
6 changed files with 205 additions and 205 deletions

View file

@ -757,7 +757,7 @@ pub fn rlGetGlTextureFormats(format: i32, glInternalFormat: *u32, glFormat: *u32
}
/// Get name string for pixel format
pub fn rlGetPixelFormatName(format: u32) [:0]const u8 {
pub fn rlGetPixelFormatName(format: u32) [*:0]const u8 {
return std.mem.span(cdef.rlGetPixelFormatName(@as(c_uint, format)));
}
@ -777,7 +777,7 @@ pub fn rlReadTexturePixels(id: u32, width: i32, height: i32, format: i32) *anyop
}
/// Read screen pixel data (color buffer)
pub fn rlReadScreenPixels(width: i32, height: i32) [:0]u8 {
pub fn rlReadScreenPixels(width: i32, height: i32) [*:0]u8 {
return std.mem.span(cdef.rlReadScreenPixels(@as(c_int, width), @as(c_int, height)));
}
@ -802,12 +802,12 @@ pub fn rlUnloadFramebuffer(id: u32) void {
}
/// Load shader from code strings
pub fn rlLoadShaderCode(vsCode: [:0]const u8, fsCode: [:0]const u8) u32 {
pub fn rlLoadShaderCode(vsCode: [*:0]const u8, fsCode: [*:0]const u8) u32 {
return @as(u32, cdef.rlLoadShaderCode(@as([*c]const u8, @ptrCast(vsCode)), @as([*c]const u8, @ptrCast(fsCode))));
}
/// Compile custom shader and return shader id (type: RL_VERTEX_SHADER, RL_FRAGMENT_SHADER, RL_COMPUTE_SHADER)
pub fn rlCompileShader(shaderCode: [:0]const u8, ty: i32) u32 {
pub fn rlCompileShader(shaderCode: [*:0]const u8, ty: i32) u32 {
return @as(u32, cdef.rlCompileShader(@as([*c]const u8, @ptrCast(shaderCode)), @as(c_int, ty)));
}
@ -822,12 +822,12 @@ pub fn rlUnloadShaderProgram(id: u32) void {
}
/// Get shader location uniform
pub fn rlGetLocationUniform(shaderId: u32, uniformName: [:0]const u8) i32 {
pub fn rlGetLocationUniform(shaderId: u32, uniformName: [*:0]const u8) i32 {
return @as(i32, cdef.rlGetLocationUniform(@as(c_uint, shaderId), @as([*c]const u8, @ptrCast(uniformName))));
}
/// Get shader location attribute
pub fn rlGetLocationAttrib(shaderId: u32, attribName: [:0]const u8) i32 {
pub fn rlGetLocationAttrib(shaderId: u32, attribName: [*:0]const u8) i32 {
return @as(i32, cdef.rlGetLocationAttrib(@as(c_uint, shaderId), @as([*c]const u8, @ptrCast(attribName))));
}