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 63809c99c97d225761e960fa3f38ecd91ce173d2..1f363b47b15ee11a516c573583ded8c92e91f52c 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 74c1e2acfc208a8e9b591e40eb2b09af1c113647..cabc4ea9efb17985d1ca217cb3ed804cd88ca663 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; -- 2.54.0