xdiff: use unambiguous types in xdl_hash_record()

Convert the function signature and body to use unambiguous types. char
is changed to uint8_t because this function processes bytes in memory.
unsigned long to uint64_t so that the hash output is consistent across
platforms. `flags` was changed from long to uint64_t to ensure the
high order bits are not dropped on platforms that treat long as 32
bits.

Signed-off-by: Ezekiel Newren <ezekielnewren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Ezekiel Newren
2025-11-18 22:34:17 +00:00
committed by Junio C Hamano
parent 9bd193253c
commit b0d4ae30f5
4 changed files with 21 additions and 21 deletions

View File

@@ -300,7 +300,7 @@ void xdiff_clear_find_func(xdemitconf_t *xecfg)
unsigned long xdiff_hash_string(const char *s, size_t len, long flags)
{
return xdl_hash_record(&s, s + len, flags);
return xdl_hash_record((uint8_t const**)&s, (uint8_t const*)s + len, flags);
}
int xdiff_compare_lines(const char *l1, long s1,