git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 2/3] make-static: next

From
Junio C Hamano <junio@pobox.com>
Date
Sep 11, 2011, 21:38 UTC
Message-ID
<7vaaaan4ix.fsf@alter.siamese.dyndns.org>
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 queued on top of each individual topic.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 builtin/revert.c |    2 +-
 credential.c     |   46 +++++++++++++++++++++++-----------------------
 credential.h     |    1 -
 submodule.c      |    4 ++--
 4 files changed, 26 insertions(+), 27 deletions(-)
diff --git a/builtin/revert.c b/builtin/revert.c
index 5e97622..515f3cc 100644
--- a/builtin/revert.c
+++ b/builtin/revert.c
@@ -659,7 +659,7 @@ 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,
+static struct commit_list **commit_list_append(struct commit *commit,
 					struct commit_list **next)
 {
 	struct commit_list *new = xmalloc(sizeof(struct commit_list));
diff --git a/credential.c b/credential.c
index 7a0c751..6243b03 100644
--- a/credential.c
+++ b/credential.c
@@ -171,6 +171,29 @@ static int credential_do(struct credential *c, const char *method,
 	return r;
 }
 
+static int credential_fill_gently(struct credential *c,
+				  const struct string_list *methods)
+{
+	int i;
+
+	if (c->username && c->password)
+		return 0;
+
+	if (!methods)
+		methods = &default_methods;
+
+	if (!methods->nr)
+		return credential_getpass(c);
+
+	for (i = 0; i < methods->nr; i++) {
+		if (!credential_do(c, methods->items[i].string, NULL) &&
+		    c->username && c->password)
+			return 0;
+	}
+
+	return -1;
+}
+
 void credential_fill(struct credential *c, const struct string_list *methods)
 {
 	struct strbuf err = STRBUF_INIT;
@@ -195,29 +218,6 @@ void credential_fill(struct credential *c, const struct string_list *methods)
 	die("%s", err.buf);
 }
 
-int credential_fill_gently(struct credential *c,
-			   const struct string_list *methods)
-{
-	int i;
-
-	if (c->username && c->password)
-		return 0;
-
-	if (!methods)
-		methods = &default_methods;
-
-	if (!methods->nr)
-		return credential_getpass(c);
-
-	for (i = 0; i < methods->nr; i++) {
-		if (!credential_do(c, methods->items[i].string, NULL) &&
-		    c->username && c->password)
-			return 0;
-	}
-
-	return -1;
-}
-
 void credential_reject(struct credential *c, const struct string_list *methods)
 {
 	int i;
diff --git a/credential.h b/credential.h
index 788ed8e..07541ad 100644
--- a/credential.h
+++ b/credential.h
@@ -13,7 +13,6 @@ struct string_list;
 int credential_getpass(struct credential *);
 void credential_from_config(struct credential *);
 
-int credential_fill_gently(struct credential *, const struct string_list *methods);
 void credential_fill(struct credential *, const struct string_list *methods);
 void credential_reject(struct credential *, const struct string_list *methods);
 
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.7.rc0.188.g3793ac
Previous: Thomas RastNext: Junio C Hamano
Message 13 of 14 in “sparse: Fix some "symbol not declared" warnings”
  1. 1/3 sparse: Fix some "symbol not declared" warningsRamsay Jones, Sep 11, 2011
  2. Junio C HamanoSep 11, 2011
  3. Junio C HamanoSep 12, 2011
  4. 1/3 make-static: masterJunio C Hamano, Sep 11, 2011
  5. Ramkumar RamachandraSep 12, 2011
  6. Junio C HamanoSep 15, 2011
  7. Ramsay JonesSep 13, 2011
  8. Junio C HamanoSep 13, 2011
  9. Johannes SixtSep 14, 2011
  10. Junio C HamanoSep 14, 2011
  11. Junio C HamanoSep 14, 2011
  12. Thomas RastSep 14, 2011
  13. 2/3 make-static: nextJunio C Hamano, Sep 11, 2011
  14. 3/3 make-static: puJunio C Hamano, Sep 11, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.