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

[PATCH 08/18] read-cache.c: mark file-local functions static

From
Junio C Hamano <gitster@pobox.com>
Date
Jan 12, 2010, 07:52 UTC
Message-ID
<1263282781-25596-9-git-send-email-gitster@pobox.com>
In-Reply-To
<1263282781-25596-1-git-send-email-gitster@pobox.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 * has conflicts when applied to 'pu' but nothing "am -3" cannot fix.
 * remove_index_entry_at() is left exported even though it can become
   static in 'master'; it is used in 'pu'.
 cache.h      |    2 --
 read-cache.c |    6 ++++--
 2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/cache.h b/cache.h
index 30b9048..e7bb6b7 100644
--- a/cache.h
+++ b/cache.h
@@ -445,7 +445,6 @@ extern int index_name_pos(const struct index_state *, const char *name, int name
 #define ADD_CACHE_JUST_APPEND 8		/* Append only; tree.c::read_tree() */
 #define ADD_CACHE_NEW_ONLY 16		/* Do not replace existing ones */
 extern int add_index_entry(struct index_state *, struct cache_entry *ce, int option);
-extern struct cache_entry *refresh_cache_entry(struct cache_entry *ce, int really);
 extern void rename_index_entry_at(struct index_state *, int pos, const char *new_name);
 extern int remove_index_entry_at(struct index_state *, int pos);
 extern void remove_marked_cache_entries(struct index_state *istate);
@@ -615,7 +614,6 @@ static inline void hashclr(unsigned char *hash)
 {
 	memset(hash, 0, 20);
 }
-extern int is_empty_blob_sha1(const unsigned char *sha1);
 
 #define EMPTY_TREE_SHA1_HEX \
 	"4b825dc642cb6eb9a060e54bf8d69288fbee4904"
diff --git a/read-cache.c b/read-cache.c
index 9033dd3..9f4f44c 100644
--- a/read-cache.c
+++ b/read-cache.c
@@ -15,6 +15,8 @@
 #include "revision.h"
 #include "blob.h"
 
+static struct cache_entry *refresh_cache_entry(struct cache_entry *ce, int really);
+
 /* Index extensions.
  *
  * The first letter should be 'A'..'Z' for extensions that are not
@@ -156,7 +158,7 @@ static int ce_modified_check_fs(struct cache_entry *ce, struct stat *st)
 	return 0;
 }
 
-int is_empty_blob_sha1(const unsigned char *sha1)
+static int is_empty_blob_sha1(const unsigned char *sha1)
 {
 	static const unsigned char empty_blob_sha1[20] = {
 		0xe6,0x9d,0xe2,0x9b,0xb2,0xd1,0xd6,0x43,0x4b,0x8b,
@@ -1141,7 +1143,7 @@ int refresh_index(struct index_state *istate, unsigned int flags, const char **p
 	return has_errors;
 }
 
-struct cache_entry *refresh_cache_entry(struct cache_entry *ce, int really)
+static struct cache_entry *refresh_cache_entry(struct cache_entry *ce, int really)
 {
 	return refresh_cache_ent(&the_index, ce, really, NULL);
 }
-- 
1.6.6.280.ge295b7.dirty
Previous: Junio C HamanoNext: Junio C Hamano
Message 12 of 24 in “mark file-local symbols static”
  1. 00/18 mark file-local symbols staticJunio C Hamano, Jan 12, 2010
  2. 01/18 bisect.c: mark file-local function staticJunio C Hamano, Jan 12, 2010
  3. 02/18 builtin-rev-list.c: mark file-local function staticJunio C Hamano, Jan 12, 2010
  4. 03/18 pretty.c: mark file-local function staticJunio C Hamano, Jan 12, 2010
  5. 04/18 date.c: mark file-local function staticJunio C Hamano, Jan 12, 2010
  6. Johannes SixtJan 12, 2010
  7. Junio C HamanoJan 12, 2010
  8. Johannes SixtJan 12, 2010
  9. 05/18 http.c: mark file-local functions staticJunio C Hamano, Jan 12, 2010
  10. 06/18 entry.c: mark file-local function staticJunio C Hamano, Jan 12, 2010
  11. 07/18 parse-options.c: mark file-local function staticJunio C Hamano, Jan 12, 2010
  12. 08/18 read-cache.c: mark file-local functions staticJunio C Hamano, Jan 12, 2010
  13. 09/18 remote-curl.c: mark file-local function staticJunio C Hamano, Jan 12, 2010
  14. 10/18 quote.c: mark file-local function staticJunio C Hamano, Jan 12, 2010
  15. 11/18 submodule.c: mark file-local function staticJunio C Hamano, Jan 12, 2010
  16. 12/18 utf8.c: mark file-local function staticJunio C Hamano, Jan 12, 2010
  17. 13/18 mailmap.c: remove unused functionJunio C Hamano, Jan 12, 2010
  18. 14/18 sha1_file.c: remove unused functionJunio C Hamano, Jan 12, 2010
  19. 15/18 strbuf.c: remove unused functionJunio C Hamano, Jan 12, 2010
  20. 16/18 blob.c: remove unused functionJunio C Hamano, Jan 12, 2010
  21. Daniel BarkalowJan 12, 2010
  22. Junio C HamanoJan 13, 2010
  23. 17/18 object.c: remove unused functionsJunio C Hamano, Jan 12, 2010
  24. 18/18 symlinks.c: remove unused functionsJunio C Hamano, Jan 12, 2010

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.