diff options
author | ZyX <kp-pav@ya.ru> | 2014-05-10 17:24:13 +0400 |
---|---|---|
committer | Thiago de Arruda <tpadilha84@gmail.com> | 2014-06-02 11:04:17 -0300 |
commit | 70929f7e1616bab2783cc5735c6061981cda8a0f (patch) | |
tree | 4a947af96fa0bac749f843a41e7b6593dd2659c0 /src/nvim/buffer.c | |
parent | 880957ad4e3fc0ff681025f5e29c5eccf797c564 (diff) | |
download | rneovim-70929f7e1616bab2783cc5735c6061981cda8a0f.tar.gz rneovim-70929f7e1616bab2783cc5735c6061981cda8a0f.tar.bz2 rneovim-70929f7e1616bab2783cc5735c6061981cda8a0f.zip |
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.
Diffstat (limited to 'src/nvim/buffer.c')
-rw-r--r-- | src/nvim/buffer.c | 30 |
1 files changed, 11 insertions, 19 deletions
diff --git a/src/nvim/buffer.c b/src/nvim/buffer.c index d3dcb375b2..3a835c1a10 100644 --- a/src/nvim/buffer.c +++ b/src/nvim/buffer.c @@ -73,22 +73,17 @@ // Todo(stefan991): remove this macro #define INVALID_DEVICE_ID UINT64_MAX -static char_u *buflist_match(regprog_T *prog, buf_T *buf); -# define HAVE_BUFLIST_MATCH -static char_u *fname_match(regprog_T *prog, char_u *name); -static void buflist_setfpos(buf_T *buf, win_T *win, linenr_T lnum, - colnr_T col, int copy_options); -static wininfo_T *find_wininfo(buf_T *buf, int skip_diff_buffer); -static buf_T *buflist_findname_file_info(char_u *ffname, FileInfo *file_info); -static int otherfile_buf(buf_T *buf, char_u *ffname, FileInfo *file_info); -static int buf_same_ino(buf_T *buf, FileInfo *file_info); -static int ti_change(char_u *str, char_u **last); -static int append_arg_number(win_T *wp, char_u *buf, int buflen, int add_file); -static void free_buffer(buf_T *); -static void free_buffer_stuff(buf_T *buf, int free_options); -static void clear_wininfo(buf_T *buf); - -static void insert_sign(buf_T *buf, signlist_T *prev, signlist_T *next, int id, linenr_T lnum, int typenr); +#define HAVE_BUFLIST_MATCH +#ifdef INCLUDE_GENERATED_DECLARATIONS +# include "buffer.c.generated.h" +#endif + +#ifdef UNIX +# define dev_T dev_t +#else +# define dev_T unsigned +#endif + static char *msg_loclist = N_("[Location List]"); static char *msg_qflist = N_("[Quickfix List]"); @@ -791,7 +786,6 @@ do_bufdel ( } -static int empty_curbuf(int close_others, int forceit, int action); /* * Make the current buffer empty. @@ -2014,7 +2008,6 @@ static void buflist_setfpos(buf_T *buf, win_T *win, linenr_T lnum, colnr_T col, return; } -static int wininfo_other_tab_diff(wininfo_T *wip); /* * Return TRUE when "wip" has 'diff' set and the diff is only for another tab @@ -4016,7 +4009,6 @@ void ex_buffer_all(exarg_T *eap) } -static int chk_modeline(linenr_T, int); /* * do_modelines() - process mode lines for the current file |