aboutsummaryrefslogtreecommitdiff
path: root/lib/std/meta/trailer_flags.zig
diff options
context:
space:
mode:
authorr00ster91 <r00ster91@proton.me>2022-12-13 22:30:06 +0100
committerr00ster91 <r00ster91@proton.me>2022-12-17 14:11:33 +0100
commitaac2d6b56f32134ea32fb3d984e3fcdfddd8aaf6 (patch)
tree941528727d4d0a5b92f58c0b862f0d5f372b89e0 /lib/std/meta/trailer_flags.zig
parent7350ea3e2da4d4e6ef5092cd9f0832beef0291d5 (diff)
downloadzig-aac2d6b56f32134ea32fb3d984e3fcdfddd8aaf6.tar.gz
zig-aac2d6b56f32134ea32fb3d984e3fcdfddd8aaf6.zip
std.builtin: rename Type.UnionField and Type.StructField's field_type to type
Diffstat (limited to 'lib/std/meta/trailer_flags.zig')
-rw-r--r--lib/std/meta/trailer_flags.zig20
1 files changed, 10 insertions, 10 deletions
diff --git a/lib/std/meta/trailer_flags.zig b/lib/std/meta/trailer_flags.zig
index 34fb17eb0a..e50950018d 100644
--- a/lib/std/meta/trailer_flags.zig
+++ b/lib/std/meta/trailer_flags.zig
@@ -24,10 +24,10 @@ pub fn TrailerFlags(comptime Fields: type) type {
inline for (@typeInfo(Fields).Struct.fields) |struct_field, i| {
fields[i] = Type.StructField{
.name = struct_field.name,
- .field_type = ?struct_field.field_type,
- .default_value = &@as(?struct_field.field_type, null),
+ .type = ?struct_field.type,
+ .default_value = &@as(?struct_field.type, null),
.is_comptime = false,
- .alignment = @alignOf(?struct_field.field_type),
+ .alignment = @alignOf(?struct_field.type),
};
}
break :blk @Type(.{
@@ -105,26 +105,26 @@ pub fn TrailerFlags(comptime Fields: type) type {
const active = (self.bits & (1 << i)) != 0;
if (i == @enumToInt(field)) {
assert(active);
- return mem.alignForwardGeneric(usize, off, @alignOf(field_info.field_type));
+ return mem.alignForwardGeneric(usize, off, @alignOf(field_info.type));
} else if (active) {
- off = mem.alignForwardGeneric(usize, off, @alignOf(field_info.field_type));
- off += @sizeOf(field_info.field_type);
+ off = mem.alignForwardGeneric(usize, off, @alignOf(field_info.type));
+ off += @sizeOf(field_info.type);
}
}
}
pub fn Field(comptime field: FieldEnum) type {
- return @typeInfo(Fields).Struct.fields[@enumToInt(field)].field_type;
+ return @typeInfo(Fields).Struct.fields[@enumToInt(field)].type;
}
pub fn sizeInBytes(self: Self) usize {
var off: usize = 0;
inline for (@typeInfo(Fields).Struct.fields) |field, i| {
- if (@sizeOf(field.field_type) == 0)
+ if (@sizeOf(field.type) == 0)
continue;
if ((self.bits & (1 << i)) != 0) {
- off = mem.alignForwardGeneric(usize, off, @alignOf(field.field_type));
- off += @sizeOf(field.field_type);
+ off = mem.alignForwardGeneric(usize, off, @alignOf(field.type));
+ off += @sizeOf(field.type);
}
}
return off;