* archival/bunzip2.c (bunzip2_main): Do not remove files if writing to standard
[oweals/busybox.git] / coreutils / expr.c
index 8ef5293c1d86771fd503ebb15a38964db00af984..0299cc73acea7e24597d56a9f48cd6049253d328 100644 (file)
  * One function can handle multiple operators all of equal precedence,
  * provided they all associate ((x op x) op x). */
 
-#include "busybox.h"
+/* no getopt needed */
+
 #include <stdio.h>
 #include <string.h>
 #include <stdlib.h>
 #include <regex.h>
 #include <sys/types.h>
+#include "busybox.h"
 
 
 /* The kinds of value we can have.  */
@@ -87,8 +89,8 @@ int expr_main (int argc, char **argv)
 
        if (v->type == integer)
                printf ("%d\n", v->u.i);
-       else 
-               printf ("%s\n", v->u.s);
+       else
+               puts (v->u.s);
 
        exit (null (v));
 }
@@ -192,7 +194,7 @@ nextarg (char *str)
 /* The comparison operator handling functions.  */
 
 #define cmpf(name, rel)                                        \
-static int name (l, r) VALUE *l; VALUE *r;             \
+static int name (VALUE *l, VALUE *r)           \
 {                                                      \
        if (l->type == string || r->type == string) {           \
                tostring (l);                           \
@@ -215,7 +217,7 @@ static int name (l, r) VALUE *l; VALUE *r;          \
 
 #define arithf(name, op)                       \
 static                                         \
-int name (l, r) VALUE *l; VALUE *r;            \
+int name (VALUE *l, VALUE *r)          \
 {                                              \
   if (!toarith (l) || !toarith (r))            \
     error_msg_and_die ("non-numeric argument");        \
@@ -223,7 +225,7 @@ int name (l, r) VALUE *l; VALUE *r;         \
 }
 
 #define arithdivf(name, op)                    \
-int name (l, r) VALUE *l; VALUE *r;            \
+static int name (VALUE *l, VALUE *r)           \
 {                                              \
   if (!toarith (l) || !toarith (r))            \
     error_msg_and_die ( "non-numeric argument");       \
@@ -412,7 +414,7 @@ static VALUE *eval5 (void)
 static VALUE *eval4 (void)
 {
        VALUE *l, *r;
-       int (*fxn) (), val;
+       int (*fxn) (VALUE *, VALUE *), val;
 
        l = eval5 ();
        while (1) {
@@ -438,7 +440,7 @@ static VALUE *eval4 (void)
 static VALUE *eval3 (void)
 {
        VALUE *l, *r;
-       int (*fxn) (), val;
+       int (*fxn) (VALUE *, VALUE *), val;
 
        l = eval4 ();
        while (1) {
@@ -462,7 +464,7 @@ static VALUE *eval3 (void)
 static VALUE *eval2 (void)
 {
        VALUE *l, *r;
-       int (*fxn) (), val;
+       int (*fxn) (VALUE *, VALUE *), val;
 
        l = eval3 ();
        while (1) {