@@ -1935,9 +1935,9 @@ void *read_object_with_reference(struct repository *r,
19351935}
19361936
19371937static void hash_object_body (const struct git_hash_algo * algo , git_hash_ctx * c ,
1938- const void * buf , unsigned long len ,
1938+ const void * buf , size_t len ,
19391939 struct object_id * oid ,
1940- char * hdr , int * hdrlen )
1940+ char * hdr , size_t * hdrlen )
19411941{
19421942 algo -> init_fn (c );
19431943 algo -> update_fn (c , hdr , * hdrlen );
@@ -1946,23 +1946,23 @@ static void hash_object_body(const struct git_hash_algo *algo, git_hash_ctx *c,
19461946}
19471947
19481948static void write_object_file_prepare (const struct git_hash_algo * algo ,
1949- const void * buf , unsigned long len ,
1949+ const void * buf , size_t len ,
19501950 enum object_type type , struct object_id * oid ,
1951- char * hdr , int * hdrlen )
1951+ char * hdr , size_t * hdrlen )
19521952{
19531953 git_hash_ctx c ;
19541954
19551955 /* Generate the header */
19561956 * hdrlen = format_object_header (hdr , * hdrlen , type , len );
19571957
1958- /* Sha1.. */
1958+ /* Hash (function pointers) computation */
19591959 hash_object_body (algo , & c , buf , len , oid , hdr , hdrlen );
19601960}
19611961
19621962static void write_object_file_prepare_literally (const struct git_hash_algo * algo ,
1963- const void * buf , unsigned long len ,
1963+ const void * buf , size_t len ,
19641964 const char * type , struct object_id * oid ,
1965- char * hdr , int * hdrlen )
1965+ char * hdr , size_t * hdrlen )
19661966{
19671967 git_hash_ctx c ;
19681968
@@ -2082,17 +2082,17 @@ int finalize_object_file_flags(const char *tmpfile, const char *filename,
20822082}
20832083
20842084static void hash_object_file_literally (const struct git_hash_algo * algo ,
2085- const void * buf , unsigned long len ,
2085+ const void * buf , size_t len ,
20862086 const char * type , struct object_id * oid )
20872087{
20882088 char hdr [MAX_HEADER_LEN ];
2089- int hdrlen = sizeof (hdr );
2089+ size_t hdrlen = sizeof (hdr );
20902090
20912091 write_object_file_prepare_literally (algo , buf , len , type , oid , hdr , & hdrlen );
20922092}
20932093
20942094void hash_object_file (const struct git_hash_algo * algo , const void * buf ,
2095- unsigned long len , enum object_type type ,
2095+ size_t len , enum object_type type ,
20962096 struct object_id * oid )
20972097{
20982098 hash_object_file_literally (algo , buf , len , type_name (type ), oid );
@@ -2458,7 +2458,7 @@ int stream_loose_object(struct input_stream *in_stream, size_t len,
24582458 return err ;
24592459}
24602460
2461- int write_object_file_flags (const void * buf , unsigned long len ,
2461+ int write_object_file_flags (const void * buf , size_t len ,
24622462 enum object_type type , struct object_id * oid ,
24632463 struct object_id * compat_oid_in , unsigned flags )
24642464{
@@ -2467,7 +2467,7 @@ int write_object_file_flags(const void *buf, unsigned long len,
24672467 const struct git_hash_algo * compat = repo -> compat_hash_algo ;
24682468 struct object_id compat_oid ;
24692469 char hdr [MAX_HEADER_LEN ];
2470- int hdrlen = sizeof (hdr );
2470+ size_t hdrlen = sizeof (hdr );
24712471
24722472 /* Generate compat_oid */
24732473 if (compat ) {
@@ -2498,7 +2498,7 @@ int write_object_file_flags(const void *buf, unsigned long len,
24982498 return 0 ;
24992499}
25002500
2501- int write_object_file_literally (const void * buf , unsigned long len ,
2501+ int write_object_file_literally (const void * buf , size_t len ,
25022502 const char * type , struct object_id * oid ,
25032503 unsigned flags )
25042504{
@@ -2507,8 +2507,8 @@ int write_object_file_literally(const void *buf, unsigned long len,
25072507 const struct git_hash_algo * algo = repo -> hash_algo ;
25082508 const struct git_hash_algo * compat = repo -> compat_hash_algo ;
25092509 struct object_id compat_oid ;
2510- int hdrlen , status = 0 ;
2511- int compat_type = -1 ;
2510+ size_t hdrlen ;
2511+ int status = 0 , compat_type = -1 ;
25122512
25132513 if (compat ) {
25142514 compat_type = type_from_string_gently (type , -1 , 1 );
0 commit comments