| author | |
| committer | |
| log | c25b157ddaede518d92ee2d87ad536a5b6b097de |
| tree | 1599c465bab670beb50b63c2a5b9d8f0411fbc9d |
| parent | c9551652b01bf47a94c139846f22c5df85d07283 |
29 files changed, 108 insertions(+), 108 deletions(-)
lib/std/array_list.zig+1-1| ... | ... | @@ -1061,7 +1061,7 @@ test "std.ArrayList(u8) implements outStream" { |
| 1061 | 1061 | const y: i32 = 1234; |
| 1062 | 1062 | try buffer.outStream().print("x: {}\ny: {}\n", .{ x, y }); |
| 1063 | 1063 | |
| 1064 | testing.expectEqualSlices(u8, "x: 42\ny: 1234\n", buffer.span()); | |
| 1064 | testing.expectEqualSlices(u8, "x: 42\ny: 1234\n", buffer.items); | |
| 1065 | 1065 | } |
| 1066 | 1066 | |
| 1067 | 1067 | test "std.ArrayList/ArrayListUnmanaged.shrink still sets length on error.OutOfMemory" { |
lib/std/array_list_sentineled.zig+1-1| ... | ... | @@ -147,7 +147,7 @@ pub fn ArrayListSentineled(comptime T: type, comptime sentinel: T) type { |
| 147 | 147 | |
| 148 | 148 | pub fn replaceContents(self: *Self, m: []const T) !void { |
| 149 | 149 | try self.resize(m.len); |
| 150 | mem.copy(T, self.list.span(), m); | |
| 150 | mem.copy(T, self.list.items, m); | |
| 151 | 151 | } |
| 152 | 152 | |
| 153 | 153 | /// Initializes an OutStream which will append to the list. |
lib/std/build.zig+18-18| ... | ... | @@ -386,7 +386,7 @@ pub const Builder = struct { |
| 386 | 386 | } |
| 387 | 387 | } |
| 388 | 388 | |
| 389 | for (wanted_steps.span()) |s| { | |
| 389 | for (wanted_steps.items) |s| { | |
| 390 | 390 | try self.makeOneStep(s); |
| 391 | 391 | } |
| 392 | 392 | } |
| ... | ... | @@ -403,7 +403,7 @@ pub const Builder = struct { |
| 403 | 403 | const uninstall_tls = @fieldParentPtr(TopLevelStep, "step", uninstall_step); |
| 404 | 404 | const self = @fieldParentPtr(Builder, "uninstall_tls", uninstall_tls); |
| 405 | 405 | |
| 406 | for (self.installed_files.span()) |installed_file| { | |
| 406 | for (self.installed_files.items) |installed_file| { | |
| 407 | 407 | const full_path = self.getInstallPath(installed_file.dir, installed_file.path); |
| 408 | 408 | if (self.verbose) { |
| 409 | 409 | warn("rm {}\n", .{full_path}); |
| ... | ... | @@ -421,7 +421,7 @@ pub const Builder = struct { |
| 421 | 421 | } |
| 422 | 422 | s.loop_flag = true; |
| 423 | 423 | |
| 424 | for (s.dependencies.span()) |dep| { | |
| 424 | for (s.dependencies.items) |dep| { | |
| 425 | 425 | self.makeOneStep(dep) catch |err| { |
| 426 | 426 | if (err == error.DependencyLoopDetected) { |
| 427 | 427 | warn(" {}\n", .{s.name}); |
| ... | ... | @@ -436,7 +436,7 @@ pub const Builder = struct { |
| 436 | 436 | } |
| 437 | 437 | |
| 438 | 438 | fn getTopLevelStepByName(self: *Builder, name: []const u8) !*Step { |
| 439 | for (self.top_level_steps.span()) |top_level_step| { | |
| 439 | for (self.top_level_steps.items) |top_level_step| { | |
| 440 | 440 | if (mem.eql(u8, top_level_step.step.name, name)) { |
| 441 | 441 | return &top_level_step.step; |
| 442 | 442 | } |
| ... | ... | @@ -550,7 +550,7 @@ pub const Builder = struct { |
| 550 | 550 | .Scalar => |s| { |
| 551 | 551 | return self.allocator.dupe([]const u8, &[_][]const u8{s}) catch unreachable; |
| 552 | 552 | }, |
| 553 | .List => |lst| return lst.span(), | |
| 553 | .List => |lst| return lst.items, | |
| 554 | 554 | }, |
| 555 | 555 | } |
| 556 | 556 | } |
| ... | ... | @@ -951,7 +951,7 @@ pub const Builder = struct { |
| 951 | 951 | pub fn findProgram(self: *Builder, names: []const []const u8, paths: []const []const u8) ![]const u8 { |
| 952 | 952 | // TODO report error for ambiguous situations |
| 953 | 953 | const exe_extension = @as(CrossTarget, .{}).exeFileExt(); |
| 954 | for (self.search_prefixes.span()) |search_prefix| { | |
| 954 | for (self.search_prefixes.items) |search_prefix| { | |
| 955 | 955 | for (names) |name| { |
| 956 | 956 | if (fs.path.isAbsolute(name)) { |
| 957 | 957 | return name; |
| ... | ... | @@ -1096,7 +1096,7 @@ pub const Builder = struct { |
| 1096 | 1096 | .desc = tok_it.rest(), |
| 1097 | 1097 | }); |
| 1098 | 1098 | } |
| 1099 | return list.span(); | |
| 1099 | return list.items; | |
| 1100 | 1100 | } |
| 1101 | 1101 | |
| 1102 | 1102 | fn getPkgConfigList(self: *Builder) ![]const PkgConfigPkg { |
| ... | ... | @@ -1505,7 +1505,7 @@ pub const LibExeObjStep = struct { |
| 1505 | 1505 | if (isLibCLibrary(name)) { |
| 1506 | 1506 | return self.is_linking_libc; |
| 1507 | 1507 | } |
| 1508 | for (self.link_objects.span()) |link_object| { | |
| 1508 | for (self.link_objects.items) |link_object| { | |
| 1509 | 1509 | switch (link_object) { |
| 1510 | 1510 | LinkObject.SystemLib => |n| if (mem.eql(u8, n, name)) return true, |
| 1511 | 1511 | else => continue, |
| ... | ... | @@ -1908,7 +1908,7 @@ pub const LibExeObjStep = struct { |
| 1908 | 1908 | self.include_dirs.append(IncludeDir{ .OtherStep = other }) catch unreachable; |
| 1909 | 1909 | |
| 1910 | 1910 | // Inherit dependency on system libraries |
| 1911 | for (other.link_objects.span()) |link_object| { | |
| 1911 | for (other.link_objects.items) |link_object| { | |
| 1912 | 1912 | switch (link_object) { |
| 1913 | 1913 | .SystemLib => |name| self.linkSystemLibrary(name), |
| 1914 | 1914 | else => continue, |
| ... | ... | @@ -1970,7 +1970,7 @@ pub const LibExeObjStep = struct { |
| 1970 | 1970 | if (self.root_src) |root_src| try zig_args.append(root_src.getPath(builder)); |
| 1971 | 1971 | |
| 1972 | 1972 | var prev_has_extra_flags = false; |
| 1973 | for (self.link_objects.span()) |link_object| { | |
| 1973 | for (self.link_objects.items) |link_object| { | |
| 1974 | 1974 | switch (link_object) { |
| 1975 | 1975 | .StaticPath => |static_path| { |
| 1976 | 1976 | try zig_args.append(builder.pathFromRoot(static_path)); |
| ... | ... | @@ -2040,7 +2040,7 @@ pub const LibExeObjStep = struct { |
| 2040 | 2040 | &[_][]const u8{ builder.cache_root, builder.fmt("{}_build_options.zig", .{self.name}) }, |
| 2041 | 2041 | ); |
| 2042 | 2042 | const path_from_root = builder.pathFromRoot(build_options_file); |
| 2043 | try fs.cwd().writeFile(path_from_root, self.build_options_contents.span()); | |
| 2043 | try fs.cwd().writeFile(path_from_root, self.build_options_contents.items); | |
| 2044 | 2044 | try zig_args.append("--pkg-begin"); |
| 2045 | 2045 | try zig_args.append("build_options"); |
| 2046 | 2046 | try zig_args.append(path_from_root); |
| ... | ... | @@ -2238,11 +2238,11 @@ pub const LibExeObjStep = struct { |
| 2238 | 2238 | }, |
| 2239 | 2239 | } |
| 2240 | 2240 | |
| 2241 | for (self.packages.span()) |pkg| { | |
| 2241 | for (self.packages.items) |pkg| { | |
| 2242 | 2242 | try self.makePackageCmd(pkg, &zig_args); |
| 2243 | 2243 | } |
| 2244 | 2244 | |
| 2245 | for (self.include_dirs.span()) |include_dir| { | |
| 2245 | for (self.include_dirs.items) |include_dir| { | |
| 2246 | 2246 | switch (include_dir) { |
| 2247 | 2247 | .RawPath => |include_path| { |
| 2248 | 2248 | try zig_args.append("-I"); |
| ... | ... | @@ -2260,18 +2260,18 @@ pub const LibExeObjStep = struct { |
| 2260 | 2260 | } |
| 2261 | 2261 | } |
| 2262 | 2262 | |
| 2263 | for (self.lib_paths.span()) |lib_path| { | |
| 2263 | for (self.lib_paths.items) |lib_path| { | |
| 2264 | 2264 | try zig_args.append("-L"); |
| 2265 | 2265 | try zig_args.append(lib_path); |
| 2266 | 2266 | } |
| 2267 | 2267 | |
| 2268 | for (self.c_macros.span()) |c_macro| { | |
| 2268 | for (self.c_macros.items) |c_macro| { | |
| 2269 | 2269 | try zig_args.append("-D"); |
| 2270 | 2270 | try zig_args.append(c_macro); |
| 2271 | 2271 | } |
| 2272 | 2272 | |
| 2273 | 2273 | if (self.target.isDarwin()) { |
| 2274 | for (self.framework_dirs.span()) |dir| { | |
| 2274 | for (self.framework_dirs.items) |dir| { | |
| 2275 | 2275 | try zig_args.append("-F"); |
| 2276 | 2276 | try zig_args.append(dir); |
| 2277 | 2277 | } |
| ... | ... | @@ -2331,11 +2331,11 @@ pub const LibExeObjStep = struct { |
| 2331 | 2331 | } |
| 2332 | 2332 | |
| 2333 | 2333 | if (self.kind == Kind.Test) { |
| 2334 | try builder.spawnChild(zig_args.span()); | |
| 2334 | try builder.spawnChild(zig_args.items); | |
| 2335 | 2335 | } else { |
| 2336 | 2336 | try zig_args.append("--enable-cache"); |
| 2337 | 2337 | |
| 2338 | const output_dir_nl = try builder.execFromStep(zig_args.span(), &self.step); | |
| 2338 | const output_dir_nl = try builder.execFromStep(zig_args.items, &self.step); | |
| 2339 | 2339 | const build_output_dir = mem.trimRight(u8, output_dir_nl, "\r\n"); |
| 2340 | 2340 | |
| 2341 | 2341 | if (self.output_dir) |output_dir| { |
lib/std/build/emit_raw.zig+6-6| ... | ... | @@ -79,7 +79,7 @@ const BinaryElfOutput = struct { |
| 79 | 79 | newSegment.binaryOffset = 0; |
| 80 | 80 | newSegment.firstSection = null; |
| 81 | 81 | |
| 82 | for (self.sections.span()) |section| { | |
| 82 | for (self.sections.items) |section| { | |
| 83 | 83 | if (sectionWithinSegment(section, phdr)) { |
| 84 | 84 | if (section.segment) |sectionSegment| { |
| 85 | 85 | if (sectionSegment.elfOffset > newSegment.elfOffset) { |
| ... | ... | @@ -99,7 +99,7 @@ const BinaryElfOutput = struct { |
| 99 | 99 | } |
| 100 | 100 | } |
| 101 | 101 | |
| 102 | sort.sort(*BinaryElfSegment, self.segments.span(), {}, segmentSortCompare); | |
| 102 | sort.sort(*BinaryElfSegment, self.segments.items, {}, segmentSortCompare); | |
| 103 | 103 | |
| 104 | 104 | if (self.segments.items.len > 0) { |
| 105 | 105 | const firstSegment = self.segments.items[0]; |
| ... | ... | @@ -112,19 +112,19 @@ const BinaryElfOutput = struct { |
| 112 | 112 | |
| 113 | 113 | const basePhysicalAddress = firstSegment.physicalAddress; |
| 114 | 114 | |
| 115 | for (self.segments.span()) |segment| { | |
| 115 | for (self.segments.items) |segment| { | |
| 116 | 116 | segment.binaryOffset = segment.physicalAddress - basePhysicalAddress; |
| 117 | 117 | } |
| 118 | 118 | } |
| 119 | 119 | } |
| 120 | 120 | |
| 121 | for (self.sections.span()) |section| { | |
| 121 | for (self.sections.items) |section| { | |
| 122 | 122 | if (section.segment) |segment| { |
| 123 | 123 | section.binaryOffset = segment.binaryOffset + (section.elfOffset - segment.elfOffset); |
| 124 | 124 | } |
| 125 | 125 | } |
| 126 | 126 | |
| 127 | sort.sort(*BinaryElfSection, self.sections.span(), {}, sectionSortCompare); | |
| 127 | sort.sort(*BinaryElfSection, self.sections.items, {}, sectionSortCompare); | |
| 128 | 128 | |
| 129 | 129 | return self; |
| 130 | 130 | } |
| ... | ... | @@ -172,7 +172,7 @@ fn emitRaw(allocator: *Allocator, elf_path: []const u8, raw_path: []const u8) !v |
| 172 | 172 | var binary_elf_output = try BinaryElfOutput.parse(allocator, elf_file); |
| 173 | 173 | defer binary_elf_output.deinit(); |
| 174 | 174 | |
| 175 | for (binary_elf_output.sections.span()) |section| { | |
| 175 | for (binary_elf_output.sections.items) |section| { | |
| 176 | 176 | try writeBinaryElfSection(elf_file, out_file, section); |
| 177 | 177 | } |
| 178 | 178 | } |
lib/std/build/run.zig+3-3| ... | ... | @@ -159,7 +159,7 @@ pub const RunStep = struct { |
| 159 | 159 | const cwd = if (self.cwd) |cwd| self.builder.pathFromRoot(cwd) else self.builder.build_root; |
| 160 | 160 | |
| 161 | 161 | var argv_list = ArrayList([]const u8).init(self.builder.allocator); |
| 162 | for (self.argv.span()) |arg| { | |
| 162 | for (self.argv.items) |arg| { | |
| 163 | 163 | switch (arg) { |
| 164 | 164 | Arg.Bytes => |bytes| try argv_list.append(bytes), |
| 165 | 165 | Arg.WriteFile => |file| { |
| ... | ... | @@ -176,7 +176,7 @@ pub const RunStep = struct { |
| 176 | 176 | } |
| 177 | 177 | } |
| 178 | 178 | |
| 179 | const argv = argv_list.span(); | |
| 179 | const argv = argv_list.items; | |
| 180 | 180 | |
| 181 | 181 | const child = std.ChildProcess.init(argv, self.builder.allocator) catch unreachable; |
| 182 | 182 | defer child.deinit(); |
| ... | ... | @@ -312,7 +312,7 @@ pub const RunStep = struct { |
| 312 | 312 | } |
| 313 | 313 | |
| 314 | 314 | fn addPathForDynLibs(self: *RunStep, artifact: *LibExeObjStep) void { |
| 315 | for (artifact.link_objects.span()) |link_object| { | |
| 315 | for (artifact.link_objects.items) |link_object| { | |
| 316 | 316 | switch (link_object) { |
| 317 | 317 | .OtherStep => |other| { |
| 318 | 318 | if (other.target.isWindows() and other.isDynamicLibrary()) { |
lib/std/build/translate_c.zig+1-1| ... | ... | @@ -86,7 +86,7 @@ pub const TranslateCStep = struct { |
| 86 | 86 | |
| 87 | 87 | try argv_list.append(self.source.getPath(self.builder)); |
| 88 | 88 | |
| 89 | const output_path_nl = try self.builder.execFromStep(argv_list.span(), &self.step); | |
| 89 | const output_path_nl = try self.builder.execFromStep(argv_list.items, &self.step); | |
| 90 | 90 | const output_path = mem.trimRight(u8, output_path_nl, "\r\n"); |
| 91 | 91 | |
| 92 | 92 | self.out_basename = fs.path.basename(output_path); |
lib/std/build/write_file.zig+2-2| ... | ... | @@ -64,7 +64,7 @@ pub const WriteFileStep = struct { |
| 64 | 64 | // new random bytes when WriteFileStep implementation is modified |
| 65 | 65 | // in a non-backwards-compatible way. |
| 66 | 66 | hash.update("eagVR1dYXoE7ARDP"); |
| 67 | for (self.files.span()) |file| { | |
| 67 | for (self.files.items) |file| { | |
| 68 | 68 | hash.update(file.basename); |
| 69 | 69 | hash.update(file.bytes); |
| 70 | 70 | hash.update("|"); |
| ... | ... | @@ -85,7 +85,7 @@ pub const WriteFileStep = struct { |
| 85 | 85 | }; |
| 86 | 86 | var dir = try fs.cwd().openDir(self.output_dir, .{}); |
| 87 | 87 | defer dir.close(); |
| 88 | for (self.files.span()) |file| { | |
| 88 | for (self.files.items) |file| { | |
| 89 | 89 | dir.writeFile(file.basename, file.bytes) catch |err| { |
| 90 | 90 | warn("unable to write {} into {}: {}\n", .{ |
| 91 | 91 | file.basename, |
lib/std/coff.zig+2-2| ... | ... | @@ -216,7 +216,7 @@ pub const Coff = struct { |
| 216 | 216 | blk: while (i < debug_dir_entry_count) : (i += 1) { |
| 217 | 217 | const debug_dir_entry = try in.readStruct(DebugDirectoryEntry); |
| 218 | 218 | if (debug_dir_entry.type == IMAGE_DEBUG_TYPE_CODEVIEW) { |
| 219 | for (self.sections.span()) |*section| { | |
| 219 | for (self.sections.items) |*section| { | |
| 220 | 220 | const section_start = section.header.virtual_address; |
| 221 | 221 | const section_size = section.header.misc.virtual_size; |
| 222 | 222 | const rva = debug_dir_entry.address_of_raw_data; |
| ... | ... | @@ -282,7 +282,7 @@ pub const Coff = struct { |
| 282 | 282 | } |
| 283 | 283 | |
| 284 | 284 | pub fn getSection(self: *Coff, comptime name: []const u8) ?*Section { |
| 285 | for (self.sections.span()) |*sec| { | |
| 285 | for (self.sections.items) |*sec| { | |
| 286 | 286 | if (mem.eql(u8, sec.header.name[0..name.len], name)) { |
| 287 | 287 | return sec; |
| 288 | 288 | } |
lib/std/debug.zig+1-1| ... | ... | @@ -1509,7 +1509,7 @@ pub const ModuleDebugInfo = switch (builtin.os.tag) { |
| 1509 | 1509 | const mod_index = for (self.sect_contribs) |sect_contrib| { |
| 1510 | 1510 | if (sect_contrib.Section > self.coff.sections.items.len) continue; |
| 1511 | 1511 | // Remember that SectionContribEntry.Section is 1-based. |
| 1512 | coff_section = &self.coff.sections.span()[sect_contrib.Section - 1]; | |
| 1512 | coff_section = &self.coff.sections.items[sect_contrib.Section - 1]; | |
| 1513 | 1513 | |
| 1514 | 1514 | const vaddr_start = coff_section.header.virtual_address + sect_contrib.Offset; |
| 1515 | 1515 | const vaddr_end = vaddr_start + sect_contrib.Size; |
lib/std/dwarf.zig+7-7| ... | ... | @@ -87,7 +87,7 @@ const Die = struct { |
| 87 | 87 | }; |
| 88 | 88 | |
| 89 | 89 | fn getAttr(self: *const Die, id: u64) ?*const FormValue { |
| 90 | for (self.attrs.span()) |*attr| { | |
| 90 | for (self.attrs.items) |*attr| { | |
| 91 | 91 | if (attr.id == id) return &attr.value; |
| 92 | 92 | } |
| 93 | 93 | return null; |
| ... | ... | @@ -371,7 +371,7 @@ fn parseFormValue(allocator: *mem.Allocator, in_stream: anytype, form_id: u64, e |
| 371 | 371 | } |
| 372 | 372 | |
| 373 | 373 | fn getAbbrevTableEntry(abbrev_table: *const AbbrevTable, abbrev_code: u64) ?*const AbbrevTableEntry { |
| 374 | for (abbrev_table.span()) |*table_entry| { | |
| 374 | for (abbrev_table.items) |*table_entry| { | |
| 375 | 375 | if (table_entry.abbrev_code == abbrev_code) return table_entry; |
| 376 | 376 | } |
| 377 | 377 | return null; |
| ... | ... | @@ -395,7 +395,7 @@ pub const DwarfInfo = struct { |
| 395 | 395 | } |
| 396 | 396 | |
| 397 | 397 | pub fn getSymbolName(di: *DwarfInfo, address: u64) ?[]const u8 { |
| 398 | for (di.func_list.span()) |*func| { | |
| 398 | for (di.func_list.items) |*func| { | |
| 399 | 399 | if (func.pc_range) |range| { |
| 400 | 400 | if (address >= range.start and address < range.end) { |
| 401 | 401 | return func.name; |
| ... | ... | @@ -584,7 +584,7 @@ pub const DwarfInfo = struct { |
| 584 | 584 | } |
| 585 | 585 | |
| 586 | 586 | pub fn findCompileUnit(di: *DwarfInfo, target_address: u64) !*const CompileUnit { |
| 587 | for (di.compile_unit_list.span()) |*compile_unit| { | |
| 587 | for (di.compile_unit_list.items) |*compile_unit| { | |
| 588 | 588 | if (compile_unit.pc_range) |range| { |
| 589 | 589 | if (target_address >= range.start and target_address < range.end) return compile_unit; |
| 590 | 590 | } |
| ... | ... | @@ -632,7 +632,7 @@ pub const DwarfInfo = struct { |
| 632 | 632 | /// Gets an already existing AbbrevTable given the abbrev_offset, or if not found, |
| 633 | 633 | /// seeks in the stream and parses it. |
| 634 | 634 | fn getAbbrevTable(di: *DwarfInfo, abbrev_offset: u64) !*const AbbrevTable { |
| 635 | for (di.abbrev_table_list.span()) |*header| { | |
| 635 | for (di.abbrev_table_list.items) |*header| { | |
| 636 | 636 | if (header.offset == abbrev_offset) { |
| 637 | 637 | return &header.table; |
| 638 | 638 | } |
| ... | ... | @@ -686,7 +686,7 @@ pub const DwarfInfo = struct { |
| 686 | 686 | .attrs = ArrayList(Die.Attr).init(di.allocator()), |
| 687 | 687 | }; |
| 688 | 688 | try result.attrs.resize(table_entry.attrs.items.len); |
| 689 | for (table_entry.attrs.span()) |attr, i| { | |
| 689 | for (table_entry.attrs.items) |attr, i| { | |
| 690 | 690 | result.attrs.items[i] = Die.Attr{ |
| 691 | 691 | .id = attr.attr_id, |
| 692 | 692 | .value = try parseFormValue(di.allocator(), in_stream, attr.form_id, di.endian, is_64), |
| ... | ... | @@ -753,7 +753,7 @@ pub const DwarfInfo = struct { |
| 753 | 753 | } |
| 754 | 754 | |
| 755 | 755 | var file_entries = ArrayList(FileEntry).init(di.allocator()); |
| 756 | var prog = LineNumberProgram.init(default_is_stmt, include_directories.span(), &file_entries, target_address); | |
| 756 | var prog = LineNumberProgram.init(default_is_stmt, include_directories.items, &file_entries, target_address); | |
| 757 | 757 | |
| 758 | 758 | while (true) { |
| 759 | 759 | const file_name = try in.readUntilDelimiterAlloc(di.allocator(), 0, math.maxInt(usize)); |
lib/std/fs.zig+3-3| ... | ... | @@ -2078,7 +2078,7 @@ pub const Walker = struct { |
| 2078 | 2078 | while (true) { |
| 2079 | 2079 | if (self.stack.items.len == 0) return null; |
| 2080 | 2080 | // `top` becomes invalid after appending to `self.stack`. |
| 2081 | const top = &self.stack.span()[self.stack.items.len - 1]; | |
| 2081 | const top = &self.stack.items[self.stack.items.len - 1]; | |
| 2082 | 2082 | const dirname_len = top.dirname_len; |
| 2083 | 2083 | if (try top.dir_it.next()) |base| { |
| 2084 | 2084 | self.name_buffer.shrink(dirname_len); |
| ... | ... | @@ -2099,8 +2099,8 @@ pub const Walker = struct { |
| 2099 | 2099 | } |
| 2100 | 2100 | return Entry{ |
| 2101 | 2101 | .dir = top.dir_it.dir, |
| 2102 | .basename = self.name_buffer.span()[dirname_len + 1 ..], | |
| 2103 | .path = self.name_buffer.span(), | |
| 2102 | .basename = self.name_buffer.items[dirname_len + 1 ..], | |
| 2103 | .path = self.name_buffer.items, | |
| 2104 | 2104 | .kind = base.kind, |
| 2105 | 2105 | }; |
| 2106 | 2106 | } else { |
lib/std/io/reader.zig+1-1| ... | ... | @@ -62,7 +62,7 @@ pub fn Reader( |
| 62 | 62 | var start_index: usize = original_len; |
| 63 | 63 | while (true) { |
| 64 | 64 | array_list.expandToCapacity(); |
| 65 | const dest_slice = array_list.span()[start_index..]; | |
| 65 | const dest_slice = array_list.items[start_index..]; | |
| 66 | 66 | const bytes_read = try self.readAll(dest_slice); |
| 67 | 67 | start_index += bytes_read; |
| 68 | 68 |
lib/std/json.zig+2-2| ... | ... | @@ -1249,7 +1249,7 @@ pub const Value = union(enum) { |
| 1249 | 1249 | .Integer => |inner| try stringify(inner, options, out_stream), |
| 1250 | 1250 | .Float => |inner| try stringify(inner, options, out_stream), |
| 1251 | 1251 | .String => |inner| try stringify(inner, options, out_stream), |
| 1252 | .Array => |inner| try stringify(inner.span(), options, out_stream), | |
| 1252 | .Array => |inner| try stringify(inner.items, options, out_stream), | |
| 1253 | 1253 | .Object => |inner| { |
| 1254 | 1254 | try out_stream.writeByte('{'); |
| 1255 | 1255 | var field_output = false; |
| ... | ... | @@ -2036,7 +2036,7 @@ pub const Parser = struct { |
| 2036 | 2036 | } |
| 2037 | 2037 | |
| 2038 | 2038 | fn pushToParent(p: *Parser, value: *const Value) !void { |
| 2039 | switch (p.stack.span()[p.stack.items.len - 1]) { | |
| 2039 | switch (p.stack.items[p.stack.items.len - 1]) { | |
| 2040 | 2040 | // Object Parent -> [ ..., object, <key>, value ] |
| 2041 | 2041 | Value.String => |key| { |
| 2042 | 2042 | _ = p.stack.pop(); |
lib/std/net.zig+6-6| ... | ... | @@ -796,7 +796,7 @@ pub fn getAddressList(allocator: *mem.Allocator, name: []const u8, port: u16) !* |
| 796 | 796 | result.canon_name = canon.toOwnedSlice(); |
| 797 | 797 | } |
| 798 | 798 | |
| 799 | for (lookup_addrs.span()) |lookup_addr, i| { | |
| 799 | for (lookup_addrs.items) |lookup_addr, i| { | |
| 800 | 800 | result.addrs[i] = lookup_addr.addr; |
| 801 | 801 | assert(result.addrs[i].getPort() == port); |
| 802 | 802 | } |
| ... | ... | @@ -849,7 +849,7 @@ fn linuxLookupName( |
| 849 | 849 | // No further processing is needed if there are fewer than 2 |
| 850 | 850 | // results or if there are only IPv4 results. |
| 851 | 851 | if (addrs.items.len == 1 or family == os.AF_INET) return; |
| 852 | const all_ip4 = for (addrs.span()) |addr| { | |
| 852 | const all_ip4 = for (addrs.items) |addr| { | |
| 853 | 853 | if (addr.addr.any.family != os.AF_INET) break false; |
| 854 | 854 | } else true; |
| 855 | 855 | if (all_ip4) return; |
| ... | ... | @@ -861,7 +861,7 @@ fn linuxLookupName( |
| 861 | 861 | // So far the label/precedence table cannot be customized. |
| 862 | 862 | // This implementation is ported from musl libc. |
| 863 | 863 | // A more idiomatic "ziggy" implementation would be welcome. |
| 864 | for (addrs.span()) |*addr, i| { | |
| 864 | for (addrs.items) |*addr, i| { | |
| 865 | 865 | var key: i32 = 0; |
| 866 | 866 | var sa6: os.sockaddr_in6 = undefined; |
| 867 | 867 | @memset(@ptrCast([*]u8, &sa6), 0, @sizeOf(os.sockaddr_in6)); |
| ... | ... | @@ -926,7 +926,7 @@ fn linuxLookupName( |
| 926 | 926 | key |= (MAXADDRS - @intCast(i32, i)) << DAS_ORDER_SHIFT; |
| 927 | 927 | addr.sortkey = key; |
| 928 | 928 | } |
| 929 | std.sort.sort(LookupAddr, addrs.span(), {}, addrCmpLessThan); | |
| 929 | std.sort.sort(LookupAddr, addrs.items, {}, addrCmpLessThan); | |
| 930 | 930 | } |
| 931 | 931 | |
| 932 | 932 | const Policy = struct { |
| ... | ... | @@ -1361,9 +1361,9 @@ fn resMSendRc( |
| 1361 | 1361 | defer ns_list.deinit(); |
| 1362 | 1362 | |
| 1363 | 1363 | try ns_list.resize(rc.ns.items.len); |
| 1364 | const ns = ns_list.span(); | |
| 1364 | const ns = ns_list.items; | |
| 1365 | 1365 | |
| 1366 | for (rc.ns.span()) |iplit, i| { | |
| 1366 | for (rc.ns.items) |iplit, i| { | |
| 1367 | 1367 | ns[i] = iplit.addr; |
| 1368 | 1368 | assert(ns[i].getPort() == 53); |
| 1369 | 1369 | if (iplit.addr.any.family != os.AF_INET) { |
lib/std/pdb.zig+1-1| ... | ... | @@ -654,7 +654,7 @@ const MsfStream = struct { |
| 654 | 654 | while (true) { |
| 655 | 655 | const byte = try self.reader().readByte(); |
| 656 | 656 | if (byte == 0) { |
| 657 | return list.span(); | |
| 657 | return list.items; | |
| 658 | 658 | } |
| 659 | 659 | try list.append(byte); |
| 660 | 660 | } |
lib/std/process.zig+2-2| ... | ... | @@ -519,8 +519,8 @@ pub fn argsAlloc(allocator: *mem.Allocator) ![][:0]u8 { |
| 519 | 519 | try slice_list.append(arg.len); |
| 520 | 520 | } |
| 521 | 521 | |
| 522 | const contents_slice = contents.span(); | |
| 523 | const slice_sizes = slice_list.span(); | |
| 522 | const contents_slice = contents.items; | |
| 523 | const slice_sizes = slice_list.items; | |
| 524 | 524 | const contents_size_bytes = try math.add(usize, contents_slice.len, slice_sizes.len); |
| 525 | 525 | const slice_list_bytes = try math.mul(usize, @sizeOf([]u8), slice_sizes.len); |
| 526 | 526 | const total_bytes = try math.add(usize, slice_list_bytes, contents_size_bytes); |
lib/std/special/build_runner.zig+3-3| ... | ... | @@ -130,7 +130,7 @@ pub fn main() !void { |
| 130 | 130 | if (builder.validateUserInputDidItFail()) |
| 131 | 131 | return usageAndErr(builder, true, stderr_stream); |
| 132 | 132 | |
| 133 | builder.make(targets.span()) catch |err| { | |
| 133 | builder.make(targets.items) catch |err| { | |
| 134 | 134 | switch (err) { |
| 135 | 135 | error.InvalidStepName => { |
| 136 | 136 | return usageAndErr(builder, true, stderr_stream); |
| ... | ... | @@ -165,7 +165,7 @@ fn usage(builder: *Builder, already_ran_build: bool, out_stream: anytype) !void |
| 165 | 165 | , .{builder.zig_exe}); |
| 166 | 166 | |
| 167 | 167 | const allocator = builder.allocator; |
| 168 | for (builder.top_level_steps.span()) |top_level_step| { | |
| 168 | for (builder.top_level_steps.items) |top_level_step| { | |
| 169 | 169 | const name = if (&top_level_step.step == builder.default_step) |
| 170 | 170 | try fmt.allocPrint(allocator, "{} (default)", .{top_level_step.step.name}) |
| 171 | 171 | else |
| ... | ... | @@ -189,7 +189,7 @@ fn usage(builder: *Builder, already_ran_build: bool, out_stream: anytype) !void |
| 189 | 189 | if (builder.available_options_list.items.len == 0) { |
| 190 | 190 | try out_stream.print(" (none)\n", .{}); |
| 191 | 191 | } else { |
| 192 | for (builder.available_options_list.span()) |option| { | |
| 192 | for (builder.available_options_list.items) |option| { | |
| 193 | 193 | const name = try fmt.allocPrint(allocator, " -D{}=[{}]", .{ |
| 194 | 194 | option.name, |
| 195 | 195 | Builder.typeIdName(option.type_id), |
lib/std/zig/system.zig+1-1| ... | ... | @@ -128,7 +128,7 @@ pub const NativePaths = struct { |
| 128 | 128 | } |
| 129 | 129 | |
| 130 | 130 | fn deinitArray(array: *ArrayList([:0]u8)) void { |
| 131 | for (array.span()) |item| { | |
| 131 | for (array.items) |item| { | |
| 132 | 132 | array.allocator.free(item); |
| 133 | 133 | } |
| 134 | 134 | array.deinit(); |
src/libc_installation.zig+3-3| ... | ... | @@ -342,7 +342,7 @@ pub const LibCInstallation = struct { |
| 342 | 342 | result_buf.shrink(0); |
| 343 | 343 | try result_buf.outStream().print("{}\\Include\\{}\\ucrt", .{ search.path, search.version }); |
| 344 | 344 | |
| 345 | var dir = fs.cwd().openDir(result_buf.span(), .{}) catch |err| switch (err) { | |
| 345 | var dir = fs.cwd().openDir(result_buf.items, .{}) catch |err| switch (err) { | |
| 346 | 346 | error.FileNotFound, |
| 347 | 347 | error.NotDir, |
| 348 | 348 | error.NoDevice, |
| ... | ... | @@ -388,7 +388,7 @@ pub const LibCInstallation = struct { |
| 388 | 388 | result_buf.shrink(0); |
| 389 | 389 | try result_buf.outStream().print("{}\\Lib\\{}\\ucrt\\{}", .{ search.path, search.version, arch_sub_dir }); |
| 390 | 390 | |
| 391 | var dir = fs.cwd().openDir(result_buf.span(), .{}) catch |err| switch (err) { | |
| 391 | var dir = fs.cwd().openDir(result_buf.items, .{}) catch |err| switch (err) { | |
| 392 | 392 | error.FileNotFound, |
| 393 | 393 | error.NotDir, |
| 394 | 394 | error.NoDevice, |
| ... | ... | @@ -443,7 +443,7 @@ pub const LibCInstallation = struct { |
| 443 | 443 | const stream = result_buf.outStream(); |
| 444 | 444 | try stream.print("{}\\Lib\\{}\\um\\{}", .{ search.path, search.version, arch_sub_dir }); |
| 445 | 445 | |
| 446 | var dir = fs.cwd().openDir(result_buf.span(), .{}) catch |err| switch (err) { | |
| 446 | var dir = fs.cwd().openDir(result_buf.items, .{}) catch |err| switch (err) { | |
| 447 | 447 | error.FileNotFound, |
| 448 | 448 | error.NotDir, |
| 449 | 449 | error.NoDevice, |
src/main.zig+3-3| ... | ... | @@ -2501,7 +2501,7 @@ pub fn cmdFmt(gpa: *Allocator, args: []const []const u8) !void { |
| 2501 | 2501 | defer fmt.seen.deinit(); |
| 2502 | 2502 | defer fmt.out_buffer.deinit(); |
| 2503 | 2503 | |
| 2504 | for (input_files.span()) |file_path| { | |
| 2504 | for (input_files.items) |file_path| { | |
| 2505 | 2505 | // Get the real path here to avoid Windows failing on relative file paths with . or .. in them. |
| 2506 | 2506 | const real_path = fs.realpathAlloc(gpa, file_path) catch |err| { |
| 2507 | 2507 | fatal("unable to open '{}': {}", .{ file_path, err }); |
| ... | ... | @@ -2681,7 +2681,7 @@ fn printErrMsgToFile( |
| 2681 | 2681 | defer text_buf.deinit(); |
| 2682 | 2682 | const out_stream = text_buf.outStream(); |
| 2683 | 2683 | try parse_error.render(tree.token_ids, out_stream); |
| 2684 | const text = text_buf.span(); | |
| 2684 | const text = text_buf.items; | |
| 2685 | 2685 | |
| 2686 | 2686 | const stream = file.outStream(); |
| 2687 | 2687 | try stream.print("{}:{}:{}: error: {}\n", .{ path, start_loc.line + 1, start_loc.column + 1, text }); |
| ... | ... | @@ -2830,7 +2830,7 @@ pub const ClangArgIterator = struct { |
| 2830 | 2830 | defer resp_arg_list.deinit(); |
| 2831 | 2831 | { |
| 2832 | 2832 | errdefer { |
| 2833 | for (resp_arg_list.span()) |item| { | |
| 2833 | for (resp_arg_list.items) |item| { | |
| 2834 | 2834 | allocator.free(mem.span(item)); |
| 2835 | 2835 | } |
| 2836 | 2836 | } |
src/translate_c.zig+1-1| ... | ... | @@ -6566,7 +6566,7 @@ fn parseCUnaryExpr(c: *Context, m: *MacroCtx, scope: *Scope) ParseError!*ast.Nod |
| 6566 | 6566 | |
| 6567 | 6567 | fn tokenSlice(c: *Context, token: ast.TokenIndex) []u8 { |
| 6568 | 6568 | const tok = c.token_locs.items[token]; |
| 6569 | const slice = c.source_buffer.span()[tok.start..tok.end]; | |
| 6569 | const slice = c.source_buffer.items[tok.start..tok.end]; | |
| 6570 | 6570 | return if (mem.startsWith(u8, slice, "@\"")) |
| 6571 | 6571 | slice[2 .. slice.len - 1] |
| 6572 | 6572 | else |
test/src/compare_output.zig+4-4| ... | ... | @@ -91,7 +91,7 @@ pub const CompareOutputContext = struct { |
| 91 | 91 | const b = self.b; |
| 92 | 92 | |
| 93 | 93 | const write_src = b.addWriteFiles(); |
| 94 | for (case.sources.span()) |src_file| { | |
| 94 | for (case.sources.items) |src_file| { | |
| 95 | 95 | write_src.add(src_file.filename, src_file.source); |
| 96 | 96 | } |
| 97 | 97 | |
| ... | ... | @@ -105,7 +105,7 @@ pub const CompareOutputContext = struct { |
| 105 | 105 | } |
| 106 | 106 | |
| 107 | 107 | const exe = b.addExecutable("test", null); |
| 108 | exe.addAssemblyFileFromWriteFileStep(write_src, case.sources.span()[0].filename); | |
| 108 | exe.addAssemblyFileFromWriteFileStep(write_src, case.sources.items[0].filename); | |
| 109 | 109 | |
| 110 | 110 | const run = exe.run(); |
| 111 | 111 | run.addArgs(case.cli_args); |
| ... | ... | @@ -125,7 +125,7 @@ pub const CompareOutputContext = struct { |
| 125 | 125 | if (mem.indexOf(u8, annotated_case_name, filter) == null) continue; |
| 126 | 126 | } |
| 127 | 127 | |
| 128 | const basename = case.sources.span()[0].filename; | |
| 128 | const basename = case.sources.items[0].filename; | |
| 129 | 129 | const exe = b.addExecutableFromWriteFileStep("test", write_src, basename); |
| 130 | 130 | exe.setBuildMode(mode); |
| 131 | 131 | if (case.link_libc) { |
| ... | ... | @@ -146,7 +146,7 @@ pub const CompareOutputContext = struct { |
| 146 | 146 | if (mem.indexOf(u8, annotated_case_name, filter) == null) return; |
| 147 | 147 | } |
| 148 | 148 | |
| 149 | const basename = case.sources.span()[0].filename; | |
| 149 | const basename = case.sources.items[0].filename; | |
| 150 | 150 | const exe = b.addExecutableFromWriteFileStep("test", write_src, basename); |
| 151 | 151 | if (case.link_libc) { |
| 152 | 152 | exe.linkSystemLibrary("c"); |
test/src/run_translated_c.zig+2-2| ... | ... | @@ -82,13 +82,13 @@ pub const RunTranslatedCContext = struct { |
| 82 | 82 | } |
| 83 | 83 | |
| 84 | 84 | const write_src = b.addWriteFiles(); |
| 85 | for (case.sources.span()) |src_file| { | |
| 85 | for (case.sources.items) |src_file| { | |
| 86 | 86 | write_src.add(src_file.filename, src_file.source); |
| 87 | 87 | } |
| 88 | 88 | const translate_c = b.addTranslateC(.{ |
| 89 | 89 | .write_file = .{ |
| 90 | 90 | .step = write_src, |
| 91 | .basename = case.sources.span()[0].filename, | |
| 91 | .basename = case.sources.items[0].filename, | |
| 92 | 92 | }, |
| 93 | 93 | }); |
| 94 | 94 | translate_c.step.name = b.fmt("{} translate-c", .{annotated_case_name}); |
test/src/translate_c.zig+3-3| ... | ... | @@ -105,20 +105,20 @@ pub const TranslateCContext = struct { |
| 105 | 105 | } |
| 106 | 106 | |
| 107 | 107 | const write_src = b.addWriteFiles(); |
| 108 | for (case.sources.span()) |src_file| { | |
| 108 | for (case.sources.items) |src_file| { | |
| 109 | 109 | write_src.add(src_file.filename, src_file.source); |
| 110 | 110 | } |
| 111 | 111 | |
| 112 | 112 | const translate_c = b.addTranslateC(.{ |
| 113 | 113 | .write_file = .{ |
| 114 | 114 | .step = write_src, |
| 115 | .basename = case.sources.span()[0].filename, | |
| 115 | .basename = case.sources.items[0].filename, | |
| 116 | 116 | }, |
| 117 | 117 | }); |
| 118 | 118 | translate_c.step.name = annotated_case_name; |
| 119 | 119 | translate_c.setTarget(case.target); |
| 120 | 120 | |
| 121 | const check_file = translate_c.addCheckFile(case.expected_lines.span()); | |
| 121 | const check_file = translate_c.addCheckFile(case.expected_lines.items); | |
| 122 | 122 | |
| 123 | 123 | self.step.dependOn(&check_file.step); |
| 124 | 124 | } |
test/standalone/brace_expansion/main.zig+5-5| ... | ... | @@ -131,7 +131,7 @@ fn expandString(input: []const u8, output: *ArrayListSentineled(u8, 0)) !void { |
| 131 | 131 | try expandNode(root, &result_list); |
| 132 | 132 | |
| 133 | 133 | try output.resize(0); |
| 134 | for (result_list.span()) |buf, i| { | |
| 134 | for (result_list.items) |buf, i| { | |
| 135 | 135 | if (i != 0) { |
| 136 | 136 | try output.append(' '); |
| 137 | 137 | } |
| ... | ... | @@ -157,8 +157,8 @@ fn expandNode(node: Node, output: *ArrayList(ArrayListSentineled(u8, 0))) Expand |
| 157 | 157 | var child_list_b = ArrayList(ArrayListSentineled(u8, 0)).init(global_allocator); |
| 158 | 158 | try expandNode(b_node, &child_list_b); |
| 159 | 159 | |
| 160 | for (child_list_a.span()) |buf_a| { | |
| 161 | for (child_list_b.span()) |buf_b| { | |
| 160 | for (child_list_a.items) |buf_a| { | |
| 161 | for (child_list_b.items) |buf_b| { | |
| 162 | 162 | var combined_buf = try ArrayListSentineled(u8, 0).initFromBuffer(buf_a); |
| 163 | 163 | try combined_buf.appendSlice(buf_b.span()); |
| 164 | 164 | try output.append(combined_buf); |
| ... | ... | @@ -166,11 +166,11 @@ fn expandNode(node: Node, output: *ArrayList(ArrayListSentineled(u8, 0))) Expand |
| 166 | 166 | } |
| 167 | 167 | }, |
| 168 | 168 | Node.List => |list| { |
| 169 | for (list.span()) |child_node| { | |
| 169 | for (list.items) |child_node| { | |
| 170 | 170 | var child_list = ArrayList(ArrayListSentineled(u8, 0)).init(global_allocator); |
| 171 | 171 | try expandNode(child_node, &child_list); |
| 172 | 172 | |
| 173 | for (child_list.span()) |buf| { | |
| 173 | for (child_list.items) |buf| { | |
| 174 | 174 | try output.append(buf); |
| 175 | 175 | } |
| 176 | 176 | } |
tools/merge_anal_dumps.zig+12-12| ... | ... | @@ -183,13 +183,13 @@ const Dump = struct { |
| 183 | 183 | try mergeSameStrings(&self.zig_version, zig_version); |
| 184 | 184 | try mergeSameStrings(&self.root_name, root_name); |
| 185 | 185 | |
| 186 | for (params.get("builds").?.value.Array.span()) |json_build| { | |
| 186 | for (params.get("builds").?.value.Array.items) |json_build| { | |
| 187 | 187 | const target = json_build.Object.get("target").?.value.String; |
| 188 | 188 | try self.targets.append(target); |
| 189 | 189 | } |
| 190 | 190 | |
| 191 | 191 | // Merge files. If the string matches, it's the same file. |
| 192 | const other_files = root.Object.get("files").?.value.Array.span(); | |
| 192 | const other_files = root.Object.get("files").?.value.Array.items; | |
| 193 | 193 | var other_file_to_mine = std.AutoHashMap(usize, usize).init(self.a()); |
| 194 | 194 | for (other_files) |other_file, i| { |
| 195 | 195 | const gop = try self.file_map.getOrPut(other_file.String); |
| ... | ... | @@ -201,7 +201,7 @@ const Dump = struct { |
| 201 | 201 | } |
| 202 | 202 | |
| 203 | 203 | // Merge AST nodes. If the file id, line, and column all match, it's the same AST node. |
| 204 | const other_ast_nodes = root.Object.get("astNodes").?.value.Array.span(); | |
| 204 | const other_ast_nodes = root.Object.get("astNodes").?.value.Array.items; | |
| 205 | 205 | var other_ast_node_to_mine = std.AutoHashMap(usize, usize).init(self.a()); |
| 206 | 206 | for (other_ast_nodes) |other_ast_node_json, i| { |
| 207 | 207 | const other_file_id = jsonObjInt(other_ast_node_json, "file"); |
| ... | ... | @@ -221,9 +221,9 @@ const Dump = struct { |
| 221 | 221 | // convert fields lists |
| 222 | 222 | for (other_ast_nodes) |other_ast_node_json, i| { |
| 223 | 223 | const my_node_index = other_ast_node_to_mine.get(i).?.value; |
| 224 | const my_node = &self.node_list.span()[my_node_index]; | |
| 224 | const my_node = &self.node_list.items[my_node_index]; | |
| 225 | 225 | if (other_ast_node_json.Object.get("fields")) |fields_json_kv| { |
| 226 | const other_fields = fields_json_kv.value.Array.span(); | |
| 226 | const other_fields = fields_json_kv.value.Array.items; | |
| 227 | 227 | my_node.fields = try self.a().alloc(usize, other_fields.len); |
| 228 | 228 | for (other_fields) |other_field_index, field_i| { |
| 229 | 229 | const other_index = @intCast(usize, other_field_index.Integer); |
| ... | ... | @@ -233,7 +233,7 @@ const Dump = struct { |
| 233 | 233 | } |
| 234 | 234 | |
| 235 | 235 | // Merge errors. If the AST Node matches, it's the same error value. |
| 236 | const other_errors = root.Object.get("errors").?.value.Array.span(); | |
| 236 | const other_errors = root.Object.get("errors").?.value.Array.items; | |
| 237 | 237 | var other_error_to_mine = std.AutoHashMap(usize, usize).init(self.a()); |
| 238 | 238 | for (other_errors) |other_error_json, i| { |
| 239 | 239 | const other_src_id = jsonObjInt(other_error_json, "src"); |
| ... | ... | @@ -253,7 +253,7 @@ const Dump = struct { |
| 253 | 253 | // First we identify all the simple types and merge those. |
| 254 | 254 | // Example: void, type, noreturn |
| 255 | 255 | // We can also do integers and floats. |
| 256 | const other_types = root.Object.get("types").?.value.Array.span(); | |
| 256 | const other_types = root.Object.get("types").?.value.Array.items; | |
| 257 | 257 | var other_types_to_mine = std.AutoHashMap(usize, usize).init(self.a()); |
| 258 | 258 | for (other_types) |other_type_json, i| { |
| 259 | 259 | const type_kind = jsonObjInt(other_type_json, "kind"); |
| ... | ... | @@ -336,7 +336,7 @@ const Dump = struct { |
| 336 | 336 | |
| 337 | 337 | try jw.objectField("builds"); |
| 338 | 338 | try jw.beginArray(); |
| 339 | for (self.targets.span()) |target| { | |
| 339 | for (self.targets.items) |target| { | |
| 340 | 340 | try jw.arrayElem(); |
| 341 | 341 | try jw.beginObject(); |
| 342 | 342 | try jw.objectField("target"); |
| ... | ... | @@ -349,7 +349,7 @@ const Dump = struct { |
| 349 | 349 | |
| 350 | 350 | try jw.objectField("types"); |
| 351 | 351 | try jw.beginArray(); |
| 352 | for (self.type_list.span()) |t| { | |
| 352 | for (self.type_list.items) |t| { | |
| 353 | 353 | try jw.arrayElem(); |
| 354 | 354 | try jw.beginObject(); |
| 355 | 355 | |
| ... | ... | @@ -379,7 +379,7 @@ const Dump = struct { |
| 379 | 379 | |
| 380 | 380 | try jw.objectField("errors"); |
| 381 | 381 | try jw.beginArray(); |
| 382 | for (self.error_list.span()) |zig_error| { | |
| 382 | for (self.error_list.items) |zig_error| { | |
| 383 | 383 | try jw.arrayElem(); |
| 384 | 384 | try jw.beginObject(); |
| 385 | 385 | |
| ... | ... | @@ -395,7 +395,7 @@ const Dump = struct { |
| 395 | 395 | |
| 396 | 396 | try jw.objectField("astNodes"); |
| 397 | 397 | try jw.beginArray(); |
| 398 | for (self.node_list.span()) |node| { | |
| 398 | for (self.node_list.items) |node| { | |
| 399 | 399 | try jw.arrayElem(); |
| 400 | 400 | try jw.beginObject(); |
| 401 | 401 | |
| ... | ... | @@ -425,7 +425,7 @@ const Dump = struct { |
| 425 | 425 | |
| 426 | 426 | try jw.objectField("files"); |
| 427 | 427 | try jw.beginArray(); |
| 428 | for (self.file_list.span()) |file| { | |
| 428 | for (self.file_list.items) |file| { | |
| 429 | 429 | try jw.arrayElem(); |
| 430 | 430 | try jw.emitString(file); |
| 431 | 431 | } |
tools/process_headers.zig+2-2| ... | ... | @@ -325,7 +325,7 @@ pub fn main() !void { |
| 325 | 325 | }, |
| 326 | 326 | .os = .linux, |
| 327 | 327 | }; |
| 328 | search: for (search_paths.span()) |search_path| { | |
| 328 | search: for (search_paths.items) |search_path| { | |
| 329 | 329 | var sub_path: []const []const u8 = undefined; |
| 330 | 330 | switch (vendor) { |
| 331 | 331 | .musl => { |
| ... | ... | @@ -416,7 +416,7 @@ pub fn main() !void { |
| 416 | 416 | try contents_list.append(contents); |
| 417 | 417 | } |
| 418 | 418 | } |
| 419 | std.sort.sort(*Contents, contents_list.span(), {}, Contents.hitCountLessThan); | |
| 419 | std.sort.sort(*Contents, contents_list.items, {}, Contents.hitCountLessThan); | |
| 420 | 420 | const best_contents = contents_list.popOrNull().?; |
| 421 | 421 | if (best_contents.hit_count > 1) { |
| 422 | 422 | // worth it to make it generic |
tools/update_clang_options.zig+5-5| ... | ... | @@ -374,7 +374,7 @@ pub fn main() anyerror!void { |
| 374 | 374 | } |
| 375 | 375 | // Some options have multiple matches. As an example, "-Wl,foo" matches both |
| 376 | 376 | // "W" and "Wl,". So we sort this list in order of descending priority. |
| 377 | std.sort.sort(*json.ObjectMap, all_objects.span(), {}, objectLessThan); | |
| 377 | std.sort.sort(*json.ObjectMap, all_objects.items, {}, objectLessThan); | |
| 378 | 378 | |
| 379 | 379 | var stdout_bos = std.io.bufferedOutStream(std.io.getStdOut().outStream()); |
| 380 | 380 | const stdout = stdout_bos.outStream(); |
| ... | ... | @@ -386,12 +386,12 @@ pub fn main() anyerror!void { |
| 386 | 386 | \\ |
| 387 | 387 | ); |
| 388 | 388 | |
| 389 | for (all_objects.span()) |obj| { | |
| 389 | for (all_objects.items) |obj| { | |
| 390 | 390 | const name = obj.get("Name").?.String; |
| 391 | 391 | var pd1 = false; |
| 392 | 392 | var pd2 = false; |
| 393 | 393 | var pslash = false; |
| 394 | for (obj.get("Prefixes").?.Array.span()) |prefix_json| { | |
| 394 | for (obj.get("Prefixes").?.Array.items) |prefix_json| { | |
| 395 | 395 | const prefix = prefix_json.String; |
| 396 | 396 | if (std.mem.eql(u8, prefix, "-")) { |
| 397 | 397 | pd1 = true; |
| ... | ... | @@ -502,7 +502,7 @@ const Syntax = union(enum) { |
| 502 | 502 | |
| 503 | 503 | fn objSyntax(obj: *json.ObjectMap) Syntax { |
| 504 | 504 | const num_args = @intCast(u8, obj.get("NumArgs").?.Integer); |
| 505 | for (obj.get("!superclasses").?.Array.span()) |superclass_json| { | |
| 505 | for (obj.get("!superclasses").?.Array.items) |superclass_json| { | |
| 506 | 506 | const superclass = superclass_json.String; |
| 507 | 507 | if (std.mem.eql(u8, superclass, "Joined")) { |
| 508 | 508 | return .joined; |
| ... | ... | @@ -548,7 +548,7 @@ fn objSyntax(obj: *json.ObjectMap) Syntax { |
| 548 | 548 | } |
| 549 | 549 | const key = obj.get("!name").?.String; |
| 550 | 550 | std.debug.warn("{} (key {}) has unrecognized superclasses:\n", .{ name, key }); |
| 551 | for (obj.get("!superclasses").?.Array.span()) |superclass_json| { | |
| 551 | for (obj.get("!superclasses").?.Array.items) |superclass_json| { | |
| 552 | 552 | std.debug.warn(" {}\n", .{superclass_json.String}); |
| 553 | 553 | } |
| 554 | 554 | std.process.exit(1); |
tools/update_glibc.zig+7-7| ... | ... | @@ -225,15 +225,15 @@ pub fn main() !void { |
| 225 | 225 | var list = std.ArrayList([]const u8).init(allocator); |
| 226 | 226 | var it = global_fn_set.iterator(); |
| 227 | 227 | while (it.next()) |entry| try list.append(entry.key); |
| 228 | std.sort.sort([]const u8, list.span(), {}, strCmpLessThan); | |
| 229 | break :blk list.span(); | |
| 228 | std.sort.sort([]const u8, list.items, {}, strCmpLessThan); | |
| 229 | break :blk list.items; | |
| 230 | 230 | }; |
| 231 | 231 | const global_ver_list = blk: { |
| 232 | 232 | var list = std.ArrayList([]const u8).init(allocator); |
| 233 | 233 | var it = global_ver_set.iterator(); |
| 234 | 234 | while (it.next()) |entry| try list.append(entry.key); |
| 235 | std.sort.sort([]const u8, list.span(), {}, versionLessThan); | |
| 236 | break :blk list.span(); | |
| 235 | std.sort.sort([]const u8, list.items, {}, versionLessThan); | |
| 236 | break :blk list.items; | |
| 237 | 237 | }; |
| 238 | 238 | { |
| 239 | 239 | const vers_txt_path = try fs.path.join(allocator, &[_][]const u8{ glibc_out_dir, "vers.txt" }); |
| ... | ... | @@ -266,13 +266,13 @@ pub fn main() !void { |
| 266 | 266 | for (abi_lists) |*abi_list, abi_index| { |
| 267 | 267 | const entry = target_functions.getEntry(@ptrToInt(abi_list)).?; |
| 268 | 268 | const fn_vers_list = &entry.value.fn_vers_list; |
| 269 | for (entry.value.list.span()) |*ver_fn| { | |
| 269 | for (entry.value.list.items) |*ver_fn| { | |
| 270 | 270 | const gop = try fn_vers_list.getOrPut(ver_fn.name); |
| 271 | 271 | if (!gop.found_existing) { |
| 272 | 272 | gop.entry.value = std.ArrayList(usize).init(allocator); |
| 273 | 273 | } |
| 274 | 274 | const ver_index = global_ver_set.getEntry(ver_fn.ver).?.value; |
| 275 | if (std.mem.indexOfScalar(usize, gop.entry.value.span(), ver_index) == null) { | |
| 275 | if (std.mem.indexOfScalar(usize, gop.entry.value.items, ver_index) == null) { | |
| 276 | 276 | try gop.entry.value.append(ver_index); |
| 277 | 277 | } |
| 278 | 278 | } |
| ... | ... | @@ -299,7 +299,7 @@ pub fn main() !void { |
| 299 | 299 | try abilist_txt.writeByte('\n'); |
| 300 | 300 | continue; |
| 301 | 301 | }; |
| 302 | for (entry.value.span()) |ver_index, it_i| { | |
| 302 | for (entry.value.items) |ver_index, it_i| { | |
| 303 | 303 | if (it_i != 0) try abilist_txt.writeByte(' '); |
| 304 | 304 | try abilist_txt.print("{d}", .{ver_index}); |
| 305 | 305 | } |