| ... | @@ -15,8 +15,8 @@ const BytesToHash = 1024 * MiB; | ... | @@ -15,8 +15,8 @@ const BytesToHash = 1024 * MiB; |
| 15 | | 15 | |
| 16 | pub fn main() !void { | 16 | pub fn main() !void { |
| 17 | var stdout_file = try std.io.getStdOut(); | 17 | var stdout_file = try std.io.getStdOut(); |
| 18 | var stdout_out_stream = std.io.FileOutStream.init(*stdout_file); | 18 | var stdout_out_stream = std.io.FileOutStream.init(&stdout_file); |
| 19 | const stdout = *stdout_out_stream.stream; | 19 | const stdout = &stdout_out_stream.stream; |
| 20 | | 20 | |
| 21 | var block: [HashFunction.block_size]u8 = undefined; | 21 | var block: [HashFunction.block_size]u8 = undefined; |
| 22 | std.mem.set(u8, block[0..], 0); | 22 | std.mem.set(u8, block[0..], 0); |
| ... | @@ -31,8 +31,8 @@ pub fn main() !void { | ... | @@ -31,8 +31,8 @@ pub fn main() !void { |
| 31 | } | 31 | } |
| 32 | const end = timer.read(); | 32 | const end = timer.read(); |
| 33 | | 33 | |
| 34 | const elapsed_s = f64(end - start) / time.ns_per_s; | 34 | const elapsed_s = @intToFloat(f64, end - start) / time.ns_per_s; |
| 35 | const throughput = u64(BytesToHash / elapsed_s); | 35 | const throughput = @floatToInt(u64, BytesToHash / elapsed_s); |
| 36 | | 36 | |
| 37 | try stdout.print("{}: {} MiB/s\n", @typeName(HashFunction), throughput / (1 * MiB)); | 37 | try stdout.print("{}: {} MiB/s\n", @typeName(HashFunction), throughput / (1 * MiB)); |
| 38 | } | 38 | } |