diff options
author | Bram Moolenaar <Bram@vim.org> | 2016-01-30 20:31:25 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2016-01-30 20:31:25 +0100 |
commit | 055409764ca5f7978d4c399d2c440af0ce971c4f (patch) | |
tree | d3f9b0d26c4e371720910e462e2ec918e19d5792 /src/regexp.c | |
parent | c1ab67674aa0dfdcf9f0e9701ac248e3eb41b19c (diff) | |
download | vim-055409764ca5f7978d4c399d2c440af0ce971c4f.zip |
patch 7.4.1213
Problem: Using old style function declarations.
Solution: Change to new style function declarations. (script by Hirohito
Higashi)
Diffstat (limited to 'src/regexp.c')
-rw-r--r-- | src/regexp.c | 423 |
1 files changed, 165 insertions, 258 deletions
diff --git a/src/regexp.c b/src/regexp.c index f954141fe..a07c6f411 100644 --- a/src/regexp.c +++ b/src/regexp.c @@ -259,8 +259,7 @@ static int no_Magic(int x); static int toggle_Magic(int x); static int -no_Magic(x) - int x; +no_Magic(int x) { if (is_Magic(x)) return un_Magic(x); @@ -268,8 +267,7 @@ no_Magic(x) } static int -toggle_Magic(x) - int x; +toggle_Magic(int x) { if (is_Magic(x)) return un_Magic(x); @@ -379,8 +377,7 @@ static char_u e_empty_sb[] = N_("E70: Empty %s%%[]"); * Return MULTI_MULT if c is a multi "multi" operator. */ static int -re_multi_type(c) - int c; +re_multi_type(int c) { if (c == Magic('@') || c == Magic('=') || c == Magic('?')) return MULTI_ONE; @@ -438,8 +435,7 @@ static void init_class_tab(void); * Translate '\x' to its control character, except "\n", which is Magic. */ static int -backslash_trans(c) - int c; +backslash_trans(int c) { switch (c) { @@ -457,8 +453,7 @@ backslash_trans(c) * recognized. Otherwise "pp" is advanced to after the item. */ static int -get_char_class(pp) - char_u **pp; +get_char_class(char_u **pp) { static const char *(class_names[]) = { @@ -527,7 +522,7 @@ static short class_tab[256]; #define RI_WHITE 0x100 static void -init_class_tab() +init_class_tab(void) { int i; static int done = FALSE; @@ -738,8 +733,7 @@ static regengine_T nfa_regengine; * Return TRUE if compiled regular expression "prog" can match a line break. */ int -re_multiline(prog) - regprog_T *prog; +re_multiline(regprog_T *prog) { return (prog->regflags & RF_HASNL); } @@ -749,8 +743,7 @@ re_multiline(prog) * position (pattern contains "\@<=" or "\@<!"). */ int -re_lookbehind(prog) - regprog_T *prog; +re_lookbehind(regprog_T *prog) { return (prog->regflags & RF_LOOKBH); } @@ -761,8 +754,7 @@ re_lookbehind(prog) * recognized. Otherwise "pp" is advanced to after the item. */ static int -get_equi_class(pp) - char_u **pp; +get_equi_class(char_u **pp) { int c; int l = 1; @@ -819,8 +811,7 @@ char *EQUIVAL_CLASS_C[16] = { * NOTE: When changing this function, also change nfa_emit_equi_class() */ static void -reg_equi_class(c) - int c; +reg_equi_class(int c) { #ifdef FEAT_MBYTE if (enc_utf8 || STRCMP(p_enc, "latin1") == 0 @@ -1150,8 +1141,7 @@ reg_equi_class(c) * Currently only single characters are recognized! */ static int -get_coll_element(pp) - char_u **pp; +get_coll_element(char_u **pp) { int c; int l = 1; @@ -1183,7 +1173,7 @@ static int reg_cpo_lit; /* 'cpoptions' contains 'l' flag */ static int reg_cpo_bsl; /* 'cpoptions' contains '\' flag */ static void -get_cpo_flags() +get_cpo_flags(void) { reg_cpo_lit = vim_strchr(p_cpo, CPO_LITERAL) != NULL; reg_cpo_bsl = vim_strchr(p_cpo, CPO_BACKSL) != NULL; @@ -1195,8 +1185,7 @@ get_cpo_flags() * The returned pointer is on the matching ']', or the terminating NUL. */ static char_u * -skip_anyof(p) - char_u *p; +skip_anyof(char_u *p) { #ifdef FEAT_MBYTE int l; @@ -1249,11 +1238,11 @@ skip_anyof(p) * is changed in-place. */ char_u * -skip_regexp(startp, dirc, magic, newp) - char_u *startp; - int dirc; - int magic; - char_u **newp; +skip_regexp( + char_u *startp, + int dirc, + int magic, + char_u **newp) { int mymagic; char_u *p = startp; @@ -1327,9 +1316,7 @@ static void bt_regfree(regprog_T *prog); * "re_flags": RE_MAGIC and/or RE_STRING. */ static regprog_T * -bt_regcomp(expr, re_flags) - char_u *expr; - int re_flags; +bt_regcomp(char_u *expr, int re_flags) { bt_regprog_T *r; char_u *scan; @@ -1464,8 +1451,7 @@ bt_regcomp(expr, re_flags) * Free a compiled regexp program, returned by bt_regcomp(). */ static void -bt_regfree(prog) - regprog_T *prog; +bt_regfree(regprog_T *prog) { vim_free(prog); } @@ -1474,9 +1460,9 @@ bt_regfree(prog) * Setup to parse the regexp. Used once to get the length and once to do it. */ static void -regcomp_start(expr, re_flags) - char_u *expr; - int re_flags; /* see vim_regcomp() */ +regcomp_start( + char_u *expr, + int re_flags) /* see vim_regcomp() */ { initchr(expr); if (re_flags & RE_MAGIC) @@ -1508,7 +1494,7 @@ regcomp_start(expr, re_flags) * found. This is messy, but it works fine. */ int -vim_regcomp_had_eol() +vim_regcomp_had_eol(void) { return had_eol; } @@ -1524,9 +1510,9 @@ vim_regcomp_had_eol() * follows makes it hard to avoid. */ static char_u * -reg(paren, flagp) - int paren; /* REG_NOPAREN, REG_PAREN, REG_NPAREN or REG_ZPAREN */ - int *flagp; +reg( + int paren, /* REG_NOPAREN, REG_PAREN, REG_NPAREN or REG_ZPAREN */ + int *flagp) { char_u *ret; char_u *br; @@ -1639,8 +1625,7 @@ reg(paren, flagp) * Implements the & operator. */ static char_u * -regbranch(flagp) - int *flagp; +regbranch(int *flagp) { char_u *ret; char_u *chain = NULL; @@ -1682,8 +1667,7 @@ regbranch(flagp) * Implements the concatenation operator. */ static char_u * -regconcat(flagp) - int *flagp; +regconcat(int *flagp) { char_u *first = NULL; char_u *chain = NULL; @@ -1767,8 +1751,7 @@ regconcat(flagp) * endmarker role is not redundant. */ static char_u * -regpiece(flagp) - int *flagp; +regpiece(int *flagp) { char_u *ret; int op; @@ -1928,8 +1911,7 @@ static int classcodes[] = { * faster to run. Don't do this when one_exactly is set. */ static char_u * -regatom(flagp) - int *flagp; +regatom(int *flagp) { char_u *ret; int flags; @@ -2743,8 +2725,7 @@ do_multibyte: * character "c". */ static int -use_multibytecode(c) - int c; +use_multibytecode(int c) { return has_mbyte && (*mb_char2len)(c) > 1 && (re_multi_type(peekchr()) != NOT_MULTI @@ -2757,8 +2738,7 @@ use_multibytecode(c) * Return pointer to generated code. */ static char_u * -regnode(op) - int op; +regnode(int op) { char_u *ret; @@ -2778,8 +2758,7 @@ regnode(op) * Emit (if appropriate) a byte of code */ static void -regc(b) - int b; +regc(int b) { if (regcode == JUST_CALC_SIZE) regsize++; @@ -2792,8 +2771,7 @@ regc(b) * Emit (if appropriate) a multi-byte character of code */ static void -regmbc(c) - int c; +regmbc(int c) { if (!has_mbyte && c > 0xff) return; @@ -2810,9 +2788,7 @@ regmbc(c) * Means relocating the operand. */ static void -reginsert(op, opnd) - int op; - char_u *opnd; +reginsert(int op, char_u *opnd) { char_u *src; char_u *dst; @@ -2840,10 +2816,7 @@ reginsert(op, opnd) * Add a number to the operator. */ static void -reginsert_nr(op, val, opnd) - int op; - long val; - char_u *opnd; +reginsert_nr(int op, long val, char_u *opnd) { char_u *src; char_u *dst; @@ -2874,11 +2847,11 @@ reginsert_nr(op, val, opnd) * Means relocating the operand. */ static void -reginsert_limits(op, minval, maxval, opnd) - int op; - long minval; - long maxval; - char_u *opnd; +reginsert_limits( + int op, + long minval, + long maxval, + char_u *opnd) { char_u *src; char_u *dst; @@ -2908,9 +2881,7 @@ reginsert_limits(op, minval, maxval, opnd) * Write a long as four bytes at "p" and return pointer to the next char. */ static char_u * -re_put_long(p, val) - char_u *p; - long_u val; +re_put_long(char_u *p, long_u val) { *p++ = (char_u) ((val >> 24) & 0377); *p++ = (char_u) ((val >> 16) & 0377); @@ -2923,9 +2894,7 @@ re_put_long(p, val) * Set the next-pointer at the end of a node chain. */ static void -regtail(p, val) - char_u *p; - char_u *val; +regtail(char_u *p, char_u *val) { char_u *scan; char_u *temp; @@ -2964,9 +2933,7 @@ regtail(p, val) * Like regtail, on item after a BRANCH; nop if none. */ static void -regoptail(p, val) - char_u *p; - char_u *val; +regoptail(char_u *p, char_u *val) { /* When op is neither BRANCH nor BRACE_COMPLEX0-9, it is "operandless" */ if (p == NULL || p == JUST_CALC_SIZE @@ -2987,8 +2954,7 @@ static int prev_at_start; /* True when on the second character */ * Start parsing at "str". */ static void -initchr(str) - char_u *str; +initchr(char_u *str) { regparse = str; prevchr_len = 0; @@ -3002,8 +2968,7 @@ initchr(str) * starts in the same state again. */ static void -save_parse_state(ps) - parse_state_T *ps; +save_parse_state(parse_state_T *ps) { ps->regparse = regparse; ps->prevchr_len = prevchr_len; @@ -3020,8 +2985,7 @@ save_parse_state(ps) * Restore a previously saved parse state. */ static void -restore_parse_state(ps) - parse_state_T *ps; +restore_parse_state(parse_state_T *ps) { regparse = ps->regparse; prevchr_len = ps->prevchr_len; @@ -3039,7 +3003,7 @@ restore_parse_state(ps) * Get the next character without advancing. */ static int -peekchr() +peekchr(void) { static int after_slash = FALSE; @@ -3211,7 +3175,7 @@ peekchr() * Eat one lexed character. Do this in a way that we can undo it. */ static void -skipchr() +skipchr(void) { /* peekchr() eats a backslash, do the same here */ if (*regparse == '\\') @@ -3244,7 +3208,7 @@ skipchr() * prevchr and prevprevchr are also kept. */ static void -skipchr_keepstart() +skipchr_keepstart(void) { int as = prev_at_start; int pr = prevchr; @@ -3261,7 +3225,7 @@ skipchr_keepstart() * therefore we need a lexical analyzer. */ static int -getchr() +getchr(void) { int chr = peekchr(); @@ -3273,7 +3237,7 @@ getchr() * put character back. Works only once! */ static void -ungetchr() +ungetchr(void) { nextchr = curchr; curchr = prevchr; @@ -3296,8 +3260,7 @@ ungetchr() * 2 when reading a \%x20 sequence and 4 when reading a \%u20AC sequence. */ static int -gethexchrs(maxinputlen) - int maxinputlen; +gethexchrs(int maxinputlen) { int nr = 0; int c; @@ -3323,7 +3286,7 @@ gethexchrs(maxinputlen) * current position. Return -1 for invalid. Consumes all digits. */ static int -getdecchrs() +getdecchrs(void) { int nr = 0; int c; @@ -3354,7 +3317,7 @@ getdecchrs() * before-^ ^-after */ static int -getoctchrs() +getoctchrs(void) { int nr = 0; int c; @@ -3380,7 +3343,7 @@ getoctchrs() * When nothing is recognized return a backslash. */ static int -coll_get_char() +coll_get_char(void) { int nr = -1; @@ -3409,9 +3372,7 @@ coll_get_char() * missing, a very big number is the default. */ static int -read_limits(minval, maxval) - long *minval; - long *maxval; +read_limits(long *minval, long *maxval) { int reverse = FALSE; char_u *first_char; @@ -3694,7 +3655,7 @@ static garray_T backpos = {0, 0, 0, 0, NULL}; #if defined(EXITFREE) || defined(PROTO) void -free_regexp_stuff() +free_regexp_stuff(void) { ga_clear(®stack); ga_clear(&backpos); @@ -3707,8 +3668,7 @@ free_regexp_stuff() * Get pointer to the line "lnum", which is relative to "reg_firstlnum". */ static char_u * -reg_getline(lnum) - linenr_T lnum; +reg_getline(linenr_T lnum) { /* when looking behind for a match/no-match lnum is negative. But we * can't go before line 1 */ @@ -3744,11 +3704,11 @@ static int bt_regexec_nl(regmatch_T *rmp, char_u *line, colnr_T col, int line_l * Returns 0 for failure, number of lines contained in the match otherwise. */ static int -bt_regexec_nl(rmp, line, col, line_lbr) - regmatch_T *rmp; - char_u *line; /* string to match against */ - colnr_T col; /* column to start looking for match */ - int line_lbr; +bt_regexec_nl( + regmatch_T *rmp, + char_u *line, /* string to match against */ + colnr_T col, /* column to start looking for match */ + int line_lbr) { reg_match = rmp; reg_mmatch = NULL; @@ -3776,13 +3736,13 @@ static long bt_regexec_multi(regmmatch_T *rmp, win_T *win, buf_T *buf, linenr_T * match otherwise. */ static long -bt_regexec_multi(rmp, win, buf, lnum, col, tm) - regmmatch_T *rmp; - win_T *win; /* window in which to search or NULL */ - buf_T *buf; /* buffer in which to search */ - linenr_T lnum; /* nr of line to start looking for match */ - colnr_T col; /* column to start looking for match */ - proftime_T *tm; /* timeout limit or NULL */ +bt_regexec_multi( + regmmatch_T *rmp, + win_T *win, /* window in which to search or NULL */ + buf_T *buf, /* buffer in which to search */ + linenr_T lnum, /* nr of line to start looking for match */ + colnr_T col, /* column to start looking for match */ + proftime_T *tm) /* timeout limit or NULL */ { reg_match = NULL; reg_mmatch = rmp; @@ -3806,10 +3766,10 @@ bt_regexec_multi(rmp, win, buf, lnum, col, tm) * Returns 0 for failure, number of lines contained in the match otherwise. */ static long -bt_regexec_both(line, col, tm) - char_u *line; - colnr_T col; /* column to start looking for match */ - proftime_T *tm UNUSED; /* timeout limit or NULL */ +bt_regexec_both( + char_u *line, + colnr_T col, /* column to start looking for match */ + proftime_T *tm UNUSED) /* timeout limit or NULL */ { bt_regprog_T *prog; char_u *s; @@ -4039,7 +3999,7 @@ static reg_extmatch_T *make_extmatch(void); * Create a new extmatch and mark it as referenced once. */ static reg_extmatch_T * -make_extmatch() +make_extmatch(void) { reg_extmatch_T *em; @@ -4053,8 +4013,7 @@ make_extmatch() * Add a reference to an extmatch. */ reg_extmatch_T * -ref_extmatch(em) - reg_extmatch_T *em; +ref_extmatch(reg_extmatch_T *em) { if (em != NULL) em->refcnt++; @@ -4066,8 +4025,7 @@ ref_extmatch(em) * the info. */ void -unref_extmatch(em) - reg_extmatch_T *em; +unref_extmatch(reg_extmatch_T *em) { int i; @@ -4085,9 +4043,7 @@ unref_extmatch(em) * Returns 0 for failure, number of lines contained in the match otherwise. */ static long -regtry(prog, col) - bt_regprog_T *prog; - colnr_T col; +regtry(bt_regprog_T *prog, colnr_T col) { reginput = regline + col; need_clear_subexpr = TRUE; @@ -4168,7 +4124,7 @@ static int reg_prev_class(void); * Get class of previous character. */ static int -reg_prev_class() +reg_prev_class(void) { if (reginput > regline) return mb_get_class_buf(reginput - 1 @@ -4183,7 +4139,7 @@ static int reg_match_visual(void); * Return TRUE if the current reginput position matches the Visual area. */ static int -reg_match_visual() +reg_match_visual(void) { pos_T top, bot; linenr_T lnum; @@ -4280,8 +4236,8 @@ static long bl_maxval; * undefined state! */ static int -regmatch(scan) - char_u *scan; /* Current node. */ +regmatch( + char_u *scan) /* Current node. */ { char_u *next; /* Next node. */ int op; @@ -5768,9 +5724,7 @@ regmatch(scan) * Returns pointer to new item. Returns NULL when out of memory. */ static regitem_T * -regstack_push(state, scan) - regstate_T state; - char_u *scan; +regstack_push(regstate_T state, char_u *scan) { regitem_T *rp; @@ -5794,8 +5748,7 @@ regstack_push(state, scan) * Pop an item from the regstack. */ static void -regstack_pop(scan) - char_u **scan; +regstack_pop(char_u **scan) { regitem_T *rp; @@ -5810,9 +5763,9 @@ regstack_pop(scan) * Advances reginput (and reglnum) to just after the matched chars. */ static int -regrepeat(p, maxcount) - char_u *p; - long maxcount; /* maximum number of matches allowed */ +regrepeat( + char_u *p, + long maxcount) /* maximum number of matches allowed */ { long count = 0; char_u *scan; @@ -6207,8 +6160,7 @@ do_class: * there is an error. */ static char_u * -regnext(p) - char_u *p; +regnext(char_u *p) { int offset; @@ -6230,7 +6182,7 @@ regnext(p) * Return TRUE if it's wrong. */ static int -prog_magic_wrong() +prog_magic_wrong(void) { regprog_T *prog; @@ -6253,7 +6205,7 @@ prog_magic_wrong() * used (to increase speed). */ static void -cleanup_subexpr() +cleanup_subexpr(void) { if (need_clear_subexpr) { @@ -6274,7 +6226,7 @@ cleanup_subexpr() #ifdef FEAT_SYN_HL static void -cleanup_zsubexpr() +cleanup_zsubexpr(void) { if (need_clear_zsubexpr) { @@ -6299,8 +6251,7 @@ cleanup_zsubexpr() * later by restore_subexpr(). */ static void -save_subexpr(bp) - regbehind_T *bp; +save_subexpr(regbehind_T *bp) { int i; @@ -6329,8 +6280,7 @@ save_subexpr(bp) * Restore the subexpr from "bp". */ static void -restore_subexpr(bp) - regbehind_T *bp; +restore_subexpr(regbehind_T *bp) { int i; @@ -6358,7 +6308,7 @@ restore_subexpr(bp) * Advance reglnum, regline and reginput to the next line. */ static void -reg_nextline() +reg_nextline(void) { regline = reg_getline(++reglnum); reginput = regline; @@ -6369,9 +6319,7 @@ reg_nextline() * Save the input line and position in a regsave_T. */ static void -reg_save(save, gap) - regsave_T *save; - garray_T *gap; +reg_save(regsave_T *save, garray_T *gap) { if (REG_MULTI) { @@ -6387,9 +6335,7 @@ reg_save(save, gap) * Restore the input line and position from a regsave_T. */ static void -reg_restore(save, gap) - regsave_T *save; - garray_T *gap; +reg_restore(regsave_T *save, garray_T *gap) { if (REG_MULTI) { @@ -6411,8 +6357,7 @@ reg_restore(save, gap) * Return TRUE if current position is equal to saved position. */ static int -reg_save_equal(save) - regsave_T *save; +reg_save_equal(regsave_T *save) { if (REG_MULTI) return reglnum == save->rs_u.pos.lnum @@ -6428,9 +6373,7 @@ reg_save_equal(save) * depending on REG_MULTI. */ static void -save_se_multi(savep, posp) - save_se_T *savep; - lpos_T *posp; +save_se_multi(save_se_T *savep, lpos_T *posp) { savep->se_u.pos = *posp; posp->lnum = reglnum; @@ -6438,9 +6381,7 @@ save_se_multi(savep, posp) } static void -save_se_one(savep, pp) - save_se_T *savep; - char_u **pp; +save_se_one(save_se_T *savep, char_u **pp) { savep->se_u.ptr = *pp; *pp = reginput; @@ -6450,9 +6391,7 @@ save_se_one(savep, pp) * Compare a number with the operand of RE_LNUM, RE_COL or RE_VCOL. */ static int -re_num_cmp(val, scan) - long_u val; - char_u *scan; +re_num_cmp(long_u val, char_u *scan) { long_u n = OPERAND_MIN(scan); @@ -6470,12 +6409,12 @@ re_num_cmp(val, scan) * last line. */ static int -match_with_backref(start_lnum, start_col, end_lnum, end_col, bytelen) - linenr_T start_lnum; - colnr_T start_col; - linenr_T end_lnum; - colnr_T end_col; - int *bytelen; +match_with_backref( + linenr_T start_lnum, + colnr_T start_col, + linenr_T end_lnum, + colnr_T end_col, + int *bytelen) { linenr_T clnum = start_lnum; colnr_T ccol = start_col; @@ -6542,9 +6481,7 @@ match_with_backref(start_lnum, start_col, end_lnum, end_col, bytelen) * regdump - dump a regexp onto stdout in vaguely comprehensible form */ static void -regdump(pattern, r) - char_u *pattern; - bt_regprog_T *r; +regdump(char_u *pattern, bt_regprog_T *r) { char_u *s; int op = EXACTLY; /* Arbitrary non-END op. */ @@ -6632,8 +6569,7 @@ regdump(pattern, r) * regprop - printable representation of opcode */ static char_u * -regprop(op) - char_u *op; +regprop(char_u *op) { char *p; static char buf[50]; @@ -7016,8 +6952,7 @@ regprop(op) * Used in a place where no * or \+ can follow. */ static int -re_mult_next(what) - char *what; +re_mult_next(char *what) { if (re_multi_type(peekchr()) == MULTI_MULT) EMSG2_RET_FAIL(_("E888: (NFA regexp) cannot repeat %s"), what); @@ -7087,8 +7022,7 @@ static decomp_T decomp_table[0xfb4f-0xfb20+1] = }; static void -mb_decompose(c, c1, c2, c3) - int c, *c1, *c2, *c3; +mb_decompose(int c, int *c1, int *c2, int *c3) { decomp_T d; @@ -7113,9 +7047,7 @@ mb_decompose(c, c1, c2, c3) * Correct the length "*n" when composing characters are ignored. */ static int -cstrncmp(s1, s2, n) - char_u *s1, *s2; - int *n; +cstrncmp(char_u *s1, char_u *s2, int *n) { int result; @@ -7169,9 +7101,7 @@ cstrncmp(s1, s2, n) * cstrchr: This function is used a lot for simple searches, keep it fast! */ static char_u * -cstrchr(s, c) - char_u *s; - int c; +cstrchr(char_u *s, int c) { char_u *p; int cc; @@ -7242,9 +7172,7 @@ static fptr_T do_Lower(int *, int); static int vim_regsub_both(char_u *source, char_u *dest, int copy, int magic, int backslash); static fptr_T -do_upper(d, c) - int *d; - int c; +do_upper(int *d, int c) { *d = MB_TOUPPER(c); @@ -7252,9 +7180,7 @@ do_upper(d, c) } static fptr_T -do_Upper(d, c) - int *d; - int c; +do_Upper(int *d, int c) { *d = MB_TOUPPER(c); @@ -7262,9 +7188,7 @@ do_Upper(d, c) } static fptr_T -do_lower(d, c) - int *d; - int c; +do_lower(int *d, int c) { *d = MB_TOLOWER(c); @@ -7272,9 +7196,7 @@ do_lower(d, c) } static fptr_T -do_Lower(d, c) - int *d; - int c; +do_Lower(int *d, int c) { *d = MB_TOLOWER(c); @@ -7294,9 +7216,7 @@ do_Lower(d, c) * The tildes are parsed once before the first call to vim_regsub(). */ char_u * -regtilde(source, magic) - char_u *source; - int magic; +regtilde(char_u *source, int magic) { char_u *newsub = source; char_u *tmpsub; @@ -7389,13 +7309,13 @@ static int submatch_line_lbr; * Returns the size of the replacement, including terminating NUL. */ int -vim_regsub(rmp, source, dest, copy, magic, backslash) - regmatch_T *rmp; - char_u *source; - char_u *dest; - int copy; - int magic; - int backslash; +vim_regsub( + regmatch_T *rmp, + char_u *source, + char_u *dest, + int copy, + int magic, + int backslash) { reg_match = rmp; reg_mmatch = NULL; @@ -7407,14 +7327,14 @@ vim_regsub(rmp, source, dest, copy, magic, backslash) #endif int -vim_regsub_multi(rmp, lnum, source, dest, copy, magic, backslash) - regmmatch_T *rmp; - linenr_T lnum; - char_u *source; - char_u *dest; - int copy; - int magic; - int backslash; +vim_regsub_multi( + regmmatch_T *rmp, + linenr_T lnum, + char_u *source, + char_u *dest, + int copy, + int magic, + int backslash) { reg_match = NULL; reg_mmatch = rmp; @@ -7426,12 +7346,12 @@ vim_regsub_multi(rmp, lnum, source, dest, copy, magic, backslash) } static int -vim_regsub_both(source, dest, copy, magic, backslash) - char_u *source; - char_u *dest; - int copy; - int magic; - int backslash; +vim_regsub_both( + char_u *source, + char_u *dest, + int copy, + int magic, + int backslash) { char_u *src; char_u *dst; @@ -7811,8 +7731,7 @@ static char_u *reg_getline_submatch(linenr_T lnum); * overwritten. */ static char_u * -reg_getline_submatch(lnum) - linenr_T lnum; +reg_getline_submatch(linenr_T lnum) { char_u *s; linenr_T save_first = reg_firstlnum; @@ -7834,8 +7753,7 @@ reg_getline_submatch(lnum) * Returns NULL when not in a ":s" command and for a non-existing submatch. */ char_u * -reg_submatch(no) - int no; +reg_submatch(int no) { char_u *retval = NULL; char_u *s; @@ -7929,8 +7847,7 @@ reg_submatch(no) * command, for a non-existing submatch and for any error. */ list_T * -reg_submatch_list(no) - int no; +reg_submatch_list(int no) { char_u *s; linenr_T slnum; @@ -8040,9 +7957,7 @@ static char_u regname[][30] = { * Returns NULL for an error. */ regprog_T * -vim_regcomp(expr_arg, re_flags) - char_u *expr_arg; - int re_flags; +vim_regcomp(char_u *expr_arg, int re_flags) { regprog_T *prog = NULL; char_u *expr = expr_arg; @@ -8128,8 +8043,7 @@ vim_regcomp(expr_arg, re_flags) * Free a compiled regexp program, returned by vim_regcomp(). */ void -vim_regfree(prog) - regprog_T *prog; +vim_regfree(regprog_T *prog) { if (prog != NULL) prog->engine->regfree(prog); @@ -8139,8 +8053,7 @@ vim_regfree(prog) static void report_re_switch(char_u *pat); static void -report_re_switch(pat) - char_u *pat; +report_re_switch(char_u *pat) { if (p_verbose > 0) { @@ -8164,11 +8077,11 @@ static int vim_regexec_both(regmatch_T *rmp, char_u *line, colnr_T col, int nl); * Return TRUE if there is a match, FALSE if not. */ static int -vim_regexec_both(rmp, line, col, nl) - regmatch_T *rmp; - char_u *line; /* string to match against */ - colnr_T col; /* column to start looking for match */ - int nl; +vim_regexec_both( + regmatch_T *rmp, + char_u *line, /* string to match against */ + colnr_T col, /* column to start looking for match */ + int nl) { int result = rmp->regprog->engine->regexec_nl(rmp, line, col, nl); @@ -8203,11 +8116,11 @@ vim_regexec_both(rmp, line, col, nl) * Return TRUE if there is a match, FALSE if not. */ int -vim_regexec_prog(prog, ignore_case, line, col) - regprog_T **prog; - int ignore_case; - char_u *line; - colnr_T col; +vim_regexec_prog( + regprog_T **prog, + int ignore_case, + char_u *line, + colnr_T col) { int r; regmatch_T regmatch; @@ -8224,10 +8137,7 @@ vim_regexec_prog(prog, ignore_case, line, col) * Return TRUE if there is a match, FALSE if not. */ int -vim_regexec(rmp, line, col) - regmatch_T *rmp; - char_u *line; - colnr_T col; +vim_regexec(regmatch_T *rmp, char_u *line, colnr_T col) { return vim_regexec_both(rmp, line, col, FALSE); } @@ -8240,10 +8150,7 @@ vim_regexec(rmp, line, col) * Return TRUE if there is a match, FALSE if not. */ int -vim_regexec_nl(rmp, line, col) - regmatch_T *rmp; - char_u *line; - colnr_T col; +vim_regexec_nl(regmatch_T *rmp, char_u *line, colnr_T col) { return vim_regexec_both(rmp, line, col, TRUE); } @@ -8259,13 +8166,13 @@ vim_regexec_nl(rmp, line, col) * match otherwise. */ long -vim_regexec_multi(rmp, win, buf, lnum, col, tm) - regmmatch_T *rmp; - win_T *win; /* window in which to search or NULL */ - buf_T *buf; /* buffer in which to search */ - linenr_T lnum; /* nr of line to start looking for match */ - colnr_T col; /* column to start looking for match */ - proftime_T *tm; /* timeout limit or NULL */ +vim_regexec_multi( + regmmatch_T *rmp, + win_T *win, /* window in which to search or NULL */ + buf_T *buf, /* buffer in which to search */ + linenr_T lnum, /* nr of line to start looking for match */ + colnr_T col, /* column to start looking for match */ + proftime_T *tm) /* timeout limit or NULL */ { int result = rmp->regprog->engine->regexec_multi( rmp, win, buf, lnum, col, tm); |