Index: doc/SetVar.3
===================================================================
RCS file: /cvsroot/tcl/tcl/doc/SetVar.3,v
retrieving revision 1.4
diff -u -r1.4 SetVar.3
--- doc/SetVar.3	25 Jan 2002 20:40:55 -0000	1.4
+++ doc/SetVar.3	20 Mar 2002 19:58:40 -0000
@@ -59,7 +59,7 @@
 or a complete name including both variable name and index.
 May include \fB::\fR namespace qualifiers
 to specify a variable in a particular namespace.
-.AP char *name2 in
+.AP CONST char *name2 in
 If non-NULL, gives name of element within array; in this
 case \fIname1\fR must refer to an array variable.
 .AP Tcl_Obj *newValuePtr in
Index: doc/TraceVar.3
===================================================================
RCS file: /cvsroot/tcl/tcl/doc/TraceVar.3,v
retrieving revision 1.5
diff -u -r1.5 TraceVar.3
--- doc/TraceVar.3	19 Nov 2001 14:35:54 -0000	1.5
+++ doc/TraceVar.3	20 Mar 2002 19:58:40 -0000
@@ -54,7 +54,7 @@
 Arbitrary one-word value to pass to \fIproc\fR.
 .AP char *name1 in
 Name of scalar or array variable (without array index).
-.AP char *name2 in
+.AP CONST char *name2 in
 For a trace on an element of an array, gives the index of the
 element.  For traces on scalar variables or on whole arrays,
 is NULL.
Index: doc/UpVar.3
===================================================================
RCS file: /cvsroot/tcl/tcl/doc/UpVar.3,v
retrieving revision 1.4
diff -u -r1.4 UpVar.3
--- doc/UpVar.3	27 Sep 2001 20:32:35 -0000	1.4
+++ doc/UpVar.3	20 Mar 2002 19:58:40 -0000
@@ -45,7 +45,7 @@
 .AP char *name1 in
 First part of source variable's name (scalar name, or name of array
 without array index).
-.AP char *name2 in
+.AP CONST char *name2 in
 If source variable is an element of an array, gives the index of the element.
 For scalar source variables, is NULL.
 .BE
Index: generic/tcl.decls
===================================================================
RCS file: /cvsroot/tcl/tcl/generic/tcl.decls,v
retrieving revision 1.85
diff -u -r1.85 tcl.decls
--- generic/tcl.decls	28 Feb 2002 05:11:25 -0000	1.85
+++ generic/tcl.decls	20 Mar 2002 19:58:42 -0000
@@ -628,7 +628,7 @@
     CONST char * Tcl_GetVar(Tcl_Interp *interp, char *varName, int flags)
 }
 declare 176 generic {
-    CONST char * Tcl_GetVar2(Tcl_Interp *interp, char *part1, char *part2,
+    CONST char * Tcl_GetVar2(Tcl_Interp *interp, char *part1, CONST char *part2,
 	    int flags)
 }
 declare 177 generic {
@@ -838,7 +838,7 @@
 	    CONST char *newValue, int flags)
 }
 declare 238 generic {
-    CONST char * Tcl_SetVar2(Tcl_Interp *interp, char *part1, char *part2,
+    CONST char * Tcl_SetVar2(Tcl_Interp *interp, char *part1, CONST char *part2,
 	    CONST char *newValue, int flags)
 }
 declare 239 generic {
@@ -874,7 +874,7 @@
 	    Tcl_VarTraceProc *proc, ClientData clientData)
 }
 declare 248 generic {
-    int Tcl_TraceVar2(Tcl_Interp *interp, char *part1, char *part2,
+    int Tcl_TraceVar2(Tcl_Interp *interp, char *part1, CONST char *part2,
 	    int flags, Tcl_VarTraceProc *proc, ClientData clientData)
 }
 declare 249 generic {
@@ -894,14 +894,14 @@
     int Tcl_UnsetVar(Tcl_Interp *interp, char *varName, int flags)
 }
 declare 254 generic {
-    int Tcl_UnsetVar2(Tcl_Interp *interp, char *part1, char *part2, int flags)
+    int Tcl_UnsetVar2(Tcl_Interp *interp, char *part1, CONST char *part2, int flags)
 }
 declare 255 generic {
     void Tcl_UntraceVar(Tcl_Interp *interp, char *varName, int flags,
 	    Tcl_VarTraceProc *proc, ClientData clientData)
 }
 declare 256 generic {
-    void Tcl_UntraceVar2(Tcl_Interp *interp, char *part1, char *part2,
+    void Tcl_UntraceVar2(Tcl_Interp *interp, char *part1, CONST char *part2,
 	    int flags, Tcl_VarTraceProc *proc, ClientData clientData)
 }
 declare 257 generic {
@@ -913,7 +913,7 @@
 }
 declare 259 generic {
     int Tcl_UpVar2(Tcl_Interp *interp, CONST char *frameName, char *part1,
-	    char *part2, CONST char *localName, int flags)
+	    CONST char *part2, CONST char *localName, int flags)
 }
 declare 260 generic {
     int Tcl_VarEval(Tcl_Interp *interp, ...)
@@ -924,7 +924,7 @@
 }
 declare 262 generic {
     ClientData Tcl_VarTraceInfo2(Tcl_Interp *interp, char *part1,
-	    char *part2, int flags, Tcl_VarTraceProc *procPtr,
+	    CONST char *part2, int flags, Tcl_VarTraceProc *procPtr,
 	    ClientData prevClientData)
 }
 declare 263 generic {
@@ -1093,7 +1093,7 @@
     VOID * Tcl_GetThreadData(Tcl_ThreadDataKey *keyPtr, int size)
 }
 declare 306 generic {
-    Tcl_Obj * Tcl_GetVar2Ex(Tcl_Interp *interp, char *part1, char *part2,
+    Tcl_Obj * Tcl_GetVar2Ex(Tcl_Interp *interp, char *part1, CONST char *part2,
 	    int flags)
 }
 declare 307 generic {
@@ -1129,7 +1129,7 @@
     int Tcl_SetSystemEncoding(Tcl_Interp *interp, CONST char *name)
 }
 declare 317 generic {
-    Tcl_Obj * Tcl_SetVar2Ex(Tcl_Interp *interp, char *part1, char *part2,
+    Tcl_Obj * Tcl_SetVar2Ex(Tcl_Interp *interp, char *part1, CONST char *part2,
 	    Tcl_Obj *newValuePtr, int flags)
 }
 declare 318 generic {
Index: generic/tcl.h
===================================================================
RCS file: /cvsroot/tcl/tcl/generic/tcl.h,v
retrieving revision 1.120
diff -u -r1.120 tcl.h
--- generic/tcl.h	6 Mar 2002 15:20:23 -0000	1.120
+++ generic/tcl.h	20 Mar 2002 19:58:43 -0000
@@ -710,7 +710,7 @@
 	struct Tcl_Obj *objPtr));
 typedef void (Tcl_UpdateStringProc) _ANSI_ARGS_((struct Tcl_Obj *objPtr));
 typedef char *(Tcl_VarTraceProc) _ANSI_ARGS_((ClientData clientData,
-	Tcl_Interp *interp, char *part1, char *part2, int flags));
+	Tcl_Interp *interp, char *part1, CONST84 char *part2, int flags));
 typedef void (Tcl_CommandTraceProc) _ANSI_ARGS_((ClientData clientData,
 	Tcl_Interp *interp, CONST char *oldName, CONST char *newName,
 	int flags));
