aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2007-04-02 16:41:24 +0000
committerBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2007-04-02 16:41:24 +0000
commit3c5929a53bf488af6ca5c9bef22bd4179fc9f636 (patch)
treee6da0bf6d1ceeabeac32404feb1527c9087b5600
parentadb01b1583199c5563cb729b9485d024cda62b30 (diff)
downloadbusybox-w32-3c5929a53bf488af6ca5c9bef22bd4179fc9f636.tar.gz
busybox-w32-3c5929a53bf488af6ca5c9bef22bd4179fc9f636.tar.bz2
busybox-w32-3c5929a53bf488af6ca5c9bef22bd4179fc9f636.zip
- remove some unneeded forward declarations. No obj-code changes.
-rw-r--r--coreutils/expr.c56
1 files changed, 26 insertions, 30 deletions
diff --git a/coreutils/expr.c b/coreutils/expr.c
index b082de1e9..8eda36739 100644
--- a/coreutils/expr.c
+++ b/coreutils/expr.c
@@ -67,38 +67,9 @@ struct globals {
67}; 67};
68#define G (*(struct globals*)&bb_common_bufsiz1) 68#define G (*(struct globals*)&bb_common_bufsiz1)
69 69
70static VALUE *docolon(VALUE * sv, VALUE * pv); 70/* forward declarations */
71static VALUE *eval(void); 71static VALUE *eval(void);
72static VALUE *int_value(arith_t i);
73static VALUE *str_value(const char *s);
74static bool nextarg(const char *str);
75static int null(VALUE * v);
76static bool toarith(VALUE * v);
77static void freev(VALUE * v);
78static void tostring(VALUE * v);
79 72
80int expr_main(int argc, char **argv);
81int expr_main(int argc, char **argv)
82{
83 VALUE *v;
84
85 if (argc == 1) {
86 bb_error_msg_and_die("too few arguments");
87 }
88
89 G.args = argv + 1;
90
91 v = eval();
92 if (*G.args)
93 bb_error_msg_and_die("syntax error");
94
95 if (v->type == integer)
96 printf("%" PF_REZ "d\n", PF_REZ_TYPE v->u.i);
97 else
98 puts(v->u.s);
99
100 fflush_stdout_and_exit(null(v));
101}
102 73
103/* Return a VALUE for I. */ 74/* Return a VALUE for I. */
104 75
@@ -509,3 +480,28 @@ static VALUE *eval(void)
509 } 480 }
510 return l; 481 return l;
511} 482}
483
484int expr_main(int argc, char **argv);
485int expr_main(int argc, char **argv)
486{
487 VALUE *v;
488
489 if (argc == 1) {
490 bb_error_msg_and_die("too few arguments");
491 }
492
493 G.args = argv + 1;
494
495 v = eval();
496 if (*G.args)
497 bb_error_msg_and_die("syntax error");
498
499 if (v->type == integer)
500 printf("%" PF_REZ "d\n", PF_REZ_TYPE v->u.i);
501 else
502 puts(v->u.s);
503
504 fflush_stdout_and_exit(null(v));
505}
506
507