summaryrefslogtreecommitdiffstats
path: root/generic/tclListObj.c
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2011-04-18 21:42:51 (GMT)
committerdgp <dgp@users.sourceforge.net>2011-04-18 21:42:51 (GMT)
commitcf9cbf06ede2587aad27b49a23c04c5fd3a46940 (patch)
treee842cb86065dd668b96d29fb3f1378a9e07696f4 /generic/tclListObj.c
parent66a254dddfb0c618ee609c6bfab4a6549e098772 (diff)
parent34bda55e3628476458e63d4495350e14672d01af (diff)
downloadtcl-cf9cbf06ede2587aad27b49a23c04c5fd3a46940.zip
tcl-cf9cbf06ede2587aad27b49a23c04c5fd3a46940.tar.gz
tcl-cf9cbf06ede2587aad27b49a23c04c5fd3a46940.tar.bz2
Use ListRepPtr(.) and other cleanup.
Diffstat (limited to 'generic/tclListObj.c')
-rw-r--r--generic/tclListObj.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/generic/tclListObj.c b/generic/tclListObj.c
index 9128333..8a0f89a 100644
--- a/generic/tclListObj.c
+++ b/generic/tclListObj.c
@@ -446,7 +446,7 @@ Tcl_ListObjGetElements(
return result;
}
}
- listRepPtr = listPtr->internalRep.twoPtrValue.ptr1;
+ listRepPtr = ListRepPtr(listPtr);
*objcPtr = listRepPtr->elemCount;
*objvPtr = &listRepPtr->elements;
return TCL_OK;
@@ -564,7 +564,7 @@ Tcl_ListObjAppendElement(
}
}
- listRepPtr = listPtr->internalRep.twoPtrValue.ptr1;
+ listRepPtr = ListRepPtr(listPtr);
numElems = listRepPtr->elemCount;
numRequired = numElems + 1 ;
@@ -674,7 +674,7 @@ Tcl_ListObjIndex(
}
}
- listRepPtr = listPtr->internalRep.twoPtrValue.ptr1;
+ listRepPtr = ListRepPtr(listPtr);
if ((index < 0) || (index >= listRepPtr->elemCount)) {
*objPtrPtr = NULL;
} else {
@@ -729,7 +729,7 @@ Tcl_ListObjLength(
}
}
- listRepPtr = listPtr->internalRep.twoPtrValue.ptr1;
+ listRepPtr = ListRepPtr(listPtr);
*intPtr = listRepPtr->elemCount;
return TCL_OK;
}
@@ -816,7 +816,7 @@ Tcl_ListObjReplace(
* Resist any temptation to optimize this case.
*/
- listRepPtr = listPtr->internalRep.twoPtrValue.ptr1;
+ listRepPtr = ListRepPtr(listPtr);
elemPtrs = &listRepPtr->elements;
numElems = listRepPtr->elemCount;
@@ -1523,7 +1523,7 @@ TclListObjSetElement(
}
}
- listRepPtr = listPtr->internalRep.twoPtrValue.ptr1;
+ listRepPtr = ListRepPtr(listPtr);
elemCount = listRepPtr->elemCount;
elemPtrs = &listRepPtr->elements;
@@ -1610,7 +1610,7 @@ static void
FreeListInternalRep(
Tcl_Obj *listPtr) /* List object with internal rep to free. */
{
- register List *listRepPtr = listPtr->internalRep.twoPtrValue.ptr1;
+ register List *listRepPtr = ListRepPtr(listPtr);
register Tcl_Obj **elemPtrs = &listRepPtr->elements;
register Tcl_Obj *objPtr;
int numElems = listRepPtr->elemCount;
@@ -1651,7 +1651,7 @@ DupListInternalRep(
Tcl_Obj *srcPtr, /* Object with internal rep to copy. */
Tcl_Obj *copyPtr) /* Object with internal rep to set. */
{
- List *listRepPtr = srcPtr->internalRep.twoPtrValue.ptr1;
+ List *listRepPtr = ListRepPtr(srcPtr);
listRepPtr->refCount++;
copyPtr->internalRep.twoPtrValue.ptr1 = listRepPtr;
@@ -1873,7 +1873,7 @@ UpdateStringOfList(
{
# define LOCAL_SIZE 20
int localFlags[LOCAL_SIZE], *flagPtr;
- List *listRepPtr = listPtr->internalRep.twoPtrValue.ptr1;
+ List *listRepPtr = ListRepPtr(listPtr);
int numElems = listRepPtr->elemCount;
register int i;
const char *elem;