gen: fix C warnings by cleaning up skip_struct_init (#6416)
* gen: removes struct name from list which shouldn't be initialized
* gen: vfmt
* cgen: remove the skip_struct_init list
* Revert "cgen: remove the skip_struct_init list"
This reverts commit d9e1fdbb4c.
* fix ci
* vfmt vlib/v/gen/cgen.v
Co-authored-by: Delyan Angelov <delian66@gmail.com>
			
			
				pull/6423/head
			
			
		
							parent
							
								
									46dc6cc24b
								
							
						
					
					
						commit
						1b9711edde
					
				| 
						 | 
					@ -3446,15 +3446,14 @@ fn (mut g Gen) go_back_out(n int) {
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const (
 | 
					const (
 | 
				
			||||||
	skip_struct_init = ['strconv__ftoa__Uf32', 'strconv__ftoa__Uf64', 'strconv__Float64u', 'struct stat',
 | 
						skip_struct_init = ['struct stat', 'struct addrinfo']
 | 
				
			||||||
		'struct addrinfo',
 | 
					 | 
				
			||||||
	]
 | 
					 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
fn (mut g Gen) struct_init(struct_init ast.StructInit) {
 | 
					fn (mut g Gen) struct_init(struct_init ast.StructInit) {
 | 
				
			||||||
	styp := g.typ(struct_init.typ)
 | 
						styp := g.typ(struct_init.typ)
 | 
				
			||||||
	mut shared_styp := '' // only needed for shared &St{...
 | 
						mut shared_styp := '' // only needed for shared &St{...
 | 
				
			||||||
	if styp in skip_struct_init {
 | 
						if styp in skip_struct_init {
 | 
				
			||||||
 | 
							// needed for c++ compilers
 | 
				
			||||||
		g.go_back_out(3)
 | 
							g.go_back_out(3)
 | 
				
			||||||
		return
 | 
							return
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue