fix some issues for future Zig update

This commit is contained in:
Mitchell Hashimoto
2023-05-19 08:34:07 -07:00
parent 472958fd12
commit b196e43ee4
4 changed files with 9 additions and 15 deletions

View File

@ -103,10 +103,8 @@ test "from descriptors" {
const desc = try text.FontDescriptor.createWithNameAndSize(name, 12);
defer desc.release();
const arr = try foundation.Array.create(
text.FontDescriptor,
&[_]*const text.FontDescriptor{desc},
);
var desc_arr = [_]*const text.FontDescriptor{desc};
const arr = try foundation.Array.create(text.FontDescriptor, &desc_arr);
defer arr.release();
const v = try FontCollection.createWithFontDescriptors(arr);
@ -129,10 +127,8 @@ test "from descriptors no match" {
const desc = try text.FontDescriptor.createWithNameAndSize(name, 12);
defer desc.release();
const arr = try foundation.Array.create(
text.FontDescriptor,
&[_]*const text.FontDescriptor{desc},
);
var desc_arr = [_]*const text.FontDescriptor{desc};
const arr = try foundation.Array.create(text.FontDescriptor, &desc_arr);
defer arr.release();
const v = try FontCollection.createWithFontDescriptors(arr);

View File

@ -20,13 +20,13 @@ pub const artifact = Artifact.detect();
/// The runtime to back exe artifacts with.
pub const app_runtime: apprt.Runtime = switch (artifact) {
.lib => .none,
else => std.meta.stringToEnum(apprt.Runtime, std.meta.tagName(options.app_runtime)).?,
else => std.meta.stringToEnum(apprt.Runtime, @tagName(options.app_runtime)).?,
};
/// The font backend desired for the build.
pub const font_backend: font.Backend = std.meta.stringToEnum(
font.Backend,
std.meta.tagName(options.font_backend),
@tagName(options.font_backend),
).?;
/// Whether our devmode UI is enabled or not. This requires imgui to be

View File

@ -251,10 +251,8 @@ pub const CoreText = struct {
defer ct_desc.release();
// Our descriptors have to be in an array
const desc_arr = try macos.foundation.Array.create(
macos.text.FontDescriptor,
&[_]*const macos.text.FontDescriptor{ct_desc},
);
var ct_desc_arr = [_]*const macos.text.FontDescriptor{ct_desc};
const desc_arr = try macos.foundation.Array.create(macos.text.FontDescriptor, &ct_desc_arr);
defer desc_arr.release();
// Build our collection

View File

@ -3547,7 +3547,7 @@ test "Screen: scrollRegionUp buffer wrap" {
}
}
test "Screen: scrollRegionUp buffer wrap" {
test "Screen: scrollRegionUp buffer wrap alternate" {
const testing = std.testing;
const alloc = testing.allocator;