diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2016-11-24 12:41:30 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2016-11-24 12:41:30 (GMT) |
commit | 82903a4b1fb9b7ea432581d5c197770473c49021 (patch) | |
tree | 0e55d2c6410e7746fe834a5237db97f46389027a /generic/tclNamesp.c | |
parent | 450b6f46c96b96bec44fb0bc119e3d11f3434f4a (diff) | |
parent | 2290210ff1e4282f665fd6b6dfaf4142220f5559 (diff) | |
download | tcl-82903a4b1fb9b7ea432581d5c197770473c49021.zip tcl-82903a4b1fb9b7ea432581d5c197770473c49021.tar.gz tcl-82903a4b1fb9b7ea432581d5c197770473c49021.tar.bz2 |
merge novem
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 fa2a10f..abac951 100644 --- a/generic/tclNamesp.c +++ b/generic/tclNamesp.c @@ -32,7 +32,7 @@ */ typedef struct { - 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 @@ -59,7 +59,7 @@ typedef struct { * 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 @@ -1320,8 +1320,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); } } @@ -4665,8 +4664,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 |