Skip to content

Commit

Permalink
fix zig master
Browse files Browse the repository at this point in the history
  • Loading branch information
jiacai2050 committed Mar 23, 2024
1 parent 1e83260 commit 36972e7
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
12 changes: 10 additions & 2 deletions src/bin/loc.zig
Original file line number Diff line number Diff line change
Expand Up @@ -350,8 +350,16 @@ fn populateLoc(allocator: std.mem.Allocator, loc_map: *LocMap, dir: fs.Dir, base
}
},
else => {
var ptr = try std.os.mmap(null, file_size, std.os.PROT.READ, std.os.MAP.PRIVATE, file.handle, 0);
defer std.os.munmap(ptr);
var ptr = try std.posix.mmap(
null,
file_size,
std.posix.PROT.READ,
.{ .TYPE = .PRIVATE },

file.handle,
0,
);
defer std.posix.munmap(ptr);

var offset_so_far: usize = 0;
while (offset_so_far < ptr.len) {
Expand Down
6 changes: 3 additions & 3 deletions src/mod/simargs.zig
Original file line number Diff line number Diff line change
Expand Up @@ -612,7 +612,7 @@ test "parse/valid option values" {
\\
\\ OPTIONS:
\\ -h, --help print this help message(required)
\\ -r, --rate FLOAT (default: 2.0e+00)
\\ -r, --rate FLOAT (default: 2e0)
\\ --timeout INTEGER (required)
\\ --user-agent STRING (default: Brave)
\\
Expand Down Expand Up @@ -773,8 +773,8 @@ test "parse/default value" {
\\ --a2 STRING (default: A2)
\\ --b1 INTEGER (default: 1)
\\ --b2 INTEGER (default: 11)
\\ --c1 FLOAT (default: 1.5e+00)
\\ --c2 FLOAT (default: 2.5e+00)
\\ --c1 FLOAT (default: 1.5e0)
\\ --c2 FLOAT (default: 2.5e0)
\\ --d1 (default: true)
\\ --d2 padding message
\\
Expand Down

0 comments on commit 36972e7

Please sign in to comment.