diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2019-03-01 21:05:25 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2019-03-01 21:05:25 (GMT) |
commit | 921a0bbbfb177411e3fe27f4c4654909fd599859 (patch) | |
tree | f10affcc12787513eab5ade51bdaf65c4e4c2f32 | |
parent | 5a0260cbcca3fe75e95b352ccd9df4d82cc6a1ae (diff) | |
download | tcl-921a0bbbfb177411e3fe27f4c4654909fd599859.zip tcl-921a0bbbfb177411e3fe27f4c4654909fd599859.tar.gz tcl-921a0bbbfb177411e3fe27f4c4654909fd599859.tar.bz2 |
More use of TclHasIntRep() macro. Add vfs build director to fossil ignore-glob
-rw-r--r-- | .fossil-settings/ignore-glob | 2 | ||||
-rw-r--r-- | generic/tclCmdMZ.c | 2 | ||||
-rw-r--r-- | generic/tclCompExpr.c | 2 | ||||
-rw-r--r-- | generic/tclExecute.c | 10 | ||||
-rw-r--r-- | generic/tclIndexObj.c | 2 | ||||
-rw-r--r-- | generic/tclInt.h | 2 | ||||
-rw-r--r-- | generic/tclLink.c | 2 | ||||
-rw-r--r-- | generic/tclLiteral.c | 2 | ||||
-rw-r--r-- | generic/tclStrToD.c | 4 | ||||
-rw-r--r-- | generic/tclStringObj.c | 16 | ||||
-rw-r--r-- | generic/tclTest.c | 4 | ||||
-rw-r--r-- | generic/tclUtil.c | 2 | ||||
-rw-r--r-- | generic/tclVar.c | 2 | ||||
-rw-r--r-- | macosx/tclMacOSXFCmd.c | 2 |
14 files changed, 28 insertions, 26 deletions
diff --git a/.fossil-settings/ignore-glob b/.fossil-settings/ignore-glob index 08e405d..9bfacde 100644 --- a/.fossil-settings/ignore-glob +++ b/.fossil-settings/ignore-glob @@ -19,6 +19,8 @@ */tcltest* */versions.vc */version.vc +*/libtcl.vfs +*/libtcl_*.zip html libtommath/bn.ilg libtommath/bn.ind diff --git a/generic/tclCmdMZ.c b/generic/tclCmdMZ.c index db6198e..bd93205 100644 --- a/generic/tclCmdMZ.c +++ b/generic/tclCmdMZ.c @@ -1571,7 +1571,7 @@ StringIsCmd( case STR_IS_BOOL: case STR_IS_TRUE: case STR_IS_FALSE: - if ((objPtr->typePtr != &tclBooleanType) + if (!TclHasIntRep(objPtr, &tclBooleanType) && (TCL_OK != TclSetBooleanFromAny(NULL, objPtr))) { if (strict) { result = 0; diff --git a/generic/tclCompExpr.c b/generic/tclCompExpr.c index 7e340e4..f88b2d6 100644 --- a/generic/tclCompExpr.c +++ b/generic/tclCompExpr.c @@ -2027,7 +2027,7 @@ ParseLexeme( * Example: Inf + luence + () becomes a valid function call. * [Bug 3401704] */ - if (literal->typePtr == &tclDoubleType) { + if (TclHasIntRep(literal, &tclDoubleType)) { const char *p = start; while (p < end) { diff --git a/generic/tclExecute.c b/generic/tclExecute.c index e7c003a..dfb1140 100644 --- a/generic/tclExecute.c +++ b/generic/tclExecute.c @@ -499,11 +499,11 @@ VarHashCreateVar( */ #define GetNumberFromObj(interp, objPtr, ptrPtr, tPtr) \ - (((objPtr)->typePtr == &tclIntType) \ + ((TclHasIntRep((objPtr), &tclIntType)) \ ? (*(tPtr) = TCL_NUMBER_INT, \ *(ptrPtr) = (ClientData) \ (&((objPtr)->internalRep.wideValue)), TCL_OK) : \ - ((objPtr)->typePtr == &tclDoubleType) \ + TclHasIntRep((objPtr), &tclDoubleType) \ ? (((TclIsNaN((objPtr)->internalRep.doubleValue)) \ ? (*(tPtr) = TCL_NUMBER_NAN) \ : (*(tPtr) = TCL_NUMBER_DOUBLE)), \ @@ -5486,8 +5486,8 @@ TEBCresume( * both. */ - if ((valuePtr->typePtr == &tclStringType) - || (value2Ptr->typePtr == &tclStringType)) { + if (TclHasIntRep(valuePtr, &tclStringType) + || TclHasIntRep(value2Ptr, &tclStringType)) { Tcl_UniChar *ustring1, *ustring2; ustring1 = Tcl_GetUnicodeFromObj(valuePtr, &length); @@ -6293,7 +6293,7 @@ TEBCresume( case INST_TRY_CVT_TO_BOOLEAN: valuePtr = OBJ_AT_TOS; - if (valuePtr->typePtr == &tclBooleanType) { + if (TclHasIntRep(valuePtr, &tclBooleanType)) { objResultPtr = TCONST(1); } else { int result = (TclSetBooleanFromAny(NULL, valuePtr) == TCL_OK); diff --git a/generic/tclIndexObj.c b/generic/tclIndexObj.c index e2be3aa..919db92 100644 --- a/generic/tclIndexObj.c +++ b/generic/tclIndexObj.c @@ -1462,7 +1462,7 @@ TclGetCompletionCodeFromObj( "ok", "error", "return", "break", "continue", NULL }; - if ((value->typePtr != &indexType) + if (!TclHasIntRep(value, &indexType) && TclGetIntFromObj(NULL, value, codePtr) == TCL_OK) { return TCL_OK; } diff --git a/generic/tclInt.h b/generic/tclInt.h index 9861208..8da6426 100644 --- a/generic/tclInt.h +++ b/generic/tclInt.h @@ -4624,7 +4624,7 @@ MODULE_SCOPE int TclIsPureByteArray(Tcl_Obj *objPtr); #define TclIsPureDict(objPtr) \ (((objPtr)->bytes==NULL) && ((objPtr)->typePtr==&tclDictType)) #define TclHasIntRep(objPtr, type) \ - ((objPtr)->typePtr == (type)) + ((objPtr)->typePtr == (type)) #define TclFetchIntRep(objPtr, type) \ (TclHasIntRep((objPtr), (type)) ? &((objPtr)->internalRep) : NULL) diff --git a/generic/tclLink.c b/generic/tclLink.c index eb4155a..e7dcb8c 100644 --- a/generic/tclLink.c +++ b/generic/tclLink.c @@ -735,7 +735,7 @@ GetInvalidDoubleFromObj(Tcl_Obj *objPtr, double *doublePtr) { int intValue; - if (objPtr->typePtr == &invalidRealType) { + if (TclHasIntRep(objPtr, &invalidRealType)) { goto gotdouble; } if (GetInvalidIntFromObj(objPtr, &intValue) == TCL_OK) { diff --git a/generic/tclLiteral.c b/generic/tclLiteral.c index 6df26bd..464f565 100644 --- a/generic/tclLiteral.c +++ b/generic/tclLiteral.c @@ -1057,7 +1057,7 @@ TclInvalidateCmdLiteral( strlen(name), -1, NULL, nsPtr, 0, NULL); if (literalObjPtr != NULL) { - if (literalObjPtr->typePtr == &tclCmdNameType) { + if (TclHasIntRep(literalObjPtr, &tclCmdNameType)) { TclFreeIntRep(literalObjPtr); } /* Balance the refcount effects of TclCreateLiteral() above */ diff --git a/generic/tclStrToD.c b/generic/tclStrToD.c index a46b29a..0770b88 100644 --- a/generic/tclStrToD.c +++ b/generic/tclStrToD.c @@ -540,11 +540,11 @@ TclParseNumber( if (bytes == NULL) { if (interp == NULL && endPtrPtr == NULL) { - if (objPtr->typePtr == &tclDictType) { + if (TclHasIntRep(objPtr, &tclDictType)) { /* A dict can never be a (single) number */ return TCL_ERROR; } - if (objPtr->typePtr == &tclListType) { + if (TclHasIntRep(objPtr, &tclListType)) { int length; /* A list can only be a (single) number if its length == 1 */ TclListObjLength(NULL, objPtr, &length); diff --git a/generic/tclStringObj.c b/generic/tclStringObj.c index b4d37ee..7db9dd4 100644 --- a/generic/tclStringObj.c +++ b/generic/tclStringObj.c @@ -1391,7 +1391,7 @@ Tcl_AppendObjToObj( * If appendObjPtr is not of the "String" type, don't convert it. */ - if (appendObjPtr->typePtr == &tclStringType) { + if (TclHasIntRep(appendObjPtr, &tclStringType)) { Tcl_UniChar *unicode = Tcl_GetUnicodeFromObj(appendObjPtr, &numChars); @@ -1412,7 +1412,7 @@ Tcl_AppendObjToObj( bytes = TclGetStringFromObj(appendObjPtr, &length); numChars = stringPtr->numChars; - if ((numChars >= 0) && (appendObjPtr->typePtr == &tclStringType)) { + if ((numChars >= 0) && TclHasIntRep(appendObjPtr, &tclStringType)) { String *appendStringPtr = GET_STRING(appendObjPtr); appendNumChars = appendStringPtr->numChars; @@ -2812,7 +2812,7 @@ TclGetStringStorage( { String *stringPtr; - if (objPtr->typePtr != &tclStringType || objPtr->bytes == NULL) { + if (!TclHasIntRep(objPtr, &tclStringType) || objPtr->bytes == NULL) { return TclGetStringFromObj(objPtr, (int *)sizePtr); } @@ -2860,7 +2860,7 @@ TclStringRepeat( */ if (!binary) { - if (objPtr->typePtr == &tclStringType) { + if (TclHasIntRep(objPtr, &tclStringType)) { String *stringPtr = GET_STRING(objPtr); if (stringPtr->hasUnicode) { unichar = 1; @@ -3037,7 +3037,7 @@ TclStringCat( } else { /* assert (objPtr->typePtr != NULL) -- stork! */ binary = 0; - if (objPtr->typePtr == &tclStringType) { + if (TclHasIntRep(objPtr, &tclStringType)) { /* Have a pure Unicode value; ask to preserve it */ requestUniChar = 1; } else { @@ -3390,8 +3390,8 @@ TclStringCmp( s1 = (char *) Tcl_GetByteArrayFromObj(value1Ptr, &s1len); s2 = (char *) Tcl_GetByteArrayFromObj(value2Ptr, &s2len); memCmpFn = memcmp; - } else if ((value1Ptr->typePtr == &tclStringType) - && (value2Ptr->typePtr == &tclStringType)) { + } else if (TclHasIntRep(value1Ptr, &tclStringType) + && TclHasIntRep(value2Ptr, &tclStringType)) { /* * Do a unicode-specific comparison if both of the args are of * String type. If the char length == byte length, we can do a @@ -4166,7 +4166,7 @@ SetStringFromAny( Tcl_Interp *interp, /* Used for error reporting if not NULL. */ Tcl_Obj *objPtr) /* The object to convert. */ { - if (objPtr->typePtr != &tclStringType) { + if (!TclHasIntRep(objPtr, &tclStringType)) { String *stringPtr = stringAlloc(0); /* diff --git a/generic/tclTest.c b/generic/tclTest.c index c87bb54..665135f 100644 --- a/generic/tclTest.c +++ b/generic/tclTest.c @@ -1750,8 +1750,8 @@ TestdoubledigitsObjCmd(void *unused, status = Tcl_GetDoubleFromObj(interp, objv[1], &d); if (status != TCL_OK) { doubleType = Tcl_GetObjType("double"); - if (objv[1]->typePtr == doubleType - || TclIsNaN(objv[1]->internalRep.doubleValue)) { + if (Tcl_FetchIntRep(objv[1], doubleType) + && TclIsNaN(objv[1]->internalRep.doubleValue)) { status = TCL_OK; memcpy(&d, &(objv[1]->internalRep.doubleValue), sizeof(double)); } diff --git a/generic/tclUtil.c b/generic/tclUtil.c index 1e7c9a9..789565b 100644 --- a/generic/tclUtil.c +++ b/generic/tclUtil.c @@ -2658,7 +2658,7 @@ TclStringMatchObj( trivial = nocase ? 0 : TclMatchIsTrivial(TclGetString(ptnObj)); */ - if ((strObj->typePtr == &tclStringType) || (strObj->typePtr == NULL)) { + if (TclHasIntRep(strObj, &tclStringType) || (strObj->typePtr == NULL)) { Tcl_UniChar *udata, *uptn; udata = Tcl_GetUnicodeFromObj(strObj, &length); diff --git a/generic/tclVar.c b/generic/tclVar.c index 6b88344..3271935 100644 --- a/generic/tclVar.c +++ b/generic/tclVar.c @@ -4122,7 +4122,7 @@ ArraySetCmd( */ arrayElemObj = objv[2]; - if (arrayElemObj->typePtr == &tclDictType && arrayElemObj->bytes == NULL) { + if (TclHasIntRep(arrayElemObj, &tclDictType) && arrayElemObj->bytes == NULL) { Tcl_Obj *keyPtr, *valuePtr; Tcl_DictSearch search; int done; diff --git a/macosx/tclMacOSXFCmd.c b/macosx/tclMacOSXFCmd.c index ab9b74f..1f7dcd8 100644 --- a/macosx/tclMacOSXFCmd.c +++ b/macosx/tclMacOSXFCmd.c @@ -577,7 +577,7 @@ GetOSTypeFromObj( { int result = TCL_OK; - if (objPtr->typePtr != &tclOSTypeType) { + if (!TclHasIntRep(objPtr, &tclOSTypeType)) { result = SetOSTypeFromAny(interp, objPtr); } *osTypePtr = (OSType) objPtr->internalRep.longValue; |