*** generic/regc_cvec.c	1999/10/13 02:22:17	1.4
--- generic/regc_cvec.c	2002/01/29 06:41:31
***************
*** 120,127 ****
  chr *startp;			/* beginning of text */
  chr *endp;			/* just past end of text */
  {
! 	int len;
! 	int i;
  	chr *s;
  	chr *d;
  
--- 120,127 ----
  chr *startp;			/* beginning of text */
  chr *endp;			/* just past end of text */
  {
! 	size_t len;
! 	size_t i;
  	chr *s;
  	chr *d;
  
***************
*** 172,178 ****
  int nranges;			/* ... and this many ranges... */
  int nmcces;			/* ... and this many MCCEs */
  {
! 	if (v->cv != NULL && nchrs <= v->cv->chrspace &&
  					nranges <= v->cv->rangespace &&
  					nmcces <= v->cv->mccespace)
  		return clearcvec(v->cv);
--- 172,178 ----
  int nranges;			/* ... and this many ranges... */
  int nmcces;			/* ... and this many MCCEs */
  {
! 	if (v->cv != NULL && nchrs <= (int) v->cv->chrspace &&
  					nranges <= v->cv->rangespace &&
  					nmcces <= v->cv->mccespace)
  		return clearcvec(v->cv);

*** generic/regcustom.h	1999/10/13 02:22:17	1.4
--- generic/regcustom.h	2002/01/29 06:41:33
***************
*** 69,75 ****
  #endif
  /* interface types */
  #define	__REG_WIDE_T	Tcl_UniChar
! #define	__REG_REGOFF_T	long	/* not really right, but good enough... */
  #define	__REG_VOID_T	VOID
  #define	__REG_CONST	CONST
  /* names and declarations */
--- 69,75 ----
  #endif
  /* interface types */
  #define	__REG_WIDE_T	Tcl_UniChar
! #define	__REG_REGOFF_T	size_t	/* not really right, but good enough... */
  #define	__REG_VOID_T	VOID
  #define	__REG_CONST	CONST
  /* names and declarations */

*** generic/rege_dfa.c	1999/08/05 01:16:57	1.6
--- generic/rege_dfa.c	2002/01/29 06:41:35
***************
*** 266,272 ****
  {
  	struct dfa *d;
  	size_t nss = cnfa->nstates * 2;
! 	int wordsper = (cnfa->nstates + UBITS - 1) / UBITS;
  	struct smalldfa *smallwas = small;
  
  	assert(cnfa != NULL && cnfa->nstates != 0);
--- 266,272 ----
  {
  	struct dfa *d;
  	size_t nss = cnfa->nstates * 2;
! 	int wordsper = (int)(cnfa->nstates + UBITS - 1) / UBITS;
  	struct smalldfa *smallwas = small;
  
  	assert(cnfa != NULL && cnfa->nstates != 0);
***************
*** 313,319 ****
  		}
  	}
  
! 	d->nssets = (v->eflags&REG_SMALL) ? 7 : nss;
  	d->nssused = 0;
  	d->nstates = cnfa->nstates;
  	d->ncolors = cnfa->ncolors;
--- 313,319 ----
  		}
  	}
  
! 	d->nssets = (v->eflags&REG_SMALL) ? 7 : (int) nss;
  	d->nssused = 0;
  	d->nstates = cnfa->nstates;
  	d->ncolors = cnfa->ncolors;
***************
*** 421,427 ****
  chr *start;			/* where the attempt got started */
  {
  	struct cnfa *cnfa = d->cnfa;
! 	int i;
  	unsigned h;
  	struct carc *ca;
  	struct sset *p;
--- 421,427 ----
  chr *start;			/* where the attempt got started */
  {
  	struct cnfa *cnfa = d->cnfa;
! 	size_t i;
  	unsigned h;
  	struct carc *ca;
  	struct sset *p;
***************
*** 439,445 ****
  	FDEBUG(("miss\n"));
  
  	/* first, what set of states would we end up in? */
! 	for (i = 0; i < d->wordsper; i++)
  		d->work[i] = 0;
  	ispost = 0;
  	noprogress = 1;
--- 439,445 ----
  	FDEBUG(("miss\n"));
  
  	/* first, what set of states would we end up in? */
! 	for (i = 0; i < (size_t) d->wordsper; i++)
  		d->work[i] = 0;
  	ispost = 0;
  	noprogress = 1;
***************
*** 493,499 ****
  	if (i == 0) {		/* nope, need a new cache entry */
  		p = getvacant(v, d, cp, start);
  		assert(p != css);
! 		for (i = 0; i < d->wordsper; i++)
  			p->states[i] = d->work[i];
  		p->hash = h;
  		p->flags = (ispost) ? POSTSTATE : 0;
--- 493,499 ----
  	if (i == 0) {		/* nope, need a new cache entry */
  		p = getvacant(v, d, cp, start);
  		assert(p != css);
! 		for (i = 0; i < (size_t) d->wordsper; i++)
  			p->states[i] = d->work[i];
  		p->hash = h;
  		p->flags = (ispost) ? POSTSTATE : 0;

*** generic/regex.h	1999/10/13 02:22:17	1.5
--- generic/regex.h	2002/01/29 06:41:38
***************
*** 109,115 ****
  #endif
  /* interface types */
  #define	__REG_WIDE_T	Tcl_UniChar
! #define	__REG_REGOFF_T	long	/* not really right, but good enough... */
  #define	__REG_VOID_T	VOID
  #define	__REG_CONST	CONST
  /* names and declarations */
--- 109,115 ----
  #endif
  /* interface types */
  #define	__REG_WIDE_T	Tcl_UniChar
! #define	__REG_REGOFF_T	size_t	/* not really right, but good enough... */
  #define	__REG_VOID_T	VOID
  #define	__REG_CONST	CONST
  /* names and declarations */

*** generic/regexec.c	2000/01/14 00:20:46	1.8
--- generic/regexec.c	2002/01/29 06:41:41
***************
*** 59,65 ****
  struct dfa {
  	int nssets;		/* size of cache */
  	int nssused;		/* how many entries occupied yet */
! 	int nstates;		/* number of states */
  	int ncolors;		/* length of outarc and inchain vectors */
  	int wordsper;		/* length of state-set bitvectors */
  	struct sset *ssets;	/* state-set cache */
--- 59,65 ----
  struct dfa {
  	int nssets;		/* size of cache */
  	int nssused;		/* how many entries occupied yet */
! 	size_t nstates;		/* number of states */
  	int ncolors;		/* length of outarc and inchain vectors */
  	int wordsper;		/* length of state-set bitvectors */
  	struct sset *ssets;	/* state-set cache */

*** generic/regguts.h	1999/10/13 02:22:18	1.5
--- generic/regguts.h	2002/01/29 06:41:44
***************
*** 253,266 ****
   */
  struct cvec {
  	int nchrs;		/* number of chrs */
! 	int chrspace;		/* number of chrs possible */
  	chr *chrs;		/* pointer to vector of chrs */
  	int nranges;		/* number of ranges (chr pairs) */
  	int rangespace;		/* number of chrs possible */
  	chr *ranges;		/* pointer to vector of chr pairs */
  	int nmcces;		/* number of MCCEs */
  	int mccespace;		/* number of MCCEs possible */
! 	int nmccechrs;		/* number of chrs used for MCCEs */
  	chr *mcces[1];		/* pointers to 0-terminated MCCEs */
  				/* and both batches of chrs are on the end */
  };
--- 253,266 ----
   */
  struct cvec {
  	int nchrs;		/* number of chrs */
! 	size_t chrspace;	/* number of chrs possible */
  	chr *chrs;		/* pointer to vector of chrs */
  	int nranges;		/* number of ranges (chr pairs) */
  	int rangespace;		/* number of chrs possible */
  	chr *ranges;		/* pointer to vector of chr pairs */
  	int nmcces;		/* number of MCCEs */
  	int mccespace;		/* number of MCCEs possible */
! 	size_t nmccechrs;	/* number of chrs used for MCCEs */
  	chr *mcces[1];		/* pointers to 0-terminated MCCEs */
  				/* and both batches of chrs are on the end */
  };
***************
*** 339,348 ****
  };
  
  struct cnfa {
! 	int nstates;		/* number of states */
  	int ncolors;		/* number of colors */
  	int flags;
! #		define	HASLACONS	01	/* uses lookahead constraints */
  	int pre;		/* setup state number */
  	int post;		/* teardown state number */
  	color bos[2];		/* colors, if any, assigned to BOS and BOL */
--- 339,348 ----
  };
  
  struct cnfa {
! 	size_t nstates;		/* number of states */
  	int ncolors;		/* number of colors */
  	int flags;
! #   define  HASLACONS	01	/* uses lookahead constraints */
  	int pre;		/* setup state number */
  	int post;		/* teardown state number */
  	color bos[2];		/* colors, if any, assigned to BOS and BOL */

*** generic/tcl.decls	2002/01/25 21:36:09	1.79
--- generic/tcl.decls	2002/01/29 06:41:49
***************
*** 39,60 ****
      void Tcl_Panic(CONST char *format, ...)
  }
  declare 3 generic {
!     char * Tcl_Alloc(unsigned int size)
  }
  declare 4 generic {
      void Tcl_Free(char *ptr)
  }
  declare 5 generic {
!     char * Tcl_Realloc(char *ptr, unsigned int size)
  }
  declare 6 generic {
!     char * Tcl_DbCkalloc(unsigned int size, CONST char *file, int line)
  }
  declare 7 generic {
      int Tcl_DbCkfree(char *ptr, CONST char *file, int line)
  }
  declare 8 generic {
!     char * Tcl_DbCkrealloc(char *ptr, unsigned int size,
                             CONST char *file, int line)
  }
  
--- 39,60 ----
      void Tcl_Panic(CONST char *format, ...)
  }
  declare 3 generic {
!     char * Tcl_Alloc(size_t size)
  }
  declare 4 generic {
      void Tcl_Free(char *ptr)
  }
  declare 5 generic {
!     char * Tcl_Realloc(char *ptr, size_t size)
  }
  declare 6 generic {
!     char * Tcl_DbCkalloc(size_t size, CONST char *file, int line)
  }
  declare 7 generic {
      int Tcl_DbCkfree(char *ptr, CONST char *file, int line)
  }
  declare 8 generic {
!     char * Tcl_DbCkrealloc(char *ptr, size_t size,
                             CONST char *file, int line)
  }
  
***************
*** 1511,1526 ****
  	    int flags, Tcl_CommandTraceProc *proc, ClientData clientData)
  }
  declare 428 generic {
!     char * Tcl_AttemptAlloc(unsigned int size)
  }
  declare 429 generic {
!     char * Tcl_AttemptDbCkalloc(unsigned int size, CONST char *file, int line)
  }
  declare 430 generic {
!     char * Tcl_AttemptRealloc(char *ptr, unsigned int size)
  }
  declare 431 generic {
!     char * Tcl_AttemptDbCkrealloc(char *ptr, unsigned int size,
  	    CONST char *file, int line)
  }
  declare 432 generic {
--- 1511,1526 ----
  	    int flags, Tcl_CommandTraceProc *proc, ClientData clientData)
  }
  declare 428 generic {
!     char * Tcl_AttemptAlloc(size_t size)
  }
  declare 429 generic {
!     char * Tcl_AttemptDbCkalloc(size_t size, CONST char *file, int line)
  }
  declare 430 generic {
!     char * Tcl_AttemptRealloc(char *ptr, size_t size)
  }
  declare 431 generic {
!     char * Tcl_AttemptDbCkrealloc(char *ptr, size_t size,
  	    CONST char *file, int line)
  }
  declare 432 generic {

*** generic/tcl.h	2002/01/25 20:40:55	1.111
--- generic/tcl.h	2002/01/29 06:41:57
***************
*** 89,98 ****
  #   ifndef HAS_STDARG
  #	define HAS_STDARG 1
  #   endif
- #   ifndef USE_PROTOTYPE
- #	define USE_PROTOTYPE 1
- #   endif
- 
  #endif /* __WIN32__ */
  
  /*
--- 89,94 ----
***************
*** 101,107 ****
   */
  
  #ifdef MAC_TCL
! #include <ConditionalMacros.h>
  #   ifndef HAS_STDARG
  #	define HAS_STDARG 1
  #   endif
--- 97,103 ----
   */
  
  #ifdef MAC_TCL
! #   include <ConditionalMacros.h>
  #   ifndef HAS_STDARG
  #	define HAS_STDARG 1
  #   endif
***************
*** 121,147 ****
  
  #define VERBATIM(x) x
  #ifdef _MSC_VER
! # define STRINGIFY(x) STRINGIFY1(x)
! # define STRINGIFY1(x) #x
! # define JOIN(a,b) JOIN1(a,b)
! # define JOIN1(a,b) a##b
  #else
! # ifdef RESOURCE_INCLUDED
! #  define STRINGIFY(x) STRINGIFY1(x)
! #  define STRINGIFY1(x) #x
! #  define JOIN(a,b) JOIN1(a,b)
! #  define JOIN1(a,b) a##b
! # else
! #  ifdef __STDC__
! #   define STRINGIFY(x) #x
! #   define JOIN(a,b) a##b
! #  else
! #   define STRINGIFY(x) "x"
! #   define JOIN(a,b) VERBATIM(a)VERBATIM(b)
! #  endif
! # endif
  #endif
  
  /*
   * Special macro to define mutexes, that doesn't do anything
   * if we are not using threads.
--- 117,152 ----
  
  #define VERBATIM(x) x
  #ifdef _MSC_VER
! #   define STRINGIFY(x) STRINGIFY1(x)
! #   define STRINGIFY1(x) #x
! #   define JOIN(a,b) JOIN1(a,b)
! #   define JOIN1(a,b) a##b
  #else
! #   ifdef RESOURCE_INCLUDED
! #	define STRINGIFY(x) STRINGIFY1(x)
! #	define STRINGIFY1(x) #x
! #	define JOIN(a,b) JOIN1(a,b)
! #	define JOIN1(a,b) a##b
! #   else
! #	ifdef __STDC__
! #	    define STRINGIFY(x) #x
! #	    define JOIN(a,b) a##b
! #	else
! #	    define STRINGIFY(x) "x"
! #	    define JOIN(a,b) VERBATIM(a)VERBATIM(b)
! #	endif
! #   endif
  #endif
  
+ /* 
+  * A special definition used to allow this header file to be included 
+  * in resource files so that they can get obtain version information from
+  * this file.  Resource compilers don't like all the C stuff, like typedefs
+  * and procedure declarations, that occur below.
+  */
+ 
+ #ifndef RESOURCE_INCLUDED
+ 
  /*
   * Special macro to define mutexes, that doesn't do anything
   * if we are not using threads.
***************
*** 167,181 ****
  #define Tcl_ConditionFinalize(condPtr)
  #endif /* TCL_THREADS */
  
- /* 
-  * A special definition used to allow this header file to be included 
-  * in resource files so that they can get obtain version information from
-  * this file.  Resource compilers don't like all the C stuff, like typedefs
-  * and procedure declarations, that occur below.
-  */
- 
- #ifndef RESOURCE_INCLUDED
- 
  #ifndef BUFSIZ
  #include <stdio.h>
  #endif
--- 172,177 ----
***************
*** 249,261 ****
  
  #undef TCL_STORAGE_CLASS
  #ifdef BUILD_tcl
! # define TCL_STORAGE_CLASS DLLEXPORT
  #else
! # ifdef USE_TCL_STUBS
! #  define TCL_STORAGE_CLASS
! # else
! #  define TCL_STORAGE_CLASS DLLIMPORT
! # endif
  #endif
  
  /*
--- 245,257 ----
  
  #undef TCL_STORAGE_CLASS
  #ifdef BUILD_tcl
! #   define TCL_STORAGE_CLASS DLLEXPORT
  #else
! #   ifdef USE_TCL_STUBS
! #	define TCL_STORAGE_CLASS
! #   else
! #	define TCL_STORAGE_CLASS DLLIMPORT
! #   endif
  #endif
  
  /*
***************
*** 325,334 ****
  #endif
  
  #ifndef _CLIENTDATA
! #   if defined(__STDC__) || defined(__cplusplus) || defined(__BORLANDC__)
!     typedef void *ClientData;
  #   else
!     typedef int *ClientData;
  #   endif /* __STDC__ */
  #define _CLIENTDATA
  #endif
--- 321,330 ----
  #endif
  
  #ifndef _CLIENTDATA
! #   if defined(__STDC__) || defined(__cplusplus) || defined(__BORLANDC__) || defined(_MSC_VER)
!     typedef void * ClientData;
  #   else
!     typedef int * ClientData;
  #   endif /* __STDC__ */
  #define _CLIENTDATA
  #endif
***************
*** 409,420 ****
  typedef void (Tcl_ThreadCreateProc) _ANSI_ARGS_((ClientData clientData));
  #endif
  
- 
  /*
   * Threading function return types used for abstracting away platform
   * differences when writing a Tcl_ThreadCreateProc.  See the NewThread
   * function in generic/tclThreadTest.c for it's usage.
   */
  #ifdef MAC_TCL
  #   define Tcl_ThreadCreateType		pascal void *
  #   define TCL_THREAD_CREATE_RETURN	return NULL
--- 405,416 ----
  typedef void (Tcl_ThreadCreateProc) _ANSI_ARGS_((ClientData clientData));
  #endif
  
  /*
   * Threading function return types used for abstracting away platform
   * differences when writing a Tcl_ThreadCreateProc.  See the NewThread
   * function in generic/tclThreadTest.c for it's usage.
   */
+ 
  #ifdef MAC_TCL
  #   define Tcl_ThreadCreateType		pascal void *
  #   define TCL_THREAD_CREATE_RETURN	return NULL
***************
*** 426,433 ****
  #   define TCL_THREAD_CREATE_RETURN	
  #endif
  
- 
- 
  /*
   * Definition of values for default stacksize and the possible flags to be
   * given to Tcl_CreateThread.
--- 422,427 ----
***************
*** 663,669 ****
  				 * Clients should use Tcl_GetStringFromObj
  				 * or Tcl_GetString to get a pointer to the
  				 * byte array as a readonly value. */
!     int length;			/* The number of bytes at *bytes, not
  				 * including the terminating null. */
      Tcl_ObjType *typePtr;	/* Denotes the object's type. Always
  				 * corresponds to the type of the object's
--- 657,663 ----
  				 * Clients should use Tcl_GetStringFromObj
  				 * or Tcl_GetString to get a pointer to the
  				 * byte array as a readonly value. */
!     size_t length;			/* The number of bytes at *bytes, not
  				 * including the terminating null. */
      Tcl_ObjType *typePtr;	/* Denotes the object's type. Always
  				 * corresponds to the type of the object's
***************
*** 691,699 ****
   * expression that is expensive to compute or has side effects.
   */
  
! void		Tcl_IncrRefCount _ANSI_ARGS_((Tcl_Obj *objPtr));
! void		Tcl_DecrRefCount _ANSI_ARGS_((Tcl_Obj *objPtr));
! int		Tcl_IsShared _ANSI_ARGS_((Tcl_Obj *objPtr));
  
  #ifdef TCL_MEM_DEBUG
  #   define Tcl_IncrRefCount(objPtr) \
--- 685,693 ----
   * expression that is expensive to compute or has side effects.
   */
  
! void	Tcl_IncrRefCount _ANSI_ARGS_((Tcl_Obj *objPtr));
! void	Tcl_DecrRefCount _ANSI_ARGS_((Tcl_Obj *objPtr));
! int	Tcl_IsShared _ANSI_ARGS_((Tcl_Obj *objPtr));
  
  #ifdef TCL_MEM_DEBUG
  #   define Tcl_IncrRefCount(objPtr) \
***************
*** 1268,1274 ****
  #define TCL_SERVICE_ALL 1
  
  /*
!  * The following structure keeps is used to hold a time value, either as
   * an absolute time (the number of seconds from the epoch) or as an
   * elapsed time. On Unix systems the epoch is Midnight Jan 1, 1970 GMT.
   * On Macintosh systems the epoch is Midnight Jan 1, 1904 GMT.
--- 1262,1268 ----
  #define TCL_SERVICE_ALL 1
  
  /*
!  * The following structure is used to hold a time value, either as
   * an absolute time (the number of seconds from the epoch) or as an
   * elapsed time. On Unix systems the epoch is Midnight Jan 1, 1970 GMT.
   * On Macintosh systems the epoch is Midnight Jan 1, 1904 GMT.
***************
*** 1369,1374 ****
--- 1363,1369 ----
  #   define ckrealloc(x,y) Tcl_DbCkrealloc((x), (y),__FILE__, __LINE__)
  #   define attemptckalloc(x) Tcl_AttemptDbCkalloc(x, __FILE__, __LINE__)
  #   define attemptckrealloc(x,y) Tcl_AttemptDbCkrealloc((x), (y), __FILE__, __LINE__)
+ 
  #else /* !TCL_MEM_DEBUG */
  
  /*

*** generic/tclAlloc.c	2001/09/06 10:16:45	1.11
--- generic/tclAlloc.c	2002/01/29 06:42:00
***************
*** 249,255 ****
  
  char *
  TclpAlloc(nbytes)
!     unsigned int nbytes;	/* Number of bytes to allocate. */
  {
      register union overhead *op;
      register long bucket;
--- 249,255 ----
  
  char *
  TclpAlloc(nbytes)
!     size_t nbytes;	/* Number of bytes to allocate. */
  {
      register union overhead *op;
      register long bucket;
***************
*** 392,399 ****
      nblks = amt / sz;
      ASSERT(nblks*sz == amt);
  
!     blockPtr = (struct block *) TclpSysAlloc((unsigned) 
! 	    (sizeof(struct block) + amt), 1);
      /* no more room! */
      if (blockPtr == NULL) {
  	return;
--- 392,398 ----
      nblks = amt / sz;
      ASSERT(nblks*sz == amt);
  
!     blockPtr = (struct block *) TclpSysAlloc(sizeof(struct block) + amt, 1);
      /* no more room! */
      if (blockPtr == NULL) {
  	return;
***************
*** 495,507 ****
  char *
  TclpRealloc(cp, nbytes)
      char *cp;			/* Pointer to alloced block. */
!     unsigned int nbytes;	/* New size of memory. */
  {   
      int i;
      union overhead *op;
      struct block *bigBlockPtr;
      int expensive;
!     unsigned long maxsize;
  
      if (cp == NULL) {
  	return (TclpAlloc(nbytes));
--- 494,506 ----
  char *
  TclpRealloc(cp, nbytes)
      char *cp;			/* Pointer to alloced block. */
!     size_t nbytes;	/* New size of memory. */
  {   
      int i;
      union overhead *op;
      struct block *bigBlockPtr;
      int expensive;
!     size_t maxsize;
  
      if (cp == NULL) {
  	return (TclpAlloc(nbytes));
***************
*** 583,589 ****
  	maxsize -= OVERHEAD;
  	if ( maxsize < nbytes )
  	    nbytes = maxsize;
! 	memcpy((VOID *) newp, (VOID *) cp, (size_t) nbytes);
  	TclpFree(cp);
  	return newp;
      }
--- 582,588 ----
  	maxsize -= OVERHEAD;
  	if ( maxsize < nbytes )
  	    nbytes = maxsize;
! 	memcpy((VOID *) newp, (VOID *) cp, nbytes);
  	TclpFree(cp);
  	return newp;
      }
***************
*** 667,673 ****
  
  char *
  TclpAlloc(nbytes)
!     unsigned int nbytes;	/* Number of bytes to allocate. */
  {
      return (char*) malloc(nbytes);
  }
--- 666,672 ----
  
  char *
  TclpAlloc(nbytes)
!     size_t nbytes;	/* Number of bytes to allocate. */
  {
      return (char*) malloc(nbytes);
  }
***************
*** 715,721 ****
  char *
  TclpRealloc(cp, nbytes)
      char *cp;			/* Pointer to alloced block. */
!     unsigned int nbytes;	/* New size of memory. */
  {   
      return (char*) realloc(cp, nbytes);
  }
--- 714,720 ----
  char *
  TclpRealloc(cp, nbytes)
      char *cp;			/* Pointer to alloced block. */
!     size_t nbytes;	/* New size of memory. */
  {   
      return (char*) realloc(cp, nbytes);
  }

*** generic/tclBasic.c	2002/01/29 02:40:49	1.45
--- generic/tclBasic.c	2002/01/29 06:42:13
***************
*** 1800,1806 ****
      Command *cmdPtr = (Command *) clientData;
      register Tcl_Obj *objPtr;
      register int i;
!     int length, result;
  
      /*
       * This procedure generates an objv array for object arguments that hold
--- 1800,1807 ----
      Command *cmdPtr = (Command *) clientData;
      register Tcl_Obj *objPtr;
      register int i;
!     size_t length;
!     int result;
  
      /*
       * This procedure generates an objv array for object arguments that hold
***************
*** 2897,2913 ****
  	     */
  	    
  	    if (argv == NULL) {
! 		argv = (char **) ckalloc((unsigned) (objc + 1) * sizeof(char *));
  		for (i = 0; i < objc; i++) {
  		    argv[i] = Tcl_GetString(objv[i]);
  		}
  		argv[objc] = 0;
  		
  		if (length < 0) {
! 		    length = strlen(command);
! 		} else if ((size_t)length < strlen(command)) {
! 		    commandCopy = (char *) ckalloc((unsigned) (length + 1));
! 		    strncpy(commandCopy, command, (size_t) length);
  		    commandCopy[length] = 0;
  		}
  	    }
--- 2898,2914 ----
  	     */
  	    
  	    if (argv == NULL) {
! 		argv = (char **) ckalloc((objc + 1) * sizeof(char *));
  		for (i = 0; i < objc; i++) {
  		    argv[i] = Tcl_GetString(objv[i]);
  		}
  		argv[objc] = 0;
  		
  		if (length < 0) {
! 		    length = (int) strlen(command);
! 		} else if ((size_t) length < strlen(command)) {
! 		    commandCopy = (char *) ckalloc(length + 1);
! 		    strncpy(commandCopy, command, length);
  		    commandCopy[length] = 0;
  		}
  	    }
***************
*** 3102,3108 ****
       */
  
      if (length < 0) {
! 	length = strlen(command);
      }
      if (length > 150) {
  	length = 150;
--- 3103,3109 ----
       */
  
      if (length < 0) {
! 	length = (int) strlen(command);
      }
      if (length > 150) {
  	length = 150;
***************
*** 3394,3400 ****
      int gotParse = 0, objectsUsed = 0;
  
      if (numBytes < 0) {
! 	numBytes = strlen(script);
      }
      Tcl_ResetResult(interp);
  
--- 3395,3401 ----
      int gotParse = 0, objectsUsed = 0;
  
      if (numBytes < 0) {
! 	numBytes = (int) strlen(script);
      }
      Tcl_ResetResult(interp);
  
***************
*** 3477,3483 ****
  	 */
  
  	next = parse.commandStart + parse.commandSize;
! 	bytesLeft -= next - p;
  	p = next;
  	Tcl_FreeParse(&parse);
  	gotParse = 0;
--- 3478,3484 ----
  	 */
  
  	next = parse.commandStart + parse.commandSize;
! 	bytesLeft -= (int) (next - p);
  	p = next;
  	Tcl_FreeParse(&parse);
  	gotParse = 0;
***************
*** 3488,3499 ****
  	     * bracket in the script.  Return immediately.
  	     */
  
! 	    iPtr->termOffset = (p - 1) - script;
  	    iPtr->varFramePtr = savedVarFramePtr;
  	    return TCL_OK;
  	}
      } while (bytesLeft > 0);
!     iPtr->termOffset = p - script;
      iPtr->varFramePtr = savedVarFramePtr;
      return TCL_OK;
  
--- 3489,3500 ----
  	     * bracket in the script.  Return immediately.
  	     */
  
! 	    iPtr->termOffset = (int) ((p - 1) - script);
  	    iPtr->varFramePtr = savedVarFramePtr;
  	    return TCL_OK;
  	}
      } while (bytesLeft > 0);
!     iPtr->termOffset = (int) (p - script);
      iPtr->varFramePtr = savedVarFramePtr;
      return TCL_OK;
  
***************
*** 3525,3531 ****
      }
      if (gotParse) {
  	next = parse.commandStart + parse.commandSize;
! 	bytesLeft -= next - p;
  	p = next;
  	Tcl_FreeParse(&parse);
  
--- 3526,3532 ----
      }
      if (gotParse) {
  	next = parse.commandStart + parse.commandSize;
! 	bytesLeft -= (int) (next - p);
  	p = next;
  	Tcl_FreeParse(&parse);
  
***************
*** 3565,3577 ****
  		 */
  
  		next = parse.commandStart + parse.commandSize;
! 		bytesLeft -= next - p;
  		p = next;
  		Tcl_FreeParse(&parse);
  	    }
! 	    iPtr->termOffset = (p - 1) - script;
  	} else {
! 	    iPtr->termOffset = p - script;
  	}    
      }
      if (objv != staticObjArray) {
--- 3566,3578 ----
  		 */
  
  		next = parse.commandStart + parse.commandSize;
! 		bytesLeft -= (int) (next - p);
  		p = next;
  		Tcl_FreeParse(&parse);
  	    }
! 	    iPtr->termOffset = (int) ((p - 1) - script);
  	} else {
! 	    iPtr->termOffset = (int) (p - script);
  	}    
      }
      if (objv != staticObjArray) {
***************
*** 3841,3851 ****
  {
      register Tcl_Obj *exprPtr;
      Tcl_Obj *resultPtr;
!     int length = strlen(string);
      int result = TCL_OK;
  
      if (length > 0) {
! 	exprPtr = Tcl_NewStringObj(string, length);
  	Tcl_IncrRefCount(exprPtr);
  	result = Tcl_ExprObj(interp, exprPtr, &resultPtr);
  	if (result == TCL_OK) {
--- 3842,3852 ----
  {
      register Tcl_Obj *exprPtr;
      Tcl_Obj *resultPtr;
!     size_t length = strlen(string);
      int result = TCL_OK;
  
      if (length > 0) {
! 	exprPtr = Tcl_NewStringObj(string, (int) length);
  	Tcl_IncrRefCount(exprPtr);
  	result = Tcl_ExprObj(interp, exprPtr, &resultPtr);
  	if (result == TCL_OK) {
***************
*** 3892,3902 ****
  {
      register Tcl_Obj *exprPtr;
      Tcl_Obj *resultPtr;
!     int length = strlen(string);
      int result = TCL_OK;
  
      if (length > 0) {
! 	exprPtr = Tcl_NewStringObj(string, length);
  	Tcl_IncrRefCount(exprPtr);
  	result = Tcl_ExprObj(interp, exprPtr, &resultPtr);
  	if (result == TCL_OK) {
--- 3893,3903 ----
  {
      register Tcl_Obj *exprPtr;
      Tcl_Obj *resultPtr;
!     size_t length = strlen(string);
      int result = TCL_OK;
  
      if (length > 0) {
! 	exprPtr = Tcl_NewStringObj(string, (int) length);
  	Tcl_IncrRefCount(exprPtr);
  	result = Tcl_ExprObj(interp, exprPtr, &resultPtr);
  	if (result == TCL_OK) {
***************
*** 3943,3953 ****
  {
      register Tcl_Obj *exprPtr;
      Tcl_Obj *resultPtr;
!     int length = strlen(string);
      int result = TCL_OK;
  
      if (length > 0) {
! 	exprPtr = Tcl_NewStringObj(string, length);
  	Tcl_IncrRefCount(exprPtr);
  	result = Tcl_ExprObj(interp, exprPtr, &resultPtr);
  	if (result == TCL_OK) {
--- 3944,3954 ----
  {
      register Tcl_Obj *exprPtr;
      Tcl_Obj *resultPtr;
!     size_t length = strlen(string);
      int result = TCL_OK;
  
      if (length > 0) {
! 	exprPtr = Tcl_NewStringObj(string, (int) length);
  	Tcl_IncrRefCount(exprPtr);
  	result = Tcl_ExprObj(interp, exprPtr, &resultPtr);
  	if (result == TCL_OK) {
***************
*** 4115,4121 ****
  {
      register Tcl_Obj *objPtr;
      register int i;
!     int length, result;
  
      /*
       * This procedure generates an objv array for object arguments that hold
--- 4116,4123 ----
  {
      register Tcl_Obj *objPtr;
      register int i;
!     int result;
!     size_t length;
  
      /*
       * This procedure generates an objv array for object arguments that hold
***************
*** 4140,4146 ****
  
      for (i = 0;  i < argc;  i++) {
  	length = strlen(argv[i]);
! 	objv[i] = Tcl_NewStringObj(argv[i], length);
  	Tcl_IncrRefCount(objv[i]);
      }
      objv[argc] = 0;
--- 4142,4148 ----
  
      for (i = 0;  i < argc;  i++) {
  	length = strlen(argv[i]);
! 	objv[i] = Tcl_NewStringObj(argv[i], (int) length);
  	Tcl_IncrRefCount(objv[i]);
      }
      objv[argc] = 0;
***************
*** 4463,4469 ****
  {
      register Tcl_Obj *exprPtr;
      Tcl_Obj *resultPtr;
!     int length = strlen(string);
      char buf[TCL_DOUBLE_SPACE];
      int result = TCL_OK;
  
--- 4465,4471 ----
  {
      register Tcl_Obj *exprPtr;
      Tcl_Obj *resultPtr;
!     size_t length = strlen(string);
      char buf[TCL_DOUBLE_SPACE];
      int result = TCL_OK;
  

*** generic/tclBinary.c	2002/01/17 04:37:33	1.11
--- generic/tclBinary.c	2002/01/29 06:42:18
***************
*** 407,413 ****
  	    *dst++ = (unsigned char) ch;
  	}
  
! 	byteArrayPtr->used = dst - byteArrayPtr->bytes;
  	byteArrayPtr->allocated = length;
  
  	if ((typePtr != NULL) && (typePtr->freeIntRepProc) != NULL) {
--- 407,413 ----
  	    *dst++ = (unsigned char) ch;
  	}
  
! 	byteArrayPtr->used = (int) (dst - byteArrayPtr->bytes);
  	byteArrayPtr->allocated = length;
  
  	if ((typePtr != NULL) && (typePtr->freeIntRepProc) != NULL) {

*** generic/tclCkalloc.c	2002/01/25 20:40:55	1.15
--- generic/tclCkalloc.c	2002/01/29 06:42:22
***************
*** 995,1001 ****
  
  char *
  Tcl_Alloc (size)
!     unsigned int size;
  {
      char *result;
  
--- 995,1001 ----
  
  char *
  Tcl_Alloc (size)
!     size_t size;
  {
      char *result;
  
***************
*** 1017,1023 ****
  
  char *
  Tcl_DbCkalloc(size, file, line)
!     unsigned int size;
      CONST char  *file;
      int          line;
  {
--- 1017,1023 ----
  
  char *
  Tcl_DbCkalloc(size, file, line)
!     size_t size;
      CONST char  *file;
      int          line;
  {
***************
*** 1044,1050 ****
  
  char *
  Tcl_AttemptAlloc (size)
!     unsigned int size;
  {
      char *result;
  
--- 1044,1050 ----
  
  char *
  Tcl_AttemptAlloc (size)
!     size_t size;
  {
      char *result;
  
***************
*** 1054,1060 ****
  
  char *
  Tcl_AttemptDbCkalloc(size, file, line)
!     unsigned int size;
      CONST char  *file;
      int          line;
  {
--- 1054,1060 ----
  
  char *
  Tcl_AttemptDbCkalloc(size, file, line)
!     size_t size;
      CONST char  *file;
      int          line;
  {
***************
*** 1078,1084 ****
  char *
  Tcl_Realloc(ptr, size)
      char *ptr;
!     unsigned int size;
  {
      char *result;
  
--- 1078,1084 ----
  char *
  Tcl_Realloc(ptr, size)
      char *ptr;
!     size_t size;
  {
      char *result;
  
***************
*** 1093,1099 ****
  char *
  Tcl_DbCkrealloc(ptr, size, file, line)
      char        *ptr;
!     unsigned int size;
      CONST char  *file;
      int          line;
  {
--- 1093,1099 ----
  char *
  Tcl_DbCkrealloc(ptr, size, file, line)
      char        *ptr;
!     size_t size;
      CONST char  *file;
      int          line;
  {
***************
*** 1121,1127 ****
  char *
  Tcl_AttemptRealloc(ptr, size)
      char *ptr;
!     unsigned int size;
  {
      char *result;
  
--- 1121,1127 ----
  char *
  Tcl_AttemptRealloc(ptr, size)
      char *ptr;
!     size_t size;
  {
      char *result;
  
***************
*** 1132,1138 ****
  char *
  Tcl_AttemptDbCkrealloc(ptr, size, file, line)
      char        *ptr;
!     unsigned int size;
      CONST char  *file;
      int          line;
  {
--- 1132,1138 ----
  char *
  Tcl_AttemptDbCkrealloc(ptr, size, file, line)
      char        *ptr;
!     size_t size;
      CONST char  *file;
      int          line;
  {

*** generic/tclClock.c	2002/01/25 20:40:55	1.14
--- generic/tclClock.c	2002/01/29 06:42:24
***************
*** 261,267 ****
      Tcl_DString buffer, uniBuffer;
      int bufSize;
      char *p;
!     int result;
      time_t tclockVal;
  #ifndef HAVE_TM_ZONE
      int savedTimeZone = 0;	/* lint. */
--- 261,267 ----
      Tcl_DString buffer, uniBuffer;
      int bufSize;
      char *p;
!     size_t result;
      time_t tclockVal;
  #ifndef HAVE_TM_ZONE
      int savedTimeZone = 0;	/* lint. */

*** generic/tclCmdAH.c	2002/01/26 01:10:08	1.20
--- generic/tclCmdAH.c	2002/01/29 06:42:30
***************
*** 1936,1942 ****
  	    while ((*format != '%') && (format < endPtr)) {
  		format++;
  	    }
! 	    size = format - ptrValue;
  	    noPercent = 1;
  	    goto doField;
  	}
--- 1936,1942 ----
  	    while ((*format != '%') && (format < endPtr)) {
  		format++;
  	    }
! 	    size = (int) (format - ptrValue);
  	    noPercent = 1;
  	    goto doField;
  	}
***************
*** 2120,2126 ****
  		if (gotPrecision && (precision < stringLen)) {
  		    stringLen = precision;
  		}
! 		size = Tcl_UtfAtIndex(ptrValue, stringLen) - ptrValue;
  		if (width > stringLen) {
  		    size += (width - stringLen);
  		}
--- 2120,2126 ----
  		if (gotPrecision && (precision < stringLen)) {
  		    stringLen = precision;
  		}
! 		size = (int) (Tcl_UtfAtIndex(ptrValue, stringLen) - ptrValue);
  		if (width > stringLen) {
  		    size += (width - stringLen);
  		}
***************
*** 2230,2236 ****
  			}
  		    }
  
! 		    size = Tcl_UtfAtIndex(ptrValue, stringLen) - ptrValue; 
  		    if (size) {
  			memcpy(ptr, ptrValue, (size_t) size);
  			ptr += size;
--- 2230,2236 ----
  			}
  		    }
  
! 		    size = (int) (Tcl_UtfAtIndex(ptrValue, stringLen) - ptrValue); 
  		    if (size) {
  			memcpy(ptr, ptrValue, (size_t) size);
  			ptr += size;

*** generic/tclCmdIL.c	2002/01/26 01:10:08	1.40
--- generic/tclCmdIL.c	2002/01/29 06:42:39
***************
*** 585,591 ****
       */
  
      bodyPtr = procPtr->bodyPtr;
!     resultPtr = Tcl_NewStringObj(bodyPtr->bytes, bodyPtr->length);
      
      Tcl_SetObjResult(interp, resultPtr);
      return TCL_OK;
--- 585,591 ----
       */
  
      bodyPtr = procPtr->bodyPtr;
!     resultPtr = Tcl_NewStringObj(bodyPtr->bytes, (int) bodyPtr->length);
      
      Tcl_SetObjResult(interp, resultPtr);
      return TCL_OK;

*** generic/tclCmdMZ.c	2002/01/21 16:15:03	1.56
--- generic/tclCmdMZ.c	2002/01/29 06:42:48
***************
*** 641,647 ****
  		} else if ((ch == '\\') || (ch == '&')) {
  		    *wsrc = ch;
  		    Tcl_AppendUnicodeToObj(resultPtr, wfirstChar,
! 			    wsrc - wfirstChar + 1);
  		    *wsrc = '\\';
  		    wfirstChar = wsrc + 2;
  		    wsrc++;
--- 641,647 ----
  		} else if ((ch == '\\') || (ch == '&')) {
  		    *wsrc = ch;
  		    Tcl_AppendUnicodeToObj(resultPtr, wfirstChar,
! 			    (int) (wsrc - wfirstChar + 1));
  		    *wsrc = '\\';
  		    wfirstChar = wsrc + 2;
  		    wsrc++;
***************
*** 654,660 ****
  	    }
  	    if (wfirstChar != wsrc) {
  		Tcl_AppendUnicodeToObj(resultPtr, wfirstChar,
! 			wsrc - wfirstChar);
  	    }
  	    if (idx <= info.nsubs) {
  		subStart = info.matches[idx].start;
--- 654,660 ----
  	    }
  	    if (wfirstChar != wsrc) {
  		Tcl_AppendUnicodeToObj(resultPtr, wfirstChar,
! 			(int) (wsrc - wfirstChar));
  	    }
  	    if (idx <= info.nsubs) {
  		subStart = info.matches[idx].start;
***************
*** 670,676 ****
  	    wfirstChar = wsrc + 1;
  	}
  	if (wfirstChar != wsrc) {
! 	    Tcl_AppendUnicodeToObj(resultPtr, wfirstChar, wsrc - wfirstChar);
  	}
  	if (end == 0) {
  	    /*
--- 670,677 ----
  	    wfirstChar = wsrc + 1;
  	}
  	if (wfirstChar != wsrc) {
! 	    Tcl_AppendUnicodeToObj(resultPtr, wfirstChar, 
! 		    (int) (wsrc - wfirstChar));
  	}
  	if (end == 0) {
  	    /*
***************
*** 983,996 ****
  	    for (p = splitChars; p < splitEnd; p += splitLen) {
  		splitLen = Tcl_UtfToUniChar(p, &splitChar);
  		if (ch == splitChar) {
! 		    objPtr = Tcl_NewStringObj(element, string - element);
  		    Tcl_ListObjAppendElement(NULL, listPtr, objPtr);
  		    element = string + len;
  		    break;
  		}
  	    }
  	}
! 	objPtr = Tcl_NewStringObj(element, string - element);
  	Tcl_ListObjAppendElement(NULL, listPtr, objPtr);
      }
      return TCL_OK;
--- 984,997 ----
  	    for (p = splitChars; p < splitEnd; p += splitLen) {
  		splitLen = Tcl_UtfToUniChar(p, &splitChar);
  		if (ch == splitChar) {
! 		    objPtr = Tcl_NewStringObj(element, (int) (string - element));
  		    Tcl_ListObjAppendElement(NULL, listPtr, objPtr);
  		    element = string + len;
  		    break;
  		}
  	    }
  	}
! 	objPtr = Tcl_NewStringObj(element, (int) (string - element));
  	Tcl_ListObjAppendElement(NULL, listPtr, objPtr);
      }
      return TCL_OK;
***************
*** 1287,1293 ****
  		    if ((*p == *ustring1) &&
  			    (Tcl_UniCharNcmp(ustring1, p,
  				    (unsigned long) length1) == 0)) {
! 			match = p - ustring2;
  			break;
  		    }
  		}
--- 1288,1294 ----
  		    if ((*p == *ustring1) &&
  			    (Tcl_UniCharNcmp(ustring1, p,
  				    (unsigned long) length1) == 0)) {
! 			match = (int) (p - ustring2);
  			break;
  		    }
  		}
***************
*** 1525,1531 ****
  			 * and then we go onto SPACE, since we are
  			 * allowed trailing whitespace
  			 */
! 			failat = stop - string1;
  			string1 = stop;
  			chcomp = Tcl_UniCharIsSpace;
  		    }
--- 1526,1532 ----
  			 * and then we go onto SPACE, since we are
  			 * allowed trailing whitespace
  			 */
! 			failat = (int) (stop - string1);
  			string1 = stop;
  			chcomp = Tcl_UniCharIsSpace;
  		    }
***************
*** 1567,1573 ****
  			 * and then we go onto SPACE, since we are
  			 * allowed trailing whitespace
  			 */
! 			failat = stop - string1;
  			string1 = stop;
  			chcomp = Tcl_UniCharIsSpace;
  		    }
--- 1568,1574 ----
  			 * and then we go onto SPACE, since we are
  			 * allowed trailing whitespace
  			 */
! 			failat = (int) (stop - string1);
  			string1 = stop;
  			chcomp = Tcl_UniCharIsSpace;
  		    }
***************
*** 1674,1680 ****
  		    if ((*p == *ustring1) &&
  			    (memcmp((char *) ustring1, (char *) p, (size_t)
  				    (length1 * sizeof(Tcl_UniChar))) == 0)) {
! 			match = p - ustring2;
  			break;
  		    }
  		}
--- 1675,1681 ----
  		    if ((*p == *ustring1) &&
  			    (memcmp((char *) ustring1, (char *) p, (size_t)
  				    (length1 * sizeof(Tcl_UniChar))) == 0)) {
! 			match = (int) (p - ustring2);
  			break;
  		    }
  		}
***************
*** 1789,1795 ****
  				    (unsigned long) length2) == 0)) {
  			if (p != ustring1) {
  			    Tcl_AppendUnicodeToObj(resultPtr, p,
! 				    ustring1 - p);
  			    p = ustring1 + length2;
  			} else {
  			    p += length2;
--- 1790,1796 ----
  				    (unsigned long) length2) == 0)) {
  			if (p != ustring1) {
  			    Tcl_AppendUnicodeToObj(resultPtr, p,
! 				    (int) (ustring1 - p));
  			    p = ustring1 + length2;
  			} else {
  			    p += length2;
***************
*** 1830,1836 ****
  				 * Put the skipped chars onto the result first
  				 */
  				Tcl_AppendUnicodeToObj(resultPtr, p,
! 					ustring1 - p);
  				p = ustring1 + length2;
  			    } else {
  				p += length2;
--- 1831,1837 ----
  				 * Put the skipped chars onto the result first
  				 */
  				Tcl_AppendUnicodeToObj(resultPtr, p,
! 					(int) (ustring1 - p));
  				p = ustring1 + length2;
  			    } else {
  				p += length2;
***************
*** 1856,1862 ****
  		/*
  		 * Put the rest of the unmapped chars onto result
  		 */
! 		Tcl_AppendUnicodeToObj(resultPtr, p, ustring1 - p);
  	    }
  	    break;
  	}
--- 1857,1863 ----
  		/*
  		 * Put the rest of the unmapped chars onto result
  		 */
! 		Tcl_AppendUnicodeToObj(resultPtr, p, (int) (ustring1 - p));
  	    }
  	    break;
  	}
***************
*** 2051,2057 ****
  		}
  		start = Tcl_UtfAtIndex(string1, first);
  		end = Tcl_UtfAtIndex(start, last - first + 1);
! 		length2 = end-start;
  		string2 = ckalloc((size_t) length2+1);
  		memcpy(string2, start, (size_t) length2);
  		string2[length2] = '\0';
--- 2052,2058 ----
  		}
  		start = Tcl_UtfAtIndex(string1, first);
  		end = Tcl_UtfAtIndex(start, last - first + 1);
! 		length2 = (int) (end-start);
  		string2 = ckalloc((size_t) length2+1);
  		memcpy(string2, start, (size_t) length2);
  		string2[length2] = '\0';
***************
*** 2062,2068 ****
  		} else {
  		    length2 = Tcl_UtfToTitle(string2);
  		}
! 		Tcl_SetStringObj(resultPtr, string1, start - string1);
  		Tcl_AppendToObj(resultPtr, string2, length2);
  		Tcl_AppendToObj(resultPtr, end, -1);
  		ckfree(string2);
--- 2063,2069 ----
  		} else {
  		    length2 = Tcl_UtfToTitle(string2);
  		}
! 		Tcl_SetStringObj(resultPtr, string1, (int) (start - string1));
  		Tcl_AppendToObj(resultPtr, string2, length2);
  		Tcl_AppendToObj(resultPtr, end, -1);
  		ckfree(string2);
***************
*** 2083,2089 ****
  		string2 = Tcl_GetStringFromObj(objv[3], &length2);
  	    } else if (objc == 3) {
  		string2 = " \t\n\r";
! 		length2 = strlen(string2);
  	    } else {
  	        Tcl_WrongNumArgs(interp, 2, objv, "string ?chars?");
  		return TCL_ERROR;
--- 2084,2090 ----
  		string2 = Tcl_GetStringFromObj(objv[3], &length2);
  	    } else if (objc == 3) {
  		string2 = " \t\n\r";
! 		length2 = (int) strlen(string2);
  	    } else {
  	        Tcl_WrongNumArgs(interp, 2, objv, "string ?chars?");
  		return TCL_ERROR;
***************
*** 2356,2362 ****
  	switch (*p) {
  	case 0:
  	    if (p != old) {
! 		Tcl_AppendToObj(resultObj, old, p-old);
  	    }
  	    return resultObj;
  
--- 2357,2363 ----
  	switch (*p) {
  	case 0:
  	    if (p != old) {
! 		Tcl_AppendToObj(resultObj, old, (int) (p-old));
  	    }
  	    return resultObj;
  
***************
*** 2366,2372 ****
  		int count;
  
  		if (p != old) {
! 		    Tcl_AppendToObj(resultObj, old, p-old);
  		}
  		Tcl_AppendToObj(resultObj, buf,
  				Tcl_UtfBackslash(p, &count, buf));
--- 2367,2373 ----
  		int count;
  
  		if (p != old) {
! 		    Tcl_AppendToObj(resultObj, old, (int) (p-old));
  		}
  		Tcl_AppendToObj(resultObj, buf,
  				Tcl_UtfBackslash(p, &count, buf));
***************
*** 2404,2410 ****
  		    break;
  		}
  		if (p != old) {
! 		    Tcl_AppendToObj(resultObj, old, p-old);
  		}
  		p += parse.tokenPtr->size;
  		code = Tcl_EvalTokensStandard(interp, parse.tokenPtr,
--- 2405,2411 ----
  		    break;
  		}
  		if (p != old) {
! 		    Tcl_AppendToObj(resultObj, old, (int) (p-old));
  		}
  		p += parse.tokenPtr->size;
  		code = Tcl_EvalTokensStandard(interp, parse.tokenPtr,
***************
*** 2426,2432 ****
  		int code;
  
  		if (p != old) {
! 		    Tcl_AppendToObj(resultObj, old, p-old);
  		}
  		iPtr->evalFlags = TCL_BRACKET_TERM;
  		code = Tcl_EvalEx(interp, p+1, -1, 0);
--- 2427,2433 ----
  		int code;
  
  		if (p != old) {
! 		    Tcl_AppendToObj(resultObj, old, (int) (p-old));
  		}
  		iPtr->evalFlags = TCL_BRACKET_TERM;
  		code = Tcl_EvalEx(interp, p+1, -1, 0);

*** generic/tclCompCmds.c	2002/01/29 02:40:50	1.22
--- generic/tclCompCmds.c	2002/01/29 06:42:57
***************
*** 309,320 ****
       */
  
      if (cmdTokenPtr->type == TCL_TOKEN_SIMPLE_WORD) {
! 	startOffset = (envPtr->codeNext - envPtr->codeStart);
  	code = TclCompileCmdWord(interp, cmdTokenPtr+1, 1, envPtr);
      } else {
  	code = TclCompileTokens(interp, cmdTokenPtr+1,
  	        cmdTokenPtr->numComponents, envPtr);
! 	startOffset = (envPtr->codeNext - envPtr->codeStart);
  	TclEmitOpcode(INST_EVAL_STK, envPtr);
      }
      envPtr->exceptArrayPtr[range].codeOffset = startOffset;
--- 309,320 ----
       */
  
      if (cmdTokenPtr->type == TCL_TOKEN_SIMPLE_WORD) {
! 	startOffset = (int) (envPtr->codeNext - envPtr->codeStart);
  	code = TclCompileCmdWord(interp, cmdTokenPtr+1, 1, envPtr);
      } else {
  	code = TclCompileTokens(interp, cmdTokenPtr+1,
  	        cmdTokenPtr->numComponents, envPtr);
! 	startOffset = (int) (envPtr->codeNext - envPtr->codeStart);
  	TclEmitOpcode(INST_EVAL_STK, envPtr);
      }
      envPtr->exceptArrayPtr[range].codeOffset = startOffset;
***************
*** 328,334 ****
  	goto done;
      }
      envPtr->exceptArrayPtr[range].numCodeBytes =
! 	    (envPtr->codeNext - envPtr->codeStart) - startOffset;
  		    
      /*
       * The "no errors" epilogue code: store the body's result into the
--- 328,334 ----
  	goto done;
      }
      envPtr->exceptArrayPtr[range].numCodeBytes =
! 	    (int) (envPtr->codeNext - envPtr->codeStart) - startOffset;
  		    
      /*
       * The "no errors" epilogue code: store the body's result into the
***************
*** 356,362 ****
  
      envPtr->currStackDepth = savedStackDepth;
      envPtr->exceptArrayPtr[range].catchOffset =
! 	    (envPtr->codeNext - envPtr->codeStart);
      if (localIndex != -1) {
  	TclEmitOpcode(INST_PUSH_RESULT, envPtr);
  	if (localIndex <= 255) {
--- 356,362 ----
  
      envPtr->currStackDepth = savedStackDepth;
      envPtr->exceptArrayPtr[range].catchOffset =
! 	    (int) (envPtr->codeNext - envPtr->codeStart);
      if (localIndex != -1) {
  	TclEmitOpcode(INST_PUSH_RESULT, envPtr);
  	if (localIndex <= 255) {
***************
*** 374,380 ****
       * an endCatch instruction at the end of the catch command.
       */
  
!     jumpDist = (envPtr->codeNext - envPtr->codeStart)
  	    - jumpFixup.codeOffset;
      if (TclFixupForwardJump(envPtr, &jumpFixup, jumpDist, 127)) {
  	panic("TclCompileCatchCmd: bad jump distance %d\n", jumpDist);
--- 374,380 ----
       * an endCatch instruction at the end of the catch command.
       */
  
!     jumpDist = (int) (envPtr->codeNext - envPtr->codeStart)
  	    - jumpFixup.codeOffset;
      if (TclFixupForwardJump(envPtr, &jumpFixup, jumpDist, 127)) {
  	panic("TclCompileCatchCmd: bad jump distance %d\n", jumpDist);
***************
*** 571,577 ****
       */
  
      envPtr->currStackDepth = savedStackDepth;
!     testCodeOffset = (envPtr->codeNext - envPtr->codeStart);
      code = TclCompileExprWords(interp, testTokenPtr, 1, envPtr);
      envPtr->currStackDepth = savedStackDepth + 1;
      if (code != TCL_OK) {
--- 571,577 ----
       */
  
      envPtr->currStackDepth = savedStackDepth;
!     testCodeOffset = (int) (envPtr->codeNext - envPtr->codeStart);
      code = TclCompileExprWords(interp, testTokenPtr, 1, envPtr);
      envPtr->currStackDepth = savedStackDepth + 1;
      if (code != TCL_OK) {
***************
*** 589,595 ****
  
      envPtr->currStackDepth = savedStackDepth;
      envPtr->exceptArrayPtr[bodyRange].codeOffset =
! 	    (envPtr->codeNext - envPtr->codeStart);
      code = TclCompileCmdWord(interp, bodyTokenPtr+1,
  	    bodyTokenPtr->numComponents, envPtr);
      if (code != TCL_OK) {
--- 589,595 ----
  
      envPtr->currStackDepth = savedStackDepth;
      envPtr->exceptArrayPtr[bodyRange].codeOffset =
! 	    (int) (envPtr->codeNext - envPtr->codeStart);
      code = TclCompileCmdWord(interp, bodyTokenPtr+1,
  	    bodyTokenPtr->numComponents, envPtr);
      if (code != TCL_OK) {
***************
*** 601,607 ****
  	goto done;
      }
      envPtr->exceptArrayPtr[bodyRange].numCodeBytes =
! 	    (envPtr->codeNext - envPtr->codeStart)
  	    - envPtr->exceptArrayPtr[bodyRange].codeOffset;
      TclEmitOpcode(INST_POP, envPtr);
  
--- 601,607 ----
  	goto done;
      }
      envPtr->exceptArrayPtr[bodyRange].numCodeBytes =
! 	    (int) (envPtr->codeNext - envPtr->codeStart)
  	    - envPtr->exceptArrayPtr[bodyRange].codeOffset;
      TclEmitOpcode(INST_POP, envPtr);
  
***************
*** 611,619 ****
  
      envPtr->currStackDepth = savedStackDepth;
      envPtr->exceptArrayPtr[bodyRange].continueOffset =
! 	    (envPtr->codeNext - envPtr->codeStart);
      envPtr->exceptArrayPtr[nextRange].codeOffset =
! 	    (envPtr->codeNext - envPtr->codeStart);
      code = TclCompileCmdWord(interp, nextTokenPtr+1,
  	    nextTokenPtr->numComponents, envPtr);
      envPtr->currStackDepth = savedStackDepth + 1;
--- 611,619 ----
  
      envPtr->currStackDepth = savedStackDepth;
      envPtr->exceptArrayPtr[bodyRange].continueOffset =
! 	    (int) (envPtr->codeNext - envPtr->codeStart);
      envPtr->exceptArrayPtr[nextRange].codeOffset =
! 	    (int) (envPtr->codeNext - envPtr->codeStart);
      code = TclCompileCmdWord(interp, nextTokenPtr+1,
  	    nextTokenPtr->numComponents, envPtr);
      envPtr->currStackDepth = savedStackDepth + 1;
***************
*** 625,631 ****
  	goto done;
      }
      envPtr->exceptArrayPtr[nextRange].numCodeBytes =
! 	    (envPtr->codeNext - envPtr->codeStart)
  	    - envPtr->exceptArrayPtr[nextRange].codeOffset;
      TclEmitOpcode(INST_POP, envPtr);
      envPtr->currStackDepth = savedStackDepth;
--- 625,631 ----
  	goto done;
      }
      envPtr->exceptArrayPtr[nextRange].numCodeBytes =
! 	    (int) (envPtr->codeNext - envPtr->codeStart)
  	    - envPtr->exceptArrayPtr[nextRange].codeOffset;
      TclEmitOpcode(INST_POP, envPtr);
      envPtr->currStackDepth = savedStackDepth;
***************
*** 637,643 ****
       * replace the ifFalse jump with a 4 byte jump.
       */
  
!     jumpBackOffset = (envPtr->codeNext - envPtr->codeStart);
      jumpBackDist = (jumpBackOffset - testCodeOffset);
      if (jumpBackDist > 120) {
  	TclEmitInstInt4(INST_JUMP4, -jumpBackDist, envPtr);
--- 637,643 ----
       * replace the ifFalse jump with a 4 byte jump.
       */
  
!     jumpBackOffset = (int) (envPtr->codeNext - envPtr->codeStart);
      jumpBackDist = (jumpBackOffset - testCodeOffset);
      if (jumpBackDist > 120) {
  	TclEmitInstInt4(INST_JUMP4, -jumpBackDist, envPtr);
***************
*** 649,655 ****
       * Fix the target of the jumpFalse after the test.
       */
  
!     jumpDist = (envPtr->codeNext - envPtr->codeStart)
  	    - jumpFalseFixup.codeOffset;
      if (TclFixupForwardJump(envPtr, &jumpFalseFixup, jumpDist, 127)) {
  	/*
--- 649,655 ----
       * Fix the target of the jumpFalse after the test.
       */
  
!     jumpDist = (int) (envPtr->codeNext - envPtr->codeStart)
  	    - jumpFalseFixup.codeOffset;
      if (TclFixupForwardJump(envPtr, &jumpFalseFixup, jumpDist, 127)) {
  	/*
***************
*** 682,688 ****
  
      envPtr->exceptArrayPtr[bodyRange].breakOffset =
              envPtr->exceptArrayPtr[nextRange].breakOffset =
! 	    (envPtr->codeNext - envPtr->codeStart);
      
      /*
       * The for command's result is an empty string.
--- 682,688 ----
  
      envPtr->exceptArrayPtr[bodyRange].breakOffset =
              envPtr->exceptArrayPtr[nextRange].breakOffset =
! 	    (int) (envPtr->codeNext - envPtr->codeStart);
      
      /*
       * The for command's result is an empty string.
***************
*** 893,899 ****
  	varListPtr->numVars = numVars;
  	for (j = 0;  j < numVars;  j++) {
  	    CONST char *varName = varvList[loopIndex][j];
! 	    int nameChars = strlen(varName);
  	    varListPtr->varIndexes[j] = TclFindCompiledLocal(varName,
  		    nameChars, /*create*/ 1, /*flags*/ VAR_SCALAR, procPtr);
  	}
--- 893,899 ----
  	varListPtr->numVars = numVars;
  	for (j = 0;  j < numVars;  j++) {
  	    CONST char *varName = varvList[loopIndex][j];
! 	    int nameChars = (int) strlen(varName);
  	    varListPtr->varIndexes[j] = TclFindCompiledLocal(varName,
  		    nameChars, /*create*/ 1, /*flags*/ VAR_SCALAR, procPtr);
  	}
***************
*** 941,947 ****
       */
  
      envPtr->exceptArrayPtr[range].continueOffset =
! 	    (envPtr->codeNext - envPtr->codeStart);
      TclEmitInstInt4(INST_FOREACH_STEP4, infoIndex, envPtr);
      TclEmitForwardJump(envPtr, TCL_FALSE_JUMP, &jumpFalseFixup);
      
--- 941,947 ----
       */
  
      envPtr->exceptArrayPtr[range].continueOffset =
! 	    (int) (envPtr->codeNext - envPtr->codeStart);
      TclEmitInstInt4(INST_FOREACH_STEP4, infoIndex, envPtr);
      TclEmitForwardJump(envPtr, TCL_FALSE_JUMP, &jumpFalseFixup);
      
***************
*** 950,956 ****
       */
  
      envPtr->exceptArrayPtr[range].codeOffset =
! 	    (envPtr->codeNext - envPtr->codeStart);
      code = TclCompileCmdWord(interp, bodyTokenPtr+1,
  	    bodyTokenPtr->numComponents, envPtr);
      envPtr->currStackDepth = savedStackDepth + 1;
--- 950,956 ----
       */
  
      envPtr->exceptArrayPtr[range].codeOffset =
! 	    (int) (envPtr->codeNext - envPtr->codeStart);
      code = TclCompileCmdWord(interp, bodyTokenPtr+1,
  	    bodyTokenPtr->numComponents, envPtr);
      envPtr->currStackDepth = savedStackDepth + 1;
***************
*** 963,969 ****
  	goto done;
      }
      envPtr->exceptArrayPtr[range].numCodeBytes =
! 	    (envPtr->codeNext - envPtr->codeStart)
  	    - envPtr->exceptArrayPtr[range].codeOffset;
      TclEmitOpcode(INST_POP, envPtr);
  	
--- 963,969 ----
  	goto done;
      }
      envPtr->exceptArrayPtr[range].numCodeBytes =
! 	    (int) (envPtr->codeNext - envPtr->codeStart)
  	    - envPtr->exceptArrayPtr[range].codeOffset;
      TclEmitOpcode(INST_POP, envPtr);
  	
***************
*** 974,980 ****
       * replace the ifFalse jump with a 4 byte jump.
       */
  
!     jumpBackOffset = (envPtr->codeNext - envPtr->codeStart);
      jumpBackDist =
  	(jumpBackOffset - envPtr->exceptArrayPtr[range].continueOffset);
      if (jumpBackDist > 120) {
--- 974,980 ----
       * replace the ifFalse jump with a 4 byte jump.
       */
  
!     jumpBackOffset = (int) (envPtr->codeNext - envPtr->codeStart);
      jumpBackDist =
  	(jumpBackOffset - envPtr->exceptArrayPtr[range].continueOffset);
      if (jumpBackDist > 120) {
***************
*** 987,993 ****
       * Fix the target of the jump after the foreach_step test.
       */
  
!     jumpDist = (envPtr->codeNext - envPtr->codeStart)
  	    - jumpFalseFixup.codeOffset;
      if (TclFixupForwardJump(envPtr, &jumpFalseFixup, jumpDist, 127)) {
  	/*
--- 987,993 ----
       * Fix the target of the jump after the foreach_step test.
       */
  
!     jumpDist = (int) (envPtr->codeNext - envPtr->codeStart)
  	    - jumpFalseFixup.codeOffset;
      if (TclFixupForwardJump(envPtr, &jumpFalseFixup, jumpDist, 127)) {
  	/*
***************
*** 1016,1022 ****
       */
  
      envPtr->exceptArrayPtr[range].breakOffset =
! 	    (envPtr->codeNext - envPtr->codeStart);
      
      /*
       * The foreach command's result is an empty string.
--- 1016,1022 ----
       */
  
      envPtr->exceptArrayPtr[range].breakOffset =
! 	    (int) (envPtr->codeNext - envPtr->codeStart);
      
      /*
       * The foreach command's result is an empty string.
***************
*** 1319,1325 ****
  	 * 4 byte jump.
  	 */
  
! 	jumpDist = (envPtr->codeNext - envPtr->codeStart)
  	        - jumpFalseFixupArray.fixup[jumpIndex].codeOffset;
  	if (TclFixupForwardJump(envPtr,
  	        &(jumpFalseFixupArray.fixup[jumpIndex]), jumpDist, 120)) {
--- 1319,1325 ----
  	 * 4 byte jump.
  	 */
  
! 	jumpDist = (int) (envPtr->codeNext - envPtr->codeStart)
  	        - jumpFalseFixupArray.fixup[jumpIndex].codeOffset;
  	if (TclFixupForwardJump(envPtr,
  	        &(jumpFalseFixupArray.fixup[jumpIndex]), jumpDist, 120)) {
***************
*** 1407,1413 ****
      
      for (j = jumpEndFixupArray.next;  j > 0;  j--) {
  	jumpIndex = (j - 1);	/* i.e. process the closest jump first */
! 	jumpDist = (envPtr->codeNext - envPtr->codeStart)
  	        - jumpEndFixupArray.fixup[jumpIndex].codeOffset;
  	if (TclFixupForwardJump(envPtr,
  	        &(jumpEndFixupArray.fixup[jumpIndex]), jumpDist, 127)) {
--- 1407,1413 ----
      
      for (j = jumpEndFixupArray.next;  j > 0;  j--) {
  	jumpIndex = (j - 1);	/* i.e. process the closest jump first */
! 	jumpDist = (int) (envPtr->codeNext - envPtr->codeStart)
  	        - jumpEndFixupArray.fixup[jumpIndex].codeOffset;
  	if (TclFixupForwardJump(envPtr,
  	        &(jumpEndFixupArray.fixup[jumpIndex]), jumpDist, 127)) {
***************
*** 2815,2828 ****
  	TclMax(envPtr->exceptDepth, envPtr->maxExceptDepth);
      range = TclCreateExceptRange(LOOP_EXCEPTION_RANGE, envPtr);
      envPtr->exceptArrayPtr[range].continueOffset =
! 	    (envPtr->codeNext - envPtr->codeStart);
  
      /*
       * Compile the test expression then emit the conditional jump that
       * terminates the while. We already know it's a simple word.
       */
  
!     testCodeOffset = (envPtr->codeNext - envPtr->codeStart);
      envPtr->exceptArrayPtr[range].continueOffset = testCodeOffset;
      code = TclCompileExprWords(interp, testTokenPtr, 1, envPtr);
      if (code != TCL_OK) {
--- 2815,2828 ----
  	TclMax(envPtr->exceptDepth, envPtr->maxExceptDepth);
      range = TclCreateExceptRange(LOOP_EXCEPTION_RANGE, envPtr);
      envPtr->exceptArrayPtr[range].continueOffset =
! 	    (int) (envPtr->codeNext - envPtr->codeStart);
  
      /*
       * Compile the test expression then emit the conditional jump that
       * terminates the while. We already know it's a simple word.
       */
  
!     testCodeOffset = (int) (envPtr->codeNext - envPtr->codeStart);
      envPtr->exceptArrayPtr[range].continueOffset = testCodeOffset;
      code = TclCompileExprWords(interp, testTokenPtr, 1, envPtr);
      if (code != TCL_OK) {
***************
*** 2841,2847 ****
      envPtr->currStackDepth = savedStackDepth;
      bodyTokenPtr = testTokenPtr + (testTokenPtr->numComponents + 1);
      envPtr->exceptArrayPtr[range].codeOffset =
! 	    (envPtr->codeNext - envPtr->codeStart);
      code = TclCompileCmdWord(interp, bodyTokenPtr+1,
  	    bodyTokenPtr->numComponents, envPtr);
      envPtr->currStackDepth = savedStackDepth + 1;
--- 2841,2847 ----
      envPtr->currStackDepth = savedStackDepth;
      bodyTokenPtr = testTokenPtr + (testTokenPtr->numComponents + 1);
      envPtr->exceptArrayPtr[range].codeOffset =
! 	    (int) (envPtr->codeNext - envPtr->codeStart);
      code = TclCompileCmdWord(interp, bodyTokenPtr+1,
  	    bodyTokenPtr->numComponents, envPtr);
      envPtr->currStackDepth = savedStackDepth + 1;
***************
*** 2854,2860 ****
  	goto error;
      }
      envPtr->exceptArrayPtr[range].numCodeBytes =
! 	    (envPtr->codeNext - envPtr->codeStart)
  	    - envPtr->exceptArrayPtr[range].codeOffset;
      TclEmitOpcode(INST_POP, envPtr);
  	
--- 2854,2860 ----
  	goto error;
      }
      envPtr->exceptArrayPtr[range].numCodeBytes =
! 	    (int) (envPtr->codeNext - envPtr->codeStart)
  	    - envPtr->exceptArrayPtr[range].codeOffset;
      TclEmitOpcode(INST_POP, envPtr);
  	
***************
*** 2865,2871 ****
       * replace the ifFalse jump with a 4 byte jump.
       */
  
!     jumpBackOffset = (envPtr->codeNext - envPtr->codeStart);
      jumpBackDist = (jumpBackOffset - testCodeOffset);
      if (jumpBackDist > 120) {
  	TclEmitInstInt4(INST_JUMP4, -jumpBackDist, envPtr);
--- 2865,2871 ----
       * replace the ifFalse jump with a 4 byte jump.
       */
  
!     jumpBackOffset = (int) (envPtr->codeNext - envPtr->codeStart);
      jumpBackDist = (jumpBackOffset - testCodeOffset);
      if (jumpBackDist > 120) {
  	TclEmitInstInt4(INST_JUMP4, -jumpBackDist, envPtr);
***************
*** 2877,2883 ****
       * Fix the target of the jumpFalse after the test. 
       */
  
!     jumpDist = (envPtr->codeNext - envPtr->codeStart)
  	    - jumpFalseFixup.codeOffset;
      if (TclFixupForwardJump(envPtr, &jumpFalseFixup, jumpDist, 127)) {
  	/*
--- 2877,2883 ----
       * Fix the target of the jumpFalse after the test. 
       */
  
!     jumpDist = (int) (envPtr->codeNext - envPtr->codeStart)
  	    - jumpFalseFixup.codeOffset;
      if (TclFixupForwardJump(envPtr, &jumpFalseFixup, jumpDist, 127)) {
  	/*
***************
*** 2906,2912 ****
       */
  
      envPtr->exceptArrayPtr[range].breakOffset =
! 	    (envPtr->codeNext - envPtr->codeStart);
      
      /*
       * The while command's result is an empty string.
--- 2906,2912 ----
       */
  
      envPtr->exceptArrayPtr[range].breakOffset =
! 	    (int) (envPtr->codeNext - envPtr->codeStart);
      
      /*
       * The while command's result is an empty string.
***************
*** 3035,3043 ****
          }
          if (simpleVarName) {
              name = varTokenPtr[1].start;
!             nameChars = p - varTokenPtr[1].start;
              elName = p + 1;
!             elNameChars = (varTokenPtr[n].start - p) + varTokenPtr[n].size - 2;
  
              /*
               * If elName contains any double quotes ("), we can't inline
--- 3035,3043 ----
          }
          if (simpleVarName) {
              name = varTokenPtr[1].start;
!             nameChars = (int) (p - varTokenPtr[1].start);
              elName = p + 1;
!             elNameChars = (int) (varTokenPtr[n].start - p) + varTokenPtr[n].size - 2;
  
              /*
               * If elName contains any double quotes ("), we can't inline

*** generic/tclCompExpr.c	2001/12/11 14:29:40	1.8
--- generic/tclCompExpr.c	2002/01/29 06:43:01
***************
*** 242,248 ****
       */
  
      if (numBytes < 0) {
! 	numBytes = (script? strlen(script) : 0);
      }
      if (!opTableInitialized) {
  	Tcl_MutexLock(&opMutex);
--- 242,248 ----
       */
  
      if (numBytes < 0) {
! 	numBytes = (script ? (int) strlen(script) : 0);
      }
      if (!opTableInitialized) {
  	Tcl_MutexLock(&opMutex);
***************
*** 678,691 ****
      TclEmitForwardJump(envPtr, TCL_TRUE_JUMP, &lhsTrueFixup);
      TclEmitPush(TclRegisterLiteral(envPtr, "0", 1, /*onHeap*/ 0), envPtr);
      TclEmitForwardJump(envPtr, TCL_UNCONDITIONAL_JUMP, &lhsEndFixup);
!     dist = (envPtr->codeNext - envPtr->codeStart) - lhsTrueFixup.codeOffset;
      if (TclFixupForwardJump(envPtr, &lhsTrueFixup, dist, 127)) {
          badDist:
  	panic("CompileLandOrLorExpr: bad jump distance %d\n", dist);
      }
      envPtr->currStackDepth = savedStackDepth;
      TclEmitPush(TclRegisterLiteral(envPtr, "1", 1, /*onHeap*/ 0), envPtr);
!     dist = (envPtr->codeNext - envPtr->codeStart) - lhsEndFixup.codeOffset;
      if (TclFixupForwardJump(envPtr, &lhsEndFixup, dist, 127)) {
  	goto badDist;
      }
--- 678,691 ----
      TclEmitForwardJump(envPtr, TCL_TRUE_JUMP, &lhsTrueFixup);
      TclEmitPush(TclRegisterLiteral(envPtr, "0", 1, /*onHeap*/ 0), envPtr);
      TclEmitForwardJump(envPtr, TCL_UNCONDITIONAL_JUMP, &lhsEndFixup);
!     dist = (int) (envPtr->codeNext - envPtr->codeStart) - lhsTrueFixup.codeOffset;
      if (TclFixupForwardJump(envPtr, &lhsTrueFixup, dist, 127)) {
          badDist:
  	panic("CompileLandOrLorExpr: bad jump distance %d\n", dist);
      }
      envPtr->currStackDepth = savedStackDepth;
      TclEmitPush(TclRegisterLiteral(envPtr, "1", 1, /*onHeap*/ 0), envPtr);
!     dist = (int) (envPtr->codeNext - envPtr->codeStart) - lhsEndFixup.codeOffset;
      if (TclFixupForwardJump(envPtr, &lhsEndFixup, dist, 127)) {
  	goto badDist;
      }
***************
*** 724,730 ****
       * correct distance.
       */
  
!     dist = (envPtr->codeNext - envPtr->codeStart)
  	    - shortCircuitFixup.codeOffset;
      TclFixupForwardJump(envPtr, &shortCircuitFixup, dist, 127);
      *endPtrPtr = tokenPtr;
--- 724,730 ----
       * correct distance.
       */
  
!     dist = (int) (envPtr->codeNext - envPtr->codeStart)
  	    - shortCircuitFixup.codeOffset;
      TclFixupForwardJump(envPtr, &shortCircuitFixup, dist, 127);
      *endPtrPtr = tokenPtr;
***************
*** 820,826 ****
       */
  
      envPtr->currStackDepth = savedStackDepth;
!     elseCodeOffset = (envPtr->codeNext - envPtr->codeStart);
      infoPtr->hasOperators = 0;
      code = CompileSubExpr(tokenPtr, infoPtr, envPtr);
      if (code != TCL_OK) {
--- 820,826 ----
       */
  
      envPtr->currStackDepth = savedStackDepth;
!     elseCodeOffset = (int) (envPtr->codeNext - envPtr->codeStart);
      infoPtr->hasOperators = 0;
      code = CompileSubExpr(tokenPtr, infoPtr, envPtr);
      if (code != TCL_OK) {
***************
*** 835,841 ****
       * Fix up the second jump around the "else" expression.
       */
  
!     dist = (envPtr->codeNext - envPtr->codeStart)
  	    - jumpAroundElseFixup.codeOffset;
      if (TclFixupForwardJump(envPtr, &jumpAroundElseFixup, dist, 127)) {
  	/*
--- 835,841 ----
       * Fix up the second jump around the "else" expression.
       */
  
!     dist = (int) (envPtr->codeNext - envPtr->codeStart)
  	    - jumpAroundElseFixup.codeOffset;
      if (TclFixupForwardJump(envPtr, &jumpAroundElseFixup, dist, 127)) {
  	/*
***************
*** 1013,1023 ****
      ExprInfo *infoPtr;		/* Describes the compilation state for the
  				 * expression being compiled. */
  {
!     int numBytes = (infoPtr->lastChar - infoPtr->expr);
      char buffer[100];
  
      sprintf(buffer, "syntax error in expression \"%.*s\"",
! 	    ((numBytes > 60)? 60 : numBytes), infoPtr->expr);
      Tcl_AppendStringsToObj(Tcl_GetObjResult(infoPtr->interp),
  	    buffer, (char *) NULL);
  }
--- 1013,1023 ----
      ExprInfo *infoPtr;		/* Describes the compilation state for the
  				 * expression being compiled. */
  {
!     int numBytes = (int) (infoPtr->lastChar - infoPtr->expr);
      char buffer[100];
  
      sprintf(buffer, "syntax error in expression \"%.*s\"",
! 	    ((numBytes > 60) ? 60 : numBytes), infoPtr->expr);
      Tcl_AppendStringsToObj(Tcl_GetObjResult(infoPtr->interp),
  	    buffer, (char *) NULL);
  }

*** generic/tclCompile.c	2002/01/25 20:40:55	1.31
--- generic/tclCompile.c	2002/01/29 06:43:11
***************
*** 831,837 ****
      Tcl_DStringInit(&ds);
  
      if (numBytes < 0) {
! 	numBytes = strlen(script);
      }
      Tcl_ResetResult(interp);
      isFirstCmd = 1;
--- 831,837 ----
      Tcl_DStringInit(&ds);
  
      if (numBytes < 0) {
! 	numBytes = (int) strlen(script);
      }
      Tcl_ResetResult(interp);
      isFirstCmd = 1;
***************
*** 861,867 ****
  		TclEmitOpcode(INST_POP, envPtr);
  		if (!nested) {
  		    envPtr->cmdMapPtr[lastTopLevelCmdIndex].numCodeBytes =
! 			   (envPtr->codeNext - envPtr->codeStart)
  			   - startCodeOffset;
  		}
  	    }
--- 861,867 ----
  		TclEmitOpcode(INST_POP, envPtr);
  		if (!nested) {
  		    envPtr->cmdMapPtr[lastTopLevelCmdIndex].numCodeBytes =
! 			   (int) (envPtr->codeNext - envPtr->codeStart)
  			   - startCodeOffset;
  		}
  	    }
***************
*** 910,918 ****
  	    if (!nested) {
  		lastTopLevelCmdIndex = currCmdIndex;
  	    }
! 	    startCodeOffset = (envPtr->codeNext - envPtr->codeStart);
  	    EnterCmdStartData(envPtr, currCmdIndex,
! 	            (parse.commandStart - envPtr->source), startCodeOffset);
  	    
  	    for (wordIdx = 0, tokenPtr = parse.tokenPtr;
  		    wordIdx < parse.numWords;
--- 910,918 ----
  	    if (!nested) {
  		lastTopLevelCmdIndex = currCmdIndex;
  	    }
! 	    startCodeOffset = (int) (envPtr->codeNext - envPtr->codeStart);
  	    EnterCmdStartData(envPtr, currCmdIndex,
! 	            (int) (parse.commandStart - envPtr->source), startCodeOffset);
  	    
  	    for (wordIdx = 0, tokenPtr = parse.tokenPtr;
  		    wordIdx < parse.numWords;
***************
*** 1020,1026 ****
  
  	    finishCommand:
  	    EnterCmdExtentData(envPtr, currCmdIndex, commandLength,
! 		    (envPtr->codeNext-envPtr->codeStart) - startCodeOffset);
  	    isFirstCmd = 0;
  	} /* end if parse.numWords > 0 */
  
--- 1020,1026 ----
  
  	    finishCommand:
  	    EnterCmdExtentData(envPtr, currCmdIndex, commandLength,
! 		    (int) (envPtr->codeNext-envPtr->codeStart) - startCodeOffset);
  	    isFirstCmd = 0;
  	} /* end if parse.numWords > 0 */
  
***************
*** 1029,1035 ****
  	 */
  	
  	next = parse.commandStart + parse.commandSize;
! 	bytesLeft -= (next - p);
  	p = next;
  	Tcl_FreeParse(&parse);
  	gotParse = 0;
--- 1029,1035 ----
  	 */
  	
  	next = parse.commandStart + parse.commandSize;
! 	bytesLeft -= (int) (next - p);
  	p = next;
  	Tcl_FreeParse(&parse);
  	gotParse = 0;
***************
*** 1055,1063 ****
      }
      
      if ((nested != 0) && (p > script) && (p[-1] == ']')) {
! 	iPtr->termOffset = (p - 1) - script;
      } else {
! 	iPtr->termOffset = (p - script);
      }
      Tcl_DStringFree(&ds);
      return TCL_OK;
--- 1055,1063 ----
      }
      
      if ((nested != 0) && (p > script) && (p[-1] == ']')) {
! 	iPtr->termOffset = (int) ((p - 1) - script);
      } else {
! 	iPtr->termOffset = (int) (p - script);
      }
      Tcl_DStringFree(&ds);
      return TCL_OK;
***************
*** 1090,1096 ****
      if (gotParse) {
  	Tcl_FreeParse(&parse);
      }
!     iPtr->termOffset = (p - script);
      Tcl_DStringFree(&ds);
      return code;
  }
--- 1090,1096 ----
      if (gotParse) {
  	Tcl_FreeParse(&parse);
      }
!     iPtr->termOffset = (int) (p - script);
      Tcl_DStringFree(&ds);
      return code;
  }
***************
*** 1490,1507 ****
  				  * which to create a ByteCode structure. */
  {
      register ByteCode *codePtr;
!     size_t codeBytes, objArrayBytes, exceptArrayBytes, cmdLocBytes;
      size_t auxDataArrayBytes, structureSize;
      register unsigned char *p;
      unsigned char *nextPtr;
      int numLitObjects = envPtr->literalArrayNext;
      Namespace *namespacePtr;
!     int i;
      Interp *iPtr;
  
      iPtr = envPtr->iPtr;
  
!     codeBytes = (envPtr->codeNext - envPtr->codeStart);
      objArrayBytes = (envPtr->literalArrayNext * sizeof(Tcl_Obj *));
      exceptArrayBytes = (envPtr->exceptArrayNext * sizeof(ExceptionRange));
      auxDataArrayBytes = (envPtr->auxDataArrayNext * sizeof(AuxData));
--- 1490,1507 ----
  				  * which to create a ByteCode structure. */
  {
      register ByteCode *codePtr;
!     size_t objArrayBytes, exceptArrayBytes;
      size_t auxDataArrayBytes, structureSize;
      register unsigned char *p;
      unsigned char *nextPtr;
      int numLitObjects = envPtr->literalArrayNext;
      Namespace *namespacePtr;
!     int i, codeBytes, cmdLocBytes;
      Interp *iPtr;
  
      iPtr = envPtr->iPtr;
  
!     codeBytes = (int) (envPtr->codeNext - envPtr->codeStart);
      objArrayBytes = (envPtr->literalArrayNext * sizeof(Tcl_Obj *));
      exceptArrayBytes = (envPtr->exceptArrayNext * sizeof(ExceptionRange));
      auxDataArrayBytes = (envPtr->auxDataArrayNext * sizeof(AuxData));
***************
*** 1524,1530 ****
          namespacePtr = envPtr->iPtr->globalNsPtr;
      }
      
!     p = (unsigned char *) ckalloc((size_t) structureSize);
      codePtr = (ByteCode *) p;
      codePtr->interpHandle = TclHandlePreserve(iPtr->handle);
      codePtr->compileEpoch = iPtr->compileEpoch;
--- 1524,1530 ----
          namespacePtr = envPtr->iPtr->globalNsPtr;
      }
      
!     p = (unsigned char *) ckalloc(structureSize);
      codePtr = (ByteCode *) p;
      codePtr->interpHandle = TclHandlePreserve(iPtr->handle);
      codePtr->compileEpoch = iPtr->compileEpoch;
***************
*** 1672,1678 ****
       */
  
      if (length < 0) {
! 	length = strlen(command);
      }
      if (length > 150) {
  	length = 150;
--- 1672,1678 ----
       */
  
      if (length < 0) {
! 	length = (int) strlen(command);
      }
      if (length > 150) {
  	length = 150;
***************
*** 1991,2001 ****
  	 * from cmdMapPtr[0] up to cmdMapPtr[envPtr->cmdMapEnd] (inclusive).
  	 */
  
! 	size_t currElems = envPtr->cmdMapEnd;
! 	size_t newElems  = 2*currElems;
  	size_t currBytes = currElems * sizeof(CmdLocation);
  	size_t newBytes  = newElems  * sizeof(CmdLocation);
! 	CmdLocation *newPtr = (CmdLocation *) ckalloc((unsigned) newBytes);
  	
  	/*
  	 * Copy from old command location array to new, free old command
--- 1991,2001 ----
  	 * from cmdMapPtr[0] up to cmdMapPtr[envPtr->cmdMapEnd] (inclusive).
  	 */
  
! 	int currElems = envPtr->cmdMapEnd;
! 	int newElems  = 2*currElems;
  	size_t currBytes = currElems * sizeof(CmdLocation);
  	size_t newBytes  = newElems  * sizeof(CmdLocation);
! 	CmdLocation *newPtr = (CmdLocation *) ckalloc(newBytes);
  	
  	/*
  	 * Copy from old command location array to new, free old command
***************
*** 2361,2367 ****
       */
      
      jumpFixupPtr->jumpType = jumpType;
!     jumpFixupPtr->codeOffset = (envPtr->codeNext - envPtr->codeStart);
      jumpFixupPtr->cmdIndex = envPtr->numCommands;
      jumpFixupPtr->exceptIndex = envPtr->exceptArrayNext;
      
--- 2361,2367 ----
       */
      
      jumpFixupPtr->jumpType = jumpType;
!     jumpFixupPtr->codeOffset = (int) (envPtr->codeNext - envPtr->codeStart);
      jumpFixupPtr->cmdIndex = envPtr->numCommands;
      jumpFixupPtr->exceptIndex = envPtr->exceptArrayNext;
      
***************
*** 2447,2454 ****
          TclExpandCodeArray(envPtr);
      }
      jumpPc = (envPtr->codeStart + jumpFixupPtr->codeOffset);
!     for (numBytes = envPtr->codeNext-jumpPc-2, p = jumpPc+2+numBytes-1;
! 	    numBytes > 0;  numBytes--, p--) {
  	p[3] = p[0];
      }
      envPtr->codeNext += 3;
--- 2447,2454 ----
          TclExpandCodeArray(envPtr);
      }
      jumpPc = (envPtr->codeStart + jumpFixupPtr->codeOffset);
!     for (numBytes = (unsigned int)(envPtr->codeNext-jumpPc-2),
! 	    p = jumpPc+2+numBytes-1; numBytes > 0;  numBytes--, p--) {
  	p[3] = p[0];
      }
      envPtr->codeNext += 3;
***************
*** 3183,3189 ****
      unsigned char opCode = *pc;
      register InstructionDesc *instDesc = &instructionTable[opCode];
      unsigned char *codeStart = codePtr->codeStart;
!     unsigned int pcOffset = (pc - codeStart);
      int opnd, i, j;
      
      fprintf(stdout, "(%u) %s ", pcOffset, instDesc->name);
--- 3183,3189 ----
      unsigned char opCode = *pc;
      register InstructionDesc *instDesc = &instructionTable[opCode];
      unsigned char *codeStart = codePtr->codeStart;
!     unsigned int pcOffset = (unsigned int) (pc - codeStart);
      int opnd, i, j;
      
      fprintf(stdout, "(%u) %s ", pcOffset, instDesc->name);

*** generic/tclDate.c	2001/10/18 20:20:28	1.20
--- generic/tclDate.c	2002/01/29 06:43:17
***************
*** 451,457 ****
      };
      time_t tod;
      time_t Julian;
!     int i;
  
      /* Figure out how many days are in February for the given year.
       * Every year divisible by 4 is a leap year.
--- 451,457 ----
      };
      time_t tod;
      time_t Julian;
!     time_t i;
  
      /* Figure out how many days are in February for the given year.
       * Every year divisible by 4 is a leap year.
***************
*** 544,550 ****
       *  doing next february from january gives us february of the current year)
       * set day to 1, time to 0
       */
!     tm->tm_year += MonthOrdinal;
      if (tm->tm_mon < MonthNumber - 1) {
  	tm->tm_year--;
      }
--- 544,550 ----
       *  doing next february from january gives us february of the current year)
       * set day to 1, time to 0
       */
!     tm->tm_year += (int) MonthOrdinal;
      if (tm->tm_mon < MonthNumber - 1) {
  	tm->tm_year--;
      }
***************
*** 714,720 ****
      /*
       * Strip off any plural and try the units table again.
       */
!     i = strlen(buff) - 1;
      if (buff[i] == 's') {
          buff[i] = '\0';
          for (tp = UnitsTable; tp->name; tp++) {
--- 714,720 ----
      /*
       * Strip off any plural and try the units table again.
       */
!     i = (int) strlen(buff) - 1;
      if (buff[i] == 's') {
          buff[i] = '\0';
          for (tp = UnitsTable; tp->name; tp++) {
***************
*** 932,938 ****
  	Start += tod;
      }
      
!     *timePtr = Start;
      return 0;
  }
  static CONST TclDatetabelem TclDateexca[] ={
--- 932,938 ----
  	Start += tod;
      }
      
!     *timePtr = (unsigned long) Start;
      return 0;
  }
  static CONST TclDatetabelem TclDateexca[] ={
***************
*** 1335,1343 ****
  			** reallocate and recover.  Note that pointers
  			** have to be reset, or bad things will happen
  			*/
! 			long TclDateps_index = (TclDate_ps - TclDates);
! 			long TclDatepv_index = (TclDate_pv - TclDatev);
! 			long TclDatepvt_index = (TclDatepvt - TclDatev);
  			int TclDatenewmax;
  #ifdef YYEXPAND
  			TclDatenewmax = YYEXPAND(TclDatemaxdepth);
--- 1335,1343 ----
  			** reallocate and recover.  Note that pointers
  			** have to be reset, or bad things will happen
  			*/
! 			long TclDateps_index = (long) (TclDate_ps - TclDates);
! 			long TclDatepv_index = (long) (TclDate_pv - TclDatev);
! 			long TclDatepvt_index = (long) (TclDatepvt - TclDatev);
  			int TclDatenewmax;
  #ifdef YYEXPAND
  			TclDatenewmax = YYEXPAND(TclDatemaxdepth);

*** generic/tclDecls.h	2002/01/25 21:36:09	1.79
--- generic/tclDecls.h	2002/01/29 06:43:31
***************
*** 37,58 ****
  /* 2 */
  EXTERN void		Tcl_Panic _ANSI_ARGS_(TCL_VARARGS(CONST char *,format));
  /* 3 */
! EXTERN char *		Tcl_Alloc _ANSI_ARGS_((unsigned int size));
  /* 4 */
  EXTERN void		Tcl_Free _ANSI_ARGS_((char * ptr));
  /* 5 */
! EXTERN char *		Tcl_Realloc _ANSI_ARGS_((char * ptr, 
! 				unsigned int size));
  /* 6 */
! EXTERN char *		Tcl_DbCkalloc _ANSI_ARGS_((unsigned int size, 
  				CONST char * file, int line));
  /* 7 */
  EXTERN int		Tcl_DbCkfree _ANSI_ARGS_((char * ptr, 
  				CONST char * file, int line));
  /* 8 */
! EXTERN char *		Tcl_DbCkrealloc _ANSI_ARGS_((char * ptr, 
! 				unsigned int size, CONST char * file, 
! 				int line));
  #if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */
  /* 9 */
  EXTERN void		Tcl_CreateFileHandler _ANSI_ARGS_((int fd, int mask, 
--- 37,56 ----
  /* 2 */
  EXTERN void		Tcl_Panic _ANSI_ARGS_(TCL_VARARGS(CONST char *,format));
  /* 3 */
! EXTERN char *		Tcl_Alloc _ANSI_ARGS_((size_t size));
  /* 4 */
  EXTERN void		Tcl_Free _ANSI_ARGS_((char * ptr));
  /* 5 */
! EXTERN char *		Tcl_Realloc _ANSI_ARGS_((char * ptr, size_t size));
  /* 6 */
! EXTERN char *		Tcl_DbCkalloc _ANSI_ARGS_((size_t size, 
  				CONST char * file, int line));
  /* 7 */
  EXTERN int		Tcl_DbCkfree _ANSI_ARGS_((char * ptr, 
  				CONST char * file, int line));
  /* 8 */
! EXTERN char *		Tcl_DbCkrealloc _ANSI_ARGS_((char * ptr, size_t size, 
! 				CONST char * file, int line));
  #if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */
  /* 9 */
  EXTERN void		Tcl_CreateFileHandler _ANSI_ARGS_((int fd, int mask, 
***************
*** 1351,1367 ****
  				Tcl_CommandTraceProc * proc, 
  				ClientData clientData));
  /* 428 */
! EXTERN char *		Tcl_AttemptAlloc _ANSI_ARGS_((unsigned int size));
  /* 429 */
! EXTERN char *		Tcl_AttemptDbCkalloc _ANSI_ARGS_((unsigned int size, 
  				CONST char * file, int line));
  /* 430 */
  EXTERN char *		Tcl_AttemptRealloc _ANSI_ARGS_((char * ptr, 
! 				unsigned int size));
  /* 431 */
  EXTERN char *		Tcl_AttemptDbCkrealloc _ANSI_ARGS_((char * ptr, 
! 				unsigned int size, CONST char * file, 
! 				int line));
  /* 432 */
  EXTERN int		Tcl_AttemptSetObjLength _ANSI_ARGS_((
  				Tcl_Obj * objPtr, int length));
--- 1349,1364 ----
  				Tcl_CommandTraceProc * proc, 
  				ClientData clientData));
  /* 428 */
! EXTERN char *		Tcl_AttemptAlloc _ANSI_ARGS_((size_t size));
  /* 429 */
! EXTERN char *		Tcl_AttemptDbCkalloc _ANSI_ARGS_((size_t size, 
  				CONST char * file, int line));
  /* 430 */
  EXTERN char *		Tcl_AttemptRealloc _ANSI_ARGS_((char * ptr, 
! 				size_t size));
  /* 431 */
  EXTERN char *		Tcl_AttemptDbCkrealloc _ANSI_ARGS_((char * ptr, 
! 				size_t size, CONST char * file, int line));
  /* 432 */
  EXTERN int		Tcl_AttemptSetObjLength _ANSI_ARGS_((
  				Tcl_Obj * objPtr, int length));
***************
*** 1533,1544 ****
      int (*tcl_PkgProvideEx) _ANSI_ARGS_((Tcl_Interp* interp, CONST char* name, CONST char* version, ClientData clientData)); /* 0 */
      CONST char * (*tcl_PkgRequireEx) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * name, CONST char * version, int exact, ClientData * clientDataPtr)); /* 1 */
      void (*tcl_Panic) _ANSI_ARGS_(TCL_VARARGS(CONST char *,format)); /* 2 */
!     char * (*tcl_Alloc) _ANSI_ARGS_((unsigned int size)); /* 3 */
      void (*tcl_Free) _ANSI_ARGS_((char * ptr)); /* 4 */
!     char * (*tcl_Realloc) _ANSI_ARGS_((char * ptr, unsigned int size)); /* 5 */
!     char * (*tcl_DbCkalloc) _ANSI_ARGS_((unsigned int size, CONST char * file, int line)); /* 6 */
      int (*tcl_DbCkfree) _ANSI_ARGS_((char * ptr, CONST char * file, int line)); /* 7 */
!     char * (*tcl_DbCkrealloc) _ANSI_ARGS_((char * ptr, unsigned int size, CONST char * file, int line)); /* 8 */
  #if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */
      void (*tcl_CreateFileHandler) _ANSI_ARGS_((int fd, int mask, Tcl_FileProc * proc, ClientData clientData)); /* 9 */
  #endif /* UNIX */
--- 1530,1541 ----
      int (*tcl_PkgProvideEx) _ANSI_ARGS_((Tcl_Interp* interp, CONST char* name, CONST char* version, ClientData clientData)); /* 0 */
      CONST char * (*tcl_PkgRequireEx) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * name, CONST char * version, int exact, ClientData * clientDataPtr)); /* 1 */
      void (*tcl_Panic) _ANSI_ARGS_(TCL_VARARGS(CONST char *,format)); /* 2 */
!     char * (*tcl_Alloc) _ANSI_ARGS_((size_t size)); /* 3 */
      void (*tcl_Free) _ANSI_ARGS_((char * ptr)); /* 4 */
!     char * (*tcl_Realloc) _ANSI_ARGS_((char * ptr, size_t size)); /* 5 */
!     char * (*tcl_DbCkalloc) _ANSI_ARGS_((size_t size, CONST char * file, int line)); /* 6 */
      int (*tcl_DbCkfree) _ANSI_ARGS_((char * ptr, CONST char * file, int line)); /* 7 */
!     char * (*tcl_DbCkrealloc) _ANSI_ARGS_((char * ptr, size_t size, CONST char * file, int line)); /* 8 */
  #if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */
      void (*tcl_CreateFileHandler) _ANSI_ARGS_((int fd, int mask, Tcl_FileProc * proc, ClientData clientData)); /* 9 */
  #endif /* UNIX */
***************
*** 2006,2015 ****
      ClientData (*tcl_CommandTraceInfo) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * varName, int flags, Tcl_CommandTraceProc * procPtr, ClientData prevClientData)); /* 425 */
      int (*tcl_TraceCommand) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * varName, int flags, Tcl_CommandTraceProc * proc, ClientData clientData)); /* 426 */
      void (*tcl_UntraceCommand) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * varName, int flags, Tcl_CommandTraceProc * proc, ClientData clientData)); /* 427 */
!     char * (*tcl_AttemptAlloc) _ANSI_ARGS_((unsigned int size)); /* 428 */
!     char * (*tcl_AttemptDbCkalloc) _ANSI_ARGS_((unsigned int size, CONST char * file, int line)); /* 429 */
!     char * (*tcl_AttemptRealloc) _ANSI_ARGS_((char * ptr, unsigned int size)); /* 430 */
!     char * (*tcl_AttemptDbCkrealloc) _ANSI_ARGS_((char * ptr, unsigned int size, CONST char * file, int line)); /* 431 */
      int (*tcl_AttemptSetObjLength) _ANSI_ARGS_((Tcl_Obj * objPtr, int length)); /* 432 */
      Tcl_ThreadId (*tcl_GetChannelThread) _ANSI_ARGS_((Tcl_Channel channel)); /* 433 */
      Tcl_UniChar * (*tcl_GetUnicodeFromObj) _ANSI_ARGS_((Tcl_Obj * objPtr, int * lengthPtr)); /* 434 */
--- 2003,2012 ----
      ClientData (*tcl_CommandTraceInfo) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * varName, int flags, Tcl_CommandTraceProc * procPtr, ClientData prevClientData)); /* 425 */
      int (*tcl_TraceCommand) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * varName, int flags, Tcl_CommandTraceProc * proc, ClientData clientData)); /* 426 */
      void (*tcl_UntraceCommand) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * varName, int flags, Tcl_CommandTraceProc * proc, ClientData clientData)); /* 427 */
!     char * (*tcl_AttemptAlloc) _ANSI_ARGS_((size_t size)); /* 428 */
!     char * (*tcl_AttemptDbCkalloc) _ANSI_ARGS_((size_t size, CONST char * file, int line)); /* 429 */
!     char * (*tcl_AttemptRealloc) _ANSI_ARGS_((char * ptr, size_t size)); /* 430 */
!     char * (*tcl_AttemptDbCkrealloc) _ANSI_ARGS_((char * ptr, size_t size, CONST char * file, int line)); /* 431 */
      int (*tcl_AttemptSetObjLength) _ANSI_ARGS_((Tcl_Obj * objPtr, int length)); /* 432 */
      Tcl_ThreadId (*tcl_GetChannelThread) _ANSI_ARGS_((Tcl_Channel channel)); /* 433 */
      Tcl_UniChar * (*tcl_GetUnicodeFromObj) _ANSI_ARGS_((Tcl_Obj * objPtr, int * lengthPtr)); /* 434 */

*** generic/tclEncoding.c	2002/01/25 20:40:55	1.9
--- generic/tclEncoding.c	2002/01/29 06:43:38
***************
*** 95,101 ****
   */
  
  typedef struct EscapeSubTable {
!     unsigned int sequenceLen;	/* Length of following string. */
      char sequence[16];		/* Escape code that marks this encoding. */
      char name[32];		/* Name for encoding. */
      Encoding *encodingPtr;	/* Encoding loaded using above name, or NULL
--- 95,101 ----
   */
  
  typedef struct EscapeSubTable {
!     size_t sequenceLen;	/* Length of following string. */
      char sequence[16];		/* Escape code that marks this encoding. */
      char name[32];		/* Name for encoding. */
      Encoding *encodingPtr;	/* Encoding loaded using above name, or NULL
***************
*** 107,116 ****
      int fallback;		/* Character (in this encoding) to
  				 * substitute when this encoding cannot
  				 * represent a UTF-8 character. */
!     unsigned int initLen;	/* Length of following string. */
      char init[16];		/* String to emit or expect before first char
  				 * in conversion. */
!     unsigned int finalLen;	/* Length of following string. */
      char final[16];		/* String to emit or expect after last char
  				 * in conversion. */
      char prefixBytes[256];	/* If a byte in the input stream is the 
--- 107,116 ----
      int fallback;		/* Character (in this encoding) to
  				 * substitute when this encoding cannot
  				 * represent a UTF-8 character. */
!     size_t initLen;		/* Length of following string. */
      char init[16];		/* String to emit or expect before first char
  				 * in conversion. */
!     size_t finalLen;		/* Length of following string. */
      char final[16];		/* String to emit or expect after last char
  				 * in conversion. */
      char prefixBytes[256];	/* If a byte in the input stream is the 
***************
*** 808,821 ****
      if (src == NULL) {
  	srcLen = 0;
      } else if (srcLen < 0) {
! 	srcLen = (*encodingPtr->lengthProc)(src);
      }
      flags = TCL_ENCODING_START | TCL_ENCODING_END;
      while (1) {
  	result = (*encodingPtr->toUtfProc)(encodingPtr->clientData, src,
  		srcLen, flags, &state, dst, dstLen, &srcRead, &dstWrote,
  		&dstChars);
! 	soFar = dst + dstWrote - Tcl_DStringValue(dstPtr);
  	if (result != TCL_CONVERT_NOSPACE) {
  	    Tcl_DStringSetLength(dstPtr, soFar);
  	    return Tcl_DStringValue(dstPtr);
--- 808,821 ----
      if (src == NULL) {
  	srcLen = 0;
      } else if (srcLen < 0) {
! 	srcLen = (int) (*encodingPtr->lengthProc)(src);
      }
      flags = TCL_ENCODING_START | TCL_ENCODING_END;
      while (1) {
  	result = (*encodingPtr->toUtfProc)(encodingPtr->clientData, src,
  		srcLen, flags, &state, dst, dstLen, &srcRead, &dstWrote,
  		&dstChars);
! 	soFar = (int) (dst + dstWrote - Tcl_DStringValue(dstPtr));
  	if (result != TCL_CONVERT_NOSPACE) {
  	    Tcl_DStringSetLength(dstPtr, soFar);
  	    return Tcl_DStringValue(dstPtr);
***************
*** 893,899 ****
      if (src == NULL) {
  	srcLen = 0;
      } else if (srcLen < 0) {
! 	srcLen = (*encodingPtr->lengthProc)(src);
      }
      if (statePtr == NULL) {
  	flags |= TCL_ENCODING_START | TCL_ENCODING_END;
--- 893,899 ----
      if (src == NULL) {
  	srcLen = 0;
      } else if (srcLen < 0) {
! 	srcLen = (int) (*encodingPtr->lengthProc)(src);
      }
      if (statePtr == NULL) {
  	flags |= TCL_ENCODING_START | TCL_ENCODING_END;
***************
*** 971,984 ****
      if (src == NULL) {
  	srcLen = 0;
      } else if (srcLen < 0) {
! 	srcLen = strlen(src);
      }
      flags = TCL_ENCODING_START | TCL_ENCODING_END;
      while (1) {
  	result = (*encodingPtr->fromUtfProc)(encodingPtr->clientData, src,
  		srcLen, flags, &state, dst, dstLen, &srcRead, &dstWrote,
  		&dstChars);
! 	soFar = dst + dstWrote - Tcl_DStringValue(dstPtr);
  	if (result != TCL_CONVERT_NOSPACE) {
  	    if (encodingPtr->nullSize == 2) {
  	        Tcl_DStringSetLength(dstPtr, soFar + 1);
--- 971,984 ----
      if (src == NULL) {
  	srcLen = 0;
      } else if (srcLen < 0) {
! 	srcLen = (int) strlen(src);
      }
      flags = TCL_ENCODING_START | TCL_ENCODING_END;
      while (1) {
  	result = (*encodingPtr->fromUtfProc)(encodingPtr->clientData, src,
  		srcLen, flags, &state, dst, dstLen, &srcRead, &dstWrote,
  		&dstChars);
! 	soFar = (int) (dst + dstWrote - Tcl_DStringValue(dstPtr));
  	if (result != TCL_CONVERT_NOSPACE) {
  	    if (encodingPtr->nullSize == 2) {
  	        Tcl_DStringSetLength(dstPtr, soFar + 1);
***************
*** 1059,1065 ****
      if (src == NULL) {
  	srcLen = 0;
      } else if (srcLen < 0) {
! 	srcLen = strlen(src);
      }
      if (statePtr == NULL) {
  	flags |= TCL_ENCODING_START | TCL_ENCODING_END;
--- 1059,1065 ----
      if (src == NULL) {
  	srcLen = 0;
      } else if (srcLen < 0) {
! 	srcLen = (int) strlen(src);
      }
      if (statePtr == NULL) {
  	flags |= TCL_ENCODING_START | TCL_ENCODING_END;
***************
*** 1572,1578 ****
      Tcl_Channel chan;		/* File containing new encoding. */
  {
      int i;
!     unsigned int size;
      Tcl_DString escapeData;
      char init[16], final[16];
      EscapeEncodingData *dataPtr;
--- 1572,1578 ----
      Tcl_Channel chan;		/* File containing new encoding. */
  {
      int i;
!     size_t size;
      Tcl_DString escapeData;
      char init[16], final[16];
      EscapeEncodingData *dataPtr;
***************
*** 1784,1790 ****
      dstEnd = dst + dstLen - TCL_UTF_MAX;
  
      for (numChars = 0; src < srcEnd; numChars++) {
! 	if ((src > srcClose) && (!Tcl_UtfCharComplete(src, srcEnd - src))) {
  	    /*
  	     * If there is more string to follow, this will ensure that the
  	     * last UTF-8 character in the source buffer hasn't been cut off.
--- 1784,1790 ----
      dstEnd = dst + dstLen - TCL_UTF_MAX;
  
      for (numChars = 0; src < srcEnd; numChars++) {
! 	if ((src > srcClose) && (!Tcl_UtfCharComplete(src, (int) (srcEnd - src)))) {
  	    /*
  	     * If there is more string to follow, this will ensure that the
  	     * last UTF-8 character in the source buffer hasn't been cut off.
***************
*** 1801,1808 ****
  	dst += Tcl_UniCharToUtf(ch, dst);
      }
  
!     *srcReadPtr = src - srcStart;
!     *dstWrotePtr = dst - dstStart;
      *dstCharsPtr = numChars;
      return result;
  }
--- 1801,1808 ----
  	dst += Tcl_UniCharToUtf(ch, dst);
      }
  
!     *srcReadPtr = (int) (src - srcStart);
!     *dstWrotePtr = (int) (dst - dstStart);
      *dstCharsPtr = numChars;
      return result;
  }
***************
*** 1879,1886 ****
  	wSrc++;
      }
  
!     *srcReadPtr = (char *) wSrc - (char *) wSrcStart;
!     *dstWrotePtr = dst - dstStart;
      *dstCharsPtr = numChars;
      return result;
  }
--- 1879,1886 ----
  	wSrc++;
      }
  
!     *srcReadPtr = (int) ((char *) wSrc - (char *) wSrcStart);
!     *dstWrotePtr = (int) (dst - dstStart);
      *dstCharsPtr = numChars;
      return result;
  }
***************
*** 1946,1952 ****
  
      result = TCL_OK;
      for (numChars = 0; src < srcEnd; numChars++) {
! 	if ((src > srcClose) && (!Tcl_UtfCharComplete(src, srcEnd - src))) {
  	    /*
  	     * If there is more string to follow, this will ensure that the
  	     * last UTF-8 character in the source buffer hasn't been cut off.
--- 1946,1952 ----
  
      result = TCL_OK;
      for (numChars = 0; src < srcEnd; numChars++) {
! 	if ((src > srcClose) && (!Tcl_UtfCharComplete(src, (int) (srcEnd - src)))) {
  	    /*
  	     * If there is more string to follow, this will ensure that the
  	     * last UTF-8 character in the source buffer hasn't been cut off.
***************
*** 1962,1969 ****
  	src += Tcl_UtfToUniChar(src, wDst);
  	wDst++;
      }
!     *srcReadPtr = src - srcStart;
!     *dstWrotePtr = (char *) wDst - (char *) wDstStart;
      *dstCharsPtr = numChars;
      return result;
  }
--- 1962,1969 ----
  	src += Tcl_UtfToUniChar(src, wDst);
  	wDst++;
      }
!     *srcReadPtr = (int) (src - srcStart);
!     *dstWrotePtr = (int) ((char *) wDst - (char *) wDstStart);
      *dstCharsPtr = numChars;
      return result;
  }
***************
*** 2064,2071 ****
  	dst += Tcl_UniCharToUtf(ch, dst);
          src++;
      }
!     *srcReadPtr = src - srcStart;
!     *dstWrotePtr = dst - dstStart;
      *dstCharsPtr = numChars;
      return result;
  }
--- 2064,2071 ----
  	dst += Tcl_UniCharToUtf(ch, dst);
          src++;
      }
!     *srcReadPtr = (int) (src - srcStart);
!     *dstWrotePtr = (int) (dst - dstStart);
      *dstCharsPtr = numChars;
      return result;
  }
***************
*** 2140,2146 ****
      dstEnd = dst + dstLen - 1;
  
      for (numChars = 0; src < srcEnd; numChars++) {
! 	if ((src > srcClose) && (!Tcl_UtfCharComplete(src, srcEnd - src))) {
  	    /*
  	     * If there is more string to follow, this will ensure that the
  	     * last UTF-8 character in the source buffer hasn't been cut off.
--- 2140,2146 ----
      dstEnd = dst + dstLen - 1;
  
      for (numChars = 0; src < srcEnd; numChars++) {
! 	if ((src > srcClose) && (!Tcl_UtfCharComplete(src, (int) (srcEnd - src)))) {
  	    /*
  	     * If there is more string to follow, this will ensure that the
  	     * last UTF-8 character in the source buffer hasn't been cut off.
***************
*** 2176,2183 ****
  	} 
  	src += len;
      }
!     *srcReadPtr = src - srcStart;
!     *dstWrotePtr = dst - dstStart;
      *dstCharsPtr = numChars;
      return result;
  }
--- 2176,2183 ----
  	} 
  	src += len;
      }
!     *srcReadPtr = (int) (src - srcStart);
!     *dstWrotePtr = (int) (dst - dstStart);
      *dstCharsPtr = numChars;
      return result;
  }
***************
*** 2295,2301 ****
          }
  	byte = *((unsigned char *) src);
  	if (prefixBytes[byte]) {
! 	    unsigned int left, len, longest;
  	    int checked, i;
  	    EscapeSubTable *subTablePtr;
  	    
--- 2295,2301 ----
          }
  	byte = *((unsigned char *) src);
  	if (prefixBytes[byte]) {
! 	    size_t left, len, longest;
  	    int checked, i;
  	    EscapeSubTable *subTablePtr;
  	    
***************
*** 2303,2309 ****
  	     * Saw the beginning of an escape sequence. 
  	     */
  	     
! 	    left = srcEnd - src;
  	    len = dataPtr->initLen;
  	    longest = len;
  	    checked = 0;
--- 2303,2309 ----
  	     * Saw the beginning of an escape sequence. 
  	     */
  	     
! 	    left = (size_t) (srcEnd - src);
  	    len = dataPtr->initLen;
  	    longest = len;
  	    checked = 0;
***************
*** 2416,2423 ****
      }
  
      *statePtr = (Tcl_EncodingState) state;
!     *srcReadPtr = src - srcStart;
!     *dstWrotePtr = dst - dstStart;
      *dstCharsPtr = numChars;
      return result;
  }
--- 2416,2423 ----
      }
  
      *statePtr = (Tcl_EncodingState) state;
!     *srcReadPtr = (int) (src - srcStart);
!     *dstWrotePtr = (int) (dst - dstStart);
      *dstCharsPtr = numChars;
      return result;
  }
***************
*** 2492,2498 ****
      dstEnd = dst + dstLen - 1;
  
      if (flags & TCL_ENCODING_START) {
! 	unsigned int len;
  	
  	state = 0;
  	len = dataPtr->subTables[0].sequenceLen;
--- 2492,2498 ----
      dstEnd = dst + dstLen - 1;
  
      if (flags & TCL_ENCODING_START) {
! 	size_t len;
  	
  	state = 0;
  	len = dataPtr->subTables[0].sequenceLen;
***************
*** 2504,2511 ****
  	memcpy((VOID *) dst, (VOID *) dataPtr->init,
  		(size_t) dataPtr->initLen);
  	dst += dataPtr->initLen;
! 	memcpy((VOID *) dst, (VOID *) dataPtr->subTables[0].sequence,
! 		(size_t) len);
  	dst += len;
      } else {
          state = (int) *statePtr;
--- 2504,2510 ----
  	memcpy((VOID *) dst, (VOID *) dataPtr->init,
  		(size_t) dataPtr->initLen);
  	dst += dataPtr->initLen;
! 	memcpy((VOID *) dst, (VOID *) dataPtr->subTables[0].sequence, len);
  	dst += len;
      } else {
          state = (int) *statePtr;
***************
*** 2521,2527 ****
  	int word;
  	Tcl_UniChar ch;
  	
! 	if ((src > srcClose) && (!Tcl_UtfCharComplete(src, srcEnd - src))) {
  	    /*
  	     * If there is more string to follow, this will ensure that the
  	     * last UTF-8 character in the source buffer hasn't been cut off.
--- 2520,2526 ----
  	int word;
  	Tcl_UniChar ch;
  	
! 	if ((src > srcClose) && (!Tcl_UtfCharComplete(src, (int) (srcEnd - src)))) {
  	    /*
  	     * If there is more string to follow, this will ensure that the
  	     * last UTF-8 character in the source buffer hasn't been cut off.
***************
*** 2601,2608 ****
      }
  
      *statePtr = (Tcl_EncodingState) state;
!     *srcReadPtr = src - srcStart;
!     *dstWrotePtr = dst - dstStart;
      *dstCharsPtr = numChars;
      return result;
  }
--- 2600,2607 ----
      }
  
      *statePtr = (Tcl_EncodingState) state;
!     *srcReadPtr = (int) (src - srcStart);
!     *dstWrotePtr = (int) (dst - dstStart);
      *dstCharsPtr = numChars;
      return result;
  }

*** generic/tclEnv.c	2002/01/26 01:10:08	1.11
--- generic/tclEnv.c	2002/01/29 06:43:41
***************
*** 175,181 ****
      CONST char *value;		/* New value for variable (UTF-8). */
  {
      Tcl_DString envString;
!     int index, length, nameLength;
      char *p, *oldValue;
      CONST char *p2;
  
--- 175,182 ----
      CONST char *value;		/* New value for variable (UTF-8). */
  {
      Tcl_DString envString;
!     int index, length;
!     size_t nameLength;
      char *p, *oldValue;
      CONST char *p2;
  
***************
*** 193,200 ****
  	if ((length + 2) > environSize) {
  	    char **newEnviron;
  
! 	    newEnviron = (char **) ckalloc((unsigned)
! 		    ((length + 5) * sizeof(char *)));
  	    memcpy((VOID *) newEnviron, (VOID *) environ,
  		    length*sizeof(char *));
  	    if (environSize != 0) {
--- 194,200 ----
  	if ((length + 2) > environSize) {
  	    char **newEnviron;
  
! 	    newEnviron = (char **) ckalloc((length + 5) * sizeof(char *));
  	    memcpy((VOID *) newEnviron, (VOID *) environ,
  		    length*sizeof(char *));
  	    if (environSize != 0) {
***************
*** 324,330 ****
      if (value == NULL) {
  	return 0;
      }
!     nameLength = value - name;
      if (nameLength == 0) {
  	return 0;
      }
--- 324,330 ----
      if (value == NULL) {
  	return 0;
      }
!     nameLength = (int) (value - name);
      if (nameLength == 0) {
  	return 0;
      }

*** generic/tclExecute.c	2002/01/29 02:21:47	1.46
--- generic/tclExecute.c	2002/01/29 06:43:56
***************
*** 2682,2688 ****
  		    s1len = Tcl_NumUtfChars(s1, s1len);
  		    s2len = Tcl_NumUtfChars(s2, s2len);
  		    iResult = Tcl_UtfNcmp(s1, s2,
! 			    (size_t) ((s1len < s2len) ? s1len : s2len));
  		}
  
  		/*
--- 2682,2688 ----
  		    s1len = Tcl_NumUtfChars(s1, s1len);
  		    s2len = Tcl_NumUtfChars(s2, s2len);
  		    iResult = Tcl_UtfNcmp(s1, s2,
! 			    ((s1len < s2len) ? s1len : s2len));
  		}
  
  		/*
***************
*** 4242,4248 ****
  				 * length of the command's source should be
  				 * stored. If NULL, no length is stored. */
  {
!     register int pcOffset = (pc - codePtr->codeStart);
      int numCmds = codePtr->numCommands;
      unsigned char *codeDeltaNext, *codeLengthNext;
      unsigned char *srcDeltaNext, *srcLengthNext;
--- 4242,4248 ----
  				 * length of the command's source should be
  				 * stored. If NULL, no length is stored. */
  {
!     register int pcOffset = (int) (pc - codePtr->codeStart);
      int numCmds = codePtr->numCommands;
      unsigned char *codeDeltaNext, *codeLengthNext;
      unsigned char *srcDeltaNext, *srcLengthNext;
***************
*** 4369,4375 ****
      ExceptionRange *rangeArrayPtr;
      int numRanges = codePtr->numExceptRanges;
      register ExceptionRange *rangePtr;
!     int pcOffset = (pc - codePtr->codeStart);
      register int i, level;
  
      if (numRanges == 0) {
--- 4369,4375 ----
      ExceptionRange *rangeArrayPtr;
      int numRanges = codePtr->numExceptRanges;
      register ExceptionRange *rangePtr;
!     int pcOffset = (int) (pc - codePtr->codeStart);
      register int i, level;
  
      if (numRanges == 0) {

*** generic/tclFileName.c	2002/01/26 01:10:08	1.29
--- generic/tclFileName.c	2002/01/29 06:44:03
***************
*** 324,330 ****
  	    while ((*end != '\0') && (*end != '/')) {
  		end++;
  	    }
! 	    *driveNameLengthPtr = end - path;
  	}
      } else {
  	switch (tclPlatform) {
--- 324,330 ----
  	    while ((*end != '\0') && (*end != '/')) {
  		end++;
  	    }
! 	    *driveNameLengthPtr = (int) (end - path);
  	}
      } else {
  	switch (tclPlatform) {
***************
*** 353,359 ****
  			 * We need this addition in case the QNX code 
  			 * was used 
  			 */
! 			*driveNameLengthPtr = (1 + path - origPath);
  		    }
  		} else {
  		    type = TCL_PATH_RELATIVE;
--- 353,359 ----
  			 * We need this addition in case the QNX code 
  			 * was used 
  			 */
! 			*driveNameLengthPtr = (int) (1 + path - origPath);
  		    }
  		} else {
  		    type = TCL_PATH_RELATIVE;
***************
*** 389,402 ****
  			} else {
  			    if (driveNameLengthPtr != NULL) {
  				Tcl_RegExpRange(re, 0, &root, &end);
! 				*driveNameLengthPtr = end - root;
  			    }
  			    if (driveNameRef != NULL) {
  				if (*root == '/') {
  				    char *c;
  				    int gotColon = 0;
  				    *driveNameRef = Tcl_NewStringObj(root + 1,
! 					    end - root -1);
  				    c = Tcl_GetString(*driveNameRef);
  				    while (*c != '\0') {
  					if (*c == '/') {
--- 389,402 ----
  			} else {
  			    if (driveNameLengthPtr != NULL) {
  				Tcl_RegExpRange(re, 0, &root, &end);
! 				*driveNameLengthPtr = (int) (end - root);
  			    }
  			    if (driveNameRef != NULL) {
  				if (*root == '/') {
  				    char *c;
  				    int gotColon = 0;
  				    *driveNameRef = Tcl_NewStringObj(root + 1,
! 					    (int) (end - root -1));
  				    c = Tcl_GetString(*driveNameRef);
  				    while (*c != '\0') {
  					if (*c == '/') {
***************
*** 416,422 ****
  					    (*(c-1) == ':')) {
  					/* We have an extra colon */
  				        Tcl_SetObjLength(*driveNameRef, 
! 						c - Tcl_GetString(*driveNameRef) - 1);
  				    }
  				}
  			    }
--- 416,422 ----
  					    (*(c-1) == ':')) {
  					/* We have an extra colon */
  				        Tcl_SetObjLength(*driveNameRef, 
! 						(int) (c - Tcl_GetString(*driveNameRef) - 1));
  				    }
  				}
  			    }
***************
*** 449,455 ****
  		Tcl_DStringInit(&ds);
  		rootEnd = ExtractWinRoot(path, &ds, 0, &type);
  		if ((rootEnd != path) && (driveNameLengthPtr != NULL)) {
! 		    *driveNameLengthPtr = rootEnd - path;
  		    if (driveNameRef != NULL) {
  			*driveNameRef = Tcl_NewStringObj(Tcl_DStringValue(&ds),
  				Tcl_DStringLength(&ds));
--- 449,455 ----
  		Tcl_DStringInit(&ds);
  		rootEnd = ExtractWinRoot(path, &ds, 0, &type);
  		if ((rootEnd != path) && (driveNameLengthPtr != NULL)) {
! 		    *driveNameLengthPtr = (int) (rootEnd - path);
  		    if (driveNameRef != NULL) {
  			*driveNameRef = Tcl_NewStringObj(Tcl_DStringValue(&ds),
  				Tcl_DStringLength(&ds));
***************
*** 679,685 ****
  	while ((*p != '\0') && (*p != '/')) {
  	    p++;
  	}
! 	length = p - elementStart;
  	if (length > 0) {
  	    Tcl_Obj *nextElt;
  	    if ((elementStart[0] == '~') && (elementStart != path)) {
--- 679,685 ----
  	while ((*p != '\0') && (*p != '/')) {
  	    p++;
  	}
! 	length = (int) (p - elementStart);
  	if (length > 0) {
  	    Tcl_Obj *nextElt;
  	    if ((elementStart[0] == '~') && (elementStart != path)) {
***************
*** 749,755 ****
  	while ((*p != '\0') && (*p != '/') && (*p != '\\')) {
  	    p++;
  	}
! 	length = p - elementStart;
  	if (length > 0) {
  	    Tcl_Obj *nextElt;
  	    if ((elementStart[0] == '~') && (elementStart != path)) {
--- 749,755 ----
  	while ((*p != '\0') && (*p != '/') && (*p != '\\')) {
  	    p++;
  	}
! 	length = (int) (p - elementStart);
  	if (length > 0) {
  	    Tcl_Obj *nextElt;
  	    if ((elementStart[0] == '~') && (elementStart != path)) {
***************
*** 826,832 ****
  	if (start) {
  	    Tcl_Obj *elt = Tcl_NewStringObj(":", 1);
  	    Tcl_RegExpRange(re, 0, &start, &end);
! 	    Tcl_AppendToObj(elt, path, end - start);
  	    Tcl_ListObjAppendElement(NULL, result, elt);
  	    return result;
  	}
--- 826,832 ----
  	if (start) {
  	    Tcl_Obj *elt = Tcl_NewStringObj(":", 1);
  	    Tcl_RegExpRange(re, 0, &start, &end);
! 	    Tcl_AppendToObj(elt, path, (int) (end - start));
  	    Tcl_ListObjAppendElement(NULL, result, elt);
  	    return result;
  	}
***************
*** 871,877 ****
  	    }
  	}
  	Tcl_RegExpRange(re, i, &start, &end);
! 	length = end - start;
  
  	/*
  	 * Append the element and terminate it with a : 
--- 871,877 ----
  	    }
  	}
  	Tcl_RegExpRange(re, i, &start, &end);
! 	length = (int) (end - start);
  
  	/*
  	 * Append the element and terminate it with a : 
***************
*** 929,935 ****
  	}
  	
  	while ((p = strchr(p, ':')) != NULL) {
! 	    length = p - elementStart;
  	    if (length == 1) {
  		while (*p == ':') {
  		    Tcl_ListObjAppendElement(NULL, result,
--- 929,935 ----
  	}
  	
  	while ((p = strchr(p, ':')) != NULL) {
! 	    length = (int) (p - elementStart);
  	    if (length == 1) {
  		while (*p == ':') {
  		    Tcl_ListObjAppendElement(NULL, result,
***************
*** 977,983 ****
  	    while ((*p != '\0') && (*p != '/')) {
  		p++;
  	    }
! 	    length = p - elementStart;
  	    if (length > 0) {
  		if ((length == 1) && (elementStart[0] == '.')) {
  		    Tcl_ListObjAppendElement(NULL, result, 
--- 977,983 ----
  	    while ((*p != '\0') && (*p != '/')) {
  		p++;
  	    }
! 	    length = (int) (p - elementStart);
  	    if (length > 0) {
  		if ((length == 1) && (elementStart[0] == '.')) {
  		    Tcl_ListObjAppendElement(NULL, result, 
***************
*** 1125,1131 ****
  		    needsSep = 1;
  		}
  	    }
! 	    length = dest - Tcl_GetString(prefix);
  	    Tcl_SetObjLength(prefix, length);
  	    break;
  
--- 1125,1131 ----
  		    needsSep = 1;
  		}
  	    }
! 	    length = (int) (dest - Tcl_GetString(prefix));
  	    Tcl_SetObjLength(prefix, length);
  	    break;
  
***************
*** 1161,1167 ****
  		    needsSep = 1;
  		}
  	    }
! 	    length = dest - Tcl_GetString(prefix);
  	    Tcl_SetObjLength(prefix, length);
  	    break;
  
--- 1161,1167 ----
  		    needsSep = 1;
  		}
  	    }
! 	    length = (int) (dest - Tcl_GetString(prefix));
  	    Tcl_SetObjLength(prefix, length);
  	    break;
  
***************
*** 1213,1219 ****
  	     * Append the element
  	     */
  
! 	    newLength = strlen(p);
  	    /* 
  	     * It may not be good to just do 'Tcl_AppendToObj(prefix,
  	     * p, newLength)' because the object may contain duplicate
--- 1213,1219 ----
  	     * Append the element
  	     */
  
! 	    newLength = (int) strlen(p);
  	    /* 
  	     * It may not be good to just do 'Tcl_AppendToObj(prefix,
  	     * p, newLength)' because the object may contain duplicate
***************
*** 1672,1685 ****
  		pathOrDir = NULL;
  	    } else {
  		/* Have to split off the end */
! 		Tcl_DStringAppend(&pref, last, first+pathlength-last);
! 		pathOrDir = Tcl_NewStringObj(first, last-first-1);
  	    }
  	    /* Need to quote 'prefix' */
  	    Tcl_DStringInit(&prefix);
  	    search = Tcl_DStringValue(&pref);
  	    while ((find = (strpbrk(search, "\\[]*?{}"))) != NULL) {
! 	        Tcl_DStringAppend(&prefix, search, find-search);
  	        Tcl_DStringAppend(&prefix, "\\", 1);
  	        Tcl_DStringAppend(&prefix, find, 1);
  	        search = find+1;
--- 1672,1685 ----
  		pathOrDir = NULL;
  	    } else {
  		/* Have to split off the end */
! 		Tcl_DStringAppend(&pref, last, (int) (first+pathlength-last));
! 		pathOrDir = Tcl_NewStringObj(first, (int) (last-first-1));
  	    }
  	    /* Need to quote 'prefix' */
  	    Tcl_DStringInit(&prefix);
  	    search = Tcl_DStringValue(&pref);
  	    while ((find = (strpbrk(search, "\\[]*?{}"))) != NULL) {
! 	        Tcl_DStringAppend(&prefix, search, (int) (find-search));
  	        Tcl_DStringAppend(&prefix, "\\", 1);
  	        Tcl_DStringAppend(&prefix, find, 1);
  	        search = find+1;
***************
*** 2345,2351 ****
  	 * before the first brace and recursively call TclDoGlob.
  	 */
  
! 	Tcl_DStringAppend(&newName, tail, openBrace-tail);
  	baseLength = Tcl_DStringLength(&newName);
  	length = Tcl_DStringLength(headPtr);
  	*closeBrace = '\0';
--- 2345,2351 ----
  	 * before the first brace and recursively call TclDoGlob.
  	 */
  
! 	Tcl_DStringAppend(&newName, tail, (int) (openBrace-tail));
  	baseLength = Tcl_DStringLength(&newName);
  	length = Tcl_DStringLength(headPtr);
  	*closeBrace = '\0';
***************
*** 2355,2361 ****
  	    SkipToChar(&p, ",");
  	    Tcl_DStringSetLength(headPtr, length);
  	    Tcl_DStringSetLength(&newName, baseLength);
! 	    Tcl_DStringAppend(&newName, element, p-element);
  	    Tcl_DStringAppend(&newName, closeBrace+1, -1);
  	    result = TclDoGlob(interp, separators, headPtr, 
  			       Tcl_DStringValue(&newName), types);
--- 2355,2361 ----
  	    SkipToChar(&p, ",");
  	    Tcl_DStringSetLength(headPtr, length);
  	    Tcl_DStringSetLength(&newName, baseLength);
! 	    Tcl_DStringAppend(&newName, element, (int) (p-element));
  	    Tcl_DStringAppend(&newName, closeBrace+1, -1);
  	    result = TclDoGlob(interp, separators, headPtr, 
  			       Tcl_DStringValue(&newName), types);
***************
*** 2448,2454 ****
  	Tcl_DecrRefCount(head);
  	return ret;
      }
!     Tcl_DStringAppend(headPtr, tail, p-tail);
      if (*p != '\0') {
  	return TclDoGlob(interp, separators, headPtr, p, types);
      } else {
--- 2448,2454 ----
  	Tcl_DecrRefCount(head);
  	return ret;
      }
!     Tcl_DStringAppend(headPtr, tail, (int) (p-tail));
      if (*p != '\0') {
  	return TclDoGlob(interp, separators, headPtr, p, types);
      } else {

*** generic/tclHistory.c	2002/01/16 06:02:34	1.4
--- generic/tclHistory.c	2002/01/29 06:44:05
***************
*** 49,55 ****
  				 * instead of Tcl_Eval. */
  {
      register Tcl_Obj *cmdPtr;
!     int length = strlen(cmd);
      int result;
  
      if (length > 0) {
--- 49,55 ----
  				 * instead of Tcl_Eval. */
  {
      register Tcl_Obj *cmdPtr;
!     int length = (int) strlen(cmd);
      int result;
  
      if (length > 0) {

*** generic/tclInt.decls	2002/01/27 11:09:30	1.45
--- generic/tclInt.decls	2002/01/29 06:44:08
***************
*** 277,283 ****
  #    int TclpAccess(CONST char *path, int mode)
  #}
  declare 69 generic {
!     char * TclpAlloc(unsigned int size)
  }
  #declare 70 generic {
  #    int TclpCopyFile(CONST char *source, CONST char *dest)
--- 277,283 ----
  #    int TclpAccess(CONST char *path, int mode)
  #}
  declare 69 generic {
!     char * TclpAlloc(size_t size)
  }
  #declare 70 generic {
  #    int TclpCopyFile(CONST char *source, CONST char *dest)
***************
*** 320,326 ****
  #	    char *modeString, int permissions)
  #}
  declare 81 generic {
!     char * TclpRealloc(char *ptr, unsigned int size)
  }
  #declare 82 generic {
  #    int TclpRemoveDirectory(CONST char *path, int recursive, \
--- 320,326 ----
  #	    char *modeString, int permissions)
  #}
  declare 81 generic {
!     char * TclpRealloc(char *ptr, size_t size)
  }
  #declare 82 generic {
  #    int TclpRemoveDirectory(CONST char *path, int recursive, \

*** generic/tclInt.h	2002/01/29 02:40:50	1.77
--- generic/tclInt.h	2002/01/29 06:44:17
***************
*** 1783,1789 ****
  			    int mode));
  EXTERN int              TclpObjLstat _ANSI_ARGS_((Tcl_Obj *pathPtr, 
  			    struct stat *buf));
! EXTERN char *		TclpAlloc _ANSI_ARGS_((unsigned int size));
  EXTERN int		TclpCheckStackSpace _ANSI_ARGS_((void));
  EXTERN Tcl_Obj*         TclpTempFileName _ANSI_ARGS_((void));
  EXTERN void		TclpExit _ANSI_ARGS_((int status));
--- 1783,1789 ----
  			    int mode));
  EXTERN int              TclpObjLstat _ANSI_ARGS_((Tcl_Obj *pathPtr, 
  			    struct stat *buf));
! EXTERN char *		TclpAlloc _ANSI_ARGS_((size_t size));
  EXTERN int		TclpCheckStackSpace _ANSI_ARGS_((void));
  EXTERN Tcl_Obj*         TclpTempFileName _ANSI_ARGS_((void));
  EXTERN void		TclpExit _ANSI_ARGS_((int status));
***************
*** 1860,1866 ****
  EXTERN char *		TclpReadlink _ANSI_ARGS_((CONST char *fileName,
  			    Tcl_DString *linkPtr));
  EXTERN char *		TclpRealloc _ANSI_ARGS_((char *ptr,
! 			    unsigned int size));
  EXTERN void		TclpReleaseFile _ANSI_ARGS_((TclFile file));
  EXTERN void		TclpSetInitialEncodings _ANSI_ARGS_((void));
  EXTERN void		TclpSetVariables _ANSI_ARGS_((Tcl_Interp *interp));
--- 1860,1866 ----
  EXTERN char *		TclpReadlink _ANSI_ARGS_((CONST char *fileName,
  			    Tcl_DString *linkPtr));
  EXTERN char *		TclpRealloc _ANSI_ARGS_((char *ptr,
! 			    size_t size));
  EXTERN void		TclpReleaseFile _ANSI_ARGS_((TclFile file));
  EXTERN void		TclpSetInitialEncodings _ANSI_ARGS_((void));
  EXTERN void		TclpSetVariables _ANSI_ARGS_((Tcl_Interp *interp));
***************
*** 2292,2300 ****
  	(objPtr)->bytes	 = tclEmptyStringRep; \
  	(objPtr)->length = 0; \
      } else { \
! 	(objPtr)->bytes = (char *) ckalloc((unsigned) ((len) + 1)); \
  	memcpy((VOID *) (objPtr)->bytes, (VOID *) (bytePtr), \
! 		(unsigned) (len)); \
  	(objPtr)->bytes[len] = '\0'; \
  	(objPtr)->length = (len); \
      }
--- 2292,2300 ----
  	(objPtr)->bytes	 = tclEmptyStringRep; \
  	(objPtr)->length = 0; \
      } else { \
! 	(objPtr)->bytes = (char *) ckalloc((len) + 1); \
  	memcpy((VOID *) (objPtr)->bytes, (VOID *) (bytePtr), \
! 		(len)); \
  	(objPtr)->bytes[len] = '\0'; \
  	(objPtr)->length = (len); \
      }

*** generic/tclIntDecls.h	2002/01/25 22:01:31	1.37
--- generic/tclIntDecls.h	2002/01/29 06:44:22
***************
*** 238,244 ****
  				TclOpenFileChannelProc_ * proc));
  /* Slot 68 is reserved */
  /* 69 */
! EXTERN char *		TclpAlloc _ANSI_ARGS_((unsigned int size));
  /* Slot 70 is reserved */
  /* Slot 71 is reserved */
  /* Slot 72 is reserved */
--- 238,244 ----
  				TclOpenFileChannelProc_ * proc));
  /* Slot 68 is reserved */
  /* 69 */
! EXTERN char *		TclpAlloc _ANSI_ARGS_((size_t size));
  /* Slot 70 is reserved */
  /* Slot 71 is reserved */
  /* Slot 72 is reserved */
***************
*** 256,263 ****
  /* Slot 79 is reserved */
  /* Slot 80 is reserved */
  /* 81 */
! EXTERN char *		TclpRealloc _ANSI_ARGS_((char * ptr, 
! 				unsigned int size));
  /* Slot 82 is reserved */
  /* Slot 83 is reserved */
  /* Slot 84 is reserved */
--- 256,262 ----
  /* Slot 79 is reserved */
  /* Slot 80 is reserved */
  /* 81 */
! EXTERN char *		TclpRealloc _ANSI_ARGS_((char * ptr, size_t size));
  /* Slot 82 is reserved */
  /* Slot 83 is reserved */
  /* Slot 84 is reserved */
***************
*** 592,598 ****
      int (*tclOpenFileChannelDeleteProc) _ANSI_ARGS_((TclOpenFileChannelProc_ * proc)); /* 66 */
      int (*tclOpenFileChannelInsertProc) _ANSI_ARGS_((TclOpenFileChannelProc_ * proc)); /* 67 */
      void *reserved68;
!     char * (*tclpAlloc) _ANSI_ARGS_((unsigned int size)); /* 69 */
      void *reserved70;
      void *reserved71;
      void *reserved72;
--- 591,597 ----
      int (*tclOpenFileChannelDeleteProc) _ANSI_ARGS_((TclOpenFileChannelProc_ * proc)); /* 66 */
      int (*tclOpenFileChannelInsertProc) _ANSI_ARGS_((TclOpenFileChannelProc_ * proc)); /* 67 */
      void *reserved68;
!     char * (*tclpAlloc) _ANSI_ARGS_((size_t size)); /* 69 */
      void *reserved70;
      void *reserved71;
      void *reserved72;
***************
*** 604,610 ****
      int (*tclpGetTimeZone) _ANSI_ARGS_((unsigned long time)); /* 78 */
      void *reserved79;
      void *reserved80;
!     char * (*tclpRealloc) _ANSI_ARGS_((char * ptr, unsigned int size)); /* 81 */
      void *reserved82;
      void *reserved83;
      void *reserved84;
--- 603,609 ----
      int (*tclpGetTimeZone) _ANSI_ARGS_((unsigned long time)); /* 78 */
      void *reserved79;
      void *reserved80;
!     char * (*tclpRealloc) _ANSI_ARGS_((char * ptr, size_t size)); /* 81 */
      void *reserved82;
      void *reserved83;
      void *reserved84;

*** generic/tclIO.c	2002/01/26 01:10:08	1.51
--- generic/tclIO.c	2002/01/29 06:44:44
***************
*** 2708,2714 ****
      }
  
      if (srcLen < 0) {
!         srcLen = strlen(src);
      }
      return DoWrite(chanPtr, src, srcLen);
  }
--- 2708,2714 ----
      }
  
      if (srcLen < 0) {
!         srcLen = (int) strlen(src);
      }
      return DoWrite(chanPtr, src, srcLen);
  }
***************
*** 2753,2759 ****
      }
  
      if (srcLen < 0) {
!         srcLen = strlen(src);
      }
  
      /*
--- 2753,2759 ----
      }
  
      if (srcLen < 0) {
!         srcLen = (int) strlen(src);
      }
  
      /*
***************
*** 2851,2857 ****
      chanPtr  = statePtr->topChanPtr;
  
      if (len < 0) {
!         len = strlen(src);
      }
      if (statePtr->encoding == NULL) {
  	/*
--- 2851,2857 ----
      chanPtr  = statePtr->topChanPtr;
  
      if (len < 0) {
!         len = (int) strlen(src);
      }
      if (statePtr->encoding == NULL) {
  	/*
***************
*** 3305,3312 ****
  		}
  		*dst++ = *src++;
  	    }
! 	    *srcLenPtr = src - srcStart;
! 	    *dstLenPtr = dst - dstStart;
  	    break;
  	}
  	default: {
--- 3305,3312 ----
  		}
  		*dst++ = *src++;
  	    }
! 	    *srcLenPtr = (int) (src - srcStart);
! 	    *dstLenPtr = (int) (dst - dstStart);
  	    break;
  	}
  	default: {
***************
*** 3564,3570 ****
  			if (eol >= dstEnd) {
  			    int offset;
  			    
! 			    offset = eol - objPtr->bytes;
  			    dst = dstEnd;
  			    if (FilterInputBytes(chanPtr, &gs) != 0) {
  				goto restore;
--- 3564,3570 ----
  			if (eol >= dstEnd) {
  			    int offset;
  			    
! 			    offset = (int) (eol - objPtr->bytes);
  			    dst = dstEnd;
  			    if (FilterInputBytes(chanPtr, &gs) != 0) {
  				goto restore;
***************
*** 3622,3628 ****
  
  			    int offset;
  			    
! 			    offset = eol - objPtr->bytes;
  			    dst = dstEnd;
  			    PeekAhead(chanPtr, &dstEnd, &gs);
  			    eol = objPtr->bytes + offset;
--- 3622,3628 ----
  
  			    int offset;
  			    
! 			    offset = (int) (eol - objPtr->bytes);
  			    dst = dstEnd;
  			    PeekAhead(chanPtr, &dstEnd, &gs);
  			    eol = objPtr->bytes + offset;
***************
*** 3686,3692 ****
      statePtr->inputEncodingState = gs.state;
      Tcl_ExternalToUtf(NULL, gs.encoding, bufPtr->buf + bufPtr->nextRemoved,
  	    gs.rawRead, statePtr->inputEncodingFlags,
! 	    &statePtr->inputEncodingState, dst, eol - dst + skip + TCL_UTF_MAX,
  	    &gs.rawRead, NULL, &gs.charsWrote);
      bufPtr->nextRemoved += gs.rawRead;
  
--- 3686,3692 ----
      statePtr->inputEncodingState = gs.state;
      Tcl_ExternalToUtf(NULL, gs.encoding, bufPtr->buf + bufPtr->nextRemoved,
  	    gs.rawRead, statePtr->inputEncodingFlags,
! 	    &statePtr->inputEncodingState, dst, (int) (eol - dst + skip + TCL_UTF_MAX),
  	    &gs.rawRead, NULL, &gs.charsWrote);
      bufPtr->nextRemoved += gs.rawRead;
  
***************
*** 3694,3700 ****
       * Recycle all the emptied buffers.
       */
  
!     Tcl_SetObjLength(objPtr, eol - objPtr->bytes);
      CommonGetsCleanup(chanPtr, encoding);
      statePtr->flags &= ~CHANNEL_BLOCKED;
      copiedTotal = gs.totalChars + gs.charsWrote - skip;
--- 3694,3700 ----
       * Recycle all the emptied buffers.
       */
  
!     Tcl_SetObjLength(objPtr, (int) (eol - objPtr->bytes));
      CommonGetsCleanup(chanPtr, encoding);
      statePtr->flags &= ~CHANNEL_BLOCKED;
      copiedTotal = gs.totalChars + gs.charsWrote - skip;
***************
*** 3835,3850 ****
      rawStart = bufPtr->buf + bufPtr->nextRemoved;
      raw = rawStart;
      rawEnd = bufPtr->buf + bufPtr->nextAdded;
!     rawLen = rawEnd - rawStart;
  
      dst = *gsPtr->dstPtr;
!     offset = dst - objPtr->bytes;
      toRead = ENCODING_LINESIZE;
      if (toRead > rawLen) {
  	toRead = rawLen;
      }
      dstNeeded = toRead * TCL_UTF_MAX + 1;
!     spaceLeft = objPtr->length - offset - TCL_UTF_MAX - 1;
      if (dstNeeded > spaceLeft) {
  	length = offset * 2;
  	if (offset < dstNeeded) {
--- 3835,3850 ----
      rawStart = bufPtr->buf + bufPtr->nextRemoved;
      raw = rawStart;
      rawEnd = bufPtr->buf + bufPtr->nextAdded;
!     rawLen = (int) (rawEnd - rawStart);
  
      dst = *gsPtr->dstPtr;
!     offset = (int) (dst - objPtr->bytes);
      toRead = ENCODING_LINESIZE;
      if (toRead > rawLen) {
  	toRead = rawLen;
      }
      dstNeeded = toRead * TCL_UTF_MAX + 1;
!     spaceLeft = (int) (objPtr->length - offset - TCL_UTF_MAX - 1);
      if (dstNeeded > spaceLeft) {
  	length = offset * 2;
  	if (offset < dstNeeded) {
***************
*** 4598,4604 ****
       */
  
      dstNeeded = toRead * factor / UTF_EXPANSION_FACTOR;
!     spaceLeft = objPtr->length - offset - TCL_UTF_MAX - 1;
  
      if (dstNeeded > spaceLeft) {
  	/*
--- 4598,4604 ----
       */
  
      dstNeeded = toRead * factor / UTF_EXPANSION_FACTOR;
!     spaceLeft = (int) (objPtr->length - offset - TCL_UTF_MAX - 1);
  
      if (dstNeeded > spaceLeft) {
  	/*
***************
*** 4731,4737 ****
  	statePtr->inputEncodingState = oldState;
  	Tcl_ExternalToUtf(NULL, statePtr->encoding, src, srcLen,
  		statePtr->inputEncodingFlags, &statePtr->inputEncodingState,
! 		dst, eof - dst + TCL_UTF_MAX, &srcRead, &dstWrote, &numChars);
  	dstRead = dstWrote;
  	TranslateInputEOL(statePtr, dst, dst, &dstWrote, &dstRead);
  	numChars -= (dstRead - dstWrote);
--- 4731,4738 ----
  	statePtr->inputEncodingState = oldState;
  	Tcl_ExternalToUtf(NULL, statePtr->encoding, src, srcLen,
  		statePtr->inputEncodingFlags, &statePtr->inputEncodingState,
! 		dst, (int) (eof - dst + TCL_UTF_MAX), &srcRead, &dstWrote,
! 		&numChars);
  	dstRead = dstWrote;
  	TranslateInputEOL(statePtr, dst, dst, &dstWrote, &dstRead);
  	numChars -= (dstRead - dstWrote);
***************
*** 4801,4807 ****
  	for (src = srcStart; src < srcMax; src++) {
  	    if (*src == inEofChar) {
  		eof = src;
! 		srcLen = src - srcStart;
  		if (srcLen < dstLen) {
  		    dstLen = srcLen;
  		}
--- 4802,4808 ----
  	for (src = srcStart; src < srcMax; src++) {
  	    if (*src == inEofChar) {
  		eof = src;
! 		srcLen = (int) (src - srcStart);
  		if (srcLen < dstLen) {
  		    dstLen = srcLen;
  		}
***************
*** 4856,4863 ****
  		    *dst++ = *src++;
  		}
  	    }
! 	    srcLen = src - srcStart;
! 	    dstLen = dst - dstStart;
  	    break;
  	}
  	case TCL_TRANSLATE_AUTO: {
--- 4857,4864 ----
  		    *dst++ = *src++;
  		}
  	    }
! 	    srcLen = (int) (src - srcStart);
! 	    dstLen = (int) (dst - dstStart);
  	    break;
  	}
  	case TCL_TRANSLATE_AUTO: {
***************
*** 4891,4898 ****
  		    *dst++ = *src++;
  		}
  	    }
! 	    srcLen = src - srcStart;
! 	    dstLen = dst - dstStart;
  	    break;
  	}
  	default: {		/* lint. */
--- 4892,4899 ----
  		    *dst++ = *src++;
  		}
  	    }
! 	    srcLen = (int) (src - srcStart);
! 	    dstLen = (int) (dst - dstStart);
  	    break;
  	}
  	default: {		/* lint. */
***************
*** 7849,7855 ****
  		    dst++;
  		}
  	    }
! 	    copied = dst - result;
  	    break;
  	}
          case TCL_TRANSLATE_AUTO: {
--- 7850,7856 ----
  		    dst++;
  		}
  	    }
! 	    copied = (int) (dst - result);
  	    break;
  	}
          case TCL_TRANSLATE_AUTO: {
***************
*** 7891,7897 ****
  		    statePtr->flags &= ~INPUT_SAW_CR;
  		}
  	    }
! 	    copied = dst - result;
              break;
  	}
          default: {
--- 7892,7898 ----
  		    statePtr->flags &= ~INPUT_SAW_CR;
  		}
  	    }
! 	    copied = (int) (dst - result);
              break;
  	}
          default: {
***************
*** 8568,8574 ****
      CONST char *name;
      int chanNameLen;
  
!     chanNameLen = strlen(chanName);
      for (statePtr = tsdPtr->firstCSPtr;
  	 statePtr != NULL;
  	 statePtr = statePtr->nextCSPtr) {
--- 8569,8575 ----
      CONST char *name;
      int chanNameLen;
  
!     chanNameLen = (int) strlen(chanName);
      for (statePtr = tsdPtr->firstCSPtr;
  	 statePtr != NULL;
  	 statePtr = statePtr->nextCSPtr) {

*** generic/tclIOSock.c	2002/01/25 20:40:55	1.6
--- generic/tclIOSock.c	2002/01/29 06:44:46
***************
*** 94,100 ****
      /*
       * Should be socklen_t, but HP10.20 (g)cc chokes
       */
!     size_t len;
  
      len = sizeof(int);
      getsockopt(sock, SOL_SOCKET, SO_SNDBUF, (char *)&current, &len);
--- 94,100 ----
      /*
       * Should be socklen_t, but HP10.20 (g)cc chokes
       */
!     int len;
  
      len = sizeof(int);
      getsockopt(sock, SOL_SOCKET, SO_SNDBUF, (char *)&current, &len);

*** generic/tclIOUtil.c	2002/01/25 21:36:09	1.33
--- generic/tclIOUtil.c	2002/01/29 06:44:59
***************
*** 2648,2654 ****
  	while ((*p != '\0') && (*p != separator)) {
  	    p++;
  	}
! 	length = p - elementStart;
  	if (length > 0) {
  	    Tcl_Obj *nextElt;
  	    if (elementStart[0] == '~') {
--- 2648,2654 ----
  	while ((*p != '\0') && (*p != separator)) {
  	    p++;
  	}
! 	length = (int) (p - elementStart);
  	if (length > 0) {
  	    Tcl_Obj *nextElt;
  	    if (elementStart[0] == '~') {
***************
*** 2803,2809 ****
  		    needsSep = 1;
  		}
  	    }
! 	    length = ptr - Tcl_GetString(res);
  	    Tcl_SetObjLength(res, length);
  	}
      }
--- 2803,2809 ----
  		    needsSep = 1;
  		}
  	    }
! 	    length = (int) (ptr - Tcl_GetString(res));
  	    Tcl_SetObjLength(res, length);
  	}
      }

*** generic/tclListObj.c	2002/01/07 23:09:13	1.13
--- generic/tclListObj.c	2002/01/29 06:45:04
***************
*** 1516,1526 ****
       * corresponding "argv" strings.
       */
  
!     elemPtrs = (Tcl_Obj **)
! 	    ckalloc((unsigned) (estCount * sizeof(Tcl_Obj *)));
      for (p = string, lenRemain = length, i = 0;
  	    lenRemain > 0;
! 	    p = nextElem, lenRemain = (limit - nextElem), i++) {
  	result = TclFindElement(interp, p, lenRemain, &elemStart, &nextElem,
  				&elemSize, &hasBrace);
  	if (result != TCL_OK) {
--- 1516,1525 ----
       * corresponding "argv" strings.
       */
  
!     elemPtrs = (Tcl_Obj **) ckalloc(estCount * sizeof(Tcl_Obj *));
      for (p = string, lenRemain = length, i = 0;
  	    lenRemain > 0;
! 	    p = nextElem, lenRemain = (int) (limit - nextElem), i++) {
  	result = TclFindElement(interp, p, lenRemain, &elemStart, &nextElem,
  				&elemSize, &hasBrace);
  	if (result != TCL_OK) {

*** generic/tclLiteral.c	2001/10/11 22:28:01	1.11
--- generic/tclLiteral.c	2002/01/29 06:45:09
***************
*** 189,195 ****
      char buf[TCL_INTEGER_SPACE];
  
      if (length < 0) {
! 	length = (bytes? strlen(bytes) : 0);
      }
      hash = HashString(bytes, length);
  
--- 189,195 ----
      char buf[TCL_INTEGER_SPACE];
  
      if (length < 0) {
! 	length = (bytes ? (int) strlen(bytes) : 0);
      }
      hash = HashString(bytes, length);
  
***************
*** 202,215 ****
      for (localPtr = localTablePtr->buckets[localHash];
  	  localPtr != NULL;  localPtr = localPtr->nextPtr) {
  	objPtr = localPtr->objPtr;
! 	if ((objPtr->length == length) && ((length == 0)
  		|| ((objPtr->bytes[0] == bytes[0])
! 			&& (memcmp(objPtr->bytes, bytes, (unsigned) length)
  				== 0)))) {
  	    if (onHeap) {
  		ckfree(bytes);
  	    }
! 	    objIndex = (localPtr - envPtr->literalArrayPtr);
  #ifdef TCL_COMPILE_DEBUG
  	    TclVerifyLocalLiteralTable(envPtr);
  #endif /*TCL_COMPILE_DEBUG*/
--- 202,215 ----
      for (localPtr = localTablePtr->buckets[localHash];
  	  localPtr != NULL;  localPtr = localPtr->nextPtr) {
  	objPtr = localPtr->objPtr;
! 	if ((objPtr->length == (size_t) length) && ((length == 0)
  		|| ((objPtr->bytes[0] == bytes[0])
! 			&& (memcmp(objPtr->bytes, bytes, (size_t) length)
  				== 0)))) {
  	    if (onHeap) {
  		ckfree(bytes);
  	    }
! 	    objIndex = (int) (localPtr - envPtr->literalArrayPtr);
  #ifdef TCL_COMPILE_DEBUG
  	    TclVerifyLocalLiteralTable(envPtr);
  #endif /*TCL_COMPILE_DEBUG*/
***************
*** 227,235 ****
      for (globalPtr = globalTablePtr->buckets[globalHash];
  	 globalPtr != NULL;  globalPtr = globalPtr->nextPtr) {
  	objPtr = globalPtr->objPtr;
! 	if ((objPtr->length == length) && ((length == 0)
  		|| ((objPtr->bytes[0] == bytes[0])
! 			&& (memcmp(objPtr->bytes, bytes, (unsigned) length)
  				== 0)))) {
  	    /*
  	     * A global literal was found. Add an entry to the CompileEnv's
--- 227,235 ----
      for (globalPtr = globalTablePtr->buckets[globalHash];
  	 globalPtr != NULL;  globalPtr = globalPtr->nextPtr) {
  	objPtr = globalPtr->objPtr;
! 	if ((objPtr->length == (size_t) length) && ((length == 0)
  		|| ((objPtr->bytes[0] == bytes[0])
! 			&& (memcmp(objPtr->bytes, bytes, (size_t) length)
  				== 0)))) {
  	    /*
  	     * A global literal was found. Add an entry to the CompileEnv's

*** generic/tclLoad.c	2002/01/09 19:09:28	1.7
--- generic/tclLoad.c	2002/01/29 06:45:12
***************
*** 308,314 ****
  		    code = TCL_ERROR;
  		    goto done;
  		}
! 		Tcl_DStringAppend(&pkgName, pkgGuess, (p - pkgGuess));
  		Tcl_DecrRefCount(splitPtr);
  	    }
  	}
--- 308,314 ----
  		    code = TCL_ERROR;
  		    goto done;
  		}
! 		Tcl_DStringAppend(&pkgName, pkgGuess, (int) (p - pkgGuess));
  		Tcl_DecrRefCount(splitPtr);
  	    }
  	}

*** generic/tclNamesp.c	2002/01/25 22:01:32	1.28
--- generic/tclNamesp.c	2002/01/29 06:45:23
***************
*** 917,923 ****
      Namespace *currNsPtr = (Namespace *) Tcl_GetCurrentNamespace(interp);
      CONST char *simplePattern;
      char *patternCpy;
!     int neededElems, len, i;
  
      /*
       * If the specified namespace is NULL, use the current namespace.
--- 917,924 ----
      Namespace *currNsPtr = (Namespace *) Tcl_GetCurrentNamespace(interp);
      CONST char *simplePattern;
      char *patternCpy;
!     int neededElems, i;
!     size_t len;
  
      /*
       * If the specified namespace is NULL, use the current namespace.
***************
*** 1005,1011 ****
       */
  
      len = strlen(pattern);
!     patternCpy = (char *) ckalloc((unsigned) (len + 1));
      strcpy(patternCpy, pattern);
      
      nsPtr->exportArrayPtr[nsPtr->numExportPatterns] = patternCpy;
--- 1006,1012 ----
       */
  
      len = strlen(pattern);
!     patternCpy = (char *) ckalloc(len + 1);
      strcpy(patternCpy, pattern);
      
      nsPtr->exportArrayPtr[nsPtr->numExportPatterns] = patternCpy;
***************
*** 3577,3583 ****
      }
  
      if (p >= name) {
!         length = p-name+1;
          Tcl_AppendToObj(Tcl_GetObjResult(interp), name, length);
      }
      return TCL_OK;
--- 3578,3584 ----
      }
  
      if (p >= name) {
!         length = (int) (p-name+1);
          Tcl_AppendToObj(Tcl_GetObjResult(interp), name, length);
      }
      return TCL_OK;
***************
*** 3949,3955 ****
       * if the internal rep is NULL.
       */
  
!     length = strlen(name);
      if (length == 0) {
  	objPtr->bytes = tclEmptyStringRep;
      } else {
--- 3950,3956 ----
       * if the internal rep is NULL.
       */
  
!     length = (int) strlen(name);
      if (length == 0) {
  	objPtr->bytes = tclEmptyStringRep;
      } else {

*** generic/tclObj.c	2002/01/25 21:36:09	1.28
--- generic/tclObj.c	2002/01/29 06:45:31
***************
*** 841,847 ****
      }
  
      if (lengthPtr != NULL) {
! 	*lengthPtr = objPtr->length;
      }
      return objPtr->bytes;
  }
--- 841,847 ----
      }
  
      if (lengthPtr != NULL) {
! 	*lengthPtr = (int) objPtr->length;
      }
      return objPtr->bytes;
  }
***************
*** 1545,1557 ****
      register Tcl_Obj *objPtr;	/* Double obj with string rep to update. */
  {
      char buffer[TCL_DOUBLE_SPACE];
!     register int len;
      
      Tcl_PrintDouble((Tcl_Interp *) NULL, objPtr->internalRep.doubleValue,
  	    buffer);
      len = strlen(buffer);
      
!     objPtr->bytes = (char *) ckalloc((unsigned) len + 1);
      strcpy(objPtr->bytes, buffer);
      objPtr->length = len;
  }
--- 1545,1557 ----
      register Tcl_Obj *objPtr;	/* Double obj with string rep to update. */
  {
      char buffer[TCL_DOUBLE_SPACE];
!     register size_t len;
      
      Tcl_PrintDouble((Tcl_Interp *) NULL, objPtr->internalRep.doubleValue,
  	    buffer);
      len = strlen(buffer);
      
!     objPtr->bytes = (char *) ckalloc(len + 1);
      strcpy(objPtr->bytes, buffer);
      objPtr->length = len;
  }
***************
*** 2272,2278 ****
      Tcl_Obj *objPtr1 = (Tcl_Obj *) keyPtr;
      Tcl_Obj *objPtr2 = (Tcl_Obj *) hPtr->key.oneWordValue;
      register CONST char *p1, *p2;
!     register int l1, l2;
  
      /*
       * If the object pointers are the same then they match.
--- 2272,2278 ----
      Tcl_Obj *objPtr1 = (Tcl_Obj *) keyPtr;
      Tcl_Obj *objPtr2 = (Tcl_Obj *) hPtr->key.oneWordValue;
      register CONST char *p1, *p2;
!     register size_t l1, l2;
  
      /*
       * If the object pointers are the same then they match.
***************
*** 2358,2364 ****
  {
      Tcl_Obj *objPtr = (Tcl_Obj *) keyPtr;
      register CONST char *string;
!     register int length;
      register unsigned int result;
      register int c;
  
--- 2358,2364 ----
  {
      Tcl_Obj *objPtr = (Tcl_Obj *) keyPtr;
      register CONST char *string;
!     register size_t length;
      register unsigned int result;
      register int c;
  

*** generic/tclParse.c	2002/01/17 02:43:19	1.19
--- generic/tclParse.c	2002/01/29 06:45:36
***************
*** 243,249 ****
  
  
      if (numBytes < 0) {
! 	numBytes = (string? strlen(string) : 0);
      }
      parsePtr->commentStart = NULL;
      parsePtr->commentSize = 0;
--- 243,249 ----
  
  
      if (numBytes < 0) {
! 	numBytes = (string ? (int) strlen(string) : 0);
      }
      parsePtr->commentStart = NULL;
      parsePtr->commentSize = 0;
***************
*** 311,317 ****
  		if (nested) {
  		    parsePtr->incomplete = nested;
  		}
! 		parsePtr->commentSize = src - parsePtr->commentStart;
  		break;
  	    } else if (*src == '\\') {
  		if ((src[1] == '\n') && ((src + 2) == parsePtr->end)) {
--- 311,317 ----
  		if (nested) {
  		    parsePtr->incomplete = nested;
  		}
! 		parsePtr->commentSize = (int) (src - parsePtr->commentStart);
  		break;
  	    } else if (*src == '\\') {
  		if ((src[1] == '\n') && ((src + 2) == parsePtr->end)) {
***************
*** 321,327 ****
  		src += length;
  	    } else if (*src == '\n') {
  		src++;
! 		parsePtr->commentSize = src - parsePtr->commentStart;
  		break;
  	    } else {
  		src++;
--- 321,327 ----
  		src += length;
  	    } else if (*src == '\n') {
  		src++;
! 		parsePtr->commentSize = (int) (src - parsePtr->commentStart);
  		break;
  	    } else {
  		src++;
***************
*** 386,398 ****
  	 */
  
  	if (*src == '"') {
! 	    if (Tcl_ParseQuotedString(interp, src, (parsePtr->end - src),
  	            parsePtr, 1, &termPtr) != TCL_OK) {
  		goto error;
  	    }
  	    src = termPtr;
  	} else if (*src == '{') {
! 	    if (Tcl_ParseBraces(interp, src, (parsePtr->end - src),
  	            parsePtr, 1, &termPtr) != TCL_OK) {
  		goto error;
  	    }
--- 386,398 ----
  	 */
  
  	if (*src == '"') {
! 	    if (Tcl_ParseQuotedString(interp, src, (int) (parsePtr->end - src),
  	            parsePtr, 1, &termPtr) != TCL_OK) {
  		goto error;
  	    }
  	    src = termPtr;
  	} else if (*src == '{') {
! 	    if (Tcl_ParseBraces(interp, src, (int) (parsePtr->end - src),
  	            parsePtr, 1, &termPtr) != TCL_OK) {
  		goto error;
  	    }
***************
*** 417,423 ****
  	 */
  
  	tokenPtr = &parsePtr->tokenPtr[wordIndex];
! 	tokenPtr->size = src - tokenPtr->start;
  	tokenPtr->numComponents = parsePtr->numTokens - (wordIndex + 1);
  	if ((tokenPtr->numComponents == 1)
  		&& (tokenPtr[1].type == TCL_TOKEN_TEXT)) {
--- 417,423 ----
  	 */
  
  	tokenPtr = &parsePtr->tokenPtr[wordIndex];
! 	tokenPtr->size = (int) (src - tokenPtr->start);
  	tokenPtr->numComponents = parsePtr->numTokens - (wordIndex + 1);
  	if ((tokenPtr->numComponents == 1)
  		&& (tokenPtr[1].type == TCL_TOKEN_TEXT)) {
***************
*** 477,483 ****
      }
  
  
!     parsePtr->commandSize = src - parsePtr->commandStart;
      if (savedChar != 0) {
  	string[numBytes] = (char) savedChar;
      }
--- 477,483 ----
      }
  
  
!     parsePtr->commandSize = (int) (src - parsePtr->commandStart);
      if (savedChar != 0) {
  	string[numBytes] = (char) savedChar;
      }
***************
*** 491,497 ****
      if (parsePtr->commandStart == NULL) {
  	parsePtr->commandStart = string;
      }
!     parsePtr->commandSize = parsePtr->term - parsePtr->commandStart;
      return TCL_ERROR;
  }
  
--- 491,497 ----
      if (parsePtr->commandStart == NULL) {
  	parsePtr->commandStart = string;
      }
!     parsePtr->commandSize = (int) (parsePtr->term - parsePtr->commandStart);
      return TCL_ERROR;
  }
  
***************
*** 571,577 ****
  		}
  	    }
  	    tokenPtr->type = TCL_TOKEN_TEXT;
! 	    tokenPtr->size = src - tokenPtr->start;
  	    parsePtr->numTokens++;
  	} else if (*src == '$') {
  	    /*
--- 571,577 ----
  		}
  	    }
  	    tokenPtr->type = TCL_TOKEN_TEXT;
! 	    tokenPtr->size = (int) (src - tokenPtr->start);
  	    parsePtr->numTokens++;
  	} else if (*src == '$') {
  	    /*
***************
*** 580,586 ****
  	     */
  
  	    varToken = parsePtr->numTokens;
! 	    if (Tcl_ParseVarName(parsePtr->interp, src, parsePtr->end - src,
  		    parsePtr, 1) != TCL_OK) {
  		return TCL_ERROR;
  	    }
--- 580,586 ----
  	     */
  
  	    varToken = parsePtr->numTokens;
! 	    if (Tcl_ParseVarName(parsePtr->interp, src, (int) (parsePtr->end - src),
  		    parsePtr, 1) != TCL_OK) {
  		return TCL_ERROR;
  	    }
***************
*** 595,601 ****
  	    src++;
  	    while (1) {
  		if (Tcl_ParseCommand(parsePtr->interp, src,
! 			parsePtr->end - src, 1, &nested) != TCL_OK) {
  		    parsePtr->errorType = nested.errorType;
  		    parsePtr->term = nested.term;
  		    parsePtr->incomplete = nested.incomplete;
--- 595,601 ----
  	    src++;
  	    while (1) {
  		if (Tcl_ParseCommand(parsePtr->interp, src,
! 			(int) (parsePtr->end - src), 1, &nested) != TCL_OK) {
  		    parsePtr->errorType = nested.errorType;
  		    parsePtr->term = nested.term;
  		    parsePtr->incomplete = nested.incomplete;
***************
*** 620,626 ****
  		}
  	    }
  	    tokenPtr->type = TCL_TOKEN_COMMAND;
! 	    tokenPtr->size = src - tokenPtr->start;
  	    parsePtr->numTokens++;
  	} else if (*src == '\\') {
  	    /*
--- 620,626 ----
  		}
  	    }
  	    tokenPtr->type = TCL_TOKEN_COMMAND;
! 	    tokenPtr->size = (int) (src - tokenPtr->start);
  	    parsePtr->numTokens++;
  	} else if (*src == '\\') {
  	    /*
***************
*** 880,887 ****
  	    }
  	    src++;
  	}
! 	tokenPtr->size = src - tokenPtr->start;
! 	tokenPtr[-1].size = src - tokenPtr[-1].start;
  	parsePtr->numTokens++;
  	src++;
      } else {
--- 880,887 ----
  	    }
  	    src++;
  	}
! 	tokenPtr->size = (int) (src - tokenPtr->start);
! 	tokenPtr[-1].size = (int) (src - tokenPtr[-1].start);
  	parsePtr->numTokens++;
  	src++;
      } else {
***************
*** 909,915 ****
  	 * Support for empty array names here.
  	 */
  	array = ((src != end) && (*src == '('));
! 	tokenPtr->size = src - tokenPtr->start;
  	if (tokenPtr->size == 0 && !array) {
  	    goto justADollarSign;
  	}
--- 909,915 ----
  	 * Support for empty array names here.
  	 */
  	array = ((src != end) && (*src == '('));
! 	tokenPtr->size = (int) (src - tokenPtr->start);
  	if (tokenPtr->size == 0 && !array) {
  	    goto justADollarSign;
  	}
***************
*** 939,945 ****
  	}
      }
      tokenPtr = &parsePtr->tokenPtr[varIndex];
!     tokenPtr->size = src - tokenPtr->start;
      tokenPtr->numComponents = parsePtr->numTokens - (varIndex + 1);
      return TCL_OK;
  
--- 939,945 ----
  	}
      }
      tokenPtr = &parsePtr->tokenPtr[varIndex];
!     tokenPtr->size = (int) (src - tokenPtr->start);
      tokenPtr->numComponents = parsePtr->numTokens - (varIndex + 1);
      return TCL_OK;
  
***************
*** 1138,1144 ****
  		if ((src + 2) == end) {
  		    parsePtr->incomplete = 1;
  		}
! 		tokenPtr->size = (src - tokenPtr->start);
  		if (tokenPtr->size != 0) {
  		    parsePtr->numTokens++;
  		}
--- 1138,1144 ----
  		if ((src + 2) == end) {
  		    parsePtr->incomplete = 1;
  		}
! 		tokenPtr->size = (int) (src - tokenPtr->start);
  		if (tokenPtr->size != 0) {
  		    parsePtr->numTokens++;
  		}
***************
*** 1220,1226 ****
      
      if ((src != tokenPtr->start)
  	    || (parsePtr->numTokens == startIndex)) {
! 	tokenPtr->size = (src - tokenPtr->start);
  	parsePtr->numTokens++;
      }
      if (termPtr != NULL) {
--- 1220,1226 ----
      
      if ((src != tokenPtr->start)
  	    || (parsePtr->numTokens == startIndex)) {
! 	tokenPtr->size = (int) (src - tokenPtr->start);
  	parsePtr->numTokens++;
      }
      if (termPtr != NULL) {
***************
*** 1355,1361 ****
  
      p = script;
      end = p + length;
!     while (Tcl_ParseCommand((Tcl_Interp *) NULL, p, end - p, 0, &parse)
  	    == TCL_OK) {
  	p = parse.commandStart + parse.commandSize;
  	if (*p == 0) {
--- 1355,1361 ----
  
      p = script;
      end = p + length;
!     while (Tcl_ParseCommand((Tcl_Interp *) NULL, p, (int) (end - p), 0, &parse)
  	    == TCL_OK) {
  	p = parse.commandStart + parse.commandSize;
  	if (*p == 0) {

*** generic/tclParseExpr.c	2001/12/06 10:59:17	1.11
--- generic/tclParseExpr.c	2002/01/29 06:45:42
***************
*** 226,232 ****
      char savedChar;
  
      if (numBytes < 0) {
! 	numBytes = (string? strlen(string) : 0);
      }
  #ifdef TCL_COMPILE_DEBUG
      if (traceParseExpr) {
--- 226,232 ----
      char savedChar;
  
      if (numBytes < 0) {
! 	numBytes = (string ? (int) strlen(string) : 0);
      }
  #ifdef TCL_COMPILE_DEBUG
      if (traceParseExpr) {
***************
*** 415,421 ****
  	 */
  
  	condTokenPtr = &parsePtr->tokenPtr[firstIndex];
! 	condTokenPtr->size = (infoPtr->prevEnd - srcStart);
  	condTokenPtr->numComponents = parsePtr->numTokens - (firstIndex+1);
      }
      return TCL_OK;
--- 415,421 ----
  	 */
  
  	condTokenPtr = &parsePtr->tokenPtr[firstIndex];
! 	condTokenPtr->size = (int) (infoPtr->prevEnd - srcStart);
  	condTokenPtr->numComponents = parsePtr->numTokens - (firstIndex+1);
      }
      return TCL_OK;
***************
*** 476,482 ****
  	 */
  
  	PrependSubExprTokens(operator, 2, srcStart,
! 	        (infoPtr->prevEnd - srcStart), firstIndex, infoPtr);
      }
      return TCL_OK;
  }
--- 476,482 ----
  	 */
  
  	PrependSubExprTokens(operator, 2, srcStart,
! 	        (int) (infoPtr->prevEnd - srcStart), firstIndex, infoPtr);
      }
      return TCL_OK;
  }
***************
*** 536,542 ****
  	 */
  
  	PrependSubExprTokens(operator, 2, srcStart,
! 	        (infoPtr->prevEnd - srcStart), firstIndex, infoPtr);
      }
      return TCL_OK;
  }
--- 536,542 ----
  	 */
  
  	PrependSubExprTokens(operator, 2, srcStart,
! 	        (int) (infoPtr->prevEnd - srcStart), firstIndex, infoPtr);
      }
      return TCL_OK;
  }
***************
*** 597,603 ****
  	 */
  
  	PrependSubExprTokens(operator, 1, srcStart,
! 	        (infoPtr->prevEnd - srcStart), firstIndex, infoPtr);
      }
      return TCL_OK;
  }
--- 597,603 ----
  	 */
  
  	PrependSubExprTokens(operator, 1, srcStart,
! 	        (int) (infoPtr->prevEnd - srcStart), firstIndex, infoPtr);
      }
      return TCL_OK;
  }
***************
*** 658,664 ****
  	 */
  
  	PrependSubExprTokens(operator, 1, srcStart,
! 	        (infoPtr->prevEnd - srcStart), firstIndex, infoPtr);
      }
      return TCL_OK;
  }
--- 658,664 ----
  	 */
  
  	PrependSubExprTokens(operator, 1, srcStart,
! 	        (int) (infoPtr->prevEnd - srcStart), firstIndex, infoPtr);
      }
      return TCL_OK;
  }
***************
*** 718,724 ****
  	 */
  
  	PrependSubExprTokens(operator, 1, srcStart,
! 	        (infoPtr->prevEnd - srcStart), firstIndex, infoPtr);
      }
      return TCL_OK;
  }
--- 718,724 ----
  	 */
  
  	PrependSubExprTokens(operator, 1, srcStart,
! 	        (int) (infoPtr->prevEnd - srcStart), firstIndex, infoPtr);
      }
      return TCL_OK;
  }
