line-log: 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 3ce9149619cc178cfdaca2bd5f5e81fd0cd6da97
1 file changed +28 -28
line-log.c
+28 -28
@@ -151,29 +151,29 @@ static void range_set_union(struct range_set *out,
151
152 assert(out->nr == 0);
153 while (i < a->nr || j < b->nr) {
154 - struct range *new;
154 + struct range *new_range;
155 if (i < a->nr && j < b->nr) {
156 if (ra[i].start < rb[j].start)
157 - new = &ra[i++];
157 + new_range = &ra[i++];
158 else if (ra[i].start > rb[j].start)
159 - new = &rb[j++];
159 + new_range = &rb[j++];
160 else if (ra[i].end < rb[j].end)
161 - new = &ra[i++];
161 + new_range = &ra[i++];
162 else
163 - new = &rb[j++];
163 + new_range = &rb[j++];
164 } else if (i < a->nr) /* b exhausted */
165 - new = &ra[i++];
165 + new_range = &ra[i++];
166 else /* a exhausted */
167 - new = &rb[j++];
168 - if (new->start == new->end)
167 + new_range = &rb[j++];
168 + if (new_range->start == new_range->end)
169 ; /* empty range */
170 - else if (!out->nr || out->ranges[out->nr-1].end < new->start) {
170 + else if (!out->nr || out->ranges[out->nr-1].end < new_range->start) {
171 range_set_grow(out, 1);
172 - out->ranges[out->nr].start = new->start;
173 - out->ranges[out->nr].end = new->end;
172 + out->ranges[out->nr].start = new_range->start;
173 + out->ranges[out->nr].end = new_range->end;
174 out->nr++;
175 - } else if (out->ranges[out->nr-1].end < new->end) {
176 - out->ranges[out->nr-1].end = new->end;
175 + } else if (out->ranges[out->nr-1].end < new_range->end) {
176 + out->ranges[out->nr-1].end = new_range->end;
177 }
178 }
179 }
@@ -696,18 +696,18 @@ static struct line_log_data *line_log_data_merge(struct line_log_data *a,
696 static void add_line_range(struct rev_info *revs, struct commit *commit,
697 struct line_log_data *range)
698 {
699 - struct line_log_data *old = NULL;
700 - struct line_log_data *new = NULL;
699 + struct line_log_data *old_line = NULL;
700 + struct line_log_data *new_line = NULL;
701
702 - old = lookup_decoration(&revs->line_log_data, &commit->object);
703 - if (old && range) {
704 - new = line_log_data_merge(old, range);
705 - free_line_log_data(old);
702 + old_line = lookup_decoration(&revs->line_log_data, &commit->object);
703 + if (old_line && range) {
704 + new_line = line_log_data_merge(old_line, range);
705 + free_line_log_data(old_line);
706 } else if (range)
707 - new = line_log_data_copy(range);
707 + new_line = line_log_data_copy(range);
708
709 - if (new)
710 - add_decoration(&revs->line_log_data, &commit->object, new);
709 + if (new_line)
710 + add_decoration(&revs->line_log_data, &commit->object, new_line);
711 }
712
713 static void clear_commit_line_range(struct rev_info *revs, struct commit *commit)
@@ -1042,12 +1042,12 @@ static int process_diff_filepair(struct rev_info *rev,
1042
1043 static struct diff_filepair *diff_filepair_dup(struct diff_filepair *pair)
1044 {
1045 - struct diff_filepair *new = xmalloc(sizeof(struct diff_filepair));
1046 - new->one = pair->one;
1047 - new->two = pair->two;
1048 - new->one->count++;
1049 - new->two->count++;
1050 - return new;
1045 + struct diff_filepair *new_filepair = xmalloc(sizeof(struct diff_filepair));
1046 + new_filepair->one = pair->one;
1047 + new_filepair->two = pair->two;
1048 + new_filepair->one->count++;
1049 + new_filepair->two->count++;
1050 + return new_filepair;
1051 }
1052
1053 static void free_diffqueues(int n, struct diff_queue_struct *dq)