@@ -484,9 +484,9 @@ int odb_source_loose_read_object_info(struct odb_source *source,
484484}
485485
486486static void hash_object_body (const struct git_hash_algo * algo , struct git_hash_ctx * c ,
487- const void * buf , unsigned long len ,
487+ const void * buf , size_t len ,
488488 struct object_id * oid ,
489- char * hdr , int * hdrlen )
489+ char * hdr , size_t * hdrlen )
490490{
491491 algo -> init_fn (c );
492492 git_hash_update (c , hdr , * hdrlen );
@@ -495,16 +495,16 @@ static void hash_object_body(const struct git_hash_algo *algo, struct git_hash_c
495495}
496496
497497static void write_object_file_prepare (const struct git_hash_algo * algo ,
498- const void * buf , unsigned long len ,
498+ const void * buf , size_t len ,
499499 enum object_type type , struct object_id * oid ,
500- char * hdr , int * hdrlen )
500+ char * hdr , size_t * hdrlen )
501501{
502502 struct git_hash_ctx c ;
503503
504504 /* Generate the header */
505505 * hdrlen = format_object_header (hdr , * hdrlen , type , len );
506506
507- /* Sha1.. */
507+ /* Hash (function pointers) computation */
508508 hash_object_body (algo , & c , buf , len , oid , hdr , hdrlen );
509509}
510510
@@ -640,11 +640,11 @@ int finalize_object_file_flags(struct repository *repo,
640640}
641641
642642void hash_object_file (const struct git_hash_algo * algo , const void * buf ,
643- unsigned long len , enum object_type type ,
643+ size_t len , enum object_type type ,
644644 struct object_id * oid )
645645{
646646 char hdr [MAX_HEADER_LEN ];
647- int hdrlen = sizeof (hdr );
647+ size_t hdrlen = sizeof (hdr );
648648
649649 write_object_file_prepare (algo , buf , len , type , oid , hdr , & hdrlen );
650650}
@@ -1085,15 +1085,15 @@ int odb_source_loose_write_stream(struct odb_source *source,
10851085}
10861086
10871087int odb_source_loose_write_object (struct odb_source * source ,
1088- const void * buf , unsigned long len ,
1088+ const void * buf , size_t len ,
10891089 enum object_type type , struct object_id * oid ,
10901090 struct object_id * compat_oid_in , unsigned flags )
10911091{
10921092 const struct git_hash_algo * algo = source -> odb -> repo -> hash_algo ;
10931093 const struct git_hash_algo * compat = source -> odb -> repo -> compat_hash_algo ;
10941094 struct object_id compat_oid ;
10951095 char hdr [MAX_HEADER_LEN ];
1096- int hdrlen = sizeof (hdr );
1096+ size_t hdrlen = sizeof (hdr );
10971097
10981098 /* Generate compat_oid */
10991099 if (compat ) {
0 commit comments