std.Target: Rename c_type_* functions to camel case

From https://ziglang.org/documentation/master/#Names:

> If `x` is otherwise callable, then `x` should be `camelCase`.
This commit is contained in:
Linus Groh
2024-08-11 13:03:19 +01:00
parent fd434fcd38
commit 4ef956ef14
11 changed files with 109 additions and 109 deletions

View File

@@ -8,7 +8,7 @@
const std = @import("std");
fn c_name(ty: std.Target.CType) []const u8 {
fn cName(ty: std.Target.CType) []const u8 {
return switch (ty) {
.char => "char",
.short => "short",
@@ -46,16 +46,16 @@ pub fn main() !void {
inline for (@typeInfo(std.Target.CType).Enum.fields) |field| {
const c_type: std.Target.CType = @enumFromInt(field.value);
try stdout.print("_Static_assert(sizeof({0s}) == {1d}, \"sizeof({0s}) == {1d}\");\n", .{
c_name(c_type),
target.c_type_byte_size(c_type),
cName(c_type),
target.cTypeByteSize(c_type),
});
try stdout.print("_Static_assert(_Alignof({0s}) == {1d}, \"_Alignof({0s}) == {1d}\");\n", .{
c_name(c_type),
target.c_type_alignment(c_type),
cName(c_type),
target.cTypeAlignment(c_type),
});
try stdout.print("_Static_assert(__alignof({0s}) == {1d}, \"__alignof({0s}) == {1d}\");\n\n", .{
c_name(c_type),
target.c_type_preferred_alignment(c_type),
cName(c_type),
target.cTypePreferredAlignment(c_type),
});
}
}