]> git.ipfire.org Git - thirdparty/git.git/commitdiff
bloom: fix `make sparse` warning
authorĐoàn Trần Công Danh <congdanhqx@gmail.com>
Thu, 7 May 2020 23:51:02 +0000 (00:51 +0100)
committerJunio C Hamano <gitster@pobox.com>
Fri, 8 May 2020 00:08:21 +0000 (17:08 -0700)
* We need a `final_new_line` to make our source code as text file, per
  POSIX and C specification.
* `bloom_filters` should be limited to interal linkage only

Signed-off-by: Đoàn Trần Công Danh <congdanhqx@gmail.com>
Signed-off-by: Ramsay Jones <ramsay@ramsayjones.plus.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
bloom.c
bloom.h
t/helper/test-bloom.c
t/t0095-bloom.sh
t/t4216-log-bloom.sh

diff --git a/bloom.c b/bloom.c
index dd9bab9bbd6cfd6b71a39e73813ecf745bec835e..ee025e0c61198a925e9423c87f0e5d8e8eae88f0 100644 (file)
--- a/bloom.c
+++ b/bloom.c
@@ -9,7 +9,7 @@
 
 define_commit_slab(bloom_filter_slab, struct bloom_filter);
 
-struct bloom_filter_slab bloom_filters;
+static struct bloom_filter_slab bloom_filters;
 
 struct pathmap_hash_entry {
     struct hashmap_entry entry;
@@ -273,4 +273,4 @@ int bloom_filter_contains(const struct bloom_filter *filter,
        }
 
        return 1;
-}
\ No newline at end of file
+}
diff --git a/bloom.h b/bloom.h
index b935186425d36d501a5cae1229338327e39bf6d1..e0e59e0754f1fb710b6ea3b7450c4771452eef2f 100644 (file)
--- a/bloom.h
+++ b/bloom.h
@@ -87,4 +87,4 @@ int bloom_filter_contains(const struct bloom_filter *filter,
                          const struct bloom_key *key,
                          const struct bloom_filter_settings *settings);
 
-#endif
\ No newline at end of file
+#endif
index 77eb27adac746e038b4e73f0e356354d3cfd9570..456f5ea7f944abf28b79182519fc86fca56dc1d6 100644 (file)
@@ -3,7 +3,7 @@
 #include "test-tool.h"
 #include "commit.h"
 
-struct bloom_filter_settings settings = DEFAULT_BLOOM_FILTER_SETTINGS;
+static struct bloom_filter_settings settings = DEFAULT_BLOOM_FILTER_SETTINGS;
 
 static void add_string_to_filter(const char *data, struct bloom_filter *filter) {
                struct bloom_key key;
index 8f9eef116dc8b70dc01d63834bdcc8a4957a733d..809ec7b0b890f3a7003f209337428cbc29073939 100755 (executable)
@@ -114,4 +114,4 @@ test_expect_success EXPENSIVE 'get bloom filter for commit with 513 changes' '
        test_cmp expect actual
 '
 
-test_done
\ No newline at end of file
+test_done
index c7011f33e2c1c0d9ad80a6e2e2185f901dbe862d..21b68dd6c89785e84b1f400673fbf0eb24df131f 100755 (executable)
@@ -152,4 +152,4 @@ test_expect_success 'Use Bloom filters if they exist in the latest but not all c
        test_bloom_filters_used_when_some_filters_are_missing "-- A/B"
 '
 
-test_done
\ No newline at end of file
+test_done