diff options
author | Junio C Hamano <gitster@pobox.com> | 2024-12-06 11:27:22 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2024-12-06 12:20:03 +0100 |
commit | ba8f6018b5bed4fc58f8dfe2f9714d22398b06fe (patch) | |
tree | 48cabeaead2941a34ff3ca022fa38e8d98a04504 /pkt-line.c | |
parent | diff.h: fix index used to loop through unsigned integer (diff) | |
download | git-ba8f6018b5bed4fc58f8dfe2f9714d22398b06fe.tar.xz git-ba8f6018b5bed4fc58f8dfe2f9714d22398b06fe.zip |
csum-file: fix -Wsign-compare warning on 32-bit platform
On 32-bit platforms, ssize_t may be "int" while size_t may be
"unsigned int". At times we compare the number of bytes we read
stored in a ssize_t variable with "unsigned int", but that is done
after we check that we did not get an error return (which is
negative---and that is the whole reason why we used ssize_t and not
size_t), so these comparisons are safe.
But compilers may not realize that. Cast these to size_t to work
around the false positives. On platforms with size_t/ssize_t wider
than a normal int, this won't be an issue.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'pkt-line.c')
0 files changed, 0 insertions, 0 deletions