diff options
-rw-r--r-- | ChangeLog | 16 | ||||
-rw-r--r-- | compat/strstr.c | 4 | ||||
-rw-r--r-- | generic/tclCmdAH.c | 4 | ||||
-rw-r--r-- | generic/tclCmdIL.c | 4 | ||||
-rw-r--r-- | generic/tclEnv.c | 4 | ||||
-rw-r--r-- | generic/tclFileName.c | 6 | ||||
-rw-r--r-- | generic/tclIO.c | 6 | ||||
-rw-r--r-- | generic/tclStringObj.c | 6 | ||||
-rw-r--r-- | generic/tclThreadTest.c | 8 | ||||
-rw-r--r-- | generic/tclUtf.c | 4 | ||||
-rw-r--r-- | mac/tclMacFCmd.c | 4 | ||||
-rw-r--r-- | mac/tclMacResource.c | 6 | ||||
-rw-r--r-- | win/tclWinInit.c | 6 |
13 files changed, 47 insertions, 31 deletions
@@ -16,6 +16,22 @@ 2002-01-25 Don Porter <dgp@users.sourceforge.net> + * compat/strstr.c (strstr): + * generic/tclCmdAH.c (Tcl_FormatObjCmd): + * generic/tclCmdIL.c (InfoNameOfExecutableCmd): + * generic/tclEnv.c (ReplaceString): + * generic/tclFileName.c (ExtractWinRoot): + * generic/tclIO.c (FlushChannel,Tcl_BadChannelOption): + * generic/tclStringObj.c (AppendUnicodeToUtfRep): + * generic/tclThreadTest.c (TclCreateThread): + * generic/tclUtf.c (Tcl_UtfPrev): + * mac/tclMacFCmd.c (TclpObjListVolumes): + * mac/tclMacResource.c (TclMacRegisterResourceFork, + BuildResourceForkList): + * win/tclWinInit.c (AppendEnvironment): Sought out and eliminated + instances of CONST-casting that are no longer needed after the + TIP 27 effort. + * Following is [Patch 501006] * generic/tclInt.decls (Tcl_AddInterpResolvers, Tcl_Export, Tcl_FindNamespace, Tcl_GetInterpResolvers, Tcl_ForgetImport, diff --git a/compat/strstr.c b/compat/strstr.c index de0c26a..c83c209 100644 --- a/compat/strstr.c +++ b/compat/strstr.c @@ -9,7 +9,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: strstr.c,v 1.2 1998/09/14 18:39:45 stanton Exp $ + * RCS: @(#) $Id: strstr.c,v 1.3 2002/01/26 01:10:08 dgp Exp $ */ /* @@ -64,5 +64,5 @@ strstr(string, substring) } b = substring; } - return (char *) 0; + return NULL; } diff --git a/generic/tclCmdAH.c b/generic/tclCmdAH.c index 8ba5132..6771374 100644 --- a/generic/tclCmdAH.c +++ b/generic/tclCmdAH.c @@ -11,7 +11,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclCmdAH.c,v 1.19 2002/01/25 20:40:55 dgp Exp $ + * RCS: @(#) $Id: tclCmdAH.c,v 1.20 2002/01/26 01:10:08 dgp Exp $ */ #include "tclInt.h" @@ -1916,7 +1916,7 @@ Tcl_FormatObjCmd(dummy, interp, objc, objv) return TCL_ERROR; } - format = (char *) Tcl_GetStringFromObj(objv[1], &formatLen); + format = Tcl_GetStringFromObj(objv[1], &formatLen); endPtr = format + formatLen; resultPtr = Tcl_NewObj(); objIndex = 2; diff --git a/generic/tclCmdIL.c b/generic/tclCmdIL.c index 72f6760..4a922fe 100644 --- a/generic/tclCmdIL.c +++ b/generic/tclCmdIL.c @@ -15,7 +15,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclCmdIL.c,v 1.39 2002/01/25 20:40:55 dgp Exp $ + * RCS: @(#) $Id: tclCmdIL.c,v 1.40 2002/01/26 01:10:08 dgp Exp $ */ #include "tclInt.h" @@ -1421,7 +1421,7 @@ InfoNameOfExecutableCmd(dummy, interp, objc, objv) nameOfExecutable = Tcl_GetNameOfExecutable(); if (nameOfExecutable != NULL) { - Tcl_SetStringObj(Tcl_GetObjResult(interp), (char *)nameOfExecutable, -1); + Tcl_SetStringObj(Tcl_GetObjResult(interp), nameOfExecutable, -1); } return TCL_OK; } diff --git a/generic/tclEnv.c b/generic/tclEnv.c index 35fa180..792835c 100644 --- a/generic/tclEnv.c +++ b/generic/tclEnv.c @@ -12,7 +12,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclEnv.c,v 1.10 2002/01/25 20:40:55 dgp Exp $ + * RCS: @(#) $Id: tclEnv.c,v 1.11 2002/01/26 01:10:08 dgp Exp $ */ #include "tclInt.h" @@ -637,7 +637,7 @@ ReplaceString(oldStr, newStr) ckfree((char *) environCache); } environCache = newCache; - environCache[cacheSize] = (char *) newStr; + environCache[cacheSize] = newStr; environCache[cacheSize+1] = NULL; cacheSize += 5; } diff --git a/generic/tclFileName.c b/generic/tclFileName.c index 3d8400a..2f6ce83 100644 --- a/generic/tclFileName.c +++ b/generic/tclFileName.c @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclFileName.c,v 1.28 2002/01/25 20:40:55 dgp Exp $ + * RCS: @(#) $Id: tclFileName.c,v 1.29 2002/01/26 01:10:08 dgp Exp $ */ #include "tclInt.h" @@ -166,7 +166,7 @@ ExtractWinRoot(path, resultPtr, offset, typePtr) { if (path[0] == '/' || path[0] == '\\') { /* Might be a UNC or Vol-Relative path */ - char *host, *share, *tail; + CONST char *host, *share, *tail; int hlen, slen; if (path[1] != '/' && path[1] != '\\') { Tcl_DStringSetLength(resultPtr, offset); @@ -174,7 +174,7 @@ ExtractWinRoot(path, resultPtr, offset, typePtr) Tcl_DStringAppend(resultPtr, "/", 1); return &path[1]; } - host = (char *)&path[2]; + host = &path[2]; /* Skip separators */ while (host[0] == '/' || host[0] == '\\') host++; diff --git a/generic/tclIO.c b/generic/tclIO.c index 75f6d42..ed5598c 100644 --- a/generic/tclIO.c +++ b/generic/tclIO.c @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclIO.c,v 1.50 2002/01/25 23:06:58 mdejong Exp $ + * RCS: @(#) $Id: tclIO.c,v 1.51 2002/01/26 01:10:08 dgp Exp $ */ #include "tclInt.h" @@ -2061,7 +2061,7 @@ FlushChannel(interp, chanPtr, calledFromAsyncFlush) toWrite = bufPtr->nextAdded - bufPtr->nextRemoved; written = (chanPtr->typePtr->outputProc) (chanPtr->instanceData, - (char *) bufPtr->buf + bufPtr->nextRemoved, toWrite, + bufPtr->buf + bufPtr->nextRemoved, toWrite, &errorCode); /* @@ -5913,7 +5913,7 @@ Tcl_BadChannelOption(interp, optionName, optionList) Tcl_DString ds; Tcl_DStringInit(&ds); - Tcl_DStringAppend(&ds, (char *) genericopt, -1); + Tcl_DStringAppend(&ds, genericopt, -1); if (optionList && (*optionList)) { Tcl_DStringAppend(&ds, " ", 1); Tcl_DStringAppend(&ds, optionList, -1); diff --git a/generic/tclStringObj.c b/generic/tclStringObj.c index 659ef41..c462565 100644 --- a/generic/tclStringObj.c +++ b/generic/tclStringObj.c @@ -33,7 +33,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclStringObj.c,v 1.23 2002/01/08 17:14:38 dgp Exp $ */ + * RCS: @(#) $Id: tclStringObj.c,v 1.24 2002/01/26 01:10:08 dgp Exp $ */ #include "tclInt.h" @@ -1221,7 +1221,7 @@ AppendUnicodeToUtfRep(objPtr, unicode, numChars) int numChars; /* Number of chars of "unicode" to convert. */ { Tcl_DString dsPtr; - char *bytes; + CONST char *bytes; if (numChars < 0) { numChars = 0; @@ -1234,7 +1234,7 @@ AppendUnicodeToUtfRep(objPtr, unicode, numChars) } Tcl_DStringInit(&dsPtr); - bytes = (char *)Tcl_UniCharToUtfDString(unicode, numChars, &dsPtr); + bytes = Tcl_UniCharToUtfDString(unicode, numChars, &dsPtr); AppendUtfToUtfRep(objPtr, bytes, Tcl_DStringLength(&dsPtr)); Tcl_DStringFree(&dsPtr); } diff --git a/generic/tclThreadTest.c b/generic/tclThreadTest.c index ef98e53..c830687 100644 --- a/generic/tclThreadTest.c +++ b/generic/tclThreadTest.c @@ -11,7 +11,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclThreadTest.c,v 1.15 2002/01/25 20:40:56 dgp Exp $ + * RCS: @(#) $Id: tclThreadTest.c,v 1.16 2002/01/26 01:10:08 dgp Exp $ */ #include "tclInt.h" @@ -118,7 +118,7 @@ EXTERN int TclThread_Init _ANSI_ARGS_((Tcl_Interp *interp)); EXTERN int Tcl_ThreadObjCmd _ANSI_ARGS_((ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])); EXTERN int TclCreateThread _ANSI_ARGS_((Tcl_Interp *interp, - CONST char *script, int joinable)); + char *script, int joinable)); EXTERN int TclThreadList _ANSI_ARGS_((Tcl_Interp *interp)); EXTERN int TclThreadSend _ANSI_ARGS_((Tcl_Interp *interp, Tcl_ThreadId id, char *script, int wait)); @@ -405,13 +405,13 @@ Tcl_ThreadObjCmd(dummy, interp, objc, objv) int TclCreateThread(interp, script, joinable) Tcl_Interp *interp; /* Current interpreter. */ - CONST char *script; /* Script to execute */ + char *script; /* Script to execute */ int joinable; /* Flag, joinable thread or not */ { ThreadCtrl ctrl; Tcl_ThreadId id; - ctrl.script = (char *) script; + ctrl.script = script; ctrl.condWait = NULL; ctrl.flags = 0; diff --git a/generic/tclUtf.c b/generic/tclUtf.c index d8b6565..2656d5a 100644 --- a/generic/tclUtf.c +++ b/generic/tclUtf.c @@ -8,7 +8,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclUtf.c,v 1.21 2002/01/17 03:03:12 dgp Exp $ + * RCS: @(#) $Id: tclUtf.c,v 1.22 2002/01/26 01:10:08 dgp Exp $ */ #include "tclInt.h" @@ -673,7 +673,7 @@ Tcl_UtfPrev(str, start) break; } if (byte >= 0xC0) { - return (char *) look; + return look; } look--; } diff --git a/mac/tclMacFCmd.c b/mac/tclMacFCmd.c index bf13e5c..528f5fc 100644 --- a/mac/tclMacFCmd.c +++ b/mac/tclMacFCmd.c @@ -9,7 +9,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclMacFCmd.c,v 1.14 2002/01/25 20:40:56 dgp Exp $ + * RCS: @(#) $Id: tclMacFCmd.c,v 1.15 2002/01/26 01:10:08 dgp Exp $ */ #include "tclInt.h" @@ -1490,7 +1490,7 @@ TclpObjListVolumes(void) break; } - Tcl_ExternalToUtfDString(NULL, (char *) &name[1], name[0], &dstr); + Tcl_ExternalToUtfDString(NULL, (CONST char *)&name[1], name[0], &dstr); elemPtr = Tcl_NewStringObj(Tcl_DStringValue(&dstr), Tcl_DStringLength(&dstr)); Tcl_AppendToObj(elemPtr, ":", 1); diff --git a/mac/tclMacResource.c b/mac/tclMacResource.c index 858bc1e..4e29420 100644 --- a/mac/tclMacResource.c +++ b/mac/tclMacResource.c @@ -11,7 +11,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclMacResource.c,v 1.10 2002/01/25 20:40:56 dgp Exp $ + * RCS: @(#) $Id: tclMacResource.c,v 1.11 2002/01/26 01:10:08 dgp Exp $ */ #include <Errors.h> @@ -1974,7 +1974,7 @@ TclMacRegisterResourceFork( if (tokenPtr != NULL) { char *tokenVal; int length; - tokenVal = (char *) Tcl_GetStringFromObj(tokenPtr, &length); + tokenVal = Tcl_GetStringFromObj(tokenPtr, &length); if (length > 0) { nameHashPtr = Tcl_FindHashEntry(&nameTable, tokenVal); if (nameHashPtr == NULL) { @@ -2191,7 +2191,7 @@ BuildResourceForkList() Tcl_SetStringObj(nameObj, "ROM Map", -1); } else { p2cstr((StringPtr) fileName); - if (strcmp(fileName,(char *) appName) == 0) { + if (strcmp(fileName,appName) == 0) { Tcl_SetStringObj(nameObj, "application", -1); } else { Tcl_SetStringObj(nameObj, fileName, -1); diff --git a/win/tclWinInit.c b/win/tclWinInit.c index 771081b..bf71fe7 100644 --- a/win/tclWinInit.c +++ b/win/tclWinInit.c @@ -7,7 +7,7 @@ * Copyright (c) 1998-1999 by Scriptics Corporation. * All rights reserved. * - * RCS: @(#) $Id: tclWinInit.c,v 1.32 2002/01/25 20:40:56 dgp Exp $ + * RCS: @(#) $Id: tclWinInit.c,v 1.33 2002/01/26 01:10:08 dgp Exp $ */ #include "tclWinInt.h" @@ -335,7 +335,7 @@ AppendEnvironment( Tcl_Obj *objPtr; char *str; Tcl_DString ds; - char **pathv; + CONST char **pathv; /* * The "L" preceeding the TCL_LIBRARY string is used to tell VC++ @@ -370,7 +370,7 @@ AppendEnvironment( * version string. */ - pathv[pathc - 1] = (char *) (lib + 4); + pathv[pathc - 1] = (lib + 4); Tcl_DStringInit(&ds); str = Tcl_JoinPath(pathc, pathv, &ds); objPtr = Tcl_NewStringObj(str, Tcl_DStringLength(&ds)); |