***************
*** 782,788 ****
  	 */
  
  	PrependSubExprTokens(operator, 2, srcStart,
! 	        (infoPtr->prevEnd - srcStart), firstIndex, infoPtr);
  	lexeme = infoPtr->lexeme;
      }
      return TCL_OK;
--- 782,788 ----
  	 */
  
  	PrependSubExprTokens(operator, 2, srcStart,
! 		(int) (infoPtr->prevEnd - srcStart), firstIndex, infoPtr);
  	lexeme = infoPtr->lexeme;
      }
      return TCL_OK;
***************
*** 850,856 ****
  	 */
  
  	PrependSubExprTokens(operator, operatorSize, srcStart,
! 	        (infoPtr->prevEnd - srcStart), firstIndex, infoPtr);
  	lexeme = infoPtr->lexeme;
      }
      return TCL_OK;
--- 850,856 ----
  	 */
  
  	PrependSubExprTokens(operator, operatorSize, srcStart,
! 	        (int) (infoPtr->prevEnd - srcStart), firstIndex, infoPtr);
  	lexeme = infoPtr->lexeme;
      }
      return TCL_OK;
***************
*** 912,918 ****
  	 */
  
  	PrependSubExprTokens(operator, 2, srcStart,
! 	        (infoPtr->prevEnd - srcStart), firstIndex, infoPtr);
  	lexeme = infoPtr->lexeme;
      }
      return TCL_OK;
