From fd92b8826ad83d09e08d67e70a6deae1deb9a06f Mon Sep 17 00:00:00 2001 From: dgp Date: Fri, 25 Jan 2002 21:36:09 +0000 Subject: * [Patch 505630] Updated interfaces of generic/tclBasic.cc (TIP 27). * [Patch 506818] Updated interfaces of generic/tclHash.c (TIP 27). * [Patch 506807] Updated interfaces of generic/tclObj.c (TIP 27). * [Patch 507304] Updated interfaces of win/tclWin32.c (TIP 27). * Update all callers. --- ChangeLog | 39 +++++++++++++++++++++++++++ doc/AddErrInfo.3 | 6 ++--- doc/Encoding.3 | 6 ++--- doc/Hash.3 | 4 +-- doc/ObjectType.3 | 4 +-- generic/tcl.decls | 16 ++++++----- generic/tclBasic.c | 8 +++--- generic/tclDecls.h | 15 ++++++----- generic/tclHash.c | 4 +-- generic/tclIOUtil.c | 6 ++--- generic/tclObj.c | 4 +-- generic/tclPlatDecls.h | 10 +++---- generic/tclVar.c | 6 ++--- win/tclWin32Dll.c | 6 ++--- win/tclWinFCmd.c | 4 +-- win/tclWinFile.c | 21 +++++++-------- win/tclWinLoad.c | 4 +-- win/tclWinPipe.c | 6 ++--- win/tclWinReg.c | 73 +++++++++++++++++++++++++++----------------------- win/tclWinSerial.c | 4 +-- 20 files changed, 147 insertions(+), 99 deletions(-) diff --git a/ChangeLog b/ChangeLog index 7b740f2..d088956 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,44 @@ 2002-01-25 Don Porter + * Following is [Patch 505630] + * doc/AddErrorInfo.3: + * generic/tcl.decls (Tcl_LogCommandInfo): + * generic/tclBasic.c (Tcl_LogCommandInfo): Updated interfaces + of generic/tclBasic.cc according to TIP 27. + * generic/tclDecls.h: make genstubs + + * Following is [Patch 506818] + * doc/Hash.3: + * generic/tcl.decls (Tcl_HashStats): + * generic/tclHash.c (Tcl_HashStats): Updated APIs of generic/tclHash.c + according to guidelines of TIP 27. + * generic/tclDecls.h: make genstubs + * generic/tclVar.c (Tcl_ArrayObjCmd): Updated callers. + + * Following is [Patch 506807] + * doc/ObjectType.3: + * generic/tcl.decls (Tcl_GetObjType): + * generic/tclObj.c (Tcl_GetObjType): Updated APIs of generic/tclObj.c + according to guidelines of TIP 27. + * generic/tclDecls.h: make genstubs + + * Following is [Patch 507304] + * doc/Encoding.3: + * generic/tcl.decls (Tcl_WinUtfToTChar,Tcl_WinTCharToUtf): + * win/tclWin32Dll.c (Tcl_WinUtfToTChar,Tcl_WinTCharToUtf): + Updated interfaces in win/tclWin32Dll.c according to TIP 27. + * generic/tclPlatDecls.h: make genstubs + * generic/tclIOUtil.c (TclpNativeToNormalized): + * win/tclWinFCmd.c (TclpObjNormalizePath): + * win/tclWinFile.c (TclpFindExecutable,TclpMatchInDirectory, + NativeIsExec,NativeStat): + * win/tclWinLoad.c (TclpLoadFile): + * win/tclWinPipe.c (TclpOpenFile,ApplicationType): + * win/tclWinReg.c (regConnectRegistryProc,RecursiveDeleteKey,DeleteKey, + GetKeyNames,GetType,GetValue,OpenSubKey,SetValue): + * win/tclWinSerial.c (SerialSetOptionProc): Update callers. + + * Following is [Patch 505072] * doc/Concat.3: * doc/Encoding.3: * doc/Filesystem.3: diff --git a/doc/AddErrInfo.3 b/doc/AddErrInfo.3 index 848c5a3..0c734f8 100644 --- a/doc/AddErrInfo.3 +++ b/doc/AddErrInfo.3 @@ -5,7 +5,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: AddErrInfo.3,v 1.6 2002/01/15 21:19:06 dgp Exp $ +'\" RCS: @(#) $Id: AddErrInfo.3,v 1.7 2002/01/25 21:36:09 dgp Exp $ '\" .so man.macros .TH Tcl_AddErrorInfo 3 8.0 Tcl "Tcl Library Procedures" @@ -55,9 +55,9 @@ Last \fIelement\fR argument must be NULL. .AP va_list argList in An argument list which must have been initialised using \fBTCL_VARARGS_START\fR, and cleared using \fBva_end\fR. -.AP char *script in +.AP "CONST char" *script in Pointer to first character in script containing command (must be <= command) -.AP char *command in +.AP "CONST char" *command in Pointer to first character in command that generated the error .AP int commandLength in Number of bytes in command; -1 means use all bytes up to first NULL byte diff --git a/doc/Encoding.3 b/doc/Encoding.3 index 65caab0..b921a09 100644 --- a/doc/Encoding.3 +++ b/doc/Encoding.3 @@ -4,7 +4,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: Encoding.3,v 1.8 2002/01/25 20:40:55 dgp Exp $ +'\" RCS: @(#) $Id: Encoding.3,v 1.9 2002/01/25 21:36:09 dgp Exp $ '\" .so man.macros .TH Tcl_GetEncoding 3 "8.1" Tcl "Tcl Library Procedures" @@ -35,10 +35,10 @@ int \fBTcl_UtfToExternal\fR(\fIinterp, encoding, src, srcLen, flags, statePtr, dst, dstLen, srcReadPtr, dstWrotePtr, dstCharsPtr\fR) .sp -char * +CONST char * \fBTcl_WinTCharToUtf\fR(\fItsrc, srcLen, dstPtr\fR) .sp -TCHAR * +CONST TCHAR * \fBTcl_WinUtfToTChar\fR(\fIsrc, srcLen, dstPtr\fR) .sp CONST char * diff --git a/doc/Hash.3 b/doc/Hash.3 index 7fbb7b2..53cd726 100644 --- a/doc/Hash.3 +++ b/doc/Hash.3 @@ -5,7 +5,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: Hash.3,v 1.8 2001/01/18 19:09:55 andreas_kupries Exp $ +'\" RCS: @(#) $Id: Hash.3,v 1.9 2002/01/25 21:36:09 dgp Exp $ '\" .so man.macros .TH Tcl_Hash 3 "" Tcl "Tcl Library Procedures" @@ -46,7 +46,7 @@ Tcl_HashEntry * Tcl_HashEntry * \fBTcl_NextHashEntry\fR(\fIsearchPtr\fR) .sp -char * +CONST char * \fBTcl_HashStats\fR(\fItablePtr\fR) .SH ARGUMENTS .AS Tcl_HashSearch *searchPtr diff --git a/doc/ObjectType.3 b/doc/ObjectType.3 index 75b2054..eee70e5 100644 --- a/doc/ObjectType.3 +++ b/doc/ObjectType.3 @@ -4,7 +4,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: ObjectType.3,v 1.4 2001/10/22 17:25:14 andreas_kupries Exp $ +'\" RCS: @(#) $Id: ObjectType.3,v 1.5 2002/01/25 21:36:09 dgp Exp $ '\" .so man.macros .TH Tcl_ObjType 3 8.0 Tcl "Tcl Library Procedures" @@ -31,7 +31,7 @@ int Points to the structure containing information about the Tcl object type. This storage must live forever, typically by being statically allocated. -.AP char *typeName in +.AP "CONST char" *typeName in The name of a Tcl object type that \fBTcl_GetObjType\fR should look up. .AP Tcl_Interp *interp in Interpreter to use for error reporting. diff --git a/generic/tcl.decls b/generic/tcl.decls index 45656ed..19b2344 100644 --- a/generic/tcl.decls +++ b/generic/tcl.decls @@ -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: tcl.decls,v 1.78 2002/01/25 20:40:55 dgp Exp $ +# RCS: @(#) $Id: tcl.decls,v 1.79 2002/01/25 21:36:09 dgp Exp $ library tcl @@ -166,7 +166,7 @@ declare 39 generic { int Tcl_GetLongFromObj(Tcl_Interp *interp, Tcl_Obj *objPtr, long *longPtr) } declare 40 generic { - Tcl_ObjType * Tcl_GetObjType(char *typeName) + Tcl_ObjType * Tcl_GetObjType(CONST char *typeName) } declare 41 generic { char * Tcl_GetStringFromObj(Tcl_Obj *objPtr, int *lengthPtr) @@ -948,7 +948,7 @@ declare 268 generic { void Tcl_AppendStringsToObjVA(Tcl_Obj *objPtr, va_list argList) } declare 269 generic { - char * Tcl_HashStats(Tcl_HashTable *tablePtr) + CONST char * Tcl_HashStats(Tcl_HashTable *tablePtr) } declare 270 generic { CONST char * Tcl_ParseVar(Tcl_Interp *interp, char *str, char **termPtr) @@ -1268,8 +1268,8 @@ declare 358 generic { void Tcl_FreeParse (Tcl_Parse *parsePtr) } declare 359 generic { - void Tcl_LogCommandInfo (Tcl_Interp *interp, char *script, \ - char *command, int length) + void Tcl_LogCommandInfo (Tcl_Interp *interp, CONST char *script, \ + CONST char *command, int length) } declare 360 generic { int Tcl_ParseBraces (Tcl_Interp *interp, char *string, \ @@ -1713,10 +1713,12 @@ interface tclPlat # Added in Tcl 8.1 declare 0 win { - TCHAR * Tcl_WinUtfToTChar(CONST char *str, int len, Tcl_DString *dsPtr) + CONST TCHAR * Tcl_WinUtfToTChar(CONST char *str, int len, \ + Tcl_DString *dsPtr) } declare 1 win { - char * Tcl_WinTCharToUtf(CONST TCHAR *str, int len, Tcl_DString *dsPtr) + CONST char * Tcl_WinTCharToUtf(CONST TCHAR *str, int len, \ + Tcl_DString *dsPtr) } ################## diff --git a/generic/tclBasic.c b/generic/tclBasic.c index 0cf25fc..3ebdfb0 100644 --- a/generic/tclBasic.c +++ b/generic/tclBasic.c @@ -13,7 +13,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclBasic.c,v 1.43 2001/12/14 20:31:22 msofer Exp $ + * RCS: @(#) $Id: tclBasic.c,v 1.44 2002/01/25 21:36:09 dgp Exp $ */ #include "tclInt.h" @@ -3064,15 +3064,15 @@ Tcl_EvalObjv(interp, objc, objv, flags) void Tcl_LogCommandInfo(interp, script, command, length) Tcl_Interp *interp; /* Interpreter in which to log information. */ - char *script; /* First character in script containing + CONST char *script; /* First character in script containing * command (must be <= command). */ - char *command; /* First character in command that + CONST char *command; /* First character in command that * generated the error. */ int length; /* Number of bytes in command (-1 means * use all bytes up to first null byte). */ { char buffer[200]; - register char *p; + register CONST char *p; char *ellipsis = ""; Interp *iPtr = (Interp *) interp; diff --git a/generic/tclDecls.h b/generic/tclDecls.h index b559f16..6fcf42a 100644 --- a/generic/tclDecls.h +++ b/generic/tclDecls.h @@ -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: tclDecls.h,v 1.78 2002/01/25 20:40:55 dgp Exp $ + * RCS: @(#) $Id: tclDecls.h,v 1.79 2002/01/25 21:36:09 dgp Exp $ */ #ifndef _TCLDECLS @@ -149,7 +149,7 @@ EXTERN int Tcl_GetIntFromObj _ANSI_ARGS_((Tcl_Interp * interp, EXTERN int Tcl_GetLongFromObj _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Obj * objPtr, long * longPtr)); /* 40 */ -EXTERN Tcl_ObjType * Tcl_GetObjType _ANSI_ARGS_((char * typeName)); +EXTERN Tcl_ObjType * Tcl_GetObjType _ANSI_ARGS_((CONST char * typeName)); /* 41 */ EXTERN char * Tcl_GetStringFromObj _ANSI_ARGS_((Tcl_Obj * objPtr, int * lengthPtr)); @@ -879,7 +879,7 @@ EXTERN void Tcl_AppendResultVA _ANSI_ARGS_((Tcl_Interp * interp, EXTERN void Tcl_AppendStringsToObjVA _ANSI_ARGS_(( Tcl_Obj * objPtr, va_list argList)); /* 269 */ -EXTERN char * Tcl_HashStats _ANSI_ARGS_((Tcl_HashTable * tablePtr)); +EXTERN CONST char * Tcl_HashStats _ANSI_ARGS_((Tcl_HashTable * tablePtr)); /* 270 */ EXTERN CONST char * Tcl_ParseVar _ANSI_ARGS_((Tcl_Interp * interp, char * str, char ** termPtr)); @@ -1139,7 +1139,8 @@ EXTERN Tcl_Obj * Tcl_EvalTokens _ANSI_ARGS_((Tcl_Interp * interp, EXTERN void Tcl_FreeParse _ANSI_ARGS_((Tcl_Parse * parsePtr)); /* 359 */ EXTERN void Tcl_LogCommandInfo _ANSI_ARGS_((Tcl_Interp * interp, - char * script, char * command, int length)); + CONST char * script, CONST char * command, + int length)); /* 360 */ EXTERN int Tcl_ParseBraces _ANSI_ARGS_((Tcl_Interp * interp, char * string, int numBytes, @@ -1585,7 +1586,7 @@ typedef struct TclStubs { int (*tcl_GetInt) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * str, int * intPtr)); /* 37 */ int (*tcl_GetIntFromObj) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Obj * objPtr, int * intPtr)); /* 38 */ int (*tcl_GetLongFromObj) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Obj * objPtr, long * longPtr)); /* 39 */ - Tcl_ObjType * (*tcl_GetObjType) _ANSI_ARGS_((char * typeName)); /* 40 */ + Tcl_ObjType * (*tcl_GetObjType) _ANSI_ARGS_((CONST char * typeName)); /* 40 */ char * (*tcl_GetStringFromObj) _ANSI_ARGS_((Tcl_Obj * objPtr, int * lengthPtr)); /* 41 */ void (*tcl_InvalidateStringRep) _ANSI_ARGS_((Tcl_Obj * objPtr)); /* 42 */ int (*tcl_ListObjAppendList) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Obj * listPtr, Tcl_Obj * elemListPtr)); /* 43 */ @@ -1846,7 +1847,7 @@ typedef struct TclStubs { void (*tcl_ValidateAllMemory) _ANSI_ARGS_((CONST char * file, int line)); /* 266 */ void (*tcl_AppendResultVA) _ANSI_ARGS_((Tcl_Interp * interp, va_list argList)); /* 267 */ void (*tcl_AppendStringsToObjVA) _ANSI_ARGS_((Tcl_Obj * objPtr, va_list argList)); /* 268 */ - char * (*tcl_HashStats) _ANSI_ARGS_((Tcl_HashTable * tablePtr)); /* 269 */ + CONST char * (*tcl_HashStats) _ANSI_ARGS_((Tcl_HashTable * tablePtr)); /* 269 */ CONST char * (*tcl_ParseVar) _ANSI_ARGS_((Tcl_Interp * interp, char * str, char ** termPtr)); /* 270 */ CONST char * (*tcl_PkgPresent) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * name, CONST char * version, int exact)); /* 271 */ CONST char * (*tcl_PkgPresentEx) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * name, CONST char * version, int exact, ClientData * clientDataPtr)); /* 272 */ @@ -1936,7 +1937,7 @@ typedef struct TclStubs { Tcl_RegExp (*tcl_GetRegExpFromObj) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Obj * patObj, int flags)); /* 356 */ Tcl_Obj * (*tcl_EvalTokens) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Token * tokenPtr, int count)); /* 357 */ void (*tcl_FreeParse) _ANSI_ARGS_((Tcl_Parse * parsePtr)); /* 358 */ - void (*tcl_LogCommandInfo) _ANSI_ARGS_((Tcl_Interp * interp, char * script, char * command, int length)); /* 359 */ + void (*tcl_LogCommandInfo) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * script, CONST char * command, int length)); /* 359 */ int (*tcl_ParseBraces) _ANSI_ARGS_((Tcl_Interp * interp, char * string, int numBytes, Tcl_Parse * parsePtr, int append, char ** termPtr)); /* 360 */ int (*tcl_ParseCommand) _ANSI_ARGS_((Tcl_Interp * interp, char * string, int numBytes, int nested, Tcl_Parse * parsePtr)); /* 361 */ int (*tcl_ParseExpr) _ANSI_ARGS_((Tcl_Interp * interp, char * string, int numBytes, Tcl_Parse * parsePtr)); /* 362 */ diff --git a/generic/tclHash.c b/generic/tclHash.c index a1075c5..41593f6 100644 --- a/generic/tclHash.c +++ b/generic/tclHash.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: tclHash.c,v 1.9 2001/01/18 19:09:55 andreas_kupries Exp $ + * RCS: @(#) $Id: tclHash.c,v 1.10 2002/01/25 21:36:09 dgp Exp $ */ #include "tclInt.h" @@ -736,7 +736,7 @@ Tcl_NextHashEntry(searchPtr) *---------------------------------------------------------------------- */ -char * +CONST char * Tcl_HashStats(tablePtr) Tcl_HashTable *tablePtr; /* Table for which to produce stats. */ { diff --git a/generic/tclIOUtil.c b/generic/tclIOUtil.c index 2e1eb4b..7e3fffe 100644 --- a/generic/tclIOUtil.c +++ b/generic/tclIOUtil.c @@ -17,7 +17,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclIOUtil.c,v 1.32 2002/01/25 20:40:55 dgp Exp $ + * RCS: @(#) $Id: tclIOUtil.c,v 1.33 2002/01/25 21:36:09 dgp Exp $ */ #include "tclInt.h" @@ -4134,9 +4134,9 @@ TclpNativeToNormalized(clientData) Tcl_Obj *objPtr; #ifdef __WIN32__ - Tcl_WinTCharToUtf((char*)clientData, -1, &ds); + Tcl_WinTCharToUtf((CONST char*)clientData, -1, &ds); #else - Tcl_ExternalToUtfDString(NULL, (char*)clientData, -1, &ds); + Tcl_ExternalToUtfDString(NULL, (CONST char*)clientData, -1, &ds); #endif objPtr = Tcl_NewStringObj(Tcl_DStringValue(&ds),Tcl_DStringLength(&ds)); Tcl_DStringFree(&ds); diff --git a/generic/tclObj.c b/generic/tclObj.c index fabb80c..c895237 100644 --- a/generic/tclObj.c +++ b/generic/tclObj.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: tclObj.c,v 1.27 2001/12/28 23:36:31 dgp Exp $ + * RCS: @(#) $Id: tclObj.c,v 1.28 2002/01/25 21:36:09 dgp Exp $ */ #include "tclInt.h" @@ -400,7 +400,7 @@ Tcl_AppendAllObjTypes(interp, objPtr) Tcl_ObjType * Tcl_GetObjType(typeName) - char *typeName; /* Name of Tcl object type to look up. */ + CONST char *typeName; /* Name of Tcl object type to look up. */ { register Tcl_HashEntry *hPtr; Tcl_ObjType *typePtr; diff --git a/generic/tclPlatDecls.h b/generic/tclPlatDecls.h index f4ad40b..51ed55a 100644 --- a/generic/tclPlatDecls.h +++ b/generic/tclPlatDecls.h @@ -6,7 +6,7 @@ * Copyright (c) 1998-1999 by Scriptics Corporation. * All rights reserved. * - * RCS: @(#) $Id: tclPlatDecls.h,v 1.13 2002/01/25 20:40:55 dgp Exp $ + * RCS: @(#) $Id: tclPlatDecls.h,v 1.14 2002/01/25 21:36:09 dgp Exp $ */ #ifndef _TCLPLATDECLS @@ -34,10 +34,10 @@ #ifdef __WIN32__ /* 0 */ -EXTERN TCHAR * Tcl_WinUtfToTChar _ANSI_ARGS_((CONST char * str, +EXTERN CONST TCHAR * Tcl_WinUtfToTChar _ANSI_ARGS_((CONST char * str, int len, Tcl_DString * dsPtr)); /* 1 */ -EXTERN char * Tcl_WinTCharToUtf _ANSI_ARGS_((CONST TCHAR * str, +EXTERN CONST char * Tcl_WinTCharToUtf _ANSI_ARGS_((CONST TCHAR * str, int len, Tcl_DString * dsPtr)); #endif /* __WIN32__ */ #ifdef MAC_TCL @@ -78,8 +78,8 @@ typedef struct TclPlatStubs { struct TclPlatStubHooks *hooks; #ifdef __WIN32__ - TCHAR * (*tcl_WinUtfToTChar) _ANSI_ARGS_((CONST char * str, int len, Tcl_DString * dsPtr)); /* 0 */ - char * (*tcl_WinTCharToUtf) _ANSI_ARGS_((CONST TCHAR * str, int len, Tcl_DString * dsPtr)); /* 1 */ + CONST TCHAR * (*tcl_WinUtfToTChar) _ANSI_ARGS_((CONST char * str, int len, Tcl_DString * dsPtr)); /* 0 */ + CONST char * (*tcl_WinTCharToUtf) _ANSI_ARGS_((CONST TCHAR * str, int len, Tcl_DString * dsPtr)); /* 1 */ #endif /* __WIN32__ */ #ifdef MAC_TCL void (*tcl_MacSetEventProc) _ANSI_ARGS_((Tcl_MacConvertEventPtr procPtr)); /* 0 */ diff --git a/generic/tclVar.c b/generic/tclVar.c index f632780..a827dea 100644 --- a/generic/tclVar.c +++ b/generic/tclVar.c @@ -15,7 +15,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclVar.c,v 1.46 2002/01/25 20:40:56 dgp Exp $ + * RCS: @(#) $Id: tclVar.c,v 1.47 2002/01/25 21:36:09 dgp Exp $ */ #include "tclInt.h" @@ -3579,7 +3579,7 @@ Tcl_ArrayObjCmd(dummy, interp, objc, objv) } case ARRAY_STATISTICS: { - char *stats; + CONST char *stats; if (notArray) { goto error; @@ -3587,7 +3587,7 @@ Tcl_ArrayObjCmd(dummy, interp, objc, objv) stats = Tcl_HashStats(varPtr->value.tablePtr); if (stats != NULL) { - Tcl_SetResult(interp, stats, TCL_VOLATILE); + Tcl_SetStringObj(Tcl_GetObjResult(interp), stats, -1); ckfree((void *)stats); } else { Tcl_SetResult(interp, "error reading array statistics", diff --git a/win/tclWin32Dll.c b/win/tclWin32Dll.c index c1194dd..d37a6ad 100644 --- a/win/tclWin32Dll.c +++ b/win/tclWin32Dll.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: tclWin32Dll.c,v 1.11 2001/11/19 17:45:12 vincentdarley Exp $ + * RCS: @(#) $Id: tclWin32Dll.c,v 1.12 2002/01/25 21:36:10 dgp Exp $ */ #include "tclWinInt.h" @@ -490,7 +490,7 @@ TclWinSetInterfaces( *--------------------------------------------------------------------------- */ -TCHAR * +CONST TCHAR * Tcl_WinUtfToTChar(string, len, dsPtr) CONST char *string; /* Source string in UTF-8. */ int len; /* Source string length in bytes, or < 0 for @@ -502,7 +502,7 @@ Tcl_WinUtfToTChar(string, len, dsPtr) string, len, dsPtr); } -char * +CONST char * Tcl_WinTCharToUtf(string, len, dsPtr) CONST TCHAR *string; /* Source string in Unicode when running * NT, ANSI when running 95. */ diff --git a/win/tclWinFCmd.c b/win/tclWinFCmd.c index ee49af9..5ebe7d7 100644 --- a/win/tclWinFCmd.c +++ b/win/tclWinFCmd.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: tclWinFCmd.c,v 1.19 2002/01/18 14:17:06 dgp Exp $ + * RCS: @(#) $Id: tclWinFCmd.c,v 1.20 2002/01/25 21:36:10 dgp Exp $ */ #include "tclWinInt.h" @@ -1888,7 +1888,7 @@ TclpObjNormalizePath(interp, pathPtr, nextCheckpoint) Tcl_DStringFree(&ds); } else { /* We're on WinNT or 2000 or XP */ - char *nativePath; + CONST char *nativePath; #if 0 /* * We don't use this simpler version, because the speed diff --git a/win/tclWinFile.c b/win/tclWinFile.c index 29f8fef..f92eeaa 100644 --- a/win/tclWinFile.c +++ b/win/tclWinFile.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: tclWinFile.c,v 1.23 2002/01/25 20:40:56 dgp Exp $ + * RCS: @(#) $Id: tclWinFile.c,v 1.24 2002/01/25 21:36:10 dgp Exp $ */ #include "tclWinInt.h" @@ -80,7 +80,7 @@ TclpFindExecutable(argv0) */ (*tclWinProcs->getModuleFileNameProc)(NULL, wName, MAX_PATH); - Tcl_WinTCharToUtf((TCHAR *) wName, -1, &ds); + Tcl_WinTCharToUtf((CONST TCHAR *) wName, -1, &ds); tclNativeExecutableName = ckalloc((unsigned) (Tcl_DStringLength(&ds) + 1)); strcpy(tclNativeExecutableName, Tcl_DStringValue(&ds)); @@ -132,7 +132,7 @@ TclpMatchInDirectory(interp, resultPtr, pathPtr, pattern, types) Tcl_DString ds; Tcl_DString dsOrig; Tcl_Obj *fileNamePtr; - TCHAR *nativeName; + CONST TCHAR *nativeName; int matchSpecialDots; /* @@ -269,15 +269,15 @@ TclpMatchInDirectory(interp, resultPtr, pathPtr, pattern, types) for (found = 1; found != 0; found = (*tclWinProcs->findNextFileProc)(handle, &data)) { - TCHAR *nativeMatchResult; - char *name, *fname; + CONST TCHAR *nativeMatchResult; + CONST char *name, *fname; int typeOk = 1; if (tclWinProcs->useWide) { - nativeName = (TCHAR *) data.w.cFileName; + nativeName = (CONST TCHAR *) data.w.cFileName; } else { - nativeName = (TCHAR *) data.a.cFileName; + nativeName = (CONST TCHAR *) data.a.cFileName; } name = Tcl_WinTCharToUtf(nativeName, -1, &ds); @@ -643,8 +643,7 @@ static int NativeIsExec(nativePath) CONST TCHAR *nativePath; { - CONST char *p; - char *path; + CONST char *p, *path; Tcl_DString ds; /* @@ -937,7 +936,7 @@ NativeStat(nativePath, statPtr) if ((fullPath[0] == '\\') && (fullPath[1] == '\\')) { CONST char *p; DWORD dw; - TCHAR *nativeVol; + CONST TCHAR *nativeVol; Tcl_DString volString; p = strchr(fullPath + 2, '\\'); @@ -997,7 +996,7 @@ NativeStat(nativePath, statPtr) if ((fullPath[0] == '\\') && (fullPath[1] == '\\')) { CONST char *p; DWORD dw; - TCHAR *nativeVol; + CONST TCHAR *nativeVol; Tcl_DString volString; p = strchr(fullPath + 2, '\\'); diff --git a/win/tclWinLoad.c b/win/tclWinLoad.c index 9cd5c21..8e23490 100644 --- a/win/tclWinLoad.c +++ b/win/tclWinLoad.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: tclWinLoad.c,v 1.10 2002/01/09 19:09:28 kennykb Exp $ + * RCS: @(#) $Id: tclWinLoad.c,v 1.11 2002/01/25 21:36:10 dgp Exp $ */ #include "tclWinInt.h" @@ -55,7 +55,7 @@ TclpLoadFile(interp, pathPtr, sym1, sym2, proc1Ptr, proc2Ptr, * this file. */ { HINSTANCE handle; - TCHAR *nativeName; + CONST TCHAR *nativeName; Tcl_DString ds; char *fileName = Tcl_GetString(pathPtr); diff --git a/win/tclWinPipe.c b/win/tclWinPipe.c index 3380942..cac423d 100644 --- a/win/tclWinPipe.c +++ b/win/tclWinPipe.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: tclWinPipe.c,v 1.22 2002/01/25 20:40:56 dgp Exp $ + * RCS: @(#) $Id: tclWinPipe.c,v 1.23 2002/01/25 21:36:10 dgp Exp $ */ #include "tclWinInt.h" @@ -578,7 +578,7 @@ TclpOpenFile(path, mode) HANDLE handle; DWORD accessMode, createMode, shareMode, flags; Tcl_DString ds; - TCHAR *nativePath; + CONST TCHAR *nativePath; /* * Map the access bits to the NT access mode. @@ -1360,7 +1360,7 @@ ApplicationType(interp, originalName, fullName) DWORD attr, read; IMAGE_DOS_HEADER header; Tcl_DString nameBuf, ds; - TCHAR *nativeName; + CONST TCHAR *nativeName; WCHAR nativeFullPath[MAX_PATH]; static char extensions[][5] = {"", ".com", ".exe", ".bat"}; diff --git a/win/tclWinReg.c b/win/tclWinReg.c index dee4188..84c31ea 100644 --- a/win/tclWinReg.c +++ b/win/tclWinReg.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: tclWinReg.c,v 1.14 2002/01/18 14:07:40 dgp Exp $ + * RCS: @(#) $Id: tclWinReg.c,v 1.15 2002/01/25 21:36:10 dgp Exp $ */ #include @@ -80,7 +80,7 @@ static DWORD lastType = REG_RESOURCE_LIST; typedef struct RegWinProcs { int useWide; - LONG (WINAPI *regConnectRegistryProc)(TCHAR *, HKEY, PHKEY); + LONG (WINAPI *regConnectRegistryProc)(CONST TCHAR *, HKEY, PHKEY); LONG (WINAPI *regCreateKeyExProc)(HKEY, CONST TCHAR *, DWORD, TCHAR *, DWORD, REGSAM, SECURITY_ATTRIBUTES *, HKEY *, DWORD *); LONG (WINAPI *regDeleteKeyProc)(HKEY, CONST TCHAR *); @@ -106,7 +106,7 @@ static RegWinProcs *regWinProcs; static RegWinProcs asciiProcs = { 0, - (LONG (WINAPI *)(TCHAR *, HKEY, PHKEY)) RegConnectRegistryA, + (LONG (WINAPI *)(CONST TCHAR *, HKEY, PHKEY)) RegConnectRegistryA, (LONG (WINAPI *)(HKEY, CONST TCHAR *, DWORD, TCHAR *, DWORD, REGSAM, SECURITY_ATTRIBUTES *, HKEY *, DWORD *)) RegCreateKeyExA, @@ -131,7 +131,7 @@ static RegWinProcs asciiProcs = { static RegWinProcs unicodeProcs = { 1, - (LONG (WINAPI *)(TCHAR *, HKEY, PHKEY)) RegConnectRegistryW, + (LONG (WINAPI *)(CONST TCHAR *, HKEY, PHKEY)) RegConnectRegistryW, (LONG (WINAPI *)(HKEY, CONST TCHAR *, DWORD, TCHAR *, DWORD, REGSAM, SECURITY_ATTRIBUTES *, HKEY *, DWORD *)) RegCreateKeyExW, @@ -179,7 +179,8 @@ static DWORD OpenSubKey(char *hostName, HKEY rootKey, static int ParseKeyName(Tcl_Interp *interp, char *name, char **hostNamePtr, HKEY *rootKeyPtr, char **keyNamePtr); -static DWORD RecursiveDeleteKey(HKEY hStartKey, TCHAR * pKeyName); +static DWORD RecursiveDeleteKey(HKEY hStartKey, + CONST TCHAR * pKeyName); static int RegistryObjCmd(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj * CONST objv[]); @@ -352,6 +353,7 @@ DeleteKey( Tcl_Interp *interp, /* Current interpreter. */ Tcl_Obj *keyNameObj) /* Name of key to delete. */ { + CONST TCHAR *nativeTail; char *tail, *buffer, *hostName, *keyName; HKEY rootKey, subkey; DWORD result; @@ -405,8 +407,8 @@ DeleteKey( * Now we recursively delete the key and everything below it. */ - tail = Tcl_WinUtfToTChar(tail, -1, &buf); - result = RecursiveDeleteKey(subkey, tail); + nativeTail = Tcl_WinUtfToTChar(tail, -1, &buf); + result = RecursiveDeleteKey(subkey, nativeTail); Tcl_DStringFree(&buf); if (result != ERROR_SUCCESS && result != ERROR_FILE_NOT_FOUND) { @@ -505,7 +507,8 @@ GetKeyNames( { HKEY key; DWORD index; - char buffer[MAX_PATH+1], *pattern, *name; + TCHAR buffer[MAX_PATH+1]; + char *pattern, *name; Tcl_Obj *resultPtr; int result = TCL_OK; Tcl_DString ds; @@ -533,7 +536,7 @@ GetKeyNames( resultPtr = Tcl_GetObjResult(interp); for (index = 0; (*regWinProcs->regEnumKeyProc)(key, index, buffer, MAX_PATH+1) == ERROR_SUCCESS; index++) { - Tcl_WinTCharToUtf((TCHAR *) buffer, -1, &ds); + Tcl_WinTCharToUtf(buffer, -1, &ds); name = Tcl_DStringValue(&ds); if (pattern && !Tcl_StringMatch(name, pattern)) { Tcl_DStringFree(&ds); @@ -581,6 +584,7 @@ GetType( Tcl_DString ds; char *valueName; int length; + CONST TCHAR *nativeValue; /* * Attempt to open the key for reading. @@ -598,8 +602,8 @@ GetType( resultPtr = Tcl_GetObjResult(interp); valueName = Tcl_GetStringFromObj(valueNameObj, &length); - valueName = Tcl_WinUtfToTChar(valueName, length, &ds); - result = (*regWinProcs->regQueryValueExProc)(key, valueName, NULL, &type, + nativeValue = Tcl_WinUtfToTChar(valueName, length, &ds); + result = (*regWinProcs->regQueryValueExProc)(key, nativeValue, NULL, &type, NULL, NULL); Tcl_DStringFree(&ds); RegCloseKey(key); @@ -655,6 +659,7 @@ GetValue( Tcl_Obj *resultPtr; Tcl_DString data, buf; int nameLen; + CONST TCHAR *nativeValue; /* * Attempt to open the key for reading. @@ -682,9 +687,9 @@ GetValue( resultPtr = Tcl_GetObjResult(interp); valueName = Tcl_GetStringFromObj(valueNameObj, &nameLen); - valueName = Tcl_WinUtfToTChar(valueName, nameLen, &buf); + nativeValue = Tcl_WinUtfToTChar(valueName, nameLen, &buf); - result = (*regWinProcs->regQueryValueExProc)(key, valueName, NULL, &type, + result = (*regWinProcs->regQueryValueExProc)(key, nativeValue, NULL, &type, (BYTE *) Tcl_DStringValue(&data), &length); while (result == ERROR_MORE_DATA) { /* @@ -694,7 +699,7 @@ GetValue( */ length *= 2; Tcl_DStringSetLength(&data, (int) length); - result = (*regWinProcs->regQueryValueExProc)(key, valueName, NULL, + result = (*regWinProcs->regQueryValueExProc)(key, nativeValue, NULL, &type, (BYTE *) Tcl_DStringValue(&data), &length); } Tcl_DStringFree(&buf); @@ -938,23 +943,24 @@ OpenKey( static DWORD OpenSubKey( - char *hostName, /* Host to access, or NULL for local. */ + CONST char *hostName, /* Host to access, or NULL for local. */ HKEY rootKey, /* Root registry key. */ - char *keyName, /* Subkey name. */ + CONST char *keyName, /* Subkey name. */ REGSAM mode, /* Access mode. */ int flags, /* 0 or REG_CREATE. */ HKEY *keyPtr) /* Returned HKEY. */ { DWORD result; Tcl_DString buf; + CONST TCHAR *nativeHost, nativeKey; /* * Attempt to open the root key on a remote host if necessary. */ if (hostName) { - hostName = Tcl_WinUtfToTChar(hostName, -1, &buf); - result = (*regWinProcs->regConnectRegistryProc)(hostName, rootKey, + nativeHost = Tcl_WinUtfToTChar(hostName, -1, &buf); + result = (*regWinProcs->regConnectRegistryProc)(nativeHost, rootKey, &rootKey); Tcl_DStringFree(&buf); if (result != ERROR_SUCCESS) { @@ -967,10 +973,10 @@ OpenSubKey( * that this key must be closed by the caller. */ - keyName = Tcl_WinUtfToTChar(keyName, -1, &buf); + nativeKey = Tcl_WinUtfToTChar(keyName, -1, &buf); if (flags & REG_CREATE) { DWORD create; - result = (*regWinProcs->regCreateKeyExProc)(rootKey, keyName, 0, "", + result = (*regWinProcs->regCreateKeyExProc)(rootKey, nativeKey, 0, "", REG_OPTION_NON_VOLATILE, mode, NULL, keyPtr, &create); } else { if (rootKey == HKEY_PERFORMANCE_DATA) { @@ -982,7 +988,7 @@ OpenSubKey( *keyPtr = HKEY_PERFORMANCE_DATA; result = ERROR_SUCCESS; } else { - result = (*regWinProcs->regOpenKeyExProc)(rootKey, keyName, 0, + result = (*regWinProcs->regOpenKeyExProc)(rootKey, nativeKey, 0, mode, keyPtr); } } @@ -1103,7 +1109,7 @@ ParseKeyName( static DWORD RecursiveDeleteKey( HKEY startKey, /* Parent of key to be deleted. */ - char *keyName) /* Name of key to be deleted in external + CONST TCHAR *keyName) /* Name of key to be deleted in external * encoding, not UTF. */ { DWORD result, size, maxSize; @@ -1140,13 +1146,14 @@ RecursiveDeleteKey( */ size = maxSize; - result=(*regWinProcs->regEnumKeyExProc)(hKey, 0, + result=(*regWinProcs->regEnumKeyExProc)(hKey, 0, (TCHAR *) Tcl_DStringValue(&subkey), &size, NULL, NULL, NULL, NULL); if (result == ERROR_NO_MORE_ITEMS) { result = (*regWinProcs->regDeleteKeyProc)(startKey, keyName); break; } else if (result == ERROR_SUCCESS) { - result = RecursiveDeleteKey(hKey, Tcl_DStringValue(&subkey)); + result = RecursiveDeleteKey(hKey, + (CONST TCHAR *) Tcl_DStringValue(&subkey)); } } Tcl_DStringFree(&subkey); @@ -1186,6 +1193,7 @@ SetValue( char *valueName; Tcl_Obj *resultPtr; Tcl_DString nameBuf; + CONST TCHAR *native; if (typeObj == NULL) { type = REG_SZ; @@ -1201,7 +1209,7 @@ SetValue( } valueName = Tcl_GetStringFromObj(valueNameObj, &length); - valueName = Tcl_WinUtfToTChar(valueName, length, &nameBuf); + native = Tcl_WinUtfToTChar(valueName, length, &nameBuf); resultPtr = Tcl_GetObjResult(interp); if (type == REG_DWORD || type == REG_DWORD_BIG_ENDIAN) { @@ -1213,7 +1221,7 @@ SetValue( } value = ConvertDWORD(type, value); - result = (*regWinProcs->regSetValueExProc)(key, valueName, 0, type, + result = (*regWinProcs->regSetValueExProc)(key, native, 0, type, (BYTE*) &value, sizeof(DWORD)); } else if (type == REG_MULTI_SZ) { Tcl_DString data, buf; @@ -1248,16 +1256,15 @@ SetValue( Tcl_WinUtfToTChar(Tcl_DStringValue(&data), Tcl_DStringLength(&data)+1, &buf); - result = (*regWinProcs->regSetValueExProc)(key, valueName, 0, type, + result = (*regWinProcs->regSetValueExProc)(key, native, 0, type, (BYTE *) Tcl_DStringValue(&buf), (DWORD) Tcl_DStringLength(&buf)); Tcl_DStringFree(&data); Tcl_DStringFree(&buf); } else if (type == REG_SZ || type == REG_EXPAND_SZ) { Tcl_DString buf; - char *data = Tcl_GetStringFromObj(dataObj, &length); - - data = Tcl_WinUtfToTChar(data, length, &buf); + CONST char *data = Tcl_GetStringFromObj(dataObj, &length); + CONST TCHAR *native = Tcl_WinUtfToTChar(data, length, &buf); /* * Include the null in the length, padding if needed for Unicode. @@ -1268,8 +1275,8 @@ SetValue( } length = Tcl_DStringLength(&buf) + 1; - result = (*regWinProcs->regSetValueExProc)(key, valueName, 0, type, - (BYTE*)data, (DWORD) length); + result = (*regWinProcs->regSetValueExProc)(key, native, 0, type, + (BYTE*)native, (DWORD) length); Tcl_DStringFree(&buf); } else { char *data; @@ -1279,7 +1286,7 @@ SetValue( */ data = Tcl_GetByteArrayFromObj(dataObj, &length); - result = (*regWinProcs->regSetValueExProc)(key, valueName, 0, type, + result = (*regWinProcs->regSetValueExProc)(key, native, 0, type, (BYTE *)data, (DWORD) length); } Tcl_DStringFree(&nameBuf); diff --git a/win/tclWinSerial.c b/win/tclWinSerial.c index 4fa856a..6a60700 100644 --- a/win/tclWinSerial.c +++ b/win/tclWinSerial.c @@ -11,7 +11,7 @@ * * Serial functionality implemented by Rolf.Schroedter@dlr.de * - * RCS: @(#) $Id: tclWinSerial.c,v 1.19 2002/01/24 01:34:16 dgp Exp $ + * RCS: @(#) $Id: tclWinSerial.c,v 1.20 2002/01/25 21:36:10 dgp Exp $ */ #include "tclWinInt.h" @@ -1531,7 +1531,7 @@ SerialSetOptionProc(instanceData, interp, optionName, value) BOOL result, flag; size_t len, vlen; Tcl_DString ds; - TCHAR *native; + CONST TCHAR *native; int argc; char **argv; -- cgit v0.12