Skip to content

Commit ff3c7f9

Browse files
René Scharfegitster
authored andcommitted
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>
1 parent 3e230fa commit ff3c7f9

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

builtin-grep.c

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -565,7 +565,8 @@ static int grep_object(struct grep_opt *opt, const char **paths,
565565
die("unable to grep from object of type %s", typename(obj->type));
566566
}
567567

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)
569570
{
570571
struct grep_opt *grep_opt = opt->value;
571572
int value;
@@ -584,7 +585,7 @@ int context_callback(const struct option *opt, const char *arg, int unset)
584585
return 0;
585586
}
586587

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)
588589
{
589590
struct grep_opt *grep_opt = opt->value;
590591
FILE *patterns;
@@ -606,42 +607,43 @@ int file_callback(const struct option *opt, const char *arg, int unset)
606607
return 0;
607608
}
608609

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)
610611
{
611612
struct grep_opt *grep_opt = opt->value;
612613
append_grep_pattern(grep_opt, "--not", "command line", 0, GREP_NOT);
613614
return 0;
614615
}
615616

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)
617618
{
618619
struct grep_opt *grep_opt = opt->value;
619620
append_grep_pattern(grep_opt, "--and", "command line", 0, GREP_AND);
620621
return 0;
621622
}
622623

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)
624625
{
625626
struct grep_opt *grep_opt = opt->value;
626627
append_grep_pattern(grep_opt, "(", "command line", 0, GREP_OPEN_PAREN);
627628
return 0;
628629
}
629630

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)
631632
{
632633
struct grep_opt *grep_opt = opt->value;
633634
append_grep_pattern(grep_opt, ")", "command line", 0, GREP_CLOSE_PAREN);
634635
return 0;
635636
}
636637

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)
638640
{
639641
struct grep_opt *grep_opt = opt->value;
640642
append_grep_pattern(grep_opt, arg, "-e option", 0, GREP_PATTERN);
641643
return 0;
642644
}
643645

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)
645647
{
646648
return -1;
647649
}

0 commit comments

Comments
 (0)