xdiff: remove unused flags parameter
After D2683, the flags parameter in some functions is no longer needed.
Thus removed.
Differential Revision: https://phab.mercurial-scm.org/D2763
--- a/mercurial/thirdparty/xdiff/xdiffi.c Fri Mar 09 14:24:27 2018 -0800
+++ b/mercurial/thirdparty/xdiff/xdiffi.c Fri Mar 09 14:37:55 2018 -0800
@@ -398,12 +398,11 @@
}
-static int recs_match(xrecord_t *rec1, xrecord_t *rec2, int64_t flags)
+static int recs_match(xrecord_t *rec1, xrecord_t *rec2)
{
return (rec1->ha == rec2->ha &&
xdl_recmatch(rec1->ptr, rec1->size,
- rec2->ptr, rec2->size,
- flags));
+ rec2->ptr, rec2->size));
}
/*
@@ -762,10 +761,10 @@
* following group, expand this group to include it. Return 0 on success or -1
* if g cannot be slid down.
*/
-static int group_slide_down(xdfile_t *xdf, struct xdlgroup *g, int64_t flags)
+static int group_slide_down(xdfile_t *xdf, struct xdlgroup *g)
{
if (g->end < xdf->nrec &&
- recs_match(xdf->recs[g->start], xdf->recs[g->end], flags)) {
+ recs_match(xdf->recs[g->start], xdf->recs[g->end])) {
xdf->rchg[g->start++] = 0;
xdf->rchg[g->end++] = 1;
@@ -783,10 +782,10 @@
* into a previous group, expand this group to include it. Return 0 on success
* or -1 if g cannot be slid up.
*/
-static int group_slide_up(xdfile_t *xdf, struct xdlgroup *g, int64_t flags)
+static int group_slide_up(xdfile_t *xdf, struct xdlgroup *g)
{
if (g->start > 0 &&
- recs_match(xdf->recs[g->start - 1], xdf->recs[g->end - 1], flags)) {
+ recs_match(xdf->recs[g->start - 1], xdf->recs[g->end - 1])) {
xdf->rchg[--g->start] = 1;
xdf->rchg[--g->end] = 0;
@@ -847,7 +846,7 @@
end_matching_other = -1;
/* Shift the group backward as much as possible: */
- while (!group_slide_up(xdf, &g, flags))
+ while (!group_slide_up(xdf, &g))
if (group_previous(xdfo, &go))
xdl_bug("group sync broken sliding up");
@@ -862,7 +861,7 @@
/* Now shift the group forward as far as possible: */
while (1) {
- if (group_slide_down(xdf, &g, flags))
+ if (group_slide_down(xdf, &g))
break;
if (group_next(xdfo, &go))
xdl_bug("group sync broken sliding down");
@@ -889,7 +888,7 @@
* that it can align with.
*/
while (go.end == go.start) {
- if (group_slide_up(xdf, &g, flags))
+ if (group_slide_up(xdf, &g))
xdl_bug("match disappeared");
if (group_previous(xdfo, &go))
xdl_bug("group sync broken sliding to match");
@@ -950,7 +949,7 @@
}
while (g.end > best_shift) {
- if (group_slide_up(xdf, &g, flags))
+ if (group_slide_up(xdf, &g))
xdl_bug("best shift unreached");
if (group_previous(xdfo, &go))
xdl_bug("group sync broken sliding to blank line");
--- a/mercurial/thirdparty/xdiff/xprepare.c Fri Mar 09 14:24:27 2018 -0800
+++ b/mercurial/thirdparty/xdiff/xprepare.c Fri Mar 09 14:37:55 2018 -0800
@@ -118,7 +118,7 @@
for (rcrec = cf->rchash[hi]; rcrec; rcrec = rcrec->next)
if (rcrec->ha == rec->ha &&
xdl_recmatch(rcrec->line, rcrec->size,
- rec->ptr, rec->size, cf->flags))
+ rec->ptr, rec->size))
break;
if (!rcrec) {
@@ -273,7 +273,7 @@
if ((cur = blk = xdl_mmfile_first(mf, &bsize)) != NULL) {
for (top = blk + bsize; cur < top; ) {
prev = cur;
- hav = xdl_hash_record(&cur, top, xpp->flags);
+ hav = xdl_hash_record(&cur, top);
if (nrec >= narec) {
narec *= 2;
if (!(rrecs = (xrecord_t **) xdl_realloc(recs, narec * sizeof(xrecord_t *))))
--- a/mercurial/thirdparty/xdiff/xutils.c Fri Mar 09 14:24:27 2018 -0800
+++ b/mercurial/thirdparty/xdiff/xutils.c Fri Mar 09 14:37:55 2018 -0800
@@ -121,14 +121,14 @@
return nl + 1;
}
-int xdl_recmatch(const char *l1, int64_t s1, const char *l2, int64_t s2, int64_t flags)
+int xdl_recmatch(const char *l1, int64_t s1, const char *l2, int64_t s2)
{
if (s1 == s2 && !memcmp(l1, l2, s1))
return 1;
return 0;
}
-uint64_t xdl_hash_record(char const **data, char const *top, int64_t flags) {
+uint64_t xdl_hash_record(char const **data, char const *top) {
uint64_t ha = 5381;
char const *ptr = *data;
--- a/mercurial/thirdparty/xdiff/xutils.h Fri Mar 09 14:24:27 2018 -0800
+++ b/mercurial/thirdparty/xdiff/xutils.h Fri Mar 09 14:37:55 2018 -0800
@@ -30,8 +30,8 @@
void xdl_cha_free(chastore_t *cha);
void *xdl_cha_alloc(chastore_t *cha);
int64_t xdl_guess_lines(mmfile_t *mf, int64_t sample);
-int xdl_recmatch(const char *l1, int64_t s1, const char *l2, int64_t s2, int64_t flags);
-uint64_t xdl_hash_record(char const **data, char const *top, int64_t flags);
+int xdl_recmatch(const char *l1, int64_t s1, const char *l2, int64_t s2);
+uint64_t xdl_hash_record(char const **data, char const *top);
unsigned int xdl_hashbits(unsigned int size);