Skip to content

Commit 62f2c1b

Browse files
ttaylorrgitster
authored andcommitted
midx: make some functions non-static
In a subsequent commit, pack-revindex.c will become responsible for sorting a list of objects in the "MIDX pack order" (which will be defined in the following patch). To do so, it will need to be know the pack identifier and offset within that pack for each object in the MIDX. The MIDX code already has functions for doing just that (nth_midxed_offset() and nth_midxed_pack_int_id()), but they are statically declared. Since there is no reason that they couldn't be exposed publicly, and because they are already doing exactly what the caller in pack-revindex.c will want, expose them publicly so that they can be reused there. Signed-off-by: Taylor Blau <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 9f19161 commit 62f2c1b

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

midx.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ struct object_id *nth_midxed_object_oid(struct object_id *oid,
239239
return oid;
240240
}
241241

242-
static off_t nth_midxed_offset(struct multi_pack_index *m, uint32_t pos)
242+
off_t nth_midxed_offset(struct multi_pack_index *m, uint32_t pos)
243243
{
244244
const unsigned char *offset_data;
245245
uint32_t offset32;
@@ -258,7 +258,7 @@ static off_t nth_midxed_offset(struct multi_pack_index *m, uint32_t pos)
258258
return offset32;
259259
}
260260

261-
static uint32_t nth_midxed_pack_int_id(struct multi_pack_index *m, uint32_t pos)
261+
uint32_t nth_midxed_pack_int_id(struct multi_pack_index *m, uint32_t pos)
262262
{
263263
return get_be32(m->chunk_object_offsets +
264264
(off_t)pos * MIDX_CHUNK_OFFSET_WIDTH);

midx.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ struct multi_pack_index {
4040
struct multi_pack_index *load_multi_pack_index(const char *object_dir, int local);
4141
int prepare_midx_pack(struct repository *r, struct multi_pack_index *m, uint32_t pack_int_id);
4242
int bsearch_midx(const struct object_id *oid, struct multi_pack_index *m, uint32_t *result);
43+
off_t nth_midxed_offset(struct multi_pack_index *m, uint32_t pos);
44+
uint32_t nth_midxed_pack_int_id(struct multi_pack_index *m, uint32_t pos);
4345
struct object_id *nth_midxed_object_oid(struct object_id *oid,
4446
struct multi_pack_index *m,
4547
uint32_t n);

0 commit comments

Comments
 (0)