From 804204db7cf1e8a28defd359d17fa72949e13eff Mon Sep 17 00:00:00 2001 From: Nathan Reiner Date: Mon, 31 Aug 2026 23:05:16 +0200 Subject: Implement with ptrCast to make it more transparent. --- src/Interpreter.zig | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/Interpreter.zig') diff --git a/src/Interpreter.zig b/src/Interpreter.zig index 6862706..6768659 100644 --- a/src/Interpreter.zig +++ b/src/Interpreter.zig @@ -4,7 +4,7 @@ const zpy = @import("root.zig"); const Self = @This(); -globals: zpy.Dict, +globals: *zpy.Dict, pub fn init() !Self { c.Py_Initialize(); @@ -20,14 +20,14 @@ pub const RunOptions = struct { locals: ?*zpy.Dict = null, }; -pub fn run(self: *Self, str: [*c]const u8, options: RunOptions) zpy.Error!zpy.Object { +pub fn run(self: *Self, str: [*c]const u8, options: RunOptions) !*zpy.Object { if (c.PyRun_String( str, c.Py_file_input, - self.globals.object.ptr, - if (options.locals) |loc| loc.object.ptr else null, + @ptrCast(self.globals), + @ptrCast(options.locals), )) |object| { - return .fromPtr(object); + return @ptrCast(object); } return error.Exception; -- cgit v1.2.3-70-g09d2