comparison src/misc1.c @ 7803:37c929c4a073 v7.4.1198

commit https://github.com/vim/vim/commit/92b8b2d307e34117f146319872010b0ccc9d2713 Author: Bram Moolenaar <Bram@vim.org> Date: Fri Jan 29 22:36:45 2016 +0100 patch 7.4.1198 Problem: Still using __ARGS. Solution: Remove __ARGS in several files. (script by Hirohito Higashi) Also remove use of HAVE_STDARG_H.
author Christian Brabandt <cb@256bit.org>
date Fri, 29 Jan 2016 22:45:06 +0100
parents b44fc33ef92a
children 2a8d6b2dd925
comparison
equal deleted inserted replaced
7802:d9180d8cfe40 7803:37c929c4a073
12 */ 12 */
13 13
14 #include "vim.h" 14 #include "vim.h"
15 #include "version.h" 15 #include "version.h"
16 16
17 static char_u *vim_version_dir __ARGS((char_u *vimdir)); 17 static char_u *vim_version_dir(char_u *vimdir);
18 static char_u *remove_tail __ARGS((char_u *p, char_u *pend, char_u *name)); 18 static char_u *remove_tail(char_u *p, char_u *pend, char_u *name);
19 #if defined(FEAT_CMDL_COMPL) 19 #if defined(FEAT_CMDL_COMPL)
20 static void init_users __ARGS((void)); 20 static void init_users(void);
21 #endif 21 #endif
22 static int copy_indent __ARGS((int size, char_u *src)); 22 static int copy_indent(int size, char_u *src);
23 23
24 /* All user names (for ~user completion as done by shell). */ 24 /* All user names (for ~user completion as done by shell). */
25 #if defined(FEAT_CMDL_COMPL) || defined(PROTO) 25 #if defined(FEAT_CMDL_COMPL) || defined(PROTO)
26 static garray_T ga_users; 26 static garray_T ga_users;
27 #endif 27 #endif
539 #endif 539 #endif
540 540
541 541
542 #if defined(FEAT_CINDENT) || defined(FEAT_SMARTINDENT) 542 #if defined(FEAT_CINDENT) || defined(FEAT_SMARTINDENT)
543 543
544 static int cin_is_cinword __ARGS((char_u *line)); 544 static int cin_is_cinword(char_u *line);
545 545
546 /* 546 /*
547 * Return TRUE if the string "line" starts with a word from 'cinwords'. 547 * Return TRUE if the string "line" starts with a word from 'cinwords'.
548 */ 548 */
549 static int 549 static int
2817 #ifdef FEAT_TITLE 2817 #ifdef FEAT_TITLE
2818 need_maketitle = TRUE; /* set window title later */ 2818 need_maketitle = TRUE; /* set window title later */
2819 #endif 2819 #endif
2820 } 2820 }
2821 2821
2822 static void changedOneline __ARGS((buf_T *buf, linenr_T lnum)); 2822 static void changedOneline(buf_T *buf, linenr_T lnum);
2823 static void changed_lines_buf __ARGS((buf_T *buf, linenr_T lnum, linenr_T lnume, long xtra)); 2823 static void changed_lines_buf(buf_T *buf, linenr_T lnum, linenr_T lnume, long xtra);
2824 static void changed_common __ARGS((linenr_T lnum, colnr_T col, linenr_T lnume, long xtra)); 2824 static void changed_common(linenr_T lnum, colnr_T col, linenr_T lnume, long xtra);
2825 2825
2826 /* 2826 /*
2827 * Changed bytes within a single line for the current buffer. 2827 * Changed bytes within a single line for the current buffer.
2828 * - marks the windows on this buffer to be redisplayed 2828 * - marks the windows on this buffer to be redisplayed
2829 * - marks the buffer changed by calling changed() 2829 * - marks the buffer changed by calling changed()
4911 } 4911 }
4912 return p1; 4912 return p1;
4913 } 4913 }
4914 4914
4915 #if defined(FEAT_SEARCHPATH) 4915 #if defined(FEAT_SEARCHPATH)
4916 static char_u *gettail_dir __ARGS((char_u *fname)); 4916 static char_u *gettail_dir(char_u *fname);
4917 4917
4918 /* 4918 /*
4919 * Return the end of the directory name, on the first path 4919 * Return the end of the directory name, on the first path
4920 * separator: 4920 * separator:
4921 * "/path/file", "/path/dir/", "/path//dir", "/file" 4921 * "/path/file", "/path/dir/", "/path//dir", "/file"
5283 return new_fname; 5283 return new_fname;
5284 } 5284 }
5285 5285
5286 #if defined(FEAT_CINDENT) || defined(FEAT_SYN_HL) 5286 #if defined(FEAT_CINDENT) || defined(FEAT_SYN_HL)
5287 5287
5288 static char_u *skip_string __ARGS((char_u *p)); 5288 static char_u *skip_string(char_u *p);
5289 static pos_T *ind_find_start_comment __ARGS((void)); 5289 static pos_T *ind_find_start_comment(void);
5290 static pos_T *ind_find_start_CORS __ARGS((void)); 5290 static pos_T *ind_find_start_CORS(void);
5291 static pos_T *find_start_rawstring __ARGS((int ind_maxcomment)); 5291 static pos_T *find_start_rawstring(int ind_maxcomment);
5292 5292
5293 /* 5293 /*
5294 * Find the start of a comment, not knowing if we are in a comment right now. 5294 * Find the start of a comment, not knowing if we are in a comment right now.
5295 * Search starts at w_cursor.lnum and goes backwards. 5295 * Search starts at w_cursor.lnum and goes backwards.
5296 * Return NULL when not inside a comment. 5296 * Return NULL when not inside a comment.
5506 */ 5506 */
5507 /* 5507 /*
5508 * Below "XXX" means that this function may unlock the current line. 5508 * Below "XXX" means that this function may unlock the current line.
5509 */ 5509 */
5510 5510
5511 static char_u *cin_skipcomment __ARGS((char_u *)); 5511 static char_u *cin_skipcomment(char_u *);
5512 static int cin_nocode __ARGS((char_u *)); 5512 static int cin_nocode(char_u *);
5513 static pos_T *find_line_comment __ARGS((void)); 5513 static pos_T *find_line_comment(void);
5514 static int cin_has_js_key __ARGS((char_u *text)); 5514 static int cin_has_js_key(char_u *text);
5515 static int cin_islabel_skip __ARGS((char_u **)); 5515 static int cin_islabel_skip(char_u **);
5516 static int cin_isdefault __ARGS((char_u *)); 5516 static int cin_isdefault(char_u *);
5517 static char_u *after_label __ARGS((char_u *l)); 5517 static char_u *after_label(char_u *l);
5518 static int get_indent_nolabel __ARGS((linenr_T lnum)); 5518 static int get_indent_nolabel(linenr_T lnum);
5519 static int skip_label __ARGS((linenr_T, char_u **pp)); 5519 static int skip_label(linenr_T, char_u **pp);
5520 static int cin_first_id_amount __ARGS((void)); 5520 static int cin_first_id_amount(void);
5521 static int cin_get_equal_amount __ARGS((linenr_T lnum)); 5521 static int cin_get_equal_amount(linenr_T lnum);
5522 static int cin_ispreproc __ARGS((char_u *)); 5522 static int cin_ispreproc(char_u *);
5523 static int cin_ispreproc_cont __ARGS((char_u **pp, linenr_T *lnump)); 5523 static int cin_ispreproc_cont(char_u **pp, linenr_T *lnump);
5524 static int cin_iscomment __ARGS((char_u *)); 5524 static int cin_iscomment(char_u *);
5525 static int cin_islinecomment __ARGS((char_u *)); 5525 static int cin_islinecomment(char_u *);
5526 static int cin_isterminated __ARGS((char_u *, int, int)); 5526 static int cin_isterminated(char_u *, int, int);
5527 static int cin_isinit __ARGS((void)); 5527 static int cin_isinit(void);
5528 static int cin_isfuncdecl __ARGS((char_u **, linenr_T, linenr_T)); 5528 static int cin_isfuncdecl(char_u **, linenr_T, linenr_T);
5529 static int cin_isif __ARGS((char_u *)); 5529 static int cin_isif(char_u *);
5530 static int cin_iselse __ARGS((char_u *)); 5530 static int cin_iselse(char_u *);
5531 static int cin_isdo __ARGS((char_u *)); 5531 static int cin_isdo(char_u *);
5532 static int cin_iswhileofdo __ARGS((char_u *, linenr_T)); 5532 static int cin_iswhileofdo(char_u *, linenr_T);
5533 static int cin_is_if_for_while_before_offset __ARGS((char_u *line, int *poffset)); 5533 static int cin_is_if_for_while_before_offset(char_u *line, int *poffset);
5534 static int cin_iswhileofdo_end __ARGS((int terminated)); 5534 static int cin_iswhileofdo_end(int terminated);
5535 static int cin_isbreak __ARGS((char_u *)); 5535 static int cin_isbreak(char_u *);
5536 static int cin_is_cpp_baseclass __ARGS((cpp_baseclass_cache_T *cached)); 5536 static int cin_is_cpp_baseclass(cpp_baseclass_cache_T *cached);
5537 static int get_baseclass_amount __ARGS((int col)); 5537 static int get_baseclass_amount(int col);
5538 static int cin_ends_in __ARGS((char_u *, char_u *, char_u *)); 5538 static int cin_ends_in(char_u *, char_u *, char_u *);
5539 static int cin_starts_with __ARGS((char_u *s, char *word)); 5539 static int cin_starts_with(char_u *s, char *word);
5540 static int cin_skip2pos __ARGS((pos_T *trypos)); 5540 static int cin_skip2pos(pos_T *trypos);
5541 static pos_T *find_start_brace __ARGS((void)); 5541 static pos_T *find_start_brace(void);
5542 static pos_T *find_match_paren __ARGS((int)); 5542 static pos_T *find_match_paren(int);
5543 static pos_T *find_match_char __ARGS((int c, int ind_maxparen)); 5543 static pos_T *find_match_char(int c, int ind_maxparen);
5544 static int corr_ind_maxparen __ARGS((pos_T *startpos)); 5544 static int corr_ind_maxparen(pos_T *startpos);
5545 static int find_last_paren __ARGS((char_u *l, int start, int end)); 5545 static int find_last_paren(char_u *l, int start, int end);
5546 static int find_match __ARGS((int lookfor, linenr_T ourscope)); 5546 static int find_match(int lookfor, linenr_T ourscope);
5547 static int cin_is_cpp_namespace __ARGS((char_u *)); 5547 static int cin_is_cpp_namespace(char_u *);
5548 5548
5549 /* 5549 /*
5550 * Skip over white space and C comments within the line. 5550 * Skip over white space and C comments within the line.
5551 * Also skip over Perl/shell comments if desired. 5551 * Also skip over Perl/shell comments if desired.
5552 */ 5552 */
9335 9335
9336 #endif /* FEAT_CINDENT */ 9336 #endif /* FEAT_CINDENT */
9337 9337
9338 #if defined(FEAT_LISP) || defined(PROTO) 9338 #if defined(FEAT_LISP) || defined(PROTO)
9339 9339
9340 static int lisp_match __ARGS((char_u *p)); 9340 static int lisp_match(char_u *p);
9341 9341
9342 static int 9342 static int
9343 lisp_match(p) 9343 lisp_match(p)
9344 char_u *p; 9344 char_u *p;
9345 { 9345 {
9858 } 9858 }
9859 9859
9860 #if !defined(NO_EXPANDPATH) || defined(PROTO) 9860 #if !defined(NO_EXPANDPATH) || defined(PROTO)
9861 9861
9862 # ifdef VIM_BACKTICK 9862 # ifdef VIM_BACKTICK
9863 static int vim_backtick __ARGS((char_u *p)); 9863 static int vim_backtick(char_u *p);
9864 static int expand_backtick __ARGS((garray_T *gap, char_u *pat, int flags)); 9864 static int expand_backtick(garray_T *gap, char_u *pat, int flags);
9865 # endif 9865 # endif
9866 9866
9867 # if defined(MSDOS) || defined(FEAT_GUI_W16) || defined(WIN3264) 9867 # if defined(MSDOS) || defined(FEAT_GUI_W16) || defined(WIN3264)
9868 /* 9868 /*
9869 * File name expansion code for MS-DOS, Win16 and Win32. It's here because 9869 * File name expansion code for MS-DOS, Win16 and Win32. It's here because
10214 || defined(PROTO) 10214 || defined(PROTO)
10215 /* 10215 /*
10216 * Unix style wildcard expansion code. 10216 * Unix style wildcard expansion code.
10217 * It's here because it's used both for Unix and Mac. 10217 * It's here because it's used both for Unix and Mac.
10218 */ 10218 */
10219 static int pstrcmp __ARGS((const void *, const void *)); 10219 static int pstrcmp(const void *, const void *);
10220 10220
10221 static int 10221 static int
10222 pstrcmp(a, b) 10222 pstrcmp(a, b)
10223 const void *a, *b; 10223 const void *a, *b;
10224 { 10224 {
10448 return matches; 10448 return matches;
10449 } 10449 }
10450 #endif 10450 #endif
10451 10451
10452 #if defined(FEAT_SEARCHPATH) 10452 #if defined(FEAT_SEARCHPATH)
10453 static int find_previous_pathsep __ARGS((char_u *path, char_u **psep)); 10453 static int find_previous_pathsep(char_u *path, char_u **psep);
10454 static int is_unique __ARGS((char_u *maybe_unique, garray_T *gap, int i)); 10454 static int is_unique(char_u *maybe_unique, garray_T *gap, int i);
10455 static void expand_path_option __ARGS((char_u *curdir, garray_T *gap)); 10455 static void expand_path_option(char_u *curdir, garray_T *gap);
10456 static char_u *get_path_cutoff __ARGS((char_u *fname, garray_T *gap)); 10456 static char_u *get_path_cutoff(char_u *fname, garray_T *gap);
10457 static void uniquefy_paths __ARGS((garray_T *gap, char_u *pattern)); 10457 static void uniquefy_paths(garray_T *gap, char_u *pattern);
10458 static int expand_in_path __ARGS((garray_T *gap, char_u *pattern, int flags)); 10458 static int expand_in_path(garray_T *gap, char_u *pattern, int flags);
10459 10459
10460 /* 10460 /*
10461 * Moves "*psep" back to the previous path separator in "path". 10461 * Moves "*psep" back to the previous path separator in "path".
10462 * Returns FAIL is "*psep" ends up at the beginning of "path". 10462 * Returns FAIL is "*psep" ends up at the beginning of "path".
10463 */ 10463 */
10870 --gap->ga_len; 10870 --gap->ga_len;
10871 } 10871 }
10872 } 10872 }
10873 #endif 10873 #endif
10874 10874
10875 static int has_env_var __ARGS((char_u *p)); 10875 static int has_env_var(char_u *p);
10876 10876
10877 /* 10877 /*
10878 * Return TRUE if "p" contains what looks like an environment variable. 10878 * Return TRUE if "p" contains what looks like an environment variable.
10879 * Allowing for escaping. 10879 * Allowing for escaping.
10880 */ 10880 */
10897 } 10897 }
10898 return FALSE; 10898 return FALSE;
10899 } 10899 }
10900 10900
10901 #ifdef SPECIAL_WILDCHAR 10901 #ifdef SPECIAL_WILDCHAR
10902 static int has_special_wildchar __ARGS((char_u *p)); 10902 static int has_special_wildchar(char_u *p);
10903 10903
10904 /* 10904 /*
10905 * Return TRUE if "p" contains a special wildcard character. 10905 * Return TRUE if "p" contains a special wildcard character.
10906 * Allowing for escaping. 10906 * Allowing for escaping.
10907 */ 10907 */