diff options
author | Joe Marcus Clarke <marcus@FreeBSD.org> | 2005-07-10 22:18:55 +0000 |
---|---|---|
committer | Joe Marcus Clarke <marcus@FreeBSD.org> | 2005-07-10 22:18:55 +0000 |
commit | 898c84cdf7f51ada025ec303f32c4f6716f02be6 (patch) | |
tree | 3f5146ff41371db9bcb1f552071e722379e8ced1 /Tools | |
parent | - Update to 1.9.5. (diff) |
Add prototypes for all the subroutines which fixes compilation with
Perl 5.8.7.
Reported by: mezz
Notes
Notes:
svn path=/head/; revision=138862
Diffstat (limited to 'Tools')
-rwxr-xr-x | Tools/scripts/addport | 29 |
1 files changed, 20 insertions, 9 deletions
diff --git a/Tools/scripts/addport b/Tools/scripts/addport index 377953c28a9a..c3b2d8de091d 100755 --- a/Tools/scripts/addport +++ b/Tools/scripts/addport @@ -43,6 +43,17 @@ use Sys::Hostname; use locale; use strict; +# Subroutine prototypes +sub warnx($); +sub err($$); +sub errx($$); +sub prompt($); +sub query($); +sub usage(); +sub contains($@); +sub lsports(); +sub lastcomment(); + my %opts; getopts('ac:d:fgh:il:M:mns:tu:', \%opts); @@ -349,12 +360,12 @@ the Contributors' List if they are not already there. To do this, edit doc/en_US.ISO8859-1/articles/contributors/contrib.additional.sgml. EOF -sub warnx { +sub warnx($) { my ($msg) = @_; print STDERR $0 . ": " . $msg . "\n"; } -sub err { +sub err($$) { my ($ex, $msg) = @_; warnx("WARNING: err called incorrectly") if (($ex !~ m/^\d+/) || ($msg eq "")); @@ -362,7 +373,7 @@ sub err { exit $ex; } -sub errx { +sub errx($$) { my ($ex,$msg) = @_; warnx("WARNING: errx called incorrectly") if (($ex !~ m/^\d+/) || ($msg eq "")); @@ -370,14 +381,14 @@ sub errx { exit $ex; } -sub prompt { +sub prompt($) { my ($msg) = @_; my $reply = query($msg); return 0 if ($reply =~ m/^[Yy]/); return 1 if ($reply =~ m/^[Nn]/); } -sub query { +sub query($) { my ($msg) = @_; print "$msg"; @@ -386,7 +397,7 @@ sub query { return $reply; } -sub usage { +sub usage() { #addport,v \$Revision: 1.21 $ print <<EOF; authors: <will\@FreeBSD.org>, <mharo\@FreeBSD.org> @@ -442,7 +453,7 @@ EXAMPLES EOF } -sub contains { +sub contains($@) { # look if the first parameter is contained in the list following it my ($item, @list) = @_; @@ -452,7 +463,7 @@ sub contains { return 0; } -sub lsports { +sub lsports() { my @rv = (); open(F, "Makefile") || die "can't open Makefile: $!"; @@ -469,7 +480,7 @@ sub lsports { } # this finds the last comment in the Makefile -sub lastcomment { +sub lastcomment() { my $num = 0; my $diff = 0; |