]> git.ipfire.org Git - thirdparty/git.git/commitdiff
csum-file: define hashwrite's count as a uint32_t
authorbrian m. carlson <sandals@crustytoothpaste.net>
Mon, 17 Nov 2025 22:16:14 +0000 (22:16 +0000)
committerJunio C Hamano <gitster@pobox.com>
Mon, 17 Nov 2025 22:24:15 +0000 (14:24 -0800)
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>
csum-file.c
csum-file.h

index 6e21e3cac8a636c016be59f6426b27d1dc66accc..3d3047c776724babf0b3812b6985875caa56481a 100644 (file)
@@ -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;
index 07ae11024afc3459bd89827a37889c41d13cf162..ecce9d27b0d248e44c3f9cec2c64476a6791ba8c 100644 (file)
@@ -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 *);