diff options
-rw-r--r-- | ChangeLog | 13 | ||||
-rw-r--r-- | cint_array.c | 2 | ||||
-rw-r--r-- | debug.c | 4 | ||||
-rw-r--r-- | field.c | 16 | ||||
-rw-r--r-- | io.c | 2 | ||||
-rw-r--r-- | main.c | 3 | ||||
-rw-r--r-- | re.c | 2 | ||||
-rw-r--r-- | str_array.c | 2 |
8 files changed, 29 insertions, 15 deletions
@@ -1,3 +1,16 @@ +2021-12-17 Yuri Gribov <tetra2005@gmail.com> + + Make a number of functions and variables static. + + * cint_array.c (argv_array_func): Make static. + * debug.c (cur_rule, check_until): Ditto. + * field.c (default_FS, FS_re_yes_case, FS_re_no_case, FS_regexp, + FPAT_re_yes_case, FPAT_re_no_case, invalidate_field0: Ditto. + * io.c (iopflags2str): Ditto. + * main.c (ENVIRON_node): Ditto. + * re.c (reflags2str): Ditto. + * str_array.c (env_array_func): Ditto. + 2021-12-02 Andrew J. Schorr <aschorr@telemetry-investments.com> * builtin.c (efwrite): Don't use return in call of function diff --git a/cint_array.c b/cint_array.c index 63c477b6..91947766 100644 --- a/cint_array.c +++ b/cint_array.c @@ -77,7 +77,7 @@ const array_funcs_t cint_array_func = { static NODE **argv_store(NODE *symbol, NODE *subs); /* special case for ARGV in sandbox mode */ -const array_funcs_t argv_array_func = { +static const array_funcs_t argv_array_func = { "argv", cint_array_init, is_uinteger, @@ -64,7 +64,7 @@ int input_fd; static SRCFILE *cur_srcfile; static long cur_frame = 0; static INSTRUCTION *cur_pc; -int cur_rule = 0; +static int cur_rule = 0; static bool prog_running = false; @@ -3303,7 +3303,7 @@ do_return(CMDARG *arg, int cmd) /* check_until --- process until, returns true if stopping */ -int +static int check_until(INSTRUCTION **pi) { if (fcall_count < stop.fcall_count) { /* current stack frame returned */ @@ -81,13 +81,13 @@ static awk_fieldwidth_info_t *FIELDWIDTHS = NULL; NODE **fields_arr; /* array of pointers to the field nodes */ bool field0_valid; /* $(>0) has not been changed yet */ -int default_FS; /* true when FS == " " */ -Regexp *FS_re_yes_case = NULL; -Regexp *FS_re_no_case = NULL; -Regexp *FS_regexp = NULL; -Regexp *FPAT_re_yes_case = NULL; -Regexp *FPAT_re_no_case = NULL; -Regexp *FPAT_regexp = NULL; +static int default_FS; /* true when FS == " " */ +static Regexp *FS_re_yes_case = NULL; +static Regexp *FS_re_no_case = NULL; +static Regexp *FS_regexp = NULL; +static Regexp *FPAT_re_yes_case = NULL; +static Regexp *FPAT_re_no_case = NULL; +static Regexp *FPAT_regexp = NULL; NODE *Null_field = NULL; #define clear_mpfr(n) ((n)->flags &= ~(MPFN | MPZN | NUMCUR)) @@ -837,7 +837,7 @@ fw_parse_field(long up_to, /* parse only up to this field number */ /* invalidate_field0 --- $0 needs reconstruction */ -void +static void invalidate_field0() { field0_valid = false; @@ -4170,7 +4170,7 @@ pty_vs_pipe(const char *command) /* iopflags2str --- make IOP flags printable */ -const char * +static const char * iopflags2str(int flag) { static const struct flagtab values[] = { @@ -73,7 +73,8 @@ static const char *platform_name(); /* These nodes store all the special variables AWK uses */ NODE *ARGC_node, *ARGIND_node, *ARGV_node, *BINMODE_node, *CONVFMT_node; -NODE *ENVIRON_node, *ERRNO_node, *FIELDWIDTHS_node, *FILENAME_node; +static NODE *ENVIRON_node; +NODE *ERRNO_node, *FIELDWIDTHS_node, *FILENAME_node; NODE *FNR_node, *FPAT_node, *FS_node, *IGNORECASE_node, *LINT_node; NODE *NF_node, *NR_node, *OFMT_node, *OFS_node, *ORS_node, *PROCINFO_node; NODE *RLENGTH_node, *RSTART_node, *RS_node, *RT_node, *SUBSEP_node; @@ -517,7 +517,7 @@ reisstring(const char *text, size_t len, Regexp *re, const char *buf) /* reflags2str --- make a regex flags value readable */ -const char * +static const char * reflags2str(int flagval) { static const struct flagtab values[] = { diff --git a/str_array.c b/str_array.c index 219a75a3..f6e4deeb 100644 --- a/str_array.c +++ b/str_array.c @@ -76,7 +76,7 @@ static NODE **env_store(NODE *symbol, NODE *subs); static NODE **env_clear(NODE *symbol, NODE *subs); /* special case for ENVIRON */ -const array_funcs_t env_array_func = { +static const array_funcs_t env_array_func = { "env", str_array_init, (afunc_t) 0, |