diff options
| author | Arnav Bhate <bhatearnav@gmail.com> | 2025-03-29 11:33:14 +0530 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2025-03-29 01:04:40 -0700 |
| commit | d2fc29380acb5bba36cbc7a12907630a5308b6b1 (patch) | |
| tree | 05910ea66fa8e5182b2d08e4391bfcbcf5183a6d /t/unit-tests/u-urlmatch-normalization.c | |
| parent | 683c54c999c301c2cd6f715c411407c413b1d84e (diff) | |
rm: fix sign comparison warnings
There are multiple places in loops, where a signed and an
unsigned data type are compared. Git uses a mix of signed and unsigned
types to store lengths of arrays. This sometimes leads to using a signed
index for an array whose length is stored in an unsigned variable or
vice versa.
get_ours_cache_pos is a special case where i, though derived from a
signed variable is never negative. Move this part to the caller side
and make i an unsigned argument of the function. Rename i to
pos to make it descriptive, now that it is a function argument.
Replace signed data types with unsigned data types and vice versa
wherever necessary. Where both signed and unsigned data types have been
used, define a new variable in the scope of the for loop for use as the
iterator. Remove #define DISABLE_SIGN_COMPARE_WARNINGS.
Signed-off-by: Arnav Bhate <bhatearnav@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/unit-tests/u-urlmatch-normalization.c')
0 files changed, 0 insertions, 0 deletions
