summaryrefslogtreecommitdiffstats
path: root/generic/tclPreserve.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2016-11-21 10:15:24 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2016-11-21 10:15:24 (GMT)
commita3271d4360790d34a08896e46f0a6a37aa344568 (patch)
tree1745e8e5096f20504655ab8f994412fe58f8eb56 /generic/tclPreserve.c
parent0f3bab8aece13cfd66cca4d2e16489faaf69457b (diff)
downloadtcl-a3271d4360790d34a08896e46f0a6a37aa344568.zip
tcl-a3271d4360790d34a08896e46f0a6a37aa344568.tar.gz
tcl-a3271d4360790d34a08896e46f0a6a37aa344568.tar.bz2
More internal use of size_t in stead of int.
Diffstat (limited to 'generic/tclPreserve.c')
-rw-r--r--generic/tclPreserve.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/generic/tclPreserve.c b/generic/tclPreserve.c
index cca13e8..2d0e15c 100644
--- a/generic/tclPreserve.c
+++ b/generic/tclPreserve.c
@@ -22,7 +22,7 @@
typedef struct {
ClientData clientData; /* Address of preserved block. */
- int refCount; /* Number of Tcl_Preserve calls in effect for
+ size_t refCount; /* Number of Tcl_Preserve calls in effect for
* block. */
int mustFree; /* Non-zero means Tcl_EventuallyFree was
* called while a Tcl_Preserve call was in
@@ -63,7 +63,7 @@ typedef struct HandleStruct {
* ensure that the contents of the handle are
* not changed by anyone else. */
#endif
- int refCount; /* Number of TclHandlePreserve() calls in
+ size_t refCount; /* Number of TclHandlePreserve() calls in
* effect on this handle. */
} HandleStruct;
@@ -195,7 +195,7 @@ Tcl_Release(
continue;
}
- if (--refPtr->refCount != 0) {
+ if (refPtr->refCount-- > 1) {
Tcl_MutexUnlock(&preserveMutex);
return;
}
@@ -459,7 +459,7 @@ TclHandleRelease(
handlePtr, handlePtr->ptr2, handlePtr->ptr);
}
#endif
- if ((--handlePtr->refCount == 0) && (handlePtr->ptr == NULL)) {
+ if ((handlePtr->refCount-- <= 1) && (handlePtr->ptr == NULL)) {
ckfree(handlePtr);
}
}