Skip to content

Commit dfa464b

Browse files
committed
tools: ynl-gen: move local vars after the opening bracket
The "function writing helper" tries to put local variables between prototype and the opening bracket. Clearly wrong, but up until now nothing actually uses it to write local vars so it wasn't noticed. Reviewed-by: Donald Hunter <[email protected]> Reviewed-by: Jacob Keller <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 4d07bbf commit dfa464b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tools/net/ynl/pyynl/ynl_gen_c.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1399,9 +1399,9 @@ def write_func_lvar(self, local_vars):
13991399

14001400
def write_func(self, qual_ret, name, body, args=None, local_vars=None):
14011401
self.write_func_prot(qual_ret=qual_ret, name=name, args=args)
1402+
self.block_start()
14021403
self.write_func_lvar(local_vars=local_vars)
14031404

1404-
self.block_start()
14051405
for line in body:
14061406
self.p(line)
14071407
self.block_end()

0 commit comments

Comments
 (0)