summaryrefslogtreecommitdiffstats
path: root/generic/tclCompCmdsSZ.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2020-05-14 09:46:54 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2020-05-14 09:46:54 (GMT)
commit04cc75b6f5e3fd31abae4090243d20e965f9d4e4 (patch)
tree86704418da067f040cd949bb5bdc0add5449c8fc /generic/tclCompCmdsSZ.c
parent320e9f1a3cd1bdde8e8d13e542c8d71ea595b780 (diff)
parent683756c1bdcc1745f0953b26f798154e1fdff5a1 (diff)
downloadtcl-04cc75b6f5e3fd31abae4090243d20e965f9d4e4.zip
tcl-04cc75b6f5e3fd31abae4090243d20e965f9d4e4.tar.gz
tcl-04cc75b6f5e3fd31abae4090243d20e965f9d4e4.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.c40
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. */