summaryrefslogtreecommitdiffstats
path: root/generic/tclStringObj.c
diff options
context:
space:
mode:
Diffstat (limited to 'generic/tclStringObj.c')
-rw-r--r--generic/tclStringObj.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/generic/tclStringObj.c b/generic/tclStringObj.c
index 043497b..1761296 100644
--- a/generic/tclStringObj.c
+++ b/generic/tclStringObj.c
@@ -1323,7 +1323,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 =
TclGetUnicodeFromObj(appendObjPtr, &numChars);
@@ -1344,7 +1344,7 @@ Tcl_AppendObjToObj(
bytes = TclGetStringFromObj(appendObjPtr, &length);
numChars = stringPtr->numChars;
- if ((numChars != TCL_AUTO_LENGTH) && (appendObjPtr->typePtr == &tclStringType)) {
+ if ((numChars != TCL_AUTO_LENGTH) && TclHasIntRep(appendObjPtr, &tclStringType)) {
String *appendStringPtr = GET_STRING(appendObjPtr);
appendNumChars = appendStringPtr->numChars;
@@ -2708,7 +2708,7 @@ TclGetStringStorage(
{
String *stringPtr;
- if (objPtr->typePtr != &tclStringType || objPtr->bytes == NULL) {
+ if (!TclHasIntRep(objPtr, &tclStringType) || objPtr->bytes == NULL) {
return TclGetStringFromObj(objPtr, sizePtr);
}
@@ -2756,7 +2756,7 @@ TclStringRepeat(
*/
if (!binary) {
- if (objPtr->typePtr == &tclStringType) {
+ if (TclHasIntRep(objPtr, &tclStringType)) {
String *stringPtr = GET_STRING(objPtr);
if (stringPtr->hasUnicode) {
unichar = 1;
@@ -2934,7 +2934,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 {
@@ -3285,8 +3285,8 @@ TclStringCmp(
s1 = (char *) TclGetByteArrayFromObj(value1Ptr, &s1len);
s2 = (char *) TclGetByteArrayFromObj(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
@@ -4056,7 +4056,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);
/*