diff options
author | dgp <dgp@users.sourceforge.net> | 2015-07-02 12:54:57 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2015-07-02 12:54:57 (GMT) |
commit | 20dafdc09ed912fb421b7968b910dd44fab379d1 (patch) | |
tree | 368c39db89288c324d774cfdfe3c9494dba33bbd /generic | |
parent | 9aa3e851043909a88856222ed97da6ed018a9bbe (diff) | |
download | tcl-20dafdc09ed912fb421b7968b910dd44fab379d1.zip tcl-20dafdc09ed912fb421b7968b910dd44fab379d1.tar.gz tcl-20dafdc09ed912fb421b7968b910dd44fab379d1.tar.bz2 |
Revert refcount changes that were not cosmetic.
Changing equality testing to inequality testing does more than make code
prettier or clearer. It makes it less strict, and thus more tolerant of
other bugs elsewhere. Such changes deserve separate consideration at least,
not breezy entry in an otherwise "code cleanup" commit.
Diffstat (limited to 'generic')
-rw-r--r-- | generic/tclCompile.c | 2 | ||||
-rw-r--r-- | generic/tclNamesp.c | 2 | ||||
-rw-r--r-- | generic/tclObj.c | 4 | ||||
-rw-r--r-- | generic/tclPreserve.c | 4 | ||||
-rw-r--r-- | generic/tclProc.c | 2 |
5 files changed, 7 insertions, 7 deletions
diff --git a/generic/tclCompile.c b/generic/tclCompile.c index b9aee64..361c26f 100644 --- a/generic/tclCompile.c +++ b/generic/tclCompile.c @@ -1117,7 +1117,7 @@ TclCleanupByteCode( } } - if (codePtr->localCachePtr && (codePtr->localCachePtr->refCount-- <= 1)) { + if (codePtr->localCachePtr && (--codePtr->localCachePtr->refCount == 0)) { TclFreeLocalCache(interp, codePtr->localCachePtr); } diff --git a/generic/tclNamesp.c b/generic/tclNamesp.c index 3231ce6..91239f0 100644 --- a/generic/tclNamesp.c +++ b/generic/tclNamesp.c @@ -402,7 +402,7 @@ Tcl_PopCallFrame( } if (framePtr->numCompiledLocals > 0) { TclDeleteCompiledLocalVars(iPtr, framePtr); - if (framePtr->localCachePtr->refCount-- <= 1) { + if (--framePtr->localCachePtr->refCount == 0) { TclFreeLocalCache(interp, framePtr->localCachePtr); } framePtr->localCachePtr = NULL; diff --git a/generic/tclObj.c b/generic/tclObj.c index 15d874f..f9216b3 100644 --- a/generic/tclObj.c +++ b/generic/tclObj.c @@ -4288,7 +4288,7 @@ FreeCmdNameInternalRep( * there are no more uses, free the ResolvedCmdName structure. */ - if (resPtr->refCount-- <= 1) { + if (resPtr->refCount-- == 1) { /* * Now free the cached command, unless it is still in its hash * table or if there are other references to it from other cmdName @@ -4404,7 +4404,7 @@ SetCmdNameFromAny( Command *oldCmdPtr = resPtr->cmdPtr; - if (oldCmdPtr->refCount-- <= 1) { + if (--oldCmdPtr->refCount == 0) { TclCleanupCommandMacro(oldCmdPtr); } } else { diff --git a/generic/tclPreserve.c b/generic/tclPreserve.c index 0b33d22..cca13e8 100644 --- a/generic/tclPreserve.c +++ b/generic/tclPreserve.c @@ -195,7 +195,7 @@ Tcl_Release( continue; } - if (refPtr->refCount-- > 1) { + if (--refPtr->refCount != 0) { Tcl_MutexUnlock(&preserveMutex); return; } @@ -459,7 +459,7 @@ TclHandleRelease( handlePtr, handlePtr->ptr2, handlePtr->ptr); } #endif - if ((handlePtr->refCount-- <= 1) && (handlePtr->ptr == NULL)) { + if ((--handlePtr->refCount == 0) && (handlePtr->ptr == NULL)) { ckfree(handlePtr); } } diff --git a/generic/tclProc.c b/generic/tclProc.c index a9705eb..7bf63c2 100644 --- a/generic/tclProc.c +++ b/generic/tclProc.c @@ -2445,7 +2445,7 @@ FreeLambdaInternalRep( Proc *procPtr = objPtr->internalRep.twoPtrValue.ptr1; Tcl_Obj *nsObjPtr = objPtr->internalRep.twoPtrValue.ptr2; - if (procPtr->refCount-- <= 1) { + if (procPtr->refCount-- == 1) { TclProcCleanupProc(procPtr); } TclDecrRefCount(nsObjPtr); |