Run `zig fmt`

master
LemonBoy 2020-02-01 11:32:53 +01:00
parent 8309ee8752
commit 3640c682a2
8 changed files with 15 additions and 21 deletions

View File

@ -1428,4 +1428,3 @@ const Parser = struct {
});
}
};

View File

@ -631,7 +631,7 @@ pub const Tokenizer = struct {
},
.BackSlashCr => switch (c) {
'\n' => {
state = .Start;
state = .Start;
},
else => {
result.id = .Invalid;

View File

@ -250,13 +250,13 @@ pub fn main() !void {
if (H.has_iterative_api) {
prng.seed(seed);
const result = try benchmarkHash(H, count);
try stdout.print(" iterative: {:4} MiB/s [{x:0<16}]\n", .{result.throughput / (1 * MiB), result.hash});
try stdout.print(" iterative: {:4} MiB/s [{x:0<16}]\n", .{ result.throughput / (1 * MiB), result.hash });
}
if (!test_iterative_only) {
prng.seed(seed);
const result_small = try benchmarkHashSmallKeys(H, key_size, count);
try stdout.print(" small keys: {:4} MiB/s [{x:0<16}]\n", .{result_small.throughput / (1 * MiB), result_small.hash});
try stdout.print(" small keys: {:4} MiB/s [{x:0<16}]\n", .{ result_small.throughput / (1 * MiB), result_small.hash });
}
}
}

View File

@ -40,7 +40,8 @@ pub const Guid = extern struct {
self.time_mid,
self.time_high_and_version,
self.clock_seq_high_and_reserved,
self.clock_seq_low, self.node,
self.clock_seq_low,
self.node,
});
} else {
@compileError("Unknown format character: '" ++ f ++ "'");

View File

@ -928,10 +928,7 @@ pub usingnamespace switch (builtin.arch) {
SegSs: DWORD,
ExtendedRegisters: [512]BYTE,
pub fn getRegs(ctx: *const CONTEXT) struct {
bp: usize,
ip: usize,
} {
pub fn getRegs(ctx: *const CONTEXT) struct { bp: usize, ip: usize } {
return .{ .bp = ctx.Ebp, .ip = ctx.Eip };
}
};
@ -1034,10 +1031,7 @@ pub usingnamespace switch (builtin.arch) {
LastExceptionToRip: DWORD64,
LastExceptionFromRip: DWORD64,
pub fn getRegs(ctx: *const CONTEXT) struct {
bp: usize,
ip: usize,
} {
pub fn getRegs(ctx: *const CONTEXT) struct { bp: usize, ip: usize } {
return .{ .bp = ctx.Rbp, .ip = ctx.Rip };
}
};
@ -1105,11 +1099,11 @@ pub usingnamespace switch (builtin.arch) {
Wcr: [2]DWORD,
Wvr: [2]DWORD64,
pub fn getRegs(ctx: *const CONTEXT) struct {
bp: usize,
ip: usize,
} {
return .{ .bp = ctx.DUMMYUNIONNAME.DUMMYSTRUCTNAME.Fp, .ip = ctx.Pc };
pub fn getRegs(ctx: *const CONTEXT) struct { bp: usize, ip: usize } {
return .{
.bp = ctx.DUMMYUNIONNAME.DUMMYSTRUCTNAME.Fp,
.ip = ctx.Pc,
};
}
};

View File

@ -25,7 +25,7 @@ pub fn main() !void {
var stdout_file = std.io.getStdOut();
const stdout = &stdout_file.outStream().stream;
try stdout.print("{:.3} MiB/s, {} KiB used \n", .{mb_per_sec, memory_used / 1024});
try stdout.print("{:.3} MiB/s, {} KiB used \n", .{ mb_per_sec, memory_used / 1024 });
}
fn testOnce() usize {

View File

@ -894,7 +894,7 @@ fn printSection(out: var, label: []const u8, bytes: []const u8) !void {
fn printLabel(out: var, label: []const u8, bytes: []const u8) !void {
var buf: [80]u8 = undefined;
var text = try std.fmt.bufPrint(buf[0..], "{} {} bytes ", .{label, bytes.len});
var text = try std.fmt.bufPrint(buf[0..], "{} {} bytes ", .{ label, bytes.len });
try out.write(text);
var i: usize = text.len;
const end = 79;

View File

@ -105,7 +105,7 @@ extern fn ZigLLDLink(
context: *c_void,
) bool;
extern fn linkDiagCallback(context: *c_void, ptr: [*]const u8, len: usize) void {
fn linkDiagCallback(context: *c_void, ptr: [*]const u8, len: usize) callconv(.C) void {
const ctx = @ptrCast(*Context, @alignCast(@alignOf(Context), context));
ctx.link_err = linkDiagCallbackErrorable(ctx, ptr[0..len]);
}