summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog6
-rw-r--r--generic/tclInt.h7
-rw-r--r--generic/tclVar.c20
3 files changed, 22 insertions, 11 deletions
diff --git a/ChangeLog b/ChangeLog
index fcb9cad..77cea46 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2004-10-26 Miguel Sofer <msofer@users.sf.net>
+
+ * generic/tclInt.h:
+ * generic/tclVar.c: removed more direct references to the VAR
+ flags, replaced with access macros.
+
2004-10-26 Donal K. Fellows <donal.k.fellows@man.ac.uk>
* doc/expr.n: Clarified that non-num/non-bool literals require
diff --git a/generic/tclInt.h b/generic/tclInt.h
index 6485187..a13d351 100644
--- a/generic/tclInt.h
+++ b/generic/tclInt.h
@@ -12,7 +12,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclInt.h,v 1.187 2004/10/25 01:06:51 msofer Exp $
+ * RCS: @(#) $Id: tclInt.h,v 1.188 2004/10/26 16:19:58 msofer Exp $
*/
#ifndef _TCLINT
@@ -536,6 +536,11 @@ typedef struct Var {
#define TclClearVarTraceActive(varPtr) \
(varPtr)->flags &= ~VAR_TRACE_ACTIVE
+#define TclSetVarNamespaceVar(varPtr) \
+ (varPtr)->flags |= VAR_NAMESPACE_VAR
+
+#define TclClearVarNamespaceVar(varPtr) \
+ (varPtr)->flags &= ~VAR_NAMESPACE_VAR
/*
* Macros to read various flag bits of variables.
diff --git a/generic/tclVar.c b/generic/tclVar.c
index e8e645b..7dc0bfe 100644
--- a/generic/tclVar.c
+++ b/generic/tclVar.c
@@ -15,7 +15,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclVar.c,v 1.96 2004/10/22 12:29:53 msofer Exp $
+ * RCS: @(#) $Id: tclVar.c,v 1.97 2004/10/26 16:19:58 msofer Exp $
*/
#ifdef STDC_HEADERS
@@ -442,7 +442,7 @@ TclObjLookupVar(interp, part1Ptr, part2, flags, msg, createPart1, createPart2,
&& !(flags & TCL_GLOBAL_ONLY)
/* careful: an undefined ns variable could
* be hiding a valid global reference. */
- && !(varPtr->flags & VAR_UNDEFINED))));
+ && !TclIsVarUndefined(varPtr))));
if (useReference && (varPtr->hPtr != NULL)) {
/*
* A straight global or namespace reference, use it. It isn't
@@ -2268,8 +2268,8 @@ TclObjUnsetVar2(interp, part1Ptr, part2, flags)
* If the variable was a namespace variable, decrement its reference count.
*/
- if (varPtr->flags & VAR_NAMESPACE_VAR) {
- varPtr->flags &= ~VAR_NAMESPACE_VAR;
+ if (TclIsVarNamespaceVar(varPtr)) {
+ TclClearVarNamespaceVar(varPtr);
varPtr->refCount--;
}
@@ -3779,8 +3779,8 @@ Tcl_VariableObjCmd(dummy, interp, objc, objv)
* destroyed or until the variable is unset.
*/
- if (!(varPtr->flags & VAR_NAMESPACE_VAR)) {
- varPtr->flags |= VAR_NAMESPACE_VAR;
+ if (!TclIsVarNamespaceVar(varPtr)) {
+ TclSetVarNamespaceVar(varPtr);
varPtr->refCount++;
}
@@ -4253,8 +4253,8 @@ TclDeleteVars(iPtr, tablePtr)
* variable.
*/
- if (varPtr->flags & VAR_NAMESPACE_VAR) {
- varPtr->flags &= ~VAR_NAMESPACE_VAR;
+ if (TclIsVarNamespaceVar(varPtr)) {
+ TclClearVarNamespaceVar(varPtr);
varPtr->refCount--;
}
@@ -4454,8 +4454,8 @@ DeleteArray(iPtr, arrayName, varPtr, flags)
* harmless.
*/
- if (elPtr->flags & VAR_NAMESPACE_VAR) {
- elPtr->flags &= ~VAR_NAMESPACE_VAR;
+ if (TclIsVarNamespaceVar(elPtr)) {
+ TclClearVarNamespaceVar(elPtr);
elPtr->refCount--;
}
if (elPtr->refCount == 0) {