@@ -316,9 +316,9 @@ int parse_loose_header(const char *hdr, struct object_info *oi)
316316}
317317
318318static void hash_object_body (const struct git_hash_algo * algo , struct git_hash_ctx * c ,
319- const void * buf , unsigned long len ,
319+ const void * buf , size_t len ,
320320 struct object_id * oid ,
321- char * hdr , int * hdrlen )
321+ char * hdr , size_t * hdrlen )
322322{
323323 algo -> init_fn (c );
324324 git_hash_update (c , hdr , * hdrlen );
@@ -327,16 +327,16 @@ static void hash_object_body(const struct git_hash_algo *algo, struct git_hash_c
327327}
328328
329329void write_object_file_prepare (const struct git_hash_algo * algo ,
330- const void * buf , unsigned long len ,
330+ const void * buf , size_t len ,
331331 enum object_type type , struct object_id * oid ,
332- char * hdr , int * hdrlen )
332+ char * hdr , size_t * hdrlen )
333333{
334334 struct git_hash_ctx c ;
335335
336336 /* Generate the header */
337337 * hdrlen = format_object_header (hdr , * hdrlen , type , len );
338338
339- /* Sha1.. */
339+ /* Hash (function pointers) computation */
340340 hash_object_body (algo , & c , buf , len , oid , hdr , hdrlen );
341341}
342342
@@ -472,11 +472,11 @@ int finalize_object_file_flags(struct repository *repo,
472472}
473473
474474void hash_object_file (const struct git_hash_algo * algo , const void * buf ,
475- unsigned long len , enum object_type type ,
475+ size_t len , enum object_type type ,
476476 struct object_id * oid )
477477{
478478 char hdr [MAX_HEADER_LEN ];
479- int hdrlen = sizeof (hdr );
479+ size_t hdrlen = sizeof (hdr );
480480
481481 write_object_file_prepare (algo , buf , len , type , oid , hdr , & hdrlen );
482482}
0 commit comments