git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <junio@pobox.com>
To: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Cc: GIT Mailing-list <git@vger.kernel.org>
Subject: [PATCH 3/3] make-static: pu
Date: Sun, 11 Sep 2011 14:38:37 -0700	[thread overview]
Message-ID: <7v39g2n4iq.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: 4E6D0E3F.3090304@ramsay1.demon.co.uk

Many symbols that are exported to the global scope do not have to be.

This needs to be split into separate patches and squashed into each
individual commit that introduces these symbols.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 dir.c            |    2 +-
 dir.h            |    1 -
 metadata-cache.c |    8 ++++----
 metadata-cache.h |    5 -----
 refs.c           |    2 +-
 5 files changed, 6 insertions(+), 12 deletions(-)

diff --git a/dir.c b/dir.c
index fba6433..bee7ed1 100644
--- a/dir.c
+++ b/dir.c
@@ -34,7 +34,7 @@ static int fnmatch_icase(const char *pattern, const char *string, int flags)
 	return fnmatch(pattern, string, flags | (ignore_case ? FNM_CASEFOLD : 0));
 }
 
-size_t common_prefix_len(const char **pathspec)
+static size_t common_prefix_len(const char **pathspec)
 {
 	const char *n, *first;
 	size_t max = 0;
diff --git a/dir.h b/dir.h
index 592ceca..9b7bfd4 100644
--- a/dir.h
+++ b/dir.h
@@ -64,7 +64,6 @@ struct dir_struct {
 #define MATCHED_RECURSIVELY 1
 #define MATCHED_FNMATCH 2
 #define MATCHED_EXACTLY 3
-extern size_t common_prefix_len(const char **pathspec);
 extern char *common_prefix(const char **pathspec);
 extern int match_pathspec(const char **pathspec, const char *name, int namelen, int prefix, char *seen);
 extern int match_pathspec_depth(const struct pathspec *pathspec,
diff --git a/metadata-cache.c b/metadata-cache.c
index 32d3c21..5f5ca4e 100644
--- a/metadata-cache.c
+++ b/metadata-cache.c
@@ -287,8 +287,8 @@ static void *lookup_disk(struct metadata_cache *c,
 	return c->disk_entries + (pos * record_size(c)) + 20;
 }
 
-const void *metadata_cache_lookup(struct metadata_cache *c,
-				  const struct object *obj)
+static const void *metadata_cache_lookup(struct metadata_cache *c,
+					 const struct object *obj)
 {
 	void *r;
 
@@ -300,8 +300,8 @@ const void *metadata_cache_lookup(struct metadata_cache *c,
 	return r;
 }
 
-void metadata_cache_add(struct metadata_cache *c, const struct object *obj,
-			const void *value)
+static void metadata_cache_add(struct metadata_cache *c, const struct object *obj,
+			       const void *value)
 {
 	metadata_cache_init(c);
 	add_decoration_value(&c->mem, obj, value, NULL);
diff --git a/metadata-cache.h b/metadata-cache.h
index 15484b5..4819563 100644
--- a/metadata-cache.h
+++ b/metadata-cache.h
@@ -24,11 +24,6 @@ struct metadata_cache {
 #define METADATA_CACHE_INIT(name, width, validity) \
 	{ validity, { (name), (width) } }
 
-const void *metadata_cache_lookup(struct metadata_cache *,
-				  const struct object *);
-void metadata_cache_add(struct metadata_cache *, const struct object *,
-			const void *value);
-
 /* Convenience wrappers around metadata_cache_{lookup,add} */
 int metadata_cache_lookup_uint32(struct metadata_cache *,
 				 const struct object *,
diff --git a/refs.c b/refs.c
index 1c4aa33..6e9588b 100644
--- a/refs.c
+++ b/refs.c
@@ -185,7 +185,7 @@ static void clear_cached_refs(struct cached_refs *ca)
 	ca->did_loose = ca->did_packed = 0;
 }
 
-struct cached_refs *create_cached_refs(const char *submodule)
+static struct cached_refs *create_cached_refs(const char *submodule)
 {
 	int len;
 	struct cached_refs *refs;
-- 
1.7.7.rc0.188.g3793ac

      parent reply	other threads:[~2011-09-11 21:38 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-11 19:38 [PATCH 1/3] sparse: Fix some "symbol not declared" warnings Ramsay Jones
2011-09-11 21:38 ` Junio C Hamano
2011-09-12  0:06   ` Junio C Hamano
2011-09-11 21:38 ` [PATCH 1/3] make-static: master Junio C Hamano
2011-09-12  6:14   ` Ramkumar Ramachandra
2011-09-15  4:29     ` Junio C Hamano
2011-09-13 22:51   ` Ramsay Jones
2011-09-13 23:46     ` Junio C Hamano
2011-09-14  6:50       ` Johannes Sixt
2011-09-14 19:03         ` Junio C Hamano
2011-09-14 20:33           ` Junio C Hamano
2011-09-14  8:52   ` Thomas Rast
2011-09-11 21:38 ` [PATCH 2/3] make-static: next Junio C Hamano
2011-09-11 21:38 ` Junio C Hamano [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=7v39g2n4iq.fsf@alter.siamese.dyndns.org \
    --to=junio@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=ramsay@ramsay1.demon.co.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
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;
as well as URLs for NNTP newsgroup(s).