blame: 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
abeacb25b4db74a13e07efa85b4f2a273628cffe
1 file changed
+17
-16
blame.c
+17
-16
@@ -998,28 +998,29 @@ unsigned blame_entry_score(struct blame_scoreboard *sb, struct blame_entry *e)
998
}
999
1000
/*
1001
- * best_so_far[] and this[] are both a split of an existing blame_entry
1002
- * that passes blame to the parent. Maintain best_so_far the best split
1003
- * so far, by comparing this and best_so_far and copying this into
1001
+ * best_so_far[] and potential[] are both a split of an existing blame_entry
1002
+ * that passes blame to the parent. Maintain best_so_far the best split so
1003
+ * far, by comparing potential and best_so_far and copying potential into
1004
* bst_so_far as needed.
1005
*/
1006
static void copy_split_if_better(struct blame_scoreboard *sb,
1007
struct blame_entry *best_so_far,
1008
- struct blame_entry *this)
1008
+ struct blame_entry *potential)
1009
{
1010
int i;
1011
1012
- if (!this[1].suspect)
1012
+ if (!potential[1].suspect)
1013
return;
1014
if (best_so_far[1].suspect) {
1015
- if (blame_entry_score(sb, &this[1]) < blame_entry_score(sb, &best_so_far[1]))
1015
+ if (blame_entry_score(sb, &potential[1]) <
1016
+ blame_entry_score(sb, &best_so_far[1]))
1017
return;
1018
}
1019
1020
for (i = 0; i < 3; i++)
1020
- blame_origin_incref(this[i].suspect);
1021
+ blame_origin_incref(potential[i].suspect);
1022
decref_split(best_so_far);
1022
- memcpy(best_so_far, this, sizeof(struct blame_entry [3]));
1023
+ memcpy(best_so_far, potential, sizeof(struct blame_entry[3]));
1024
}
1025
1026
/*
@@ -1046,12 +1047,12 @@ static void handle_split(struct blame_scoreboard *sb,
1047
if (ent->num_lines <= tlno)
1048
return;
1049
if (tlno < same) {
1049
- struct blame_entry this[3];
1050
+ struct blame_entry potential[3];
1051
tlno += ent->s_lno;
1052
same += ent->s_lno;
1052
- split_overlap(this, ent, tlno, plno, same, parent);
1053
- copy_split_if_better(sb, split, this);
1054
- decref_split(this);
1053
+ split_overlap(potential, ent, tlno, plno, same, parent);
1054
+ copy_split_if_better(sb, split, potential);
1055
+ decref_split(potential);
1056
}
1057
}
1058
@@ -1273,7 +1274,7 @@ static void find_copy_in_parent(struct blame_scoreboard *sb,
1274
struct diff_filepair *p = diff_queued_diff.queue[i];
1275
struct blame_origin *norigin;
1276
mmfile_t file_p;
1276
- struct blame_entry this[3];
1277
+ struct blame_entry potential[3];
1278
1279
if (!DIFF_FILE_VALID(p->one))
1280
continue; /* does not exist in parent */
@@ -1292,10 +1293,10 @@ static void find_copy_in_parent(struct blame_scoreboard *sb,
1293
1294
for (j = 0; j < num_ents; j++) {
1295
find_copy_in_blob(sb, blame_list[j].ent,
1295
- norigin, this, &file_p);
1296
+ norigin, potential, &file_p);
1297
copy_split_if_better(sb, blame_list[j].split,
1297
- this);
1298
- decref_split(this);
1298
+ potential);
1299
+ decref_split(potential);
1300
}
1301
blame_origin_decref(norigin);
1302
}