diff --git a/scripts/_common.zig b/scripts/_common.zig index 4e8821bc57073cd451f874f62e06c14713646bfc..cd98eff56590eb1970f9dc52057a70ac9fc8cd5e 100644 --- a/scripts/_common.zig +++ b/scripts/_common.zig @@ -12,7 +12,7 @@ pub fn Main(comptime T: type) type { return struct { pub fn do() !void { var gpa = std.heap.GeneralPurposeAllocator(.{}){}; - const alloc = &gpa.allocator; + const alloc = gpa.allocator(); defer _ = gpa.deinit(); const max_size = std.math.maxInt(usize); @@ -41,7 +41,7 @@ pub fn Main(comptime T: type) type { var line_num: usize = 1; std.debug.print("\n", .{}); - const arena = &std.heap.ArenaAllocator.init(alloc); + var arena = std.heap.ArenaAllocator.init(alloc); defer arena.deinit(); while (true) { const line = r.readUntilDelimiterAlloc(alloc, '\n', max_size) catch |e| if (e == error.EndOfStream) break else return e; @@ -54,7 +54,7 @@ pub fn Main(comptime T: type) type { continue; } - if (!(try T.exec(&arena.allocator, line, w))) { + if (!(try T.exec(arena.allocator(), line, w))) { break; } diff --git a/scripts/arabic_shaping.zig b/scripts/arabic_shaping.zig index b784486cf2ac59c875b91b96a717b158cb5d547c..6bde80fc7e2a865aed6e501701d51ecdf649346c 100644 --- a/scripts/arabic_shaping.zig +++ b/scripts/arabic_shaping.zig @@ -139,8 +139,8 @@ pub const default = common.Main(struct { \\ ; - pub fn exec(alloc: *std.mem.Allocator, line: []const u8, writer: anytype) !bool { - var it = std.mem.split(line, ";"); + pub fn exec(alloc: std.mem.Allocator, line: []const u8, writer: anytype) !bool { + var it = std.mem.split(u8, line, ";"); const c = std.mem.trim(u8, it.next().?, " "); const n = std.mem.trim(u8, it.next().?, " "); const t = std.mem.trim(u8, it.next().?, " "); diff --git a/scripts/bidi_brackets.zig b/scripts/bidi_brackets.zig index 71ce029ea33a5a79a1982d59ba1c346449a836ff..41c97d0d948fa7746d4c54944d9fd0d86141dd2d 100644 --- a/scripts/bidi_brackets.zig +++ b/scripts/bidi_brackets.zig @@ -28,8 +28,10 @@ pub const default = common.Main(struct { \\ ; - pub fn exec(alloc: *std.mem.Allocator, line: []const u8, writer: anytype) !bool { - var it = std.mem.split(line, ";"); + pub fn exec(alloc: std.mem.Allocator, line: []const u8, writer: anytype) !bool { + _ = alloc; + + var it = std.mem.split(u8, line, ";"); const a = std.mem.trim(u8, it.next().?, " "); const b = std.mem.trim(u8, it.next().?, " "); const c = std.mem.trim(u8, it.next().?, " "); diff --git a/scripts/blocks.zig b/scripts/blocks.zig index 4aa7fab39dcd07e49e80c417242f61da8b565c0e..4ef24d1fc90fb32201dd2c42688714f1022d8009 100644 --- a/scripts/blocks.zig +++ b/scripts/blocks.zig @@ -22,9 +22,11 @@ pub const default = common.Main(struct { \\ ; - pub fn exec(alloc: *std.mem.Allocator, line: []const u8, writer: anytype) !bool { - var it1 = std.mem.split(line, "; "); - var it2 = std.mem.split(it1.next().?, ".."); + pub fn exec(alloc: std.mem.Allocator, line: []const u8, writer: anytype) !bool { + _ = alloc; + + var it1 = std.mem.split(u8, line, "; "); + var it2 = std.mem.split(u8, it1.next().?, ".."); const from = it2.next().?; const to = it2.next().?; const name = it1.next().?; diff --git a/zig.mod b/zig.mod index d10198eeda78ad343dc21880fcc2e221e03bf5c1..6b9556c9b8c708c8389a66aa17f511725e7a39a5 100644 --- a/zig.mod +++ b/zig.mod @@ -4,6 +4,7 @@ main: src/lib.zig license: MIT description: Zig bindings for the Unicode Character Database root_dependencies: + - src: git https://github.com/nektro/iguanaTLS - src: git https://github.com/truemedian/zfetch - src: git https://github.com/nektro/zig-ansi - src: git https://github.com/nektro/zig-fmt-valueliteral