--- 912,918 ----
  	 */
  
  	PrependSubExprTokens(operator, 2, srcStart,
! 		(int) (infoPtr->prevEnd - srcStart), firstIndex, infoPtr);
  	lexeme = infoPtr->lexeme;
      }
      return TCL_OK;
***************
*** 974,980 ****
  	 */
  
  	PrependSubExprTokens(operator, 1, srcStart,
! 	        (infoPtr->prevEnd - srcStart), firstIndex, infoPtr);
  	lexeme = infoPtr->lexeme;
      }
      return TCL_OK;
--- 974,980 ----
  	 */
  
  	PrependSubExprTokens(operator, 1, srcStart,
! 	    (int) (infoPtr->prevEnd - srcStart), firstIndex, infoPtr);
  	lexeme = infoPtr->lexeme;
      }
      return TCL_OK;
***************
*** 1036,1042 ****
  	 */
  
  	PrependSubExprTokens(operator, 1, srcStart,
! 	        (infoPtr->prevEnd - srcStart), firstIndex, infoPtr);
  	lexeme = infoPtr->lexeme;
      }
      return TCL_OK;
--- 1036,1042 ----
  	 */
  
  	PrependSubExprTokens(operator, 1, srcStart,
! 		(int) (infoPtr->prevEnd - srcStart), firstIndex, infoPtr);
  	lexeme = infoPtr->lexeme;
      }
      return TCL_OK;
