mirror of
https://codeberg.org/ziglang/zig.git
synced 2025-12-06 13:54:21 +00:00
update std.DynLib to use @intCast
This commit is contained in:
parent
431fda4141
commit
906ed059ce
1 changed files with 3 additions and 3 deletions
|
|
@ -16,7 +16,7 @@ pub const DynLib = struct {
|
||||||
const fd = try std.os.posixOpen(allocator, path, 0, linux.O_RDONLY | linux.O_CLOEXEC);
|
const fd = try std.os.posixOpen(allocator, path, 0, linux.O_RDONLY | linux.O_CLOEXEC);
|
||||||
errdefer std.os.close(fd);
|
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(
|
const addr = linux.mmap(
|
||||||
null,
|
null,
|
||||||
|
|
@ -126,8 +126,8 @@ pub const ElfLib = struct {
|
||||||
|
|
||||||
var i: usize = 0;
|
var i: usize = 0;
|
||||||
while (i < self.hashtab[1]) : (i += 1) {
|
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) << @intCast(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 >> 4) & OK_BINDS)) continue;
|
||||||
if (0 == self.syms[i].st_shndx) 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 (!mem.eql(u8, name, cstr.toSliceConst(self.strings + self.syms[i].st_name))) continue;
|
||||||
if (maybe_versym) |versym| {
|
if (maybe_versym) |versym| {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue