From 675084e77c30dbc2e03124e37b74f91b30bd0b0c Mon Sep 17 00:00:00 2001 From: Rekai Musuka Date: Thu, 15 Dec 2022 04:17:18 -0400 Subject: [PATCH] chore: remove const cast --- src/lib.zig | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/lib.zig b/src/lib.zig index dcb9a6c..660dba3 100644 --- a/src/lib.zig +++ b/src/lib.zig @@ -11,8 +11,8 @@ pub const Emulator = struct { writeFn: *const fn (*anyopaque, u32, u8) void, // FIXME: Expensive copy - registersFn: *const fn (*const anyopaque) [16]u32, - cpsrFn: *const fn (*const anyopaque) u32, + registersFn: *const fn (*anyopaque) [16]u32, + cpsrFn: *const fn (*anyopaque) u32, pub fn init(ptr: anytype) Self { const Ptr = @TypeOf(ptr); @@ -36,13 +36,13 @@ pub const Emulator = struct { return @call(.{ .modifier = .always_inline }, ptr_info.Pointer.child.read, .{ self, addr, value }); } - pub fn registersImpl(pointer: *const anyopaque) [16]u32 { + pub fn registersImpl(pointer: *anyopaque) [16]u32 { const self = @ptrCast(Ptr, @alignCast(alignment, pointer)); return @call(.{ .modifier = .always_inline }, ptr_info.Pointer.child.registers, .{self}); } - pub fn cpsrImpl(pointer: *const anyopaque) u32 { + pub fn cpsrImpl(pointer: *anyopaque) u32 { const self = @ptrCast(Ptr, @alignCast(alignment, pointer)); return @call(.{ .modifier = .always_inline }, ptr_info.Pointer.child.cpsr, .{self});