diff options
Diffstat (limited to 'src/wl/display.zig')
| -rw-r--r-- | src/wl/display.zig | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/wl/display.zig b/src/wl/display.zig index d8b9e93..fed8bbd 100644 --- a/src/wl/display.zig +++ b/src/wl/display.zig @@ -164,7 +164,7 @@ pub fn request(self: *Self, object: anytype, args: @TypeOf(object.*).Request) !v return error.InvalidOpcode; } -fn read_event(self: *Self, ctx: *const wayland.Context) !void { +fn read_event(self: *Self, ctx: wayland.Context) !void { const endian = @import("builtin").target.cpu.arch.endian(); const reader = self.stream.reader(); @@ -192,7 +192,7 @@ fn read_event(self: *Self, ctx: *const wayland.Context) !void { } pub fn roundtrip(self: *Self, allocator: std.mem.Allocator) !void { - var context: wayland.Context = .{ + const context: wayland.Context = .{ .display = self, .allocator = allocator, }; @@ -200,21 +200,21 @@ pub fn roundtrip(self: *Self, allocator: std.mem.Allocator) !void { var done = false; var callback: wl.Callback = undefined; - try callback.init(&context, &done); - defer callback.deinit(&context); + try callback.init(context, &done); + defer callback.deinit(context); - errdefer self.read_event(&context) catch |e| { + errdefer self.read_event(context) catch |e| { log.err("cleanup error: {}", .{e}); }; while (!done) { - try self.read_event(&context); + try self.read_event(context); } } fn err( self: *Self, - ctx: *const wayland.Context, + ctx: wayland.Context, object: *wayland.Object, code: u32, message: []const u8, @@ -226,7 +226,7 @@ fn err( fn delete_id( self: *Self, - ctx: *const wayland.Context, + ctx: wayland.Context, id: u32, ) void { _ = ctx; |