summaryrefslogtreecommitdiffstats
path: root/generic/tclEncoding.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2016-12-16 16:14:57 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2016-12-16 16:14:57 (GMT)
commit972b65b569a076eb77f72d26185a309bcca4ffd4 (patch)
tree7ca9a2e61706cb9fa91e227c8a5154e4c9551ce7 /generic/tclEncoding.c
parentb549e1996164c30e79ed1b26538b03dbdafa284a (diff)
downloadtcl-972b65b569a076eb77f72d26185a309bcca4ffd4.zip
tcl-972b65b569a076eb77f72d26185a309bcca4ffd4.tar.gz
tcl-972b65b569a076eb77f72d26185a309bcca4ffd4.tar.bz2
Some more internal use of size_t in stead of int. No functional change.
Diffstat (limited to 'generic/tclEncoding.c')
-rw-r--r--generic/tclEncoding.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/generic/tclEncoding.c b/generic/tclEncoding.c
index 8a4dc3b..91c2278 100644
--- a/generic/tclEncoding.c
+++ b/generic/tclEncoding.c
@@ -46,7 +46,7 @@ typedef struct Encoding {
* nullSize is 2, this is a function that
* returns the number of bytes in a 0x0000
* terminated string. */
- int refCount; /* Number of uses of this structure. */
+ size_t refCount; /* Number of uses of this structure. */
Tcl_HashEntry *hPtr; /* Hash table entry that owns this encoding. */
} Encoding;
@@ -844,11 +844,7 @@ FreeEncoding(
if (encodingPtr == NULL) {
return;
}
- if (encodingPtr->refCount<=0) {
- Tcl_Panic("FreeEncoding: refcount problem !!!");
- }
- encodingPtr->refCount--;
- if (encodingPtr->refCount == 0) {
+ if (encodingPtr->refCount-- <= 1) {
if (encodingPtr->freeProc != NULL) {
encodingPtr->freeProc(encodingPtr->clientData);
}