Skip to content

Commit 6380b9e

Browse files
authored
cgen: minor cleanup of struct.v (#13661)
1 parent 22fda7c commit 6380b9e

File tree

2 files changed

+2
-8
lines changed

2 files changed

+2
-8
lines changed

vlib/v/gen/c/cgen.v

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4359,10 +4359,6 @@ fn (mut g Gen) global_decl(node ast.GlobalDecl) {
43594359
}
43604360
}
43614361

4362-
fn (mut g Gen) go_back_out(n int) {
4363-
g.out.go_back(n)
4364-
}
4365-
43664362
fn (mut g Gen) assoc(node ast.Assoc) {
43674363
g.writeln('// assoc')
43684364
if node.typ == 0 {

vlib/v/gen/c/struct.v

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,14 @@ module c
55

66
import v.ast
77

8-
const (
9-
skip_struct_init = ['struct stat', 'struct addrinfo']
10-
)
8+
const skip_struct_init = ['struct stat', 'struct addrinfo']
119

1210
fn (mut g Gen) struct_init(node ast.StructInit) {
1311
styp := g.typ(node.typ)
1412
mut shared_styp := '' // only needed for shared x := St{...
1513
if styp in c.skip_struct_init {
1614
// needed for c++ compilers
17-
g.go_back_out(3)
15+
g.out.go_back(3)
1816
return
1917
}
2018
mut sym := g.table.final_sym(g.unwrap_generic(node.typ))

0 commit comments

Comments
 (0)