Skip to content

Commit 01e3ba9

Browse files
committed
openvr_test: Zig 0.14.0 fixups
1 parent 48c6fab commit 01e3ba9

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

samples/openvr_test/src/ui.zig

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -878,7 +878,7 @@ fn renderParams(allocator: ?std.mem.Allocator, comptime arg_types: []const type,
878878
fn deinitResult(allocator: std.mem.Allocator, comptime Return: type, result: ?Return) void {
879879
if (result) |r| {
880880
switch (@typeInfo(Return)) {
881-
.ErrorUnion => |error_union| {
881+
.error_union => |error_union| {
882882
if (r) |payload| {
883883
deinitResult(allocator, error_union.payload, payload);
884884
} else |_| {}
@@ -951,7 +951,7 @@ pub fn readOnlyHexdump(allocator: std.mem.Allocator, bytes: []const u8) !void {
951951
}
952952
fn renderResult(allocator: ?std.mem.Allocator, comptime Return: type, result: Return) !void {
953953
switch (@typeInfo(Return)) {
954-
.Pointer => |pointer| {
954+
.pointer => |pointer| {
955955
if (pointer.size == .Slice and pointer.child != u8) {
956956
if (result.len > 0) {
957957
for (result, 0..) |v, i| {
@@ -969,7 +969,7 @@ fn renderResult(allocator: ?std.mem.Allocator, comptime Return: type, result: Re
969969
return;
970970
}
971971
},
972-
.Optional => |optional| {
972+
.optional => |optional| {
973973
if (result) |v| {
974974
try renderResult(allocator, optional.child, v);
975975
} else {
@@ -979,7 +979,7 @@ fn renderResult(allocator: ?std.mem.Allocator, comptime Return: type, result: Re
979979
}
980980
return;
981981
},
982-
.ErrorUnion => |error_union| {
982+
.error_union => |error_union| {
983983
if (result) |v| {
984984
try renderResult(allocator, error_union.payload, v);
985985
} else |err| {
@@ -1337,7 +1337,7 @@ pub fn getter(comptime T: type, comptime f_name: [:0]const u8, self: T, arg_ptrs
13371337
defer zgui.popId();
13381338

13391339
const ArgPtrs = @TypeOf(arg_ptrs);
1340-
const arg_ptrs_info = @typeInfo(ArgPtrs).Struct;
1340+
const arg_ptrs_info = @typeInfo(ArgPtrs).@"struct";
13411341

13421342
const f_type = fType(T, f_name);
13431343
const args = args: {
@@ -1360,10 +1360,10 @@ fn fillArgs(comptime arg_ptrs_info: std.builtin.Type.Struct, arg_ptrs: anytype,
13601360
inline for (arg_ptrs_info.fields, 0..) |field, i| {
13611361
const arg_ptr = @field(arg_ptrs, field.name);
13621362
args[i + offset] = switch (@typeInfo(field.type)) {
1363-
.Pointer => |pointer| switch (pointer.size) {
1363+
.pointer => |pointer| switch (pointer.size) {
13641364
.Slice => arg_ptr,
13651365
.One => switch (@typeInfo(pointer.child)) {
1366-
.Array => std.mem.sliceTo(arg_ptr, 0),
1366+
.array => std.mem.sliceTo(arg_ptr, 0),
13671367
else => switch (field.type) {
13681368
*std.ArrayList(OpenVR.AppOverrideKeys),
13691369
*std.ArrayList(OpenVR.TrackedDeviceIndex),
@@ -1387,7 +1387,7 @@ pub fn staticGetter(comptime T: type, comptime f_name: [:0]const u8, arg_ptrs: a
13871387
defer zgui.popId();
13881388

13891389
const ArgPtrs = @TypeOf(arg_ptrs);
1390-
const arg_ptrs_info = @typeInfo(ArgPtrs).Struct;
1390+
const arg_ptrs_info = @typeInfo(ArgPtrs).@"struct";
13911391

13921392
const f_type = fType(T, f_name);
13931393
const args = args: {
@@ -1410,7 +1410,7 @@ pub fn allocGetter(allocator: std.mem.Allocator, comptime T: type, comptime f_na
14101410
defer zgui.popId();
14111411

14121412
const ArgPtrs = @TypeOf(arg_ptrs);
1413-
const arg_ptrs_info = @typeInfo(ArgPtrs).Struct;
1413+
const arg_ptrs_info = @typeInfo(ArgPtrs).@"struct";
14141414

14151415
const f_type = fType(T, f_name);
14161416
const args = args: {
@@ -1444,7 +1444,7 @@ pub fn allocGetter(allocator: std.mem.Allocator, comptime T: type, comptime f_na
14441444
fn FType(comptime T: type, comptime f_name: []const u8) type {
14451445
const f = @field(T, f_name);
14461446
const F = @TypeOf(f);
1447-
const f_info = @typeInfo(F).Fn;
1447+
const f_info = @typeInfo(F).@"fn";
14481448
comptime var arg_types: [f_info.params.len]type = undefined;
14491449
inline for (f_info.params, 0..) |param, i| {
14501450
arg_types[i] = param.type.?;
@@ -1453,11 +1453,11 @@ fn FType(comptime T: type, comptime f_name: []const u8) type {
14531453
const Return = f_info.return_type.?;
14541454
const return_type_info = @typeInfo(Return);
14551455
const Payload = switch (return_type_info) {
1456-
.ErrorUnion => |error_union| error_union.payload,
1456+
.error_union => |error_union| error_union.payload,
14571457
else => Return,
14581458
};
14591459
const payload_prefix = switch (return_type_info) {
1460-
.ErrorUnion => "!",
1460+
.error_union => "!",
14611461
else => "",
14621462
};
14631463

@@ -1482,7 +1482,7 @@ pub fn setter(comptime T: type, comptime f_name: [:0]const u8, self: T, arg_ptrs
14821482
defer zgui.popId();
14831483

14841484
const ArgPtrs = @TypeOf(arg_ptrs);
1485-
const arg_ptrs_info = @typeInfo(ArgPtrs).Struct;
1485+
const arg_ptrs_info = @typeInfo(ArgPtrs).@"struct";
14861486

14871487
const f_type = fType(T, f_name);
14881488

@@ -1509,7 +1509,7 @@ pub fn deinitSetter(comptime T: type, comptime f_name: [:0]const u8, self: T, ar
15091509
defer zgui.popId();
15101510

15111511
const ArgPtrs = @TypeOf(arg_ptrs);
1512-
const arg_ptrs_info = @typeInfo(ArgPtrs).Struct;
1512+
const arg_ptrs_info = @typeInfo(ArgPtrs).@"struct";
15131513

15141514
const f_type = fType(T, f_name);
15151515

@@ -1537,7 +1537,7 @@ pub fn persistedSetter(comptime T: type, comptime f_name: [:0]const u8, self: T,
15371537
defer zgui.popId();
15381538

15391539
const ArgPtrs = @TypeOf(arg_ptrs);
1540-
const arg_ptrs_info = @typeInfo(ArgPtrs).Struct;
1540+
const arg_ptrs_info = @typeInfo(ArgPtrs).@"struct";
15411541

15421542
const f_type = fType(T, f_name);
15431543

@@ -1566,7 +1566,7 @@ pub fn allocPersistedSetter(allocator: std.mem.Allocator, comptime T: type, comp
15661566
defer zgui.popId();
15671567

15681568
const ArgPtrs = @TypeOf(arg_ptrs);
1569-
const arg_ptrs_info = @typeInfo(ArgPtrs).Struct;
1569+
const arg_ptrs_info = @typeInfo(ArgPtrs).@"struct";
15701570

15711571
const f_type = fType(T, f_name);
15721572

0 commit comments

Comments
 (0)