From 132813849ce593db232751e55c0d0fe7636d87f1 Mon Sep 17 00:00:00 2001 From: Jan Prudil <57442prudil@sstebrno.eu> Date: Sat, 17 Oct 2020 14:50:26 +0200 Subject: [PATCH] Convert remaining call sites --- lib/std/packed_int_array.zig | 8 ++++---- test/stage1/behavior/bit_shifting.zig | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/std/packed_int_array.zig b/lib/std/packed_int_array.zig index af4975207d..9cc3a0af1a 100644 --- a/lib/std/packed_int_array.zig +++ b/lib/std/packed_int_array.zig @@ -332,8 +332,8 @@ test "PackedIntArray" { comptime var bits = 0; inline while (bits <= max_bits) : (bits += 1) { //alternate unsigned and signed - const even = bits % 2 == 0; - const I = std.meta.Int(even, bits); + const sign: std.meta.Signedness = if (bits % 2 == 0) .signed else .unsigned; + const I = std.meta.Int(sign, bits); const PackedArray = PackedIntArray(I, int_count); const expected_bytes = ((bits * int_count) + 7) / 8; @@ -384,8 +384,8 @@ test "PackedIntSlice" { comptime var bits = 0; inline while (bits <= max_bits) : (bits += 1) { //alternate unsigned and signed - const even = bits % 2 == 0; - const I = std.meta.Int(even, bits); + const sign: std.meta.Signedness = if (bits % 2 == 0) .signed else .unsigned; + const I = std.meta.Int(sign, bits); const P = PackedIntSlice(I); var data = P.init(&buffer, int_count); diff --git a/test/stage1/behavior/bit_shifting.zig b/test/stage1/behavior/bit_shifting.zig index 786cef0802..746d598237 100644 --- a/test/stage1/behavior/bit_shifting.zig +++ b/test/stage1/behavior/bit_shifting.zig @@ -3,10 +3,10 @@ const expect = std.testing.expect; fn ShardedTable(comptime Key: type, comptime mask_bit_count: comptime_int, comptime V: type) type { const key_bits = @typeInfo(Key).Int.bits; - expect(Key == std.meta.Int(false, key_bits)); + expect(Key == std.meta.Int(.unsigned, key_bits)); expect(key_bits >= mask_bit_count); const shard_key_bits = mask_bit_count; - const ShardKey = std.meta.Int(false, mask_bit_count); + const ShardKey = std.meta.Int(.unsigned, mask_bit_count); const shift_amount = key_bits - shard_key_bits; return struct { const Self = @This();