From 94a5c5d5b095299f0d693d7d82608a60b23692a4 Mon Sep 17 00:00:00 2001 From: Brandon Williams Date: Wed, 14 Feb 2018 10:59:40 -0800 Subject: [PATCH] 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 Signed-off-by: Junio C Hamano --- diffcore-delta.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/diffcore-delta.c b/diffcore-delta.c index ebe70fb068519b..c83d45a0470d41 100644 --- a/diffcore-delta.c +++ b/diffcore-delta.c @@ -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,