diff options
author | Bram Moolenaar <Bram@vim.org> | 2016-01-30 17:24:07 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2016-01-30 17:24:07 +0100 |
commit | 68c2f638e65d914dc6e84eb7ce2624f08af525c0 (patch) | |
tree | 051b6b7500c6ac80c45cdeff26296c5b7acb88ff /src/if_cscope.c | |
parent | 66f948e928d5e0cd3123af902aa8ac1613534c94 (diff) | |
download | vim-git-68c2f638e65d914dc6e84eb7ce2624f08af525c0.tar.gz |
patch 7.4.1208v7.4.1208
Problem: Using old style function declarations.
Solution: Change to new style function declarations. (script by Hirohito
Higashi)
Diffstat (limited to 'src/if_cscope.c')
-rw-r--r-- | src/if_cscope.c | 203 |
1 files changed, 84 insertions, 119 deletions
diff --git a/src/if_cscope.c b/src/if_cscope.c index c6acd1765..4a7290713 100644 --- a/src/if_cscope.c +++ b/src/if_cscope.c @@ -83,8 +83,7 @@ static cscmd_T cs_cmds[] = }; static void -cs_usage_msg(x) - csid_e x; +cs_usage_msg(csid_e x) { (void)EMSG2(_("E560: Usage: cs[cope] %s"), cs_cmds[(int)x].usage); } @@ -104,9 +103,7 @@ static enum * expansion. */ char_u * -get_cscope_name(xp, idx) - expand_T *xp UNUSED; - int idx; +get_cscope_name(expand_T *xp UNUSED, int idx) { int current_idx; int i; @@ -167,10 +164,10 @@ get_cscope_name(xp, idx) * Handle command line completion for :cscope command. */ void -set_context_in_cscope_cmd(xp, arg, cmdidx) - expand_T *xp; - char_u *arg; - cmdidx_T cmdidx; +set_context_in_cscope_cmd( + expand_T *xp, + char_u *arg, + cmdidx_T cmdidx) { char_u *p; @@ -210,9 +207,9 @@ set_context_in_cscope_cmd(xp, arg, cmdidx) * command function. */ static void -do_cscope_general(eap, make_split) - exarg_T *eap; - int make_split; /* whether to split window */ +do_cscope_general( + exarg_T *eap, + int make_split) /* whether to split window */ { cscmd_T *cmdp; @@ -248,8 +245,7 @@ do_cscope_general(eap, make_split) * PUBLIC: do_cscope */ void -do_cscope(eap) - exarg_T *eap; +do_cscope(exarg_T *eap) { do_cscope_general(eap, FALSE); } @@ -260,8 +256,7 @@ do_cscope(eap) * same as do_cscope, but splits window, too. */ void -do_scscope(eap) - exarg_T *eap; +do_scscope(exarg_T *eap) { do_cscope_general(eap, TRUE); } @@ -271,8 +266,7 @@ do_scscope(eap) * */ void -do_cstag(eap) - exarg_T *eap; +do_cstag(exarg_T *eap) { int ret = FALSE; @@ -354,9 +348,7 @@ do_cstag(eap) * returns TRUE if eof, FALSE otherwise */ int -cs_fgets(buf, size) - char_u *buf; - int size; +cs_fgets(char_u *buf, int size) { char *p; @@ -374,7 +366,7 @@ cs_fgets(buf, size) * called only from do_tag(), when popping the tag stack */ void -cs_free_tags() +cs_free_tags(void) { cs_manage_matches(NULL, NULL, -1, Free); } @@ -386,7 +378,7 @@ cs_free_tags() * called from do_tag() */ void -cs_print_tags() +cs_print_tags(void) { cs_manage_matches(NULL, NULL, -1, Print); } @@ -421,10 +413,7 @@ cs_print_tags() */ #if defined(FEAT_EVAL) || defined(PROTO) int -cs_connection(num, dbpath, ppath) - int num; - char_u *dbpath; - char_u *ppath; +cs_connection(int num, char_u *dbpath, char_u *ppath) { int i; @@ -486,8 +475,7 @@ cs_connection(num, dbpath, ppath) * MAXPATHL 256 */ static int -cs_add(eap) - exarg_T *eap UNUSED; +cs_add(exarg_T *eap UNUSED) { char *fname, *ppath, *flags = NULL; @@ -503,8 +491,7 @@ cs_add(eap) } static void -cs_stat_emsg(fname) - char *fname; +cs_stat_emsg(char *fname) { char *stat_emsg = _("E563: stat(%s) error: %d"); char *buf = (char *)alloc((unsigned)strlen(stat_emsg) + MAXPATHL + 10); @@ -528,10 +515,10 @@ cs_stat_emsg(fname) * routine uses a number of goto statements. */ static int -cs_add_common(arg1, arg2, flags) - char *arg1; /* filename - may contain environment variables */ - char *arg2; /* prepend path - may contain environment variables */ - char *flags; +cs_add_common( + char *arg1, /* filename - may contain environment variables */ + char *arg2, /* prepend path - may contain environment variables */ + char *flags) { struct stat statbuf; int ret; @@ -665,14 +652,14 @@ add_err: static int -cs_check_for_connections() +cs_check_for_connections(void) { return (cs_cnt_connections() > 0); } /* cs_check_for_connections */ static int -cs_check_for_tags() +cs_check_for_tags(void) { return (p_tags[0] != NUL && curbuf->b_p_tags != NULL); } /* cs_check_for_tags */ @@ -684,7 +671,7 @@ cs_check_for_tags() * count the number of cscope connections */ static int -cs_cnt_connections() +cs_cnt_connections(void) { short i; short cnt = 0; @@ -698,8 +685,8 @@ cs_cnt_connections() } /* cs_cnt_connections */ static void -cs_reading_emsg(idx) - int idx; /* connection index */ +cs_reading_emsg( + int idx) /* connection index */ { EMSGN(_("E262: error reading cscope connection %ld"), idx); } @@ -711,8 +698,7 @@ cs_reading_emsg(idx) * count the number of matches for a given cscope connection. */ static int -cs_cnt_matches(idx) - int idx; +cs_cnt_matches(int idx) { char *stok; char *buf; @@ -773,9 +759,7 @@ cs_cnt_matches(idx) * Creates the actual cscope command query from what the user entered. */ static char * -cs_create_cmd(csoption, pattern) - char *csoption; - char *pattern; +cs_create_cmd(char *csoption, char *pattern) { char *cmd; short search; @@ -836,8 +820,7 @@ cs_create_cmd(csoption, pattern) * the BSD license notice? */ static int -cs_create_connection(i) - int i; +cs_create_connection(int i) { #ifdef UNIX int to_cs[2], from_cs[2]; @@ -1082,8 +1065,7 @@ err_closing: * returns TRUE if we jump to a tag or abort, FALSE if not. */ static int -cs_find(eap) - exarg_T *eap; +cs_find(exarg_T *eap) { char *opt, *pat; int i; @@ -1126,13 +1108,13 @@ cs_find(eap) * common code for cscope find, shared by cs_find() and do_cstag() */ static int -cs_find_common(opt, pat, forceit, verbose, use_ll, cmdline) - char *opt; - char *pat; - int forceit; - int verbose; - int use_ll UNUSED; - char_u *cmdline UNUSED; +cs_find_common( + char *opt, + char *pat, + int forceit, + int verbose, + int use_ll UNUSED, + char_u *cmdline UNUSED) { int i; char *cmd; @@ -1344,8 +1326,7 @@ cs_find_common(opt, pat, forceit, verbose, use_ll, cmdline) * print help */ static int -cs_help(eap) - exarg_T *eap UNUSED; +cs_help(exarg_T *eap UNUSED) { cscmd_T *cmdp = cs_cmds; @@ -1382,8 +1363,7 @@ cs_help(eap) static void -clear_csinfo(i) - int i; +clear_csinfo(int i) { csinfo[i].fname = NULL; csinfo[i].ppath = NULL; @@ -1408,7 +1388,7 @@ clear_csinfo(i) static char *GetWin32Error(void); static char * -GetWin32Error() +GetWin32Error(void) { char *msg = NULL; FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER|FORMAT_MESSAGE_FROM_SYSTEM, @@ -1430,11 +1410,11 @@ GetWin32Error() * insert a new cscope database filename into the filelist */ static int -cs_insert_filelist(fname, ppath, flags, sb) - char *fname; - char *ppath; - char *flags; - struct stat *sb UNUSED; +cs_insert_filelist( + char *fname, + char *ppath, + char *flags, + struct stat *sb UNUSED) { short i, j; #ifndef UNIX @@ -1577,8 +1557,7 @@ cs_insert_filelist(fname, ppath, flags, sb) * find cscope command in command table */ static cscmd_T * -cs_lookup_cmd(eap) - exarg_T *eap; +cs_lookup_cmd(exarg_T *eap) { cscmd_T *cmdp; char *stok; @@ -1609,8 +1588,7 @@ cs_lookup_cmd(eap) * nuke em */ static int -cs_kill(eap) - exarg_T *eap UNUSED; +cs_kill(exarg_T *eap UNUSED) { char *stok; short i; @@ -1667,9 +1645,9 @@ cs_kill(eap) * Actually kills a specific cscope connection. */ static void -cs_kill_execute(i, cname) - int i; /* cscope table index */ - char *cname; /* cscope database name */ +cs_kill_execute( + int i, /* cscope table index */ + char *cname) /* cscope database name */ { if (p_csverbose) { @@ -1702,11 +1680,11 @@ cs_kill_execute(i, cname) * characters to comply with ctags formatting. */ static char * -cs_make_vim_style_matches(fname, slno, search, tagstr) - char *fname; - char *slno; - char *search; - char *tagstr; +cs_make_vim_style_matches( + char *fname, + char *slno, + char *search, + char *tagstr) { /* vim style is ctags: * @@ -1762,11 +1740,11 @@ cs_make_vim_style_matches(fname, slno, search, tagstr) * Print: prints the tags */ static char * -cs_manage_matches(matches, contexts, totmatches, cmd) - char **matches; - char **contexts; - int totmatches; - mcmd_e cmd; +cs_manage_matches( + char **matches, + char **contexts, + int totmatches, + mcmd_e cmd) { static char **mp = NULL; static char **cp = NULL; @@ -1829,13 +1807,13 @@ cs_manage_matches(matches, contexts, totmatches, cmd) * parse cscope output */ static char * -cs_parse_results(cnumber, buf, bufsize, context, linenumber, search) - int cnumber; - char *buf; - int bufsize; - char **context; - char **linenumber; - char **search; +cs_parse_results( + int cnumber, + char *buf, + int bufsize, + char **context, + char **linenumber, + char **search) { int ch; char *p; @@ -1892,9 +1870,7 @@ cs_parse_results(cnumber, buf, bufsize, context, linenumber, search) * write cscope find results to file */ static void -cs_file_results(f, nummatches_a) - FILE *f; - int *nummatches_a; +cs_file_results(FILE *f, int *nummatches_a) { int i, j; char *buf; @@ -1951,13 +1927,13 @@ cs_file_results(f, nummatches_a) * When there are no matches sets "*matches_p" to NULL. */ static void -cs_fill_results(tagstr, totmatches, nummatches_a, matches_p, cntxts_p, matched) - char *tagstr; - int totmatches; - int *nummatches_a; - char ***matches_p; - char ***cntxts_p; - int *matched; +cs_fill_results( + char *tagstr, + int totmatches, + int *nummatches_a, + char ***matches_p, + char ***cntxts_p, + int *matched) { int i, j; char *buf; @@ -2031,8 +2007,7 @@ parse_out: /* get the requested path components */ static char * -cs_pathcomponents(path) - char *path; +cs_pathcomponents(char *path) { int i; char *s; @@ -2063,10 +2038,7 @@ cs_pathcomponents(path) * called from cs_manage_matches() */ static void -cs_print_tags_priv(matches, cntxts, num_matches) - char **matches; - char **cntxts; - int num_matches; +cs_print_tags_priv(char **matches, char **cntxts, int num_matches) { char *buf = NULL; char *t_buf; @@ -2212,8 +2184,7 @@ cs_print_tags_priv(matches, cntxts, num_matches) * read a cscope prompt (basically, skip over the ">> ") */ static int -cs_read_prompt(i) - int i; +cs_read_prompt(int i) { int ch; char *buf = NULL; /* buffer for possible error message from cscope */ @@ -2312,9 +2283,7 @@ sig_handler SIGDEFARG(sigarg) * or not to free the filename. Called by cs_kill and cs_reset. */ static void -cs_release_csp(i, freefnpp) - int i; - int freefnpp; +cs_release_csp(int i, int freefnpp) { /* * Trying to exit normally (not sure whether it is fit to UNIX cscope @@ -2441,8 +2410,7 @@ cs_release_csp(i, freefnpp) * calls cs_kill on all cscope connections then reinits */ static int -cs_reset(eap) - exarg_T *eap UNUSED; +cs_reset(exarg_T *eap UNUSED) { char **dblist = NULL, **pplist = NULL, **fllist = NULL; int i; @@ -2514,9 +2482,7 @@ cs_reset(eap) * Contrast this with my development system (Digital Unix), which does. */ static char * -cs_resolve_file(i, name) - int i; - char *name; +cs_resolve_file(int i, char *name) { char *fullname; int len; @@ -2580,8 +2546,7 @@ cs_resolve_file(i, name) * show all cscope connections */ static int -cs_show(eap) - exarg_T *eap UNUSED; +cs_show(exarg_T *eap UNUSED) { short i; if (cs_cnt_connections() == 0) @@ -2616,7 +2581,7 @@ cs_show(eap) * Only called when VIM exits to quit any cscope sessions. */ void -cs_end() +cs_end(void) { int i; |