Skip to content

Commit 3eea3c8

Browse files
ttaylorrgitster
authored andcommitted
midx: mark get_midx_checksum() arguments as const
To make clear that the fucntion `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 f0ef5b6 commit 3eea3c8

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

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)