Index: generic/tclCompile.h
===================================================================
RCS file: /cvsroot/tcl/tcl/generic/tclCompile.h,v
retrieving revision 1.31
diff -u -2 -r1.31 tclCompile.h
--- generic/tclCompile.h	7 Aug 2002 15:50:29 -0000	1.31
+++ generic/tclCompile.h	9 Sep 2002 01:00:47 -0000
@@ -820,4 +820,6 @@
 			    CompileEnv *envPtr));
 #endif
+EXTERN int		TclCompileVariableCmd _ANSI_ARGS_((
+			    Tcl_Interp *interp, Tcl_Parse *parsePtr, CompileEnv *envPtr));
 
 /*
Index: generic/tclInitScript.h
===================================================================
RCS file: /cvsroot/tcl/tcl/generic/tclInitScript.h,v
retrieving revision 1.13
diff -u -2 -r1.13 tclInitScript.h
--- generic/tclInitScript.h	10 Sep 2001 21:06:55 -0000	1.13
+++ generic/tclInitScript.h	9 Sep 2002 01:00:47 -0000
@@ -12,4 +12,6 @@
  */
 
+EXTERN char * TclSetPreInitScript _ANSI_ARGS_((char *string));
+
 /*
  * In order to find init.tcl during initialization, the following script
Index: mac/tclMacFCmd.c
===================================================================
RCS file: /cvsroot/tcl/tcl/mac/tclMacFCmd.c,v
retrieving revision 1.17
diff -u -2 -r1.17 tclMacFCmd.c
--- mac/tclMacFCmd.c	19 Apr 2002 14:18:45 -0000	1.17
+++ mac/tclMacFCmd.c	9 Sep 2002 01:00:49 -0000
@@ -67,4 +67,8 @@
 
 
+/* file-sprecific data, jcw 05-09-2002 */
+
+static long startSeed = 248923489;
+
 /*
  * Prototypes for procedure only used in this file
@@ -88,6 +92,4 @@
 OSErr			FSpGetFLockCompat _ANSI_ARGS_((const FSSpec *specPtr, 
 			    Boolean *lockedPtr));
-static OSErr		GenerateUniqueName _ANSI_ARGS_((short vRefNum, 
-			    long dirID1, long dirID2, Str31 uniqueName));
 static OSErr		GetFileSpecs _ANSI_ARGS_((CONST char *path, 
 			    FSSpec *pathSpecPtr, FSSpec *dirSpecPtr,	
@@ -219,5 +221,5 @@
 	        FSSpec tmpFileSpec;
 
-	        err = GenerateUniqueName(dstFileSpec.vRefNum, 
+	        err = GenerateUniqueName(dstFileSpec.vRefNum, &startSeed,
 	        	dstFileSpec.parID, dstFileSpec.parID, tmpName);
 	        if (err == noErr) {
@@ -335,5 +337,5 @@
          */
           
