1
0
forked from aniani/vim

patch 7.4.1207

Problem:    Using old style function declarations.
Solution:   Change to new style function declarations. (script by Hirohito
            Higashi)
This commit is contained in:
Bram Moolenaar
2016-01-30 16:39:25 +01:00
parent 78c0b7d43e
commit 66f948e928
12 changed files with 980 additions and 1373 deletions

View File

@@ -100,9 +100,7 @@ static int foldendmarkerlen;
* Copy that folding state from window "wp_from" to window "wp_to". * Copy that folding state from window "wp_from" to window "wp_to".
*/ */
void void
copyFoldingState(wp_from, wp_to) copyFoldingState(win_T *wp_from, win_T *wp_to)
win_T *wp_from;
win_T *wp_to;
{ {
wp_to->w_fold_manual = wp_from->w_fold_manual; wp_to->w_fold_manual = wp_from->w_fold_manual;
wp_to->w_foldinvalid = wp_from->w_foldinvalid; wp_to->w_foldinvalid = wp_from->w_foldinvalid;
@@ -115,8 +113,7 @@ copyFoldingState(wp_from, wp_to)
* Return TRUE if there may be folded lines in the current window. * Return TRUE if there may be folded lines in the current window.
*/ */
int int
hasAnyFolding(win) hasAnyFolding(win_T *win)
win_T *win;
{ {
/* very simple now, but can become more complex later */ /* very simple now, but can become more complex later */
return (win->w_p_fen return (win->w_p_fen
@@ -131,23 +128,20 @@ hasAnyFolding(win)
* lnum of the sequence of folded lines (skipped when NULL). * lnum of the sequence of folded lines (skipped when NULL).
*/ */
int int
hasFolding(lnum, firstp, lastp) hasFolding(linenr_T lnum, linenr_T *firstp, linenr_T *lastp)
linenr_T lnum;
linenr_T *firstp;
linenr_T *lastp;
{ {
return hasFoldingWin(curwin, lnum, firstp, lastp, TRUE, NULL); return hasFoldingWin(curwin, lnum, firstp, lastp, TRUE, NULL);
} }
/* hasFoldingWin() {{{2 */ /* hasFoldingWin() {{{2 */
int int
hasFoldingWin(win, lnum, firstp, lastp, cache, infop) hasFoldingWin(
win_T *win; win_T *win,
linenr_T lnum; linenr_T lnum,
linenr_T *firstp; linenr_T *firstp,
linenr_T *lastp; linenr_T *lastp,
int cache; /* when TRUE: use cached values of window */ int cache, /* when TRUE: use cached values of window */
foldinfo_T *infop; /* where to store fold info */ foldinfo_T *infop) /* where to store fold info */
{ {
int had_folded = FALSE; int had_folded = FALSE;
linenr_T first = 0; linenr_T first = 0;
@@ -254,8 +248,7 @@ hasFoldingWin(win, lnum, firstp, lastp, cache, infop)
* Return fold level at line number "lnum" in the current window. * Return fold level at line number "lnum" in the current window.
*/ */
int int
foldLevel(lnum) foldLevel(linenr_T lnum)
linenr_T lnum;
{ {
/* While updating the folds lines between invalid_top and invalid_bot have /* While updating the folds lines between invalid_top and invalid_bot have
* an undefined fold level. Otherwise update the folds first. */ * an undefined fold level. Otherwise update the folds first. */
@@ -281,9 +274,7 @@ foldLevel(lnum)
* Return MAYBE if the line is folded when next to a folded line. * Return MAYBE if the line is folded when next to a folded line.
*/ */
int int
lineFolded(win, lnum) lineFolded(win_T *win, linenr_T lnum)
win_T *win;
linenr_T lnum;
{ {
return foldedCount(win, lnum, NULL) != 0; return foldedCount(win, lnum, NULL) != 0;
} }
@@ -298,10 +289,7 @@ lineFolded(win, lnum)
* When "infop" is not NULL, fills *infop with the fold level info. * When "infop" is not NULL, fills *infop with the fold level info.
*/ */
long long
foldedCount(win, lnum, infop) foldedCount(win_T *win, linenr_T lnum, foldinfo_T *infop)
win_T *win;
linenr_T lnum;
foldinfo_T *infop;
{ {
linenr_T last; linenr_T last;
@@ -315,8 +303,7 @@ foldedCount(win, lnum, infop)
* Return TRUE if 'foldmethod' is "manual" * Return TRUE if 'foldmethod' is "manual"
*/ */
int int
foldmethodIsManual(wp) foldmethodIsManual(win_T *wp)
win_T *wp;
{ {
return (wp->w_p_fdm[3] == 'u'); return (wp->w_p_fdm[3] == 'u');
} }
@@ -326,8 +313,7 @@ foldmethodIsManual(wp)
* Return TRUE if 'foldmethod' is "indent" * Return TRUE if 'foldmethod' is "indent"
*/ */
int int
foldmethodIsIndent(wp) foldmethodIsIndent(win_T *wp)
win_T *wp;
{ {
return (wp->w_p_fdm[0] == 'i'); return (wp->w_p_fdm[0] == 'i');
} }
@@ -337,8 +323,7 @@ foldmethodIsIndent(wp)
* Return TRUE if 'foldmethod' is "expr" * Return TRUE if 'foldmethod' is "expr"
*/ */
int int
foldmethodIsExpr(wp) foldmethodIsExpr(win_T *wp)
win_T *wp;
{ {
return (wp->w_p_fdm[1] == 'x'); return (wp->w_p_fdm[1] == 'x');
} }
@@ -348,8 +333,7 @@ foldmethodIsExpr(wp)
* Return TRUE if 'foldmethod' is "marker" * Return TRUE if 'foldmethod' is "marker"
*/ */
int int
foldmethodIsMarker(wp) foldmethodIsMarker(win_T *wp)
win_T *wp;
{ {
return (wp->w_p_fdm[2] == 'r'); return (wp->w_p_fdm[2] == 'r');
} }
@@ -359,8 +343,7 @@ foldmethodIsMarker(wp)
* Return TRUE if 'foldmethod' is "syntax" * Return TRUE if 'foldmethod' is "syntax"
*/ */
int int
foldmethodIsSyntax(wp) foldmethodIsSyntax(win_T *wp)
win_T *wp;
{ {
return (wp->w_p_fdm[0] == 's'); return (wp->w_p_fdm[0] == 's');
} }
@@ -370,8 +353,7 @@ foldmethodIsSyntax(wp)
* Return TRUE if 'foldmethod' is "diff" * Return TRUE if 'foldmethod' is "diff"
*/ */
int int
foldmethodIsDiff(wp) foldmethodIsDiff(win_T *wp)
win_T *wp;
{ {
return (wp->w_p_fdm[0] == 'd'); return (wp->w_p_fdm[0] == 'd');
} }
@@ -382,9 +364,7 @@ foldmethodIsDiff(wp)
* Repeat "count" times. * Repeat "count" times.
*/ */
void void
closeFold(lnum, count) closeFold(linenr_T lnum, long count)
linenr_T lnum;
long count;
{ {
setFoldRepeat(lnum, count, FALSE); setFoldRepeat(lnum, count, FALSE);
} }
@@ -394,8 +374,7 @@ closeFold(lnum, count)
* Close fold for current window at line "lnum" recursively. * Close fold for current window at line "lnum" recursively.
*/ */
void void
closeFoldRecurse(lnum) closeFoldRecurse(linenr_T lnum)
linenr_T lnum;
{ {
(void)setManualFold(lnum, FALSE, TRUE, NULL); (void)setManualFold(lnum, FALSE, TRUE, NULL);
} }
@@ -406,12 +385,12 @@ closeFoldRecurse(lnum)
* Used for "zo", "zO", "zc" and "zC" in Visual mode. * Used for "zo", "zO", "zc" and "zC" in Visual mode.
*/ */
void void
opFoldRange(first, last, opening, recurse, had_visual) opFoldRange(
linenr_T first; linenr_T first,
linenr_T last; linenr_T last,
int opening; /* TRUE to open, FALSE to close */ int opening, /* TRUE to open, FALSE to close */
int recurse; /* TRUE to do it recursively */ int recurse, /* TRUE to do it recursively */
int had_visual; /* TRUE when Visual selection used */ int had_visual) /* TRUE when Visual selection used */
{ {
int done = DONE_NOTHING; /* avoid error messages */ int done = DONE_NOTHING; /* avoid error messages */
linenr_T lnum; linenr_T lnum;
@@ -443,9 +422,7 @@ opFoldRange(first, last, opening, recurse, had_visual)
* Repeat "count" times. * Repeat "count" times.
*/ */
void void
openFold(lnum, count) openFold(linenr_T lnum, long count)
linenr_T lnum;
long count;
{ {
setFoldRepeat(lnum, count, TRUE); setFoldRepeat(lnum, count, TRUE);
} }
@@ -455,8 +432,7 @@ openFold(lnum, count)
* Open fold for current window at line "lnum" recursively. * Open fold for current window at line "lnum" recursively.
*/ */
void void
openFoldRecurse(lnum) openFoldRecurse(linenr_T lnum)
linenr_T lnum;
{ {
(void)setManualFold(lnum, TRUE, TRUE, NULL); (void)setManualFold(lnum, TRUE, TRUE, NULL);
} }
@@ -466,7 +442,7 @@ openFoldRecurse(lnum)
* Open folds until the cursor line is not in a closed fold. * Open folds until the cursor line is not in a closed fold.
*/ */
void void
foldOpenCursor() foldOpenCursor(void)
{ {
int done; int done;
@@ -486,7 +462,7 @@ foldOpenCursor()
* Set new foldlevel for current window. * Set new foldlevel for current window.
*/ */
void void
newFoldLevel() newFoldLevel(void)
{ {
newFoldLevelWin(curwin); newFoldLevelWin(curwin);
@@ -511,8 +487,7 @@ newFoldLevel()
} }
static void static void
newFoldLevelWin(wp) newFoldLevelWin(win_T *wp)
win_T *wp;
{ {
fold_T *fp; fold_T *fp;
int i; int i;
@@ -536,7 +511,7 @@ newFoldLevelWin(wp)
* Apply 'foldlevel' to all folds that don't contain the cursor. * Apply 'foldlevel' to all folds that don't contain the cursor.
*/ */
void void
foldCheckClose() foldCheckClose(void)
{ {
if (*p_fcl != NUL) /* can only be "all" right now */ if (*p_fcl != NUL) /* can only be "all" right now */
{ {
@@ -549,10 +524,7 @@ foldCheckClose()
/* checkCloseRec() {{{2 */ /* checkCloseRec() {{{2 */
static int static int
checkCloseRec(gap, lnum, level) checkCloseRec(garray_T *gap, linenr_T lnum, int level)
garray_T *gap;
linenr_T lnum;
int level;
{ {
fold_T *fp; fold_T *fp;
int retval = FALSE; int retval = FALSE;
@@ -584,8 +556,7 @@ checkCloseRec(gap, lnum, level)
* Give an error message and return FALSE if not. * Give an error message and return FALSE if not.
*/ */
int int
foldManualAllowed(create) foldManualAllowed(int create)
int create;
{ {
if (foldmethodIsManual(curwin) || foldmethodIsMarker(curwin)) if (foldmethodIsManual(curwin) || foldmethodIsMarker(curwin))
return TRUE; return TRUE;
@@ -602,9 +573,7 @@ foldManualAllowed(create)
* window. * window.
*/ */
void void
foldCreate(start, end) foldCreate(linenr_T start, linenr_T end)
linenr_T start;
linenr_T end;
{ {
fold_T *fp; fold_T *fp;
garray_T *gap; garray_T *gap;
@@ -729,11 +698,11 @@ foldCreate(start, end)
* When "recursive" is TRUE delete recursively. * When "recursive" is TRUE delete recursively.
*/ */
void void
deleteFold(start, end, recursive, had_visual) deleteFold(
linenr_T start; linenr_T start,
linenr_T end; linenr_T end,
int recursive; int recursive,
int had_visual; /* TRUE when Visual selection used */ int had_visual) /* TRUE when Visual selection used */
{ {
garray_T *gap; garray_T *gap;
fold_T *fp; fold_T *fp;
@@ -824,8 +793,7 @@ deleteFold(start, end, recursive, had_visual)
* Remove all folding for window "win". * Remove all folding for window "win".
*/ */
void void
clearFolding(win) clearFolding(win_T *win)
win_T *win;
{ {
deleteFoldRecurse(&win->w_folds); deleteFoldRecurse(&win->w_folds);
win->w_foldinvalid = FALSE; win->w_foldinvalid = FALSE;
@@ -839,10 +807,7 @@ clearFolding(win)
* The changes in lines from top to bot (inclusive). * The changes in lines from top to bot (inclusive).
*/ */
void void
foldUpdate(wp, top, bot) foldUpdate(win_T *wp, linenr_T top, linenr_T bot)
win_T *wp;
linenr_T top;
linenr_T bot;
{ {
fold_T *fp; fold_T *fp;
@@ -880,8 +845,7 @@ foldUpdate(wp, top, bot)
* every time a setting is changed or a syntax item is added. * every time a setting is changed or a syntax item is added.
*/ */
void void
foldUpdateAll(win) foldUpdateAll(win_T *win)
win_T *win;
{ {
win->w_foldinvalid = TRUE; win->w_foldinvalid = TRUE;
redraw_win_later(win, NOT_VALID); redraw_win_later(win, NOT_VALID);
@@ -894,10 +858,10 @@ foldUpdateAll(win)
* If not moved return FAIL. * If not moved return FAIL.
*/ */
int int
foldMoveTo(updown, dir, count) foldMoveTo(
int updown; int updown,
int dir; /* FORWARD or BACKWARD */ int dir, /* FORWARD or BACKWARD */
long count; long count)
{ {
long n; long n;
int retval = FAIL; int retval = FAIL;
@@ -1031,8 +995,7 @@ foldMoveTo(updown, dir, count)
* Init the fold info in a new window. * Init the fold info in a new window.
*/ */
void void
foldInitWin(new_win) foldInitWin(win_T *new_win)
win_T *new_win;
{ {
ga_init2(&new_win->w_folds, (int)sizeof(fold_T), 10); ga_init2(&new_win->w_folds, (int)sizeof(fold_T), 10);
} }
@@ -1045,9 +1008,7 @@ foldInitWin(new_win)
* Returns index of entry or -1 if not found. * Returns index of entry or -1 if not found.
*/ */
int int
find_wl_entry(win, lnum) find_wl_entry(win_T *win, linenr_T lnum)
win_T *win;
linenr_T lnum;
{ {
int i; int i;
@@ -1067,7 +1028,7 @@ find_wl_entry(win, lnum)
* Adjust the Visual area to include any fold at the start or end completely. * Adjust the Visual area to include any fold at the start or end completely.
*/ */
void void
foldAdjustVisual() foldAdjustVisual(void)
{ {
pos_T *start, *end; pos_T *start, *end;
char_u *ptr; char_u *ptr;
@@ -1106,7 +1067,7 @@ foldAdjustVisual()
* Move the cursor to the first line of a closed fold. * Move the cursor to the first line of a closed fold.
*/ */
void void
foldAdjustCursor() foldAdjustCursor(void)
{ {
(void)hasFolding(curwin->w_cursor.lnum, &curwin->w_cursor.lnum, NULL); (void)hasFolding(curwin->w_cursor.lnum, &curwin->w_cursor.lnum, NULL);
} }
@@ -1119,9 +1080,7 @@ foldAdjustCursor()
* Return FAIL if the operation cannot be completed, otherwise OK. * Return FAIL if the operation cannot be completed, otherwise OK.
*/ */
void void
cloneFoldGrowArray(from, to) cloneFoldGrowArray(garray_T *from, garray_T *to)
garray_T *from;
garray_T *to;
{ {
int i; int i;
fold_T *from_p; fold_T *from_p;
@@ -1155,10 +1114,7 @@ cloneFoldGrowArray(from, to)
* Returns FALSE when there is no fold that contains "lnum". * Returns FALSE when there is no fold that contains "lnum".
*/ */
static int static int
foldFind(gap, lnum, fpp) foldFind(garray_T *gap, linenr_T lnum, fold_T **fpp)
garray_T *gap;
linenr_T lnum;
fold_T **fpp;
{ {
linenr_T low, high; linenr_T low, high;
fold_T *fp; fold_T *fp;
@@ -1197,9 +1153,7 @@ foldFind(gap, lnum, fpp)
* Return fold level at line number "lnum" in window "wp". * Return fold level at line number "lnum" in window "wp".
*/ */
static int static int
foldLevelWin(wp, lnum) foldLevelWin(win_T *wp, linenr_T lnum)
win_T *wp;
linenr_T lnum;
{ {
fold_T *fp; fold_T *fp;
linenr_T lnum_rel = lnum; linenr_T lnum_rel = lnum;
@@ -1226,8 +1180,7 @@ foldLevelWin(wp, lnum)
* Check if the folds in window "wp" are invalid and update them if needed. * Check if the folds in window "wp" are invalid and update them if needed.
*/ */
static void static void
checkupdate(wp) checkupdate(win_T *wp)
win_T *wp;
{ {
if (wp->w_foldinvalid) if (wp->w_foldinvalid)
{ {
@@ -1242,10 +1195,7 @@ checkupdate(wp)
* Repeat "count" times. * Repeat "count" times.
*/ */
static void static void
setFoldRepeat(lnum, count, do_open) setFoldRepeat(linenr_T lnum, long count, int do_open)
linenr_T lnum;
long count;
int do_open;
{ {
int done; int done;
long n; long n;
@@ -1270,11 +1220,11 @@ setFoldRepeat(lnum, count, do_open)
* Also does this for other windows in diff mode when needed. * Also does this for other windows in diff mode when needed.
*/ */
static linenr_T static linenr_T
setManualFold(lnum, opening, recurse, donep) setManualFold(
linenr_T lnum; linenr_T lnum,
int opening; /* TRUE when opening, FALSE when closing */ int opening, /* TRUE when opening, FALSE when closing */
int recurse; /* TRUE when closing/opening recursive */ int recurse, /* TRUE when closing/opening recursive */
int *donep; int *donep)
{ {
#ifdef FEAT_DIFF #ifdef FEAT_DIFF
if (foldmethodIsDiff(curwin) && curwin->w_p_scb) if (foldmethodIsDiff(curwin) && curwin->w_p_scb)
@@ -1312,12 +1262,12 @@ setManualFold(lnum, opening, recurse, donep)
* It's only valid when "opening" is TRUE! * It's only valid when "opening" is TRUE!
*/ */
static linenr_T static linenr_T
setManualFoldWin(wp, lnum, opening, recurse, donep) setManualFoldWin(
win_T *wp; win_T *wp,
linenr_T lnum; linenr_T lnum,
int opening; /* TRUE when opening, FALSE when closing */ int opening, /* TRUE when opening, FALSE when closing */
int recurse; /* TRUE when closing/opening recursive */ int recurse, /* TRUE when closing/opening recursive */
int *donep; int *donep)
{ {
fold_T *fp; fold_T *fp;
fold_T *fp2; fold_T *fp2;
@@ -1423,8 +1373,7 @@ setManualFoldWin(wp, lnum, opening, recurse, donep)
* Open all nested folds in fold "fpr" recursively. * Open all nested folds in fold "fpr" recursively.
*/ */
static void static void
foldOpenNested(fpr) foldOpenNested(fold_T *fpr)
fold_T *fpr;
{ {
int i; int i;
fold_T *fp; fold_T *fp;
@@ -1444,10 +1393,7 @@ foldOpenNested(fpr)
* When "recursive" is FALSE contained folds are moved one level up. * When "recursive" is FALSE contained folds are moved one level up.
*/ */
static void static void
deleteFoldEntry(gap, idx, recursive) deleteFoldEntry(garray_T *gap, int idx, int recursive)
garray_T *gap;
int idx;
int recursive;
{ {
fold_T *fp; fold_T *fp;
int i; int i;
@@ -1501,8 +1447,7 @@ deleteFoldEntry(gap, idx, recursive)
* Delete nested folds in a fold. * Delete nested folds in a fold.
*/ */
void void
deleteFoldRecurse(gap) deleteFoldRecurse(garray_T *gap)
garray_T *gap;
{ {
int i; int i;
@@ -1516,12 +1461,12 @@ deleteFoldRecurse(gap)
* Update line numbers of folds for inserted/deleted lines. * Update line numbers of folds for inserted/deleted lines.
*/ */
void void
foldMarkAdjust(wp, line1, line2, amount, amount_after) foldMarkAdjust(
win_T *wp; win_T *wp,
linenr_T line1; linenr_T line1,
linenr_T line2; linenr_T line2,
long amount; long amount,
long amount_after; long amount_after)
{ {
/* If deleting marks from line1 to line2, but not deleting all those /* If deleting marks from line1 to line2, but not deleting all those
* lines, set line2 so that only deleted lines have their folds removed. */ * lines, set line2 so that only deleted lines have their folds removed. */
@@ -1536,12 +1481,12 @@ foldMarkAdjust(wp, line1, line2, amount, amount_after)
/* foldMarkAdjustRecurse() {{{2 */ /* foldMarkAdjustRecurse() {{{2 */
static void static void
foldMarkAdjustRecurse(gap, line1, line2, amount, amount_after) foldMarkAdjustRecurse(
garray_T *gap; garray_T *gap,
linenr_T line1; linenr_T line1,
linenr_T line2; linenr_T line2,
long amount; long amount,
long amount_after; long amount_after)
{ {
fold_T *fp; fold_T *fp;
int i; int i;
@@ -1653,15 +1598,14 @@ foldMarkAdjustRecurse(gap, line1, line2, amount, amount_after)
* current window open. * current window open.
*/ */
int int
getDeepestNesting() getDeepestNesting(void)
{ {
checkupdate(curwin); checkupdate(curwin);
return getDeepestNestingRecurse(&curwin->w_folds); return getDeepestNestingRecurse(&curwin->w_folds);
} }
static int static int
getDeepestNestingRecurse(gap) getDeepestNestingRecurse(garray_T *gap)
garray_T *gap;
{ {
int i; int i;
int level; int level;
@@ -1684,13 +1628,13 @@ getDeepestNestingRecurse(gap)
* Check if a fold is closed and update the info needed to check nested folds. * Check if a fold is closed and update the info needed to check nested folds.
*/ */
static int static int
check_closed(win, fp, use_levelp, level, maybe_smallp, lnum_off) check_closed(
win_T *win; win_T *win,
fold_T *fp; fold_T *fp,
int *use_levelp; /* TRUE: outer fold had FD_LEVEL */ int *use_levelp, /* TRUE: outer fold had FD_LEVEL */
int level; /* folding depth */ int level, /* folding depth */
int *maybe_smallp; /* TRUE: outer this had fd_small == MAYBE */ int *maybe_smallp, /* TRUE: outer this had fd_small == MAYBE */
linenr_T lnum_off; /* line number offset for fp->fd_top */ linenr_T lnum_off) /* line number offset for fp->fd_top */
{ {
int closed = FALSE; int closed = FALSE;
@@ -1724,10 +1668,10 @@ check_closed(win, fp, use_levelp, level, maybe_smallp, lnum_off)
* Update fd_small field of fold "fp". * Update fd_small field of fold "fp".
*/ */
static void static void
checkSmall(wp, fp, lnum_off) checkSmall(
win_T *wp; win_T *wp,
fold_T *fp; fold_T *fp,
linenr_T lnum_off; /* offset for fp->fd_top */ linenr_T lnum_off) /* offset for fp->fd_top */
{ {
int count; int count;
int n; int n;
@@ -1761,8 +1705,7 @@ checkSmall(wp, fp, lnum_off)
* Set small flags in "gap" to MAYBE. * Set small flags in "gap" to MAYBE.
*/ */
static void static void
setSmallMaybe(gap) setSmallMaybe(garray_T *gap)
garray_T *gap;
{ {
int i; int i;
fold_T *fp; fold_T *fp;
@@ -1778,9 +1721,7 @@ setSmallMaybe(gap)
* window by adding markers. * window by adding markers.
*/ */
static void static void
foldCreateMarkers(start, end) foldCreateMarkers(linenr_T start, linenr_T end)
linenr_T start;
linenr_T end;
{ {
if (!curbuf->b_p_ma) if (!curbuf->b_p_ma)
{ {
@@ -1802,10 +1743,7 @@ foldCreateMarkers(start, end)
* Add "marker[markerlen]" in 'commentstring' to line "lnum". * Add "marker[markerlen]" in 'commentstring' to line "lnum".
*/ */
static void static void
foldAddMarker(lnum, marker, markerlen) foldAddMarker(linenr_T lnum, char_u *marker, int markerlen)
linenr_T lnum;
char_u *marker;
int markerlen;
{ {
char_u *cms = curbuf->b_p_cms; char_u *cms = curbuf->b_p_cms;
char_u *line; char_u *line;
@@ -1841,10 +1779,10 @@ foldAddMarker(lnum, marker, markerlen)
* Delete the markers for a fold, causing it to be deleted. * Delete the markers for a fold, causing it to be deleted.
*/ */
static void static void
deleteFoldMarkers(fp, recursive, lnum_off) deleteFoldMarkers(
fold_T *fp; fold_T *fp,
int recursive; int recursive,
linenr_T lnum_off; /* offset for fp->fd_top */ linenr_T lnum_off) /* offset for fp->fd_top */
{ {
int i; int i;
@@ -1865,10 +1803,7 @@ deleteFoldMarkers(fp, recursive, lnum_off)
* close-marker. * close-marker.
*/ */
static void static void
foldDelMarker(lnum, marker, markerlen) foldDelMarker(linenr_T lnum, char_u *marker, int markerlen)
linenr_T lnum;
char_u *marker;
int markerlen;
{ {
char_u *line; char_u *line;
char_u *newline; char_u *newline;
@@ -1919,11 +1854,12 @@ foldDelMarker(lnum, marker, markerlen)
* result is in allocated memory. * result is in allocated memory.
*/ */
char_u * char_u *
get_foldtext(wp, lnum, lnume, foldinfo, buf) get_foldtext(
win_T *wp; win_T *wp,
linenr_T lnum, lnume; linenr_T lnum,
foldinfo_T *foldinfo; linenr_T lnume,
char_u *buf; foldinfo_T *foldinfo,
char_u *buf)
{ {
char_u *text = NULL; char_u *text = NULL;
#ifdef FEAT_EVAL #ifdef FEAT_EVAL
@@ -2033,8 +1969,7 @@ get_foldtext(wp, lnum, lnume, foldinfo, buf)
* Remove 'foldmarker' and 'commentstring' from "str" (in-place). * Remove 'foldmarker' and 'commentstring' from "str" (in-place).
*/ */
void void
foldtext_cleanup(str) foldtext_cleanup(char_u *str)
char_u *str;
{ {
char_u *cms_start; /* first part or the whole comment */ char_u *cms_start; /* first part or the whole comment */
int cms_slen = 0; /* length of cms_start */ int cms_slen = 0; /* length of cms_start */
@@ -2161,10 +2096,7 @@ static void foldlevelSyntax(fline_T *flp);
* Return TRUE if any folds did change. * Return TRUE if any folds did change.
*/ */
static void static void
foldUpdateIEMS(wp, top, bot) foldUpdateIEMS(win_T *wp, linenr_T top, linenr_T bot)
win_T *wp;
linenr_T top;
linenr_T bot;
{ {
linenr_T start; linenr_T start;
linenr_T end; linenr_T end;
@@ -2417,14 +2349,14 @@ foldUpdateIEMS(wp, top, bot)
* updated as a result of a detected change in the fold. * updated as a result of a detected change in the fold.
*/ */
static linenr_T static linenr_T
foldUpdateIEMSRecurse(gap, level, startlnum, flp, getlevel, bot, topflags) foldUpdateIEMSRecurse(
garray_T *gap; garray_T *gap,
int level; int level,
linenr_T startlnum; linenr_T startlnum,
fline_T *flp; fline_T *flp,
void (*getlevel)(fline_T *); void (*getlevel)(fline_T *),
linenr_T bot; linenr_T bot,
int topflags; /* flags used by containing fold */ int topflags) /* flags used by containing fold */
{ {
linenr_T ll; linenr_T ll;
fold_T *fp = NULL; fold_T *fp = NULL;
@@ -2831,9 +2763,7 @@ foldUpdateIEMSRecurse(gap, level, startlnum, flp, getlevel, bot, topflags)
* Returns OK for success, FAIL for failure. * Returns OK for success, FAIL for failure.
*/ */
static int static int
foldInsert(gap, i) foldInsert(garray_T *gap, int i)
garray_T *gap;
int i;
{ {
fold_T *fp; fold_T *fp;
@@ -2856,11 +2786,11 @@ foldInsert(gap, i)
* "bot"! * "bot"!
*/ */
static void static void
foldSplit(gap, i, top, bot) foldSplit(
garray_T *gap; garray_T *gap,
int i; int i,
linenr_T top; linenr_T top,
linenr_T bot; linenr_T bot)
{ {
fold_T *fp; fold_T *fp;
fold_T *fp2; fold_T *fp2;
@@ -2920,10 +2850,7 @@ foldSplit(gap, i, top, bot)
* 6: not changed * 6: not changed
*/ */
static void static void
foldRemove(gap, top, bot) foldRemove(garray_T *gap, linenr_T top, linenr_T bot)
garray_T *gap;
linenr_T top;
linenr_T bot;
{ {
fold_T *fp = NULL; fold_T *fp = NULL;
@@ -2986,10 +2913,7 @@ foldRemove(gap, top, bot)
* Fold entry "fp2" in "gap" is deleted. * Fold entry "fp2" in "gap" is deleted.
*/ */
static void static void
foldMerge(fp1, gap, fp2) foldMerge(fold_T *fp1, garray_T *gap, fold_T *fp2)
fold_T *fp1;
garray_T *gap;
fold_T *fp2;
{ {
fold_T *fp3; fold_T *fp3;
fold_T *fp4; fold_T *fp4;
@@ -3027,8 +2951,7 @@ foldMerge(fp1, gap, fp2)
* Returns a level of -1 if the foldlevel depends on surrounding lines. * Returns a level of -1 if the foldlevel depends on surrounding lines.
*/ */
static void static void
foldlevelIndent(flp) foldlevelIndent(fline_T *flp)
fline_T *flp;
{ {
char_u *s; char_u *s;
buf_T *buf; buf_T *buf;
@@ -3064,8 +2987,7 @@ foldlevelIndent(flp)
* Doesn't use any caching. * Doesn't use any caching.
*/ */
static void static void
foldlevelDiff(flp) foldlevelDiff(fline_T *flp)
fline_T *flp;
{ {
if (diff_infold(flp->wp, flp->lnum + flp->off)) if (diff_infold(flp->wp, flp->lnum + flp->off))
flp->lvl = 1; flp->lvl = 1;
@@ -3081,8 +3003,7 @@ foldlevelDiff(flp)
* Returns a level of -1 if the foldlevel depends on surrounding lines. * Returns a level of -1 if the foldlevel depends on surrounding lines.
*/ */
static void static void
foldlevelExpr(flp) foldlevelExpr(fline_T *flp)
fline_T *flp;
{ {
#ifndef FEAT_EVAL #ifndef FEAT_EVAL
flp->start = FALSE; flp->start = FALSE;
@@ -3184,8 +3105,7 @@ foldlevelExpr(flp)
* Relies on the option value to have been checked for correctness already. * Relies on the option value to have been checked for correctness already.
*/ */
static void static void
parseMarker(wp) parseMarker(win_T *wp)
win_T *wp;
{ {
foldendmarker = vim_strchr(wp->w_p_fmr, ','); foldendmarker = vim_strchr(wp->w_p_fmr, ',');
foldstartmarkerlen = (int)(foldendmarker++ - wp->w_p_fmr); foldstartmarkerlen = (int)(foldendmarker++ - wp->w_p_fmr);
@@ -3203,8 +3123,7 @@ parseMarker(wp)
* Sets flp->start when a start marker was found. * Sets flp->start when a start marker was found.
*/ */
static void static void
foldlevelMarker(flp) foldlevelMarker(fline_T *flp)
fline_T *flp;
{ {
char_u *startmarker; char_u *startmarker;
int cstart; int cstart;
@@ -3286,8 +3205,7 @@ foldlevelMarker(flp)
* Doesn't use any caching. * Doesn't use any caching.
*/ */
static void static void
foldlevelSyntax(flp) foldlevelSyntax(fline_T *flp)
fline_T *flp;
{ {
#ifndef FEAT_SYN_HL #ifndef FEAT_SYN_HL
flp->start = 0; flp->start = 0;
@@ -3323,9 +3241,7 @@ static int put_fold_open_close(FILE *fd, fold_T *fp, linenr_T off);
* Return FAIL if writing fails. * Return FAIL if writing fails.
*/ */
int int
put_folds(fd, wp) put_folds(FILE *fd, win_T *wp)
FILE *fd;
win_T *wp;
{ {
if (foldmethodIsManual(wp)) if (foldmethodIsManual(wp))
{ {
@@ -3347,10 +3263,7 @@ put_folds(fd, wp)
* Returns FAIL when writing failed. * Returns FAIL when writing failed.
*/ */
static int static int
put_folds_recurse(fd, gap, off) put_folds_recurse(FILE *fd, garray_T *gap, linenr_T off)
FILE *fd;
garray_T *gap;
linenr_T off;
{ {
int i; int i;
fold_T *fp; fold_T *fp;
@@ -3376,11 +3289,11 @@ put_folds_recurse(fd, gap, off)
* Returns FAIL when writing failed. * Returns FAIL when writing failed.
*/ */
static int static int
put_foldopen_recurse(fd, wp, gap, off) put_foldopen_recurse(
FILE *fd; FILE *fd,
win_T *wp; win_T *wp,
garray_T *gap; garray_T *gap,
linenr_T off; linenr_T off)
{ {
int i; int i;
int level; int level;
@@ -3433,10 +3346,7 @@ put_foldopen_recurse(fd, wp, gap, off)
* Returns FAIL when writing failed. * Returns FAIL when writing failed.
*/ */
static int static int
put_fold_open_close(fd, fp, off) put_fold_open_close(FILE *fd, fold_T *fp, linenr_T off)
FILE *fd;
fold_T *fp;
linenr_T off;
{ {
if (fprintf(fd, "%ld", fp->fd_top + off) < 0 if (fprintf(fd, "%ld", fp->fd_top + off) < 0
|| put_eol(fd) == FAIL || put_eol(fd) == FAIL

View File

@@ -137,8 +137,7 @@ static char_u *eval_map_expr(char_u *str, int c);
* Free and clear a buffer. * Free and clear a buffer.
*/ */
void void
free_buff(buf) free_buff(buffheader_T *buf)
buffheader_T *buf;
{ {
buffblock_T *p, *np; buffblock_T *p, *np;
@@ -155,9 +154,9 @@ free_buff(buf)
* K_SPECIAL and CSI in the returned string are escaped. * K_SPECIAL and CSI in the returned string are escaped.
*/ */
static char_u * static char_u *
get_buffcont(buffer, dozero) get_buffcont(
buffheader_T *buffer; buffheader_T *buffer,
int dozero; /* count == zero is not an error */ int dozero) /* count == zero is not an error */
{ {
long_u count = 0; long_u count = 0;
char_u *p = NULL; char_u *p = NULL;
@@ -186,7 +185,7 @@ get_buffcont(buffer, dozero)
* K_SPECIAL and CSI in the returned string are escaped. * K_SPECIAL and CSI in the returned string are escaped.
*/ */
char_u * char_u *
get_recorded() get_recorded(void)
{ {
char_u *p; char_u *p;
size_t len; size_t len;
@@ -220,7 +219,7 @@ get_recorded()
* K_SPECIAL and CSI in the returned string are escaped. * K_SPECIAL and CSI in the returned string are escaped.
*/ */
char_u * char_u *
get_inserted() get_inserted(void)
{ {
return get_buffcont(&redobuff, FALSE); return get_buffcont(&redobuff, FALSE);
} }
@@ -230,10 +229,10 @@ get_inserted()
* K_SPECIAL and CSI should have been escaped already. * K_SPECIAL and CSI should have been escaped already.
*/ */
static void static void
add_buff(buf, s, slen) add_buff(
buffheader_T *buf; buffheader_T *buf,
char_u *s; char_u *s,
long slen; /* length of "s" or -1 */ long slen) /* length of "s" or -1 */
{ {
buffblock_T *p; buffblock_T *p;
long_u len; long_u len;
@@ -289,9 +288,7 @@ add_buff(buf, s, slen)
* Add number "n" to buffer "buf". * Add number "n" to buffer "buf".
*/ */
static void static void
add_num_buff(buf, n) add_num_buff(buffheader_T *buf, long n)
buffheader_T *buf;
long n;
{ {
char_u number[32]; char_u number[32];
@@ -304,9 +301,7 @@ add_num_buff(buf, n)
* Translates special keys, NUL, CSI, K_SPECIAL and multibyte characters. * Translates special keys, NUL, CSI, K_SPECIAL and multibyte characters.
*/ */
static void static void
add_char_buff(buf, c) add_char_buff(buffheader_T *buf, int c)
buffheader_T *buf;
int c;
{ {
#ifdef FEAT_MBYTE #ifdef FEAT_MBYTE
char_u bytes[MB_MAXBYTES + 1]; char_u bytes[MB_MAXBYTES + 1];
@@ -368,8 +363,7 @@ static buffheader_T readbuf2 = {{NULL, {NUL}}, NULL, 0, 0};
* No translation is done K_SPECIAL and CSI are escaped. * No translation is done K_SPECIAL and CSI are escaped.
*/ */
static int static int
read_readbuffers(advance) read_readbuffers(int advance)
int advance;
{ {
int c; int c;
@@ -380,9 +374,7 @@ read_readbuffers(advance)
} }
static int static int
read_readbuf(buf, advance) read_readbuf(buffheader_T *buf, int advance)
buffheader_T *buf;
int advance;
{ {
char_u c; char_u c;
buffblock_T *curr; buffblock_T *curr;
@@ -409,7 +401,7 @@ read_readbuf(buf, advance)
* Prepare the read buffers for reading (if they contain something). * Prepare the read buffers for reading (if they contain something).
*/ */
static void static void
start_stuff() start_stuff(void)
{ {
if (readbuf1.bh_first.b_next != NULL) if (readbuf1.bh_first.b_next != NULL)
{ {
@@ -427,7 +419,7 @@ start_stuff()
* Return TRUE if the stuff buffer is empty. * Return TRUE if the stuff buffer is empty.
*/ */
int int
stuff_empty() stuff_empty(void)
{ {
return (readbuf1.bh_first.b_next == NULL return (readbuf1.bh_first.b_next == NULL
&& readbuf2.bh_first.b_next == NULL); && readbuf2.bh_first.b_next == NULL);
@@ -438,7 +430,7 @@ stuff_empty()
* redbuf2. * redbuf2.
*/ */
int int
readbuf1_empty() readbuf1_empty(void)
{ {
return (readbuf1.bh_first.b_next == NULL); return (readbuf1.bh_first.b_next == NULL);
} }
@@ -447,8 +439,7 @@ readbuf1_empty()
* Set a typeahead character that won't be flushed. * Set a typeahead character that won't be flushed.
*/ */
void void
typeahead_noflush(c) typeahead_noflush(int c)
int c;
{ {
typeahead_char = c; typeahead_char = c;
} }
@@ -459,8 +450,7 @@ typeahead_noflush(c)
* flush all typeahead characters (used when interrupted by a CTRL-C). * flush all typeahead characters (used when interrupted by a CTRL-C).
*/ */
void void
flush_buffers(flush_typeahead) flush_buffers(int flush_typeahead)
int flush_typeahead;
{ {
init_typebuf(); init_typebuf();
@@ -497,7 +487,7 @@ flush_buffers(flush_typeahead)
* This is used for the CTRL-O <.> command in insert mode. * This is used for the CTRL-O <.> command in insert mode.
*/ */
void void
ResetRedobuff() ResetRedobuff(void)
{ {
if (!block_redo) if (!block_redo)
{ {
@@ -512,7 +502,7 @@ ResetRedobuff()
* buffer. * buffer.
*/ */
void void
CancelRedo() CancelRedo(void)
{ {
if (!block_redo) if (!block_redo)
{ {
@@ -533,7 +523,7 @@ CancelRedo()
static int save_level = 0; static int save_level = 0;
void void
saveRedobuff() saveRedobuff(void)
{ {
char_u *s; char_u *s;
@@ -559,7 +549,7 @@ saveRedobuff()
* Used after executing autocommands and user functions. * Used after executing autocommands and user functions.
*/ */
void void
restoreRedobuff() restoreRedobuff(void)
{ {
if (--save_level == 0) if (--save_level == 0)
{ {
@@ -576,8 +566,7 @@ restoreRedobuff()
* K_SPECIAL and CSI should already have been escaped. * K_SPECIAL and CSI should already have been escaped.
*/ */
void void
AppendToRedobuff(s) AppendToRedobuff(char_u *s)
char_u *s;
{ {
if (!block_redo) if (!block_redo)
add_buff(&redobuff, s, -1L); add_buff(&redobuff, s, -1L);
@@ -588,9 +577,9 @@ AppendToRedobuff(s)
* K_SPECIAL and CSI are escaped as well. * K_SPECIAL and CSI are escaped as well.
*/ */
void void
AppendToRedobuffLit(str, len) AppendToRedobuffLit(
char_u *str; char_u *str,
int len; /* length of "str" or -1 for up to the NUL */ int len) /* length of "str" or -1 for up to the NUL */
{ {
char_u *s = str; char_u *s = str;
int c; int c;
@@ -649,8 +638,7 @@ AppendToRedobuffLit(str, len)
* Translates special keys, NUL, CSI, K_SPECIAL and multibyte characters. * Translates special keys, NUL, CSI, K_SPECIAL and multibyte characters.
*/ */
void void
AppendCharToRedobuff(c) AppendCharToRedobuff(int c)
int c;
{ {
if (!block_redo) if (!block_redo)
add_char_buff(&redobuff, c); add_char_buff(&redobuff, c);
@@ -660,8 +648,7 @@ AppendCharToRedobuff(c)
* Append a number to the redo buffer. * Append a number to the redo buffer.
*/ */
void void
AppendNumberToRedobuff(n) AppendNumberToRedobuff(long n)
long n;
{ {
if (!block_redo) if (!block_redo)
add_num_buff(&redobuff, n); add_num_buff(&redobuff, n);
@@ -672,8 +659,7 @@ AppendNumberToRedobuff(n)
* CSI and K_SPECIAL must already have been escaped. * CSI and K_SPECIAL must already have been escaped.
*/ */
void void
stuffReadbuff(s) stuffReadbuff(char_u *s)
char_u *s;
{ {
add_buff(&readbuf1, s, -1L); add_buff(&readbuf1, s, -1L);
} }
@@ -683,16 +669,13 @@ stuffReadbuff(s)
* CSI and K_SPECIAL must already have been escaped. * CSI and K_SPECIAL must already have been escaped.
*/ */
void void
stuffRedoReadbuff(s) stuffRedoReadbuff(char_u *s)
char_u *s;
{ {
add_buff(&readbuf2, s, -1L); add_buff(&readbuf2, s, -1L);
} }
void void
stuffReadbuffLen(s, len) stuffReadbuffLen(char_u *s, long len)
char_u *s;
long len;
{ {
add_buff(&readbuf1, s, len); add_buff(&readbuf1, s, len);
} }
@@ -704,8 +687,7 @@ stuffReadbuffLen(s, len)
* Change CR, LF and ESC into a space. * Change CR, LF and ESC into a space.
*/ */
void void
stuffReadbuffSpec(s) stuffReadbuffSpec(char_u *s)
char_u *s;
{ {
int c; int c;
@@ -737,8 +719,7 @@ stuffReadbuffSpec(s)
* Translates special keys, NUL, CSI, K_SPECIAL and multibyte characters. * Translates special keys, NUL, CSI, K_SPECIAL and multibyte characters.
*/ */
void void
stuffcharReadbuff(c) stuffcharReadbuff(int c)
int c;
{ {
add_char_buff(&readbuf1, c); add_char_buff(&readbuf1, c);
} }
@@ -747,8 +728,7 @@ stuffcharReadbuff(c)
* Append a number to the stuff buffer. * Append a number to the stuff buffer.
*/ */
void void
stuffnumReadbuff(n) stuffnumReadbuff(long n)
long n;
{ {
add_num_buff(&readbuf1, n); add_num_buff(&readbuf1, n);
} }
@@ -762,9 +742,7 @@ stuffnumReadbuff(n)
* If old is TRUE, use old_redobuff instead of redobuff. * If old is TRUE, use old_redobuff instead of redobuff.
*/ */
static int static int
read_redo(init, old_redo) read_redo(int init, int old_redo)
int init;
int old_redo;
{ {
static buffblock_T *bp; static buffblock_T *bp;
static char_u *p; static char_u *p;
@@ -837,8 +815,7 @@ read_redo(init, old_redo)
* The escaped K_SPECIAL and CSI are copied without translation. * The escaped K_SPECIAL and CSI are copied without translation.
*/ */
static void static void
copy_redo(old_redo) copy_redo(int old_redo)
int old_redo;
{ {
int c; int c;
@@ -856,9 +833,7 @@ copy_redo(old_redo)
* return FAIL for failure, OK otherwise * return FAIL for failure, OK otherwise
*/ */
int int
start_redo(count, old_redo) start_redo(long count, int old_redo)
long count;
int old_redo;
{ {
int c; int c;
@@ -911,7 +886,7 @@ start_redo(count, old_redo)
* return FAIL for failure, OK otherwise * return FAIL for failure, OK otherwise
*/ */
int int
start_redo_ins() start_redo_ins(void)
{ {
int c; int c;
@@ -937,7 +912,7 @@ start_redo_ins()
} }
void void
stop_redo_ins() stop_redo_ins(void)
{ {
block_redo = FALSE; block_redo = FALSE;
} }
@@ -948,7 +923,7 @@ stop_redo_ins()
* be impossible to type anything. * be impossible to type anything.
*/ */
static void static void
init_typebuf() init_typebuf(void)
{ {
if (typebuf.tb_buf == NULL) if (typebuf.tb_buf == NULL)
{ {
@@ -981,12 +956,12 @@ init_typebuf()
* return FAIL for failure, OK otherwise * return FAIL for failure, OK otherwise
*/ */
int int
ins_typebuf(str, noremap, offset, nottyped, silent) ins_typebuf(
char_u *str; char_u *str,
int noremap; int noremap,
int offset; int offset,
int nottyped; int nottyped,
int silent; int silent)
{ {
char_u *s1, *s2; char_u *s1, *s2;
int newlen; int newlen;
@@ -1114,8 +1089,7 @@ ins_typebuf(str, noremap, offset, nottyped, silent)
* the char. * the char.
*/ */
void void
ins_char_typebuf(c) ins_char_typebuf(int c)
int c;
{ {
#ifdef FEAT_MBYTE #ifdef FEAT_MBYTE
char_u buf[MB_MAXBYTES + 1]; char_u buf[MB_MAXBYTES + 1];
@@ -1151,8 +1125,8 @@ ins_char_typebuf(c)
* that was just added. * that was just added.
*/ */
int int
typebuf_changed(tb_change_cnt) typebuf_changed(
int tb_change_cnt; /* old value of typebuf.tb_change_cnt */ int tb_change_cnt) /* old value of typebuf.tb_change_cnt */
{ {
return (tb_change_cnt != 0 && (typebuf.tb_change_cnt != tb_change_cnt return (tb_change_cnt != 0 && (typebuf.tb_change_cnt != tb_change_cnt
#if defined(FEAT_CLIENTSERVER) || defined(FEAT_EVAL) #if defined(FEAT_CLIENTSERVER) || defined(FEAT_EVAL)
@@ -1166,7 +1140,7 @@ typebuf_changed(tb_change_cnt)
* not been typed (result from a mapping or come from ":normal"). * not been typed (result from a mapping or come from ":normal").
*/ */
int int
typebuf_typed() typebuf_typed(void)
{ {
return typebuf.tb_maplen == 0; return typebuf.tb_maplen == 0;
} }
@@ -1175,7 +1149,7 @@ typebuf_typed()
* Return the number of characters that are mapped (or not typed). * Return the number of characters that are mapped (or not typed).
*/ */
int int
typebuf_maplen() typebuf_maplen(void)
{ {
return typebuf.tb_maplen; return typebuf.tb_maplen;
} }
@@ -1184,9 +1158,7 @@ typebuf_maplen()
* remove "len" characters from typebuf.tb_buf[typebuf.tb_off + offset] * remove "len" characters from typebuf.tb_buf[typebuf.tb_off + offset]
*/ */
void void
del_typebuf(len, offset) del_typebuf(int len, int offset)
int len;
int offset;
{ {
int i; int i;
@@ -1264,9 +1236,7 @@ del_typebuf(len, offset)
* If recording is on put the character in the recordbuffer. * If recording is on put the character in the recordbuffer.
*/ */
static void static void
gotchars(chars, len) gotchars(char_u *chars, int len)
char_u *chars;
int len;
{ {
char_u *s = chars; char_u *s = chars;
int c; int c;
@@ -1311,7 +1281,7 @@ gotchars(chars, len)
* - When no_u_sync is non-zero. * - When no_u_sync is non-zero.
*/ */
static void static void
may_sync_undo() may_sync_undo(void)
{ {
if ((!(State & (INSERT + CMDLINE)) || arrow_used) if ((!(State & (INSERT + CMDLINE)) || arrow_used)
&& scriptin[curscript] == NULL) && scriptin[curscript] == NULL)
@@ -1323,7 +1293,7 @@ may_sync_undo()
* Returns FAIL when out of memory. * Returns FAIL when out of memory.
*/ */
int int
alloc_typebuf() alloc_typebuf(void)
{ {
typebuf.tb_buf = alloc(TYPELEN_INIT); typebuf.tb_buf = alloc(TYPELEN_INIT);
typebuf.tb_noremap = alloc(TYPELEN_INIT); typebuf.tb_noremap = alloc(TYPELEN_INIT);
@@ -1347,7 +1317,7 @@ alloc_typebuf()
* Free the buffers of "typebuf". * Free the buffers of "typebuf".
*/ */
void void
free_typebuf() free_typebuf(void)
{ {
if (typebuf.tb_buf == typebuf_init) if (typebuf.tb_buf == typebuf_init)
EMSG2(_(e_intern2), "Free typebuf 1"); EMSG2(_(e_intern2), "Free typebuf 1");
@@ -1366,7 +1336,7 @@ free_typebuf()
static typebuf_T saved_typebuf[NSCRIPT]; static typebuf_T saved_typebuf[NSCRIPT];
int int
save_typebuf() save_typebuf(void)
{ {
init_typebuf(); init_typebuf();
saved_typebuf[curscript] = typebuf; saved_typebuf[curscript] = typebuf;
@@ -1392,8 +1362,7 @@ static int old_mouse_col; /* mouse_col related to old_char */
* Save all three kinds of typeahead, so that the user must type at a prompt. * Save all three kinds of typeahead, so that the user must type at a prompt.
*/ */
void void
save_typeahead(tp) save_typeahead(tasave_T *tp)
tasave_T *tp;
{ {
tp->save_typebuf = typebuf; tp->save_typebuf = typebuf;
tp->typebuf_valid = (alloc_typebuf() == OK); tp->typebuf_valid = (alloc_typebuf() == OK);
@@ -1418,8 +1387,7 @@ save_typeahead(tp)
* The allocated memory is freed, can only be called once! * The allocated memory is freed, can only be called once!
*/ */
void void
restore_typeahead(tp) restore_typeahead(tasave_T *tp)
tasave_T *tp;
{ {
if (tp->typebuf_valid) if (tp->typebuf_valid)
{ {
@@ -1444,9 +1412,9 @@ restore_typeahead(tp)
* Open a new script file for the ":source!" command. * Open a new script file for the ":source!" command.
*/ */
void void
openscript(name, directly) openscript(
char_u *name; char_u *name,
int directly; /* when TRUE execute directly */ int directly) /* when TRUE execute directly */
{ {
if (curscript + 1 == NSCRIPT) if (curscript + 1 == NSCRIPT)
{ {
@@ -1517,7 +1485,7 @@ openscript(name, directly)
* Close the currently active input script. * Close the currently active input script.
*/ */
static void static void
closescript() closescript(void)
{ {
free_typebuf(); free_typebuf();
typebuf = saved_typebuf[curscript]; typebuf = saved_typebuf[curscript];
@@ -1530,7 +1498,7 @@ closescript()
#if defined(EXITFREE) || defined(PROTO) #if defined(EXITFREE) || defined(PROTO)
void void
close_all_scripts() close_all_scripts(void)
{ {
while (scriptin[0] != NULL) while (scriptin[0] != NULL)
closescript(); closescript();
@@ -1542,7 +1510,7 @@ close_all_scripts()
* Return TRUE when reading keys from a script file. * Return TRUE when reading keys from a script file.
*/ */
int int
using_script() using_script(void)
{ {
return scriptin[curscript] != NULL; return scriptin[curscript] != NULL;
} }
@@ -1553,7 +1521,7 @@ using_script()
* waiting 'updatetime' for a character to arrive. * waiting 'updatetime' for a character to arrive.
*/ */
void void
before_blocking() before_blocking(void)
{ {
updatescript(0); updatescript(0);
#ifdef FEAT_EVAL #ifdef FEAT_EVAL
@@ -1570,8 +1538,7 @@ before_blocking()
* characters reaches 'updatecount' and 'updatecount' is non-zero. * characters reaches 'updatecount' and 'updatecount' is non-zero.
*/ */
void void
updatescript(c) updatescript(int c)
int c;
{ {
static int count = 0; static int count = 0;
@@ -1594,7 +1561,7 @@ updatescript(c)
* Returns the modifiers in the global "mod_mask". * Returns the modifiers in the global "mod_mask".
*/ */
int int
vgetc() vgetc(void)
{ {
int c, c2; int c, c2;
#ifdef FEAT_MBYTE #ifdef FEAT_MBYTE
@@ -1839,7 +1806,7 @@ vgetc()
* directly from the user (ignoring typeahead). * directly from the user (ignoring typeahead).
*/ */
int int
safe_vgetc() safe_vgetc(void)
{ {
int c; int c;
@@ -1854,7 +1821,7 @@ safe_vgetc()
* Also ignore scrollbar events. * Also ignore scrollbar events.
*/ */
int int
plain_vgetc() plain_vgetc(void)
{ {
int c; int c;
@@ -1871,7 +1838,7 @@ plain_vgetc()
* character is not valid!. * character is not valid!.
*/ */
int int
vpeekc() vpeekc(void)
{ {
if (old_char != -1) if (old_char != -1)
return old_char; return old_char;
@@ -1884,7 +1851,7 @@ vpeekc()
* codes. * codes.
*/ */
int int
vpeekc_nomap() vpeekc_nomap(void)
{ {
int c; int c;
@@ -1904,7 +1871,7 @@ vpeekc_nomap()
* buffer, it must be an ESC that is recognized as the start of a key code. * buffer, it must be an ESC that is recognized as the start of a key code.
*/ */
int int
vpeekc_any() vpeekc_any(void)
{ {
int c; int c;
@@ -1920,7 +1887,7 @@ vpeekc_any()
* Return TRUE if a character is available, FALSE otherwise. * Return TRUE if a character is available, FALSE otherwise.
*/ */
int int
char_avail() char_avail(void)
{ {
int retval; int retval;
@@ -1930,9 +1897,11 @@ char_avail()
return (retval != NUL); return (retval != NUL);
} }
/*
* unget one character (can only be done once!)
*/
void void
vungetc(c) /* unget one character (can only be done once!) */ vungetc(int c)
int c;
{ {
old_char = c; old_char = c;
old_mod_mask = mod_mask; old_mod_mask = mod_mask;
@@ -1966,8 +1935,7 @@ vungetc(c) /* unget one character (can only be done once!) */
* K_SPECIAL and CSI may be escaped, need to get two more bytes then. * K_SPECIAL and CSI may be escaped, need to get two more bytes then.
*/ */
static int static int
vgetorpeek(advance) vgetorpeek(int advance)
int advance;
{ {
int c, c1; int c, c1;
int keylen; int keylen;
@@ -2988,11 +2956,11 @@ vgetorpeek(advance)
* Return -1 when end of input script reached. * Return -1 when end of input script reached.
*/ */
int int
inchar(buf, maxlen, wait_time, tb_change_cnt) inchar(
char_u *buf; char_u *buf,
int maxlen; int maxlen,
long wait_time; /* milli seconds */ long wait_time, /* milli seconds */
int tb_change_cnt; int tb_change_cnt)
{ {
int len = 0; /* init for GCC */ int len = 0; /* init for GCC */
int retesc = FALSE; /* return ESC with gotint */ int retesc = FALSE; /* return ESC with gotint */
@@ -3114,10 +3082,10 @@ inchar(buf, maxlen, wait_time, tb_change_cnt)
* Returns the new length. * Returns the new length.
*/ */
int int
fix_input_buffer(buf, len, script) fix_input_buffer(
char_u *buf; char_u *buf,
int len; int len,
int script; /* TRUE when reading from a script */ int script) /* TRUE when reading from a script */
{ {
int i; int i;
char_u *p = buf; char_u *p = buf;
@@ -3182,7 +3150,7 @@ fix_input_buffer(buf, len, script)
* waiting for input to arrive. * waiting for input to arrive.
*/ */
int int
input_available() input_available(void)
{ {
return (!vim_is_input_buf_empty() return (!vim_is_input_buf_empty()
# if defined(FEAT_CLIENTSERVER) || defined(FEAT_EVAL) # if defined(FEAT_CLIENTSERVER) || defined(FEAT_EVAL)
@@ -3231,11 +3199,11 @@ input_available()
* 5 for entry not unique * 5 for entry not unique
*/ */
int int
do_map(maptype, arg, mode, abbrev) do_map(
int maptype; int maptype,
char_u *arg; char_u *arg,
int mode; int mode,
int abbrev; /* not a mapping but an abbreviation */ int abbrev) /* not a mapping but an abbreviation */
{ {
char_u *keys; char_u *keys;
mapblock_T *mp, **mpp; mapblock_T *mp, **mpp;
@@ -3810,8 +3778,7 @@ theend:
* "mpp" is a pointer to the m_next field of the PREVIOUS entry! * "mpp" is a pointer to the m_next field of the PREVIOUS entry!
*/ */
static void static void
map_free(mpp) map_free(mapblock_T **mpp)
mapblock_T **mpp;
{ {
mapblock_T *mp; mapblock_T *mp;
@@ -3827,7 +3794,7 @@ map_free(mpp)
* Initialize maphash[] for first use. * Initialize maphash[] for first use.
*/ */
static void static void
validate_maphash() validate_maphash(void)
{ {
if (!maphash_valid) if (!maphash_valid)
{ {
@@ -3840,9 +3807,7 @@ validate_maphash()
* Get the mapping mode from the command name. * Get the mapping mode from the command name.
*/ */
int int
get_map_mode(cmdp, forceit) get_map_mode(char_u **cmdp, int forceit)
char_u **cmdp;
int forceit;
{ {
char_u *p; char_u *p;
int modec; int modec;
@@ -3884,11 +3849,11 @@ get_map_mode(cmdp, forceit)
* 'abbr' should be FALSE for mappings, TRUE for abbreviations. * 'abbr' should be FALSE for mappings, TRUE for abbreviations.
*/ */
void void
map_clear(cmdp, arg, forceit, abbr) map_clear(
char_u *cmdp; char_u *cmdp,
char_u *arg UNUSED; char_u *arg UNUSED,
int forceit; int forceit,
int abbr; int abbr)
{ {
int mode; int mode;
#ifdef FEAT_LOCALMAP #ifdef FEAT_LOCALMAP
@@ -3916,11 +3881,11 @@ map_clear(cmdp, arg, forceit, abbr)
* Clear all mappings in "mode". * Clear all mappings in "mode".
*/ */
void void
map_clear_int(buf, mode, local, abbr) map_clear_int(
buf_T *buf UNUSED; /* buffer for local mappings */ buf_T *buf UNUSED, /* buffer for local mappings */
int mode; /* mode in which to delete */ int mode, /* mode in which to delete */
int local UNUSED; /* TRUE for buffer-local mappings */ int local UNUSED, /* TRUE for buffer-local mappings */
int abbr; /* TRUE for abbreviations */ int abbr) /* TRUE for abbreviations */
{ {
mapblock_T *mp, **mpp; mapblock_T *mp, **mpp;
int hash; int hash;
@@ -3993,8 +3958,7 @@ map_clear_int(buf, mode, local, abbr)
* Returns NULL when out of memory. * Returns NULL when out of memory.
*/ */
char_u * char_u *
map_mode_to_chars(mode) map_mode_to_chars(int mode)
int mode;
{ {
garray_T mapmode; garray_T mapmode;
@@ -4033,9 +3997,9 @@ map_mode_to_chars(mode)
} }
static void static void
showmap(mp, local) showmap(
mapblock_T *mp; mapblock_T *mp,
int local; /* TRUE for buffer-local map */ int local) /* TRUE for buffer-local map */
{ {
int len = 1; int len = 1;
char_u *mapchars; char_u *mapchars;
@@ -4108,10 +4072,7 @@ showmap(mp, local)
* Also checks mappings local to the current buffer. * Also checks mappings local to the current buffer.
*/ */
int int
map_to_exists(str, modechars, abbr) map_to_exists(char_u *str, char_u *modechars, int abbr)
char_u *str;
char_u *modechars;
int abbr;
{ {
int mode = 0; int mode = 0;
char_u *rhs; char_u *rhs;
@@ -4149,10 +4110,7 @@ map_to_exists(str, modechars, abbr)
* Also checks mappings local to the current buffer. * Also checks mappings local to the current buffer.
*/ */
int int
map_to_exists_mode(rhs, mode, abbr) map_to_exists_mode(char_u *rhs, int mode, int abbr)
char_u *rhs;
int mode;
int abbr;
{ {
mapblock_T *mp; mapblock_T *mp;
int hash; int hash;
@@ -4216,14 +4174,14 @@ static int expand_buffer = FALSE;
* or abbreviation names. * or abbreviation names.
*/ */
char_u * char_u *
set_context_in_map_cmd(xp, cmd, arg, forceit, isabbrev, isunmap, cmdidx) set_context_in_map_cmd(
expand_T *xp; expand_T *xp,
char_u *cmd; char_u *cmd,
char_u *arg; char_u *arg,
int forceit; /* TRUE if '!' given */ int forceit, /* TRUE if '!' given */
int isabbrev; /* TRUE if abbreviation */ int isabbrev, /* TRUE if abbreviation */
int isunmap; /* TRUE if unmap/unabbrev command */ int isunmap, /* TRUE if unmap/unabbrev command */
cmdidx_T cmdidx; cmdidx_T cmdidx)
{ {
if (forceit && cmdidx != CMD_map && cmdidx != CMD_unmap) if (forceit && cmdidx != CMD_map && cmdidx != CMD_unmap)
xp->xp_context = EXPAND_NOTHING; xp->xp_context = EXPAND_NOTHING;
@@ -4293,10 +4251,10 @@ set_context_in_map_cmd(xp, cmd, arg, forceit, isabbrev, isunmap, cmdidx)
* Return OK if matches found, FAIL otherwise. * Return OK if matches found, FAIL otherwise.
*/ */
int int
ExpandMappings(regmatch, num_file, file) ExpandMappings(
regmatch_T *regmatch; regmatch_T *regmatch,
int *num_file; int *num_file,
char_u ***file; char_u ***file)
{ {
mapblock_T *mp; mapblock_T *mp;
int hash; int hash;
@@ -4441,11 +4399,11 @@ ExpandMappings(regmatch, num_file, file)
* return TRUE if there is an abbreviation, FALSE if not * return TRUE if there is an abbreviation, FALSE if not
*/ */
int int
check_abbr(c, ptr, col, mincol) check_abbr(
int c; int c,
char_u *ptr; char_u *ptr,
int col; int col,
int mincol; int mincol)
{ {
int len; int len;
int scol; /* starting column of the abbr. */ int scol; /* starting column of the abbr. */
@@ -4651,9 +4609,9 @@ check_abbr(c, ptr, col, mincol)
* special characters. * special characters.
*/ */
static char_u * static char_u *
eval_map_expr(str, c) eval_map_expr(
char_u *str; char_u *str,
int c; /* NUL or typed character for abbreviation */ int c) /* NUL or typed character for abbreviation */
{ {
char_u *res; char_u *res;
char_u *p; char_u *p;
@@ -4715,8 +4673,8 @@ eval_map_expr(str, c)
* Returns NULL when out of memory. * Returns NULL when out of memory.
*/ */
char_u * char_u *
vim_strsave_escape_csi(p) vim_strsave_escape_csi(
char_u *p; char_u *p)
{ {
char_u *res; char_u *res;
char_u *s, *d; char_u *s, *d;
@@ -4765,8 +4723,7 @@ vim_strsave_escape_csi(p)
* vim_strsave_escape_csi(). Works in-place. * vim_strsave_escape_csi(). Works in-place.
*/ */
void void
vim_unescape_csi(p) vim_unescape_csi(char_u *p)
char_u *p;
{ {
char_u *s = p, *d = p; char_u *s = p, *d = p;
@@ -4794,9 +4751,9 @@ vim_unescape_csi(p)
* Return FAIL on error, OK otherwise. * Return FAIL on error, OK otherwise.
*/ */
int int
makemap(fd, buf) makemap(
FILE *fd; FILE *fd,
buf_T *buf; /* buffer for local mappings or NULL */ buf_T *buf) /* buffer for local mappings or NULL */
{ {
mapblock_T *mp; mapblock_T *mp;
char_u c1, c2, c3; char_u c1, c2, c3;
@@ -5007,10 +4964,7 @@ makemap(fd, buf)
* return FAIL for failure, OK otherwise * return FAIL for failure, OK otherwise
*/ */
int int
put_escstr(fd, strstart, what) put_escstr(FILE *fd, char_u *strstart, int what)
FILE *fd;
char_u *strstart;
int what;
{ {
char_u *str = strstart; char_u *str = strstart;
int c; int c;
@@ -5123,7 +5077,7 @@ put_escstr(fd, strstart, what)
* Used after ":set term=xxx". * Used after ":set term=xxx".
*/ */
void void
check_map_keycodes() check_map_keycodes(void)
{ {
mapblock_T *mp; mapblock_T *mp;
char_u *p; char_u *p;
@@ -5215,14 +5169,14 @@ check_map_keycodes()
* NULL when no mapping found. * NULL when no mapping found.
*/ */
char_u * char_u *
check_map(keys, mode, exact, ign_mod, abbr, mp_ptr, local_ptr) check_map(
char_u *keys; char_u *keys,
int mode; int mode,
int exact; /* require exact match */ int exact, /* require exact match */
int ign_mod; /* ignore preceding modifier */ int ign_mod, /* ignore preceding modifier */
int abbr; /* do abbreviations */ int abbr, /* do abbreviations */
mapblock_T **mp_ptr; /* return: pointer to mapblock or NULL */ mapblock_T **mp_ptr, /* return: pointer to mapblock or NULL */
int *local_ptr; /* return: buffer-local mapping or NULL */ int *local_ptr) /* return: buffer-local mapping or NULL */
{ {
int hash; int hash;
int len, minlen; int len, minlen;
@@ -5378,7 +5332,7 @@ static struct initmap
* Set up default mappings. * Set up default mappings.
*/ */
void void
init_mappings() init_mappings(void)
{ {
#if defined(MSDOS) || defined(MSWIN) ||defined(MACOS) #if defined(MSDOS) || defined(MSWIN) ||defined(MACOS)
int i; int i;
@@ -5395,9 +5349,7 @@ init_mappings()
* Need to put string in allocated memory, because do_map() will modify it. * Need to put string in allocated memory, because do_map() will modify it.
*/ */
void void
add_map(map, mode) add_map(char_u *map, int mode)
char_u *map;
int mode;
{ {
char_u *s; char_u *s;
char_u *cpo_save = p_cpo; char_u *cpo_save = p_cpo;

356
src/gui.c
View File

@@ -73,7 +73,7 @@ static int can_update_cursor = TRUE; /* can display the cursor */
* recursive call. * recursive call.
*/ */
void void
gui_start() gui_start(void)
{ {
char_u *old_term; char_u *old_term;
static int recursive = 0; static int recursive = 0;
@@ -152,7 +152,7 @@ gui_start()
* full_screen will be set to TRUE again by a successful termcapinit(). * full_screen will be set to TRUE again by a successful termcapinit().
*/ */
static void static void
gui_attempt_start() gui_attempt_start(void)
{ {
static int recursive = 0; static int recursive = 0;
@@ -204,7 +204,7 @@ gui_attempt_start()
* and the child will return. * and the child will return.
*/ */
static void static void
gui_do_fork() gui_do_fork(void)
{ {
int pipefd[2]; /* pipe between parent and child */ int pipefd[2]; /* pipe between parent and child */
int pipe_error; int pipe_error;
@@ -345,9 +345,7 @@ gui_read_child_pipe(int fd)
* Call this when vim starts up, whether or not the GUI is started * Call this when vim starts up, whether or not the GUI is started
*/ */
void void
gui_prepare(argc, argv) gui_prepare(int *argc, char **argv)
int *argc;
char **argv;
{ {
gui.in_use = FALSE; /* No GUI yet (maybe later) */ gui.in_use = FALSE; /* No GUI yet (maybe later) */
gui.starting = FALSE; /* No GUI yet (maybe later) */ gui.starting = FALSE; /* No GUI yet (maybe later) */
@@ -361,7 +359,7 @@ gui_prepare(argc, argv)
* Returns FAIL or OK. * Returns FAIL or OK.
*/ */
int int
gui_init_check() gui_init_check(void)
{ {
static int result = MAYBE; static int result = MAYBE;
@@ -461,7 +459,7 @@ gui_init_check()
* This is the call which starts the GUI. * This is the call which starts the GUI.
*/ */
void void
gui_init() gui_init(void)
{ {
win_T *wp; win_T *wp;
static int recursive = 0; static int recursive = 0;
@@ -789,8 +787,7 @@ error:
void void
gui_exit(rc) gui_exit(int rc)
int rc;
{ {
/* don't free the fonts, it leads to a BUS error /* don't free the fonts, it leads to a BUS error
* richard@whitequeen.com Jul 99 */ * richard@whitequeen.com Jul 99 */
@@ -809,7 +806,7 @@ gui_exit(rc)
* When this function returns, Vim should NOT exit! * When this function returns, Vim should NOT exit!
*/ */
void void
gui_shell_closed() gui_shell_closed(void)
{ {
cmdmod_T save_cmdmod; cmdmod_T save_cmdmod;
@@ -843,9 +840,7 @@ gui_shell_closed()
* the fonts are unchanged. * the fonts are unchanged.
*/ */
int int
gui_init_font(font_list, fontset) gui_init_font(char_u *font_list, int fontset UNUSED)
char_u *font_list;
int fontset UNUSED;
{ {
#define FONTLEN 320 #define FONTLEN 320
char_u font_name[FONTLEN]; char_u font_name[FONTLEN];
@@ -926,8 +921,7 @@ gui_init_font(font_list, fontset)
* Try setting 'guifontwide' to a font twice as wide as "name". * Try setting 'guifontwide' to a font twice as wide as "name".
*/ */
static void static void
set_guifontwide(name) set_guifontwide(char_u *name)
char_u *name;
{ {
int i = 0; int i = 0;
char_u wide_name[FONTLEN + 10]; /* room for 2 * width and '*' */ char_u wide_name[FONTLEN + 10]; /* room for 2 * width and '*' */
@@ -976,7 +970,7 @@ set_guifontwide(name)
* Return FAIL for an invalid font name. * Return FAIL for an invalid font name.
*/ */
int int
gui_get_wide_font() gui_get_wide_font(void)
{ {
GuiFont font = NOFONT; GuiFont font = NOFONT;
char_u font_name[FONTLEN]; char_u font_name[FONTLEN];
@@ -1024,9 +1018,7 @@ gui_get_wide_font()
#endif #endif
void void
gui_set_cursor(row, col) gui_set_cursor(int row, int col)
int row;
int col;
{ {
gui.row = row; gui.row = row;
gui.col = col; gui.col = col;
@@ -1036,7 +1028,7 @@ gui_set_cursor(row, col)
* gui_check_pos - check if the cursor is on the screen. * gui_check_pos - check if the cursor is on the screen.
*/ */
static void static void
gui_check_pos() gui_check_pos(void)
{ {
if (gui.row >= screen_Rows) if (gui.row >= screen_Rows)
gui.row = screen_Rows - 1; gui.row = screen_Rows - 1;
@@ -1052,9 +1044,9 @@ gui_check_pos()
* otherwise this goes wrong. May need to call out_flush() first. * otherwise this goes wrong. May need to call out_flush() first.
*/ */
void void
gui_update_cursor(force, clear_selection) gui_update_cursor(
int force; /* when TRUE, update even when not moved */ int force, /* when TRUE, update even when not moved */
int clear_selection;/* clear selection under cursor */ int clear_selection)/* clear selection under cursor */
{ {
int cur_width = 0; int cur_width = 0;
int cur_height = 0; int cur_height = 0;
@@ -1301,7 +1293,7 @@ gui_update_cursor(force, clear_selection)
#if defined(FEAT_MENU) || defined(PROTO) #if defined(FEAT_MENU) || defined(PROTO)
void void
gui_position_menu() gui_position_menu(void)
{ {
# if !defined(FEAT_GUI_GTK) && !defined(FEAT_GUI_MOTIF) # if !defined(FEAT_GUI_GTK) && !defined(FEAT_GUI_MOTIF)
if (gui.menu_is_active && gui.in_use) if (gui.menu_is_active && gui.in_use)
@@ -1315,8 +1307,7 @@ gui_position_menu()
* scrollbars are NOT handled here. See gui_update_scrollbars(). * scrollbars are NOT handled here. See gui_update_scrollbars().
*/ */
static void static void
gui_position_components(total_width) gui_position_components(int total_width UNUSED)
int total_width UNUSED;
{ {
int text_area_x; int text_area_x;
int text_area_y; int text_area_y;
@@ -1388,7 +1379,7 @@ gui_position_components(total_width)
* Get the width of the widgets and decorations to the side of the text area. * Get the width of the widgets and decorations to the side of the text area.
*/ */
int int
gui_get_base_width() gui_get_base_width(void)
{ {
int base_width; int base_width;
@@ -1404,7 +1395,7 @@ gui_get_base_width()
* Get the height of the widgets and decorations above and below the text area. * Get the height of the widgets and decorations above and below the text area.
*/ */
int int
gui_get_base_height() gui_get_base_height(void)
{ {
int base_height; int base_height;
@@ -1449,9 +1440,7 @@ gui_get_base_height()
* the new width and height of the shell in pixels. * the new width and height of the shell in pixels.
*/ */
void void
gui_resize_shell(pixel_width, pixel_height) gui_resize_shell(int pixel_width, int pixel_height)
int pixel_width;
int pixel_height;
{ {
static int busy = FALSE; static int busy = FALSE;
@@ -1520,7 +1509,7 @@ again:
* Check if gui_resize_shell() must be called. * Check if gui_resize_shell() must be called.
*/ */
void void
gui_may_resize_shell() gui_may_resize_shell(void)
{ {
int h, w; int h, w;
@@ -1537,7 +1526,7 @@ gui_may_resize_shell()
} }
int int
gui_get_shellsize() gui_get_shellsize(void)
{ {
Rows = gui.num_rows; Rows = gui.num_rows;
Columns = gui.num_cols; Columns = gui.num_cols;
@@ -1550,10 +1539,10 @@ gui_get_shellsize()
* on the screen. * on the screen.
*/ */
void void
gui_set_shellsize(mustset, fit_to_display, direction) gui_set_shellsize(
int mustset UNUSED; /* set by the user */ int mustset UNUSED, /* set by the user */
int fit_to_display; int fit_to_display,
int direction; /* RESIZE_HOR, RESIZE_VER */ int direction) /* RESIZE_HOR, RESIZE_VER */
{ {
int base_width; int base_width;
int base_height; int base_height;
@@ -1676,7 +1665,7 @@ gui_set_shellsize(mustset, fit_to_display, direction)
* Called when Rows and/or Columns has changed. * Called when Rows and/or Columns has changed.
*/ */
void void
gui_new_shellsize() gui_new_shellsize(void)
{ {
gui_reset_scroll_region(); gui_reset_scroll_region();
} }
@@ -1685,7 +1674,7 @@ gui_new_shellsize()
* Make scroll region cover whole screen. * Make scroll region cover whole screen.
*/ */
void void
gui_reset_scroll_region() gui_reset_scroll_region(void)
{ {
gui.scroll_region_top = 0; gui.scroll_region_top = 0;
gui.scroll_region_bot = gui.num_rows - 1; gui.scroll_region_bot = gui.num_rows - 1;
@@ -1694,8 +1683,7 @@ gui_reset_scroll_region()
} }
void void
gui_start_highlight(mask) gui_start_highlight(int mask)
int mask;
{ {
if (mask > HL_ALL) /* highlight code */ if (mask > HL_ALL) /* highlight code */
gui.highlight_mask = mask; gui.highlight_mask = mask;
@@ -1704,8 +1692,7 @@ gui_start_highlight(mask)
} }
void void
gui_stop_highlight(mask) gui_stop_highlight(int mask)
int mask;
{ {
if (mask > HL_ALL) /* highlight code */ if (mask > HL_ALL) /* highlight code */
gui.highlight_mask = HL_NORMAL; gui.highlight_mask = HL_NORMAL;
@@ -1718,11 +1705,11 @@ gui_stop_highlight(mask)
* (row2, col2) inclusive. * (row2, col2) inclusive.
*/ */
void void
gui_clear_block(row1, col1, row2, col2) gui_clear_block(
int row1; int row1,
int col1; int col1,
int row2; int row2,
int col2; int col2)
{ {
/* Clear the selection if we are about to write over it */ /* Clear the selection if we are about to write over it */
clip_may_clear_selection(row1, row2); clip_may_clear_selection(row1, row2);
@@ -1740,15 +1727,15 @@ gui_clear_block(row1, col1, row2, col2)
* output buffer before calling gui_update_cursor(). * output buffer before calling gui_update_cursor().
*/ */
void void
gui_update_cursor_later() gui_update_cursor_later(void)
{ {
OUT_STR(IF_EB("\033|s", ESC_STR "|s")); OUT_STR(IF_EB("\033|s", ESC_STR "|s"));
} }
void void
gui_write(s, len) gui_write(
char_u *s; char_u *s,
int len; int len)
{ {
char_u *p; char_u *p;
int arg1 = 0, arg2 = 0; int arg1 = 0, arg2 = 0;
@@ -1977,7 +1964,7 @@ gui_write(s, len)
* gui_can_update_cursor() afterwards. * gui_can_update_cursor() afterwards.
*/ */
void void
gui_dont_update_cursor() gui_dont_update_cursor(void)
{ {
if (gui.in_use) if (gui.in_use)
{ {
@@ -1988,7 +1975,7 @@ gui_dont_update_cursor()
} }
void void
gui_can_update_cursor() gui_can_update_cursor(void)
{ {
can_update_cursor = TRUE; can_update_cursor = TRUE;
/* No need to update the cursor right now, there is always more output /* No need to update the cursor right now, there is always more output
@@ -1996,9 +1983,7 @@ gui_can_update_cursor()
} }
static void static void
gui_outstr(s, len) gui_outstr(char_u *s, int len)
char_u *s;
int len;
{ {
int this_len; int this_len;
#ifdef FEAT_MBYTE #ifdef FEAT_MBYTE
@@ -2060,11 +2045,12 @@ gui_outstr(s, len)
* Returns FAIL or OK, just like gui_outstr_nowrap(). * Returns FAIL or OK, just like gui_outstr_nowrap().
*/ */
static int static int
gui_screenchar(off, flags, fg, bg, back) gui_screenchar(
int off; /* Offset from start of screen */ int off, /* Offset from start of screen */
int flags; int flags,
guicolor_T fg, bg; /* colors for cursor */ guicolor_T fg, /* colors for cursor */
int back; /* backup this many chars when using bold trick */ guicolor_T bg, /* colors for cursor */
int back) /* backup this many chars when using bold trick */
{ {
#ifdef FEAT_MBYTE #ifdef FEAT_MBYTE
char_u buf[MB_MAXBYTES + 1]; char_u buf[MB_MAXBYTES + 1];
@@ -2101,12 +2087,13 @@ gui_screenchar(off, flags, fg, bg, back)
* as possible to work nicely. It's a lot faster as well. * as possible to work nicely. It's a lot faster as well.
*/ */
static int static int
gui_screenstr(off, len, flags, fg, bg, back) gui_screenstr(
int off; /* Offset from start of screen */ int off, /* Offset from start of screen */
int len; /* string length in screen cells */ int len, /* string length in screen cells */
int flags; int flags,
guicolor_T fg, bg; /* colors for cursor */ guicolor_T fg, /* colors for cursor */
int back; /* backup this many chars when using bold trick */ guicolor_T bg, /* colors for cursor */
int back) /* backup this many chars when using bold trick */
{ {
char_u *buf; char_u *buf;
int outlen = 0; int outlen = 0;
@@ -2184,12 +2171,13 @@ gui_screenstr(off, len, flags, fg, bg, back)
* FAIL (the caller should start drawing "back" chars back). * FAIL (the caller should start drawing "back" chars back).
*/ */
int int
gui_outstr_nowrap(s, len, flags, fg, bg, back) gui_outstr_nowrap(
char_u *s; char_u *s,
int len; int len,
int flags; int flags,
guicolor_T fg, bg; /* colors for cursor */ guicolor_T fg, /* colors for cursor */
int back; /* backup this many chars when using bold trick */ guicolor_T bg, /* colors for cursor */
int back) /* backup this many chars when using bold trick */
{ {
long_u highlight_mask; long_u highlight_mask;
long_u hl_mask_todo; long_u hl_mask_todo;
@@ -2576,7 +2564,7 @@ gui_outstr_nowrap(s, len, flags, fg, bg, back)
* position. The character just before it too, for when it was in bold. * position. The character just before it too, for when it was in bold.
*/ */
void void
gui_undraw_cursor() gui_undraw_cursor(void)
{ {
if (gui.cursor_is_valid) if (gui.cursor_is_valid)
{ {
@@ -2617,11 +2605,11 @@ gui_undraw_cursor()
} }
void void
gui_redraw(x, y, w, h) gui_redraw(
int x; int x,
int y; int y,
int w; int w,
int h; int h)
{ {
int row1, col1, row2, col2; int row1, col1, row2, col2;
@@ -2650,12 +2638,12 @@ gui_redraw(x, y, w, h)
* different attributes (may have to be redrawn too). * different attributes (may have to be redrawn too).
*/ */
int int
gui_redraw_block(row1, col1, row2, col2, flags) gui_redraw_block(
int row1; int row1,
int col1; int col1,
int row2; int row2,
int col2; int col2,
int flags; /* flags for gui_outstr_nowrap() */ int flags) /* flags for gui_outstr_nowrap() */
{ {
int old_row, old_col; int old_row, old_col;
long_u old_hl_mask; long_u old_hl_mask;
@@ -2814,9 +2802,7 @@ gui_redraw_block(row1, col1, row2, col2, flags)
} }
static void static void
gui_delete_lines(row, count) gui_delete_lines(int row, int count)
int row;
int count;
{ {
if (count <= 0) if (count <= 0)
return; return;
@@ -2844,9 +2830,7 @@ gui_delete_lines(row, count)
} }
static void static void
gui_insert_lines(row, count) gui_insert_lines(int row, int count)
int row;
int count;
{ {
if (count <= 0) if (count <= 0)
return; return;
@@ -2880,8 +2864,7 @@ gui_insert_lines(row, count)
* or FAIL otherwise. * or FAIL otherwise.
*/ */
int int
gui_wait_for_chars(wtime) gui_wait_for_chars(long wtime)
long wtime;
{ {
int retval; int retval;
@@ -2956,10 +2939,7 @@ gui_wait_for_chars(wtime)
* Fill p[4] with mouse coordinates encoded for check_termcode(). * Fill p[4] with mouse coordinates encoded for check_termcode().
*/ */
static void static void
fill_mouse_coord(p, col, row) fill_mouse_coord(char_u *p, int col, int row)
char_u *p;
int col;
int row;
{ {
p[0] = (char_u)(col / 128 + ' ' + 1); p[0] = (char_u)(col / 128 + ' ' + 1);
p[1] = (char_u)(col % 128 + ' ' + 1); p[1] = (char_u)(col % 128 + ' ' + 1);
@@ -2984,12 +2964,12 @@ fill_mouse_coord(p, col, row)
* character. * character.
*/ */
void void
gui_send_mouse_event(button, x, y, repeated_click, modifiers) gui_send_mouse_event(
int button; int button,
int x; int x,
int y; int y,
int repeated_click; int repeated_click,
int_u modifiers; int_u modifiers)
{ {
static int prev_row = 0, prev_col = 0; static int prev_row = 0, prev_col = 0;
static int prev_button = -1; static int prev_button = -1;
@@ -3299,10 +3279,7 @@ button_set:
* returns column in "*colp" and row as return value; * returns column in "*colp" and row as return value;
*/ */
int int
gui_xy2colrow(x, y, colp) gui_xy2colrow(int x, int y, int *colp)
int x;
int y;
int *colp;
{ {
int col = check_col(X_2_COL(x)); int col = check_col(X_2_COL(x));
int row = check_row(Y_2_ROW(y)); int row = check_row(Y_2_ROW(y));
@@ -3320,8 +3297,7 @@ gui_xy2colrow(x, y, colp)
* Callback function for when a menu entry has been selected. * Callback function for when a menu entry has been selected.
*/ */
void void
gui_menu_cb(menu) gui_menu_cb(vimmenu_T *menu)
vimmenu_T *menu;
{ {
char_u bytes[sizeof(long_u)]; char_u bytes[sizeof(long_u)];
@@ -3346,8 +3322,7 @@ static int prev_which_scrollbars[3];
* in p_go. * in p_go.
*/ */
void void
gui_init_which_components(oldval) gui_init_which_components(char_u *oldval UNUSED)
char_u *oldval UNUSED;
{ {
#ifdef FEAT_MENU #ifdef FEAT_MENU
static int prev_menu_is_active = -1; static int prev_menu_is_active = -1;
@@ -3599,7 +3574,7 @@ gui_init_which_components(oldval)
* It may still be hidden if 'showtabline' is zero. * It may still be hidden if 'showtabline' is zero.
*/ */
int int
gui_use_tabline() gui_use_tabline(void)
{ {
return gui.in_use && vim_strchr(p_go, GO_TABLINE) != NULL; return gui.in_use && vim_strchr(p_go, GO_TABLINE) != NULL;
} }
@@ -3609,7 +3584,7 @@ gui_use_tabline()
* This uses 'showtabline'. * This uses 'showtabline'.
*/ */
static int static int
gui_has_tabline() gui_has_tabline(void)
{ {
if (!gui_use_tabline() if (!gui_use_tabline()
|| p_stal == 0 || p_stal == 0
@@ -3623,7 +3598,7 @@ gui_has_tabline()
* This may display/undisplay the tabline and update the labels. * This may display/undisplay the tabline and update the labels.
*/ */
void void
gui_update_tabline() gui_update_tabline(void)
{ {
int showit = gui_has_tabline(); int showit = gui_has_tabline();
int shown = gui_mch_showing_tabline(); int shown = gui_mch_showing_tabline();
@@ -3651,9 +3626,9 @@ gui_update_tabline()
* Get the label or tooltip for tab page "tp" into NameBuff[]. * Get the label or tooltip for tab page "tp" into NameBuff[].
*/ */
void void
get_tabline_label(tp, tooltip) get_tabline_label(
tabpage_T *tp; tabpage_T *tp,
int tooltip; /* TRUE: get tooltip */ int tooltip) /* TRUE: get tooltip */
{ {
int modified = FALSE; int modified = FALSE;
char_u buf[40]; char_u buf[40];
@@ -3744,8 +3719,7 @@ get_tabline_label(tp, tooltip)
* that tab page or the cmdline window is open. * that tab page or the cmdline window is open.
*/ */
int int
send_tabline_event(nr) send_tabline_event(int nr)
int nr;
{ {
char_u string[3]; char_u string[3];
@@ -3777,9 +3751,7 @@ send_tabline_event(nr)
* Send a tabline menu event * Send a tabline menu event
*/ */
void void
send_tabline_menu_event(tabidx, event) send_tabline_menu_event(int tabidx, int event)
int tabidx;
int event;
{ {
char_u string[3]; char_u string[3];
@@ -3807,7 +3779,7 @@ send_tabline_menu_event(tabidx, event)
* Remove all scrollbars. Used before switching to another tab page. * Remove all scrollbars. Used before switching to another tab page.
*/ */
void void
gui_remove_scrollbars() gui_remove_scrollbars(void)
{ {
int i; int i;
win_T *wp; win_T *wp;
@@ -3829,10 +3801,7 @@ gui_remove_scrollbars()
#endif #endif
void void
gui_create_scrollbar(sb, type, wp) gui_create_scrollbar(scrollbar_T *sb, int type, win_T *wp)
scrollbar_T *sb;
int type;
win_T *wp;
{ {
static int sbar_ident = 0; static int sbar_ident = 0;
@@ -3858,8 +3827,7 @@ gui_create_scrollbar(sb, type, wp)
* Find the scrollbar with the given index. * Find the scrollbar with the given index.
*/ */
scrollbar_T * scrollbar_T *
gui_find_scrollbar(ident) gui_find_scrollbar(long ident)
long ident;
{ {
win_T *wp; win_T *wp;
@@ -3891,10 +3859,7 @@ gui_find_scrollbar(ident)
* are still characters to be processed. * are still characters to be processed.
*/ */
void void
gui_drag_scrollbar(sb, value, still_dragging) gui_drag_scrollbar(scrollbar_T *sb, long value, int still_dragging)
scrollbar_T *sb;
long value;
int still_dragging;
{ {
#ifdef FEAT_WINDOWS #ifdef FEAT_WINDOWS
win_T *wp; win_T *wp;
@@ -4112,7 +4077,7 @@ gui_drag_scrollbar(sb, value, still_dragging)
* Called when something in the window layout has changed. * Called when something in the window layout has changed.
*/ */
void void
gui_may_update_scrollbars() gui_may_update_scrollbars(void)
{ {
if (gui.in_use && starting == 0) if (gui.in_use && starting == 0)
{ {
@@ -4125,8 +4090,8 @@ gui_may_update_scrollbars()
#endif #endif
void void
gui_update_scrollbars(force) gui_update_scrollbars(
int force; /* Force all scrollbars to get updated */ int force) /* Force all scrollbars to get updated */
{ {
win_T *wp; win_T *wp;
scrollbar_T *sb; scrollbar_T *sb;
@@ -4340,10 +4305,10 @@ gui_update_scrollbars(force)
* sometimes. * sometimes.
*/ */
static void static void
gui_do_scrollbar(wp, which, enable) gui_do_scrollbar(
win_T *wp; win_T *wp,
int which; /* SBAR_LEFT or SBAR_RIGHT */ int which, /* SBAR_LEFT or SBAR_RIGHT */
int enable; /* TRUE to enable scrollbar */ int enable) /* TRUE to enable scrollbar */
{ {
#ifdef FEAT_VERTSPLIT #ifdef FEAT_VERTSPLIT
int midcol = curwin->w_wincol + curwin->w_width / 2; int midcol = curwin->w_wincol + curwin->w_width / 2;
@@ -4386,7 +4351,7 @@ gui_do_scrollbar(wp, which, enable)
* or FALSE otherwise. * or FALSE otherwise.
*/ */
int int
gui_do_scroll() gui_do_scroll(void)
{ {
win_T *wp, *save_wp; win_T *wp, *save_wp;
int i; int i;
@@ -4498,8 +4463,7 @@ gui_do_scroll()
* Return length of line "lnum" for horizontal scrolling. * Return length of line "lnum" for horizontal scrolling.
*/ */
static colnr_T static colnr_T
scroll_line_len(lnum) scroll_line_len(linenr_T lnum)
linenr_T lnum;
{ {
char_u *p; char_u *p;
colnr_T col; colnr_T col;
@@ -4528,7 +4492,7 @@ static linenr_T longest_lnum = 0;
* by setting 'h' in "guioptions") then the current line number is returned. * by setting 'h' in "guioptions") then the current line number is returned.
*/ */
static linenr_T static linenr_T
gui_find_longest_lnum() gui_find_longest_lnum(void)
{ {
linenr_T ret = 0; linenr_T ret = 0;
@@ -4569,8 +4533,7 @@ gui_find_longest_lnum()
} }
static void static void
gui_update_horiz_scrollbar(force) gui_update_horiz_scrollbar(int force)
int force;
{ {
long value, size, max; /* need 32 bit ints here */ long value, size, max; /* need 32 bit ints here */
@@ -4662,9 +4625,7 @@ gui_update_horiz_scrollbar(force)
* Do a horizontal scroll. Return TRUE if the cursor moved, FALSE otherwise. * Do a horizontal scroll. Return TRUE if the cursor moved, FALSE otherwise.
*/ */
int int
gui_do_horiz_scroll(leftcol, compute_longest_lnum) gui_do_horiz_scroll(long_u leftcol, int compute_longest_lnum)
long_u leftcol;
int compute_longest_lnum;
{ {
/* no wrapping, no scrolling */ /* no wrapping, no scrolling */
if (curwin->w_p_wrap) if (curwin->w_p_wrap)
@@ -4702,7 +4663,7 @@ gui_do_horiz_scroll(leftcol, compute_longest_lnum)
* Check that none of the colors are the same as the background color * Check that none of the colors are the same as the background color
*/ */
void void
gui_check_colors() gui_check_colors(void)
{ {
if (gui.norm_pixel == gui.back_pixel || gui.norm_pixel == INVALCOLOR) if (gui.norm_pixel == gui.back_pixel || gui.norm_pixel == INVALCOLOR)
{ {
@@ -4713,16 +4674,14 @@ gui_check_colors()
} }
static void static void
gui_set_fg_color(name) gui_set_fg_color(char_u *name)
char_u *name;
{ {
gui.norm_pixel = gui_get_color(name); gui.norm_pixel = gui_get_color(name);
hl_set_fg_color_name(vim_strsave(name)); hl_set_fg_color_name(vim_strsave(name));
} }
static void static void
gui_set_bg_color(name) gui_set_bg_color(char_u *name)
char_u *name;
{ {
gui.back_pixel = gui_get_color(name); gui.back_pixel = gui_get_color(name);
hl_set_bg_color_name(vim_strsave(name)); hl_set_bg_color_name(vim_strsave(name));
@@ -4733,8 +4692,7 @@ gui_set_bg_color(name)
* Returns INVALCOLOR and gives an error message when failed. * Returns INVALCOLOR and gives an error message when failed.
*/ */
guicolor_T guicolor_T
gui_get_color(name) gui_get_color(char_u *name)
char_u *name;
{ {
guicolor_T t; guicolor_T t;
@@ -4755,8 +4713,7 @@ gui_get_color(name)
* Return the grey value of a color (range 0-255). * Return the grey value of a color (range 0-255).
*/ */
int int
gui_get_lightness(pixel) gui_get_lightness(guicolor_T pixel)
guicolor_T pixel;
{ {
long_u rgb = gui_mch_get_rgb(pixel); long_u rgb = gui_mch_get_rgb(pixel);
@@ -4767,7 +4724,7 @@ gui_get_lightness(pixel)
#if defined(FEAT_GUI_X11) || defined(PROTO) #if defined(FEAT_GUI_X11) || defined(PROTO)
void void
gui_new_scrollbar_colors() gui_new_scrollbar_colors(void)
{ {
win_T *wp; win_T *wp;
@@ -4788,8 +4745,7 @@ gui_new_scrollbar_colors()
* Call this when focus has changed. * Call this when focus has changed.
*/ */
void void
gui_focus_change(in_focus) gui_focus_change(int in_focus)
int in_focus;
{ {
/* /*
* Skip this code to avoid drawing the cursor when debugging and switching * Skip this code to avoid drawing the cursor when debugging and switching
@@ -4823,9 +4779,7 @@ gui_focus_change(in_focus)
* Called when the mouse moved (but not when dragging). * Called when the mouse moved (but not when dragging).
*/ */
void void
gui_mouse_moved(x, y) gui_mouse_moved(int x, int y)
int x;
int y;
{ {
win_T *wp; win_T *wp;
char_u st[8]; char_u st[8];
@@ -4902,7 +4856,7 @@ gui_mouse_moved(x, y)
* Called when mouse should be moved to window with focus. * Called when mouse should be moved to window with focus.
*/ */
void void
gui_mouse_correct() gui_mouse_correct(void)
{ {
int x, y; int x, y;
win_T *wp = NULL; win_T *wp = NULL;
@@ -4935,9 +4889,7 @@ gui_mouse_correct()
* Find window where the mouse pointer "y" coordinate is in. * Find window where the mouse pointer "y" coordinate is in.
*/ */
static win_T * static win_T *
xy2win(x, y) xy2win(int x UNUSED, int y UNUSED)
int x UNUSED;
int y UNUSED;
{ {
#ifdef FEAT_WINDOWS #ifdef FEAT_WINDOWS
int row; int row;
@@ -4981,8 +4933,7 @@ xy2win(x, y)
* File names may be given to redefine the args list. * File names may be given to redefine the args list.
*/ */
void void
ex_gui(eap) ex_gui(exarg_T *eap)
exarg_T *eap;
{ {
char_u *arg = eap->arg; char_u *arg = eap->arg;
@@ -5023,9 +4974,7 @@ static void gfp_setname(char_u *fname, void *cookie);
* Callback function for do_in_runtimepath(). * Callback function for do_in_runtimepath().
*/ */
static void static void
gfp_setname(fname, cookie) gfp_setname(char_u *fname, void *cookie)
char_u *fname;
void *cookie;
{ {
char_u *gfp_buffer = cookie; char_u *gfp_buffer = cookie;
@@ -5040,10 +4989,7 @@ gfp_setname(fname, cookie)
* Return FAIL for failure and OK if buffer[MAXPATHL] contains the result. * Return FAIL for failure and OK if buffer[MAXPATHL] contains the result.
*/ */
int int
gui_find_bitmap(name, buffer, ext) gui_find_bitmap(char_u *name, char_u *buffer, char *ext)
char_u *name;
char_u *buffer;
char *ext;
{ {
if (STRLEN(name) > MAXPATHL - 14) if (STRLEN(name) > MAXPATHL - 14)
return FAIL; return FAIL;
@@ -5063,10 +5009,7 @@ gui_find_bitmap(name, buffer, ext)
* contains "name". * contains "name".
*/ */
void void
gui_find_iconfile(name, buffer, ext) gui_find_iconfile(char_u *name, char_u *buffer, char *ext)
char_u *name;
char_u *buffer;
char *ext;
{ {
char_u buf[MAXPATHL + 1]; char_u buf[MAXPATHL + 1];
@@ -5079,7 +5022,7 @@ gui_find_iconfile(name, buffer, ext)
#if defined(FEAT_GUI_GTK) || defined(FEAT_GUI_X11) || defined(PROTO) #if defined(FEAT_GUI_GTK) || defined(FEAT_GUI_X11) || defined(PROTO)
void void
display_errors() display_errors(void)
{ {
char_u *p; char_u *p;
@@ -5111,7 +5054,7 @@ display_errors()
* allow typing on stdin. * allow typing on stdin.
*/ */
int int
no_console_input() no_console_input(void)
{ {
return ((!gui.in_use || gui.starting) return ((!gui.in_use || gui.starting)
# ifndef NO_CONSOLE # ifndef NO_CONSOLE
@@ -5128,7 +5071,7 @@ no_console_input()
* Update the current window and the screen. * Update the current window and the screen.
*/ */
void void
gui_update_screen() gui_update_screen(void)
{ {
#ifdef FEAT_CONCEAL #ifdef FEAT_CONCEAL
linenr_T conceal_old_cursor_line = 0; linenr_T conceal_old_cursor_line = 0;
@@ -5199,10 +5142,10 @@ static void concat_esc(garray_T *gap, char_u *text, int what);
* Returns an allocated string. * Returns an allocated string.
*/ */
char_u * char_u *
get_find_dialog_text(arg, wwordp, mcasep) get_find_dialog_text(
char_u *arg; char_u *arg,
int *wwordp; /* return: TRUE if \< \> found */ int *wwordp, /* return: TRUE if \< \> found */
int *mcasep; /* return: TRUE if \C found */ int *mcasep) /* return: TRUE if \C found */
{ {
char_u *text; char_u *text;
@@ -5260,10 +5203,7 @@ get_find_dialog_text(arg, wwordp, mcasep)
* Concatenate "text" to grow array "gap", escaping "what" with a backslash. * Concatenate "text" to grow array "gap", escaping "what" with a backslash.
*/ */
static void static void
concat_esc(gap, text, what) concat_esc(garray_T *gap, char_u *text, int what)
garray_T *gap;
char_u *text;
int what;
{ {
while (*text != NUL) while (*text != NUL)
{ {
@@ -5289,11 +5229,11 @@ concat_esc(gap, text, what)
* Return TRUE when something was added to the input buffer. * Return TRUE when something was added to the input buffer.
*/ */
int int
gui_do_findrepl(flags, find_text, repl_text, down) gui_do_findrepl(
int flags; /* one of FRD_REPLACE, FRD_FINDNEXT, etc. */ int flags, /* one of FRD_REPLACE, FRD_FINDNEXT, etc. */
char_u *find_text; char_u *find_text,
char_u *repl_text; char_u *repl_text,
int down; /* Search downwards. */ int down) /* Search downwards. */
{ {
garray_T ga; garray_T ga;
int i; int i;
@@ -5422,9 +5362,7 @@ static void gui_wingoto_xy(int x, int y);
* Jump to the window at specified point (x, y). * Jump to the window at specified point (x, y).
*/ */
static void static void
gui_wingoto_xy(x, y) gui_wingoto_xy(int x, int y)
int x;
int y;
{ {
int row = Y_2_ROW(y); int row = Y_2_ROW(y);
int col = X_2_COL(x); int col = X_2_COL(x);
@@ -5446,12 +5384,12 @@ gui_wingoto_xy(x, y)
* fnames after call this function. * fnames after call this function.
*/ */
void void
gui_handle_drop(x, y, modifiers, fnames, count) gui_handle_drop(
int x UNUSED; int x UNUSED,
int y UNUSED; int y UNUSED,
int_u modifiers; int_u modifiers,
char_u **fnames; char_u **fnames,
int count; int count)
{ {
int i; int i;
char_u *p; char_u *p;

View File

@@ -240,8 +240,7 @@ static int SFtwiddle = 0;
static int SFchdir(char *path); static int SFchdir(char *path);
static int static int
SFchdir(path) SFchdir(char *path)
char *path;
{ {
int result; int result;
@@ -260,8 +259,7 @@ SFchdir(path)
static void SFfree(int i); static void SFfree(int i);
static void static void
SFfree(i) SFfree(int i)
int i;
{ {
SFDir *dir; SFDir *dir;
int j; int j;
@@ -284,9 +282,7 @@ SFfree(i)
static void SFstrdup(char **s1, char *s2); static void SFstrdup(char **s1, char *s2);
static void static void
SFstrdup(s1, s2) SFstrdup(char **s1, char *s2)
char **s1;
char *s2;
{ {
*s1 = strcpy(XtMalloc((unsigned)(strlen(s2) + 1)), s2); *s1 = strcpy(XtMalloc((unsigned)(strlen(s2) + 1)), s2);
} }
@@ -294,8 +290,7 @@ SFstrdup(s1, s2)
static void SFunreadableDir(SFDir *dir); static void SFunreadableDir(SFDir *dir);
static void static void
SFunreadableDir(dir) SFunreadableDir(SFDir *dir)
SFDir *dir;
{ {
char *cannotOpen = _("<cannot open> "); char *cannotOpen = _("<cannot open> ");
@@ -310,9 +305,7 @@ SFunreadableDir(dir)
static void SFreplaceText(SFDir *dir, char *str); static void SFreplaceText(SFDir *dir, char *str);
static void static void
SFreplaceText(dir, str) SFreplaceText(SFDir *dir, char *str)
SFDir *dir;
char *str;
{ {
int len; int len;
@@ -333,8 +326,7 @@ SFreplaceText(dir, str)
static void SFexpand(char *str); static void SFexpand(char *str);
static void static void
SFexpand(str) SFexpand(char *str)
char *str;
{ {
int len; int len;
int cmp; int cmp;
@@ -390,9 +382,7 @@ SFexpand(str)
static int SFfindFile(SFDir *dir, char *str); static int SFfindFile(SFDir *dir, char *str);
static int static int
SFfindFile(dir, str) SFfindFile(SFDir *dir, char *str)
SFDir *dir;
char *str;
{ {
int i, last, max; int i, last, max;
char *name, save; char *name, save;
@@ -491,7 +481,7 @@ SFfindFile(dir, str)
static void SFunselect(void); static void SFunselect(void);
static void static void
SFunselect() SFunselect(void)
{ {
SFDir *dir; SFDir *dir;
@@ -505,8 +495,7 @@ SFunselect()
static int SFcompareLogins(const void *p, const void *q); static int SFcompareLogins(const void *p, const void *q);
static int static int
SFcompareLogins(p, q) SFcompareLogins(const void *p, *q)
const void *p, *q;
{ {
return strcmp(((SFLogin *)p)->name, ((SFLogin *)q)->name); return strcmp(((SFLogin *)p)->name, ((SFLogin *)q)->name);
} }
@@ -514,7 +503,7 @@ SFcompareLogins(p, q)
static void SFgetHomeDirs(void); static void SFgetHomeDirs(void);
static void static void
SFgetHomeDirs() SFgetHomeDirs(void)
{ {
struct passwd *pw; struct passwd *pw;
int Alloc; int Alloc;
@@ -582,8 +571,7 @@ SFgetHomeDirs()
static int SFfindHomeDir(char *begin, char *end); static int SFfindHomeDir(char *begin, char *end);
static int static int
SFfindHomeDir(begin, end) SFfindHomeDir(char *begin, *end)
char *begin, *end;
{ {
char save; char save;
char *theRest; char *theRest;
@@ -613,7 +601,7 @@ SFfindHomeDir(begin, end)
} }
static void static void
SFupdatePath() SFupdatePath(void)
{ {
static int Alloc; static int Alloc;
static int wasTwiddle = 0; static int wasTwiddle = 0;
@@ -807,8 +795,7 @@ SFupdatePath()
#ifdef XtNinternational #ifdef XtNinternational
static int static int
WcsLen(p) WcsLen(wchar_t *p)
wchar_t *p;
{ {
int i = 0; int i = 0;
while (*p++ != 0) while (*p++ != 0)
@@ -818,8 +805,7 @@ WcsLen(p)
#endif #endif
static void static void
SFsetText(path) SFsetText(char *path)
char *path;
{ {
XawTextBlock text; XawTextBlock text;
@@ -852,19 +838,19 @@ SFsetText(path)
} }
static void static void
SFbuttonPressList(w, n, event) SFbuttonPressList(
Widget w UNUSED; Widget w UNUSED,
int n UNUSED; int n UNUSED,
XButtonPressedEvent *event UNUSED; XButtonPressedEvent *event UNUSED)
{ {
SFbuttonPressed = 1; SFbuttonPressed = 1;
} }
static void static void
SFbuttonReleaseList(w, n, event) SFbuttonReleaseList(
Widget w; Widget w,
int n; int n,
XButtonReleasedEvent *event; XButtonReleasedEvent *event)
{ {
SFDir *dir; SFDir *dir;
@@ -885,9 +871,7 @@ SFbuttonReleaseList(w, n, event)
static int SFcheckDir(int n, SFDir *dir); static int SFcheckDir(int n, SFDir *dir);
static int static int
SFcheckDir(n, dir) SFcheckDir(int n, SFDir *dir)
int n;
SFDir *dir;
{ {
struct stat statBuf; struct stat statBuf;
int i; int i;
@@ -951,8 +935,7 @@ SFcheckDir(n, dir)
static int SFcheckFiles(SFDir *dir); static int SFcheckFiles(SFDir *dir);
static int static int
SFcheckFiles(dir) SFcheckFiles(SFDir *dir)
SFDir *dir;
{ {
int from, to; int from, to;
int result; int result;
@@ -988,9 +971,7 @@ SFcheckFiles(dir)
} }
static void static void
SFdirModTimer(cl, id) SFdirModTimer(XtPointer cl UNUSED, XtIntervalId *id UNUSED)
XtPointer cl UNUSED;
XtIntervalId *id UNUSED;
{ {
static int n = -1; static int n = -1;
static int f = 0; static int f = 0;
@@ -1036,8 +1017,7 @@ SFdirModTimer(cl, id)
/* Return a single character describing what kind of file STATBUF is. */ /* Return a single character describing what kind of file STATBUF is. */
static char static char
SFstatChar(statBuf) SFstatChar(struct stat *statBuf)
struct stat *statBuf;
{ {
if (S_ISDIR (statBuf->st_mode)) if (S_ISDIR (statBuf->st_mode))
return '/'; return '/';
@@ -1100,7 +1080,7 @@ static XtIntervalId SFscrollTimerId;
static void SFinitFont(void); static void SFinitFont(void);
static void static void
SFinitFont() SFinitFont(void)
{ {
TextData *data; TextData *data;
#ifdef FEAT_XFONTSET #ifdef FEAT_XFONTSET
@@ -1151,7 +1131,7 @@ SFinitFont()
static void SFcreateGC(void); static void SFcreateGC(void);
static void static void
SFcreateGC() SFcreateGC(void)
{ {
XGCValues gcValues; XGCValues gcValues;
XRectangle rectangles[1]; XRectangle rectangles[1];
@@ -1209,9 +1189,7 @@ SFcreateGC()
} }
static void static void
SFclearList(n, doScroll) SFclearList(int n, int doScroll)
int n;
int doScroll;
{ {
SFDir *dir; SFDir *dir;
@@ -1286,9 +1264,7 @@ SFclearList(n, doScroll)
static void SFdeleteEntry(SFDir *dir, SFEntry *entry); static void SFdeleteEntry(SFDir *dir, SFEntry *entry);
static void static void
SFdeleteEntry(dir, entry) SFdeleteEntry(SFDir *dir, SFEntry *entry)
SFDir *dir;
SFEntry *entry;
{ {
SFEntry *e; SFEntry *e;
SFEntry *end; SFEntry *end;
@@ -1340,10 +1316,10 @@ SFdeleteEntry(dir, entry)
static void SFwriteStatChar(char *name, int last, struct stat *statBuf); static void SFwriteStatChar(char *name, int last, struct stat *statBuf);
static void static void
SFwriteStatChar(name, last, statBuf) SFwriteStatChar(
char *name; char *name,
int last; int last,
struct stat *statBuf; struct stat *statBuf)
{ {
name[last] = SFstatChar(statBuf); name[last] = SFstatChar(statBuf);
} }
@@ -1351,9 +1327,7 @@ SFwriteStatChar(name, last, statBuf)
static int SFstatAndCheck(SFDir *dir, SFEntry *entry); static int SFstatAndCheck(SFDir *dir, SFEntry *entry);
static int static int
SFstatAndCheck(dir, entry) SFstatAndCheck(SFDir *dir, SFEntry *entry)
SFDir *dir;
SFEntry *entry;
{ {
struct stat statBuf; struct stat statBuf;
char save; char save;
@@ -1414,11 +1388,11 @@ SFstatAndCheck(dir, entry)
static void static void
SFdrawStrings(w, dir, from, to) SFdrawStrings(
Window w; Window w,
SFDir *dir; SFDir *dir,
int from; int from,
int to; int to)
{ {
int i; int i;
SFEntry *entry; SFEntry *entry;
@@ -1501,9 +1475,7 @@ SFdrawStrings(w, dir, from, to)
} }
static void static void
SFdrawList(n, doScroll) SFdrawList(int n, int doScroll)
int n;
int doScroll;
{ {
SFDir *dir; SFDir *dir;
Window w; Window w;
@@ -1539,8 +1511,7 @@ SFdrawList(n, doScroll)
} }
static void static void
SFdrawLists(doScroll) SFdrawLists(int doScroll)
int doScroll;
{ {
int i; int i;
@@ -1549,8 +1520,7 @@ SFdrawLists(doScroll)
} }
static void static void
SFinvertEntry(n) SFinvertEntry(int n)
int n;
{ {
XFillRectangle( XFillRectangle(
SFdisplay, SFdisplay,
@@ -1565,7 +1535,7 @@ SFinvertEntry(n)
static unsigned long SFscrollTimerInterval(void); static unsigned long SFscrollTimerInterval(void);
static unsigned long static unsigned long
SFscrollTimerInterval() SFscrollTimerInterval(void)
{ {
static int maxVal = 200; static int maxVal = 200;
static int varyDist = 50; static int varyDist = 50;
@@ -1594,9 +1564,7 @@ SFscrollTimerInterval()
static void SFscrollTimer(XtPointer p, XtIntervalId *id); static void SFscrollTimer(XtPointer p, XtIntervalId *id);
static void static void
SFscrollTimer(p, id) SFscrollTimer(XtPointer p, XtIntervalId *id UNUSED)
XtPointer p;
XtIntervalId *id UNUSED;
{ {
SFDir *dir; SFDir *dir;
int save; int save;
@@ -1646,9 +1614,7 @@ SFscrollTimer(p, id)
} }
static int static int
SFnewInvertEntry(n, event) SFnewInvertEntry(int n, XMotionEvent *event)
int n;
XMotionEvent *event;
{ {
int x, y; int x, y;
int nw; int nw;
@@ -1693,10 +1659,7 @@ SFnewInvertEntry(n, event)
} }
static void static void
SFenterList(w, n, event) SFenterList(Widget w UNUSED, int n, XEnterWindowEvent *event)
Widget w UNUSED;
int n;
XEnterWindowEvent *event;
{ {
int nw; int nw;
@@ -1716,10 +1679,7 @@ SFenterList(w, n, event)
} }
static void static void
SFleaveList(w, n, event) SFleaveList(Widget w UNUSED, int n, XEvent *event UNUSED)
Widget w UNUSED;
int n;
XEvent *event UNUSED;
{ {
if (SFcurrentInvert[n] != -1) if (SFcurrentInvert[n] != -1)
{ {
@@ -1729,10 +1689,7 @@ SFleaveList(w, n, event)
} }
static void static void
SFmotionList(w, n, event) SFmotionList(Widget w UNUSED, int n, XMotionEvent *event)
Widget w UNUSED;
int n;
XMotionEvent *event;
{ {
int nw; int nw;
@@ -1749,10 +1706,7 @@ SFmotionList(w, n, event)
} }
static void static void
SFvFloatSliderMovedCallback(w, n, fnew) SFvFloatSliderMovedCallback(Widget w, XtPointer n, XtPointer fnew)
Widget w;
XtPointer n;
XtPointer fnew;
{ {
int nw; int nw;
@@ -1761,10 +1715,7 @@ SFvFloatSliderMovedCallback(w, n, fnew)
} }
static void static void
SFvSliderMovedCallback(w, n, nw) SFvSliderMovedCallback(Widget w UNUSED, int n, int nw)
Widget w UNUSED;
int n;
int nw;
{ {
int old; int old;
Window win; Window win;
@@ -1846,10 +1797,7 @@ SFvSliderMovedCallback(w, n, nw)
} }
static void static void
SFvAreaSelectedCallback(w, n, pnew) SFvAreaSelectedCallback(Widget w, XtPointer n, XtPointer pnew)
Widget w;
XtPointer n;
XtPointer pnew;
{ {
SFDir *dir; SFDir *dir;
int nw = (int)(long)pnew; int nw = (int)(long)pnew;
@@ -1906,10 +1854,7 @@ SFvAreaSelectedCallback(w, n, pnew)
} }
static void static void
SFhSliderMovedCallback(w, n, nw) SFhSliderMovedCallback(Widget w UNUSED, XtPointer n, XtPointer nw)
Widget w UNUSED;
XtPointer n;
XtPointer nw;
{ {
SFDir *dir; SFDir *dir;
int save; int save;
@@ -1924,10 +1869,7 @@ SFhSliderMovedCallback(w, n, nw)
} }
static void static void
SFhAreaSelectedCallback(w, n, pnew) SFhAreaSelectedCallback(Widget w, XtPointer n, XtPointer pnew)
Widget w;
XtPointer n;
XtPointer pnew;
{ {
SFDir *dir; SFDir *dir;
int nw = (int)(long)pnew; int nw = (int)(long)pnew;
@@ -1984,10 +1926,10 @@ SFhAreaSelectedCallback(w, n, pnew)
} }
static void static void
SFpathSliderMovedCallback(w, client_data, nw) SFpathSliderMovedCallback(
Widget w UNUSED; Widget w UNUSED,
XtPointer client_data UNUSED; XtPointer client_data UNUSED,
XtPointer nw; XtPointer nw)
{ {
SFDir *dir; SFDir *dir;
int n; int n;
@@ -2020,10 +1962,10 @@ SFpathSliderMovedCallback(w, client_data, nw)
} }
static void static void
SFpathAreaSelectedCallback(w, client_data, pnew) SFpathAreaSelectedCallback(
Widget w; Widget w,
XtPointer client_data UNUSED; XtPointer client_data UNUSED,
XtPointer pnew; XtPointer pnew)
{ {
int nw = (int)(long)pnew; int nw = (int)(long)pnew;
float f; float f;
@@ -2071,7 +2013,7 @@ SFpathAreaSelectedCallback(w, client_data, pnew)
} }
static Boolean static Boolean
SFworkProc() SFworkProc(void)
{ {
SFDir *dir; SFDir *dir;
SFEntry *entry; SFEntry *entry;
@@ -2100,16 +2042,14 @@ SFworkProc()
/***************** Dir.c */ /***************** Dir.c */
static int static int
SFcompareEntries(p, q) SFcompareEntries(const void *p, const void *q)
const void *p;
const void *q;
{ {
return strcmp(((SFEntry *)p)->real, ((SFEntry *)q)->real); return strcmp(((SFEntry *)p)->real, ((SFEntry *)q)->real);
} }
static int static int
SFgetDir(dir) SFgetDir(
SFDir *dir; SFDir *dir)
{ {
SFEntry *result = NULL; SFEntry *result = NULL;
int Alloc = 0; int Alloc = 0;
@@ -2194,11 +2134,11 @@ static char *oneLineTextEditTranslations = "\
static void SFexposeList(Widget w, XtPointer n, XEvent *event, Boolean *cont); static void SFexposeList(Widget w, XtPointer n, XEvent *event, Boolean *cont);
static void static void
SFexposeList(w, n, event, cont) SFexposeList(
Widget w UNUSED; Widget w UNUSED,
XtPointer n; XtPointer n,
XEvent *event; XEvent *event,
Boolean *cont UNUSED; Boolean *cont UNUSED)
{ {
if ((event->type == NoExpose) || event->xexpose.count) if ((event->type == NoExpose) || event->xexpose.count)
return; return;
@@ -2209,11 +2149,11 @@ SFexposeList(w, n, event, cont)
static void SFmodVerifyCallback(Widget w, XtPointer client_data, XEvent *event, Boolean *cont); static void SFmodVerifyCallback(Widget w, XtPointer client_data, XEvent *event, Boolean *cont);
static void static void
SFmodVerifyCallback(w, client_data, event, cont) SFmodVerifyCallback(
Widget w UNUSED; Widget w UNUSED,
XtPointer client_data UNUSED; XtPointer client_data UNUSED,
XEvent *event; XEvent *event,
Boolean *cont UNUSED; Boolean *cont UNUSED)
{ {
char buf[2]; char buf[2];
@@ -2227,10 +2167,7 @@ SFmodVerifyCallback(w, client_data, event, cont)
static void SFokCallback(Widget w, XtPointer cl, XtPointer cd); static void SFokCallback(Widget w, XtPointer cl, XtPointer cd);
static void static void
SFokCallback(w, cl, cd) SFokCallback(Widget w UNUSED, XtPointer cl UNUSED, XtPointer cd UNUSED)
Widget w UNUSED;
XtPointer cl UNUSED;
XtPointer cd UNUSED;
{ {
SFstatus = SEL_FILE_OK; SFstatus = SEL_FILE_OK;
} }
@@ -2244,10 +2181,7 @@ static XtCallbackRec SFokSelect[] =
static void SFcancelCallback(Widget w, XtPointer cl, XtPointer cd); static void SFcancelCallback(Widget w, XtPointer cl, XtPointer cd);
static void static void
SFcancelCallback(w, cl, cd) SFcancelCallback(Widget w UNUSED, XtPointer cl UNUSED, XtPointer cd UNUSED)
Widget w UNUSED;
XtPointer cl UNUSED;
XtPointer cd UNUSED;
{ {
SFstatus = SEL_FILE_CANCEL; SFstatus = SEL_FILE_CANCEL;
} }
@@ -2261,11 +2195,11 @@ static XtCallbackRec SFcancelSelect[] =
static void SFdismissAction(Widget w, XEvent *event, String *params, Cardinal *num_params); static void SFdismissAction(Widget w, XEvent *event, String *params, Cardinal *num_params);
static void static void
SFdismissAction(w, event, params, num_params) SFdismissAction(
Widget w UNUSED; Widget w UNUSED,
XEvent *event; XEvent *event,
String *params UNUSED; String *params UNUSED,
Cardinal *num_params UNUSED; Cardinal *num_params UNUSED)
{ {
if (event->type == ClientMessage if (event->type == ClientMessage
&& (Atom)event->xclient.data.l[0] != SFwmDeleteWindow) && (Atom)event->xclient.data.l[0] != SFwmDeleteWindow)
@@ -2284,11 +2218,11 @@ static XtActionsRec actions[] =
}; };
static void static void
SFsetColors(bg, fg, scroll_bg, scroll_fg) SFsetColors(
guicolor_T bg; guicolor_T bg,
guicolor_T fg; guicolor_T fg,
guicolor_T scroll_bg; guicolor_T scroll_bg,
guicolor_T scroll_fg; guicolor_T scroll_fg)
{ {
if (selFileForm) if (selFileForm)
{ {
@@ -2366,11 +2300,11 @@ SFsetColors(bg, fg, scroll_bg, scroll_fg)
} }
static void static void
SFcreateWidgets(toplevel, prompt, ok, cancel) SFcreateWidgets(
Widget toplevel; Widget toplevel,
char *prompt; char *prompt,
char *ok; char *ok,
char *cancel; char *cancel)
{ {
Cardinal n; Cardinal n;
int listWidth, listHeight; int listWidth, listHeight;
@@ -2686,7 +2620,7 @@ SFcreateWidgets(toplevel, prompt, ok, cancel)
} }
static void static void
SFtextChanged() SFtextChanged(void)
{ {
#if defined(FEAT_XFONTSET) && defined(XtNinternational) #if defined(FEAT_XFONTSET) && defined(XtNinternational)
if ((unsigned long)_XawTextFormat((TextWidget)selFileField) == XawFmtWide) if ((unsigned long)_XawTextFormat((TextWidget)selFileField) == XawFmtWide)
@@ -2730,7 +2664,7 @@ SFtextChanged()
} }
static char * static char *
SFgetText() SFgetText(void)
{ {
#if defined(FEAT_XFONTSET) && defined(XtNinternational) #if defined(FEAT_XFONTSET) && defined(XtNinternational)
char *buf; char *buf;
@@ -2756,7 +2690,7 @@ SFgetText()
} }
static void static void
SFprepareToReturn() SFprepareToReturn(void)
{ {
SFstatus = SEL_FILE_NULL; SFstatus = SEL_FILE_NULL;
XtRemoveGrab(selFile); XtRemoveGrab(selFile);
@@ -2770,14 +2704,14 @@ SFprepareToReturn()
} }
char * char *
vim_SelFile(toplevel, prompt, init_path, show_entry, x, y, fg, bg, scroll_fg, scroll_bg) vim_SelFile(
Widget toplevel; Widget toplevel,
char *prompt; char *prompt,
char *init_path; char *init_path,
int (*show_entry)(); int (*show_entry)(),
int x, y; int x, y,
guicolor_T fg, bg; guicolor_T fg, bg,
guicolor_T scroll_fg, scroll_bg; /* The "Scrollbar" group colors */ guicolor_T scroll_fg, scroll_bg) /* The "Scrollbar" group colors */
{ {
static int firstTime = 1; static int firstTime = 1;
XEvent event; XEvent event;

View File

@@ -222,7 +222,7 @@ WidgetClass vim_scrollbarWidgetClass = (WidgetClass)&vim_scrollbarClassRec;
#define PAGE_REPEAT 250 #define PAGE_REPEAT 250
static void static void
ClassInitialize() ClassInitialize(void)
{ {
XawInitializeWidgetSet(); XawInitializeWidgetSet();
XtAddConverter( XtRString, XtROrientation, XmuCvtStringToOrientation, XtAddConverter( XtRString, XtROrientation, XmuCvtStringToOrientation,
@@ -232,11 +232,11 @@ ClassInitialize()
#define MARGIN(sbw) (sbw)->scrollbar.thickness + (sbw)->scrollbar.shadow_width #define MARGIN(sbw) (sbw)->scrollbar.thickness + (sbw)->scrollbar.shadow_width
static void static void
FillArea(sbw, top, bottom, fill, draw_shadow) FillArea(
ScrollbarWidget sbw; ScrollbarWidget sbw,
Position top, bottom; Position top, bottom,
int fill; int fill,
int draw_shadow; int draw_shadow)
{ {
int tlen = bottom - top; /* length of thumb in pixels */ int tlen = bottom - top; /* length of thumb in pixels */
int sw, margin, floor; int sw, margin, floor;
@@ -340,8 +340,7 @@ FillArea(sbw, top, bottom, fill, draw_shadow)
*/ */
static void static void
PaintThumb(sbw) PaintThumb(ScrollbarWidget sbw)
ScrollbarWidget sbw;
{ {
Position oldtop, oldbot, newtop, newbot; Position oldtop, oldbot, newtop, newbot;
Dimension margin, tzl; Dimension margin, tzl;
@@ -374,8 +373,7 @@ PaintThumb(sbw)
} }
static void static void
PaintArrows(sbw) PaintArrows(ScrollbarWidget sbw)
ScrollbarWidget sbw;
{ {
XPoint point[6]; XPoint point[6];
Dimension thickness = sbw->scrollbar.thickness - 1; Dimension thickness = sbw->scrollbar.thickness - 1;
@@ -454,8 +452,7 @@ PaintArrows(sbw)
} }
static void static void
Destroy(w) Destroy(Widget w)
Widget w;
{ {
ScrollbarWidget sbw = (ScrollbarWidget) w; ScrollbarWidget sbw = (ScrollbarWidget) w;
if (sbw->scrollbar.timer_id != (XtIntervalId) 0) if (sbw->scrollbar.timer_id != (XtIntervalId) 0)
@@ -466,8 +463,7 @@ Destroy(w)
} }
static void static void
CreateGC(w) CreateGC(Widget w)
Widget w;
{ {
ScrollbarWidget sbw = (ScrollbarWidget) w; ScrollbarWidget sbw = (ScrollbarWidget) w;
XGCValues gcValues; XGCValues gcValues;
@@ -505,8 +501,7 @@ CreateGC(w)
} }
static void static void
SetDimensions(sbw) SetDimensions(ScrollbarWidget sbw)
ScrollbarWidget sbw;
{ {
if (sbw->scrollbar.orientation == XtorientVertical) if (sbw->scrollbar.orientation == XtorientVertical)
{ {
@@ -521,11 +516,11 @@ SetDimensions(sbw)
} }
static void static void
Initialize(request, new, args, num_args) Initialize(
Widget request UNUSED; /* what the client asked for */ Widget request UNUSED, /* what the client asked for */
Widget new; /* what we're going to give him */ Widget new, /* what we're going to give him */
ArgList args UNUSED; ArgList args UNUSED,
Cardinal *num_args UNUSED; Cardinal *num_args UNUSED)
{ {
ScrollbarWidget sbw = (ScrollbarWidget) new; ScrollbarWidget sbw = (ScrollbarWidget) new;
@@ -549,10 +544,10 @@ Initialize(request, new, args, num_args)
} }
static void static void
Realize(w, valueMask, attributes) Realize(
Widget w; Widget w,
Mask *valueMask; Mask *valueMask,
XSetWindowAttributes *attributes; XSetWindowAttributes *attributes)
{ {
/* The Simple widget actually stuffs the value in the valuemask. */ /* The Simple widget actually stuffs the value in the valuemask. */
(*vim_scrollbarWidgetClass->core_class.superclass->core_class.realize) (*vim_scrollbarWidgetClass->core_class.superclass->core_class.realize)
@@ -560,12 +555,12 @@ Realize(w, valueMask, attributes)
} }
static Boolean static Boolean
SetValues(current, request, desired, args, num_args) SetValues(
Widget current; /* what I am */ Widget current, /* what I am */
Widget request UNUSED; /* what he wants me to be */ Widget request UNUSED, /* what he wants me to be */
Widget desired; /* what I will become */ Widget desired, /* what I will become */
ArgList args UNUSED; ArgList args UNUSED,
Cardinal *num_args UNUSED; Cardinal *num_args UNUSED)
{ {
ScrollbarWidget sbw = (ScrollbarWidget) current; ScrollbarWidget sbw = (ScrollbarWidget) current;
ScrollbarWidget dsbw = (ScrollbarWidget) desired; ScrollbarWidget dsbw = (ScrollbarWidget) desired;
@@ -601,8 +596,7 @@ SetValues(current, request, desired, args, num_args)
} }
static void static void
Resize(w) Resize(Widget w)
Widget w;
{ {
/* ForgetGravity has taken care of background, but thumb may /* ForgetGravity has taken care of background, but thumb may
* have to move as a result of the new size. */ * have to move as a result of the new size. */
@@ -612,10 +606,7 @@ Resize(w)
static void static void
Redisplay(w, event, region) Redisplay(Widget w, XEvent *event, Region region)
Widget w;
XEvent *event;
Region region;
{ {
ScrollbarWidget sbw = (ScrollbarWidget) w; ScrollbarWidget sbw = (ScrollbarWidget) w;
int x, y; int x, y;
@@ -650,8 +641,7 @@ Redisplay(w, event, region)
static Boolean static Boolean
CompareEvents(oldEvent, newEvent) CompareEvents(XEvent *oldEvent, *newEvent)
XEvent *oldEvent, *newEvent;
{ {
#define Check(field) if (newEvent->field != oldEvent->field) return False; #define Check(field) if (newEvent->field != oldEvent->field) return False;
@@ -693,10 +683,7 @@ struct EventData
}; };
static Bool static Bool
PeekNotifyEvent(dpy, event, args) PeekNotifyEvent(Display *dpy, XEvent *event, char *args)
Display *dpy;
XEvent *event;
char *args;
{ {
struct EventData *eventData = (struct EventData*)args; struct EventData *eventData = (struct EventData*)args;
@@ -706,9 +693,7 @@ PeekNotifyEvent(dpy, event, args)
static Boolean static Boolean
LookAhead(w, event) LookAhead(Widget w, XEvent *event)
Widget w;
XEvent *event;
{ {
XEvent newEvent; XEvent newEvent;
struct EventData eventData; struct EventData eventData;
@@ -726,10 +711,10 @@ LookAhead(w, event)
static void static void
ExtractPosition(event, x, y, state) ExtractPosition(
XEvent *event; XEvent *event,
Position *x, *y; /* RETURN */ Position *x, *y, /* RETURN */
unsigned int *state; /* RETURN */ unsigned int *state) /* RETURN */
{ {
switch (event->type) switch (event->type)
{ {
@@ -768,11 +753,11 @@ ExtractPosition(event, x, y, state)
} }
static void static void
HandleThumb(w, event, params, num_params) HandleThumb(
Widget w; Widget w,
XEvent *event; XEvent *event,
String *params; String *params,
Cardinal *num_params; Cardinal *num_params)
{ {
Position x, y, loc; Position x, y, loc;
ScrollbarWidget sbw = (ScrollbarWidget) w; ScrollbarWidget sbw = (ScrollbarWidget) w;
@@ -791,9 +776,7 @@ HandleThumb(w, event, params, num_params)
} }
static void static void
RepeatNotify(client_data, idp) RepeatNotify(XtPointer client_data, XtIntervalId *idp UNUSED)
XtPointer client_data;
XtIntervalId *idp UNUSED;
{ {
ScrollbarWidget sbw = (ScrollbarWidget) client_data; ScrollbarWidget sbw = (ScrollbarWidget) client_data;
int call_data; int call_data;
@@ -833,57 +816,56 @@ RepeatNotify(client_data, idp)
* Same as above, but for floating numbers. * Same as above, but for floating numbers.
*/ */
static float static float
FloatInRange(num, small, big) FloatInRange(float num, small, big)
float num, small, big;
{ {
return (num < small) ? small : ((num > big) ? big : num); return (num < small) ? small : ((num > big) ? big : num);
} }
static void static void
ScrollOneLineUp(w, event, params, num_params) ScrollOneLineUp(
Widget w; Widget w,
XEvent *event; XEvent *event,
String *params UNUSED; String *params UNUSED,
Cardinal *num_params UNUSED; Cardinal *num_params UNUSED)
{ {
ScrollSome(w, event, -ONE_LINE_DATA); ScrollSome(w, event, -ONE_LINE_DATA);
} }
static void static void
ScrollOneLineDown(w, event, params, num_params) ScrollOneLineDown(
Widget w; Widget w,
XEvent *event; XEvent *event,
String *params UNUSED; String *params UNUSED,
Cardinal *num_params UNUSED; Cardinal *num_params UNUSED)
{ {
ScrollSome(w, event, ONE_LINE_DATA); ScrollSome(w, event, ONE_LINE_DATA);
} }
static void static void
ScrollPageDown(w, event, params, num_params) ScrollPageDown(
Widget w; Widget w,
XEvent *event; XEvent *event,
String *params UNUSED; String *params UNUSED,
Cardinal *num_params UNUSED; Cardinal *num_params UNUSED)
{ {
ScrollSome(w, event, ONE_PAGE_DATA); ScrollSome(w, event, ONE_PAGE_DATA);
} }
static void static void
ScrollPageUp(w, event, params, num_params) ScrollPageUp(
Widget w; Widget w,
XEvent *event; XEvent *event,
String *params UNUSED; String *params UNUSED,
Cardinal *num_params UNUSED; Cardinal *num_params UNUSED)
{ {
ScrollSome(w, event, -ONE_PAGE_DATA); ScrollSome(w, event, -ONE_PAGE_DATA);
} }
static void static void
ScrollSome(w, event, call_data) ScrollSome(
Widget w; Widget w,
XEvent *event; XEvent *event,
int call_data; int call_data)
{ {
ScrollbarWidget sbw = (ScrollbarWidget) w; ScrollbarWidget sbw = (ScrollbarWidget) w;
@@ -898,11 +880,11 @@ ScrollSome(w, event, call_data)
} }
static void static void
NotifyScroll(w, event, params, num_params) NotifyScroll(
Widget w; Widget w,
XEvent *event; XEvent *event,
String *params UNUSED; String *params UNUSED,
Cardinal *num_params UNUSED; Cardinal *num_params UNUSED)
{ {
ScrollbarWidget sbw = (ScrollbarWidget) w; ScrollbarWidget sbw = (ScrollbarWidget) w;
Position x, y, loc; Position x, y, loc;
@@ -987,11 +969,11 @@ NotifyScroll(w, event, params, num_params)
} }
static void static void
EndScroll(w, event, params, num_params) EndScroll(
Widget w; Widget w,
XEvent *event UNUSED; XEvent *event UNUSED,
String *params UNUSED; String *params UNUSED,
Cardinal *num_params UNUSED; Cardinal *num_params UNUSED)
{ {
ScrollbarWidget sbw = (ScrollbarWidget) w; ScrollbarWidget sbw = (ScrollbarWidget) w;
@@ -1002,9 +984,7 @@ EndScroll(w, event, params, num_params)
} }
static float static float
FractionLoc(sbw, x, y) FractionLoc(ScrollbarWidget sbw, int x, y)
ScrollbarWidget sbw;
int x, y;
{ {
int margin; int margin;
float height, width; float height, width;
@@ -1018,11 +998,11 @@ FractionLoc(sbw, x, y)
} }
static void static void
MoveThumb(w, event, params, num_params) MoveThumb(
Widget w; Widget w,
XEvent *event; XEvent *event,
String *params UNUSED; String *params UNUSED,
Cardinal *num_params UNUSED; Cardinal *num_params UNUSED)
{ {
ScrollbarWidget sbw = (ScrollbarWidget)w; ScrollbarWidget sbw = (ScrollbarWidget)w;
Position x, y; Position x, y;
@@ -1063,11 +1043,11 @@ MoveThumb(w, event, params, num_params)
static void static void
NotifyThumb(w, event, params, num_params) NotifyThumb(
Widget w; Widget w,
XEvent *event; XEvent *event,
String *params UNUSED; String *params UNUSED,
Cardinal *num_params UNUSED; Cardinal *num_params UNUSED)
{ {
ScrollbarWidget sbw = (ScrollbarWidget)w; ScrollbarWidget sbw = (ScrollbarWidget)w;
/* Use a union to avoid a warning for the weird conversion from float to /* Use a union to avoid a warning for the weird conversion from float to
@@ -1089,8 +1069,7 @@ NotifyThumb(w, event, params, num_params)
} }
static void static void
AllocTopShadowGC(w) AllocTopShadowGC(Widget w)
Widget w;
{ {
ScrollbarWidget sbw = (ScrollbarWidget) w; ScrollbarWidget sbw = (ScrollbarWidget) w;
XtGCMask valuemask; XtGCMask valuemask;
@@ -1102,8 +1081,7 @@ AllocTopShadowGC(w)
} }
static void static void
AllocBotShadowGC(w) AllocBotShadowGC(Widget w)
Widget w;
{ {
ScrollbarWidget sbw = (ScrollbarWidget) w; ScrollbarWidget sbw = (ScrollbarWidget) w;
XtGCMask valuemask; XtGCMask valuemask;
@@ -1115,11 +1093,11 @@ AllocBotShadowGC(w)
} }
static void static void
_Xaw3dDrawShadows(gw, event, region, out) _Xaw3dDrawShadows(
Widget gw; Widget gw,
XEvent *event UNUSED; XEvent *event UNUSED,
Region region; Region region,
int out; int out)
{ {
XPoint pt[6]; XPoint pt[6];
ScrollbarWidget sbw = (ScrollbarWidget) gw; ScrollbarWidget sbw = (ScrollbarWidget) gw;
@@ -1187,9 +1165,7 @@ _Xaw3dDrawShadows(gw, event, region, out)
* Set the scroll bar to the given location. * Set the scroll bar to the given location.
*/ */
void void
vim_XawScrollbarSetThumb(w, top, shown, max) vim_XawScrollbarSetThumb(Widget w, double top, shown, max)
Widget w;
double top, shown, max;
{ {
ScrollbarWidget sbw = (ScrollbarWidget) w; ScrollbarWidget sbw = (ScrollbarWidget) w;

View File

@@ -87,9 +87,9 @@ static int puller_width = 0;
* left or middle mouse button. * left or middle mouse button.
*/ */
static void static void
gui_athena_scroll_cb_jump(w, client_data, call_data) gui_athena_scroll_cb_jump(
Widget w UNUSED; Widget w UNUSED,
XtPointer client_data, call_data; XtPointer client_data, call_data)
{ {
scrollbar_T *sb, *sb_info; scrollbar_T *sb, *sb_info;
long value; long value;
@@ -122,9 +122,9 @@ gui_athena_scroll_cb_jump(w, client_data, call_data)
* right mouse buttons. * right mouse buttons.
*/ */
static void static void
gui_athena_scroll_cb_scroll(w, client_data, call_data) gui_athena_scroll_cb_scroll(
Widget w UNUSED; Widget w UNUSED,
XtPointer client_data, call_data; XtPointer client_data, call_data)
{ {
scrollbar_T *sb, *sb_info; scrollbar_T *sb, *sb_info;
long value; long value;
@@ -228,7 +228,7 @@ gui_athena_scroll_cb_scroll(w, client_data, call_data)
* Create all the Athena widgets necessary. * Create all the Athena widgets necessary.
*/ */
void void
gui_x11_create_widgets() gui_x11_create_widgets(void)
{ {
/* /*
* We don't have any borders handled internally by the textArea to worry * We don't have any borders handled internally by the textArea to worry
@@ -325,8 +325,7 @@ gui_x11_create_widgets()
* Calculates the Pixmap based on the size of the current menu font. * Calculates the Pixmap based on the size of the current menu font.
*/ */
static Pixmap static Pixmap
gui_athena_create_pullright_pixmap(w) gui_athena_create_pullright_pixmap(Widget w)
Widget w;
{ {
Pixmap retval; Pixmap retval;
#ifdef FONTSET_ALWAYS #ifdef FONTSET_ALWAYS
@@ -425,7 +424,7 @@ gui_athena_create_pullright_pixmap(w)
* Called when the GUI is not going to start after all. * Called when the GUI is not going to start after all.
*/ */
void void
gui_x11_destroy_widgets() gui_x11_destroy_widgets(void)
{ {
textArea = NULL; textArea = NULL;
#ifdef FEAT_MENU #ifdef FEAT_MENU
@@ -450,9 +449,7 @@ static void get_toolbar_pixmap(vimmenu_T *menu, Pixmap *sen);
* Return in "sen". * Return in "sen".
*/ */
static void static void
get_toolbar_pixmap(menu, sen) get_toolbar_pixmap(vimmenu_T *menu, Pixmap *sen)
vimmenu_T *menu;
Pixmap *sen;
{ {
char_u buf[MAXPATHL]; /* buffer storing expanded pathname */ char_u buf[MAXPATHL]; /* buffer storing expanded pathname */
char **xpm = NULL; /* xpm array */ char **xpm = NULL; /* xpm array */
@@ -492,10 +489,7 @@ get_toolbar_pixmap(menu, sen)
* insensitive Pixmap too. * insensitive Pixmap too.
*/ */
static void static void
createXpmImages(path, xpm, sen) createXpmImages(char_u *path, char **xpm, Pixmap *sen)
char_u *path;
char **xpm;
Pixmap *sen;
{ {
Window rootWindow; Window rootWindow;
XpmAttributes attrs; XpmAttributes attrs;
@@ -566,11 +560,11 @@ createXpmImages(path, xpm, sen)
} }
void void
gui_mch_set_toolbar_pos(x, y, w, h) gui_mch_set_toolbar_pos(
int x; int x,
int y; int y,
int w; int w,
int h; int h)
{ {
Dimension border; Dimension border;
int height; int height;
@@ -595,11 +589,11 @@ gui_mch_set_toolbar_pos(x, y, w, h)
#endif #endif
void void
gui_mch_set_text_area_pos(x, y, w, h) gui_mch_set_text_area_pos(
int x; int x,
int y; int y,
int w; int w,
int h; int h)
{ {
XtUnmanageChild(textArea); XtUnmanageChild(textArea);
XtVaSetValues(textArea, XtVaSetValues(textArea,
@@ -622,7 +616,7 @@ gui_mch_set_text_area_pos(x, y, w, h)
* input go to the editor window, not the button * input go to the editor window, not the button
*/ */
static void static void
gui_mch_reset_focus() gui_mch_reset_focus(void)
{ {
XtSetKeyboardFocus(vimForm, textArea); XtSetKeyboardFocus(vimForm, textArea);
} }
@@ -630,7 +624,7 @@ gui_mch_reset_focus()
void void
gui_x11_set_back_color() gui_x11_set_back_color(void)
{ {
if (textArea != NULL) if (textArea != NULL)
XtVaSetValues(textArea, XtVaSetValues(textArea,
@@ -652,8 +646,7 @@ static void gui_athena_menu_font(Widget id);
static Boolean gui_athena_menu_has_submenus(Widget, Widget); static Boolean gui_athena_menu_has_submenus(Widget, Widget);
void void
gui_mch_enable_menu(flag) gui_mch_enable_menu(int flag)
int flag;
{ {
if (flag) if (flag)
{ {
@@ -685,11 +678,11 @@ gui_mch_enable_menu(flag)
} }
void void
gui_mch_set_menu_pos(x, y, w, h) gui_mch_set_menu_pos(
int x; int x,
int y; int y,
int w; int w,
int h; int h)
{ {
Dimension border; Dimension border;
int height; int height;
@@ -717,8 +710,7 @@ gui_mch_set_menu_pos(x, y, w, h)
* numChildren (end of children). * numChildren (end of children).
*/ */
static Cardinal static Cardinal
athena_calculate_ins_pos(widget) athena_calculate_ins_pos(Widget widget)
Widget widget;
{ {
/* Assume that if the parent of the vimmenu_T is NULL, then we can get /* Assume that if the parent of the vimmenu_T is NULL, then we can get
* to this menu by traversing "next", starting at "root_menu". * to this menu by traversing "next", starting at "root_menu".
@@ -764,9 +756,7 @@ athena_calculate_ins_pos(widget)
} }
void void
gui_mch_add_menu(menu, idx) gui_mch_add_menu(vimmenu_T *menu, int idx UNUSED)
vimmenu_T *menu;
int idx UNUSED;
{ {
char_u *pullright_name; char_u *pullright_name;
Dimension height, space, border; Dimension height, space, border;
@@ -884,9 +874,7 @@ gui_mch_add_menu(menu, idx)
* Ignore widget "ignore" in the pane. * Ignore widget "ignore" in the pane.
*/ */
static Boolean static Boolean
gui_athena_menu_has_submenus(id, ignore) gui_athena_menu_has_submenus(Widget id, Widget ignore)
Widget id;
Widget ignore;
{ {
WidgetList children; WidgetList children;
Cardinal num_children; Cardinal num_children;
@@ -906,8 +894,7 @@ gui_athena_menu_has_submenus(id, ignore)
} }
static void static void
gui_athena_menu_font(id) gui_athena_menu_font(Widget id)
Widget id;
{ {
#ifdef FONTSET_ALWAYS #ifdef FONTSET_ALWAYS
if (gui.menu_fontset != NOFONTSET) if (gui.menu_fontset != NOFONTSET)
@@ -954,7 +941,7 @@ gui_athena_menu_font(id)
void void
gui_mch_new_menu_font() gui_mch_new_menu_font(void)
{ {
Pixmap oldpuller = None; Pixmap oldpuller = None;
@@ -1031,7 +1018,7 @@ gui_mch_new_menu_font()
#if defined(FEAT_BEVAL) || defined(PROTO) #if defined(FEAT_BEVAL) || defined(PROTO)
void void
gui_mch_new_tooltip_font() gui_mch_new_tooltip_font(void)
{ {
# ifdef FEAT_TOOLBAR # ifdef FEAT_TOOLBAR
vimmenu_T *menu; vimmenu_T *menu;
@@ -1046,7 +1033,7 @@ gui_mch_new_tooltip_font()
} }
void void
gui_mch_new_tooltip_colors() gui_mch_new_tooltip_colors(void)
{ {
# ifdef FEAT_TOOLBAR # ifdef FEAT_TOOLBAR
vimmenu_T *menu; vimmenu_T *menu;
@@ -1062,9 +1049,9 @@ gui_mch_new_tooltip_colors()
#endif #endif
static void static void
gui_mch_submenu_change(menu, colors) gui_mch_submenu_change(
vimmenu_T *menu; vimmenu_T *menu,
int colors; /* TRUE for colors, FALSE for font */ int colors) /* TRUE for colors, FALSE for font */
{ {
vimmenu_T *mp; vimmenu_T *mp;
@@ -1141,8 +1128,7 @@ gui_mch_submenu_change(menu, colors)
* Replace '.' by '_', can't include '.' in the submenu name. * Replace '.' by '_', can't include '.' in the submenu name.
*/ */
static char_u * static char_u *
make_pull_name(name) make_pull_name(char_u * name)
char_u * name;
{ {
char_u *pname; char_u *pname;
char_u *p; char_u *p;
@@ -1158,9 +1144,7 @@ make_pull_name(name)
} }
void void
gui_mch_add_menu_item(menu, idx) gui_mch_add_menu_item(vimmenu_T *menu, int idx UNUSED)
vimmenu_T *menu;
int idx UNUSED;
{ {
vimmenu_T *parent = menu->parent; vimmenu_T *parent = menu->parent;
@@ -1404,7 +1388,7 @@ gui_mch_show_toolbar(int showit)
int int
gui_mch_compute_toolbar_height() gui_mch_compute_toolbar_height(void)
{ {
Dimension height; /* total Toolbar height */ Dimension height; /* total Toolbar height */
Dimension whgt; /* height of each widget */ Dimension whgt; /* height of each widget */
@@ -1439,12 +1423,12 @@ gui_mch_compute_toolbar_height()
} }
void void
gui_mch_get_toolbar_colors(bgp, fgp, bsp, tsp, hsp) gui_mch_get_toolbar_colors(
Pixel *bgp; Pixel *bgp,
Pixel *fgp; Pixel *fgp,
Pixel *bsp; Pixel *bsp,
Pixel *tsp; Pixel *tsp,
Pixel *hsp; Pixel *hsp)
{ {
XtVaGetValues(toolBar, XtNbackground, bgp, XtNborderColor, fgp, NULL); XtVaGetValues(toolBar, XtNbackground, bgp, XtNborderColor, fgp, NULL);
*bsp = *bgp; *bsp = *bgp;
@@ -1455,14 +1439,13 @@ gui_mch_get_toolbar_colors(bgp, fgp, bsp, tsp, hsp)
void void
gui_mch_toggle_tearoffs(enable) gui_mch_toggle_tearoffs(int enable UNUSED)
int enable UNUSED;
{ {
/* no tearoff menus */ /* no tearoff menus */
} }
void void
gui_mch_new_menu_colors() gui_mch_new_menu_colors(void)
{ {
if (menuBar == (Widget)0) if (menuBar == (Widget)0)
return; return;
@@ -1480,8 +1463,7 @@ gui_mch_new_menu_colors()
* Destroy the machine specific menu widget. * Destroy the machine specific menu widget.
*/ */
void void
gui_mch_destroy_menu(menu) gui_mch_destroy_menu(vimmenu_T *menu)
vimmenu_T *menu;
{ {
Widget parent; Widget parent;
@@ -1626,9 +1608,9 @@ gui_mch_destroy_menu(menu)
} }
static void static void
gui_athena_menu_timeout(client_data, id) gui_athena_menu_timeout(
XtPointer client_data; XtPointer client_data,
XtIntervalId *id UNUSED; XtIntervalId *id UNUSED)
{ {
Widget w = (Widget)client_data; Widget w = (Widget)client_data;
Widget popup; Widget popup;
@@ -1658,10 +1640,10 @@ gui_athena_menu_timeout(client_data, id)
* This is called when XtPopup() is called. * This is called when XtPopup() is called.
*/ */
static void static void
gui_athena_popup_callback(w, client_data, call_data) gui_athena_popup_callback(
Widget w; Widget w,
XtPointer client_data; XtPointer client_data,
XtPointer call_data UNUSED; XtPointer call_data UNUSED)
{ {
/* Assumption: XtIsSubclass(XtParent(w),simpleMenuWidgetClass) */ /* Assumption: XtIsSubclass(XtParent(w),simpleMenuWidgetClass) */
vimmenu_T *menu = (vimmenu_T *)client_data; vimmenu_T *menu = (vimmenu_T *)client_data;
@@ -1690,11 +1672,11 @@ gui_athena_popup_callback(w, client_data, call_data)
} }
static void static void
gui_athena_popdown_submenus_action(w, event, args, nargs) gui_athena_popdown_submenus_action(
Widget w; Widget w,
XEvent *event; XEvent *event,
String *args; String *args,
Cardinal *nargs; Cardinal *nargs)
{ {
WidgetList children; WidgetList children;
Cardinal num_children; Cardinal num_children;
@@ -1719,8 +1701,7 @@ gui_athena_popdown_submenus_action(w, event, args, nargs)
/* Used to determine if the given widget has a submenu that can be popped up. */ /* Used to determine if the given widget has a submenu that can be popped up. */
static Boolean static Boolean
has_submenu(widget) has_submenu(Widget widget)
Widget widget;
{ {
if ((widget != NULL) && XtIsSubclass(widget,smeBSBObjectClass)) if ((widget != NULL) && XtIsSubclass(widget,smeBSBObjectClass))
{ {
@@ -1734,11 +1715,11 @@ has_submenu(widget)
} }
static void static void
gui_athena_delayed_arm_action(w, event, args, nargs) gui_athena_delayed_arm_action(
Widget w; Widget w,
XEvent *event; XEvent *event,
String *args; String *args,
Cardinal *nargs; Cardinal *nargs)
{ {
Dimension width, height; Dimension width, height;
@@ -1778,8 +1759,7 @@ gui_athena_delayed_arm_action(w, event, args, nargs)
} }
static Widget static Widget
get_popup_entry(w) get_popup_entry(Widget w)
Widget w;
{ {
Widget menuw; Widget menuw;
@@ -1794,8 +1774,7 @@ get_popup_entry(w)
* that is to be popped up. * that is to be popped up.
*/ */
static Widget static Widget
submenu_widget(widget) submenu_widget(Widget widget)
Widget widget;
{ {
/* Precondition: has_submenu(widget) == True /* Precondition: has_submenu(widget) == True
* XtIsSubclass(XtParent(widget),simpleMenuWidgetClass) == True * XtIsSubclass(XtParent(widget),simpleMenuWidgetClass) == True
@@ -1814,8 +1793,7 @@ submenu_widget(widget)
} }
void void
gui_mch_show_popupmenu(menu) gui_mch_show_popupmenu(vimmenu_T *menu)
vimmenu_T *menu;
{ {
int rootx, rooty, winx, winy; int rootx, rooty, winx, winy;
Window root, child; Window root, child;
@@ -1850,7 +1828,7 @@ gui_mch_show_popupmenu(menu)
* Set the menu and scrollbar colors to their default values. * Set the menu and scrollbar colors to their default values.
*/ */
void void
gui_mch_def_colors() gui_mch_def_colors(void)
{ {
/* /*
* Get the colors ourselves. Using the automatic conversion doesn't * Get the colors ourselves. Using the automatic conversion doesn't
@@ -1875,11 +1853,11 @@ gui_mch_def_colors()
*/ */
void void
gui_mch_set_scrollbar_thumb(sb, val, size, max) gui_mch_set_scrollbar_thumb(
scrollbar_T *sb; scrollbar_T *sb,
long val; long val,
long size; long size,
long max; long max)
{ {
double v, s; double v, s;
@@ -1911,12 +1889,12 @@ gui_mch_set_scrollbar_thumb(sb, val, size, max)
} }
void void
gui_mch_set_scrollbar_pos(sb, x, y, w, h) gui_mch_set_scrollbar_pos(
scrollbar_T *sb; scrollbar_T *sb,
int x; int x,
int y; int y,
int w; int w,
int h; int h)
{ {
if (sb->id == (Widget)0) if (sb->id == (Widget)0)
return; return;
@@ -1932,9 +1910,7 @@ gui_mch_set_scrollbar_pos(sb, x, y, w, h)
} }
void void
gui_mch_enable_scrollbar(sb, flag) gui_mch_enable_scrollbar(scrollbar_T *sb, int flag)
scrollbar_T *sb;
int flag;
{ {
if (sb->id != (Widget)0) if (sb->id != (Widget)0)
{ {
@@ -1946,9 +1922,9 @@ gui_mch_enable_scrollbar(sb, flag)
} }
void void
gui_mch_create_scrollbar(sb, orient) gui_mch_create_scrollbar(
scrollbar_T *sb; scrollbar_T *sb,
int orient; /* SBAR_VERT or SBAR_HORIZ */ int orient) /* SBAR_VERT or SBAR_HORIZ */
{ {
sb->id = XtVaCreateWidget("scrollBar", sb->id = XtVaCreateWidget("scrollBar",
#ifdef FEAT_GUI_NEXTAW #ifdef FEAT_GUI_NEXTAW
@@ -1984,8 +1960,7 @@ gui_mch_create_scrollbar(sb, orient)
#if defined(FEAT_WINDOWS) || defined(PROTO) #if defined(FEAT_WINDOWS) || defined(PROTO)
void void
gui_mch_destroy_scrollbar(sb) gui_mch_destroy_scrollbar(scrollbar_T *sb)
scrollbar_T *sb;
{ {
if (sb->id != (Widget)0) if (sb->id != (Widget)0)
XtDestroyWidget(sb->id); XtDestroyWidget(sb->id);
@@ -1993,8 +1968,7 @@ gui_mch_destroy_scrollbar(sb)
#endif #endif
void void
gui_mch_set_scrollbar_colors(sb) gui_mch_set_scrollbar_colors(scrollbar_T *sb)
scrollbar_T *sb;
{ {
if (sb->id != (Widget)0) if (sb->id != (Widget)0)
XtVaSetValues(sb->id, XtVaSetValues(sb->id,
@@ -2011,7 +1985,7 @@ gui_mch_set_scrollbar_colors(sb)
* Miscellaneous stuff: * Miscellaneous stuff:
*/ */
Window Window
gui_x11_get_wid() gui_x11_get_wid(void)
{ {
return XtWindow(textArea); return XtWindow(textArea);
} }
@@ -2022,13 +1996,13 @@ gui_x11_get_wid()
* Returns the selected name in allocated memory, or NULL for Cancel. * Returns the selected name in allocated memory, or NULL for Cancel.
*/ */
char_u * char_u *
gui_mch_browse(saving, title, dflt, ext, initdir, filter) gui_mch_browse(
int saving UNUSED; /* select file to write */ int saving UNUSED, /* select file to write */
char_u *title; /* title for the window */ char_u *title, /* title for the window */
char_u *dflt; /* default name */ char_u *dflt, /* default name */
char_u *ext UNUSED; /* extension added */ char_u *ext UNUSED, /* extension added */
char_u *initdir; /* initial directory, NULL for current dir */ char_u *initdir, /* initial directory, NULL for current dir */
char_u *filter UNUSED; /* file name filter */ char_u *filter UNUSED) /* file name filter */
{ {
Position x, y; Position x, y;
char_u dirbuf[MAXPATHL]; char_u dirbuf[MAXPATHL];
@@ -2075,11 +2049,11 @@ static void dialog_wm_handler(Widget w, XtPointer client_data, XEvent *event, Bo
* hitting the "OK" button, ESC like "Cancel". * hitting the "OK" button, ESC like "Cancel".
*/ */
static void static void
keyhit_callback(w, client_data, event, cont) keyhit_callback(
Widget w UNUSED; Widget w UNUSED,
XtPointer client_data UNUSED; XtPointer client_data UNUSED,
XEvent *event; XEvent *event,
Boolean *cont UNUSED; Boolean *cont UNUSED)
{ {
char buf[2]; char buf[2];
@@ -2093,10 +2067,10 @@ keyhit_callback(w, client_data, event, cont)
} }
static void static void
butproc(w, client_data, call_data) butproc(
Widget w UNUSED; Widget w UNUSED,
XtPointer client_data; XtPointer client_data,
XtPointer call_data UNUSED; XtPointer call_data UNUSED)
{ {
dialogStatus = (int)(long)client_data + 1; dialogStatus = (int)(long)client_data + 1;
} }
@@ -2105,11 +2079,11 @@ butproc(w, client_data, call_data)
* Function called when dialog window closed. * Function called when dialog window closed.
*/ */
static void static void
dialog_wm_handler(w, client_data, event, dum) dialog_wm_handler(
Widget w UNUSED; Widget w UNUSED,
XtPointer client_data UNUSED; XtPointer client_data UNUSED,
XEvent *event; XEvent *event,
Boolean *dum UNUSED; Boolean *dum UNUSED)
{ {
if (event->type == ClientMessage if (event->type == ClientMessage
&& (Atom)((XClientMessageEvent *)event)->data.l[0] == dialogatom) && (Atom)((XClientMessageEvent *)event)->data.l[0] == dialogatom)
@@ -2117,14 +2091,14 @@ dialog_wm_handler(w, client_data, event, dum)
} }
int int
gui_mch_dialog(type, title, message, buttons, dfltbutton, textfield, ex_cmd) gui_mch_dialog(
int type UNUSED; int type UNUSED,
char_u *title; char_u *title,
char_u *message; char_u *message,
char_u *buttons; char_u *buttons,
int dfltbutton UNUSED; int dfltbutton UNUSED,
char_u *textfield; char_u *textfield,
int ex_cmd UNUSED; int ex_cmd UNUSED)
{ {
char_u *buts; char_u *buts;
char_u *p, *next; char_u *p, *next;
@@ -2305,8 +2279,7 @@ error:
* Set the colors of Widget "id" to the menu colors. * Set the colors of Widget "id" to the menu colors.
*/ */
static void static void
gui_athena_menu_colors(id) gui_athena_menu_colors(Widget id)
Widget id;
{ {
if (gui.menu_bg_pixel != INVALCOLOR) if (gui.menu_bg_pixel != INVALCOLOR)
XtVaSetValues(id, XtNbackground, gui.menu_bg_pixel, NULL); XtVaSetValues(id, XtNbackground, gui.menu_bg_pixel, NULL);
@@ -2319,8 +2292,7 @@ gui_athena_menu_colors(id)
* Set the colors of Widget "id" to the scroll colors. * Set the colors of Widget "id" to the scroll colors.
*/ */
static void static void
gui_athena_scroll_colors(id) gui_athena_scroll_colors(Widget id)
Widget id;
{ {
if (gui.scroll_bg_pixel != INVALCOLOR) if (gui.scroll_bg_pixel != INVALCOLOR)
XtVaSetValues(id, XtNbackground, gui.scroll_bg_pixel, NULL); XtVaSetValues(id, XtNbackground, gui.scroll_bg_pixel, NULL);

View File

@@ -16,9 +16,7 @@
* Common code, invoked when the mouse is resting for a moment. * Common code, invoked when the mouse is resting for a moment.
*/ */
void void
general_beval_cb(beval, state) general_beval_cb(BalloonEval *beval, int state UNUSED)
BalloonEval *beval;
int state UNUSED;
{ {
#ifdef FEAT_EVAL #ifdef FEAT_EVAL
win_T *wp; win_T *wp;
@@ -192,11 +190,11 @@ static void createBalloonEvalWindow(BalloonEval *);
* Returns a pointer to the resulting object (NULL when out of memory). * Returns a pointer to the resulting object (NULL when out of memory).
*/ */
BalloonEval * BalloonEval *
gui_mch_create_beval_area(target, mesg, mesgCB, clientData) gui_mch_create_beval_area(
void *target; void *target,
char_u *mesg; char_u *mesg,
void (*mesgCB)(BalloonEval *, int); void (*mesgCB)(BalloonEval *, int),
void *clientData; void *clientData)
{ {
#ifndef FEAT_GUI_GTK #ifndef FEAT_GUI_GTK
char *display_name; /* get from gui.dpy */ char *display_name; /* get from gui.dpy */
@@ -262,8 +260,7 @@ gui_mch_create_beval_area(target, mesg, mesgCB, clientData)
* Destroy a balloon-eval and free its associated memory. * Destroy a balloon-eval and free its associated memory.
*/ */
void void
gui_mch_destroy_beval_area(beval) gui_mch_destroy_beval_area(BalloonEval *beval)
BalloonEval *beval;
{ {
cancelBalloon(beval); cancelBalloon(beval);
removeEventHandler(beval); removeEventHandler(beval);
@@ -278,16 +275,14 @@ gui_mch_destroy_beval_area(beval)
#endif #endif
void void
gui_mch_enable_beval_area(beval) gui_mch_enable_beval_area(BalloonEval *beval)
BalloonEval *beval;
{ {
if (beval != NULL) if (beval != NULL)
addEventHandler(beval->target, beval); addEventHandler(beval->target, beval);
} }
void void
gui_mch_disable_beval_area(beval) gui_mch_disable_beval_area(BalloonEval *beval)
BalloonEval *beval;
{ {
if (beval != NULL) if (beval != NULL)
removeEventHandler(beval); removeEventHandler(beval);
@@ -301,7 +296,7 @@ gui_mch_disable_beval_area(beval)
* Assumption: Only one tooltip can be shown at a time. * Assumption: Only one tooltip can be shown at a time.
*/ */
BalloonEval * BalloonEval *
gui_mch_currently_showing_beval() gui_mch_currently_showing_beval(void)
{ {
return current_beval; return current_beval;
} }
@@ -317,13 +312,13 @@ gui_mch_currently_showing_beval()
* Returns OK or FAIL. * Returns OK or FAIL.
*/ */
int int
get_beval_info(beval, getword, winp, lnump, textp, colp) get_beval_info(
BalloonEval *beval; BalloonEval *beval,
int getword; int getword,
win_T **winp; win_T **winp,
linenr_T *lnump; linenr_T *lnump,
char_u **textp; char_u **textp,
int *colp; int *colp)
{ {
win_T *wp; win_T *wp;
int row, col; int row, col;
@@ -427,9 +422,7 @@ get_beval_info(beval, getword, winp, lnump, textp, colp)
* Show a balloon with "mesg". * Show a balloon with "mesg".
*/ */
void void
gui_mch_post_balloon(beval, mesg) gui_mch_post_balloon(BalloonEval *beval, char_u *mesg)
BalloonEval *beval;
char_u *mesg;
{ {
beval->msg = mesg; beval->msg = mesg;
if (mesg != NULL) if (mesg != NULL)
@@ -446,8 +439,7 @@ gui_mch_post_balloon(beval, mesg)
* Hide the given balloon. * Hide the given balloon.
*/ */
void void
gui_mch_unpost_balloon(beval) gui_mch_unpost_balloon(BalloonEval *beval)
BalloonEval *beval;
{ {
undrawBalloon(beval); undrawBalloon(beval);
} }
@@ -687,9 +679,7 @@ balloon_expose_event_cb(GtkWidget *widget,
#else /* !FEAT_GUI_GTK */ #else /* !FEAT_GUI_GTK */
static void static void
addEventHandler(target, beval) addEventHandler(Widget target, BalloonEval *beval)
Widget target;
BalloonEval *beval;
{ {
XtAddEventHandler(target, XtAddEventHandler(target,
PointerMotionMask | EnterWindowMask | PointerMotionMask | EnterWindowMask |
@@ -700,8 +690,7 @@ addEventHandler(target, beval)
} }
static void static void
removeEventHandler(beval) removeEventHandler(BalloonEval *beval)
BalloonEval *beval;
{ {
XtRemoveEventHandler(beval->target, XtRemoveEventHandler(beval->target,
PointerMotionMask | EnterWindowMask | PointerMotionMask | EnterWindowMask |
@@ -716,11 +705,11 @@ removeEventHandler(beval)
* The X event handler. All it does is call the real event handler. * The X event handler. All it does is call the real event handler.
*/ */
static void static void
pointerEventEH(w, client_data, event, unused) pointerEventEH(
Widget w UNUSED; Widget w UNUSED,
XtPointer client_data; XtPointer client_data,
XEvent *event; XEvent *event,
Boolean *unused UNUSED; Boolean *unused UNUSED)
{ {
BalloonEval *beval = (BalloonEval *)client_data; BalloonEval *beval = (BalloonEval *)client_data;
pointerEvent(beval, event); pointerEvent(beval, event);
@@ -733,9 +722,7 @@ pointerEventEH(w, client_data, event, unused)
*/ */
static void static void
pointerEvent(beval, event) pointerEvent(BalloonEval *beval, XEvent *event)
BalloonEval *beval;
XEvent *event;
{ {
Position distance; /* a measure of how much the pointer moved */ Position distance; /* a measure of how much the pointer moved */
Position delta; /* used to compute distance */ Position delta; /* used to compute distance */
@@ -866,9 +853,7 @@ pointerEvent(beval, event)
} }
static void static void
timerRoutine(dx, id) timerRoutine(XtPointer dx, XtIntervalId *id UNUSED)
XtPointer dx;
XtIntervalId *id UNUSED;
{ {
BalloonEval *beval = (BalloonEval *)dx; BalloonEval *beval = (BalloonEval *)dx;
@@ -885,8 +870,7 @@ timerRoutine(dx, id)
#endif /* !FEAT_GUI_GTK */ #endif /* !FEAT_GUI_GTK */
static void static void
requestBalloon(beval) requestBalloon(BalloonEval *beval)
BalloonEval *beval;
{ {
if (beval->showState != ShS_PENDING) if (beval->showState != ShS_PENDING)
{ {
@@ -1177,8 +1161,7 @@ createBalloonEvalWindow(BalloonEval *beval)
* Draw a balloon. * Draw a balloon.
*/ */
static void static void
drawBalloon(beval) drawBalloon(BalloonEval *beval)
BalloonEval *beval;
{ {
Dimension w; Dimension w;
Dimension h; Dimension h;
@@ -1281,8 +1264,7 @@ drawBalloon(beval)
* Undraw a balloon. * Undraw a balloon.
*/ */
static void static void
undrawBalloon(beval) undrawBalloon(BalloonEval *beval)
BalloonEval *beval;
{ {
if (beval->balloonShell != (Widget)0) if (beval->balloonShell != (Widget)0)
XtPopdown(beval->balloonShell); XtPopdown(beval->balloonShell);
@@ -1292,8 +1274,7 @@ undrawBalloon(beval)
} }
static void static void
cancelBalloon(beval) cancelBalloon(BalloonEval *beval)
BalloonEval *beval;
{ {
if (beval->showState == ShS_SHOWING if (beval->showState == ShS_SHOWING
|| beval->showState == ShS_UPDATE_PENDING) || beval->showState == ShS_UPDATE_PENDING)
@@ -1309,8 +1290,7 @@ cancelBalloon(beval)
static void static void
createBalloonEvalWindow(beval) createBalloonEvalWindow(BalloonEval *beval)
BalloonEval *beval;
{ {
Arg args[12]; Arg args[12];
int n; int n;

View File

@@ -1988,8 +1988,7 @@ entry_changed_cb(GtkWidget * entry, GtkWidget * dialog)
* ":helpfind" * ":helpfind"
*/ */
void void
ex_helpfind(eap) ex_helpfind(exarg_T *eap UNUSED)
exarg_T *eap UNUSED;
{ {
/* This will fail when menus are not loaded. Well, it's only for /* This will fail when menus are not loaded. Well, it's only for
* backwards compatibility anyway. */ * backwards compatibility anyway. */

View File

@@ -571,7 +571,7 @@ gui_mch_prepare(int *argc, char **argv)
#if defined(EXITFREE) || defined(PROTO) #if defined(EXITFREE) || defined(PROTO)
void void
gui_mch_free_all() gui_mch_free_all(void)
{ {
vim_free(gui_argv); vim_free(gui_argv);
#if defined(FEAT_GUI_GNOME) && defined(FEAT_SESSION) #if defined(FEAT_GUI_GNOME) && defined(FEAT_SESSION)
@@ -2224,10 +2224,10 @@ setup_save_yourself(void)
* GTK tells us that XSMP needs attention * GTK tells us that XSMP needs attention
*/ */
static gboolean static gboolean
local_xsmp_handle_requests(source, condition, data) local_xsmp_handle_requests(
GIOChannel *source UNUSED; GIOChannel *source UNUSED,
GIOCondition condition; GIOCondition condition,
gpointer data; gpointer data)
{ {
if (condition == G_IO_IN) if (condition == G_IO_IN)
{ {
@@ -3070,8 +3070,7 @@ gui_mch_update_tabline(void)
* Set the current tab to "nr". First tab is 1. * Set the current tab to "nr". First tab is 1.
*/ */
void void
gui_mch_set_curtab(nr) gui_mch_set_curtab(int nr)
int nr;
{ {
if (gui.tabline == NULL) if (gui.tabline == NULL)
return; return;
@@ -3944,7 +3943,7 @@ force_shell_resize_idle(gpointer data)
* Return TRUE if the main window is maximized. * Return TRUE if the main window is maximized.
*/ */
int int
gui_mch_maximized() gui_mch_maximized(void)
{ {
return (gui.mainwin != NULL && gui.mainwin->window != NULL return (gui.mainwin != NULL && gui.mainwin->window != NULL
&& (gdk_window_get_state(gui.mainwin->window) && (gdk_window_get_state(gui.mainwin->window)
@@ -3955,7 +3954,7 @@ gui_mch_maximized()
* Unmaximize the main window * Unmaximize the main window
*/ */
void void
gui_mch_unmaximize() gui_mch_unmaximize(void)
{ {
if (gui.mainwin != NULL) if (gui.mainwin != NULL)
gtk_window_unmaximize(GTK_WINDOW(gui.mainwin)); gtk_window_unmaximize(GTK_WINDOW(gui.mainwin));
@@ -3966,7 +3965,7 @@ gui_mch_unmaximize()
* new Rows and Columns. This is like resizing the window. * new Rows and Columns. This is like resizing the window.
*/ */
void void
gui_mch_newfont() gui_mch_newfont(void)
{ {
int w, h; int w, h;

View File

@@ -2607,8 +2607,7 @@ gui_mch_mousehide(int hide)
* the menu that we should display * the menu that we should display
*/ */
void void
gui_mac_handle_contextual_menu(event) gui_mac_handle_contextual_menu(EventRecord *event)
EventRecord *event;
{ {
/* /*
* Clone PopUp to use menu * Clone PopUp to use menu
@@ -3697,8 +3696,7 @@ gui_mch_set_font(GuiFont font)
* If a font is not going to be used, free its structure. * If a font is not going to be used, free its structure.
*/ */
void void
gui_mch_free_font(font) gui_mch_free_font(GuiFont font)
GuiFont font;
{ {
/* /*
* Free font when "font" is not 0. * Free font when "font" is not 0.
@@ -6897,8 +6895,7 @@ gui_mch_update_tabline(void)
* Set the current tab to "nr". First tab is 1. * Set the current tab to "nr". First tab is 1.
*/ */
void void
gui_mch_set_curtab(nr) gui_mch_set_curtab(int nr)
int nr;
{ {
DataBrowserItemID item = nr; DataBrowserItemID item = nr;
SetDataBrowserSelectedItems(dataBrowser, 1, &item, kDataBrowserItemsAssign); SetDataBrowserSelectedItems(dataBrowser, 1, &item, kDataBrowserItemsAssign);

View File

@@ -118,9 +118,7 @@ static void gui_motif_scroll_colors(Widget id);
*/ */
static void static void
scroll_cb(w, client_data, call_data) scroll_cb(Widget w UNUSED, XtPointer client_data, call_data)
Widget w UNUSED;
XtPointer client_data, call_data;
{ {
scrollbar_T *sb; scrollbar_T *sb;
long value; long value;
@@ -136,10 +134,10 @@ scroll_cb(w, client_data, call_data)
#ifdef FEAT_GUI_TABLINE #ifdef FEAT_GUI_TABLINE
static void static void
tabline_cb(w, client_data, call_data) tabline_cb(
Widget w UNUSED; Widget w UNUSED,
XtPointer client_data UNUSED; XtPointer client_data UNUSED,
XtPointer call_data; XtPointer call_data)
{ {
XmNotebookCallbackStruct *nptr; XmNotebookCallbackStruct *nptr;
@@ -149,10 +147,10 @@ tabline_cb(w, client_data, call_data)
} }
static void static void
tabline_button_cb(w, client_data, call_data) tabline_button_cb(
Widget w; Widget w,
XtPointer client_data UNUSED; XtPointer client_data UNUSED,
XtPointer call_data UNUSED; XtPointer call_data UNUSED)
{ {
int cmd, tab_idx; int cmd, tab_idx;
@@ -166,9 +164,9 @@ tabline_button_cb(w, client_data, call_data)
* Tabline single mouse click timeout handler * Tabline single mouse click timeout handler
*/ */
static void static void
motif_tabline_timer_cb (timed_out, interval_id) motif_tabline_timer_cb (
XtPointer timed_out; XtPointer timed_out,
XtIntervalId *interval_id UNUSED; XtIntervalId *interval_id UNUSED)
{ {
*((int *)timed_out) = TRUE; *((int *)timed_out) = TRUE;
} }
@@ -177,9 +175,9 @@ motif_tabline_timer_cb (timed_out, interval_id)
* check if the tabline tab scroller is clicked * check if the tabline tab scroller is clicked
*/ */
static int static int
tabline_scroller_clicked(scroller_name, event) tabline_scroller_clicked(
char *scroller_name; char *scroller_name,
XButtonPressedEvent *event; XButtonPressedEvent *event)
{ {
Widget tab_scroll_w; Widget tab_scroll_w;
Position pos_x, pos_y; Position pos_x, pos_y;
@@ -202,11 +200,11 @@ tabline_scroller_clicked(scroller_name, event)
} }
static void static void
tabline_menu_cb(w, closure, e, continue_dispatch) tabline_menu_cb(
Widget w; Widget w,
XtPointer closure UNUSED; XtPointer closure UNUSED,
XEvent *e; XEvent *e,
Boolean *continue_dispatch UNUSED; Boolean *continue_dispatch UNUSED)
{ {
Widget tab_w; Widget tab_w;
XButtonPressedEvent *event; XButtonPressedEvent *event;
@@ -275,9 +273,7 @@ tabline_menu_cb(w, closure, e, continue_dispatch)
} }
static void static void
tabline_balloon_cb(beval, state) tabline_balloon_cb(BalloonEval *beval, int state UNUSED)
BalloonEval *beval;
int state UNUSED;
{ {
int nr; int nr;
tabpage_T *tp; tabpage_T *tp;
@@ -313,10 +309,7 @@ static XtExposeProc old_label_expose = NULL;
static void label_expose(Widget _w, XEvent *_event, Region _region); static void label_expose(Widget _w, XEvent *_event, Region _region);
static void static void
label_expose(_w, _event, _region) label_expose(Widget _w, XEvent *_event, Region _region)
Widget _w;
XEvent *_event;
Region _region;
{ {
GC insensitiveGC; GC insensitiveGC;
XmLabelWidget lw = (XmLabelWidget)_w; XmLabelWidget lw = (XmLabelWidget)_w;
@@ -396,7 +389,7 @@ label_expose(_w, _event, _region)
* Create all the motif widgets necessary. * Create all the motif widgets necessary.
*/ */
void void
gui_x11_create_widgets() gui_x11_create_widgets(void)
{ {
#ifdef FEAT_GUI_TABLINE #ifdef FEAT_GUI_TABLINE
Widget button, scroller; Widget button, scroller;
@@ -633,7 +626,7 @@ gui_x11_create_widgets()
* Called when the GUI is not going to start after all. * Called when the GUI is not going to start after all.
*/ */
void void
gui_x11_destroy_widgets() gui_x11_destroy_widgets(void)
{ {
textArea = NULL; textArea = NULL;
#ifdef FEAT_MENU #ifdef FEAT_MENU
@@ -642,11 +635,11 @@ gui_x11_destroy_widgets()
} }
void void
gui_mch_set_text_area_pos(x, y, w, h) gui_mch_set_text_area_pos(
int x UNUSED; int x UNUSED,
int y UNUSED; int y UNUSED,
int w UNUSED; int w UNUSED,
int h UNUSED; int h UNUSED)
{ {
#ifdef FEAT_TOOLBAR #ifdef FEAT_TOOLBAR
/* Give keyboard focus to the textArea instead of the toolbar. */ /* Give keyboard focus to the textArea instead of the toolbar. */
@@ -655,7 +648,7 @@ gui_mch_set_text_area_pos(x, y, w, h)
} }
void void
gui_x11_set_back_color() gui_x11_set_back_color(void)
{ {
if (textArea != NULL) if (textArea != NULL)
#if (XmVersion >= 1002) #if (XmVersion >= 1002)
@@ -672,8 +665,7 @@ gui_x11_set_back_color()
* well. * well.
*/ */
void void
manage_centered(dialog_child) manage_centered(Widget dialog_child)
Widget dialog_child;
{ {
Widget shell = XtParent(dialog_child); Widget shell = XtParent(dialog_child);
Window root, child; Window root, child;
@@ -731,8 +723,7 @@ manage_centered(dialog_child)
* Encapsulate the way an XmFontList is created. * Encapsulate the way an XmFontList is created.
*/ */
XmFontList XmFontList
gui_motif_create_fontlist(font) gui_motif_create_fontlist(XFontStruct *font)
XFontStruct *font;
{ {
XmFontList font_list; XmFontList font_list;
@@ -753,8 +744,7 @@ gui_motif_create_fontlist(font)
# if ((XmVersion > 1001) && defined(FEAT_XFONTSET)) || defined(PROTO) # if ((XmVersion > 1001) && defined(FEAT_XFONTSET)) || defined(PROTO)
XmFontList XmFontList
gui_motif_fontset2fontlist(fontset) gui_motif_fontset2fontlist(XFontSet *fontset)
XFontSet *fontset;
{ {
XmFontList font_list; XmFontList font_list;
@@ -788,8 +778,7 @@ static void do_set_mnemonics(int enable);
static int menu_enabled = TRUE; static int menu_enabled = TRUE;
void void
gui_mch_enable_menu(flag) gui_mch_enable_menu(int flag)
int flag;
{ {
if (flag) if (flag)
{ {
@@ -900,8 +889,7 @@ gui_mch_enable_menu(flag)
* Enable or disable mnemonics for the toplevel menus. * Enable or disable mnemonics for the toplevel menus.
*/ */
void void
gui_motif_set_mnemonics(enable) gui_motif_set_mnemonics(int enable)
int enable;
{ {
/* /*
* Don't enable menu mnemonics when the menu bar is disabled, LessTif * Don't enable menu mnemonics when the menu bar is disabled, LessTif
@@ -913,8 +901,7 @@ gui_motif_set_mnemonics(enable)
} }
static void static void
do_set_mnemonics(enable) do_set_mnemonics(int enable)
int enable;
{ {
vimmenu_T *menu; vimmenu_T *menu;
@@ -926,9 +913,7 @@ do_set_mnemonics(enable)
} }
void void
gui_mch_add_menu(menu, idx) gui_mch_add_menu(vimmenu_T *menu, int idx)
vimmenu_T *menu;
int idx;
{ {
XmString label; XmString label;
Widget shell; Widget shell;
@@ -1036,8 +1021,7 @@ gui_mch_add_menu(menu, idx)
* Add mnemonic and accelerator text to a menu button. * Add mnemonic and accelerator text to a menu button.
*/ */
static void static void
gui_motif_add_actext(menu) gui_motif_add_actext(vimmenu_T *menu)
vimmenu_T *menu;
{ {
XmString label; XmString label;
@@ -1053,8 +1037,7 @@ gui_motif_add_actext(menu)
} }
void void
gui_mch_toggle_tearoffs(enable) gui_mch_toggle_tearoffs(int enable)
int enable;
{ {
#if (XmVersion >= 1002) #if (XmVersion >= 1002)
if (enable) if (enable)
@@ -1072,8 +1055,7 @@ gui_mch_toggle_tearoffs(enable)
* tearoff widget. * tearoff widget.
*/ */
static void static void
toggle_tearoff(wid) toggle_tearoff(Widget wid)
Widget wid;
{ {
Widget w; Widget w;
@@ -1084,8 +1066,7 @@ toggle_tearoff(wid)
} }
static void static void
gui_mch_recurse_tearoffs(menu) gui_mch_recurse_tearoffs(vimmenu_T *menu)
vimmenu_T *menu;
{ {
while (menu != NULL) while (menu != NULL)
{ {
@@ -1101,7 +1082,7 @@ gui_mch_recurse_tearoffs(menu)
#endif #endif
int int
gui_mch_text_area_extra_height() gui_mch_text_area_extra_height(void)
{ {
Dimension shadowHeight; Dimension shadowHeight;
@@ -1115,8 +1096,8 @@ gui_mch_text_area_extra_height()
* there are several rows, and/or some characters extend higher or lower. * there are several rows, and/or some characters extend higher or lower.
*/ */
void void
gui_mch_compute_menu_height(id) gui_mch_compute_menu_height(
Widget id; /* can be NULL when deleting menu */ Widget id) /* can be NULL when deleting menu */
{ {
Dimension y, maxy; Dimension y, maxy;
Dimension margin, shadow; Dimension margin, shadow;
@@ -1200,8 +1181,7 @@ static int add_pixmap_args(vimmenu_T *menu, Arg *args, int n);
* Read an Xpm file. Return OK or FAIL. * Read an Xpm file. Return OK or FAIL.
*/ */
static int static int
check_xpm(path) check_xpm(char_u *path)
char_u *path;
{ {
XpmAttributes attrs; XpmAttributes attrs;
int status; int status;
@@ -1229,9 +1209,7 @@ check_xpm(path)
* Return a blank pixmap if it fails. * Return a blank pixmap if it fails.
*/ */
static char ** static char **
get_toolbar_pixmap(menu, fname) get_toolbar_pixmap(vimmenu_T *menu, char **fname)
vimmenu_T *menu;
char **fname;
{ {
char_u buf[MAXPATHL]; /* buffer storing expanded pathname */ char_u buf[MAXPATHL]; /* buffer storing expanded pathname */
char **xpm = NULL; /* xpm array */ char **xpm = NULL; /* xpm array */
@@ -1272,10 +1250,7 @@ get_toolbar_pixmap(menu, fname)
* Add arguments for the toolbar pixmap to a menu item. * Add arguments for the toolbar pixmap to a menu item.
*/ */
static int static int
add_pixmap_args(menu, args, n) add_pixmap_args(vimmenu_T *menu, Arg *args, int n)
vimmenu_T *menu;
Arg *args;
int n;
{ {
vim_free(menu->xpm_fname); vim_free(menu->xpm_fname);
menu->xpm = get_toolbar_pixmap(menu, &menu->xpm_fname); menu->xpm = get_toolbar_pixmap(menu, &menu->xpm_fname);
@@ -1297,9 +1272,7 @@ add_pixmap_args(menu, args, n)
#endif /* FEAT_TOOLBAR */ #endif /* FEAT_TOOLBAR */
void void
gui_mch_add_menu_item(menu, idx) gui_mch_add_menu_item(vimmenu_T *menu, int idx)
vimmenu_T *menu;
int idx;
{ {
XmString label; XmString label;
vimmenu_T *parent = menu->parent; vimmenu_T *parent = menu->parent;
@@ -1457,8 +1430,7 @@ gui_mch_add_menu_item(menu, idx)
* there exists a popup menu but it isn't managed. * there exists a popup menu but it isn't managed.
*/ */
void void
gui_motif_update_mousemodel(menu) gui_motif_update_mousemodel(vimmenu_T *menu)
vimmenu_T *menu;
{ {
int idx = 0; int idx = 0;
@@ -1500,7 +1472,7 @@ gui_motif_update_mousemodel(menu)
#endif #endif
void void
gui_mch_new_menu_colors() gui_mch_new_menu_colors(void)
{ {
if (menuBar == (Widget)0) if (menuBar == (Widget)0)
return; return;
@@ -1514,7 +1486,7 @@ gui_mch_new_menu_colors()
} }
void void
gui_mch_new_menu_font() gui_mch_new_menu_font(void)
{ {
if (menuBar == (Widget)0) if (menuBar == (Widget)0)
return; return;
@@ -1539,7 +1511,7 @@ gui_mch_new_menu_font()
#if defined(FEAT_BEVAL) || defined(PROTO) #if defined(FEAT_BEVAL) || defined(PROTO)
void void
gui_mch_new_tooltip_font() gui_mch_new_tooltip_font(void)
{ {
# ifdef FEAT_TOOLBAR # ifdef FEAT_TOOLBAR
vimmenu_T *menu; vimmenu_T *menu;
@@ -1554,7 +1526,7 @@ gui_mch_new_tooltip_font()
} }
void void
gui_mch_new_tooltip_colors() gui_mch_new_tooltip_colors(void)
{ {
# ifdef FEAT_TOOLBAR # ifdef FEAT_TOOLBAR
vimmenu_T *toolbar; vimmenu_T *toolbar;
@@ -1570,9 +1542,9 @@ gui_mch_new_tooltip_colors()
#endif #endif
static void static void
submenu_change(menu, colors) submenu_change(
vimmenu_T *menu; vimmenu_T *menu,
int colors; /* TRUE for colors, FALSE for font */ int colors) /* TRUE for colors, FALSE for font */
{ {
vimmenu_T *mp; vimmenu_T *mp;
@@ -1650,8 +1622,7 @@ submenu_change(menu, colors)
* Destroy the machine specific menu widget. * Destroy the machine specific menu widget.
*/ */
void void
gui_mch_destroy_menu(menu) gui_mch_destroy_menu(vimmenu_T *menu)
vimmenu_T *menu;
{ {
/* Please be sure to destroy the parent widget first (i.e. menu->id). /* Please be sure to destroy the parent widget first (i.e. menu->id).
* On the other hand, problems have been reported that the submenu must be * On the other hand, problems have been reported that the submenu must be
@@ -1708,8 +1679,7 @@ gui_mch_destroy_menu(menu)
} }
void void
gui_mch_show_popupmenu(menu) gui_mch_show_popupmenu(vimmenu_T *menu UNUSED)
vimmenu_T *menu UNUSED;
{ {
#ifdef MOTIF_POPUP #ifdef MOTIF_POPUP
XmMenuPosition(menu->submenu_id, gui_x11_get_last_mouse_event()); XmMenuPosition(menu->submenu_id, gui_x11_get_last_mouse_event());
@@ -1723,7 +1693,7 @@ gui_mch_show_popupmenu(menu)
* Set the menu and scrollbar colors to their default values. * Set the menu and scrollbar colors to their default values.
*/ */
void void
gui_mch_def_colors() gui_mch_def_colors(void)
{ {
if (gui.in_use) if (gui.in_use)
{ {
@@ -1748,11 +1718,11 @@ gui_mch_def_colors()
*/ */
void void
gui_mch_set_scrollbar_thumb(sb, val, size, max) gui_mch_set_scrollbar_thumb(
scrollbar_T *sb; scrollbar_T *sb,
long val; long val,
long size; long size,
long max; long max)
{ {
if (sb->id != (Widget)0) if (sb->id != (Widget)0)
XtVaSetValues(sb->id, XtVaSetValues(sb->id,
@@ -1764,12 +1734,12 @@ gui_mch_set_scrollbar_thumb(sb, val, size, max)
} }
void void
gui_mch_set_scrollbar_pos(sb, x, y, w, h) gui_mch_set_scrollbar_pos(
scrollbar_T *sb; scrollbar_T *sb,
int x; int x,
int y; int y,
int w; int w,
int h; int h)
{ {
if (sb->id != (Widget)0) if (sb->id != (Widget)0)
{ {
@@ -1798,9 +1768,7 @@ gui_mch_set_scrollbar_pos(sb, x, y, w, h)
} }
void void
gui_mch_enable_scrollbar(sb, flag) gui_mch_enable_scrollbar(scrollbar_T *sb, int flag)
scrollbar_T *sb;
int flag;
{ {
Arg args[16]; Arg args[16];
int n; int n;
@@ -1855,9 +1823,9 @@ gui_mch_enable_scrollbar(sb, flag)
} }
void void
gui_mch_create_scrollbar(sb, orient) gui_mch_create_scrollbar(
scrollbar_T *sb; scrollbar_T *sb,
int orient; /* SBAR_VERT or SBAR_HORIZ */ int orient) /* SBAR_VERT or SBAR_HORIZ */
{ {
Arg args[16]; Arg args[16];
int n; int n;
@@ -1913,8 +1881,7 @@ gui_mch_create_scrollbar(sb, orient)
#if defined(FEAT_WINDOWS) || defined(PROTO) #if defined(FEAT_WINDOWS) || defined(PROTO)
void void
gui_mch_destroy_scrollbar(sb) gui_mch_destroy_scrollbar(scrollbar_T *sb)
scrollbar_T *sb;
{ {
if (sb->id != (Widget)0) if (sb->id != (Widget)0)
XtDestroyWidget(sb->id); XtDestroyWidget(sb->id);
@@ -1922,8 +1889,7 @@ gui_mch_destroy_scrollbar(sb)
#endif #endif
void void
gui_mch_set_scrollbar_colors(sb) gui_mch_set_scrollbar_colors(scrollbar_T *sb)
scrollbar_T *sb;
{ {
if (sb->id != (Widget)0) if (sb->id != (Widget)0)
{ {
@@ -1957,7 +1923,7 @@ gui_mch_set_scrollbar_colors(sb)
*/ */
Window Window
gui_x11_get_wid() gui_x11_get_wid(void)
{ {
return(XtWindow(textArea)); return(XtWindow(textArea));
} }
@@ -2130,8 +2096,7 @@ static void set_fontlist(Widget wg);
* Use the 'guifont' or 'guifontset' as a fontlist for a dialog widget. * Use the 'guifont' or 'guifontset' as a fontlist for a dialog widget.
*/ */
static void static void
set_fontlist(id) set_fontlist(Widget id)
Widget id;
{ {
XmFontList fl; XmFontList fl;
@@ -2211,11 +2176,8 @@ static void DialogAcceptCB(Widget, XtPointer, XtPointer);
*/ */
static void set_predefined_label(Widget parent, String name, char *new_label); static void set_predefined_label(Widget parent, String name, char *new_label);
static void static void
set_predefined_label(parent, name, new_label) set_predefined_label(Widget parent, String name, char *new_label)
Widget parent;
String name;
char *new_label;
{ {
XmString str; XmString str;
Widget w; Widget w;
@@ -2258,10 +2220,8 @@ set_predefined_label(parent, name, new_label)
gui_motif_menu_fontlist(w); gui_motif_menu_fontlist(w);
} }
static void static void
set_predefined_fontlist(parent, name) set_predefined_fontlist(Widget parent, String name)
Widget parent;
String name;
{ {
Widget w; Widget w;
w = XtNameToWidget(parent, name); w = XtNameToWidget(parent, name);
@@ -2277,13 +2237,13 @@ set_predefined_fontlist(parent, name)
* Returns the selected name in allocated memory, or NULL for Cancel. * Returns the selected name in allocated memory, or NULL for Cancel.
*/ */
char_u * char_u *
gui_mch_browse(saving, title, dflt, ext, initdir, filter) gui_mch_browse(
int saving UNUSED; /* select file to write */ int saving UNUSED, /* select file to write */
char_u *title; /* title for the window */ char_u *title, /* title for the window */
char_u *dflt; /* default name */ char_u *dflt, /* default name */
char_u *ext UNUSED; /* not used (extension added) */ char_u *ext UNUSED, /* not used (extension added) */
char_u *initdir; /* initial directory, NULL for current dir */ char_u *initdir, /* initial directory, NULL for current dir */
char_u *filter; /* file name filter */ char_u *filter) /* file name filter */
{ {
char_u dirbuf[MAXPATHL]; char_u dirbuf[MAXPATHL];
char_u dfltbuf[MAXPATHL]; char_u dfltbuf[MAXPATHL];
@@ -2402,10 +2362,10 @@ gui_mch_browse(saving, title, dflt, ext, initdir, filter)
* Process callback from Dialog cancel actions. * Process callback from Dialog cancel actions.
*/ */
static void static void
DialogCancelCB(w, client_data, call_data) DialogCancelCB(
Widget w UNUSED; /* widget id */ Widget w UNUSED, /* widget id */
XtPointer client_data UNUSED; /* data from application */ XtPointer client_data UNUSED, /* data from application */
XtPointer call_data UNUSED; /* data from widget class */ XtPointer call_data UNUSED) /* data from widget class */
{ {
if (browse_fname != NULL) if (browse_fname != NULL)
{ {
@@ -2419,10 +2379,10 @@ DialogCancelCB(w, client_data, call_data)
* Process callback from Dialog actions. * Process callback from Dialog actions.
*/ */
static void static void
DialogAcceptCB(w, client_data, call_data) DialogAcceptCB(
Widget w UNUSED; /* widget id */ Widget w UNUSED, /* widget id */
XtPointer client_data UNUSED; /* data from application */ XtPointer client_data UNUSED, /* data from application */
XtPointer call_data; /* data from widget class */ XtPointer call_data) /* data from widget class */
{ {
XmFileSelectionBoxCallbackStruct *fcb; XmFileSelectionBoxCallbackStruct *fcb;
@@ -2454,11 +2414,11 @@ static void butproc(Widget w, XtPointer client_data, XtPointer call_data);
* hitting the "OK" button, ESC like "Cancel". * hitting the "OK" button, ESC like "Cancel".
*/ */
static void static void
keyhit_callback(w, client_data, event, cont) keyhit_callback(
Widget w; Widget w,
XtPointer client_data UNUSED; XtPointer client_data UNUSED,
XEvent *event; XEvent *event,
Boolean *cont UNUSED; Boolean *cont UNUSED)
{ {
char buf[2]; char buf[2];
KeySym key_sym; KeySym key_sym;
@@ -2476,10 +2436,10 @@ keyhit_callback(w, client_data, event, cont)
} }
static void static void
butproc(w, client_data, call_data) butproc(
Widget w UNUSED; Widget w UNUSED,
XtPointer client_data; XtPointer client_data,
XtPointer call_data UNUSED; XtPointer call_data UNUSED)
{ {
dialogStatus = (int)(long)client_data + 1; dialogStatus = (int)(long)client_data + 1;
} }
@@ -2489,12 +2449,12 @@ butproc(w, client_data, call_data)
static Widget create_pixmap_label(Widget parent, String name, char **data, ArgList args, Cardinal arg); static Widget create_pixmap_label(Widget parent, String name, char **data, ArgList args, Cardinal arg);
static Widget static Widget
create_pixmap_label(parent, name, data, args, arg) create_pixmap_label(
Widget parent; Widget parent,
String name; String name,
char **data; char **data,
ArgList args; ArgList args,
Cardinal arg; Cardinal arg)
{ {
Widget label; Widget label;
Display *dsp; Display *dsp;
@@ -2552,14 +2512,14 @@ create_pixmap_label(parent, name, data, args, arg)
#endif #endif
int int
gui_mch_dialog(type, title, message, button_names, dfltbutton, textfield, ex_cmd) gui_mch_dialog(
int type UNUSED; int type UNUSED,
char_u *title; char_u *title,
char_u *message; char_u *message,
char_u *button_names; char_u *button_names,
int dfltbutton; int dfltbutton,
char_u *textfield; /* buffer of size IOSIZE */ char_u *textfield, /* buffer of size IOSIZE */
int ex_cmd UNUSED; int ex_cmd UNUSED)
{ {
char_u *buts; char_u *buts;
char_u *p, *next; char_u *p, *next;
@@ -2927,7 +2887,7 @@ gui_mch_dialog(type, title, message, button_names, dfltbutton, textfield, ex_cmd
#if defined(FEAT_FOOTER) || defined(PROTO) #if defined(FEAT_FOOTER) || defined(PROTO)
static int static int
gui_mch_compute_footer_height() gui_mch_compute_footer_height(void)
{ {
Dimension height; /* total Toolbar height */ Dimension height; /* total Toolbar height */
Dimension top; /* XmNmarginTop */ Dimension top; /* XmNmarginTop */
@@ -2945,8 +2905,7 @@ gui_mch_compute_footer_height()
} }
void void
gui_mch_enable_footer(showit) gui_mch_enable_footer(int showit)
int showit;
{ {
if (showit) if (showit)
{ {
@@ -2962,8 +2921,7 @@ gui_mch_enable_footer(showit)
} }
void void
gui_mch_set_footer(s) gui_mch_set_footer(char_u *s)
char_u *s;
{ {
XmString xms; XmString xms;
@@ -3135,14 +3093,14 @@ gui_mch_show_toolbar(int showit)
* input go to the editor window, not the button * input go to the editor window, not the button
*/ */
static void static void
reset_focus() reset_focus(void)
{ {
if (textArea != NULL) if (textArea != NULL)
XmProcessTraversal(textArea, XmTRAVERSE_CURRENT); XmProcessTraversal(textArea, XmTRAVERSE_CURRENT);
} }
int int
gui_mch_compute_toolbar_height() gui_mch_compute_toolbar_height(void)
{ {
Dimension borders; Dimension borders;
Dimension height; /* total Toolbar height */ Dimension height; /* total Toolbar height */
@@ -3189,12 +3147,12 @@ gui_mch_compute_toolbar_height()
} }
void void
motif_get_toolbar_colors(bgp, fgp, bsp, tsp, hsp) motif_get_toolbar_colors(
Pixel *bgp; Pixel *bgp,
Pixel *fgp; Pixel *fgp,
Pixel *bsp; Pixel *bsp,
Pixel *tsp; Pixel *tsp,
Pixel *hsp; Pixel *hsp)
{ {
XtVaGetValues(toolBar, XtVaGetValues(toolBar,
XmNbackground, bgp, XmNbackground, bgp,
@@ -3212,11 +3170,11 @@ motif_get_toolbar_colors(bgp, fgp, bsp, tsp, hsp)
* get implemented and the user will have a choice. * get implemented and the user will have a choice.
*/ */
static void static void
toolbarbutton_enter_cb(w, client_data, event, cont) toolbarbutton_enter_cb(
Widget w UNUSED; Widget w UNUSED,
XtPointer client_data; XtPointer client_data,
XEvent *event UNUSED; XEvent *event UNUSED,
Boolean *cont UNUSED; Boolean *cont UNUSED)
{ {
vimmenu_T *menu = (vimmenu_T *) client_data; vimmenu_T *menu = (vimmenu_T *) client_data;
@@ -3228,11 +3186,11 @@ toolbarbutton_enter_cb(w, client_data, event, cont)
} }
static void static void
toolbarbutton_leave_cb(w, client_data, event, cont) toolbarbutton_leave_cb(
Widget w UNUSED; Widget w UNUSED,
XtPointer client_data UNUSED; XtPointer client_data UNUSED,
XEvent *event UNUSED; XEvent *event UNUSED,
Boolean *cont UNUSED; Boolean *cont UNUSED)
{ {
gui_mch_set_footer((char_u *) ""); gui_mch_set_footer((char_u *) "");
} }
@@ -3413,8 +3371,7 @@ gui_mch_update_tabline(void)
* Set the current tab to "nr". First tab is 1. * Set the current tab to "nr". First tab is 1.
*/ */
void void
gui_mch_set_curtab(nr) gui_mch_set_curtab(int nr)
int nr;
{ {
int currentpage; int currentpage;
@@ -3431,8 +3388,7 @@ gui_mch_set_curtab(nr)
* Set the colors of Widget "id" to the menu colors. * Set the colors of Widget "id" to the menu colors.
*/ */
static void static void
gui_motif_menu_colors(id) gui_motif_menu_colors(Widget id)
Widget id;
{ {
if (gui.menu_bg_pixel != INVALCOLOR) if (gui.menu_bg_pixel != INVALCOLOR)
#if (XmVersion >= 1002) #if (XmVersion >= 1002)
@@ -3448,8 +3404,7 @@ gui_motif_menu_colors(id)
* Set the colors of Widget "id" to the scrollbar colors. * Set the colors of Widget "id" to the scrollbar colors.
*/ */
static void static void
gui_motif_scroll_colors(id) gui_motif_scroll_colors(Widget id)
Widget id;
{ {
if (gui.scroll_bg_pixel != INVALCOLOR) if (gui.scroll_bg_pixel != INVALCOLOR)
#if (XmVersion >= 1002) #if (XmVersion >= 1002)
@@ -3465,8 +3420,7 @@ gui_motif_scroll_colors(id)
* Set the fontlist for Widget "id" to use gui.menu_fontset or gui.menu_font. * Set the fontlist for Widget "id" to use gui.menu_fontset or gui.menu_font.
*/ */
void void
gui_motif_menu_fontlist(id) gui_motif_menu_fontlist(Widget id UNUSED)
Widget id UNUSED;
{ {
#ifdef FEAT_MENU #ifdef FEAT_MENU
#ifdef FONTSET_ALWAYS #ifdef FONTSET_ALWAYS
@@ -3548,10 +3502,10 @@ static void find_replace_keypress(Widget w, SharedFindReplace * frdp, XKeyEvent
static void find_replace_dialog_create(char_u *entry_text, int do_replace); static void find_replace_dialog_create(char_u *entry_text, int do_replace);
static void static void
find_replace_destroy_callback(w, client_data, call_data) find_replace_destroy_callback(
Widget w UNUSED; Widget w UNUSED,
XtPointer client_data; XtPointer client_data,
XtPointer call_data UNUSED; XtPointer call_data UNUSED)
{ {
SharedFindReplace *cd = (SharedFindReplace *)client_data; SharedFindReplace *cd = (SharedFindReplace *)client_data;
@@ -3561,10 +3515,10 @@ find_replace_destroy_callback(w, client_data, call_data)
} }
static void static void
find_replace_dismiss_callback(w, client_data, call_data) find_replace_dismiss_callback(
Widget w UNUSED; Widget w UNUSED,
XtPointer client_data; XtPointer client_data,
XtPointer call_data UNUSED; XtPointer call_data UNUSED)
{ {
SharedFindReplace *cd = (SharedFindReplace *)client_data; SharedFindReplace *cd = (SharedFindReplace *)client_data;
@@ -3573,19 +3527,19 @@ find_replace_dismiss_callback(w, client_data, call_data)
} }
static void static void
entry_activate_callback(w, client_data, call_data) entry_activate_callback(
Widget w UNUSED; Widget w UNUSED,
XtPointer client_data; XtPointer client_data,
XtPointer call_data UNUSED; XtPointer call_data UNUSED)
{ {
XmProcessTraversal((Widget)client_data, XmTRAVERSE_CURRENT); XmProcessTraversal((Widget)client_data, XmTRAVERSE_CURRENT);
} }
static void static void
find_replace_callback(w, client_data, call_data) find_replace_callback(
Widget w UNUSED; Widget w UNUSED,
XtPointer client_data; XtPointer client_data,
XtPointer call_data UNUSED; XtPointer call_data UNUSED)
{ {
long_u flags = (long_u)client_data; long_u flags = (long_u)client_data;
char *find_text, *repl_text; char *find_text, *repl_text;
@@ -3636,10 +3590,10 @@ find_replace_callback(w, client_data, call_data)
} }
static void static void
find_replace_keypress(w, frdp, event) find_replace_keypress(
Widget w UNUSED; Widget w UNUSED,
SharedFindReplace *frdp; SharedFindReplace *frdp,
XKeyEvent *event; XKeyEvent *event)
{ {
KeySym keysym; KeySym keysym;
@@ -3654,9 +3608,7 @@ find_replace_keypress(w, frdp, event)
} }
static void static void
set_label(w, label) set_label(Widget w, char *label)
Widget w;
char *label;
{ {
XmString str; XmString str;
char_u *p, *next; char_u *p, *next;
@@ -3696,9 +3648,7 @@ set_label(w, label)
} }
static void static void
find_replace_dialog_create(arg, do_replace) find_replace_dialog_create(char_u *arg, int do_replace)
char_u *arg;
int do_replace;
{ {
SharedFindReplace *frdp; SharedFindReplace *frdp;
Widget separator; Widget separator;
@@ -4050,8 +4000,7 @@ find_replace_dialog_create(arg, do_replace)
} }
void void
gui_mch_find_dialog(eap) gui_mch_find_dialog(exarg_T *eap)
exarg_T *eap;
{ {
if (!gui.in_use) if (!gui.in_use)
return; return;
@@ -4061,8 +4010,7 @@ gui_mch_find_dialog(eap)
void void
gui_mch_replace_dialog(eap) gui_mch_replace_dialog(exarg_T *eap)
exarg_T *eap;
{ {
if (!gui.in_use) if (!gui.in_use)
return; return;

View File

@@ -746,6 +746,8 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
1207,
/**/ /**/
1206, 1206,
/**/ /**/