@@ -1934,9 +1934,9 @@ void *read_object_with_reference(struct repository *r,
19341934}
19351935
19361936static void hash_object_body (const struct git_hash_algo * algo , git_hash_ctx * c ,
1937- const void * buf , unsigned long len ,
1937+ const void * buf , size_t len ,
19381938 struct object_id * oid ,
1939- char * hdr , int * hdrlen )
1939+ char * hdr , size_t * hdrlen )
19401940{
19411941 algo -> init_fn (c );
19421942 algo -> update_fn (c , hdr , * hdrlen );
@@ -1945,23 +1945,23 @@ static void hash_object_body(const struct git_hash_algo *algo, git_hash_ctx *c,
19451945}
19461946
19471947static void write_object_file_prepare (const struct git_hash_algo * algo ,
1948- const void * buf , unsigned long len ,
1948+ const void * buf , size_t len ,
19491949 enum object_type type , struct object_id * oid ,
1950- char * hdr , int * hdrlen )
1950+ char * hdr , size_t * hdrlen )
19511951{
19521952 git_hash_ctx c ;
19531953
19541954 /* Generate the header */
19551955 * hdrlen = format_object_header (hdr , * hdrlen , type , len );
19561956
1957- /* Sha1.. */
1957+ /* Hash (function pointers) computation */
19581958 hash_object_body (algo , & c , buf , len , oid , hdr , hdrlen );
19591959}
19601960
19611961static void write_object_file_prepare_literally (const struct git_hash_algo * algo ,
1962- const void * buf , unsigned long len ,
1962+ const void * buf , size_t len ,
19631963 const char * type , struct object_id * oid ,
1964- char * hdr , int * hdrlen )
1964+ char * hdr , size_t * hdrlen )
19651965{
19661966 git_hash_ctx c ;
19671967
@@ -2081,17 +2081,17 @@ int finalize_object_file_flags(const char *tmpfile, const char *filename,
20812081}
20822082
20832083static void hash_object_file_literally (const struct git_hash_algo * algo ,
2084- const void * buf , unsigned long len ,
2084+ const void * buf , size_t len ,
20852085 const char * type , struct object_id * oid )
20862086{
20872087 char hdr [MAX_HEADER_LEN ];
2088- int hdrlen = sizeof (hdr );
2088+ size_t hdrlen = sizeof (hdr );
20892089
20902090 write_object_file_prepare_literally (algo , buf , len , type , oid , hdr , & hdrlen );
20912091}
20922092
20932093void hash_object_file (const struct git_hash_algo * algo , const void * buf ,
2094- unsigned long len , enum object_type type ,
2094+ size_t len , enum object_type type ,
20952095 struct object_id * oid )
20962096{
20972097 hash_object_file_literally (algo , buf , len , type_name (type ), oid );
@@ -2457,7 +2457,7 @@ int stream_loose_object(struct input_stream *in_stream, size_t len,
24572457 return err ;
24582458}
24592459
2460- int write_object_file_flags (const void * buf , unsigned long len ,
2460+ int write_object_file_flags (const void * buf , size_t len ,
24612461 enum object_type type , struct object_id * oid ,
24622462 struct object_id * compat_oid_in , unsigned flags )
24632463{
@@ -2466,7 +2466,7 @@ int write_object_file_flags(const void *buf, unsigned long len,
24662466 const struct git_hash_algo * compat = repo -> compat_hash_algo ;
24672467 struct object_id compat_oid ;
24682468 char hdr [MAX_HEADER_LEN ];
2469- int hdrlen = sizeof (hdr );
2469+ size_t hdrlen = sizeof (hdr );
24702470
24712471 /* Generate compat_oid */
24722472 if (compat ) {
@@ -2497,7 +2497,7 @@ int write_object_file_flags(const void *buf, unsigned long len,
24972497 return 0 ;
24982498}
24992499
2500- int write_object_file_literally (const void * buf , unsigned long len ,
2500+ int write_object_file_literally (const void * buf , size_t len ,
25012501 const char * type , struct object_id * oid ,
25022502 unsigned flags )
25032503{
@@ -2506,8 +2506,8 @@ int write_object_file_literally(const void *buf, unsigned long len,
25062506 const struct git_hash_algo * algo = repo -> hash_algo ;
25072507 const struct git_hash_algo * compat = repo -> compat_hash_algo ;
25082508 struct object_id compat_oid ;
2509- int hdrlen , status = 0 ;
2510- int compat_type = -1 ;
2509+ size_t hdrlen ;
2510+ int status = 0 , compat_type = -1 ;
25112511
25122512 if (compat ) {
25132513 compat_type = type_from_string_gently (type , -1 , 1 );
0 commit comments