aboutsummaryrefslogtreecommitdiff
path: root/coreutils/expr.c
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2006-01-30 19:48:23 +0000
committerEric Andersen <andersen@codepoet.org>2006-01-30 19:48:23 +0000
commit5e678873f9ff7c95d43b278feee547ce989b3b20 (patch)
tree6b0bab1e0d6df7f659352acc7dc844663c11634c /coreutils/expr.c
parent2cdd4d56ffc3b467d5ffa76e3c4cd009dc311097 (diff)
downloadbusybox-5e678873f9ff7c95d43b278feee547ce989b3b20.tar.gz
clean up yet more annoying signed/unsigned mismatches and fixup
yet more incorrect types
Diffstat (limited to 'coreutils/expr.c')
-rw-r--r--coreutils/expr.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/coreutils/expr.c b/coreutils/expr.c
index e0eb4ec8c..b23de8e9f 100644
--- a/coreutils/expr.c
+++ b/coreutils/expr.c
@@ -57,10 +57,12 @@ typedef enum valtype TYPE;
#if ENABLE_EXPR_MATH_SUPPORT_64
typedef int64_t arith_t;
#define PF_REZ "ll"
+#define PF_REZ_TYPE (long long)
#define STRTOL(s, e, b) strtoll(s, e, b)
#else
typedef long arith_t;
#define PF_REZ "l"
+#define PF_REZ_TYPE (long)
#define STRTOL(s, e, b) strtol(s, e, b)
#endif
@@ -102,7 +104,7 @@ int expr_main (int argc, char **argv)
bb_error_msg_and_die ("syntax error");
if (v->type == integer)
- printf ("%" PF_REZ "d\n", v->u.i);
+ printf ("%" PF_REZ "d\n", PF_REZ_TYPE v->u.i);
else
puts (v->u.s);
@@ -159,7 +161,7 @@ static int null (VALUE *v)
static void tostring (VALUE *v)
{
if (v->type == integer) {
- v->u.s = bb_xasprintf ("%" PF_REZ "d", v->u.i);
+ v->u.s = bb_xasprintf ("%" PF_REZ "d", PF_REZ_TYPE v->u.i);
v->type = string;
}
}