summaryrefslogtreecommitdiffstats
path: root/generic/tclStrToD.c
diff options
context:
space:
mode:
authordkf <dkf@noemail.net>2009-01-08 16:41:34 (GMT)
committerdkf <dkf@noemail.net>2009-01-08 16:41:34 (GMT)
commitbb2e95f0aafc8ebb940170baaf51bc6cd82b0a61 (patch)
tree267ec42d4b8749e2fc3f2492f172710bd8a8b5d0 /generic/tclStrToD.c
parent0fa3f0a1d28cc276043d8841fb5668c135fd9965 (diff)
downloadtcl-bb2e95f0aafc8ebb940170baaf51bc6cd82b0a61.zip
tcl-bb2e95f0aafc8ebb940170baaf51bc6cd82b0a61.tar.gz
tcl-bb2e95f0aafc8ebb940170baaf51bc6cd82b0a61.tar.bz2
Generate errorcodes for more cases.
FossilOrigin-Name: a12728cbb91807a88ca7e1a6e8d4678ca5eee07b
Diffstat (limited to 'generic/tclStrToD.c')
-rwxr-xr-xgeneric/tclStrToD.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/generic/tclStrToD.c b/generic/tclStrToD.c
index 8eec7b4..7664ebd 100755
--- a/generic/tclStrToD.c
+++ b/generic/tclStrToD.c
@@ -14,7 +14,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclStrToD.c,v 1.35 2008/12/10 18:21:47 ferrieux Exp $
+ * RCS: @(#) $Id: tclStrToD.c,v 1.36 2009/01/08 16:41:34 dkf Exp $
*
*----------------------------------------------------------------------
*/
@@ -90,7 +90,8 @@ static int maxpow10_wide; /* The powers of ten that can be represented
* exactly as wide integers. */
static Tcl_WideUInt *pow10_wide;
#define MAXPOW 22
-static double pow10vals[MAXPOW+1]; /* The powers of ten that can be represented
+static double pow10vals[MAXPOW+1];
+ /* The powers of ten that can be represented
* exactly as IEEE754 doubles. */
static int mmaxpow; /* Largest power of ten that can be
* represented exactly in a 'double'. */
@@ -1161,6 +1162,7 @@ TclParseNumber(
Tcl_AppendToObj(msg, " (looks like invalid octal number)", -1);
}
Tcl_SetObjResult(interp, msg);
+ Tcl_SetErrorCode(interp, "TCL", "VALUE", "NUMBER", NULL);
}
}
@@ -1339,7 +1341,7 @@ MakeLowPrecisionDouble(
* without special handling.
*/
- retval = (double)(Tcl_WideInt)significand * pow10vals[ exponent ];
+ retval = (double)(Tcl_WideInt)significand * pow10vals[exponent];
goto returnValue;
} else {
int diff = DBL_DIG - numSigDigs;