diff options
| author | dgp <dgp@users.sourceforge.net> | 2016-10-07 21:06:04 (GMT) |
|---|---|---|
| committer | dgp <dgp@users.sourceforge.net> | 2016-10-07 21:06:04 (GMT) |
| commit | ec7df3f449d90d7fd7a81b27d7b6264f13596629 (patch) | |
| tree | 0c322ae84764e4ed054d8c27cdf240eadca9a5df | |
| parent | 7b2a90493f10dc61b00ab07a3057b23b4b2dc7d2 (diff) | |
| download | tcl-ec7df3f449d90d7fd7a81b27d7b6264f13596629.zip tcl-ec7df3f449d90d7fd7a81b27d7b6264f13596629.tar.gz tcl-ec7df3f449d90d7fd7a81b27d7b6264f13596629.tar.bz2 | |
Purge more direct accesses to bytes field.
| -rw-r--r-- | generic/tclCompExpr.c | 8 | ||||
| -rw-r--r-- | generic/tclDisassemble.c | 4 | ||||
| -rw-r--r-- | generic/tclEncoding.c | 2 | ||||
| -rw-r--r-- | generic/tclListObj.c | 2 |
4 files changed, 8 insertions, 8 deletions
diff --git a/generic/tclCompExpr.c b/generic/tclCompExpr.c index 83bb883..7ad39f9 100644 --- a/generic/tclCompExpr.c +++ b/generic/tclCompExpr.c @@ -2476,11 +2476,13 @@ CompileExprTree( * already, then use it to share via the literal table. */ - if (objPtr->bytes) { + if (TclHasStringRep(objPtr)) { Tcl_Obj *tableValue; + int numBytes; + const char *bytes + = Tcl_GetStringFromObj(objPtr, &numBytes); - index = TclRegisterLiteral(envPtr, objPtr->bytes, - objPtr->length, 0); + index = TclRegisterLiteral(envPtr, bytes, numBytes, 0); tableValue = TclFetchLiteral(envPtr, index); if ((tableValue->typePtr == NULL) && (objPtr->typePtr != NULL)) { diff --git a/generic/tclDisassemble.c b/generic/tclDisassemble.c index 92e5c2e..a727413 100644 --- a/generic/tclDisassemble.c +++ b/generic/tclDisassemble.c @@ -815,9 +815,7 @@ TclNewInstNameObj( { Tcl_Obj *objPtr = Tcl_NewObj(); - /* Optimized Tcl_InvalidateStringRep */ - objPtr->bytes = NULL; - + TclInvalidateStringRep(objPtr); InstNameSetIntRep(objPtr, (long) inst); return objPtr; diff --git a/generic/tclEncoding.c b/generic/tclEncoding.c index 5db6859..6beb10c 100644 --- a/generic/tclEncoding.c +++ b/generic/tclEncoding.c @@ -370,7 +370,7 @@ DupEncodingIntRep( Tcl_Obj *srcPtr, Tcl_Obj *dupPtr) { - Tcl_Encoding encoding = Tcl_GetEncoding(NULL, srcPtr->bytes); + Tcl_Encoding encoding = Tcl_GetEncoding(NULL, TclGetString(srcPtr)); EncodingSetIntRep(dupPtr, encoding); } diff --git a/generic/tclListObj.c b/generic/tclListObj.c index 0b6473b..e2e0f63 100644 --- a/generic/tclListObj.c +++ b/generic/tclListObj.c @@ -1877,7 +1877,7 @@ SetListFromAny( * describe duplicate keys). */ - if (Tcl_FetchIntRep(objPtr, &tclDictType) && !objPtr->bytes) { + if (!TclHasStringRep(objPtr) && Tcl_FetchIntRep(objPtr, &tclDictType)) { Tcl_Obj *keyPtr, *valuePtr; Tcl_DictSearch search; int done, size; |
