| author | |
| committer | |
| log | 4f0aa7d639e099b18df583cb984412037fbb1dbe |
| tree | 1ef3e04948909487d22bce82d65d96d362ec4001 |
| parent | 3b9ec4e4df634b17268034a6a5527c11cf67e54b |
The intermediate value can be larger than an u16, so @truncate is needed
to match the behavior of musl.3 files changed, 3 insertions(+), 3 deletions(-)
lib/std/os/bits/dragonfly.zig+1-1| ... | @@ -348,7 +348,7 @@ pub fn WIFEXITED(s: u32) bool { | ... | @@ -348,7 +348,7 @@ pub fn WIFEXITED(s: u32) bool { |
| 348 | return WTERMSIG(s) == 0; | 348 | return WTERMSIG(s) == 0; |
| 349 | } | 349 | } |
| 350 | pub fn WIFSTOPPED(s: u32) bool { | 350 | pub fn WIFSTOPPED(s: u32) bool { |
| 351 | return @intCast(u16, (((s & 0xffff) *% 0x10001) >> 8)) > 0x7f00; | 351 | return @truncate(u16, (((s & 0xffff) *% 0x10001) >> 8)) > 0x7f00; |
| 352 | } | 352 | } |
| 353 | pub fn WIFSIGNALED(s: u32) bool { | 353 | pub fn WIFSIGNALED(s: u32) bool { |
| 354 | return (s & 0xffff) -% 1 < 0xff; | 354 | return (s & 0xffff) -% 1 < 0xff; |
lib/std/os/bits/freebsd.zig+1-1| ... | @@ -741,7 +741,7 @@ pub fn WIFEXITED(s: u32) bool { | ... | @@ -741,7 +741,7 @@ pub fn WIFEXITED(s: u32) bool { |
| 741 | return WTERMSIG(s) == 0; | 741 | return WTERMSIG(s) == 0; |
| 742 | } | 742 | } |
| 743 | pub fn WIFSTOPPED(s: u32) bool { | 743 | pub fn WIFSTOPPED(s: u32) bool { |
| 744 | return @intCast(u16, (((s & 0xffff) *% 0x10001) >> 8)) > 0x7f00; | 744 | return @truncate(u16, (((s & 0xffff) *% 0x10001) >> 8)) > 0x7f00; |
| 745 | } | 745 | } |
| 746 | pub fn WIFSIGNALED(s: u32) bool { | 746 | pub fn WIFSIGNALED(s: u32) bool { |
| 747 | return (s & 0xffff) -% 1 < 0xff; | 747 | return (s & 0xffff) -% 1 < 0xff; |
lib/std/os/bits/linux.zig+1-1| ... | @@ -1066,7 +1066,7 @@ pub fn WIFEXITED(s: u32) bool { | ... | @@ -1066,7 +1066,7 @@ pub fn WIFEXITED(s: u32) bool { |
| 1066 | return WTERMSIG(s) == 0; | 1066 | return WTERMSIG(s) == 0; |
| 1067 | } | 1067 | } |
| 1068 | pub fn WIFSTOPPED(s: u32) bool { | 1068 | pub fn WIFSTOPPED(s: u32) bool { |
| 1069 | return @intCast(u16, ((s & 0xffff) *% 0x10001) >> 8) > 0x7f00; | 1069 | return @truncate(u16, ((s & 0xffff) *% 0x10001) >> 8) > 0x7f00; |
| 1070 | } | 1070 | } |
| 1071 | pub fn WIFSIGNALED(s: u32) bool { | 1071 | pub fn WIFSIGNALED(s: u32) bool { |
| 1072 | return (s & 0xffff) -% 1 < 0xff; | 1072 | return (s & 0xffff) -% 1 < 0xff; |