authorgravatar for thatlemon@gmail.comLemonBoy <thatlemon@gmail.com> 2019-05-06 21:42:52+02:00
committergravatar for thatlemon@gmail.comLemonBoy <thatlemon@gmail.com> 2019-05-07 11:47:23+02:00
loga3beda27fc9093b6d4d5538104d2704590d7cf2b
treeb6f71ee173b59866912097986e7abda5c5717efc
parent939ec878a00803502f2e07347c09fa6736c5f44a

Add missing cast to usize


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

std/io.zig+1-1
...@@ -290,7 +290,7 @@ pub fn readFileAllocAligned(allocator: *mem.Allocator, path: []const u8, comptim...@@ -290,7 +290,7 @@ pub fn readFileAllocAligned(allocator: *mem.Allocator, path: []const u8, comptim
290 var file = try File.openRead(path);290 var file = try File.openRead(path);
291 defer file.close();291 defer file.close();
292292
293 const size = try file.getEndPos();293 const size = try math.cast(usize, try file.getEndPos());
294 const buf = try allocator.alignedAlloc(u8, A, size);294 const buf = try allocator.alignedAlloc(u8, A, size);
295 errdefer allocator.free(buf);295 errdefer allocator.free(buf);
296296
std/zig/render.zig+1-1
...@@ -748,7 +748,7 @@ fn renderExpression(...@@ -748,7 +748,7 @@ fn renderExpression(
748 counting_stream.bytes_written = 0;748 counting_stream.bytes_written = 0;
749 var dummy_col: usize = 0;749 var dummy_col: usize = 0;
750 try renderExpression(allocator, &counting_stream.stream, tree, 0, &dummy_col, expr.*, Space.None);750 try renderExpression(allocator, &counting_stream.stream, tree, 0, &dummy_col, expr.*, Space.None);
751 const width = counting_stream.bytes_written;751 const width = @intCast(usize, counting_stream.bytes_written);
752 const col = i % row_size;752 const col = i % row_size;
753 column_widths[col] = std.math.max(column_widths[col], width);753 column_widths[col] = std.math.max(column_widths[col], width);
754 expr_widths[i] = width;754 expr_widths[i] = width;