authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2018-06-18 00:52:55-04:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2018-06-18 00:52:55-04:00
log906ed059ce7c5c9acb5088d38d9da76ad5c93407
treecc5489cfa1e3b9e1ee8fc268e36ae32c12756aa7
parent431fda414189e012252614c7cf3702b46b305e35

update std.DynLib to use @intCast


1 files changed, 3 insertions(+), 3 deletions(-)

std/dynamic_library.zig+3-3
...@@ -16,7 +16,7 @@ pub const DynLib = struct {...@@ -16,7 +16,7 @@ pub const DynLib = struct {
16 const fd = try std.os.posixOpen(allocator, path, 0, linux.O_RDONLY | linux.O_CLOEXEC);16 const fd = try std.os.posixOpen(allocator, path, 0, linux.O_RDONLY | linux.O_CLOEXEC);
17 errdefer std.os.close(fd);17 errdefer std.os.close(fd);
1818
19 const size = usize((try std.os.posixFStat(fd)).size);19 const size = @intCast(usize, (try std.os.posixFStat(fd)).size);
2020
21 const addr = linux.mmap(21 const addr = linux.mmap(
22 null,22 null,
...@@ -126,8 +126,8 @@ pub const ElfLib = struct {...@@ -126,8 +126,8 @@ pub const ElfLib = struct {
126126
127 var i: usize = 0;127 var i: usize = 0;
128 while (i < self.hashtab[1]) : (i += 1) {128 while (i < self.hashtab[1]) : (i += 1) {
129 if (0 == (u32(1) << u5(self.syms[i].st_info & 0xf) & OK_TYPES)) continue;129 if (0 == (u32(1) << @intCast(u5, self.syms[i].st_info & 0xf) & OK_TYPES)) continue;
130 if (0 == (u32(1) << u5(self.syms[i].st_info >> 4) & OK_BINDS)) continue;130 if (0 == (u32(1) << @intCast(u5, self.syms[i].st_info >> 4) & OK_BINDS)) continue;
131 if (0 == self.syms[i].st_shndx) continue;131 if (0 == self.syms[i].st_shndx) continue;
132 if (!mem.eql(u8, name, cstr.toSliceConst(self.strings + self.syms[i].st_name))) continue;132 if (!mem.eql(u8, name, cstr.toSliceConst(self.strings + self.syms[i].st_name))) continue;
133 if (maybe_versym) |versym| {133 if (maybe_versym) |versym| {