Skip to content

Commit b2e4baf

Browse files
bmwillgitster
authored andcommitted
pack-redundant: 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>
1 parent 8adda46 commit b2e4baf

File tree

1 file changed

+27
-27
lines changed

1 file changed

+27
-27
lines changed

builtin/pack-redundant.c

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -48,17 +48,17 @@ static inline void llist_item_put(struct llist_item *item)
4848

4949
static inline struct llist_item *llist_item_get(void)
5050
{
51-
struct llist_item *new;
51+
struct llist_item *new_item;
5252
if ( free_nodes ) {
53-
new = free_nodes;
53+
new_item = free_nodes;
5454
free_nodes = free_nodes->next;
5555
} else {
5656
int i = 1;
57-
ALLOC_ARRAY(new, BLKSIZE);
57+
ALLOC_ARRAY(new_item, BLKSIZE);
5858
for (; i < BLKSIZE; i++)
59-
llist_item_put(&new[i]);
59+
llist_item_put(&new_item[i]);
6060
}
61-
return new;
61+
return new_item;
6262
}
6363

6464
static void llist_free(struct llist *list)
@@ -80,26 +80,26 @@ static inline void llist_init(struct llist **list)
8080
static struct llist * llist_copy(struct llist *list)
8181
{
8282
struct llist *ret;
83-
struct llist_item *new, *old, *prev;
83+
struct llist_item *new_item, *old_item, *prev;
8484

8585
llist_init(&ret);
8686

8787
if ((ret->size = list->size) == 0)
8888
return ret;
8989

90-
new = ret->front = llist_item_get();
91-
new->sha1 = list->front->sha1;
90+
new_item = ret->front = llist_item_get();
91+
new_item->sha1 = list->front->sha1;
9292

93-
old = list->front->next;
94-
while (old) {
95-
prev = new;
96-
new = llist_item_get();
97-
prev->next = new;
98-
new->sha1 = old->sha1;
99-
old = old->next;
93+
old_item = list->front->next;
94+
while (old_item) {
95+
prev = new_item;
96+
new_item = llist_item_get();
97+
prev->next = new_item;
98+
new_item->sha1 = old_item->sha1;
99+
old_item = old_item->next;
100100
}
101-
new->next = NULL;
102-
ret->back = new;
101+
new_item->next = NULL;
102+
ret->back = new_item;
103103

104104
return ret;
105105
}
@@ -108,24 +108,24 @@ static inline struct llist_item *llist_insert(struct llist *list,
108108
struct llist_item *after,
109109
const unsigned char *sha1)
110110
{
111-
struct llist_item *new = llist_item_get();
112-
new->sha1 = sha1;
113-
new->next = NULL;
111+
struct llist_item *new_item = llist_item_get();
112+
new_item->sha1 = sha1;
113+
new_item->next = NULL;
114114

115115
if (after != NULL) {
116-
new->next = after->next;
117-
after->next = new;
116+
new_item->next = after->next;
117+
after->next = new_item;
118118
if (after == list->back)
119-
list->back = new;
119+
list->back = new_item;
120120
} else {/* insert in front */
121121
if (list->size == 0)
122-
list->back = new;
122+
list->back = new_item;
123123
else
124-
new->next = list->front;
125-
list->front = new;
124+
new_item->next = list->front;
125+
list->front = new_item;
126126
}
127127
list->size++;
128-
return new;
128+
return new_item;
129129
}
130130

131131
static inline struct llist_item *llist_insert_back(struct llist *list,

0 commit comments

Comments
 (0)