Commit 132813849c

Jan Prudil <57442prudil@sstebrno.eu>
2020-10-17 14:50:26
Convert remaining call sites
1 parent aadccc4
Changed files (2)
lib
test
stage1
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);
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();