@matheusbsbs / matheus-bagliano / commits / ff3c7f9a26
Fork 0

grep: make callback functions static

Suggested by Stephen Boyd: make the callback functions used for option parsing static. Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx> Signed-off-by: Junio C Hamano <gitster@pobox.com>

René Scharfe committed May 21, 2009 at 00:05 UTC ff3c7f9a264da41a2cd7b7a28a27f8ad935b81a9
1 file changed +10 -8
builtin-grep.c
+10 -8
@@ -565,7 +565,8 @@ static int grep_object(struct grep_opt *opt, const char **paths,
565 die("unable to grep from object of type %s", typename(obj->type));
566 }
567
568 -int context_callback(const struct option *opt, const char *arg, int unset)
568 +static int context_callback(const struct option *opt, const char *arg,
569 + int unset)
570 {
571 struct grep_opt *grep_opt = opt->value;
572 int value;
@@ -584,7 +585,7 @@ int context_callback(const struct option *opt, const char *arg, int unset)
585 return 0;
586 }
587
587 -int file_callback(const struct option *opt, const char *arg, int unset)
588 +static int file_callback(const struct option *opt, const char *arg, int unset)
589 {
590 struct grep_opt *grep_opt = opt->value;
591 FILE *patterns;
@@ -606,42 +607,43 @@ int file_callback(const struct option *opt, const char *arg, int unset)
607 return 0;
608 }
609
609 -int not_callback(const struct option *opt, const char *arg, int unset)
610 +static int not_callback(const struct option *opt, const char *arg, int unset)
611 {
612 struct grep_opt *grep_opt = opt->value;
613 append_grep_pattern(grep_opt, "--not", "command line", 0, GREP_NOT);
614 return 0;
615 }
616
616 -int and_callback(const struct option *opt, const char *arg, int unset)
617 +static int and_callback(const struct option *opt, const char *arg, int unset)
618 {
619 struct grep_opt *grep_opt = opt->value;
620 append_grep_pattern(grep_opt, "--and", "command line", 0, GREP_AND);
621 return 0;
622 }
623
623 -int open_callback(const struct option *opt, const char *arg, int unset)
624 +static int open_callback(const struct option *opt, const char *arg, int unset)
625 {
626 struct grep_opt *grep_opt = opt->value;
627 append_grep_pattern(grep_opt, "(", "command line", 0, GREP_OPEN_PAREN);
628 return 0;
629 }
630
630 -int close_callback(const struct option *opt, const char *arg, int unset)
631 +static int close_callback(const struct option *opt, const char *arg, int unset)
632 {
633 struct grep_opt *grep_opt = opt->value;
634 append_grep_pattern(grep_opt, ")", "command line", 0, GREP_CLOSE_PAREN);
635 return 0;
636 }
637
637 -int pattern_callback(const struct option *opt, const char *arg, int unset)
638 +static int pattern_callback(const struct option *opt, const char *arg,
639 + int unset)
640 {
641 struct grep_opt *grep_opt = opt->value;
642 append_grep_pattern(grep_opt, arg, "-e option", 0, GREP_PATTERN);
643 return 0;
644 }
645
644 -int help_callback(const struct option *opt, const char *arg, int unset)
646 +static int help_callback(const struct option *opt, const char *arg, int unset)
647 {
648 return -1;
649 }