@matheusbsbs / matheus-bagliano / commits / 74fd8728e2
Fork 0

gitweb: Remove function prototypes (cleanup)

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>

Jakub Narebski committed May 7, 2009 at 19:11 UTC 74fd8728e2abd46a6276f6d48bfc6c9f01d74570
1 file changed +5 -7
gitweb/gitweb.perl
+5 -7
@@ -838,7 +838,7 @@ exit;
838 ## ======================================================================
839 ## action links
840
841 -sub href (%) {
841 +sub href {
842 my %params = @_;
843 # default is to use -absolute url() i.e. $my_uri
844 my $href = $params{-full} ? $my_url : $my_uri;
@@ -1036,7 +1036,7 @@ sub esc_url {
1036 }
1037
1038 # replace invalid utf8 character with SUBSTITUTION sequence
1039 -sub esc_html ($;%) {
1039 +sub esc_html {
1040 my $str = shift;
1041 my %opts = @_;
1042
@@ -1296,7 +1296,7 @@ use constant {
1296 };
1297
1298 # submodule/subproject, a commit object reference
1299 -sub S_ISGITLINK($) {
1299 +sub S_ISGITLINK {
1300 my $mode = shift;
1301
1302 return (($mode & S_IFMT) == S_IFGITLINK)
@@ -2615,7 +2615,7 @@ sub parsed_difftree_line {
2615 }
2616
2617 # parse line of git-ls-tree output
2618 -sub parse_ls_tree_line ($;%) {
2618 +sub parse_ls_tree_line {
2619 my $line = shift;
2620 my %opts = @_;
2621 my %res;
@@ -3213,7 +3213,6 @@ sub git_print_header_div {
3213 "\n</div>\n";
3214 }
3215
3216 -#sub git_print_authorship (\%) {
3216 sub git_print_authorship {
3217 my $co = shift;
3218
@@ -3269,8 +3268,7 @@ sub git_print_page_path {
3268 print "<br/></div>\n";
3269 }
3270
3272 -# sub git_print_log (\@;%) {
3273 -sub git_print_log ($;%) {
3271 +sub git_print_log {
3272 my $log = shift;
3273 my %opts = @_;
3274