zig fmt pass

This commit is contained in:
Luna 2020-07-23 16:31:32 -03:00
parent 973d6e63c5
commit fa7e993ec2
6 changed files with 12 additions and 12 deletions

View file

@ -16,7 +16,7 @@ pub const RandomNoise = struct {
pub fn init(
allocator: *std.mem.Allocator,
params: var,
params: anytype,
) ?RandomNoise {
var r = std.rand.DefaultPrng.init(params.seed);
@ -64,7 +64,7 @@ pub const WildNoise = struct {
pub fn init(
allocator: *std.mem.Allocator,
params: var,
params: anytype,
) ?WildNoise {
var r = std.rand.DefaultPrng.init(params.seed);
@ -112,7 +112,7 @@ pub const Write = struct {
pub fn init(
allocator: *std.mem.Allocator,
params: var,
params: anytype,
) Write {
return Write{
.data = params.data,
@ -133,7 +133,7 @@ pub const Embed = struct {
sndfile: *c.SNDFILE = undefined,
buf: []f32 = undefined,
pub fn init(allocator: *std.mem.Allocator, params: var) @This() {
pub fn init(allocator: *std.mem.Allocator, params: anytype) @This() {
return Embed{
.allocator = allocator,
.filepath = params.path,

View file

@ -425,7 +425,7 @@ pub const Image = struct {
self: *Image,
comptime Plugin: type,
position: plugins.Position,
extra: var,
extra: anytype,
) !void {
var plugin_opt: ?Plugin = Plugin.init(self.allocator, extra);
if (plugin_opt == null) {

View file

@ -497,7 +497,7 @@ pub const Lang = struct {
self.has_error = false;
self.line = 0;
}
fn doError(self: *Lang, comptime fmt: []const u8, args: var) void {
fn doError(self: *Lang, comptime fmt: []const u8, args: anytype) void {
std.debug.warn("ERROR! at line {}: ", .{self.line});
std.debug.warn(fmt, args);
std.debug.warn("\n", .{});

View file

@ -36,7 +36,7 @@ fn copyCommandToHeap(allocator: *std.mem.Allocator, command: langs.Command, comp
return &heap_cmd.base;
}
pub fn doRepl(allocator: *std.mem.Allocator, args_it: var) !void {
pub fn doRepl(allocator: *std.mem.Allocator, args_it: anytype) !void {
var stdout_file = std.io.getStdOut();
const stdout = &stdout_file.outStream();
const scri_path = try (args_it.next(allocator) orelse @panic("expected scri path"));

View file

@ -1,7 +1,7 @@
const std = @import("std");
const langs = @import("lang.zig");
fn printCommandWithParams(stream: var, command: var) !void {
fn printCommandWithParams(stream: anytype, command: anytype) !void {
const Parameters = @TypeOf(command.parameters);
try stream.print(" {} {}", .{ command.split, command.index });
inline for (@typeInfo(Parameters).Struct.fields) |field| {
@ -13,7 +13,7 @@ fn printCommandWithParams(stream: var, command: var) !void {
}
}
fn printCommand(stream: var, cmd: *langs.Command, comptime tag: langs.Command.Tag) !void {
fn printCommand(stream: anytype, cmd: *langs.Command, comptime tag: langs.Command.Tag) !void {
const CommandStruct = langs.Command.tagToType(tag);
const casted = cmd.cast(CommandStruct).?;
@ -31,7 +31,7 @@ fn printCommand(stream: var, cmd: *langs.Command, comptime tag: langs.Command.Ta
}
}
pub fn printList(list: langs.CommandList, stream: var) !void {
pub fn printList(list: langs.CommandList, stream: anytype) !void {
for (list.items) |cmd| {
const command = @tagName(cmd.tag);
try stream.print("{}", .{command});

View file

@ -209,7 +209,7 @@ pub const Runner = struct {
try magick.runRotate(image, rotate_cmd.deg, c_bgfill);
}
fn executeLV2Command(self: *@This(), command: var) !void {
fn executeLV2Command(self: *@This(), command: anytype) !void {
const pos = plugin.Position{
.split = command.split,
.index = command.index,
@ -231,7 +231,7 @@ pub const Runner = struct {
try image.runPlugin(typ.lv2_url, pos, params);
}
fn executeCustomCommand(self: *@This(), command: var) !void {
fn executeCustomCommand(self: *@This(), command: anytype) !void {
const pos = plugin.Position{
.split = command.split,
.index = command.index,