summaryrefslogtreecommitdiffstats
path: root/generic/tclIndexObj.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2022-04-11 11:20:09 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2022-04-11 11:20:09 (GMT)
commit54ee71bc1207b883cec010d1f5acb60b08a8cc7b (patch)
treea10fd719299ff5d128949cfc4733e88742ed6940 /generic/tclIndexObj.c
parent142a7645bb9c38692513ce5aaefe2ccbd1a9e02a (diff)
parentce8fc8dc1e031e8dd27cd9196f299ecb1e21317f (diff)
downloadtcl-54ee71bc1207b883cec010d1f5acb60b08a8cc7b.zip
tcl-54ee71bc1207b883cec010d1f5acb60b08a8cc7b.tar.gz
tcl-54ee71bc1207b883cec010d1f5acb60b08a8cc7b.tar.bz2
Merge 9.0. Eliminate almost all remaining (enum) casts
Diffstat (limited to 'generic/tclIndexObj.c')
-rw-r--r--generic/tclIndexObj.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/generic/tclIndexObj.c b/generic/tclIndexObj.c
index c989313..c369827 100644
--- a/generic/tclIndexObj.c
+++ b/generic/tclIndexObj.c
@@ -360,6 +360,9 @@ Tcl_GetIndexFromObjStruct(
}
return TCL_ERROR;
}
+/* #define again, needed below */
+#define Tcl_GetIndexFromObjStruct(interp, objPtr, tablePtr, offset, msg, flags, indexPtr) \
+ ((Tcl_GetIndexFromObjStruct)((interp), (objPtr), (tablePtr), (offset), (msg), (flags)|(int)(sizeof(*(indexPtr))<<8), (indexPtr)))
/*
*----------------------------------------------------------------------
@@ -504,7 +507,7 @@ PrefixMatchObjCmd(
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
{
- int flags = 0, result, index;
+ int flags = 0, result, dummy;
int dummyLength, i, errorLength;
Tcl_Obj *errorPtr = NULL;
const char *message = "option";
@@ -514,7 +517,7 @@ PrefixMatchObjCmd(
};
enum matchOptionsEnum {
PRFMATCH_ERROR, PRFMATCH_EXACT, PRFMATCH_MESSAGE
- };
+ } index;
if (objc < 3) {
Tcl_WrongNumArgs(interp, 1, objv, "?options? table string");
@@ -526,7 +529,7 @@ PrefixMatchObjCmd(
sizeof(char *), "option", 0, &index) != TCL_OK) {
return TCL_ERROR;
}
- switch ((enum matchOptionsEnum) index) {
+ switch (index) {
case PRFMATCH_EXACT:
flags |= TCL_EXACT;
break;
@@ -578,7 +581,7 @@ PrefixMatchObjCmd(
}
result = GetIndexFromObjList(interp, objPtr, tablePtr, message, flags,
- &index);
+ &dummy);
if (result != TCL_OK) {
if (errorPtr != NULL && errorLength == 0) {
Tcl_ResetResult(interp);
@@ -597,7 +600,7 @@ PrefixMatchObjCmd(
return Tcl_SetReturnOptions(interp, errorPtr);
}
- result = Tcl_ListObjIndex(interp, tablePtr, index, &resultPtr);
+ result = Tcl_ListObjIndex(interp, tablePtr, dummy, &resultPtr);
if (result != TCL_OK) {
return result;
}