diff options
| author | Vexu <git@vexu.eu> | 2019-12-05 20:20:38 +0200 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2019-12-05 15:47:06 -0500 |
| commit | bfb15f1c9f1b4a33cfd8e58cdefc3a0d98a015d2 (patch) | |
| tree | ee257da4316c3e53d9ddd34769cbffe7440b88ab /lib/std | |
| parent | 1baaf9a503bd399f4da4a9d3e80695b1739ea966 (diff) | |
| download | zig-bfb15f1c9f1b4a33cfd8e58cdefc3a0d98a015d2.tar.gz zig-bfb15f1c9f1b4a33cfd8e58cdefc3a0d98a015d2.zip | |
fix casts
Diffstat (limited to 'lib/std')
| -rw-r--r-- | lib/std/c/hermit.zig | 4 | ||||
| -rw-r--r-- | lib/std/meta.zig | 2 | ||||
| -rw-r--r-- | lib/std/os/bits/linux.zig | 2 |
3 files changed, 4 insertions, 4 deletions
diff --git a/lib/std/c/hermit.zig b/lib/std/c/hermit.zig index b9be76c3ba..1730aa43ac 100644 --- a/lib/std/c/hermit.zig +++ b/lib/std/c/hermit.zig @@ -1,6 +1,6 @@ pub const pthread_mutex_t = extern struct { - inner: usize = ~usize(0), + inner: usize = ~@as(usize, 0), }; pub const pthread_cond_t = extern struct { - inner: usize = ~usize(0), + inner: usize = ~@as(usize, 0), }; diff --git a/lib/std/meta.zig b/lib/std/meta.zig index b770b97a47..2352c0bfff 100644 --- a/lib/std/meta.zig +++ b/lib/std/meta.zig @@ -548,7 +548,7 @@ pub fn intToEnum(comptime Tag: type, tag_int: var) IntToEnumError!Tag { pub fn fieldIndex(comptime T: type, comptime name: []const u8) ?comptime_int { inline for (fields(T)) |field, i| { if (mem.eql(u8, field.name, name)) - return comptime_int(i); + return i; } return null; } diff --git a/lib/std/os/bits/linux.zig b/lib/std/os/bits/linux.zig index 52cc5a710d..a6d010e26d 100644 --- a/lib/std/os/bits/linux.zig +++ b/lib/std/os/bits/linux.zig @@ -951,7 +951,7 @@ pub fn cap_valid(u8: x) bool { } pub fn CAP_TO_MASK(cap: u8) u32 { - return @as(u32, 1) << u5(cap & 31); + return @as(u32, 1) << @intCast(u5, cap & 31); } pub fn CAP_TO_INDEX(cap: u8) u8 { |
