Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2021-01-28 09:20:23 +0300
committerJunio C Hamano <gitster@pobox.com>2021-01-28 23:03:26 +0300
commit8380dcd700e80cd22745bcffb3625f90f943950c (patch)
treea4ab3fcfe1f8b98af53592eaedd64f7b07eb4dff /builtin/name-rev.c
parent45ee13b942b26925b33d827bda2856e1ed0af0b7 (diff)
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>
Diffstat (limited to 'builtin/name-rev.c')
-rw-r--r--builtin/name-rev.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/builtin/name-rev.c b/builtin/name-rev.c
index 27138fdce4..b221d30014 100644
--- a/builtin/name-rev.c
+++ b/builtin/name-rev.c
@@ -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;
}