From f26dda21171e26f44aeec8c59a75bbb3331eeb2e Mon Sep 17 00:00:00 2001 From: mlugg Date: Thu, 22 Jun 2023 18:46:56 +0100 Subject: all: migrate code to new cast builtin syntax Most of this migration was performed automatically with `zig fmt`. There were a few exceptions which I had to manually fix: * `@alignCast` and `@addrSpaceCast` cannot be automatically rewritten * `@truncate`'s fixup is incorrect for vectors * Test cases are not formatted, and their error locations change --- test/behavior/floatop.zig | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'test/behavior/floatop.zig') diff --git a/test/behavior/floatop.zig b/test/behavior/floatop.zig index 56f3885a4a..e21645ae8f 100644 --- a/test/behavior/floatop.zig +++ b/test/behavior/floatop.zig @@ -94,7 +94,7 @@ test "negative f128 intFromFloat at compile-time" { if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO const a: f128 = -2; - var b = @intFromFloat(i64, a); + var b = @as(i64, @intFromFloat(a)); try expect(@as(i64, -2) == b); } @@ -387,11 +387,11 @@ fn testLog() !void { } { var a: f32 = e; - try expect(@log(a) == 1 or @log(a) == @bitCast(f32, @as(u32, 0x3f7fffff))); + try expect(@log(a) == 1 or @log(a) == @as(f32, @bitCast(@as(u32, 0x3f7fffff)))); } { var a: f64 = e; - try expect(@log(a) == 1 or @log(a) == @bitCast(f64, @as(u64, 0x3ff0000000000000))); + try expect(@log(a) == 1 or @log(a) == @as(f64, @bitCast(@as(u64, 0x3ff0000000000000)))); } inline for ([_]type{ f16, f32, f64 }) |ty| { const eps = epsForType(ty); -- cgit v1.2.3