]> git.ipfire.org Git - thirdparty/git.git/commitdiff
progress.c: silence cgcc suggestion about internal linkage
authorĐoàn Trần Công Danh <congdanhqx@gmail.com>
Mon, 27 Apr 2020 14:22:37 +0000 (21:22 +0700)
committerJunio C Hamano <gitster@pobox.com>
Mon, 27 Apr 2020 18:21:28 +0000 (11:21 -0700)
Signed-off-by: Đoàn Trần Công Danh <congdanhqx@gmail.com>
Reviewed-by: Ramsay Jones <ramsay@ramsayjones.plus.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
progress.c
progress.h
t/helper/test-progress.c

index 19805ac6461ba3b1300e542989189f76738c1407..75633e9c5e91a959e624ea38898933ea20d1daaa 100644 (file)
@@ -8,6 +8,7 @@
  * published by the Free Software Foundation.
  */
 
+#define GIT_TEST_PROGRESS_ONLY
 #include "cache.h"
 #include "gettext.h"
 #include "progress.h"
@@ -52,7 +53,6 @@ static volatile sig_atomic_t progress_update;
  */
 int progress_testing;
 uint64_t progress_test_ns = 0;
-void progress_test_force_update(void); /* To silence -Wmissing-prototypes */
 void progress_test_force_update(void)
 {
        progress_update = 1;
index 847338911fbb6cf359f39ea0cb7a406297b61812..f1913acf73f1790366ebd2f3f802f0472221bc7c 100644 (file)
@@ -3,6 +3,14 @@
 
 struct progress;
 
+#ifdef GIT_TEST_PROGRESS_ONLY
+
+extern int progress_testing;
+extern uint64_t progress_test_ns;
+void progress_test_force_update(void);
+
+#endif
+
 void display_throughput(struct progress *progress, uint64_t total);
 void display_progress(struct progress *progress, uint64_t n);
 struct progress *start_progress(const char *title, uint64_t total);
index 42b96cb103c6acee9ad2a9dfad8afbaa7ef854e9..5d05cbe7894097f6410328b966bda936e678237f 100644 (file)
  *
  * See 't0500-progress-display.sh' for examples.
  */
+#define GIT_TEST_PROGRESS_ONLY
 #include "test-tool.h"
 #include "gettext.h"
 #include "parse-options.h"
 #include "progress.h"
 #include "strbuf.h"
 
-/*
- * These are defined in 'progress.c', but are not exposed in 'progress.h',
- * because they are exclusively for testing.
- */
-extern int progress_testing;
-extern uint64_t progress_test_ns;
-void progress_test_force_update(void);
-
 int cmd__progress(int argc, const char **argv)
 {
        int total = 0;