From a3beda27fc9093b6d4d5538104d2704590d7cf2b Mon Sep 17 00:00:00 2001 From: LemonBoy Date: Mon, 6 May 2019 21:42:52 +0200 Subject: [PATCH] Add missing cast to usize --- std/io.zig | 2 +- std/zig/render.zig | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/std/io.zig b/std/io.zig index 63809c99c9..1f363b47b1 100644 --- a/std/io.zig +++ b/std/io.zig @@ -290,7 +290,7 @@ pub fn readFileAllocAligned(allocator: *mem.Allocator, path: []const u8, comptim var file = try File.openRead(path); defer file.close(); - const size = try file.getEndPos(); + const size = try math.cast(usize, try file.getEndPos()); const buf = try allocator.alignedAlloc(u8, A, size); errdefer allocator.free(buf); diff --git a/std/zig/render.zig b/std/zig/render.zig index 74c1e2acfc..cabc4ea9ef 100644 --- a/std/zig/render.zig +++ b/std/zig/render.zig @@ -748,7 +748,7 @@ fn renderExpression( counting_stream.bytes_written = 0; var dummy_col: usize = 0; try renderExpression(allocator, &counting_stream.stream, tree, 0, &dummy_col, expr.*, Space.None); - const width = counting_stream.bytes_written; + const width = @intCast(usize, counting_stream.bytes_written); const col = i % row_size; column_widths[col] = std.math.max(column_widths[col], width); expr_widths[i] = width;