summaryrefslogtreecommitdiffstats
path: root/generic/tclNamesp.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2017-12-19 11:23:13 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2017-12-19 11:23:13 (GMT)
commitee66488c3683d1e2b6ac36f523638c42c5649433 (patch)
treea0ea11d5e0652dbe305b67358e441b21fdca104e /generic/tclNamesp.c
parentf64bba0499c121428187fe686da131dca5905e50 (diff)
downloadtcl-ee66488c3683d1e2b6ac36f523638c42c5649433.zip
tcl-ee66488c3683d1e2b6ac36f523638c42c5649433.tar.gz
tcl-ee66488c3683d1e2b6ac36f523638c42c5649433.tar.bz2
Make TclEnsureNamespace() MODULE_SCOPE. Also change some refCount fields from type "int" to "unsigned int" for increased range.
Diffstat (limited to 'generic/tclNamesp.c')
-rw-r--r--generic/tclNamesp.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/generic/tclNamesp.c b/generic/tclNamesp.c
index d212de1..269d06b 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 == 0) {
+ if (framePtr->localCachePtr->refCount-- <= 1) {
TclFreeLocalCache(interp, framePtr->localCachePtr);
}
framePtr->localCachePtr = NULL;
@@ -1052,7 +1052,7 @@ Tcl_DeleteNamespace(
* Otherwise, mark it as "dead" so that it can't be used.
*/
- if (nsPtr->refCount == 0) {
+ if (!nsPtr->refCount) {
NamespaceFree(nsPtr);
} else {
nsPtr->flags |= NS_DEAD;