summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2019-02-25 21:15:40 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2019-02-25 21:15:40 (GMT)
commit50e25405198e4d87a648289376b90e2e40dd2972 (patch)
tree9df20f81d3386f9903f6513365fe7940e57ce6da /generic
parent4d61bea373ceb34971f2b91b2e8543c8a40eb243 (diff)
parent4fdbe79875a43efd9f42e75ccf256884f657dac3 (diff)
downloadtcl-50e25405198e4d87a648289376b90e2e40dd2972.zip
tcl-50e25405198e4d87a648289376b90e2e40dd2972.tar.gz
tcl-50e25405198e4d87a648289376b90e2e40dd2972.tar.bz2
Merge 8.7
Diffstat (limited to 'generic')
-rw-r--r--generic/tclBasic.c2
-rw-r--r--generic/tclBinary.c6
-rw-r--r--generic/tclClock.c2
-rw-r--r--generic/tclCmdMZ.c12
-rw-r--r--generic/tclDictObj.c2
-rw-r--r--generic/tclDisassemble.c8
-rw-r--r--generic/tclExecute.c6
-rw-r--r--generic/tclInt.h4
-rw-r--r--generic/tclListObj.c2
9 files changed, 23 insertions, 21 deletions
diff --git a/generic/tclBasic.c b/generic/tclBasic.c
index 8196ef4..2a23ed0 100644
--- a/generic/tclBasic.c
+++ b/generic/tclBasic.c
@@ -7158,7 +7158,7 @@ ExprDoubleFunc(
}
if (Tcl_GetDoubleFromObj(interp, objv[1], &dResult) != TCL_OK) {
#ifdef ACCEPT_NAN
- if (objv[1]->typePtr == &tclDoubleType) {
+ if (TclHasIntRep(objv[1], &tclDoubleType)) {
Tcl_SetObjResult(interp, objv[1]);
return TCL_OK;
}
diff --git a/generic/tclBinary.c b/generic/tclBinary.c
index 4b5623d..d1b076f 100644
--- a/generic/tclBinary.c
+++ b/generic/tclBinary.c
@@ -291,7 +291,7 @@ int
TclIsPureByteArray(
Tcl_Obj * objPtr)
{
- return objPtr->typePtr == &properByteArrayType;
+ return TclHasIntRep(objPtr, &properByteArrayType);
}
/*
@@ -554,10 +554,10 @@ SetByteArrayFromAny(
ByteArray *byteArrayPtr;
Tcl_ObjIntRep ir;
- if (objPtr->typePtr == &properByteArrayType) {
+ if (TclHasIntRep(objPtr, &properByteArrayType)) {
return TCL_OK;
}
- if (objPtr->typePtr == &tclByteArrayType) {
+ if (TclHasIntRep(objPtr, &tclByteArrayType)) {
return TCL_OK;
}
diff --git a/generic/tclClock.c b/generic/tclClock.c
index ba12b66..634ab1b 100644
--- a/generic/tclClock.c
+++ b/generic/tclClock.c
@@ -452,7 +452,7 @@ ClockGetdatefieldsObjCmd(
* that it isn't.
*/
- if (objv[1]->typePtr == &tclBignumType) {
+ if (TclHasIntRep(objv[1], &tclBignumType)) {
Tcl_SetObjResult(interp, literals[LIT_INTEGER_VALUE_TOO_LARGE]);
return TCL_ERROR;
}
diff --git a/generic/tclCmdMZ.c b/generic/tclCmdMZ.c
index f140f3c..c0df3e0 100644
--- a/generic/tclCmdMZ.c
+++ b/generic/tclCmdMZ.c
@@ -1644,9 +1644,9 @@ StringIsCmd(
chcomp = Tcl_UniCharIsDigit;
break;
case STR_IS_DOUBLE: {
- if ((objPtr->typePtr == &tclDoubleType) ||
- (objPtr->typePtr == &tclIntType) ||
- (objPtr->typePtr == &tclBignumType)) {
+ if (TclHasIntRep(objPtr, &tclDoubleType) ||
+ TclHasIntRep(objPtr, &tclIntType) ||
+ TclHasIntRep(objPtr, &tclBignumType)) {
break;
}
string1 = TclGetStringFromObj(objPtr, &length1);
@@ -1675,8 +1675,8 @@ StringIsCmd(
break;
case STR_IS_INT:
case STR_IS_ENTIER:
- if ((objPtr->typePtr == &tclIntType) ||
- (objPtr->typePtr == &tclBignumType)) {
+ if (TclHasIntRep(objPtr, &tclIntType) ||
+ TclHasIntRep(objPtr, &tclBignumType)) {
break;
}
string1 = TclGetStringFromObj(objPtr, &length1);
@@ -1957,7 +1957,7 @@ StringMapCmd(
*/
if (!TclHasStringRep(objv[objc-2])
- && (objv[objc-2]->typePtr == &tclDictType)){
+ && TclHasIntRep(objv[objc-2], &tclDictType)){
int i, done;
Tcl_DictSearch search;
diff --git a/generic/tclDictObj.c b/generic/tclDictObj.c
index f9515ae..6bdbfa6 100644
--- a/generic/tclDictObj.c
+++ b/generic/tclDictObj.c
@@ -613,7 +613,7 @@ SetDictFromAny(
* the conversion from lists to dictionaries.
*/
- if (objPtr->typePtr == &tclListType) {
+ if (TclHasIntRep(objPtr, &tclListType)) {
int objc, i;
Tcl_Obj **objv;
diff --git a/generic/tclDisassemble.c b/generic/tclDisassemble.c
index 6e4d541..210b35c 100644
--- a/generic/tclDisassemble.c
+++ b/generic/tclDisassemble.c
@@ -1383,7 +1383,7 @@ Tcl_DisassembleObjCmd(
return TCL_ERROR;
}
- if ((objv[2]->typePtr != &tclByteCodeType) && (TCL_OK
+ if (!TclHasIntRep(objv[2], &tclByteCodeType) && (TCL_OK
!= TclSetByteCodeFromAny(interp, objv[2], NULL, NULL))) {
return TCL_ERROR;
}
@@ -1434,7 +1434,7 @@ Tcl_DisassembleObjCmd(
* Compile if necessary.
*/
- if (procPtr->bodyPtr->typePtr != &tclByteCodeType) {
+ if (!TclHasIntRep(procPtr->bodyPtr, &tclByteCodeType)) {
Command cmd;
/*
@@ -1499,7 +1499,7 @@ Tcl_DisassembleObjCmd(
* Compile if necessary.
*/
- if (procPtr->bodyPtr->typePtr != &tclByteCodeType) {
+ if (!TclHasIntRep(procPtr->bodyPtr, &tclByteCodeType)) {
Command cmd;
/*
@@ -1584,7 +1584,7 @@ Tcl_DisassembleObjCmd(
"METHODTYPE", NULL);
return TCL_ERROR;
}
- if (procPtr->bodyPtr->typePtr != &tclByteCodeType) {
+ if (!TclHasIntRep(procPtr->bodyPtr, &tclByteCodeType)) {
Command cmd;
/*
diff --git a/generic/tclExecute.c b/generic/tclExecute.c
index 2379115..4285ed0 100644
--- a/generic/tclExecute.c
+++ b/generic/tclExecute.c
@@ -4559,7 +4559,7 @@ TEBCresume(
*/
if ((TclListObjGetElements(interp, valuePtr, &objc, &objv) == TCL_OK)
- && (value2Ptr->typePtr != &tclListType)
+ && !TclHasIntRep(value2Ptr, &tclListType)
&& (TclGetIntForIndexM(NULL, value2Ptr, objc-1,
&index) == TCL_OK)) {
TclDecrRefCount(value2Ptr);
@@ -6736,7 +6736,7 @@ TEBCresume(
}
varPtr = LOCAL(opnd);
if (varPtr->value.objPtr) {
- if (varPtr->value.objPtr->typePtr == &dictIteratorType) {
+ if (TclHasIntRep(varPtr->value.objPtr, &dictIteratorType)) {
Tcl_Panic("mis-issued dictFirst!");
}
TclDecrRefCount(varPtr->value.objPtr);
@@ -9244,7 +9244,7 @@ EvalStatsCmd(
for (i = 0; i < globalTablePtr->numBuckets; i++) {
for (entryPtr = globalTablePtr->buckets[i]; entryPtr != NULL;
entryPtr = entryPtr->nextPtr) {
- if (entryPtr->objPtr->typePtr == &tclByteCodeType) {
+ if (TclHasIntRep(entryPtr->objPtr, &tclByteCodeType)) {
numByteCodeLits++;
}
(void) TclGetStringFromObj(entryPtr->objPtr, &length);
diff --git a/generic/tclInt.h b/generic/tclInt.h
index 4b7166a..a69c9bb 100644
--- a/generic/tclInt.h
+++ b/generic/tclInt.h
@@ -4575,8 +4575,10 @@ MODULE_SCOPE void TclDbInitNewObj(Tcl_Obj *objPtr, const char *file,
MODULE_SCOPE int TclIsPureByteArray(Tcl_Obj *objPtr);
#define TclIsPureDict(objPtr) \
(((objPtr)->bytes==NULL) && ((objPtr)->typePtr==&tclDictType))
+#define TclHasIntRep(objPtr, type) \
+ ((objPtr)->typePtr == (type))
#define TclFetchIntRep(objPtr, type) \
- (((objPtr)->typePtr == type) ? &((objPtr)->internalRep) : NULL)
+ (TclHasIntRep((objPtr), (type)) ? &((objPtr)->internalRep) : NULL)
/*
diff --git a/generic/tclListObj.c b/generic/tclListObj.c
index 2ce980a..df0b21e 100644
--- a/generic/tclListObj.c
+++ b/generic/tclListObj.c
@@ -1983,7 +1983,7 @@ SetListFromAny(
* describe duplicate keys).
*/
- if (!TclHasStringRep(objPtr) && (objPtr->typePtr == &tclDictType)) {
+ if (!TclHasStringRep(objPtr) && TclHasIntRep(objPtr, &tclDictType)) {
Tcl_Obj *keyPtr, *valuePtr;
Tcl_DictSearch search;
int done, size;