diff options
-rw-r--r-- | src/arabic.c | 74 | ||||
-rw-r--r-- | src/blowfish.c | 78 | ||||
-rw-r--r-- | src/buffer.c | 509 | ||||
-rw-r--r-- | src/channel.c | 2 | ||||
-rw-r--r-- | src/charset.c | 278 | ||||
-rw-r--r-- | src/crypt.c | 138 | ||||
-rw-r--r-- | src/crypt_zip.c | 36 | ||||
-rw-r--r-- | src/diff.c | 186 | ||||
-rw-r--r-- | src/digraph.c | 32 | ||||
-rw-r--r-- | src/edit.c | 512 | ||||
-rw-r--r-- | src/eval.c | 2773 | ||||
-rw-r--r-- | src/version.c | 2 |
12 files changed, 1712 insertions, 2908 deletions
diff --git a/src/arabic.c b/src/arabic.c index d6679d6e04..1c30598392 100644 --- a/src/arabic.c +++ b/src/arabic.c @@ -43,8 +43,7 @@ static int A_is_special(int c); * Returns True if c is an ISO-8859-6 shaped ARABIC letter (user entered) */ static int -A_is_a(cur_c) - int cur_c; +A_is_a(int cur_c) { switch (cur_c) { @@ -96,8 +95,7 @@ A_is_a(cur_c) * Returns True if c is an Isolated Form-B ARABIC letter */ static int -A_is_s(cur_c) - int cur_c; +A_is_s(int cur_c) { switch (cur_c) { @@ -148,8 +146,7 @@ A_is_s(cur_c) * Returns True if c is a Final shape of an ARABIC letter */ static int -A_is_f(cur_c) - int cur_c; +A_is_f(int cur_c) { switch (cur_c) { @@ -202,8 +199,7 @@ A_is_f(cur_c) * Change shape - from ISO-8859-6/Isolated to Form-B Isolated */ static int -chg_c_a2s(cur_c) - int cur_c; +chg_c_a2s(int cur_c) { int tempc; @@ -332,8 +328,7 @@ chg_c_a2s(cur_c) * Change shape - from ISO-8859-6/Isolated to Initial */ static int -chg_c_a2i(cur_c) - int cur_c; +chg_c_a2i(int cur_c) { int tempc; @@ -462,8 +457,7 @@ chg_c_a2i(cur_c) * Change shape - from ISO-8859-6/Isolated to Medial */ static int -chg_c_a2m(cur_c) - int cur_c; +chg_c_a2m(int cur_c) { int tempc; @@ -592,8 +586,7 @@ chg_c_a2m(cur_c) * Change shape - from ISO-8859-6/Isolated to final */ static int -chg_c_a2f(cur_c) - int cur_c; +chg_c_a2f(int cur_c) { int tempc; @@ -732,8 +725,7 @@ chg_c_a2f(cur_c) * Change shape - from Initial to Medial */ static int -chg_c_i2m(cur_c) - int cur_c; +chg_c_i2m(int cur_c) { int tempc; @@ -820,8 +812,7 @@ chg_c_i2m(cur_c) * Change shape - from Final to Medial */ static int -chg_c_f2m(cur_c) - int cur_c; +chg_c_f2m(int cur_c) { int tempc; @@ -930,8 +921,7 @@ chg_c_f2m(cur_c) * Change shape - from Combination (2 char) to an Isolated */ static int -chg_c_laa2i(hid_c) - int hid_c; +chg_c_laa2i(int hid_c) { int tempc; @@ -961,8 +951,7 @@ chg_c_laa2i(hid_c) * Change shape - from Combination-Isolated to Final */ static int -chg_c_laa2f(hid_c) - int hid_c; +chg_c_laa2f(int hid_c) { int tempc; @@ -991,8 +980,7 @@ chg_c_laa2f(hid_c) * Do "half-shaping" on character "c". Return zero if no shaping. */ static int -half_shape(c) - int c; +half_shape(int c) { if (A_is_a(c)) return chg_c_a2i(c); @@ -1011,13 +999,13 @@ half_shape(c) * in: "next_c" is the next character (not shaped). */ int -arabic_shape(c, ccp, c1p, prev_c, prev_c1, next_c) - int c; - int *ccp; - int *c1p; - int prev_c; - int prev_c1; - int next_c; +arabic_shape( + int c, + int *ccp, + int *c1p, + int prev_c, + int prev_c1, + int next_c) { int curr_c; int shape_c; @@ -1082,9 +1070,9 @@ arabic_shape(c, ccp, c1p, prev_c, prev_c1, next_c) * A_firstc_laa returns first character of LAA combination if it exists */ static int -A_firstc_laa(c, c1) - int c; /* base character */ - int c1; /* first composing character */ +A_firstc_laa( + int c, /* base character */ + int c1) /* first composing character */ { if (c1 != NUL && c == a_LAM && !A_is_harakat(c1)) return c1; @@ -1097,8 +1085,7 @@ A_firstc_laa(c, c1) * (harakat/tanween) */ static int -A_is_harakat(c) - int c; +A_is_harakat(int c) { return (c >= a_FATHATAN && c <= a_SUKUN); } @@ -1109,8 +1096,7 @@ A_is_harakat(c) * (alphabet/number/punctuation) */ static int -A_is_iso(c) - int c; +A_is_iso(int c) { return ((c >= a_HAMZA && c <= a_GHAIN) || (c >= a_TATWEEL && c <= a_HAMZA_BELOW) @@ -1123,8 +1109,7 @@ A_is_iso(c) * (alphabet/number/punctuation) */ static int -A_is_formb(c) - int c; +A_is_formb(int c) { return ((c >= a_s_FATHATAN && c <= a_s_DAMMATAN) || c == a_s_KASRATAN @@ -1137,8 +1122,7 @@ A_is_formb(c) * A_is_ok returns TRUE if 'c' is an Arabic 10646 (8859-6 or Form-B) */ static int -A_is_ok(c) - int c; +A_is_ok(int c) { return (A_is_iso(c) || A_is_formb(c)); } @@ -1149,8 +1133,7 @@ A_is_ok(c) * with some exceptions/exclusions */ static int -A_is_valid(c) - int c; +A_is_valid(int c) { return (A_is_ok(c) && !A_is_special(c)); } @@ -1161,8 +1144,7 @@ A_is_valid(c) * Specials don't adhere to most of the rules. */ static int -A_is_special(c) - int c; +A_is_special(int c) { return (c == a_HAMZA || c == a_s_HAMZA); } diff --git a/src/blowfish.c b/src/blowfish.c index 2191bafbea..d24aa2c745 100644 --- a/src/blowfish.c +++ b/src/blowfish.c @@ -348,10 +348,10 @@ static UINT32_T sbx_init[4][256] = { bfs->sbx[3][xr & 0xFF]; static void -bf_e_block(bfs, p_xl, p_xr) - bf_state_T *bfs; - UINT32_T *p_xl; - UINT32_T *p_xr; +bf_e_block( + bf_state_T *bfs, + UINT32_T *p_xl, + UINT32_T *p_xr) { UINT32_T temp; UINT32_T xl = *p_xl; @@ -384,9 +384,9 @@ bf_e_block(bfs, p_xl, p_xr) #endif static void -bf_e_cblock(bfs, block) - bf_state_T *bfs; - char_u *block; +bf_e_cblock( + bf_state_T *bfs, + char_u *block) { block8 bk; @@ -404,11 +404,11 @@ bf_e_cblock(bfs, block) * "salt[salt_len]" as the salt. */ static void -bf_key_init(bfs, password, salt, salt_len) - bf_state_T *bfs; - char_u *password; - char_u *salt; - int salt_len; +bf_key_init( + bf_state_T *bfs, + char_u *password, + char_u *salt, + int salt_len) { int i, j, keypos = 0; unsigned u; @@ -470,10 +470,10 @@ bf_key_init(bfs, password, salt, salt_len) * Blowfish self-test for corrupted tables or instructions. */ static int -bf_check_tables(pax, sbx, val) - UINT32_T pax[18]; - UINT32_T sbx[4][256]; - UINT32_T val; +bf_check_tables( + UINT32_T pax[18], + UINT32_T sbx[4][256], + UINT32_T val) { int i, j; UINT32_T c = 0; @@ -514,7 +514,7 @@ static struct_bf_test_data bf_test_data[] = { * Return FAIL when there is something wrong with blowfish encryption. */ static int -bf_self_test() +bf_self_test(void) { int i, bn; int err = 0; @@ -566,10 +566,10 @@ bf_self_test() * Initialize with seed "seed[seed_len]". */ static void -bf_cfb_init(bfs, seed, seed_len) - bf_state_T *bfs; - char_u *seed; - int seed_len; +bf_cfb_init( + bf_state_T *bfs, + char_u *seed, + int seed_len) { int i, mi; @@ -602,11 +602,11 @@ bf_cfb_init(bfs, seed, seed_len) * "from" and "to" can be equal to encrypt in place. */ void -crypt_blowfish_encode(state, from, len, to) - cryptstate_T *state; - char_u *from; - size_t len; - char_u *to; +crypt_blowfish_encode( + cryptstate_T *state, + char_u *from, + size_t len, + char_u *to) { bf_state_T *bfs = state->method_state; size_t i; @@ -625,11 +625,11 @@ crypt_blowfish_encode(state, from, len, to) * Decrypt "from[len]" into "to[len]". */ void -crypt_blowfish_decode(state, from, len, to) - cryptstate_T *state; - char_u *from; - size_t len; - char_u *to; +crypt_blowfish_decode( + cryptstate_T *state, + char_u *from, + size_t len, + char_u *to) { bf_state_T *bfs = state->method_state; size_t i; @@ -644,13 +644,13 @@ crypt_blowfish_decode(state, from, len, to) } void -crypt_blowfish_init(state, key, salt, salt_len, seed, seed_len) - cryptstate_T *state; - char_u* key; - char_u* salt; - int salt_len; - char_u* seed; - int seed_len; +crypt_blowfish_init( + cryptstate_T *state, + char_u* key, + char_u* salt, + int salt_len, + char_u* seed, + int seed_len) { bf_state_T *bfs = (bf_state_T *)alloc_clear(sizeof(bf_state_T)); @@ -672,7 +672,7 @@ crypt_blowfish_init(state, key, salt, salt_len, seed, seed_len) * Give an error and return FAIL when not. */ int -blowfish_self_test() +blowfish_self_test(void) { if (sha256_self_test() == FAIL) { diff --git a/src/buffer.c b/src/buffer.c index 92513cc27d..9f61eefd1c 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -73,10 +73,10 @@ static char *e_auabort = N_("E855: Autocommands caused command to abort"); * Return FAIL for failure, OK otherwise. */ int -open_buffer(read_stdin, eap, flags) - int read_stdin; /* read file from stdin */ - exarg_T *eap; /* for forced 'ff' and 'fenc' or NULL */ - int flags; /* extra flags for readfile() */ +open_buffer( + int read_stdin, /* read file from stdin */ + exarg_T *eap, /* for forced 'ff' and 'fenc' or NULL */ + int flags) /* extra flags for readfile() */ { int retval = OK; #ifdef FEAT_AUTOCMD @@ -307,8 +307,7 @@ open_buffer(read_stdin, eap, flags) * Return TRUE if "buf" points to a valid buffer (in the buffer list). */ int -buf_valid(buf) - buf_T *buf; +buf_valid(buf_T *buf) { buf_T *bp; @@ -336,11 +335,11 @@ buf_valid(buf) * supposed to close the window but autocommands close all other windows. */ void -close_buffer(win, buf, action, abort_if_last) - win_T *win; /* if not NULL, set b_last_cursor */ - buf_T *buf; - int action; - int abort_if_last UNUSED; +close_buffer( + win_T *win, /* if not NULL, set b_last_cursor */ + buf_T *buf, + int action, + int abort_if_last UNUSED) { #ifdef FEAT_AUTOCMD int is_curbuf; @@ -538,8 +537,7 @@ aucmd_abort: * Make buffer not contain a file. */ void -buf_clear_file(buf) - buf_T *buf; +buf_clear_file(buf_T *buf) { buf->b_ml.ml_line_count = 1; unchanged(buf, TRUE); @@ -567,9 +565,7 @@ buf_clear_file(buf) * BFA_KEEP_UNDO do not free undo information */ void -buf_freeall(buf, flags) - buf_T *buf; - int flags; +buf_freeall(buf_T *buf, int flags) { #ifdef FEAT_AUTOCMD int is_curbuf = (buf == curbuf); @@ -653,8 +649,7 @@ buf_freeall(buf, flags) * itself (not the file, that must have been done already). */ static void -free_buffer(buf) - buf_T *buf; +free_buffer(buf_T *buf) { free_buffer_stuff(buf, TRUE); #ifdef FEAT_EVAL @@ -696,9 +691,9 @@ free_buffer(buf) * Free stuff in the buffer for ":bdel" and when wiping out the buffer. */ static void -free_buffer_stuff(buf, free_options) - buf_T *buf; - int free_options; /* free options as well */ +free_buffer_stuff( + buf_T *buf, + int free_options) /* free options as well */ { if (free_options) { @@ -735,8 +730,7 @@ free_buffer_stuff(buf, free_options) * Free the b_wininfo list for buffer "buf". */ static void -clear_wininfo(buf) - buf_T *buf; +clear_wininfo(buf_T *buf) { wininfo_T *wip; @@ -760,11 +754,11 @@ clear_wininfo(buf) * Go to another buffer. Handles the result of the ATTENTION dialog. */ void -goto_buffer(eap, start, dir, count) - exarg_T *eap; - int start; - int dir; - int count; +goto_buffer( + exarg_T *eap, + int start, + int dir, + int count) { # if defined(FEAT_WINDOWS) && defined(HAS_SWAP_EXISTS_ACTION) buf_T *old_curbuf = curbuf; @@ -807,8 +801,7 @@ goto_buffer(eap, start, dir, count) * It is allowed for "old_curbuf" to be NULL or invalid. */ void -handle_swap_exists(old_curbuf) - buf_T *old_curbuf; +handle_swap_exists(buf_T *old_curbuf) { # if defined(FEAT_AUTOCMD) && defined(FEAT_EVAL) cleanup_T cs; @@ -889,13 +882,13 @@ handle_swap_exists(old_curbuf) * Returns error message or NULL */ char_u * -do_bufdel(command, arg, addr_count, start_bnr, end_bnr, forceit) - int command; - char_u *arg; /* pointer to extra arguments */ - int addr_count; - int start_bnr; /* first buffer number in a range */ - int end_bnr; /* buffer nr or last buffer nr in a range */ - int forceit; +do_bufdel( + int command, + char_u *arg, /* pointer to extra arguments */ + int addr_count, + int start_bnr, /* first buffer number in a range */ + int end_bnr, /* buffer nr or last buffer nr in a range */ + int forceit) { int do_current = 0; /* delete current buffer? */ int deleted = 0; /* number of buffers deleted */ @@ -1013,10 +1006,10 @@ static int empty_curbuf(int close_others, int forceit, int action); * Used when it is wiped out and it's the last buffer. */ static int -empty_curbuf(close_others, forceit, action) - int close_others; - int forceit; - int action; +empty_curbuf( + int close_others, + int forceit, + int action) { int retval; buf_T *buf = curbuf; @@ -1067,12 +1060,12 @@ empty_curbuf(close_others, forceit, action) * Return FAIL or OK. */ int -do_buffer(action, start, dir, count, forceit) - int action; - int start; - int dir; /* FORWARD or BACKWARD */ - int count; /* buffer number or number of buffers */ - int forceit; /* TRUE for :...! */ +do_buffer( + int action, + int start, + int dir, /* FORWARD or BACKWARD */ + int count, /* buffer number or number of buffers */ + int forceit) /* TRUE for :...! */ { buf_T *buf; buf_T *bp; @@ -1428,9 +1421,7 @@ do_buffer(action, start, dir, count, forceit) * DOBUF_WIPE wipe it out */ void -set_curbuf(buf, action) - buf_T *buf; - int action; +set_curbuf(buf_T *buf, int action) { buf_T *prevbuf; int unload = (action == DOBUF_UNLOAD || action == DOBUF_DEL @@ -1517,8 +1508,7 @@ set_curbuf(buf, action) * be pointing to freed memory. */ void -enter_buffer(buf) - buf_T *buf; +enter_buffer(buf_T *buf) { /* Copy buffer and window local option values. Not for a help buffer. */ buf_copy_options(buf, BCO_ENTER | BCO_NOHELP); @@ -1629,7 +1619,7 @@ enter_buffer(buf) * Change to the directory of the current buffer. */ void -do_autochdir() +do_autochdir(void) { if (curbuf->b_ffname != NULL && vim_chdirfile(curbuf->b_ffname) == OK) shorten_fnames(TRUE); @@ -1652,11 +1642,11 @@ do_autochdir() static int top_file_num = 1; /* highest file number */ buf_T * -buflist_new(ffname, sfname, lnum, flags) - char_u *ffname; /* full path of fname or relative */ - char_u *sfname; /* short fname or NULL */ - linenr_T lnum; /* preferred cursor line */ - int flags; /* BLN_ defines */ +buflist_new( + char_u *ffname, /* full path of fname or relative */ + char_u *sfname, /* short fname or NULL */ + linenr_T lnum, /* preferred cursor line */ + int flags) /* BLN_ defines */ { buf_T *buf; #ifdef UNIX @@ -1899,9 +1889,9 @@ buflist_new(ffname, sfname, lnum, flags) * 'fileencoding'. */ void -free_buf_options(buf, free_p_ff) - buf_T *buf; - int free_p_ff; +free_buf_options( + buf_T *buf, + int free_p_ff) { if (free_p_ff) { @@ -2019,11 +2009,11 @@ free_buf_options(buf, free_p_ff) * return FAIL for failure, OK for success */ int -buflist_getfile(n, lnum, options, forceit) - int n; - linenr_T lnum; - int options; - int forceit; +buflist_getfile( + int n, + linenr_T lnum, + int options, + int forceit) { buf_T *buf; #ifdef FEAT_WINDOWS @@ -2120,7 +2110,7 @@ buflist_getfile(n, lnum, options, forceit) * go to the last know line number for the current buffer */ void -buflist_getfpos() +buflist_getfpos(void) { pos_T *fpos; @@ -2148,8 +2138,7 @@ buflist_getfpos() * Returns NULL if not found. */ buf_T * -buflist_findname_exp(fname) - char_u *fname; +buflist_findname_exp(char_u *fname) { char_u *ffname; buf_T *buf = NULL; @@ -2178,8 +2167,7 @@ buflist_findname_exp(fname) * Returns NULL if not found. */ buf_T * -buflist_findname(ffname) - char_u *ffname; +buflist_findname(char_u *ffname) { #ifdef UNIX struct stat st; @@ -2195,9 +2183,9 @@ buflist_findname(ffname) * Returns NULL if not found. */ static buf_T * -buflist_findname_stat(ffname, stp) - char_u *ffname; - struct stat *stp; +buflist_findname_stat( + char_u *ffname, + struct stat *stp) { #endif buf_T *buf; @@ -2220,12 +2208,12 @@ buflist_findname_stat(ffname, stp) * Return < 0 for error. */ int -buflist_findpat(pattern, pattern_end, unlisted, diffmode, curtab_only) - char_u *pattern; - char_u *pattern_end; /* pointer to first char after pattern */ - int unlisted; /* find unlisted buffers */ - int diffmode UNUSED; /* find diff-mode buffers only */ - int curtab_only; /* find buffers in current tab only */ +buflist_findpat( + char_u *pattern, + char_u *pattern_end, /* pointer to first char after pattern */ + int unlisted, /* find unlisted buffers */ + int diffmode UNUSED, /* find diff-mode buffers only */ + int curtab_only) /* find buffers in current tab only */ { buf_T *buf; int match = -1; @@ -2350,11 +2338,11 @@ buflist_findpat(pattern, pattern_end, unlisted, diffmode, curtab_only) * Return OK if matches found, FAIL otherwise. */ int -ExpandBufnames(pat, num_file, file, options) - char_u *pat; - int *num_file; - char_u ***file; - int options; +ExpandBufnames( + char_u *pat, + int *num_file, + char_u ***file, + int options) { int count = 0; buf_T *buf; @@ -2455,10 +2443,10 @@ ExpandBufnames(pat, num_file, file, options) * Check for a match on the file name for buffer "buf" with regprog "prog". */ static char_u * -buflist_match(rmp, buf, ignore_case) - regmatch_T *rmp; - buf_T *buf; - int ignore_case; /* when TRUE ignore case, when FALSE use 'fic' */ +buflist_match( + regmatch_T *rmp, + buf_T *buf, + int ignore_case) /* when TRUE ignore case, when FALSE use 'fic' */ { char_u *match; @@ -2475,10 +2463,10 @@ buflist_match(rmp, buf, ignore_case) * Return "name" when there is a match, NULL when not. */ static char_u * -fname_match(rmp, name, ignore_case) - regmatch_T *rmp; - char_u *name; - int ignore_case; /* when TRUE ignore case, when FALSE use 'fic' */ +fname_match( + regmatch_T *rmp, + char_u *name, + int ignore_case) /* when TRUE ignore case, when FALSE use 'fic' */ { char_u *match = NULL; char_u *p; @@ -2507,8 +2495,7 @@ fname_match(rmp, name, ignore_case) * find file in buffer list by number */ buf_T * -buflist_findnr(nr) - int nr; +buflist_findnr(int nr) { buf_T *buf; @@ -2527,10 +2514,10 @@ buflist_findnr(nr) * Returns a pointer to allocated memory, of NULL when failed. */ char_u * -buflist_nr2name(n, fullname, helptail) - int n; - int fullname; - int helptail; /* for help buffers return tail only */ +buflist_nr2name( + int n, + int fullname, + int helptail) /* for help buffers return tail only */ { buf_T *buf; @@ -2547,12 +2534,12 @@ buflist_nr2name(n, fullname, helptail) * When "lnum" is 0 only do the options. */ static void -buflist_setfpos(buf, win, lnum, col, copy_options) - buf_T *buf; - win_T *win; - linenr_T lnum; - colnr_T col; - int copy_options; +buflist_setfpos( + buf_T *buf, + win_T *win, + linenr_T lnum, + colnr_T col, + int copy_options) { wininfo_T *wip; @@ -2620,8 +2607,7 @@ static int wininfo_other_tab_diff(wininfo_T *wip); * page. That's because a diff is local to a tab page. */ static int -wininfo_other_tab_diff(wip) - wininfo_T *wip; +wininfo_other_tab_diff(wininfo_T *wip) { win_T *wp; @@ -2646,9 +2632,9 @@ wininfo_other_tab_diff(wip) * Returns NULL when there isn't any info. */ static wininfo_T * -find_wininfo(buf, skip_diff_buffer) - buf_T *buf; - int skip_diff_buffer UNUSED; +find_wininfo( + buf_T *buf, + int skip_diff_buffer UNUSED) { wininfo_T *wip; @@ -2685,8 +2671,7 @@ find_wininfo(buf, skip_diff_buffer) * global values for the window. */ void -get_winopts(buf) - buf_T *buf; +get_winopts(buf_T *buf) { wininfo_T *wip; @@ -2724,8 +2709,7 @@ get_winopts(buf) * Returns a pointer to no_position if no position is found. */ pos_T * -buflist_findfpos(buf) - buf_T *buf; +buflist_findfpos(buf_T *buf) { wininfo_T *wip; static pos_T no_position = INIT_POS_T(1, 0, 0); @@ -2741,8 +2725,7 @@ buflist_findfpos(buf) * Find the lnum for the buffer 'buf' for the current window. */ linenr_T -buflist_findlnum(buf) - buf_T *buf; +buflist_findlnum(buf_T *buf) { return buflist_findfpos(buf)->lnum; } @@ -2752,8 +2735,7 @@ buflist_findlnum(buf) * List all know file names (for :files and :buffers command). */ void -buflist_list(eap) - exarg_T *eap; +buflist_list(exarg_T *eap) { buf_T *buf; int len; @@ -2820,10 +2802,10 @@ buflist_list(eap) * Return FAIL if not found, OK for success. */ int -buflist_name_nr(fnum, fname, lnum) - int fnum; - char_u **fname; - linenr_T *lnum; +buflist_name_nr( + int fnum, + char_u **fname, + linenr_T *lnum) { buf_T *buf; @@ -2844,10 +2826,11 @@ buflist_name_nr(fnum, fname, lnum) * OK otherwise. */ int -setfname(buf, ffname, sfname, message) - buf_T *buf; - char_u *ffname, *sfname; - int message; /* give message when buffer already exists */ +setfname( + buf_T *buf, + char_u *ffname, + char_u *sfname, + int message) /* give message when buffer already exists */ { buf_T *obuf = NULL; #ifdef UNIX @@ -2941,9 +2924,7 @@ setfname(buf, ffname, sfname, message) * The name should be relative to the current directory. */ void -buf_set_name(fnum, name) - int fnum; - char_u *name; +buf_set_name(int fnum, char_u *name) { buf_T *buf; @@ -2966,8 +2947,7 @@ buf_set_name(fnum, name) * changed. */ void -buf_name_changed(buf) - buf_T *buf; +buf_name_changed(buf_T *buf) { /* * If the file name changed, also change the name of the swapfile @@ -2994,10 +2974,10 @@ buf_name_changed(buf) * Return the buffer. */ buf_T * -setaltfname(ffname, sfname, lnum) - char_u *ffname; - char_u *sfname; - linenr_T lnum; +setaltfname( + char_u *ffname, + char_u *sfname, + linenr_T lnum) { buf_T *buf; @@ -3013,8 +2993,8 @@ setaltfname(ffname, sfname, lnum) * Return NULL if there isn't any, and give error message if requested. */ char_u * -getaltfname(errmsg) - int errmsg; /* give error message */ +getaltfname( + int errmsg) /* give error message */ { char_u *fname; linenr_T dummy; @@ -3035,9 +3015,7 @@ getaltfname(errmsg) * used by qf_init(), main() and doarglist() */ int -buflist_add(fname, flags) - char_u *fname; - int flags; +buflist_add(char_u *fname, int flags) { buf_T *buf; @@ -3052,7 +3030,7 @@ buflist_add(fname, flags) * Adjust slashes in file names. Called after 'shellslash' was set. */ void -buflist_slash_adjust() +buflist_slash_adjust(void) { buf_T *bp; @@ -3071,8 +3049,7 @@ buflist_slash_adjust() * Also save the local window option values. */ void -buflist_altfpos(win) - win_T *win; +buflist_altfpos(win_T *win) { buflist_setfpos(curbuf, win, win->w_cursor.lnum, win->w_cursor.col, TRUE); } @@ -3082,8 +3059,7 @@ buflist_altfpos(win) * Fname must have a full path (expanded by mch_FullName()). */ int -otherfile(ffname) - char_u *ffname; +otherfile(char_u *ffname) { return otherfile_buf(curbuf, ffname #ifdef UNIX @@ -3093,16 +3069,13 @@ otherfile(ffname) } static int -otherfile_buf(buf, ffname +otherfile_buf( + buf_T *buf, + char_u *ffname #ifdef UNIX - , stp -#endif - ) - buf_T *buf; - char_u *ffname; -#ifdef UNIX - struct stat *stp; + , struct stat *stp #endif + ) { /* no name is different */ if (ffname == NULL || *ffname == NUL || buf->b_ffname == NULL) @@ -3146,8 +3119,7 @@ otherfile_buf(buf, ffname * Must always be called when b_fname is changed!. */ void -buf_setino(buf) - buf_T *buf; +buf_setino(buf_T *buf) { struct stat st; @@ -3165,9 +3137,9 @@ buf_setino(buf) * Return TRUE if dev/ino in buffer "buf" matches with "stp". */ static int -buf_same_ino(buf, stp) - buf_T *buf; - struct stat *stp; +buf_same_ino( + buf_T *buf, + struct stat *stp) { return (buf->b_dev_valid && stp->st_dev == buf->b_dev @@ -3179,10 +3151,10 @@ buf_same_ino(buf, stp) * Print info about the current buffer. */ void -fileinfo(fullname, shorthelp, dont_truncate) - int fullname; /* when non-zero print full path */ - int shorthelp; - int dont_truncate; +fileinfo( + int fullname, /* when non-zero print full path */ + int shorthelp, + int dont_truncate) { char_u *name; int n; @@ -3298,11 +3270,11 @@ fileinfo(fullname, shorthelp, dont_truncate) } void -col_print(buf, buflen, col, vcol) - char_u *buf; - size_t buflen; - int col; - int vcol; +col_print( + char_u *buf, + size_t buflen, + int col, + int vcol) { if (col == vcol) vim_snprintf((char *)buf, buflen, "%d", col); @@ -3319,7 +3291,7 @@ static char_u *lasttitle = NULL; static char_u *lasticon = NULL; void -maketitle() +maketitle(void) { char_u *p; char_u *t_str = NULL; @@ -3528,9 +3500,7 @@ maketitle() * Return TRUE when "*last" changed. */ static int -ti_change(str, last) - char_u *str; - char_u **last; +ti_change(char_u *str, char_u **last) { if ((str == NULL) != (*last == NULL) || (str != NULL && *last != NULL && STRCMP(str, *last) != 0)) @@ -3549,14 +3519,14 @@ ti_change(str, last) * Put current window title back (used after calling a shell) */ void -resettitle() +resettitle(void) { mch_settitle(lasttitle, lasticon); } # if defined(EXITFREE) || defined(PROTO) void -free_titles() +free_titles(void) { vim_free(lasttitle); vim_free(lasticon); @@ -3581,17 +3551,16 @@ free_titles() * or truncated if too long, fillchar is used for all whitespace. */ int -build_stl_str_hl(wp, out, outlen, fmt, use_sandbox, fillchar, - maxwidth, hltab, tabtab) - win_T *wp; - char_u *out; /* buffer to write into != NameBuff */ - size_t outlen; /* length of out[] */ - char_u *fmt; - int use_sandbox UNUSED; /* "fmt" was set insecurely, use sandbox */ - int fillchar; - int maxwidth; - struct stl_hlrec *hltab; /* return: HL attributes (can be NULL) */ - struct stl_hlrec *tabtab; /* return: tab page nrs (can be NULL) */ +build_stl_str_hl( + win_T *wp, + char_u *out, /* buffer to write into != NameBuff */ + size_t outlen, /* length of out[] */ + char_u *fmt, + int use_sandbox UNUSED, /* "fmt" was set insecurely, use sandbox */ + int fillchar, + int maxwidth, + struct stl_hlrec *hltab, /* return: HL attributes (can be NULL) */ + struct stl_hlrec *tabtab) /* return: tab page nrs (can be NULL) */ { char_u *p; char_u *s; @@ -4424,10 +4393,10 @@ build_stl_str_hl(wp, out, outlen, fmt, use_sandbox, fillchar, * using "Top", "Bot" or "All" when appropriate. */ void -get_rel_pos(wp, buf, buflen) - win_T *wp; - char_u *buf; - int buflen; +get_rel_pos( + win_T *wp, + char_u *buf, + int buflen) { long above; /* number of lines above window */ long below; /* number of lines below window */ @@ -4460,11 +4429,11 @@ get_rel_pos(wp, buf, buflen) * Return TRUE if it was appended. */ static int -append_arg_number(wp, buf, buflen, add_file) - win_T *wp; - char_u *buf; - int buflen; - int add_file; /* Add "file" before the arg number */ +append_arg_number( + win_T *wp, + char_u *buf, + int buflen, + int add_file) /* Add "file" before the arg number */ { char_u *p; @@ -4492,8 +4461,7 @@ append_arg_number(wp, buf, buflen, add_file) * Returns pointer to allocated memory (NULL for failure). */ char_u * -fix_fname(fname) - char_u *fname; +fix_fname(char_u *fname) { /* * Force expanding the path always for Unix, because symbolic links may @@ -4539,10 +4507,10 @@ fix_fname(fname) * "ffname" becomes a pointer to allocated memory (or NULL). */ void -fname_expand(buf, ffname, sfname) - buf_T *buf UNUSED; - char_u **ffname; - char_u **sfname; +fname_expand( + buf_T *buf UNUSED, + char_u **ffname, + char_u **sfname) { if (*ffname == NULL) /* if no file name given, nothing to do */ return; @@ -4571,8 +4539,7 @@ fname_expand(buf, ffname, sfname) * Get the file name for an argument list entry. */ char_u * -alist_name(aep) - aentry_T *aep; +alist_name(aentry_T *aep) { buf_T *bp; @@ -4588,10 +4555,10 @@ alist_name(aep) * do_arg_all(): Open up to 'count' windows, one for each argument. */ void -do_arg_ |