aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2021-12-17 11:10:31 +0200
committerArnold D. Robbins <arnold@skeeve.com>2021-12-17 11:10:31 +0200
commitaa58c798bed920b6051c4459488195df2b76aaf4 (patch)
tree0f19662dafc6a13909cc1806a74f65b200efe918
parent71258c13172b489139f1a1d339bf140af6c1ebf1 (diff)
parentf285f960bdfb5acb50a8ec7ed4b98f17d0bd624a (diff)
downloadegawk-aa58c798bed920b6051c4459488195df2b76aaf4.tar.gz
egawk-aa58c798bed920b6051c4459488195df2b76aaf4.tar.bz2
egawk-aa58c798bed920b6051c4459488195df2b76aaf4.zip
Merge branch 'gawk-5.1-stable'
-rw-r--r--ChangeLog13
-rw-r--r--cint_array.c2
-rw-r--r--debug.c4
-rw-r--r--field.c16
-rw-r--r--io.c2
-rw-r--r--main.c3
-rw-r--r--re.c2
-rw-r--r--str_array.c2
8 files changed, 29 insertions, 15 deletions
diff --git a/ChangeLog b/ChangeLog
index 6f4907bc..a30f31ad 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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,
diff --git a/debug.c b/debug.c
index cf0946e2..e7dd7060 100644
--- a/debug.c
+++ b/debug.c
@@ -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 */
diff --git a/field.c b/field.c
index b2661d6b..1cbd547d 100644
--- a/field.c
+++ b/field.c
@@ -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;
diff --git a/io.c b/io.c
index 0da8699e..1d440c1e 100644
--- a/io.c
+++ b/io.c
@@ -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[] = {
diff --git a/main.c b/main.c
index 2ca0dc85..c88c23a6 100644
--- a/main.c
+++ b/main.c
@@ -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;
diff --git a/re.c b/re.c
index 929c317e..fd134727 100644
--- a/re.c
+++ b/re.c
@@ -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 ba8c2148..08704312 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,