aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2018-12-03 00:08:59 +0100
committerDenys Vlasenko <vda.linux@googlemail.com>2018-12-05 15:43:35 +0100
commit1f67e935ac7c4e8812deb97e3e81d0973634fa93 (patch)
tree9db66241acaca9ab1e9515be52822b1e8ef9891e
parentd9d66556d74f14982daa34b70c0aeb8c6456117d (diff)
downloadbusybox-w32-1f67e935ac7c4e8812deb97e3e81d0973634fa93.tar.gz
busybox-w32-1f67e935ac7c4e8812deb97e3e81d0973634fa93.tar.bz2
busybox-w32-1f67e935ac7c4e8812deb97e3e81d0973634fa93.zip
bc: reduce forward declarations
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--miscutils/bc.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/miscutils/bc.c b/miscutils/bc.c
index 7c88a4ba0..e224c8dd4 100644
--- a/miscutils/bc.c
+++ b/miscutils/bc.c
@@ -717,7 +717,6 @@ static BcStatus bc_lex_token(BcLex *l);
717// first in the expr enum. Note: This only works for binary operators. 717// first in the expr enum. Note: This only works for binary operators.
718#define BC_PARSE_TOKEN_INST(t) ((char) ((t) -BC_LEX_NEG + BC_INST_NEG)) 718#define BC_PARSE_TOKEN_INST(t) ((char) ((t) -BC_LEX_NEG + BC_INST_NEG))
719 719
720static BcStatus bc_parse_parse(BcParse *p);
721static BcStatus bc_parse_expr(BcParse *p, uint8_t flags, BcParseNext next); 720static BcStatus bc_parse_expr(BcParse *p, uint8_t flags, BcParseNext next);
722 721
723#endif // ENABLE_BC 722#endif // ENABLE_BC
@@ -845,8 +844,6 @@ static BcStatus bc_vm_posixError(BcStatus s, const char *file, size_t line,
845 844
846static void bc_vm_info(void); 845static void bc_vm_info(void);
847 846
848static const char* const bc_args_env_name = "BC_ENV_ARGS";
849
850static const char bc_err_fmt[] = "\n%s error: %s\n"; 847static const char bc_err_fmt[] = "\n%s error: %s\n";
851static const char bc_warn_fmt[] = "\n%s warning: %s\n"; 848static const char bc_warn_fmt[] = "\n%s warning: %s\n";
852static const char bc_err_line[] = ":%zu\n\n"; 849static const char bc_err_line[] = ":%zu\n\n";
@@ -960,9 +957,6 @@ static const char *bc_err_msgs[] = {
960 957
961}; 958};
962 959
963static const char bc_func_main[] = "(main)";
964static const char bc_func_read[] = "(read)";
965
966#if ENABLE_BC 960#if ENABLE_BC
967static const BcLexKeyword bc_lex_kws[20] = { 961static const BcLexKeyword bc_lex_kws[20] = {
968 BC_LEX_KW_ENTRY("auto", 4, true), 962 BC_LEX_KW_ENTRY("auto", 4, true),
@@ -6895,6 +6889,8 @@ static BcStatus bc_vm_posixError(BcStatus s, const char *file, size_t line,
6895 6889
6896static void bc_vm_envArgs(void) 6890static void bc_vm_envArgs(void)
6897{ 6891{
6892 static const char* const bc_args_env_name = "BC_ENV_ARGS";
6893
6898 BcVec v; 6894 BcVec v;
6899 char *env_args = getenv(bc_args_env_name), *buf; 6895 char *env_args = getenv(bc_args_env_name), *buf;
6900 6896
@@ -7200,8 +7196,8 @@ static void bc_program_init(size_t line_len)
7200 bc_vec_init(&G.prog.fns, sizeof(BcFunc), bc_func_free); 7196 bc_vec_init(&G.prog.fns, sizeof(BcFunc), bc_func_free);
7201 bc_map_init(&G.prog.fn_map); 7197 bc_map_init(&G.prog.fn_map);
7202 7198
7203 bc_program_addFunc(xstrdup(bc_func_main), &idx); 7199 bc_program_addFunc(xstrdup("(main)"), &idx);
7204 bc_program_addFunc(xstrdup(bc_func_read), &idx); 7200 bc_program_addFunc(xstrdup("(read)"), &idx);
7205 7201
7206 bc_vec_init(&G.prog.vars, sizeof(BcVec), bc_vec_free); 7202 bc_vec_init(&G.prog.vars, sizeof(BcVec), bc_vec_free);
7207 bc_map_init(&G.prog.var_map); 7203 bc_map_init(&G.prog.var_map);