* 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. */
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));
}
/* 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); \
#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"); \
}
#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"); \
static VALUE *eval4 (void)
{
VALUE *l, *r;
- int (*fxn) (), val;
+ int (*fxn) (VALUE *, VALUE *), val;
l = eval5 ();
while (1) {
static VALUE *eval3 (void)
{
VALUE *l, *r;
- int (*fxn) (), val;
+ int (*fxn) (VALUE *, VALUE *), val;
l = eval4 ();
while (1) {
static VALUE *eval2 (void)
{
VALUE *l, *r;
- int (*fxn) (), val;
+ int (*fxn) (VALUE *, VALUE *), val;
l = eval3 ();
while (1) {