summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2022-02-17 09:51:40 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2022-02-17 09:51:40 (GMT)
commit721b319dcb44dc8af3446dbc91de321fd6a5b707 (patch)
tree891c88867d71742a1d9b34fe85f247a38c655a39
parentd36751c671764d5351700a2ca73e18f78bd6aae8 (diff)
parent8fd0500bc8b2821f46d079ebc6b19bb39a25152e (diff)
downloadtcl-721b319dcb44dc8af3446dbc91de321fd6a5b707.zip
tcl-721b319dcb44dc8af3446dbc91de321fd6a5b707.tar.gz
tcl-721b319dcb44dc8af3446dbc91de321fd6a5b707.tar.bz2
Merge 8.6. Remove some Tcl_Panic()'s which can never happen
-rw-r--r--generic/tclScan.c3
-rw-r--r--generic/tclStrToD.c17
2 files changed, 8 insertions, 12 deletions
diff --git a/generic/tclScan.c b/generic/tclScan.c
index 134f60d..6bc914d 100644
--- a/generic/tclScan.c
+++ b/generic/tclScan.c
@@ -916,9 +916,10 @@ Tcl_ScanObjCmd(
}
if (flags & SCAN_LONGER) {
if (Tcl_GetWideIntFromObj(NULL, objPtr, &wideValue) != TCL_OK) {
- wideValue = WIDE_MAX;
if (TclGetString(objPtr)[0] == '-') {
wideValue = WIDE_MIN;
+ } else {
+ wideValue = WIDE_MAX;
}
}
if ((flags & SCAN_UNSIGNED) && (wideValue < 0)) {
diff --git a/generic/tclStrToD.c b/generic/tclStrToD.c
index 32e6701..5ee5945 100644
--- a/generic/tclStrToD.c
+++ b/generic/tclStrToD.c
@@ -543,8 +543,7 @@ TclParseNumber(
int under = 0; /* Flag trailing '_' as error if true once
* number is accepted. */
-#define ALL_BITS UWIDE_MAX
-#define MOST_BITS (ALL_BITS >> 1)
+#define MOST_BITS (UWIDE_MAX >> 1)
/*
* Initialize bytes to start of the object's string rep if the caller
@@ -915,7 +914,7 @@ TclParseNumber(
acceptState = state;
acceptPoint = p;
acceptLen = len;
- /* FALLTHRU */
+ /* FALLTHRU */
case ZERO_B:
zerob:
if (c == '0') {
@@ -3852,15 +3851,13 @@ ShouldBankerRoundUp(
int r = mp_cmp_mag(twor, S);
switch (r) {
- case MP_LT:
- return 0;
case MP_EQ:
return isodd;
case MP_GT:
return 1;
+ default:
+ return 0;
}
- Tcl_Panic("in ShouldBankerRoundUp, trichotomy fails!");
- return 0;
}
/*
@@ -3898,15 +3895,13 @@ ShouldBankerRoundUpToNext(
r = mp_cmp_mag(&temp, S);
mp_clear(&temp);
switch(r) {
- case MP_LT:
- return 0;
case MP_EQ:
return isodd;
case MP_GT:
return 1;
+ default:
+ return 0;
}
- Tcl_Panic("in ShouldBankerRoundUpToNext, trichotomy fails!");
- return 0;
}
/*