summaryrefslogtreecommitdiffstats
path: root/generic/tclExecute.c
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2002-07-10 08:25:59 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2002-07-10 08:25:59 (GMT)
commit2bd24907d1762ded15a5d294dcc6ad03ed0fd787 (patch)
tree9b1cfa200e4217a99e49898d99a6161a96eb4c66 /generic/tclExecute.c
parent02a6e9afc2955f7bd59537c5a65a6b024a55e796 (diff)
downloadtcl-2bd24907d1762ded15a5d294dcc6ad03ed0fd787.zip
tcl-2bd24907d1762ded15a5d294dcc6ad03ed0fd787.tar.gz
tcl-2bd24907d1762ded15a5d294dcc6ad03ed0fd787.tar.bz2
Fix for bug 579284; registered math funcs can now correctly return wide-ints.
Diffstat (limited to 'generic/tclExecute.c')
-rw-r--r--generic/tclExecute.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/generic/tclExecute.c b/generic/tclExecute.c
index 1f80829..1375b20 100644
--- a/generic/tclExecute.c
+++ b/generic/tclExecute.c
@@ -11,7 +11,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclExecute.c,v 1.75 2002/06/20 14:47:38 msofer Exp $
+ * RCS: @(#) $Id: tclExecute.c,v 1.76 2002/07/10 08:25:59 dkf Exp $
*/
#include "tclInt.h"
@@ -5413,7 +5413,7 @@ ExprCallMathFunc(interp, eePtr, objc, objv)
} else if (mathFuncPtr->argTypes[k] == TCL_WIDE_INT) {
args[k].type = TCL_WIDE_INT;
args[k].wideValue = Tcl_LongAsWide(i);
-#endif /* TCL_WIDE_INT_IS_LONG */
+#endif /* !TCL_WIDE_INT_IS_LONG */
} else {
args[k].type = TCL_INT;
args[k].intValue = i;
@@ -5431,7 +5431,7 @@ ExprCallMathFunc(interp, eePtr, objc, objv)
args[k].type = TCL_WIDE_INT;
args[k].wideValue = w;
}
-#endif /* TCL_WIDE_INT_IS_LONG */
+#endif /* !TCL_WIDE_INT_IS_LONG */
} else {
d = valuePtr->internalRep.doubleValue;
if (mathFuncPtr->argTypes[k] == TCL_INT) {
@@ -5441,7 +5441,7 @@ ExprCallMathFunc(interp, eePtr, objc, objv)
} else if (mathFuncPtr->argTypes[k] == TCL_WIDE_INT) {
args[k].type = TCL_WIDE_INT;
args[k].wideValue = Tcl_DoubleAsWide(d);
-#endif /* TCL_WIDE_INT_IS_LONG */
+#endif /* !TCL_WIDE_INT_IS_LONG */
} else {
args[k].type = TCL_DOUBLE;
args[k].doubleValue = d;
@@ -5475,6 +5475,10 @@ ExprCallMathFunc(interp, eePtr, objc, objv)
if (funcResult.type == TCL_INT) {
PUSH_OBJECT(Tcl_NewLongObj(funcResult.intValue));
+#ifndef TCL_WIDE_INT_IS_LONG
+ } else if (funcResult.type == TCL_WIDE_INT) {
+ PUSH_OBJECT(Tcl_NewWideIntObj(funcResult.wideValue));
+#endif /* !TCL_WIDE_INT_IS_LONG */
} else {
d = funcResult.doubleValue;
if (IS_NAN(d) || IS_INF(d)) {