Index: generic/tclCmdMZ.c
===================================================================
RCS file: /cvsroot/tcl/tcl/generic/tclCmdMZ.c,v
retrieving revision 1.63
diff -u -r1.63 tclCmdMZ.c
--- generic/tclCmdMZ.c	1 Mar 2002 06:23:08 -0000	1.63
+++ generic/tclCmdMZ.c	20 Mar 2002 19:58:45 -0000
@@ -68,7 +68,7 @@
 };
 
 static char *		TraceVarProc _ANSI_ARGS_((ClientData clientData,
-			    Tcl_Interp *interp, char *name1, char *name2,
+			    Tcl_Interp *interp, char *name1, CONST char *name2,
 			    int flags));
 static void		TraceCommandProc _ANSI_ARGS_((ClientData clientData,
 			    Tcl_Interp *interp, CONST char *oldName,
@@ -3722,7 +3722,7 @@
     ClientData clientData;	/* Information about the variable trace. */
     Tcl_Interp *interp;		/* Interpreter containing variable. */
     char *name1;		/* Name of variable or array. */
-    char *name2;		/* Name of element within array;  NULL means
+    CONST char *name2;		/* Name of element within array;  NULL means
 				 * scalar variable is being referenced. */
     int flags;			/* OR-ed bits giving operation and other
 				 * information. */
Index: generic/tclDecls.h
===================================================================
RCS file: /cvsroot/tcl/tcl/generic/tclDecls.h,v
retrieving revision 1.85
diff -u -r1.85 tclDecls.h
--- generic/tclDecls.h	28 Feb 2002 05:11:25 -0000	1.85
+++ generic/tclDecls.h	20 Mar 2002 19:58:47 -0000
@@ -574,7 +574,7 @@
 				char * varName, int flags));
 /* 176 */
 EXTERN CONST char *	Tcl_GetVar2 _ANSI_ARGS_((Tcl_Interp * interp, 
-				char * part1, char * part2, int flags));
+				char * part1, CONST char * part2, int flags));
 /* 177 */
 EXTERN int		Tcl_GlobalEval _ANSI_ARGS_((Tcl_Interp * interp, 
 				char * command));
@@ -772,7 +772,7 @@
 				int flags));
 /* 238 */
 EXTERN CONST char *	Tcl_SetVar2 _ANSI_ARGS_((Tcl_Interp * interp, 
-				char * part1, char * part2, 
+				char * part1, CONST char * part2, 
 				CONST char * newValue, int flags));
 /* 239 */
 EXTERN CONST char *	Tcl_SignalId _ANSI_ARGS_((int sig));
