Skip to content

Commit

Permalink
gitweb: Remove function prototypes (cleanup)
Browse files Browse the repository at this point in the history
Use of function prototypes is considered bad practice in Perl.  The
ones used here didn't accomplish anything anyhow, so they've been
removed.

>From perlsub(1):

  [...] the intent of this feature [prototypes] is primarily to let
  you define subroutines that work like built-in functions [...]
  you can generate new syntax with it [...]

We don't want to have subroutines behaving exactly like built-in
functions, we don't want to define new syntax / syntactic sugar, so
prototypes in gitweb are not needed... and they can have unintended
consequences.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Jakub Narebski authored and Junio C Hamano committed May 9, 2009
1 parent 5a0e4a2 commit 74fd872
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions gitweb/gitweb.perl
Original file line number Diff line number Diff line change
Expand Up @@ -838,7 +838,7 @@ sub evaluate_path_info {
## ======================================================================
## action links

sub href (%) {
sub href {
my %params = @_;
# default is to use -absolute url() i.e. $my_uri
my $href = $params{-full} ? $my_url : $my_uri;
Expand Down Expand Up @@ -1036,7 +1036,7 @@ sub esc_url {
}

# replace invalid utf8 character with SUBSTITUTION sequence
sub esc_html ($;%) {
sub esc_html {
my $str = shift;
my %opts = @_;

Expand Down Expand Up @@ -1296,7 +1296,7 @@ sub age_string {
};

# submodule/subproject, a commit object reference
sub S_ISGITLINK($) {
sub S_ISGITLINK {
my $mode = shift;

return (($mode & S_IFMT) == S_IFGITLINK)
Expand Down Expand Up @@ -2615,7 +2615,7 @@ sub parsed_difftree_line {
}

# parse line of git-ls-tree output
sub parse_ls_tree_line ($;%) {
sub parse_ls_tree_line {
my $line = shift;
my %opts = @_;
my %res;
Expand Down Expand Up @@ -3213,7 +3213,6 @@ sub git_print_header_div {
"\n</div>\n";
}

#sub git_print_authorship (\%) {
sub git_print_authorship {
my $co = shift;

Expand Down Expand Up @@ -3269,8 +3268,7 @@ sub git_print_page_path {
print "<br/></div>\n";
}

# sub git_print_log (\@;%) {
sub git_print_log ($;%) {
sub git_print_log {
my $log = shift;
my %opts = @_;

Expand Down

0 comments on commit 74fd872

Please sign in to comment.