summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2015-07-02 12:54:57 (GMT)
committerdgp <dgp@users.sourceforge.net>2015-07-02 12:54:57 (GMT)
commitd4d66c05ba64ebd9ae204c048eebebfd76a095c2 (patch)
tree368c39db89288c324d774cfdfe3c9494dba33bbd
parent2ee65349c997ec60a0e3def277a24c0f638fed78 (diff)
downloadtcl-d4d66c05ba64ebd9ae204c048eebebfd76a095c2.zip
tcl-d4d66c05ba64ebd9ae204c048eebebfd76a095c2.tar.gz
tcl-d4d66c05ba64ebd9ae204c048eebebfd76a095c2.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.
-rw-r--r--generic/tclCompile.c2
-rw-r--r--generic/tclNamesp.c2
-rw-r--r--generic/tclObj.c4
-rw-r--r--generic/tclPreserve.c4
-rw-r--r--generic/tclProc.c2
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);