-        err = GenerateUniqueName(srcFileSpecPtr->vRefNum, 
+        err = GenerateUniqueName(srcFileSpecPtr->vRefNum, &startSeed,
        		srcFileSpecPtr->parID, dstID, tmpName);
         FSMakeFSSpecCompat(srcFileSpecPtr->vRefNum, srcFileSpecPtr->parID,
@@ -437,5 +439,5 @@
          */
          
-        dstErr = GenerateUniqueName(dstFileSpec.vRefNum, dstFileSpec.parID, 
+        dstErr = GenerateUniqueName(dstFileSpec.vRefNum, &startSeed, dstFileSpec.parID, 
     	        dstFileSpec.parID, tmpName);
         if (dstErr == noErr) {
@@ -708,5 +710,5 @@
     }
     if (err == noErr) {
-        err = GenerateUniqueName(dstFileSpec.vRefNum, dstFileSpec.parID, 
+        err = GenerateUniqueName(dstFileSpec.vRefNum, &startSeed, dstFileSpec.parID, 
     	        dstFileSpec.parID, tmpName);
     }
@@ -932,67 +934,4 @@
 }
 			    
-/*
- *---------------------------------------------------------------------------
- *
- * GenerateUniqueName --
- *
- * 	Generate a filename that is not in either of the two specified
- *	directories (on the same volume). 
- *
- * Results:
- *	Standard macintosh error.  On success, uniqueName is filled with 
- *	the name of the temporary file.
- *
- * Side effects:
- *	None.
- *
- *---------------------------------------------------------------------------
- */ 
- 
-static OSErr
-GenerateUniqueName(
-    short vRefNum,		/* Volume on which the following directories
-    				 * are located. */		
-    long dirID1,		/* ID of first directory. */
-    long dirID2,		/* ID of second directory.  May be the same
-    				 * as the first. */
-    Str31 uniqueName)		/* Filled with filename for a file that is
-    				 * not located in either of the above two
-    				 * directories. */
-{
-    OSErr err;
-    long i;
-    CInfoPBRec pb;
-    static unsigned char hexStr[16] = "0123456789ABCDEF";
-    static long startSeed = 248923489;
-    
-    pb.hFileInfo.ioVRefNum = vRefNum;
-    pb.hFileInfo.ioFDirIndex = 0;
-    pb.hFileInfo.ioNamePtr = uniqueName;
-
-    while (1) {
-        startSeed++;		
-	pb.hFileInfo.ioNamePtr[0] = 8;
-	for (i = 1; i <= 8; i++) {
-	    pb.hFileInfo.ioNamePtr[i] = hexStr[((startSeed >> ((8-i)*4)) & 0xf)];
-	}
-	pb.hFileInfo.ioDirID = dirID1;
-	err = PBGetCatInfoSync(&pb);
-	if (err == fnfErr) {
-	    if (dirID1 != dirID2) {
-		pb.hFileInfo.ioDirID = dirID2;
-		err = PBGetCatInfoSync(&pb);
-	    }
-	    if (err == fnfErr) {
-	        return noErr;
-	    }
-	}
-	if (err == noErr) {
-	    continue;
-	} 
-	return err;
-    }
-} 
-
 /*
  *---------------------------------------------------------------------------
Index: mac/tclMacFile.c
===================================================================
RCS file: /cvsroot/tcl/tcl/mac/tclMacFile.c,v
retrieving revision 1.24
diff -u -2 -r1.24 tclMacFile.c
--- mac/tclMacFile.c	15 Jul 2002 10:28:18 -0000	1.24
+++ mac/tclMacFile.c	9 Sep 2002 01:00:51 -0000
@@ -1173,5 +1173,5 @@
 	    FSSpec linkSpec;
 	    OSErr err;
-	    char *path;
+	    CONST char *path;
 	    AliasHandle alias;
 	    
Index: mac/tclMacLoad.c
===================================================================
RCS file: /cvsroot/tcl/tcl/mac/tclMacLoad.c,v
retrieving revision 1.15
diff -u -2 -r1.15 tclMacLoad.c
--- mac/tclMacLoad.c	18 Jul 2002 16:26:04 -0000	1.15
+++ mac/tclMacLoad.c	9 Sep 2002 01:00:51 -0000
@@ -94,5 +94,5 @@
 
 static int TryToLoad(Tcl_Interp *interp, TclMacLoadInfo *loadInfo, 
-		     CONST char *sym /* native */) 
+		     CONST char *sym /* native */);
 
 
@@ -124,5 +124,5 @@
 				 * file which will be passed back to 
 				 * (*unloadProcPtr)() to unload the file. */
-    Tcl_FSUnloadFileProc **unloadProcPtr)
+    Tcl_FSUnloadFileProc **unloadProcPtr;
 				/* Filled with address of Tcl_FSUnloadFileProc
 				 * function which should be used for
@@ -131,5 +131,4 @@
     OSErr err;
     FSSpec fileSpec;
-    Tcl_DString ds;
     CONST char *native;
     TclMacLoadInfo *loadInfo;
@@ -149,5 +148,5 @@
     
     if (TryToLoad(interp, loadInfo, NULL) != TCL_OK) {
-	ckfree(loadInfo);
+	ckfree((char*) loadInfo);
 	return TCL_ERROR;
     }
@@ -175,5 +174,7 @@
     Str255 errName;
     StringPtr fragName=NULL;
-
+    FSSpec fileSpec; /* added, BUT NOT INITED, this is WRONG ... jcw, 05-09-2002 */
+    OSErr err;
+    
     if (loadInfo->loaded == 1) {
         return TCL_OK;
@@ -244,5 +245,5 @@
 	p2cstr(errName);
 	Tcl_AppendResult(interp, "couldn't load file \"", 
-			 Tcl_GetString(pathPtr),
+			 "?" /* Tcl_GetString(pathPtr) NO SUCH VAR HERE jcw, 05-09-2002 */,
 			 "\": ", errName, (char *) NULL);
 	return TCL_ERROR;
@@ -341,5 +342,5 @@
 	CloseConnection((CFragConnectionID*) &(loadInfo->connID));
     }