***************
*** 1094,1100 ****
  	 */
  
  	PrependSubExprTokens(operator, 1, srcStart,
! 	        (infoPtr->prevEnd - srcStart), firstIndex, infoPtr);
      } else {			/* must be a primaryExpr */
  	code = ParsePrimaryExpr(infoPtr);
  	if (code != TCL_OK) {
--- 1094,1100 ----
  	 */
  
  	PrependSubExprTokens(operator, 1, srcStart,
! 		(int) (infoPtr->prevEnd - srcStart), firstIndex, infoPtr);
      } else {			/* must be a primaryExpr */
  	code = ParsePrimaryExpr(infoPtr);
  	if (code != TCL_OK) {
***************
*** 1213,1219 ****
  	
  	dollarPtr = (infoPtr->next - 1);
  	code = Tcl_ParseVarName(interp, dollarPtr,
! 	        (infoPtr->lastChar - dollarPtr), parsePtr, 1);
  	if (code != TCL_OK) {
  	    return code;
  	}
--- 1213,1219 ----
  	
  	dollarPtr = (infoPtr->next - 1);
  	code = Tcl_ParseVarName(interp, dollarPtr,
! 		(int) (infoPtr->lastChar - dollarPtr), parsePtr, 1);
  	if (code != TCL_OK) {
  	    return code;
  	}
***************
*** 1232,1245 ****
  	
  	stringStart = infoPtr->next;
  	code = Tcl_ParseQuotedString(interp, infoPtr->start,
! 	        (infoPtr->lastChar - stringStart), parsePtr, 1, &termPtr);
  	if (code != TCL_OK) {
  	    return code;
  	}
  	infoPtr->next = termPtr;
  
  	exprTokenPtr = &parsePtr->tokenPtr[exprIndex];
! 	exprTokenPtr->size = (termPtr - exprTokenPtr->start);
  	exprTokenPtr->numComponents = parsePtr->numTokens - firstIndex;
  
  	/*
--- 1232,1245 ----
  	
  	stringStart = infoPtr->next;
  	code = Tcl_ParseQuotedString(interp, infoPtr->start,
! 	        (int) (infoPtr->lastChar - stringStart), parsePtr, 1, &termPtr);
  	if (code != TCL_OK) {
  	    return code;
  	}
  	infoPtr->next = termPtr;
  
  	exprTokenPtr = &parsePtr->tokenPtr[exprIndex];
! 	exprTokenPtr->size = (int) (termPtr - exprTokenPtr->start);
  	exprTokenPtr->numComponents = parsePtr->numTokens - firstIndex;
  
  	/*
***************
*** 1289,1295 ****
  	
  	src = infoPtr->next;
  	while (1) {
! 	    if (Tcl_ParseCommand(interp, src, (parsePtr->end - src), 1,
  		    &nested) != TCL_OK) {
  		parsePtr->term = nested.term;
  		parsePtr->errorType = nested.errorType;
--- 1289,1295 ----
  	
  	src = infoPtr->next;
  	while (1) {
! 	    if (Tcl_ParseCommand(interp, src, (int) (parsePtr->end - src), 1,
  		    &nested) != TCL_OK) {
  		parsePtr->term = nested.term;
  		parsePtr->errorType = nested.errorType;
***************
*** 1314,1324 ****
  		return TCL_ERROR;
  	    }
  	}
! 	tokenPtr->size = (src - tokenPtr->start);
  	infoPtr->next = src;
  
  	exprTokenPtr = &parsePtr->tokenPtr[exprIndex];
! 	exprTokenPtr->size = (src - tokenPtr->start);
  	exprTokenPtr->numComponents = 1;
  	break;
  
--- 1314,1324 ----
  		return TCL_ERROR;
  	    }
  	}
! 	tokenPtr->size = (int) (src - tokenPtr->start);
  	infoPtr->next = src;
  
  	exprTokenPtr = &parsePtr->tokenPtr[exprIndex];
! 	exprTokenPtr->size = (int) (src - tokenPtr->start);
  	exprTokenPtr->numComponents = 1;
  	break;
  
***************
*** 1328,1334 ****
  	 */
  
  	code = Tcl_ParseBraces(interp, infoPtr->start,
! 	        (infoPtr->lastChar - infoPtr->start), parsePtr, 1,
  		&termPtr);
  	if (code != TCL_OK) {
  	    return code;
--- 1328,1334 ----
  	 */
  
  	code = Tcl_ParseBraces(interp, infoPtr->start,
! 	        (int) (infoPtr->lastChar - infoPtr->start), parsePtr, 1,
  		&termPtr);
  	if (code != TCL_OK) {
  	    return code;
***************
*** 1336,1342 ****
  	infoPtr->next = termPtr;
  
  	exprTokenPtr = &parsePtr->tokenPtr[exprIndex];
! 	exprTokenPtr->size = (termPtr - infoPtr->start);
  	exprTokenPtr->numComponents = parsePtr->numTokens - firstIndex;
  
  	/*
--- 1336,1342 ----
  	infoPtr->next = termPtr;
  
  	exprTokenPtr = &parsePtr->tokenPtr[exprIndex];
! 	exprTokenPtr->size = (int) (termPtr - infoPtr->start);
  	exprTokenPtr->numComponents = parsePtr->numTokens - firstIndex;
  
  	/*
***************
*** 1444,1450 ****
  	}
  
  	exprTokenPtr = &parsePtr->tokenPtr[exprIndex];
! 	exprTokenPtr->size = (infoPtr->next - exprTokenPtr->start);
  	exprTokenPtr->numComponents = parsePtr->numTokens - firstIndex;
  	break;
  
--- 1444,1450 ----
  	}
  
  	exprTokenPtr = &parsePtr->tokenPtr[exprIndex];
! 	exprTokenPtr->size = (int) (infoPtr->next - exprTokenPtr->start);
  	exprTokenPtr->numComponents = parsePtr->numTokens - firstIndex;
  	break;
  
***************
*** 1604,1610 ****
  		    if (interp != NULL) {
  			while (isdigit(UCHAR(*(++termPtr)))) {} /* INTL: digit. */
  			Tcl_ResetResult(interp);
! 			offset = termPtr - src;
  			c = src[offset];
  			src[offset] = 0;
  			Tcl_AppendResult(interp, "\"", src,
--- 1604,1610 ----
  		    if (interp != NULL) {
  			while (isdigit(UCHAR(*(++termPtr)))) {} /* INTL: digit. */
  			Tcl_ResetResult(interp);
! 			offset = (int) (termPtr - src);
  			c = src[offset];
  			src[offset] = 0;
  			Tcl_AppendResult(interp, "\"", src,
***************
*** 1618,1624 ****
  
                  infoPtr->lexeme = LITERAL;
  		infoPtr->start = src;
! 		infoPtr->size = (termPtr - src);
                  infoPtr->next = termPtr;
  		parsePtr->term = termPtr;
                  return TCL_OK;
--- 1618,1624 ----
  
                  infoPtr->lexeme = LITERAL;
  		infoPtr->start = src;
! 		infoPtr->size = (int) (termPtr - src);
                  infoPtr->next = termPtr;
  		parsePtr->term = termPtr;
                  return TCL_OK;
***************
*** 1642,1648 ****
  		
  		infoPtr->lexeme = LITERAL;
  		infoPtr->start = src;
! 		infoPtr->size = (termPtr - src);
  		infoPtr->next = termPtr;
  		parsePtr->term = termPtr;
  		return TCL_OK;
--- 1642,1648 ----
  		
  		infoPtr->lexeme = LITERAL;
  		infoPtr->start = src;
! 		infoPtr->size = (int) (termPtr - src);
  		infoPtr->next = termPtr;
  		parsePtr->term = termPtr;
  		return TCL_OK;
***************
*** 1840,1846 ****
  		    offset = Tcl_UtfToUniChar(src, &ch);
  		    c = UCHAR(ch);
  		}
! 		infoPtr->size = (src - infoPtr->start);
  		infoPtr->next = src;
  		parsePtr->term = infoPtr->next;
  		/*
--- 1840,1846 ----
  		    offset = Tcl_UtfToUniChar(src, &ch);
  		    c = UCHAR(ch);
  		}
! 		infoPtr->size = (int) (src - infoPtr->start);
  		infoPtr->next = src;
  		parsePtr->term = infoPtr->next;
  		/*
***************
*** 1982,1988 ****
      char *extraInfo;		/* String to provide extra information
  				 * about the syntax error. */
  {
!     int numBytes = (infoPtr->lastChar - infoPtr->originalExpr);
      char buffer[100];
  
      if (numBytes > 60) {
--- 1982,1988 ----
      char *extraInfo;		/* String to provide extra information
  				 * about the syntax error. */
  {
!     int numBytes = (int) (infoPtr->lastChar - infoPtr->originalExpr);
      char buffer[100];
  
      if (numBytes > 60) {

*** generic/tclProc.c	2002/01/25 20:40:55	1.36
--- generic/tclProc.c	2002/01/29 06:45:49
***************
*** 361,369 ****
              goto procError;
          }
  	
!         nameLength = strlen(fieldValues[0]);
          if (fieldCount == 2) {
!             valueLength = strlen(fieldValues[1]);
          } else {
              valueLength = 0;
          }
--- 361,369 ----
              goto procError;
          }
  	
!         nameLength = (int) strlen(fieldValues[0]);
          if (fieldCount == 2) {
!             valueLength = (int) strlen(fieldValues[1]);
          } else {
              valueLength = 0;
          }
***************
*** 1215,1221 ****
   	    if (result == TCL_ERROR) {
  		char buf[100 + TCL_INTEGER_SPACE];
  
! 		numChars = strlen(procName);
   		ellipsis = "";
   		if (numChars > 50) {
   		    numChars = 50;
--- 1215,1221 ----
   	    if (result == TCL_ERROR) {
  		char buf[100 + TCL_INTEGER_SPACE];
  
! 		numChars = (int) strlen(procName);
   		ellipsis = "";
   		if (numChars > 50) {
   		    numChars = 50;

*** generic/tclRegexp.c	2002/01/17 03:03:12	1.14
--- generic/tclRegexp.c	2002/01/29 06:45:52
***************
*** 261,268 ****
  	} else {
  	    string = regexpPtr->string;
  	}
! 	*startPtr = Tcl_UtfAtIndex(string, regexpPtr->matches[index].rm_so);
! 	*endPtr = Tcl_UtfAtIndex(string, regexpPtr->matches[index].rm_eo);
      }
  }
  
--- 261,268 ----
  	} else {
  	    string = regexpPtr->string;
  	}
! 	*startPtr = Tcl_UtfAtIndex(string, (int) regexpPtr->matches[index].rm_so);
! 	*endPtr = Tcl_UtfAtIndex(string, (int) regexpPtr->matches[index].rm_eo);
      }
  }
  
***************
*** 365,378 ****
      TclRegexp *regexpPtr = (TclRegexp *) re;
  
      if ((regexpPtr->flags&REG_EXPECT) && index == -1) {
! 	*startPtr = regexpPtr->details.rm_extend.rm_so;
! 	*endPtr = regexpPtr->details.rm_extend.rm_eo;
      } else if ((size_t) index > regexpPtr->re.re_nsub) {
  	*startPtr = -1;
  	*endPtr = -1;
      } else {
! 	*startPtr = regexpPtr->matches[index].rm_so;
! 	*endPtr = regexpPtr->matches[index].rm_eo;
      }
  }
  
--- 365,378 ----
      TclRegexp *regexpPtr = (TclRegexp *) re;
  
      if ((regexpPtr->flags&REG_EXPECT) && index == -1) {
! 	*startPtr = (int) regexpPtr->details.rm_extend.rm_so;
! 	*endPtr = (int) regexpPtr->details.rm_extend.rm_eo;
      } else if ((size_t) index > regexpPtr->re.re_nsub) {
  	*startPtr = -1;
  	*endPtr = -1;
      } else {
! 	*startPtr = (int) regexpPtr->matches[index].rm_so;
! 	*endPtr = (int) regexpPtr->matches[index].rm_eo;
      }
  }
  
***************
*** 526,534 ****
  {
      TclRegexp *regexpPtr = (TclRegexp *) regexp;
  
!     infoPtr->nsubs = regexpPtr->re.re_nsub;
      infoPtr->matches = (Tcl_RegExpIndices *) regexpPtr->matches;
!     infoPtr->extendStart = regexpPtr->details.rm_extend.rm_so;
  }
  
  /*
--- 526,534 ----
  {
      TclRegexp *regexpPtr = (TclRegexp *) regexp;
  
!     infoPtr->nsubs = (int) regexpPtr->re.re_nsub;
      infoPtr->matches = (Tcl_RegExpIndices *) regexpPtr->matches;
!     infoPtr->extendStart = (int) regexpPtr->details.rm_extend.rm_so;
  }
  
  /*

*** generic/tclResult.c	2002/01/25 20:40:55	1.5
--- generic/tclResult.c	2002/01/29 06:45:56
***************
*** 235,241 ****
  				 * of a Tcl_FreeProc such as free. */
  {
      Interp *iPtr = (Interp *) interp;
!     int length;
      register Tcl_FreeProc *oldFreeProc = iPtr->freeProc;
      char *oldResult = iPtr->result;
  
--- 235,241 ----
  				 * of a Tcl_FreeProc such as free. */
  {
      Interp *iPtr = (Interp *) interp;
!     size_t length;
      register Tcl_FreeProc *oldFreeProc = iPtr->freeProc;
      char *oldResult = iPtr->result;
  
***************
*** 246,252 ****
      } else if (freeProc == TCL_VOLATILE) {
  	length = strlen(string);
  	if (length > TCL_RESULT_SIZE) {
! 	    iPtr->result = (char *) ckalloc((unsigned) length+1);
  	    iPtr->freeProc = TCL_DYNAMIC;
  	} else {
  	    iPtr->result = iPtr->resultSpace;
--- 246,252 ----
      } else if (freeProc == TCL_VOLATILE) {
  	length = strlen(string);
  	if (length > TCL_RESULT_SIZE) {
! 	    iPtr->result = (char *) ckalloc(length+1);
  	    iPtr->freeProc = TCL_DYNAMIC;
  	} else {
  	    iPtr->result = iPtr->resultSpace;
***************
*** 398,404 ****
  {
      register Interp *iPtr = (Interp *) interp;
      Tcl_Obj *objResultPtr;
!     int length;
  
      /*
       * If the string result is non-empty, move the string result to the
--- 398,404 ----
  {
      register Interp *iPtr = (Interp *) interp;
      Tcl_Obj *objResultPtr;
!     size_t length;
  
      /*
       * If the string result is non-empty, move the string result to the
***************
*** 501,507 ****
  			nargs_space * sizeof(char *));
   	    }
   	}
!   	newSpace += strlen(string);
  	args[nargs++] = string;
      }
  
--- 501,507 ----
  			nargs_space * sizeof(char *));
   	    }
   	}
!   	newSpace += (int) strlen(string);
  	args[nargs++] = string;
      }
  
***************
*** 524,530 ****
      for (i = 0; i < nargs; ++i) {
   	string = args[i];
    	strcpy(iPtr->appendResult + iPtr->appendUsed, string);
!   	iPtr->appendUsed += strlen(string);
      }
   
      /*
--- 524,530 ----
      for (i = 0; i < nargs; ++i) {
   	string = args[i];
    	strcpy(iPtr->appendResult + iPtr->appendUsed, string);
!   	iPtr->appendUsed += (int) strlen(string);
      }
   
      /*
***************
*** 687,693 ****
  	    iPtr->appendResult = NULL;
  	    iPtr->appendAvl = 0;
  	}
! 	iPtr->appendUsed = strlen(iPtr->result);
      } else if (iPtr->result[iPtr->appendUsed] != 0) {
  	/*
  	 * Most likely someone has modified a result created by
--- 687,693 ----
  	    iPtr->appendResult = NULL;
  	    iPtr->appendAvl = 0;
  	}
! 	iPtr->appendUsed = (int) strlen(iPtr->result);
      } else if (iPtr->result[iPtr->appendUsed] != 0) {
  	/*
  	 * Most likely someone has modified a result created by
***************
*** 695,701 ****
  	 * Just recompute the size.
  	 */
  
! 	iPtr->appendUsed = strlen(iPtr->result);
      }
      
      totalSpace = newSpace + iPtr->appendUsed;
--- 695,701 ----
  	 * Just recompute the size.
  	 */
  
! 	iPtr->appendUsed = (int) strlen(iPtr->result);
      }
      
      totalSpace = newSpace + iPtr->appendUsed;

*** generic/tclScan.c	2001/09/20 01:03:08	1.8
--- generic/tclScan.c	2002/01/29 06:45:59
***************
*** 675,681 ****
  	switch (ch) {
  	    case 'n':
  		if (!(flags & SCAN_SUPPRESS)) {
! 		    objPtr = Tcl_NewIntObj(string - baseString);
  		    Tcl_IncrRefCount(objPtr);
  		    objs[objIndex++] = objPtr;
  		}
--- 675,681 ----
  	switch (ch) {
  	    case 'n':
  		if (!(flags & SCAN_SUPPRESS)) {
! 		    objPtr = Tcl_NewIntObj((int) (string - baseString));
  		    Tcl_IncrRefCount(objPtr);
  		    objs[objIndex++] = objPtr;
  		}
***************
*** 783,789 ****
  		    }
  		}
  		if (!(flags & SCAN_SUPPRESS)) {
! 		    objPtr = Tcl_NewStringObj(string, end-string);
  		    Tcl_IncrRefCount(objPtr);
  		    objs[objIndex++] = objPtr;
  		}
--- 783,789 ----
  		    }
  		}
  		if (!(flags & SCAN_SUPPRESS)) {
! 		    objPtr = Tcl_NewStringObj(string, (int) (end-string));
  		    Tcl_IncrRefCount(objPtr);
  		    objs[objIndex++] = objPtr;
  		}
***************
*** 818,824 ****
  		    goto done;
  		}
  		if (!(flags & SCAN_SUPPRESS)) {
! 		    objPtr = Tcl_NewStringObj(string, end-string);
  		    Tcl_IncrRefCount(objPtr);
  		    objs[objIndex++] = objPtr;
  		}
--- 818,824 ----
  		    goto done;
  		}
  		if (!(flags & SCAN_SUPPRESS)) {
! 		    objPtr = Tcl_NewStringObj(string, (int) (end-string));
  		    Tcl_IncrRefCount(objPtr);
  		    objs[objIndex++] = objPtr;
  		}

*** generic/tclStringObj.c	2002/01/26 01:10:08	1.24
--- generic/tclStringObj.c	2002/01/29 06:46:05
***************
*** 202,211 ****
      register Tcl_Obj *objPtr;
  
      if (length < 0) {
! 	length = (bytes? strlen(bytes) : 0);
      }
      TclNewObj(objPtr);
!     TclInitStringRep(objPtr, bytes, length);
      return objPtr;
  }
  #endif /* TCL_MEM_DEBUG */
--- 202,211 ----
      register Tcl_Obj *objPtr;
  
      if (length < 0) {
! 	length = (bytes ? (int) strlen(bytes) : 0);
      }
      TclNewObj(objPtr);
!     TclInitStringRep(objPtr, bytes, (size_t) length);
      return objPtr;
  }
  #endif /* TCL_MEM_DEBUG */
***************
*** 258,267 ****
      register Tcl_Obj *objPtr;
  
      if (length < 0) {
! 	length = (bytes? strlen(bytes) : 0);
      }
      TclDbNewObj(objPtr, file, line);
!     TclInitStringRep(objPtr, bytes, length);
      return objPtr;
  }
  
--- 258,267 ----
      register Tcl_Obj *objPtr;
  
      if (length < 0) {
! 	length = (bytes ? strlen(bytes) : 0);
      }
      TclDbNewObj(objPtr, file, line);
!     TclInitStringRep(objPtr, bytes, (size_t) length);
      return objPtr;
  }
  
