[PATCH 3/3] make-static: pu

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx>
---
 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

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]