Skip to content
This repository has been archived by the owner on Nov 21, 2023. It is now read-only.

Commit

Permalink
update for zig master
Browse files Browse the repository at this point in the history
  • Loading branch information
leecannon committed Aug 7, 2023
1 parent 95644d6 commit ba326b8
Show file tree
Hide file tree
Showing 18 changed files with 180 additions and 216 deletions.
22 changes: 10 additions & 12 deletions examples/file_system/simple_open_read.zig
Original file line number Diff line number Diff line change
Expand Up @@ -60,18 +60,16 @@ comptime {
fn refAllDeclsRecursive(comptime T: type) void {
if (!@import("builtin").is_test) return;
inline for (comptime std.meta.declarations(T)) |decl| {
if (decl.is_pub) {
if (@TypeOf(@field(T, decl.name)) == type) {
switch (@typeInfo(@field(T, decl.name))) {
.Struct, .Enum, .Union, .Opaque => {
refAllDeclsRecursive(@field(T, decl.name));
_ = @field(T, decl.name);
},
.Type, .Fn => {
_ = @field(T, decl.name);
},
else => {},
}
if (@TypeOf(@field(T, decl.name)) == type) {
switch (@typeInfo(@field(T, decl.name))) {
.Struct, .Enum, .Union, .Opaque => {
refAllDeclsRecursive(@field(T, decl.name));
_ = @field(T, decl.name);
},
.Type, .Fn => {
_ = @field(T, decl.name);
},
else => {},
}
}
}
Expand Down
22 changes: 10 additions & 12 deletions src/backend/Backend.zig
Original file line number Diff line number Diff line change
Expand Up @@ -370,18 +370,16 @@ comptime {
fn refAllDeclsRecursive(comptime T: type) void {
if (!@import("builtin").is_test) return;
inline for (comptime std.meta.declarations(T)) |decl| {
if (decl.is_pub) {
if (@TypeOf(@field(T, decl.name)) == type) {
switch (@typeInfo(@field(T, decl.name))) {
.Struct, .Enum, .Union, .Opaque => {
refAllDeclsRecursive(@field(T, decl.name));
_ = @field(T, decl.name);
},
.Type, .Fn => {
_ = @field(T, decl.name);
},
else => {},
}
if (@TypeOf(@field(T, decl.name)) == type) {
switch (@typeInfo(@field(T, decl.name))) {
.Struct, .Enum, .Union, .Opaque => {
refAllDeclsRecursive(@field(T, decl.name));
_ = @field(T, decl.name);
},
.Type, .Fn => {
_ = @field(T, decl.name);
},
else => {},
}
}
}
Expand Down
22 changes: 10 additions & 12 deletions src/backend/FileSystemBackend.zig
Original file line number Diff line number Diff line change
Expand Up @@ -728,18 +728,16 @@ comptime {
fn refAllDeclsRecursive(comptime T: type) void {
if (!@import("builtin").is_test) return;
inline for (comptime std.meta.declarations(T)) |decl| {
if (decl.is_pub) {
if (@TypeOf(@field(T, decl.name)) == type) {
switch (@typeInfo(@field(T, decl.name))) {
.Struct, .Enum, .Union, .Opaque => {
refAllDeclsRecursive(@field(T, decl.name));
_ = @field(T, decl.name);
},
.Type, .Fn => {
_ = @field(T, decl.name);
},
else => {},
}
if (@TypeOf(@field(T, decl.name)) == type) {
switch (@typeInfo(@field(T, decl.name))) {
.Struct, .Enum, .Union, .Opaque => {
refAllDeclsRecursive(@field(T, decl.name));
_ = @field(T, decl.name);
},
.Type, .Fn => {
_ = @field(T, decl.name);
},
else => {},
}
}
}
Expand Down
22 changes: 10 additions & 12 deletions src/backend/LinuxUserGroupBackend.zig
Original file line number Diff line number Diff line change
Expand Up @@ -35,18 +35,16 @@ comptime {
fn refAllDeclsRecursive(comptime T: type) void {
if (!@import("builtin").is_test) return;
inline for (comptime std.meta.declarations(T)) |decl| {
if (decl.is_pub) {
if (@TypeOf(@field(T, decl.name)) == type) {
switch (@typeInfo(@field(T, decl.name))) {
.Struct, .Enum, .Union, .Opaque => {
refAllDeclsRecursive(@field(T, decl.name));
_ = @field(T, decl.name);
},
.Type, .Fn => {
_ = @field(T, decl.name);
},
else => {},
}
if (@TypeOf(@field(T, decl.name)) == type) {
switch (@typeInfo(@field(T, decl.name))) {
.Struct, .Enum, .Union, .Opaque => {
refAllDeclsRecursive(@field(T, decl.name));
_ = @field(T, decl.name);
},
.Type, .Fn => {
_ = @field(T, decl.name);
},
else => {},
}
}
}
Expand Down
22 changes: 10 additions & 12 deletions src/backend/TimeBackend.zig
Original file line number Diff line number Diff line change
Expand Up @@ -40,18 +40,16 @@ comptime {
fn refAllDeclsRecursive(comptime T: type) void {
if (!@import("builtin").is_test) return;
inline for (comptime std.meta.declarations(T)) |decl| {
if (decl.is_pub) {
if (@TypeOf(@field(T, decl.name)) == type) {
switch (@typeInfo(@field(T, decl.name))) {
.Struct, .Enum, .Union, .Opaque => {
refAllDeclsRecursive(@field(T, decl.name));
_ = @field(T, decl.name);
},
.Type, .Fn => {
_ = @field(T, decl.name);
},
else => {},
}
if (@TypeOf(@field(T, decl.name)) == type) {
switch (@typeInfo(@field(T, decl.name))) {
.Struct, .Enum, .Union, .Opaque => {
refAllDeclsRecursive(@field(T, decl.name));
_ = @field(T, decl.name);
},
.Type, .Fn => {
_ = @field(T, decl.name);
},
else => {},
}
}
}
Expand Down
22 changes: 10 additions & 12 deletions src/backend/UnameBackend.zig
Original file line number Diff line number Diff line change
Expand Up @@ -60,18 +60,16 @@ comptime {
fn refAllDeclsRecursive(comptime T: type) void {
if (!@import("builtin").is_test) return;
inline for (comptime std.meta.declarations(T)) |decl| {
if (decl.is_pub) {
if (@TypeOf(@field(T, decl.name)) == type) {
switch (@typeInfo(@field(T, decl.name))) {
.Struct, .Enum, .Union, .Opaque => {
refAllDeclsRecursive(@field(T, decl.name));
_ = @field(T, decl.name);
},
.Type, .Fn => {
_ = @field(T, decl.name);
},
else => {},
}
if (@TypeOf(@field(T, decl.name)) == type) {
switch (@typeInfo(@field(T, decl.name))) {
.Struct, .Enum, .Union, .Opaque => {
refAllDeclsRecursive(@field(T, decl.name));
_ = @field(T, decl.name);
},
.Type, .Fn => {
_ = @field(T, decl.name);
},
else => {},
}
}
}
Expand Down
22 changes: 10 additions & 12 deletions src/backend/host_backend.zig
Original file line number Diff line number Diff line change
Expand Up @@ -160,18 +160,16 @@ comptime {
fn refAllDeclsRecursive(comptime T: type) void {
if (!@import("builtin").is_test) return;
inline for (comptime std.meta.declarations(T)) |decl| {
if (decl.is_pub) {
if (@TypeOf(@field(T, decl.name)) == type) {
switch (@typeInfo(@field(T, decl.name))) {
.Struct, .Enum, .Union, .Opaque => {
refAllDeclsRecursive(@field(T, decl.name));
_ = @field(T, decl.name);
},
.Type, .Fn => {
_ = @field(T, decl.name);
},
else => {},
}
if (@TypeOf(@field(T, decl.name)) == type) {
switch (@typeInfo(@field(T, decl.name))) {
.Struct, .Enum, .Union, .Opaque => {
refAllDeclsRecursive(@field(T, decl.name));
_ = @field(T, decl.name);
},
.Type, .Fn => {
_ = @field(T, decl.name);
},
else => {},
}
}
}
Expand Down
22 changes: 10 additions & 12 deletions src/config/Config.zig
Original file line number Diff line number Diff line change
Expand Up @@ -48,18 +48,16 @@ comptime {
fn refAllDeclsRecursive(comptime T: type) void {
if (!@import("builtin").is_test) return;
inline for (comptime std.meta.declarations(T)) |decl| {
if (decl.is_pub) {
if (@TypeOf(@field(T, decl.name)) == type) {
switch (@typeInfo(@field(T, decl.name))) {
.Struct, .Enum, .Union, .Opaque => {
refAllDeclsRecursive(@field(T, decl.name));
_ = @field(T, decl.name);
},
.Type, .Fn => {
_ = @field(T, decl.name);
},
else => {},
}
if (@TypeOf(@field(T, decl.name)) == type) {
switch (@typeInfo(@field(T, decl.name))) {
.Struct, .Enum, .Union, .Opaque => {
refAllDeclsRecursive(@field(T, decl.name));
_ = @field(T, decl.name);
},
.Type, .Fn => {
_ = @field(T, decl.name);
},
else => {},
}
}
}
Expand Down
22 changes: 10 additions & 12 deletions src/config/FileSystemDescription.zig
Original file line number Diff line number Diff line change
Expand Up @@ -171,18 +171,16 @@ comptime {
fn refAllDeclsRecursive(comptime T: type) void {
if (!@import("builtin").is_test) return;
inline for (comptime std.meta.declarations(T)) |decl| {
if (decl.is_pub) {
if (@TypeOf(@field(T, decl.name)) == type) {
switch (@typeInfo(@field(T, decl.name))) {
.Struct, .Enum, .Union, .Opaque => {
refAllDeclsRecursive(@field(T, decl.name));
_ = @field(T, decl.name);
},
.Type, .Fn => {
_ = @field(T, decl.name);
},
else => {},
}
if (@TypeOf(@field(T, decl.name)) == type) {
switch (@typeInfo(@field(T, decl.name))) {
.Struct, .Enum, .Union, .Opaque => {
refAllDeclsRecursive(@field(T, decl.name));
_ = @field(T, decl.name);
},
.Type, .Fn => {
_ = @field(T, decl.name);
},
else => {},
}
}
}
Expand Down
22 changes: 10 additions & 12 deletions src/config/LinuxUserGroupDescription.zig
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,16 @@ comptime {
fn refAllDeclsRecursive(comptime T: type) void {
if (!@import("builtin").is_test) return;
inline for (comptime std.meta.declarations(T)) |decl| {
if (decl.is_pub) {
if (@TypeOf(@field(T, decl.name)) == type) {
switch (@typeInfo(@field(T, decl.name))) {
.Struct, .Enum, .Union, .Opaque => {
refAllDeclsRecursive(@field(T, decl.name));
_ = @field(T, decl.name);
},
.Type, .Fn => {
_ = @field(T, decl.name);
},
else => {},
}
if (@TypeOf(@field(T, decl.name)) == type) {
switch (@typeInfo(@field(T, decl.name))) {
.Struct, .Enum, .Union, .Opaque => {
refAllDeclsRecursive(@field(T, decl.name));
_ = @field(T, decl.name);
},
.Type, .Fn => {
_ = @field(T, decl.name);
},
else => {},
}
}
}
Expand Down
22 changes: 10 additions & 12 deletions src/config/TimeDescription.zig
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,16 @@ comptime {
fn refAllDeclsRecursive(comptime T: type) void {
if (!@import("builtin").is_test) return;
inline for (comptime std.meta.declarations(T)) |decl| {
if (decl.is_pub) {
if (@TypeOf(@field(T, decl.name)) == type) {
switch (@typeInfo(@field(T, decl.name))) {
.Struct, .Enum, .Union, .Opaque => {
refAllDeclsRecursive(@field(T, decl.name));
_ = @field(T, decl.name);
},
.Type, .Fn => {
_ = @field(T, decl.name);
},
else => {},
}
if (@TypeOf(@field(T, decl.name)) == type) {
switch (@typeInfo(@field(T, decl.name))) {
.Struct, .Enum, .Union, .Opaque => {
refAllDeclsRecursive(@field(T, decl.name));
_ = @field(T, decl.name);
},
.Type, .Fn => {
_ = @field(T, decl.name);
},
else => {},
}
}
}
Expand Down
22 changes: 10 additions & 12 deletions src/config/UnameDescription.zig
Original file line number Diff line number Diff line change
Expand Up @@ -30,18 +30,16 @@ comptime {
fn refAllDeclsRecursive(comptime T: type) void {
if (!@import("builtin").is_test) return;
inline for (comptime std.meta.declarations(T)) |decl| {
if (decl.is_pub) {
if (@TypeOf(@field(T, decl.name)) == type) {
switch (@typeInfo(@field(T, decl.name))) {
.Struct, .Enum, .Union, .Opaque => {
refAllDeclsRecursive(@field(T, decl.name));
_ = @field(T, decl.name);
},
.Type, .Fn => {
_ = @field(T, decl.name);
},
else => {},
}
if (@TypeOf(@field(T, decl.name)) == type) {
switch (@typeInfo(@field(T, decl.name))) {
.Struct, .Enum, .Union, .Opaque => {
refAllDeclsRecursive(@field(T, decl.name));
_ = @field(T, decl.name);
},
.Type, .Fn => {
_ = @field(T, decl.name);
},
else => {},
}
}
}
Expand Down
22 changes: 10 additions & 12 deletions src/interface/Dir.zig
Original file line number Diff line number Diff line change
Expand Up @@ -47,18 +47,16 @@ comptime {
fn refAllDeclsRecursive(comptime T: type) void {
if (!@import("builtin").is_test) return;
inline for (comptime std.meta.declarations(T)) |decl| {
if (decl.is_pub) {
if (@TypeOf(@field(T, decl.name)) == type) {
switch (@typeInfo(@field(T, decl.name))) {
.Struct, .Enum, .Union, .Opaque => {
refAllDeclsRecursive(@field(T, decl.name));
_ = @field(T, decl.name);
},
.Type, .Fn => {
_ = @field(T, decl.name);
},
else => {},
}
if (@TypeOf(@field(T, decl.name)) == type) {
switch (@typeInfo(@field(T, decl.name))) {
.Struct, .Enum, .Union, .Opaque => {
refAllDeclsRecursive(@field(T, decl.name));
_ = @field(T, decl.name);
},
.Type, .Fn => {
_ = @field(T, decl.name);
},
else => {},
}
}
}
Expand Down
Loading

0 comments on commit ba326b8

Please sign in to comment.