-    ckfree(loadInfo);
+    ckfree((char*) loadInfo);
 }
 
Index: mac/tclMacOSA.c
===================================================================
RCS file: /cvsroot/tcl/tcl/mac/tclMacOSA.c,v
retrieving revision 1.9
diff -u -2 -r1.9 tclMacOSA.c
--- mac/tclMacOSA.c	8 Apr 2002 09:02:48 -0000	1.9
+++ mac/tclMacOSA.c	9 Sep 2002 01:00:54 -0000
@@ -79,25 +79,25 @@
 static int		TclOSACompileCmd _ANSI_ARGS_((Tcl_Interp *interp,
 		 	    tclOSAComponent *OSAComponent, int argc,
-			    char **argv));
+			    CONST char **argv));
 static int 		tclOSADecompileCmd _ANSI_ARGS_((Tcl_Interp * Interp,
 			    tclOSAComponent *OSAComponent, int argc,
-			    char **argv));
+			    CONST char **argv));
 static int 		tclOSADeleteCmd _ANSI_ARGS_((Tcl_Interp *interp,
 			    tclOSAComponent *OSAComponent, int argc,
-			    char **argv));
+			    CONST char **argv));
 static int 		tclOSAExecuteCmd _ANSI_ARGS_((Tcl_Interp *interp,
 			    tclOSAComponent *OSAComponent, int argc,
-			    char **argv));
+			    CONST char **argv));
 static int 		tclOSAInfoCmd _ANSI_ARGS_((Tcl_Interp *interp,
 			    tclOSAComponent *OSAComponent, int argc,
-			    char **argv));
+			    CONST char **argv));
 static int 		tclOSALoadCmd _ANSI_ARGS_((Tcl_Interp *interp,
 			    tclOSAComponent *OSAComponent, int argc,
-			    char **argv));
+			    CONST char **argv));
 static int 		tclOSARunCmd _ANSI_ARGS_((Tcl_Interp *interp,
 			    tclOSAComponent *OSAComponent, int argc,
-			    char **argv));
+			    CONST char **argv));
 static int 		tclOSAStoreCmd _ANSI_ARGS_((Tcl_Interp *interp,
-			    tclOSAComponent *OSAComponent, int argc, char
+			    tclOSAComponent *OSAComponent, int argc, CONST char
 			    **argv));
 static void		GetRawDataFromDescriptor _ANSI_ARGS_((AEDesc *theDesc,
@@ -107,11 +107,11 @@
 			    Size resultMaxSize,Size *resultSize));
 static int 		Tcl_OSAComponentCmd _ANSI_ARGS_((ClientData clientData,
-			    Tcl_Interp *interp, int argc, char **argv)); 
+			    Tcl_Interp *interp, int argc, CONST char **argv)); 
 static void 		getSortedHashKeys _ANSI_ARGS_((Tcl_HashTable *theTable,
-			    char *pattern, Tcl_DString *theResult));
+			    CONST char *pattern, Tcl_DString *theResult));
 static int 		ASCIICompareProc _ANSI_ARGS_((const void *first,
 			    const void *second));
 static int 		Tcl_OSACmd _ANSI_ARGS_((ClientData clientData,
-			    Tcl_Interp *interp, int argc, char **argv)); 
+			    Tcl_Interp *interp, int argc, CONST char **argv)); 
 static void 		tclOSAClose _ANSI_ARGS_((ClientData clientData));
 static void 		tclOSACloseAll _ANSI_ARGS_((ClientData clientData));
@@ -119,5 +119,5 @@
 			    char *cmdName, char *languageName,
 			    OSType scriptSubtype, long componentFlags));  
