projects
/
oweals
/
busybox.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
- fix build
[oweals/busybox.git]
/
coreutils
/
expr.c
diff --git
a/coreutils/expr.c
b/coreutils/expr.c
index e0eb4ec8cdc0f98af117a6bf71cca02cbc788f68..b23de8e9f8b5061125f5aa7cbe14f6e774ce75f2 100644
(file)
--- 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"
#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 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
#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)
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);
else
puts (v->u.s);
@@
-159,7
+161,7
@@
static int null (VALUE *v)
static void tostring (VALUE *v)
{
if (v->type == integer) {
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;
}
}
v->type = string;
}
}