| author | |
| committer | |
| log | c95791d223efb5113f17568fc9536d4e19a03900 |
| tree | ec2d50d918108e629dc89319c8c7bed8d39e01d9 |
| parent | 751cbb34ca5562ec8c148b4d77707c9c011ad5aa |
2 files changed, 3 insertions(+), 3 deletions(-)
AnyReadable.zig+2-2| ... | @@ -3,8 +3,8 @@ const std = @import("std"); | ... | @@ -3,8 +3,8 @@ const std = @import("std"); |
| 3 | const nio = @import("./nio.zig"); | 3 | const nio = @import("./nio.zig"); |
| 4 | const AnyReadable = @This(); | 4 | const AnyReadable = @This(); |
| 5 | 5 | ||
| 6 | readFn: *const fn (*anyopaque, []u8) anyerror!usize, | 6 | readFn: *const fn (*allowzero anyopaque, []u8) anyerror!usize, |
| 7 | state: *anyopaque, | 7 | state: *allowzero anyopaque, |
| 8 | 8 | ||
| 9 | pub fn read(r: *AnyReadable, buffer: []u8) !usize { | 9 | pub fn read(r: *AnyReadable, buffer: []u8) !usize { |
| 10 | return r.readFn(r.state, buffer); | 10 | return r.readFn(r.state, buffer); |
fixed_buffer_stream.zig+1-1| ... | @@ -29,7 +29,7 @@ pub fn FixedBufferStream(comptime Buffer: type) type { | ... | @@ -29,7 +29,7 @@ pub fn FixedBufferStream(comptime Buffer: type) type { |
| 29 | 29 | ||
| 30 | pub fn anyReadable(self: *Self) nio.AnyReadable { | 30 | pub fn anyReadable(self: *Self) nio.AnyReadable { |
| 31 | const S = struct { | 31 | const S = struct { |
| 32 | fn foo(s: *anyopaque, buffer: []u8) anyerror!usize { | 32 | fn foo(s: *allowzero anyopaque, buffer: []u8) anyerror!usize { |
| 33 | const fbs: *Self = @ptrCast(@alignCast(s)); | 33 | const fbs: *Self = @ptrCast(@alignCast(s)); |
| 34 | return fbs.read(buffer); | 34 | return fbs.read(buffer); |
| 35 | } | 35 | } |