summaryrefslogtreecommitdiffstats
path: root/generic/tclBasic.c
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2002-08-05 03:24:39 (GMT)
committerdgp <dgp@users.sourceforge.net>2002-08-05 03:24:39 (GMT)
commitb3debf8fa6252ac20fea32f74530a37a1b013ba3 (patch)
tree55bc26f8f6a88258d08fd90ff9a8943937349574 /generic/tclBasic.c
parenta96927be11c81e5e49d42cb7d0574729840d8f17 (diff)
downloadtcl-b3debf8fa6252ac20fea32f74530a37a1b013ba3.zip
tcl-b3debf8fa6252ac20fea32f74530a37a1b013ba3.tar.gz
tcl-b3debf8fa6252ac20fea32f74530a37a1b013ba3.tar.bz2
* doc/CmdCmplt.3: Applied Patch 585105 to fully CONST-ify
* doc/Concat.3: all remaining public interfaces of Tcl. * doc/CrtCommand.3: Notably, the parser no longer writes on * doc/CrtSlave.3: the string it is parsing, so it is no * doc/CrtTrace.3: longer necessary for Tcl_Eval() to be * doc/Eval.3: given a writable string. Also, the * doc/ExprLong.3: refactoring of the Tcl_*Var* routines * doc/LinkVar.3: by Miguel Sofer is included, so that the * doc/ParseCmd.3: "part1" argument for them no longer needs * doc/SetVar.3: to be writable either. * doc/TraceVar.3: * doc/UpVar.3: Compatibility support has been enhanced so * generic/tcl.decls that a #define of USE_NON_CONST will remove * generic/tcl.h all possible source incompatibilities with * generic/tclBasic.c the 8.3 version of the header file(s). * generic/tclCmdMZ.c The new #define of USE_COMPAT_CONST now does * generic/tclCompCmds.c what USE_NON_CONST used to do -- disable * generic/tclCompExpr.c only those new CONST's that introduce * generic/tclCompile.c irreconcilable incompatibilities. * generic/tclCompile.h * generic/tclDecls.h Several bugs are also fixed by this patch. * generic/tclEnv.c [Bugs 584051,580433] [Patches 585105,582429] * generic/tclEvent.c * generic/tclInt.decls * generic/tclInt.h * generic/tclIntDecls.h * generic/tclInterp.c * generic/tclLink.c * generic/tclObj.c * generic/tclParse.c * generic/tclParseExpr.c * generic/tclProc.c * generic/tclTest.c * generic/tclUtf.c * generic/tclUtil.c * generic/tclVar.c * mac/tclMacTest.c * tests/expr-old.test * tests/parseExpr.test * unix/tclUnixTest.c * unix/tclXtTest.c * win/tclWinTest.c
Diffstat (limited to 'generic/tclBasic.c')
-rw-r--r--generic/tclBasic.c36
1 files changed, 17 insertions, 19 deletions
diff --git a/generic/tclBasic.c b/generic/tclBasic.c
index e927654..b1da3ad 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.67 2002/07/29 15:56:53 msofer Exp $
+ * RCS: @(#) $Id: tclBasic.c,v 1.68 2002/08/05 03:24:40 dgp Exp $
*/
#include "tclInt.h"
@@ -1753,8 +1753,8 @@ TclInvokeStringCommand(clientData, interp, objc, objv)
*/
#define NUM_ARGS 20
- char *(argStorage[NUM_ARGS]);
- char **argv = argStorage;
+ CONST char *(argStorage[NUM_ARGS]);
+ CONST char **argv = argStorage;
/*
* Create the string argument array "argv". Make sure argv is large
@@ -1763,7 +1763,7 @@ TclInvokeStringCommand(clientData, interp, objc, objv)
*/
if ((objc + 1) > NUM_ARGS) {
- argv = (char **) ckalloc((unsigned)(objc + 1) * sizeof(char *));
+ argv = (CONST char **) ckalloc((unsigned)(objc + 1) * sizeof(char *));
}
for (i = 0; i < objc; i++) {
@@ -1814,7 +1814,7 @@ TclInvokeObjectCommand(clientData, interp, argc, argv)
ClientData clientData; /* Points to command's Command structure. */
Tcl_Interp *interp; /* Current interpreter. */
int argc; /* Number of arguments. */
- register char **argv; /* Argument strings. */
+ register CONST char **argv; /* Argument strings. */
{
Command *cmdPtr = (Command *) clientData;
register Tcl_Obj *objPtr;
@@ -2914,7 +2914,7 @@ TclEvalObjvInternal(interp, objc, objv, command, length, flags)
int objc; /* Number of words in command. */
Tcl_Obj *CONST objv[]; /* An array of pointers to objects that are
* the words that make up the command. */
- char *command; /* Points to the beginning of the string
+ CONST char *command; /* Points to the beginning of the string
* representation of the command; this
* is used for traces. If the string
* representation of the command is
@@ -3308,7 +3308,7 @@ Tcl_EvalTokensStandard(interp, tokenPtr, count)
#endif
char nameBuffer[MAX_VAR_CHARS+1];
char *varName, *index;
- char *p = NULL; /* Initialized to avoid compiler warning. */
+ CONST char *p = NULL; /* Initialized to avoid compiler warning. */
int length, code;
/*
@@ -3516,7 +3516,7 @@ int
Tcl_EvalEx(interp, script, numBytes, flags)
Tcl_Interp *interp; /* Interpreter in which to evaluate the
* script. Also used for error reporting. */
- char *script; /* First character of script to evaluate. */
+ CONST char *script; /* First character of script to evaluate. */
int numBytes; /* Number of bytes in script. If < 0, the
* script consists of all bytes up to the
* first null character. */
@@ -3526,7 +3526,7 @@ Tcl_EvalEx(interp, script, numBytes, flags)
* supported. */
{
Interp *iPtr = (Interp *) interp;
- char *p, *next;
+ CONST char *p, *next;
Tcl_Parse parse;
#define NUM_STATIC_OBJS 20
Tcl_Obj *staticObjArray[NUM_STATIC_OBJS], **objv;
@@ -3541,7 +3541,7 @@ Tcl_EvalEx(interp, script, numBytes, flags)
* nothing will be read nor written there.
*/
- char *onePast = NULL;
+ CONST char *onePast = NULL;
/*
* The variables below keep track of how much state has been
@@ -3712,7 +3712,7 @@ Tcl_EvalEx(interp, script, numBytes, flags)
Tcl_FreeParse(&parse);
if ((nested != 0) && (p > script)) {
- char *nextCmd = NULL; /* pointer to start of next command */
+ CONST char *nextCmd = NULL; /* pointer to start of next command */
/*
* We get here in the special case where the TCL_BRACKET_TERM
@@ -3791,11 +3791,9 @@ int
Tcl_Eval(interp, string)
Tcl_Interp *interp; /* Token for command interpreter (returned
* by previous call to Tcl_CreateInterp). */
- char *string; /* Pointer to TCL command to execute. */
+ CONST char *string; /* Pointer to TCL command to execute. */
{
- int code;
-
- code = Tcl_EvalEx(interp, string, -1, 0);
+ int code = Tcl_EvalEx(interp, string, -1, 0);
/*
* For backwards compatibility with old C code that predates the
@@ -4301,7 +4299,7 @@ int
TclInvoke(interp, argc, argv, flags)
Tcl_Interp *interp; /* Where to invoke the command. */
int argc; /* Count of args. */
- register char **argv; /* The arg strings; argv[0] is the name of
+ register CONST char **argv; /* The arg strings; argv[0] is the name of
* the command to invoke. */
int flags; /* Combination of flags controlling the
* call: TCL_INVOKE_HIDDEN and
@@ -4398,7 +4396,7 @@ int
TclGlobalInvoke(interp, argc, argv, flags)
Tcl_Interp *interp; /* Where to invoke the command. */
int argc; /* Count of args. */
- register char **argv; /* The arg strings; argv[0] is the name of
+ register CONST char **argv; /* The arg strings; argv[0] is the name of
* the command to invoke. */
int flags; /* Combination of flags controlling the
* call: TCL_INVOKE_HIDDEN and
@@ -4931,7 +4929,7 @@ StringTraceProc( clientData, interp, level, command, commandInfo, objc, objv )
( data->proc )( data->clientData, interp, level,
(char*) command, cmdPtr->proc, cmdPtr->clientData,
- objc, (char**) argv );
+ objc, argv );
ckfree( (char*) argv );
return TCL_OK;
@@ -5238,7 +5236,7 @@ Tcl_VarEval TCL_VARARGS_DEF(Tcl_Interp *,arg1)
int
Tcl_GlobalEval(interp, command)
Tcl_Interp *interp; /* Interpreter in which to evaluate command. */
- char *command; /* Command to evaluate. */
+ CONST char *command; /* Command to evaluate. */
{
register Interp *iPtr = (Interp *) interp;
int result;