@@ -561,9 +561,9 @@ int odb_source_loose_read_object_info(struct odb_source *source,
561561}
562562
563563static void hash_object_body (const struct git_hash_algo * algo , struct git_hash_ctx * c ,
564- const void * buf , unsigned long len ,
564+ const void * buf , size_t len ,
565565 struct object_id * oid ,
566- char * hdr , int * hdrlen )
566+ char * hdr , size_t * hdrlen )
567567{
568568 algo -> init_fn (c );
569569 git_hash_update (c , hdr , * hdrlen );
@@ -572,16 +572,16 @@ static void hash_object_body(const struct git_hash_algo *algo, struct git_hash_c
572572}
573573
574574static void write_object_file_prepare (const struct git_hash_algo * algo ,
575- const void * buf , unsigned long len ,
575+ const void * buf , size_t len ,
576576 enum object_type type , struct object_id * oid ,
577- char * hdr , int * hdrlen )
577+ char * hdr , size_t * hdrlen )
578578{
579579 struct git_hash_ctx c ;
580580
581581 /* Generate the header */
582582 * hdrlen = format_object_header (hdr , * hdrlen , type , len );
583583
584- /* Sha1.. */
584+ /* Hash (function pointers) computation */
585585 hash_object_body (algo , & c , buf , len , oid , hdr , hdrlen );
586586}
587587
@@ -717,11 +717,11 @@ int finalize_object_file_flags(struct repository *repo,
717717}
718718
719719void hash_object_file (const struct git_hash_algo * algo , const void * buf ,
720- unsigned long len , enum object_type type ,
720+ size_t len , enum object_type type ,
721721 struct object_id * oid )
722722{
723723 char hdr [MAX_HEADER_LEN ];
724- int hdrlen = sizeof (hdr );
724+ size_t hdrlen = sizeof (hdr );
725725
726726 write_object_file_prepare (algo , buf , len , type , oid , hdr , & hdrlen );
727727}
@@ -1177,7 +1177,7 @@ int odb_source_loose_write_stream(struct odb_source *source,
11771177}
11781178
11791179int odb_source_loose_write_object (struct odb_source * source ,
1180- const void * buf , unsigned long len ,
1180+ const void * buf , size_t len ,
11811181 enum object_type type , struct object_id * oid ,
11821182 struct object_id * compat_oid_in ,
11831183 enum odb_write_object_flags flags )
@@ -1186,7 +1186,7 @@ int odb_source_loose_write_object(struct odb_source *source,
11861186 const struct git_hash_algo * compat = source -> odb -> repo -> compat_hash_algo ;
11871187 struct object_id compat_oid ;
11881188 char hdr [MAX_HEADER_LEN ];
1189- int hdrlen = sizeof (hdr );
1189+ size_t hdrlen = sizeof (hdr );
11901190
11911191 /* Generate compat_oid */
11921192 if (compat ) {
0 commit comments