summaryrefslogtreecommitdiffstats
path: root/generic/tclListObj.c
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2011-04-21 18:50:37 (GMT)
committerdgp <dgp@users.sourceforge.net>2011-04-21 18:50:37 (GMT)
commit97ca190e3033a85ba2f074151fbedb986b531def (patch)
tree76ea67633309e97f1f17146de543d16fafea0869 /generic/tclListObj.c
parentd3a0ad0b83779f8b3ad8b665c8a64461dfc56b33 (diff)
parent8bcda731ae34f234a8894fe1f2de0d06ce951b72 (diff)
downloadtcl-97ca190e3033a85ba2f074151fbedb986b531def.zip
tcl-97ca190e3033a85ba2f074151fbedb986b531def.tar.gz
tcl-97ca190e3033a85ba2f074151fbedb986b531def.tar.bz2
Use macro to set List intreps
Diffstat (limited to 'generic/tclListObj.c')
-rw-r--r--generic/tclListObj.c26
1 files changed, 5 insertions, 21 deletions
diff --git a/generic/tclListObj.c b/generic/tclListObj.c
index 4c40a8b..be3e212 100644
--- a/generic/tclListObj.c
+++ b/generic/tclListObj.c
@@ -234,11 +234,7 @@ Tcl_NewListObj(
*/
Tcl_InvalidateStringRep(listPtr);
- listPtr->internalRep.twoPtrValue.ptr1 = listRepPtr;
- listPtr->internalRep.twoPtrValue.ptr2 = NULL;
- listPtr->typePtr = &tclListType;
- listRepPtr->refCount++;
-
+ ListSetIntRep(listPtr, listRepPtr);
return listPtr;
}
#endif /* if TCL_MEM_DEBUG */
@@ -303,10 +299,7 @@ Tcl_DbNewListObj(
*/
Tcl_InvalidateStringRep(listPtr);
- listPtr->internalRep.twoPtrValue.ptr1 = listRepPtr;
- listPtr->internalRep.twoPtrValue.ptr2 = NULL;
- listPtr->typePtr = &tclListType;
- listRepPtr->refCount++;
+ ListSetIntRep(listPtr, listRepPtr);
return listPtr;
}
@@ -376,10 +369,7 @@ Tcl_SetListObj(
if (objc > 0) {
listRepPtr = NewListIntRep(objc, objv, 1);
- objPtr->internalRep.twoPtrValue.ptr1 = listRepPtr;
- objPtr->internalRep.twoPtrValue.ptr2 = NULL;
- objPtr->typePtr = &tclListType;
- listRepPtr->refCount++;
+ ListSetIntRep(objPtr, listRepPtr);
} else {
objPtr->bytes = tclEmptyStringRep;
objPtr->length = 0;
@@ -1700,10 +1690,7 @@ DupListInternalRep(
{
List *listRepPtr = ListRepPtr(srcPtr);
- listRepPtr->refCount++;
- copyPtr->internalRep.twoPtrValue.ptr1 = listRepPtr;
- copyPtr->internalRep.twoPtrValue.ptr2 = NULL;
- copyPtr->typePtr = &tclListType;
+ ListSetIntRep(copyPtr, listRepPtr);
}
/*
@@ -1878,11 +1865,8 @@ SetListFromAny(
*/
commitRepresentation:
- listRepPtr->refCount++;
TclFreeIntRep(objPtr);
- objPtr->internalRep.twoPtrValue.ptr1 = listRepPtr;
- objPtr->internalRep.twoPtrValue.ptr2 = NULL;
- objPtr->typePtr = &tclListType;
+ ListSetIntRep(objPtr, listRepPtr);
return TCL_OK;
}