@@ -804,7 +804,7 @@
 				ClientData clientData));
 /* 248 */
 EXTERN int		Tcl_TraceVar2 _ANSI_ARGS_((Tcl_Interp * interp, 
-				char * part1, char * part2, int flags, 
+				char * part1, CONST char * part2, int flags, 
 				Tcl_VarTraceProc * proc, 
 				ClientData clientData));
 /* 249 */
@@ -825,7 +825,7 @@
 				char * varName, int flags));
 /* 254 */
 EXTERN int		Tcl_UnsetVar2 _ANSI_ARGS_((Tcl_Interp * interp, 
-				char * part1, char * part2, int flags));
+				char * part1, CONST char * part2, int flags));
 /* 255 */
 EXTERN void		Tcl_UntraceVar _ANSI_ARGS_((Tcl_Interp * interp, 
 				char * varName, int flags, 
@@ -833,7 +833,7 @@
 				ClientData clientData));
 /* 256 */
 EXTERN void		Tcl_UntraceVar2 _ANSI_ARGS_((Tcl_Interp * interp, 
-				char * part1, char * part2, int flags, 
+				char * part1, CONST char * part2, int flags, 
 				Tcl_VarTraceProc * proc, 
 				ClientData clientData));
 /* 257 */
@@ -846,7 +846,7 @@
 /* 259 */
 EXTERN int		Tcl_UpVar2 _ANSI_ARGS_((Tcl_Interp * interp, 
 				CONST char * frameName, char * part1, 
-				char * part2, CONST char * localName, 
+				CONST char * part2, CONST char * localName, 
 				int flags));
 /* 260 */
 EXTERN int		Tcl_VarEval _ANSI_ARGS_(TCL_VARARGS(Tcl_Interp *,interp));
@@ -857,7 +857,7 @@
 				ClientData prevClientData));
 /* 262 */
 EXTERN ClientData	Tcl_VarTraceInfo2 _ANSI_ARGS_((Tcl_Interp * interp, 
-				char * part1, char * part2, int flags, 
+				char * part1, CONST char * part2, int flags, 
 				Tcl_VarTraceProc * procPtr, 
 				ClientData prevClientData));
 /* 263 */
@@ -994,7 +994,7 @@
 				Tcl_ThreadDataKey * keyPtr, int size));
 /* 306 */
 EXTERN Tcl_Obj *	Tcl_GetVar2Ex _ANSI_ARGS_((Tcl_Interp * interp, 
-				char * part1, char * part2, int flags));
+				char * part1, CONST char * part2, int flags));
 /* 307 */
 EXTERN ClientData	Tcl_InitNotifier _ANSI_ARGS_((void));
 /* 308 */
@@ -1026,7 +1026,7 @@
 				Tcl_Interp * interp, CONST char * name));
 /* 317 */
 EXTERN Tcl_Obj *	Tcl_SetVar2Ex _ANSI_ARGS_((Tcl_Interp * interp, 
-				char * part1, char * part2, 
+				char * part1, CONST char * part2, 
 				Tcl_Obj * newValuePtr, int flags));
 /* 318 */
 EXTERN void		Tcl_ThreadAlert _ANSI_ARGS_((Tcl_ThreadId threadId));
@@ -1772,7 +1772,7 @@
     Tcl_Channel (*tcl_GetStdChannel) _ANSI_ARGS_((int type)); /* 173 */
     CONST char * (*tcl_GetStringResult) _ANSI_ARGS_((Tcl_Interp * interp)); /* 174 */
     CONST char * (*tcl_GetVar) _ANSI_ARGS_((Tcl_Interp * interp, char * varName, int flags)); /* 175 */
-    CONST char * (*tcl_GetVar2) _ANSI_ARGS_((Tcl_Interp * interp, char * part1, char * part2, int flags)); /* 176 */
+    CONST char * (*tcl_GetVar2) _ANSI_ARGS_((Tcl_Interp * interp, char * part1, CONST char * part2, int flags)); /* 176 */
     int (*tcl_GlobalEval) _ANSI_ARGS_((Tcl_Interp * interp, char * command)); /* 177 */
     int (*tcl_GlobalEvalObj) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Obj * objPtr)); /* 178 */
     int (*tcl_HideCommand) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * cmdName, CONST char * hiddenCmdToken)); /* 179 */
@@ -1850,7 +1850,7 @@
     void (*tcl_SetObjResult) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Obj * resultObjPtr)); /* 235 */
     void (*tcl_SetStdChannel) _ANSI_ARGS_((Tcl_Channel channel, int type)); /* 236 */
     CONST char * (*tcl_SetVar) _ANSI_ARGS_((Tcl_Interp * interp, char * varName, CONST char * newValue, int flags)); /* 237 */
