mirror of
https://github.com/ziglang/zig.git
synced 2026-02-15 13:58:27 +00:00
Add missing cast to usize
This commit is contained in:
parent
939ec878a0
commit
a3beda27fc
@ -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);
|
||||
|
||||
|
||||
@ -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;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user