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>

Brandon Williams committed Feb 14, 2018 at 10:59 UTC b2e4bafb68ba196c320e0c9eae0cd359403e7d3c
1 file changed +27 -27
builtin/pack-redundant.c
+27 -27
@@ -48,17 +48,17 @@ static inline void llist_item_put(struct llist_item *item)
48
49 static inline struct llist_item *llist_item_get(void)
50 {
51 - struct llist_item *new;
51 + struct llist_item *new_item;
52 if ( free_nodes ) {
53 - new = free_nodes;
53 + new_item = free_nodes;
54 free_nodes = free_nodes->next;
55 } else {
56 int i = 1;
57 - ALLOC_ARRAY(new, BLKSIZE);
57 + ALLOC_ARRAY(new_item, BLKSIZE);
58 for (; i < BLKSIZE; i++)
59 - llist_item_put(&new[i]);
59 + llist_item_put(&new_item[i]);
60 }
61 - return new;
61 + return new_item;
62 }
63
64 static void llist_free(struct llist *list)
@@ -80,26 +80,26 @@ static inline void llist_init(struct llist **list)
80 static struct llist * llist_copy(struct llist *list)
81 {
82 struct llist *ret;
83 - struct llist_item *new, *old, *prev;
83 + struct llist_item *new_item, *old_item, *prev;
84
85 llist_init(&ret);
86
87 if ((ret->size = list->size) == 0)
88 return ret;
89
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;
92
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;
100 }
101 - new->next = NULL;
102 - ret->back = new;
101 + new_item->next = NULL;
102 + ret->back = new_item;
103
104 return ret;
105 }
@@ -108,24 +108,24 @@ static inline struct llist_item *llist_insert(struct llist *list,
108 struct llist_item *after,
109 const unsigned char *sha1)
110 {
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;
114
115 if (after != NULL) {
116 - new->next = after->next;
117 - after->next = new;
116 + new_item->next = after->next;
117 + after->next = new_item;
118 if (after == list->back)
119 - list->back = new;
119 + list->back = new_item;
120 } else {/* insert in front */
121 if (list->size == 0)
122 - list->back = new;
122 + list->back = new_item;
123 else
124 - new->next = list->front;
125 - list->front = new;
124 + new_item->next = list->front;
125 + list->front = new_item;
126 }
127 list->size++;
128 - return new;
128 + return new_item;
129 }
130
131 static inline struct llist_item *llist_insert_back(struct llist *list,