summaryrefslogtreecommitdiff
path: root/miscutils/bc.c
diff options
context:
space:
mode:
authorDenys Vlasenko2018-12-03 00:08:59 +0100
committerDenys Vlasenko2018-12-05 15:43:35 +0100
commit1f67e935ac7c4e8812deb97e3e81d0973634fa93 (patch)
tree9db66241acaca9ab1e9515be52822b1e8ef9891e /miscutils/bc.c
parentd9d66556d74f14982daa34b70c0aeb8c6456117d (diff)
downloadbusybox-1f67e935ac7c4e8812deb97e3e81d0973634fa93.zip
busybox-1f67e935ac7c4e8812deb97e3e81d0973634fa93.tar.gz
bc: reduce forward declarations
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'miscutils/bc.c')
-rw-r--r--miscutils/bc.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/miscutils/bc.c b/miscutils/bc.c
index 7c88a4b..e224c8d 100644
--- a/miscutils/bc.c
+++ b/miscutils/bc.c
@@ -717,7 +717,6 @@ static BcStatus bc_lex_token(BcLex *l);
// first in the expr enum. Note: This only works for binary operators.
#define BC_PARSE_TOKEN_INST(t) ((char) ((t) -BC_LEX_NEG + BC_INST_NEG))
-static BcStatus bc_parse_parse(BcParse *p);
static BcStatus bc_parse_expr(BcParse *p, uint8_t flags, BcParseNext next);
#endif // ENABLE_BC
@@ -845,8 +844,6 @@ static BcStatus bc_vm_posixError(BcStatus s, const char *file, size_t line,
static void bc_vm_info(void);
-static const char* const bc_args_env_name = "BC_ENV_ARGS";
-
static const char bc_err_fmt[] = "\n%s error: %s\n";
static const char bc_warn_fmt[] = "\n%s warning: %s\n";
static const char bc_err_line[] = ":%zu\n\n";
@@ -960,9 +957,6 @@ static const char *bc_err_msgs[] = {
};
-static const char bc_func_main[] = "(main)";
-static const char bc_func_read[] = "(read)";
-
#if ENABLE_BC
static const BcLexKeyword bc_lex_kws[20] = {
BC_LEX_KW_ENTRY("auto", 4, true),
@@ -6895,6 +6889,8 @@ static BcStatus bc_vm_posixError(BcStatus s, const char *file, size_t line,
static void bc_vm_envArgs(void)
{
+ static const char* const bc_args_env_name = "BC_ENV_ARGS";
+
BcVec v;
char *env_args = getenv(bc_args_env_name), *buf;
@@ -7200,8 +7196,8 @@ static void bc_program_init(size_t line_len)
bc_vec_init(&G.prog.fns, sizeof(BcFunc), bc_func_free);
bc_map_init(&G.prog.fn_map);
- bc_program_addFunc(xstrdup(bc_func_main), &idx);
- bc_program_addFunc(xstrdup(bc_func_read), &idx);
+ bc_program_addFunc(xstrdup("(main)"), &idx);
+ bc_program_addFunc(xstrdup("(read)"), &idx);
bc_vec_init(&G.prog.vars, sizeof(BcVec), bc_vec_free);
bc_map_init(&G.prog.var_map);