diff options
author | Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> | 2007-04-02 16:41:24 +0000 |
---|---|---|
committer | Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> | 2007-04-02 16:41:24 +0000 |
commit | 3c5929a53bf488af6ca5c9bef22bd4179fc9f636 (patch) | |
tree | e6da0bf6d1ceeabeac32404feb1527c9087b5600 | |
parent | adb01b1583199c5563cb729b9485d024cda62b30 (diff) | |
download | busybox-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.c | 56 |
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 | ||
70 | static VALUE *docolon(VALUE * sv, VALUE * pv); | 70 | /* forward declarations */ |
71 | static VALUE *eval(void); | 71 | static VALUE *eval(void); |
72 | static VALUE *int_value(arith_t i); | ||
73 | static VALUE *str_value(const char *s); | ||
74 | static bool nextarg(const char *str); | ||
75 | static int null(VALUE * v); | ||
76 | static bool toarith(VALUE * v); | ||
77 | static void freev(VALUE * v); | ||
78 | static void tostring(VALUE * v); | ||
79 | 72 | ||
80 | int expr_main(int argc, char **argv); | ||
81 | int 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 | |||
484 | int expr_main(int argc, char **argv); | ||
485 | int 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 | |||