@@ -507,9 +507,9 @@ int odb_source_loose_read_object_info(struct odb_source *source,
507507}
508508
509509static void hash_object_body (const struct git_hash_algo * algo , struct git_hash_ctx * c ,
510- const void * buf , unsigned long len ,
510+ const void * buf , size_t len ,
511511 struct object_id * oid ,
512- char * hdr , int * hdrlen )
512+ char * hdr , size_t * hdrlen )
513513{
514514 algo -> init_fn (c );
515515 git_hash_update (c , hdr , * hdrlen );
@@ -518,16 +518,16 @@ static void hash_object_body(const struct git_hash_algo *algo, struct git_hash_c
518518}
519519
520520static void write_object_file_prepare (const struct git_hash_algo * algo ,
521- const void * buf , unsigned long len ,
521+ const void * buf , size_t len ,
522522 enum object_type type , struct object_id * oid ,
523- char * hdr , int * hdrlen )
523+ char * hdr , size_t * hdrlen )
524524{
525525 struct git_hash_ctx c ;
526526
527527 /* Generate the header */
528528 * hdrlen = format_object_header (hdr , * hdrlen , type , len );
529529
530- /* Sha1.. */
530+ /* Hash (function pointers) computation */
531531 hash_object_body (algo , & c , buf , len , oid , hdr , hdrlen );
532532}
533533
@@ -663,11 +663,11 @@ int finalize_object_file_flags(struct repository *repo,
663663}
664664
665665void hash_object_file (const struct git_hash_algo * algo , const void * buf ,
666- unsigned long len , enum object_type type ,
666+ size_t len , enum object_type type ,
667667 struct object_id * oid )
668668{
669669 char hdr [MAX_HEADER_LEN ];
670- int hdrlen = sizeof (hdr );
670+ size_t hdrlen = sizeof (hdr );
671671
672672 write_object_file_prepare (algo , buf , len , type , oid , hdr , & hdrlen );
673673}
@@ -1108,15 +1108,15 @@ int odb_source_loose_write_stream(struct odb_source *source,
11081108}
11091109
11101110int odb_source_loose_write_object (struct odb_source * source ,
1111- const void * buf , unsigned long len ,
1111+ const void * buf , size_t len ,
11121112 enum object_type type , struct object_id * oid ,
11131113 struct object_id * compat_oid_in , unsigned flags )
11141114{
11151115 const struct git_hash_algo * algo = source -> odb -> repo -> hash_algo ;
11161116 const struct git_hash_algo * compat = source -> odb -> repo -> compat_hash_algo ;
11171117 struct object_id compat_oid ;
11181118 char hdr [MAX_HEADER_LEN ];
1119- int hdrlen = sizeof (hdr );
1119+ size_t hdrlen = sizeof (hdr );
11201120
11211121 /* Generate compat_oid */
11221122 if (compat ) {
0 commit comments