Skip to content

Commit

Permalink
update std.DynLib to use @intcast
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewrk committed Jun 18, 2018
1 parent 431fda4 commit 906ed05
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions std/dynamic_library.zig
Expand Up @@ -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,
Expand Down Expand Up @@ -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| {
Expand Down

0 comments on commit 906ed05

Please sign in to comment.