***************
*** 374,382 ****
      
      if (stringPtr->numChars == -1) {
  
! 	stringPtr->numChars = Tcl_NumUtfChars(objPtr->bytes, objPtr->length);
  
!  	if (stringPtr->numChars == objPtr->length) {
  
  	    /*
  	     * Since we've just calculated the number of chars, and all
--- 374,382 ----
      
      if (stringPtr->numChars == -1) {
  
! 	stringPtr->numChars = Tcl_NumUtfChars(objPtr->bytes, (int) objPtr->length);
  
!  	if (stringPtr->numChars == (int) objPtr->length) {
  
  	    /*
  	     * Since we've just calculated the number of chars, and all
***************
*** 623,629 ****
  	stringPtr = GET_STRING(objPtr);
      }
  
!     if (stringPtr->numChars == objPtr->length) {
  	char *str = Tcl_GetString(objPtr);
  
  	/*
--- 623,629 ----
  	stringPtr = GET_STRING(objPtr);
      }
  
!     if (stringPtr->numChars == (int) objPtr->length) {
  	char *str = Tcl_GetString(objPtr);
  
  	/*
***************
*** 702,708 ****
  
      Tcl_InvalidateStringRep(objPtr);
      if (length < 0) {
! 	length = (bytes? strlen(bytes) : 0);
      }
      TclInitStringRep(objPtr, bytes, length);
  }
--- 702,708 ----
  
      Tcl_InvalidateStringRep(objPtr);
      if (length < 0) {
! 	length = (bytes ? (int) strlen(bytes) : 0);
      }
      TclInitStringRep(objPtr, bytes, length);
  }
***************
*** 960,966 ****
      SetStringFromAny(NULL, objPtr);
  
      if (length < 0) {
! 	length = (bytes ? strlen(bytes) : 0);
      }
      if (length == 0) {
  	return;
--- 960,966 ----
      SetStringFromAny(NULL, objPtr);
  
      if (length < 0) {
! 	length = (bytes ? (int) strlen(bytes) : 0);
      }
      if (length == 0) {
  	return;
***************
*** 1192,1198 ****
      memcpy((VOID*) (stringPtr->unicode + stringPtr->numChars), unicode,
  	    appendNumChars * sizeof(Tcl_UniChar));
      stringPtr->unicode[numChars] = 0;
!     stringPtr->numChars = numChars;
  
      Tcl_InvalidateStringRep(objPtr);
  }
--- 1192,1198 ----
      memcpy((VOID*) (stringPtr->unicode + stringPtr->numChars), unicode,
  	    appendNumChars * sizeof(Tcl_UniChar));
      stringPtr->unicode[numChars] = 0;
!     stringPtr->numChars = (int) numChars;
  
      Tcl_InvalidateStringRep(objPtr);
  }
***************
*** 1268,1274 ****
      Tcl_UniChar *unicode;
  
      if (numBytes < 0) {
! 	numBytes = (bytes ? strlen(bytes) : 0);
      }
      if (numBytes == 0) {
  	return;
--- 1268,1274 ----
      Tcl_UniChar *unicode;
  
      if (numBytes < 0) {
! 	numBytes = (bytes ? (int) strlen(bytes) : 0);
      }
      if (numBytes == 0) {
  	return;
***************
*** 1305,1314 ****
      int numBytes;	/* Number of bytes of "bytes" to append. */
  {
      String *stringPtr;
!     int newLength, oldLength;
  
      if (numBytes < 0) {
! 	numBytes = (bytes ? strlen(bytes) : 0);
      }
      if (numBytes == 0) {
  	return;
--- 1305,1314 ----
      int numBytes;	/* Number of bytes of "bytes" to append. */
  {
      String *stringPtr;
!     size_t newLength, oldLength;
  
      if (numBytes < 0) {
! 	numBytes = (bytes ? (int) strlen(bytes) : 0);
      }
      if (numBytes == 0) {
  	return;
***************
*** 1333,1341 ****
  	 * explanation of this growth algorithm.
  	 */
  
! 	if (Tcl_AttemptSetObjLength(objPtr, 2 * newLength) == 0) {
  	    Tcl_SetObjLength(objPtr,
! 		    newLength + numBytes + TCL_GROWTH_MIN_ALLOC);
  	}
      } else {
  
--- 1333,1341 ----
  	 * explanation of this growth algorithm.
  	 */
  
! 	if (Tcl_AttemptSetObjLength(objPtr, (int) (2 * newLength)) == 0) {
  	    Tcl_SetObjLength(objPtr,
! 		    (int) (newLength + numBytes + TCL_GROWTH_MIN_ALLOC));
  	}
      } else {
  
***************
*** 1378,1384 ****
  {
  #define STATIC_LIST_SIZE 16
      String *stringPtr;
!     int newLength, oldLength, attemptLength;
      register char *string, *dst;
      char *static_list[STATIC_LIST_SIZE];
      char **args = static_list;
--- 1378,1384 ----
  {
  #define STATIC_LIST_SIZE 16
      String *stringPtr;
!     size_t newLength, oldLength, attemptLength;
      register char *string, *dst;
      char *static_list[STATIC_LIST_SIZE];
      char **args = static_list;
***************
*** 1429,1435 ****
      }
  
      stringPtr = GET_STRING(objPtr);
!     if (oldLength + newLength > (int) stringPtr->allocated) {
  
  	/*
  	 * There isn't currently enough space in the string
--- 1429,1435 ----
      }
  
      stringPtr = GET_STRING(objPtr);
!     if (oldLength + newLength > stringPtr->allocated) {
  
  	/*
  	 * There isn't currently enough space in the string
***************
*** 1444,1456 ****
  	 */
  
  	if (oldLength == 0) {
! 	    Tcl_SetObjLength(objPtr, newLength);
  	} else {
  	    attemptLength = 2 * (oldLength + newLength);
! 	    if (Tcl_AttemptSetObjLength(objPtr, attemptLength) == 0) {
  		attemptLength = oldLength + (2 * newLength) +
  		    TCL_GROWTH_MIN_ALLOC;
! 		Tcl_SetObjLength(objPtr, attemptLength);
  	    }
  	}
      }
--- 1444,1456 ----
  	 */
  
  	if (oldLength == 0) {
! 	    Tcl_SetObjLength(objPtr, (int) newLength);
  	} else {
  	    attemptLength = 2 * (oldLength + newLength);
! 	    if (Tcl_AttemptSetObjLength(objPtr, (int) attemptLength) == 0) {
  		attemptLength = oldLength + (2 * newLength) +
  		    TCL_GROWTH_MIN_ALLOC;
! 		Tcl_SetObjLength(objPtr, (int) attemptLength);
  	    }
  	}
      }
***************
*** 1555,1561 ****
      
      stringPtr = GET_STRING(objPtr);
      if (stringPtr->numChars == -1) {
! 	stringPtr->numChars = Tcl_NumUtfChars(src, objPtr->length);
      }
  
      uallocated = stringPtr->numChars * sizeof(Tcl_UniChar);
--- 1555,1561 ----
      
      stringPtr = GET_STRING(objPtr);
      if (stringPtr->numChars == -1) {
! 	stringPtr->numChars = Tcl_NumUtfChars(src, (int) objPtr->length);
      }
  
      uallocated = stringPtr->numChars * sizeof(Tcl_UniChar);

*** generic/tclUtf.c	2002/01/26 01:10:08	1.22
--- generic/tclUtf.c	2002/01/29 06:46:10
***************
*** 259,265 ****
  	p += Tcl_UniCharToUtf(*w, p);
  	w++;
      }
!     Tcl_DStringSetLength(dsPtr, oldLength + (p - string));
  
      return string;
  }
--- 259,265 ----
  	p += Tcl_UniCharToUtf(*w, p);
  	w++;
      }
!     Tcl_DStringSetLength(dsPtr, oldLength + (int) (p - string));
  
      return string;
  }
***************
*** 407,413 ****
      int oldLength;
  
      if (length < 0) {
! 	length = strlen(string);
      }
  
      /*
--- 407,413 ----
      int oldLength;
  
      if (length < 0) {
! 	length = (int) strlen(string);
      }
  
      /*
***************
*** 428,434 ****
      }
      *w = '\0';
      Tcl_DStringSetLength(dsPtr,
! 	    (oldLength + ((char *) w - (char *) wString)));
  
      return wString;
  }
--- 428,434 ----
      }
      *w = '\0';
      Tcl_DStringSetLength(dsPtr,
! 	    (oldLength + (int)((char *) w - (char *) wString)));
  
      return wString;
  }
***************
*** 823,829 ****
                  char *end;
  
                  result = (unsigned char) strtoul(p+1, &end, 16);
!                 count = end - src;
              } else {
                  count = 2;
                  result = 'x';
--- 823,829 ----
                  char *end;
  
                  result = (unsigned char) strtoul(p+1, &end, 16);
!                 count = (int) (end - src);
              } else {
                  count = 2;
                  result = 'x';
***************
*** 856,862 ****
                  p++;
              } while ((*p == ' ') || (*p == '\t'));
              result = ' ';
!             count = p - src;
              break;
          case 0:
              result = '\\';
--- 856,862 ----
                  p++;
              } while ((*p == ' ') || (*p == '\t'));
              result = ' ';
!             count = (int) (p - src);
              break;
          case 0:
              result = '\\';
***************
*** 953,959 ****
  	src += bytes;
      }
      *dst = '\0';
!     return (dst - str);
  }
  
  /*
--- 953,959 ----
  	src += bytes;
      }
      *dst = '\0';
!     return (int) (dst - str);
  }
  
  /*
***************
*** 1006,1012 ****
  	src += bytes;
      }
      *dst = '\0';
!     return (dst - str);
  }
  
  /*
--- 1006,1012 ----
  	src += bytes;
      }
      *dst = '\0';
!     return (int) (dst - str);
  }
  
  /*
***************
*** 1068,1074 ****
  	src += bytes;
      }
      *dst = '\0';
!     return (dst - str);
  }
  
  /*
--- 1068,1074 ----
  	src += bytes;
      }
      *dst = '\0';
!     return (int) (dst - str);
  }
  
  /*

*** generic/tclUtil.c	2002/01/25 20:40:56	1.28
--- generic/tclUtil.c	2002/01/29 06:46:16
***************
*** 206,212 ****
  		if (openBraces > 1) {
  		    openBraces--;
  		} else if (openBraces == 1) {
! 		    size = (p - elemStart);
  		    p++;
  		    if ((p >= limit)
  			    || isspace(UCHAR(*p))) { /* INTL: ISO space. */
--- 206,212 ----
  		if (openBraces > 1) {
  		    openBraces--;
  		} else if (openBraces == 1) {
! 		    size = (int) (p - elemStart);
  		    p++;
  		    if ((p >= limit)
  			    || isspace(UCHAR(*p))) { /* INTL: ISO space. */
***************
*** 258,264 ****
  	    case '\t':
  	    case '\v':
  		if ((openBraces == 0) && !inQuotes) {
! 		    size = (p - elemStart);
  		    goto done;
  		}
  		break;
--- 258,264 ----
  	    case '\t':
  	    case '\v':
  		if ((openBraces == 0) && !inQuotes) {
! 		    size = (int) (p - elemStart);
  		    goto done;
  		}
  		break;
***************
*** 269,275 ****
  
  	    case '"':
  		if (inQuotes) {
! 		    size = (p - elemStart);
  		    p++;
  		    if ((p >= limit)
  			    || isspace(UCHAR(*p))) { /* INTL: ISO space */
--- 269,275 ----
  
  	    case '"':
  		if (inQuotes) {
! 		    size = (int) (p - elemStart);
  		    p++;
  		    if ((p >= limit)
  			    || isspace(UCHAR(*p))) { /* INTL: ISO space */
***************
*** 320,326 ****
  	    }
  	    return TCL_ERROR;
  	}
! 	size = (p - elemStart);
      }
  
      done:
--- 320,326 ----
  	    }
  	    return TCL_ERROR;
  	}
! 	size = (int) (p - elemStart);
      }
  
      done:
***************
*** 444,457 ****
      size++;			/* Leave space for final NULL pointer. */
      argv = (CONST char **) ckalloc((unsigned)
  	    ((size * sizeof(char *)) + (l - list) + 1));
!     length = strlen(list);
      for (i = 0, p = ((char *) argv) + size*sizeof(char *);
  	    *list != 0;  i++) {
  	CONST char *prevList = list;
  	
  	result = TclFindElement(interp, list, length, &element,
  				&list, &elSize, &brace);
! 	length -= (list - prevList);
  	if (result != TCL_OK) {
  	    ckfree((char *) argv);
  	    return result;
--- 444,457 ----
      size++;			/* Leave space for final NULL pointer. */
      argv = (CONST char **) ckalloc((unsigned)
  	    ((size * sizeof(char *)) + (l - list) + 1));
!     length = (int) strlen(list);
      for (i = 0, p = ((char *) argv) + size*sizeof(char *);
  	    *list != 0;  i++) {
  	CONST char *prevList = list;
  	
  	result = TclFindElement(interp, list, length, &element,
  				&list, &elSize, &brace);
! 	length -= (int) (list - prevList);
  	if (result != TCL_OK) {
  	    ckfree((char *) argv);
  	    return result;
***************
*** 599,605 ****
  	string = "";
      }
      if (length == -1) {
! 	length = strlen(string);
      }
      lastChar = string + length;
      p = string;
--- 599,605 ----
  	string = "";
      }
      if (length == -1) {
! 	length = (int) strlen(string);
      }
      lastChar = string + length;
      p = string;
***************
*** 651,657 ****
       * two spaces for braces.
       */
  
!     return 2*(p-string) + 2;
  }
  
  /*
--- 651,657 ----
       * two spaces for braces.
       */
  
!     return (2 * (int) (p-string) + 2);
  }
  
  /*
***************
*** 724,730 ****
       */
  
      if (src && length == -1) {
! 	length = strlen(src);
      }
      if ((src == NULL) || (length == 0)) {
  	p[0] = '{';
--- 724,730 ----
       */
  
      if (src && length == -1) {
! 	length = (int) strlen(src);
      }
      if ((src == NULL) || (length == 0)) {
  	p[0] = '{';
***************
*** 820,826 ****
  	}
      }
      *p = '\0';
!     return p-dst;
  }
  
  /*
--- 820,826 ----
  	}
      }
      *p = '\0';
!     return (int) (p-dst);
  }
  
  /*
***************
*** 957,963 ****
      char *result;
  
      for (totalSize = 1, i = 0; i < argc; i++) {
! 	totalSize += strlen(argv[i]) + 1;
      }
      result = (char *) ckalloc((unsigned) totalSize);
      if (argc == 0) {
--- 957,963 ----
      char *result;
  
      for (totalSize = 1, i = 0; i < argc; i++) {
! 	totalSize += (int) strlen(argv[i]) + 1;
      }
      result = (char *) ckalloc((unsigned) totalSize);
      if (argc == 0) {
***************
*** 978,984 ****
  	while (isspace(UCHAR(*element))) { /* INTL: ISO space. */
  	    element++;
  	}
