aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZyX <kp-pav@ya.ru>2014-05-18 00:34:16 +0400
committerThiago de Arruda <tpadilha84@gmail.com>2014-06-02 11:04:18 -0300
commit6498b281fa4fdb3728944b30f18981613b621925 (patch)
treeac780af7fef9fb74d5330812760322140893861d
parent70929f7e1616bab2783cc5735c6061981cda8a0f (diff)
downloadrneovim-6498b281fa4fdb3728944b30f18981613b621925.tar.gz
rneovim-6498b281fa4fdb3728944b30f18981613b621925.tar.bz2
rneovim-6498b281fa4fdb3728944b30f18981613b621925.zip
Remove remaining declarations with new script: finddeclarations.pl
-rwxr-xr-xscripts/finddeclarations.pl50
-rw-r--r--src/nvim/ex_cmds2.c7
-rw-r--r--src/nvim/if_cscope.c3
-rw-r--r--src/nvim/main.c4
-rw-r--r--src/nvim/message.c4
-rw-r--r--src/nvim/regexp_nfa.c12
-rw-r--r--src/nvim/term.c1
7 files changed, 51 insertions, 30 deletions
diff --git a/scripts/finddeclarations.pl b/scripts/finddeclarations.pl
new file mode 100755
index 0000000000..1b1a57b9b7
--- /dev/null
+++ b/scripts/finddeclarations.pl
@@ -0,0 +1,50 @@
+#!/usr/bin/perl
+
+use strict;
+use warnings;
+
+if ($ARGV[0] eq '--help') {
+ print << "EOF";
+Usage:
+
+ $0 definitions.c
+EOF
+ exit;
+}
+
+my ($cfname, $sfname, $gfname, $cpp) = @ARGV;
+
+my $F;
+
+open $F, "<", $cfname;
+
+my $text = join "", <$F>;
+
+close $F;
+
+my $s = qr/(?>\s*)/aso;
+my $w = qr/(?>\w+)/aso;
+my $argname = qr/$w(?:\[(?>\w+)\])?/aso;
+my $type_regex = qr/(?:$w$s\**$s)+/aso;
+my $arg_regex = qr/(?:$type_regex$s$argname)/aso;
+
+while ($text =~ /
+ (?<=\n) # Definition starts at the start of line
+ $type_regex # Return type
+ $s$w # Function name
+ $s\($s
+ (?:
+ $arg_regex(?:$s,$s$arg_regex)*+
+ ($s,$s\.\.\.)? # varargs function
+ |void
+ )?
+ $s\)
+ (?:$s FUNC_ATTR_$w(?:\((?>[^)]*)\))?)*+ # Optional attributes
+ (?=$s;) # Ending semicolon
+ /axsogp) {
+ my $match = "${^MATCH}";
+ my $s = "${^PREMATCH}";
+ $s =~ s/[^\n]++//g;
+ my $line = 1 + length $s;
+ print "${cfname}:${line}: $match\n";
+}
diff --git a/src/nvim/ex_cmds2.c b/src/nvim/ex_cmds2.c
index 2dac4bec9a..2d24225c01 100644
--- a/src/nvim/ex_cmds2.c
+++ b/src/nvim/ex_cmds2.c
@@ -2372,8 +2372,6 @@ int source_level(void *cookie)
#if (defined(WIN32) && defined(FEAT_CSCOPE)) || defined(HAVE_FD_CLOEXEC)
# define USE_FOPEN_NOINH
-static FILE *fopen_noinh_readbin(char *filename);
-
/*
* Special function to open a file without handle inheritance.
* When possible the handle is closed on exec().
@@ -3244,8 +3242,6 @@ char_u *get_mess_lang(void)
/* Complicated #if; matches with where get_mess_env() is used below. */
#ifdef HAVE_WORKING_LIBINTL
-static char_u *get_mess_env(void);
-
/*
* Get the language used for messages from the environment.
*/
@@ -3406,9 +3402,6 @@ void ex_language(exarg_T *eap)
static char_u **locales = NULL; /* Array of all available locales */
static int did_init_locales = FALSE;
-static void init_locales(void);
-static char_u **find_locales(void);
-
/*
* Lazy initialization of all available locales.
*/
diff --git a/src/nvim/if_cscope.c b/src/nvim/if_cscope.c
index bdb2659010..0b3e06070c 100644
--- a/src/nvim/if_cscope.c
+++ b/src/nvim/if_cscope.c
@@ -1153,8 +1153,6 @@ static void clear_csinfo(int i)
}
#ifndef UNIX
-static char *GetWin32Error(void);
-
static char *GetWin32Error(void)
{
char *msg = NULL;
@@ -1168,7 +1166,6 @@ static char *GetWin32Error(void)
}
return msg;
}
-
#endif
/*
diff --git a/src/nvim/main.c b/src/nvim/main.c
index 0e55353712..7b567be564 100644
--- a/src/nvim/main.c
+++ b/src/nvim/main.c
@@ -98,8 +98,6 @@ typedef struct {
#define EDIT_TAG 3 /* tag name argument given, use tagname */
#define EDIT_QF 4 /* start in quickfix mode */
-#if defined(UNIX) && !defined(NO_VIM_MAIN)
-#endif
#ifdef INCLUDE_GENERATED_DECLARATIONS
# include "main.c.generated.h"
#endif
@@ -134,7 +132,7 @@ static char *(main_errors[]) =
};
#ifndef NO_VIM_MAIN /* skip this for unittests */
- int main(int argc, char **argv)
+int main(int argc, char **argv)
{
char_u *fname = NULL; /* file name from command line */
mparm_T params; /* various parameters passed between
diff --git a/src/nvim/message.c b/src/nvim/message.c
index 98851da625..42162b9315 100644
--- a/src/nvim/message.c
+++ b/src/nvim/message.c
@@ -3018,10 +3018,6 @@ int vim_dialog_yesnoallcancel(int type, char_u *title, char_u *message, int dflt
static char *e_printf = N_("E766: Insufficient arguments for printf()");
-static long tv_nr(typval_T *tvs, int *idxp);
-static char *tv_str(typval_T *tvs, int *idxp);
-static double tv_float(typval_T *tvs, int *idxp);
-
/*
* Get number argument from "idxp" entry in "tvs". First entry is 1.
*/
diff --git a/src/nvim/regexp_nfa.c b/src/nvim/regexp_nfa.c
index 08a419b4f7..2926206ba7 100644
--- a/src/nvim/regexp_nfa.c
+++ b/src/nvim/regexp_nfa.c
@@ -343,14 +343,6 @@ static int nfa_ll_index = 0;
#ifdef INCLUDE_GENERATED_DECLARATIONS
# include "regexp_nfa.c.generated.h"
#endif
-#ifdef REGEXP_DEBUG
-static void nfa_set_code(int c);
-static void nfa_postfix_dump(char_u *expr, int retval);
-static void nfa_print_state(FILE *debugf, nfa_state_T *state);
-static void nfa_print_state2(FILE *debugf, nfa_state_T *state,
- garray_T *indent);
-static void nfa_dump(nfa_regprog_T *prog);
-#endif
/* helper functions used when doing re2post() ... regatom() parsing */
#define EMIT(c) do { \
@@ -3396,10 +3388,6 @@ static void nfa_postprocess(nfa_regprog_T *prog)
#ifdef REGEXP_DEBUG
-static void log_subsexpr(regsubs_T *subs);
-static void log_subexpr(regsub_T *sub);
-static char *pim_info(nfa_pim_T *pim);
-
static void log_subsexpr(regsubs_T *subs)
{
log_subexpr(&subs->norm);
diff --git a/src/nvim/term.c b/src/nvim/term.c
index 2b2607fb30..34cc90620b 100644
--- a/src/nvim/term.c
+++ b/src/nvim/term.c
@@ -146,7 +146,6 @@ char *UP, *BC, PC;
# define TGETSTR(s, p) vim_tgetstr((s), (p))
# define TGETENT(b, t) tgetent((char *)(b), (char *)(t))
-static char_u *vim_tgetstr(char *s, char_u **pp);
#endif /* HAVE_TGETENT */
static int detected_8bit = FALSE; /* detected 8-bit terminal */