aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbrian m. carlson <sandals@crustytoothpaste.net>2026-02-07 20:04:38 +0000
committerJunio C Hamano <gitster@pobox.com>2026-02-07 17:41:02 -0800
commit0a0f6b97e9bd41c1ed6b386b99a52e62ea72e4a6 (patch)
treeafc1d1e7b6eb3ee4dd8f205dfb809b0e2cd9956f
parent86215ab0cc632026a95aa955ebe94c8f33ff2be6 (diff)
downloadgit-0a0f6b97e9bd41c1ed6b386b99a52e62ea72e4a6.tar.xz
csum-file: define hashwrite's count as a uint32_t
We want to call this code from Rust and ensure that the types are the same for compatibility, which is easiest to do if the type is a fixed size. Since unsigned int is 32 bits on all the platforms we care about, define it as a uint32_t instead. Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r--csum-file.c2
-rw-r--r--csum-file.h2
2 files changed, 2 insertions, 2 deletions
diff --git a/csum-file.c b/csum-file.c
index 6e21e3cac8..3d3047c776 100644
--- a/csum-file.c
+++ b/csum-file.c
@@ -110,7 +110,7 @@ void discard_hashfile(struct hashfile *f)
free_hashfile(f);
}
-void hashwrite(struct hashfile *f, const void *buf, unsigned int count)
+void hashwrite(struct hashfile *f, const void *buf, uint32_t count)
{
while (count) {
unsigned left = f->buffer_len - f->offset;
diff --git a/csum-file.h b/csum-file.h
index 07ae11024a..ecce9d27b0 100644
--- a/csum-file.h
+++ b/csum-file.h
@@ -63,7 +63,7 @@ void free_hashfile(struct hashfile *f);
*/
int finalize_hashfile(struct hashfile *, unsigned char *, enum fsync_component, unsigned int);
void discard_hashfile(struct hashfile *);
-void hashwrite(struct hashfile *, const void *, unsigned int);
+void hashwrite(struct hashfile *, const void *, uint32_t);
void hashflush(struct hashfile *f);
void crc32_begin(struct hashfile *);
uint32_t crc32_end(struct hashfile *);