diff options
author | dgp <dgp@users.sourceforge.net> | 2016-11-28 16:08:33 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2016-11-28 16:08:33 (GMT) |
commit | e615b5470447167aa8fbcb94824cd5285e8abeaa (patch) | |
tree | 0bc5f840a6bd251cb90c5c690fdef2b905ead1e9 /generic/tclNamesp.c | |
parent | e2d691eda81e4b943c815e3cb0fc52f62c82b73f (diff) | |
parent | df537d0dfb0d776a346f5c04aca6cb5f090c0b1a (diff) | |
download | tcl-e615b5470447167aa8fbcb94824cd5285e8abeaa.zip tcl-e615b5470447167aa8fbcb94824cd5285e8abeaa.tar.gz tcl-e615b5470447167aa8fbcb94824cd5285e8abeaa.tar.bz2 |
merge trunk
Diffstat (limited to 'generic/tclNamesp.c')
-rw-r--r-- | generic/tclNamesp.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/generic/tclNamesp.c b/generic/tclNamesp.c index 7aacf7f..b1b486a 100644 --- a/generic/tclNamesp.c +++ b/generic/tclNamesp.c @@ -33,7 +33,7 @@ */ typedef struct ThreadSpecificData { - long numNsCreated; /* Count of the number of namespaces created + size_t numNsCreated; /* Count of the number of namespaces created * within the thread. This value is used as a * unique id for each namespace. Cannot be * per-interp because the nsId is used to @@ -60,7 +60,7 @@ typedef struct ResolvedNsName { * the name was resolved. NULL if the name is * fully qualified and thus the resolution * does not depend on the context. */ - int refCount; /* Reference count: 1 for each nsName object + size_t refCount; /* Reference count: 1 for each nsName object * that has a pointer to this ResolvedNsName * structure as its internal rep. This * structure can be freed when refCount @@ -1343,8 +1343,7 @@ void TclNsDecrRefCount( Namespace *nsPtr) { - nsPtr->refCount--; - if ((nsPtr->refCount == 0) && (nsPtr->flags & NS_DEAD)) { + if ((nsPtr->refCount-- <= 1) && (nsPtr->flags & NS_DEAD)) { NamespaceFree(nsPtr); } } @@ -4694,8 +4693,7 @@ FreeNsNameInternalRep( * references, free it up. */ - resNamePtr->refCount--; - if (resNamePtr->refCount == 0) { + if (resNamePtr->refCount-- <= 1) { /* * Decrement the reference count for the cached namespace. If the * namespace is dead, and there are no more references to it, free |