aboutsummaryrefslogtreecommitdiff
path: root/compat/fsmonitor
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2024-12-06 11:27:24 +0100
committerJunio C Hamano <gitster@pobox.com>2024-12-06 20:20:04 +0900
commit80c9e70ebe871f0826bc101142c66ff783405100 (patch)
treec95f04cef2dc0abb2d1fe8e4470e9e385e637b12 /compat/fsmonitor
parent25435e4ad87aa484ce0d9d2adf3aa407f0241704 (diff)
downloadgit-80c9e70ebe871f0826bc101142c66ff783405100.tar.xz
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 'compat/fsmonitor')
-rw-r--r--compat/fsmonitor/fsm-listen-darwin.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/compat/fsmonitor/fsm-listen-darwin.c b/compat/fsmonitor/fsm-listen-darwin.c
index 58f3878a22..43c3a915a0 100644
--- a/compat/fsmonitor/fsm-listen-darwin.c
+++ b/compat/fsmonitor/fsm-listen-darwin.c
@@ -23,8 +23,6 @@
#endif
#endif
-#define DISABLE_SIGN_COMPARE_WARNINGS
-
#include "git-compat-util.h"
#include "fsmonitor-ll.h"
#include "fsm-listen.h"
@@ -210,13 +208,12 @@ static void fsevent_callback(ConstFSEventStreamRef streamRef UNUSED,
const char *slash;
char *resolved = NULL;
struct strbuf tmp = STRBUF_INIT;
- int k;
/*
* Build a list of all filesystem changes into a private/local
* list and without holding any locks.
*/
- for (k = 0; k < num_of_events; k++) {
+ for (size_t k = 0; k < num_of_events; k++) {
/*
* On Mac, we receive an array of absolute paths.
*/