! 	for (length = strlen(element);
  		(length > 0)
  		&& (isspace(UCHAR(element[length-1]))) /* INTL: ISO space. */
  		&& ((length < 2) || (element[length-2] != '\\'));
--- 978,984 ----
  	while (isspace(UCHAR(*element))) { /* INTL: ISO space. */
  	    element++;
  	}
! 	for (length = (int) strlen(element);
  		(length > 0)
  		&& (isspace(UCHAR(element[length-1]))) /* INTL: ISO space. */
  		&& ((length < 2) || (element[length-2] != '\\'));
***************
*** 1425,1431 ****
      CONST char *end;
  
      if (length < 0) {
! 	length = strlen(string);
      }
      newSize = length + dsPtr->length;
  
--- 1425,1431 ----
      CONST char *end;
  
      if (length < 0) {
! 	length = (int) strlen(string);
      }
      newSize = length + dsPtr->length;
  
***************
*** 1491,1497 ****
      int newSize, flags, strSize;
      char *dst;
  
!     strSize = ((string == NULL) ? 0 : strlen(string));
      newSize = Tcl_ScanCountedElement(string, strSize, &flags)
  	+ dsPtr->length + 1;
  
--- 1491,1497 ----
      int newSize, flags, strSize;
      char *dst;
  
!     strSize = ((string == NULL) ? 0 : (int) strlen(string));
      newSize = Tcl_ScanCountedElement(string, strSize, &flags)
  	+ dsPtr->length + 1;
  
***************
*** 1715,1728 ****
  	        TCL_VOLATILE);
      }
  
