diff: rename 'this' 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 585c0e2efabee10baf98ad3d8e87aab07f5a82ed
1 file changed +8 -8
diff.c
+8 -8
@@ -2594,14 +2594,14 @@ struct dirstat_dir {
2594 static long gather_dirstat(struct diff_options *opt, struct dirstat_dir *dir,
2595 unsigned long changed, const char *base, int baselen)
2596 {
2597 - unsigned long this_dir = 0;
2597 + unsigned long sum_changes = 0;
2598 unsigned int sources = 0;
2599 const char *line_prefix = diff_line_prefix(opt);
2600
2601 while (dir->nr) {
2602 struct dirstat_file *f = dir->files;
2603 int namelen = strlen(f->name);
2604 - unsigned long this;
2604 + unsigned long changes;
2605 char *slash;
2606
2607 if (namelen < baselen)
@@ -2611,15 +2611,15 @@ static long gather_dirstat(struct diff_options *opt, struct dirstat_dir *dir,
2611 slash = strchr(f->name + baselen, '/');
2612 if (slash) {
2613 int newbaselen = slash + 1 - f->name;
2614 - this = gather_dirstat(opt, dir, changed, f->name, newbaselen);
2614 + changes = gather_dirstat(opt, dir, changed, f->name, newbaselen);
2615 sources++;
2616 } else {
2617 - this = f->changed;
2617 + changes = f->changed;
2618 dir->files++;
2619 dir->nr--;
2620 sources += 2;
2621 }
2622 - this_dir += this;
2622 + sum_changes += changes;
2623 }
2624
2625 /*
@@ -2629,8 +2629,8 @@ static long gather_dirstat(struct diff_options *opt, struct dirstat_dir *dir,
2629 * under this directory (sources == 1).
2630 */
2631 if (baselen && sources != 1) {
2632 - if (this_dir) {
2633 - int permille = this_dir * 1000 / changed;
2632 + if (sum_changes) {
2633 + int permille = sum_changes * 1000 / changed;
2634 if (permille >= dir->permille) {
2635 fprintf(opt->file, "%s%4d.%01d%% %.*s\n", line_prefix,
2636 permille / 10, permille % 10, baselen, base);
@@ -2639,7 +2639,7 @@ static long gather_dirstat(struct diff_options *opt, struct dirstat_dir *dir,
2639 }
2640 }
2641 }
2642 - return this_dir;
2642 + return sum_changes;
2643 }
2644
2645 static int dirstat_compare(const void *_a, const void *_b)