authorgravatar for thatlemon@gmail.comLemonBoy <thatlemon@gmail.com> 2019-05-03 22:23:08+02:00
committergravatar for thatlemon@gmail.comLemonBoy <thatlemon@gmail.com> 2019-05-03 22:42:45+02:00
log077216b58205fc3fa4920a6e2cbcf9565b2c7116
treecafa29c6c66a640f7838c982991e2e6b947f40eb
parentfbcc559cdbe67b711ea24a152aa7bb3a10bb06c7

Address the comments of the first review round


2 files changed, 4 insertions(+), 8 deletions(-)

std/io.zig+2-2
......@@ -232,9 +232,9 @@ pub fn OutStream(comptime WriteError: type) type {
232232 return self.writeFn(self, slice);
233233 }
234234
235 pub fn writeByteNTimes(self: *Self, byte: u8, n: u64) Error!void {
235 pub fn writeByteNTimes(self: *Self, byte: u8, n: usize) Error!void {
236236 const slice = (*const [1]u8)(&byte)[0..];
237 var i: u64 = 0;
237 var i: usize = 0;
238238 while (i < n) : (i += 1) {
239239 try self.writeFn(self, slice);
240240 }
std/os/file.zig+2-6
......@@ -301,7 +301,6 @@ pub const File = struct {
301301 }
302302
303303 pub const GetSeekPosError = error{
304 Overflow,
305304 SystemResources,
306305 Unseekable,
307306 Unexpected,
......@@ -324,7 +323,7 @@ pub const File = struct {
324323 else => os.unexpectedErrorPosix(err),
325324 };
326325 }
327 return @intCast(u64, result);
326 return u64(result);
328327 },
329328 Os.windows => {
330329 var pos: windows.LARGE_INTEGER = undefined;
......@@ -336,8 +335,7 @@ pub const File = struct {
336335 };
337336 }
338337
339 assert(pos >= 0);
340 return math.cast(u64, pos);
338 return @intCast(u64, pos);
341339 },
342340 else => @compileError("unsupported OS"),
343341 }
......@@ -355,8 +353,6 @@ pub const File = struct {
355353 else => os.unexpectedErrorWindows(err),
356354 };
357355 }
358 if (file_size < 0)
359 return error.Overflow;
360356 return @intCast(u64, file_size);
361357 } else {
362358 @compileError("TODO support getEndPos on this OS");