public inbox for git@vger.kernel.org 
 help / color / mirror / Atom feed
From: "René Scharfe" <rene.scharfe@lsrfire•ath.cx>
To: Stephen Boyd <bebarino@gmail•com>
Cc: Git Mailing List <git@vger•kernel.org>,
	Pierre Habouzit <madcoder@debian•org>,
	Junio C Hamano <gitster@pobox•com>
Subject: [PATCH] grep: make callback functions static
Date: Thu, 21 May 2009 00:05:22 +0200	[thread overview]
Message-ID: <4A147EA2.7050203@lsrfire.ath.cx> (raw)
In-Reply-To: <4A0E8AEF.3000704@gmail.com>

Suggested by Stephen Boyd: make the callback functions used for option
parsing static.

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire•ath.cx>
---
Patch applies to next.

 builtin-grep.c |   18 ++++++++++--------
 1 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/builtin-grep.c b/builtin-grep.c
index 169a91c..5308b34 100644
--- a/builtin-grep.c
+++ b/builtin-grep.c
@@ -565,7 +565,8 @@ static int grep_object(struct grep_opt *opt, const char **paths,
 	die("unable to grep from object of type %s", typename(obj->type));
 }
 
-int context_callback(const struct option *opt, const char *arg, int unset)
+static int context_callback(const struct option *opt, const char *arg,
+			    int unset)
 {
 	struct grep_opt *grep_opt = opt->value;
 	int value;
@@ -584,7 +585,7 @@ int context_callback(const struct option *opt, const char *arg, int unset)
 	return 0;
 }
 
-int file_callback(const struct option *opt, const char *arg, int unset)
+static int file_callback(const struct option *opt, const char *arg, int unset)
 {
 	struct grep_opt *grep_opt = opt->value;
 	FILE *patterns;
@@ -606,42 +607,43 @@ int file_callback(const struct option *opt, const char *arg, int unset)
 	return 0;
 }
 
-int not_callback(const struct option *opt, const char *arg, int unset)
+static int not_callback(const struct option *opt, const char *arg, int unset)
 {
 	struct grep_opt *grep_opt = opt->value;
 	append_grep_pattern(grep_opt, "--not", "command line", 0, GREP_NOT);
 	return 0;
 }
 
-int and_callback(const struct option *opt, const char *arg, int unset)
+static int and_callback(const struct option *opt, const char *arg, int unset)
 {
 	struct grep_opt *grep_opt = opt->value;
 	append_grep_pattern(grep_opt, "--and", "command line", 0, GREP_AND);
 	return 0;
 }
 
-int open_callback(const struct option *opt, const char *arg, int unset)
+static int open_callback(const struct option *opt, const char *arg, int unset)
 {
 	struct grep_opt *grep_opt = opt->value;
 	append_grep_pattern(grep_opt, "(", "command line", 0, GREP_OPEN_PAREN);
 	return 0;
 }
 
-int close_callback(const struct option *opt, const char *arg, int unset)
+static int close_callback(const struct option *opt, const char *arg, int unset)
 {
 	struct grep_opt *grep_opt = opt->value;
 	append_grep_pattern(grep_opt, ")", "command line", 0, GREP_CLOSE_PAREN);
 	return 0;
 }
 
-int pattern_callback(const struct option *opt, const char *arg, int unset)
+static int pattern_callback(const struct option *opt, const char *arg,
+			    int unset)
 {
 	struct grep_opt *grep_opt = opt->value;
 	append_grep_pattern(grep_opt, arg, "-e option", 0, GREP_PATTERN);
 	return 0;
 }
 
-int help_callback(const struct option *opt, const char *arg, int unset)
+static int help_callback(const struct option *opt, const char *arg, int unset)
 {
 	return -1;
 }
-- 
1.6.3.1

      parent reply	other threads:[~2009-05-20 22:05 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-07 19:43 [PATCH 0/5] grep parseopt conversion René Scharfe
2009-05-07 19:44 ` [PATCH 1/5] parseopt: add OPT_NEGBIT René Scharfe
2009-05-08  5:01   ` Jeff King
2009-05-07 19:45 ` [PATCH 2/5] parseopt: add OPT_NUMBER_CALLBACK René Scharfe
2009-05-07 19:45 ` [PATCH 3/5] parseopt: add PARSE_OPT_NODASH René Scharfe
2009-05-07 19:46 ` [PATCH 4/5] grep: remove global variable builtin_grep René Scharfe
2009-05-07 19:46 ` [PATCH 5/5] grep: use parseopt René Scharfe
2009-05-16  9:44   ` Stephen Boyd
2009-05-17 19:45     ` René Scharfe
2009-05-20 22:05     ` René Scharfe [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4A147EA2.7050203@lsrfire.ath.cx \
    --to=rene.scharfe@lsrfire$(echo .)ath.cx \
    --cc=bebarino@gmail$(echo .)com \
    --cc=git@vger$(echo .)kernel.org \
    --cc=gitster@pobox$(echo .)com \
    --cc=madcoder@debian$(echo .)org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox