summaryrefslogtreecommitdiffstats
path: root/src/xdiff/xpatience.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/xdiff/xpatience.c')
-rw-r--r--src/xdiff/xpatience.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/src/xdiff/xpatience.c b/src/xdiff/xpatience.c
index 2c65aac386..f6c84c67d8 100644
--- a/src/xdiff/xpatience.c
+++ b/src/xdiff/xpatience.c
@@ -69,7 +69,7 @@ struct hashmap {
*/
unsigned anchor : 1;
} *entries, *first, *last;
- /* were common records found? */
+ // were common records found?
unsigned long has_matches;
mmfile_t *file1, *file2;
xdfenv_t *env;
@@ -86,7 +86,7 @@ static int is_anchor(xpparam_t const *xpp, const char *line)
return 0;
}
-/* The argument "pass" is 1 for the first file, 2 for the second. */
+// The argument "pass" is 1 for the first file, 2 for the second.
static void insert_record(xpparam_t const *xpp, int line, struct hashmap *map,
int pass)
{
@@ -155,7 +155,7 @@ static int fill_hashmap(mmfile_t *file1, mmfile_t *file2,
result->xpp = xpp;
result->env = env;
- /* We know exactly how large we want the hash map */
+ // We know exactly how large we want the hash map
result->alloc = count1 * 2;
result->entries = (struct entry *)
xdl_malloc(result->alloc * sizeof(struct entry));
@@ -163,11 +163,11 @@ static int fill_hashmap(mmfile_t *file1, mmfile_t *file2,
return -1;
memset(result->entries, 0, result->alloc * sizeof(struct entry));
- /* First, fill with entries from the first file */
+ // First, fill with entries from the first file
while (count1--)
insert_record(xpp, line1++, result, 1);
- /* Then search for matches in the second file */
+ // Then search for matches in the second file
while (count2--)
insert_record(xpp, line2++, result, 2);
@@ -185,13 +185,13 @@ static int binary_search(struct entry **sequence, int longest,
while (left + 1 < right) {
int middle = left + (right - left) / 2;
- /* by construction, no two entries can be equal */
+ // by construction, no two entries can be equal
if (sequence[middle]->line2 > entry->line2)
right = middle;
else
left = middle;
}
- /* return the index in "sequence", _not_ the sequence length */
+ // return the index in "sequence", _not_ the sequence length
return left;
}
@@ -216,7 +216,7 @@ static struct entry *find_longest_common_sequence(struct hashmap *map)
*/
int anchor_i = -1;
- /* Added to silence Coverity. */
+ // Added to silence Coverity.
if (sequence == NULL)
return map->first;
@@ -237,13 +237,13 @@ static struct entry *find_longest_common_sequence(struct hashmap *map)
}
}
- /* No common unique lines were found */
+ // No common unique lines were found
if (!longest) {
xdl_free(sequence);
return NULL;
}
- /* Iterate starting at the last element, adjusting the "next" members */
+ // Iterate starting at the last element, adjusting the "next" members
entry = sequence[longest - 1];
entry->next = NULL;
while (entry->previous) {
@@ -273,7 +273,7 @@ static int walk_common_sequence(struct hashmap *map, struct entry *first,
int next1, next2;
for (;;) {
- /* Try to grow the line ranges of common lines */
+ // Try to grow the line ranges of common lines
if (first) {
next1 = first->line1;
next2 = first->line2;
@@ -292,7 +292,7 @@ static int walk_common_sequence(struct hashmap *map, struct entry *first,
line2++;
}
- /* Recurse */
+ // Recurse
if (next1 > line1 || next2 > line2) {
struct hashmap submap;
@@ -343,7 +343,7 @@ static int patience_diff(mmfile_t *file1, mmfile_t *file2,
struct entry *first;
int result = 0;
- /* trivial case: one side is empty */
+ // trivial case: one side is empty
if (!count1) {
while(count2--)
env->xdf2.rchg[line2++ - 1] = 1;
@@ -359,7 +359,7 @@ static int patience_diff(mmfile_t *file1, mmfile_t *file2,
line1, count1, line2, count2))
return -1;
- /* are there any matching lines at all? */
+ // are there any matching lines at all?
if (!map.has_matches) {
while(count1--)
env->xdf1.rchg[line1++ - 1] = 1;
@@ -387,7 +387,7 @@ int xdl_do_patience_diff(mmfile_t *file1, mmfile_t *file2,
if (xdl_prepare_env(file1, file2, xpp, env) < 0)
return -1;
- /* environment is cleaned up in xdl_diff() */
+ // environment is cleaned up in xdl_diff()
return patience_diff(file1, file2, xpp, env,
1, env->xdf1.nrec, 1, env->xdf2.nrec);
}