diff --git a/pkg/fontconfig/common.zig b/pkg/fontconfig/common.zig index 44c583f94..6ad6f5685 100644 --- a/pkg/fontconfig/common.zig +++ b/pkg/fontconfig/common.zig @@ -84,7 +84,7 @@ pub const Property = enum { pub fn cval(self: Property) [:0]const u8 { @setEvalBranchQuota(10_000); - inline for (@typeInfo(Property).Enum.fields) |field| { + inline for (@typeInfo(Property).@"enum".fields) |field| { if (self == @field(Property, field.name)) { // Build our string in a comptime context so it is a binary // constant and not stack allocated. diff --git a/src/renderer.zig b/src/renderer.zig index ea3eb1b97..61d9a4e53 100644 --- a/src/renderer.zig +++ b/src/renderer.zig @@ -70,5 +70,13 @@ pub const Health = enum(c_int) { }; test { - @import("std").testing.refAllDecls(@This()); + // Our comptime-chosen renderer + _ = Renderer; + + _ = cursor; + _ = message; + _ = shadertoy; + _ = size; + _ = Thread; + _ = State; } diff --git a/src/renderer/OpenGL.zig b/src/renderer/OpenGL.zig index c152db14d..f2df8f9a0 100644 --- a/src/renderer/OpenGL.zig +++ b/src/renderer/OpenGL.zig @@ -41,7 +41,7 @@ pub const single_threaded_draw = if (@hasDecl(apprt.Surface, "opengl_single_thre else false; const DrawMutex = if (single_threaded_draw) std.Thread.Mutex else void; -const drawMutexZero = if (DrawMutex == void) void{} else .{}; +const drawMutexZero: DrawMutex = if (DrawMutex == void) void{} else .{}; alloc: std.mem.Allocator, @@ -1392,29 +1392,29 @@ pub fn rebuildCells( // Try to read the cells from the shaping cache if we can. self.font_shaper_cache.get(run) orelse cache: { - // Otherwise we have to shape them. - const cells = try self.font_shaper.shape(run); - - // Try to cache them. If caching fails for any reason we - // continue because it is just a performance optimization, - // not a correctness issue. - self.font_shaper_cache.put( - self.alloc, - run, - cells, - ) catch |err| { - log.warn( - "error caching font shaping results err={}", - .{err}, - ); + // Otherwise we have to shape them. + const cells = try self.font_shaper.shape(run); + + // Try to cache them. If caching fails for any reason we + // continue because it is just a performance optimization, + // not a correctness issue. + self.font_shaper_cache.put( + self.alloc, + run, + cells, + ) catch |err| { + log.warn( + "error caching font shaping results err={}", + .{err}, + ); + }; + + // The cells we get from direct shaping are always owned + // by the shaper and valid until the next shaping call so + // we can safely use them. + break :cache cells; }; - // The cells we get from direct shaping are always owned - // by the shaper and valid until the next shaping call so - // we can safely use them. - break :cache cells; - }; - // Advance our index until we reach or pass // our current x position in the shaper cells. while (shaper_cells.?[shaper_cells_i].x < x) { @@ -1637,29 +1637,29 @@ pub fn rebuildCells( // Try to read the cells from the shaping cache if we can. self.font_shaper_cache.get(run) orelse cache: { - // Otherwise we have to shape them. - const cells = try self.font_shaper.shape(run); - - // Try to cache them. If caching fails for any reason we - // continue because it is just a performance optimization, - // not a correctness issue. - self.font_shaper_cache.put( - self.alloc, - run, - cells, - ) catch |err| { - log.warn( - "error caching font shaping results err={}", - .{err}, - ); + // Otherwise we have to shape them. + const cells = try self.font_shaper.shape(run); + + // Try to cache them. If caching fails for any reason we + // continue because it is just a performance optimization, + // not a correctness issue. + self.font_shaper_cache.put( + self.alloc, + run, + cells, + ) catch |err| { + log.warn( + "error caching font shaping results err={}", + .{err}, + ); + }; + + // The cells we get from direct shaping are always owned + // by the shaper and valid until the next shaping call so + // we can safely use them. + break :cache cells; }; - // The cells we get from direct shaping are always owned - // by the shaper and valid until the next shaping call so - // we can safely use them. - break :cache cells; - }; - const cells = shaper_cells orelse break :glyphs; // If there are no shaper cells for this run, ignore it.