zig compatibility
This commit is contained in:
parent
4785ed029f
commit
f5b50068b7
@ -33,7 +33,7 @@ Project goals
|
|||||||
Dependencies
|
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.
|
2. [cmph][cmph]: bundled with this repository.
|
||||||
|
|
||||||
Building
|
Building
|
||||||
|
@ -159,7 +159,7 @@ pub fn init(
|
|||||||
// returning from this function. This keeps the arena clean.
|
// returning from this function. This keeps the arena clean.
|
||||||
var user2groups = try baseAllocator.alloc(ArrayListUnmanaged(u32), users.len);
|
var user2groups = try baseAllocator.alloc(ArrayListUnmanaged(u32), users.len);
|
||||||
defer baseAllocator.free(user2groups);
|
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| {
|
for (groups.items(.members), groups.items(.name), 0..) |groupmembers, name, i| {
|
||||||
var members = try allocator.alloc(u32, groupmembers.len);
|
var members = try allocator.alloc(u32, groupmembers.len);
|
||||||
|
@ -903,8 +903,8 @@ test "DB pack gids" {
|
|||||||
const k2 = bdz.search_u32(cmph_gid, 128);
|
const k2 = bdz.search_u32(cmph_gid, 128);
|
||||||
const k3 = bdz.search_u32(cmph_gid, 9999);
|
const k3 = bdz.search_u32(cmph_gid, 9999);
|
||||||
const k4 = bdz.search_u32(cmph_gid, 100000);
|
const k4 = bdz.search_u32(cmph_gid, 100000);
|
||||||
var hashes = &[_]u32{ k1, k2, k3, k4 };
|
var hashes = [_]u32{ k1, k2, k3, k4 };
|
||||||
sort.sort(u32, hashes, {}, comptime sort.asc(u32));
|
sort.sort(u32, &hashes, {}, comptime sort.asc(u32));
|
||||||
for (hashes, 0..) |hash, i|
|
for (hashes, 0..) |hash, i|
|
||||||
try testing.expectEqual(i, hash);
|
try testing.expectEqual(i, hash);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user