Commit a3beda27fc

LemonBoy <thatlemon@gmail.com>
2019-05-06 21:42:52
Add missing cast to usize
1 parent 939ec87
Changed files (2)
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;
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);