-    CONST char * (*tcl_SetVar2) _ANSI_ARGS_((Tcl_Interp * interp, char * part1, char * part2, CONST char * newValue, int flags)); /* 238 */
+    CONST char * (*tcl_SetVar2) _ANSI_ARGS_((Tcl_Interp * interp, char * part1, CONST char * part2, CONST char * newValue, int flags)); /* 238 */
     CONST char * (*tcl_SignalId) _ANSI_ARGS_((int sig)); /* 239 */
     CONST char * (*tcl_SignalMsg) _ANSI_ARGS_((int sig)); /* 240 */
     void (*tcl_SourceRCFile) _ANSI_ARGS_((Tcl_Interp * interp)); /* 241 */
@@ -1860,21 +1860,21 @@
     int (*tcl_StringMatch) _ANSI_ARGS_((CONST char * str, CONST char * pattern)); /* 245 */
     int (*tcl_TellOld) _ANSI_ARGS_((Tcl_Channel chan)); /* 246 */
     int (*tcl_TraceVar) _ANSI_ARGS_((Tcl_Interp * interp, char * varName, int flags, Tcl_VarTraceProc * proc, ClientData clientData)); /* 247 */
-    int (*tcl_TraceVar2) _ANSI_ARGS_((Tcl_Interp * interp, char * part1, char * part2, int flags, Tcl_VarTraceProc * proc, ClientData clientData)); /* 248 */
+    int (*tcl_TraceVar2) _ANSI_ARGS_((Tcl_Interp * interp, char * part1, CONST char * part2, int flags, Tcl_VarTraceProc * proc, ClientData clientData)); /* 248 */
     char * (*tcl_TranslateFileName) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * name, Tcl_DString * bufferPtr)); /* 249 */
     int (*tcl_Ungets) _ANSI_ARGS_((Tcl_Channel chan, CONST char * str, int len, int atHead)); /* 250 */
     void (*tcl_UnlinkVar) _ANSI_ARGS_((Tcl_Interp * interp, char * varName)); /* 251 */
     int (*tcl_UnregisterChannel) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Channel chan)); /* 252 */
     int (*tcl_UnsetVar) _ANSI_ARGS_((Tcl_Interp * interp, char * varName, int flags)); /* 253 */
-    int (*tcl_UnsetVar2) _ANSI_ARGS_((Tcl_Interp * interp, char * part1, char * part2, int flags)); /* 254 */
+    int (*tcl_UnsetVar2) _ANSI_ARGS_((Tcl_Interp * interp, char * part1, CONST char * part2, int flags)); /* 254 */
     void (*tcl_UntraceVar) _ANSI_ARGS_((Tcl_Interp * interp, char * varName, int flags, Tcl_VarTraceProc * proc, ClientData clientData)); /* 255 */
-    void (*tcl_UntraceVar2) _ANSI_ARGS_((Tcl_Interp * interp, char * part1, char * part2, int flags, Tcl_VarTraceProc * proc, ClientData clientData)); /* 256 */
+    void (*tcl_UntraceVar2) _ANSI_ARGS_((Tcl_Interp * interp, char * part1, CONST char * part2, int flags, Tcl_VarTraceProc * proc, ClientData clientData)); /* 256 */
     void (*tcl_UpdateLinkedVar) _ANSI_ARGS_((Tcl_Interp * interp, char * varName)); /* 257 */
     int (*tcl_UpVar) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * frameName, char * varName, CONST char * localName, int flags)); /* 258 */
-    int (*tcl_UpVar2) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * frameName, char * part1, char * part2, CONST char * localName, int flags)); /* 259 */
+    int (*tcl_UpVar2) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * frameName, char * part1, CONST char * part2, CONST char * localName, int flags)); /* 259 */
     int (*tcl_VarEval) _ANSI_ARGS_(TCL_VARARGS(Tcl_Interp *,interp)); /* 260 */
     ClientData (*tcl_VarTraceInfo) _ANSI_ARGS_((Tcl_Interp * interp, char * varName, int flags, Tcl_VarTraceProc * procPtr, ClientData prevClientData)); /* 261 */
-    ClientData (*tcl_VarTraceInfo2) _ANSI_ARGS_((Tcl_Interp * interp, char * part1, char * part2, int flags, Tcl_VarTraceProc * procPtr, ClientData prevClientData)); /* 262 */
+    ClientData (*tcl_VarTraceInfo2) _ANSI_ARGS_((Tcl_Interp * interp, char * part1, CONST char * part2, int flags, Tcl_VarTraceProc * procPtr, ClientData prevClientData)); /* 262 */
     int (*tcl_Write) _ANSI_ARGS_((Tcl_Channel chan, CONST char * s, int slen)); /* 263 */
     void (*tcl_WrongNumArgs) _ANSI_ARGS_((Tcl_Interp * interp, int objc, Tcl_Obj *CONST objv[], CONST char * message)); /* 264 */
     int (*tcl_DumpActiveMemory) _ANSI_ARGS_((CONST char * fileName)); /* 265 */
@@ -1918,7 +1918,7 @@
     void (*tcl_GetEncodingNames) _ANSI_ARGS_((Tcl_Interp * interp)); /* 303 */
     int (*tcl_GetIndexFromObjStruct) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Obj * objPtr, CONST VOID * tablePtr, int offset, CONST char * msg, int flags, int * indexPtr)); /* 304 */
     VOID * (*tcl_GetThreadData) _ANSI_ARGS_((Tcl_ThreadDataKey * keyPtr, int size)); /* 305 */
