Commit 8413c0f9b357a513943e496b01c68aa27e1d95b4

Edward Thomson 2020-12-05T21:32:48

util: move git__noop into the util header The git__noop function is more largely useful; move it into the util header. (And reduce the number of underscores.)

diff --git a/src/runtime.c b/src/runtime.c
index f8e3e3b..a214b43 100644
--- a/src/runtime.c
+++ b/src/runtime.c
@@ -103,8 +103,8 @@ GIT_INLINE(int) init_unlock(void)
 # error unknown threading model
 #else
 
-# define init_lock() git___noop()
-# define init_unlock() git___noop()
+# define init_lock() git__noop()
+# define init_unlock() git__noop()
 
 #endif
 
diff --git a/src/thread-utils.h b/src/thread-utils.h
index e577a9b..d71fabe 100644
--- a/src/thread-utils.h
+++ b/src/thread-utils.h
@@ -235,38 +235,36 @@ GIT_INLINE(int64_t) git_atomic64_get(git_atomic64 *a)
 
 #else
 
-GIT_INLINE(int) git___noop(void) { return 0; }
-
-#define git_threads_global_init git___noop
+#define git_threads_global_init git__noop
 
 #define git_thread unsigned int
-#define git_thread_create(thread, start_routine, arg) git___noop()
-#define git_thread_join(id, status) git___noop()
+#define git_thread_create(thread, start_routine, arg) git__noop()
+#define git_thread_join(id, status) git__noop()
 
 /* Pthreads Mutex */
 #define git_mutex unsigned int
-#define git_mutex_init(a)	git___noop()
-#define git_mutex_init(a)	git___noop()
-#define git_mutex_lock(a)	git___noop()
-#define git_mutex_unlock(a)	git___noop()
-#define git_mutex_free(a)	git___noop()
+#define git_mutex_init(a)	git__noop()
+#define git_mutex_init(a)	git__noop()
+#define git_mutex_lock(a)	git__noop()
+#define git_mutex_unlock(a)	git__noop()
+#define git_mutex_free(a)	git__noop()
 
 /* Pthreads condition vars */
 #define git_cond unsigned int
-#define git_cond_init(c)	git___noop()
-#define git_cond_free(c)	git___noop()
-#define git_cond_wait(c, l)	git___noop()
-#define git_cond_signal(c)	git___noop()
-#define git_cond_broadcast(c)	git___noop()
+#define git_cond_init(c)	git__noop()
+#define git_cond_free(c)	git__noop()
+#define git_cond_wait(c, l)	git__noop()
+#define git_cond_signal(c)	git__noop()
+#define git_cond_broadcast(c)	git__noop()
 
 /* Pthreads rwlock */
 #define git_rwlock unsigned int
-#define git_rwlock_init(a)	git___noop()
-#define git_rwlock_rdlock(a)	git___noop()
-#define git_rwlock_rdunlock(a)	git___noop()
-#define git_rwlock_wrlock(a)	git___noop()
-#define git_rwlock_wrunlock(a)	git___noop()
-#define git_rwlock_free(a)	git___noop()
+#define git_rwlock_init(a)	git__noop()
+#define git_rwlock_rdlock(a)	git__noop()
+#define git_rwlock_rdunlock(a)	git__noop()
+#define git_rwlock_wrlock(a)	git__noop()
+#define git_rwlock_wrunlock(a)	git__noop()
+#define git_rwlock_free(a)	git__noop()
 #define GIT_RWLOCK_STATIC_INIT	0
 
 
diff --git a/src/util.h b/src/util.h
index f49989f..185a1b1 100644
--- a/src/util.h
+++ b/src/util.h
@@ -414,6 +414,8 @@ GIT_INLINE(double) git__timer(void)
 
 extern int git__getenv(git_buf *out, const char *name);
 
+GIT_INLINE(int) git__noop(void) { return 0; }
+
 #include "alloc.h"
 
 #endif