diff src/move.c @ 7829:2a8d6b2dd925 v7.4.1211

commit https://github.com/vim/vim/commit/9b57814db13c29ecb08260b36923c0e1c8a373a9 Author: Bram Moolenaar <Bram@vim.org> Date: Sat Jan 30 19:39:49 2016 +0100 patch 7.4.1211 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 19:45:04 +0100
parents 37c929c4a073
children 24b43dd167eb
line wrap: on
line diff
--- a/src/move.c
+++ b/src/move.c
@@ -48,8 +48,7 @@ static void max_topfill(void);
  * wp->w_topline changed.
  */
     static void
-comp_botline(wp)
-    win_T	*wp;
+comp_botline(win_T *wp)
 {
     int		n;
     linenr_T	lnum;
@@ -129,8 +128,7 @@ comp_botline(wp)
  * set.
  */
     static void
-redraw_for_cursorline(wp)
-    win_T *wp;
+redraw_for_cursorline(win_T *wp)
 {
     if ((wp->w_p_rnu
 #ifdef FEAT_SYN_HL
@@ -150,7 +148,7 @@ redraw_for_cursorline(wp)
  * Used to update the screen before printing a message.
  */
     void
-update_topline_redraw()
+update_topline_redraw(void)
 {
     update_topline();
     if (must_redraw)
@@ -161,7 +159,7 @@ update_topline_redraw()
  * Update curwin->w_topline to move the cursor onto the screen.
  */
     void
-update_topline()
+update_topline(void)
 {
     long	line_count;
     int		halfheight;
@@ -420,7 +418,7 @@ update_topline()
  * When 'scrolljump' is negative use it as a percentage of the window height.
  */
     static int
-scrolljump_value()
+scrolljump_value(void)
 {
     if (p_sj >= 0)
 	return (int)p_sj;
@@ -432,7 +430,7 @@ scrolljump_value()
  * current window.
  */
     static int
-check_top_offset()
+check_top_offset(void)
 {
     lineoff_T	loff;
     int		n;
@@ -470,7 +468,7 @@ check_top_offset()
 }
 
     void
-update_curswant()
+update_curswant(void)
 {
     if (curwin->w_set_curswant)
     {
@@ -484,8 +482,7 @@ update_curswant()
  * Check if the cursor has moved.  Set the w_valid flag accordingly.
  */
     void
-check_cursor_moved(wp)
-    win_T	*wp;
+check_cursor_moved(win_T *wp)
 {
     if (wp->w_cursor.lnum != wp->w_valid_cursor.lnum)
     {
@@ -516,14 +513,13 @@ check_cursor_moved(wp)
  * be redrawn.  E.g, when changing the 'wrap' option or folding.
  */
     void
-changed_window_setting()
+changed_window_setting(void)
 {
     changed_window_setting_win(curwin);
 }
 
     void
-changed_window_setting_win(wp)
-    win_T	*wp;
+changed_window_setting_win(win_T *wp)
 {
     wp->w_lines_valid = 0;
     changed_line_abv_curs_win(wp);
@@ -535,9 +531,7 @@ changed_window_setting_win(wp)
  * Set wp->w_topline to a certain number.
  */
     void
-set_topline(wp, lnum)
-    win_T	*wp;
-    linenr_T	lnum;
+set_topline(win_T *wp, linenr_T lnum)
 {
 #ifdef FEAT_FOLDING
     /* go to first of folded lines */
@@ -563,15 +557,14 @@ set_topline(wp, lnum)
  * Need to take care of w_botline separately!
  */
     void
-changed_cline_bef_curs()
+changed_cline_bef_curs(void)
 {
     curwin->w_valid &= ~(VALID_WROW|VALID_WCOL|VALID_VIRTCOL
 						|VALID_CHEIGHT|VALID_TOPLINE);
 }
 
     void
-changed_cline_bef_curs_win(wp)
-    win_T	*wp;
+changed_cline_bef_curs_win(win_T *wp)
 {
     wp->w_valid &= ~(VALID_WROW|VALID_WCOL|VALID_VIRTCOL
 						|VALID_CHEIGHT|VALID_TOPLINE);
@@ -583,15 +576,14 @@ changed_cline_bef_curs_win(wp)
  * Need to take care of w_botline separately!
  */
     void
-changed_line_abv_curs()
+changed_line_abv_curs(void)
 {
     curwin->w_valid &= ~(VALID_WROW|VALID_WCOL|VALID_VIRTCOL|VALID_CROW
 						|VALID_CHEIGHT|VALID_TOPLINE);
 }
 
     void
-changed_line_abv_curs_win(wp)
-    win_T	*wp;
+changed_line_abv_curs_win(win_T *wp)
 {
     wp->w_valid &= ~(VALID_WROW|VALID_WCOL|VALID_VIRTCOL|VALID_CROW
 						|VALID_CHEIGHT|VALID_TOPLINE);
@@ -601,7 +593,7 @@ changed_line_abv_curs_win(wp)
  * Make sure the value of curwin->w_botline is valid.
  */
     void
-validate_botline()
+validate_botline(void)
 {
     if (!(curwin->w_valid & VALID_BOTLINE))
 	comp_botline(curwin);
@@ -611,21 +603,20 @@ validate_botline()
  * Mark curwin->w_botline as invalid (because of some change in the buffer).
  */
     void
-invalidate_botline()
+invalidate_botline(void)
 {
     curwin->w_valid &= ~(VALID_BOTLINE|VALID_BOTLINE_AP);
 }
 
     void
-invalidate_botline_win(wp)
-    win_T	*wp;
+invalidate_botline_win(win_T *wp)
 {
     wp->w_valid &= ~(VALID_BOTLINE|VALID_BOTLINE_AP);
 }
 
     void
-approximate_botline_win(wp)
-    win_T	*wp;
+approximate_botline_win(
+    win_T	*wp)
 {
     wp->w_valid &= ~VALID_BOTLINE;
 }
@@ -634,7 +625,7 @@ approximate_botline_win(wp)
  * Return TRUE if curwin->w_wrow and curwin->w_wcol are valid.
  */
     int
-cursor_valid()
+cursor_valid(void)
 {
     check_cursor_moved(curwin);
     return ((curwin->w_valid & (VALID_WROW|VALID_WCOL)) ==
@@ -646,7 +637,7 @@ cursor_valid()
  * w_topline must be valid, you may need to call update_topline() first!
  */
     void
-validate_cursor()
+validate_cursor(void)
 {
     check_cursor_moved(curwin);
     if ((curwin->w_valid & (VALID_WCOL|VALID_WROW)) != (VALID_WCOL|VALID_WROW))
@@ -658,7 +649,7 @@ validate_cursor()
  * validate w_cline_row.
  */
     void
-validate_cline_row()
+validate_cline_row(void)
 {
     /*
      * First make sure that w_topline is valid (after moving the cursor).
@@ -675,8 +666,7 @@ validate_cline_row()
  * of wp->w_topline.
  */
     static void
-curs_rows(wp)
-    win_T	*wp;
+curs_rows(win_T *wp)
 {
     linenr_T	lnum;
     int		i;
@@ -801,7 +791,7 @@ curs_rows(wp)
  * Validate curwin->w_virtcol only.
  */
     void
-validate_virtcol()
+validate_virtcol(void)
 {
     validate_virtcol_win(curwin);
 }
@@ -810,8 +800,7 @@ validate_virtcol()
  * Validate wp->w_virtcol only.
  */
     void
-validate_virtcol_win(wp)
-    win_T	*wp;
+validate_virtcol_win(win_T *wp)
 {
     check_cursor_moved(wp);
     if (!(wp->w_valid & VALID_VIRTCOL))
@@ -833,7 +822,7 @@ validate_virtcol_win(wp)
  * Validate curwin->w_cline_height only.
  */
     static void
-validate_cheight()
+validate_cheight(void)
 {
     check_cursor_moved(curwin);
     if (!(curwin->w_valid & VALID_CHEIGHT))
@@ -856,7 +845,7 @@ validate_cheight()
  * Validate w_wcol and w_virtcol only.
  */
     void
-validate_cursor_col()
+validate_cursor_col(void)
 {
     colnr_T off;
     colnr_T col;
@@ -891,8 +880,7 @@ validate_cursor_col()
  * fold column and sign column (these don't move when scrolling horizontally).
  */
     int
-win_col_off(wp)
-    win_T	*wp;
+win_col_off(win_T *wp)
 {
     return (((wp->w_p_nu || wp->w_p_rnu) ? number_width(wp) + 1 : 0)
 #ifdef FEAT_CMDWIN
@@ -913,7 +901,7 @@ win_col_off(wp)
 }
 
     int
-curwin_col_off()
+curwin_col_off(void)
 {
     return win_col_off(curwin);
 }
@@ -924,8 +912,7 @@ curwin_col_off()
  * 'cpoptions'.
  */
     int
-win_col_off2(wp)
-    win_T	*wp;
+win_col_off2(win_T *wp)
 {
     if ((wp->w_p_nu || wp->w_p_rnu) && vim_strchr(p_cpo, CPO_NUMCOL) != NULL)
 	return number_width(wp) + 1;
@@ -933,7 +920,7 @@ win_col_off2(wp)
 }
 
     int
-curwin_col_off2()
+curwin_col_off2(void)
 {
     return win_col_off2(curwin);
 }
@@ -944,8 +931,8 @@ curwin_col_off2()
  * Also updates curwin->w_leftcol.
  */
     void
-curs_columns(may_scroll)
-    int		may_scroll;	/* when TRUE, may scroll horizontally */
+curs_columns(
+    int		may_scroll)	/* when TRUE, may scroll horizontally */
 {
     int		diff;
     int		extra;		/* offset for first screen line */
@@ -1207,9 +1194,9 @@ curs_columns(may_scroll)
  * Scroll the current window down by "line_count" logical lines.  "CTRL-Y"
  */
     void
-scrolldown(line_count, byfold)
-    long	line_count;
-    int		byfold UNUSED;	/* TRUE: count a closed fold as one line */
+scrolldown(
+    long	line_count,
+    int		byfold UNUSED)	/* TRUE: count a closed fold as one line */
 {
     long	done = 0;	/* total # of physical lines done */
     int		wrow;
@@ -1314,9 +1301,9 @@ scrolldown(line_count, byfold)
  * Scroll the current window up by "line_count" logical lines.  "CTRL-E"
  */
     void
-scrollup(line_count, byfold)
-    long	line_count;
-    int		byfold UNUSED;	/* TRUE: count a closed fold as one line */
+scrollup(
+    long	line_count,
+    int		byfold UNUSED)	/* TRUE: count a closed fold as one line */
 {
 #if defined(FEAT_FOLDING) || defined(FEAT_DIFF)
     linenr_T	lnum;
@@ -1396,9 +1383,9 @@ scrollup(line_count, byfold)
  * Don't end up with too many filler lines in the window.
  */
     void
-check_topfill(wp, down)
-    win_T	*wp;
-    int		down;	/* when TRUE scroll down when not enough space */
+check_topfill(
+    win_T	*wp,
+    int		down)	/* when TRUE scroll down when not enough space */
 {
     int		n;
 
@@ -1427,7 +1414,7 @@ check_topfill(wp, down)
  * is still visible.
  */
     static void
-max_topfill()
+max_topfill(void)
 {
     int		n;
 
@@ -1449,7 +1436,7 @@ max_topfill()
  * cursor off the screen.
  */
     void
-scrolldown_clamp()
+scrolldown_clamp(void)
 {
     int		end_row;
 #ifdef FEAT_DIFF
@@ -1520,7 +1507,7 @@ scrolldown_clamp()
  * off the screen.
  */
     void
-scrollup_clamp()
+scrollup_clamp(void)
 {
     int	    start_row;
 
@@ -1579,8 +1566,7 @@ scrollup_clamp()
  * Lines above the first one are incredibly high: MAXCOL.
  */
     static void
-topline_back(lp)
-    lineoff_T	*lp;
+topline_back(lineoff_T *lp)
 {
 #ifdef FEAT_DIFF
     if (lp->fill < diff_check_fill(curwin, lp->lnum))
@@ -1616,8 +1602,7 @@ topline_back(lp)
  * Lines below the last one are incredibly high.
  */
     static void
-botline_forw(lp)
-    lineoff_T	*lp;
+botline_forw(lineoff_T *lp)
 {
 #ifdef FEAT_DIFF
     if (lp->fill < diff_check_fill(curwin, lp->lnum + 1))
@@ -1655,8 +1640,7 @@ botline_forw(lp)
  * When there are no filler lines nothing changes.
  */
     static void
-botline_topline(lp)
-    lineoff_T	*lp;
+botline_topline(lineoff_T *lp)
 {
     if (lp->fill > 0)
     {
@@ -1671,8 +1655,7 @@ botline_topline(lp)
  * When there are no filler lines nothing changes.
  */
     static void
-topline_botline(lp)
-    lineoff_T	*lp;
+topline_botline(lineoff_T *lp)
 {
     if (lp->fill > 0)
     {
@@ -1688,9 +1671,7 @@ topline_botline(lp)
  * If "always" is TRUE, always set topline (for "zt").
  */
     void
-scroll_cursor_top(min_scroll, always)
-    int		min_scroll;
-    int		always;
+scroll_cursor_top(int min_scroll, int always)
 {
     int		scrolled = 0;
     int		extra = 0;
@@ -1828,9 +1809,7 @@ scroll_cursor_top(min_scroll, always)
  * screen lines for text lines.
  */
     void
-set_empty_rows(wp, used)
-    win_T	*wp;
-    int		used;
+set_empty_rows(win_T *wp, int used)
 {
 #ifdef FEAT_DIFF
     wp->w_filler_rows = 0;
@@ -1863,9 +1842,7 @@ set_empty_rows(wp, used)
  * This is messy stuff!!!
  */
     void
-scroll_cursor_bot(min_scroll, set_topbot)
-    int		min_scroll;
-    int		set_topbot;
+scroll_cursor_bot(int min_scroll, int set_topbot)
 {
     int		used;
     int		scrolled = 0;
@@ -2086,8 +2063,7 @@ scroll_cursor_bot(min_scroll, set_topbot
  * If "atend" is TRUE, also put it halfway at the end of the file.
  */
     void
-scroll_cursor_halfway(atend)
-    int		atend;
+scroll_cursor_halfway(int atend)
 {
     int		above = 0;
     linenr_T	topline;
@@ -2171,7 +2147,7 @@ scroll_cursor_halfway(atend)
  * When called topline must be valid!
  */
     void
-cursor_correct()
+cursor_correct(void)
 {
     int		above = 0;	    /* screen lines above topline */
     linenr_T	topline;
@@ -2298,9 +2274,7 @@ static void get_scroll_overlap(lineoff_T
  * return FAIL for failure, OK otherwise
  */
     int
-onepage(dir, count)
-    int		dir;
-    long	count;
+onepage(int dir, long count)
 {
     long	n;
     int		retval = OK;
@@ -2549,9 +2523,7 @@ onepage(dir, count)
  *  l3				   etc.
  */
     static void
-get_scroll_overlap(lp, dir)
-    lineoff_T	*lp;
-    int		dir;
+get_scroll_overlap(lineoff_T *lp, int dir)
 {
     int		h1, h2, h3, h4;
     int		min_height = curwin->w_height - 2;
@@ -2611,9 +2583,7 @@ get_scroll_overlap(lp, dir)
  * Scroll 'scroll' lines up or down.
  */
     void
-halfpage(flag, Prenum)
-    int		flag;
-    linenr_T	Prenum;
+halfpage(int flag, linenr_T Prenum)
 {
     long	scrolled = 0;
     int		i;
@@ -2831,7 +2801,7 @@ halfpage(flag, Prenum)
 
 #if defined(FEAT_CURSORBIND) || defined(PROTO)
     void
-do_check_cursorbind()
+do_check_cursorbind(void)
 {
     linenr_T	line = curwin->w_cursor.lnum;
     colnr_T	col = curwin->w_cursor.col;