summaryrefslogtreecommitdiffstats
path: root/generic/tclEnsemble.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/tclEnsemble.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/tclEnsemble.c')
-rw-r--r--generic/tclEnsemble.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/generic/tclEnsemble.c b/generic/tclEnsemble.c
index 03bbf03..ea32e8a 100644
--- a/generic/tclEnsemble.c
+++ b/generic/tclEnsemble.c
@@ -107,7 +107,7 @@ static inline Tcl_Obj *
NewNsObj(
Tcl_Namespace *namespacePtr)
{
- register Namespace *nsPtr = (Namespace *) namespacePtr;
+ Namespace *nsPtr = (Namespace *) namespacePtr;
if (namespacePtr == TclGetGlobalNamespace(nsPtr->interp)) {
return Tcl_NewStringObj("::", 2);
@@ -1805,7 +1805,7 @@ NsEnsembleImplementationCmdNR(
subcmdName = Tcl_GetStringFromObj(subObj, &stringLength);
for (i=0 ; i<tableLength ; i++) {
- register int cmp = strncmp(subcmdName,
+ int cmp = strncmp(subcmdName,
ensemblePtr->subcommandArrayPtr[i],
(unsigned) stringLength);
@@ -2396,7 +2396,7 @@ MakeCachedEnsembleCommand(
Tcl_HashEntry *hPtr,
Tcl_Obj *fix)
{
- register EnsembleCmdRep *ensembleCmd;
+ EnsembleCmdRep *ensembleCmd;
if (objPtr->typePtr == &ensembleCmdType) {
ensembleCmd = objPtr->internalRep.twoPtrValue.ptr1;
@@ -2892,6 +2892,7 @@ TclCompileEnsemble(
* compiled. */
CompileEnv *envPtr) /* Holds resulting instructions. */
{
+ DefineLineInformation;
Tcl_Token *tokenPtr = TokenAfter(parsePtr->tokenPtr);
Tcl_Obj *mapObj, *subcmdObj, *targetCmdObj, *listObj, **elems;
Tcl_Obj *replaced = Tcl_NewObj(), *replacement;
@@ -2901,7 +2902,6 @@ TclCompileEnsemble(
int ourResult = TCL_ERROR;
unsigned numBytes;
const char *word;
- DefineLineInformation;
Tcl_IncrRefCount(replaced);
if (parsePtr->numWords < depth + 1) {
@@ -3230,6 +3230,7 @@ TclAttemptCompileProc(
Command *cmdPtr,
CompileEnv *envPtr) /* Holds resulting instructions. */
{
+ DefineLineInformation;
int result, i;
Tcl_Token *saveTokenPtr = parsePtr->tokenPtr;
int savedStackDepth = envPtr->currStackDepth;
@@ -3239,7 +3240,6 @@ TclAttemptCompileProc(
#ifdef TCL_COMPILE_DEBUG
int savedExceptDepth = envPtr->exceptDepth;
#endif
- DefineLineInformation;
if (cmdPtr->compileProc == NULL) {
return TCL_ERROR;
@@ -3363,11 +3363,11 @@ CompileToInvokedCommand(
Command *cmdPtr,
CompileEnv *envPtr) /* Holds resulting instructions. */
{
+ DefineLineInformation;
Tcl_Token *tokPtr;
Tcl_Obj *objPtr, **words;
char *bytes;
int length, i, numWords, cmdLit, extraLiteralFlags = LITERAL_CMD_NAME;
- DefineLineInformation;
/*
* Push the words of the command. Take care; the command words may be