summaryrefslogtreecommitdiffstats
path: root/generic/tclRegexp.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2013-01-29 10:46:44 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2013-01-29 10:46:44 (GMT)
commitf9c71d451ebcc045cddff69484eb2bbe3c4eb312 (patch)
treece2ac1730893423bb06e66cdeb9ba071c37ace52 /generic/tclRegexp.c
parent38de96ca81b0ff5e34b5d653195a2412a66410dc (diff)
downloadtcl-f9c71d451ebcc045cddff69484eb2bbe3c4eb312.zip
tcl-f9c71d451ebcc045cddff69484eb2bbe3c4eb312.tar.gz
tcl-f9c71d451ebcc045cddff69484eb2bbe3c4eb312.tar.bz2
Change core to use repr->twoPtrValue.ptr1 in stead of repr->otherValuePtr (which is exactly the same), but also set repr->twoPtrValue.ptr2 to NULL explicitly.
This allows repr->twoPtrValue.ptr2 to be used for another purpose (experimental): Store the StringObj internal representation there when available.
Diffstat (limited to 'generic/tclRegexp.c')
-rw-r--r--generic/tclRegexp.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/generic/tclRegexp.c b/generic/tclRegexp.c
index d340f4c..bcf9562 100644
--- a/generic/tclRegexp.c
+++ b/generic/tclRegexp.c
@@ -578,7 +578,7 @@ Tcl_GetRegExpFromObj(
* TclRegexp* when the type is tclRegexpType.
*/
- regexpPtr = (TclRegexp *) objPtr->internalRep.otherValuePtr;
+ regexpPtr = (TclRegexp *) objPtr->internalRep.twoPtrValue.ptr1;
if ((objPtr->typePtr != &tclRegexpType) || (regexpPtr->flags != flags)) {
pattern = TclGetStringFromObj(objPtr, &length);
@@ -601,7 +601,8 @@ Tcl_GetRegExpFromObj(
*/
TclFreeIntRep(objPtr);
- objPtr->internalRep.otherValuePtr = (void *) regexpPtr;
+ objPtr->internalRep.twoPtrValue.ptr1 = (void *) regexpPtr;
+ objPtr->internalRep.twoPtrValue.ptr2 = NULL;
objPtr->typePtr = &tclRegexpType;
}
return (Tcl_RegExp) regexpPtr;
@@ -747,7 +748,7 @@ static void
FreeRegexpInternalRep(
Tcl_Obj *objPtr) /* Regexp object with internal rep to free. */
{
- TclRegexp *regexpRepPtr = (TclRegexp *) objPtr->internalRep.otherValuePtr;
+ TclRegexp *regexpRepPtr = (TclRegexp *) objPtr->internalRep.twoPtrValue.ptr1;
/*
* If this is the last reference to the regexp, free it.
@@ -781,10 +782,11 @@ DupRegexpInternalRep(
Tcl_Obj *srcPtr, /* Object with internal rep to copy. */
Tcl_Obj *copyPtr) /* Object with internal rep to set. */
{
- TclRegexp *regexpPtr = (TclRegexp *) srcPtr->internalRep.otherValuePtr;
+ TclRegexp *regexpPtr = (TclRegexp *) srcPtr->internalRep.twoPtrValue.ptr1;
regexpPtr->refCount++;
- copyPtr->internalRep.otherValuePtr = srcPtr->internalRep.otherValuePtr;
+ copyPtr->internalRep.twoPtrValue.ptr1 = srcPtr->internalRep.twoPtrValue.ptr1;
+ copyPtr->internalRep.twoPtrValue.ptr2 = NULL;
copyPtr->typePtr = &tclRegexpType;
}