-static int 		prepareScriptData _ANSI_ARGS_((int argc, char **argv,
+static int 		prepareScriptData _ANSI_ARGS_((int argc, CONST char **argv,
 			    Tcl_DString *scrptData ,AEDesc *scrptDesc)); 
 static void 		tclOSAResultFromID _ANSI_ARGS_((Tcl_Interp *interp,
@@ -126,25 +126,25 @@
 			    ComponentInstance theComponent, char *scriptSource));
 static int 		tclOSAGetContextID _ANSI_ARGS_((tclOSAComponent *theComponent, 
-			    char *contextName, OSAID *theContext));
+			    CONST char *contextName, OSAID *theContext));
 static void 		tclOSAAddContext _ANSI_ARGS_((tclOSAComponent *theComponent, 
-			    char *contextName, const OSAID theContext));						
+			    CONST char *contextName, const OSAID theContext));						
 static int 		tclOSAMakeContext _ANSI_ARGS_((tclOSAComponent *theComponent, 
-			    char *contextName, OSAID *theContext));						
+			    CONST char *contextName, OSAID *theContext));						
 static int 		tclOSADeleteContext _ANSI_ARGS_((tclOSAComponent *theComponent,
-			    char *contextName)); 
+			    CONST char *contextName)); 
 static int 		tclOSALoad _ANSI_ARGS_((Tcl_Interp *interp, 
-			    tclOSAComponent *theComponent, char *resourceName, 
-			    int resourceNumber, char *fileName,OSAID *resultID));
+			    tclOSAComponent *theComponent, CONST char *resourceName, 
+			    int resourceNumber, CONST char *fileName,OSAID *resultID));
 static int 		tclOSAStore _ANSI_ARGS_((Tcl_Interp *interp, 
-			    tclOSAComponent *theComponent, char *resourceName, 
-			    int resourceNumber, char *fileName,char *scriptName));
+			    tclOSAComponent *theComponent, CONST char *resourceName, 
+			    int resourceNumber, CONST char *fileName, CONST char *scriptName));
 static int 		tclOSAAddScript _ANSI_ARGS_((tclOSAComponent *theComponent,
-			    char *scriptName, long modeFlags, OSAID scriptID)); 		
+			    CONST char *scriptName, long modeFlags, OSAID scriptID)); 		
 static int 		tclOSAGetScriptID _ANSI_ARGS_((tclOSAComponent *theComponent,
-			    char *scriptName, OSAID *scriptID)); 
+			    CONST char *scriptName, OSAID *scriptID)); 
 static tclOSAScript *	tclOSAGetScript _ANSI_ARGS_((tclOSAComponent *theComponent,
-			    char *scriptName)); 
+			    CONST char *scriptName)); 
 static int 		tclOSADeleteScript _ANSI_ARGS_((tclOSAComponent *theComponent,
-			    char *scriptName,char *errMsg));
+			    CONST char *scriptName,char *errMsg));
 
 /*
@@ -358,5 +358,5 @@
     Tcl_Interp *interp,
     int argc,
-    char **argv)
+    CONST char **argv)
 {
     static unsigned short componentCmdIndex = 0;
@@ -582,5 +582,5 @@
     Tcl_Interp *interp, 
     int argc,
-    char **argv)
+    CONST char **argv)
 {
     int length;
@@ -649,5 +649,5 @@
     tclOSAComponent *OSAComponent,
     int argc,
-    char **argv)
+    CONST char **argv)
 {
     int  tclError = TCL_OK;
@@ -657,5 +657,5 @@
     char autoName[16];
     char buffer[32];
-    char *resultName;
+    CONST char *resultName;
     Boolean makeNewContext = false;
     Tcl_DString scrptData;
@@ -853,5 +853,5 @@
 		}
 				
-		Tcl_SetResult(interp, resultName, TCL_VOLATILE);
+		Tcl_SetResult(interp, (char*) resultName, TCL_VOLATILE);
 		tclError = TCL_OK;
 	    }
@@ -861,5 +861,5 @@
 	     */
 	    tclOSAAddScript(OSAComponent, resultName, modeFlags, resultID);
-	    Tcl_SetResult(interp, resultName, TCL_VOLATILE);
+	    Tcl_SetResult(interp, (char*) resultName, TCL_VOLATILE);
 	    tclError = TCL_OK;	
 	}
