Skip to content

Commit 4156b6a

Browse files
committed
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
2 parents f7c607f + e03d2a9 commit 4156b6a

File tree

266 files changed

+524
-235
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

266 files changed

+524
-235
lines changed

add-interactive.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#define USE_THE_REPOSITORY_VARIABLE
2+
#define DISABLE_SIGN_COMPARE_WARNINGS
23

34
#include "git-compat-util.h"
45
#include "add-interactive.h"

add-patch.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#define USE_THE_REPOSITORY_VARIABLE
2+
#define DISABLE_SIGN_COMPARE_WARNINGS
23

34
#include "git-compat-util.h"
45
#include "add-interactive.h"

advice.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,6 @@ void advise_if_enabled(enum advice_type type, const char *advice, ...)
161161
int git_default_advice_config(const char *var, const char *value)
162162
{
163163
const char *k, *slot_name;
164-
int i;
165164

166165
if (!strcmp(var, "color.advice")) {
167166
advice_use_color = git_config_colorbool(var, value);
@@ -180,7 +179,7 @@ int git_default_advice_config(const char *var, const char *value)
180179
if (!skip_prefix(var, "advice.", &k))
181180
return 0;
182181

183-
for (i = 0; i < ARRAY_SIZE(advice_setting); i++) {
182+
for (size_t i = 0; i < ARRAY_SIZE(advice_setting); i++) {
184183
if (strcasecmp(k, advice_setting[i].key))
185184
continue;
186185
advice_setting[i].level = git_config_bool(var, value)
@@ -194,9 +193,7 @@ int git_default_advice_config(const char *var, const char *value)
194193

195194
void list_config_advices(struct string_list *list, const char *prefix)
196195
{
197-
int i;
198-
199-
for (i = 0; i < ARRAY_SIZE(advice_setting); i++)
196+
for (size_t i = 0; i < ARRAY_SIZE(advice_setting); i++)
200197
list_config_item(list, prefix, advice_setting[i].key);
201198
}
202199

apply.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
*/
99

1010
#define USE_THE_REPOSITORY_VARIABLE
11+
#define DISABLE_SIGN_COMPARE_WARNINGS
1112

1213
#include "git-compat-util.h"
1314
#include "abspath.h"

archive.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#define USE_THE_REPOSITORY_VARIABLE
2+
#define DISABLE_SIGN_COMPARE_WARNINGS
23

34
#include "git-compat-util.h"
45
#include "abspath.h"

attr.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
*/
88

99
#define USE_THE_REPOSITORY_VARIABLE
10+
#define DISABLE_SIGN_COMPARE_WARNINGS
1011

1112
#include "git-compat-util.h"
1213
#include "config.h"

base85.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,9 @@ static const char en85[] = {
2929
static char de85[256];
3030
static void prep_base85(void)
3131
{
32-
int i;
3332
if (de85['Z'])
3433
return;
35-
for (i = 0; i < ARRAY_SIZE(en85); i++) {
34+
for (size_t i = 0; i < ARRAY_SIZE(en85); i++) {
3635
int ch = en85[i];
3736
de85[ch] = i + 1;
3837
}

bisect.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#define USE_THE_REPOSITORY_VARIABLE
2+
#define DISABLE_SIGN_COMPARE_WARNINGS
23

34
#include "git-compat-util.h"
45
#include "config.h"

blame.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#define USE_THE_REPOSITORY_VARIABLE
2+
#define DISABLE_SIGN_COMPARE_WARNINGS
23

34
#include "git-compat-util.h"
45
#include "refs.h"

bloom.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#define DISABLE_SIGN_COMPARE_WARNINGS
2+
13
#include "git-compat-util.h"
24
#include "bloom.h"
35
#include "diff.h"

0 commit comments

Comments
 (0)