mirror of
https://github.com/ziglang/zig.git
synced 2026-02-14 13:30:45 +00:00
Convert remaining call sites
This commit is contained in:
parent
aadccc4206
commit
132813849c
@ -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);
|
||||
|
||||
@ -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();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user