@@ -1773,16 +1773,16 @@ void *read_object_with_reference(struct repository *r,
17731773}
17741774
17751775static void write_object_file_prepare (const struct git_hash_algo * algo ,
1776- const void * buf , unsigned long len ,
1776+ const void * buf , size_t len ,
17771777 const char * type , struct object_id * oid ,
1778- char * hdr , int * hdrlen )
1778+ char * hdr , size_t * hdrlen )
17791779{
17801780 git_hash_ctx c ;
17811781
17821782 /* Generate the header */
17831783 * hdrlen = xsnprintf (hdr , * hdrlen , "%s %" PRIuMAX , type , (uintmax_t )len )+ 1 ;
17841784
1785- /* Sha1.. */
1785+ /* Hash (function pointers) computation */
17861786 algo -> init_fn (& c );
17871787 algo -> update_fn (& c , hdr , * hdrlen );
17881788 algo -> update_fn (& c , buf , len );
@@ -1840,11 +1840,11 @@ static int write_buffer(int fd, const void *buf, size_t len)
18401840}
18411841
18421842int hash_object_file (const struct git_hash_algo * algo , const void * buf ,
1843- unsigned long len , const char * type ,
1843+ size_t len , const char * type ,
18441844 struct object_id * oid )
18451845{
18461846 char hdr [MAX_HEADER_LEN ];
1847- int hdrlen = sizeof (hdr );
1847+ size_t hdrlen = sizeof (hdr );
18481848 write_object_file_prepare (algo , buf , len , type , oid , hdr , & hdrlen );
18491849 return 0 ;
18501850}
@@ -2010,12 +2010,12 @@ static int freshen_packed_object(const struct object_id *oid)
20102010 return 1 ;
20112011}
20122012
2013- int write_object_file_flags (const void * buf , unsigned long len ,
2013+ int write_object_file_flags (const void * buf , size_t len ,
20142014 const char * type , struct object_id * oid ,
20152015 unsigned flags )
20162016{
20172017 char hdr [MAX_HEADER_LEN ];
2018- int hdrlen = sizeof (hdr );
2018+ size_t hdrlen = sizeof (hdr );
20192019
20202020 /* Normally if we have it in the pack then we do not bother writing
20212021 * it out into .git/objects/??/?{38} file.
@@ -2027,12 +2027,13 @@ int write_object_file_flags(const void *buf, unsigned long len,
20272027 return write_loose_object (oid , hdr , hdrlen , buf , len , 0 , flags );
20282028}
20292029
2030- int hash_object_file_literally (const void * buf , unsigned long len ,
2030+ int hash_object_file_literally (const void * buf , size_t len ,
20312031 const char * type , struct object_id * oid ,
20322032 unsigned flags )
20332033{
20342034 char * header ;
2035- int hdrlen , status = 0 ;
2035+ size_t hdrlen ;
2036+ int status = 0 ;
20362037
20372038 /* type string, SP, %lu of the length plus NUL must fit this */
20382039 hdrlen = strlen (type ) + MAX_HEADER_LEN ;
0 commit comments