Skip to content

Commit

Permalink
diffcore-delta: rename 'new' variables
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
bmwill authored and gitster committed Feb 22, 2018
1 parent 63a01c3 commit 94a5c5d
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions diffcore-delta.c
Expand Up @@ -48,36 +48,36 @@ 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;
if (!o->cnt)
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)
bucket = 0;
}
}
free(orig);
return new;
return new_spanhash;
}

static struct spanhash_top *add_spanhash(struct spanhash_top *top,
Expand Down

0 comments on commit 94a5c5d

Please sign in to comment.