Skip to content

Commit 94fa8b6

Browse files
committed
autodoc: Use function signatures feature
1 parent 2f48e46 commit 94fa8b6

File tree

1 file changed

+11
-21
lines changed

1 file changed

+11
-21
lines changed

autodoc.pl

Lines changed: 11 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
#!/usr/bin/perl -w
22

33
use v5.41;
4-
no feature 'signatures'; # For the time being, to avoid converting
54
use Text::Tabs;
65

76
# Unconditionally regenerate:
@@ -470,8 +469,7 @@
470469
'vutil.c' => $versioning_scn,
471470
);
472471

473-
sub where_from_string($;$) {
474-
my ($file, $line_num) = @_;
472+
sub where_from_string($file, $line_num = 0) {
475473

476474
# Returns a string of hopefully idiomatic text about the location given by
477475
# the input parameters. The line number is not always available, and this
@@ -632,8 +630,7 @@ sub check_and_add_proto_defn {
632630
return \$elements{$element};
633631
}
634632

635-
sub classify_input_line ($$$$) {
636-
my ($file, $line_num, $input, $is_file_C) = @_;
633+
sub classify_input_line ($file, $line_num, $input, $is_file_C) {
637634

638635
# Looks at an input line and classifies it as to if it is of use to us or
639636
# not, and if so, what class of apidoc line it is. It looks for common
@@ -761,8 +758,7 @@ ($$$$)
761758
EOS
762759
}
763760

764-
sub handle_apidoc_line ($$$$) {
765-
my ($file, $line_num, $type, $arg) = @_;
761+
sub handle_apidoc_line ($file, $line_num, $type, $arg) {
766762

767763
# This just does a couple of checks that would otherwise have to be
768764
# duplicated in the calling code, and calls check_and_add_proto_defn() to
@@ -806,16 +802,14 @@ ($$$$)
806802
return $updated;
807803
}
808804

809-
sub destination_pod ($) { # Into which pod should the element go whose flags
810-
# are $1
811-
my $flags = shift;
805+
sub destination_pod ($flags) { # Into which pod should the element go whose
806+
# flags are $1
812807
return "unknown" if $flags eq "";
813808
return $api if $flags =~ /A/;
814809
return $intern;
815810
}
816811

817-
sub autodoc ($$) { # parse a file and extract documentation info
818-
my($fh, $file) = @_;
812+
sub autodoc ($fh, $file) { # parse a file and extract documentation info
819813

820814
my $section = $initial_file_section{$file}
821815
if defined $initial_file_section{$file};
@@ -1584,8 +1578,7 @@ sub parse_config_h {
15841578
}
15851579
}
15861580

1587-
sub format_pod_indexes($) {
1588-
my $entries_ref = shift;
1581+
sub format_pod_indexes($entries_ref) {
15891582

15901583
# Output the X<> references to the names, packed since they don't get
15911584
# displayed, but not too many per line so that when someone is editing the
@@ -1612,9 +1605,8 @@ ($)
16121605
return $text;
16131606
}
16141607

1615-
sub docout ($$$) { # output the docs for one function group
1616-
my($fh, $element_name, $docref) = @_;
1617-
1608+
sub docout ($fh, $element_name, $docref) { # output the docs for one function
1609+
# group
16181610
# Trim trailing space
16191611
$element_name =~ s/\s*$//;
16201612

@@ -2160,8 +2152,7 @@ ($$$)
21602152
print $fh "\n";
21612153
}
21622154

2163-
sub construct_missings_section {
2164-
my ($missings_hdr, $missings_ref) = @_;
2155+
sub construct_missings_section($missings_hdr, $missings_ref) {
21652156
my $text = "";
21662157

21672158
$text .= "$missings_hdr\n" . format_pod_indexes($missings_ref);
@@ -2239,8 +2230,7 @@ sub dictionary_order {
22392230
return $a cmp $b;
22402231
}
22412232

2242-
sub output($) { # Output a complete pod file
2243-
my $destpod = shift;
2233+
sub output($destpod) { # Output a complete pod file
22442234
my $podname = $destpod->{podname};
22452235
my $dochash = $destpod->{docs};
22462236

0 commit comments

Comments
 (0)