diff --git a/src/image.zig b/src/image.zig index e3599be..704213d 100644 --- a/src/image.zig +++ b/src/image.zig @@ -312,7 +312,7 @@ pub const Image = struct { // now, for each param for the plugin, we find its port, and set // the value for the port there. - for (params.toSlice()) |param| { + for (params.items) |param| { var sym_cstr = try std.cstr.addNullByte(self.allocator, param.sym); defer self.allocator.free(sym_cstr); diff --git a/src/lang.zig b/src/lang.zig index 864940d..848cf9a 100644 --- a/src/lang.zig +++ b/src/lang.zig @@ -113,7 +113,7 @@ pub const Command = struct { try arr.append(value); } - return arr.toSliceConst(); + return arr.items; } pub fn appendParam( @@ -256,8 +256,7 @@ pub const Lang = struct { } while (i < count) : (i += 1) { - var arg = args.at(i); - + var arg = args.items[i]; _ = std.fmt.parseFloat(f32, arg) catch |err| { std.debug.warn("failed to parse f32: {}\n", .{err}); return error.FloatParseFail; diff --git a/src/main.zig b/src/main.zig index 510c2d8..2b8da57 100644 --- a/src/main.zig +++ b/src/main.zig @@ -51,7 +51,7 @@ pub fn doRepl(allocator: *std.mem.Allocator, args_it: var) !void { defer existing_cmds.deinit(); // copy the existing command list into the repl's command list - for (existing_cmds.toSlice()) |existing_cmd| { + for (existing_cmds.items) |existing_cmd| { try cmds.append(existing_cmd); } } else { diff --git a/src/printer.zig b/src/printer.zig index 940c7b3..ea91ec2 100644 --- a/src/printer.zig +++ b/src/printer.zig @@ -1,7 +1,7 @@ const langs = @import("lang.zig"); pub fn printList(list: langs.CommandList, stream: var) !void { - for (list.toSlice()) |cmd| { + for (list.items) |cmd| { var command = switch (cmd.command) { .Noop => "noop", .Load => "load", @@ -47,7 +47,7 @@ pub fn printList(list: langs.CommandList, stream: var) !void { try stream.print("{}", .{command}); - for (cmd.args.toSlice()) |arg| { + for (cmd.args.items) |arg| { try stream.print(" {}", .{arg}); } diff --git a/src/runner.zig b/src/runner.zig index aa0a069..6276954 100644 --- a/src/runner.zig +++ b/src/runner.zig @@ -384,14 +384,14 @@ pub const Runner = struct { return switch (cmd.command) { .Noop => {}, .Load => blk: { - var path = cmd.args.at(0); + var path = cmd.args.items[0]; try self.loadCmd(path); // TODO is this needed? break :blk; }, .Quicksave => try self.quicksaveCmd(), - .RunQS => try self.runQSCmd(cmd.args.at(0)), + .RunQS => try self.runQSCmd(cmd.args.items[0]), .Amp => blk: { const pos = try cmd.consumePosition(); @@ -547,7 +547,7 @@ pub const Runner = struct { .Embed => blk: { const pos = try cmd.consumePosition(); - const path = cmd.args.at(2); + const path = cmd.args.items[2]; try self.embedCmd(pos, path); }, @@ -775,7 +775,7 @@ pub const Runner = struct { cmds: lang.CommandList, debug_flag: bool, ) !void { - for (cmds.toSlice()) |const_cmd| { + for (cmds.items) |const_cmd| { if (debug_flag) const_cmd.print(); // copy the command so we own its memory