Thread (7 messages) 7 messages, 1 author, 2021-07-31

[PATCH v1 5/6] refs/debug: declare file-local variable to be static

DORMANTno replies

From: Ben Boeckel <hidden>
Date: 2021-07-31 02:42:42
Subsystem: the rest · Maintainer: Linus Torvalds

Declaring a variable in a source file as `extern` and then defining it
later is not very useful. It can instead be declared as `static`.

Signed-off-by: Ben Boeckel <redacted>
---
 refs/debug.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/refs/debug.c b/refs/debug.c
index 7db4abccc3..f5609408f3 100644
--- a/refs/debug.c
+++ b/refs/debug.c
@@ -9,7 +9,7 @@ struct debug_ref_store {
 	struct ref_store *refs;
 };
 
-extern struct ref_storage_be refs_be_debug;
+static struct ref_storage_be refs_be_debug;
 
 struct ref_store *maybe_debug_wrap_ref_store(const char *gitdir, struct ref_store *store)
 {
@@ -413,7 +413,7 @@ static int debug_reflog_expire(struct ref_store *ref_store, const char *refname,
 	return res;
 }
 
-struct ref_storage_be refs_be_debug = {
+static struct ref_storage_be refs_be_debug = {
 	NULL,
 	"debug",
 	NULL,
-- 
2.31.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help