@@ -349,7 +349,7 @@ int for_each_commit_graft(each_commit_graft_fn fn, void *cb_data)
349349
350350struct commit_buffer {
351351 void * buffer ;
352- unsigned long size ;
352+ size_t size ;
353353};
354354define_commit_slab (buffer_slab , struct commit_buffer );
355355
@@ -366,15 +366,18 @@ void free_commit_buffer_slab(struct buffer_slab *bs)
366366 free (bs );
367367}
368368
369- void set_commit_buffer (struct repository * r , struct commit * commit , void * buffer , unsigned long size )
369+ void set_commit_buffer (struct repository * r , struct commit * commit ,
370+ void * buffer , size_t size )
370371{
371372 struct commit_buffer * v = buffer_slab_at (
372373 r -> parsed_objects -> buffer_slab , commit );
373374 v -> buffer = buffer ;
374375 v -> size = size ;
375376}
376377
377- const void * get_cached_commit_buffer (struct repository * r , const struct commit * commit , unsigned long * sizep )
378+ const void * get_cached_commit_buffer (struct repository * r ,
379+ const struct commit * commit ,
380+ size_t * sizep )
378381{
379382 struct commit_buffer * v = buffer_slab_peek (
380383 r -> parsed_objects -> buffer_slab , commit );
@@ -390,7 +393,7 @@ const void *get_cached_commit_buffer(struct repository *r, const struct commit *
390393
391394const void * repo_get_commit_buffer (struct repository * r ,
392395 const struct commit * commit ,
393- unsigned long * sizep )
396+ size_t * sizep )
394397{
395398 const void * ret = get_cached_commit_buffer (r , commit , sizep );
396399 if (!ret ) {
@@ -404,7 +407,7 @@ const void *repo_get_commit_buffer(struct repository *r,
404407 die ("expected commit for %s, got %s" ,
405408 oid_to_hex (& commit -> object .oid ), type_name (type ));
406409 if (sizep )
407- * sizep = cast_size_t_to_ulong ( size ) ;
410+ * sizep = size ;
408411 }
409412 return ret ;
410413}
@@ -1185,7 +1188,7 @@ int parse_signed_commit(const struct commit *commit,
11851188 struct strbuf * payload , struct strbuf * signature ,
11861189 const struct git_hash_algo * algop )
11871190{
1188- unsigned long size ;
1191+ size_t size ;
11891192 const char * buffer = repo_get_commit_buffer (the_repository , commit ,
11901193 & size );
11911194 int ret = parse_buffer_signed_by_header (buffer , size , payload , signature , algop );
@@ -1358,7 +1361,7 @@ int verify_commit_buffer(const char *buffer, size_t size,
13581361
13591362int check_commit_signature (const struct commit * commit , struct signature_check * sigc )
13601363{
1361- unsigned long size ;
1364+ size_t size ;
13621365 const char * buffer = repo_get_commit_buffer (the_repository , commit , & size );
13631366 int ret = verify_commit_buffer (buffer , size , sigc );
13641367
@@ -1455,7 +1458,7 @@ struct commit_extra_header *read_commit_extra_headers(struct commit *commit,
14551458 const char * * exclude )
14561459{
14571460 struct commit_extra_header * extra = NULL ;
1458- unsigned long size ;
1461+ size_t size ;
14591462 const char * buffer = repo_get_commit_buffer (the_repository , commit ,
14601463 & size );
14611464 extra = read_commit_extra_header_lines (buffer , size , exclude );
0 commit comments