summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--generic/tclBasic.c47
-rw-r--r--generic/tclCmdMZ.c7
-rw-r--r--generic/tclCompCmdsSZ.c3
-rw-r--r--generic/tclExecute.c11
-rw-r--r--generic/tclInt.h11
-rw-r--r--generic/tclObj.c6
-rw-r--r--generic/tclScan.c27
-rw-r--r--generic/tclStringObj.c91
-rw-r--r--generic/tclStubInit.c4
-rw-r--r--tests/get.test12
-rw-r--r--tests/obj.test12
-rw-r--r--tests/platform.test2
-rw-r--r--tests/string.test12
-rw-r--r--tests/uplevel.test16
14 files changed, 70 insertions, 191 deletions
diff --git a/generic/tclBasic.c b/generic/tclBasic.c
index 93776dc..699975e 100644
--- a/generic/tclBasic.c
+++ b/generic/tclBasic.c
@@ -116,7 +116,6 @@ static Tcl_ObjCmdProc ExprCeilFunc;
static Tcl_ObjCmdProc ExprDoubleFunc;
static Tcl_ObjCmdProc ExprEntierFunc;
static Tcl_ObjCmdProc ExprFloorFunc;
-static Tcl_ObjCmdProc ExprIntFunc;
static Tcl_ObjCmdProc ExprIsqrtFunc;
static Tcl_ObjCmdProc ExprMaxFunc;
static Tcl_ObjCmdProc ExprMinFunc;
@@ -125,7 +124,7 @@ static Tcl_ObjCmdProc ExprRoundFunc;
static Tcl_ObjCmdProc ExprSqrtFunc;
static Tcl_ObjCmdProc ExprSrandFunc;
static Tcl_ObjCmdProc ExprUnaryFunc;
-static Tcl_ObjCmdProc ExprWideFunc;
+static Tcl_ObjCmdProc ExprIntFunc;
static void MathFuncWrongNumArgs(Tcl_Interp *interp, int expected,
int actual, Tcl_Obj *const *objv);
static Tcl_NRPostProc NRCoroutineCallerCallback;
@@ -336,7 +335,7 @@ static const BuiltinFuncDef BuiltinFuncTable[] = {
{ "srand", ExprSrandFunc, NULL },
{ "tan", ExprUnaryFunc, (ClientData) tan },
{ "tanh", ExprUnaryFunc, (ClientData) tanh },
- { "wide", ExprWideFunc, NULL },
+ { "wide", ExprIntFunc, NULL },
{ NULL, NULL, NULL }
};
@@ -3660,16 +3659,8 @@ OldMathFuncProc(
args[k].doubleValue = d;
break;
case TCL_INT:
- if (ExprIntFunc(NULL, interp, 2, &objv[j-1]) != TCL_OK) {
- ckfree(args);
- return TCL_ERROR;
- }
- valuePtr = Tcl_GetObjResult(interp);
- Tcl_GetLongFromObj(NULL, valuePtr, &args[k].intValue);
- Tcl_ResetResult(interp);
- break;
case TCL_WIDE_INT:
- if (ExprWideFunc(NULL, interp, 2, &objv[j-1]) != TCL_OK) {
+ if (ExprIntFunc(NULL, interp, 2, &objv[j-1]) != TCL_OK) {
ckfree(args);
return TCL_ERROR;
}
@@ -7680,38 +7671,6 @@ ExprIntFunc(
int objc, /* Actual parameter count. */
Tcl_Obj *const *objv) /* Actual parameter vector. */
{
- long iResult;
- Tcl_Obj *objPtr;
- if (ExprEntierFunc(NULL, interp, objc, objv) != TCL_OK) {
- return TCL_ERROR;
- }
- objPtr = Tcl_GetObjResult(interp);
- if (TclGetLongFromObj(NULL, objPtr, &iResult) != TCL_OK) {
- /*
- * Truncate the bignum; keep only bits in long range.
- */
-
- mp_int big;
-
- Tcl_GetBignumFromObj(NULL, objPtr, &big);
- mp_mod_2d(&big, (int) CHAR_BIT * sizeof(long), &big);
- objPtr = Tcl_NewBignumObj(&big);
- Tcl_IncrRefCount(objPtr);
- TclGetLongFromObj(NULL, objPtr, &iResult);
- Tcl_DecrRefCount(objPtr);
- }
- Tcl_SetObjResult(interp, Tcl_NewLongObj(iResult));
- return TCL_OK;
-}
-
-static int
-ExprWideFunc(
- ClientData clientData, /* Ignored. */
- Tcl_Interp *interp, /* The interpreter in which to execute the
- * function. */
- int objc, /* Actual parameter count. */
- Tcl_Obj *const *objv) /* Actual parameter vector. */
-{
Tcl_WideInt wResult;
Tcl_Obj *objPtr;
diff --git a/generic/tclCmdMZ.c b/generic/tclCmdMZ.c
index 0bd6cb4..f99a4a0 100644
--- a/generic/tclCmdMZ.c
+++ b/generic/tclCmdMZ.c
@@ -1622,11 +1622,6 @@ StringIsCmd(
case STR_IS_GRAPH:
chcomp = Tcl_UniCharIsGraph;
break;
- case STR_IS_INT:
- if (TCL_OK == TclGetIntFromObj(NULL, objPtr, &i)) {
- break;
- }
- goto failedIntParse;
case STR_IS_ENTIER:
if ((objPtr->typePtr == &tclIntType) ||
(objPtr->typePtr == &tclBignumType)) {
@@ -1669,12 +1664,12 @@ StringIsCmd(
failat = 0;
}
break;
+ case STR_IS_INT:
case STR_IS_WIDE:
if (TCL_OK == TclGetWideIntFromObj(NULL, objPtr, &w)) {
break;
}
- failedIntParse:
string1 = TclGetStringFromObj(objPtr, &length1);
if (length1 == 0) {
if (strict) {
diff --git a/generic/tclCompCmdsSZ.c b/generic/tclCompCmdsSZ.c
index 9434e54..8ab1ffa 100644
--- a/generic/tclCompCmdsSZ.c
+++ b/generic/tclCompCmdsSZ.c
@@ -692,9 +692,6 @@ TclCompileStringIsCmd(
switch (t) {
case STR_IS_INT:
- PUSH( "1");
- OP( EQ);
- break;
case STR_IS_WIDE:
PUSH( "2");
OP( LE);
diff --git a/generic/tclExecute.c b/generic/tclExecute.c
index 82de752..034bfd2 100644
--- a/generic/tclExecute.c
+++ b/generic/tclExecute.c
@@ -5634,18 +5634,9 @@ TEBCresume(
case INST_NUM_TYPE:
if (GetNumberFromObj(NULL, OBJ_AT_TOS, &ptr1, &type1) != TCL_OK) {
type1 = 0;
- } else if (type1 == TCL_NUMBER_WIDE) {
- /* value is between LLONG_MIN and LLONG_MAX */
- /* [string is integer] is -UINT_MAX to UINT_MAX range */
- /* [string is wideinteger] is -ULLONG_MAX to ULLONG_MAX range */
- int i;
-
- if (Tcl_GetIntFromObj(NULL, OBJ_AT_TOS, &i) == TCL_OK) {
- type1 = TCL_NUMBER_LONG;
- }
} else if (type1 == TCL_NUMBER_BIG) {
/* value is an integer outside the LLONG_MIN to LLONG_MAX range */
- /* [string is wideinteger] is -ULLONG_MAX to ULLONG_MAX range */
+ /* [string is wideinteger] is LLONG_MIN to LLONG_MAX range */
Tcl_WideInt w;
if (Tcl_GetWideIntFromObj(NULL, OBJ_AT_TOS, &w) == TCL_OK) {
diff --git a/generic/tclInt.h b/generic/tclInt.h
index 5379396..038fa88 100644
--- a/generic/tclInt.h
+++ b/generic/tclInt.h
@@ -2497,7 +2497,7 @@ typedef struct List {
#else
#define TclGetLongFromObj(interp, objPtr, longPtr) \
(((objPtr)->typePtr == &tclIntType \
- && (objPtr)->internalRep.wideValue >= -(Tcl_WideInt)(ULONG_MAX) \
+ && (objPtr)->internalRep.wideValue >= (Tcl_WideInt)(LONG_MIN) \
&& (objPtr)->internalRep.wideValue <= (Tcl_WideInt)(ULONG_MAX)) \
? ((*(longPtr) = (long)(objPtr)->internalRep.wideValue), TCL_OK) \
: Tcl_GetLongFromObj((interp), (objPtr), (longPtr)))
@@ -2505,7 +2505,7 @@ typedef struct List {
#define TclGetIntFromObj(interp, objPtr, intPtr) \
(((objPtr)->typePtr == &tclIntType \
- && (objPtr)->internalRep.wideValue >= -(Tcl_WideInt)(UINT_MAX) \
+ && (objPtr)->internalRep.wideValue >= (Tcl_WideInt)(INT_MIN) \
&& (objPtr)->internalRep.wideValue <= (Tcl_WideInt)(UINT_MAX)) \
? ((*(intPtr) = (int)(objPtr)->internalRep.wideValue), TCL_OK) \
: Tcl_GetIntFromObj((interp), (objPtr), (intPtr)))
@@ -2709,8 +2709,11 @@ typedef struct ProcessGlobalValue {
*----------------------------------------------------------------------
*/
-#define TCL_NUMBER_LONG 1
-#define TCL_NUMBER_WIDE 2
+#define TCL_NUMBER_INT 2
+#if TCL_MAJOR_VERSION < 9
+# define TCL_NUMBER_LONG 1 /* deprecated, not used any more */
+# define TCL_NUMBER_WIDE TCL_NUMBER_INT /* deprecated */
+#endif
#define TCL_NUMBER_BIG 3
#define TCL_NUMBER_DOUBLE 4
#define TCL_NUMBER_NAN 5
diff --git a/generic/tclObj.c b/generic/tclObj.c
index 16ef7c3..b1e4b29 100644
--- a/generic/tclObj.c
+++ b/generic/tclObj.c
@@ -2516,7 +2516,7 @@ Tcl_GetIntFromObj(
if (TclGetLongFromObj(interp, objPtr, &l) != TCL_OK) {
return TCL_ERROR;
}
- if ((ULONG_MAX > UINT_MAX) && ((l > UINT_MAX) || (l < -(long)UINT_MAX))) {
+ if ((ULONG_MAX > UINT_MAX) && ((l > (long)(UINT_MAX)) || (l < (long)(INT_MIN)))) {
if (interp != NULL) {
const char *s =
"integer value too large to represent as non-long integer";
@@ -2796,7 +2796,7 @@ Tcl_GetLongFromObj(
#else
if (objPtr->typePtr == &tclIntType) {
/*
- * We return any integer in the range -ULONG_MAX to ULONG_MAX
+ * We return any integer in the range LONG_MIN to ULONG_MAX
* converted to a long, ignoring overflow. The rule preserves
* existing semantics for conversion of integers on input, but
* avoids inadvertent demotion of wide integers to 32-bit ones in
@@ -2805,7 +2805,7 @@ Tcl_GetLongFromObj(
Tcl_WideInt w = objPtr->internalRep.wideValue;
- if (w >= -(Tcl_WideInt)(ULONG_MAX)
+ if (w >= (Tcl_WideInt)(LONG_MIN)
&& w <= (Tcl_WideInt)(ULONG_MAX)) {
*longPtr = Tcl_WideAsLong(w);
return TCL_OK;
diff --git a/generic/tclScan.c b/generic/tclScan.c
index 0e3da17..458dbd8 100644
--- a/generic/tclScan.c
+++ b/generic/tclScan.c
@@ -571,11 +571,10 @@ Tcl_ScanObjCmd(
const char *format;
int numVars, nconversions, totalVars = -1;
int objIndex, offset, i, result, code;
- long value;
+ Tcl_WideInt value;
const char *string, *end, *baseString;
char op = 0;
int width, underflow = 0;
- Tcl_WideInt wideValue;
Tcl_UniChar ch = 0, sch = 0;
Tcl_Obj **objs = NULL, *objPtr = NULL;
int flags;
@@ -924,21 +923,7 @@ Tcl_ScanObjCmd(
Tcl_DecrRefCount(objPtr);
break;
}
- if (flags & SCAN_LONGER) {
- if (Tcl_GetWideIntFromObj(NULL, objPtr, &wideValue) != TCL_OK) {
- wideValue = LLONG_MAX;
- if (TclGetString(objPtr)[0] == '-') {
- wideValue = LLONG_MIN;
- }
- }
- if ((flags & SCAN_UNSIGNED) && (wideValue < 0)) {
- sprintf(buf, "%" TCL_LL_MODIFIER "u",
- (Tcl_WideUInt)wideValue);
- Tcl_SetStringObj(objPtr, buf, -1);
- } else {
- TclSetIntObj(objPtr, wideValue);
- }
- } else if (flags & SCAN_BIG) {
+ if (flags & SCAN_BIG) {
if (flags & SCAN_UNSIGNED) {
mp_int big;
int code = Tcl_GetBignumFromObj(interp, objPtr, &big);
@@ -963,15 +948,15 @@ Tcl_ScanObjCmd(
}
}
} else {
- if (TclGetLongFromObj(NULL, objPtr, &value) != TCL_OK) {
+ if (TclGetWideIntFromObj(NULL, objPtr, &value) != TCL_OK) {
if (TclGetString(objPtr)[0] == '-') {
- value = LONG_MIN;
+ value = LLONG_MIN;
} else {
- value = LONG_MAX;
+ value = LLONG_MAX;
}
}
if ((flags & SCAN_UNSIGNED) && (value < 0)) {
- sprintf(buf, "%lu", value); /* INTL: ISO digit */
+ sprintf(buf, "%" TCL_LL_MODIFIER "u", value); /* INTL: ISO digit */
Tcl_SetStringObj(objPtr, buf, -1);
} else {
TclSetIntObj(objPtr, value);
diff --git a/generic/tclStringObj.c b/generic/tclStringObj.c
index f98180f..60df2dd 100644
--- a/generic/tclStringObj.c
+++ b/generic/tclStringObj.c
@@ -1793,9 +1793,6 @@ Tcl_AppendFormatToObj(
char *end;
int gotMinus = 0, gotHash = 0, gotZero = 0, gotSpace = 0, gotPlus = 0;
int width, gotPrecision, precision, sawFlag, useShort = 0, useBig = 0;
-#ifndef TCL_WIDE_INT_IS_LONG
- int useWide = 0;
-#endif
int newXpg, numChars, allocSegment = 0, segmentLimit, segmentNumBytes;
Tcl_Obj *segment;
int step = TclUtfToUniChar(format, &ch);
@@ -1986,18 +1983,11 @@ Tcl_AppendFormatToObj(
useBig = 1;
format += step;
step = TclUtfToUniChar(format, &ch);
-#ifndef TCL_WIDE_INT_IS_LONG
- } else {
- useWide = 1;
-#endif
}
} else if (ch == 'I') {
if ((format[1] == '6') && (format[2] == '4')) {
format += (step + 2);
step = TclUtfToUniChar(format, &ch);
-#ifndef TCL_WIDE_INT_IS_LONG
- useWide = 1;
-#endif
} else if ((format[1] == '3') && (format[2] == '2')) {
format += (step + 2);
step = TclUtfToUniChar(format, &ch);
@@ -2067,16 +2057,10 @@ Tcl_AppendFormatToObj(
case 'b': {
short s = 0; /* Silence compiler warning; only defined and
* used when useShort is true. */
- long l;
Tcl_WideInt w;
mp_int big;
int toAppend, isNegative = 0;
-#ifndef TCL_WIDE_INT_IS_LONG
- if (ch == 'p') {
- useWide = 1;
- }
-#endif
if (useBig) {
int cmpResult;
if (Tcl_GetBignumFromObj(interp, segment, &big) != TCL_OK) {
@@ -2095,53 +2079,32 @@ Tcl_AppendFormatToObj(
ch = 'd';
}
}
-#ifndef TCL_WIDE_INT_IS_LONG
- } else if (useWide) {
- if (TclGetWideIntFromObj(NULL, segment, &w) != TCL_OK) {
- Tcl_Obj *objPtr;
+ } else if (TclGetWideIntFromObj(NULL, segment, &w) != TCL_OK) {
+ Tcl_Obj *objPtr;
- if (Tcl_GetBignumFromObj(interp,segment,&big) != TCL_OK) {
- goto error;
- }
- mp_mod_2d(&big, (int) CHAR_BIT*sizeof(Tcl_WideInt), &big);
- objPtr = Tcl_NewBignumObj(&big);
- Tcl_IncrRefCount(objPtr);
- TclGetWideIntFromObj(NULL, objPtr, &w);
- Tcl_DecrRefCount(objPtr);
- }
- isNegative = (w < (Tcl_WideInt) 0);
- if (w == (Tcl_WideInt) 0) gotHash = 0;
-#endif
- } else if (TclGetLongFromObj(NULL, segment, &l) != TCL_OK) {
- if (TclGetWideIntFromObj(NULL, segment, &w) != TCL_OK) {
- Tcl_Obj *objPtr;
-
- if (Tcl_GetBignumFromObj(interp,segment,&big) != TCL_OK) {
- goto error;
- }
- mp_mod_2d(&big, (int) CHAR_BIT * sizeof(long), &big);
- objPtr = Tcl_NewBignumObj(&big);
- Tcl_IncrRefCount(objPtr);
- TclGetLongFromObj(NULL, objPtr, &l);
- Tcl_DecrRefCount(objPtr);
- } else {
- l = Tcl_WideAsLong(w);
+ if (Tcl_GetBignumFromObj(interp,segment,&big) != TCL_OK) {
+ goto error;
}
+ mp_mod_2d(&big, (int) CHAR_BIT * sizeof(long), &big);
+ objPtr = Tcl_NewBignumObj(&big);
+ Tcl_IncrRefCount(objPtr);
+ TclGetWideIntFromObj(NULL, objPtr, &w);
+ Tcl_DecrRefCount(objPtr);
if (useShort) {
- s = (short) l;
+ s = (short) w;
isNegative = (s < (short) 0);
if (s == (short) 0) gotHash = 0;
} else {
- isNegative = (l < (long) 0);
- if (l == (long) 0) gotHash = 0;
+ isNegative = (w < (long) 0);
+ if (w == (long) 0) gotHash = 0;
}
} else if (useShort) {
- s = (short) l;
+ s = (short) w;
isNegative = (s < (short) 0);
if (s == (short) 0) gotHash = 0;
} else {
- isNegative = (l < (long) 0);
- if (l == (long) 0) gotHash = 0;
+ isNegative = (w < (Tcl_WideInt) 0);
+ if (w == (Tcl_WideInt) 0) gotHash = 0;
}
segment = Tcl_NewObj();
@@ -2190,14 +2153,10 @@ Tcl_AppendFormatToObj(
if (useShort) {
pure = Tcl_NewIntObj((int) s);
-#ifndef TCL_WIDE_INT_IS_LONG
- } else if (useWide) {
- pure = Tcl_NewWideIntObj(w);
-#endif
} else if (useBig) {
pure = Tcl_NewBignumObj(&big);
} else {
- pure = Tcl_NewLongObj(l);
+ pure = Tcl_NewWideIntObj(w);
}
Tcl_IncrRefCount(pure);
bytes = TclGetStringFromObj(pure, &length);
@@ -2277,16 +2236,6 @@ Tcl_AppendFormatToObj(
numDigits++;
us /= base;
}
-#ifndef TCL_WIDE_INT_IS_LONG
- } else if (useWide) {
- Tcl_WideUInt uw = (Tcl_WideUInt) w;
-
- bits = uw;
- while (uw) {
- numDigits++;
- uw /= base;
- }
-#endif
} else if (useBig && big.used) {
int leftover = (big.used * DIGIT_BIT) % numBits;
mp_digit mask = (~(mp_digit)0) << (DIGIT_BIT-leftover);
@@ -2303,12 +2252,12 @@ Tcl_AppendFormatToObj(
goto errorMsg;
}
} else if (!useBig) {
- unsigned long ul = (unsigned long) l;
+ Tcl_WideUInt uw = (Tcl_WideUInt) w;
- bits = (Tcl_WideUInt) ul;
- while (ul) {
+ bits = (Tcl_WideUInt) uw;
+ while (uw) {
numDigits++;
- ul /= base;
+ uw /= base;
}
}
diff --git a/generic/tclStubInit.c b/generic/tclStubInit.c
index c4706df..a7a9b0b 100644
--- a/generic/tclStubInit.c
+++ b/generic/tclStubInit.c
@@ -271,7 +271,7 @@ static int exprInt(Tcl_Interp *interp, const char *expr, int *ptr){
long longValue;
int result = Tcl_ExprLong(interp, expr, &longValue);
if (result == TCL_OK) {
- if ((longValue >= -(long)(UINT_MAX))
+ if ((longValue >= (long)(INT_MIN))
&& (longValue <= (long)(UINT_MAX))) {
*ptr = (int)longValue;
} else {
@@ -287,7 +287,7 @@ static int exprIntObj(Tcl_Interp *interp, Tcl_Obj*expr, int *ptr){
long longValue;
int result = Tcl_ExprLongObj(interp, expr, &longValue);
if (result == TCL_OK) {
- if ((longValue >= -(long)(UINT_MAX))
+ if ((longValue >= (long)(INT_MIN))
&& (longValue <= (long)(UINT_MAX))) {
*ptr = (int)longValue;
} else {
diff --git a/tests/get.test b/tests/get.test
index d6a7206..b02b686 100644
--- a/tests/get.test
+++ b/tests/get.test
@@ -45,14 +45,14 @@ test get-1.7 {Tcl_GetInt procedure} {testgetint longIs64bit} {
list [catch {testgetint 44 18446744073709551616} msg] $msg $errorCode
} {1 {integer value too large to represent} {ARITH IOVERFLOW {integer value too large to represent}}}
test get-1.8 {Tcl_GetInt procedure} {testgetint longIs64bit} {
- list [catch {testgetint 18446744073709551614} msg] $msg
-} {0 -2}
+ list [catch {testgetint 18446744073709551614} msg] $msg $errorCode
+} {1 {integer value too large to represent} {ARITH IOVERFLOW {integer value too large to represent}}}
test get-1.9 {Tcl_GetInt procedure} {testgetint longIs64bit} {
- list [catch {testgetint +18446744073709551614} msg] $msg
-} {0 -2}
+ list [catch {testgetint +18446744073709551614} msg] $msg $errorCode
+} {1 {integer value too large to represent} {ARITH IOVERFLOW {integer value too large to represent}}}
test get-1.10 {Tcl_GetInt procedure} {testgetint longIs64bit} {
- list [catch {testgetint -18446744073709551614} msg] $msg
-} {0 2}
+ list [catch {testgetint -18446744073709551614} msg] $msg $errorCode
+} {1 {integer value too large to represent} {ARITH IOVERFLOW {integer value too large to represent}}}
test get-1.11 {Tcl_GetInt procedure} {testgetint longIs32bit} {
list [catch {testgetint 44 4294967296} msg] $msg $errorCode
} {1 {integer value too large to represent} {ARITH IOVERFLOW {integer value too large to represent}}}
diff --git a/tests/obj.test b/tests/obj.test
index cb62d3f..ffd1a59 100644
--- a/tests/obj.test
+++ b/tests/obj.test
@@ -558,9 +558,9 @@ test obj-33.2 {integer overflow on input} {longIs32bit wideBiggerThanInt} {
list [string is integer $x] [expr { wide($x) }]
} {1 4294967295}
test obj-33.3 {integer overflow on input} {
- set x 0x10000; append x 0000
- list [string is integer $x] [expr { wide($x) }]
-} {0 4294967296}
+ set x 0x100000000; append x 00000000
+ list [string is integer $x] [expr { $x }]
+} {0 18446744073709551616}
test obj-33.4 {integer overflow on input} {longIs32bit wideBiggerThanInt} {
set x -0x8000; append x 0000
list [string is integer $x] [expr { wide($x) }]
@@ -574,9 +574,9 @@ test obj-33.6 {integer overflow on input} {longIs32bit wideBiggerThanInt} {
list [string is integer $x] [expr { wide($x) }]
} {1 -4294967295}
test obj-33.7 {integer overflow on input} {
- set x -0x10000; append x 0000
- list [string is integer $x] [expr { wide($x) }]
-} {0 -4294967296}
+ set x -0x100000000; append x 00000000
+ list [string is integer $x] [expr { $x }]
+} {0 -18446744073709551616}
test obj-34.1 {mp_iseven} testobj {
set result ""
diff --git a/tests/platform.test b/tests/platform.test
index fa533e8..83848e8 100644
--- a/tests/platform.test
+++ b/tests/platform.test
@@ -43,7 +43,7 @@ test platform-1.1 {TclpSetVariables: tcl_platform} {
# everything these days. Note that this does *not* use wide(), and
# this is intentional since that could make Tcl's numbers wider than
# the machine-integer on some platforms...
-test platform-2.1 {tcl_platform(wordSize) indicates size of native word} {
+test platform-2.1 {tcl_platform(wordSize) indicates size of native word} nonPortable {
set result [expr {int(1 << (8 * $tcl_platform(wordSize) - 1))}]
# Result must be the largest bit in a machine word, which this checks
# without assuming how wide the word really is
diff --git a/tests/string.test b/tests/string.test
index d169193..81588ff 100644
--- a/tests/string.test
+++ b/tests/string.test
@@ -807,20 +807,20 @@ test string-6.91.$noComp {string is double, bad doubles} {
}
return $result
} {1 1 0 0 0 1 0 0}
-test string-6.92.$noComp {string is integer, 32-bit overflow} {
+test string-6.92.$noComp {string is integer, 64-bit overflow} {
# Bug 718878
- set x 0x100000000
+ set x 0x10000000000000000
list [run {string is integer -failindex var $x}] $var
} {0 -1}
-test string-6.93.$noComp {string is integer, 32-bit overflow} {
+test string-6.93.$noComp {string is integer, 64-bit overflow} {
# Bug 718878
- set x 0x100000000
+ set x 0x10000000000000000
append x ""
list [run {string is integer -failindex var $x}] $var
} {0 -1}
-test string-6.94.$noComp {string is integer, 32-bit overflow} {
+test string-6.94.$noComp {string is integer, 64-bit overflow} {
# Bug 718878
- set x 0x100000000
+ set x 0x10000000000000000
list [run {string is integer -failindex var [expr {$x}]}] $var
} {0 -1}
test string-6.95.$noComp {string is wideinteger, true} {
diff --git a/tests/uplevel.test b/tests/uplevel.test
index 737c571..83d6b42 100644
--- a/tests/uplevel.test
+++ b/tests/uplevel.test
@@ -137,18 +137,18 @@ test uplevel-4.15 {level parsing} {
test uplevel-4.16 {level parsing} {
apply {{} {uplevel #[expr 1] {}}}
} {}
-test uplevel-4.17 {level parsing} {
+test uplevel-4.17 {level parsing} -returnCodes error -body {
apply {{} {uplevel -0xffffffff {}}}
-} {}
-test uplevel-4.18 {level parsing} {
+} -result {invalid command name "-0xffffffff"}
+test uplevel-4.18 {level parsing} -returnCodes error -body {
apply {{} {uplevel #-0xffffffff {}}}
-} {}
-test uplevel-4.19 {level parsing} {
+} -result {bad level "#-0xffffffff"}
+test uplevel-4.19 {level parsing} -returnCodes error -body {
apply {{} {uplevel [expr -0xffffffff] {}}}
-} {}
-test uplevel-4.20 {level parsing} {
+} -result {invalid command name "-4294967295"}
+test uplevel-4.20 {level parsing} -returnCodes error -body {
apply {{} {uplevel #[expr -0xffffffff] {}}}
-} {}
+} -result {bad level "#-4294967295"}
test uplevel-4.21 {level parsing} -body {
apply {{} {uplevel -1 {}}}
} -returnCodes error -result {invalid command name "-1"}