shell/math: randomconfig fix
authorDenis Vlasenko <vda.linux@googlemail.com>
Fri, 3 Apr 2009 21:13:31 +0000 (21:13 -0000)
committerDenis Vlasenko <vda.linux@googlemail.com>
Fri, 3 Apr 2009 21:13:31 +0000 (21:13 -0000)
shell/math.c
shell/math.h

index 9a46a937e41b96dc593e1e0ebdb46f1a6b7753ce..8a44c8e88dd7d07ff7a862d8c74d922d3a1a5ebb 100644 (file)
@@ -414,14 +414,14 @@ arith_apply(operator op, v_n_t *numstack, v_n_t **numstackptr, a_e_h_t *math_hoo
                        rez %= numptr_val;
        }
        if (tok_have_assign(op)) {
-               char buf[sizeof(arith_t_type)*3 + 2];
+               char buf[sizeof(arith_t)*3 + 2];
 
                if (numptr_m1->var == NULL) {
                        /* Hmm, 1=2 ? */
                        goto err;
                }
                /* save to shell variable */
-               snprintf(buf, sizeof(buf), arith_t_fmt, (arith_t_type) rez);
+               sprintf(buf, arith_t_fmt, rez);
                setvar(numptr_m1->var, buf, 0);
                /* after saving, make previous value for v++ or v-- */
                if (op == TOK_POST_INC)
@@ -668,7 +668,7 @@ arith(const char *expr, int *perrcode, a_e_h_t *math_hooks)
        } /* while */
 }
 
-/*-
+/*
  * Copyright (c) 1989, 1991, 1993, 1994
  *      The Regents of the University of California.  All rights reserved.
  *
index a52680923abfe590f55b1a7c2a719443f7a73be9..195fc20ba3fe04538601910adb013f070d752359 100644 (file)
 #define _SHELL_MATH_
 
 #if ENABLE_SH_MATH_SUPPORT_64
-typedef int64_t arith_t;
-#define arith_t_type long long
+typedef long long arith_t;
 #define arith_t_fmt "%lld"
 #define strto_arith_t strtoll
 #else
 typedef long arith_t;
-#define arith_t_type long
 #define arith_t_fmt "%ld"
 #define strto_arith_t strtol
 #endif