@@ -502,9 +502,9 @@ int loose_object_info(struct repository *r,
502502}
503503
504504static void hash_object_body (const struct git_hash_algo * algo , struct git_hash_ctx * c ,
505- const void * buf , unsigned long len ,
505+ const void * buf , size_t len ,
506506 struct object_id * oid ,
507- char * hdr , int * hdrlen )
507+ char * hdr , size_t * hdrlen )
508508{
509509 algo -> init_fn (c );
510510 git_hash_update (c , hdr , * hdrlen );
@@ -513,16 +513,16 @@ static void hash_object_body(const struct git_hash_algo *algo, struct git_hash_c
513513}
514514
515515static void write_object_file_prepare (const struct git_hash_algo * algo ,
516- const void * buf , unsigned long len ,
516+ const void * buf , size_t len ,
517517 enum object_type type , struct object_id * oid ,
518- char * hdr , int * hdrlen )
518+ char * hdr , size_t * hdrlen )
519519{
520520 struct git_hash_ctx c ;
521521
522522 /* Generate the header */
523523 * hdrlen = format_object_header (hdr , * hdrlen , type , len );
524524
525- /* Sha1.. */
525+ /* Hash (function pointers) computation */
526526 hash_object_body (algo , & c , buf , len , oid , hdr , hdrlen );
527527}
528528
@@ -658,11 +658,11 @@ int finalize_object_file_flags(struct repository *repo,
658658}
659659
660660void hash_object_file (const struct git_hash_algo * algo , const void * buf ,
661- unsigned long len , enum object_type type ,
661+ size_t len , enum object_type type ,
662662 struct object_id * oid )
663663{
664664 char hdr [MAX_HEADER_LEN ];
665- int hdrlen = sizeof (hdr );
665+ size_t hdrlen = sizeof (hdr );
666666
667667 write_object_file_prepare (algo , buf , len , type , oid , hdr , & hdrlen );
668668}
@@ -1125,15 +1125,15 @@ int stream_loose_object(struct odb_source *source,
11251125}
11261126
11271127int write_object_file (struct odb_source * source ,
1128- const void * buf , unsigned long len ,
1128+ const void * buf , size_t len ,
11291129 enum object_type type , struct object_id * oid ,
11301130 struct object_id * compat_oid_in , unsigned flags )
11311131{
11321132 const struct git_hash_algo * algo = source -> odb -> repo -> hash_algo ;
11331133 const struct git_hash_algo * compat = source -> odb -> repo -> compat_hash_algo ;
11341134 struct object_id compat_oid ;
11351135 char hdr [MAX_HEADER_LEN ];
1136- int hdrlen = sizeof (hdr );
1136+ size_t hdrlen = sizeof (hdr );
11371137
11381138 /* Generate compat_oid */
11391139 if (compat ) {
0 commit comments