| author | |
| committer | |
| log | 0059d9ee3e7298df03723d97adbea72ff142cacd |
| tree | d88f0722a4cf79afdf374189098bbf753f17cee2 |
| parent | 4023ed56d4fd7b627aed73428b5fa4be4b7c05ad |
21 files changed, 56 insertions(+), 56 deletions(-)
lib/std/atomic/queue.zig+2-2| ... | ... | @@ -348,7 +348,7 @@ test "std.atomic.Queue dump" { |
| 348 | 348 | fbs.reset(); |
| 349 | 349 | try queue.dumpToStream(fbs.outStream()); |
| 350 | 350 | |
| 351 | var expected = try std.fmt.bufPrint(expected_buffer[0..], | |
| 351 | var expected = try std.fmtstream.bufPrint(expected_buffer[0..], | |
| 352 | 352 | \\head: 0x{x}=1 |
| 353 | 353 | \\ (null) |
| 354 | 354 | \\tail: 0x{x}=1 |
| ... | ... | @@ -368,7 +368,7 @@ test "std.atomic.Queue dump" { |
| 368 | 368 | fbs.reset(); |
| 369 | 369 | try queue.dumpToStream(fbs.outStream()); |
| 370 | 370 | |
| 371 | expected = try std.fmt.bufPrint(expected_buffer[0..], | |
| 371 | expected = try std.fmtstream.bufPrint(expected_buffer[0..], | |
| 372 | 372 | \\head: 0x{x}=1 |
| 373 | 373 | \\ 0x{x}=2 |
| 374 | 374 | \\ (null) |
lib/std/net.zig+1-1| ... | ... | @@ -438,7 +438,7 @@ pub fn getAddressList(allocator: *mem.Allocator, name: []const u8, port: u16) !* |
| 438 | 438 | const name_c = try std.cstr.addNullByte(allocator, name); |
| 439 | 439 | defer allocator.free(name_c); |
| 440 | 440 | |
| 441 | const port_c = try std.fmt.allocPrint(allocator, "{}\x00", .{port}); | |
| 441 | const port_c = try std.fmtstream.allocPrint(allocator, "{}\x00", .{port}); | |
| 442 | 442 | defer allocator.free(port_c); |
| 443 | 443 | |
| 444 | 444 | const hints = os.addrinfo{ |
lib/std/os.zig+1-1| ... | ... | @@ -3049,7 +3049,7 @@ pub fn realpathC(pathname: [*:0]const u8, out_buffer: *[MAX_PATH_BYTES]u8) RealP |
| 3049 | 3049 | defer close(fd); |
| 3050 | 3050 | |
| 3051 | 3051 | var procfs_buf: ["/proc/self/fd/-2147483648".len:0]u8 = undefined; |
| 3052 | const proc_path = std.fmt.bufPrint(procfs_buf[0..], "/proc/self/fd/{}\x00", .{fd}) catch unreachable; | |
| 3052 | const proc_path = std.fmtstream.bufPrint(procfs_buf[0..], "/proc/self/fd/{}\x00", .{fd}) catch unreachable; | |
| 3053 | 3053 | |
| 3054 | 3054 | return readlinkC(@ptrCast([*:0]const u8, proc_path.ptr), out_buffer); |
| 3055 | 3055 | } |
lib/std/progress.zig+3-3| ... | ... | @@ -130,11 +130,11 @@ pub const Progress = struct { |
| 130 | 130 | var end: usize = 0; |
| 131 | 131 | if (self.columns_written > 0) { |
| 132 | 132 | // restore cursor position |
| 133 | end += (std.fmt.bufPrint(self.output_buffer[end..], "\x1b[{}D", .{self.columns_written}) catch unreachable).len; | |
| 133 | end += (std.fmtstream.bufPrint(self.output_buffer[end..], "\x1b[{}D", .{self.columns_written}) catch unreachable).len; | |
| 134 | 134 | self.columns_written = 0; |
| 135 | 135 | |
| 136 | 136 | // clear rest of line |
| 137 | end += (std.fmt.bufPrint(self.output_buffer[end..], "\x1b[0K", .{}) catch unreachable).len; | |
| 137 | end += (std.fmtstream.bufPrint(self.output_buffer[end..], "\x1b[0K", .{}) catch unreachable).len; | |
| 138 | 138 | } |
| 139 | 139 | |
| 140 | 140 | if (!self.done) { |
| ... | ... | @@ -185,7 +185,7 @@ pub const Progress = struct { |
| 185 | 185 | } |
| 186 | 186 | |
| 187 | 187 | fn bufWrite(self: *Progress, end: *usize, comptime format: []const u8, args: var) void { |
| 188 | if (std.fmt.bufPrint(self.output_buffer[end.*..], format, args)) |written| { | |
| 188 | if (std.fmtstream.bufPrint(self.output_buffer[end.*..], format, args)) |written| { | |
| 189 | 189 | const amt = written.len; |
| 190 | 190 | end.* += amt; |
| 191 | 191 | self.columns_written += amt; |
lib/std/special/build_runner.zig+3-3| ... | ... | @@ -2,7 +2,7 @@ const root = @import("@build"); |
| 2 | 2 | const std = @import("std"); |
| 3 | 3 | const builtin = @import("builtin"); |
| 4 | 4 | const io = std.io; |
| 5 | const fmt = std.fmt; | |
| 5 | const fmtstream = std.fmtstream; | |
| 6 | 6 | const Builder = std.build.Builder; |
| 7 | 7 | const mem = std.mem; |
| 8 | 8 | const process = std.process; |
| ... | ... | @@ -153,7 +153,7 @@ fn usage(builder: *Builder, already_ran_build: bool, out_stream: var) !void { |
| 153 | 153 | const allocator = builder.allocator; |
| 154 | 154 | for (builder.top_level_steps.toSliceConst()) |top_level_step| { |
| 155 | 155 | const name = if (&top_level_step.step == builder.default_step) |
| 156 | try fmt.allocPrint(allocator, "{} (default)", .{top_level_step.step.name}) | |
| 156 | try fmtstream.allocPrint(allocator, "{} (default)", .{top_level_step.step.name}) | |
| 157 | 157 | else |
| 158 | 158 | top_level_step.step.name; |
| 159 | 159 | try out_stream.print(" {s:22} {}\n", .{ name, top_level_step.description }); |
| ... | ... | @@ -175,7 +175,7 @@ fn usage(builder: *Builder, already_ran_build: bool, out_stream: var) !void { |
| 175 | 175 | try out_stream.print(" (none)\n", .{}); |
| 176 | 176 | } else { |
| 177 | 177 | for (builder.available_options_list.toSliceConst()) |option| { |
| 178 | const name = try fmt.allocPrint(allocator, " -D{}=[{}]", .{ | |
| 178 | const name = try fmtstream.allocPrint(allocator, " -D{}=[{}]", .{ | |
| 179 | 179 | option.name, |
| 180 | 180 | Builder.typeIdName(option.type_id), |
| 181 | 181 | }); |
lib/std/target.zig+2-2| ... | ... | @@ -972,7 +972,7 @@ pub const Target = struct { |
| 972 | 972 | } |
| 973 | 973 | |
| 974 | 974 | pub fn linuxTripleSimple(allocator: *mem.Allocator, cpu_arch: Cpu.Arch, os_tag: Os.Tag, abi: Abi) ![:0]u8 { |
| 975 | return std.fmt.allocPrint0(allocator, "{}-{}-{}", .{ @tagName(cpu_arch), @tagName(os_tag), @tagName(abi) }); | |
| 975 | return std.fmtstream.allocPrint0(allocator, "{}-{}-{}", .{ @tagName(cpu_arch), @tagName(os_tag), @tagName(abi) }); | |
| 976 | 976 | } |
| 977 | 977 | |
| 978 | 978 | pub fn linuxTriple(self: Target, allocator: *mem.Allocator) ![:0]u8 { |
| ... | ... | @@ -1158,7 +1158,7 @@ pub const Target = struct { |
| 1158 | 1158 | var result: DynamicLinker = .{}; |
| 1159 | 1159 | const S = struct { |
| 1160 | 1160 | fn print(r: *DynamicLinker, comptime fmt: []const u8, args: var) DynamicLinker { |
| 1161 | r.max_byte = @intCast(u8, (std.fmt.bufPrint(&r.buffer, fmt, args) catch unreachable).len - 1); | |
| 1161 | r.max_byte = @intCast(u8, (std.fmtstream.bufPrint(&r.buffer, fmt, args) catch unreachable).len - 1); | |
| 1162 | 1162 | return r.*; |
| 1163 | 1163 | } |
| 1164 | 1164 | fn copy(r: *DynamicLinker, s: []const u8) DynamicLinker { |
lib/std/zig/cross_target.zig+1-1| ... | ... | @@ -573,7 +573,7 @@ pub const CrossTarget = struct { |
| 573 | 573 | .Dynamic => "", |
| 574 | 574 | }; |
| 575 | 575 | |
| 576 | return std.fmt.allocPrint0(allocator, "{}-{}{}", .{ arch, os, static_suffix }); | |
| 576 | return std.fmtstream.allocPrint0(allocator, "{}-{}{}", .{ arch, os, static_suffix }); | |
| 577 | 577 | } |
| 578 | 578 | |
| 579 | 579 | pub const Executor = union(enum) { |
lib/std/zig/system.zig+3-3| ... | ... | @@ -130,7 +130,7 @@ pub const NativePaths = struct { |
| 130 | 130 | } |
| 131 | 131 | |
| 132 | 132 | pub fn addIncludeDirFmt(self: *NativePaths, comptime fmt: []const u8, args: var) !void { |
| 133 | const item = try std.fmt.allocPrint0(self.include_dirs.allocator, fmt, args); | |
| 133 | const item = try std.fmtstream.allocPrint0(self.include_dirs.allocator, fmt, args); | |
| 134 | 134 | errdefer self.include_dirs.allocator.free(item); |
| 135 | 135 | try self.include_dirs.append(item); |
| 136 | 136 | } |
| ... | ... | @@ -140,7 +140,7 @@ pub const NativePaths = struct { |
| 140 | 140 | } |
| 141 | 141 | |
| 142 | 142 | pub fn addLibDirFmt(self: *NativePaths, comptime fmt: []const u8, args: var) !void { |
| 143 | const item = try std.fmt.allocPrint0(self.lib_dirs.allocator, fmt, args); | |
| 143 | const item = try std.fmtstream.allocPrint0(self.lib_dirs.allocator, fmt, args); | |
| 144 | 144 | errdefer self.lib_dirs.allocator.free(item); |
| 145 | 145 | try self.lib_dirs.append(item); |
| 146 | 146 | } |
| ... | ... | @@ -150,7 +150,7 @@ pub const NativePaths = struct { |
| 150 | 150 | } |
| 151 | 151 | |
| 152 | 152 | pub fn addWarningFmt(self: *NativePaths, comptime fmt: []const u8, args: var) !void { |
| 153 | const item = try std.fmt.allocPrint0(self.warnings.allocator, fmt, args); | |
| 153 | const item = try std.fmtstream.allocPrint0(self.warnings.allocator, fmt, args); | |
| 154 | 154 | errdefer self.warnings.allocator.free(item); |
| 155 | 155 | try self.warnings.append(item); |
| 156 | 156 | } |
src-self-hosted/compilation.zig+3-3| ... | ... | @@ -1051,7 +1051,7 @@ pub const Compilation = struct { |
| 1051 | 1051 | } |
| 1052 | 1052 | |
| 1053 | 1053 | fn addCompileError(self: *Compilation, tree_scope: *Scope.AstTree, span: Span, comptime fmt: []const u8, args: var) !void { |
| 1054 | const text = try std.fmt.allocPrint(self.gpa(), fmt, args); | |
| 1054 | const text = try std.fmtstream.allocPrint(self.gpa(), fmt, args); | |
| 1055 | 1055 | errdefer self.gpa().free(text); |
| 1056 | 1056 | |
| 1057 | 1057 | const msg = try Msg.createFromScope(self, tree_scope, span, text); |
| ... | ... | @@ -1061,7 +1061,7 @@ pub const Compilation = struct { |
| 1061 | 1061 | } |
| 1062 | 1062 | |
| 1063 | 1063 | fn addCompileErrorCli(self: *Compilation, realpath: []const u8, comptime fmt: []const u8, args: var) !void { |
| 1064 | const text = try std.fmt.allocPrint(self.gpa(), fmt, args); | |
| 1064 | const text = try std.fmtstream.allocPrint(self.gpa(), fmt, args); | |
| 1065 | 1065 | errdefer self.gpa().free(text); |
| 1066 | 1066 | |
| 1067 | 1067 | const msg = try Msg.createFromCli(self, realpath, text); |
| ... | ... | @@ -1154,7 +1154,7 @@ pub const Compilation = struct { |
| 1154 | 1154 | const tmp_dir = try self.getTmpDir(); |
| 1155 | 1155 | const file_prefix = self.getRandomFileName(); |
| 1156 | 1156 | |
| 1157 | const file_name = try std.fmt.allocPrint(self.gpa(), "{}{}", .{ file_prefix[0..], suffix }); | |
| 1157 | const file_name = try std.fmtstream.allocPrint(self.gpa(), "{}{}", .{ file_prefix[0..], suffix }); | |
| 1158 | 1158 | defer self.gpa().free(file_name); |
| 1159 | 1159 | |
| 1160 | 1160 | const full_path = try fs.path.join(self.gpa(), &[_][]const u8{ tmp_dir, file_name[0..] }); |
src-self-hosted/dep_tokenizer.zig+1-1| ... | ... | @@ -894,7 +894,7 @@ fn printSection(out: var, label: []const u8, bytes: []const u8) !void { |
| 894 | 894 | |
| 895 | 895 | fn printLabel(out: var, label: []const u8, bytes: []const u8) !void { |
| 896 | 896 | var buf: [80]u8 = undefined; |
| 897 | var text = try std.fmt.bufPrint(buf[0..], "{} {} bytes ", .{ label, bytes.len }); | |
| 897 | var text = try std.fmtstream.bufPrint(buf[0..], "{} {} bytes ", .{ label, bytes.len }); | |
| 898 | 898 | try out.write(text); |
| 899 | 899 | var i: usize = text.len; |
| 900 | 900 | const end = 79; |
src-self-hosted/libc_installation.zig+1-1| ... | ... | @@ -543,7 +543,7 @@ fn ccPrintFileName(args: CCPrintFileNameOptions) ![:0]u8 { |
| 543 | 543 | const allocator = args.allocator; |
| 544 | 544 | |
| 545 | 545 | const cc_exe = std.os.getenvZ("CC") orelse default_cc_exe; |
| 546 | const arg1 = try std.fmt.allocPrint(allocator, "-print-file-name={}", .{args.search_basename}); | |
| 546 | const arg1 = try std.fmtstream.allocPrint(allocator, "-print-file-name={}", .{args.search_basename}); | |
| 547 | 547 | defer allocator.free(arg1); |
| 548 | 548 | const argv = [_][]const u8{ cc_exe, arg1 }; |
| 549 | 549 |
src-self-hosted/link.zig+10-10| ... | ... | @@ -296,13 +296,13 @@ fn constructLinkerArgsCoff(ctx: *Context) !void { |
| 296 | 296 | |
| 297 | 297 | const is_library = ctx.comp.kind == .Lib; |
| 298 | 298 | |
| 299 | const out_arg = try std.fmt.allocPrint(&ctx.arena.allocator, "-OUT:{}\x00", .{ctx.out_file_path.toSliceConst()}); | |
| 299 | const out_arg = try std.fmtstream.allocPrint(&ctx.arena.allocator, "-OUT:{}\x00", .{ctx.out_file_path.toSliceConst()}); | |
| 300 | 300 | try ctx.args.append(@ptrCast([*:0]const u8, out_arg.ptr)); |
| 301 | 301 | |
| 302 | 302 | if (ctx.comp.haveLibC()) { |
| 303 | try ctx.args.append(@ptrCast([*:0]const u8, (try std.fmt.allocPrint(&ctx.arena.allocator, "-LIBPATH:{}\x00", .{ctx.libc.msvc_lib_dir.?})).ptr)); | |
| 304 | try ctx.args.append(@ptrCast([*:0]const u8, (try std.fmt.allocPrint(&ctx.arena.allocator, "-LIBPATH:{}\x00", .{ctx.libc.kernel32_lib_dir.?})).ptr)); | |
| 305 | try ctx.args.append(@ptrCast([*:0]const u8, (try std.fmt.allocPrint(&ctx.arena.allocator, "-LIBPATH:{}\x00", .{ctx.libc.lib_dir.?})).ptr)); | |
| 303 | try ctx.args.append(@ptrCast([*:0]const u8, (try std.fmtstream.allocPrint(&ctx.arena.allocator, "-LIBPATH:{}\x00", .{ctx.libc.msvc_lib_dir.?})).ptr)); | |
| 304 | try ctx.args.append(@ptrCast([*:0]const u8, (try std.fmtstream.allocPrint(&ctx.arena.allocator, "-LIBPATH:{}\x00", .{ctx.libc.kernel32_lib_dir.?})).ptr)); | |
| 305 | try ctx.args.append(@ptrCast([*:0]const u8, (try std.fmtstream.allocPrint(&ctx.arena.allocator, "-LIBPATH:{}\x00", .{ctx.libc.lib_dir.?})).ptr)); | |
| 306 | 306 | } |
| 307 | 307 | |
| 308 | 308 | if (ctx.link_in_crt) { |
| ... | ... | @@ -310,20 +310,20 @@ fn constructLinkerArgsCoff(ctx: *Context) !void { |
| 310 | 310 | const d_str = if (ctx.comp.build_mode == .Debug) "d" else ""; |
| 311 | 311 | |
| 312 | 312 | if (ctx.comp.is_static) { |
| 313 | const cmt_lib_name = try std.fmt.allocPrint(&ctx.arena.allocator, "libcmt{}.lib\x00", .{d_str}); | |
| 313 | const cmt_lib_name = try std.fmtstream.allocPrint(&ctx.arena.allocator, "libcmt{}.lib\x00", .{d_str}); | |
| 314 | 314 | try ctx.args.append(@ptrCast([*:0]const u8, cmt_lib_name.ptr)); |
| 315 | 315 | } else { |
| 316 | const msvcrt_lib_name = try std.fmt.allocPrint(&ctx.arena.allocator, "msvcrt{}.lib\x00", .{d_str}); | |
| 316 | const msvcrt_lib_name = try std.fmtstream.allocPrint(&ctx.arena.allocator, "msvcrt{}.lib\x00", .{d_str}); | |
| 317 | 317 | try ctx.args.append(@ptrCast([*:0]const u8, msvcrt_lib_name.ptr)); |
| 318 | 318 | } |
| 319 | 319 | |
| 320 | const vcruntime_lib_name = try std.fmt.allocPrint(&ctx.arena.allocator, "{}vcruntime{}.lib\x00", .{ | |
| 320 | const vcruntime_lib_name = try std.fmtstream.allocPrint(&ctx.arena.allocator, "{}vcruntime{}.lib\x00", .{ | |
| 321 | 321 | lib_str, |
| 322 | 322 | d_str, |
| 323 | 323 | }); |
| 324 | 324 | try ctx.args.append(@ptrCast([*:0]const u8, vcruntime_lib_name.ptr)); |
| 325 | 325 | |
| 326 | const crt_lib_name = try std.fmt.allocPrint(&ctx.arena.allocator, "{}ucrt{}.lib\x00", .{ lib_str, d_str }); | |
| 326 | const crt_lib_name = try std.fmtstream.allocPrint(&ctx.arena.allocator, "{}ucrt{}.lib\x00", .{ lib_str, d_str }); | |
| 327 | 327 | try ctx.args.append(@ptrCast([*:0]const u8, crt_lib_name.ptr)); |
| 328 | 328 | |
| 329 | 329 | // Visual C++ 2015 Conformance Changes |
| ... | ... | @@ -383,7 +383,7 @@ fn constructLinkerArgsMachO(ctx: *Context) !void { |
| 383 | 383 | .IPhoneOS => try ctx.args.append("-iphoneos_version_min"), |
| 384 | 384 | .IPhoneOSSimulator => try ctx.args.append("-ios_simulator_version_min"), |
| 385 | 385 | } |
| 386 | const ver_str = try std.fmt.allocPrint(&ctx.arena.allocator, "{}.{}.{}\x00", .{ | |
| 386 | const ver_str = try std.fmtstream.allocPrint(&ctx.arena.allocator, "{}.{}.{}\x00", .{ | |
| 387 | 387 | platform.major, |
| 388 | 388 | platform.minor, |
| 389 | 389 | platform.micro, |
| ... | ... | @@ -445,7 +445,7 @@ fn constructLinkerArgsMachO(ctx: *Context) !void { |
| 445 | 445 | try ctx.args.append("-lSystem"); |
| 446 | 446 | } else { |
| 447 | 447 | if (mem.indexOfScalar(u8, lib.name, '/') == null) { |
| 448 | const arg = try std.fmt.allocPrint(&ctx.arena.allocator, "-l{}\x00", .{lib.name}); | |
| 448 | const arg = try std.fmtstream.allocPrint(&ctx.arena.allocator, "-l{}\x00", .{lib.name}); | |
| 449 | 449 | try ctx.args.append(@ptrCast([*:0]const u8, arg.ptr)); |
| 450 | 450 | } else { |
| 451 | 451 | const arg = try std.cstr.addNullByte(&ctx.arena.allocator, lib.name); |
src-self-hosted/print_targets.zig+1-1| ... | ... | @@ -138,7 +138,7 @@ pub fn cmdTargets( |
| 138 | 138 | for (available_glibcs) |glibc| { |
| 139 | 139 | try jws.arrayElem(); |
| 140 | 140 | |
| 141 | const tmp = try std.fmt.allocPrint(allocator, "{}", .{glibc}); | |
| 141 | const tmp = try std.fmtstream.allocPrint(allocator, "{}", .{glibc}); | |
| 142 | 142 | defer allocator.free(tmp); |
| 143 | 143 | try jws.emitString(tmp); |
| 144 | 144 | } |
src-self-hosted/test.zig+3-3| ... | ... | @@ -81,7 +81,7 @@ pub const TestContext = struct { |
| 81 | 81 | msg: []const u8, |
| 82 | 82 | ) !void { |
| 83 | 83 | var file_index_buf: [20]u8 = undefined; |
| 84 | const file_index = try std.fmt.bufPrint(file_index_buf[0..], "{}", .{self.file_index.incr()}); | |
| 84 | const file_index = try std.fmtstream.bufPrint(file_index_buf[0..], "{}", .{self.file_index.incr()}); | |
| 85 | 85 | const file1_path = try std.fs.path.join(allocator, [_][]const u8{ tmp_dir_name, file_index, file1 }); |
| 86 | 86 | |
| 87 | 87 | if (std.fs.path.dirname(file1_path)) |dirname| { |
| ... | ... | @@ -114,10 +114,10 @@ pub const TestContext = struct { |
| 114 | 114 | expected_output: []const u8, |
| 115 | 115 | ) !void { |
| 116 | 116 | var file_index_buf: [20]u8 = undefined; |
| 117 | const file_index = try std.fmt.bufPrint(file_index_buf[0..], "{}", .{self.file_index.incr()}); | |
| 117 | const file_index = try std.fmtstream.bufPrint(file_index_buf[0..], "{}", .{self.file_index.incr()}); | |
| 118 | 118 | const file1_path = try std.fs.path.join(allocator, [_][]const u8{ tmp_dir_name, file_index, file1 }); |
| 119 | 119 | |
| 120 | const output_file = try std.fmt.allocPrint(allocator, "{}-out{}", .{ file1_path, (Target{ .Native = {} }).exeFileExt() }); | |
| 120 | const output_file = try std.fmtstream.allocPrint(allocator, "{}-out{}", .{ file1_path, (Target{ .Native = {} }).exeFileExt() }); | |
| 121 | 121 | if (std.fs.path.dirname(file1_path)) |dirname| { |
| 122 | 122 | try std.fs.cwd().makePath(dirname); |
| 123 | 123 | } |
src-self-hosted/type.zig+4-4| ... | ... | @@ -581,7 +581,7 @@ pub const Type = struct { |
| 581 | 581 | errdefer comp.gpa().destroy(self); |
| 582 | 582 | |
| 583 | 583 | const u_or_i = "ui"[@boolToInt(key.is_signed)]; |
| 584 | const name = try std.fmt.allocPrint(comp.gpa(), "{c}{}", .{ u_or_i, key.bit_count }); | |
| 584 | const name = try std.fmtstream.allocPrint(comp.gpa(), "{c}{}", .{ u_or_i, key.bit_count }); | |
| 585 | 585 | errdefer comp.gpa().free(name); |
| 586 | 586 | |
| 587 | 587 | self.base.init(comp, .Int, name); |
| ... | ... | @@ -764,13 +764,13 @@ pub const Type = struct { |
| 764 | 764 | .Non => "", |
| 765 | 765 | }; |
| 766 | 766 | const name = switch (self.key.alignment) { |
| 767 | .Abi => try std.fmt.allocPrint(comp.gpa(), "{}{}{}{}", .{ | |
| 767 | .Abi => try std.fmtstream.allocPrint(comp.gpa(), "{}{}{}{}", .{ | |
| 768 | 768 | size_str, |
| 769 | 769 | mut_str, |
| 770 | 770 | vol_str, |
| 771 | 771 | self.key.child_type.name, |
| 772 | 772 | }), |
| 773 | .Override => |alignment| try std.fmt.allocPrint(comp.gpa(), "{}align<{}> {}{}{}", .{ | |
| 773 | .Override => |alignment| try std.fmtstream.allocPrint(comp.gpa(), "{}align<{}> {}{}{}", .{ | |
| 774 | 774 | size_str, |
| 775 | 775 | alignment, |
| 776 | 776 | mut_str, |
| ... | ... | @@ -845,7 +845,7 @@ pub const Type = struct { |
| 845 | 845 | }; |
| 846 | 846 | errdefer comp.gpa().destroy(self); |
| 847 | 847 | |
| 848 | const name = try std.fmt.allocPrint(comp.gpa(), "[{}]{}", .{ key.len, key.elem_type.name }); | |
| 848 | const name = try std.fmtstream.allocPrint(comp.gpa(), "[{}]{}", .{ key.len, key.elem_type.name }); | |
| 849 | 849 | errdefer comp.gpa().free(name); |
| 850 | 850 | |
| 851 | 851 | self.base.init(comp, .Array, name); |
test/src/compare_output.zig+4-4| ... | ... | @@ -4,7 +4,7 @@ const std = @import("std"); |
| 4 | 4 | const builtin = std.builtin; |
| 5 | 5 | const build = std.build; |
| 6 | 6 | const ArrayList = std.ArrayList; |
| 7 | const fmt = std.fmt; | |
| 7 | const fmtstream = std.fmtstream; | |
| 8 | 8 | const mem = std.mem; |
| 9 | 9 | const fs = std.fs; |
| 10 | 10 | const warn = std.debug.warn; |
| ... | ... | @@ -97,7 +97,7 @@ pub const CompareOutputContext = struct { |
| 97 | 97 | |
| 98 | 98 | switch (case.special) { |
| 99 | 99 | Special.Asm => { |
| 100 | const annotated_case_name = fmt.allocPrint(self.b.allocator, "assemble-and-link {}", .{ | |
| 100 | const annotated_case_name = fmtstream.allocPrint(self.b.allocator, "assemble-and-link {}", .{ | |
| 101 | 101 | case.name, |
| 102 | 102 | }) catch unreachable; |
| 103 | 103 | if (self.test_filter) |filter| { |
| ... | ... | @@ -116,7 +116,7 @@ pub const CompareOutputContext = struct { |
| 116 | 116 | }, |
| 117 | 117 | Special.None => { |
| 118 | 118 | for (self.modes) |mode| { |
| 119 | const annotated_case_name = fmt.allocPrint(self.b.allocator, "{} {} ({})", .{ | |
| 119 | const annotated_case_name = fmtstream.allocPrint(self.b.allocator, "{} {} ({})", .{ | |
| 120 | 120 | "compare-output", |
| 121 | 121 | case.name, |
| 122 | 122 | @tagName(mode), |
| ... | ... | @@ -141,7 +141,7 @@ pub const CompareOutputContext = struct { |
| 141 | 141 | } |
| 142 | 142 | }, |
| 143 | 143 | Special.RuntimeSafety => { |
| 144 | const annotated_case_name = fmt.allocPrint(self.b.allocator, "safety {}", .{case.name}) catch unreachable; | |
| 144 | const annotated_case_name = fmtstream.allocPrint(self.b.allocator, "safety {}", .{case.name}) catch unreachable; | |
| 145 | 145 | if (self.test_filter) |filter| { |
| 146 | 146 | if (mem.indexOf(u8, annotated_case_name, filter) == null) return; |
| 147 | 147 | } |
test/src/run_translated_c.zig+2-2| ... | ... | @@ -3,7 +3,7 @@ |
| 3 | 3 | const std = @import("std"); |
| 4 | 4 | const build = std.build; |
| 5 | 5 | const ArrayList = std.ArrayList; |
| 6 | const fmt = std.fmt; | |
| 6 | const fmtstream = std.fmtstream; | |
| 7 | 7 | const mem = std.mem; |
| 8 | 8 | const fs = std.fs; |
| 9 | 9 | const warn = std.debug.warn; |
| ... | ... | @@ -76,7 +76,7 @@ pub const RunTranslatedCContext = struct { |
| 76 | 76 | pub fn addCase(self: *RunTranslatedCContext, case: *const TestCase) void { |
| 77 | 77 | const b = self.b; |
| 78 | 78 | |
| 79 | const annotated_case_name = fmt.allocPrint(self.b.allocator, "run-translated-c {}", .{case.name}) catch unreachable; | |
| 79 | const annotated_case_name = fmtstream.allocPrint(self.b.allocator, "run-translated-c {}", .{case.name}) catch unreachable; | |
| 80 | 80 | if (self.test_filter) |filter| { |
| 81 | 81 | if (mem.indexOf(u8, annotated_case_name, filter) == null) return; |
| 82 | 82 | } |
test/src/translate_c.zig+2-2| ... | ... | @@ -3,7 +3,7 @@ |
| 3 | 3 | const std = @import("std"); |
| 4 | 4 | const build = std.build; |
| 5 | 5 | const ArrayList = std.ArrayList; |
| 6 | const fmt = std.fmt; | |
| 6 | const fmtstream = std.fmtstream; | |
| 7 | 7 | const mem = std.mem; |
| 8 | 8 | const fs = std.fs; |
| 9 | 9 | const warn = std.debug.warn; |
| ... | ... | @@ -99,7 +99,7 @@ pub const TranslateCContext = struct { |
| 99 | 99 | const b = self.b; |
| 100 | 100 | |
| 101 | 101 | const translate_c_cmd = "translate-c"; |
| 102 | const annotated_case_name = fmt.allocPrint(self.b.allocator, "{} {}", .{ translate_c_cmd, case.name }) catch unreachable; | |
| 102 | const annotated_case_name = fmtstream.allocPrint(self.b.allocator, "{} {}", .{ translate_c_cmd, case.name }) catch unreachable; | |
| 103 | 103 | if (self.test_filter) |filter| { |
| 104 | 104 | if (mem.indexOf(u8, annotated_case_name, filter) == null) return; |
| 105 | 105 | } |
test/tests.zig+5-5| ... | ... | @@ -8,7 +8,7 @@ const Buffer = std.Buffer; |
| 8 | 8 | const io = std.io; |
| 9 | 9 | const fs = std.fs; |
| 10 | 10 | const mem = std.mem; |
| 11 | const fmt = std.fmt; | |
| 11 | const fmtstream = std.fmtstream; | |
| 12 | 12 | const ArrayList = std.ArrayList; |
| 13 | 13 | const Mode = builtin.Mode; |
| 14 | 14 | const LibExeObjStep = build.LibExeObjStep; |
| ... | ... | @@ -484,7 +484,7 @@ pub const StackTracesContext = struct { |
| 484 | 484 | const expect_for_mode = expect[@enumToInt(mode)]; |
| 485 | 485 | if (expect_for_mode.len == 0) continue; |
| 486 | 486 | |
| 487 | const annotated_case_name = fmt.allocPrint(self.b.allocator, "{} {} ({})", .{ | |
| 487 | const annotated_case_name = fmtstream.allocPrint(self.b.allocator, "{} {} ({})", .{ | |
| 488 | 488 | "stack-trace", |
| 489 | 489 | name, |
| 490 | 490 | @tagName(mode), |
| ... | ... | @@ -943,7 +943,7 @@ pub const CompileErrorContext = struct { |
| 943 | 943 | pub fn addCase(self: *CompileErrorContext, case: *const TestCase) void { |
| 944 | 944 | const b = self.b; |
| 945 | 945 | |
| 946 | const annotated_case_name = fmt.allocPrint(self.b.allocator, "compile-error {}", .{ | |
| 946 | const annotated_case_name = fmtstream.allocPrint(self.b.allocator, "compile-error {}", .{ | |
| 947 | 947 | case.name, |
| 948 | 948 | }) catch unreachable; |
| 949 | 949 | if (self.test_filter) |filter| { |
| ... | ... | @@ -1009,7 +1009,7 @@ pub const StandaloneContext = struct { |
| 1009 | 1009 | const b = self.b; |
| 1010 | 1010 | |
| 1011 | 1011 | for (self.modes) |mode| { |
| 1012 | const annotated_case_name = fmt.allocPrint(self.b.allocator, "build {} ({})", .{ | |
| 1012 | const annotated_case_name = fmtstream.allocPrint(self.b.allocator, "build {} ({})", .{ | |
| 1013 | 1013 | root_src, |
| 1014 | 1014 | @tagName(mode), |
| 1015 | 1015 | }) catch unreachable; |
| ... | ... | @@ -1152,7 +1152,7 @@ pub const GenHContext = struct { |
| 1152 | 1152 | const b = self.b; |
| 1153 | 1153 | |
| 1154 | 1154 | const mode = builtin.Mode.Debug; |
| 1155 | const annotated_case_name = fmt.allocPrint(self.b.allocator, "gen-h {} ({})", .{ case.name, @tagName(mode) }) catch unreachable; | |
| 1155 | const annotated_case_name = fmtstream.allocPrint(self.b.allocator, "gen-h {} ({})", .{ case.name, @tagName(mode) }) catch unreachable; | |
| 1156 | 1156 | if (self.test_filter) |filter| { |
| 1157 | 1157 | if (mem.indexOf(u8, annotated_case_name, filter) == null) return; |
| 1158 | 1158 | } |
tools/process_headers.zig+2-2| ... | ... | @@ -299,7 +299,7 @@ pub fn main() !void { |
| 299 | 299 | std.debug.warn("unrecognized C ABI: {}\n", .{abi_name}); |
| 300 | 300 | usageAndExit(args[0]); |
| 301 | 301 | }; |
| 302 | const generic_name = try std.fmt.allocPrint(allocator, "generic-{}", .{abi_name}); | |
| 302 | const generic_name = try std.fmtstream.allocPrint(allocator, "generic-{}", .{abi_name}); | |
| 303 | 303 | |
| 304 | 304 | // TODO compiler crashed when I wrote this the canonical way |
| 305 | 305 | var libc_targets: []const LibCTarget = undefined; |
| ... | ... | @@ -440,7 +440,7 @@ pub fn main() !void { |
| 440 | 440 | .specific => |a| @tagName(a), |
| 441 | 441 | else => @tagName(dest_target.arch), |
| 442 | 442 | }; |
| 443 | const out_subpath = try std.fmt.allocPrint(allocator, "{}-{}-{}", .{ | |
| 443 | const out_subpath = try std.fmtstream.allocPrint(allocator, "{}-{}-{}", .{ | |
| 444 | 444 | arch_name, |
| 445 | 445 | @tagName(dest_target.os), |
| 446 | 446 | @tagName(dest_target.abi), |
tools/update_glibc.zig+2-2| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | 1 | const std = @import("std"); |
| 2 | 2 | const fs = std.fs; |
| 3 | const fmt = std.fmt; | |
| 3 | const fmtstream = std.fmtstream; | |
| 4 | 4 | const assert = std.debug.assert; |
| 5 | 5 | |
| 6 | 6 | // Example abilist path: |
| ... | ... | @@ -154,7 +154,7 @@ pub fn main() !void { |
| 154 | 154 | const fn_set = &target_funcs_gop.kv.value.list; |
| 155 | 155 | |
| 156 | 156 | for (lib_names) |lib_name, lib_name_index| { |
| 157 | const basename = try fmt.allocPrint(allocator, "lib{}.abilist", .{lib_name}); | |
| 157 | const basename = try fmtstream.allocPrint(allocator, "lib{}.abilist", .{lib_name}); | |
| 158 | 158 | const abi_list_filename = blk: { |
| 159 | 159 | if (abi_list.targets[0].abi == .gnuabi64 and std.mem.eql(u8, lib_name, "c")) { |
| 160 | 160 | break :blk try fs.path.join(allocator, &[_][]const u8{ prefix, abi_list.path, "n64", basename }); |