fix casts

master
Vexu 2019-12-05 20:20:38 +02:00 committed by Andrew Kelley
parent 1baaf9a503
commit bfb15f1c9f
3 changed files with 4 additions and 4 deletions

View File

@ -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),
};

View File

@ -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;
}

View File

@ -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 {