@@ -910,5 +910,5 @@
     tclOSAComponent *OSAComponent,
     int argc, 
-    char **argv)
+    CONST char **argv)
 {
     AEDesc resultingSourceData = { typeChar, NULL };
@@ -987,5 +987,5 @@
     tclOSAComponent *OSAComponent,
     int argc,
-    char **argv)
+    CONST char **argv)
 {
     char c,*errMsg = NULL;
@@ -1050,5 +1050,5 @@
     tclOSAComponent *OSAComponent,
     int argc,
-    char **argv)
+    CONST char **argv)
 {
     int tclError = TCL_OK, resID = 128;
@@ -1214,5 +1214,5 @@
     tclOSAComponent *OSAComponent,
     int argc, 
-    char **argv)
+    CONST char **argv)
 {
     char c;
@@ -1294,9 +1294,10 @@
     tclOSAComponent *OSAComponent,
     int argc,
-    char **argv)
+    CONST char **argv)
 {
     int tclError = TCL_OK, resID = 128;
     char c, autoName[24],
-	*contextName = NULL, *scriptName = NULL, *resName = NULL;
+	*contextName = NULL, *scriptName = NULL;
+    CONST char *resName = NULL;
     Boolean makeNewContext = false, makeContext = false;
     AEDesc scrptDesc = { typeNull, NULL };
@@ -1432,5 +1433,5 @@
     tclOSAComponent *OSAComponent,
     int argc,
-    char **argv)
+    CONST char **argv)
 {
     int tclError = TCL_OK,
@@ -1446,5 +1447,5 @@
     OSAError osaErr = noErr;
     OSErr sysErr = noErr;
-    char *componentName = argv[0];
+    CONST char *componentName = argv[0];
     OSAID scriptID;
 	
@@ -1568,8 +1569,9 @@
     tclOSAComponent *OSAComponent,
     int argc,
-    char **argv)
+    CONST char **argv)
 {
     int tclError = TCL_OK, resID = 128;
-    char c, *contextName = NULL, *scriptName = NULL, *resName = NULL;
+    char c, *contextName = NULL, *scriptName = NULL;
+    CONST char *resName = NULL;
     Boolean makeNewContext = false, makeContext = false;
     AEDesc scrptDesc = { typeNull, NULL };
@@ -1887,5 +1889,5 @@
 tclOSAGetContextID(
     tclOSAComponent *theComponent, 
-    char *contextName, 
+    CONST char *contextName, 
     OSAID *theContext)
 {
@@ -1926,5 +1928,5 @@
 tclOSAAddContext(
     tclOSAComponent *theComponent, 
-    char *contextName,
+    CONST char *contextName,
     const OSAID theContext)
 {
@@ -1936,7 +1938,7 @@
     if (contextName == NULL) {
 	contextName = ckalloc(16 + TCL_INTEGER_SPACE);
-	sprintf(contextName, "OSAContext%d", contextIndex++);
+	sprintf((char*) contextName, "OSAContext%d", contextIndex++);
     } else if (*contextName == '\0') {
-	sprintf(contextName, "OSAContext%d", contextIndex++);
+	sprintf((char*) contextName, "OSAContext%d", contextIndex++);
     }
 	
@@ -1969,5 +1971,5 @@
 tclOSADeleteContext(
     tclOSAComponent *theComponent,
-    char *contextName) 
+    CONST char *contextName) 
 {
     Tcl_HashEntry *hashEntry;
@@ -2011,5 +2013,5 @@
 tclOSAMakeContext(
     tclOSAComponent *theComponent, 
-    char *contextName,
+    CONST char *contextName,
     OSAID *theContext)
 {
@@ -2057,8 +2059,8 @@
     Tcl_Interp *interp,
     tclOSAComponent *theComponent,
-    char *resourceName,
+    CONST char *resourceName,
     int resourceNumber, 
-    char *scriptName,
-    char *fileName)
+    CONST char *scriptName,
+    CONST char *fileName)
 {
     Handle resHandle;
@@ -2277,7 +2279,7 @@
     Tcl_Interp *interp,
     tclOSAComponent *theComponent,
-    char *resourceName,
+    CONST char *resourceName,
     int resourceNumber, 
-    char *fileName,
+    CONST char *fileName,
     OSAID *resultID)
 {
@@ -2398,5 +2400,5 @@
 tclOSAGetScriptID(
     tclOSAComponent *theComponent,
-    char *scriptName,
+    CONST char *scriptName,
     OSAID *scriptID) 
 {
@@ -2432,5 +2434,5 @@
 tclOSAAddScript(
     tclOSAComponent *theComponent,
-    char *scriptName,
+    CONST char *scriptName,
     long modeFlags,
     OSAID scriptID) 
@@ -2442,5 +2444,5 @@
 	
     if (*scriptName == '\0') {
-	sprintf(scriptName, "OSAScript%d", scriptIndex++);
+	sprintf((char*) scriptName, "OSAScript%d", scriptIndex++);
     }
 	
@@ -2485,5 +2487,5 @@
 tclOSAGetScript(
     tclOSAComponent *theComponent,
-    char *scriptName)
+    CONST char *scriptName)
 {
     Tcl_HashEntry *hashEntry;
@@ -2519,5 +2521,5 @@
 tclOSADeleteScript(
     tclOSAComponent *theComponent,
-    char *scriptName,
+    CONST char *scriptName,
     char *errMsg) 
 {
@@ -2622,5 +2624,5 @@
 getSortedHashKeys(
     Tcl_HashTable *theTable,
-    char *pattern,
+    CONST char *pattern,
     Tcl_DString *theResult)
 {
@@ -2690,5 +2692,5 @@
 prepareScriptData(
     int argc,
-    char **argv,
+    CONST char **argv,
     Tcl_DString *scrptData,
     AEDesc *scrptDesc) 
Index: mac/tclMacTest.c
===================================================================
RCS file: /cvsroot/tcl/tcl/mac/tclMacTest.c,v
retrieving revision 1.5
diff -u -2 -r1.5 tclMacTest.c
--- mac/tclMacTest.c	5 Aug 2002 03:24:41 -0000	1.5
+++ mac/tclMacTest.c	9 Sep 2002 01:00:54 -0000
@@ -31,7 +31,7 @@
 int			TclplatformtestInit _ANSI_ARGS_((Tcl_Interp *interp));
 static int		DebuggerCmd _ANSI_ARGS_((ClientData dummy,
-			    Tcl_Interp *interp, int argc, char **argv));
+			    Tcl_Interp *interp, int argc, CONST char **argv));
 static int		WriteTextResource _ANSI_ARGS_((ClientData dummy,
-			    Tcl_Interp *interp, int argc, char **argv));
+			    Tcl_Interp *interp, int argc, CONST char **argv));
 			    
 
@@ -90,5 +90,5 @@
     Tcl_Interp *interp,			/* Not used. */
     int argc,				/* Not used. */
-    char **argv)			/* Not used. */
+    CONST char **argv)			/* Not used. */
 {
     Debugger();
@@ -119,11 +119,12 @@
     Tcl_Interp *interp,			/* Current interpreter. */
     int argc,				/* Number of arguments. */
-    char **argv)			/* Argument strings. */
+    CONST char **argv)			/* Argument strings. */
 {
     char *errNum = "wrong # args: ";
     char *errBad = "bad argument: ";
     char *errStr;
-    char *fileName = NULL, *rsrcName = NULL;
-    char *data = NULL;
+    CONST char *fileName = NULL;
+    CONST char *rsrcName = NULL;
+    CONST char *data = NULL;
     int rsrcID = -1, i, protectIt = 0;
     short fileRef = -1;
Index: mac/tclMacUnix.c
===================================================================
RCS file: /cvsroot/tcl/tcl/mac/tclMacUnix.c,v
retrieving revision 1.4
diff -u -2 -r1.4 tclMacUnix.c
--- mac/tclMacUnix.c	23 Nov 2001 01:28:46 -0000	1.4
+++ mac/tclMacUnix.c	9 Sep 2002 01:00:54 -0000
@@ -75,5 +75,5 @@
     Tcl_Interp *interp,			/* Current interpreter. */
     int argc,				/* Number of arguments. */
-    char **argv)			/* Argument strings. */
+    CONST char **argv)			/* Argument strings. */
 {
     Tcl_Channel chan;
