@@ -1763,9 +1763,9 @@ void *read_object_with_reference(struct repository *r,
1763
1763
}
1764
1764
1765
1765
static void hash_object_body (const struct git_hash_algo * algo , git_hash_ctx * c ,
1766
- const void * buf , unsigned long len ,
1766
+ const void * buf , size_t len ,
1767
1767
struct object_id * oid ,
1768
- char * hdr , int * hdrlen )
1768
+ char * hdr , size_t * hdrlen )
1769
1769
{
1770
1770
algo -> init_fn (c );
1771
1771
algo -> update_fn (c , hdr , * hdrlen );
@@ -1774,23 +1774,23 @@ static void hash_object_body(const struct git_hash_algo *algo, git_hash_ctx *c,
1774
1774
}
1775
1775
1776
1776
static void write_object_file_prepare (const struct git_hash_algo * algo ,
1777
- const void * buf , unsigned long len ,
1777
+ const void * buf , size_t len ,
1778
1778
enum object_type type , struct object_id * oid ,
1779
- char * hdr , int * hdrlen )
1779
+ char * hdr , size_t * hdrlen )
1780
1780
{
1781
1781
git_hash_ctx c ;
1782
1782
1783
1783
/* Generate the header */
1784
1784
* hdrlen = format_object_header (hdr , * hdrlen , type , len );
1785
1785
1786
- /* Sha1.. */
1786
+ /* Hash (function pointers) computation */
1787
1787
hash_object_body (algo , & c , buf , len , oid , hdr , hdrlen );
1788
1788
}
1789
1789
1790
1790
static void write_object_file_prepare_literally (const struct git_hash_algo * algo ,
1791
- const void * buf , unsigned long len ,
1791
+ const void * buf , size_t len ,
1792
1792
const char * type , struct object_id * oid ,
1793
- char * hdr , int * hdrlen )
1793
+ char * hdr , size_t * hdrlen )
1794
1794
{
1795
1795
git_hash_ctx c ;
1796
1796
@@ -1842,17 +1842,17 @@ int finalize_object_file(const char *tmpfile, const char *filename)
1842
1842
}
1843
1843
1844
1844
static void hash_object_file_literally (const struct git_hash_algo * algo ,
1845
- const void * buf , unsigned long len ,
1845
+ const void * buf , size_t len ,
1846
1846
const char * type , struct object_id * oid )
1847
1847
{
1848
1848
char hdr [MAX_HEADER_LEN ];
1849
- int hdrlen = sizeof (hdr );
1849
+ size_t hdrlen = sizeof (hdr );
1850
1850
1851
1851
write_object_file_prepare_literally (algo , buf , len , type , oid , hdr , & hdrlen );
1852
1852
}
1853
1853
1854
1854
void hash_object_file (const struct git_hash_algo * algo , const void * buf ,
1855
- unsigned long len , enum object_type type ,
1855
+ size_t len , enum object_type type ,
1856
1856
struct object_id * oid )
1857
1857
{
1858
1858
hash_object_file_literally (algo , buf , len , type_name (type ), oid );
@@ -2194,12 +2194,12 @@ int stream_loose_object(struct input_stream *in_stream, size_t len,
2194
2194
return err ;
2195
2195
}
2196
2196
2197
- int write_object_file_flags (const void * buf , unsigned long len ,
2197
+ int write_object_file_flags (const void * buf , size_t len ,
2198
2198
enum object_type type , struct object_id * oid ,
2199
2199
unsigned flags )
2200
2200
{
2201
2201
char hdr [MAX_HEADER_LEN ];
2202
- int hdrlen = sizeof (hdr );
2202
+ size_t hdrlen = sizeof (hdr );
2203
2203
2204
2204
/* Normally if we have it in the pack then we do not bother writing
2205
2205
* it out into .git/objects/??/?{38} file.
@@ -2211,12 +2211,13 @@ int write_object_file_flags(const void *buf, unsigned long len,
2211
2211
return write_loose_object (oid , hdr , hdrlen , buf , len , 0 , flags );
2212
2212
}
2213
2213
2214
- int write_object_file_literally (const void * buf , unsigned long len ,
2214
+ int write_object_file_literally (const void * buf , size_t len ,
2215
2215
const char * type , struct object_id * oid ,
2216
2216
unsigned flags )
2217
2217
{
2218
2218
char * header ;
2219
- int hdrlen , status = 0 ;
2219
+ size_t hdrlen ;
2220
+ int status = 0 ;
2220
2221
2221
2222
/* type string, SP, %lu of the length plus NUL must fit this */
2222
2223
hdrlen = strlen (type ) + MAX_HEADER_LEN ;
0 commit comments