From a2834d48b9480286549fd9882d67e874396eec79 Mon Sep 17 00:00:00 2001 From: wilsonk Date: Mon, 9 Jul 2018 15:21:20 -0600 Subject: [PATCH] Update throughput_test.zig. (#1211) --- std/crypto/throughput_test.zig | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/std/crypto/throughput_test.zig b/std/crypto/throughput_test.zig index 0ad6845d1a..c21838e607 100644 --- a/std/crypto/throughput_test.zig +++ b/std/crypto/throughput_test.zig @@ -15,8 +15,8 @@ const BytesToHash = 1024 * MiB; pub fn main() !void { var stdout_file = try std.io.getStdOut(); - var stdout_out_stream = std.io.FileOutStream.init(*stdout_file); - const stdout = *stdout_out_stream.stream; + var stdout_out_stream = std.io.FileOutStream.init(&stdout_file); + const stdout = &stdout_out_stream.stream; var block: [HashFunction.block_size]u8 = undefined; std.mem.set(u8, block[0..], 0); @@ -31,8 +31,8 @@ pub fn main() !void { } const end = timer.read(); - const elapsed_s = f64(end - start) / time.ns_per_s; - const throughput = u64(BytesToHash / elapsed_s); + const elapsed_s = @intToFloat(f64, end - start) / time.ns_per_s; + const throughput = @floatToInt(u64, BytesToHash / elapsed_s); try stdout.print("{}: {} MiB/s\n", @typeName(HashFunction), throughput / (1 * MiB)); }