mirror of
https://github.com/ziglang/zig.git
synced 2025-12-24 07:03:11 +00:00
update update_glibc to format strings with "{s}"
This commit is contained in:
parent
102d954220
commit
70a7c14ca6
@ -157,7 +157,7 @@ pub fn main() !void {
|
|||||||
|
|
||||||
for (lib_names) |lib_name, lib_name_index| {
|
for (lib_names) |lib_name, lib_name_index| {
|
||||||
const lib_prefix = if (std.mem.eql(u8, lib_name, "ld")) "" else "lib";
|
const lib_prefix = if (std.mem.eql(u8, lib_name, "ld")) "" else "lib";
|
||||||
const basename = try fmt.allocPrint(allocator, "{}{}.abilist", .{ lib_prefix, lib_name });
|
const basename = try fmt.allocPrint(allocator, "{s}{s}.abilist", .{ lib_prefix, lib_name });
|
||||||
const abi_list_filename = blk: {
|
const abi_list_filename = blk: {
|
||||||
const is_c = std.mem.eql(u8, lib_name, "c");
|
const is_c = std.mem.eql(u8, lib_name, "c");
|
||||||
const is_m = std.mem.eql(u8, lib_name, "m");
|
const is_m = std.mem.eql(u8, lib_name, "m");
|
||||||
@ -185,7 +185,7 @@ pub fn main() !void {
|
|||||||
};
|
};
|
||||||
const max_bytes = 10 * 1024 * 1024;
|
const max_bytes = 10 * 1024 * 1024;
|
||||||
const contents = std.fs.cwd().readFileAlloc(allocator, abi_list_filename, max_bytes) catch |err| {
|
const contents = std.fs.cwd().readFileAlloc(allocator, abi_list_filename, max_bytes) catch |err| {
|
||||||
std.debug.warn("unable to open {}: {}\n", .{ abi_list_filename, err });
|
std.debug.warn("unable to open {s}: {s}\n", .{ abi_list_filename, err });
|
||||||
std.process.exit(1);
|
std.process.exit(1);
|
||||||
};
|
};
|
||||||
var lines_it = std.mem.tokenize(contents, "\n");
|
var lines_it = std.mem.tokenize(contents, "\n");
|
||||||
@ -243,7 +243,7 @@ pub fn main() !void {
|
|||||||
const vers_txt = buffered.writer();
|
const vers_txt = buffered.writer();
|
||||||
for (global_ver_list) |name, i| {
|
for (global_ver_list) |name, i| {
|
||||||
_ = global_ver_set.put(name, i) catch unreachable;
|
_ = global_ver_set.put(name, i) catch unreachable;
|
||||||
try vers_txt.print("{}\n", .{name});
|
try vers_txt.print("{s}\n", .{name});
|
||||||
}
|
}
|
||||||
try buffered.flush();
|
try buffered.flush();
|
||||||
}
|
}
|
||||||
@ -256,7 +256,7 @@ pub fn main() !void {
|
|||||||
for (global_fn_list) |name, i| {
|
for (global_fn_list) |name, i| {
|
||||||
const entry = global_fn_set.getEntry(name).?;
|
const entry = global_fn_set.getEntry(name).?;
|
||||||
entry.value.index = i;
|
entry.value.index = i;
|
||||||
try fns_txt.print("{} {}\n", .{ name, entry.value.lib });
|
try fns_txt.print("{s} {s}\n", .{ name, entry.value.lib });
|
||||||
}
|
}
|
||||||
try buffered.flush();
|
try buffered.flush();
|
||||||
}
|
}
|
||||||
@ -290,7 +290,7 @@ pub fn main() !void {
|
|||||||
const fn_vers_list = &target_functions.getEntry(@ptrToInt(abi_list)).?.value.fn_vers_list;
|
const fn_vers_list = &target_functions.getEntry(@ptrToInt(abi_list)).?.value.fn_vers_list;
|
||||||
for (abi_list.targets) |target, it_i| {
|
for (abi_list.targets) |target, it_i| {
|
||||||
if (it_i != 0) try abilist_txt.writeByte(' ');
|
if (it_i != 0) try abilist_txt.writeByte(' ');
|
||||||
try abilist_txt.print("{}-linux-{}", .{ @tagName(target.arch), @tagName(target.abi) });
|
try abilist_txt.print("{s}-linux-{s}", .{ @tagName(target.arch), @tagName(target.abi) });
|
||||||
}
|
}
|
||||||
try abilist_txt.writeByte('\n');
|
try abilist_txt.writeByte('\n');
|
||||||
// next, each line implicitly corresponds to a function
|
// next, each line implicitly corresponds to a function
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user