various: tighten constness of some local variables

Signed-off-by: Shahzad Lone <shahzadlone@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Shahzad Lone
2019-02-02 23:16:45 +00:00
committed by Junio C Hamano
parent b5101f9297
commit 33de80b1d5
4 changed files with 15 additions and 15 deletions

View File

@ -1901,10 +1901,10 @@ static int type_size_sort(const void *_a, const void *_b)
{
const struct object_entry *a = *(struct object_entry **)_a;
const struct object_entry *b = *(struct object_entry **)_b;
enum object_type a_type = oe_type(a);
enum object_type b_type = oe_type(b);
unsigned long a_size = SIZE(a);
unsigned long b_size = SIZE(b);
const enum object_type a_type = oe_type(a);
const enum object_type b_type = oe_type(b);
const unsigned long a_size = SIZE(a);
const unsigned long b_size = SIZE(b);
if (a_type > b_type)
return -1;
@ -1919,7 +1919,7 @@ static int type_size_sort(const void *_a, const void *_b)
if (a->preferred_base < b->preferred_base)
return 1;
if (use_delta_islands) {
int island_cmp = island_delta_cmp(&a->idx.oid, &b->idx.oid);
const int island_cmp = island_delta_cmp(&a->idx.oid, &b->idx.oid);
if (island_cmp)
return island_cmp;
}
@ -2171,7 +2171,7 @@ static unsigned int check_delta_limit(struct object_entry *me, unsigned int n)
struct object_entry *child = DELTA_CHILD(me);
unsigned int m = n;
while (child) {
unsigned int c = check_delta_limit(child, n + 1);
const unsigned int c = check_delta_limit(child, n + 1);
if (m < c)
m = c;
child = DELTA_SIBLING(child);
@ -2226,7 +2226,7 @@ static void find_deltas(struct object_entry **list, unsigned *list_size,
while (window_memory_limit &&
mem_usage > window_memory_limit &&
count > 1) {
uint32_t tail = (idx + window - count) % window;
const uint32_t tail = (idx + window - count) % window;
mem_usage -= free_unpacked(array + tail);
count--;
}