authorgravatar for mehdiboujid@gmail.comippsav <mehdiboujid@gmail.com> 2024-08-09 00:52:40+01:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2024-08-09 13:07:54-07:00
log291fb43f275b368f425380a3028068c7facafabb
tree5e6aa2b64e664a55d64a57dc5ab77a7016c562b5
parenteb17fe85a595c81da0304f4168c5dcf8181bd972

fix(fmt): remove additional trailing newline


1 files changed, 10 insertions(+), 5 deletions(-)

tools/generate_linux_syscalls.zig+10-5
...@@ -587,13 +587,13 @@ fn generateSyscallsFromTable(...@@ -587,13 +587,13 @@ fn generateSyscallsFromTable(
587 if (arch_info.extra_values) |extra_values| {587 if (arch_info.extra_values) |extra_values| {
588 try writer.writeAll(extra_values);588 try writer.writeAll(extra_values);
589 }589 }
590590 try writer.writeAll("};");
591 try writer.writeAll("};\n\n");
592591
593 if (arch_info.additional_enum) |additional_enum| {592 if (arch_info.additional_enum) |additional_enum| {
593 try writer.writeAll("\n\n");
594 try writer.print("pub const {s} = enum(usize) {{\n", .{additional_enum});594 try writer.print("pub const {s} = enum(usize) {{\n", .{additional_enum});
595 try writer.writeAll(optional_array_list.?.items);595 try writer.writeAll(optional_array_list.?.items);
596 try writer.writeAll("};\n\n");596 try writer.writeAll("};");
597 }597 }
598}598}
599599
...@@ -639,7 +639,7 @@ fn generateSyscallsFromPreprocessor(...@@ -639,7 +639,7 @@ fn generateSyscallsFromPreprocessor(
639 try writer.writeAll(extra_values);639 try writer.writeAll(extra_values);
640 }640 }
641641
642 try writer.writeAll("};\n\n");642 try writer.writeAll("};");
643}643}
644644
645pub fn main() !void {645pub fn main() !void {
...@@ -671,7 +671,7 @@ pub fn main() !void {...@@ -671,7 +671,7 @@ pub fn main() !void {
671 const buf = try allocator.alloc(u8, 1 << 15);671 const buf = try allocator.alloc(u8, 1 << 15);
672 defer allocator.free(buf);672 defer allocator.free(buf);
673673
674 inline for (arch_infos) |arch_info| {674 inline for (arch_infos, 0..) |arch_info, i| {
675 switch (arch_info) {675 switch (arch_info) {
676 .table => try generateSyscallsFromTable(676 .table => try generateSyscallsFromTable(
677 allocator,677 allocator,
...@@ -689,6 +689,11 @@ pub fn main() !void {...@@ -689,6 +689,11 @@ pub fn main() !void {
689 &arch_info,689 &arch_info,
690 ),690 ),
691 }691 }
692 if (i < arch_infos.len - 1) {
693 try writer.writeAll("\n\n");
694 } else {
695 try writer.writeAll("\n");
696 }
692 }697 }
693698
694 try buf_out.flush();699 try buf_out.flush();