Mercurial > hg
changeset 34630:38463bd96d21
bdiff: re-wrap lines per clang-format
A few too-wide lines corrected, and some places where clang-format
prefers to wrap after the binary operator instead of before. I don't
feel strongly, so I'm leaving the auto-format result as "after the
binary operator".
Differential Revision: https://phab.mercurial-scm.org/D1007
author | Augie Fackler <augie@google.com> |
---|---|
date | Wed, 04 Oct 2017 10:50:54 -0400 |
parents | 2c79a5a0c7f3 |
children | 4dea82ee7945 |
files | mercurial/bdiff.c |
diffstat | 1 files changed, 10 insertions(+), 9 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/bdiff.c Wed Oct 04 10:49:34 2017 -0400 +++ b/mercurial/bdiff.c Wed Oct 04 10:50:54 2017 -0400 @@ -79,7 +79,8 @@ static inline int cmp(struct bdiff_line *a, struct bdiff_line *b) { - return a->hash != b->hash || a->len != b->len || memcmp(a->l, b->l, a->len); + return a->hash != b->hash || a->len != b->len || + memcmp(a->l, b->l, a->len); } static int equatelines(struct bdiff_line *a, int an, struct bdiff_line *b, @@ -211,8 +212,7 @@ } /* expand match to include subsequent popular lines */ - while (mi + mk < a2 && mj + mk < b2 && - a[mi + mk].e == b[mj + mk].e) + while (mi + mk < a2 && mj + mk < b2 && a[mi + mk].e == b[mj + mk].e) mk++; *omi = mi; @@ -238,7 +238,8 @@ if (!l) return NULL; - l->next = (struct bdiff_hunk *)malloc(sizeof(struct bdiff_hunk)); + l->next = + (struct bdiff_hunk *)malloc(sizeof(struct bdiff_hunk)); if (!l->next) return NULL; @@ -274,7 +275,8 @@ return -1; /* sentinel end hunk */ - curr->next = (struct bdiff_hunk *)malloc(sizeof(struct bdiff_hunk)); + curr->next = + (struct bdiff_hunk *)malloc(sizeof(struct bdiff_hunk)); if (!curr->next) return -1; curr = curr->next; @@ -293,10 +295,9 @@ break; if (curr->a2 == next->a1 || curr->b2 == next->b1) - while (curr->a2 < an && curr->b2 < bn - && next->a1 < next->a2 - && next->b1 < next->b2 - && !cmp(a + curr->a2, b + curr->b2)) { + while (curr->a2 < an && curr->b2 < bn && + next->a1 < next->a2 && next->b1 < next->b2 && + !cmp(a + curr->a2, b + curr->b2)) { curr->a2++; next->a1++; curr->b2++;