From ee4fcd926b3c0d56690fb82e7d267563f401c82a Mon Sep 17 00:00:00 2001 From: Rekai Musuka Date: Fri, 21 Oct 2022 05:11:49 -0300 Subject: [PATCH] fix: by convention deinit() should not take pointers to self --- src/bus.zig | 2 +- src/bus/bios.zig | 2 +- src/bus/pak.zig | 2 +- src/ppu.zig | 6 +++--- src/scheduler.zig | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/bus.zig b/src/bus.zig index 83f1bea..03f2d37 100644 --- a/src/bus.zig +++ b/src/bus.zig @@ -23,7 +23,7 @@ pub const Bus = struct { }; } - pub fn deinit(self: *@This()) void { + pub fn deinit(self: @This()) void { self.pak.deinit(); self.bios.deinit(); self.ppu.deinit(); diff --git a/src/bus/bios.zig b/src/bus/bios.zig index 389de16..84e5a29 100644 --- a/src/bus/bios.zig +++ b/src/bus/bios.zig @@ -18,7 +18,7 @@ pub const Bios = struct { }; } - pub fn deinit(self: *@This()) void { + pub fn deinit(self: @This()) void { self.alloc.free(self.buf); } diff --git a/src/bus/pak.zig b/src/bus/pak.zig index d622e5e..3f5e170 100644 --- a/src/bus/pak.zig +++ b/src/bus/pak.zig @@ -18,7 +18,7 @@ pub const GamePak = struct { }; } - pub fn deinit(self: *@This()) void { + pub fn deinit(self: @This()) void { self.alloc.free(self.buf); } diff --git a/src/ppu.zig b/src/ppu.zig index c841779..b9e4b2c 100644 --- a/src/ppu.zig +++ b/src/ppu.zig @@ -20,7 +20,7 @@ pub const Ppu = struct { }; } - pub fn deinit(self: *@This()) void { + pub fn deinit(self: @This()) void { self.vram.deinit(); } }; @@ -36,7 +36,7 @@ const Palette = struct { }; } - fn deinit(self: *@This()) void { + fn deinit(self: @This()) void { self.alloc.free(self.buf); } @@ -74,7 +74,7 @@ const Vram = struct { }; } - fn deinit(self: *@This()) void { + fn deinit(self: @This()) void { self.alloc.free(self.buf); } diff --git a/src/scheduler.zig b/src/scheduler.zig index 58d16d3..e9195c3 100644 --- a/src/scheduler.zig +++ b/src/scheduler.zig @@ -21,7 +21,7 @@ pub const Scheduler = struct { return scheduler; } - pub fn deinit(self: *@This()) void { + pub fn deinit(self: @This()) void { self.queue.deinit(); }