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 --- lib/std/sort/pdq.zig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/std/sort') diff --git a/lib/std/sort/pdq.zig b/lib/std/sort/pdq.zig index 23678a79c6..795dd29fc5 100644 --- a/lib/std/sort/pdq.zig +++ b/lib/std/sort/pdq.zig @@ -251,7 +251,7 @@ fn breakPatterns(a: usize, b: usize, context: anytype) void { const len = b - a; if (len < 8) return; - var rand = @intCast(u64, len); + var rand = @as(u64, @intCast(len)); const modulus = math.ceilPowerOfTwoAssert(u64, len); var i = a + (len / 4) * 2 - 1; @@ -261,7 +261,7 @@ fn breakPatterns(a: usize, b: usize, context: anytype) void { rand ^= rand >> 7; rand ^= rand << 17; - var other = @intCast(usize, rand & (modulus - 1)); + var other = @as(usize, @intCast(rand & (modulus - 1))); if (other >= len) other -= len; context.swap(i, a + other); } -- cgit v1.2.3