summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2020-09-28 13:07:29 (GMT)
committerdgp <dgp@users.sourceforge.net>2020-09-28 13:07:29 (GMT)
commit0188c9979dd99659c8a1c8507af1d33f648dc422 (patch)
treeaf3cf67fbc40173a4660a273d6afd8a4560400ee /generic
parent2394d76c65cb9d2a7266984d14582075d357d5a7 (diff)
parentf6bf85fb67eb15e637ecf7c7de4f661dc0557b43 (diff)
downloadtcl-0188c9979dd99659c8a1c8507af1d33f648dc422.zip
tcl-0188c9979dd99659c8a1c8507af1d33f648dc422.tar.gz
tcl-0188c9979dd99659c8a1c8507af1d33f648dc422.tar.bz2
merge 8.6
Diffstat (limited to 'generic')
-rw-r--r--generic/tclCompCmdsGR.c2
-rw-r--r--generic/tclCompExpr.c16
-rw-r--r--generic/tclExecute.c34
-rw-r--r--generic/tclIOUtil.c2
-rw-r--r--generic/tclListObj.c22
-rw-r--r--generic/tclPathObj.c2
-rw-r--r--generic/tclPkg.c5
-rw-r--r--generic/tclProc.c2
-rw-r--r--generic/tclTest.c9
-rw-r--r--generic/tclTestObj.c4
-rw-r--r--generic/tclTrace.c39
-rw-r--r--generic/tclVar.c58
12 files changed, 95 insertions, 100 deletions
diff --git a/generic/tclCompCmdsGR.c b/generic/tclCompCmdsGR.c
index 16fafad..990be2a 100644
--- a/generic/tclCompCmdsGR.c
+++ b/generic/tclCompCmdsGR.c
@@ -881,7 +881,7 @@ TclCompileLappendCmd(
*/
if (numWords > 2) {
- Tcl_Token *valueTokenPtr = TokenAfter(varTokenPtr);
+ valueTokenPtr = TokenAfter(varTokenPtr);
CompileWord(envPtr, valueTokenPtr, interp, 2);
}
diff --git a/generic/tclCompExpr.c b/generic/tclCompExpr.c
index 0d33821..729ad52 100644
--- a/generic/tclCompExpr.c
+++ b/generic/tclCompExpr.c
@@ -2424,8 +2424,8 @@ CompileExprTree(
if (optimize) {
int length;
const char *bytes = TclGetStringFromObj(literal, &length);
- int index = TclRegisterNewLiteral(envPtr, bytes, length);
- Tcl_Obj *objPtr = TclFetchLiteral(envPtr, index);
+ int idx = TclRegisterNewLiteral(envPtr, bytes, length);
+ Tcl_Obj *objPtr = TclFetchLiteral(envPtr, idx);
if ((objPtr->typePtr == NULL) && (literal->typePtr != NULL)) {
/*
@@ -2445,7 +2445,7 @@ CompileExprTree(
objPtr->internalRep = literal->internalRep;
literal->typePtr = NULL;
}
- TclEmitPush(index, envPtr);
+ TclEmitPush(idx, envPtr);
} else {
/*
* When optimize==0, we know the expression is a one-off and
@@ -2471,7 +2471,7 @@ CompileExprTree(
if (ExecConstantExprTree(interp, nodes, next, litObjvPtr)
== TCL_OK) {
- int index;
+ int idx;
Tcl_Obj *objPtr = Tcl_GetObjResult(interp);
/*
@@ -2482,9 +2482,9 @@ CompileExprTree(
if (objPtr->bytes) {
Tcl_Obj *tableValue;
- index = TclRegisterNewLiteral(envPtr, objPtr->bytes,
+ idx = TclRegisterNewLiteral(envPtr, objPtr->bytes,
objPtr->length);
- tableValue = TclFetchLiteral(envPtr, index);
+ tableValue = TclFetchLiteral(envPtr, idx);
if ((tableValue->typePtr == NULL) &&
(objPtr->typePtr != NULL)) {
/*
@@ -2496,9 +2496,9 @@ CompileExprTree(
objPtr->typePtr = NULL;
}
} else {
- index = TclAddLiteralObj(envPtr, objPtr, NULL);
+ idx = TclAddLiteralObj(envPtr, objPtr, NULL);
}
- TclEmitPush(index, envPtr);
+ TclEmitPush(idx, envPtr);
} else {
TclCompileSyntaxError(interp, envPtr);
}
diff --git a/generic/tclExecute.c b/generic/tclExecute.c
index 4d92468..b8e9312 100644
--- a/generic/tclExecute.c
+++ b/generic/tclExecute.c
@@ -1407,7 +1407,7 @@ int
Tcl_ExprObj(
Tcl_Interp *interp, /* Context in which to evaluate the
* expression. */
- register Tcl_Obj *objPtr, /* Points to Tcl object containing expression
+ Tcl_Obj *objPtr, /* Points to Tcl object containing expression
* to evaluate. */
Tcl_Obj **resultPtrPtr) /* Where the Tcl_Obj* that is the expression
* result is stored if no errors occur. */
@@ -1526,7 +1526,7 @@ CompileExprObj(
Interp *iPtr = (Interp *) interp;
CompileEnv compEnv; /* Compilation environment structure allocated
* in frame. */
- register ByteCode *codePtr = NULL;
+ ByteCode *codePtr = NULL;
/* Tcl Internal type of bytecode. Initialized
* to avoid compiler warning. */
@@ -1680,8 +1680,8 @@ TclCompileObj(
const CmdFrame *invoker,
int word)
{
- register Interp *iPtr = (Interp *) interp;
- register ByteCode *codePtr; /* Tcl Internal type of bytecode. */
+ Interp *iPtr = (Interp *) interp;
+ ByteCode *codePtr; /* Tcl Internal type of bytecode. */
Namespace *namespacePtr = iPtr->varFramePtr->nsPtr;
/*
@@ -6806,8 +6806,8 @@ TEBCresume(
if (valuePtr->typePtr == &tclBooleanType) {
objResultPtr = TCONST(1);
} else {
- int result = (TclSetBooleanFromAny(NULL, valuePtr) == TCL_OK);
- objResultPtr = TCONST(result);
+ int res = (TclSetBooleanFromAny(NULL, valuePtr) == TCL_OK);
+ objResultPtr = TCONST(res);
}
TRACE_WITH_OBJ(("\"%.30s\" => ", O2S(valuePtr)), objResultPtr);
NEXT_INST_F(1, 0, 1);
@@ -7000,7 +7000,7 @@ TEBCresume(
}
{
ForeachInfo *infoPtr;
- Tcl_Obj *listPtr, **elements, *tmpPtr;
+ Tcl_Obj *listPtr, **elements;
ForeachVarList *varListPtr;
int numLists, iterMax, listLen, numVars;
int iterTmp, iterNum, listTmpDepth;
@@ -7286,8 +7286,8 @@ TEBCresume(
case INST_DICT_GET:
case INST_DICT_EXISTS: {
- register Tcl_Interp *interp2 = interp;
- register int found;
+ Tcl_Interp *interp2 = interp;
+ int found;
opnd = TclGetUInt4AtPtr(pc+1);
TRACE(("%u => ", opnd));
@@ -9599,7 +9599,7 @@ TclCompareTwoNumbers(
static void
PrintByteCodeInfo(
- register ByteCode *codePtr) /* The bytecode whose summary is printed to
+ ByteCode *codePtr) /* The bytecode whose summary is printed to
* stdout. */
{
Proc *procPtr = codePtr->procPtr;
@@ -9663,7 +9663,7 @@ PrintByteCodeInfo(
#ifdef TCL_COMPILE_DEBUG
static void
ValidatePcAndStackTop(
- register ByteCode *codePtr, /* The bytecode whose summary is printed to
+ ByteCode *codePtr, /* The bytecode whose summary is printed to
* stdout. */
const unsigned char *pc, /* Points to first byte of a bytecode
* instruction. The program counter. */
@@ -9906,7 +9906,7 @@ GetSrcInfoForPc(
* of the command containing the pc should
* be stored. */
{
- register int pcOffset = (pc - codePtr->codeStart);
+ int pcOffset = (pc - codePtr->codeStart);
int numCmds = codePtr->numCommands;
unsigned char *codeDeltaNext, *codeLengthNext;
unsigned char *srcDeltaNext, *srcLengthNext;
@@ -10059,9 +10059,9 @@ GetExceptRangeForPc(
{
ExceptionRange *rangeArrayPtr;
int numRanges = codePtr->numExceptRanges;
- register ExceptionRange *rangePtr;
+ ExceptionRange *rangePtr;
int pcOffset = pc - codePtr->codeStart;
- register int start;
+ int start;
if (numRanges == 0) {
return NULL;
@@ -10193,11 +10193,11 @@ TclExprFloatError(
int
TclLog2(
- register int value) /* The integer for which to compute the log
+ int value) /* The integer for which to compute the log
* base 2. */
{
- register int n = value;
- register int result = 0;
+ int n = value;
+ int result = 0;
while (n > 1) {
n = n >> 1;
diff --git a/generic/tclIOUtil.c b/generic/tclIOUtil.c
index 6e1cb1f..513f1fb 100644
--- a/generic/tclIOUtil.c
+++ b/generic/tclIOUtil.c
@@ -3244,7 +3244,7 @@ Tcl_LoadFile(
}
if (fsPtr->loadFileProc != NULL) {
- int retVal = ((Tcl_FSLoadFileProc2 *)(void *)(fsPtr->loadFileProc))
+ retVal = ((Tcl_FSLoadFileProc2 *)(void *)(fsPtr->loadFileProc))
(interp, pathPtr, handlePtr, &unloadProcPtr, flags);
if (retVal == TCL_OK) {
diff --git a/generic/tclListObj.c b/generic/tclListObj.c
index e0d7bcc..481cae7 100644
--- a/generic/tclListObj.c
+++ b/generic/tclListObj.c
@@ -420,14 +420,14 @@ TclListObjCopy(
int
Tcl_ListObjGetElements(
Tcl_Interp *interp, /* Used to report errors if not NULL. */
- register Tcl_Obj *listPtr, /* List object for which an element array is
+ Tcl_Obj *listPtr, /* List object for which an element array is
* to be returned. */
int *objcPtr, /* Where to store the count of objects
* referenced by objv. */
Tcl_Obj ***objvPtr) /* Where to store the pointer to an array of
* pointers to the list's objects. */
{
- register List *listRepPtr;
+ List *listRepPtr;
if (listPtr->typePtr != &tclListType) {
int result;
@@ -481,7 +481,7 @@ Tcl_ListObjGetElements(
int
Tcl_ListObjAppendList(
Tcl_Interp *interp, /* Used to report errors if not NULL. */
- register Tcl_Obj *listPtr, /* List object to append elements to. */
+ Tcl_Obj *listPtr, /* List object to append elements to. */
Tcl_Obj *elemListPtr) /* List obj with elements to append. */
{
int objc;
@@ -543,7 +543,7 @@ Tcl_ListObjAppendElement(
Tcl_Obj *listPtr, /* List object to append objPtr to. */
Tcl_Obj *objPtr) /* Object to append to listPtr's list. */
{
- register List *listRepPtr, *newPtr = NULL;
+ List *listRepPtr, *newPtr = NULL;
int numElems, numRequired, needGrow, isShared, attempt;
if (Tcl_IsShared(listPtr)) {
@@ -711,11 +711,11 @@ Tcl_ListObjAppendElement(
int
Tcl_ListObjIndex(
Tcl_Interp *interp, /* Used to report errors if not NULL. */
- register Tcl_Obj *listPtr, /* List object to index into. */
- register int index, /* Index of element to return. */
+ Tcl_Obj *listPtr, /* List object to index into. */
+ int index, /* Index of element to return. */
Tcl_Obj **objPtrPtr) /* The resulting Tcl_Obj* is stored here. */
{
- register List *listRepPtr;
+ List *listRepPtr;
if (listPtr->typePtr != &tclListType) {
int result;
@@ -766,10 +766,10 @@ Tcl_ListObjIndex(
int
Tcl_ListObjLength(
Tcl_Interp *interp, /* Used to report errors if not NULL. */
- register Tcl_Obj *listPtr, /* List object whose #elements to return. */
- register int *intPtr) /* The resulting int is stored here. */
+ Tcl_Obj *listPtr, /* List object whose #elements to return. */
+ int *intPtr) /* The resulting int is stored here. */
{
- register List *listRepPtr;
+ List *listRepPtr;
if (listPtr->typePtr != &tclListType) {
int result;
@@ -839,7 +839,7 @@ Tcl_ListObjReplace(
* insert. */
{
List *listRepPtr;
- register Tcl_Obj **elemPtrs;
+ Tcl_Obj **elemPtrs;
int needGrow, numElems, numRequired, numAfterLast, start, i, j, isShared;
if (Tcl_IsShared(listPtr)) {
diff --git a/generic/tclPathObj.c b/generic/tclPathObj.c
index 0f98881..a41d9fd 100644
--- a/generic/tclPathObj.c
+++ b/generic/tclPathObj.c
@@ -2617,7 +2617,7 @@ DupFsPathInternalRep(
static void
UpdateStringOfFsPath(
- register Tcl_Obj *pathPtr) /* path obj with string rep to update. */
+ Tcl_Obj *pathPtr) /* path obj with string rep to update. */
{
FsPath *fsPathPtr = PATHOBJ(pathPtr);
int cwdLen;
diff --git a/generic/tclPkg.c b/generic/tclPkg.c
index 06d6ade..0a0c868 100644
--- a/generic/tclPkg.c
+++ b/generic/tclPkg.c
@@ -1137,9 +1137,10 @@ TclNRPackageObjCmd(
Tcl_NRAddCallback(interp, PkgRequireCore, (void *)argv3, INT2PTR(newobjc), newObjvPtr, NULL);
return TCL_OK;
} else {
- int i, newobjc = objc-3;
Tcl_Obj *const *newobjv = objv + 3;
- if (CheckAllRequirements(interp, objc-3, objv+3) != TCL_OK) {
+ newobjc = objc - 3;
+
+ if (CheckAllRequirements(interp, objc - 3, objv + 3) != TCL_OK) {
return TCL_ERROR;
}
objvListPtr = Tcl_NewListObj(0, NULL);
diff --git a/generic/tclProc.c b/generic/tclProc.c
index 56757ff..769074b 100644
--- a/generic/tclProc.c
+++ b/generic/tclProc.c
@@ -903,7 +903,7 @@ TclNRUplevelObjCmd(
Tcl_Obj *objPtr;
if (objc < 2) {
- /* to do
+ /* to do
* simplify things by interpreting the argument as a command when there
* is only one argument. This requires a TIP since currently a single
* argument is interpreted as a level indicator if possible.
diff --git a/generic/tclTest.c b/generic/tclTest.c
index 03f40dd..f1e3fac 100644
--- a/generic/tclTest.c
+++ b/generic/tclTest.c
@@ -7398,8 +7398,6 @@ TestconcatobjCmd(
"\n\t* (e) concatObj does not have refCount 0", NULL);
}
if (concatPtr == tmpPtr) {
- int len;
-
result = TCL_ERROR;
Tcl_AppendResult(interp, "\n\t* (e) concatObj is not a new obj ",
NULL);
@@ -7430,8 +7428,6 @@ TestconcatobjCmd(
"\n\t* (f) concatObj does not have refCount 0", NULL);
}
if (concatPtr == tmpPtr) {
- int len;
-
result = TCL_ERROR;
Tcl_AppendResult(interp, "\n\t* (f) concatObj is not a new obj ",
NULL);
@@ -7463,8 +7459,6 @@ TestconcatobjCmd(
"\n\t* (g) concatObj does not have refCount 0", NULL);
}
if (concatPtr == tmpPtr) {
- int len;
-
result = TCL_ERROR;
Tcl_AppendResult(interp, "\n\t* (g) concatObj is not a new obj ",
NULL);
@@ -7559,7 +7553,7 @@ static int
InterpCmdResolver(
Tcl_Interp *interp,
const char *name,
- Tcl_Namespace *context,
+ Tcl_Namespace *dummy,
int flags,
Tcl_Command *rPtr)
{
@@ -7569,6 +7563,7 @@ InterpCmdResolver(
varFramePtr->procPtr : NULL;
Namespace *callerNsPtr = varFramePtr->nsPtr;
Tcl_Command resolvedCmdPtr = NULL;
+ (void)dummy;
/*
* Just do something special on a cmd literal "z" in two cases:
diff --git a/generic/tclTestObj.c b/generic/tclTestObj.c
index ba1dda6..3fe9d02 100644
--- a/generic/tclTestObj.c
+++ b/generic/tclTestObj.c
@@ -53,7 +53,7 @@ static int TeststringobjCmd(ClientData dummy, Tcl_Interp *interp,
static void VarPtrDeleteProc(ClientData clientData, Tcl_Interp *interp)
{
- register int i;
+ int i;
Tcl_Obj **varPtr = (Tcl_Obj **) clientData;
for (i = 0; i < NUMBER_OF_OBJECT_VARS; i++) {
if (varPtr[i]) Tcl_DecrRefCount(varPtr[i]);
@@ -91,7 +91,7 @@ int
TclObjTest_Init(
Tcl_Interp *interp)
{
- register int i;
+ int i;
/*
* An array of Tcl_Obj pointers used in the commands that operate on or get
* the values of Tcl object-valued variables. varPtr[i] is the i-th variable's
diff --git a/generic/tclTrace.c b/generic/tclTrace.c
index 3178441..0228aff 100644
--- a/generic/tclTrace.c
+++ b/generic/tclTrace.c
@@ -136,7 +136,7 @@ static int StringTraceProc(ClientData clientData,
static void StringTraceDeleteProc(ClientData clientData);
static void DisposeTraceResult(int flags, char *result);
static int TraceVarEx(Tcl_Interp *interp, const char *part1,
- const char *part2, register VarTrace *tracePtr);
+ const char *part2, VarTrace *tracePtr);
/*
* The following structure holds the client data for string-based
@@ -1049,7 +1049,7 @@ Tcl_CommandTraceInfo(
* call will return the first trace. */
{
Command *cmdPtr;
- register CommandTrace *tracePtr;
+ CommandTrace *tracePtr;
cmdPtr = (Command *) Tcl_FindCommand(interp, cmdName, NULL,
TCL_LEAVE_ERR_MSG);
@@ -1114,7 +1114,7 @@ Tcl_TraceCommand(
ClientData clientData) /* Arbitrary argument to pass to proc. */
{
Command *cmdPtr;
- register CommandTrace *tracePtr;
+ CommandTrace *tracePtr;
cmdPtr = (Command *) Tcl_FindCommand(interp, cmdName, NULL,
TCL_LEAVE_ERR_MSG);
@@ -1177,10 +1177,10 @@ Tcl_UntraceCommand(
Tcl_CommandTraceProc *proc, /* Function assocated with trace. */
ClientData clientData) /* Arbitrary argument to pass to proc. */
{
- register CommandTrace *tracePtr;
+ CommandTrace *tracePtr;
CommandTrace *prevPtr;
Command *cmdPtr;
- Interp *iPtr = (Interp *) interp;
+ Interp *iPtr = (Interp *)interp;
ActiveCommandTrace *activePtr;
int hasExecTraces = 0;
@@ -1255,7 +1255,6 @@ Tcl_UntraceCommand(
*/
if (cmdPtr->compileProc != NULL) {
- Interp *iPtr = (Interp *) interp;
iPtr->compileEpoch++;
}
}
@@ -1672,13 +1671,13 @@ TclCheckInterpTraces(
static int
CallTraceFunction(
Tcl_Interp *interp, /* The current interpreter. */
- register Trace *tracePtr, /* Describes the trace function to call. */
+ Trace *tracePtr, /* Describes the trace function to call. */
Command *cmdPtr, /* Points to command's Command struct. */
const char *command, /* Points to the first character of the
* command's source before substitutions. */
int numChars, /* The number of characters in the command's
* source. */
- register int objc, /* Number of arguments for the command. */
+ int objc, /* Number of arguments for the command. */
Tcl_Obj *const objv[]) /* Pointers to Tcl_Obj of each argument. */
{
Interp *iPtr = (Interp *) interp;
@@ -1920,7 +1919,7 @@ TraceExecutionProc(
if ((flags & TCL_TRACE_ENTER_EXEC) && (tcmdPtr->stepTrace == NULL)
&& (tcmdPtr->flags & (TCL_TRACE_ENTER_DURING_EXEC |
TCL_TRACE_LEAVE_DURING_EXEC))) {
- register unsigned len = strlen(command) + 1;
+ unsigned len = strlen(command) + 1;
tcmdPtr->startLevel = level;
tcmdPtr->startCmd = ckalloc(len);
@@ -2065,7 +2064,7 @@ TraceVarProc(
}
}
if (destroy && result != NULL) {
- register Tcl_Obj *errMsgObj = (Tcl_Obj *) result;
+ Tcl_Obj *errMsgObj = (Tcl_Obj *) result;
Tcl_DecrRefCount(errMsgObj);
result = NULL;
@@ -2142,8 +2141,8 @@ Tcl_CreateObjTrace(
Tcl_CmdObjTraceDeleteProc *delProc)
/* Function to call when trace is deleted */
{
- register Trace *tracePtr;
- register Interp *iPtr = (Interp *) interp;
+ Trace *tracePtr;
+ Interp *iPtr = (Interp *) interp;
/*
* Test if this trace allows inline compilation of commands.
@@ -2342,7 +2341,7 @@ Tcl_DeleteTrace(
{
Interp *iPtr = (Interp *) interp;
Trace *prevPtr, *tracePtr = (Trace *) trace;
- register Trace **tracePtr2 = &iPtr->tracePtr;
+ Trace **tracePtr2 = &iPtr->tracePtr;
ActiveInterpTrace *activePtr;
/*
@@ -2534,7 +2533,7 @@ TclCheckArrayTraces(
int
TclObjCallVarTraces(
Interp *iPtr, /* Interpreter containing variable. */
- register Var *arrayPtr, /* Pointer to array variable that contains the
+ Var *arrayPtr, /* Pointer to array variable that contains the
* variable, or NULL if the variable isn't an
* element of an array. */
Var *varPtr, /* Variable whose traces are to be invoked. */
@@ -2568,7 +2567,7 @@ TclObjCallVarTraces(
int
TclCallVarTraces(
Interp *iPtr, /* Interpreter containing variable. */
- register Var *arrayPtr, /* Pointer to array variable that contains the
+ Var *arrayPtr, /* Pointer to array variable that contains the
* variable, or NULL if the variable isn't an
* element of an array. */
Var *varPtr, /* Variable whose traces are to be invoked. */
@@ -2581,7 +2580,7 @@ TclCallVarTraces(
* error, then leave an error message and
* stack trace information in *iPTr. */
{
- register VarTrace *tracePtr;
+ VarTrace *tracePtr;
ActiveVarTrace active;
char *result;
const char *openParen, *p;
@@ -2909,7 +2908,7 @@ Tcl_UntraceVar2(
Tcl_VarTraceProc *proc, /* Function assocated with trace. */
ClientData clientData) /* Arbitrary argument to pass to proc. */
{
- register VarTrace *tracePtr;
+ VarTrace *tracePtr;
VarTrace *prevPtr, *nextPtr;
Var *varPtr, *arrayPtr;
Interp *iPtr = (Interp *) interp;
@@ -3099,7 +3098,7 @@ Tcl_VarTraceInfo2(
hPtr = Tcl_FindHashEntry(&iPtr->varTraces, (char *) varPtr);
if (hPtr) {
- register VarTrace *tracePtr = Tcl_GetHashValue(hPtr);
+ VarTrace *tracePtr = Tcl_GetHashValue(hPtr);
if (prevClientData != NULL) {
for (; tracePtr != NULL; tracePtr = tracePtr->nextPtr) {
@@ -3195,7 +3194,7 @@ Tcl_TraceVar2(
* invoked upon varName. */
ClientData clientData) /* Arbitrary argument to pass to proc. */
{
- register VarTrace *tracePtr;
+ VarTrace *tracePtr;
int result;
tracePtr = ckalloc(sizeof(VarTrace));
@@ -3240,7 +3239,7 @@ TraceVarEx(
const char *part2, /* Name of element within array; NULL means
* trace applies to scalar variable or array
* as-a-whole. */
- register VarTrace *tracePtr)/* Structure containing flags, traceProc and
+ VarTrace *tracePtr)/* Structure containing flags, traceProc and
* clientData fields. Others should be left
* blank. Will be ckfree()d (eventually) if
* this function returns TCL_OK, and up to
diff --git a/generic/tclVar.c b/generic/tclVar.c
index 5d8d88c..b7567a8 100644
--- a/generic/tclVar.c
+++ b/generic/tclVar.c
@@ -123,17 +123,17 @@ VarHashNextVar(
* access is denied.
*/
-static const char *noSuchVar = "no such variable";
-static const char *isArray = "variable is array";
-static const char *needArray = "variable isn't array";
-static const char *noSuchElement = "no such element in array";
-static const char *danglingElement =
+static const char NOSUCHVAR[] = "no such variable";
+static const char ISARRAY[] = "variable is array";
+static const char NEEDARRAY[] = "variable isn't array";
+static const char NOSUCHELEMENT[] = "no such element in array";
+static const char DANGLINGELEMENT[] =
"upvar refers to element in deleted array";
-static const char *danglingVar =
+static const char DANGLINGVAR[] =
"upvar refers to variable in deleted namespace";
-static const char *badNamespace = "parent namespace doesn't exist";
-static const char *missingName = "missing variable name";
-static const char *isArrayElement =
+static const char BADNAMESPACE[] = "parent namespace doesn't exist";
+static const char MISSINGNAME[] = "missing variable name";
+static const char ISARRAYELEMENT[] =
"name refers to an element in an array";
/*
@@ -613,7 +613,7 @@ TclObjLookupVarEx(
if (flags & TCL_LEAVE_ERR_MSG) {
TclObjVarErrMsg(interp, part1Ptr, part2Ptr, msg,
- noSuchVar, -1);
+ NOSUCHVAR, -1);
Tcl_SetErrorCode(interp, "TCL", "VALUE", "VARNAME", NULL);
}
return NULL;
@@ -648,7 +648,7 @@ TclObjLookupVarEx(
if (part2Ptr != NULL) {
if (flags & TCL_LEAVE_ERR_MSG) {
TclObjVarErrMsg(interp, part1Ptr, part2Ptr, msg,
- needArray, -1);
+ NEEDARRAY, -1);
Tcl_SetErrorCode(interp, "TCL", "VALUE", "VARNAME",
NULL);
}
@@ -942,10 +942,10 @@ TclLookupSimpleVar(
TclGetNamespaceForQualName(interp, varName, cxtNsPtr,
flags, &varNsPtr, &dummy1Ptr, &dummy2Ptr, &tail);
if (varNsPtr == NULL) {
- *errMsgPtr = badNamespace;
+ *errMsgPtr = BADNAMESPACE;
return NULL;
} else if (tail == NULL) {
- *errMsgPtr = missingName;
+ *errMsgPtr = MISSINGNAME;
return NULL;
}
if (tail != varName) {
@@ -967,7 +967,7 @@ TclLookupSimpleVar(
*indexPtr = -2;
}
} else { /* Var wasn't found and not to create it. */
- *errMsgPtr = noSuchVar;
+ *errMsgPtr = NOSUCHVAR;
return NULL;
}
}
@@ -1007,7 +1007,7 @@ TclLookupSimpleVar(
varPtr = VarHashFindVar(tablePtr, varNamePtr);
}
if (varPtr == NULL) {
- *errMsgPtr = noSuchVar;
+ *errMsgPtr = NOSUCHVAR;
}
}
}
@@ -1087,7 +1087,7 @@ TclLookupArrayElement(
if (!createArray) {
if (flags & TCL_LEAVE_ERR_MSG) {
TclObjVarErrMsg(interp, arrayNamePtr, elNamePtr, msg,
- noSuchVar, index);
+ NOSUCHVAR, index);
Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "VARNAME",
arrayNamePtr?TclGetString(arrayNamePtr):NULL, NULL);
}
@@ -1102,7 +1102,7 @@ TclLookupArrayElement(
if (TclIsVarDeadHash(arrayPtr)) {
if (flags & TCL_LEAVE_ERR_MSG) {
TclObjVarErrMsg(interp, arrayNamePtr, elNamePtr, msg,
- danglingVar, index);
+ DANGLINGVAR, index);
Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "VARNAME",
arrayNamePtr?TclGetString(arrayNamePtr):NULL, NULL);
}
@@ -1121,7 +1121,7 @@ TclLookupArrayElement(
TclInitVarHashTable(arrayPtr->value.tablePtr, nsPtr);
} else if (!TclIsVarArray(arrayPtr)) {
if (flags & TCL_LEAVE_ERR_MSG) {
- TclObjVarErrMsg(interp, arrayNamePtr, elNamePtr, msg, needArray,
+ TclObjVarErrMsg(interp, arrayNamePtr, elNamePtr, msg, NEEDARRAY,
index);
Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "VARNAME",
arrayNamePtr?TclGetString(arrayNamePtr):NULL, NULL);
@@ -1143,7 +1143,7 @@ TclLookupArrayElement(
if (varPtr == NULL) {
if (flags & TCL_LEAVE_ERR_MSG) {
TclObjVarErrMsg(interp, arrayNamePtr, elNamePtr, msg,
- noSuchElement, index);
+ NOSUCHELEMENT, index);
Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "ELEMENT",
TclGetString(elNamePtr), NULL);
}
@@ -1469,11 +1469,11 @@ TclPtrGetVarIdx(
if (flags & TCL_LEAVE_ERR_MSG) {
if (TclIsVarUndefined(varPtr) && arrayPtr
&& !TclIsVarUndefined(arrayPtr)) {
- msg = noSuchElement;
+ msg = NOSUCHELEMENT;
} else if (TclIsVarArray(varPtr)) {
- msg = isArray;
+ msg = ISARRAY;
} else {
- msg = noSuchVar;
+ msg = NOSUCHVAR;
}
TclObjVarErrMsg(interp, part1Ptr, part2Ptr, "read", msg, index);
}
@@ -1887,11 +1887,11 @@ TclPtrSetVarIdx(
if (flags & TCL_LEAVE_ERR_MSG) {
if (TclIsVarArrayElement(varPtr)) {
TclObjVarErrMsg(interp, part1Ptr, part2Ptr, "set",
- danglingElement, index);
+ DANGLINGELEMENT, index);
Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "ELEMENT", NULL);
} else {
TclObjVarErrMsg(interp, part1Ptr, part2Ptr, "set",
- danglingVar, index);
+ DANGLINGVAR, index);
Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "VARNAME", NULL);
}
}
@@ -1904,7 +1904,7 @@ TclPtrSetVarIdx(
if (TclIsVarArray(varPtr)) {
if (flags & TCL_LEAVE_ERR_MSG) {
- TclObjVarErrMsg(interp, part1Ptr, part2Ptr, "set", isArray,index);
+ TclObjVarErrMsg(interp, part1Ptr, part2Ptr, "set", ISARRAY,index);
Tcl_SetErrorCode(interp, "TCL", "WRITE", "ARRAY", NULL);
}
goto earlyError;
@@ -2502,7 +2502,7 @@ TclPtrUnsetVarIdx(
if (result != TCL_OK) {
if (flags & TCL_LEAVE_ERR_MSG) {
TclObjVarErrMsg(interp, part1Ptr, part2Ptr, "unset",
- ((arrayPtr == NULL) ? noSuchVar : noSuchElement), index);
+ ((arrayPtr == NULL) ? NOSUCHVAR : NOSUCHELEMENT), index);
Tcl_SetErrorCode(interp, "TCL", "UNSET", "VARNAME", NULL);
}
}
@@ -3697,7 +3697,7 @@ ArraySetCmd(
}
if (arrayPtr) {
CleanupVar(varPtr, arrayPtr);
- TclObjVarErrMsg(interp, arrayNameObj, NULL, "set", needArray, -1);
+ TclObjVarErrMsg(interp, arrayNameObj, NULL, "set", NEEDARRAY, -1);
Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "VARNAME",
TclGetString(arrayNameObj), NULL);
return TCL_ERROR;
@@ -3815,7 +3815,7 @@ ArraySetCmd(
*/
TclObjVarErrMsg(interp, arrayNameObj, NULL, "array set",
- needArray, -1);
+ NEEDARRAY, -1);
Tcl_SetErrorCode(interp, "TCL", "WRITE", "ARRAY", NULL);
return TCL_ERROR;
}
@@ -4718,7 +4718,7 @@ Tcl_VariableObjCmd(
*/
TclObjVarErrMsg(interp, varNamePtr, NULL, "define",
- isArrayElement, -1);
+ ISARRAYELEMENT, -1);
Tcl_SetErrorCode(interp, "TCL", "UPVAR", "LOCAL_ELEMENT", NULL);
return TCL_ERROR;
}