@@ -509,9 +509,9 @@ int odb_source_loose_read_object_info(struct odb_source *source,
509509}
510510
511511static void hash_object_body (const struct git_hash_algo * algo , struct git_hash_ctx * c ,
512- const void * buf , unsigned long len ,
512+ const void * buf , size_t len ,
513513 struct object_id * oid ,
514- char * hdr , int * hdrlen )
514+ char * hdr , size_t * hdrlen )
515515{
516516 algo -> init_fn (c );
517517 git_hash_update (c , hdr , * hdrlen );
@@ -520,16 +520,16 @@ static void hash_object_body(const struct git_hash_algo *algo, struct git_hash_c
520520}
521521
522522static void write_object_file_prepare (const struct git_hash_algo * algo ,
523- const void * buf , unsigned long len ,
523+ const void * buf , size_t len ,
524524 enum object_type type , struct object_id * oid ,
525- char * hdr , int * hdrlen )
525+ char * hdr , size_t * hdrlen )
526526{
527527 struct git_hash_ctx c ;
528528
529529 /* Generate the header */
530530 * hdrlen = format_object_header (hdr , * hdrlen , type , len );
531531
532- /* Sha1.. */
532+ /* Hash (function pointers) computation */
533533 hash_object_body (algo , & c , buf , len , oid , hdr , hdrlen );
534534}
535535
@@ -665,11 +665,11 @@ int finalize_object_file_flags(struct repository *repo,
665665}
666666
667667void hash_object_file (const struct git_hash_algo * algo , const void * buf ,
668- unsigned long len , enum object_type type ,
668+ size_t len , enum object_type type ,
669669 struct object_id * oid )
670670{
671671 char hdr [MAX_HEADER_LEN ];
672- int hdrlen = sizeof (hdr );
672+ size_t hdrlen = sizeof (hdr );
673673
674674 write_object_file_prepare (algo , buf , len , type , oid , hdr , & hdrlen );
675675}
@@ -1110,15 +1110,15 @@ int odb_source_loose_write_stream(struct odb_source *source,
11101110}
11111111
11121112int odb_source_loose_write_object (struct odb_source * source ,
1113- const void * buf , unsigned long len ,
1113+ const void * buf , size_t len ,
11141114 enum object_type type , struct object_id * oid ,
11151115 struct object_id * compat_oid_in , unsigned flags )
11161116{
11171117 const struct git_hash_algo * algo = source -> odb -> repo -> hash_algo ;
11181118 const struct git_hash_algo * compat = source -> odb -> repo -> compat_hash_algo ;
11191119 struct object_id compat_oid ;
11201120 char hdr [MAX_HEADER_LEN ];
1121- int hdrlen = sizeof (hdr );
1121+ size_t hdrlen = sizeof (hdr );
11221122
11231123 /* Generate compat_oid */
11241124 if (compat ) {
0 commit comments