diff options
| author | Jacob Young <jacobly0@users.noreply.github.com> | 2024-03-28 20:41:58 -0400 |
|---|---|---|
| committer | Jacob Young <jacobly0@users.noreply.github.com> | 2024-03-30 20:50:48 -0400 |
| commit | 5a41704f7ec2c472897f955ecfe1feafa697ff68 (patch) | |
| tree | 62984e96e61c367ce7ad304fc532051c10e6921d /src/InternPool.zig | |
| parent | 6f10b11658c002b26341bff10e1dd522f2465b5a (diff) | |
| download | zig-5a41704f7ec2c472897f955ecfe1feafa697ff68.tar.gz zig-5a41704f7ec2c472897f955ecfe1feafa697ff68.zip | |
cbe: rewrite `CType`
Closes #14904
Diffstat (limited to 'src/InternPool.zig')
| -rw-r--r-- | src/InternPool.zig | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/src/InternPool.zig b/src/InternPool.zig index 63d29d3760..67368e1195 100644 --- a/src/InternPool.zig +++ b/src/InternPool.zig @@ -712,7 +712,7 @@ pub const Key = union(enum) { pub fn fieldName( self: AnonStructType, ip: *const InternPool, - index: u32, + index: usize, ) OptionalNullTerminatedString { if (self.names.len == 0) return .none; @@ -3879,20 +3879,13 @@ pub const Alignment = enum(u6) { none = std.math.maxInt(u6), _, - pub fn toByteUnitsOptional(a: Alignment) ?u64 { + pub fn toByteUnits(a: Alignment) ?u64 { return switch (a) { .none => null, else => @as(u64, 1) << @intFromEnum(a), }; } - pub fn toByteUnits(a: Alignment, default: u64) u64 { - return switch (a) { - .none => default, - else => @as(u64, 1) << @intFromEnum(a), - }; - } - pub fn fromByteUnits(n: u64) Alignment { if (n == 0) return .none; assert(std.math.isPowerOfTwo(n)); |
