diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2020-05-14 09:46:54 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2020-05-14 09:46:54 (GMT) |
commit | 9a6cdd9be6aa2fb159419ae767c51a86761d693a (patch) | |
tree | 86704418da067f040cd949bb5bdc0add5449c8fc /generic/tclCompCmdsSZ.c | |
parent | 3f8145ca1c49d7260a2552a38703a49898a85442 (diff) | |
parent | cb69b3c14d6b8f89baa9ab46581c70dbb6a316ea (diff) | |
download | tcl-9a6cdd9be6aa2fb159419ae767c51a86761d693a.zip tcl-9a6cdd9be6aa2fb159419ae767c51a86761d693a.tar.gz tcl-9a6cdd9be6aa2fb159419ae767c51a86761d693a.tar.bz2 |
In some places, Tcl_UtfPrev()/Tcl_UtfNext() is used traversing the individual bytes of a string searching for '(', ')', '::' or other single bytes. It is overkill to use Tcl_UtfPrev/Tcl_UtfNext for that, since those characters can only appear as their ASCII byte, not as any other sequence.
This effectively removes the last Tcl_UtfNext() call from the core, the only ones left are in tclTest.c for test commands. So the TclUtfNext() macro doesn't make sense any more.
Remove "register" keyword from many files.
Diffstat (limited to 'generic/tclCompCmdsSZ.c')
-rw-r--r-- | generic/tclCompCmdsSZ.c | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/generic/tclCompCmdsSZ.c b/generic/tclCompCmdsSZ.c index 1ce4582..31e2c88 100644 --- a/generic/tclCompCmdsSZ.c +++ b/generic/tclCompCmdsSZ.c @@ -135,9 +135,9 @@ TclCompileSetCmd( * compiled. */ CompileEnv *envPtr) /* Holds resulting instructions. */ { + DefineLineInformation; /* TIP #280 */ Tcl_Token *varTokenPtr, *valueTokenPtr; int isAssignment, isScalar, localIndex, numWords; - DefineLineInformation; /* TIP #280 */ numWords = parsePtr->numWords; if ((numWords != 2) && (numWords != 3)) { @@ -229,10 +229,10 @@ TclCompileStringCatCmd( * compiled. */ CompileEnv *envPtr) /* Holds resulting instructions. */ { + DefineLineInformation; /* TIP #280 */ int i, numWords = parsePtr->numWords, numArgs; Tcl_Token *wordTokenPtr; Tcl_Obj *obj, *folded; - DefineLineInformation; /* TIP #280 */ /* Trivial case, no arg */ @@ -996,8 +996,8 @@ TclCompileStringReplaceCmd( * compiled. */ CompileEnv *envPtr) /* Holds the resulting instructions. */ { - Tcl_Token *tokenPtr, *valueTokenPtr; DefineLineInformation; /* TIP #280 */ + Tcl_Token *tokenPtr, *valueTokenPtr; int first, last; if (parsePtr->numWords < 4 || parsePtr->numWords > 5) { @@ -1403,13 +1403,13 @@ TclCompileSubstCmd( * compiled. */ CompileEnv *envPtr) /* Holds resulting instructions. */ { + DefineLineInformation; /* TIP #280 */ int numArgs = parsePtr->numWords - 1; int numOpts = numArgs - 1; int objc, flags = TCL_SUBST_ALL; Tcl_Obj **objv/*, *toSubst = NULL*/; Tcl_Token *wordTokenPtr = TokenAfter(parsePtr->tokenPtr); int code = TCL_ERROR; - DefineLineInformation; /* TIP #280 */ if (numArgs == 0) { return TCL_ERROR; @@ -1736,6 +1736,7 @@ TclCompileSwitchCmd( * compiled. */ CompileEnv *envPtr) /* Holds resulting instructions. */ { + DefineLineInformation; /* TIP #280 */ Tcl_Token *tokenPtr; /* Pointer to tokens in command. */ int numWords; /* Number of words in command. */ @@ -1752,7 +1753,6 @@ TclCompileSwitchCmd( int foundMode = 0; /* Have we seen a mode flag yet? */ int i, valueIndex; int result = TCL_ERROR; - DefineLineInformation; /* TIP #280 */ int *clNext = envPtr->clNext; /* @@ -1800,8 +1800,8 @@ TclCompileSwitchCmd( */ for (; numWords>=3 ; tokenPtr=TokenAfter(tokenPtr),numWords--) { - register unsigned size = tokenPtr[1].size; - register const char *chrs = tokenPtr[1].start; + unsigned size = tokenPtr[1].size; + const char *chrs = tokenPtr[1].start; /* * We only process literal options, and we assume that -e, -g and -n @@ -2540,7 +2540,7 @@ PrintJumptableInfo( ByteCode *codePtr, unsigned int pcOffset) { - register JumptableInfo *jtPtr = clientData; + JumptableInfo *jtPtr = clientData; Tcl_HashEntry *hPtr; Tcl_HashSearch search; const char *keyPtr; @@ -2569,7 +2569,7 @@ DisassembleJumptableInfo( ByteCode *codePtr, unsigned int pcOffset) { - register JumptableInfo *jtPtr = clientData; + JumptableInfo *jtPtr = clientData; Tcl_Obj *mapping = Tcl_NewObj(); Tcl_HashEntry *hPtr; Tcl_HashSearch search; @@ -3574,9 +3574,9 @@ TclCompileUnsetCmd( * compiled. */ CompileEnv *envPtr) /* Holds resulting instructions. */ { + DefineLineInformation; /* TIP #280 */ Tcl_Token *varTokenPtr; int isScalar, localIndex, flags = 1, i, varCount = 0, haveFlags = 0; - DefineLineInformation; /* TIP #280 */ /* TODO: Consider support for compiling expanded args. */ @@ -3712,13 +3712,13 @@ TclCompileWhileCmd( * compiled. */ CompileEnv *envPtr) /* Holds resulting instructions. */ { + DefineLineInformation; /* TIP #280 */ Tcl_Token *testTokenPtr, *bodyTokenPtr; JumpFixup jumpEvalCondFixup; int testCodeOffset, bodyCodeOffset, jumpDist, range, code, boolVal; int loopMayEnd = 1; /* This is set to 0 if it is recognized as an * infinite loop. */ Tcl_Obj *boolObj; - DefineLineInformation; /* TIP #280 */ if (parsePtr->numWords != 3) { return TCL_ERROR; @@ -3976,8 +3976,8 @@ CompileUnaryOpCmd( int instruction, CompileEnv *envPtr) { - Tcl_Token *tokenPtr; DefineLineInformation; /* TIP #280 */ + Tcl_Token *tokenPtr; if (parsePtr->numWords != 2) { return TCL_ERROR; @@ -4018,8 +4018,8 @@ CompileAssociativeBinaryOpCmd( int instruction, CompileEnv *envPtr) { - Tcl_Token *tokenPtr = parsePtr->tokenPtr; DefineLineInformation; /* TIP #280 */ + Tcl_Token *tokenPtr = parsePtr->tokenPtr; int words; /* TODO: Consider support for compiling expanded args. */ @@ -4103,8 +4103,8 @@ CompileComparisonOpCmd( int instruction, CompileEnv *envPtr) { - Tcl_Token *tokenPtr; DefineLineInformation; /* TIP #280 */ + Tcl_Token *tokenPtr; /* TODO: Consider support for compiling expanded args. */ if (parsePtr->numWords < 3) { @@ -4265,15 +4265,15 @@ TclCompilePowOpCmd( * compiled. */ CompileEnv *envPtr) { + DefineLineInformation; /* TIP #280 */ + Tcl_Token *tokenPtr = parsePtr->tokenPtr; + int words; + /* * This one has its own implementation because the ** operator is the only * one with right associativity. */ - Tcl_Token *tokenPtr = parsePtr->tokenPtr; - DefineLineInformation; /* TIP #280 */ - int words; - for (words=1 ; words<parsePtr->numWords ; words++) { tokenPtr = TokenAfter(tokenPtr); CompileWord(envPtr, tokenPtr, interp, words); @@ -4440,8 +4440,8 @@ TclCompileMinusOpCmd( * compiled. */ CompileEnv *envPtr) { - Tcl_Token *tokenPtr = parsePtr->tokenPtr; DefineLineInformation; /* TIP #280 */ + Tcl_Token *tokenPtr = parsePtr->tokenPtr; int words; /* TODO: Consider support for compiling expanded args. */ @@ -4486,8 +4486,8 @@ TclCompileDivOpCmd( * compiled. */ CompileEnv *envPtr) { - Tcl_Token *tokenPtr = parsePtr->tokenPtr; DefineLineInformation; /* TIP #280 */ + Tcl_Token *tokenPtr = parsePtr->tokenPtr; int words; /* TODO: Consider support for compiling expanded args. */ |