@@ -1770,16 +1770,16 @@ void *read_object_with_reference(struct repository *r,
17701770}
17711771
17721772static void write_object_file_prepare (const struct git_hash_algo * algo ,
1773- const void * buf , unsigned long len ,
1773+ const void * buf , size_t len ,
17741774 const char * type , struct object_id * oid ,
1775- char * hdr , int * hdrlen )
1775+ char * hdr , size_t * hdrlen )
17761776{
17771777 git_hash_ctx c ;
17781778
17791779 /* Generate the header */
17801780 * hdrlen = xsnprintf (hdr , * hdrlen , "%s %" PRIuMAX , type , (uintmax_t )len )+ 1 ;
17811781
1782- /* Sha1.. */
1782+ /* Hash (function pointers) computation */
17831783 algo -> init_fn (& c );
17841784 algo -> update_fn (& c , hdr , * hdrlen );
17851785 algo -> update_fn (& c , buf , len );
@@ -1837,11 +1837,11 @@ static int write_buffer(int fd, const void *buf, size_t len)
18371837}
18381838
18391839int hash_object_file (const struct git_hash_algo * algo , const void * buf ,
1840- unsigned long len , const char * type ,
1840+ size_t len , const char * type ,
18411841 struct object_id * oid )
18421842{
18431843 char hdr [MAX_HEADER_LEN ];
1844- int hdrlen = sizeof (hdr );
1844+ size_t hdrlen = sizeof (hdr );
18451845 write_object_file_prepare (algo , buf , len , type , oid , hdr , & hdrlen );
18461846 return 0 ;
18471847}
@@ -1999,12 +1999,12 @@ static int freshen_packed_object(const struct object_id *oid)
19991999 return 1 ;
20002000}
20012001
2002- int write_object_file_flags (const void * buf , unsigned long len ,
2002+ int write_object_file_flags (const void * buf , size_t len ,
20032003 const char * type , struct object_id * oid ,
20042004 unsigned flags )
20052005{
20062006 char hdr [MAX_HEADER_LEN ];
2007- int hdrlen = sizeof (hdr );
2007+ size_t hdrlen = sizeof (hdr );
20082008
20092009 /* Normally if we have it in the pack then we do not bother writing
20102010 * it out into .git/objects/??/?{38} file.
@@ -2016,12 +2016,13 @@ int write_object_file_flags(const void *buf, unsigned long len,
20162016 return write_loose_object (oid , hdr , hdrlen , buf , len , 0 , flags );
20172017}
20182018
2019- int hash_object_file_literally (const void * buf , unsigned long len ,
2019+ int hash_object_file_literally (const void * buf , size_t len ,
20202020 const char * type , struct object_id * oid ,
20212021 unsigned flags )
20222022{
20232023 char * header ;
2024- int hdrlen , status = 0 ;
2024+ size_t hdrlen ;
2025+ int status = 0 ;
20252026
20262027 /* type string, SP, %lu of the length plus NUL must fit this */
20272028 hdrlen = strlen (type ) + MAX_HEADER_LEN ;
0 commit comments