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

[PATCH v1 6/6] globals: remove explicit `0` initialization from globals

DORMANTno replies

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

Git relies on implicit zero-initialization of global variables.

Signed-off-by: Ben Boeckel <redacted>
---
 object-file.c | 2 +-
 progress.c    | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/object-file.c b/object-file.c
index ecca5a8da0..6a04013342 100644
--- a/object-file.c
+++ b/object-file.c
@@ -1503,7 +1503,7 @@ static int loose_object_info(struct repository *r,
 	return (status < 0) ? status : 0;
 }
 
-int obj_read_use_lock = 0;
+int obj_read_use_lock;
 pthread_mutex_t obj_read_mutex;
 
 void enable_obj_read_lock(void)
diff --git a/progress.c b/progress.c
index 680c6a8bf9..4fb4233b67 100644
--- a/progress.c
+++ b/progress.c
@@ -52,7 +52,7 @@ static volatile sig_atomic_t progress_update;
  * for 'test-tool progress'.
  */
 int progress_testing;
-uint64_t progress_test_ns = 0;
+uint64_t progress_test_ns;
 void progress_test_force_update(void)
 {
 	progress_update = 1;
-- 
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