]> git.ipfire.org Git - thirdparty/git.git/commit
string-list: change "string_list_find_insert_index" return type to "size_t"
authorshejialuo <shejialuo@gmail.com>
Mon, 6 Oct 2025 06:32:40 +0000 (14:32 +0800)
committerJunio C Hamano <gitster@pobox.com>
Mon, 6 Oct 2025 16:11:07 +0000 (09:11 -0700)
commit51c3385e3736aeb5f78cc9ed193779e2cb4a2a29
tree7fa12176e859434789d45fc3f4bee59e1b8ad8a8
parente8a32e766fe3f5e40fb8918a4d825e6d0b9aa272
string-list: change "string_list_find_insert_index" return type to "size_t"

As "string_list_find_insert_index" is a simple wrapper of
"get_entry_index" and the return type of "get_entry_index" is already
"size_t", we could simply change its return type to "size_t".

Update all callers to use size_t variables for storing the return value.
The tricky fix is the loop condition in "mailmap.c" to properly handle
"size_t" underflow by changing from `0 <= --i` to `i--`.

Remove "DISABLE_SIGN_COMPARE_WARNINGS" from "mailmap.c" as it's no
longer needed with the proper unsigned types.

Signed-off-by: shejialuo <shejialuo@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
add-interactive.c
mailmap.c
refs.c
string-list.c
string-list.h