##// END OF EJS Templates
xdiff: resolve signed unsigned comparison warning...
Jun Wu -
r36844:e5b14f5b default
parent child Browse files
Show More
@@ -1015,8 +1015,6 b' void xdl_free_script(xdchange_t *xscr) {'
1015 xdchange_t *xdl_get_hunk(xdchange_t **xscr)
1015 xdchange_t *xdl_get_hunk(xdchange_t **xscr)
1016 {
1016 {
1017 xdchange_t *xch, *xchp, *lxch;
1017 xdchange_t *xch, *xchp, *lxch;
1018 int64_t max_common = 0;
1019 int64_t max_ignorable = 0;
1020 uint64_t ignored = 0; /* number of ignored blank lines */
1018 uint64_t ignored = 0; /* number of ignored blank lines */
1021
1019
1022 /* remove ignorable changes that are too far before other changes */
1020 /* remove ignorable changes that are too far before other changes */
@@ -1024,7 +1022,7 b' xdchange_t *xdl_get_hunk(xdchange_t **xs'
1024 xch = xchp->next;
1022 xch = xchp->next;
1025
1023
1026 if (xch == NULL ||
1024 if (xch == NULL ||
1027 xch->i1 - (xchp->i1 + xchp->chg1) >= max_ignorable)
1025 xch->i1 - (xchp->i1 + xchp->chg1) >= 0)
1028 *xscr = xch;
1026 *xscr = xch;
1029 }
1027 }
1030
1028
@@ -1035,16 +1033,16 b' xdchange_t *xdl_get_hunk(xdchange_t **xs'
1035
1033
1036 for (xchp = *xscr, xch = xchp->next; xch; xchp = xch, xch = xch->next) {
1034 for (xchp = *xscr, xch = xchp->next; xch; xchp = xch, xch = xch->next) {
1037 int64_t distance = xch->i1 - (xchp->i1 + xchp->chg1);
1035 int64_t distance = xch->i1 - (xchp->i1 + xchp->chg1);
1038 if (distance > max_common)
1036 if (distance > 0)
1039 break;
1037 break;
1040
1038
1041 if (distance < max_ignorable && (!xch->ignore || lxch == xchp)) {
1039 if (distance < 0 && (!xch->ignore || lxch == xchp)) {
1042 lxch = xch;
1040 lxch = xch;
1043 ignored = 0;
1041 ignored = 0;
1044 } else if (distance < max_ignorable && xch->ignore) {
1042 } else if (distance < 0 && xch->ignore) {
1045 ignored += xch->chg2;
1043 ignored += xch->chg2;
1046 } else if (lxch != xchp &&
1044 } else if (lxch != xchp &&
1047 xch->i1 + ignored - (lxch->i1 + lxch->chg1) > max_common) {
1045 xch->i1 + ignored - (lxch->i1 + lxch->chg1) > 0) {
1048 break;
1046 break;
1049 } else if (!xch->ignore) {
1047 } else if (!xch->ignore) {
1050 lxch = xch;
1048 lxch = xch;
General Comments 0
You need to be logged in to leave comments. Login now