diffcore-delta: rename 'new' variables

Rename C++ keyword in order to bring the codebase closer to being able
to be compiled with a C++ compiler.

Signed-off-by: Brandon Williams <bmwill@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Brandon Williams 2018-02-14 10:59:40 -08:00 committed by Junio C Hamano
parent 63a01c3f79
commit 94a5c5d5b0

View File

@ -48,16 +48,16 @@ struct spanhash_top {
static struct spanhash_top *spanhash_rehash(struct spanhash_top *orig)
{
struct spanhash_top *new;
struct spanhash_top *new_spanhash;
int i;
int osz = 1 << orig->alloc_log2;
int sz = osz << 1;
new = xmalloc(st_add(sizeof(*orig),
new_spanhash = xmalloc(st_add(sizeof(*orig),
st_mult(sizeof(struct spanhash), sz)));
new->alloc_log2 = orig->alloc_log2 + 1;
new->free = INITIAL_FREE(new->alloc_log2);
memset(new->data, 0, sizeof(struct spanhash) * sz);
new_spanhash->alloc_log2 = orig->alloc_log2 + 1;
new_spanhash->free = INITIAL_FREE(new_spanhash->alloc_log2);
memset(new_spanhash->data, 0, sizeof(struct spanhash) * sz);
for (i = 0; i < osz; i++) {
struct spanhash *o = &(orig->data[i]);
int bucket;
@ -65,11 +65,11 @@ static struct spanhash_top *spanhash_rehash(struct spanhash_top *orig)
continue;
bucket = o->hashval & (sz - 1);
while (1) {
struct spanhash *h = &(new->data[bucket++]);
struct spanhash *h = &(new_spanhash->data[bucket++]);
if (!h->cnt) {
h->hashval = o->hashval;
h->cnt = o->cnt;
new->free--;
new_spanhash->free--;
break;
}
if (sz <= bucket)
@ -77,7 +77,7 @@ static struct spanhash_top *spanhash_rehash(struct spanhash_top *orig)
}
}
free(orig);
return new;
return new_spanhash;
}
static struct spanhash_top *add_spanhash(struct spanhash_top *top,