@@ -1952,9 +1952,9 @@ void *read_object_with_reference(struct repository *r,
1952
1952
}
1953
1953
1954
1954
static void hash_object_body (const struct git_hash_algo * algo , struct git_hash_ctx * c ,
1955
- const void * buf , unsigned long len ,
1955
+ const void * buf , size_t len ,
1956
1956
struct object_id * oid ,
1957
- char * hdr , int * hdrlen )
1957
+ char * hdr , size_t * hdrlen )
1958
1958
{
1959
1959
algo -> init_fn (c );
1960
1960
git_hash_update (c , hdr , * hdrlen );
@@ -1963,23 +1963,23 @@ static void hash_object_body(const struct git_hash_algo *algo, struct git_hash_c
1963
1963
}
1964
1964
1965
1965
static void write_object_file_prepare (const struct git_hash_algo * algo ,
1966
- const void * buf , unsigned long len ,
1966
+ const void * buf , size_t len ,
1967
1967
enum object_type type , struct object_id * oid ,
1968
- char * hdr , int * hdrlen )
1968
+ char * hdr , size_t * hdrlen )
1969
1969
{
1970
1970
struct git_hash_ctx c ;
1971
1971
1972
1972
/* Generate the header */
1973
1973
* hdrlen = format_object_header (hdr , * hdrlen , type , len );
1974
1974
1975
- /* Sha1.. */
1975
+ /* Hash (function pointers) computation */
1976
1976
hash_object_body (algo , & c , buf , len , oid , hdr , hdrlen );
1977
1977
}
1978
1978
1979
1979
static void write_object_file_prepare_literally (const struct git_hash_algo * algo ,
1980
- const void * buf , unsigned long len ,
1980
+ const void * buf , size_t len ,
1981
1981
const char * type , struct object_id * oid ,
1982
- char * hdr , int * hdrlen )
1982
+ char * hdr , size_t * hdrlen )
1983
1983
{
1984
1984
struct git_hash_ctx c ;
1985
1985
@@ -2117,17 +2117,17 @@ int finalize_object_file_flags(const char *tmpfile, const char *filename,
2117
2117
}
2118
2118
2119
2119
static void hash_object_file_literally (const struct git_hash_algo * algo ,
2120
- const void * buf , unsigned long len ,
2120
+ const void * buf , size_t len ,
2121
2121
const char * type , struct object_id * oid )
2122
2122
{
2123
2123
char hdr [MAX_HEADER_LEN ];
2124
- int hdrlen = sizeof (hdr );
2124
+ size_t hdrlen = sizeof (hdr );
2125
2125
2126
2126
write_object_file_prepare_literally (algo , buf , len , type , oid , hdr , & hdrlen );
2127
2127
}
2128
2128
2129
2129
void hash_object_file (const struct git_hash_algo * algo , const void * buf ,
2130
- unsigned long len , enum object_type type ,
2130
+ size_t len , enum object_type type ,
2131
2131
struct object_id * oid )
2132
2132
{
2133
2133
hash_object_file_literally (algo , buf , len , type_name (type ), oid );
@@ -2491,7 +2491,7 @@ int stream_loose_object(struct input_stream *in_stream, size_t len,
2491
2491
return err ;
2492
2492
}
2493
2493
2494
- int write_object_file_flags (const void * buf , unsigned long len ,
2494
+ int write_object_file_flags (const void * buf , size_t len ,
2495
2495
enum object_type type , struct object_id * oid ,
2496
2496
struct object_id * compat_oid_in , unsigned flags )
2497
2497
{
@@ -2500,7 +2500,7 @@ int write_object_file_flags(const void *buf, unsigned long len,
2500
2500
const struct git_hash_algo * compat = repo -> compat_hash_algo ;
2501
2501
struct object_id compat_oid ;
2502
2502
char hdr [MAX_HEADER_LEN ];
2503
- int hdrlen = sizeof (hdr );
2503
+ size_t hdrlen = sizeof (hdr );
2504
2504
2505
2505
/* Generate compat_oid */
2506
2506
if (compat ) {
@@ -2531,7 +2531,7 @@ int write_object_file_flags(const void *buf, unsigned long len,
2531
2531
return 0 ;
2532
2532
}
2533
2533
2534
- int write_object_file_literally (const void * buf , unsigned long len ,
2534
+ int write_object_file_literally (const void * buf , size_t len ,
2535
2535
const char * type , struct object_id * oid ,
2536
2536
unsigned flags )
2537
2537
{
@@ -2540,8 +2540,8 @@ int write_object_file_literally(const void *buf, unsigned long len,
2540
2540
const struct git_hash_algo * algo = repo -> hash_algo ;
2541
2541
const struct git_hash_algo * compat = repo -> compat_hash_algo ;
2542
2542
struct object_id compat_oid ;
2543
- int hdrlen , status = 0 ;
2544
- int compat_type = -1 ;
2543
+ size_t hdrlen ;
2544
+ int status = 0 , compat_type = -1 ;
2545
2545
2546
2546
if (compat ) {
2547
2547
compat_type = type_from_string_gently (type , -1 , 1 );
0 commit comments