comparison src/diff.c @ 7817:83861277e6a3 v7.4.1205

commit https://github.com/vim/vim/commit/7454a06e2642d2b37afad1c5e71cec68081ca4ff Author: Bram Moolenaar <Bram@vim.org> Date: Sat Jan 30 15:14:10 2016 +0100 patch 7.4.1205 Problem: Using old style function declarations. Solution: Change to new style function declarations. (script by Hirohito Higashi)
author Christian Brabandt <cb@256bit.org>
date Sat, 30 Jan 2016 15:15:05 +0100
parents af3c41a3c53f
children 05b88224cea1
comparison
equal deleted inserted replaced
7816:fb4674285a7a 7817:83861277e6a3
58 58
59 /* 59 /*
60 * Called when deleting or unloading a buffer: No longer make a diff with it. 60 * Called when deleting or unloading a buffer: No longer make a diff with it.
61 */ 61 */
62 void 62 void
63 diff_buf_delete(buf) 63 diff_buf_delete(buf_T *buf)
64 buf_T *buf;
65 { 64 {
66 int i; 65 int i;
67 tabpage_T *tp; 66 tabpage_T *tp;
68 67
69 for (tp = first_tabpage; tp != NULL; tp = tp->tp_next) 68 for (tp = first_tabpage; tp != NULL; tp = tp->tp_next)
82 /* 81 /*
83 * Check if the current buffer should be added to or removed from the list of 82 * Check if the current buffer should be added to or removed from the list of
84 * diff buffers. 83 * diff buffers.
85 */ 84 */
86 void 85 void
87 diff_buf_adjust(win) 86 diff_buf_adjust(win_T *win)
88 win_T *win;
89 { 87 {
90 win_T *wp; 88 win_T *wp;
91 int i; 89 int i;
92 90
93 if (!win->w_p_diff) 91 if (!win->w_p_diff)
119 * Marks the current buffer as being part of the diff and requiring updating. 117 * Marks the current buffer as being part of the diff and requiring updating.
120 * This must be done before any autocmd, because a command may use info 118 * This must be done before any autocmd, because a command may use info
121 * about the screen contents. 119 * about the screen contents.
122 */ 120 */
123 void 121 void
124 diff_buf_add(buf) 122 diff_buf_add(buf_T *buf)
125 buf_T *buf;
126 { 123 {
127 int i; 124 int i;
128 125
129 if (diff_buf_idx(buf) != DB_COUNT) 126 if (diff_buf_idx(buf) != DB_COUNT)
130 return; /* It's already there. */ 127 return; /* It's already there. */
144 /* 141 /*
145 * Find buffer "buf" in the list of diff buffers for the current tab page. 142 * Find buffer "buf" in the list of diff buffers for the current tab page.
146 * Return its index or DB_COUNT if not found. 143 * Return its index or DB_COUNT if not found.
147 */ 144 */
148 static int 145 static int
149 diff_buf_idx(buf) 146 diff_buf_idx(buf_T *buf)
150 buf_T *buf;
151 { 147 {
152 int idx; 148 int idx;
153 149
154 for (idx = 0; idx < DB_COUNT; ++idx) 150 for (idx = 0; idx < DB_COUNT; ++idx)
155 if (curtab->tp_diffbuf[idx] == buf) 151 if (curtab->tp_diffbuf[idx] == buf)
160 /* 156 /*
161 * Find buffer "buf" in the list of diff buffers for tab page "tp". 157 * Find buffer "buf" in the list of diff buffers for tab page "tp".
162 * Return its index or DB_COUNT if not found. 158 * Return its index or DB_COUNT if not found.
163 */ 159 */
164 static int 160 static int
165 diff_buf_idx_tp(buf, tp) 161 diff_buf_idx_tp(buf_T *buf, tabpage_T *tp)
166 buf_T *buf;
167 tabpage_T *tp;
168 { 162 {
169 int idx; 163 int idx;
170 164
171 for (idx = 0; idx < DB_COUNT; ++idx) 165 for (idx = 0; idx < DB_COUNT; ++idx)
172 if (tp->tp_diffbuf[idx] == buf) 166 if (tp->tp_diffbuf[idx] == buf)
177 /* 171 /*
178 * Mark the diff info involving buffer "buf" as invalid, it will be updated 172 * Mark the diff info involving buffer "buf" as invalid, it will be updated
179 * when info is requested. 173 * when info is requested.
180 */ 174 */
181 void 175 void
182 diff_invalidate(buf) 176 diff_invalidate(buf_T *buf)
183 buf_T *buf;
184 { 177 {
185 tabpage_T *tp; 178 tabpage_T *tp;
186 int i; 179 int i;
187 180
188 for (tp = first_tabpage; tp != NULL; tp = tp->tp_next) 181 for (tp = first_tabpage; tp != NULL; tp = tp->tp_next)
199 192
200 /* 193 /*
201 * Called by mark_adjust(): update line numbers in "curbuf". 194 * Called by mark_adjust(): update line numbers in "curbuf".
202 */ 195 */
203 void 196 void
204 diff_mark_adjust(line1, line2, amount, amount_after) 197 diff_mark_adjust(
205 linenr_T line1; 198 linenr_T line1,
206 linenr_T line2; 199 linenr_T line2,
207 long amount; 200 long amount,
208 long amount_after; 201 long amount_after)
209 { 202 {
210 int idx; 203 int idx;
211 tabpage_T *tp; 204 tabpage_T *tp;
212 205
213 /* Handle all tab pages that use the current buffer in a diff. */ 206 /* Handle all tab pages that use the current buffer in a diff. */
225 * When inserting/deleting lines outside of existing change blocks, create a 218 * When inserting/deleting lines outside of existing change blocks, create a
226 * new change block and update the line numbers in following blocks. 219 * new change block and update the line numbers in following blocks.
227 * When inserting/deleting lines in existing change blocks, update them. 220 * When inserting/deleting lines in existing change blocks, update them.
228 */ 221 */
229 static void 222 static void
230 diff_mark_adjust_tp(tp, idx, line1, line2, amount, amount_after) 223 diff_mark_adjust_tp(
231 tabpage_T *tp; 224 tabpage_T *tp,
232 int idx; 225 int idx,
233 linenr_T line1; 226 linenr_T line1,
234 linenr_T line2; 227 linenr_T line2,
235 long amount; 228 long amount,
236 long amount_after; 229 long amount_after)
237 { 230 {
238 diff_T *dp; 231 diff_T *dp;
239 diff_T *dprev; 232 diff_T *dprev;
240 diff_T *dnext; 233 diff_T *dnext;
241 int i; 234 int i;
477 470
478 /* 471 /*
479 * Allocate a new diff block and link it between "dprev" and "dp". 472 * Allocate a new diff block and link it between "dprev" and "dp".
480 */ 473 */
481 static diff_T * 474 static diff_T *
482 diff_alloc_new(tp, dprev, dp) 475 diff_alloc_new(tabpage_T *tp, diff_T *dprev, diff_T *dp)
483 tabpage_T *tp;
484 diff_T *dprev;
485 diff_T *dp;
486 { 476 {
487 diff_T *dnew; 477 diff_T *dnew;
488 478
489 dnew = (diff_T *)alloc((unsigned)sizeof(diff_T)); 479 dnew = (diff_T *)alloc((unsigned)sizeof(diff_T));
490 if (dnew != NULL) 480 if (dnew != NULL)
503 * end that are equal. Called after inserting lines. 493 * end that are equal. Called after inserting lines.
504 * This may result in a change where all buffers have zero lines, the caller 494 * This may result in a change where all buffers have zero lines, the caller
505 * must take care of removing it. 495 * must take care of removing it.
506 */ 496 */
507 static void 497 static void
508 diff_check_unchanged(tp, dp) 498 diff_check_unchanged(tabpage_T *tp, diff_T *dp)
509 tabpage_T *tp;
510 diff_T *dp;
511 { 499 {
512 int i_org; 500 int i_org;
513 int i_new; 501 int i_new;
514 int off_org, off_new; 502 int off_org, off_new;
515 char_u *line_org; 503 char_u *line_org;
579 /* 567 /*
580 * Check if a diff block doesn't contain invalid line numbers. 568 * Check if a diff block doesn't contain invalid line numbers.
581 * This can happen when the diff program returns invalid results. 569 * This can happen when the diff program returns invalid results.
582 */ 570 */
583 static int 571 static int
584 diff_check_sanity(tp, dp) 572 diff_check_sanity(tabpage_T *tp, diff_T *dp)
585 tabpage_T *tp;
586 diff_T *dp;
587 { 573 {
588 int i; 574 int i;
589 575
590 for (i = 0; i < DB_COUNT; ++i) 576 for (i = 0; i < DB_COUNT; ++i)
591 if (tp->tp_diffbuf[i] != NULL) 577 if (tp->tp_diffbuf[i] != NULL)
597 583
598 /* 584 /*
599 * Mark all diff buffers in the current tab page for redraw. 585 * Mark all diff buffers in the current tab page for redraw.
600 */ 586 */
601 static void 587 static void
602 diff_redraw(dofold) 588 diff_redraw(
603 int dofold; /* also recompute the folds */ 589 int dofold) /* also recompute the folds */
604 { 590 {
605 win_T *wp; 591 win_T *wp;
606 int n; 592 int n;
607 593
608 for (wp = firstwin; wp != NULL; wp = wp->w_next) 594 for (wp = firstwin; wp != NULL; wp = wp->w_next)
631 * Write buffer "buf" to file "name". 617 * Write buffer "buf" to file "name".
632 * Always use 'fileformat' set to "unix". 618 * Always use 'fileformat' set to "unix".
633 * Return FAIL for failure 619 * Return FAIL for failure
634 */ 620 */
635 static int 621 static int
636 diff_write(buf, fname) 622 diff_write(buf_T *buf, char_u *fname)
637 buf_T *buf;
638 char_u *fname;
639 { 623 {
640 int r; 624 int r;
641 char_u *save_ff; 625 char_u *save_ff;
642 626
643 save_ff = buf->b_p_ff; 627 save_ff = buf->b_p_ff;
654 * This uses the ordinary "diff" command. 638 * This uses the ordinary "diff" command.
655 * The buffers are written to a file, also for unmodified buffers (the file 639 * The buffers are written to a file, also for unmodified buffers (the file
656 * could have been produced by autocommands, e.g. the netrw plugin). 640 * could have been produced by autocommands, e.g. the netrw plugin).
657 */ 641 */
658 void 642 void
659 ex_diffupdate(eap) 643 ex_diffupdate(
660 exarg_T *eap UNUSED; /* can be NULL */ 644 exarg_T *eap UNUSED) /* can be NULL */
661 { 645 {
662 buf_T *buf; 646 buf_T *buf;
663 int idx_orig; 647 int idx_orig;
664 int idx_new; 648 int idx_new;
665 char_u *tmp_orig; 649 char_u *tmp_orig;
830 814
831 /* 815 /*
832 * Make a diff between files "tmp_orig" and "tmp_new", results in "tmp_diff". 816 * Make a diff between files "tmp_orig" and "tmp_new", results in "tmp_diff".
833 */ 817 */
834 static void 818 static void
835 diff_file(tmp_orig, tmp_new, tmp_diff) 819 diff_file(
836 char_u *tmp_orig; 820 char_u *tmp_orig,
837 char_u *tmp_new; 821 char_u *tmp_new,
838 char_u *tmp_diff; 822 char_u *tmp_diff)
839 { 823 {
840 char_u *cmd; 824 char_u *cmd;
841 size_t len; 825 size_t len;
842 826
843 #ifdef FEAT_EVAL 827 #ifdef FEAT_EVAL
886 * Create a new version of a file from the current buffer and a diff file. 870 * Create a new version of a file from the current buffer and a diff file.
887 * The buffer is written to a file, also for unmodified buffers (the file 871 * The buffer is written to a file, also for unmodified buffers (the file
888 * could have been produced by autocommands, e.g. the netrw plugin). 872 * could have been produced by autocommands, e.g. the netrw plugin).
889 */ 873 */
890 void 874 void
891 ex_diffpatch(eap) 875 ex_diffpatch(exarg_T *eap)
892 exarg_T *eap;
893 { 876 {
894 char_u *tmp_orig; /* name of original temp file */ 877 char_u *tmp_orig; /* name of original temp file */
895 char_u *tmp_new; /* name of patched temp file */ 878 char_u *tmp_new; /* name of patched temp file */
896 char_u *buf = NULL; 879 char_u *buf = NULL;
897 size_t buflen; 880 size_t buflen;
1081 1064
1082 /* 1065 /*
1083 * Split the window and edit another file, setting options to show the diffs. 1066 * Split the window and edit another file, setting options to show the diffs.
1084 */ 1067 */
1085 void 1068 void
1086 ex_diffsplit(eap) 1069 ex_diffsplit(exarg_T *eap)
1087 exarg_T *eap;
1088 { 1070 {
1089 win_T *old_curwin = curwin; 1071 win_T *old_curwin = curwin;
1090 buf_T *old_curbuf = curbuf; 1072 buf_T *old_curbuf = curbuf;
1091 1073
1092 #ifdef FEAT_GUI 1074 #ifdef FEAT_GUI
1124 1106
1125 /* 1107 /*
1126 * Set options to show diffs for the current window. 1108 * Set options to show diffs for the current window.
1127 */ 1109 */
1128 void 1110 void
1129 ex_diffthis(eap) 1111 ex_diffthis(exarg_T *eap UNUSED)
1130 exarg_T *eap UNUSED;
1131 { 1112 {
1132 /* Set 'diff', 'scrollbind' on and 'wrap' off. */ 1113 /* Set 'diff', 'scrollbind' on and 'wrap' off. */
1133 diff_win_options(curwin, TRUE); 1114 diff_win_options(curwin, TRUE);
1134 } 1115 }
1135 1116
1136 /* 1117 /*
1137 * Set options in window "wp" for diff mode. 1118 * Set options in window "wp" for diff mode.
1138 */ 1119 */
1139 void 1120 void
1140 diff_win_options(wp, addbuf) 1121 diff_win_options(
1141 win_T *wp; 1122 win_T *wp,
1142 int addbuf; /* Add buffer to diff. */ 1123 int addbuf) /* Add buffer to diff. */
1143 { 1124 {
1144 # ifdef FEAT_FOLDING 1125 # ifdef FEAT_FOLDING
1145 win_T *old_curwin = curwin; 1126 win_T *old_curwin = curwin;
1146 1127
1147 /* close the manually opened folds */ 1128 /* close the manually opened folds */
1207 /* 1188 /*
1208 * Set options not to show diffs. For the current window or all windows. 1189 * Set options not to show diffs. For the current window or all windows.
1209 * Only in the current tab page. 1190 * Only in the current tab page.
1210 */ 1191 */
1211 void 1192 void
1212 ex_diffoff(eap) 1193 ex_diffoff(exarg_T *eap)
1213 exarg_T *eap;
1214 { 1194 {
1215 win_T *wp; 1195 win_T *wp;
1216 #ifdef FEAT_SCROLLBIND 1196 #ifdef FEAT_SCROLLBIND
1217 int diffwin = FALSE; 1197 int diffwin = FALSE;
1218 #endif 1198 #endif
1277 1257
1278 /* 1258 /*
1279 * Read the diff output and add each entry to the diff list. 1259 * Read the diff output and add each entry to the diff list.
1280 */ 1260 */
1281 static void 1261 static void
1282 diff_read(idx_orig, idx_new, fname) 1262 diff_read(
1283 int idx_orig; /* idx of original file */ 1263 int idx_orig, /* idx of original file */
1284 int idx_new; /* idx of new file */ 1264 int idx_new, /* idx of new file */
1285 char_u *fname; /* name of diff output file */ 1265 char_u *fname) /* name of diff output file */
1286 { 1266 {
1287 FILE *fd; 1267 FILE *fd;
1288 diff_T *dprev = NULL; 1268 diff_T *dprev = NULL;
1289 diff_T *dp = curtab->tp_first_diff; 1269 diff_T *dp = curtab->tp_first_diff;
1290 diff_T *dn, *dpl; 1270 diff_T *dn, *dpl;
1471 1451
1472 /* 1452 /*
1473 * Copy an entry at "dp" from "idx_orig" to "idx_new". 1453 * Copy an entry at "dp" from "idx_orig" to "idx_new".
1474 */ 1454 */
1475 static void 1455 static void
1476 diff_copy_entry(dprev, dp, idx_orig, idx_new) 1456 diff_copy_entry(
1477 diff_T *dprev; 1457 diff_T *dprev,
1478 diff_T *dp; 1458 diff_T *dp,
1479 int idx_orig; 1459 int idx_orig,
1480 int idx_new; 1460 int idx_new)
1481 { 1461 {
1482 long off; 1462 long off;
1483 1463
1484 if (dprev == NULL) 1464 if (dprev == NULL)
1485 off = 0; 1465 off = 0;
1492 1472
1493 /* 1473 /*
1494 * Clear the list of diffblocks for tab page "tp". 1474 * Clear the list of diffblocks for tab page "tp".
1495 */ 1475 */
1496 void 1476 void
1497 diff_clear(tp) 1477 diff_clear(tabpage_T *tp)
1498 tabpage_T *tp;
1499 { 1478 {
1500 diff_T *p, *next_p; 1479 diff_T *p, *next_p;
1501 1480
1502 for (p = tp->tp_first_diff; p != NULL; p = next_p) 1481 for (p = tp->tp_first_diff; p != NULL; p = next_p)
1503 { 1482 {
1515 * Returns > 0 for inserting that many filler lines above it (never happens 1494 * Returns > 0 for inserting that many filler lines above it (never happens
1516 * when 'diffopt' doesn't contain "filler"). 1495 * when 'diffopt' doesn't contain "filler").
1517 * This should only be used for windows where 'diff' is set. 1496 * This should only be used for windows where 'diff' is set.
1518 */ 1497 */
1519 int 1498 int
1520 diff_check(wp, lnum) 1499 diff_check(win_T *wp, linenr_T lnum)
1521 win_T *wp;
1522 linenr_T lnum;
1523 { 1500 {
1524 int idx; /* index in tp_diffbuf[] for this buffer */ 1501 int idx; /* index in tp_diffbuf[] for this buffer */
1525 diff_T *dp; 1502 diff_T *dp;
1526 int maxcount; 1503 int maxcount;
1527 int i; 1504 int i;
1609 1586
1610 /* 1587 /*
1611 * Compare two entries in diff "*dp" and return TRUE if they are equal. 1588 * Compare two entries in diff "*dp" and return TRUE if they are equal.
1612 */ 1589 */
1613 static int 1590 static int
1614 diff_equal_entry(dp, idx1, idx2) 1591 diff_equal_entry(diff_T *dp, int idx1, int idx2)
1615 diff_T *dp;
1616 int idx1;
1617 int idx2;
1618 { 1592 {
1619 int i; 1593 int i;
1620 char_u *line; 1594 char_u *line;
1621 int cmp; 1595 int cmp;
1622 1596
1642 /* 1616 /*
1643 * Compare strings "s1" and "s2" according to 'diffopt'. 1617 * Compare strings "s1" and "s2" according to 'diffopt'.
1644 * Return non-zero when they are different. 1618 * Return non-zero when they are different.
1645 */ 1619 */
1646 static int 1620 static int
1647 diff_cmp(s1, s2) 1621 diff_cmp(char_u *s1, char_u *s2)
1648 char_u *s1;
1649 char_u *s2;
1650 { 1622 {
1651 char_u *p1, *p2; 1623 char_u *p1, *p2;
1652 #ifdef FEAT_MBYTE 1624 #ifdef FEAT_MBYTE
1653 int l; 1625 int l;
1654 #endif 1626 #endif
1707 1679
1708 /* 1680 /*
1709 * Return the number of filler lines above "lnum". 1681 * Return the number of filler lines above "lnum".
1710 */ 1682 */
1711 int 1683 int
1712 diff_check_fill(wp, lnum) 1684 diff_check_fill(win_T *wp, linenr_T lnum)
1713 win_T *wp;
1714 linenr_T lnum;
1715 { 1685 {
1716 int n; 1686 int n;
1717 1687
1718 /* be quick when there are no filler lines */ 1688 /* be quick when there are no filler lines */
1719 if (!(diff_flags & DIFF_FILLER)) 1689 if (!(diff_flags & DIFF_FILLER))
1727 /* 1697 /*
1728 * Set the topline of "towin" to match the position in "fromwin", so that they 1698 * Set the topline of "towin" to match the position in "fromwin", so that they
1729 * show the same diff'ed lines. 1699 * show the same diff'ed lines.
1730 */ 1700 */
1731 void 1701 void
1732 diff_set_topline(fromwin, towin) 1702 diff_set_topline(win_T *fromwin, win_T *towin)
1733 win_T *fromwin;
1734 win_T *towin;
1735 { 1703 {
1736 buf_T *frombuf = fromwin->w_buffer; 1704 buf_T *frombuf = fromwin->w_buffer;
1737 linenr_T lnum = fromwin->w_topline; 1705 linenr_T lnum = fromwin->w_topline;
1738 int fromidx; 1706 int fromidx;
1739 int toidx; 1707 int toidx;
1849 1817
1850 /* 1818 /*
1851 * This is called when 'diffopt' is changed. 1819 * This is called when 'diffopt' is changed.
1852 */ 1820 */
1853 int 1821 int
1854 diffopt_changed() 1822 diffopt_changed(void)
1855 { 1823 {
1856 char_u *p; 1824 char_u *p;
1857 int diff_context_new = 6; 1825 int diff_context_new = 6;
1858 int diff_flags_new = 0; 1826 int diff_flags_new = 0;
1859 int diff_foldcolumn_new = 2; 1827 int diff_foldcolumn_new = 2;
1927 1895
1928 /* 1896 /*
1929 * Return TRUE if 'diffopt' contains "horizontal". 1897 * Return TRUE if 'diffopt' contains "horizontal".
1930 */ 1898 */
1931 int 1899 int
1932 diffopt_horizontal() 1900 diffopt_horizontal(void)
1933 { 1901 {
1934 return (diff_flags & DIFF_HORIZONTAL) != 0; 1902 return (diff_flags & DIFF_HORIZONTAL) != 0;
1935 } 1903 }
1936 1904
1937 /* 1905 /*
1938 * Find the difference within a changed line. 1906 * Find the difference within a changed line.
1939 * Returns TRUE if the line was added, no other buffer has it. 1907 * Returns TRUE if the line was added, no other buffer has it.
1940 */ 1908 */
1941 int 1909 int
1942 diff_find_change(wp, lnum, startp, endp) 1910 diff_find_change(
1943 win_T *wp; 1911 win_T *wp,
1944 linenr_T lnum; 1912 linenr_T lnum,
1945 int *startp; /* first char of the change */ 1913 int *startp, /* first char of the change */
1946 int *endp; /* last char of the change */ 1914 int *endp) /* last char of the change */
1947 { 1915 {
1948 char_u *line_org; 1916 char_u *line_org;
1949 char_u *line_new; 1917 char_u *line_new;
1950 int i; 1918 int i;
1951 int si_org, si_new; 1919 int si_org, si_new;
2061 * Return TRUE if line "lnum" is not close to a diff block, this line should 2029 * Return TRUE if line "lnum" is not close to a diff block, this line should
2062 * be in a fold. 2030 * be in a fold.
2063 * Return FALSE if there are no diff blocks at all in this window. 2031 * Return FALSE if there are no diff blocks at all in this window.
2064 */ 2032 */
2065 int 2033 int
2066 diff_infold(wp, lnum) 2034 diff_infold(win_T *wp, linenr_T lnum)
2067 win_T *wp;
2068 linenr_T lnum;
2069 { 2035 {
2070 int i; 2036 int i;
2071 int idx = -1; 2037 int idx = -1;
2072 int other = FALSE; 2038 int other = FALSE;
2073 diff_T *dp; 2039 diff_T *dp;
2110 2076
2111 /* 2077 /*
2112 * "dp" and "do" commands. 2078 * "dp" and "do" commands.
2113 */ 2079 */
2114 void 2080 void
2115 nv_diffgetput(put, count) 2081 nv_diffgetput(int put, long count)
2116 int put;
2117 long count;
2118 { 2082 {
2119 exarg_T ea; 2083 exarg_T ea;
2120 char_u buf[30]; 2084 char_u buf[30];
2121 2085
2122 if (count == 0) 2086 if (count == 0)
2139 /* 2103 /*
2140 * ":diffget" 2104 * ":diffget"
2141 * ":diffput" 2105 * ":diffput"
2142 */ 2106 */
2143 void 2107 void
2144 ex_diffgetput(eap) 2108 ex_diffgetput(exarg_T *eap)
2145 exarg_T *eap;
2146 { 2109 {
2147 linenr_T lnum; 2110 linenr_T lnum;
2148 int count; 2111 int count;
2149 linenr_T off = 0; 2112 linenr_T off = 0;
2150 diff_T *dp; 2113 diff_T *dp;
2462 * Update folds for all diff buffers for entry "dp". 2425 * Update folds for all diff buffers for entry "dp".
2463 * Skip buffer with index "skip_idx". 2426 * Skip buffer with index "skip_idx".
2464 * When there are no diffs, all folds are removed. 2427 * When there are no diffs, all folds are removed.
2465 */ 2428 */
2466 static void 2429 static void
2467 diff_fold_update(dp, skip_idx) 2430 diff_fold_update(diff_T *dp, int skip_idx)
2468 diff_T *dp;
2469 int skip_idx;
2470 { 2431 {
2471 int i; 2432 int i;
2472 win_T *wp; 2433 win_T *wp;
2473 2434
2474 for (wp = firstwin; wp != NULL; wp = wp->w_next) 2435 for (wp = firstwin; wp != NULL; wp = wp->w_next)
2481 2442
2482 /* 2443 /*
2483 * Return TRUE if buffer "buf" is in diff-mode. 2444 * Return TRUE if buffer "buf" is in diff-mode.
2484 */ 2445 */
2485 int 2446 int
2486 diff_mode_buf(buf) 2447 diff_mode_buf(buf_T *buf)
2487 buf_T *buf;
2488 { 2448 {
2489 tabpage_T *tp; 2449 tabpage_T *tp;
2490 2450
2491 for (tp = first_tabpage; tp != NULL; tp = tp->tp_next) 2451 for (tp = first_tabpage; tp != NULL; tp = tp->tp_next)
2492 if (diff_buf_idx_tp(buf, tp) != DB_COUNT) 2452 if (diff_buf_idx_tp(buf, tp) != DB_COUNT)
2497 /* 2457 /*
2498 * Move "count" times in direction "dir" to the next diff block. 2458 * Move "count" times in direction "dir" to the next diff block.
2499 * Return FAIL if there isn't such a diff block. 2459 * Return FAIL if there isn't such a diff block.
2500 */ 2460 */
2501 int 2461 int
2502 diff_move_to(dir, count) 2462 diff_move_to(int dir, long count)
2503 int dir;
2504 long count;
2505 { 2463 {
2506 int idx; 2464 int idx;
2507 linenr_T lnum = curwin->w_cursor.lnum; 2465 linenr_T lnum = curwin->w_cursor.lnum;
2508 diff_T *dp; 2466 diff_T *dp;
2509 2467
2552 2510
2553 return OK; 2511 return OK;
2554 } 2512 }
2555 2513
2556 linenr_T 2514 linenr_T
2557 diff_get_corresponding_line(buf1, lnum1, buf2, lnum3) 2515 diff_get_corresponding_line(
2558 buf_T *buf1; 2516 buf_T *buf1,
2559 linenr_T lnum1; 2517 linenr_T lnum1,
2560 buf_T *buf2; 2518 buf_T *buf2,
2561 linenr_T lnum3; 2519 linenr_T lnum3)
2562 { 2520 {
2563 int idx1; 2521 int idx1;
2564 int idx2; 2522 int idx2;
2565 diff_T *dp; 2523 diff_T *dp;
2566 int baseline = 0; 2524 int baseline = 0;
2626 /* 2584 /*
2627 * For line "lnum" in the current window find the equivalent lnum in window 2585 * For line "lnum" in the current window find the equivalent lnum in window
2628 * "wp", compensating for inserted/deleted lines. 2586 * "wp", compensating for inserted/deleted lines.
2629 */ 2587 */
2630 linenr_T 2588 linenr_T
2631 diff_lnum_win(lnum, wp) 2589 diff_lnum_win(linenr_T lnum, win_T *wp)
2632 linenr_T lnum;
2633 win_T *wp;
2634 { 2590 {
2635 diff_T *dp; 2591 diff_T *dp;
2636 int idx; 2592 int idx;
2637 int i; 2593 int i;
2638 linenr_T n; 2594 linenr_T n;