diff options
author | dgp <dgp@users.sourceforge.net> | 2011-04-21 18:44:38 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2011-04-21 18:44:38 (GMT) |
commit | 887609eca770b32ce181ecb0d29041bb0cadb732 (patch) | |
tree | 915af8c1d0d451362dfe388a73ff338cbeccc4f0 /generic/tclListObj.c | |
parent | 8850f2128d8e89bd89e49b15414166f25de25c0b (diff) | |
download | tcl-887609eca770b32ce181ecb0d29041bb0cadb732.zip tcl-887609eca770b32ce181ecb0d29041bb0cadb732.tar.gz tcl-887609eca770b32ce181ecb0d29041bb0cadb732.tar.bz2 |
Use macro to set List intreps
Diffstat (limited to 'generic/tclListObj.c')
-rw-r--r-- | generic/tclListObj.c | 26 |
1 files changed, 5 insertions, 21 deletions
diff --git a/generic/tclListObj.c b/generic/tclListObj.c index 730b94d..b269607 100644 --- a/generic/tclListObj.c +++ b/generic/tclListObj.c @@ -234,11 +234,7 @@ Tcl_NewListObj( */ Tcl_InvalidateStringRep(listPtr); - listPtr->internalRep.twoPtrValue.ptr1 = (void *) 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 = (void *) 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 = (void *) listRepPtr; - objPtr->internalRep.twoPtrValue.ptr2 = NULL; - objPtr->typePtr = &tclListType; - listRepPtr->refCount++; + ListSetIntRep(objPtr, listRepPtr); } else { objPtr->bytes = tclEmptyStringRep; objPtr->length = 0; @@ -1675,10 +1665,7 @@ DupListInternalRep( { List *listRepPtr = ListRepPtr(srcPtr); - listRepPtr->refCount++; - copyPtr->internalRep.twoPtrValue.ptr1 = (void *) listRepPtr; - copyPtr->internalRep.twoPtrValue.ptr2 = NULL; - copyPtr->typePtr = &tclListType; + ListSetIntRep(copyPtr, listRepPtr); } /* @@ -1849,11 +1836,8 @@ SetListFromAny( */ commitRepresentation: - listRepPtr->refCount++; TclFreeIntRep(objPtr); - objPtr->internalRep.twoPtrValue.ptr1 = (void *) listRepPtr; - objPtr->internalRep.twoPtrValue.ptr2 = NULL; - objPtr->typePtr = &tclListType; + ListSetIntRep(objPtr, listRepPtr); return TCL_OK; } |