@@ -1675,9 +1675,9 @@ void *read_object_with_reference(struct repository *r,
1675
1675
}
1676
1676
1677
1677
static void hash_object_body (const struct git_hash_algo * algo , struct git_hash_ctx * c ,
1678
- const void * buf , unsigned long len ,
1678
+ const void * buf , size_t len ,
1679
1679
struct object_id * oid ,
1680
- char * hdr , int * hdrlen )
1680
+ char * hdr , size_t * hdrlen )
1681
1681
{
1682
1682
algo -> init_fn (c );
1683
1683
git_hash_update (c , hdr , * hdrlen );
@@ -1686,23 +1686,23 @@ static void hash_object_body(const struct git_hash_algo *algo, struct git_hash_c
1686
1686
}
1687
1687
1688
1688
static void write_object_file_prepare (const struct git_hash_algo * algo ,
1689
- const void * buf , unsigned long len ,
1689
+ const void * buf , size_t len ,
1690
1690
enum object_type type , struct object_id * oid ,
1691
- char * hdr , int * hdrlen )
1691
+ char * hdr , size_t * hdrlen )
1692
1692
{
1693
1693
struct git_hash_ctx c ;
1694
1694
1695
1695
/* Generate the header */
1696
1696
* hdrlen = format_object_header (hdr , * hdrlen , type , len );
1697
1697
1698
- /* Sha1.. */
1698
+ /* Hash (function pointers) computation */
1699
1699
hash_object_body (algo , & c , buf , len , oid , hdr , hdrlen );
1700
1700
}
1701
1701
1702
1702
static void write_object_file_prepare_literally (const struct git_hash_algo * algo ,
1703
- const void * buf , unsigned long len ,
1703
+ const void * buf , size_t len ,
1704
1704
const char * type , struct object_id * oid ,
1705
- char * hdr , int * hdrlen )
1705
+ char * hdr , size_t * hdrlen )
1706
1706
{
1707
1707
struct git_hash_ctx c ;
1708
1708
@@ -1840,17 +1840,17 @@ int finalize_object_file_flags(const char *tmpfile, const char *filename,
1840
1840
}
1841
1841
1842
1842
static void hash_object_file_literally (const struct git_hash_algo * algo ,
1843
- const void * buf , unsigned long len ,
1843
+ const void * buf , size_t len ,
1844
1844
const char * type , struct object_id * oid )
1845
1845
{
1846
1846
char hdr [MAX_HEADER_LEN ];
1847
- int hdrlen = sizeof (hdr );
1847
+ size_t hdrlen = sizeof (hdr );
1848
1848
1849
1849
write_object_file_prepare_literally (algo , buf , len , type , oid , hdr , & hdrlen );
1850
1850
}
1851
1851
1852
1852
void hash_object_file (const struct git_hash_algo * algo , const void * buf ,
1853
- unsigned long len , enum object_type type ,
1853
+ size_t len , enum object_type type ,
1854
1854
struct object_id * oid )
1855
1855
{
1856
1856
hash_object_file_literally (algo , buf , len , type_name (type ), oid );
@@ -2214,7 +2214,7 @@ int stream_loose_object(struct input_stream *in_stream, size_t len,
2214
2214
return err ;
2215
2215
}
2216
2216
2217
- int write_object_file_flags (const void * buf , unsigned long len ,
2217
+ int write_object_file_flags (const void * buf , size_t len ,
2218
2218
enum object_type type , struct object_id * oid ,
2219
2219
struct object_id * compat_oid_in , unsigned flags )
2220
2220
{
@@ -2223,7 +2223,7 @@ int write_object_file_flags(const void *buf, unsigned long len,
2223
2223
const struct git_hash_algo * compat = repo -> compat_hash_algo ;
2224
2224
struct object_id compat_oid ;
2225
2225
char hdr [MAX_HEADER_LEN ];
2226
- int hdrlen = sizeof (hdr );
2226
+ size_t hdrlen = sizeof (hdr );
2227
2227
2228
2228
/* Generate compat_oid */
2229
2229
if (compat ) {
@@ -2254,7 +2254,7 @@ int write_object_file_flags(const void *buf, unsigned long len,
2254
2254
return 0 ;
2255
2255
}
2256
2256
2257
- int write_object_file_literally (const void * buf , unsigned long len ,
2257
+ int write_object_file_literally (const void * buf , size_t len ,
2258
2258
const char * type , struct object_id * oid ,
2259
2259
unsigned flags )
2260
2260
{
@@ -2263,8 +2263,8 @@ int write_object_file_literally(const void *buf, unsigned long len,
2263
2263
const struct git_hash_algo * algo = repo -> hash_algo ;
2264
2264
const struct git_hash_algo * compat = repo -> compat_hash_algo ;
2265
2265
struct object_id compat_oid ;
2266
- int hdrlen , status = 0 ;
2267
- int compat_type = -1 ;
2266
+ size_t hdrlen ;
2267
+ int status = 0 , compat_type = -1 ;
2268
2268
2269
2269
if (compat ) {
2270
2270
compat_type = type_from_string_gently (type , -1 , 1 );
0 commit comments