*endptr = (char*)nptr;
return n;
}
-#define strto_arith_t(nptr, endptr, base_is_always_0) \
- strto_arith_t(nptr, endptr)
+#else /* !ENABLE_FEATURE_SH_MATH_BASE */
+# if ENABLE_FEATURE_SH_MATH_64
+# define strto_arith_t(nptr, endptr) strtoull(nptr, endptr, 0)
+# else
+# define strto_arith_t(nptr, endptr) strtoul(nptr, endptr, 0)
+# endif
#endif
static arith_t FAST_FUNC
/* Number */
numstackptr->var = NULL;
errno = 0;
- numstackptr->val = strto_arith_t(expr, (char**) &expr, 0);
+ numstackptr->val = strto_arith_t(expr, (char**) &expr);
if (errno)
numstackptr->val = 0; /* bash compat */
goto num;
# define ARITH_FMT "%ld"
#endif
-#if !ENABLE_FEATURE_SH_MATH_BASE
-# if ENABLE_FEATURE_SH_MATH_64
-# define strto_arith_t strtoull
-# else
-# define strto_arith_t strtoul
-# endif
-#endif
-
typedef const char* FAST_FUNC (*arith_var_lookup_t)(const char *name);
typedef void FAST_FUNC (*arith_var_set_t)(const char *name, const char *val);
//typedef const char* FAST_FUNC (*arith_var_endofname_t)(const char *name);