From 6380b9eb154076e6fca978245e4347d566e34c23 Mon Sep 17 00:00:00 2001 From: yuyi Date: Sat, 5 Mar 2022 23:19:20 +0800 Subject: [PATCH] cgen: minor cleanup of struct.v (#13661) --- vlib/v/gen/c/cgen.v | 4 ---- vlib/v/gen/c/struct.v | 6 ++---- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/vlib/v/gen/c/cgen.v b/vlib/v/gen/c/cgen.v index 544f81940f..bbe60bcf28 100644 --- a/vlib/v/gen/c/cgen.v +++ b/vlib/v/gen/c/cgen.v @@ -4359,10 +4359,6 @@ fn (mut g Gen) global_decl(node ast.GlobalDecl) { } } -fn (mut g Gen) go_back_out(n int) { - g.out.go_back(n) -} - fn (mut g Gen) assoc(node ast.Assoc) { g.writeln('// assoc') if node.typ == 0 { diff --git a/vlib/v/gen/c/struct.v b/vlib/v/gen/c/struct.v index e1e5844646..a2e85d416c 100644 --- a/vlib/v/gen/c/struct.v +++ b/vlib/v/gen/c/struct.v @@ -5,16 +5,14 @@ module c import v.ast -const ( - skip_struct_init = ['struct stat', 'struct addrinfo'] -) +const skip_struct_init = ['struct stat', 'struct addrinfo'] fn (mut g Gen) struct_init(node ast.StructInit) { styp := g.typ(node.typ) mut shared_styp := '' // only needed for shared x := St{... if styp in c.skip_struct_init { // needed for c++ compilers - g.go_back_out(3) + g.out.go_back(3) return } mut sym := g.table.final_sym(g.unwrap_generic(node.typ))