From 45da58188cab8d71ce956b3c567bce7d8984d78a Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Fri, 30 Jun 2023 13:53:05 -0700 Subject: [PATCH] fix up for new zig --- pkg/macos/text/font.zig | 4 ++-- src/font/face/coretext.zig | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pkg/macos/text/font.zig b/pkg/macos/text/font.zig index 5ff031183..cf24bc5d0 100644 --- a/pkg/macos/text/font.zig +++ b/pkg/macos/text/font.zig @@ -132,11 +132,11 @@ pub const Font = opaque { } pub fn getUnitsPerEm(self: *Font) u32 { - return c.CTFontGetUnitsPerEm(@ptrCast(c.CTFontRef, self)); + return c.CTFontGetUnitsPerEm(@ptrCast(self)); } pub fn getSize(self: *Font) f64 { - return c.CTFontGetSize(@ptrCast(c.CTFontRef, self)); + return c.CTFontGetSize(@ptrCast(self)); } }; diff --git a/src/font/face/coretext.zig b/src/font/face/coretext.zig index 86bbca747..58bbddac9 100644 --- a/src/font/face/coretext.zig +++ b/src/font/face/coretext.zig @@ -144,7 +144,7 @@ pub const Face = struct { // TODO(mitchellh): color is going to require a depth here var buf = try alloc.alloc(u8, width * height); defer alloc.free(buf); - std.mem.set(u8, buf, 0); + @memset(buf, 0); const space = try macos.graphics.ColorSpace.createDeviceGray(); defer space.release(); @@ -166,8 +166,8 @@ pub const Face = struct { ctx.fillRect(.{ .origin = .{ .x = 0, .y = 0 }, .size = .{ - .width = @intToFloat(f64, width), - .height = @intToFloat(f64, height), + .width = @floatFromInt(width), + .height = @floatFromInt(height), }, });