From 906ed059ce7c5c9acb5088d38d9da76ad5c93407 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Mon, 18 Jun 2018 00:52:55 -0400 Subject: [PATCH] update std.DynLib to use @intCast --- std/dynamic_library.zig | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/std/dynamic_library.zig b/std/dynamic_library.zig index 8fe5f7f81..ed190f7de 100644 --- a/std/dynamic_library.zig +++ b/std/dynamic_library.zig @@ -16,7 +16,7 @@ pub const DynLib = struct { const fd = try std.os.posixOpen(allocator, path, 0, linux.O_RDONLY | linux.O_CLOEXEC); errdefer std.os.close(fd); - const size = usize((try std.os.posixFStat(fd)).size); + const size = @intCast(usize, (try std.os.posixFStat(fd)).size); const addr = linux.mmap( null, @@ -126,8 +126,8 @@ pub const ElfLib = struct { var i: usize = 0; while (i < self.hashtab[1]) : (i += 1) { - if (0 == (u32(1) << u5(self.syms[i].st_info & 0xf) & OK_TYPES)) continue; - if (0 == (u32(1) << u5(self.syms[i].st_info >> 4) & OK_BINDS)) continue; + if (0 == (u32(1) << @intCast(u5, self.syms[i].st_info & 0xf) & OK_TYPES)) continue; + if (0 == (u32(1) << @intCast(u5, self.syms[i].st_info >> 4) & OK_BINDS)) continue; if (0 == self.syms[i].st_shndx) continue; if (!mem.eql(u8, name, cstr.toSliceConst(self.strings + self.syms[i].st_name))) continue; if (maybe_versym) |versym| {