authorgravatar for thatlemon@gmail.comLemonBoy <thatlemon@gmail.com> 2021-05-07 09:44:33+02:00
committergravatar for thatlemon@gmail.comLemonBoy <thatlemon@gmail.com> 2021-05-11 12:33:47+02:00
log679876ba7266e6a9eac73705280a39158808bd52
treed613f7c979820ceb14b6bb5a890fa4fc7da28388
parenta909db6aea38f65ffe996d61a62a4f1bd2cbc44c

c: Fix prototypes for bcmp and memcmp

They return c_int and not isize.

1 files changed, 2 insertions(+), 2 deletions(-)

lib/std/special/c.zig+2-2
...@@ -225,7 +225,7 @@ export fn memmove(dest: ?[*]u8, src: ?[*]const u8, n: usize) callconv(.C) ?[*]u8...@@ -225,7 +225,7 @@ export fn memmove(dest: ?[*]u8, src: ?[*]const u8, n: usize) callconv(.C) ?[*]u8
225 return dest;225 return dest;
226}226}
227227
228export fn memcmp(vl: ?[*]const u8, vr: ?[*]const u8, n: usize) callconv(.C) isize {228export fn memcmp(vl: ?[*]const u8, vr: ?[*]const u8, n: usize) callconv(.C) c_int {
229 @setRuntimeSafety(false);229 @setRuntimeSafety(false);
230230
231 var index: usize = 0;231 var index: usize = 0;
...@@ -250,7 +250,7 @@ test "memcmp" {...@@ -250,7 +250,7 @@ test "memcmp" {
250 try std.testing.expect(memcmp(base_arr[0..], arr3[0..], base_arr.len) < 0);250 try std.testing.expect(memcmp(base_arr[0..], arr3[0..], base_arr.len) < 0);
251}251}
252252
253export fn bcmp(vl: [*]allowzero const u8, vr: [*]allowzero const u8, n: usize) callconv(.C) isize {253export fn bcmp(vl: [*]allowzero const u8, vr: [*]allowzero const u8, n: usize) callconv(.C) c_int {
254 @setRuntimeSafety(false);254 @setRuntimeSafety(false);
255255
256 var index: usize = 0;256 var index: usize = 0;