zig compatibility

This commit is contained in:
Motiejus Jakštys 2023-05-19 15:40:27 +03:00
parent 4785ed029f
commit f5b50068b7
3 changed files with 4 additions and 4 deletions

View File

@ -33,7 +33,7 @@ Project goals
Dependencies
------------
1. zig around `0.11.0-dev.2560+602029bb2`.
1. zig around `0.11.0-dev.3132+465272921`.
2. [cmph][cmph]: bundled with this repository.
Building

View File

@ -159,7 +159,7 @@ pub fn init(
// returning from this function. This keeps the arena clean.
var user2groups = try baseAllocator.alloc(ArrayListUnmanaged(u32), users.len);
defer baseAllocator.free(user2groups);
mem.set(ArrayListUnmanaged(u32), user2groups, ArrayListUnmanaged(u32){});
@memset(user2groups, ArrayListUnmanaged(u32){});
for (groups.items(.members), groups.items(.name), 0..) |groupmembers, name, i| {
var members = try allocator.alloc(u32, groupmembers.len);

View File

@ -903,8 +903,8 @@ test "DB pack gids" {
const k2 = bdz.search_u32(cmph_gid, 128);
const k3 = bdz.search_u32(cmph_gid, 9999);
const k4 = bdz.search_u32(cmph_gid, 100000);
var hashes = &[_]u32{ k1, k2, k3, k4 };
sort.sort(u32, hashes, {}, comptime sort.asc(u32));
var hashes = [_]u32{ k1, k2, k3, k4 };
sort.sort(u32, &hashes, {}, comptime sort.asc(u32));
for (hashes, 0..) |hash, i|
try testing.expectEqual(i, hash);
}