-    Tcl_Obj * (*tcl_GetVar2Ex) _ANSI_ARGS_((Tcl_Interp * interp, char * part1, char * part2, int flags)); /* 306 */
+    Tcl_Obj * (*tcl_GetVar2Ex) _ANSI_ARGS_((Tcl_Interp * interp, char * part1, CONST char * part2, int flags)); /* 306 */
     ClientData (*tcl_InitNotifier) _ANSI_ARGS_((void)); /* 307 */
     void (*tcl_MutexLock) _ANSI_ARGS_((Tcl_Mutex * mutexPtr)); /* 308 */
     void (*tcl_MutexUnlock) _ANSI_ARGS_((Tcl_Mutex * mutexPtr)); /* 309 */
@@ -1929,7 +1929,7 @@
     void (*tcl_RestoreResult) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_SavedResult * statePtr)); /* 314 */
     void (*tcl_SaveResult) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_SavedResult * statePtr)); /* 315 */
     int (*tcl_SetSystemEncoding) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * name)); /* 316 */
-    Tcl_Obj * (*tcl_SetVar2Ex) _ANSI_ARGS_((Tcl_Interp * interp, char * part1, char * part2, Tcl_Obj * newValuePtr, int flags)); /* 317 */
+    Tcl_Obj * (*tcl_SetVar2Ex) _ANSI_ARGS_((Tcl_Interp * interp, char * part1, CONST char * part2, Tcl_Obj * newValuePtr, int flags)); /* 317 */
     void (*tcl_ThreadAlert) _ANSI_ARGS_((Tcl_ThreadId threadId)); /* 318 */
     void (*tcl_ThreadQueueEvent) _ANSI_ARGS_((Tcl_ThreadId threadId, Tcl_Event* evPtr, Tcl_QueuePosition position)); /* 319 */
     Tcl_UniChar (*tcl_UniCharAtIndex) _ANSI_ARGS_((CONST char * src, int index)); /* 320 */
Index: generic/tclEnv.c
===================================================================
RCS file: /cvsroot/tcl/tcl/generic/tclEnv.c,v
retrieving revision 1.12
diff -u -r1.12 tclEnv.c
--- generic/tclEnv.c	8 Feb 2002 02:52:54 -0000	1.12
+++ generic/tclEnv.c	20 Mar 2002 19:58:48 -0000
@@ -46,7 +46,7 @@
  */
 
 static char *		EnvTraceProc _ANSI_ARGS_((ClientData clientData,
-			    Tcl_Interp *interp, char *name1, char *name2,
+			    Tcl_Interp *interp, char *name1, CONST char *name2,
 			    int flags));
 static void		ReplaceString _ANSI_ARGS_((CONST char *oldStr,
 			    char *newStr));
@@ -506,7 +506,7 @@
     Tcl_Interp *interp;		/* Interpreter whose "env" variable is
 				 * being modified. */
     char *name1;		/* Better be "env". */
-    char *name2;		/* Name of variable being modified, or NULL
+    CONST char *name2;		/* Name of variable being modified, or NULL
 				 * if whole array is being deleted (UTF-8). */
     int flags;			/* Indicates what's happening. */
 {
Index: generic/tclEvent.c
===================================================================
RCS file: /cvsroot/tcl/tcl/generic/tclEvent.c,v
retrieving revision 1.19
diff -u -r1.19 tclEvent.c
--- generic/tclEvent.c	25 Jan 2002 20:40:55 -0000	1.19
+++ generic/tclEvent.c	20 Mar 2002 19:58:48 -0000
@@ -111,7 +111,7 @@
 			    Tcl_Interp *interp));
 static void		HandleBgErrors _ANSI_ARGS_((ClientData clientData));
 static char *		VwaitVarProc _ANSI_ARGS_((ClientData clientData,
-			    Tcl_Interp *interp, char *name1, char *name2,
+			    Tcl_Interp *interp, char *name1, CONST char *name2,
 			    int flags));
 
 /*
@@ -1014,7 +1014,7 @@
     ClientData clientData;	/* Pointer to integer to set to 1. */
     Tcl_Interp *interp;		/* Interpreter containing variable. */
     char *name1;		/* Name of variable. */
