From 89d24825ecd05fb81e5fb8cc33a15f0ee1fd14c1 Mon Sep 17 00:00:00 2001 From: Meghan Denny Date: Mon, 13 Mar 2023 16:04:21 -0700 Subject: [PATCH] update to zig master 0.11.0-dev.1681+0bb178bbb closes #91 --- src/cmd/fetch.zig | 12 ++++++------ src/cmd/generate.zig | 16 ++++++++-------- src/cmd/zpm/search.zig | 3 +-- src/cmd/zpm/tags.zig | 3 +-- src/util/funcs.zig | 2 +- src/util/module.zig | 2 +- zigmod.lock | 8 ++++---- 7 files changed, 22 insertions(+), 24 deletions(-) diff --git a/src/cmd/fetch.zig b/src/cmd/fetch.zig index d1fd83ec6360057b2d4eb5fc2ba6ad9527485ecb..88be0498528b11aebca9839bf6d8bbe82df3df22 100644 --- a/src/cmd/fetch.zig +++ b/src/cmd/fetch.zig @@ -314,7 +314,7 @@ fn print_pkg_data_to(w: std.fs.File.Writer, notdone: *std.ArrayList(zigmod.Modul try w.writeAll(" &.{} },\n"); } else { try w.writeAll(" &.{"); - for (mod.deps) |moddep, j| { + for (mod.deps, 0..) |moddep, j| { if (moddep.main.len == 0) continue; try w.print(" _{s}.pkg.?", .{moddep.id[0..12]}); if (j != mod.deps.len - 1) try w.writeAll(","); @@ -324,7 +324,7 @@ fn print_pkg_data_to(w: std.fs.File.Writer, notdone: *std.ArrayList(zigmod.Modul } if (mod.c_include_dirs.len > 0) { try w.writeAll(" .c_include_dirs = &.{"); - for (mod.c_include_dirs) |item, j| { + for (mod.c_include_dirs, 0..) |item, j| { try w.print(" \"{}\"", .{std.zig.fmtEscapes(item)}); if (j != mod.c_include_dirs.len - 1) try w.writeAll(","); } @@ -332,7 +332,7 @@ fn print_pkg_data_to(w: std.fs.File.Writer, notdone: *std.ArrayList(zigmod.Modul } if (mod.c_source_files.len > 0) { try w.writeAll(" .c_source_files = &.{"); - for (mod.c_source_files) |item, j| { + for (mod.c_source_files, 0..) |item, j| { try w.print(" \"{}\"", .{std.zig.fmtEscapes(item)}); if (j != mod.c_source_files.len - 1) try w.writeAll(","); } @@ -340,7 +340,7 @@ fn print_pkg_data_to(w: std.fs.File.Writer, notdone: *std.ArrayList(zigmod.Modul } if (mod.c_source_flags.len > 0) { try w.writeAll(" .c_source_flags = &.{"); - for (mod.c_source_flags) |item, j| { + for (mod.c_source_flags, 0..) |item, j| { try w.print(" \"{}\"", .{std.zig.fmtEscapes(item)}); if (j != mod.c_source_flags.len - 1) try w.writeAll(","); } @@ -348,7 +348,7 @@ fn print_pkg_data_to(w: std.fs.File.Writer, notdone: *std.ArrayList(zigmod.Modul } if (mod.has_syslib_deps()) { try w.writeAll(" .system_libs = &.{"); - for (mod.deps) |item, j| { + for (mod.deps, 0..) |item, j| { if (!(item.type == .system_lib)) continue; try w.print(" \"{}\"", .{std.zig.fmtEscapes(item.name)}); if (j != mod.deps.len - 1) try w.writeAll(","); @@ -357,7 +357,7 @@ fn print_pkg_data_to(w: std.fs.File.Writer, notdone: *std.ArrayList(zigmod.Modul } if (mod.has_framework_deps()) { try w.writeAll(" .frameworks = &.{"); - for (mod.deps) |item, j| { + for (mod.deps, 0..) |item, j| { if (!(item.type == .system_lib)) continue; try w.print(" \"{}\"", .{std.zig.fmtEscapes(item.name)}); if (j != mod.deps.len - 1) try w.writeAll(","); diff --git a/src/cmd/generate.zig b/src/cmd/generate.zig index 4b411b673a0e6cafc908f8a93b0262258703ce53..c4b8ca504ec14aa3fcbf023a79f71bd12d2d4fa5 100644 --- a/src/cmd/generate.zig +++ b/src/cmd/generate.zig @@ -167,7 +167,7 @@ pub fn create_depszig(alloc: std.mem.Allocator, cachepath: string, dir: std.fs.D \\ \\ pub fn zp(self: *const Package, b: *std.build.Builder) ModuleDependency { \\ var temp: [100]ModuleDependency = undefined; - \\ for (self.deps) |item, i| { + \\ for (self.deps, 0..) |item, i| { \\ temp[i] = item.zp(b); \\ } \\ return .{ @@ -245,7 +245,7 @@ fn print_deps(w: std.fs.File.Writer, m: zigmod.Module) !void { fn print_pkg_data_to(w: std.fs.File.Writer, alloc: std.mem.Allocator, cachepath: string, notdone: *std.ArrayList(zigmod.Module), done: *std.ArrayList(zigmod.Module)) !void { var len: usize = notdone.items.len; while (notdone.items.len > 0) { - for (notdone.items) |mod, i| { + for (notdone.items, 0..) |mod, i| { if (contains_all(mod.deps, done.items)) { try w.print( \\ pub var _{s} = Package{{ @@ -267,7 +267,7 @@ fn print_pkg_data_to(w: std.fs.File.Writer, alloc: std.mem.Allocator, cachepath: if (!mod.has_no_zig_deps()) { try w.writeAll(" .deps = &[_]*Package{"); - for (mod.deps) |moddep, j| { + for (mod.deps, 0..) |moddep, j| { if (moddep.main.len == 0) continue; try w.print(" &_{s}", .{moddep.id[0..12]}); if (j != mod.deps.len - 1) try w.writeAll(","); @@ -277,7 +277,7 @@ fn print_pkg_data_to(w: std.fs.File.Writer, alloc: std.mem.Allocator, cachepath: } if (mod.c_include_dirs.len > 0) { try w.writeAll(" .c_include_dirs = &.{"); - for (mod.c_include_dirs) |item, j| { + for (mod.c_include_dirs, 0..) |item, j| { try w.print(" \"{}\"", .{std.zig.fmtEscapes(item)}); if (j != mod.c_include_dirs.len - 1) try w.writeAll(","); } @@ -285,7 +285,7 @@ fn print_pkg_data_to(w: std.fs.File.Writer, alloc: std.mem.Allocator, cachepath: } if (mod.c_source_files.len > 0) { try w.writeAll(" .c_source_files = &.{"); - for (mod.c_source_files) |item, j| { + for (mod.c_source_files, 0..) |item, j| { try w.print(" \"{}\"", .{std.zig.fmtEscapes(item)}); if (j != mod.c_source_files.len - 1) try w.writeAll(","); } @@ -293,7 +293,7 @@ fn print_pkg_data_to(w: std.fs.File.Writer, alloc: std.mem.Allocator, cachepath: } if (mod.c_source_flags.len > 0) { try w.writeAll(" .c_source_flags = &.{"); - for (mod.c_source_flags) |item, j| { + for (mod.c_source_flags, 0..) |item, j| { try w.print(" \"{}\"", .{std.zig.fmtEscapes(item)}); if (j != mod.c_source_flags.len - 1) try w.writeAll(","); } @@ -301,7 +301,7 @@ fn print_pkg_data_to(w: std.fs.File.Writer, alloc: std.mem.Allocator, cachepath: } if (mod.has_syslib_deps()) { try w.writeAll(" .system_libs = &.{"); - for (mod.deps) |item, j| { + for (mod.deps, 0..) |item, j| { if (!(item.type == .system_lib)) continue; try w.print(" \"{}\"", .{std.zig.fmtEscapes(item.name)}); if (j != mod.deps.len - 1) try w.writeAll(","); @@ -310,7 +310,7 @@ fn print_pkg_data_to(w: std.fs.File.Writer, alloc: std.mem.Allocator, cachepath: } if (mod.has_framework_deps()) { try w.writeAll(" .frameworks = &.{"); - for (mod.deps) |item, j| { + for (mod.deps, 0..) |item, j| { if (!(item.type == .system_lib)) continue; try w.print(" \"{}\"", .{std.zig.fmtEscapes(item.name)}); if (j != mod.deps.len - 1) try w.writeAll(","); diff --git a/src/cmd/zpm/search.zig b/src/cmd/zpm/search.zig index 7f53872e12257b7f294a3c319539805d173fdab5..2358d74d6e3a9ca19fcdc74507a342176ddf31bc 100644 --- a/src/cmd/zpm/search.zig +++ b/src/cmd/zpm/search.zig @@ -1,7 +1,6 @@ const std = @import("std"); const gpa = std.heap.c_allocator; const extras = @import("extras"); -const range = extras.range; const zpm = @import("./../zpm.zig"); @@ -57,7 +56,7 @@ pub fn execute(args: [][]u8) !void { } fn print_c_n(out: anytype, c: u8, n: usize) !void { - for (range(n)) |_| { + for (0..n) |_| { try out.writeAll(&.{c}); } } diff --git a/src/cmd/zpm/tags.zig b/src/cmd/zpm/tags.zig index 86d85fb76b1818eddb0a6bdce0108a8a44dcf0a9..0e54a2c96758c5794ff3ff3313fdca2fac8f3152 100644 --- a/src/cmd/zpm/tags.zig +++ b/src/cmd/zpm/tags.zig @@ -1,7 +1,6 @@ const std = @import("std"); const gpa = std.heap.c_allocator; const extras = @import("extras"); -const range = extras.range; const zpm = @import("./../zpm.zig"); @@ -41,7 +40,7 @@ pub fn execute(args: [][]u8) !void { } fn print_c_n(out: anytype, c: u8, n: usize) !void { - for (range(n)) |_| { + for (0..n) |_| { try out.writeAll(&.{c}); } } diff --git a/src/util/funcs.zig b/src/util/funcs.zig index 88d90e80903aad49af45d75e53284fa9e60c9a06..b540fd0f273d5ccb59f8c31f0ff33ba8e25619ac 100644 --- a/src/util/funcs.zig +++ b/src/util/funcs.zig @@ -244,7 +244,7 @@ pub fn indexOfN(haystack: string, needle: u8, n: usize) ?usize { } pub fn indexOfAfter(haystack: string, needle: u8, after: usize) ?usize { - for (haystack) |c, i| { + for (haystack, 0..) |c, i| { if (i <= after) continue; if (c == needle) return i; } diff --git a/src/util/module.zig b/src/util/module.zig index f77696a3f5ad1da9245c8873da2b288f12d35090..fd6c04316f7efee6f337c506238877584c5fb2fa 100644 --- a/src/util/module.zig +++ b/src/util/module.zig @@ -151,7 +151,7 @@ pub const Module = struct { } pub fn lessThan(_: void, lhs: Module, rhs: Module) bool { - for (lhs.clean_path) |_, i| { + for (lhs.clean_path, 0..) |_, i| { if (i == rhs.clean_path.len) return false; if (lhs.clean_path[i] < rhs.clean_path[i]) return true; if (lhs.clean_path[i] > rhs.clean_path[i]) return false; diff --git a/zigmod.lock b/zigmod.lock index 67858a79e4689606fb01cf0e12de67f23cba6394..fda3b22720b649b809fd94cd23626387e34568f3 100644 --- a/zigmod.lock +++ b/zigmod.lock @@ -1,20 +1,20 @@ 2 git https://github.com/MasterQ32/zig-uri commit-d4299ad6043ad19f2ce0676687b0bff57273eae2 -git https://github.com/marlersoft/zigwin32 commit-56cf335ddcdb72a6d7059c5b6f131263830b3eca +git https://github.com/marlersoft/zigwin32 commit-79c0144225dc015a5c0253b5af30356aa6dc6426 git https://github.com/nektro/arqv-ini commit-ee395fd34e152d9067def609d86b7af5382b83b1 git https://github.com/nektro/iguanaTLS commit-5dee3ead2b289319080834add91b5f35dfdb1847 git https://github.com/nektro/zig-ansi commit-8d6fdb4983a616940c1d5137110292a7862f6a7e git https://github.com/nektro/zig-detect-license commit-de5c285d999eea68b9189b48bb000243fef0a689 -git https://github.com/nektro/zig-extras commit-b45c99e2e747e3bb8df5e1051078cacb1470a430 +git https://github.com/nektro/zig-extras commit-d34ac633f0a0af8d348b66a38e7497d031f027b1 git https://github.com/nektro/zig-inquirer commit-25e35a46400cfa1d7278436c0b7d14d314889d7c git https://github.com/nektro/zig-json commit-0e7d026b0d3889ed7f96e1b24566a66cd9df6cb3 git https://github.com/nektro/zig-leven commit-ab852cf74fa0b4edc530d925f0654b62c60365bf git https://github.com/nektro/zig-licenses commit-c9b8cbf3565675a056ad4e9b57cb4f84020e7680 git https://github.com/nektro/zig-licenses-text commit-3c07c6e4eb0965dafd0b029c632f823631b3169c git https://github.com/nektro/zig-range commit-4b2f12808aa09be4b27a163efc424dd4e0415992 -git https://github.com/nektro/zig-time commit-aff2df866eb16ad781e26a25f8b664d498e2211a -git https://github.com/truemedian/hzzp commit-2d2ab34b666e6806a6f6c98cc50ca94e606c9103 +git https://github.com/nektro/zig-time commit-bfb7da7b8ee92b6c07f90a14b044a9b8f4df182c git https://github.com/nektro/zig-yaml commit-3f3641e90697546e7f8aeef365815c4ccab168b0 +git https://github.com/truemedian/hzzp commit-9b5de4d8626ddedf925bf82dbe49610513485b9d git https://github.com/truemedian/zfetch commit-829973144f680cd16be16923041fa810c1dee417 git https://github.com/ziglibs/known-folders commit-6b37490ac7285133bf09441850b8102c9728a776 git https://github.com/yaml/libyaml tag-0.2.5 -- 2.54.0