cgen: minor cleanup of struct.v

pull/13661/head
yuyi98 2022-03-05 20:57:00 +08:00
parent 22fda7c3dd
commit b06c96fb60
2 changed files with 2 additions and 8 deletions

View File

@ -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 {

View File

@ -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))