-    char *name2;		/* Second part of variable name. */
+    CONST char *name2;		/* Second part of variable name. */
     int flags;			/* Information about what happened. */
 {
     int *donePtr = (int *) clientData;
Index: generic/tclInt.decls
===================================================================
RCS file: /cvsroot/tcl/tcl/generic/tclInt.decls,v
retrieving revision 1.46
diff -u -r1.46 tclInt.decls
--- generic/tclInt.decls	15 Feb 2002 14:28:49 -0000	1.46
+++ generic/tclInt.decls	20 Mar 2002 19:58:49 -0000
@@ -236,7 +236,7 @@
 #      int TclLooksLikeInt(char *p)
 #  }
 declare 58 generic {
-    Var * TclLookupVar(Tcl_Interp *interp, char *part1, char *part2,
+    Var * TclLookupVar(Tcl_Interp *interp, char *part1, CONST char *part2,
 	    int flags, char *msg, int createPart1, int createPart2,
 	    Var **arrayPtrPtr)
 }
@@ -347,7 +347,7 @@
 #  }
 declare 88 generic {
     char * TclPrecTraceProc(ClientData clientData, Tcl_Interp *interp,
-	    char *name1, char *name2, int flags)
+	    char *name1, CONST char *name2, int flags)
 }
 declare 89 generic {
     int TclPreventAliasLoop(Tcl_Interp *interp, Tcl_Interp *cmdInterp,
Index: generic/tclIntDecls.h
===================================================================
RCS file: /cvsroot/tcl/tcl/generic/tclIntDecls.h,v
retrieving revision 1.38
diff -u -r1.38 tclIntDecls.h
--- generic/tclIntDecls.h	15 Feb 2002 14:28:49 -0000	1.38
+++ generic/tclIntDecls.h	20 Mar 2002 19:58:49 -0000
@@ -209,7 +209,7 @@
 /* Slot 57 is reserved */
 /* 58 */
 EXTERN Var *		TclLookupVar _ANSI_ARGS_((Tcl_Interp * interp, 
-				char * part1, char * part2, int flags, 
+				char * part1, CONST char * part2, int flags, 
 				char * msg, int createPart1, int createPart2, 
 				Var ** arrayPtrPtr));
 /* Slot 59 is reserved */
@@ -267,7 +267,7 @@
 /* 88 */
 EXTERN char *		TclPrecTraceProc _ANSI_ARGS_((ClientData clientData, 
 				Tcl_Interp * interp, char * name1, 
-				char * name2, int flags));
+				CONST char * name2, int flags));
 /* 89 */
 EXTERN int		TclPreventAliasLoop _ANSI_ARGS_((Tcl_Interp * interp, 
 				Tcl_Interp * cmdInterp, Tcl_Command cmd));
@@ -581,7 +581,7 @@
     Proc * (*tclIsProc) _ANSI_ARGS_((Command * cmdPtr)); /* 55 */
     void *reserved56;
     void *reserved57;
-    Var * (*tclLookupVar) _ANSI_ARGS_((Tcl_Interp * interp, char * part1, char * part2, int flags, char * msg, int createPart1, int createPart2, Var ** arrayPtrPtr)); /* 58 */
+    Var * (*tclLookupVar) _ANSI_ARGS_((Tcl_Interp * interp, char * part1, CONST char * part2, int flags, char * msg, int createPart1, int createPart2, Var ** arrayPtrPtr)); /* 58 */
     void *reserved59;
     int (*tclNeedSpace) _ANSI_ARGS_((CONST char * start, CONST char * end)); /* 60 */
     Tcl_Obj * (*tclNewProcBodyObj) _ANSI_ARGS_((Proc * procPtr)); /* 61 */
@@ -611,7 +611,7 @@
     void *reserved85;
     void *reserved86;
     void *reserved87;
-    char * (*tclPrecTraceProc) _ANSI_ARGS_((ClientData clientData, Tcl_Interp * interp, char * name1, char * name2, int flags)); /* 88 */
+    char * (*tclPrecTraceProc) _ANSI_ARGS_((ClientData clientData, Tcl_Interp * interp, char * name1, CONST char * name2, int flags)); /* 88 */
     int (*tclPreventAliasLoop) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Interp * cmdInterp, Tcl_Command cmd)); /* 89 */
     void *reserved90;
     void (*tclProcCleanupProc) _ANSI_ARGS_((Proc * procPtr)); /* 91 */
Index: generic/tclLink.c
===================================================================
RCS file: /cvsroot/tcl/tcl/generic/tclLink.c,v
retrieving revision 1.6
diff -u -r1.6 tclLink.c
--- generic/tclLink.c	28 Feb 2002 00:38:26 -0000	1.6
+++ generic/tclLink.c	20 Mar 2002 19:58:49 -0000
@@ -60,7 +60,7 @@
  */
 
 static char *		LinkTraceProc _ANSI_ARGS_((ClientData clientData,
-			    Tcl_Interp *interp, char *name1, char *name2,
+			    Tcl_Interp *interp, char *name1, CONST char *name2,
 			    int flags));
 static Tcl_Obj *	ObjValue _ANSI_ARGS_((Link *linkPtr));
 
@@ -230,7 +230,7 @@
     ClientData clientData;	/* Contains information about the link. */
     Tcl_Interp *interp;		/* Interpreter containing Tcl variable. */
     char *name1;		/* First part of variable name. */
