Skip to content

Commit

Permalink
fix generation of pointer return types
Browse files Browse the repository at this point in the history
  • Loading branch information
ryupold committed Aug 13, 2023
1 parent f380a7f commit 5ca39b5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions generate.zig
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,8 @@ fn writeFunctions(
try file.writeAll(
try allocPrint(
allocator,
") [*]const {s} {{\n",
.{stripType(func.returnType)},
") {s} {{\n",
.{func.returnType},
),
);
}
Expand Down
14 changes: 7 additions & 7 deletions raylib.zig
Original file line number Diff line number Diff line change
Expand Up @@ -3947,7 +3947,7 @@ pub fn ImageColorReplace(
/// Load color data from image as a Color array (RGBA - 32bit)
pub fn LoadImageColors(
image: Image,
) [*]const Color {
) ?[*]Color {
return @as(
?[*]Color,
@ptrCast(raylib.mLoadImageColors(
Expand All @@ -3961,7 +3961,7 @@ pub fn LoadImagePalette(
image: Image,
maxPaletteSize: i32,
colorCount: ?[*]i32,
) [*]const Color {
) ?[*]Color {
return @as(
?[*]Color,
@ptrCast(raylib.mLoadImagePalette(
Expand Down Expand Up @@ -5036,7 +5036,7 @@ pub fn UnloadUTF8(
pub fn LoadCodepoints(
text: [*:0]const u8,
count: ?[*]i32,
) [*]const i32 {
) ?[*]i32 {
return @as(
?[*]i32,
@ptrCast(raylib.mLoadCodepoints(
Expand Down Expand Up @@ -6092,7 +6092,7 @@ pub fn GenMeshCubicmap(
pub fn LoadMaterials(
fileName: [*:0]const u8,
materialCount: ?[*]i32,
) [*]const Material {
) ?[*]Material {
return @as(
?[*]Material,
@ptrCast(raylib.mLoadMaterials(
Expand Down Expand Up @@ -6604,7 +6604,7 @@ pub fn WaveFormat(
/// Load samples data from wave as a 32bit float data array
pub fn LoadWaveSamples(
wave: Wave,
) [*]const f32 {
) ?[*]f32 {
return @as(
?[*]f32,
@ptrCast(raylib.mLoadWaveSamples(
Expand Down Expand Up @@ -7639,7 +7639,7 @@ pub fn rlGetShaderIdDefault() u32 {
}

/// Get default shader locations
pub fn rlGetShaderLocsDefault() [*]const i32 {
pub fn rlGetShaderLocsDefault() ?[*]i32 {
return @as(
?[*]i32,
@ptrCast(raylib.mrlGetShaderLocsDefault()),
Expand Down Expand Up @@ -8001,7 +8001,7 @@ pub fn rlReadTexturePixels(
width: i32,
height: i32,
format: i32,
) [*]const anyopaque {
) *anyopaque {
return @as(
*anyopaque,
@ptrCast(raylib.mrlReadTexturePixels(
Expand Down

0 comments on commit 5ca39b5

Please sign in to comment.