zig

fork of https://codeberg.org/ziglang/zig
Log | Files | Refs | README | LICENSE

commit 906ed059ce7c5c9acb5088d38d9da76ad5c93407 (tree)
parent 431fda414189e012252614c7cf3702b46b305e35
Author: Andrew Kelley <superjoe30@gmail.com>
Date:   Mon, 18 Jun 2018 00:52:55 -0400

update std.DynLib to use @intCast

Diffstat:
Mstd/dynamic_library.zig | 6+++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git 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| {