!     dsPtr->length = strlen(iPtr->result);
      if (iPtr->freeProc != NULL) {
  	if ((iPtr->freeProc == TCL_DYNAMIC)
  		|| (iPtr->freeProc == (Tcl_FreeProc *) free)) {
  	    dsPtr->string = iPtr->result;
  	    dsPtr->spaceAvl = dsPtr->length+1;
  	} else {
! 	    dsPtr->string = (char *) ckalloc((unsigned) (dsPtr->length+1));
  	    strcpy(dsPtr->string, iPtr->result);
  	    (*iPtr->freeProc)(iPtr->result);
  	}
--- 1715,1728 ----
  	        TCL_VOLATILE);
      }
  
!     dsPtr->length = (int) strlen(iPtr->result);
      if (iPtr->freeProc != NULL) {
  	if ((iPtr->freeProc == TCL_DYNAMIC)
  		|| (iPtr->freeProc == (Tcl_FreeProc *) free)) {
  	    dsPtr->string = iPtr->result;
  	    dsPtr->spaceAvl = dsPtr->length+1;
  	} else {
! 	    dsPtr->string = (char *) ckalloc(dsPtr->length+1);
  	    strcpy(dsPtr->string, iPtr->result);
  	    (*iPtr->freeProc)(iPtr->result);
  	}
***************
*** 2062,2068 ****
  
      if (n == -n) {
  	sprintf(buffer, "%ld", n);
! 	return strlen(buffer);
      }
  
      /*
--- 2062,2068 ----
  
      if (n == -n) {
  	sprintf(buffer, "%ld", n);
! 	return (int) strlen(buffer);
      }
  
      /*
***************
*** 2127,2135 ****
      register CONST char *p, *end;
  
      if (length < 0) {
! 	length = (bytes? strlen(bytes) : 0);
      }
!     end = (bytes + length);
  
      p = bytes;
      while ((p < end) && isspace(UCHAR(*p))) { /* INTL: ISO space. */
--- 2127,2135 ----
      register CONST char *p, *end;
  
      if (length < 0) {
! 	length = (bytes ? (int) strlen(bytes) : 0);
      }
!     end = bytes + length;
  
      p = bytes;
      while ((p < end) && isspace(UCHAR(*p))) { /* INTL: ISO space. */

*** generic/tclVar.c	2002/01/25 21:36:09	1.47
--- generic/tclVar.c	2002/01/29 06:46:31
***************
*** 313,319 ****
  	int localCt = procPtr->numCompiledLocals;
  	CompiledLocal *localPtr = procPtr->firstLocalPtr;
  	Var *localVarPtr = varFramePtr->compiledLocals;
! 	int part1Len = strlen(part1);
  	
  	for (i = 0;  i < localCt;  i++) {
  	    if (!TclIsVarTemporary(localPtr)) {
--- 313,319 ----
  	int localCt = procPtr->numCompiledLocals;
  	CompiledLocal *localPtr = procPtr->firstLocalPtr;
  	Var *localVarPtr = varFramePtr->compiledLocals;
! 	int part1Len = (int) strlen(part1);
  	
  	for (i = 0;  i < localCt;  i++) {
  	    if (!TclIsVarTemporary(localPtr)) {
***************
*** 3887,3893 ****
  	int localCt = procPtr->numCompiledLocals;
  	CompiledLocal *localPtr = procPtr->firstLocalPtr;
  	Var *localVarPtr = varFramePtr->compiledLocals;
! 	int nameLen = strlen(myName);
  	int i;
  
  	varPtr = NULL;
--- 3887,3893 ----
  	int localCt = procPtr->numCompiledLocals;
  	CompiledLocal *localPtr = procPtr->firstLocalPtr;
  	Var *localVarPtr = varFramePtr->compiledLocals;
! 	int nameLen = (int) strlen(myName);
  	int i;
  
  	varPtr = NULL;
***************
*** 4538,4544 ****
  		p--;
  		if (*p == ')') {
  		    Tcl_DStringInit(&nameCopy);
! 		    Tcl_DStringAppend(&nameCopy, part1, (p-part1));
  		    part2 = Tcl_DStringValue(&nameCopy)
  			+ (openParen + 1 - part1);
  		    part2[-1] = 0;
--- 4538,4544 ----
  		p--;
  		if (*p == ')') {
  		    Tcl_DStringInit(&nameCopy);
! 		    Tcl_DStringAppend(&nameCopy, part1, (int) (p-part1));
  		    part2 = Tcl_DStringValue(&nameCopy)
  			+ (openParen + 1 - part1);
  		    part2[-1] = 0;

*** win/tclWinDde.c	2002/01/18 14:07:40	1.8
--- win/tclWinDde.c	2002/01/29 06:46:35
***************
*** 86,95 ****
--- 86,102 ----
  				Tcl_Obj *ddeObjectPtr));
  static int		    MakeDdeConnection _ANSI_ARGS_((Tcl_Interp *interp,
  				char *name, HCONV *ddeConvPtr));
+ #ifdef _WIN64
  static HDDEDATA CALLBACK    DdeServerProc _ANSI_ARGS_((UINT uType,
  				UINT uFmt, HCONV hConv, HSZ ddeTopic,
+ 				HSZ ddeItem, HDDEDATA hData, ULONG_PTR dwData1, 
+ 				ULONG_PTR dwData2));
+ #else
+ static HDDEDATA CALLBACK    DdeServerProc _ANSI_ARGS_((UINT uType,
+ 				UINT uFmt, HCONV hConv, HSZ ddeTopic,
  				HSZ ddeItem, HDDEDATA hData, DWORD dwData1, 
  				DWORD dwData2));
+ #endif
  static void		    SetDdeError _ANSI_ARGS_((Tcl_Interp *interp));
  int Tcl_DdeObjCmd(ClientData clientData,	/* Used only for deletion */
  	Tcl_Interp *interp,		/* The interp we are sending from */
***************
*** 181,190 ****
  	Tcl_MutexLock(&ddeMutex);
  	if (ddeInstance == 0) {
  	    if (DdeInitialize(&ddeInstance, DdeServerProc,
! 		    CBF_SKIP_REGISTRATIONS
! 		    | CBF_SKIP_UNREGISTRATIONS
! 		    | CBF_FAIL_POKES, 0) 
! 		    != DMLERR_NO_ERROR) {
  		ddeInstance = 0;
  	    }
  	}
--- 188,195 ----
  	Tcl_MutexLock(&ddeMutex);
  	if (ddeInstance == 0) {
  	    if (DdeInitialize(&ddeInstance, DdeServerProc,
! 		    CBF_SKIP_REGISTRATIONS | CBF_SKIP_UNREGISTRATIONS |
! 		    CBF_FAIL_POKES, 0) != DMLERR_NO_ERROR) {
  		ddeInstance = 0;
  	    }
  	}
***************
*** 446,453 ****
--- 451,463 ----
      HSZ ddeItem,		/* A string handle. Transaction-type 
  				 * dependent. */
      HDDEDATA hData,		/* DDE data. Transaction-type dependent. */
+ #ifdef _WIN64
+     ULONG_PTR dwData1,		/* Transaction-dependent data. */
+     ULONG_PTR dwData2)		/* Transaction-dependent data. */
+ #else
      DWORD dwData1,		/* Transaction-dependent data. */
      DWORD dwData2)		/* Transaction-dependent data. */
+ #endif
  {
      Tcl_DString dString;
      int len;
***************
*** 1301,1307 ****
  		    Tcl_SetObjLength(resultPtr, length);
  		    string = Tcl_GetString(resultPtr);
  		    DdeGetData(ddeData, string, length, 0);
! 		    Tcl_SetObjLength(resultPtr, strlen(string));
  		    
  		    if (Tcl_ListObjIndex(NULL, resultPtr, 0, &objPtr)
  			    != TCL_OK) {
--- 1311,1317 ----
  		    Tcl_SetObjLength(resultPtr, length);
  		    string = Tcl_GetString(resultPtr);
  		    DdeGetData(ddeData, string, length, 0);
! 		    Tcl_SetObjLength(resultPtr, (int) strlen(string));
  		    
  		    if (Tcl_ListObjIndex(NULL, resultPtr, 0, &objPtr)
  			    != TCL_OK) {

*** win/tclWinFCmd.c	2002/01/25 21:36:10	1.20
--- win/tclWinFCmd.c	2002/01/29 06:46:41
***************
*** 850,862 ****
  		HANDLE handle;
  		WIN32_FIND_DATAA data;
  		Tcl_DString buffer;
! 		int len;
  
  		path = (CONST char *) nativePath;
  
  		Tcl_DStringInit(&buffer);
  		len = strlen(path);
! 		find = Tcl_DStringAppend(&buffer, path, len);
  		if ((len > 0) && (find[len - 1] != '\\')) {
  		    Tcl_DStringAppend(&buffer, "\\", 1);
  		}
--- 850,862 ----
  		HANDLE handle;
  		WIN32_FIND_DATAA data;
  		Tcl_DString buffer;
! 		size_t len;
  
  		path = (CONST char *) nativePath;
  
  		Tcl_DStringInit(&buffer);
  		len = strlen(path);
! 		find = Tcl_DStringAppend(&buffer, path, (int) len);
  		if ((len > 0) && (find[len - 1] != '\\')) {
  		    Tcl_DStringAppend(&buffer, "\\", 1);
  		}
***************
*** 1071,1077 ****
  		continue;
  	    }
  	    nativeName = (TCHAR *) data.a.cFileName;
! 	    len = strlen(data.a.cFileName);
  	}
  
  	/* 
--- 1071,1077 ----
  		continue;
  	    }
  	    nativeName = (TCHAR *) data.a.cFileName;
! 	    len = (int) strlen(data.a.cFileName);
  	}
  
  	/* 
***************
*** 1813,1837 ****
      Tcl_Obj *pathPtr;
      int nextCheckpoint;
  {
!     char *lastValidPathEnd = NULL;
      Tcl_DString ds;
      int pathLen;
      
!     char *path = Tcl_GetStringFromObj(pathPtr, &pathLen);
  
      if (TclWinGetPlatformId() == VER_PLATFORM_WIN32_WINDOWS) {
  	Tcl_DString eDs;
! 	char *nativePath;
  	int nativeLen;
  
  	nativePath = Tcl_UtfToExternalDString(NULL, path, -1, &ds);
  	nativeLen = Tcl_DStringLength(&ds);
  
  	/* We're on Windows 95/98 */
! 	lastValidPathEnd = nativePath + Tcl_DStringLength(&ds);
  	
  	while (1) {
! 	    DWORD res = GetShortPathNameA(nativePath, nativePath, 1+nativeLen);
  	    if (res != 0) {
  		/* We found an ok path */
  		break;
--- 1813,1837 ----
      Tcl_Obj *pathPtr;
      int nextCheckpoint;
  {
!     LPTSTR lastValidPathEnd = NULL;
      Tcl_DString ds;
      int pathLen;
      
!     LPTSTR path = Tcl_GetStringFromObj(pathPtr, &pathLen);
  
      if (TclWinGetPlatformId() == VER_PLATFORM_WIN32_WINDOWS) {
  	Tcl_DString eDs;
! 	LPCTSTR nativePath;
  	int nativeLen;
  
  	nativePath = Tcl_UtfToExternalDString(NULL, path, -1, &ds);
  	nativeLen = Tcl_DStringLength(&ds);
  
  	/* We're on Windows 95/98 */
! 	lastValidPathEnd = (LPTSTR) (nativePath + Tcl_DStringLength(&ds));
  	
  	while (1) {
! 	    DWORD res = GetShortPathNameA(nativePath, (LPTSTR) nativePath, 1+nativeLen);
  	    if (res != 0) {
  		/* We found an ok path */
  		break;
***************
*** 1868,1874 ****
  	 */
  
  	/* Copy over the valid part of the path and find its length */
! 	path = Tcl_ExternalToUtfDString(NULL, nativePath, -1, &eDs);
  	if (path[1] == ':') {
  	    if (path[0] >= 'a' && path[0] <= 'z') {
  		/* Make uppercase */
--- 1868,1874 ----
  	 */
  
  	/* Copy over the valid part of the path and find its length */
! 	path = (LPTSTR) Tcl_ExternalToUtfDString(NULL, nativePath, -1, &eDs);
  	if (path[1] == ':') {
  	    if (path[0] >= 'a' && path[0] <= 'z') {
  		/* Make uppercase */
***************
*** 1881,1894 ****
  	if (lastValidPathEnd != (nativePath + nativeLen)) {
  	    *lastValidPathEnd = '/';
  	    /* Now copy over the invalid (i.e. non-existent) part of the path */
! 	    path = Tcl_ExternalToUtfDString(NULL, lastValidPathEnd, -1, &eDs);
  	    Tcl_AppendToObj(pathPtr, path, Tcl_DStringLength(&eDs));
  	    Tcl_DStringFree(&eDs);
  	}
  	Tcl_DStringFree(&ds);
      } else {
  	/* We're on WinNT or 2000 or XP */
! 	CONST char *nativePath;
  #if 0
  	/* 
  	 * We don't use this simpler version, because the speed
--- 1881,1894 ----
  	if (lastValidPathEnd != (nativePath + nativeLen)) {
  	    *lastValidPathEnd = '/';
  	    /* Now copy over the invalid (i.e. non-existent) part of the path */
! 	    path = (LPTSTR) Tcl_ExternalToUtfDString(NULL, lastValidPathEnd, -1, &eDs);
  	    Tcl_AppendToObj(pathPtr, path, Tcl_DStringLength(&eDs));
  	    Tcl_DStringFree(&eDs);
  	}
  	Tcl_DStringFree(&ds);
      } else {
  	/* We're on WinNT or 2000 or XP */
! 	LPCTSTR nativePath;
  #if 0
  	/* 
  	 * We don't use this simpler version, because the speed
***************
*** 1909,1921 ****
  	Tcl_DStringFree(&eDs);
  	Tcl_DStringFree(&ds);
  #else
! 	char *currentPathEndPosition;
  	WIN32_FILE_ATTRIBUTE_DATA data;
  	nativePath = Tcl_WinUtfToTChar(path, -1, &ds);
  
! 	if ((*tclWinProcs->getFileAttributesExProc)(nativePath, 
! 						    GetFileExInfoStandard, 
! 						    &data) == TRUE) {
  	    currentPathEndPosition = path + pathLen;
  	    nextCheckpoint = pathLen;
  	    lastValidPathEnd = currentPathEndPosition;
--- 1909,1920 ----
  	Tcl_DStringFree(&eDs);
  	Tcl_DStringFree(&ds);
  #else
! 	LPTSTR currentPathEndPosition;
  	WIN32_FILE_ATTRIBUTE_DATA data;
  	nativePath = Tcl_WinUtfToTChar(path, -1, &ds);
  
! 	if ((*tclWinProcs->getFileAttributesExProc)(
! 		nativePath, GetFileExInfoStandard, &data) == TRUE) {
  	    currentPathEndPosition = path + pathLen;
  	    nextCheckpoint = pathLen;
  	    lastValidPathEnd = currentPathEndPosition;
***************
*** 1927,1936 ****
  		char cur = *currentPathEndPosition;
  		if ((cur == '/' || cur == 0) && (path != currentPathEndPosition)) {
  		    /* Reached directory separator, or end of string */
! 		    nativePath = Tcl_WinUtfToTChar(path, currentPathEndPosition - path, 
! 						   &ds);
  		    if ((*tclWinProcs->getFileAttributesExProc)(nativePath,
! 			GetFileExInfoStandard, &data) != TRUE) {
  			/* File doesn't exist */
  			Tcl_DStringFree(&ds);
  			break;
--- 1926,1935 ----
  		char cur = *currentPathEndPosition;
  		if ((cur == '/' || cur == 0) && (path != currentPathEndPosition)) {
  		    /* Reached directory separator, or end of string */
! 		    nativePath = Tcl_WinUtfToTChar(path,
! 			    (int) (currentPathEndPosition - path), &ds);
  		    if ((*tclWinProcs->getFileAttributesExProc)(nativePath,
! 			    GetFileExInfoStandard, &data) != TRUE) {
  			/* File doesn't exist */
  			Tcl_DStringFree(&ds);
  			break;
***************
*** 1945,1951 ****
  		}
  		currentPathEndPosition++;
  	    }
! 	    nextCheckpoint = currentPathEndPosition - path;
  	}
  	if (lastValidPathEnd != NULL) {
  	    Tcl_Obj *tmpPathPtr;
--- 1944,1950 ----
  		}
  		currentPathEndPosition++;
  	    }
! 	    nextCheckpoint = (int) (currentPathEndPosition - path);
  	}
  	if (lastValidPathEnd != NULL) {
  	    Tcl_Obj *tmpPathPtr;
***************
*** 1956,1962 ****
  	     */
  	    Tcl_Obj* objPtr = NULL;
  	    int endOfString;
! 	    int useLength = lastValidPathEnd - path;
  	    if (*lastValidPathEnd == 0) {
  		tmpPathPtr = Tcl_NewStringObj(path, useLength);
  		endOfString = 1;
--- 1955,1961 ----
  	     */
  	    Tcl_Obj* objPtr = NULL;
  	    int endOfString;
! 	    int useLength = (int) (lastValidPathEnd - path);
  	    if (*lastValidPathEnd == 0) {
  		tmpPathPtr = Tcl_NewStringObj(path, useLength);
  		endOfString = 1;

*** win/tclWinFile.c	2002/01/25 21:36:10	1.24
--- win/tclWinFile.c	2002/01/29 06:46:46
***************
*** 219,225 ****
  		p = strchr(dir + 2, '\\');
  		p = strchr(p + 1, '\\');
  		p++;
! 		nativeName = Tcl_WinUtfToTChar(dir, p - dir, &ds);
  		found = (*tclWinProcs->getVolumeInformationProc)(nativeName, 
  			NULL, 0, NULL, NULL, &volFlags, NULL, 0);
  		Tcl_DStringFree(&ds);
--- 219,225 ----
  		p = strchr(dir + 2, '\\');
  		p = strchr(p + 1, '\\');
  		p++;
! 		nativeName = Tcl_WinUtfToTChar(dir, (int) (p - dir), &ds);
  		found = (*tclWinProcs->getVolumeInformationProc)(nativeName, 
  			NULL, 0, NULL, NULL, &volFlags, NULL, 0);
  		Tcl_DStringFree(&ds);
***************
*** 513,519 ****
  			(LPWSTR) Tcl_DStringValue(&ds),
  			(LPBYTE *) &wDomain);
  		Tcl_DStringFree(&ds);
! 		nameLen = domain - name;
  	    }
  	    if (badDomain == 0) {
  		Tcl_DStringInit(&ds);
--- 513,519 ----
  			(LPWSTR) Tcl_DStringValue(&ds),
  			(LPBYTE *) &wDomain);
  		Tcl_DStringFree(&ds);
! 		nameLen = (int) (domain - name);
  	    }
  	    if (badDomain == 0) {
  		Tcl_DStringInit(&ds);
***************
*** 952,958 ****
  	    } else {
  		p++;
  	    }
! 	    nativeVol = Tcl_WinUtfToTChar(fullPath, p - fullPath, &volString);
  	    dw = (DWORD) -1;
  	    (*tclWinProcs->getVolumeInformationProc)(nativeVol, NULL, 0, &dw,
  		    NULL, NULL, NULL, 0);
--- 952,959 ----
  	    } else {
  		p++;
  	    }
! 	    nativeVol = Tcl_WinUtfToTChar(fullPath,
! 		    (int) (p-fullPath), &volString);
  	    dw = (DWORD) -1;
  	    (*tclWinProcs->getVolumeInformationProc)(nativeVol, NULL, 0, &dw,
  		    NULL, NULL, NULL, 0);
***************
*** 1012,1018 ****
  	    } else {
  		p++;
  	    }
! 	    nativeVol = Tcl_WinUtfToTChar(fullPath, p - fullPath, &volString);
  	    dw = (DWORD) -1;
  	    (*tclWinProcs->getVolumeInformationProc)(nativeVol, NULL, 0, &dw,
  		    NULL, NULL, NULL, 0);
--- 1013,1020 ----
  	    } else {
  		p++;
  	    }
! 	    nativeVol = Tcl_WinUtfToTChar(fullPath,
! 		    (int) (p-fullPath), &volString);
  	    dw = (DWORD) -1;
  	    (*tclWinProcs->getVolumeInformationProc)(nativeVol, NULL, 0, &dw,
  		    NULL, NULL, NULL, 0);

*** win/tclWinInit.c	2002/01/29 02:19:24	1.34
--- win/tclWinInit.c	2002/01/29 06:46:49
***************
*** 677,683 ****
  {
      int i, length, result = -1;
      register CONST char *env, *p1, *p2;
!     char *envUpper, *nameUpper;
      Tcl_DString envString;
  
      /*
--- 677,684 ----
  {
      int i, length, result = -1;
      register CONST char *env, *p1, *p2;
!     char *nameUpper;
!     CONST char *envUpper;
      Tcl_DString envString;
  
      /*
***************
*** 685,695 ****
       * comparison.
       */
  
!     length = strlen(name);
!     nameUpper = (char *) ckalloc((unsigned) length+1);
!     memcpy((VOID *) nameUpper, (VOID *) name, (size_t) length+1);
      Tcl_UtfToUpper(nameUpper);
!     
      Tcl_DStringInit(&envString);
      for (i = 0, env = environ[i]; env != NULL; i++, env = environ[i]) {
  	/*
--- 686,696 ----
       * comparison.
       */
  
!     length = (int) strlen(name);
!     nameUpper = (char *) ckalloc(length+1);
!     memcpy((VOID *) nameUpper, (VOID *) name, length+1);
      Tcl_UtfToUpper(nameUpper);
! 
      Tcl_DStringInit(&envString);
      for (i = 0, env = environ[i]; env != NULL; i++, env = environ[i]) {
  	/*
***************
*** 706,712 ****
  	}
  	length = (int) (p1 - envUpper);
  	Tcl_DStringSetLength(&envString, length+1);
! 	Tcl_UtfToUpper(envUpper);
  
  	p1 = envUpper;
  	p2 = nameUpper;
--- 707,713 ----
  	}
  	length = (int) (p1 - envUpper);
  	Tcl_DStringSetLength(&envString, length+1);
! 	Tcl_UtfToUpper((char *)envUpper);
  
  	p1 = envUpper;
  	p2 = nameUpper;
***************
*** 718,727 ****
  	    result = i;
  	    goto done;
  	}
! 	
  	Tcl_DStringFree(&envString);
      }
!     
      *lengthPtr = i;
  
      done:
--- 719,728 ----
  	    result = i;
  	    goto done;
  	}
! 
  	Tcl_DStringFree(&envString);
      }
! 
      *lengthPtr = i;
  
      done:

*** win/tclWinPipe.c	2002/01/25 21:36:10	1.23
--- win/tclWinPipe.c	2002/01/29 06:46:56
***************
*** 726,732 ****
  	
  	for (p = native; *p != '\0'; p++) {
  	    if (*p == '\n') {
! 		length = p - native;
  		if (length > 0) {
  		    if (!WriteFile(handle, native, length, &result, NULL)) {
  			goto error;
--- 726,732 ----
  	
  	for (p = native; *p != '\0'; p++) {
  	    if (*p == '\n') {
! 		length = (int) (p - native);
  		if (length > 0) {
  		    if (!WriteFile(handle, native, length, &result, NULL)) {
  			goto error;
***************
*** 738,744 ****
  		native = p+1;
  	    }
  	}
! 	length = p - native;
  	if (length > 0) {
  	    if (!WriteFile(handle, native, length, &result, NULL)) {
  		goto error;
--- 738,744 ----
  		native = p+1;
  	    }
  	}
! 	length = (int) (p - native);
  	if (length > 0) {
  	    if (!WriteFile(handle, native, length, &result, NULL)) {
  		goto error;
***************
*** 1567,1573 ****
  	for (special = arg; ; ) {
  	    if ((*special == '\\') && 
  		    (special[1] == '\\' || special[1] == '"')) {
! 		Tcl_DStringAppend(&ds, start, special - start);
  		start = special;
  		while (1) {
  		    special++;
--- 1567,1574 ----
  	for (special = arg; ; ) {
  	    if ((*special == '\\') && 
  		    (special[1] == '\\' || special[1] == '"')) {
! 		Tcl_DStringAppend(&ds, start,
! 			(int) (special - start));
  		start = special;
  		while (1) {
  		    special++;
***************
*** 1577,1594 ****
  			 * N * 2 + 1 backslashes then a quote.
  			 */
  
! 			Tcl_DStringAppend(&ds, start, special - start);
  			break;
  		    }
  		    if (*special != '\\') {
  			break;
  		    }
  		}
! 		Tcl_DStringAppend(&ds, start, special - start);
  		start = special;
  	    }
  	    if (*special == '"') {
! 		Tcl_DStringAppend(&ds, start, special - start);
  		Tcl_DStringAppend(&ds, "\\\"", 2);
  		start = special + 1;
  	    }
--- 1578,1596 ----
  			 * N * 2 + 1 backslashes then a quote.
  			 */
  
! 			Tcl_DStringAppend(&ds, start,
! 				(int) (special - start));
  			break;
  		    }
  		    if (*special != '\\') {
  			break;
  		    }
  		}
! 		Tcl_DStringAppend(&ds, start, (int) (special - start));
  		start = special;
  	    }
  	    if (*special == '"') {
! 		Tcl_DStringAppend(&ds, start, (int) (special - start));
  		Tcl_DStringAppend(&ds, "\\\"", 2);
  		start = special + 1;
  	    }
***************
*** 1597,1603 ****
  	    }
  	    special++;
  	}
! 	Tcl_DStringAppend(&ds, start, special - start);
  	if (quote) {
  	    Tcl_DStringAppend(&ds, "\"", 1);
  	}
--- 1599,1605 ----
  	    }
  	    special++;
  	}
! 	Tcl_DStringAppend(&ds, start, (int) (special - start));
  	if (quote) {
  	    Tcl_DStringAppend(&ds, "\"", 1);
  	}

*** win/tclWinPort.h
--- win/tclWinPort.h
*** win/tclWinSerial.c	2002/01/25 21:36:10	1.20
--- win/tclWinSerial.c	2002/01/29 06:47:04
***************
*** 1747,1753 ****
          /*
          * -sysbuffer 4096 or -sysbuffer {64536 4096}
          */
!         size_t inSize = -1, outSize = -1;
          
          if (Tcl_SplitList(interp, value, &argc, &argv) == TCL_ERROR) {
              return TCL_ERROR;
--- 1747,1753 ----
          /*
          * -sysbuffer 4096 or -sysbuffer {64536 4096}
          */
!         DWORD inSize = -1, outSize = -1;
          
          if (Tcl_SplitList(interp, value, &argc, &argv) == TCL_ERROR) {
              return TCL_ERROR;

*** win/tclWinSock.c	2002/01/24 01:34:16	1.25
--- win/tclWinSock.c	2002/01/29 06:47:11
***************
*** 1067,1073 ****
       * Set kernel space buffering
       */
  
!     TclSockMinimumBuffers(sock, TCP_BUFFER_SIZE);
  
      if (server) {
  	/*
--- 1067,1073 ----
       * Set kernel space buffering
       */
  
!     TclSockMinimumBuffers((int) sock, TCP_BUFFER_SIZE);
  
      if (server) {
  	/*
***************
*** 1430,1436 ****
       * Set kernel space buffering and non-blocking.
       */
  
!     TclSockMinimumBuffers((SOCKET) sock, TCP_BUFFER_SIZE);
  
      infoPtr = NewSocketInfo((SOCKET) sock);
  
--- 1430,1436 ----
       * Set kernel space buffering and non-blocking.
       */
  
!     TclSockMinimumBuffers((int) sock, TCP_BUFFER_SIZE);
  
      infoPtr = NewSocketInfo((SOCKET) sock);
  

*** win/tclWinTime.c	2001/11/21 02:36:21	1.9
--- win/tclWinTime.c	2002/01/29 06:47:14
***************
*** 326,333 ****
  	timeInfo.lastFileTime.QuadPart = curFileTime;
  	timeInfo.lastCounter.QuadPart = curCounter.QuadPart;
  	usecSincePosixEpoch = ( curFileTime - posixEpoch.QuadPart ) / 10;
! 	timePtr->sec = (time_t) ( usecSincePosixEpoch / 1000000 );
! 	timePtr->usec = (unsigned long ) ( usecSincePosixEpoch % 1000000 );
  	
  	LeaveCriticalSection( &timeInfo.cs );
  
--- 326,333 ----
  	timeInfo.lastFileTime.QuadPart = curFileTime;
  	timeInfo.lastCounter.QuadPart = curCounter.QuadPart;
  	usecSincePosixEpoch = ( curFileTime - posixEpoch.QuadPart ) / 10;
! 	timePtr->sec = (long) ( usecSincePosixEpoch / 1000000 );
! 	timePtr->usec = (long) ( usecSincePosixEpoch % 1000000 );
  	
  	LeaveCriticalSection( &timeInfo.cs );
  
***************
*** 337,343 ****
  	/* High resolution timer is not available.  Just use ftime */
  	
  	ftime(&t);
! 	timePtr->sec = t.time;
  	timePtr->usec = t.millitm * 1000;
      }
  }
--- 337,343 ----
  	/* High resolution timer is not available.  Just use ftime */
  	
  	ftime(&t);
! 	timePtr->sec = (long) t.time;
  	timePtr->usec = t.millitm * 1000;
      }
  }
***************
*** 389,395 ****
  	 * and DST strings are optional.
  	 */
  
! 	len = strlen(zone);
  	if (len > 3) {
  	    len = 3;
  	}
--- 389,395 ----
  	 * and DST strings are optional.
  	 */
  
! 	len = (int) strlen(zone);
  	if (len > 3) {
  	    len = 3;
  	}
***************
*** 402,408 ****
  	    p += strspn(p, "+-:0123456789");
  	    if (*p != '\0') {
  		zone = p;
! 		len = strlen(zone);
  		if (len > 3) {
  		    len = 3;
  		}
--- 402,408 ----
  	    p += strspn(p, "+-:0123456789");
  	    if (*p != '\0') {
  		zone = p;
! 		len = (int) strlen(zone);
  		if (len > 3) {
  		    len = 3;
  		}
***************
*** 453,459 ****
  {
      const time_t *tp = (const time_t *) t;
      struct tm *tmPtr;
!     long time;
  
      if (!useGMT) {
  	tzset();
--- 453,459 ----
  {
      const time_t *tp = (const time_t *) t;
      struct tm *tmPtr;
!     time_t time;
  
      if (!useGMT) {
  	tzset();
***************
*** 468,474 ****
  	    return localtime(tp);
  	}
  
! 	time = *tp - _timezone;
  	
  	/*
  	 * If we aren't near to overflowing the long, just add the bias and
--- 468,474 ----
  	    return localtime(tp);
  	}
  
! 	time = (*tp - _timezone);
  	
  	/*
  	 * If we aren't near to overflowing the long, just add the bias and
***************
*** 511,519 ****
  	    }
  
  	    time /= 24;
! 	    tmPtr->tm_mday += time;
! 	    tmPtr->tm_yday += time;
! 	    tmPtr->tm_wday = (tmPtr->tm_wday + time) % 7;
  	}
      } else {
  	tmPtr = ComputeGMT(tp);
--- 511,519 ----
  	    }
  
  	    time /= 24;
! 	    tmPtr->tm_mday += (int) time;
! 	    tmPtr->tm_yday += (int) time;
! 	    tmPtr->tm_wday = (int) ((tmPtr->tm_wday + time) % 7);
  	}
      } else {
  	tmPtr = ComputeGMT(tp);
***************
*** 554,561 ****
       * Compute the 4 year span containing the specified time.
       */
  
!     tmp = *tp / SECSPER4YEAR;
!     rem = *tp % SECSPER4YEAR;
  
      /*
       * Correct for weird mod semantics so the remainder is always positive.
--- 554,561 ----
       * Compute the 4 year span containing the specified time.
       */
  
!     tmp = (long) (*tp / SECSPER4YEAR);
!     rem = (long) (*tp % SECSPER4YEAR);
  
      /*
       * Correct for weird mod semantics so the remainder is always positive.
***************
*** 621,627 ****
       * Compute day of week.  Epoch started on a Thursday.
       */
  
!     tmPtr->tm_wday = (*tp / SECSPERDAY) + 4;
      if ((*tp % SECSPERDAY) < 0) {
  	tmPtr->tm_wday--;
      }
--- 621,627 ----
       * Compute day of week.  Epoch started on a Thursday.
       */
  
!     tmPtr->tm_wday = (int) ((*tp / SECSPERDAY) + 4);
      if ((*tp % SECSPERDAY) < 0) {
  	tmPtr->tm_wday--;
      }

