std: update std.builtin.Type fields to follow naming conventions
The compiler actually doesn't need any functional changes for this: Sema does reification based on the tag indices of `std.builtin.Type` already! So, no zig1.wasm update is necessary. This change is necessary to disallow name clashes between fields and decls on a type, which is a prerequisite of #9938.
This commit is contained in:
@@ -12,7 +12,7 @@ pub const min_buffer_size = 53;
|
||||
|
||||
/// Returns the minimum buffer size needed to print every float of a specific type and format.
|
||||
pub fn bufferSize(comptime mode: Format, comptime T: type) comptime_int {
|
||||
comptime std.debug.assert(@typeInfo(T) == .Float);
|
||||
comptime std.debug.assert(@typeInfo(T) == .float);
|
||||
return switch (mode) {
|
||||
.scientific => 53,
|
||||
// Based on minimum subnormal values.
|
||||
@@ -60,8 +60,8 @@ pub fn formatFloat(buf: []u8, v_: anytype, options: FormatOptions) FormatError![
|
||||
};
|
||||
|
||||
const T = @TypeOf(v);
|
||||
comptime std.debug.assert(@typeInfo(T) == .Float);
|
||||
const I = @Type(.{ .Int = .{ .signedness = .unsigned, .bits = @bitSizeOf(T) } });
|
||||
comptime std.debug.assert(@typeInfo(T) == .float);
|
||||
const I = @Type(.{ .int = .{ .signedness = .unsigned, .bits = @bitSizeOf(T) } });
|
||||
|
||||
const DT = if (@bitSizeOf(T) <= 64) u64 else u128;
|
||||
const tables = switch (DT) {
|
||||
@@ -563,13 +563,13 @@ fn pow5Factor(value_: anytype) u32 {
|
||||
|
||||
fn multipleOfPowerOf5(value: anytype, p: u32) bool {
|
||||
const T = @TypeOf(value);
|
||||
std.debug.assert(@typeInfo(T) == .Int);
|
||||
std.debug.assert(@typeInfo(T) == .int);
|
||||
return pow5Factor(value) >= p;
|
||||
}
|
||||
|
||||
fn multipleOfPowerOf2(value: anytype, p: u32) bool {
|
||||
const T = @TypeOf(value);
|
||||
std.debug.assert(@typeInfo(T) == .Int);
|
||||
std.debug.assert(@typeInfo(T) == .int);
|
||||
return (value & ((@as(T, 1) << @as(std.math.Log2Int(T), @intCast(p))) - 1)) == 0;
|
||||
}
|
||||
|
||||
@@ -1516,7 +1516,7 @@ const FLOAT128_POW5_INV_ERRORS: [154]u64 = .{
|
||||
const builtin = @import("builtin");
|
||||
|
||||
fn check(comptime T: type, value: T, comptime expected: []const u8) !void {
|
||||
const I = @Type(.{ .Int = .{ .signedness = .unsigned, .bits = @bitSizeOf(T) } });
|
||||
const I = @Type(.{ .int = .{ .signedness = .unsigned, .bits = @bitSizeOf(T) } });
|
||||
|
||||
var buf: [6000]u8 = undefined;
|
||||
const value_bits: I = @bitCast(value);
|
||||
|
||||
Reference in New Issue
Block a user