summaryrefslogtreecommitdiffstats
path: root/generic/tclNamesp.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/tclNamesp.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/tclNamesp.c')
-rw-r--r--generic/tclNamesp.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/generic/tclNamesp.c b/generic/tclNamesp.c
index 7f6ecf5..1e360d1 100644
--- a/generic/tclNamesp.c
+++ b/generic/tclNamesp.c
@@ -32,7 +32,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
@@ -59,7 +59,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
@@ -1326,8 +1326,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);
}
}
@@ -4671,8 +4670,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