diff options
author | dkf <donal.k.fellows@manchester.ac.uk> | 2009-01-08 16:41:34 (GMT) |
---|---|---|
committer | dkf <donal.k.fellows@manchester.ac.uk> | 2009-01-08 16:41:34 (GMT) |
commit | a23a10f4460267a77fa20b723239edaf3a5ce877 (patch) | |
tree | 267ec42d4b8749e2fc3f2492f172710bd8a8b5d0 /generic/tclStrToD.c | |
parent | e241610f648c4f00d9f6b5bff043a865ba8f0054 (diff) | |
download | tcl-a23a10f4460267a77fa20b723239edaf3a5ce877.zip tcl-a23a10f4460267a77fa20b723239edaf3a5ce877.tar.gz tcl-a23a10f4460267a77fa20b723239edaf3a5ce877.tar.bz2 |
Generate errorcodes for more cases.
Diffstat (limited to 'generic/tclStrToD.c')
-rwxr-xr-x | generic/tclStrToD.c | 8 |
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; |