diff options
| author | Junio C Hamano <gitster@pobox.com> | 2024-12-23 09:32:10 -0800 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2024-12-23 09:32:11 -0800 |
| commit | 4156b6a741c7fb15a4eccb320612fb6e453f439c (patch) | |
| tree | 203f68166cc5f2337fd80f6628c3b344d2dd3abf /t/unit-tests | |
| parent | f7c607fac3dd906c46d0d86ff174215698912316 (diff) | |
| parent | e03d2a9ccb88c7ff42237f5890a05e071497f8ae (diff) | |
| download | git-4156b6a741c7fb15a4eccb320612fb6e453f439c.tar.gz | |
Merge branch 'ps/build-sign-compare'
Start working to make the codebase buildable with -Wsign-compare.
* ps/build-sign-compare:
t/helper: don't depend on implicit wraparound
scalar: address -Wsign-compare warnings
builtin/patch-id: fix type of `get_one_patchid()`
builtin/blame: fix type of `length` variable when emitting object ID
gpg-interface: address -Wsign-comparison warnings
daemon: fix type of `max_connections`
daemon: fix loops that have mismatching integer types
global: trivial conversions to fix `-Wsign-compare` warnings
pkt-line: fix -Wsign-compare warning on 32 bit platform
csum-file: fix -Wsign-compare warning on 32-bit platform
diff.h: fix index used to loop through unsigned integer
config.mak.dev: drop `-Wno-sign-compare`
global: mark code units that generate warnings with `-Wsign-compare`
compat/win32: fix -Wsign-compare warning in "wWinMain()"
compat/regex: explicitly ignore "-Wsign-compare" warnings
git-compat-util: introduce macros to disable "-Wsign-compare" warnings
Diffstat (limited to 't/unit-tests')
| -rw-r--r-- | t/unit-tests/lib-reftable.c | 2 | ||||
| -rw-r--r-- | t/unit-tests/t-example-decorate.c | 4 | ||||
| -rw-r--r-- | t/unit-tests/t-prio-queue.c | 2 | ||||
| -rw-r--r-- | t/unit-tests/t-reftable-readwrite.c | 2 | ||||
| -rw-r--r-- | t/unit-tests/t-reftable-stack.c | 2 | ||||
| -rw-r--r-- | t/unit-tests/t-trailer.c | 2 | ||||
| -rw-r--r-- | t/unit-tests/test-lib.c | 2 |
7 files changed, 13 insertions, 3 deletions
diff --git a/t/unit-tests/lib-reftable.c b/t/unit-tests/lib-reftable.c index d795dfb7c9..8a69612266 100644 --- a/t/unit-tests/lib-reftable.c +++ b/t/unit-tests/lib-reftable.c @@ -1,3 +1,5 @@ +#define DISABLE_SIGN_COMPARE_WARNINGS + #include "lib-reftable.h" #include "test-lib.h" #include "reftable/constants.h" diff --git a/t/unit-tests/t-example-decorate.c b/t/unit-tests/t-example-decorate.c index 8bf0709c41..bfc776e223 100644 --- a/t/unit-tests/t-example-decorate.c +++ b/t/unit-tests/t-example-decorate.c @@ -42,9 +42,9 @@ static void t_lookup(struct test_vars *vars) static void t_loop(struct test_vars *vars) { - int i, objects_noticed = 0; + int objects_noticed = 0; - for (i = 0; i < vars->n.size; i++) { + for (size_t i = 0; i < vars->n.size; i++) { if (vars->n.entries[i].base) objects_noticed++; } diff --git a/t/unit-tests/t-prio-queue.c b/t/unit-tests/t-prio-queue.c index fe6ae37935..a053635000 100644 --- a/t/unit-tests/t-prio-queue.c +++ b/t/unit-tests/t-prio-queue.c @@ -25,7 +25,7 @@ static void test_prio_queue(int *input, size_t input_size, struct prio_queue pq = { intcmp }; int j = 0; - for (int i = 0; i < input_size; i++) { + for (size_t i = 0; i < input_size; i++) { void *peek, *get; switch(input[i]) { case GET: diff --git a/t/unit-tests/t-reftable-readwrite.c b/t/unit-tests/t-reftable-readwrite.c index 8c4161f365..6b75a419b9 100644 --- a/t/unit-tests/t-reftable-readwrite.c +++ b/t/unit-tests/t-reftable-readwrite.c @@ -6,6 +6,8 @@ license that can be found in the LICENSE file or at https://developers.google.com/open-source/licenses/bsd */ +#define DISABLE_SIGN_COMPARE_WARNINGS + #include "test-lib.h" #include "lib-reftable.h" #include "reftable/basics.h" diff --git a/t/unit-tests/t-reftable-stack.c b/t/unit-tests/t-reftable-stack.c index e208e156f0..aeec195b2b 100644 --- a/t/unit-tests/t-reftable-stack.c +++ b/t/unit-tests/t-reftable-stack.c @@ -6,6 +6,8 @@ license that can be found in the LICENSE file or at https://developers.google.com/open-source/licenses/bsd */ +#define DISABLE_SIGN_COMPARE_WARNINGS + #include "test-lib.h" #include "lib-reftable.h" #include "dir.h" diff --git a/t/unit-tests/t-trailer.c b/t/unit-tests/t-trailer.c index e1c6ad7461..184593e73d 100644 --- a/t/unit-tests/t-trailer.c +++ b/t/unit-tests/t-trailer.c @@ -1,3 +1,5 @@ +#define DISABLE_SIGN_COMPARE_WARNINGS + #include "test-lib.h" #include "trailer.h" diff --git a/t/unit-tests/test-lib.c b/t/unit-tests/test-lib.c index fa1f95965c..87e1f5c201 100644 --- a/t/unit-tests/test-lib.c +++ b/t/unit-tests/test-lib.c @@ -1,3 +1,5 @@ +#define DISABLE_SIGN_COMPARE_WARNINGS + #include "test-lib.h" enum result { |
