From 70929f7e1616bab2783cc5735c6061981cda8a0f Mon Sep 17 00:00:00 2001 From: ZyX Date: Sat, 10 May 2014 17:24:13 +0400 Subject: Add automatic generation of headers - The 'stripdecls.py' script replaces declarations in all headers by includes to generated headers. `ag '#\s*if(?!ndef NEOVIM_).*((?!#\s*endif).*\n)*#ifdef INCLUDE_GENERATED'` was used for this. - Add and integrate gendeclarations.lua into the build system to generate the required includes. - Add -Wno-unused-function - Made a bunch of old-style definitions ANSI This adds a requirement: all type and structure definitions must be present before INCLUDE_GENERATED_DECLARATIONS-protected include. Warning: mch_expandpath (path.h.generated.h) was moved manually. So far it is the only exception. --- src/nvim/if_cscope.c | 45 ++++----------------------------------------- 1 file changed, 4 insertions(+), 41 deletions(-) (limited to 'src/nvim/if_cscope.c') diff --git a/src/nvim/if_cscope.c b/src/nvim/if_cscope.c index 7549e77223..bdb2659010 100644 --- a/src/nvim/if_cscope.c +++ b/src/nvim/if_cscope.c @@ -33,45 +33,9 @@ #endif #include "nvim/if_cscope_defs.h" -static void cs_usage_msg(csid_e x); -static int cs_add(exarg_T *eap); -static void cs_stat_emsg(char *fname); -static int cs_add_common(char *, char *, char *); -static int cs_check_for_connections(void); -static int cs_check_for_tags(void); -static int cs_cnt_connections(void); -static void cs_reading_emsg(int idx); -static int cs_cnt_matches(int idx); -static char * cs_create_cmd(char *csoption, char *pattern); -static int cs_create_connection(int i); -static void do_cscope_general(exarg_T *eap, int make_split); -static void cs_file_results(FILE *, int *); -static void cs_fill_results(char *, int, int *, char ***, - char ***, int *); -static int cs_find(exarg_T *eap); -static int cs_find_common(char *opt, char *pat, int, int, int, - char_u *cmdline); -static int cs_help(exarg_T *eap); -static void clear_csinfo(int i); -static int cs_insert_filelist(char *, char *, char *, FileInfo *file_info); -static int cs_kill(exarg_T *eap); -static void cs_kill_execute(int, char *); -static cscmd_T * cs_lookup_cmd(exarg_T *eap); -static char * cs_make_vim_style_matches(char *, char *, - char *, char *); -static char * cs_manage_matches(char **, char **, int, mcmd_e); -static char * cs_parse_results(int cnumber, char *buf, - int bufsize, char **context, - char **linenumber, - char **search); -static char * cs_pathcomponents(char *path); -static void cs_print_tags_priv(char **, char **, int); -static int cs_read_prompt(int); -static void cs_release_csp(int, int freefnpp); -static int cs_reset(exarg_T *eap); -static char * cs_resolve_file(int, char *); -static int cs_show(exarg_T *eap); - +#ifdef INCLUDE_GENERATED_DECLARATIONS +# include "if_cscope.c.generated.h" +#endif static csinfo_T * csinfo = NULL; static int csinfo_size = 0; /* number of items allocated in @@ -1275,8 +1239,7 @@ static int cs_insert_filelist(char *fname, char *ppath, char *flags, * * find cscope command in command table */ -static cscmd_T * cs_lookup_cmd(eap) -exarg_T *eap; +static cscmd_T * cs_lookup_cmd(exarg_T *eap) { cscmd_T *cmdp; char *stok; -- cgit