git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] sparse: Fix some "symbol not declared" warnings
@ 2011-09-11 19:38 Ramsay Jones
  2011-09-11 21:38 ` Junio C Hamano
                   ` (3 more replies)
  0 siblings, 4 replies; 14+ messages in thread
From: Ramsay Jones @ 2011-09-11 19:38 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: GIT Mailing-list


In particular, sparse issues the "symbol 'a_symbol' was not declared.
Should it be static?" warning for the following symbols:

    submodule.c:321:5: 'submodule_needs_pushing'
    submodule.c:355:5: 'push_submodule'
    builtin/revert.c:662:20: 'commit_list_append'

These symbols only require file scope, so we simply add the static
modifier to their declarations.

Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
---
 builtin/revert.c |    4 ++--
 submodule.c      |    4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/builtin/revert.c b/builtin/revert.c
index 5e97622..5f1cee8 100644
--- a/builtin/revert.c
+++ b/builtin/revert.c
@@ -659,8 +659,8 @@ static void read_and_refresh_cache(struct replay_opts *opts)
  *     assert(commit_list_count(list) == 2);
  *     return list;
  */
-struct commit_list **commit_list_append(struct commit *commit,
-					struct commit_list **next)
+static struct commit_list **commit_list_append(struct commit *commit,
+						struct commit_list **next)
 {
 	struct commit_list *new = xmalloc(sizeof(struct commit_list));
 	new->item = commit;
diff --git a/submodule.c b/submodule.c
index 38d9877..5a02890 100644
--- a/submodule.c
+++ b/submodule.c
@@ -318,7 +318,7 @@ static int has_remote(const char *refname, const unsigned char *sha1, int flags,
 	return 1;
 }
 
-int submodule_needs_pushing(const char *path, const unsigned char sha1[20], void *data)
+static int submodule_needs_pushing(const char *path, const unsigned char sha1[20], void *data)
 {
 	int *needs_pushing = data;
 
@@ -352,7 +352,7 @@ int submodule_needs_pushing(const char *path, const unsigned char sha1[20], void
 	return 1;
 }
 
-int push_submodule(const char *path, const unsigned char sha1[20], void *data)
+static int push_submodule(const char *path, const unsigned char sha1[20], void *data)
 {
 	if (add_submodule_odb(path) || !lookup_commit_reference(sha1))
 		return 1;
-- 
1.7.6

^ permalink raw reply related	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2011-09-15  4:30 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 ` [PATCH 3/3] make-static: pu Junio C Hamano

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).