-    char *name2;		/* Second part of variable name. */
+    CONST char *name2;		/* Second part of variable name. */
     int flags;			/* Miscellaneous additional information. */
 {
     Link *linkPtr = (Link *) clientData;
Index: generic/tclUtil.c
===================================================================
RCS file: /cvsroot/tcl/tcl/generic/tclUtil.c,v
retrieving revision 1.29
diff -u -r1.29 tclUtil.c
--- generic/tclUtil.c	8 Feb 2002 02:52:54 -0000	1.29
+++ generic/tclUtil.c	20 Mar 2002 19:58:51 -0000
@@ -1879,7 +1879,7 @@
     ClientData clientData;	/* Not used. */
     Tcl_Interp *interp;		/* Interpreter containing variable. */
     char *name1;		/* Name of variable. */
-    char *name2;		/* Second part of variable name. */
+    CONST char *name2;		/* Second part of variable name. */
     int flags;			/* Information about what happened. */
 {
     CONST char *value;
Index: generic/tclVar.c
===================================================================
RCS file: /cvsroot/tcl/tcl/generic/tclVar.c,v
retrieving revision 1.49
diff -u -r1.49 tclVar.c
--- generic/tclVar.c	27 Feb 2002 06:38:39 -0000	1.49
+++ generic/tclVar.c	20 Mar 2002 19:58:54 -0000
@@ -41,7 +41,7 @@
  */
 
 static  char *		CallTraces _ANSI_ARGS_((Interp *iPtr, Var *arrayPtr,
-			    Var *varPtr, char *part1, char *part2,
+			    Var *varPtr, char *part1, CONST char *part2,
 			    int flags, int *resultTypePtr));
 static void		CleanupVar _ANSI_ARGS_((Var *varPtr,
 			    Var *arrayPtr));
@@ -50,13 +50,13 @@
 			    char *arrayName, Var *varPtr, int flags));
 static int		MakeUpvar _ANSI_ARGS_((
 			    Interp *iPtr, CallFrame *framePtr,
-			    char *otherP1, char *otherP2, int otherFlags,
+			    char *otherP1, CONST char *otherP2, int otherFlags,
 			    CONST char *myName, int myFlags));
 static Var *		NewVar _ANSI_ARGS_((void));
 static ArraySearch *	ParseSearchId _ANSI_ARGS_((Tcl_Interp *interp,
 			    Var *varPtr, char *varName, Tcl_Obj *handleObj));
 static void		VarErrMsg _ANSI_ARGS_((Tcl_Interp *interp,
-			    char *part1, char *part2, char *operation,
+			    char *part1, CONST char *part2, char *operation,
 			    char *reason));
 static int		SetArraySearchObj _ANSI_ARGS_((Tcl_Interp *interp,
 			    Tcl_Obj *objPtr));
@@ -122,7 +122,7 @@
 				 * an array. Otherwise, this
 				 * is a full variable name that could
 				 * include a parenthesized array element. */
-    char *part2;		/* Name of element within array, or NULL. */
+    CONST char *part2;		/* Name of element within array, or NULL. */
     int flags;			/* Only TCL_GLOBAL_ONLY, TCL_NAMESPACE_ONLY,
 				 * and TCL_LEAVE_ERR_MSG bits matter. */
     char *msg;			/* Verb to use in error messages, e.g.
@@ -150,7 +150,7 @@
     Tcl_Var var;                /* Used to search for global names. */
     Var *varPtr;		/* Points to the Var structure returned for
     				 * the variable. */
-    char *elName;		/* Name of array element or NULL; may be
+    CONST char *elName;		/* Name of array element or NULL; may be
 				 * same as part2, or may be openParen+1. */
     char *openParen, *closeParen;
                                 /* If this procedure parses a name into
@@ -515,7 +515,7 @@
 				 * to be looked up. */
     char *part1;		/* Name of an array (if part2 is non-NULL)
 				 * or the name of a variable. */
-    char *part2;		/* If non-NULL, gives the name of an element
+    CONST char *part2;		/* If non-NULL, gives the name of an element
 				 * in the array part1. */
     int flags;			/* OR-ed combination of TCL_GLOBAL_ONLY,
 				 * TCL_NAMESPACE_ONLY and TCL_LEAVE_ERR_MSG
@@ -606,7 +606,7 @@
 				 * to be looked up. */
     char *part1;		/* Name of an array (if part2 is non-NULL)
 				 * or the name of a variable. */
-    char *part2;		/* If non-NULL, gives the name of an element
+    CONST char *part2;		/* If non-NULL, gives the name of an element
 				 * in the array part1. */
     int flags;			/* OR-ed combination of TCL_GLOBAL_ONLY,
 				 * and TCL_LEAVE_ERR_MSG bits. */
@@ -1111,7 +1111,7 @@
     char *part1;                /* If part2 is NULL, this is name of scalar
                                  * variable. Otherwise it is the name of
                                  * an array. */
-    char *part2;                /* Name of an element within an array, or
+    CONST char *part2;		/* Name of an element within an array, or
 				 * NULL. */
     CONST char *newValue;       /* New value for variable. */
     int flags;                  /* Various flags that tell how to set value:
@@ -1236,7 +1236,7 @@
 				 * to be found. */
     char *part1;		/* Name of an array (if part2 is non-NULL)
 				 * or the name of a variable. */
