@@ -1786,9 +1786,9 @@ void *read_object_with_reference(struct repository *r,
17861786}
17871787
17881788static void hash_object_body (const struct git_hash_algo * algo , git_hash_ctx * c ,
1789- const void * buf , unsigned long len ,
1789+ const void * buf , size_t len ,
17901790 struct object_id * oid ,
1791- char * hdr , int * hdrlen )
1791+ char * hdr , size_t * hdrlen )
17921792{
17931793 algo -> init_fn (c );
17941794 algo -> update_fn (c , hdr , * hdrlen );
@@ -1797,23 +1797,23 @@ static void hash_object_body(const struct git_hash_algo *algo, git_hash_ctx *c,
17971797}
17981798
17991799static void write_object_file_prepare (const struct git_hash_algo * algo ,
1800- const void * buf , unsigned long len ,
1800+ const void * buf , size_t len ,
18011801 enum object_type type , struct object_id * oid ,
1802- char * hdr , int * hdrlen )
1802+ char * hdr , size_t * hdrlen )
18031803{
18041804 git_hash_ctx c ;
18051805
18061806 /* Generate the header */
18071807 * hdrlen = format_object_header (hdr , * hdrlen , type , len );
18081808
1809- /* Sha1.. */
1809+ /* Hash (function pointers) computation */
18101810 hash_object_body (algo , & c , buf , len , oid , hdr , hdrlen );
18111811}
18121812
18131813static void write_object_file_prepare_literally (const struct git_hash_algo * algo ,
1814- const void * buf , unsigned long len ,
1814+ const void * buf , size_t len ,
18151815 const char * type , struct object_id * oid ,
1816- char * hdr , int * hdrlen )
1816+ char * hdr , size_t * hdrlen )
18171817{
18181818 git_hash_ctx c ;
18191819
@@ -1872,17 +1872,17 @@ static int write_buffer(int fd, const void *buf, size_t len)
18721872}
18731873
18741874static void hash_object_file_literally (const struct git_hash_algo * algo ,
1875- const void * buf , unsigned long len ,
1875+ const void * buf , size_t len ,
18761876 const char * type , struct object_id * oid )
18771877{
18781878 char hdr [MAX_HEADER_LEN ];
1879- int hdrlen = sizeof (hdr );
1879+ size_t hdrlen = sizeof (hdr );
18801880
18811881 write_object_file_prepare_literally (algo , buf , len , type , oid , hdr , & hdrlen );
18821882}
18831883
18841884void hash_object_file (const struct git_hash_algo * algo , const void * buf ,
1885- unsigned long len , enum object_type type ,
1885+ size_t len , enum object_type type ,
18861886 struct object_id * oid )
18871887{
18881888 hash_object_file_literally (algo , buf , len , type_name (type ), oid );
@@ -2224,12 +2224,12 @@ int stream_loose_object(struct input_stream *in_stream, size_t len,
22242224 return err ;
22252225}
22262226
2227- int write_object_file_flags (const void * buf , unsigned long len ,
2227+ int write_object_file_flags (const void * buf , size_t len ,
22282228 enum object_type type , struct object_id * oid ,
22292229 unsigned flags )
22302230{
22312231 char hdr [MAX_HEADER_LEN ];
2232- int hdrlen = sizeof (hdr );
2232+ size_t hdrlen = sizeof (hdr );
22332233
22342234 /* Normally if we have it in the pack then we do not bother writing
22352235 * it out into .git/objects/??/?{38} file.
@@ -2241,12 +2241,13 @@ int write_object_file_flags(const void *buf, unsigned long len,
22412241 return write_loose_object (oid , hdr , hdrlen , buf , len , 0 , flags );
22422242}
22432243
2244- int write_object_file_literally (const void * buf , unsigned long len ,
2244+ int write_object_file_literally (const void * buf , size_t len ,
22452245 const char * type , struct object_id * oid ,
22462246 unsigned flags )
22472247{
22482248 char * header ;
2249- int hdrlen , status = 0 ;
2249+ size_t hdrlen ;
2250+ int status = 0 ;
22502251
22512252 /* type string, SP, %lu of the length plus NUL must fit this */
22522253 hdrlen = strlen (type ) + MAX_HEADER_LEN ;
0 commit comments