From b184ae5ca5d3d3c0a4b9de564a6e30555e596e65 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Sat, 26 May 2018 18:16:39 -0400 Subject: run zig fmt on some of the codebase See #1003 --- example/guess_number/main.zig | 2 +- example/hello_world/hello_libc.zig | 3 +-- example/mix_o_files/build.zig | 4 +--- example/shared_library/build.zig | 4 +--- 4 files changed, 4 insertions(+), 9 deletions(-) (limited to 'example') diff --git a/example/guess_number/main.zig b/example/guess_number/main.zig index 7178c5274a..bed132b25c 100644 --- a/example/guess_number/main.zig +++ b/example/guess_number/main.zig @@ -23,7 +23,7 @@ pub fn main() !void { while (true) { try stdout.print("\nGuess a number between 1 and 100: "); - var line_buf : [20]u8 = undefined; + var line_buf: [20]u8 = undefined; const line_len = io.readLine(line_buf[0..]) catch |err| switch (err) { error.InputTooLong => { diff --git a/example/hello_world/hello_libc.zig b/example/hello_world/hello_libc.zig index 4a35e47b15..1df8f04ce4 100644 --- a/example/hello_world/hello_libc.zig +++ b/example/hello_world/hello_libc.zig @@ -8,8 +8,7 @@ const c = @cImport({ const msg = c"Hello, world!\n"; export fn main(argc: c_int, argv: &&u8) c_int { - if (c.printf(msg) != c_int(c.strlen(msg))) - return -1; + if (c.printf(msg) != c_int(c.strlen(msg))) return -1; return 0; } diff --git a/example/mix_o_files/build.zig b/example/mix_o_files/build.zig index 4380486867..e5d2e6a446 100644 --- a/example/mix_o_files/build.zig +++ b/example/mix_o_files/build.zig @@ -4,9 +4,7 @@ pub fn build(b: &Builder) void { const obj = b.addObject("base64", "base64.zig"); const exe = b.addCExecutable("test"); - exe.addCompileFlags([][]const u8 { - "-std=c99", - }); + exe.addCompileFlags([][]const u8{"-std=c99"}); exe.addSourceFile("test.c"); exe.addObject(obj); diff --git a/example/shared_library/build.zig b/example/shared_library/build.zig index 2b5a178b35..30c714c6c6 100644 --- a/example/shared_library/build.zig +++ b/example/shared_library/build.zig @@ -4,9 +4,7 @@ pub fn build(b: &Builder) void { const lib = b.addSharedLibrary("mathtest", "mathtest.zig", b.version(1, 0, 0)); const exe = b.addCExecutable("test"); - exe.addCompileFlags([][]const u8 { - "-std=c99", - }); + exe.addCompileFlags([][]const u8{"-std=c99"}); exe.addSourceFile("test.c"); exe.linkLibrary(lib); -- cgit v1.2.3