diff options
author | dgp <dgp@noemail.net> | 2002-03-20 22:47:35 (GMT) |
---|---|---|
committer | dgp <dgp@noemail.net> | 2002-03-20 22:47:35 (GMT) |
commit | ba9f95d5492347d48f0585b5a7d711347e973bf3 (patch) | |
tree | 8f368f02d83a51268df54df95963ddc703bfa767 | |
parent | 431752470573c699cd64c8174c40c89614896d4d (diff) | |
download | tcl-ba9f95d5492347d48f0585b5a7d711347e973bf3.zip tcl-ba9f95d5492347d48f0585b5a7d711347e973bf3.tar.gz tcl-ba9f95d5492347d48f0585b5a7d711347e973bf3.tar.bz2 |
* Updated interfaces of generic/tclVar.c according
to TIP 27. In particular, the "part2" arguments were CONSTified.
FossilOrigin-Name: b64c27e52d63f10977aa98296f7f47941929cfff
-rw-r--r-- | ChangeLog | 23 | ||||
-rw-r--r-- | doc/SetVar.3 | 4 | ||||
-rw-r--r-- | doc/TraceVar.3 | 4 | ||||
-rw-r--r-- | doc/UpVar.3 | 4 | ||||
-rw-r--r-- | generic/tcl.decls | 21 | ||||
-rw-r--r-- | generic/tcl.h | 4 | ||||
-rw-r--r-- | generic/tclCmdMZ.c | 6 | ||||
-rw-r--r-- | generic/tclDecls.h | 38 | ||||
-rw-r--r-- | generic/tclEnv.c | 6 | ||||
-rw-r--r-- | generic/tclEvent.c | 6 | ||||
-rw-r--r-- | generic/tclInt.decls | 6 | ||||
-rw-r--r-- | generic/tclIntDecls.h | 10 | ||||
-rw-r--r-- | generic/tclLink.c | 6 | ||||
-rw-r--r-- | generic/tclUtil.c | 4 | ||||
-rw-r--r-- | generic/tclVar.c | 46 |
15 files changed, 108 insertions, 80 deletions
@@ -1,3 +1,26 @@ +2002-03-20 Don Porter <dgp@users.sourceforge.net> + + * doc/SetVar.3: + * doc/TraceVar.3: + * doc/UpVar.3: + * generic/tcl.h (Tcl_VarTraceProc): + * generic/tcl.decls (Tcl_GetVar2, Tcl_SetVar2, Tcl_TraceVar2, + Tcl_UnsetVar2, Tcl_UntraceVar2, Tcl_UpVar2, Tcl_VarTraceInfo2, + Tcl_GetVar2Ex, TclSetVar2Ex): + * generic/tclCmdMZ.c (TraceVarProc): + * generic/tclEnv.c (EnvTraceProc): + * generic/tclEvent.c (VwaitVarProc): + * generic/tclInt.decls (TclLookupVar,TclPrecTraceProc): + * generic/tclLink.c (LinkTraceProc): + * generic/tclUtil.c (TclPrecTraceProc): + * generic/tclVar.c (CallTraces, MakeUpvar, VarErrMsg, TclLookupVar, + Tcl_GetVar2, Tcl_SetVar2, Tcl_TraceVar2, Tcl_UnsetVar2, + Tcl_UntraceVar2, Tcl_UpVar2, Tcl_VarTraceInfo2, Tcl_GetVar2Ex, + TclSetVar2Ex): Updated interfaces of generic/tclVar.c according + to TIP 27. In particular, the "part2" arguments were CONSTified. + * generic/tclDecls.h: + * generic/tclIntDecls.h: make genstubs + 2002-03-15 Donal K. Fellows <fellowsd@cs.man.ac.uk> * tests/compile.test (compile-12.3): Test to detect bug 530320. diff --git a/doc/SetVar.3 b/doc/SetVar.3 index 6f610c1..72b373f 100644 --- a/doc/SetVar.3 +++ b/doc/SetVar.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: SetVar.3,v 1.4 2002/01/25 20:40:55 dgp Exp $ +'\" RCS: @(#) $Id: SetVar.3,v 1.5 2002/03/20 22:47:36 dgp Exp $ '\" .so man.macros .TH Tcl_SetVar 3 8.1 Tcl "Tcl Library Procedures" @@ -59,7 +59,7 @@ or (if \fIname2\fR is NULL) either the name of a scalar variable or a complete name including both variable name and index. May include \fB::\fR namespace qualifiers to specify a variable in a particular namespace. -.AP char *name2 in +.AP CONST char *name2 in If non-NULL, gives name of element within array; in this case \fIname1\fR must refer to an array variable. .AP Tcl_Obj *newValuePtr in diff --git a/doc/TraceVar.3 b/doc/TraceVar.3 index b8c5efb..ffd0f52 100644 --- a/doc/TraceVar.3 +++ b/doc/TraceVar.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: TraceVar.3,v 1.5 2001/11/19 14:35:54 dkf Exp $ +'\" RCS: @(#) $Id: TraceVar.3,v 1.6 2002/03/20 22:47:36 dgp Exp $ '\" .so man.macros .TH Tcl_TraceVar 3 7.4 Tcl "Tcl Library Procedures" @@ -54,7 +54,7 @@ Procedure to invoke whenever one of the traced operations occurs. Arbitrary one-word value to pass to \fIproc\fR. .AP char *name1 in Name of scalar or array variable (without array index). -.AP char *name2 in +.AP CONST char *name2 in For a trace on an element of an array, gives the index of the element. For traces on scalar variables or on whole arrays, is NULL. diff --git a/doc/UpVar.3 b/doc/UpVar.3 index 7eaf0d1..c8df47b 100644 --- a/doc/UpVar.3 +++ b/doc/UpVar.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: UpVar.3,v 1.4 2001/09/27 20:32:35 dgp Exp $ +'\" RCS: @(#) $Id: UpVar.3,v 1.5 2002/03/20 22:47:36 dgp Exp $ '\" .so man.macros .TH Tcl_UpVar 3 7.4 Tcl "Tcl Library Procedures" @@ -45,7 +45,7 @@ a global variable; otherwise it is a local to the current procedure .AP char *name1 in First part of source variable's name (scalar name, or name of array without array index). -.AP char *name2 in +.AP CONST char *name2 in If source variable is an element of an array, gives the index of the element. For scalar source variables, is NULL. .BE diff --git a/generic/tcl.decls b/generic/tcl.decls index 120f888..75e787e 100644 --- a/generic/tcl.decls +++ b/generic/tcl.decls @@ -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: tcl.decls,v 1.85 2002/02/28 05:11:25 dgp Exp $ +# RCS: @(#) $Id: tcl.decls,v 1.86 2002/03/20 22:47:36 dgp Exp $ library tcl @@ -628,7 +628,7 @@ declare 175 generic { CONST char * Tcl_GetVar(Tcl_Interp *interp, char *varName, int flags) } declare 176 generic { - CONST char * Tcl_GetVar2(Tcl_Interp *interp, char *part1, char *part2, + CONST char * Tcl_GetVar2(Tcl_Interp *interp, char *part1, CONST char *part2, int flags) } declare 177 generic { @@ -838,7 +838,7 @@ declare 237 generic { CONST char *newValue, int flags) } declare 238 generic { - CONST char * Tcl_SetVar2(Tcl_Interp *interp, char *part1, char *part2, + CONST char * Tcl_SetVar2(Tcl_Interp *interp, char *part1, CONST char *part2, CONST char *newValue, int flags) } declare 239 generic { @@ -874,7 +874,7 @@ declare 247 generic { Tcl_VarTraceProc *proc, ClientData clientData) } declare 248 generic { - int Tcl_TraceVar2(Tcl_Interp *interp, char *part1, char *part2, + int Tcl_TraceVar2(Tcl_Interp *interp, char *part1, CONST char *part2, int flags, Tcl_VarTraceProc *proc, ClientData clientData) } declare 249 generic { @@ -894,14 +894,15 @@ declare 253 generic { int Tcl_UnsetVar(Tcl_Interp *interp, char *varName, int flags) } declare 254 generic { - int Tcl_UnsetVar2(Tcl_Interp *interp, char *part1, char *part2, int flags) + int Tcl_UnsetVar2(Tcl_Interp *interp, char *part1, CONST char *part2, + int flags) } declare 255 generic { void Tcl_UntraceVar(Tcl_Interp *interp, char *varName, int flags, Tcl_VarTraceProc *proc, ClientData clientData) } declare 256 generic { - void Tcl_UntraceVar2(Tcl_Interp *interp, char *part1, char *part2, + void Tcl_UntraceVar2(Tcl_Interp *interp, char *part1, CONST char *part2, int flags, Tcl_VarTraceProc *proc, ClientData clientData) } declare 257 generic { @@ -913,7 +914,7 @@ declare 258 generic { } declare 259 generic { int Tcl_UpVar2(Tcl_Interp *interp, CONST char *frameName, char *part1, - char *part2, CONST char *localName, int flags) + CONST char *part2, CONST char *localName, int flags) } declare 260 generic { int Tcl_VarEval(Tcl_Interp *interp, ...) @@ -924,7 +925,7 @@ declare 261 generic { } declare 262 generic { ClientData Tcl_VarTraceInfo2(Tcl_Interp *interp, char *part1, - char *part2, int flags, Tcl_VarTraceProc *procPtr, + CONST char *part2, int flags, Tcl_VarTraceProc *procPtr, ClientData prevClientData) } declare 263 generic { @@ -1093,7 +1094,7 @@ declare 305 generic { VOID * Tcl_GetThreadData(Tcl_ThreadDataKey *keyPtr, int size) } declare 306 generic { - Tcl_Obj * Tcl_GetVar2Ex(Tcl_Interp *interp, char *part1, char *part2, + Tcl_Obj * Tcl_GetVar2Ex(Tcl_Interp *interp, char *part1, CONST char *part2, int flags) } declare 307 generic { @@ -1129,7 +1130,7 @@ declare 316 generic { int Tcl_SetSystemEncoding(Tcl_Interp *interp, CONST char *name) } declare 317 generic { - Tcl_Obj * Tcl_SetVar2Ex(Tcl_Interp *interp, char *part1, char *part2, + Tcl_Obj * Tcl_SetVar2Ex(Tcl_Interp *interp, char *part1, CONST char *part2, Tcl_Obj *newValuePtr, int flags) } declare 318 generic { diff --git a/generic/tcl.h b/generic/tcl.h index a1a8dec..d5f4bd3 100644 --- a/generic/tcl.h +++ b/generic/tcl.h @@ -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: tcl.h,v 1.120 2002/03/06 15:20:23 dkf Exp $ + * RCS: @(#) $Id: tcl.h,v 1.121 2002/03/20 22:47:36 dgp Exp $ */ #ifndef _TCL @@ -710,7 +710,7 @@ typedef int (Tcl_SetFromAnyProc) _ANSI_ARGS_((Tcl_Interp *interp, struct Tcl_Obj *objPtr)); typedef void (Tcl_UpdateStringProc) _ANSI_ARGS_((struct Tcl_Obj *objPtr)); typedef char *(Tcl_VarTraceProc) _ANSI_ARGS_((ClientData clientData, - Tcl_Interp *interp, char *part1, char *part2, int flags)); + Tcl_Interp *interp, char *part1, CONST84 char *part2, int flags)); typedef void (Tcl_CommandTraceProc) _ANSI_ARGS_((ClientData clientData, Tcl_Interp *interp, CONST char *oldName, CONST char *newName, int flags)); diff --git a/generic/tclCmdMZ.c b/generic/tclCmdMZ.c index ef96e0c..017b407 100644 --- a/generic/tclCmdMZ.c +++ b/generic/tclCmdMZ.c @@ -14,7 +14,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclCmdMZ.c,v 1.63 2002/03/01 06:23:08 hobbs Exp $ + * RCS: @(#) $Id: tclCmdMZ.c,v 1.64 2002/03/20 22:47:36 dgp Exp $ */ #include "tclInt.h" @@ -68,7 +68,7 @@ static Tcl_TraceTypeObjCmd* traceSubCmds[] = { }; static char * TraceVarProc _ANSI_ARGS_((ClientData clientData, - Tcl_Interp *interp, char *name1, char *name2, + Tcl_Interp *interp, char *name1, CONST char *name2, int flags)); static void TraceCommandProc _ANSI_ARGS_((ClientData clientData, Tcl_Interp *interp, CONST char *oldName, @@ -3722,7 +3722,7 @@ TraceVarProc(clientData, interp, name1, name2, flags) ClientData clientData; /* Information about the variable trace. */ Tcl_Interp *interp; /* Interpreter containing variable. */ char *name1; /* Name of variable or array. */ - char *name2; /* Name of element within array; NULL means + CONST char *name2; /* Name of element within array; NULL means * scalar variable is being referenced. */ int flags; /* OR-ed bits giving operation and other * information. */ diff --git a/generic/tclDecls.h b/generic/tclDecls.h index e3f46ba..392a2e7 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.85 2002/02/28 05:11:25 dgp Exp $ + * RCS: @(#) $Id: tclDecls.h,v 1.86 2002/03/20 22:47:36 dgp Exp $ */ #ifndef _TCLDECLS @@ -574,7 +574,7 @@ EXTERN CONST char * Tcl_GetVar _ANSI_ARGS_((Tcl_Interp * interp, char * varName, int flags)); /* 176 */ EXTERN CONST char * Tcl_GetVar2 _ANSI_ARGS_((Tcl_Interp * interp, - char * part1, char * part2, int flags)); + char * part1, CONST char * part2, int flags)); /* 177 */ EXTERN int Tcl_GlobalEval _ANSI_ARGS_((Tcl_Interp * interp, char * command)); @@ -772,7 +772,7 @@ EXTERN CONST char * Tcl_SetVar _ANSI_ARGS_((Tcl_Interp * interp, int flags)); /* 238 */ EXTERN CONST char * Tcl_SetVar2 _ANSI_ARGS_((Tcl_Interp * interp, - char * part1, char * part2, + char * part1, CONST char * part2, CONST char * newValue, int flags)); /* 239 */ EXTERN CONST char * Tcl_SignalId _ANSI_ARGS_((int sig)); @@ -804,7 +804,7 @@ EXTERN int Tcl_TraceVar _ANSI_ARGS_((Tcl_Interp * interp, ClientData clientData)); /* 248 */ EXTERN int Tcl_TraceVar2 _ANSI_ARGS_((Tcl_Interp * interp, - char * part1, char * part2, int flags, + char * part1, CONST char * part2, int flags, Tcl_VarTraceProc * proc, ClientData clientData)); /* 249 */ @@ -825,7 +825,7 @@ EXTERN int Tcl_UnsetVar _ANSI_ARGS_((Tcl_Interp * interp, char * varName, int flags)); /* 254 */ EXTERN int Tcl_UnsetVar2 _ANSI_ARGS_((Tcl_Interp * interp, - char * part1, char * part2, int flags)); + char * part1, CONST char * part2, int flags)); /* 255 */ EXTERN void Tcl_UntraceVar _ANSI_ARGS_((Tcl_Interp * interp, char * varName, int flags, @@ -833,7 +833,7 @@ EXTERN void Tcl_UntraceVar _ANSI_ARGS_((Tcl_Interp * interp, ClientData clientData)); /* 256 */ EXTERN void Tcl_UntraceVar2 _ANSI_ARGS_((Tcl_Interp * interp, - char * part1, char * part2, int flags, + char * part1, CONST char * part2, int flags, Tcl_VarTraceProc * proc, ClientData clientData)); /* 257 */ @@ -846,7 +846,7 @@ EXTERN int Tcl_UpVar _ANSI_ARGS_((Tcl_Interp * interp, /* 259 */ EXTERN int Tcl_UpVar2 _ANSI_ARGS_((Tcl_Interp * interp, CONST char * frameName, char * part1, - char * part2, CONST char * localName, + CONST char * part2, CONST char * localName, int flags)); /* 260 */ EXTERN int Tcl_VarEval _ANSI_ARGS_(TCL_VARARGS(Tcl_Interp *,interp)); @@ -857,7 +857,7 @@ EXTERN ClientData Tcl_VarTraceInfo _ANSI_ARGS_((Tcl_Interp * interp, ClientData prevClientData)); /* 262 */ EXTERN ClientData Tcl_VarTraceInfo2 _ANSI_ARGS_((Tcl_Interp * interp, - char * part1, char * part2, int flags, + char * part1, CONST char * part2, int flags, Tcl_VarTraceProc * procPtr, ClientData prevClientData)); /* 263 */ @@ -994,7 +994,7 @@ EXTERN VOID * Tcl_GetThreadData _ANSI_ARGS_(( Tcl_ThreadDataKey * keyPtr, int size)); /* 306 */ EXTERN Tcl_Obj * Tcl_GetVar2Ex _ANSI_ARGS_((Tcl_Interp * interp, - char * part1, char * part2, int flags)); + char * part1, CONST char * part2, int flags)); /* 307 */ EXTERN ClientData Tcl_InitNotifier _ANSI_ARGS_((void)); /* 308 */ @@ -1026,7 +1026,7 @@ EXTERN int Tcl_SetSystemEncoding _ANSI_ARGS_(( Tcl_Interp * interp, CONST char * name)); /* 317 */ EXTERN Tcl_Obj * Tcl_SetVar2Ex _ANSI_ARGS_((Tcl_Interp * interp, - char * part1, char * part2, + char * part1, CONST char * part2, Tcl_Obj * newValuePtr, int flags)); /* 318 */ EXTERN void Tcl_ThreadAlert _ANSI_ARGS_((Tcl_ThreadId threadId)); @@ -1772,7 +1772,7 @@ typedef struct TclStubs { Tcl_Channel (*tcl_GetStdChannel) _ANSI_ARGS_((int type)); /* 173 */ CONST char * (*tcl_GetStringResult) _ANSI_ARGS_((Tcl_Interp * interp)); /* 174 */ CONST char * (*tcl_GetVar) _ANSI_ARGS_((Tcl_Interp * interp, char * varName, int flags)); /* 175 */ - CONST char * (*tcl_GetVar2) _ANSI_ARGS_((Tcl_Interp * interp, char * part1, char * part2, int flags)); /* 176 */ + CONST char * (*tcl_GetVar2) _ANSI_ARGS_((Tcl_Interp * interp, char * part1, CONST char * part2, int flags)); /* 176 */ int (*tcl_GlobalEval) _ANSI_ARGS_((Tcl_Interp * interp, char * command)); /* 177 */ int (*tcl_GlobalEvalObj) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Obj * objPtr)); /* 178 */ int (*tcl_HideCommand) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * cmdName, CONST char * hiddenCmdToken)); /* 179 */ @@ -1850,7 +1850,7 @@ typedef struct TclStubs { void (*tcl_SetObjResult) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Obj * resultObjPtr)); /* 235 */ void (*tcl_SetStdChannel) _ANSI_ARGS_((Tcl_Channel channel, int type)); /* 236 */ CONST char * (*tcl_SetVar) _ANSI_ARGS_((Tcl_Interp * interp, char * varName, CONST char * newValue, int flags)); /* 237 */ - CONST char * (*tcl_SetVar2) _ANSI_ARGS_((Tcl_Interp * interp, char * part1, char * part2, CONST char * newValue, int flags)); /* 238 */ + CONST char * (*tcl_SetVar2) _ANSI_ARGS_((Tcl_Interp * interp, char * part1, CONST char * part2, CONST char * newValue, int flags)); /* 238 */ CONST char * (*tcl_SignalId) _ANSI_ARGS_((int sig)); /* 239 */ CONST char * (*tcl_SignalMsg) _ANSI_ARGS_((int sig)); /* 240 */ void (*tcl_SourceRCFile) _ANSI_ARGS_((Tcl_Interp * interp)); /* 241 */ @@ -1860,21 +1860,21 @@ typedef struct TclStubs { int (*tcl_StringMatch) _ANSI_ARGS_((CONST char * str, CONST char * pattern)); /* 245 */ int (*tcl_TellOld) _ANSI_ARGS_((Tcl_Channel chan)); /* 246 */ int (*tcl_TraceVar) _ANSI_ARGS_((Tcl_Interp * interp, char * varName, int flags, Tcl_VarTraceProc * proc, ClientData clientData)); /* 247 */ - int (*tcl_TraceVar2) _ANSI_ARGS_((Tcl_Interp * interp, char * part1, char * part2, int flags, Tcl_VarTraceProc * proc, ClientData clientData)); /* 248 */ + int (*tcl_TraceVar2) _ANSI_ARGS_((Tcl_Interp * interp, char * part1, CONST char * part2, int flags, Tcl_VarTraceProc * proc, ClientData clientData)); /* 248 */ char * (*tcl_TranslateFileName) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * name, Tcl_DString * bufferPtr)); /* 249 */ int (*tcl_Ungets) _ANSI_ARGS_((Tcl_Channel chan, CONST char * str, int len, int atHead)); /* 250 */ void (*tcl_UnlinkVar) _ANSI_ARGS_((Tcl_Interp * interp, char * varName)); /* 251 */ int (*tcl_UnregisterChannel) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Channel chan)); /* 252 */ int (*tcl_UnsetVar) _ANSI_ARGS_((Tcl_Interp * interp, char * varName, int flags)); /* 253 */ - int (*tcl_UnsetVar2) _ANSI_ARGS_((Tcl_Interp * interp, char * part1, char * part2, int flags)); /* 254 */ + int (*tcl_UnsetVar2) _ANSI_ARGS_((Tcl_Interp * interp, char * part1, CONST char * part2, int flags)); /* 254 */ void (*tcl_UntraceVar) _ANSI_ARGS_((Tcl_Interp * interp, char * varName, int flags, Tcl_VarTraceProc * proc, ClientData clientData)); /* 255 */ - void (*tcl_UntraceVar2) _ANSI_ARGS_((Tcl_Interp * interp, char * part1, char * part2, int flags, Tcl_VarTraceProc * proc, ClientData clientData)); /* 256 */ + void (*tcl_UntraceVar2) _ANSI_ARGS_((Tcl_Interp * interp, char * part1, CONST char * part2, int flags, Tcl_VarTraceProc * proc, ClientData clientData)); /* 256 */ void (*tcl_UpdateLinkedVar) _ANSI_ARGS_((Tcl_Interp * interp, char * varName)); /* 257 */ int (*tcl_UpVar) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * frameName, char * varName, CONST char * localName, int flags)); /* 258 */ - int (*tcl_UpVar2) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * frameName, char * part1, char * part2, CONST char * localName, int flags)); /* 259 */ + int (*tcl_UpVar2) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * frameName, char * part1, CONST char * part2, CONST char * localName, int flags)); /* 259 */ int (*tcl_VarEval) _ANSI_ARGS_(TCL_VARARGS(Tcl_Interp *,interp)); /* 260 */ ClientData (*tcl_VarTraceInfo) _ANSI_ARGS_((Tcl_Interp * interp, char * varName, int flags, Tcl_VarTraceProc * procPtr, ClientData prevClientData)); /* 261 */ - ClientData (*tcl_VarTraceInfo2) _ANSI_ARGS_((Tcl_Interp * interp, char * part1, char * part2, int flags, Tcl_VarTraceProc * procPtr, ClientData prevClientData)); /* 262 */ + ClientData (*tcl_VarTraceInfo2) _ANSI_ARGS_((Tcl_Interp * interp, char * part1, CONST char * part2, int flags, Tcl_VarTraceProc * procPtr, ClientData prevClientData)); /* 262 */ int (*tcl_Write) _ANSI_ARGS_((Tcl_Channel chan, CONST char * s, int slen)); /* 263 */ void (*tcl_WrongNumArgs) _ANSI_ARGS_((Tcl_Interp * interp, int objc, Tcl_Obj *CONST objv[], CONST char * message)); /* 264 */ int (*tcl_DumpActiveMemory) _ANSI_ARGS_((CONST char * fileName)); /* 265 */ @@ -1918,7 +1918,7 @@ typedef struct TclStubs { void (*tcl_GetEncodingNames) _ANSI_ARGS_((Tcl_Interp * interp)); /* 303 */ int (*tcl_GetIndexFromObjStruct) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Obj * objPtr, CONST VOID * tablePtr, int offset, CONST char * msg, int flags, int * indexPtr)); /* 304 */ VOID * (*tcl_GetThreadData) _ANSI_ARGS_((Tcl_ThreadDataKey * keyPtr, int size)); /* 305 */ - Tcl_Obj * (*tcl_GetVar2Ex) _ANSI_ARGS_((Tcl_Interp * interp, char * part1, char * part2, int flags)); /* 306 */ + Tcl_Obj * (*tcl_GetVar2Ex) _ANSI_ARGS_((Tcl_Interp * interp, char * part1, CONST char * part2, int flags)); /* 306 */ ClientData (*tcl_InitNotifier) _ANSI_ARGS_((void)); /* 307 */ void (*tcl_MutexLock) _ANSI_ARGS_((Tcl_Mutex * mutexPtr)); /* 308 */ void (*tcl_MutexUnlock) _ANSI_ARGS_((Tcl_Mutex * mutexPtr)); /* 309 */ @@ -1929,7 +1929,7 @@ typedef struct TclStubs { void (*tcl_RestoreResult) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_SavedResult * statePtr)); /* 314 */ void (*tcl_SaveResult) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_SavedResult * statePtr)); /* 315 */ int (*tcl_SetSystemEncoding) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * name)); /* 316 */ - Tcl_Obj * (*tcl_SetVar2Ex) _ANSI_ARGS_((Tcl_Interp * interp, char * part1, char * part2, Tcl_Obj * newValuePtr, int flags)); /* 317 */ + Tcl_Obj * (*tcl_SetVar2Ex) _ANSI_ARGS_((Tcl_Interp * interp, char * part1, CONST char * part2, Tcl_Obj * newValuePtr, int flags)); /* 317 */ void (*tcl_ThreadAlert) _ANSI_ARGS_((Tcl_ThreadId threadId)); /* 318 */ void (*tcl_ThreadQueueEvent) _ANSI_ARGS_((Tcl_ThreadId threadId, Tcl_Event* evPtr, Tcl_QueuePosition position)); /* 319 */ Tcl_UniChar (*tcl_UniCharAtIndex) _ANSI_ARGS_((CONST char * src, int index)); /* 320 */ diff --git a/generic/tclEnv.c b/generic/tclEnv.c index c4f6ea2..86a1844 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.12 2002/02/08 02:52:54 dgp Exp $ + * RCS: @(#) $Id: tclEnv.c,v 1.13 2002/03/20 22:47:36 dgp Exp $ */ #include "tclInt.h" @@ -46,7 +46,7 @@ char **environ = NULL; */ static char * EnvTraceProc _ANSI_ARGS_((ClientData clientData, - Tcl_Interp *interp, char *name1, char *name2, + Tcl_Interp *interp, char *name1, CONST char *name2, int flags)); static void ReplaceString _ANSI_ARGS_((CONST char *oldStr, char *newStr)); @@ -506,7 +506,7 @@ EnvTraceProc(clientData, interp, name1, name2, flags) Tcl_Interp *interp; /* Interpreter whose "env" variable is * being modified. */ char *name1; /* Better be "env". */ - char *name2; /* Name of variable being modified, or NULL + CONST char *name2; /* Name of variable being modified, or NULL * if whole array is being deleted (UTF-8). */ int flags; /* Indicates what's happening. */ { diff --git a/generic/tclEvent.c b/generic/tclEvent.c index d85a550..4e24e72 100644 --- a/generic/tclEvent.c +++ b/generic/tclEvent.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: tclEvent.c,v 1.19 2002/01/25 20:40:55 dgp Exp $ + * RCS: @(#) $Id: tclEvent.c,v 1.20 2002/03/20 22:47:36 dgp Exp $ */ #include "tclInt.h" @@ -111,7 +111,7 @@ static void BgErrorDeleteProc _ANSI_ARGS_((ClientData clientData, Tcl_Interp *interp)); static void HandleBgErrors _ANSI_ARGS_((ClientData clientData)); static char * VwaitVarProc _ANSI_ARGS_((ClientData clientData, - Tcl_Interp *interp, char *name1, char *name2, + Tcl_Interp *interp, char *name1, CONST char *name2, int flags)); /* @@ -1014,7 +1014,7 @@ VwaitVarProc(clientData, interp, name1, name2, flags) ClientData clientData; /* Pointer to integer to set to 1. */ Tcl_Interp *interp; /* Interpreter containing variable. */ char *name1; /* Name of variable. */ - char *name2; /* Second part of variable name. */ + CONST char *name2; /* Second part of variable name. */ int flags; /* Information about what happened. */ { int *donePtr = (int *) clientData; diff --git a/generic/tclInt.decls b/generic/tclInt.decls index 912c596..ca33071 100644 --- a/generic/tclInt.decls +++ b/generic/tclInt.decls @@ -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: tclInt.decls,v 1.46 2002/02/15 14:28:49 dkf Exp $ +# RCS: @(#) $Id: tclInt.decls,v 1.47 2002/03/20 22:47:36 dgp Exp $ library tcl @@ -236,7 +236,7 @@ declare 55 generic { # int TclLooksLikeInt(char *p) # } declare 58 generic { - Var * TclLookupVar(Tcl_Interp *interp, char *part1, char *part2, + Var * TclLookupVar(Tcl_Interp *interp, char *part1, CONST char *part2, int flags, char *msg, int createPart1, int createPart2, Var **arrayPtrPtr) } @@ -347,7 +347,7 @@ declare 81 generic { # } declare 88 generic { char * TclPrecTraceProc(ClientData clientData, Tcl_Interp *interp, - char *name1, char *name2, int flags) + char *name1, CONST char *name2, int flags) } declare 89 generic { int TclPreventAliasLoop(Tcl_Interp *interp, Tcl_Interp *cmdInterp, diff --git a/generic/tclIntDecls.h b/generic/tclIntDecls.h index 3c7359c..dd2bd0f 100644 --- a/generic/tclIntDecls.h +++ b/generic/tclIntDecls.h @@ -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: tclIntDecls.h,v 1.38 2002/02/15 14:28:49 dkf Exp $ + * RCS: @(#) $Id: tclIntDecls.h,v 1.39 2002/03/20 22:47:36 dgp Exp $ */ #ifndef _TCLINTDECLS @@ -209,7 +209,7 @@ EXTERN Proc * TclIsProc _ANSI_ARGS_((Command * cmdPtr)); /* Slot 57 is reserved */ /* 58 */ EXTERN Var * TclLookupVar _ANSI_ARGS_((Tcl_Interp * interp, - char * part1, char * part2, int flags, + char * part1, CONST char * part2, int flags, char * msg, int createPart1, int createPart2, Var ** arrayPtrPtr)); /* Slot 59 is reserved */ @@ -267,7 +267,7 @@ EXTERN char * TclpRealloc _ANSI_ARGS_((char * ptr, /* 88 */ EXTERN char * TclPrecTraceProc _ANSI_ARGS_((ClientData clientData, Tcl_Interp * interp, char * name1, - char * name2, int flags)); + CONST char * name2, int flags)); /* 89 */ EXTERN int TclPreventAliasLoop _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Interp * cmdInterp, Tcl_Command cmd)); @@ -581,7 +581,7 @@ typedef struct TclIntStubs { Proc * (*tclIsProc) _ANSI_ARGS_((Command * cmdPtr)); /* 55 */ void *reserved56; void *reserved57; - Var * (*tclLookupVar) _ANSI_ARGS_((Tcl_Interp * interp, char * part1, char * part2, int flags, char * msg, int createPart1, int createPart2, Var ** arrayPtrPtr)); /* 58 */ + Var * (*tclLookupVar) _ANSI_ARGS_((Tcl_Interp * interp, char * part1, CONST char * part2, int flags, char * msg, int createPart1, int createPart2, Var ** arrayPtrPtr)); /* 58 */ void *reserved59; int (*tclNeedSpace) _ANSI_ARGS_((CONST char * start, CONST char * end)); /* 60 */ Tcl_Obj * (*tclNewProcBodyObj) _ANSI_ARGS_((Proc * procPtr)); /* 61 */ @@ -611,7 +611,7 @@ typedef struct TclIntStubs { void *reserved85; void *reserved86; void *reserved87; - char * (*tclPrecTraceProc) _ANSI_ARGS_((ClientData clientData, Tcl_Interp * interp, char * name1, char * name2, int flags)); /* 88 */ + char * (*tclPrecTraceProc) _ANSI_ARGS_((ClientData clientData, Tcl_Interp * interp, char * name1, CONST char * name2, int flags)); /* 88 */ int (*tclPreventAliasLoop) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Interp * cmdInterp, Tcl_Command cmd)); /* 89 */ void *reserved90; void (*tclProcCleanupProc) _ANSI_ARGS_((Proc * procPtr)); /* 91 */ diff --git a/generic/tclLink.c b/generic/tclLink.c index 60a86f1..b81554e 100644 --- a/generic/tclLink.c +++ b/generic/tclLink.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: tclLink.c,v 1.6 2002/02/28 00:38:26 hobbs Exp $ + * RCS: @(#) $Id: tclLink.c,v 1.7 2002/03/20 22:47:36 dgp Exp $ */ #include "tclInt.h" @@ -60,7 +60,7 @@ typedef struct Link { */ static char * LinkTraceProc _ANSI_ARGS_((ClientData clientData, - Tcl_Interp *interp, char *name1, char *name2, + Tcl_Interp *interp, char *name1, CONST char *name2, int flags)); static Tcl_Obj * ObjValue _ANSI_ARGS_((Link *linkPtr)); @@ -230,7 +230,7 @@ LinkTraceProc(clientData, interp, name1, name2, flags) ClientData clientData; /* Contains information about the link. */ Tcl_Interp *interp; /* Interpreter containing Tcl variable. */ char *name1; /* First part of variable name. */ - char *name2; /* Second part of variable name. */ + CONST char *name2; /* Second part of variable name. */ int flags; /* Miscellaneous additional information. */ { Link *linkPtr = (Link *) clientData; diff --git a/generic/tclUtil.c b/generic/tclUtil.c index c65fdd5..d855381 100644 --- a/generic/tclUtil.c +++ b/generic/tclUtil.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: tclUtil.c,v 1.29 2002/02/08 02:52:54 dgp Exp $ + * RCS: @(#) $Id: tclUtil.c,v 1.30 2002/03/20 22:47:36 dgp Exp $ */ #include "tclInt.h" @@ -1879,7 +1879,7 @@ TclPrecTraceProc(clientData, interp, name1, name2, flags) ClientData clientData; /* Not used. */ Tcl_Interp *interp; /* Interpreter containing variable. */ char *name1; /* Name of variable. */ - char *name2; /* Second part of variable name. */ + CONST char *name2; /* Second part of variable name. */ int flags; /* Information about what happened. */ { CONST char *value; diff --git a/generic/tclVar.c b/generic/tclVar.c index 7a8741a..93ed8ef 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.49 2002/02/27 06:38:39 hobbs Exp $ + * RCS: @(#) $Id: tclVar.c,v 1.50 2002/03/20 22:47:36 dgp Exp $ */ #include "tclInt.h" @@ -41,7 +41,7 @@ static char *isArrayElement = "name refers to an element in an array"; */ static char * CallTraces _ANSI_ARGS_((Interp *iPtr, Var *arrayPtr, - Var *varPtr, char *part1, char *part2, + Var *varPtr, char *part1, CONST char *part2, int flags, int *resultTypePtr)); static void CleanupVar _ANSI_ARGS_((Var *varPtr, Var *arrayPtr)); @@ -50,13 +50,13 @@ static void DeleteArray _ANSI_ARGS_((Interp *iPtr, char *arrayName, Var *varPtr, int flags)); static int MakeUpvar _ANSI_ARGS_(( Interp *iPtr, CallFrame *framePtr, - char *otherP1, char *otherP2, int otherFlags, + char *otherP1, CONST char *otherP2, int otherFlags, CONST char *myName, int myFlags)); static Var * NewVar _ANSI_ARGS_((void)); static ArraySearch * ParseSearchId _ANSI_ARGS_((Tcl_Interp *interp, Var *varPtr, char *varName, Tcl_Obj *handleObj)); static void VarErrMsg _ANSI_ARGS_((Tcl_Interp *interp, - char *part1, char *part2, char *operation, + char *part1, CONST char *part2, char *operation, char *reason)); static int SetArraySearchObj _ANSI_ARGS_((Tcl_Interp *interp, Tcl_Obj *objPtr)); @@ -122,7 +122,7 @@ TclLookupVar(interp, part1, part2, flags, msg, createPart1, createPart2, * an array. Otherwise, this * is a full variable name that could * include a parenthesized array element. */ - char *part2; /* Name of element within array, or NULL. */ + CONST char *part2; /* Name of element within array, or NULL. */ int flags; /* Only TCL_GLOBAL_ONLY, TCL_NAMESPACE_ONLY, * and TCL_LEAVE_ERR_MSG bits matter. */ char *msg; /* Verb to use in error messages, e.g. @@ -150,7 +150,7 @@ TclLookupVar(interp, part1, part2, flags, msg, createPart1, createPart2, Tcl_Var var; /* Used to search for global names. */ Var *varPtr; /* Points to the Var structure returned for * the variable. */ - char *elName; /* Name of array element or NULL; may be + CONST char *elName; /* Name of array element or NULL; may be * same as part2, or may be openParen+1. */ char *openParen, *closeParen; /* If this procedure parses a name into @@ -515,7 +515,7 @@ Tcl_GetVar2(interp, part1, part2, flags) * to be looked up. */ char *part1; /* Name of an array (if part2 is non-NULL) * or the name of a variable. */ - char *part2; /* If non-NULL, gives the name of an element + CONST char *part2; /* If non-NULL, gives the name of an element * in the array part1. */ int flags; /* OR-ed combination of TCL_GLOBAL_ONLY, * TCL_NAMESPACE_ONLY and TCL_LEAVE_ERR_MSG @@ -606,7 +606,7 @@ Tcl_GetVar2Ex(interp, part1, part2, flags) * to be looked up. */ char *part1; /* Name of an array (if part2 is non-NULL) * or the name of a variable. */ - char *part2; /* If non-NULL, gives the name of an element + CONST char *part2; /* If non-NULL, gives the name of an element * in the array part1. */ int flags; /* OR-ed combination of TCL_GLOBAL_ONLY, * and TCL_LEAVE_ERR_MSG bits. */ @@ -1111,7 +1111,7 @@ Tcl_SetVar2(interp, part1, part2, newValue, flags) char *part1; /* If part2 is NULL, this is name of scalar * variable. Otherwise it is the name of * an array. */ - char *part2; /* Name of an element within an array, or + CONST char *part2; /* Name of an element within an array, or * NULL. */ CONST char *newValue; /* New value for variable. */ int flags; /* Various flags that tell how to set value: @@ -1236,7 +1236,7 @@ Tcl_SetVar2Ex(interp, part1, part2, newValuePtr, flags) * to be found. */ char *part1; /* Name of an array (if part2 is non-NULL) * or the name of a variable. */ - char *part2; /* If non-NULL, gives the name of an element + CONST char *part2; /* If non-NULL, gives the name of an element * in the array part1. */ Tcl_Obj *newValuePtr; /* New value for variable. */ int flags; /* Various flags that tell how to set value: @@ -2360,7 +2360,7 @@ Tcl_UnsetVar2(interp, part1, part2, flags) Tcl_Interp *interp; /* Command interpreter in which varName is * to be looked up. */ char *part1; /* Name of variable or array. */ - char *part2; /* Name of element within array or NULL. */ + CONST char *part2; /* Name of element within array or NULL. */ int flags; /* OR-ed combination of any of * TCL_GLOBAL_ONLY, TCL_NAMESPACE_ONLY, * TCL_LEAVE_ERR_MSG. */ @@ -2574,7 +2574,7 @@ Tcl_TraceVar2(interp, part1, part2, flags, proc, clientData) Tcl_Interp *interp; /* Interpreter in which variable is * to be traced. */ char *part1; /* Name of scalar variable or array. */ - char *part2; /* Name of element within array; NULL means + CONST char *part2; /* Name of element within array; NULL means * trace applies to scalar variable or array * as-a-whole. */ int flags; /* OR-ed collection of bits, including any @@ -2686,7 +2686,7 @@ void Tcl_UntraceVar2(interp, part1, part2, flags, proc, clientData) Tcl_Interp *interp; /* Interpreter containing variable. */ char *part1; /* Name of variable or array. */ - char *part2; /* Name of element within array; NULL means + CONST char *part2; /* Name of element within array; NULL means * trace applies to scalar variable or array * as-a-whole. */ int flags; /* OR-ed collection of bits describing @@ -2832,7 +2832,7 @@ ClientData Tcl_VarTraceInfo2(interp, part1, part2, flags, proc, prevClientData) Tcl_Interp *interp; /* Interpreter containing variable. */ char *part1; /* Name of variable or array. */ - char *part2; /* Name of element within array; NULL means + CONST char *part2; /* Name of element within array; NULL means * trace applies to scalar variable or array * as-a-whole. */ int flags; /* OR-ed combination of TCL_GLOBAL_ONLY, @@ -3848,7 +3848,8 @@ MakeUpvar(iPtr, framePtr, otherP1, otherP2, otherFlags, myName, myFlags) * for error messages, too. */ CallFrame *framePtr; /* Call frame containing "other" variable. * NULL means use global :: context. */ - char *otherP1, *otherP2; /* Two-part name of variable in framePtr. */ + char *otherP1; + CONST char *otherP2; /* Two-part name of variable in framePtr. */ int otherFlags; /* 0, TCL_GLOBAL_ONLY or TCL_NAMESPACE_ONLY: * indicates scope of "other" variable. */ CONST char *myName; /* Name of variable which will refer to @@ -4121,7 +4122,8 @@ Tcl_UpVar2(interp, frameName, part1, part2, localName, flags) * for error messages too. */ CONST char *frameName; /* Name of the frame containing the source * variable, such as "1" or "#0". */ - char *part1, *part2; /* Two parts of source variable name to + char *part1; + CONST char *part2; /* Two parts of source variable name to * link to. */ CONST char *localName; /* Name of link variable. */ int flags; /* 0, TCL_GLOBAL_ONLY or TCL_NAMESPACE_ONLY: @@ -4547,7 +4549,8 @@ CallTraces(iPtr, arrayPtr, varPtr, part1, part2, flags, resultTypePtr) * isn't an element of an array. */ Var *varPtr; /* Variable whose traces are to be * invoked. */ - char *part1, *part2; /* Variable's two-part name. */ + char *part1; + CONST char *part2; /* Variable's two-part name. */ int flags; /* Flags passed to trace procedures: * indicates what's happening to variable, * plus other stuff like TCL_GLOBAL_ONLY, @@ -4595,12 +4598,12 @@ CallTraces(iPtr, arrayPtr, varPtr, part1, part2, flags, resultTypePtr) } while (*p != '\0'); p--; if (*p == ')') { + int offset = (openParen - part1); Tcl_DStringInit(&nameCopy); Tcl_DStringAppend(&nameCopy, part1, (p-part1)); - part2 = Tcl_DStringValue(&nameCopy) - + (openParen + 1 - part1); - part2[-1] = 0; + part2 = Tcl_DStringValue(&nameCopy) + offset + 1; part1 = Tcl_DStringValue(&nameCopy); + part1[offset] = 0; copiedName = 1; } break; @@ -5344,7 +5347,8 @@ CleanupVar(varPtr, arrayPtr) static void VarErrMsg(interp, part1, part2, operation, reason) Tcl_Interp *interp; /* Interpreter in which to record message. */ - char *part1, *part2; /* Variable's two-part name. */ + char *part1; + CONST char *part2; /* Variable's two-part name. */ char *operation; /* String describing operation that failed, * e.g. "read", "set", or "unset". */ char *reason; /* String describing why operation failed. */ |