summaryrefslogtreecommitdiffstats
path: root/generic/tclVar.c
diff options
context:
space:
mode:
authorMiguel Sofer <miguel.sofer@gmail.com>2004-12-14 21:11:42 (GMT)
committerMiguel Sofer <miguel.sofer@gmail.com>2004-12-14 21:11:42 (GMT)
commitbd20925e673c0a425280fc0163ce6febaf8c1e31 (patch)
tree107f654f002e993a551fe1925e706a97939c8a44 /generic/tclVar.c
parente648edc8fd0e8e6aa1d499e3392456a056f5acce (diff)
downloadtcl-bd20925e673c0a425280fc0163ce6febaf8c1e31.zip
tcl-bd20925e673c0a425280fc0163ce6febaf8c1e31.tar.gz
tcl-bd20925e673c0a425280fc0163ce6febaf8c1e31.tar.bz2
changing the isProcCallFrame field of the CallFrame struct from a 0/1 field
to flags. Should be perfectly backwards compatible.
Diffstat (limited to 'generic/tclVar.c')
-rw-r--r--generic/tclVar.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/generic/tclVar.c b/generic/tclVar.c
index ff0abce..362449a 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.100 2004/12/13 01:50:20 msofer Exp $
+ * RCS: @(#) $Id: tclVar.c,v 1.101 2004/12/14 21:11:47 msofer Exp $
*/
#include "tclInt.h"
@@ -403,7 +403,8 @@ TclObjLookupVar(interp, part1Ptr, part2, flags, msg, createPart1, createPart2,
if (typePtr == &tclLocalVarNameType) {
int localIndex = (int) part1Ptr->internalRep.longValue;
- if ((varFramePtr != NULL) && varFramePtr->isProcCallFrame
+ if ((varFramePtr != NULL)
+ && (varFramePtr->isProcCallFrame & FRAME_IS_PROC)
&& !(flags & (TCL_GLOBAL_ONLY | TCL_NAMESPACE_ONLY))
&& (localIndex < varFramePtr->numCompiledLocals)) {
/*
@@ -428,11 +429,12 @@ TclObjLookupVar(interp, part1Ptr, part2, flags, msg, createPart1, createPart2,
&& ((flags & TCL_GLOBAL_ONLY)
|| ((*part1 == ':') && (*(part1+1) == ':'))
|| (varFramePtr == NULL)
- || (!varFramePtr->isProcCallFrame
+ || (!(varFramePtr->isProcCallFrame & FRAME_IS_PROC)
&& (nsPtr == iPtr->globalNsPtr)));
useReference = useGlobal || ((cachedNsPtr == nsPtr)
&& ((flags & TCL_NAMESPACE_ONLY)
- || (varFramePtr && !varFramePtr->isProcCallFrame
+ || (varFramePtr
+ && !(varFramePtr->isProcCallFrame & FRAME_IS_PROC)
&& !(flags & TCL_GLOBAL_ONLY)
/* careful: an undefined ns variable could
* be hiding a valid global reference. */
@@ -699,7 +701,6 @@ TclLookupSimpleVar(interp, varName, flags, create, errMsgPtr, indexPtr)
if ((cxtNsPtr->varResProc != NULL || iPtr->resolverPtr != NULL)
&& !(flags & LOOKUP_FOR_UPVAR)) {
resPtr = iPtr->resolverPtr;
-
if (cxtNsPtr->varResProc) {
result = (*cxtNsPtr->varResProc)(interp, varName,
(Tcl_Namespace *) cxtNsPtr, flags, &var);
@@ -742,7 +743,7 @@ TclLookupSimpleVar(interp, varName, flags, create, errMsgPtr, indexPtr)
if (((flags & (TCL_GLOBAL_ONLY | TCL_NAMESPACE_ONLY)) != 0)
|| (varFramePtr == NULL)
- || !varFramePtr->isProcCallFrame
+ || !(varFramePtr->isProcCallFrame & FRAME_IS_PROC)
|| (strstr(varName, "::") != NULL)) {
CONST char *tail;
int lookGlobal;
@@ -3358,7 +3359,7 @@ ObjMakeUpvar(interp, framePtr, otherP1Ptr, otherP2, otherFlags, myName, myFlags,
}
if (index >= 0) {
- if (!varFramePtr->isProcCallFrame) {
+ if (!(varFramePtr->isProcCallFrame & FRAME_IS_PROC)) {
Tcl_Panic("ObjMakeUpvar called with an index outside from a proc.\n");
}
varPtr = &(varFramePtr->compiledLocals[index]);
@@ -3373,7 +3374,7 @@ ObjMakeUpvar(interp, framePtr, otherP1Ptr, otherP2, otherFlags, myName, myFlags,
if (((otherP2 ? arrayPtr->nsPtr : otherPtr->nsPtr) == NULL)
&& ((myFlags & (TCL_GLOBAL_ONLY | TCL_NAMESPACE_ONLY))
|| (varFramePtr == NULL)
- || !varFramePtr->isProcCallFrame
+ || !(varFramePtr->isProcCallFrame & FRAME_IS_PROC)
|| (strstr(myName, "::") != NULL))) {
Tcl_AppendResult((Tcl_Interp *) iPtr, "bad variable name \"",
myName, "\": upvar won't create namespace variable that ",
@@ -3643,7 +3644,7 @@ Tcl_GlobalObjCmd(dummy, interp, objc, objv)
*/
if ((iPtr->varFramePtr == NULL)
- || !iPtr->varFramePtr->isProcCallFrame) {
+ || !(iPtr->varFramePtr->isProcCallFrame & FRAME_IS_PROC)) {
return TCL_OK;
}
@@ -3797,7 +3798,7 @@ Tcl_VariableObjCmd(dummy, interp, objc, objv)
*/
if ((iPtr->varFramePtr != NULL)
- && iPtr->varFramePtr->isProcCallFrame) {
+ && (iPtr->varFramePtr->isProcCallFrame & FRAME_IS_PROC)) {
/*
* varName might have a scope qualifier, but the name for the
* local "link" variable must be the simple name at the tail.