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>
This commit is contained in:
Brandon Williams 2018-02-14 10:59:28 -08:00 committed by Junio C Hamano
parent ae90bdce8f
commit 585c0e2efa

16
diff.c
View file

@ -2594,14 +2594,14 @@ struct dirstat_dir {
static long gather_dirstat(struct diff_options *opt, struct dirstat_dir *dir,
unsigned long changed, const char *base, int baselen)
{
unsigned long this_dir = 0;
unsigned long sum_changes = 0;
unsigned int sources = 0;
const char *line_prefix = diff_line_prefix(opt);
while (dir->nr) {
struct dirstat_file *f = dir->files;
int namelen = strlen(f->name);
unsigned long this;
unsigned long changes;
char *slash;
if (namelen < baselen)
@ -2611,15 +2611,15 @@ static long gather_dirstat(struct diff_options *opt, struct dirstat_dir *dir,
slash = strchr(f->name + baselen, '/');
if (slash) {
int newbaselen = slash + 1 - f->name;
this = gather_dirstat(opt, dir, changed, f->name, newbaselen);
changes = gather_dirstat(opt, dir, changed, f->name, newbaselen);
sources++;
} else {
this = f->changed;
changes = f->changed;
dir->files++;
dir->nr--;
sources += 2;
}
this_dir += this;
sum_changes += changes;
}
/*
@ -2629,8 +2629,8 @@ static long gather_dirstat(struct diff_options *opt, struct dirstat_dir *dir,
* under this directory (sources == 1).
*/
if (baselen && sources != 1) {
if (this_dir) {
int permille = this_dir * 1000 / changed;
if (sum_changes) {
int permille = sum_changes * 1000 / changed;
if (permille >= dir->permille) {
fprintf(opt->file, "%s%4d.%01d%% %.*s\n", line_prefix,
permille / 10, permille % 10, baselen, base);
@ -2639,7 +2639,7 @@ static long gather_dirstat(struct diff_options *opt, struct dirstat_dir *dir,
}
}
}
return this_dir;
return sum_changes;
}
static int dirstat_compare(const void *_a, const void *_b)