diff options
Diffstat (limited to 'generic/tclCmdMZ.c')
-rw-r--r-- | generic/tclCmdMZ.c | 36 |
1 files changed, 16 insertions, 20 deletions
diff --git a/generic/tclCmdMZ.c b/generic/tclCmdMZ.c index 534a5ae..a584d47 100644 --- a/generic/tclCmdMZ.c +++ b/generic/tclCmdMZ.c @@ -141,7 +141,7 @@ Tcl_RegexpObjCmd( REGEXP_ALL, REGEXP_ABOUT, REGEXP_INDICES, REGEXP_INLINE, REGEXP_EXPANDED,REGEXP_LINE, REGEXP_LINESTOP,REGEXP_LINEANCHOR, REGEXP_NOCASE, REGEXP_START, REGEXP_LAST - }; + } index; indices = 0; about = 0; @@ -152,7 +152,6 @@ Tcl_RegexpObjCmd( for (i = 1; i < objc; i++) { const char *name; - int index; name = TclGetString(objv[i]); if (name[0] != '-') { @@ -162,7 +161,7 @@ Tcl_RegexpObjCmd( &index) != TCL_OK) { goto optionError; } - switch ((enum regexpoptions) index) { + switch (index) { case REGEXP_ALL: all = 1; break; @@ -504,7 +503,7 @@ Tcl_RegsubObjCmd( REGSUB_ALL, REGSUB_COMMAND, REGSUB_EXPANDED, REGSUB_LINE, REGSUB_LINESTOP, REGSUB_LINEANCHOR, REGSUB_NOCASE, REGSUB_START, REGSUB_LAST - }; + } index; cflags = TCL_REG_ADVANCED; all = 0; @@ -514,7 +513,6 @@ Tcl_RegsubObjCmd( for (idx = 1; idx < (size_t)objc; idx++) { const char *name; - int index; name = TclGetString(objv[idx]); if (name[0] != '-') { @@ -524,7 +522,7 @@ Tcl_RegsubObjCmd( TCL_EXACT, &index) != TCL_OK) { goto optionError; } - switch ((enum regsubobjoptions) index) { + switch (index) { case REGSUB_ALL: all = 1; break; @@ -1525,7 +1523,7 @@ StringIsCmd( { const char *string1, *end, *stop; int (*chcomp)(int) = NULL; /* The UniChar comparison function. */ - int i, result = 1, strict = 0, index, length3; + int i, result = 1, strict = 0, length3; size_t failat = 0; size_t length1, length2; Tcl_Obj *objPtr, *failVarObj = NULL; @@ -1546,13 +1544,13 @@ StringIsCmd( STR_IS_LIST, STR_IS_LOWER, STR_IS_PRINT, STR_IS_PUNCT, STR_IS_SPACE, STR_IS_TRUE, STR_IS_UPPER, STR_IS_UNICODE, STR_IS_WIDE, STR_IS_WORD, STR_IS_XDIGIT - }; + } index; static const char *const isOptions[] = { "-strict", "-failindex", NULL }; enum isOptionsEnum { OPT_STRICT, OPT_FAILIDX - }; + } idx2; if (objc < 3 || objc > 6) { Tcl_WrongNumArgs(interp, 1, objv, @@ -1566,13 +1564,11 @@ StringIsCmd( if (objc != 3) { for (i = 2; i < objc-1; i++) { - int idx2; - if (Tcl_GetIndexFromObj(interp, objv[i], isOptions, "option", 0, &idx2) != TCL_OK) { return TCL_ERROR; } - switch ((enum isOptionsEnum) idx2) { + switch (idx2) { case OPT_STRICT: strict = 1; break; @@ -1601,7 +1597,7 @@ StringIsCmd( * When entering here, result == 1 and failat == 0. */ - switch ((enum isClassesEnum) index) { + switch (index) { case STR_IS_ALNUM: chcomp = Tcl_UniCharIsAlnum; break; @@ -3426,7 +3422,7 @@ TclNRSwitchObjCmd( int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { - int i, index, mode, foundmode, splitObjs, numMatchesSaved; + int i, mode, foundmode, splitObjs, numMatchesSaved; int noCase; size_t patternLength, j; const char *pattern; @@ -3452,7 +3448,7 @@ TclNRSwitchObjCmd( enum switchOptionsEnum { OPT_EXACT, OPT_GLOB, OPT_INDEXV, OPT_MATCHV, OPT_NOCASE, OPT_REGEXP, OPT_LAST - }; + } index; typedef int (*strCmpFn_t)(const char *, const char *); strCmpFn_t strCmpFn = TclUtfCmp; @@ -3470,7 +3466,7 @@ TclNRSwitchObjCmd( &index) != TCL_OK) { return TCL_ERROR; } - switch ((enum switchOptionsEnum) index) { + switch (index) { /* * General options. */ @@ -4143,7 +4139,7 @@ Tcl_TimeRateObjCmd( ByteCode *codePtr = NULL; for (i = 1; i < objc - 1; i++) { - int index; + enum timeRateOptionsEnum index; if (Tcl_GetIndexFromObj(NULL, objv[i], options, "option", TCL_EXACT, &index) != TCL_OK) { @@ -4153,7 +4149,7 @@ Tcl_TimeRateObjCmd( i++; break; } - switch ((enum timeRateOptionsEnum)index) { + switch (index) { case TMRT_EV_DIRECT: direct = objv[i]; break; @@ -4692,7 +4688,7 @@ TclNRTryObjCmd( bodyShared = 0; haveHandlers = 0; for (i=2 ; i<objc ; i++) { - int type; + enum Handlers type; Tcl_Obj *info[5]; if (Tcl_GetIndexFromObj(interp, objv[i], handlerNames, "handler type", @@ -4700,7 +4696,7 @@ TclNRTryObjCmd( Tcl_DecrRefCount(handlersObj); return TCL_ERROR; } - switch ((enum Handlers) type) { + switch (type) { case TryFinally: /* finally script */ if (i < objc-2) { Tcl_SetObjResult(interp, Tcl_NewStringObj( |