oid_pos(): access table through const pointers
When we are looking up an oid in an array, we obviously don't need to write to the array. Let's mark it as const in the function interfaces, as well as in the local variables we use to derference the void pointer (note a few cases use pointers-to-pointers, so we mark everything const). Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:

committed by
Junio C Hamano

parent
45ee13b942
commit
8380dcd700
@ -390,9 +390,9 @@ static void name_tips(void)
|
||||
}
|
||||
}
|
||||
|
||||
static const struct object_id *nth_tip_table_ent(size_t ix, void *table_)
|
||||
static const struct object_id *nth_tip_table_ent(size_t ix, const void *table_)
|
||||
{
|
||||
struct tip_table_entry *table = table_;
|
||||
const struct tip_table_entry *table = table_;
|
||||
return &table[ix].oid;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user