# HG changeset patch # User Christian Brabandt # Date 1454168704 -3600 # Node ID 81794242a275aa138d422da2f6c6c43f3d422bd6 # Parent 38d22ab3d9a08194a84ec9d96e0ea2c4a6be6cb5 commit https://github.com/vim/vim/commit/66f948e928d5e0cd3123af902aa8ac1613534c94 Author: Bram Moolenaar Date: Sat Jan 30 16:39:25 2016 +0100 patch 7.4.1207 Problem: Using old style function declarations. Solution: Change to new style function declarations. (script by Hirohito Higashi) diff --git a/src/fold.c b/src/fold.c --- a/src/fold.c +++ b/src/fold.c @@ -100,9 +100,7 @@ static int foldendmarkerlen; * Copy that folding state from window "wp_from" to window "wp_to". */ void -copyFoldingState(wp_from, wp_to) - win_T *wp_from; - win_T *wp_to; +copyFoldingState(win_T *wp_from, win_T *wp_to) { wp_to->w_fold_manual = wp_from->w_fold_manual; 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. */ int -hasAnyFolding(win) - win_T *win; +hasAnyFolding(win_T *win) { /* very simple now, but can become more complex later */ return (win->w_p_fen @@ -131,23 +128,20 @@ hasAnyFolding(win) * lnum of the sequence of folded lines (skipped when NULL). */ int -hasFolding(lnum, firstp, lastp) - linenr_T lnum; - linenr_T *firstp; - linenr_T *lastp; +hasFolding(linenr_T lnum, linenr_T *firstp, linenr_T *lastp) { return hasFoldingWin(curwin, lnum, firstp, lastp, TRUE, NULL); } /* hasFoldingWin() {{{2 */ int -hasFoldingWin(win, lnum, firstp, lastp, cache, infop) - win_T *win; - linenr_T lnum; - linenr_T *firstp; - linenr_T *lastp; - int cache; /* when TRUE: use cached values of window */ - foldinfo_T *infop; /* where to store fold info */ +hasFoldingWin( + win_T *win, + linenr_T lnum, + linenr_T *firstp, + linenr_T *lastp, + int cache, /* when TRUE: use cached values of window */ + foldinfo_T *infop) /* where to store fold info */ { int had_folded = FALSE; linenr_T first = 0; @@ -254,8 +248,7 @@ hasFoldingWin(win, lnum, firstp, lastp, * Return fold level at line number "lnum" in the current window. */ int -foldLevel(lnum) - linenr_T lnum; +foldLevel(linenr_T lnum) { /* While updating the folds lines between invalid_top and invalid_bot have * 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. */ int -lineFolded(win, lnum) - win_T *win; - linenr_T lnum; +lineFolded(win_T *win, linenr_T lnum) { 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. */ long -foldedCount(win, lnum, infop) - win_T *win; - linenr_T lnum; - foldinfo_T *infop; +foldedCount(win_T *win, linenr_T lnum, foldinfo_T *infop) { linenr_T last; @@ -315,8 +303,7 @@ foldedCount(win, lnum, infop) * Return TRUE if 'foldmethod' is "manual" */ int -foldmethodIsManual(wp) - win_T *wp; +foldmethodIsManual(win_T *wp) { return (wp->w_p_fdm[3] == 'u'); } @@ -326,8 +313,7 @@ foldmethodIsManual(wp) * Return TRUE if 'foldmethod' is "indent" */ int -foldmethodIsIndent(wp) - win_T *wp; +foldmethodIsIndent(win_T *wp) { return (wp->w_p_fdm[0] == 'i'); } @@ -337,8 +323,7 @@ foldmethodIsIndent(wp) * Return TRUE if 'foldmethod' is "expr" */ int -foldmethodIsExpr(wp) - win_T *wp; +foldmethodIsExpr(win_T *wp) { return (wp->w_p_fdm[1] == 'x'); } @@ -348,8 +333,7 @@ foldmethodIsExpr(wp) * Return TRUE if 'foldmethod' is "marker" */ int -foldmethodIsMarker(wp) - win_T *wp; +foldmethodIsMarker(win_T *wp) { return (wp->w_p_fdm[2] == 'r'); } @@ -359,8 +343,7 @@ foldmethodIsMarker(wp) * Return TRUE if 'foldmethod' is "syntax" */ int -foldmethodIsSyntax(wp) - win_T *wp; +foldmethodIsSyntax(win_T *wp) { return (wp->w_p_fdm[0] == 's'); } @@ -370,8 +353,7 @@ foldmethodIsSyntax(wp) * Return TRUE if 'foldmethod' is "diff" */ int -foldmethodIsDiff(wp) - win_T *wp; +foldmethodIsDiff(win_T *wp) { return (wp->w_p_fdm[0] == 'd'); } @@ -382,9 +364,7 @@ foldmethodIsDiff(wp) * Repeat "count" times. */ void -closeFold(lnum, count) - linenr_T lnum; - long count; +closeFold(linenr_T lnum, long count) { setFoldRepeat(lnum, count, FALSE); } @@ -394,8 +374,7 @@ closeFold(lnum, count) * Close fold for current window at line "lnum" recursively. */ void -closeFoldRecurse(lnum) - linenr_T lnum; +closeFoldRecurse(linenr_T lnum) { (void)setManualFold(lnum, FALSE, TRUE, NULL); } @@ -406,12 +385,12 @@ closeFoldRecurse(lnum) * Used for "zo", "zO", "zc" and "zC" in Visual mode. */ void -opFoldRange(first, last, opening, recurse, had_visual) - linenr_T first; - linenr_T last; - int opening; /* TRUE to open, FALSE to close */ - int recurse; /* TRUE to do it recursively */ - int had_visual; /* TRUE when Visual selection used */ +opFoldRange( + linenr_T first, + linenr_T last, + int opening, /* TRUE to open, FALSE to close */ + int recurse, /* TRUE to do it recursively */ + int had_visual) /* TRUE when Visual selection used */ { int done = DONE_NOTHING; /* avoid error messages */ linenr_T lnum; @@ -443,9 +422,7 @@ opFoldRange(first, last, opening, recurs * Repeat "count" times. */ void -openFold(lnum, count) - linenr_T lnum; - long count; +openFold(linenr_T lnum, long count) { setFoldRepeat(lnum, count, TRUE); } @@ -455,8 +432,7 @@ openFold(lnum, count) * Open fold for current window at line "lnum" recursively. */ void -openFoldRecurse(lnum) - linenr_T lnum; +openFoldRecurse(linenr_T lnum) { (void)setManualFold(lnum, TRUE, TRUE, NULL); } @@ -466,7 +442,7 @@ openFoldRecurse(lnum) * Open folds until the cursor line is not in a closed fold. */ void -foldOpenCursor() +foldOpenCursor(void) { int done; @@ -486,7 +462,7 @@ foldOpenCursor() * Set new foldlevel for current window. */ void -newFoldLevel() +newFoldLevel(void) { newFoldLevelWin(curwin); @@ -511,8 +487,7 @@ newFoldLevel() } static void -newFoldLevelWin(wp) - win_T *wp; +newFoldLevelWin(win_T *wp) { fold_T *fp; int i; @@ -536,7 +511,7 @@ newFoldLevelWin(wp) * Apply 'foldlevel' to all folds that don't contain the cursor. */ void -foldCheckClose() +foldCheckClose(void) { if (*p_fcl != NUL) /* can only be "all" right now */ { @@ -549,10 +524,7 @@ foldCheckClose() /* checkCloseRec() {{{2 */ static int -checkCloseRec(gap, lnum, level) - garray_T *gap; - linenr_T lnum; - int level; +checkCloseRec(garray_T *gap, linenr_T lnum, int level) { fold_T *fp; int retval = FALSE; @@ -584,8 +556,7 @@ checkCloseRec(gap, lnum, level) * Give an error message and return FALSE if not. */ int -foldManualAllowed(create) - int create; +foldManualAllowed(int create) { if (foldmethodIsManual(curwin) || foldmethodIsMarker(curwin)) return TRUE; @@ -602,9 +573,7 @@ foldManualAllowed(create) * window. */ void -foldCreate(start, end) - linenr_T start; - linenr_T end; +foldCreate(linenr_T start, linenr_T end) { fold_T *fp; garray_T *gap; @@ -729,11 +698,11 @@ foldCreate(start, end) * When "recursive" is TRUE delete recursively. */ void -deleteFold(start, end, recursive, had_visual) - linenr_T start; - linenr_T end; - int recursive; - int had_visual; /* TRUE when Visual selection used */ +deleteFold( + linenr_T start, + linenr_T end, + int recursive, + int had_visual) /* TRUE when Visual selection used */ { garray_T *gap; fold_T *fp; @@ -824,8 +793,7 @@ deleteFold(start, end, recursive, had_vi * Remove all folding for window "win". */ void -clearFolding(win) - win_T *win; +clearFolding(win_T *win) { deleteFoldRecurse(&win->w_folds); win->w_foldinvalid = FALSE; @@ -839,10 +807,7 @@ clearFolding(win) * The changes in lines from top to bot (inclusive). */ void -foldUpdate(wp, top, bot) - win_T *wp; - linenr_T top; - linenr_T bot; +foldUpdate(win_T *wp, linenr_T top, linenr_T bot) { fold_T *fp; @@ -880,8 +845,7 @@ foldUpdate(wp, top, bot) * every time a setting is changed or a syntax item is added. */ void -foldUpdateAll(win) - win_T *win; +foldUpdateAll(win_T *win) { win->w_foldinvalid = TRUE; redraw_win_later(win, NOT_VALID); @@ -894,10 +858,10 @@ foldUpdateAll(win) * If not moved return FAIL. */ int -foldMoveTo(updown, dir, count) - int updown; - int dir; /* FORWARD or BACKWARD */ - long count; +foldMoveTo( + int updown, + int dir, /* FORWARD or BACKWARD */ + long count) { long n; int retval = FAIL; @@ -1031,8 +995,7 @@ foldMoveTo(updown, dir, count) * Init the fold info in a new window. */ void -foldInitWin(new_win) - win_T *new_win; +foldInitWin(win_T *new_win) { 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. */ int -find_wl_entry(win, lnum) - win_T *win; - linenr_T lnum; +find_wl_entry(win_T *win, linenr_T lnum) { 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. */ void -foldAdjustVisual() +foldAdjustVisual(void) { pos_T *start, *end; char_u *ptr; @@ -1106,7 +1067,7 @@ foldAdjustVisual() * Move the cursor to the first line of a closed fold. */ void -foldAdjustCursor() +foldAdjustCursor(void) { (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. */ void -cloneFoldGrowArray(from, to) - garray_T *from; - garray_T *to; +cloneFoldGrowArray(garray_T *from, garray_T *to) { int i; fold_T *from_p; @@ -1155,10 +1114,7 @@ cloneFoldGrowArray(from, to) * Returns FALSE when there is no fold that contains "lnum". */ static int -foldFind(gap, lnum, fpp) - garray_T *gap; - linenr_T lnum; - fold_T **fpp; +foldFind(garray_T *gap, linenr_T lnum, fold_T **fpp) { linenr_T low, high; fold_T *fp; @@ -1197,9 +1153,7 @@ foldFind(gap, lnum, fpp) * Return fold level at line number "lnum" in window "wp". */ static int -foldLevelWin(wp, lnum) - win_T *wp; - linenr_T lnum; +foldLevelWin(win_T *wp, linenr_T lnum) { fold_T *fp; 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. */ static void -checkupdate(wp) - win_T *wp; +checkupdate(win_T *wp) { if (wp->w_foldinvalid) { @@ -1242,10 +1195,7 @@ checkupdate(wp) * Repeat "count" times. */ static void -setFoldRepeat(lnum, count, do_open) - linenr_T lnum; - long count; - int do_open; +setFoldRepeat(linenr_T lnum, long count, int do_open) { int done; long n; @@ -1270,11 +1220,11 @@ setFoldRepeat(lnum, count, do_open) * Also does this for other windows in diff mode when needed. */ static linenr_T -setManualFold(lnum, opening, recurse, donep) - linenr_T lnum; - int opening; /* TRUE when opening, FALSE when closing */ - int recurse; /* TRUE when closing/opening recursive */ - int *donep; +setManualFold( + linenr_T lnum, + int opening, /* TRUE when opening, FALSE when closing */ + int recurse, /* TRUE when closing/opening recursive */ + int *donep) { #ifdef FEAT_DIFF if (foldmethodIsDiff(curwin) && curwin->w_p_scb) @@ -1312,12 +1262,12 @@ setManualFold(lnum, opening, recurse, do * It's only valid when "opening" is TRUE! */ static linenr_T -setManualFoldWin(wp, lnum, opening, recurse, donep) - win_T *wp; - linenr_T lnum; - int opening; /* TRUE when opening, FALSE when closing */ - int recurse; /* TRUE when closing/opening recursive */ - int *donep; +setManualFoldWin( + win_T *wp, + linenr_T lnum, + int opening, /* TRUE when opening, FALSE when closing */ + int recurse, /* TRUE when closing/opening recursive */ + int *donep) { fold_T *fp; fold_T *fp2; @@ -1423,8 +1373,7 @@ setManualFoldWin(wp, lnum, opening, recu * Open all nested folds in fold "fpr" recursively. */ static void -foldOpenNested(fpr) - fold_T *fpr; +foldOpenNested(fold_T *fpr) { int i; fold_T *fp; @@ -1444,10 +1393,7 @@ foldOpenNested(fpr) * When "recursive" is FALSE contained folds are moved one level up. */ static void -deleteFoldEntry(gap, idx, recursive) - garray_T *gap; - int idx; - int recursive; +deleteFoldEntry(garray_T *gap, int idx, int recursive) { fold_T *fp; int i; @@ -1501,8 +1447,7 @@ deleteFoldEntry(gap, idx, recursive) * Delete nested folds in a fold. */ void -deleteFoldRecurse(gap) - garray_T *gap; +deleteFoldRecurse(garray_T *gap) { int i; @@ -1516,12 +1461,12 @@ deleteFoldRecurse(gap) * Update line numbers of folds for inserted/deleted lines. */ void -foldMarkAdjust(wp, line1, line2, amount, amount_after) - win_T *wp; - linenr_T line1; - linenr_T line2; - long amount; - long amount_after; +foldMarkAdjust( + win_T *wp, + linenr_T line1, + linenr_T line2, + long amount, + long amount_after) { /* If deleting marks from line1 to line2, but not deleting all those * lines, set line2 so that only deleted lines have their folds removed. */ @@ -1536,12 +1481,12 @@ foldMarkAdjust(wp, line1, line2, amount, /* foldMarkAdjustRecurse() {{{2 */ static void -foldMarkAdjustRecurse(gap, line1, line2, amount, amount_after) - garray_T *gap; - linenr_T line1; - linenr_T line2; - long amount; - long amount_after; +foldMarkAdjustRecurse( + garray_T *gap, + linenr_T line1, + linenr_T line2, + long amount, + long amount_after) { fold_T *fp; int i; @@ -1653,15 +1598,14 @@ foldMarkAdjustRecurse(gap, line1, line2, * current window open. */ int -getDeepestNesting() +getDeepestNesting(void) { checkupdate(curwin); return getDeepestNestingRecurse(&curwin->w_folds); } static int -getDeepestNestingRecurse(gap) - garray_T *gap; +getDeepestNestingRecurse(garray_T *gap) { int i; int level; @@ -1684,13 +1628,13 @@ getDeepestNestingRecurse(gap) * Check if a fold is closed and update the info needed to check nested folds. */ static int -check_closed(win, fp, use_levelp, level, maybe_smallp, lnum_off) - win_T *win; - fold_T *fp; - int *use_levelp; /* TRUE: outer fold had FD_LEVEL */ - int level; /* folding depth */ - int *maybe_smallp; /* TRUE: outer this had fd_small == MAYBE */ - linenr_T lnum_off; /* line number offset for fp->fd_top */ +check_closed( + win_T *win, + fold_T *fp, + int *use_levelp, /* TRUE: outer fold had FD_LEVEL */ + int level, /* folding depth */ + int *maybe_smallp, /* TRUE: outer this had fd_small == MAYBE */ + linenr_T lnum_off) /* line number offset for fp->fd_top */ { int closed = FALSE; @@ -1724,10 +1668,10 @@ check_closed(win, fp, use_levelp, level, * Update fd_small field of fold "fp". */ static void -checkSmall(wp, fp, lnum_off) - win_T *wp; - fold_T *fp; - linenr_T lnum_off; /* offset for fp->fd_top */ +checkSmall( + win_T *wp, + fold_T *fp, + linenr_T lnum_off) /* offset for fp->fd_top */ { int count; int n; @@ -1761,8 +1705,7 @@ checkSmall(wp, fp, lnum_off) * Set small flags in "gap" to MAYBE. */ static void -setSmallMaybe(gap) - garray_T *gap; +setSmallMaybe(garray_T *gap) { int i; fold_T *fp; @@ -1778,9 +1721,7 @@ setSmallMaybe(gap) * window by adding markers. */ static void -foldCreateMarkers(start, end) - linenr_T start; - linenr_T end; +foldCreateMarkers(linenr_T start, linenr_T end) { if (!curbuf->b_p_ma) { @@ -1802,10 +1743,7 @@ foldCreateMarkers(start, end) * Add "marker[markerlen]" in 'commentstring' to line "lnum". */ static void -foldAddMarker(lnum, marker, markerlen) - linenr_T lnum; - char_u *marker; - int markerlen; +foldAddMarker(linenr_T lnum, char_u *marker, int markerlen) { char_u *cms = curbuf->b_p_cms; char_u *line; @@ -1841,10 +1779,10 @@ foldAddMarker(lnum, marker, markerlen) * Delete the markers for a fold, causing it to be deleted. */ static void -deleteFoldMarkers(fp, recursive, lnum_off) - fold_T *fp; - int recursive; - linenr_T lnum_off; /* offset for fp->fd_top */ +deleteFoldMarkers( + fold_T *fp, + int recursive, + linenr_T lnum_off) /* offset for fp->fd_top */ { int i; @@ -1865,10 +1803,7 @@ deleteFoldMarkers(fp, recursive, lnum_of * close-marker. */ static void -foldDelMarker(lnum, marker, markerlen) - linenr_T lnum; - char_u *marker; - int markerlen; +foldDelMarker(linenr_T lnum, char_u *marker, int markerlen) { char_u *line; char_u *newline; @@ -1919,11 +1854,12 @@ foldDelMarker(lnum, marker, markerlen) * result is in allocated memory. */ char_u * -get_foldtext(wp, lnum, lnume, foldinfo, buf) - win_T *wp; - linenr_T lnum, lnume; - foldinfo_T *foldinfo; - char_u *buf; +get_foldtext( + win_T *wp, + linenr_T lnum, + linenr_T lnume, + foldinfo_T *foldinfo, + char_u *buf) { char_u *text = NULL; #ifdef FEAT_EVAL @@ -2033,8 +1969,7 @@ get_foldtext(wp, lnum, lnume, foldinfo, * Remove 'foldmarker' and 'commentstring' from "str" (in-place). */ void -foldtext_cleanup(str) - char_u *str; +foldtext_cleanup(char_u *str) { char_u *cms_start; /* first part or the whole comment */ 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. */ static void -foldUpdateIEMS(wp, top, bot) - win_T *wp; - linenr_T top; - linenr_T bot; +foldUpdateIEMS(win_T *wp, linenr_T top, linenr_T bot) { linenr_T start; linenr_T end; @@ -2417,14 +2349,14 @@ foldUpdateIEMS(wp, top, bot) * updated as a result of a detected change in the fold. */ static linenr_T -foldUpdateIEMSRecurse(gap, level, startlnum, flp, getlevel, bot, topflags) - garray_T *gap; - int level; - linenr_T startlnum; - fline_T *flp; - void (*getlevel)(fline_T *); - linenr_T bot; - int topflags; /* flags used by containing fold */ +foldUpdateIEMSRecurse( + garray_T *gap, + int level, + linenr_T startlnum, + fline_T *flp, + void (*getlevel)(fline_T *), + linenr_T bot, + int topflags) /* flags used by containing fold */ { linenr_T ll; fold_T *fp = NULL; @@ -2831,9 +2763,7 @@ foldUpdateIEMSRecurse(gap, level, startl * Returns OK for success, FAIL for failure. */ static int -foldInsert(gap, i) - garray_T *gap; - int i; +foldInsert(garray_T *gap, int i) { fold_T *fp; @@ -2856,11 +2786,11 @@ foldInsert(gap, i) * "bot"! */ static void -foldSplit(gap, i, top, bot) - garray_T *gap; - int i; - linenr_T top; - linenr_T bot; +foldSplit( + garray_T *gap, + int i, + linenr_T top, + linenr_T bot) { fold_T *fp; fold_T *fp2; @@ -2920,10 +2850,7 @@ foldSplit(gap, i, top, bot) * 6: not changed */ static void -foldRemove(gap, top, bot) - garray_T *gap; - linenr_T top; - linenr_T bot; +foldRemove(garray_T *gap, linenr_T top, linenr_T bot) { fold_T *fp = NULL; @@ -2986,10 +2913,7 @@ foldRemove(gap, top, bot) * Fold entry "fp2" in "gap" is deleted. */ static void -foldMerge(fp1, gap, fp2) - fold_T *fp1; - garray_T *gap; - fold_T *fp2; +foldMerge(fold_T *fp1, garray_T *gap, fold_T *fp2) { fold_T *fp3; fold_T *fp4; @@ -3027,8 +2951,7 @@ foldMerge(fp1, gap, fp2) * Returns a level of -1 if the foldlevel depends on surrounding lines. */ static void -foldlevelIndent(flp) - fline_T *flp; +foldlevelIndent(fline_T *flp) { char_u *s; buf_T *buf; @@ -3064,8 +2987,7 @@ foldlevelIndent(flp) * Doesn't use any caching. */ static void -foldlevelDiff(flp) - fline_T *flp; +foldlevelDiff(fline_T *flp) { if (diff_infold(flp->wp, flp->lnum + flp->off)) flp->lvl = 1; @@ -3081,8 +3003,7 @@ foldlevelDiff(flp) * Returns a level of -1 if the foldlevel depends on surrounding lines. */ static void -foldlevelExpr(flp) - fline_T *flp; +foldlevelExpr(fline_T *flp) { #ifndef FEAT_EVAL flp->start = FALSE; @@ -3184,8 +3105,7 @@ foldlevelExpr(flp) * Relies on the option value to have been checked for correctness already. */ static void -parseMarker(wp) - win_T *wp; +parseMarker(win_T *wp) { foldendmarker = vim_strchr(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. */ static void -foldlevelMarker(flp) - fline_T *flp; +foldlevelMarker(fline_T *flp) { char_u *startmarker; int cstart; @@ -3286,8 +3205,7 @@ foldlevelMarker(flp) * Doesn't use any caching. */ static void -foldlevelSyntax(flp) - fline_T *flp; +foldlevelSyntax(fline_T *flp) { #ifndef FEAT_SYN_HL flp->start = 0; @@ -3323,9 +3241,7 @@ static int put_fold_open_close(FILE *fd, * Return FAIL if writing fails. */ int -put_folds(fd, wp) - FILE *fd; - win_T *wp; +put_folds(FILE *fd, win_T *wp) { if (foldmethodIsManual(wp)) { @@ -3347,10 +3263,7 @@ put_folds(fd, wp) * Returns FAIL when writing failed. */ static int -put_folds_recurse(fd, gap, off) - FILE *fd; - garray_T *gap; - linenr_T off; +put_folds_recurse(FILE *fd, garray_T *gap, linenr_T off) { int i; fold_T *fp; @@ -3376,11 +3289,11 @@ put_folds_recurse(fd, gap, off) * Returns FAIL when writing failed. */ static int -put_foldopen_recurse(fd, wp, gap, off) - FILE *fd; - win_T *wp; - garray_T *gap; - linenr_T off; +put_foldopen_recurse( + FILE *fd, + win_T *wp, + garray_T *gap, + linenr_T off) { int i; int level; @@ -3433,10 +3346,7 @@ put_foldopen_recurse(fd, wp, gap, off) * Returns FAIL when writing failed. */ static int -put_fold_open_close(fd, fp, off) - FILE *fd; - fold_T *fp; - linenr_T off; +put_fold_open_close(FILE *fd, fold_T *fp, linenr_T off) { if (fprintf(fd, "%ld", fp->fd_top + off) < 0 || put_eol(fd) == FAIL diff --git a/src/getchar.c b/src/getchar.c --- a/src/getchar.c +++ b/src/getchar.c @@ -137,8 +137,7 @@ static char_u *eval_map_expr(char_u *str * Free and clear a buffer. */ void -free_buff(buf) - buffheader_T *buf; +free_buff(buffheader_T *buf) { buffblock_T *p, *np; @@ -155,9 +154,9 @@ free_buff(buf) * K_SPECIAL and CSI in the returned string are escaped. */ static char_u * -get_buffcont(buffer, dozero) - buffheader_T *buffer; - int dozero; /* count == zero is not an error */ +get_buffcont( + buffheader_T *buffer, + int dozero) /* count == zero is not an error */ { long_u count = 0; char_u *p = NULL; @@ -186,7 +185,7 @@ get_buffcont(buffer, dozero) * K_SPECIAL and CSI in the returned string are escaped. */ char_u * -get_recorded() +get_recorded(void) { char_u *p; size_t len; @@ -220,7 +219,7 @@ get_recorded() * K_SPECIAL and CSI in the returned string are escaped. */ char_u * -get_inserted() +get_inserted(void) { return get_buffcont(&redobuff, FALSE); } @@ -230,10 +229,10 @@ get_inserted() * K_SPECIAL and CSI should have been escaped already. */ static void -add_buff(buf, s, slen) - buffheader_T *buf; - char_u *s; - long slen; /* length of "s" or -1 */ +add_buff( + buffheader_T *buf, + char_u *s, + long slen) /* length of "s" or -1 */ { buffblock_T *p; long_u len; @@ -289,9 +288,7 @@ add_buff(buf, s, slen) * Add number "n" to buffer "buf". */ static void -add_num_buff(buf, n) - buffheader_T *buf; - long n; +add_num_buff(buffheader_T *buf, long n) { char_u number[32]; @@ -304,9 +301,7 @@ add_num_buff(buf, n) * Translates special keys, NUL, CSI, K_SPECIAL and multibyte characters. */ static void -add_char_buff(buf, c) - buffheader_T *buf; - int c; +add_char_buff(buffheader_T *buf, int c) { #ifdef FEAT_MBYTE char_u bytes[MB_MAXBYTES + 1]; @@ -368,8 +363,7 @@ static buffheader_T readbuf2 = {{NULL, { * No translation is done K_SPECIAL and CSI are escaped. */ static int -read_readbuffers(advance) - int advance; +read_readbuffers(int advance) { int c; @@ -380,9 +374,7 @@ read_readbuffers(advance) } static int -read_readbuf(buf, advance) - buffheader_T *buf; - int advance; +read_readbuf(buffheader_T *buf, int advance) { char_u c; buffblock_T *curr; @@ -409,7 +401,7 @@ read_readbuf(buf, advance) * Prepare the read buffers for reading (if they contain something). */ static void -start_stuff() +start_stuff(void) { if (readbuf1.bh_first.b_next != NULL) { @@ -427,7 +419,7 @@ start_stuff() * Return TRUE if the stuff buffer is empty. */ int -stuff_empty() +stuff_empty(void) { return (readbuf1.bh_first.b_next == NULL && readbuf2.bh_first.b_next == NULL); @@ -438,7 +430,7 @@ stuff_empty() * redbuf2. */ int -readbuf1_empty() +readbuf1_empty(void) { return (readbuf1.bh_first.b_next == NULL); } @@ -447,8 +439,7 @@ readbuf1_empty() * Set a typeahead character that won't be flushed. */ void -typeahead_noflush(c) - int c; +typeahead_noflush(int c) { typeahead_char = c; } @@ -459,8 +450,7 @@ typeahead_noflush(c) * flush all typeahead characters (used when interrupted by a CTRL-C). */ void -flush_buffers(flush_typeahead) - int flush_typeahead; +flush_buffers(int flush_typeahead) { init_typebuf(); @@ -497,7 +487,7 @@ flush_buffers(flush_typeahead) * This is used for the CTRL-O <.> command in insert mode. */ void -ResetRedobuff() +ResetRedobuff(void) { if (!block_redo) { @@ -512,7 +502,7 @@ ResetRedobuff() * buffer. */ void -CancelRedo() +CancelRedo(void) { if (!block_redo) { @@ -533,7 +523,7 @@ CancelRedo() static int save_level = 0; void -saveRedobuff() +saveRedobuff(void) { char_u *s; @@ -559,7 +549,7 @@ saveRedobuff() * Used after executing autocommands and user functions. */ void -restoreRedobuff() +restoreRedobuff(void) { if (--save_level == 0) { @@ -576,8 +566,7 @@ restoreRedobuff() * K_SPECIAL and CSI should already have been escaped. */ void -AppendToRedobuff(s) - char_u *s; +AppendToRedobuff(char_u *s) { if (!block_redo) add_buff(&redobuff, s, -1L); @@ -588,9 +577,9 @@ AppendToRedobuff(s) * K_SPECIAL and CSI are escaped as well. */ void -AppendToRedobuffLit(str, len) - char_u *str; - int len; /* length of "str" or -1 for up to the NUL */ +AppendToRedobuffLit( + char_u *str, + int len) /* length of "str" or -1 for up to the NUL */ { char_u *s = str; int c; @@ -649,8 +638,7 @@ AppendToRedobuffLit(str, len) * Translates special keys, NUL, CSI, K_SPECIAL and multibyte characters. */ void -AppendCharToRedobuff(c) - int c; +AppendCharToRedobuff(int c) { if (!block_redo) add_char_buff(&redobuff, c); @@ -660,8 +648,7 @@ AppendCharToRedobuff(c) * Append a number to the redo buffer. */ void -AppendNumberToRedobuff(n) - long n; +AppendNumberToRedobuff(long n) { if (!block_redo) add_num_buff(&redobuff, n); @@ -672,8 +659,7 @@ AppendNumberToRedobuff(n) * CSI and K_SPECIAL must already have been escaped. */ void -stuffReadbuff(s) - char_u *s; +stuffReadbuff(char_u *s) { add_buff(&readbuf1, s, -1L); } @@ -683,16 +669,13 @@ stuffReadbuff(s) * CSI and K_SPECIAL must already have been escaped. */ void -stuffRedoReadbuff(s) - char_u *s; +stuffRedoReadbuff(char_u *s) { add_buff(&readbuf2, s, -1L); } void -stuffReadbuffLen(s, len) - char_u *s; - long len; +stuffReadbuffLen(char_u *s, long len) { add_buff(&readbuf1, s, len); } @@ -704,8 +687,7 @@ stuffReadbuffLen(s, len) * Change CR, LF and ESC into a space. */ void -stuffReadbuffSpec(s) - char_u *s; +stuffReadbuffSpec(char_u *s) { int c; @@ -737,8 +719,7 @@ stuffReadbuffSpec(s) * Translates special keys, NUL, CSI, K_SPECIAL and multibyte characters. */ void -stuffcharReadbuff(c) - int c; +stuffcharReadbuff(int c) { add_char_buff(&readbuf1, c); } @@ -747,8 +728,7 @@ stuffcharReadbuff(c) * Append a number to the stuff buffer. */ void -stuffnumReadbuff(n) - long n; +stuffnumReadbuff(long n) { add_num_buff(&readbuf1, n); } @@ -762,9 +742,7 @@ stuffnumReadbuff(n) * If old is TRUE, use old_redobuff instead of redobuff. */ static int -read_redo(init, old_redo) - int init; - int old_redo; +read_redo(int init, int old_redo) { static buffblock_T *bp; static char_u *p; @@ -837,8 +815,7 @@ read_redo(init, old_redo) * The escaped K_SPECIAL and CSI are copied without translation. */ static void -copy_redo(old_redo) - int old_redo; +copy_redo(int old_redo) { int c; @@ -856,9 +833,7 @@ copy_redo(old_redo) * return FAIL for failure, OK otherwise */ int -start_redo(count, old_redo) - long count; - int old_redo; +start_redo(long count, int old_redo) { int c; @@ -911,7 +886,7 @@ start_redo(count, old_redo) * return FAIL for failure, OK otherwise */ int -start_redo_ins() +start_redo_ins(void) { int c; @@ -937,7 +912,7 @@ start_redo_ins() } void -stop_redo_ins() +stop_redo_ins(void) { block_redo = FALSE; } @@ -948,7 +923,7 @@ stop_redo_ins() * be impossible to type anything. */ static void -init_typebuf() +init_typebuf(void) { if (typebuf.tb_buf == NULL) { @@ -981,12 +956,12 @@ init_typebuf() * return FAIL for failure, OK otherwise */ int -ins_typebuf(str, noremap, offset, nottyped, silent) - char_u *str; - int noremap; - int offset; - int nottyped; - int silent; +ins_typebuf( + char_u *str, + int noremap, + int offset, + int nottyped, + int silent) { char_u *s1, *s2; int newlen; @@ -1114,8 +1089,7 @@ ins_typebuf(str, noremap, offset, nottyp * the char. */ void -ins_char_typebuf(c) - int c; +ins_char_typebuf(int c) { #ifdef FEAT_MBYTE char_u buf[MB_MAXBYTES + 1]; @@ -1151,8 +1125,8 @@ ins_char_typebuf(c) * that was just added. */ int -typebuf_changed(tb_change_cnt) - int tb_change_cnt; /* old value of typebuf.tb_change_cnt */ +typebuf_changed( + int tb_change_cnt) /* old value of typebuf.tb_change_cnt */ { return (tb_change_cnt != 0 && (typebuf.tb_change_cnt != tb_change_cnt #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"). */ int -typebuf_typed() +typebuf_typed(void) { return typebuf.tb_maplen == 0; } @@ -1175,7 +1149,7 @@ typebuf_typed() * Return the number of characters that are mapped (or not typed). */ int -typebuf_maplen() +typebuf_maplen(void) { return typebuf.tb_maplen; } @@ -1184,9 +1158,7 @@ typebuf_maplen() * remove "len" characters from typebuf.tb_buf[typebuf.tb_off + offset] */ void -del_typebuf(len, offset) - int len; - int offset; +del_typebuf(int len, int offset) { int i; @@ -1264,9 +1236,7 @@ del_typebuf(len, offset) * If recording is on put the character in the recordbuffer. */ static void -gotchars(chars, len) - char_u *chars; - int len; +gotchars(char_u *chars, int len) { char_u *s = chars; int c; @@ -1311,7 +1281,7 @@ gotchars(chars, len) * - When no_u_sync is non-zero. */ static void -may_sync_undo() +may_sync_undo(void) { if ((!(State & (INSERT + CMDLINE)) || arrow_used) && scriptin[curscript] == NULL) @@ -1323,7 +1293,7 @@ may_sync_undo() * Returns FAIL when out of memory. */ int -alloc_typebuf() +alloc_typebuf(void) { typebuf.tb_buf = alloc(TYPELEN_INIT); typebuf.tb_noremap = alloc(TYPELEN_INIT); @@ -1347,7 +1317,7 @@ alloc_typebuf() * Free the buffers of "typebuf". */ void -free_typebuf() +free_typebuf(void) { if (typebuf.tb_buf == typebuf_init) EMSG2(_(e_intern2), "Free typebuf 1"); @@ -1366,7 +1336,7 @@ free_typebuf() static typebuf_T saved_typebuf[NSCRIPT]; int -save_typebuf() +save_typebuf(void) { init_typebuf(); saved_typebuf[curscript] = typebuf; @@ -1392,8 +1362,7 @@ static int old_mouse_col; /* mouse_col r * Save all three kinds of typeahead, so that the user must type at a prompt. */ void -save_typeahead(tp) - tasave_T *tp; +save_typeahead(tasave_T *tp) { tp->save_typebuf = typebuf; tp->typebuf_valid = (alloc_typebuf() == OK); @@ -1418,8 +1387,7 @@ save_typeahead(tp) * The allocated memory is freed, can only be called once! */ void -restore_typeahead(tp) - tasave_T *tp; +restore_typeahead(tasave_T *tp) { if (tp->typebuf_valid) { @@ -1444,9 +1412,9 @@ restore_typeahead(tp) * Open a new script file for the ":source!" command. */ void -openscript(name, directly) - char_u *name; - int directly; /* when TRUE execute directly */ +openscript( + char_u *name, + int directly) /* when TRUE execute directly */ { if (curscript + 1 == NSCRIPT) { @@ -1517,7 +1485,7 @@ openscript(name, directly) * Close the currently active input script. */ static void -closescript() +closescript(void) { free_typebuf(); typebuf = saved_typebuf[curscript]; @@ -1530,7 +1498,7 @@ closescript() #if defined(EXITFREE) || defined(PROTO) void -close_all_scripts() +close_all_scripts(void) { while (scriptin[0] != NULL) closescript(); @@ -1542,7 +1510,7 @@ close_all_scripts() * Return TRUE when reading keys from a script file. */ int -using_script() +using_script(void) { return scriptin[curscript] != NULL; } @@ -1553,7 +1521,7 @@ using_script() * waiting 'updatetime' for a character to arrive. */ void -before_blocking() +before_blocking(void) { updatescript(0); #ifdef FEAT_EVAL @@ -1570,8 +1538,7 @@ before_blocking() * characters reaches 'updatecount' and 'updatecount' is non-zero. */ void -updatescript(c) - int c; +updatescript(int c) { static int count = 0; @@ -1594,7 +1561,7 @@ updatescript(c) * Returns the modifiers in the global "mod_mask". */ int -vgetc() +vgetc(void) { int c, c2; #ifdef FEAT_MBYTE @@ -1839,7 +1806,7 @@ vgetc() * directly from the user (ignoring typeahead). */ int -safe_vgetc() +safe_vgetc(void) { int c; @@ -1854,7 +1821,7 @@ safe_vgetc() * Also ignore scrollbar events. */ int -plain_vgetc() +plain_vgetc(void) { int c; @@ -1871,7 +1838,7 @@ plain_vgetc() * character is not valid!. */ int -vpeekc() +vpeekc(void) { if (old_char != -1) return old_char; @@ -1884,7 +1851,7 @@ vpeekc() * codes. */ int -vpeekc_nomap() +vpeekc_nomap(void) { int c; @@ -1904,7 +1871,7 @@ vpeekc_nomap() * buffer, it must be an ESC that is recognized as the start of a key code. */ int -vpeekc_any() +vpeekc_any(void) { int c; @@ -1920,7 +1887,7 @@ vpeekc_any() * Return TRUE if a character is available, FALSE otherwise. */ int -char_avail() +char_avail(void) { int retval; @@ -1930,9 +1897,11 @@ char_avail() return (retval != NUL); } +/* + * unget one character (can only be done once!) + */ void -vungetc(c) /* unget one character (can only be done once!) */ - int c; +vungetc(int c) { old_char = c; old_mod_mask = mod_mask; @@ -1966,8 +1935,7 @@ vungetc(c) /* unget one character (can o * K_SPECIAL and CSI may be escaped, need to get two more bytes then. */ static int -vgetorpeek(advance) - int advance; +vgetorpeek(int advance) { int c, c1; int keylen; @@ -2988,11 +2956,11 @@ vgetorpeek(advance) * Return -1 when end of input script reached. */ int -inchar(buf, maxlen, wait_time, tb_change_cnt) - char_u *buf; - int maxlen; - long wait_time; /* milli seconds */ - int tb_change_cnt; +inchar( + char_u *buf, + int maxlen, + long wait_time, /* milli seconds */ + int tb_change_cnt) { int len = 0; /* init for GCC */ int retesc = FALSE; /* return ESC with gotint */ @@ -3114,10 +3082,10 @@ inchar(buf, maxlen, wait_time, tb_change * Returns the new length. */ int -fix_input_buffer(buf, len, script) - char_u *buf; - int len; - int script; /* TRUE when reading from a script */ +fix_input_buffer( + char_u *buf, + int len, + int script) /* TRUE when reading from a script */ { int i; char_u *p = buf; @@ -3182,7 +3150,7 @@ fix_input_buffer(buf, len, script) * waiting for input to arrive. */ int -input_available() +input_available(void) { return (!vim_is_input_buf_empty() # if defined(FEAT_CLIENTSERVER) || defined(FEAT_EVAL) @@ -3231,11 +3199,11 @@ input_available() * 5 for entry not unique */ int -do_map(maptype, arg, mode, abbrev) - int maptype; - char_u *arg; - int mode; - int abbrev; /* not a mapping but an abbreviation */ +do_map( + int maptype, + char_u *arg, + int mode, + int abbrev) /* not a mapping but an abbreviation */ { char_u *keys; mapblock_T *mp, **mpp; @@ -3810,8 +3778,7 @@ theend: * "mpp" is a pointer to the m_next field of the PREVIOUS entry! */ static void -map_free(mpp) - mapblock_T **mpp; +map_free(mapblock_T **mpp) { mapblock_T *mp; @@ -3827,7 +3794,7 @@ map_free(mpp) * Initialize maphash[] for first use. */ static void -validate_maphash() +validate_maphash(void) { if (!maphash_valid) { @@ -3840,9 +3807,7 @@ validate_maphash() * Get the mapping mode from the command name. */ int -get_map_mode(cmdp, forceit) - char_u **cmdp; - int forceit; +get_map_mode(char_u **cmdp, int forceit) { char_u *p; int modec; @@ -3884,11 +3849,11 @@ get_map_mode(cmdp, forceit) * 'abbr' should be FALSE for mappings, TRUE for abbreviations. */ void -map_clear(cmdp, arg, forceit, abbr) - char_u *cmdp; - char_u *arg UNUSED; - int forceit; - int abbr; +map_clear( + char_u *cmdp, + char_u *arg UNUSED, + int forceit, + int abbr) { int mode; #ifdef FEAT_LOCALMAP @@ -3916,11 +3881,11 @@ map_clear(cmdp, arg, forceit, abbr) * Clear all mappings in "mode". */ void -map_clear_int(buf, mode, local, abbr) - buf_T *buf UNUSED; /* buffer for local mappings */ - int mode; /* mode in which to delete */ - int local UNUSED; /* TRUE for buffer-local mappings */ - int abbr; /* TRUE for abbreviations */ +map_clear_int( + buf_T *buf UNUSED, /* buffer for local mappings */ + int mode, /* mode in which to delete */ + int local UNUSED, /* TRUE for buffer-local mappings */ + int abbr) /* TRUE for abbreviations */ { mapblock_T *mp, **mpp; int hash; @@ -3993,8 +3958,7 @@ map_clear_int(buf, mode, local, abbr) * Returns NULL when out of memory. */ char_u * -map_mode_to_chars(mode) - int mode; +map_mode_to_chars(int mode) { garray_T mapmode; @@ -4033,9 +3997,9 @@ map_mode_to_chars(mode) } static void -showmap(mp, local) - mapblock_T *mp; - int local; /* TRUE for buffer-local map */ +showmap( + mapblock_T *mp, + int local) /* TRUE for buffer-local map */ { int len = 1; char_u *mapchars; @@ -4108,10 +4072,7 @@ showmap(mp, local) * Also checks mappings local to the current buffer. */ int -map_to_exists(str, modechars, abbr) - char_u *str; - char_u *modechars; - int abbr; +map_to_exists(char_u *str, char_u *modechars, int abbr) { int mode = 0; char_u *rhs; @@ -4149,10 +4110,7 @@ map_to_exists(str, modechars, abbr) * Also checks mappings local to the current buffer. */ int -map_to_exists_mode(rhs, mode, abbr) - char_u *rhs; - int mode; - int abbr; +map_to_exists_mode(char_u *rhs, int mode, int abbr) { mapblock_T *mp; int hash; @@ -4216,14 +4174,14 @@ static int expand_buffer = FALSE; * or abbreviation names. */ char_u * -set_context_in_map_cmd(xp, cmd, arg, forceit, isabbrev, isunmap, cmdidx) - expand_T *xp; - char_u *cmd; - char_u *arg; - int forceit; /* TRUE if '!' given */ - int isabbrev; /* TRUE if abbreviation */ - int isunmap; /* TRUE if unmap/unabbrev command */ - cmdidx_T cmdidx; +set_context_in_map_cmd( + expand_T *xp, + char_u *cmd, + char_u *arg, + int forceit, /* TRUE if '!' given */ + int isabbrev, /* TRUE if abbreviation */ + int isunmap, /* TRUE if unmap/unabbrev command */ + cmdidx_T cmdidx) { if (forceit && cmdidx != CMD_map && cmdidx != CMD_unmap) xp->xp_context = EXPAND_NOTHING; @@ -4293,10 +4251,10 @@ set_context_in_map_cmd(xp, cmd, arg, for * Return OK if matches found, FAIL otherwise. */ int -ExpandMappings(regmatch, num_file, file) - regmatch_T *regmatch; - int *num_file; - char_u ***file; +ExpandMappings( + regmatch_T *regmatch, + int *num_file, + char_u ***file) { mapblock_T *mp; int hash; @@ -4441,11 +4399,11 @@ ExpandMappings(regmatch, num_file, file) * return TRUE if there is an abbreviation, FALSE if not */ int -check_abbr(c, ptr, col, mincol) - int c; - char_u *ptr; - int col; - int mincol; +check_abbr( + int c, + char_u *ptr, + int col, + int mincol) { int len; int scol; /* starting column of the abbr. */ @@ -4651,9 +4609,9 @@ check_abbr(c, ptr, col, mincol) * special characters. */ static char_u * -eval_map_expr(str, c) - char_u *str; - int c; /* NUL or typed character for abbreviation */ +eval_map_expr( + char_u *str, + int c) /* NUL or typed character for abbreviation */ { char_u *res; char_u *p; @@ -4715,8 +4673,8 @@ eval_map_expr(str, c) * Returns NULL when out of memory. */ char_u * -vim_strsave_escape_csi(p) - char_u *p; +vim_strsave_escape_csi( + char_u *p) { char_u *res; char_u *s, *d; @@ -4765,8 +4723,7 @@ vim_strsave_escape_csi(p) * vim_strsave_escape_csi(). Works in-place. */ void -vim_unescape_csi(p) - char_u *p; +vim_unescape_csi(char_u *p) { char_u *s = p, *d = p; @@ -4794,9 +4751,9 @@ vim_unescape_csi(p) * Return FAIL on error, OK otherwise. */ int -makemap(fd, buf) - FILE *fd; - buf_T *buf; /* buffer for local mappings or NULL */ +makemap( + FILE *fd, + buf_T *buf) /* buffer for local mappings or NULL */ { mapblock_T *mp; char_u c1, c2, c3; @@ -5007,10 +4964,7 @@ makemap(fd, buf) * return FAIL for failure, OK otherwise */ int -put_escstr(fd, strstart, what) - FILE *fd; - char_u *strstart; - int what; +put_escstr(FILE *fd, char_u *strstart, int what) { char_u *str = strstart; int c; @@ -5123,7 +5077,7 @@ put_escstr(fd, strstart, what) * Used after ":set term=xxx". */ void -check_map_keycodes() +check_map_keycodes(void) { mapblock_T *mp; char_u *p; @@ -5215,14 +5169,14 @@ check_map_keycodes() * NULL when no mapping found. */ char_u * -check_map(keys, mode, exact, ign_mod, abbr, mp_ptr, local_ptr) - char_u *keys; - int mode; - int exact; /* require exact match */ - int ign_mod; /* ignore preceding modifier */ - int abbr; /* do abbreviations */ - mapblock_T **mp_ptr; /* return: pointer to mapblock or NULL */ - int *local_ptr; /* return: buffer-local mapping or NULL */ +check_map( + char_u *keys, + int mode, + int exact, /* require exact match */ + int ign_mod, /* ignore preceding modifier */ + int abbr, /* do abbreviations */ + mapblock_T **mp_ptr, /* return: pointer to mapblock or NULL */ + int *local_ptr) /* return: buffer-local mapping or NULL */ { int hash; int len, minlen; @@ -5378,7 +5332,7 @@ static struct initmap * Set up default mappings. */ void -init_mappings() +init_mappings(void) { #if defined(MSDOS) || defined(MSWIN) ||defined(MACOS) int i; @@ -5395,9 +5349,7 @@ init_mappings() * Need to put string in allocated memory, because do_map() will modify it. */ void -add_map(map, mode) - char_u *map; - int mode; +add_map(char_u *map, int mode) { char_u *s; char_u *cpo_save = p_cpo; diff --git a/src/gui.c b/src/gui.c --- a/src/gui.c +++ b/src/gui.c @@ -73,7 +73,7 @@ static int can_update_cursor = TRUE; /* * recursive call. */ void -gui_start() +gui_start(void) { char_u *old_term; static int recursive = 0; @@ -152,7 +152,7 @@ gui_start() * full_screen will be set to TRUE again by a successful termcapinit(). */ static void -gui_attempt_start() +gui_attempt_start(void) { static int recursive = 0; @@ -204,7 +204,7 @@ gui_attempt_start() * and the child will return. */ static void -gui_do_fork() +gui_do_fork(void) { int pipefd[2]; /* pipe between parent and child */ 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 */ void -gui_prepare(argc, argv) - int *argc; - char **argv; +gui_prepare(int *argc, char **argv) { gui.in_use = 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. */ int -gui_init_check() +gui_init_check(void) { static int result = MAYBE; @@ -461,7 +459,7 @@ gui_init_check() * This is the call which starts the GUI. */ void -gui_init() +gui_init(void) { win_T *wp; static int recursive = 0; @@ -789,8 +787,7 @@ error: void -gui_exit(rc) - int rc; +gui_exit(int rc) { /* don't free the fonts, it leads to a BUS error * richard@whitequeen.com Jul 99 */ @@ -809,7 +806,7 @@ gui_exit(rc) * When this function returns, Vim should NOT exit! */ void -gui_shell_closed() +gui_shell_closed(void) { cmdmod_T save_cmdmod; @@ -843,9 +840,7 @@ gui_shell_closed() * the fonts are unchanged. */ int -gui_init_font(font_list, fontset) - char_u *font_list; - int fontset UNUSED; +gui_init_font(char_u *font_list, int fontset UNUSED) { #define FONTLEN 320 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". */ static void -set_guifontwide(name) - char_u *name; +set_guifontwide(char_u *name) { int i = 0; 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. */ int -gui_get_wide_font() +gui_get_wide_font(void) { GuiFont font = NOFONT; char_u font_name[FONTLEN]; @@ -1024,9 +1018,7 @@ gui_get_wide_font() #endif void -gui_set_cursor(row, col) - int row; - int col; +gui_set_cursor(int row, int col) { gui.row = row; gui.col = col; @@ -1036,7 +1028,7 @@ gui_set_cursor(row, col) * gui_check_pos - check if the cursor is on the screen. */ static void -gui_check_pos() +gui_check_pos(void) { if (gui.row >= screen_Rows) gui.row = screen_Rows - 1; @@ -1052,9 +1044,9 @@ gui_check_pos() * otherwise this goes wrong. May need to call out_flush() first. */ void -gui_update_cursor(force, clear_selection) - int force; /* when TRUE, update even when not moved */ - int clear_selection;/* clear selection under cursor */ +gui_update_cursor( + int force, /* when TRUE, update even when not moved */ + int clear_selection)/* clear selection under cursor */ { int cur_width = 0; int cur_height = 0; @@ -1301,7 +1293,7 @@ gui_update_cursor(force, clear_selection #if defined(FEAT_MENU) || defined(PROTO) void -gui_position_menu() +gui_position_menu(void) { # if !defined(FEAT_GUI_GTK) && !defined(FEAT_GUI_MOTIF) if (gui.menu_is_active && gui.in_use) @@ -1315,8 +1307,7 @@ gui_position_menu() * scrollbars are NOT handled here. See gui_update_scrollbars(). */ static void -gui_position_components(total_width) - int total_width UNUSED; +gui_position_components(int total_width UNUSED) { int text_area_x; 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. */ int -gui_get_base_width() +gui_get_base_width(void) { 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. */ int -gui_get_base_height() +gui_get_base_height(void) { int base_height; @@ -1449,9 +1440,7 @@ gui_get_base_height() * the new width and height of the shell in pixels. */ void -gui_resize_shell(pixel_width, pixel_height) - int pixel_width; - int pixel_height; +gui_resize_shell(int pixel_width, int pixel_height) { static int busy = FALSE; @@ -1520,7 +1509,7 @@ again: * Check if gui_resize_shell() must be called. */ void -gui_may_resize_shell() +gui_may_resize_shell(void) { int h, w; @@ -1537,7 +1526,7 @@ gui_may_resize_shell() } int -gui_get_shellsize() +gui_get_shellsize(void) { Rows = gui.num_rows; Columns = gui.num_cols; @@ -1550,10 +1539,10 @@ gui_get_shellsize() * on the screen. */ void -gui_set_shellsize(mustset, fit_to_display, direction) - int mustset UNUSED; /* set by the user */ - int fit_to_display; - int direction; /* RESIZE_HOR, RESIZE_VER */ +gui_set_shellsize( + int mustset UNUSED, /* set by the user */ + int fit_to_display, + int direction) /* RESIZE_HOR, RESIZE_VER */ { int base_width; int base_height; @@ -1676,7 +1665,7 @@ gui_set_shellsize(mustset, fit_to_displa * Called when Rows and/or Columns has changed. */ void -gui_new_shellsize() +gui_new_shellsize(void) { gui_reset_scroll_region(); } @@ -1685,7 +1674,7 @@ gui_new_shellsize() * Make scroll region cover whole screen. */ void -gui_reset_scroll_region() +gui_reset_scroll_region(void) { gui.scroll_region_top = 0; gui.scroll_region_bot = gui.num_rows - 1; @@ -1694,8 +1683,7 @@ gui_reset_scroll_region() } void -gui_start_highlight(mask) - int mask; +gui_start_highlight(int mask) { if (mask > HL_ALL) /* highlight code */ gui.highlight_mask = mask; @@ -1704,8 +1692,7 @@ gui_start_highlight(mask) } void -gui_stop_highlight(mask) - int mask; +gui_stop_highlight(int mask) { if (mask > HL_ALL) /* highlight code */ gui.highlight_mask = HL_NORMAL; @@ -1718,11 +1705,11 @@ gui_stop_highlight(mask) * (row2, col2) inclusive. */ void -gui_clear_block(row1, col1, row2, col2) - int row1; - int col1; - int row2; - int col2; +gui_clear_block( + int row1, + int col1, + int row2, + int col2) { /* Clear the selection if we are about to write over it */ clip_may_clear_selection(row1, row2); @@ -1740,15 +1727,15 @@ gui_clear_block(row1, col1, row2, col2) * output buffer before calling gui_update_cursor(). */ 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 -gui_write(s, len) - char_u *s; - int len; +gui_write( + char_u *s, + int len) { char_u *p; int arg1 = 0, arg2 = 0; @@ -1977,7 +1964,7 @@ gui_write(s, len) * gui_can_update_cursor() afterwards. */ void -gui_dont_update_cursor() +gui_dont_update_cursor(void) { if (gui.in_use) { @@ -1988,7 +1975,7 @@ gui_dont_update_cursor() } void -gui_can_update_cursor() +gui_can_update_cursor(void) { can_update_cursor = TRUE; /* No need to update the cursor right now, there is always more output @@ -1996,9 +1983,7 @@ gui_can_update_cursor() } static void -gui_outstr(s, len) - char_u *s; - int len; +gui_outstr(char_u *s, int len) { int this_len; #ifdef FEAT_MBYTE @@ -2060,11 +2045,12 @@ gui_outstr(s, len) * Returns FAIL or OK, just like gui_outstr_nowrap(). */ static int -gui_screenchar(off, flags, fg, bg, back) - int off; /* Offset from start of screen */ - int flags; - guicolor_T fg, bg; /* colors for cursor */ - int back; /* backup this many chars when using bold trick */ +gui_screenchar( + int off, /* Offset from start of screen */ + int flags, + guicolor_T fg, /* colors for cursor */ + guicolor_T bg, /* colors for cursor */ + int back) /* backup this many chars when using bold trick */ { #ifdef FEAT_MBYTE 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. */ static int -gui_screenstr(off, len, flags, fg, bg, back) - int off; /* Offset from start of screen */ - int len; /* string length in screen cells */ - int flags; - guicolor_T fg, bg; /* colors for cursor */ - int back; /* backup this many chars when using bold trick */ +gui_screenstr( + int off, /* Offset from start of screen */ + int len, /* string length in screen cells */ + int flags, + guicolor_T fg, /* colors for cursor */ + guicolor_T bg, /* colors for cursor */ + int back) /* backup this many chars when using bold trick */ { char_u *buf; int outlen = 0; @@ -2184,12 +2171,13 @@ gui_screenstr(off, len, flags, fg, bg, b * FAIL (the caller should start drawing "back" chars back). */ int -gui_outstr_nowrap(s, len, flags, fg, bg, back) - char_u *s; - int len; - int flags; - guicolor_T fg, bg; /* colors for cursor */ - int back; /* backup this many chars when using bold trick */ +gui_outstr_nowrap( + char_u *s, + int len, + int flags, + guicolor_T fg, /* colors for cursor */ + guicolor_T bg, /* colors for cursor */ + int back) /* backup this many chars when using bold trick */ { long_u highlight_mask; long_u hl_mask_todo; @@ -2576,7 +2564,7 @@ gui_outstr_nowrap(s, len, flags, fg, bg, * position. The character just before it too, for when it was in bold. */ void -gui_undraw_cursor() +gui_undraw_cursor(void) { if (gui.cursor_is_valid) { @@ -2617,11 +2605,11 @@ gui_undraw_cursor() } void -gui_redraw(x, y, w, h) - int x; - int y; - int w; - int h; +gui_redraw( + int x, + int y, + int w, + int h) { int row1, col1, row2, col2; @@ -2650,12 +2638,12 @@ gui_redraw(x, y, w, h) * different attributes (may have to be redrawn too). */ int -gui_redraw_block(row1, col1, row2, col2, flags) - int row1; - int col1; - int row2; - int col2; - int flags; /* flags for gui_outstr_nowrap() */ +gui_redraw_block( + int row1, + int col1, + int row2, + int col2, + int flags) /* flags for gui_outstr_nowrap() */ { int old_row, old_col; long_u old_hl_mask; @@ -2814,9 +2802,7 @@ gui_redraw_block(row1, col1, row2, col2, } static void -gui_delete_lines(row, count) - int row; - int count; +gui_delete_lines(int row, int count) { if (count <= 0) return; @@ -2844,9 +2830,7 @@ gui_delete_lines(row, count) } static void -gui_insert_lines(row, count) - int row; - int count; +gui_insert_lines(int row, int count) { if (count <= 0) return; @@ -2880,8 +2864,7 @@ gui_insert_lines(row, count) * or FAIL otherwise. */ int -gui_wait_for_chars(wtime) - long wtime; +gui_wait_for_chars(long wtime) { int retval; @@ -2956,10 +2939,7 @@ gui_wait_for_chars(wtime) * Fill p[4] with mouse coordinates encoded for check_termcode(). */ static void -fill_mouse_coord(p, col, row) - char_u *p; - int col; - int row; +fill_mouse_coord(char_u *p, int col, int row) { p[0] = (char_u)(col / 128 + ' ' + 1); p[1] = (char_u)(col % 128 + ' ' + 1); @@ -2984,12 +2964,12 @@ fill_mouse_coord(p, col, row) * character. */ void -gui_send_mouse_event(button, x, y, repeated_click, modifiers) - int button; - int x; - int y; - int repeated_click; - int_u modifiers; +gui_send_mouse_event( + int button, + int x, + int y, + int repeated_click, + int_u modifiers) { static int prev_row = 0, prev_col = 0; static int prev_button = -1; @@ -3299,10 +3279,7 @@ button_set: * returns column in "*colp" and row as return value; */ int -gui_xy2colrow(x, y, colp) - int x; - int y; - int *colp; +gui_xy2colrow(int x, int y, int *colp) { int col = check_col(X_2_COL(x)); 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. */ void -gui_menu_cb(menu) - vimmenu_T *menu; +gui_menu_cb(vimmenu_T *menu) { char_u bytes[sizeof(long_u)]; @@ -3346,8 +3322,7 @@ static int prev_which_scrollbars[3]; * in p_go. */ void -gui_init_which_components(oldval) - char_u *oldval UNUSED; +gui_init_which_components(char_u *oldval UNUSED) { #ifdef FEAT_MENU 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. */ int -gui_use_tabline() +gui_use_tabline(void) { return gui.in_use && vim_strchr(p_go, GO_TABLINE) != NULL; } @@ -3609,7 +3584,7 @@ gui_use_tabline() * This uses 'showtabline'. */ static int -gui_has_tabline() +gui_has_tabline(void) { if (!gui_use_tabline() || p_stal == 0 @@ -3623,7 +3598,7 @@ gui_has_tabline() * This may display/undisplay the tabline and update the labels. */ void -gui_update_tabline() +gui_update_tabline(void) { int showit = gui_has_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[]. */ void -get_tabline_label(tp, tooltip) - tabpage_T *tp; - int tooltip; /* TRUE: get tooltip */ +get_tabline_label( + tabpage_T *tp, + int tooltip) /* TRUE: get tooltip */ { int modified = FALSE; char_u buf[40]; @@ -3744,8 +3719,7 @@ get_tabline_label(tp, tooltip) * that tab page or the cmdline window is open. */ int -send_tabline_event(nr) - int nr; +send_tabline_event(int nr) { char_u string[3]; @@ -3777,9 +3751,7 @@ send_tabline_event(nr) * Send a tabline menu event */ void -send_tabline_menu_event(tabidx, event) - int tabidx; - int event; +send_tabline_menu_event(int tabidx, int event) { char_u string[3]; @@ -3807,7 +3779,7 @@ send_tabline_menu_event(tabidx, event) * Remove all scrollbars. Used before switching to another tab page. */ void -gui_remove_scrollbars() +gui_remove_scrollbars(void) { int i; win_T *wp; @@ -3829,10 +3801,7 @@ gui_remove_scrollbars() #endif void -gui_create_scrollbar(sb, type, wp) - scrollbar_T *sb; - int type; - win_T *wp; +gui_create_scrollbar(scrollbar_T *sb, int type, win_T *wp) { static int sbar_ident = 0; @@ -3858,8 +3827,7 @@ gui_create_scrollbar(sb, type, wp) * Find the scrollbar with the given index. */ scrollbar_T * -gui_find_scrollbar(ident) - long ident; +gui_find_scrollbar(long ident) { win_T *wp; @@ -3891,10 +3859,7 @@ gui_find_scrollbar(ident) * are still characters to be processed. */ void -gui_drag_scrollbar(sb, value, still_dragging) - scrollbar_T *sb; - long value; - int still_dragging; +gui_drag_scrollbar(scrollbar_T *sb, long value, int still_dragging) { #ifdef FEAT_WINDOWS win_T *wp; @@ -4112,7 +4077,7 @@ gui_drag_scrollbar(sb, value, still_drag * Called when something in the window layout has changed. */ void -gui_may_update_scrollbars() +gui_may_update_scrollbars(void) { if (gui.in_use && starting == 0) { @@ -4125,8 +4090,8 @@ gui_may_update_scrollbars() #endif void -gui_update_scrollbars(force) - int force; /* Force all scrollbars to get updated */ +gui_update_scrollbars( + int force) /* Force all scrollbars to get updated */ { win_T *wp; scrollbar_T *sb; @@ -4340,10 +4305,10 @@ gui_update_scrollbars(force) * sometimes. */ static void -gui_do_scrollbar(wp, which, enable) - win_T *wp; - int which; /* SBAR_LEFT or SBAR_RIGHT */ - int enable; /* TRUE to enable scrollbar */ +gui_do_scrollbar( + win_T *wp, + int which, /* SBAR_LEFT or SBAR_RIGHT */ + int enable) /* TRUE to enable scrollbar */ { #ifdef FEAT_VERTSPLIT int midcol = curwin->w_wincol + curwin->w_width / 2; @@ -4386,7 +4351,7 @@ gui_do_scrollbar(wp, which, enable) * or FALSE otherwise. */ int -gui_do_scroll() +gui_do_scroll(void) { win_T *wp, *save_wp; int i; @@ -4498,8 +4463,7 @@ gui_do_scroll() * Return length of line "lnum" for horizontal scrolling. */ static colnr_T -scroll_line_len(lnum) - linenr_T lnum; +scroll_line_len(linenr_T lnum) { char_u *p; 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. */ static linenr_T -gui_find_longest_lnum() +gui_find_longest_lnum(void) { linenr_T ret = 0; @@ -4569,8 +4533,7 @@ gui_find_longest_lnum() } static void -gui_update_horiz_scrollbar(force) - int force; +gui_update_horiz_scrollbar(int force) { 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. */ int -gui_do_horiz_scroll(leftcol, compute_longest_lnum) - long_u leftcol; - int compute_longest_lnum; +gui_do_horiz_scroll(long_u leftcol, int compute_longest_lnum) { /* no wrapping, no scrolling */ if (curwin->w_p_wrap) @@ -4702,7 +4663,7 @@ gui_do_horiz_scroll(leftcol, compute_lon * Check that none of the colors are the same as the background color */ void -gui_check_colors() +gui_check_colors(void) { if (gui.norm_pixel == gui.back_pixel || gui.norm_pixel == INVALCOLOR) { @@ -4713,16 +4674,14 @@ gui_check_colors() } static void -gui_set_fg_color(name) - char_u *name; +gui_set_fg_color(char_u *name) { gui.norm_pixel = gui_get_color(name); hl_set_fg_color_name(vim_strsave(name)); } static void -gui_set_bg_color(name) - char_u *name; +gui_set_bg_color(char_u *name) { gui.back_pixel = gui_get_color(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. */ guicolor_T -gui_get_color(name) - char_u *name; +gui_get_color(char_u *name) { guicolor_T t; @@ -4755,8 +4713,7 @@ gui_get_color(name) * Return the grey value of a color (range 0-255). */ int -gui_get_lightness(pixel) - guicolor_T pixel; +gui_get_lightness(guicolor_T pixel) { long_u rgb = gui_mch_get_rgb(pixel); @@ -4767,7 +4724,7 @@ gui_get_lightness(pixel) #if defined(FEAT_GUI_X11) || defined(PROTO) void -gui_new_scrollbar_colors() +gui_new_scrollbar_colors(void) { win_T *wp; @@ -4788,8 +4745,7 @@ gui_new_scrollbar_colors() * Call this when focus has changed. */ void -gui_focus_change(in_focus) - int in_focus; +gui_focus_change(int in_focus) { /* * 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). */ void -gui_mouse_moved(x, y) - int x; - int y; +gui_mouse_moved(int x, int y) { win_T *wp; char_u st[8]; @@ -4902,7 +4856,7 @@ gui_mouse_moved(x, y) * Called when mouse should be moved to window with focus. */ void -gui_mouse_correct() +gui_mouse_correct(void) { int x, y; win_T *wp = NULL; @@ -4935,9 +4889,7 @@ gui_mouse_correct() * Find window where the mouse pointer "y" coordinate is in. */ static win_T * -xy2win(x, y) - int x UNUSED; - int y UNUSED; +xy2win(int x UNUSED, int y UNUSED) { #ifdef FEAT_WINDOWS int row; @@ -4981,8 +4933,7 @@ xy2win(x, y) * File names may be given to redefine the args list. */ void -ex_gui(eap) - exarg_T *eap; +ex_gui(exarg_T *eap) { char_u *arg = eap->arg; @@ -5023,9 +4974,7 @@ static void gfp_setname(char_u *fname, v * Callback function for do_in_runtimepath(). */ static void -gfp_setname(fname, cookie) - char_u *fname; - void *cookie; +gfp_setname(char_u *fname, void *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. */ int -gui_find_bitmap(name, buffer, ext) - char_u *name; - char_u *buffer; - char *ext; +gui_find_bitmap(char_u *name, char_u *buffer, char *ext) { if (STRLEN(name) > MAXPATHL - 14) return FAIL; @@ -5063,10 +5009,7 @@ gui_find_bitmap(name, buffer, ext) * contains "name". */ void -gui_find_iconfile(name, buffer, ext) - char_u *name; - char_u *buffer; - char *ext; +gui_find_iconfile(char_u *name, char_u *buffer, char *ext) { 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) void -display_errors() +display_errors(void) { char_u *p; @@ -5111,7 +5054,7 @@ display_errors() * allow typing on stdin. */ int -no_console_input() +no_console_input(void) { return ((!gui.in_use || gui.starting) # ifndef NO_CONSOLE @@ -5128,7 +5071,7 @@ no_console_input() * Update the current window and the screen. */ void -gui_update_screen() +gui_update_screen(void) { #ifdef FEAT_CONCEAL linenr_T conceal_old_cursor_line = 0; @@ -5199,10 +5142,10 @@ static void concat_esc(garray_T *gap, ch * Returns an allocated string. */ char_u * -get_find_dialog_text(arg, wwordp, mcasep) - char_u *arg; - int *wwordp; /* return: TRUE if \< \> found */ - int *mcasep; /* return: TRUE if \C found */ +get_find_dialog_text( + char_u *arg, + int *wwordp, /* return: TRUE if \< \> found */ + int *mcasep) /* return: TRUE if \C found */ { 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. */ static void -concat_esc(gap, text, what) - garray_T *gap; - char_u *text; - int what; +concat_esc(garray_T *gap, char_u *text, int what) { while (*text != NUL) { @@ -5289,11 +5229,11 @@ concat_esc(gap, text, what) * Return TRUE when something was added to the input buffer. */ int -gui_do_findrepl(flags, find_text, repl_text, down) - int flags; /* one of FRD_REPLACE, FRD_FINDNEXT, etc. */ - char_u *find_text; - char_u *repl_text; - int down; /* Search downwards. */ +gui_do_findrepl( + int flags, /* one of FRD_REPLACE, FRD_FINDNEXT, etc. */ + char_u *find_text, + char_u *repl_text, + int down) /* Search downwards. */ { garray_T ga; int i; @@ -5422,9 +5362,7 @@ static void gui_wingoto_xy(int x, int y) * Jump to the window at specified point (x, y). */ static void -gui_wingoto_xy(x, y) - int x; - int y; +gui_wingoto_xy(int x, int y) { int row = Y_2_ROW(y); int col = X_2_COL(x); @@ -5446,12 +5384,12 @@ gui_wingoto_xy(x, y) * fnames after call this function. */ void -gui_handle_drop(x, y, modifiers, fnames, count) - int x UNUSED; - int y UNUSED; - int_u modifiers; - char_u **fnames; - int count; +gui_handle_drop( + int x UNUSED, + int y UNUSED, + int_u modifiers, + char_u **fnames, + int count) { int i; char_u *p; diff --git a/src/gui_at_fs.c b/src/gui_at_fs.c --- a/src/gui_at_fs.c +++ b/src/gui_at_fs.c @@ -240,8 +240,7 @@ static int SFtwiddle = 0; static int SFchdir(char *path); static int -SFchdir(path) - char *path; +SFchdir(char *path) { int result; @@ -260,8 +259,7 @@ SFchdir(path) static void SFfree(int i); static void -SFfree(i) - int i; +SFfree(int i) { SFDir *dir; int j; @@ -284,9 +282,7 @@ SFfree(i) static void SFstrdup(char **s1, char *s2); static void -SFstrdup(s1, s2) - char **s1; - char *s2; +SFstrdup(char **s1, char *s2) { *s1 = strcpy(XtMalloc((unsigned)(strlen(s2) + 1)), s2); } @@ -294,8 +290,7 @@ SFstrdup(s1, s2) static void SFunreadableDir(SFDir *dir); static void -SFunreadableDir(dir) - SFDir *dir; +SFunreadableDir(SFDir *dir) { char *cannotOpen = _(" "); @@ -310,9 +305,7 @@ SFunreadableDir(dir) static void SFreplaceText(SFDir *dir, char *str); static void -SFreplaceText(dir, str) - SFDir *dir; - char *str; +SFreplaceText(SFDir *dir, char *str) { int len; @@ -333,8 +326,7 @@ SFreplaceText(dir, str) static void SFexpand(char *str); static void -SFexpand(str) - char *str; +SFexpand(char *str) { int len; int cmp; @@ -390,9 +382,7 @@ SFexpand(str) static int SFfindFile(SFDir *dir, char *str); static int -SFfindFile(dir, str) - SFDir *dir; - char *str; +SFfindFile(SFDir *dir, char *str) { int i, last, max; char *name, save; @@ -491,7 +481,7 @@ SFfindFile(dir, str) static void SFunselect(void); static void -SFunselect() +SFunselect(void) { SFDir *dir; @@ -505,8 +495,7 @@ SFunselect() static int SFcompareLogins(const void *p, const void *q); static int -SFcompareLogins(p, q) - const void *p, *q; +SFcompareLogins(const void *p, *q) { return strcmp(((SFLogin *)p)->name, ((SFLogin *)q)->name); } @@ -514,7 +503,7 @@ SFcompareLogins(p, q) static void SFgetHomeDirs(void); static void -SFgetHomeDirs() +SFgetHomeDirs(void) { struct passwd *pw; int Alloc; @@ -582,8 +571,7 @@ SFgetHomeDirs() static int SFfindHomeDir(char *begin, char *end); static int -SFfindHomeDir(begin, end) - char *begin, *end; +SFfindHomeDir(char *begin, *end) { char save; char *theRest; @@ -613,7 +601,7 @@ SFfindHomeDir(begin, end) } static void -SFupdatePath() +SFupdatePath(void) { static int Alloc; static int wasTwiddle = 0; @@ -807,8 +795,7 @@ SFupdatePath() #ifdef XtNinternational static int -WcsLen(p) - wchar_t *p; +WcsLen(wchar_t *p) { int i = 0; while (*p++ != 0) @@ -818,8 +805,7 @@ WcsLen(p) #endif static void -SFsetText(path) - char *path; +SFsetText(char *path) { XawTextBlock text; @@ -852,19 +838,19 @@ SFsetText(path) } static void -SFbuttonPressList(w, n, event) - Widget w UNUSED; - int n UNUSED; - XButtonPressedEvent *event UNUSED; +SFbuttonPressList( + Widget w UNUSED, + int n UNUSED, + XButtonPressedEvent *event UNUSED) { SFbuttonPressed = 1; } static void -SFbuttonReleaseList(w, n, event) - Widget w; - int n; - XButtonReleasedEvent *event; +SFbuttonReleaseList( + Widget w, + int n, + XButtonReleasedEvent *event) { SFDir *dir; @@ -885,9 +871,7 @@ SFbuttonReleaseList(w, n, event) static int SFcheckDir(int n, SFDir *dir); static int -SFcheckDir(n, dir) - int n; - SFDir *dir; +SFcheckDir(int n, SFDir *dir) { struct stat statBuf; int i; @@ -951,8 +935,7 @@ SFcheckDir(n, dir) static int SFcheckFiles(SFDir *dir); static int -SFcheckFiles(dir) - SFDir *dir; +SFcheckFiles(SFDir *dir) { int from, to; int result; @@ -988,9 +971,7 @@ SFcheckFiles(dir) } static void -SFdirModTimer(cl, id) - XtPointer cl UNUSED; - XtIntervalId *id UNUSED; +SFdirModTimer(XtPointer cl UNUSED, XtIntervalId *id UNUSED) { static int n = -1; static int f = 0; @@ -1036,8 +1017,7 @@ SFdirModTimer(cl, id) /* Return a single character describing what kind of file STATBUF is. */ static char -SFstatChar(statBuf) - struct stat *statBuf; +SFstatChar(struct stat *statBuf) { if (S_ISDIR (statBuf->st_mode)) return '/'; @@ -1100,7 +1080,7 @@ static XtIntervalId SFscrollTimerId; static void SFinitFont(void); static void -SFinitFont() +SFinitFont(void) { TextData *data; #ifdef FEAT_XFONTSET @@ -1151,7 +1131,7 @@ SFinitFont() static void SFcreateGC(void); static void -SFcreateGC() +SFcreateGC(void) { XGCValues gcValues; XRectangle rectangles[1]; @@ -1209,9 +1189,7 @@ SFcreateGC() } static void -SFclearList(n, doScroll) - int n; - int doScroll; +SFclearList(int n, int doScroll) { SFDir *dir; @@ -1286,9 +1264,7 @@ SFclearList(n, doScroll) static void SFdeleteEntry(SFDir *dir, SFEntry *entry); static void -SFdeleteEntry(dir, entry) - SFDir *dir; - SFEntry *entry; +SFdeleteEntry(SFDir *dir, SFEntry *entry) { SFEntry *e; SFEntry *end; @@ -1340,10 +1316,10 @@ SFdeleteEntry(dir, entry) static void SFwriteStatChar(char *name, int last, struct stat *statBuf); static void -SFwriteStatChar(name, last, statBuf) - char *name; - int last; - struct stat *statBuf; +SFwriteStatChar( + char *name, + int last, + struct stat *statBuf) { name[last] = SFstatChar(statBuf); } @@ -1351,9 +1327,7 @@ SFwriteStatChar(name, last, statBuf) static int SFstatAndCheck(SFDir *dir, SFEntry *entry); static int -SFstatAndCheck(dir, entry) - SFDir *dir; - SFEntry *entry; +SFstatAndCheck(SFDir *dir, SFEntry *entry) { struct stat statBuf; char save; @@ -1414,11 +1388,11 @@ SFstatAndCheck(dir, entry) static void -SFdrawStrings(w, dir, from, to) - Window w; - SFDir *dir; - int from; - int to; +SFdrawStrings( + Window w, + SFDir *dir, + int from, + int to) { int i; SFEntry *entry; @@ -1501,9 +1475,7 @@ SFdrawStrings(w, dir, from, to) } static void -SFdrawList(n, doScroll) - int n; - int doScroll; +SFdrawList(int n, int doScroll) { SFDir *dir; Window w; @@ -1539,8 +1511,7 @@ SFdrawList(n, doScroll) } static void -SFdrawLists(doScroll) - int doScroll; +SFdrawLists(int doScroll) { int i; @@ -1549,8 +1520,7 @@ SFdrawLists(doScroll) } static void -SFinvertEntry(n) - int n; +SFinvertEntry(int n) { XFillRectangle( SFdisplay, @@ -1565,7 +1535,7 @@ SFinvertEntry(n) static unsigned long SFscrollTimerInterval(void); static unsigned long -SFscrollTimerInterval() +SFscrollTimerInterval(void) { static int maxVal = 200; static int varyDist = 50; @@ -1594,9 +1564,7 @@ SFscrollTimerInterval() static void SFscrollTimer(XtPointer p, XtIntervalId *id); static void -SFscrollTimer(p, id) - XtPointer p; - XtIntervalId *id UNUSED; +SFscrollTimer(XtPointer p, XtIntervalId *id UNUSED) { SFDir *dir; int save; @@ -1646,9 +1614,7 @@ SFscrollTimer(p, id) } static int -SFnewInvertEntry(n, event) - int n; - XMotionEvent *event; +SFnewInvertEntry(int n, XMotionEvent *event) { int x, y; int nw; @@ -1693,10 +1659,7 @@ SFnewInvertEntry(n, event) } static void -SFenterList(w, n, event) - Widget w UNUSED; - int n; - XEnterWindowEvent *event; +SFenterList(Widget w UNUSED, int n, XEnterWindowEvent *event) { int nw; @@ -1716,10 +1679,7 @@ SFenterList(w, n, event) } static void -SFleaveList(w, n, event) - Widget w UNUSED; - int n; - XEvent *event UNUSED; +SFleaveList(Widget w UNUSED, int n, XEvent *event UNUSED) { if (SFcurrentInvert[n] != -1) { @@ -1729,10 +1689,7 @@ SFleaveList(w, n, event) } static void -SFmotionList(w, n, event) - Widget w UNUSED; - int n; - XMotionEvent *event; +SFmotionList(Widget w UNUSED, int n, XMotionEvent *event) { int nw; @@ -1749,10 +1706,7 @@ SFmotionList(w, n, event) } static void -SFvFloatSliderMovedCallback(w, n, fnew) - Widget w; - XtPointer n; - XtPointer fnew; +SFvFloatSliderMovedCallback(Widget w, XtPointer n, XtPointer fnew) { int nw; @@ -1761,10 +1715,7 @@ SFvFloatSliderMovedCallback(w, n, fnew) } static void -SFvSliderMovedCallback(w, n, nw) - Widget w UNUSED; - int n; - int nw; +SFvSliderMovedCallback(Widget w UNUSED, int n, int nw) { int old; Window win; @@ -1846,10 +1797,7 @@ SFvSliderMovedCallback(w, n, nw) } static void -SFvAreaSelectedCallback(w, n, pnew) - Widget w; - XtPointer n; - XtPointer pnew; +SFvAreaSelectedCallback(Widget w, XtPointer n, XtPointer pnew) { SFDir *dir; int nw = (int)(long)pnew; @@ -1906,10 +1854,7 @@ SFvAreaSelectedCallback(w, n, pnew) } static void -SFhSliderMovedCallback(w, n, nw) - Widget w UNUSED; - XtPointer n; - XtPointer nw; +SFhSliderMovedCallback(Widget w UNUSED, XtPointer n, XtPointer nw) { SFDir *dir; int save; @@ -1924,10 +1869,7 @@ SFhSliderMovedCallback(w, n, nw) } static void -SFhAreaSelectedCallback(w, n, pnew) - Widget w; - XtPointer n; - XtPointer pnew; +SFhAreaSelectedCallback(Widget w, XtPointer n, XtPointer pnew) { SFDir *dir; int nw = (int)(long)pnew; @@ -1984,10 +1926,10 @@ SFhAreaSelectedCallback(w, n, pnew) } static void -SFpathSliderMovedCallback(w, client_data, nw) - Widget w UNUSED; - XtPointer client_data UNUSED; - XtPointer nw; +SFpathSliderMovedCallback( + Widget w UNUSED, + XtPointer client_data UNUSED, + XtPointer nw) { SFDir *dir; int n; @@ -2020,10 +1962,10 @@ SFpathSliderMovedCallback(w, client_data } static void -SFpathAreaSelectedCallback(w, client_data, pnew) - Widget w; - XtPointer client_data UNUSED; - XtPointer pnew; +SFpathAreaSelectedCallback( + Widget w, + XtPointer client_data UNUSED, + XtPointer pnew) { int nw = (int)(long)pnew; float f; @@ -2071,7 +2013,7 @@ SFpathAreaSelectedCallback(w, client_dat } static Boolean -SFworkProc() +SFworkProc(void) { SFDir *dir; SFEntry *entry; @@ -2100,16 +2042,14 @@ SFworkProc() /***************** Dir.c */ static int -SFcompareEntries(p, q) - const void *p; - const void *q; +SFcompareEntries(const void *p, const void *q) { - return strcmp(((SFEntry *)p)->real, ((SFEntry *)q)->real); + return strcmp(((SFEntry *)p)->real, ((SFEntry *)q)->real); } static int -SFgetDir(dir) - SFDir *dir; +SFgetDir( + SFDir *dir) { SFEntry *result = NULL; int Alloc = 0; @@ -2194,11 +2134,11 @@ static char *oneLineTextEditTranslations static void SFexposeList(Widget w, XtPointer n, XEvent *event, Boolean *cont); static void -SFexposeList(w, n, event, cont) - Widget w UNUSED; - XtPointer n; - XEvent *event; - Boolean *cont UNUSED; +SFexposeList( + Widget w UNUSED, + XtPointer n, + XEvent *event, + Boolean *cont UNUSED) { if ((event->type == NoExpose) || event->xexpose.count) 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(w, client_data, event, cont) - Widget w UNUSED; - XtPointer client_data UNUSED; - XEvent *event; - Boolean *cont UNUSED; +SFmodVerifyCallback( + Widget w UNUSED, + XtPointer client_data UNUSED, + XEvent *event, + Boolean *cont UNUSED) { char buf[2]; @@ -2227,10 +2167,7 @@ SFmodVerifyCallback(w, client_data, even static void SFokCallback(Widget w, XtPointer cl, XtPointer cd); static void -SFokCallback(w, cl, cd) - Widget w UNUSED; - XtPointer cl UNUSED; - XtPointer cd UNUSED; +SFokCallback(Widget w UNUSED, XtPointer cl UNUSED, XtPointer cd UNUSED) { SFstatus = SEL_FILE_OK; } @@ -2244,10 +2181,7 @@ static XtCallbackRec SFokSelect[] = static void SFcancelCallback(Widget w, XtPointer cl, XtPointer cd); static void -SFcancelCallback(w, cl, cd) - Widget w UNUSED; - XtPointer cl UNUSED; - XtPointer cd UNUSED; +SFcancelCallback(Widget w UNUSED, XtPointer cl UNUSED, XtPointer cd UNUSED) { 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(w, event, params, num_params) - Widget w UNUSED; - XEvent *event; - String *params UNUSED; - Cardinal *num_params UNUSED; +SFdismissAction( + Widget w UNUSED, + XEvent *event, + String *params UNUSED, + Cardinal *num_params UNUSED) { if (event->type == ClientMessage && (Atom)event->xclient.data.l[0] != SFwmDeleteWindow) @@ -2284,11 +2218,11 @@ static XtActionsRec actions[] = }; static void -SFsetColors(bg, fg, scroll_bg, scroll_fg) - guicolor_T bg; - guicolor_T fg; - guicolor_T scroll_bg; - guicolor_T scroll_fg; +SFsetColors( + guicolor_T bg, + guicolor_T fg, + guicolor_T scroll_bg, + guicolor_T scroll_fg) { if (selFileForm) { @@ -2366,11 +2300,11 @@ SFsetColors(bg, fg, scroll_bg, scroll_fg } static void -SFcreateWidgets(toplevel, prompt, ok, cancel) - Widget toplevel; - char *prompt; - char *ok; - char *cancel; +SFcreateWidgets( + Widget toplevel, + char *prompt, + char *ok, + char *cancel) { Cardinal n; int listWidth, listHeight; @@ -2686,7 +2620,7 @@ SFcreateWidgets(toplevel, prompt, ok, ca } static void -SFtextChanged() +SFtextChanged(void) { #if defined(FEAT_XFONTSET) && defined(XtNinternational) if ((unsigned long)_XawTextFormat((TextWidget)selFileField) == XawFmtWide) @@ -2730,7 +2664,7 @@ SFtextChanged() } static char * -SFgetText() +SFgetText(void) { #if defined(FEAT_XFONTSET) && defined(XtNinternational) char *buf; @@ -2756,7 +2690,7 @@ SFgetText() } static void -SFprepareToReturn() +SFprepareToReturn(void) { SFstatus = SEL_FILE_NULL; XtRemoveGrab(selFile); @@ -2770,14 +2704,14 @@ SFprepareToReturn() } char * -vim_SelFile(toplevel, prompt, init_path, show_entry, x, y, fg, bg, scroll_fg, scroll_bg) - Widget toplevel; - char *prompt; - char *init_path; - int (*show_entry)(); - int x, y; - guicolor_T fg, bg; - guicolor_T scroll_fg, scroll_bg; /* The "Scrollbar" group colors */ +vim_SelFile( + Widget toplevel, + char *prompt, + char *init_path, + int (*show_entry)(), + int x, y, + guicolor_T fg, bg, + guicolor_T scroll_fg, scroll_bg) /* The "Scrollbar" group colors */ { static int firstTime = 1; XEvent event; diff --git a/src/gui_at_sb.c b/src/gui_at_sb.c --- a/src/gui_at_sb.c +++ b/src/gui_at_sb.c @@ -222,7 +222,7 @@ WidgetClass vim_scrollbarWidgetClass = ( #define PAGE_REPEAT 250 static void -ClassInitialize() +ClassInitialize(void) { XawInitializeWidgetSet(); XtAddConverter( XtRString, XtROrientation, XmuCvtStringToOrientation, @@ -232,11 +232,11 @@ ClassInitialize() #define MARGIN(sbw) (sbw)->scrollbar.thickness + (sbw)->scrollbar.shadow_width static void -FillArea(sbw, top, bottom, fill, draw_shadow) - ScrollbarWidget sbw; - Position top, bottom; - int fill; - int draw_shadow; +FillArea( + ScrollbarWidget sbw, + Position top, bottom, + int fill, + int draw_shadow) { int tlen = bottom - top; /* length of thumb in pixels */ int sw, margin, floor; @@ -340,8 +340,7 @@ FillArea(sbw, top, bottom, fill, draw_sh */ static void -PaintThumb(sbw) - ScrollbarWidget sbw; +PaintThumb(ScrollbarWidget sbw) { Position oldtop, oldbot, newtop, newbot; Dimension margin, tzl; @@ -374,8 +373,7 @@ PaintThumb(sbw) } static void -PaintArrows(sbw) - ScrollbarWidget sbw; +PaintArrows(ScrollbarWidget sbw) { XPoint point[6]; Dimension thickness = sbw->scrollbar.thickness - 1; @@ -454,8 +452,7 @@ PaintArrows(sbw) } static void -Destroy(w) - Widget w; +Destroy(Widget w) { ScrollbarWidget sbw = (ScrollbarWidget) w; if (sbw->scrollbar.timer_id != (XtIntervalId) 0) @@ -466,8 +463,7 @@ Destroy(w) } static void -CreateGC(w) - Widget w; +CreateGC(Widget w) { ScrollbarWidget sbw = (ScrollbarWidget) w; XGCValues gcValues; @@ -505,8 +501,7 @@ CreateGC(w) } static void -SetDimensions(sbw) - ScrollbarWidget sbw; +SetDimensions(ScrollbarWidget sbw) { if (sbw->scrollbar.orientation == XtorientVertical) { @@ -521,11 +516,11 @@ SetDimensions(sbw) } static void -Initialize(request, new, args, num_args) - Widget request UNUSED; /* what the client asked for */ - Widget new; /* what we're going to give him */ - ArgList args UNUSED; - Cardinal *num_args UNUSED; +Initialize( + Widget request UNUSED, /* what the client asked for */ + Widget new, /* what we're going to give him */ + ArgList args UNUSED, + Cardinal *num_args UNUSED) { ScrollbarWidget sbw = (ScrollbarWidget) new; @@ -549,10 +544,10 @@ Initialize(request, new, args, num_args) } static void -Realize(w, valueMask, attributes) - Widget w; - Mask *valueMask; - XSetWindowAttributes *attributes; +Realize( + Widget w, + Mask *valueMask, + XSetWindowAttributes *attributes) { /* The Simple widget actually stuffs the value in the valuemask. */ (*vim_scrollbarWidgetClass->core_class.superclass->core_class.realize) @@ -560,12 +555,12 @@ Realize(w, valueMask, attributes) } static Boolean -SetValues(current, request, desired, args, num_args) - Widget current; /* what I am */ - Widget request UNUSED; /* what he wants me to be */ - Widget desired; /* what I will become */ - ArgList args UNUSED; - Cardinal *num_args UNUSED; +SetValues( + Widget current, /* what I am */ + Widget request UNUSED, /* what he wants me to be */ + Widget desired, /* what I will become */ + ArgList args UNUSED, + Cardinal *num_args UNUSED) { ScrollbarWidget sbw = (ScrollbarWidget) current; ScrollbarWidget dsbw = (ScrollbarWidget) desired; @@ -601,8 +596,7 @@ SetValues(current, request, desired, arg } static void -Resize(w) - Widget w; +Resize(Widget w) { /* ForgetGravity has taken care of background, but thumb may * have to move as a result of the new size. */ @@ -612,10 +606,7 @@ Resize(w) static void -Redisplay(w, event, region) - Widget w; - XEvent *event; - Region region; +Redisplay(Widget w, XEvent *event, Region region) { ScrollbarWidget sbw = (ScrollbarWidget) w; int x, y; @@ -650,8 +641,7 @@ Redisplay(w, event, region) static Boolean -CompareEvents(oldEvent, newEvent) - XEvent *oldEvent, *newEvent; +CompareEvents(XEvent *oldEvent, *newEvent) { #define Check(field) if (newEvent->field != oldEvent->field) return False; @@ -693,10 +683,7 @@ struct EventData }; static Bool -PeekNotifyEvent(dpy, event, args) - Display *dpy; - XEvent *event; - char *args; +PeekNotifyEvent(Display *dpy, XEvent *event, char *args) { struct EventData *eventData = (struct EventData*)args; @@ -706,9 +693,7 @@ PeekNotifyEvent(dpy, event, args) static Boolean -LookAhead(w, event) - Widget w; - XEvent *event; +LookAhead(Widget w, XEvent *event) { XEvent newEvent; struct EventData eventData; @@ -726,10 +711,10 @@ LookAhead(w, event) static void -ExtractPosition(event, x, y, state) - XEvent *event; - Position *x, *y; /* RETURN */ - unsigned int *state; /* RETURN */ +ExtractPosition( + XEvent *event, + Position *x, *y, /* RETURN */ + unsigned int *state) /* RETURN */ { switch (event->type) { @@ -768,11 +753,11 @@ ExtractPosition(event, x, y, state) } static void -HandleThumb(w, event, params, num_params) - Widget w; - XEvent *event; - String *params; - Cardinal *num_params; +HandleThumb( + Widget w, + XEvent *event, + String *params, + Cardinal *num_params) { Position x, y, loc; ScrollbarWidget sbw = (ScrollbarWidget) w; @@ -791,9 +776,7 @@ HandleThumb(w, event, params, num_params } static void -RepeatNotify(client_data, idp) - XtPointer client_data; - XtIntervalId *idp UNUSED; +RepeatNotify(XtPointer client_data, XtIntervalId *idp UNUSED) { ScrollbarWidget sbw = (ScrollbarWidget) client_data; int call_data; @@ -833,57 +816,56 @@ RepeatNotify(client_data, idp) * Same as above, but for floating numbers. */ static float -FloatInRange(num, small, big) - float num, small, big; +FloatInRange(float num, small, big) { return (num < small) ? small : ((num > big) ? big : num); } static void -ScrollOneLineUp(w, event, params, num_params) - Widget w; - XEvent *event; - String *params UNUSED; - Cardinal *num_params UNUSED; +ScrollOneLineUp( + Widget w, + XEvent *event, + String *params UNUSED, + Cardinal *num_params UNUSED) { ScrollSome(w, event, -ONE_LINE_DATA); } static void -ScrollOneLineDown(w, event, params, num_params) - Widget w; - XEvent *event; - String *params UNUSED; - Cardinal *num_params UNUSED; +ScrollOneLineDown( + Widget w, + XEvent *event, + String *params UNUSED, + Cardinal *num_params UNUSED) { ScrollSome(w, event, ONE_LINE_DATA); } static void -ScrollPageDown(w, event, params, num_params) - Widget w; - XEvent *event; - String *params UNUSED; - Cardinal *num_params UNUSED; +ScrollPageDown( + Widget w, + XEvent *event, + String *params UNUSED, + Cardinal *num_params UNUSED) { ScrollSome(w, event, ONE_PAGE_DATA); } static void -ScrollPageUp(w, event, params, num_params) - Widget w; - XEvent *event; - String *params UNUSED; - Cardinal *num_params UNUSED; +ScrollPageUp( + Widget w, + XEvent *event, + String *params UNUSED, + Cardinal *num_params UNUSED) { ScrollSome(w, event, -ONE_PAGE_DATA); } static void -ScrollSome(w, event, call_data) - Widget w; - XEvent *event; - int call_data; +ScrollSome( + Widget w, + XEvent *event, + int call_data) { ScrollbarWidget sbw = (ScrollbarWidget) w; @@ -898,11 +880,11 @@ ScrollSome(w, event, call_data) } static void -NotifyScroll(w, event, params, num_params) - Widget w; - XEvent *event; - String *params UNUSED; - Cardinal *num_params UNUSED; +NotifyScroll( + Widget w, + XEvent *event, + String *params UNUSED, + Cardinal *num_params UNUSED) { ScrollbarWidget sbw = (ScrollbarWidget) w; Position x, y, loc; @@ -987,11 +969,11 @@ NotifyScroll(w, event, params, num_param } static void -EndScroll(w, event, params, num_params) - Widget w; - XEvent *event UNUSED; - String *params UNUSED; - Cardinal *num_params UNUSED; +EndScroll( + Widget w, + XEvent *event UNUSED, + String *params UNUSED, + Cardinal *num_params UNUSED) { ScrollbarWidget sbw = (ScrollbarWidget) w; @@ -1002,9 +984,7 @@ EndScroll(w, event, params, num_params) } static float -FractionLoc(sbw, x, y) - ScrollbarWidget sbw; - int x, y; +FractionLoc(ScrollbarWidget sbw, int x, y) { int margin; float height, width; @@ -1018,11 +998,11 @@ FractionLoc(sbw, x, y) } static void -MoveThumb(w, event, params, num_params) - Widget w; - XEvent *event; - String *params UNUSED; - Cardinal *num_params UNUSED; +MoveThumb( + Widget w, + XEvent *event, + String *params UNUSED, + Cardinal *num_params UNUSED) { ScrollbarWidget sbw = (ScrollbarWidget)w; Position x, y; @@ -1063,11 +1043,11 @@ MoveThumb(w, event, params, num_params) static void -NotifyThumb(w, event, params, num_params) - Widget w; - XEvent *event; - String *params UNUSED; - Cardinal *num_params UNUSED; +NotifyThumb( + Widget w, + XEvent *event, + String *params UNUSED, + Cardinal *num_params UNUSED) { ScrollbarWidget sbw = (ScrollbarWidget)w; /* 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 -AllocTopShadowGC(w) - Widget w; +AllocTopShadowGC(Widget w) { ScrollbarWidget sbw = (ScrollbarWidget) w; XtGCMask valuemask; @@ -1102,8 +1081,7 @@ AllocTopShadowGC(w) } static void -AllocBotShadowGC(w) - Widget w; +AllocBotShadowGC(Widget w) { ScrollbarWidget sbw = (ScrollbarWidget) w; XtGCMask valuemask; @@ -1115,11 +1093,11 @@ AllocBotShadowGC(w) } static void -_Xaw3dDrawShadows(gw, event, region, out) - Widget gw; - XEvent *event UNUSED; - Region region; - int out; +_Xaw3dDrawShadows( + Widget gw, + XEvent *event UNUSED, + Region region, + int out) { XPoint pt[6]; ScrollbarWidget sbw = (ScrollbarWidget) gw; @@ -1187,9 +1165,7 @@ AllocBotShadowGC(w) * Set the scroll bar to the given location. */ void -vim_XawScrollbarSetThumb(w, top, shown, max) - Widget w; - double top, shown, max; +vim_XawScrollbarSetThumb(Widget w, double top, shown, max) { ScrollbarWidget sbw = (ScrollbarWidget) w; diff --git a/src/gui_athena.c b/src/gui_athena.c --- a/src/gui_athena.c +++ b/src/gui_athena.c @@ -87,9 +87,9 @@ static int puller_width = 0; * left or middle mouse button. */ static void -gui_athena_scroll_cb_jump(w, client_data, call_data) - Widget w UNUSED; - XtPointer client_data, call_data; +gui_athena_scroll_cb_jump( + Widget w UNUSED, + XtPointer client_data, call_data) { scrollbar_T *sb, *sb_info; long value; @@ -122,9 +122,9 @@ gui_athena_scroll_cb_jump(w, client_data * right mouse buttons. */ static void -gui_athena_scroll_cb_scroll(w, client_data, call_data) - Widget w UNUSED; - XtPointer client_data, call_data; +gui_athena_scroll_cb_scroll( + Widget w UNUSED, + XtPointer client_data, call_data) { scrollbar_T *sb, *sb_info; long value; @@ -228,7 +228,7 @@ gui_athena_scroll_cb_scroll(w, client_da * Create all the Athena widgets necessary. */ void -gui_x11_create_widgets() +gui_x11_create_widgets(void) { /* * 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. */ static Pixmap -gui_athena_create_pullright_pixmap(w) - Widget w; +gui_athena_create_pullright_pixmap(Widget w) { Pixmap retval; #ifdef FONTSET_ALWAYS @@ -425,7 +424,7 @@ gui_athena_create_pullright_pixmap(w) * Called when the GUI is not going to start after all. */ void -gui_x11_destroy_widgets() +gui_x11_destroy_widgets(void) { textArea = NULL; #ifdef FEAT_MENU @@ -450,9 +449,7 @@ static void get_toolbar_pixmap(vimmenu_T * Return in "sen". */ static void -get_toolbar_pixmap(menu, sen) - vimmenu_T *menu; - Pixmap *sen; +get_toolbar_pixmap(vimmenu_T *menu, Pixmap *sen) { char_u buf[MAXPATHL]; /* buffer storing expanded pathname */ char **xpm = NULL; /* xpm array */ @@ -492,10 +489,7 @@ get_toolbar_pixmap(menu, sen) * insensitive Pixmap too. */ static void -createXpmImages(path, xpm, sen) - char_u *path; - char **xpm; - Pixmap *sen; +createXpmImages(char_u *path, char **xpm, Pixmap *sen) { Window rootWindow; XpmAttributes attrs; @@ -566,11 +560,11 @@ createXpmImages(path, xpm, sen) } void -gui_mch_set_toolbar_pos(x, y, w, h) - int x; - int y; - int w; - int h; +gui_mch_set_toolbar_pos( + int x, + int y, + int w, + int h) { Dimension border; int height; @@ -595,11 +589,11 @@ gui_mch_set_toolbar_pos(x, y, w, h) #endif void -gui_mch_set_text_area_pos(x, y, w, h) - int x; - int y; - int w; - int h; +gui_mch_set_text_area_pos( + int x, + int y, + int w, + int h) { XtUnmanageChild(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 */ static void -gui_mch_reset_focus() +gui_mch_reset_focus(void) { XtSetKeyboardFocus(vimForm, textArea); } @@ -630,7 +624,7 @@ gui_mch_reset_focus() void -gui_x11_set_back_color() +gui_x11_set_back_color(void) { if (textArea != NULL) XtVaSetValues(textArea, @@ -652,8 +646,7 @@ static void gui_athena_menu_font(Widget static Boolean gui_athena_menu_has_submenus(Widget, Widget); void -gui_mch_enable_menu(flag) - int flag; +gui_mch_enable_menu(int flag) { if (flag) { @@ -685,11 +678,11 @@ gui_mch_enable_menu(flag) } void -gui_mch_set_menu_pos(x, y, w, h) - int x; - int y; - int w; - int h; +gui_mch_set_menu_pos( + int x, + int y, + int w, + int h) { Dimension border; int height; @@ -717,8 +710,7 @@ gui_mch_set_menu_pos(x, y, w, h) * numChildren (end of children). */ static Cardinal -athena_calculate_ins_pos(widget) - Widget widget; +athena_calculate_ins_pos(Widget widget) { /* 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". @@ -764,9 +756,7 @@ athena_calculate_ins_pos(widget) } void -gui_mch_add_menu(menu, idx) - vimmenu_T *menu; - int idx UNUSED; +gui_mch_add_menu(vimmenu_T *menu, int idx UNUSED) { char_u *pullright_name; Dimension height, space, border; @@ -884,9 +874,7 @@ gui_mch_add_menu(menu, idx) * Ignore widget "ignore" in the pane. */ static Boolean -gui_athena_menu_has_submenus(id, ignore) - Widget id; - Widget ignore; +gui_athena_menu_has_submenus(Widget id, Widget ignore) { WidgetList children; Cardinal num_children; @@ -906,8 +894,7 @@ gui_athena_menu_has_submenus(id, ignore) } static void -gui_athena_menu_font(id) - Widget id; +gui_athena_menu_font(Widget id) { #ifdef FONTSET_ALWAYS if (gui.menu_fontset != NOFONTSET) @@ -954,7 +941,7 @@ gui_athena_menu_font(id) void -gui_mch_new_menu_font() +gui_mch_new_menu_font(void) { Pixmap oldpuller = None; @@ -1031,7 +1018,7 @@ gui_mch_new_menu_font() #if defined(FEAT_BEVAL) || defined(PROTO) void -gui_mch_new_tooltip_font() +gui_mch_new_tooltip_font(void) { # ifdef FEAT_TOOLBAR vimmenu_T *menu; @@ -1046,7 +1033,7 @@ gui_mch_new_tooltip_font() } void -gui_mch_new_tooltip_colors() +gui_mch_new_tooltip_colors(void) { # ifdef FEAT_TOOLBAR vimmenu_T *menu; @@ -1062,9 +1049,9 @@ gui_mch_new_tooltip_colors() #endif static void -gui_mch_submenu_change(menu, colors) - vimmenu_T *menu; - int colors; /* TRUE for colors, FALSE for font */ +gui_mch_submenu_change( + vimmenu_T *menu, + int colors) /* TRUE for colors, FALSE for font */ { vimmenu_T *mp; @@ -1141,8 +1128,7 @@ gui_mch_submenu_change(menu, colors) * Replace '.' by '_', can't include '.' in the submenu name. */ static char_u * -make_pull_name(name) - char_u * name; +make_pull_name(char_u * name) { char_u *pname; char_u *p; @@ -1158,9 +1144,7 @@ make_pull_name(name) } void -gui_mch_add_menu_item(menu, idx) - vimmenu_T *menu; - int idx UNUSED; +gui_mch_add_menu_item(vimmenu_T *menu, int idx UNUSED) { vimmenu_T *parent = menu->parent; @@ -1404,7 +1388,7 @@ gui_mch_show_toolbar(int showit) int -gui_mch_compute_toolbar_height() +gui_mch_compute_toolbar_height(void) { Dimension height; /* total Toolbar height */ Dimension whgt; /* height of each widget */ @@ -1439,12 +1423,12 @@ gui_mch_compute_toolbar_height() } void -gui_mch_get_toolbar_colors(bgp, fgp, bsp, tsp, hsp) - Pixel *bgp; - Pixel *fgp; - Pixel *bsp; - Pixel *tsp; - Pixel *hsp; +gui_mch_get_toolbar_colors( + Pixel *bgp, + Pixel *fgp, + Pixel *bsp, + Pixel *tsp, + Pixel *hsp) { XtVaGetValues(toolBar, XtNbackground, bgp, XtNborderColor, fgp, NULL); *bsp = *bgp; @@ -1455,14 +1439,13 @@ gui_mch_get_toolbar_colors(bgp, fgp, bsp void -gui_mch_toggle_tearoffs(enable) - int enable UNUSED; +gui_mch_toggle_tearoffs(int enable UNUSED) { /* no tearoff menus */ } void -gui_mch_new_menu_colors() +gui_mch_new_menu_colors(void) { if (menuBar == (Widget)0) return; @@ -1480,8 +1463,7 @@ gui_mch_new_menu_colors() * Destroy the machine specific menu widget. */ void -gui_mch_destroy_menu(menu) - vimmenu_T *menu; +gui_mch_destroy_menu(vimmenu_T *menu) { Widget parent; @@ -1626,9 +1608,9 @@ gui_mch_destroy_menu(menu) } static void -gui_athena_menu_timeout(client_data, id) - XtPointer client_data; - XtIntervalId *id UNUSED; +gui_athena_menu_timeout( + XtPointer client_data, + XtIntervalId *id UNUSED) { Widget w = (Widget)client_data; Widget popup; @@ -1658,10 +1640,10 @@ gui_athena_menu_timeout(client_data, id) * This is called when XtPopup() is called. */ static void -gui_athena_popup_callback(w, client_data, call_data) - Widget w; - XtPointer client_data; - XtPointer call_data UNUSED; +gui_athena_popup_callback( + Widget w, + XtPointer client_data, + XtPointer call_data UNUSED) { /* Assumption: XtIsSubclass(XtParent(w),simpleMenuWidgetClass) */ vimmenu_T *menu = (vimmenu_T *)client_data; @@ -1690,11 +1672,11 @@ gui_athena_popup_callback(w, client_data } static void -gui_athena_popdown_submenus_action(w, event, args, nargs) - Widget w; - XEvent *event; - String *args; - Cardinal *nargs; +gui_athena_popdown_submenus_action( + Widget w, + XEvent *event, + String *args, + Cardinal *nargs) { WidgetList children; Cardinal num_children; @@ -1719,8 +1701,7 @@ gui_athena_popdown_submenus_action(w, ev /* Used to determine if the given widget has a submenu that can be popped up. */ static Boolean -has_submenu(widget) - Widget widget; +has_submenu(Widget widget) { if ((widget != NULL) && XtIsSubclass(widget,smeBSBObjectClass)) { @@ -1734,11 +1715,11 @@ has_submenu(widget) } static void -gui_athena_delayed_arm_action(w, event, args, nargs) - Widget w; - XEvent *event; - String *args; - Cardinal *nargs; +gui_athena_delayed_arm_action( + Widget w, + XEvent *event, + String *args, + Cardinal *nargs) { Dimension width, height; @@ -1778,8 +1759,7 @@ gui_athena_delayed_arm_action(w, event, } static Widget -get_popup_entry(w) - Widget w; +get_popup_entry(Widget w) { Widget menuw; @@ -1794,8 +1774,7 @@ get_popup_entry(w) * that is to be popped up. */ static Widget -submenu_widget(widget) - Widget widget; +submenu_widget(Widget widget) { /* Precondition: has_submenu(widget) == True * XtIsSubclass(XtParent(widget),simpleMenuWidgetClass) == True @@ -1814,8 +1793,7 @@ submenu_widget(widget) } void -gui_mch_show_popupmenu(menu) - vimmenu_T *menu; +gui_mch_show_popupmenu(vimmenu_T *menu) { int rootx, rooty, winx, winy; Window root, child; @@ -1850,7 +1828,7 @@ gui_mch_show_popupmenu(menu) * Set the menu and scrollbar colors to their default values. */ void -gui_mch_def_colors() +gui_mch_def_colors(void) { /* * Get the colors ourselves. Using the automatic conversion doesn't @@ -1875,11 +1853,11 @@ gui_mch_def_colors() */ void -gui_mch_set_scrollbar_thumb(sb, val, size, max) - scrollbar_T *sb; - long val; - long size; - long max; +gui_mch_set_scrollbar_thumb( + scrollbar_T *sb, + long val, + long size, + long max) { double v, s; @@ -1911,12 +1889,12 @@ gui_mch_set_scrollbar_thumb(sb, val, siz } void -gui_mch_set_scrollbar_pos(sb, x, y, w, h) - scrollbar_T *sb; - int x; - int y; - int w; - int h; +gui_mch_set_scrollbar_pos( + scrollbar_T *sb, + int x, + int y, + int w, + int h) { if (sb->id == (Widget)0) return; @@ -1932,9 +1910,7 @@ gui_mch_set_scrollbar_pos(sb, x, y, w, h } void -gui_mch_enable_scrollbar(sb, flag) - scrollbar_T *sb; - int flag; +gui_mch_enable_scrollbar(scrollbar_T *sb, int flag) { if (sb->id != (Widget)0) { @@ -1946,9 +1922,9 @@ gui_mch_enable_scrollbar(sb, flag) } void -gui_mch_create_scrollbar(sb, orient) - scrollbar_T *sb; - int orient; /* SBAR_VERT or SBAR_HORIZ */ +gui_mch_create_scrollbar( + scrollbar_T *sb, + int orient) /* SBAR_VERT or SBAR_HORIZ */ { sb->id = XtVaCreateWidget("scrollBar", #ifdef FEAT_GUI_NEXTAW @@ -1984,8 +1960,7 @@ gui_mch_create_scrollbar(sb, orient) #if defined(FEAT_WINDOWS) || defined(PROTO) void -gui_mch_destroy_scrollbar(sb) - scrollbar_T *sb; +gui_mch_destroy_scrollbar(scrollbar_T *sb) { if (sb->id != (Widget)0) XtDestroyWidget(sb->id); @@ -1993,8 +1968,7 @@ gui_mch_destroy_scrollbar(sb) #endif void -gui_mch_set_scrollbar_colors(sb) - scrollbar_T *sb; +gui_mch_set_scrollbar_colors(scrollbar_T *sb) { if (sb->id != (Widget)0) XtVaSetValues(sb->id, @@ -2011,7 +1985,7 @@ gui_mch_set_scrollbar_colors(sb) * Miscellaneous stuff: */ Window -gui_x11_get_wid() +gui_x11_get_wid(void) { return XtWindow(textArea); } @@ -2022,13 +1996,13 @@ gui_x11_get_wid() * Returns the selected name in allocated memory, or NULL for Cancel. */ char_u * -gui_mch_browse(saving, title, dflt, ext, initdir, filter) - int saving UNUSED; /* select file to write */ - char_u *title; /* title for the window */ - char_u *dflt; /* default name */ - char_u *ext UNUSED; /* extension added */ - char_u *initdir; /* initial directory, NULL for current dir */ - char_u *filter UNUSED; /* file name filter */ +gui_mch_browse( + int saving UNUSED, /* select file to write */ + char_u *title, /* title for the window */ + char_u *dflt, /* default name */ + char_u *ext UNUSED, /* extension added */ + char_u *initdir, /* initial directory, NULL for current dir */ + char_u *filter UNUSED) /* file name filter */ { Position x, y; char_u dirbuf[MAXPATHL]; @@ -2075,11 +2049,11 @@ static void dialog_wm_handler(Widget w, * hitting the "OK" button, ESC like "Cancel". */ static void -keyhit_callback(w, client_data, event, cont) - Widget w UNUSED; - XtPointer client_data UNUSED; - XEvent *event; - Boolean *cont UNUSED; +keyhit_callback( + Widget w UNUSED, + XtPointer client_data UNUSED, + XEvent *event, + Boolean *cont UNUSED) { char buf[2]; @@ -2093,10 +2067,10 @@ keyhit_callback(w, client_data, event, c } static void -butproc(w, client_data, call_data) - Widget w UNUSED; - XtPointer client_data; - XtPointer call_data UNUSED; +butproc( + Widget w UNUSED, + XtPointer client_data, + XtPointer call_data UNUSED) { dialogStatus = (int)(long)client_data + 1; } @@ -2105,11 +2079,11 @@ butproc(w, client_data, call_data) * Function called when dialog window closed. */ static void -dialog_wm_handler(w, client_data, event, dum) - Widget w UNUSED; - XtPointer client_data UNUSED; - XEvent *event; - Boolean *dum UNUSED; +dialog_wm_handler( + Widget w UNUSED, + XtPointer client_data UNUSED, + XEvent *event, + Boolean *dum UNUSED) { if (event->type == ClientMessage && (Atom)((XClientMessageEvent *)event)->data.l[0] == dialogatom) @@ -2117,14 +2091,14 @@ dialog_wm_handler(w, client_data, event, } int -gui_mch_dialog(type, title, message, buttons, dfltbutton, textfield, ex_cmd) - int type UNUSED; - char_u *title; - char_u *message; - char_u *buttons; - int dfltbutton UNUSED; - char_u *textfield; - int ex_cmd UNUSED; +gui_mch_dialog( + int type UNUSED, + char_u *title, + char_u *message, + char_u *buttons, + int dfltbutton UNUSED, + char_u *textfield, + int ex_cmd UNUSED) { char_u *buts; char_u *p, *next; @@ -2305,8 +2279,7 @@ error: * Set the colors of Widget "id" to the menu colors. */ static void -gui_athena_menu_colors(id) - Widget id; +gui_athena_menu_colors(Widget id) { if (gui.menu_bg_pixel != INVALCOLOR) 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. */ static void -gui_athena_scroll_colors(id) - Widget id; +gui_athena_scroll_colors(Widget id) { if (gui.scroll_bg_pixel != INVALCOLOR) XtVaSetValues(id, XtNbackground, gui.scroll_bg_pixel, NULL); diff --git a/src/gui_beval.c b/src/gui_beval.c --- a/src/gui_beval.c +++ b/src/gui_beval.c @@ -16,9 +16,7 @@ * Common code, invoked when the mouse is resting for a moment. */ void -general_beval_cb(beval, state) - BalloonEval *beval; - int state UNUSED; +general_beval_cb(BalloonEval *beval, int state UNUSED) { #ifdef FEAT_EVAL win_T *wp; @@ -192,11 +190,11 @@ static void createBalloonEvalWindow(Ball * Returns a pointer to the resulting object (NULL when out of memory). */ BalloonEval * -gui_mch_create_beval_area(target, mesg, mesgCB, clientData) - void *target; - char_u *mesg; - void (*mesgCB)(BalloonEval *, int); - void *clientData; +gui_mch_create_beval_area( + void *target, + char_u *mesg, + void (*mesgCB)(BalloonEval *, int), + void *clientData) { #ifndef FEAT_GUI_GTK char *display_name; /* get from gui.dpy */ @@ -262,8 +260,7 @@ gui_mch_create_beval_area(target, mesg, * Destroy a balloon-eval and free its associated memory. */ void -gui_mch_destroy_beval_area(beval) - BalloonEval *beval; +gui_mch_destroy_beval_area(BalloonEval *beval) { cancelBalloon(beval); removeEventHandler(beval); @@ -278,16 +275,14 @@ gui_mch_destroy_beval_area(beval) #endif void -gui_mch_enable_beval_area(beval) - BalloonEval *beval; +gui_mch_enable_beval_area(BalloonEval *beval) { if (beval != NULL) addEventHandler(beval->target, beval); } void -gui_mch_disable_beval_area(beval) - BalloonEval *beval; +gui_mch_disable_beval_area(BalloonEval *beval) { if (beval != NULL) removeEventHandler(beval); @@ -301,7 +296,7 @@ gui_mch_disable_beval_area(beval) * Assumption: Only one tooltip can be shown at a time. */ BalloonEval * -gui_mch_currently_showing_beval() +gui_mch_currently_showing_beval(void) { return current_beval; } @@ -317,13 +312,13 @@ gui_mch_currently_showing_beval() * Returns OK or FAIL. */ int -get_beval_info(beval, getword, winp, lnump, textp, colp) - BalloonEval *beval; - int getword; - win_T **winp; - linenr_T *lnump; - char_u **textp; - int *colp; +get_beval_info( + BalloonEval *beval, + int getword, + win_T **winp, + linenr_T *lnump, + char_u **textp, + int *colp) { win_T *wp; int row, col; @@ -427,9 +422,7 @@ get_beval_info(beval, getword, winp, lnu * Show a balloon with "mesg". */ void -gui_mch_post_balloon(beval, mesg) - BalloonEval *beval; - char_u *mesg; +gui_mch_post_balloon(BalloonEval *beval, char_u *mesg) { beval->msg = mesg; if (mesg != NULL) @@ -446,8 +439,7 @@ gui_mch_post_balloon(beval, mesg) * Hide the given balloon. */ void -gui_mch_unpost_balloon(beval) - BalloonEval *beval; +gui_mch_unpost_balloon(BalloonEval *beval) { undrawBalloon(beval); } @@ -687,9 +679,7 @@ balloon_expose_event_cb(GtkWidget *widge #else /* !FEAT_GUI_GTK */ static void -addEventHandler(target, beval) - Widget target; - BalloonEval *beval; +addEventHandler(Widget target, BalloonEval *beval) { XtAddEventHandler(target, PointerMotionMask | EnterWindowMask | @@ -700,8 +690,7 @@ addEventHandler(target, beval) } static void -removeEventHandler(beval) - BalloonEval *beval; +removeEventHandler(BalloonEval *beval) { XtRemoveEventHandler(beval->target, PointerMotionMask | EnterWindowMask | @@ -716,11 +705,11 @@ removeEventHandler(beval) * The X event handler. All it does is call the real event handler. */ static void -pointerEventEH(w, client_data, event, unused) - Widget w UNUSED; - XtPointer client_data; - XEvent *event; - Boolean *unused UNUSED; +pointerEventEH( + Widget w UNUSED, + XtPointer client_data, + XEvent *event, + Boolean *unused UNUSED) { BalloonEval *beval = (BalloonEval *)client_data; pointerEvent(beval, event); @@ -733,9 +722,7 @@ pointerEventEH(w, client_data, event, un */ static void -pointerEvent(beval, event) - BalloonEval *beval; - XEvent *event; +pointerEvent(BalloonEval *beval, XEvent *event) { Position distance; /* a measure of how much the pointer moved */ Position delta; /* used to compute distance */ @@ -866,9 +853,7 @@ pointerEvent(beval, event) } static void -timerRoutine(dx, id) - XtPointer dx; - XtIntervalId *id UNUSED; +timerRoutine(XtPointer dx, XtIntervalId *id UNUSED) { BalloonEval *beval = (BalloonEval *)dx; @@ -885,8 +870,7 @@ timerRoutine(dx, id) #endif /* !FEAT_GUI_GTK */ static void -requestBalloon(beval) - BalloonEval *beval; +requestBalloon(BalloonEval *beval) { if (beval->showState != ShS_PENDING) { @@ -1177,8 +1161,7 @@ createBalloonEvalWindow(BalloonEval *bev * Draw a balloon. */ static void -drawBalloon(beval) - BalloonEval *beval; +drawBalloon(BalloonEval *beval) { Dimension w; Dimension h; @@ -1281,8 +1264,7 @@ drawBalloon(beval) * Undraw a balloon. */ static void -undrawBalloon(beval) - BalloonEval *beval; +undrawBalloon(BalloonEval *beval) { if (beval->balloonShell != (Widget)0) XtPopdown(beval->balloonShell); @@ -1292,8 +1274,7 @@ undrawBalloon(beval) } static void -cancelBalloon(beval) - BalloonEval *beval; +cancelBalloon(BalloonEval *beval) { if (beval->showState == ShS_SHOWING || beval->showState == ShS_UPDATE_PENDING) @@ -1309,8 +1290,7 @@ cancelBalloon(beval) static void -createBalloonEvalWindow(beval) - BalloonEval *beval; +createBalloonEvalWindow(BalloonEval *beval) { Arg args[12]; int n; diff --git a/src/gui_gtk.c b/src/gui_gtk.c --- a/src/gui_gtk.c +++ b/src/gui_gtk.c @@ -1988,8 +1988,7 @@ entry_changed_cb(GtkWidget * entry, GtkW * ":helpfind" */ void -ex_helpfind(eap) - exarg_T *eap UNUSED; +ex_helpfind(exarg_T *eap UNUSED) { /* This will fail when menus are not loaded. Well, it's only for * backwards compatibility anyway. */ diff --git a/src/gui_gtk_x11.c b/src/gui_gtk_x11.c --- a/src/gui_gtk_x11.c +++ b/src/gui_gtk_x11.c @@ -571,7 +571,7 @@ gui_mch_prepare(int *argc, char **argv) #if defined(EXITFREE) || defined(PROTO) void -gui_mch_free_all() +gui_mch_free_all(void) { vim_free(gui_argv); #if defined(FEAT_GUI_GNOME) && defined(FEAT_SESSION) @@ -2224,10 +2224,10 @@ setup_save_yourself(void) * GTK tells us that XSMP needs attention */ static gboolean -local_xsmp_handle_requests(source, condition, data) - GIOChannel *source UNUSED; - GIOCondition condition; - gpointer data; +local_xsmp_handle_requests( + GIOChannel *source UNUSED, + GIOCondition condition, + gpointer data) { if (condition == G_IO_IN) { @@ -3070,8 +3070,7 @@ gui_mch_update_tabline(void) * Set the current tab to "nr". First tab is 1. */ void -gui_mch_set_curtab(nr) - int nr; +gui_mch_set_curtab(int nr) { if (gui.tabline == NULL) return; @@ -3944,7 +3943,7 @@ force_shell_resize_idle(gpointer data) * Return TRUE if the main window is maximized. */ int -gui_mch_maximized() +gui_mch_maximized(void) { return (gui.mainwin != NULL && gui.mainwin->window != NULL && (gdk_window_get_state(gui.mainwin->window) @@ -3955,7 +3954,7 @@ gui_mch_maximized() * Unmaximize the main window */ void -gui_mch_unmaximize() +gui_mch_unmaximize(void) { if (gui.mainwin != NULL) gtk_window_unmaximize(GTK_WINDOW(gui.mainwin)); @@ -3966,7 +3965,7 @@ gui_mch_unmaximize() * new Rows and Columns. This is like resizing the window. */ void -gui_mch_newfont() +gui_mch_newfont(void) { int w, h; diff --git a/src/gui_mac.c b/src/gui_mac.c --- a/src/gui_mac.c +++ b/src/gui_mac.c @@ -2607,8 +2607,7 @@ gui_mch_mousehide(int hide) * the menu that we should display */ void -gui_mac_handle_contextual_menu(event) - EventRecord *event; +gui_mac_handle_contextual_menu(EventRecord *event) { /* * 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. */ void -gui_mch_free_font(font) - GuiFont font; +gui_mch_free_font(GuiFont font) { /* * 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. */ void -gui_mch_set_curtab(nr) - int nr; +gui_mch_set_curtab(int nr) { DataBrowserItemID item = nr; SetDataBrowserSelectedItems(dataBrowser, 1, &item, kDataBrowserItemsAssign); diff --git a/src/gui_motif.c b/src/gui_motif.c --- a/src/gui_motif.c +++ b/src/gui_motif.c @@ -118,9 +118,7 @@ static void gui_motif_scroll_colors(Widg */ static void -scroll_cb(w, client_data, call_data) - Widget w UNUSED; - XtPointer client_data, call_data; +scroll_cb(Widget w UNUSED, XtPointer client_data, call_data) { scrollbar_T *sb; long value; @@ -136,10 +134,10 @@ scroll_cb(w, client_data, call_data) #ifdef FEAT_GUI_TABLINE static void -tabline_cb(w, client_data, call_data) - Widget w UNUSED; - XtPointer client_data UNUSED; - XtPointer call_data; +tabline_cb( + Widget w UNUSED, + XtPointer client_data UNUSED, + XtPointer call_data) { XmNotebookCallbackStruct *nptr; @@ -149,10 +147,10 @@ tabline_cb(w, client_data, call_data) } static void -tabline_button_cb(w, client_data, call_data) - Widget w; - XtPointer client_data UNUSED; - XtPointer call_data UNUSED; +tabline_button_cb( + Widget w, + XtPointer client_data UNUSED, + XtPointer call_data UNUSED) { int cmd, tab_idx; @@ -166,9 +164,9 @@ tabline_button_cb(w, client_data, call_d * Tabline single mouse click timeout handler */ static void -motif_tabline_timer_cb (timed_out, interval_id) - XtPointer timed_out; - XtIntervalId *interval_id UNUSED; +motif_tabline_timer_cb ( + XtPointer timed_out, + XtIntervalId *interval_id UNUSED) { *((int *)timed_out) = TRUE; } @@ -177,9 +175,9 @@ motif_tabline_timer_cb (timed_out, inter * check if the tabline tab scroller is clicked */ static int -tabline_scroller_clicked(scroller_name, event) - char *scroller_name; - XButtonPressedEvent *event; +tabline_scroller_clicked( + char *scroller_name, + XButtonPressedEvent *event) { Widget tab_scroll_w; Position pos_x, pos_y; @@ -202,11 +200,11 @@ tabline_scroller_clicked(scroller_name, } static void -tabline_menu_cb(w, closure, e, continue_dispatch) - Widget w; - XtPointer closure UNUSED; - XEvent *e; - Boolean *continue_dispatch UNUSED; +tabline_menu_cb( + Widget w, + XtPointer closure UNUSED, + XEvent *e, + Boolean *continue_dispatch UNUSED) { Widget tab_w; XButtonPressedEvent *event; @@ -275,9 +273,7 @@ tabline_menu_cb(w, closure, e, continue_ } static void -tabline_balloon_cb(beval, state) - BalloonEval *beval; - int state UNUSED; +tabline_balloon_cb(BalloonEval *beval, int state UNUSED) { int nr; tabpage_T *tp; @@ -313,10 +309,7 @@ static XtExposeProc old_label_expose = N static void label_expose(Widget _w, XEvent *_event, Region _region); static void -label_expose(_w, _event, _region) - Widget _w; - XEvent *_event; - Region _region; +label_expose(Widget _w, XEvent *_event, Region _region) { GC insensitiveGC; XmLabelWidget lw = (XmLabelWidget)_w; @@ -396,7 +389,7 @@ label_expose(_w, _event, _region) * Create all the motif widgets necessary. */ void -gui_x11_create_widgets() +gui_x11_create_widgets(void) { #ifdef FEAT_GUI_TABLINE Widget button, scroller; @@ -633,7 +626,7 @@ gui_x11_create_widgets() * Called when the GUI is not going to start after all. */ void -gui_x11_destroy_widgets() +gui_x11_destroy_widgets(void) { textArea = NULL; #ifdef FEAT_MENU @@ -642,11 +635,11 @@ gui_x11_destroy_widgets() } void -gui_mch_set_text_area_pos(x, y, w, h) - int x UNUSED; - int y UNUSED; - int w UNUSED; - int h UNUSED; +gui_mch_set_text_area_pos( + int x UNUSED, + int y UNUSED, + int w UNUSED, + int h UNUSED) { #ifdef FEAT_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 -gui_x11_set_back_color() +gui_x11_set_back_color(void) { if (textArea != NULL) #if (XmVersion >= 1002) @@ -672,8 +665,7 @@ gui_x11_set_back_color() * well. */ void -manage_centered(dialog_child) - Widget dialog_child; +manage_centered(Widget dialog_child) { Widget shell = XtParent(dialog_child); Window root, child; @@ -731,8 +723,7 @@ manage_centered(dialog_child) * Encapsulate the way an XmFontList is created. */ XmFontList -gui_motif_create_fontlist(font) - XFontStruct *font; +gui_motif_create_fontlist(XFontStruct *font) { XmFontList font_list; @@ -753,8 +744,7 @@ gui_motif_create_fontlist(font) # if ((XmVersion > 1001) && defined(FEAT_XFONTSET)) || defined(PROTO) XmFontList -gui_motif_fontset2fontlist(fontset) - XFontSet *fontset; +gui_motif_fontset2fontlist(XFontSet *fontset) { XmFontList font_list; @@ -788,8 +778,7 @@ static void do_set_mnemonics(int enable) static int menu_enabled = TRUE; void -gui_mch_enable_menu(flag) - int flag; +gui_mch_enable_menu(int flag) { if (flag) { @@ -900,8 +889,7 @@ gui_mch_enable_menu(flag) * Enable or disable mnemonics for the toplevel menus. */ void -gui_motif_set_mnemonics(enable) - int enable; +gui_motif_set_mnemonics(int enable) { /* * Don't enable menu mnemonics when the menu bar is disabled, LessTif @@ -913,8 +901,7 @@ gui_motif_set_mnemonics(enable) } static void -do_set_mnemonics(enable) - int enable; +do_set_mnemonics(int enable) { vimmenu_T *menu; @@ -926,9 +913,7 @@ do_set_mnemonics(enable) } void -gui_mch_add_menu(menu, idx) - vimmenu_T *menu; - int idx; +gui_mch_add_menu(vimmenu_T *menu, int idx) { XmString label; Widget shell; @@ -1036,8 +1021,7 @@ gui_mch_add_menu(menu, idx) * Add mnemonic and accelerator text to a menu button. */ static void -gui_motif_add_actext(menu) - vimmenu_T *menu; +gui_motif_add_actext(vimmenu_T *menu) { XmString label; @@ -1053,8 +1037,7 @@ gui_motif_add_actext(menu) } void -gui_mch_toggle_tearoffs(enable) - int enable; +gui_mch_toggle_tearoffs(int enable) { #if (XmVersion >= 1002) if (enable) @@ -1072,8 +1055,7 @@ gui_mch_toggle_tearoffs(enable) * tearoff widget. */ static void -toggle_tearoff(wid) - Widget wid; +toggle_tearoff(Widget wid) { Widget w; @@ -1084,8 +1066,7 @@ toggle_tearoff(wid) } static void -gui_mch_recurse_tearoffs(menu) - vimmenu_T *menu; +gui_mch_recurse_tearoffs(vimmenu_T *menu) { while (menu != NULL) { @@ -1101,7 +1082,7 @@ gui_mch_recurse_tearoffs(menu) #endif int -gui_mch_text_area_extra_height() +gui_mch_text_area_extra_height(void) { Dimension shadowHeight; @@ -1115,8 +1096,8 @@ gui_mch_text_area_extra_height() * there are several rows, and/or some characters extend higher or lower. */ void -gui_mch_compute_menu_height(id) - Widget id; /* can be NULL when deleting menu */ +gui_mch_compute_menu_height( + Widget id) /* can be NULL when deleting menu */ { Dimension y, maxy; Dimension margin, shadow; @@ -1200,8 +1181,7 @@ static int add_pixmap_args(vimmenu_T *me * Read an Xpm file. Return OK or FAIL. */ static int -check_xpm(path) - char_u *path; +check_xpm(char_u *path) { XpmAttributes attrs; int status; @@ -1229,9 +1209,7 @@ check_xpm(path) * Return a blank pixmap if it fails. */ static char ** -get_toolbar_pixmap(menu, fname) - vimmenu_T *menu; - char **fname; +get_toolbar_pixmap(vimmenu_T *menu, char **fname) { char_u buf[MAXPATHL]; /* buffer storing expanded pathname */ char **xpm = NULL; /* xpm array */ @@ -1272,10 +1250,7 @@ get_toolbar_pixmap(menu, fname) * Add arguments for the toolbar pixmap to a menu item. */ static int -add_pixmap_args(menu, args, n) - vimmenu_T *menu; - Arg *args; - int n; +add_pixmap_args(vimmenu_T *menu, Arg *args, int n) { vim_free(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 */ void -gui_mch_add_menu_item(menu, idx) - vimmenu_T *menu; - int idx; +gui_mch_add_menu_item(vimmenu_T *menu, int idx) { XmString label; 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. */ void -gui_motif_update_mousemodel(menu) - vimmenu_T *menu; +gui_motif_update_mousemodel(vimmenu_T *menu) { int idx = 0; @@ -1500,7 +1472,7 @@ gui_motif_update_mousemodel(menu) #endif void -gui_mch_new_menu_colors() +gui_mch_new_menu_colors(void) { if (menuBar == (Widget)0) return; @@ -1514,7 +1486,7 @@ gui_mch_new_menu_colors() } void -gui_mch_new_menu_font() +gui_mch_new_menu_font(void) { if (menuBar == (Widget)0) return; @@ -1539,7 +1511,7 @@ gui_mch_new_menu_font() #if defined(FEAT_BEVAL) || defined(PROTO) void -gui_mch_new_tooltip_font() +gui_mch_new_tooltip_font(void) { # ifdef FEAT_TOOLBAR vimmenu_T *menu; @@ -1554,7 +1526,7 @@ gui_mch_new_tooltip_font() } void -gui_mch_new_tooltip_colors() +gui_mch_new_tooltip_colors(void) { # ifdef FEAT_TOOLBAR vimmenu_T *toolbar; @@ -1570,9 +1542,9 @@ gui_mch_new_tooltip_colors() #endif static void -submenu_change(menu, colors) - vimmenu_T *menu; - int colors; /* TRUE for colors, FALSE for font */ +submenu_change( + vimmenu_T *menu, + int colors) /* TRUE for colors, FALSE for font */ { vimmenu_T *mp; @@ -1650,8 +1622,7 @@ submenu_change(menu, colors) * Destroy the machine specific menu widget. */ void -gui_mch_destroy_menu(menu) - vimmenu_T *menu; +gui_mch_destroy_menu(vimmenu_T *menu) { /* 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 @@ -1708,8 +1679,7 @@ gui_mch_destroy_menu(menu) } void -gui_mch_show_popupmenu(menu) - vimmenu_T *menu UNUSED; +gui_mch_show_popupmenu(vimmenu_T *menu UNUSED) { #ifdef MOTIF_POPUP 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. */ void -gui_mch_def_colors() +gui_mch_def_colors(void) { if (gui.in_use) { @@ -1748,11 +1718,11 @@ gui_mch_def_colors() */ void -gui_mch_set_scrollbar_thumb(sb, val, size, max) - scrollbar_T *sb; - long val; - long size; - long max; +gui_mch_set_scrollbar_thumb( + scrollbar_T *sb, + long val, + long size, + long max) { if (sb->id != (Widget)0) XtVaSetValues(sb->id, @@ -1764,12 +1734,12 @@ gui_mch_set_scrollbar_thumb(sb, val, siz } void -gui_mch_set_scrollbar_pos(sb, x, y, w, h) - scrollbar_T *sb; - int x; - int y; - int w; - int h; +gui_mch_set_scrollbar_pos( + scrollbar_T *sb, + int x, + int y, + int w, + int h) { if (sb->id != (Widget)0) { @@ -1798,9 +1768,7 @@ gui_mch_set_scrollbar_pos(sb, x, y, w, h } void -gui_mch_enable_scrollbar(sb, flag) - scrollbar_T *sb; - int flag; +gui_mch_enable_scrollbar(scrollbar_T *sb, int flag) { Arg args[16]; int n; @@ -1855,9 +1823,9 @@ gui_mch_enable_scrollbar(sb, flag) } void -gui_mch_create_scrollbar(sb, orient) - scrollbar_T *sb; - int orient; /* SBAR_VERT or SBAR_HORIZ */ +gui_mch_create_scrollbar( + scrollbar_T *sb, + int orient) /* SBAR_VERT or SBAR_HORIZ */ { Arg args[16]; int n; @@ -1913,8 +1881,7 @@ gui_mch_create_scrollbar(sb, orient) #if defined(FEAT_WINDOWS) || defined(PROTO) void -gui_mch_destroy_scrollbar(sb) - scrollbar_T *sb; +gui_mch_destroy_scrollbar(scrollbar_T *sb) { if (sb->id != (Widget)0) XtDestroyWidget(sb->id); @@ -1922,8 +1889,7 @@ gui_mch_destroy_scrollbar(sb) #endif void -gui_mch_set_scrollbar_colors(sb) - scrollbar_T *sb; +gui_mch_set_scrollbar_colors(scrollbar_T *sb) { if (sb->id != (Widget)0) { @@ -1957,7 +1923,7 @@ gui_mch_set_scrollbar_colors(sb) */ Window -gui_x11_get_wid() +gui_x11_get_wid(void) { 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. */ static void -set_fontlist(id) - Widget id; +set_fontlist(Widget id) { XmFontList fl; @@ -2211,11 +2176,8 @@ static void DialogAcceptCB(Widget, XtPoi */ static void set_predefined_label(Widget parent, String name, char *new_label); -static void -set_predefined_label(parent, name, new_label) - Widget parent; - String name; - char *new_label; + static void +set_predefined_label(Widget parent, String name, char *new_label) { XmString str; Widget w; @@ -2258,10 +2220,8 @@ set_predefined_label(parent, name, new_l gui_motif_menu_fontlist(w); } -static void -set_predefined_fontlist(parent, name) - Widget parent; - String name; + static void +set_predefined_fontlist(Widget parent, String name) { Widget w; w = XtNameToWidget(parent, name); @@ -2277,13 +2237,13 @@ set_predefined_fontlist(parent, name) * Returns the selected name in allocated memory, or NULL for Cancel. */ char_u * -gui_mch_browse(saving, title, dflt, ext, initdir, filter) - int saving UNUSED; /* select file to write */ - char_u *title; /* title for the window */ - char_u *dflt; /* default name */ - char_u *ext UNUSED; /* not used (extension added) */ - char_u *initdir; /* initial directory, NULL for current dir */ - char_u *filter; /* file name filter */ +gui_mch_browse( + int saving UNUSED, /* select file to write */ + char_u *title, /* title for the window */ + char_u *dflt, /* default name */ + char_u *ext UNUSED, /* not used (extension added) */ + char_u *initdir, /* initial directory, NULL for current dir */ + char_u *filter) /* file name filter */ { char_u dirbuf[MAXPATHL]; char_u dfltbuf[MAXPATHL]; @@ -2402,10 +2362,10 @@ gui_mch_browse(saving, title, dflt, ext, * Process callback from Dialog cancel actions. */ static void -DialogCancelCB(w, client_data, call_data) - Widget w UNUSED; /* widget id */ - XtPointer client_data UNUSED; /* data from application */ - XtPointer call_data UNUSED; /* data from widget class */ +DialogCancelCB( + Widget w UNUSED, /* widget id */ + XtPointer client_data UNUSED, /* data from application */ + XtPointer call_data UNUSED) /* data from widget class */ { if (browse_fname != NULL) { @@ -2419,10 +2379,10 @@ DialogCancelCB(w, client_data, call_data * Process callback from Dialog actions. */ static void -DialogAcceptCB(w, client_data, call_data) - Widget w UNUSED; /* widget id */ - XtPointer client_data UNUSED; /* data from application */ - XtPointer call_data; /* data from widget class */ +DialogAcceptCB( + Widget w UNUSED, /* widget id */ + XtPointer client_data UNUSED, /* data from application */ + XtPointer call_data) /* data from widget class */ { XmFileSelectionBoxCallbackStruct *fcb; @@ -2454,11 +2414,11 @@ static void butproc(Widget w, XtPointer * hitting the "OK" button, ESC like "Cancel". */ static void -keyhit_callback(w, client_data, event, cont) - Widget w; - XtPointer client_data UNUSED; - XEvent *event; - Boolean *cont UNUSED; +keyhit_callback( + Widget w, + XtPointer client_data UNUSED, + XEvent *event, + Boolean *cont UNUSED) { char buf[2]; KeySym key_sym; @@ -2476,10 +2436,10 @@ keyhit_callback(w, client_data, event, c } static void -butproc(w, client_data, call_data) - Widget w UNUSED; - XtPointer client_data; - XtPointer call_data UNUSED; +butproc( + Widget w UNUSED, + XtPointer client_data, + XtPointer call_data UNUSED) { 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(parent, name, data, args, arg) - Widget parent; - String name; - char **data; - ArgList args; - Cardinal arg; +create_pixmap_label( + Widget parent, + String name, + char **data, + ArgList args, + Cardinal arg) { Widget label; Display *dsp; @@ -2552,14 +2512,14 @@ create_pixmap_label(parent, name, data, #endif int -gui_mch_dialog(type, title, message, button_names, dfltbutton, textfield, ex_cmd) - int type UNUSED; - char_u *title; - char_u *message; - char_u *button_names; - int dfltbutton; - char_u *textfield; /* buffer of size IOSIZE */ - int ex_cmd UNUSED; +gui_mch_dialog( + int type UNUSED, + char_u *title, + char_u *message, + char_u *button_names, + int dfltbutton, + char_u *textfield, /* buffer of size IOSIZE */ + int ex_cmd UNUSED) { char_u *buts; char_u *p, *next; @@ -2927,7 +2887,7 @@ gui_mch_dialog(type, title, message, but #if defined(FEAT_FOOTER) || defined(PROTO) static int -gui_mch_compute_footer_height() +gui_mch_compute_footer_height(void) { Dimension height; /* total Toolbar height */ Dimension top; /* XmNmarginTop */ @@ -2945,8 +2905,7 @@ gui_mch_compute_footer_height() } void -gui_mch_enable_footer(showit) - int showit; +gui_mch_enable_footer(int showit) { if (showit) { @@ -2962,8 +2921,7 @@ gui_mch_enable_footer(showit) } void -gui_mch_set_footer(s) - char_u *s; +gui_mch_set_footer(char_u *s) { XmString xms; @@ -3135,14 +3093,14 @@ gui_mch_show_toolbar(int showit) * input go to the editor window, not the button */ static void -reset_focus() +reset_focus(void) { if (textArea != NULL) XmProcessTraversal(textArea, XmTRAVERSE_CURRENT); } int -gui_mch_compute_toolbar_height() +gui_mch_compute_toolbar_height(void) { Dimension borders; Dimension height; /* total Toolbar height */ @@ -3189,12 +3147,12 @@ gui_mch_compute_toolbar_height() } void -motif_get_toolbar_colors(bgp, fgp, bsp, tsp, hsp) - Pixel *bgp; - Pixel *fgp; - Pixel *bsp; - Pixel *tsp; - Pixel *hsp; +motif_get_toolbar_colors( + Pixel *bgp, + Pixel *fgp, + Pixel *bsp, + Pixel *tsp, + Pixel *hsp) { XtVaGetValues(toolBar, XmNbackground, bgp, @@ -3212,11 +3170,11 @@ motif_get_toolbar_colors(bgp, fgp, bsp, * get implemented and the user will have a choice. */ static void -toolbarbutton_enter_cb(w, client_data, event, cont) - Widget w UNUSED; - XtPointer client_data; - XEvent *event UNUSED; - Boolean *cont UNUSED; +toolbarbutton_enter_cb( + Widget w UNUSED, + XtPointer client_data, + XEvent *event UNUSED, + Boolean *cont UNUSED) { vimmenu_T *menu = (vimmenu_T *) client_data; @@ -3228,11 +3186,11 @@ toolbarbutton_enter_cb(w, client_data, e } static void -toolbarbutton_leave_cb(w, client_data, event, cont) - Widget w UNUSED; - XtPointer client_data UNUSED; - XEvent *event UNUSED; - Boolean *cont UNUSED; +toolbarbutton_leave_cb( + Widget w UNUSED, + XtPointer client_data UNUSED, + XEvent *event UNUSED, + Boolean *cont UNUSED) { 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. */ void -gui_mch_set_curtab(nr) - int nr; +gui_mch_set_curtab(int nr) { int currentpage; @@ -3431,8 +3388,7 @@ gui_mch_set_curtab(nr) * Set the colors of Widget "id" to the menu colors. */ static void -gui_motif_menu_colors(id) - Widget id; +gui_motif_menu_colors(Widget id) { if (gui.menu_bg_pixel != INVALCOLOR) #if (XmVersion >= 1002) @@ -3448,8 +3404,7 @@ gui_motif_menu_colors(id) * Set the colors of Widget "id" to the scrollbar colors. */ static void -gui_motif_scroll_colors(id) - Widget id; +gui_motif_scroll_colors(Widget id) { if (gui.scroll_bg_pixel != INVALCOLOR) #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. */ void -gui_motif_menu_fontlist(id) - Widget id UNUSED; +gui_motif_menu_fontlist(Widget id UNUSED) { #ifdef FEAT_MENU #ifdef FONTSET_ALWAYS @@ -3548,10 +3502,10 @@ static void find_replace_keypress(Widget static void find_replace_dialog_create(char_u *entry_text, int do_replace); static void -find_replace_destroy_callback(w, client_data, call_data) - Widget w UNUSED; - XtPointer client_data; - XtPointer call_data UNUSED; +find_replace_destroy_callback( + Widget w UNUSED, + XtPointer client_data, + XtPointer call_data UNUSED) { SharedFindReplace *cd = (SharedFindReplace *)client_data; @@ -3561,10 +3515,10 @@ find_replace_destroy_callback(w, client_ } static void -find_replace_dismiss_callback(w, client_data, call_data) - Widget w UNUSED; - XtPointer client_data; - XtPointer call_data UNUSED; +find_replace_dismiss_callback( + Widget w UNUSED, + XtPointer client_data, + XtPointer call_data UNUSED) { SharedFindReplace *cd = (SharedFindReplace *)client_data; @@ -3573,19 +3527,19 @@ find_replace_dismiss_callback(w, client_ } static void -entry_activate_callback(w, client_data, call_data) - Widget w UNUSED; - XtPointer client_data; - XtPointer call_data UNUSED; +entry_activate_callback( + Widget w UNUSED, + XtPointer client_data, + XtPointer call_data UNUSED) { XmProcessTraversal((Widget)client_data, XmTRAVERSE_CURRENT); } static void -find_replace_callback(w, client_data, call_data) - Widget w UNUSED; - XtPointer client_data; - XtPointer call_data UNUSED; +find_replace_callback( + Widget w UNUSED, + XtPointer client_data, + XtPointer call_data UNUSED) { long_u flags = (long_u)client_data; char *find_text, *repl_text; @@ -3636,10 +3590,10 @@ find_replace_callback(w, client_data, ca } static void -find_replace_keypress(w, frdp, event) - Widget w UNUSED; - SharedFindReplace *frdp; - XKeyEvent *event; +find_replace_keypress( + Widget w UNUSED, + SharedFindReplace *frdp, + XKeyEvent *event) { KeySym keysym; @@ -3654,9 +3608,7 @@ find_replace_keypress(w, frdp, event) } static void -set_label(w, label) - Widget w; - char *label; +set_label(Widget w, char *label) { XmString str; char_u *p, *next; @@ -3696,9 +3648,7 @@ set_label(w, label) } static void -find_replace_dialog_create(arg, do_replace) - char_u *arg; - int do_replace; +find_replace_dialog_create(char_u *arg, int do_replace) { SharedFindReplace *frdp; Widget separator; @@ -4050,8 +4000,7 @@ find_replace_dialog_create(arg, do_repla } void -gui_mch_find_dialog(eap) - exarg_T *eap; +gui_mch_find_dialog(exarg_T *eap) { if (!gui.in_use) return; @@ -4061,8 +4010,7 @@ gui_mch_find_dialog(eap) void -gui_mch_replace_dialog(eap) - exarg_T *eap; +gui_mch_replace_dialog(exarg_T *eap) { if (!gui.in_use) return; diff --git a/src/version.c b/src/version.c --- a/src/version.c +++ b/src/version.c @@ -747,6 +747,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 1207, +/**/ 1206, /**/ 1205,