diff options
| author | Patrick Steinhardt <ps@pks.im> | 2024-12-06 11:27:24 +0100 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2024-12-06 20:20:04 +0900 |
| commit | 80c9e70ebe871f0826bc101142c66ff783405100 (patch) | |
| tree | c95f04cef2dc0abb2d1fe8e4470e9e385e637b12 /builtin/help.c | |
| parent | pkt-line: fix -Wsign-compare warning on 32 bit platform (diff) | |
| download | git-80c9e70ebe871f0826bc101142c66ff783405100.tar.gz git-80c9e70ebe871f0826bc101142c66ff783405100.zip | |
global: trivial conversions to fix `-Wsign-compare` warnings
We have a bunch of loops which iterate up to an unsigned boundary using
a signed index, which generates warnigs because we compare a signed and
unsigned value in the loop condition. Address these sites for trivial
cases and enable `-Wsign-compare` warnings for these code units.
This patch only adapts those code units where we can drop the
`DISABLE_SIGN_COMPARE_WARNINGS` macro in the same step.
Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/help.c')
| -rw-r--r-- | builtin/help.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/builtin/help.c b/builtin/help.c index aa6bd6e412..05136279cf 100644 --- a/builtin/help.c +++ b/builtin/help.c @@ -3,7 +3,6 @@ */ #define USE_THE_REPOSITORY_VARIABLE -#define DISABLE_SIGN_COMPARE_WARNINGS #include "builtin.h" #include "config.h" @@ -131,7 +130,6 @@ static void list_config_help(enum show_config_type type) struct string_list keys = STRING_LIST_INIT_DUP; struct string_list keys_uniq = STRING_LIST_INIT_DUP; struct string_list_item *item; - int i; for (p = config_name_list; *p; p++) { const char *var = *p; @@ -158,7 +156,7 @@ static void list_config_help(enum show_config_type type) e->prefix, e->placeholder); string_list_sort(&keys); - for (i = 0; i < keys.nr; i++) { + for (size_t i = 0; i < keys.nr; i++) { const char *var = keys.items[i].string; const char *wildcard, *tag, *cut; const char *dot = NULL; |
