summaryrefslogtreecommitdiff
path: root/builtin/pack-redundant.c
diff options
context:
space:
mode:
authorShahzad Lone <shahzadlone@gmail.com>2019-02-02 23:16:45 (GMT)
committerJunio C Hamano <gitster@pobox.com>2019-02-04 17:57:10 (GMT)
commit33de80b1d50773f79e380eff33b4fc5c8ae1dd25 (patch)
tree8f0e4f65315b789213e1d806fb4dbdae81e87804 /builtin/pack-redundant.c
parentb5101f929789889c2e536d915698f58d5c5c6b7a (diff)
downloadgit-33de80b1d50773f79e380eff33b4fc5c8ae1dd25.zip
git-33de80b1d50773f79e380eff33b4fc5c8ae1dd25.tar.gz
git-33de80b1d50773f79e380eff33b4fc5c8ae1dd25.tar.bz2
various: tighten constness of some local variables
Signed-off-by: Shahzad Lone <shahzadlone@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/pack-redundant.c')
-rw-r--r--builtin/pack-redundant.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/builtin/pack-redundant.c b/builtin/pack-redundant.c
index cf9a9aa..11bc514 100644
--- a/builtin/pack-redundant.c
+++ b/builtin/pack-redundant.c
@@ -166,7 +166,7 @@ redo_from_start:
l = (hint == NULL) ? list->front : hint;
prev = NULL;
while (l) {
- int cmp = oidcmp(l->oid, oid);
+ const int cmp = oidcmp(l->oid, oid);
if (cmp > 0) /* not in list, since sorted */
return prev;
if (!cmp) { /* found */
@@ -264,7 +264,7 @@ static void cmp_two_packs(struct pack_list *p1, struct pack_list *p2)
while (p1_off < p1->pack->num_objects * p1_step &&
p2_off < p2->pack->num_objects * p2_step)
{
- int cmp = hashcmp(p1_base + p1_off, p2_base + p2_off);
+ const int cmp = hashcmp(p1_base + p1_off, p2_base + p2_off);
/* cmp ~ p1 - p2 */
if (cmp == 0) {
p1_hint = llist_sorted_remove(p1->unique_objects,