Skip to content

Commit 906ed05

Browse files
committedJun 18, 2018
update std.DynLib to use @intcast
·
0.15.20.3.0
1 parent 431fda4 commit 906ed05

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed
 

‎std/dynamic_library.zig‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ pub const DynLib = struct {
1616
const fd = try std.os.posixOpen(allocator, path, 0, linux.O_RDONLY | linux.O_CLOEXEC);
1717
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

2121
const addr = linux.mmap(
2222
null,
@@ -126,8 +126,8 @@ pub const ElfLib = struct {
126126

127127
var i: usize = 0;
128128
while (i < self.hashtab[1]) : (i += 1) {
129-
if (0 == (u32(1) << 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;
129+
if (0 == (u32(1) << @intCast(u5, self.syms[i].st_info & 0xf) & OK_TYPES)) continue;
130+
if (0 == (u32(1) << @intCast(u5, self.syms[i].st_info >> 4) & OK_BINDS)) continue;
131131
if (0 == self.syms[i].st_shndx) continue;
132132
if (!mem.eql(u8, name, cstr.toSliceConst(self.strings + self.syms[i].st_name))) continue;
133133
if (maybe_versym) |versym| {

0 commit comments

Comments
 (0)
Please sign in to comment.