History

kernel-doc: handle varargs cleanly

The method for listing varargs in kernel-doc notation is: * @...: these arguments are printed by the @fmt argument but scripts/kernel-doc is confused: it always lists varargs as: ... variable arguments and ignores the @...: line's description, but then prints that line after the list of function parameters as though it's not part of the function parameters. This patch makes kernel-doc print the supplied @... description if it is present; otherwise a boilerplate "variable arguments" is printed.

Randy Dunlap committed 17 years ago

Commit ced69091 parent 6ff2d391 file · +7 −3Browse files

Showing the changes to scripts (1 of 1 file). Show all

Unified · Split

scripts/kernel-doc+7−3
@@ -378,6 +378,10 @@ sub dump_section { · 377 unmodified lines
378# print STDERR "parameter def '$1' = '$contents'\n";378# print STDERR "parameter def '$1' = '$contents'\n";
379 $name = $1;379 $name = $1;
380 $parameterdescs{$name} = $contents;380 $parameterdescs{$name} = $contents;
381 } elsif ($name eq "@\.\.\.") {
382# print STDERR "parameter def '...' = '$contents'\n";
383 $name = "...";
384 $parameterdescs{$name} = $contents;
381 } else {385 } else {
382# print STDERR "other section '$name' = '$contents'\n";386# print STDERR "other section '$name' = '$contents'\n";
383 if (defined($sections{$name}) && ($sections{$name} ne "")) {387 if (defined($sections{$name}) && ($sections{$name} ne "")) {
@@ -1588,12 +1592,12 @@ sub push_parameter($$$) { · 1204 unmodified lines
1588 1592
1589 if ($type eq "" && $param =~ /\.\.\.$/)1593 if ($type eq "" && $param =~ /\.\.\.$/)
1590 {1594 {
1591 $type="";1595 if (!defined $parameterdescs{$param} || $parameterdescs{$param} eq "") {
1592 $parameterdescs{$param} = "variable arguments";1596 $parameterdescs{$param} = "variable arguments";
1597 }
1593 }1598 }
1594 elsif ($type eq "" && ($param eq "" or $param eq "void"))1599 elsif ($type eq "" && ($param eq "" or $param eq "void"))
1595 {1600 {
1596 $type="";
1597 $param="void";1601 $param="void";
1598 $parameterdescs{void} = "no arguments";1602 $parameterdescs{void} = "no arguments";
1599 }1603 }

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t