| 589 | } |
| 590 | |
| 591 | static int write_midx_large_offsets(struct hashfile *f, |
| 592 | void *data) |
| 593 | { |
| 594 | struct write_midx_context *ctx = data; |
| 595 | struct pack_midx_entry *list = ctx->entries; |
| 596 | struct pack_midx_entry *end = ctx->entries + ctx->entries_nr; |
| 597 | uint32_t nr_large_offset = ctx->num_large_offsets; |
| 598 | |
| 599 | while (nr_large_offset) { |
| 600 | struct pack_midx_entry *obj; |
| 601 | uint64_t offset; |
| 602 | |
| 603 | if (list >= end) |
| 604 | BUG("too many large-offset objects"); |
| 605 | |
| 606 | obj = list++; |
| 607 | offset = obj->offset; |
| 608 | |
| 609 | if (!(offset >> 31)) |
| 610 | continue; |
| 611 | |
| 612 | hashwrite_be64(f, offset); |
| 613 | |
| 614 | nr_large_offset--; |
| 615 | } |
| 616 | |
| 617 | return 0; |
| 618 | } |
| 619 | |
| 620 | static int write_midx_revindex(struct hashfile *f, |
| 621 | void *data) |
nothing calls this directly
no test coverage detected