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>

Brandon Williams committed Feb 14, 2018 at 10:59 UTC 94a5c5d5b095299f0d693d7d82608a60b23692a4
1 file changed +8 -8
diffcore-delta.c
+8 -8
@@ -48,16 +48,16 @@ struct spanhash_top {
48
49 static struct spanhash_top *spanhash_rehash(struct spanhash_top *orig)
50 {
51 - struct spanhash_top *new;
51 + struct spanhash_top *new_spanhash;
52 int i;
53 int osz = 1 << orig->alloc_log2;
54 int sz = osz << 1;
55
56 - new = xmalloc(st_add(sizeof(*orig),
56 + new_spanhash = xmalloc(st_add(sizeof(*orig),
57 st_mult(sizeof(struct spanhash), sz)));
58 - new->alloc_log2 = orig->alloc_log2 + 1;
59 - new->free = INITIAL_FREE(new->alloc_log2);
60 - memset(new->data, 0, sizeof(struct spanhash) * sz);
58 + new_spanhash->alloc_log2 = orig->alloc_log2 + 1;
59 + new_spanhash->free = INITIAL_FREE(new_spanhash->alloc_log2);
60 + memset(new_spanhash->data, 0, sizeof(struct spanhash) * sz);
61 for (i = 0; i < osz; i++) {
62 struct spanhash *o = &(orig->data[i]);
63 int bucket;
@@ -65,11 +65,11 @@ static struct spanhash_top *spanhash_rehash(struct spanhash_top *orig)
65 continue;
66 bucket = o->hashval & (sz - 1);
67 while (1) {
68 - struct spanhash *h = &(new->data[bucket++]);
68 + struct spanhash *h = &(new_spanhash->data[bucket++]);
69 if (!h->cnt) {
70 h->hashval = o->hashval;
71 h->cnt = o->cnt;
72 - new->free--;
72 + new_spanhash->free--;
73 break;
74 }
75 if (sz <= bucket)
@@ -77,7 +77,7 @@ static struct spanhash_top *spanhash_rehash(struct spanhash_top *orig)
77 }
78 }
79 free(orig);
80 - return new;
80 + return new_spanhash;
81 }
82
83 static struct spanhash_top *add_spanhash(struct spanhash_top *top,