summaryrefslogtreecommitdiffstats
path: root/generic/tclStrToD.c
diff options
context:
space:
mode:
Diffstat (limited to 'generic/tclStrToD.c')
-rw-r--r--generic/tclStrToD.c65
1 files changed, 33 insertions, 32 deletions
diff --git a/generic/tclStrToD.c b/generic/tclStrToD.c
index a816062..49610be 100644
--- a/generic/tclStrToD.c
+++ b/generic/tclStrToD.c
@@ -261,34 +261,35 @@ static const int log2pow5[27] = {
};
#define N_LOG2POW5 27
-static const Tcl_WideUInt wuipow5[27] = {
- (Tcl_WideUInt) 1, /* 5**0 */
- (Tcl_WideUInt) 5,
- (Tcl_WideUInt) 25,
- (Tcl_WideUInt) 125,
- (Tcl_WideUInt) 625,
- (Tcl_WideUInt) 3125, /* 5**5 */
- (Tcl_WideUInt) 3125*5,
- (Tcl_WideUInt) 3125*25,
- (Tcl_WideUInt) 3125*125,
- (Tcl_WideUInt) 3125*625,
- (Tcl_WideUInt) 3125*3125, /* 5**10 */
- (Tcl_WideUInt) 3125*3125*5,
- (Tcl_WideUInt) 3125*3125*25,
- (Tcl_WideUInt) 3125*3125*125,
- (Tcl_WideUInt) 3125*3125*625,
- (Tcl_WideUInt) 3125*3125*3125, /* 5**15 */
- (Tcl_WideUInt) 3125*3125*3125*5,
- (Tcl_WideUInt) 3125*3125*3125*25,
- (Tcl_WideUInt) 3125*3125*3125*125,
- (Tcl_WideUInt) 3125*3125*3125*625,
- (Tcl_WideUInt) 3125*3125*3125*3125, /* 5**20 */
- (Tcl_WideUInt) 3125*3125*3125*3125*5,
- (Tcl_WideUInt) 3125*3125*3125*3125*25,
- (Tcl_WideUInt) 3125*3125*3125*3125*125,
- (Tcl_WideUInt) 3125*3125*3125*3125*625,
- (Tcl_WideUInt) 3125*3125*3125*3125*3125, /* 5**25 */
- (Tcl_WideUInt) 3125*3125*3125*3125*3125*5 /* 5**26 */
+static const Tcl_WideUInt wuipow5[] = {
+ (Tcl_WideUInt) 1U, /* 5**0 */
+ (Tcl_WideUInt) 5U,
+ (Tcl_WideUInt) 25U,
+ (Tcl_WideUInt) 125U,
+ (Tcl_WideUInt) 625U,
+ (Tcl_WideUInt) 3125U, /* 5**5 */
+ (Tcl_WideUInt) 3125U*5U,
+ (Tcl_WideUInt) 3125U*25U,
+ (Tcl_WideUInt) 3125U*125U,
+ (Tcl_WideUInt) 3125U*625U,
+ (Tcl_WideUInt) 3125U*3125U, /* 5**10 */
+ (Tcl_WideUInt) 3125U*3125U*5U,
+ (Tcl_WideUInt) 3125U*3125U*25U,
+ (Tcl_WideUInt) 3125U*3125U*125U,
+ (Tcl_WideUInt) 3125U*3125U*625U,
+ (Tcl_WideUInt) 3125U*3125U*3125U, /* 5**15 */
+ (Tcl_WideUInt) 3125U*3125U*3125U*5U,
+ (Tcl_WideUInt) 3125U*3125U*3125U*25U,
+ (Tcl_WideUInt) 3125U*3125U*3125U*125U,
+ (Tcl_WideUInt) 3125U*3125U*3125U*625U,
+ (Tcl_WideUInt) 3125U*3125U*3125U*3125U, /* 5**20 */
+ (Tcl_WideUInt) 3125U*3125U*3125U*3125U*5U,
+ (Tcl_WideUInt) 3125U*3125U*3125U*3125U*25U,
+ (Tcl_WideUInt) 3125U*3125U*3125U*3125U*125U,
+ (Tcl_WideUInt) 3125U*3125U*3125U*3125U*625U,
+ (Tcl_WideUInt) 3125U*3125U*3125U*3125U*3125U, /* 5**25 */
+ (Tcl_WideUInt) 3125U*3125U*3125U*3125U*3125U*5U,
+ (Tcl_WideUInt) 3125U*3125U*3125U*3125U*3125U*25U /* 5**27 */
};
/*
@@ -1522,7 +1523,7 @@ TclParseNumber(
expected);
Tcl_AppendLimitedToObj(msg, bytes, numBytes, 50, "");
- Tcl_AppendToObj(msg, "\"", -1);
+ Tcl_AppendToObj(msg, "\"", TCL_INDEX_NONE);
Tcl_SetObjResult(interp, msg);
Tcl_SetErrorCode(interp, "TCL", "VALUE", "NUMBER", NULL);
}
@@ -4484,7 +4485,7 @@ TclDoubleDigits(
++m2plus;
}
- if (s5+1 < N_LOG2POW5 && s2+1 + log2pow5[s5+1] <= 64) {
+ if (s5+1 < N_LOG2POW5 && s2+1 + log2pow5[s5+1] < 64) {
/*
* If 10*2**s2*5**s5 == 2**(s2+1)+5**(s5+1) fits in a 64-bit word,
* then all our intermediate calculations can be done using exact
@@ -4541,7 +4542,7 @@ TclDoubleDigits(
s2 -= b2; b2 = 0;
}
- if (s5+1 < N_LOG2POW5 && s2+1 + log2pow5[s5+1] <= 64) {
+ if (s5+1 < N_LOG2POW5 && s2+1 + log2pow5[s5+1] < 64) {
/*
* If 10*2**s2*5**s5 == 2**(s2+1)+5**(s5+1) fits in a 64-bit word,
* then all our intermediate calculations can be done using exact
@@ -4786,7 +4787,7 @@ Tcl_InitBignumFromDouble(
if (interp != NULL) {
const char *s = "integer value too large to represent";
- Tcl_SetObjResult(interp, Tcl_NewStringObj(s, -1));
+ Tcl_SetObjResult(interp, Tcl_NewStringObj(s, TCL_INDEX_NONE));
Tcl_SetErrorCode(interp, "ARITH", "IOVERFLOW", s, NULL);
}
return TCL_ERROR;