@@ -998,11 +998,13 @@ static int store_object(
998998
999999 if (last && last -> data .len && last -> data .buf && last -> depth < max_depth
10001000 && dat -> len > the_hash_algo -> rawsz ) {
1001+ size_t deltalen_st = 0 ;
10011002
10021003 delta_count_attempts_by_type [type ]++ ;
10031004 delta = diff_delta (last -> data .buf , last -> data .len ,
10041005 dat -> buf , dat -> len ,
1005- & deltalen , dat -> len - the_hash_algo -> rawsz );
1006+ & deltalen_st , dat -> len - the_hash_algo -> rawsz );
1007+ deltalen = cast_size_t_to_ulong (deltalen_st );
10061008 } else
10071009 delta = NULL ;
10081010
@@ -1241,6 +1243,8 @@ static void *gfi_unpack_entry(
12411243 unsigned long * sizep )
12421244{
12431245 enum object_type type ;
1246+ size_t size_st = 0 ;
1247+ void * data ;
12441248 struct packed_git * p = all_packs [oe -> pack_id ];
12451249 if (p == pack_data && p -> pack_size < (pack_size + the_hash_algo -> rawsz )) {
12461250 /* The object is stored in the packfile we are writing to
@@ -1262,7 +1266,10 @@ static void *gfi_unpack_entry(
12621266 */
12631267 p -> pack_size = pack_size + the_hash_algo -> rawsz ;
12641268 }
1265- return unpack_entry (the_repository , p , oe -> idx .offset , & type , sizep );
1269+ data = unpack_entry (the_repository , p , oe -> idx .offset , & type , & size_st );
1270+ if (sizep )
1271+ * sizep = cast_size_t_to_ulong (size_st );
1272+ return data ;
12661273}
12671274
12681275static void load_tree (struct tree_entry * root )
@@ -1288,7 +1295,10 @@ static void load_tree(struct tree_entry *root)
12881295 die (_ ("can't load tree %s" ), oid_to_hex (oid ));
12891296 } else {
12901297 enum object_type type ;
1291- buf = odb_read_object (the_repository -> objects , oid , & type , & size );
1298+ size_t size_st = 0 ;
1299+ buf = odb_read_object (the_repository -> objects , oid , & type ,
1300+ & size_st );
1301+ size = cast_size_t_to_ulong (size_st );
12921302 if (!buf || type != OBJ_TREE )
12931303 die (_ ("can't load tree %s" ), oid_to_hex (oid ));
12941304 }
@@ -2557,7 +2567,7 @@ static void note_change_n(const char *p, struct branch *b, unsigned char *old_fa
25572567 die (_ ("mark :%" PRIuMAX " not a commit" ), commit_mark );
25582568 oidcpy (& commit_oid , & commit_oe -> idx .oid );
25592569 } else if (!repo_get_oid (the_repository , p , & commit_oid )) {
2560- unsigned long size ;
2570+ size_t size ;
25612571 char * buf = odb_read_object_peeled (the_repository -> objects ,
25622572 & commit_oid , OBJ_COMMIT , & size ,
25632573 & commit_oid );
@@ -2624,10 +2634,12 @@ static void parse_from_existing(struct branch *b)
26242634 oidclr (& b -> branch_tree .versions [1 ].oid , the_repository -> hash_algo );
26252635 } else {
26262636 unsigned long size ;
2637+ size_t size_st = 0 ;
26272638 char * buf ;
26282639
26292640 buf = odb_read_object_peeled (the_repository -> objects , & b -> oid ,
2630- OBJ_COMMIT , & size , & b -> oid );
2641+ OBJ_COMMIT , & size_st , & b -> oid );
2642+ size = cast_size_t_to_ulong (size_st );
26312643 parse_from_commit (b , buf , size );
26322644 free (buf );
26332645 }
@@ -2719,7 +2731,7 @@ static struct hash_list *parse_merge(unsigned int *count)
27192731 die (_ ("mark :%" PRIuMAX " not a commit" ), idnum );
27202732 oidcpy (& n -> oid , & oe -> idx .oid );
27212733 } else if (!repo_get_oid (the_repository , from , & n -> oid )) {
2722- unsigned long size ;
2734+ size_t size ;
27232735 char * buf = odb_read_object_peeled (the_repository -> objects ,
27242736 & n -> oid , OBJ_COMMIT ,
27252737 & size , & n -> oid );
@@ -3327,7 +3339,10 @@ static void cat_blob(struct object_entry *oe, struct object_id *oid)
33273339 char * buf ;
33283340
33293341 if (!oe || oe -> pack_id == MAX_PACK_ID ) {
3330- buf = odb_read_object (the_repository -> objects , oid , & type , & size );
3342+ size_t size_st = 0 ;
3343+ buf = odb_read_object (the_repository -> objects , oid , & type ,
3344+ & size_st );
3345+ size = cast_size_t_to_ulong (size_st );
33313346 } else {
33323347 type = oe -> type ;
33333348 buf = gfi_unpack_entry (oe , & size );
@@ -3435,8 +3450,10 @@ static struct object_entry *dereference(struct object_entry *oe,
34353450 buf = gfi_unpack_entry (oe , & size );
34363451 } else {
34373452 enum object_type unused ;
3453+ size_t size_st = 0 ;
34383454 buf = odb_read_object (the_repository -> objects , oid ,
3439- & unused , & size );
3455+ & unused , & size_st );
3456+ size = cast_size_t_to_ulong (size_st );
34403457 }
34413458 if (!buf )
34423459 die (_ ("can't load object %s" ), oid_to_hex (oid ));
0 commit comments