diff-lib: rename 'new' variable
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
e36ede2e1c5141b13baa5696fe01b64c7f7cedf5
1 file changed
+19
-19
diff-lib.c
+19
-19
@@ -302,7 +302,7 @@ static int get_stat_data(const struct cache_entry *ce,
302
}
303
304
static void show_new_file(struct rev_info *revs,
305
- const struct cache_entry *new,
305
+ const struct cache_entry *new_file,
306
int cached, int match_missing)
307
{
308
const struct object_id *oid;
@@ -313,16 +313,16 @@ static void show_new_file(struct rev_info *revs,
313
* New file in the index: it might actually be different in
314
* the working tree.
315
*/
316
- if (get_stat_data(new, &oid, &mode, cached, match_missing,
316
+ if (get_stat_data(new_file, &oid, &mode, cached, match_missing,
317
&dirty_submodule, &revs->diffopt) < 0)
318
return;
319
320
- diff_index_show_file(revs, "+", new, oid, !is_null_oid(oid), mode, dirty_submodule);
320
+ diff_index_show_file(revs, "+", new_file, oid, !is_null_oid(oid), mode, dirty_submodule);
321
}
322
323
static int show_modified(struct rev_info *revs,
324
- const struct cache_entry *old,
325
- const struct cache_entry *new,
324
+ const struct cache_entry *old_entry,
325
+ const struct cache_entry *new_entry,
326
int report_missing,
327
int cached, int match_missing)
328
{
@@ -330,47 +330,47 @@ static int show_modified(struct rev_info *revs,
330
const struct object_id *oid;
331
unsigned dirty_submodule = 0;
332
333
- if (get_stat_data(new, &oid, &mode, cached, match_missing,
333
+ if (get_stat_data(new_entry, &oid, &mode, cached, match_missing,
334
&dirty_submodule, &revs->diffopt) < 0) {
335
if (report_missing)
336
- diff_index_show_file(revs, "-", old,
337
- &old->oid, 1, old->ce_mode,
336
+ diff_index_show_file(revs, "-", old_entry,
337
+ &old_entry->oid, 1, old_entry->ce_mode,
338
0);
339
return -1;
340
}
341
342
if (revs->combine_merges && !cached &&
343
- (oidcmp(oid, &old->oid) || oidcmp(&old->oid, &new->oid))) {
343
+ (oidcmp(oid, &old_entry->oid) || oidcmp(&old_entry->oid, &new_entry->oid))) {
344
struct combine_diff_path *p;
345
- int pathlen = ce_namelen(new);
345
+ int pathlen = ce_namelen(new_entry);
346
347
p = xmalloc(combine_diff_path_size(2, pathlen));
348
p->path = (char *) &p->parent[2];
349
p->next = NULL;
350
- memcpy(p->path, new->name, pathlen);
350
+ memcpy(p->path, new_entry->name, pathlen);
351
p->path[pathlen] = 0;
352
p->mode = mode;
353
oidclr(&p->oid);
354
memset(p->parent, 0, 2 * sizeof(struct combine_diff_parent));
355
p->parent[0].status = DIFF_STATUS_MODIFIED;
356
- p->parent[0].mode = new->ce_mode;
357
- oidcpy(&p->parent[0].oid, &new->oid);
356
+ p->parent[0].mode = new_entry->ce_mode;
357
+ oidcpy(&p->parent[0].oid, &new_entry->oid);
358
p->parent[1].status = DIFF_STATUS_MODIFIED;
359
- p->parent[1].mode = old->ce_mode;
360
- oidcpy(&p->parent[1].oid, &old->oid);
359
+ p->parent[1].mode = old_entry->ce_mode;
360
+ oidcpy(&p->parent[1].oid, &old_entry->oid);
361
show_combined_diff(p, 2, revs->dense_combined_merges, revs);
362
free(p);
363
return 0;
364
}
365
366
- oldmode = old->ce_mode;
367
- if (mode == oldmode && !oidcmp(oid, &old->oid) && !dirty_submodule &&
366
+ oldmode = old_entry->ce_mode;
367
+ if (mode == oldmode && !oidcmp(oid, &old_entry->oid) && !dirty_submodule &&
368
!revs->diffopt.flags.find_copies_harder)
369
return 0;
370
371
diff_change(&revs->diffopt, oldmode, mode,
372
- &old->oid, oid, 1, !is_null_oid(oid),
373
- old->name, 0, dirty_submodule);
372
+ &old_entry->oid, oid, 1, !is_null_oid(oid),
373
+ old_entry->name, 0, dirty_submodule);
374
return 0;
375
}
376