-    char *part2;		/* If non-NULL, gives the name of an element
+    CONST char *part2;		/* If non-NULL, gives the name of an element
 				 * in the array part1. */
     Tcl_Obj *newValuePtr;	/* New value for variable. */
     int flags;			/* Various flags that tell how to set value:
@@ -2360,7 +2360,7 @@
     Tcl_Interp *interp;		/* Command interpreter in which varName is
 				 * to be looked up. */
     char *part1;		/* Name of variable or array. */
-    char *part2;		/* Name of element within array or NULL. */
+    CONST char *part2;		/* Name of element within array or NULL. */
     int flags;			/* OR-ed combination of any of
 				 * TCL_GLOBAL_ONLY, TCL_NAMESPACE_ONLY,
 				 * TCL_LEAVE_ERR_MSG. */
@@ -2574,7 +2574,7 @@
     Tcl_Interp *interp;		/* Interpreter in which variable is
 				 * to be traced. */
     char *part1;		/* Name of scalar variable or array. */
-    char *part2;		/* Name of element within array;  NULL means
+    CONST char *part2;		/* Name of element within array;  NULL means
 				 * trace applies to scalar variable or array
 				 * as-a-whole. */
     int flags;			/* OR-ed collection of bits, including any
@@ -2686,7 +2686,7 @@
 Tcl_UntraceVar2(interp, part1, part2, flags, proc, clientData)
     Tcl_Interp *interp;		/* Interpreter containing variable. */
     char *part1;		/* Name of variable or array. */
-    char *part2;		/* Name of element within array;  NULL means
+    CONST char *part2;		/* Name of element within array;  NULL means
 				 * trace applies to scalar variable or array
 				 * as-a-whole. */
     int flags;			/* OR-ed collection of bits describing
@@ -2832,7 +2832,7 @@
 Tcl_VarTraceInfo2(interp, part1, part2, flags, proc, prevClientData)
     Tcl_Interp *interp;		/* Interpreter containing variable. */
     char *part1;		/* Name of variable or array. */
-    char *part2;		/* Name of element within array;  NULL means
+    CONST char *part2;		/* Name of element within array;  NULL means
 				 * trace applies to scalar variable or array
 				 * as-a-whole. */
     int flags;			/* OR-ed combination of TCL_GLOBAL_ONLY,
@@ -3848,7 +3848,8 @@
 				 * for error messages, too. */
     CallFrame *framePtr;	/* Call frame containing "other" variable.
 				 * NULL means use global :: context. */
-    char *otherP1, *otherP2;	/* Two-part name of variable in framePtr. */
+    char *otherP1;
+    CONST char *otherP2;	/* Two-part name of variable in framePtr. */
     int otherFlags;		/* 0, TCL_GLOBAL_ONLY or TCL_NAMESPACE_ONLY:
 				 * indicates scope of "other" variable. */
     CONST char *myName;		/* Name of variable which will refer to
@@ -4121,7 +4122,8 @@
 				 * for error messages too. */
     CONST char *frameName;	/* Name of the frame containing the source
 				 * variable, such as "1" or "#0". */
-    char *part1, *part2;	/* Two parts of source variable name to
+    char *part1;
+    CONST char *part2;		/* Two parts of source variable name to
 				 * link to. */
     CONST char *localName;	/* Name of link variable. */
     int flags;			/* 0, TCL_GLOBAL_ONLY or TCL_NAMESPACE_ONLY:
@@ -4547,7 +4549,8 @@
 				 * isn't an element of an array. */
     Var *varPtr;		/* Variable whose traces are to be
 				 * invoked. */
-    char *part1, *part2;	/* Variable's two-part name. */
+    char *part1;
+    CONST char *part2;		/* Variable's two-part name. */
     int flags;			/* Flags passed to trace procedures:
 				 * indicates what's happening to variable,
 				 * plus other stuff like TCL_GLOBAL_ONLY,
@@ -4595,12 +4598,12 @@
 		} while (*p != '\0');
 		p--;
 		if (*p == ')') {
+		    int offset = (openParen - part1);
 		    Tcl_DStringInit(&nameCopy);
 		    Tcl_DStringAppend(&nameCopy, part1, (p-part1));
-		    part2 = Tcl_DStringValue(&nameCopy)
-			+ (openParen + 1 - part1);
-		    part2[-1] = 0;
+		    part2 = Tcl_DStringValue(&nameCopy) + offset + 1;
 		    part1 = Tcl_DStringValue(&nameCopy);
+		    part1[offset] = 0;
 		    copiedName = 1;
 		}
 		break;
@@ -5344,7 +5347,8 @@
 static void
 VarErrMsg(interp, part1, part2, operation, reason)
     Tcl_Interp *interp;         /* Interpreter in which to record message. */
-    char *part1, *part2;        /* Variable's two-part name. */
+    char *part1;
+    CONST char *part2;		/* Variable's two-part name. */
     char *operation;            /* String describing operation that failed,
                                  * e.g. "read", "set", or "unset". */
     char *reason;               /* String describing why operation failed. */
