aboutsummaryrefslogtreecommitdiff
path: root/lib/std/atomic/queue.zig
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2019-12-09 10:51:47 -0500
committerGitHub <noreply@github.com>2019-12-09 10:51:47 -0500
commit640e09183d3100c477a26c6cdc26f1eae31472a1 (patch)
tree0bddf7eb99d6daaaa2e5ee80b51a6766aefb7d9c /lib/std/atomic/queue.zig
parent5874cb04bd544ca155d1489bb0bdf9397fa3b41c (diff)
parent8b3c0bbeeef080b77d0cb7999682abc52de437e3 (diff)
downloadzig-640e09183d3100c477a26c6cdc26f1eae31472a1.tar.gz
zig-640e09183d3100c477a26c6cdc26f1eae31472a1.zip
Merge pull request #3873 from ziglang/format-no-var-args
std.fmt.format: tuple parameter instead of var args
Diffstat (limited to 'lib/std/atomic/queue.zig')
-rw-r--r--lib/std/atomic/queue.zig19
1 files changed, 9 insertions, 10 deletions
diff --git a/lib/std/atomic/queue.zig b/lib/std/atomic/queue.zig
index 53f1d99f13..63bacb4fb5 100644
--- a/lib/std/atomic/queue.zig
+++ b/lib/std/atomic/queue.zig
@@ -116,19 +116,19 @@ pub fn Queue(comptime T: type) type {
fn dumpRecursive(s: *std.io.OutStream(Error), optional_node: ?*Node, indent: usize) Error!void {
try s.writeByteNTimes(' ', indent);
if (optional_node) |node| {
- try s.print("0x{x}={}\n", @ptrToInt(node), node.data);
+ try s.print("0x{x}={}\n", .{ @ptrToInt(node), node.data });
try dumpRecursive(s, node.next, indent + 1);
} else {
- try s.print("(null)\n");
+ try s.print("(null)\n", .{});
}
}
};
const held = self.mutex.acquire();
defer held.release();
- try stream.print("head: ");
+ try stream.print("head: ", .{});
try S.dumpRecursive(stream, self.head, 0);
- try stream.print("tail: ");
+ try stream.print("tail: ", .{});
try S.dumpRecursive(stream, self.tail, 0);
}
};
@@ -207,16 +207,15 @@ test "std.atomic.Queue" {
}
if (context.put_sum != context.get_sum) {
- std.debug.panic("failure\nput_sum:{} != get_sum:{}", context.put_sum, context.get_sum);
+ std.debug.panic("failure\nput_sum:{} != get_sum:{}", .{ context.put_sum, context.get_sum });
}
if (context.get_count != puts_per_thread * put_thread_count) {
- std.debug.panic(
- "failure\nget_count:{} != puts_per_thread:{} * put_thread_count:{}",
+ std.debug.panic("failure\nget_count:{} != puts_per_thread:{} * put_thread_count:{}", .{
context.get_count,
@as(u32, puts_per_thread),
@as(u32, put_thread_count),
- );
+ });
}
}
@@ -351,7 +350,7 @@ test "std.atomic.Queue dump" {
\\tail: 0x{x}=1
\\ (null)
\\
- , @ptrToInt(queue.head), @ptrToInt(queue.tail));
+ , .{ @ptrToInt(queue.head), @ptrToInt(queue.tail) });
expect(mem.eql(u8, buffer[0..sos.pos], expected));
// Test a stream with two elements
@@ -372,6 +371,6 @@ test "std.atomic.Queue dump" {
\\tail: 0x{x}=2
\\ (null)
\\
- , @ptrToInt(queue.head), @ptrToInt(queue.head.?.next), @ptrToInt(queue.tail));
+ , .{ @ptrToInt(queue.head), @ptrToInt(queue.head.?.next), @ptrToInt(queue.tail) });
expect(mem.eql(u8, buffer[0..sos.pos], expected));
}