summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTaylor Blau <me@ttaylorr.com>2023-03-20 16:02:43 -0400
committerJunio C Hamano <gitster@pobox.com>2023-03-20 14:40:13 -0700
commit82d838ac61e08bccede2682eb6fb5c6730d3ea87 (patch)
tree78287bdf7ad094d98480605599143ce128971f91
parentf8762b1cefcdd8b027d1f89b0c37f9abe27b91c0 (diff)
downloadgit-82d838ac61e08bccede2682eb6fb5c6730d3ea87.tar.gz
pack-bitmap.c: hide bitmap internals in `read_be32()`
In a similar fashion as the previous commit, update `read_be32()` to take a `struct bitmap_index *` instead of copies of and pointers to variables within that structure. Signed-off-by: Taylor Blau <me@ttaylorr.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r--pack-bitmap.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/pack-bitmap.c b/pack-bitmap.c
index afb3812fb6..4423d54821 100644
--- a/pack-bitmap.c
+++ b/pack-bitmap.c
@@ -242,10 +242,10 @@ static struct stored_bitmap *store_bitmap(struct bitmap_index *index,
return stored;
}
-static inline uint32_t read_be32(const unsigned char *buffer, size_t *pos)
+static inline uint32_t read_be32(struct bitmap_index *bitmap_git)
{
- uint32_t result = get_be32(buffer + *pos);
- (*pos) += sizeof(result);
+ uint32_t result = get_be32(bitmap_git->map + bitmap_git->map_pos);
+ bitmap_git->map_pos += sizeof(result);
return result;
}
@@ -280,7 +280,7 @@ static int load_bitmap_entries_v1(struct bitmap_index *index)
if (index->map_size - index->map_pos < 6)
return error(_("corrupt ewah bitmap: truncated header for entry %d"), i);
- commit_idx_pos = read_be32(index->map, &index->map_pos);
+ commit_idx_pos = read_be32(index);
xor_offset = read_u8(index);
flags = read_u8(index);