summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2013-01-24 10:37:30 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2013-01-24 10:37:30 (GMT)
commit51db664c7d3fa5bc0a1c216ac3ee89c1eeba6f09 (patch)
tree6cd1984366d92404681d2d61d43d3558ae6c0d17 /generic
parent4462cc72bb42f0c350c2059a67c357a63220e326 (diff)
parenteae252da83b4af0e55e40abefe4e3d7ff8f1a370 (diff)
downloadtcl-51db664c7d3fa5bc0a1c216ac3ee89c1eeba6f09.zip
tcl-51db664c7d3fa5bc0a1c216ac3ee89c1eeba6f09.tar.gz
tcl-51db664c7d3fa5bc0a1c216ac3ee89c1eeba6f09.tar.bz2
Convert Tcl_GetIndexFromObj implementation to macro
Diffstat (limited to 'generic')
-rw-r--r--generic/tcl.decls9
-rw-r--r--generic/tclBinary.c16
-rw-r--r--generic/tclClock.c16
-rw-r--r--generic/tclCmdAH.c6
-rw-r--r--generic/tclCmdIL.c8
-rw-r--r--generic/tclCmdMZ.c32
-rw-r--r--generic/tclConfig.c4
-rw-r--r--generic/tclDecls.h14
-rw-r--r--generic/tclDictObj.c6
-rw-r--r--generic/tclEnsemble.c16
-rw-r--r--generic/tclEvent.c18
-rw-r--r--generic/tclFCmd.c18
-rw-r--r--generic/tclFileName.c4
-rw-r--r--generic/tclIO.c12
-rw-r--r--generic/tclIORTrans.c8
-rw-r--r--generic/tclIOUtil.c10
-rw-r--r--generic/tclIndexObj.c84
-rw-r--r--generic/tclNamesp.c16
-rw-r--r--generic/tclOOBasic.c4
-rw-r--r--generic/tclProc.c3
-rw-r--r--generic/tclStubInit.c2
-rw-r--r--generic/tclTest.c38
-rw-r--r--generic/tclTestObj.c23
-rw-r--r--generic/tclTimer.c4
-rw-r--r--generic/tclVar.c8
25 files changed, 161 insertions, 218 deletions
diff --git a/generic/tcl.decls b/generic/tcl.decls
index 2f1d4ac..c7686a1 100644
--- a/generic/tcl.decls
+++ b/generic/tcl.decls
@@ -152,10 +152,11 @@ declare 35 {
int Tcl_GetDoubleFromObj(Tcl_Interp *interp, Tcl_Obj *objPtr,
double *doublePtr)
}
-declare 36 {
- int Tcl_GetIndexFromObj(Tcl_Interp *interp, Tcl_Obj *objPtr,
- const char *const *tablePtr, const char *msg, int flags, int *indexPtr)
-}
+# Removed in 9.0
+#declare 36 {
+# int Tcl_GetIndexFromObj(Tcl_Interp *interp, Tcl_Obj *objPtr,
+# const char *const *tablePtr, const char *msg, int flags, int *indexPtr)
+#}
declare 37 {
int Tcl_GetInt(Tcl_Interp *interp, const char *src, int *intPtr)
}
diff --git a/generic/tclBinary.c b/generic/tclBinary.c
index 9b0b233..629319e 100644
--- a/generic/tclBinary.c
+++ b/generic/tclBinary.c
@@ -2365,8 +2365,8 @@ BinaryDecodeHex(
return TCL_ERROR;
}
for (i = 1; i < objc-1; ++i) {
- if (Tcl_GetIndexFromObj(interp, objv[i], optStrings, "option",
- TCL_EXACT, &index) != TCL_OK) {
+ if (Tcl_GetIndexFromObjStruct(interp, objv[i], optStrings,
+ sizeof(char *), "option", TCL_EXACT, &index) != TCL_OK) {
return TCL_ERROR;
}
switch (index) {
@@ -2485,8 +2485,8 @@ BinaryEncode64(
return TCL_ERROR;
}
for (i = 1; i < objc-1; i += 2) {
- if (Tcl_GetIndexFromObj(interp, objv[i], optStrings, "option",
- TCL_EXACT, &index) != TCL_OK) {
+ if (Tcl_GetIndexFromObjStruct(interp, objv[i], optStrings,
+ sizeof(char *), "option", TCL_EXACT, &index) != TCL_OK) {
return TCL_ERROR;
}
switch (index) {
@@ -2579,8 +2579,8 @@ BinaryDecodeUu(
return TCL_ERROR;
}
for (i = 1; i < objc-1; ++i) {
- if (Tcl_GetIndexFromObj(interp, objv[i], optStrings, "option",
- TCL_EXACT, &index) != TCL_OK) {
+ if (Tcl_GetIndexFromObjStruct(interp, objv[i], optStrings,
+ sizeof(char *), "option", TCL_EXACT, &index) != TCL_OK) {
return TCL_ERROR;
}
switch (index) {
@@ -2675,8 +2675,8 @@ BinaryDecode64(
return TCL_ERROR;
}
for (i = 1; i < objc-1; ++i) {
- if (Tcl_GetIndexFromObj(interp, objv[i], optStrings, "option",
- TCL_EXACT, &index) != TCL_OK) {
+ if (Tcl_GetIndexFromObjStruct(interp, objv[i], optStrings,
+ sizeof(char *), "option", TCL_EXACT, &index) != TCL_OK) {
return TCL_ERROR;
}
switch (index) {
diff --git a/generic/tclClock.c b/generic/tclClock.c
index 1257231..98ca02d 100644
--- a/generic/tclClock.c
+++ b/generic/tclClock.c
@@ -548,8 +548,8 @@ ClockGetjuliandayfromerayearmonthdayObjCmd(
}
dict = objv[1];
if (Tcl_DictObjGet(interp, dict, literals[LIT_ERA], &fieldPtr) != TCL_OK
- || Tcl_GetIndexFromObj(interp, fieldPtr, eras, "era", TCL_EXACT,
- &era) != TCL_OK
+ || Tcl_GetIndexFromObjStruct(interp, fieldPtr, eras,
+ sizeof(char *), "era", TCL_EXACT, &era) != TCL_OK
|| Tcl_DictObjGet(interp, dict, literals[LIT_YEAR],
&fieldPtr) != TCL_OK
|| TclGetIntFromObj(interp, fieldPtr, &fields.year) != TCL_OK
@@ -638,8 +638,8 @@ ClockGetjuliandayfromerayearweekdayObjCmd(
}
dict = objv[1];
if (Tcl_DictObjGet(interp, dict, literals[LIT_ERA], &fieldPtr) != TCL_OK
- || Tcl_GetIndexFromObj(interp, fieldPtr, eras, "era", TCL_EXACT,
- &era) != TCL_OK
+ || Tcl_GetIndexFromObjStruct(interp, fieldPtr, eras,
+ sizeof(char *), "era", TCL_EXACT, &era) != TCL_OK
|| Tcl_DictObjGet(interp, dict, literals[LIT_ISO8601YEAR],
&fieldPtr) != TCL_OK
|| TclGetIntFromObj(interp, fieldPtr, &fields.iso8601Year)!=TCL_OK
@@ -1697,8 +1697,8 @@ ClockClicksObjCmd(
case 1:
break;
case 2:
- if (Tcl_GetIndexFromObj(interp, objv[1], clicksSwitches, "switch", 0,
- &index) != TCL_OK) {
+ if (Tcl_GetIndexFromObjStruct(interp, objv[1], clicksSwitches,
+ sizeof(char *), "switch", 0, &index) != TCL_OK) {
return TCL_ERROR;
}
break;
@@ -1867,8 +1867,8 @@ ClockParseformatargsObjCmd(
localeObj = litPtr[LIT_C];
timezoneObj = litPtr[LIT__NIL];
for (i = 2; i < objc; i+=2) {
- if (Tcl_GetIndexFromObj(interp, objv[i], options, "switch", 0,
- &optionIndex) != TCL_OK) {
+ if (Tcl_GetIndexFromObjStruct(interp, objv[i], options,
+ sizeof(char *), "switch", 0, &optionIndex) != TCL_OK) {
Tcl_SetErrorCode(interp, "CLOCK", "badSwitch",
Tcl_GetString(objv[i]), NULL);
return TCL_ERROR;
diff --git a/generic/tclCmdAH.c b/generic/tclCmdAH.c
index fefe5a3..fd62ede 100644
--- a/generic/tclCmdAH.c
+++ b/generic/tclCmdAH.c
@@ -395,8 +395,8 @@ Tcl_EncodingObjCmd(
Tcl_WrongNumArgs(interp, 1, objv, "option ?arg ...?");
return TCL_ERROR;
}
- if (Tcl_GetIndexFromObj(interp, objv[1], optionStrings, "option", 0,
- &index) != TCL_OK) {
+ if (Tcl_GetIndexFromObjStruct(interp, objv[1], optionStrings,
+ sizeof(char *), "option", 0, &index) != TCL_OK) {
return TCL_ERROR;
}
@@ -612,7 +612,7 @@ Tcl_EvalObjCmd(
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
{
- return Tcl_NRCallObjProc(interp, TclNREvalObjCmd, dummy, objc, objv);
+ return Tcl_NRCallObjProc(interp, TclNREvalObjCmd, dummy, objc, objv);
}
int
diff --git a/generic/tclCmdIL.c b/generic/tclCmdIL.c
index 5afe265..7fdab05 100644
--- a/generic/tclCmdIL.c
+++ b/generic/tclCmdIL.c
@@ -2962,8 +2962,8 @@ Tcl_LsearchObjCmd(
}
for (i = 1; i < objc-2; i++) {
- if (Tcl_GetIndexFromObj(interp, objv[i], options, "option", 0, &index)
- != TCL_OK) {
+ if (Tcl_GetIndexFromObjStruct(interp, objv[i], options,
+ sizeof(char *), "option", 0, &index) != TCL_OK) {
if (startPtr != NULL) {
Tcl_DecrRefCount(startPtr);
}
@@ -3691,8 +3691,8 @@ Tcl_LsortObjCmd(
groupOffset = 0;
indexPtr = NULL;
for (i = 1; i < objc-1; i++) {
- if (Tcl_GetIndexFromObj(interp, objv[i], switches, "option", 0,
- &index) != TCL_OK) {
+ if (Tcl_GetIndexFromObjStruct(interp, objv[i], switches,
+ sizeof(char *), "option", 0, &index) != TCL_OK) {
sortInfo.resultCode = TCL_ERROR;
goto done2;
}
diff --git a/generic/tclCmdMZ.c b/generic/tclCmdMZ.c
index 95debf8..5b8f9ac 100644
--- a/generic/tclCmdMZ.c
+++ b/generic/tclCmdMZ.c
@@ -159,8 +159,8 @@ Tcl_RegexpObjCmd(
if (name[0] != '-') {
break;
}
- if (Tcl_GetIndexFromObj(interp, objv[i], options, "switch", TCL_EXACT,
- &index) != TCL_OK) {
+ if (Tcl_GetIndexFromObjStruct(interp, objv[i], options,
+ sizeof(char *), "switch", TCL_EXACT, &index) != TCL_OK) {
goto optionError;
}
switch ((enum options) index) {
@@ -517,8 +517,8 @@ Tcl_RegsubObjCmd(
if (name[0] != '-') {
break;
}
- if (Tcl_GetIndexFromObj(interp, objv[idx], options, "switch",
- TCL_EXACT, &index) != TCL_OK) {
+ if (Tcl_GetIndexFromObjStruct(interp, objv[idx], options,
+ sizeof(char *), "switch", TCL_EXACT, &index) != TCL_OK) {
goto optionError;
}
switch ((enum options) index) {
@@ -1003,8 +1003,8 @@ TclNRSourceObjCmd(
};
int index;
- if (TCL_ERROR == Tcl_GetIndexFromObj(interp, objv[1], options,
- "option", TCL_EXACT, &index)) {
+ if (TCL_ERROR == Tcl_GetIndexFromObjStruct(interp, objv[1], options,
+ sizeof(char *), "option", TCL_EXACT, &index)) {
return TCL_ERROR;
}
encodingName = TclGetString(objv[2]);
@@ -1485,8 +1485,8 @@ StringIsCmd(
"class ?-strict? ?-failindex var? str");
return TCL_ERROR;
}
- if (Tcl_GetIndexFromObj(interp, objv[1], isClasses, "class", 0,
- &index) != TCL_OK) {
+ if (Tcl_GetIndexFromObjStruct(interp, objv[1], isClasses,
+ sizeof(char *), "class", 0, &index) != TCL_OK) {
return TCL_ERROR;
}
@@ -1494,8 +1494,8 @@ StringIsCmd(
for (i = 2; i < objc-1; i++) {
int idx2;
- if (Tcl_GetIndexFromObj(interp, objv[i], isOptions, "option", 0,
- &idx2) != TCL_OK) {
+ if (Tcl_GetIndexFromObjStruct(interp, objv[i], isOptions,
+ sizeof(char *), "option", 0, &idx2) != TCL_OK) {
return TCL_ERROR;
}
switch ((enum isOptions) idx2) {
@@ -3388,8 +3388,8 @@ TclSubstOptions(
for (i = 0; i < numOpts; i++) {
int optionIndex;
- if (Tcl_GetIndexFromObj(interp, opts[i], substOptions, "switch", 0,
- &optionIndex) != TCL_OK) {
+ if (Tcl_GetIndexFromObjStruct(interp, opts[i], substOptions,
+ sizeof(char *), "switch", 0, &optionIndex) != TCL_OK) {
return TCL_ERROR;
}
switch (optionIndex) {
@@ -3513,8 +3513,8 @@ TclNRSwitchObjCmd(
if (TclGetString(objv[i])[0] != '-') {
break;
}
- if (Tcl_GetIndexFromObj(interp, objv[i], options, "option", 0,
- &index) != TCL_OK) {
+ if (Tcl_GetIndexFromObjStruct(interp, objv[i], options,
+ sizeof(char *), "option", 0, &index) != TCL_OK) {
return TCL_ERROR;
}
switch ((enum options) index) {
@@ -4190,8 +4190,8 @@ TclNRTryObjCmd(
int type;
Tcl_Obj *info[5];
- if (Tcl_GetIndexFromObj(interp, objv[i], handlerNames, "handler type",
- 0, &type) != TCL_OK) {
+ if (Tcl_GetIndexFromObjStruct(interp, objv[i], handlerNames,
+ sizeof(char *), "handler type", 0, &type) != TCL_OK) {
Tcl_DecrRefCount(handlersObj);
return TCL_ERROR;
}
diff --git a/generic/tclConfig.c b/generic/tclConfig.c
index fe99bbb..ce36047 100644
--- a/generic/tclConfig.c
+++ b/generic/tclConfig.c
@@ -223,8 +223,8 @@ QueryConfigObjCmd(
Tcl_WrongNumArgs(interp, 1, objv, "subcommand ?arg?");
return TCL_ERROR;
}
- if (Tcl_GetIndexFromObj(interp, objv[1], subcmdStrings, "subcommand", 0,
- &index) != TCL_OK) {
+ if (Tcl_GetIndexFromObjStruct(interp, objv[1], subcmdStrings,
+ sizeof(char *), "subcommand", 0, &index) != TCL_OK) {
return TCL_ERROR;
}
diff --git a/generic/tclDecls.h b/generic/tclDecls.h
index b824e76..d7b2324 100644
--- a/generic/tclDecls.h
+++ b/generic/tclDecls.h
@@ -133,10 +133,7 @@ TCLAPI int Tcl_GetDouble(Tcl_Interp *interp, const char *src,
/* 35 */
TCLAPI int Tcl_GetDoubleFromObj(Tcl_Interp *interp,
Tcl_Obj *objPtr, double *doublePtr);
-/* 36 */
-TCLAPI int Tcl_GetIndexFromObj(Tcl_Interp *interp,
- Tcl_Obj *objPtr, const char *const *tablePtr,
- const char *msg, int flags, int *indexPtr);
+/* Slot 36 is reserved */
/* 37 */
TCLAPI int Tcl_GetInt(Tcl_Interp *interp, const char *src,
int *intPtr);
@@ -1823,7 +1820,7 @@ typedef struct TclStubs {
unsigned char * (*tcl_GetByteArrayFromObj) (Tcl_Obj *objPtr, int *lengthPtr); /* 33 */
int (*tcl_GetDouble) (Tcl_Interp *interp, const char *src, double *doublePtr); /* 34 */
int (*tcl_GetDoubleFromObj) (Tcl_Interp *interp, Tcl_Obj *objPtr, double *doublePtr); /* 35 */
- int (*tcl_GetIndexFromObj) (Tcl_Interp *interp, Tcl_Obj *objPtr, const char *const *tablePtr, const char *msg, int flags, int *indexPtr); /* 36 */
+ void (*reserved36)(void);
int (*tcl_GetInt) (Tcl_Interp *interp, const char *src, int *intPtr); /* 37 */
int (*tcl_GetIntFromObj) (Tcl_Interp *interp, Tcl_Obj *objPtr, int *intPtr); /* 38 */
int (*tcl_GetLongFromObj) (Tcl_Interp *interp, Tcl_Obj *objPtr, long *longPtr); /* 39 */
@@ -2526,8 +2523,7 @@ extern const TclStubs *tclStubsPtr;
(tclStubsPtr->tcl_GetDouble) /* 34 */
#define Tcl_GetDoubleFromObj \
(tclStubsPtr->tcl_GetDoubleFromObj) /* 35 */
-#define Tcl_GetIndexFromObj \
- (tclStubsPtr->tcl_GetIndexFromObj) /* 36 */
+/* Slot 36 is reserved */
#define Tcl_GetInt \
(tclStubsPtr->tcl_GetInt) /* 37 */
#define Tcl_GetIntFromObj \
@@ -3740,7 +3736,9 @@ TCLAPI void Tcl_MainExW(int argc, wchar_t **argv,
Tcl_EvalEx((interp),(objPtr),-1,0)
#define Tcl_GlobalEval(interp,objPtr) \
Tcl_EvalEx((interp),(objPtr),-1,TCL_EVAL_GLOBAL)
-
+#define Tcl_GetIndexFromObj(interp, objPtr, tablePtr, msg, flags, indexPtr) \
+ Tcl_GetIndexFromObjStruct(interp, objPtr, tablePtr, (int)sizeof(char *), \
+ msg, flags, indexPtr)
/*
* Deprecated Tcl procedures:
*/
diff --git a/generic/tclDictObj.c b/generic/tclDictObj.c
index 2bc5f81..e602c9f 100644
--- a/generic/tclDictObj.c
+++ b/generic/tclDictObj.c
@@ -621,7 +621,7 @@ SetDictFromAny(
}
for (i=0 ; i<objc ; i+=2) {
-
+
/* Store key and value in the hash table we're building. */
hPtr = CreateChainEntry(dict, objv[i], &isNew);
if (!isNew) {
@@ -2913,8 +2913,8 @@ DictFilterCmd(
Tcl_WrongNumArgs(interp, 1, objv, "dictionary filterType ?arg ...?");
return TCL_ERROR;
}
- if (Tcl_GetIndexFromObj(interp, objv[2], filters, "filterType",
- 0, &index) != TCL_OK) {
+ if (Tcl_GetIndexFromObjStruct(interp, objv[2], filters,
+ sizeof(char *), "filterType", 0, &index) != TCL_OK) {
return TCL_ERROR;
}
diff --git a/generic/tclEnsemble.c b/generic/tclEnsemble.c
index 88de9f3..821be3f 100644
--- a/generic/tclEnsemble.c
+++ b/generic/tclEnsemble.c
@@ -162,8 +162,8 @@ TclNamespaceEnsembleCmd(
Tcl_WrongNumArgs(interp, 1, objv, "subcommand ?arg ...?");
return TCL_ERROR;
}
- if (Tcl_GetIndexFromObj(interp, objv[1], ensembleSubcommands,
- "subcommand", 0, &index) != TCL_OK) {
+ if (Tcl_GetIndexFromObjStruct(interp, objv[1], ensembleSubcommands,
+ sizeof(char *), "subcommand", 0, &index) != TCL_OK) {
return TCL_ERROR;
}
@@ -207,8 +207,8 @@ TclNamespaceEnsembleCmd(
*/
for (; objc>1 ; objc-=2,objv+=2) {
- if (Tcl_GetIndexFromObj(interp, objv[0], ensembleCreateOptions,
- "option", 0, &index) != TCL_OK) {
+ if (Tcl_GetIndexFromObjStruct(interp, objv[0], ensembleCreateOptions,
+ sizeof(char *), "option", 0, &index) != TCL_OK) {
if (allocatedMapFlag) {
Tcl_DecrRefCount(mapObj);
}
@@ -381,8 +381,8 @@ TclNamespaceEnsembleCmd(
if (objc == 4) {
Tcl_Obj *resultObj = NULL; /* silence gcc 4 warning */
- if (Tcl_GetIndexFromObj(interp, objv[3], ensembleConfigOptions,
- "option", 0, &index) != TCL_OK) {
+ if (Tcl_GetIndexFromObjStruct(interp, objv[3], ensembleConfigOptions,
+ sizeof(char *), "option", 0, &index) != TCL_OK) {
return TCL_ERROR;
}
switch ((enum EnsConfigOpts) index) {
@@ -502,8 +502,8 @@ TclNamespaceEnsembleCmd(
*/
for (; objc>0 ; objc-=2,objv+=2) {
- if (Tcl_GetIndexFromObj(interp, objv[0],ensembleConfigOptions,
- "option", 0, &index) != TCL_OK) {
+ if (Tcl_GetIndexFromObjStruct(interp, objv[0],ensembleConfigOptions,
+ sizeof(char *), "option", 0, &index) != TCL_OK) {
freeMapAndError:
if (allocatedMapFlag) {
Tcl_DecrRefCount(mapObj);
diff --git a/generic/tclEvent.c b/generic/tclEvent.c
index fb5e9c5..85100cb 100644
--- a/generic/tclEvent.c
+++ b/generic/tclEvent.c
@@ -891,7 +891,7 @@ Tcl_SetExitProc(
*----------------------------------------------------------------------
*/
static void
-InvokeExitHandlers(void)
+InvokeExitHandlers(void)
{
ExitHandler *exitPtr;
@@ -967,22 +967,22 @@ Tcl_Exit(
/*
* Fast and deterministic exit (default behavior)
*/
-
+
InvokeExitHandlers();
-
+
/*
* Ensure the thread-specific data is initialised as it is used in
* Tcl_FinalizeThread()
*/
-
+
(void) TCL_TSD_INIT(&dataKey);
-
+
/*
* Now finalize the calling thread only (others are not safely
* reachable). Among other things, this triggers a flush of the
* Tcl_Channels that may have data enqueued.
*/
-
+
Tcl_FinalizeThread();
}
TclpExit(status);
@@ -1094,7 +1094,7 @@ Tcl_Finalize(void)
* Invoke exit handlers first.
*/
- InvokeExitHandlers();
+ InvokeExitHandlers();
TclpInitLock();
if (subsystemsInitialized == 0) {
@@ -1498,8 +1498,8 @@ Tcl_UpdateObjCmd(
if (objc == 1) {
flags = TCL_ALL_EVENTS|TCL_DONT_WAIT;
} else if (objc == 2) {
- if (Tcl_GetIndexFromObj(interp, objv[1], updateOptions,
- "option", 0, &optionIndex) != TCL_OK) {
+ if (Tcl_GetIndexFromObjStruct(interp, objv[1], updateOptions,
+ sizeof(char *), "option", 0, &optionIndex) != TCL_OK) {
return TCL_ERROR;
}
switch ((enum updateOptions) optionIndex) {
diff --git a/generic/tclFCmd.c b/generic/tclFCmd.c
index 33c1496..036a82c 100644
--- a/generic/tclFCmd.c
+++ b/generic/tclFCmd.c
@@ -120,7 +120,7 @@ FileCopyRename(
}
i++;
if ((objc - i) < 2) {
- Tcl_WrongNumArgs(interp, 1, objv,
+ Tcl_WrongNumArgs(interp, 1, objv,
"?-option value ...? source ?source ...? target");
return TCL_ERROR;
}
@@ -831,8 +831,8 @@ FileForceOption(
if (TclGetString(objv[i])[0] != '-') {
break;
}
- if (Tcl_GetIndexFromObj(interp, objv[i], options, "option", TCL_EXACT,
- &idx) != TCL_OK) {
+ if (Tcl_GetIndexFromObjStruct(interp, objv[i], options,
+ sizeof(char *), "option", TCL_EXACT, &idx) != TCL_OK) {
return -1;
}
if (idx == 0 /* -force */) {
@@ -1081,8 +1081,8 @@ TclFileAttrsCmd(
goto end;
}
- if (Tcl_GetIndexFromObj(interp, objv[0], attributeStrings,
- "option", 0, &index) != TCL_OK) {
+ if (Tcl_GetIndexFromObjStruct(interp, objv[0], attributeStrings,
+ sizeof(char *), "option", 0, &index) != TCL_OK) {
goto end;
}
if (attributeStringsAllocated != NULL) {
@@ -1109,8 +1109,8 @@ TclFileAttrsCmd(
}
for (i = 0; i < objc ; i += 2) {
- if (Tcl_GetIndexFromObj(interp, objv[i], attributeStrings,
- "option", 0, &index) != TCL_OK) {
+ if (Tcl_GetIndexFromObjStruct(interp, objv[i], attributeStrings,
+ sizeof(char *), "option", 0, &index) != TCL_OK) {
goto end;
}
if (attributeStringsAllocated != NULL) {
@@ -1199,8 +1199,8 @@ TclFileLinkCmd(
static const char *const linkTypes[] = {
"-symbolic", "-hard", NULL
};
- if (Tcl_GetIndexFromObj(interp, objv[1], linkTypes, "switch", 0,
- &linkAction) != TCL_OK) {
+ if (Tcl_GetIndexFromObjStruct(interp, objv[1], linkTypes,
+ sizeof(char *), "switch", 0, &linkAction) != TCL_OK) {
return TCL_ERROR;
}
if (linkAction == 0) {
diff --git a/generic/tclFileName.c b/generic/tclFileName.c
index a519f0e..847a97a 100644
--- a/generic/tclFileName.c
+++ b/generic/tclFileName.c
@@ -1256,8 +1256,8 @@ Tcl_GlobObjCmd(
dir = PATH_NONE;
typePtr = NULL;
for (i = 1; i < objc; i++) {
- if (Tcl_GetIndexFromObj(interp, objv[i], options, "option", 0,
- &index) != TCL_OK) {
+ if (Tcl_GetIndexFromObjStruct(interp, objv[i], options,
+ sizeof(char *), "option", 0, &index) != TCL_OK) {
string = Tcl_GetStringFromObj(objv[i], &length);
if (string[0] == '-') {
/*
diff --git a/generic/tclIO.c b/generic/tclIO.c
index c9842df..0ba441a 100644
--- a/generic/tclIO.c
+++ b/generic/tclIO.c
@@ -398,11 +398,11 @@ TclFinalizeIOSubsystem(void)
int active = 1; /* Flag == 1 while there's still work to do */
int doflushnb;
- /* Fetch the pre-TIP#398 compatibility flag */
+ /* Fetch the pre-TIP#398 compatibility flag */
{
const char *s;
Tcl_DString ds;
-
+
s = TclGetEnv("TCL_FLUSH_NONBLOCKING_ON_EXIT", &ds);
doflushnb = ((s != NULL) && strcmp(s, "0"));
if (s != NULL) {
@@ -454,9 +454,9 @@ TclFinalizeIOSubsystem(void)
/* Set the channel back into blocking mode to ensure that we wait
* for all data to flush out.
*/
-
+
(void) Tcl_SetChannelOption(NULL, (Tcl_Channel) chanPtr,
- "-blocking", "on");
+ "-blocking", "on");
}
if ((chanPtr == (Channel *) tsdPtr->stdinChannel) ||
@@ -8860,8 +8860,8 @@ Tcl_FileEventObjCmd(
Tcl_WrongNumArgs(interp, 1, objv, "channelId event ?script?");
return TCL_ERROR;
}
- if (Tcl_GetIndexFromObj(interp, objv[2], modeOptions, "event name", 0,
- &modeIndex) != TCL_OK) {
+ if (Tcl_GetIndexFromObjStruct(interp, objv[2], modeOptions,
+ sizeof(char *), "event name", 0, &modeIndex) != TCL_OK) {
return TCL_ERROR;
}
mask = maskArray[modeIndex];
diff --git a/generic/tclIORTrans.c b/generic/tclIORTrans.c
index a4fa9a4..2ab634c 100644
--- a/generic/tclIORTrans.c
+++ b/generic/tclIORTrans.c
@@ -615,8 +615,8 @@ TclChanPushObjCmd(
methods = 0;
while (listc > 0) {
- if (Tcl_GetIndexFromObj(interp, listv[listc-1], methodNames,
- "method", TCL_EXACT, &methIndex) != TCL_OK) {
+ if (Tcl_GetIndexFromObjStruct(interp, listv[listc-1], methodNames,
+ sizeof(char *), "method", TCL_EXACT, &methIndex) != TCL_OK) {
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"chan handler \"%s initialize\" returned %s",
Tcl_GetString(cmdObj),
@@ -943,7 +943,7 @@ ReflectClose(
Tcl_EventuallyFree(rtPtr,
(Tcl_FreeProc *) FreeReflectedTransform);
return errorCode;
- }
+ }
#endif /* TCL_THREADS */
errorCodeSet = 1;
goto cleanup;
@@ -957,7 +957,7 @@ ReflectClose(
Tcl_EventuallyFree(rtPtr,
(Tcl_FreeProc *) FreeReflectedTransform);
return errorCode;
- }
+ }
#endif /* TCL_THREADS */
errorCodeSet = 1;
goto cleanup;
diff --git a/generic/tclIOUtil.c b/generic/tclIOUtil.c
index e0043f5..f325a74 100644
--- a/generic/tclIOUtil.c
+++ b/generic/tclIOUtil.c
@@ -2472,8 +2472,8 @@ TclFSFileAttrIndex(
Tcl_Obj *tmpObj = Tcl_NewStringObj(attributeName, -1);
int result;
- result = Tcl_GetIndexFromObj(NULL, tmpObj, attrTable, NULL, TCL_EXACT,
- indexPtr);
+ result = Tcl_GetIndexFromObjStruct(NULL, tmpObj, attrTable,
+ sizeof(char *), NULL, TCL_EXACT, indexPtr);
TclDecrRefCount(tmpObj);
if (listObj != NULL) {
TclDecrRefCount(listObj);
@@ -3357,7 +3357,7 @@ Tcl_LoadFile(
return retVal;
resolveSymbols:
- /*
+ /*
* At this point, *handlePtr is already set up to the handle for the
* loaded library. We now try to resolve the symbols.
*/
@@ -3366,7 +3366,7 @@ Tcl_LoadFile(
for (i=0 ; symbols[i] != NULL; i++) {
procPtrs[i] = Tcl_FindSymbol(interp, *handlePtr, symbols[i]);
if (procPtrs[i] == NULL) {
- /*
+ /*
* At least one symbol in the list was not found. Unload the
* file, and report the problem back to the caller.
* (Tcl_FindSymbol should already have left an appropriate
@@ -3386,7 +3386,7 @@ Tcl_LoadFile(
*----------------------------------------------------------------------
*
* DivertFindSymbol --
- *
+ *
* Find a symbol in a shared library loaded by copy-from-VFS.
*
*----------------------------------------------------------------------
diff --git a/generic/tclIndexObj.c b/generic/tclIndexObj.c
index 7b85481..0a1f7de 100644
--- a/generic/tclIndexObj.c
+++ b/generic/tclIndexObj.c
@@ -69,74 +69,12 @@ typedef struct {
* The following macros greatly simplify moving through a table...
*/
-#define STRING_AT(table, offset, index) \
- (*((const char *const *)(((char *)(table)) + ((offset) * (index)))))
+#define STRING_AT(table, offset) \
+ (*((const char *const *)(((char *)(table)) + (offset))))
#define NEXT_ENTRY(table, offset) \
- (&(STRING_AT(table, offset, 1)))
+ (&(STRING_AT(table, offset)))
#define EXPAND_OF(indexRep) \
- STRING_AT((indexRep)->tablePtr, (indexRep)->offset, (indexRep)->index)
-
-/*
- *----------------------------------------------------------------------
- *
- * Tcl_GetIndexFromObj --
- *
- * This function looks up an object's value in a table of strings and
- * returns the index of the matching string, if any.
- *
- * Results:
- * If the value of objPtr is identical to or a unique abbreviation for
- * one of the entries in tablePtr, then the return value is TCL_OK and the
- * index of the matching entry is stored at *indexPtr. If there isn't a
- * proper match, then TCL_ERROR is returned and an error message is left
- * in interp's result (unless interp is NULL). The msg argument is used
- * in the error message; for example, if msg has the value "option" then
- * the error message will say something flag 'bad option "foo": must be
- * ...'
- *
- * Side effects:
- * The result of the lookup is cached as the internal rep of objPtr, so
- * that repeated lookups can be done quickly.
- *
- *----------------------------------------------------------------------
- */
-
-int
-Tcl_GetIndexFromObj(
- Tcl_Interp *interp, /* Used for error reporting if not NULL. */
- Tcl_Obj *objPtr, /* Object containing the string to lookup. */
- const char *const*tablePtr, /* Array of strings to compare against the
- * value of objPtr; last entry must be NULL
- * and there must not be duplicate entries. */
- const char *msg, /* Identifying word to use in error
- * messages. */
- int flags, /* 0 or TCL_EXACT */
- int *indexPtr) /* Place to store resulting integer index. */
-{
-
- /*
- * See if there is a valid cached result from a previous lookup (doing the
- * check here saves the overhead of calling Tcl_GetIndexFromObjStruct in
- * the common case where the result is cached).
- */
-
- if (objPtr->typePtr == &indexType) {
- IndexRep *indexRep = objPtr->internalRep.otherValuePtr;
-
- /*
- * Here's hoping we don't get hit by unfortunate packing constraints
- * on odd platforms like a Cray PVP...
- */
-
- if (indexRep->tablePtr == (void *) tablePtr
- && indexRep->offset == sizeof(char *)) {
- *indexPtr = indexRep->index;
- return TCL_OK;
- }
- }
- return Tcl_GetIndexFromObjStruct(interp, objPtr, tablePtr, sizeof(char *),
- msg, flags, indexPtr);
-}
+ STRING_AT((indexRep)->tablePtr, (indexRep)->offset*(indexRep)->index)
/*
*----------------------------------------------------------------------
@@ -238,7 +176,7 @@ GetIndexFromObjList(
* a proper match, then TCL_ERROR is returned and an error message is
* left in interp's result (unless interp is NULL). The msg argument is
* used in the error message; for example, if msg has the value "option"
- * then the error message will say something flag 'bad option "foo": must
+ * then the error message will say something like 'bad option "foo": must
* be ...'
*
* Side effects:
@@ -270,6 +208,10 @@ Tcl_GetIndexFromObjStruct(
Tcl_Obj *resultPtr;
IndexRep *indexRep;
+ /* Protect against invalid values, like -1 or 0. */
+ if (offset < (int)sizeof(char *)) {
+ offset = (int)sizeof(char *);
+ }
/*
* See if there is a valid cached result from a previous lookup.
*/
@@ -587,8 +529,8 @@ PrefixMatchObjCmd(
}
for (i = 1; i < (objc - 2); i++) {
- if (Tcl_GetIndexFromObj(interp, objv[i], matchOptions, "option", 0,
- &index) != TCL_OK) {
+ if (Tcl_GetIndexFromObjStruct(interp, objv[i], matchOptions,
+ sizeof(char *), "option", 0, &index) != TCL_OK) {
return TCL_ERROR;
}
switch ((enum matchOptions) index) {
@@ -1460,8 +1402,8 @@ TclGetCompletionCodeFromObj(
&& TclGetIntFromObj(NULL, value, codePtr) == TCL_OK) {
return TCL_OK;
}
- if (Tcl_GetIndexFromObj(NULL, value, returnCodes, NULL, TCL_EXACT,
- codePtr) == TCL_OK) {
+ if (Tcl_GetIndexFromObjStruct(NULL, value, returnCodes,
+ sizeof(char *), NULL, TCL_EXACT, codePtr) == TCL_OK) {
return TCL_OK;
}
diff --git a/generic/tclNamesp.c b/generic/tclNamesp.c
index 03e34bd..0e84dbf 100644
--- a/generic/tclNamesp.c
+++ b/generic/tclNamesp.c
@@ -343,7 +343,7 @@ Tcl_PushCallFrame(
framePtr->clientData = NULL;
framePtr->localCachePtr = NULL;
framePtr->tailcallPtr = NULL;
-
+
/*
* Push the new call frame onto the interpreter's stack of procedure call
* frames making it the current frame.
@@ -3025,7 +3025,7 @@ NamespaceCodeCmd(
*/
arg = TclGetStringFromObj(objv[1], &length);
- if (*arg==':' && length > 20
+ if (*arg==':' && length > 20
&& strncmp(arg, "::namespace inscope ", 20) == 0) {
Tcl_SetObjResult(interp, objv[1]);
return TCL_OK;
@@ -4570,8 +4570,8 @@ NamespaceWhichCmd(
* Look for a flag controlling the lookup.
*/
- if (Tcl_GetIndexFromObj(interp, objv[1], opts, "option", 0,
- &lookupType) != TCL_OK) {
+ if (Tcl_GetIndexFromObjStruct(interp, objv[1], opts,
+ sizeof(char *), "option", 0, &lookupType) != TCL_OK) {
/*
* Preserve old style of error message!
*/
@@ -4918,7 +4918,7 @@ TclLogCommandInfo(
if (Tcl_IsShared(iPtr->errorStack)) {
Tcl_Obj *newObj;
-
+
newObj = Tcl_DuplicateObj(iPtr->errorStack);
Tcl_DecrRefCount(iPtr->errorStack);
Tcl_IncrRefCount(newObj);
@@ -4950,7 +4950,7 @@ TclLogCommandInfo(
Tcl_ListObjAppendElement(NULL, iPtr->errorStack,
Tcl_NewStringObj(command, length));
}
- }
+ }
if (!iPtr->framePtr->objc) {
/*
@@ -5003,7 +5003,7 @@ TclErrorStackResetIf(
if (Tcl_IsShared(iPtr->errorStack)) {
Tcl_Obj *newObj;
-
+
newObj = Tcl_DuplicateObj(iPtr->errorStack);
Tcl_DecrRefCount(iPtr->errorStack);
Tcl_IncrRefCount(newObj);
@@ -5023,7 +5023,7 @@ TclErrorStackResetIf(
Tcl_ListObjAppendElement(NULL, iPtr->errorStack, iPtr->innerLiteral);
Tcl_ListObjAppendElement(NULL, iPtr->errorStack,
Tcl_NewStringObj(msg, length));
- }
+ }
}
/*
diff --git a/generic/tclOOBasic.c b/generic/tclOOBasic.c
index 0676618..a2a72e7 100644
--- a/generic/tclOOBasic.c
+++ b/generic/tclOOBasic.c
@@ -979,8 +979,8 @@ TclOOSelfObjCmd(
return TCL_ERROR;
} else if (objc == 1) {
index = SELF_OBJECT;
- } else if (Tcl_GetIndexFromObj(interp, objv[1], subcmds, "subcommand", 0,
- &index) != TCL_OK) {
+ } else if (Tcl_GetIndexFromObjStruct(interp, objv[1], subcmds,
+ sizeof(char *), "subcommand", 0, &index) != TCL_OK) {
return TCL_ERROR;
}
diff --git a/generic/tclProc.c b/generic/tclProc.c
index 933e7d2..8630359 100644
--- a/generic/tclProc.c
+++ b/generic/tclProc.c
@@ -2881,7 +2881,8 @@ Tcl_DisassembleObjCmd(
Tcl_WrongNumArgs(interp, 1, objv, "type ...");
return TCL_ERROR;
}
- if (Tcl_GetIndexFromObj(interp, objv[1], types, "type", 0, &idx)!=TCL_OK){
+ if (Tcl_GetIndexFromObjStruct(interp, objv[1], types,
+ sizeof(char *), "type", 0, &idx) != TCL_OK){
return TCL_ERROR;
}
diff --git a/generic/tclStubInit.c b/generic/tclStubInit.c
index eb9cd95..7a4b0c0 100644
--- a/generic/tclStubInit.c
+++ b/generic/tclStubInit.c
@@ -690,7 +690,7 @@ const TclStubs tclStubs = {
Tcl_GetByteArrayFromObj, /* 33 */
Tcl_GetDouble, /* 34 */
Tcl_GetDoubleFromObj, /* 35 */
- Tcl_GetIndexFromObj, /* 36 */
+ 0, /* 36 */
Tcl_GetInt, /* 37 */
Tcl_GetIntFromObj, /* 38 */
Tcl_GetLongFromObj, /* 39 */
diff --git a/generic/tclTest.c b/generic/tclTest.c
index 8575658..54862f1 100644
--- a/generic/tclTest.c
+++ b/generic/tclTest.c
@@ -680,8 +680,8 @@ Tcltest_Init(
if (Tcl_ListObjGetElements(interp, listPtr, &objc, &objv) != TCL_OK) {
return TCL_ERROR;
}
- if (objc && (Tcl_GetIndexFromObj(NULL, objv[0], specialOptions, NULL,
- TCL_EXACT, &index) == TCL_OK)) {
+ if (objc && (Tcl_GetIndexFromObjStruct(NULL, objv[0], specialOptions,
+ sizeof(char *), NULL, TCL_EXACT, &index) == TCL_OK)) {
switch (index) {
case 0:
return TCL_ERROR;
@@ -885,7 +885,7 @@ TestasyncCmd(
static int
AsyncHandlerProc(
- ClientData clientData, /* If of TestAsyncHandler structure.
+ ClientData clientData, /* If of TestAsyncHandler structure.
* in global list. */
Tcl_Interp *interp, /* Interpreter in which command was
* executed, or NULL. */
@@ -1693,8 +1693,8 @@ TestdoubledigitsObjCmd(ClientData unused,
}
if (status != TCL_OK
|| Tcl_GetIntFromObj(interp, objv[2], &ndigits) != TCL_OK
- || Tcl_GetIndexFromObj(interp, objv[3], options, "conversion type",
- TCL_EXACT, &type) != TCL_OK) {
+ || Tcl_GetIndexFromObjStruct(interp, objv[3], options,
+ sizeof(char *), "conversion type", TCL_EXACT, &type) != TCL_OK) {
fprintf(stderr, "bad value? %g\n", d);
return TCL_ERROR;
}
@@ -1880,8 +1880,8 @@ TestencodingObjCmd(
ENC_CREATE, ENC_DELETE
};
- if (Tcl_GetIndexFromObj(interp, objv[1], optionStrings, "option", 0,
- &index) != TCL_OK) {
+ if (Tcl_GetIndexFromObjStruct(interp, objv[1], optionStrings,
+ sizeof(char *), "option", 0, &index) != TCL_OK) {
return TCL_ERROR;
}
@@ -2140,8 +2140,8 @@ TesteventObjCmd(
Tcl_WrongNumArgs(interp, 1, objv, "subcommand ?arg ...?");
return TCL_ERROR;
}
- if (Tcl_GetIndexFromObj(interp, objv[1], subcommands, "subcommand",
- TCL_EXACT, &subCmdIndex) != TCL_OK) {
+ if (Tcl_GetIndexFromObjStruct(interp, objv[1], subcommands,
+ sizeof(char *), "subcommand", TCL_EXACT, &subCmdIndex) != TCL_OK) {
return TCL_ERROR;
}
switch (subCmdIndex) {
@@ -2150,8 +2150,8 @@ TesteventObjCmd(
Tcl_WrongNumArgs(interp, 2, objv, "name position script");
return TCL_ERROR;
}
- if (Tcl_GetIndexFromObj(interp, objv[3], positions,
- "position specifier", TCL_EXACT, &posIndex) != TCL_OK) {
+ if (Tcl_GetIndexFromObjStruct(interp, objv[3], positions,
+ sizeof(char *), "position specifier", TCL_EXACT, &posIndex) != TCL_OK) {
return TCL_ERROR;
}
ev = ckalloc(sizeof(TestEvent));
@@ -3254,8 +3254,8 @@ TestlocaleCmd(
return TCL_ERROR;
}
- if (Tcl_GetIndexFromObj(interp, objv[1], optionStrings, "option", 0,
- &index) != TCL_OK) {
+ if (Tcl_GetIndexFromObjStruct(interp, objv[1], optionStrings,
+ sizeof(char *), "option", 0, &index) != TCL_OK) {
return TCL_ERROR;
}
@@ -3662,8 +3662,8 @@ TestregexpObjCmd(
if (name[0] != '-') {
break;
}
- if (Tcl_GetIndexFromObj(interp, objv[i], options, "switch", TCL_EXACT,
- &index) != TCL_OK) {
+ if (Tcl_GetIndexFromObjStruct(interp, objv[i], options,
+ sizeof(char *), "switch", TCL_EXACT, &index) != TCL_OK) {
return TCL_ERROR;
}
switch ((enum options) index) {
@@ -4880,8 +4880,8 @@ TestsaveresultCmd(
Tcl_WrongNumArgs(interp, 1, objv, "type script discard");
return TCL_ERROR;
}
- if (Tcl_GetIndexFromObj(interp, objv[1], optionStrings, "option", 0,
- &index) != TCL_OK) {
+ if (Tcl_GetIndexFromObjStruct(interp, objv[1], optionStrings,
+ sizeof(char *), "option", 0, &index) != TCL_OK) {
return TCL_ERROR;
}
if (Tcl_GetBooleanFromObj(interp, objv[3], &discard) != TCL_OK) {
@@ -7158,8 +7158,8 @@ TestInterpResolverCmd(
Tcl_WrongNumArgs(interp, 1, objv, "up|down");
return TCL_ERROR;
}
- if (Tcl_GetIndexFromObj(interp, objv[1], table, "operation", TCL_EXACT,
- &idx) != TCL_OK) {
+ if (Tcl_GetIndexFromObjStruct(interp, objv[1], table,
+ sizeof(char *), "operation", TCL_EXACT, &idx) != TCL_OK) {
return TCL_ERROR;
}
switch (idx) {
diff --git a/generic/tclTestObj.c b/generic/tclTestObj.c
index e61f809..bc1834f 100644
--- a/generic/tclTestObj.c
+++ b/generic/tclTestObj.c
@@ -172,8 +172,8 @@ TestbignumobjCmd(
Tcl_WrongNumArgs(interp, 1, objv, "option ?arg ...?");
return TCL_ERROR;
}
- if (Tcl_GetIndexFromObj(interp, objv[1], subcmds, "option", 0,
- &index) != TCL_OK) {
+ if (Tcl_GetIndexFromObjStruct(interp, objv[1], subcmds,
+ sizeof(char *), "option", 0, &index) != TCL_OK) {
return TCL_ERROR;
}
string = Tcl_GetString(objv[2]);
@@ -554,11 +554,12 @@ TestindexobjCmd(
return TCL_ERROR;
}
- Tcl_GetIndexFromObj(NULL, objv[1], tablePtr, "token", 0, &index);
+ Tcl_GetIndexFromObjStruct(NULL, objv[1], tablePtr,
+ sizeof(char *), "token", 0, &index);
indexRep = objv[1]->internalRep.otherValuePtr;
indexRep->index = index2;
- result = Tcl_GetIndexFromObj(NULL, objv[1],
- tablePtr, "token", 0, &index);
+ result = Tcl_GetIndexFromObjStruct(NULL, objv[1],
+ tablePtr, sizeof(char *), "token", 0, &index);
if (result == TCL_OK) {
Tcl_SetIntObj(Tcl_GetObjResult(interp), index);
}
@@ -598,8 +599,8 @@ TestindexobjCmd(
}
}
- result = Tcl_GetIndexFromObj((setError? interp : NULL), objv[3],
- argv, "token", (allowAbbrev? 0 : TCL_EXACT), &index);
+ result = Tcl_GetIndexFromObjStruct((setError? interp : NULL), objv[3],
+ argv, sizeof(char *), "token", (allowAbbrev? 0 : TCL_EXACT), &index);
ckfree(argv);
if (result == TCL_OK) {
Tcl_SetIntObj(Tcl_GetObjResult(interp), index);
@@ -864,8 +865,8 @@ TestlistobjCmd(
if (GetVariableIndex(interp, index, &varIndex) != TCL_OK) {
return TCL_ERROR;
}
- if (Tcl_GetIndexFromObj(interp, objv[1], subcommands, "command",
- 0, &cmdIndex) != TCL_OK) {
+ if (Tcl_GetIndexFromObjStruct(interp, objv[1], subcommands,
+ sizeof(char *), "command", 0, &cmdIndex) != TCL_OK) {
return TCL_ERROR;
}
switch(cmdIndex) {
@@ -1161,8 +1162,8 @@ TeststringobjCmd(
return TCL_ERROR;
}
- if (Tcl_GetIndexFromObj(interp, objv[1], options, "option", 0, &option)
- != TCL_OK) {
+ if (Tcl_GetIndexFromObjStruct(interp, objv[1], options,
+ sizeof(char *), "option", 0, &option) != TCL_OK) {
return TCL_ERROR;
}
switch (option) {
diff --git a/generic/tclTimer.c b/generic/tclTimer.c
index 735c54a..c5f11c9 100644
--- a/generic/tclTimer.c
+++ b/generic/tclTimer.c
@@ -823,8 +823,8 @@ Tcl_AfterObjCmd(
|| objv[1]->typePtr == &tclWideIntType
#endif
|| objv[1]->typePtr == &tclBignumType
- || (Tcl_GetIndexFromObj(NULL, objv[1], afterSubCmds, "", 0,
- &index) != TCL_OK)) {
+ || (Tcl_GetIndexFromObjStruct(NULL, objv[1], afterSubCmds,
+ sizeof(char *), "", 0, &index) != TCL_OK)) {
index = -1;
if (Tcl_GetWideIntFromObj(NULL, objv[1], &ms) != TCL_OK) {
const char *arg = Tcl_GetString(objv[1]);
diff --git a/generic/tclVar.c b/generic/tclVar.c
index 22f6fb8..3c5ee15 100644
--- a/generic/tclVar.c
+++ b/generic/tclVar.c
@@ -2106,7 +2106,7 @@ TclPtrIncrObjVar(
if (Tcl_IsShared(varValuePtr)) {
/* Copy on write */
varValuePtr = Tcl_DuplicateObj(varValuePtr);
-
+
if (TCL_OK == TclIncrObj(interp, varValuePtr, incrPtr)) {
return TclPtrSetVar(interp, varPtr, arrayPtr, part1Ptr, part2Ptr,
varValuePtr, flags, index);
@@ -3729,8 +3729,8 @@ ArrayNamesCmd(
* Finish parsing the arguments.
*/
- if ((objc == 4) && Tcl_GetIndexFromObj(interp, objv[2], options, "option",
- 0, &mode) != TCL_OK) {
+ if ((objc == 4) && Tcl_GetIndexFromObjStruct(interp, objv[2], options,
+ sizeof(char *), "option", 0, &mode) != TCL_OK) {
return TCL_ERROR;
}
@@ -4372,7 +4372,7 @@ TclPtrMakeUpvar(
}
/* Callers must Incr myNamePtr if they plan to Decr it. */
-
+
int
TclPtrObjMakeUpvar(
Tcl_Interp *interp, /* Interpreter containing variables. Used for