summaryrefslogtreecommitdiffstats
path: root/refs
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2024-12-23 18:32:10 +0100
committerJunio C Hamano <gitster@pobox.com>2024-12-23 18:32:11 +0100
commit4156b6a741c7fb15a4eccb320612fb6e453f439c (patch)
tree203f68166cc5f2337fd80f6628c3b344d2dd3abf /refs
parentMerge branch 'kn/reftable-writer-log-write-verify' (diff)
parentt/helper: don't depend on implicit wraparound (diff)
downloadgit-4156b6a741c7fb15a4eccb320612fb6e453f439c.tar.xz
git-4156b6a741c7fb15a4eccb320612fb6e453f439c.zip
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 'refs')
-rw-r--r--refs/debug.c3
-rw-r--r--refs/files-backend.c1
-rw-r--r--refs/iterator.c2
-rw-r--r--refs/packed-backend.c1
4 files changed, 5 insertions, 2 deletions
diff --git a/refs/debug.c b/refs/debug.c
index a893ae0c90..fbc4df08b4 100644
--- a/refs/debug.c
+++ b/refs/debug.c
@@ -83,9 +83,8 @@ static void print_update(int i, const char *refname,
static void print_transaction(struct ref_transaction *transaction)
{
- int i;
trace_printf_key(&trace_refs, "transaction {\n");
- for (i = 0; i < transaction->nr; i++) {
+ for (size_t i = 0; i < transaction->nr; i++) {
struct ref_update *u = transaction->updates[i];
print_update(i, u->refname, &u->old_oid, &u->new_oid, u->flags,
u->type, u->msg);
diff --git a/refs/files-backend.c b/refs/files-backend.c
index 4e3545de49..467fe347fa 100644
--- a/refs/files-backend.c
+++ b/refs/files-backend.c
@@ -1,4 +1,5 @@
#define USE_THE_REPOSITORY_VARIABLE
+#define DISABLE_SIGN_COMPARE_WARNINGS
#include "../git-compat-util.h"
#include "../abspath.h"
diff --git a/refs/iterator.c b/refs/iterator.c
index 8e999d81fc..d25e568bf0 100644
--- a/refs/iterator.c
+++ b/refs/iterator.c
@@ -3,6 +3,8 @@
* documentation about the design and use of reference iterators.
*/
+#define DISABLE_SIGN_COMPARE_WARNINGS
+
#include "git-compat-util.h"
#include "refs.h"
#include "refs/refs-internal.h"
diff --git a/refs/packed-backend.c b/refs/packed-backend.c
index 3406f1e71d..a7b6f74b6e 100644
--- a/refs/packed-backend.c
+++ b/refs/packed-backend.c
@@ -1,4 +1,5 @@
#define USE_THE_REPOSITORY_VARIABLE
+#define DISABLE_SIGN_COMPARE_WARNINGS
#include "../git-compat-util.h"
#include "../config.h"