authorgravatar for git@vexu.euVeikka Tuominen <git@vexu.eu> 2019-11-23 19:36:26+02:00
committergravatar for git@vexu.euVeikka Tuominen <git@vexu.eu> 2019-11-23 19:36:26+02:00
log133579d7c05a92e33bd8a4cfaf5c460f48150de7
tree32a7dec3c31da1d84baa6bfedbf0b19abf854090
parent03cc81665bb28eb35c8c6d4be17b5a56fa66261f
signaturelock-open Commit is signed but in an unrecognized format.

fix casts


4 files changed, 12 insertions(+), 11 deletions(-)

src-self-hosted/compilation.zig+5-4
......@@ -548,10 +548,11 @@ pub const Compilation = struct {
548548
549549 comp.deinit_group.wait();
550550
551 if (comp.tmp_dir.getOrNull()) |tmp_dir_result| if (tmp_dir_result.*) |tmp_dir| {
552 // TODO evented I/O?
553 std.fs.deleteTree(tmp_dir) catch {};
554 } else |_| {};
551 if (comp.tmp_dir.getOrNull()) |tmp_dir_result|
552 if (tmp_dir_result.*) |tmp_dir| {
553 // TODO evented I/O?
554 std.fs.deleteTree(tmp_dir) catch {};
555 } else |_| {};
555556 }
556557
557558 /// it does ref the result because it could be an arbitrary integer size
src-self-hosted/libc_installation.zig+2-2
......@@ -138,7 +138,7 @@ pub const LibCInstallation = struct {
138138 self.static_lib_dir orelse "",
139139 self.msvc_lib_dir orelse "",
140140 self.kernel32_lib_dir orelse "",
141 self.dynamic_linker_path orelse util.getDynamicLinkerPath(Target(Target.Native)),
141 self.dynamic_linker_path orelse util.getDynamicLinkerPath(Target{ .Native = {} }),
142142 );
143143 }
144144
......@@ -382,7 +382,7 @@ pub const LibCInstallation = struct {
382382
383383 fn initEmpty(self: *LibCInstallation) void {
384384 self.* = LibCInstallation{
385 .include_dir = ([*]const u8)(undefined)[0..0],
385 .include_dir = @as([*]const u8, undefined)[0..0],
386386 .lib_dir = null,
387387 .static_lib_dir = null,
388388 .msvc_lib_dir = null,
src-self-hosted/main.zig+1-1
......@@ -631,7 +631,7 @@ fn cmdFmt(allocator: *Allocator, args: []const []const u8) !void {
631631 }
632632 if (flags.present("check")) {
633633 const anything_changed = try std.zig.render(allocator, io.null_out_stream, tree);
634 const code = if (anything_changed) u8(1) else u8(0);
634 const code: u8 = if (anything_changed) 1 else 0;
635635 process.exit(code);
636636 }
637637
src-self-hosted/type.zig+4-4
......@@ -294,7 +294,7 @@ pub const Type = struct {
294294 if (self.alignment) |self_align| {
295295 if (self_align != other.alignment.?) return false;
296296 }
297 if (@TagType(Data)(self.data) != @TagType(Data)(other.data)) return false;
297 if (@as(@TagType(Data), self.data) != @as(@TagType(Data), other.data)) return false;
298298 switch (self.data) {
299299 .Generic => |*self_generic| {
300300 const other_generic = &other.data.Generic;
......@@ -665,7 +665,7 @@ pub const Type = struct {
665665 self.mut != other.mut or
666666 self.vol != other.vol or
667667 self.size != other.size or
668 @TagType(Align)(self.alignment) != @TagType(Align)(other.alignment))
668 @as(@TagType(Align), self.alignment) != @as(@TagType(Align), other.alignment))
669669 {
670670 return false;
671671 }
......@@ -1058,7 +1058,7 @@ fn hashAny(x: var, comptime seed: u64) u32 {
10581058 comptime var rng = comptime std.rand.DefaultPrng.init(seed);
10591059 const unsigned_x = @bitCast(@IntType(false, info.bits), x);
10601060 if (info.bits <= 32) {
1061 return u32(unsigned_x) *% comptime rng.random.scalar(u32);
1061 return @as(u32, unsigned_x) *% comptime rng.random.scalar(u32);
10621062 } else {
10631063 return @truncate(u32, unsigned_x *% comptime rng.random.scalar(@typeOf(unsigned_x)));
10641064 }
......@@ -1081,7 +1081,7 @@ fn hashAny(x: var, comptime seed: u64) u32 {
10811081 if (x) |non_opt| {
10821082 return hashAny(non_opt, seed);
10831083 } else {
1084 return hashAny(u32(1), seed);
1084 return hashAny(@as(u32, 1), seed);
10851085 }
10861086 },
10871087 else => @compileError("implement hash function for " ++ @typeName(@typeOf(x))),