Skip to content

Commit

Permalink
fix missing param name
Browse files Browse the repository at this point in the history
  • Loading branch information
felipensp committed Jan 14, 2024
1 parent 5ff52bd commit d32168e
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/c2v.v
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@ fn (mut c C2V) fn_decl(mut node Node, gen_types string) {
}
if node.ast_type.qualified.contains('...)') {
// TODO handle this better (`...any` ?)
c.genln('[c2v_variadic]')
c.genln('@[c2v_variadic]')
}
if name.contains('blkcpy') {
vprintln('GOT FINISH')
Expand Down Expand Up @@ -506,7 +506,10 @@ fn (c &C2V) fn_params(mut node Node) []string {
if arg_typ.name.contains('...') {
vprintln('vararg: ' + arg_typ.name)
}
param_name := filter_name(param.name).to_lower().all_after_last('c.')
mut param_name := filter_name(param.name).to_lower().all_after_last('c.')
if param_name == '' {
param_name = 'arg${i}'
}
str_args << '${param_name} ${arg_typ.name}'
}
return str_args
Expand Down

0 comments on commit d32168e

Please sign in to comment.