threads / patch / 37846

patchdir.c: mark a file local function as static

Subject: [PATCH] dir.c: mark a file local function as static

## tl;dr

One message between Oct 30, 2014 and Oct 30, 2014. Diffs are folded; open one to read it.

replies: 0people: 1as markdown or json

Ramsay Jones· Oct 30, 2014, 16:01 UTC · lore

Commit b74884b86 ("untracked cache: make a wrapper around {open,read,close}dir()", 27-10-2014) added the read_cached_dir() function as an external symbol.

Noticed by sparse. ("'read_cached_dir' was not declared. Should it be static?").

Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
---
Hi Duy,

If you need to re-roll your 'nd/untracked-cache' branch, could you please squash this into the relevant patch.

Thanks!

[If this function is destined to be used from external call sites in future patches, then adding an extern declaration to "dir.h" would be an alternative, of course. ;-) ]

ATB, Ramsay Jones

 dir.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Show changes to dir.c +1 −1
diff --git a/dir.c b/dir.c
index 0040ca1..e999cc8 100644
--- a/dir.c
+++ b/dir.c
@@ -1582,7 +1582,7 @@ static int open_cached_dir(struct cached_dir *cdir,
 	return 0;
 }
 
-int read_cached_dir(struct cached_dir *cdir)
+static int read_cached_dir(struct cached_dir *cdir)
 {
 	if (cdir->fdir) {
 		cdir->de = readdir(cdir->fdir);
-- 
2.1.0

← back to recent threads