Skip to content

Commit 00c0d84

Browse files
ttaylorrgitster
authored andcommitted
midx: mark get_midx_checksum() arguments as const
To make clear that the function `get_midx_checksum()` does not do anything to modify its argument, mark the MIDX pointer as const. The following commit will rename this function altogether to make clear that it returns the raw bytes of the checksum, not a hex-encoded copy of it. Signed-off-by: Taylor Blau <me@ttaylorr.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent 7c02d39 commit 00c0d84

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

midx.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ void clear_incremental_midx_files_ext(struct odb_source *source, const char *ext
2424
int cmp_idx_or_pack_name(const char *idx_or_pack_name,
2525
const char *idx_name);
2626

27-
const unsigned char *get_midx_checksum(struct multi_pack_index *m)
27+
const unsigned char *get_midx_checksum(const struct multi_pack_index *m)
2828
{
2929
return m->data + m->data_len - m->source->odb->repo->hash_algo->rawsz;
3030
}

midx.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ struct multi_pack_index {
8585
#define MIDX_EXT_BITMAP "bitmap"
8686
#define MIDX_EXT_MIDX "midx"
8787

88-
const unsigned char *get_midx_checksum(struct multi_pack_index *m);
88+
const unsigned char *get_midx_checksum(const struct multi_pack_index *m);
8989
void get_midx_filename(struct odb_source *source, struct strbuf *out);
9090
void get_midx_filename_ext(struct odb_source *source, struct strbuf *out,
9191
const unsigned char *hash, const char *ext);

0 commit comments

Comments
 (0)