Commit 585c0e2e authored by Brandon Williams's avatar Brandon Williams Committed by Junio C Hamano

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: default avatarBrandon Williams <bmwill@google.com>
Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
parent ae90bdce
......@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment