From 4feb8c7dab2b0a3492b8248ee12c3f0a475106f1 Mon Sep 17 00:00:00 2001 From: Nathan Reiner Date: Fri, 29 Aug 2025 18:21:48 +0200 Subject: Use wayland.Context instead of *const wayland.Context --- src/wl/display.zig | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/wl/display.zig') 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; -- cgit v1.2.3-70-g09d2