summaryrefslogtreecommitdiff
path: root/diff.c
diff options
context:
space:
mode:
authorBrandon Williams <bmwill@google.com>2018-02-14 18:59:28 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-02-22 18:08:05 (GMT)
commit585c0e2efabee10baf98ad3d8e87aab07f5a82ed (patch)
treecf6e586f947ef78cb1162bfbe2de9a004809bcd1 /diff.c
parentae90bdce8f828348146a55eef863d8b594e0997c (diff)
downloadgit-585c0e2efabee10baf98ad3d8e87aab07f5a82ed.zip
git-585c0e2efabee10baf98ad3d8e87aab07f5a82ed.tar.gz
git-585c0e2efabee10baf98ad3d8e87aab07f5a82ed.tar.bz2
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>
Diffstat (limited to 'diff.c')
-rw-r--r--diff.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/diff.c b/diff.c
index 0a9a0cd..f7df227 100644
--- a/diff.c
+++ b/diff.c
@@ -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)