summaryrefslogtreecommitdiff
path: root/builtin/commit.c
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2025-07-23 16:08:42 +0200
committerJunio C Hamano <gitster@pobox.com>2025-07-23 08:15:22 -0700
commitb06408b817c70204542924db0c689f258f010f7e (patch)
treef68cd23bc682bacd330e35b15c9d55fd0e876586 /builtin/commit.c
parent08b775864edf96b97500fd70446c55528f5cf4a6 (diff)
config: fix sign comparison warnings
There are a couple of -Wsign-compare warnings in "config.c": - `prepare_include_condition_pattern()` is returns a signed integer, where it either returns a negative error code or the index of the last dir separator in a path. That index will always be a non-negative number, but we cannot just change the return type to a `size_t` due to it being re-used as error code. This is fixed by splitting up concerns: the return value is only used as error code, and the prefix is now returned via an out-pointer. This fixes a sign comparison warning when comparing `text.len < prefix`, - We treat `struct config_store_data::seen` as signed integer in several places even though it's unsigned. - There are multiple trivial sign comparison warnings where we use a signed loop index to iterate through an unsigned number of items. Fix all of these issues and drop the `DISABLE_SIGN_COMPARE_WARNINGS` macro. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/commit.c')
0 files changed, 0 insertions, 0 deletions