diff options
author | Eric Andersen <andersen@codepoet.org> | 2006-01-30 19:48:23 +0000 |
---|---|---|
committer | Eric Andersen <andersen@codepoet.org> | 2006-01-30 19:48:23 +0000 |
commit | 5e678873f9ff7c95d43b278feee547ce989b3b20 (patch) | |
tree | 6b0bab1e0d6df7f659352acc7dc844663c11634c /coreutils/expr.c | |
parent | 2cdd4d56ffc3b467d5ffa76e3c4cd009dc311097 (diff) | |
download | busybox-w32-5e678873f9ff7c95d43b278feee547ce989b3b20.tar.gz busybox-w32-5e678873f9ff7c95d43b278feee547ce989b3b20.tar.bz2 busybox-w32-5e678873f9ff7c95d43b278feee547ce989b3b20.zip |
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.c | 6 |
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; | |||
57 | #if ENABLE_EXPR_MATH_SUPPORT_64 | 57 | #if ENABLE_EXPR_MATH_SUPPORT_64 |
58 | typedef int64_t arith_t; | 58 | typedef int64_t arith_t; |
59 | #define PF_REZ "ll" | 59 | #define PF_REZ "ll" |
60 | #define PF_REZ_TYPE (long long) | ||
60 | #define STRTOL(s, e, b) strtoll(s, e, b) | 61 | #define STRTOL(s, e, b) strtoll(s, e, b) |
61 | #else | 62 | #else |
62 | typedef long arith_t; | 63 | typedef long arith_t; |
63 | #define PF_REZ "l" | 64 | #define PF_REZ "l" |
65 | #define PF_REZ_TYPE (long) | ||
64 | #define STRTOL(s, e, b) strtol(s, e, b) | 66 | #define STRTOL(s, e, b) strtol(s, e, b) |
65 | #endif | 67 | #endif |
66 | 68 | ||
@@ -102,7 +104,7 @@ int expr_main (int argc, char **argv) | |||
102 | bb_error_msg_and_die ("syntax error"); | 104 | bb_error_msg_and_die ("syntax error"); |
103 | 105 | ||
104 | if (v->type == integer) | 106 | if (v->type == integer) |
105 | printf ("%" PF_REZ "d\n", v->u.i); | 107 | printf ("%" PF_REZ "d\n", PF_REZ_TYPE v->u.i); |
106 | else | 108 | else |
107 | puts (v->u.s); | 109 | puts (v->u.s); |
108 | 110 | ||
@@ -159,7 +161,7 @@ static int null (VALUE *v) | |||
159 | static void tostring (VALUE *v) | 161 | static void tostring (VALUE *v) |
160 | { | 162 | { |
161 | if (v->type == integer) { | 163 | if (v->type == integer) { |
162 | v->u.s = bb_xasprintf ("%" PF_REZ "d", v->u.i); | 164 | v->u.s = bb_xasprintf ("%" PF_REZ "d", PF_REZ_TYPE v->u.i); |
163 | v->type = string; | 165 | v->type = string; |
164 | } | 166 | } |
165 | } | 167 | } |