diff options
| author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2020-08-11 06:40:52 (GMT) |
|---|---|---|
| committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2020-08-11 06:40:52 (GMT) |
| commit | 1ba4ad76b3abf67834ed39e7f20199104298b794 (patch) | |
| tree | 3168591b5da4c539d43510f3fb4214a7e5dc91b0 /generic | |
| parent | 33c33747236b588a0fb278f6ab9a37e824b06f1c (diff) | |
| parent | 1c5831fa439ec0ee7a7f63fa15753b0ff46c5100 (diff) | |
| download | tcl-1ba4ad76b3abf67834ed39e7f20199104298b794.zip tcl-1ba4ad76b3abf67834ed39e7f20199104298b794.tar.gz tcl-1ba4ad76b3abf67834ed39e7f20199104298b794.tar.bz2 | |
Merge 8.7
Diffstat (limited to 'generic')
| -rw-r--r-- | generic/tclBasic.c | 5 | ||||
| -rw-r--r-- | generic/tclFileName.c | 2 | ||||
| -rw-r--r-- | generic/tclInt.h | 1 | ||||
| -rw-r--r-- | generic/tclLink.c | 8 | ||||
| -rw-r--r-- | generic/tclTest.c | 52 |
5 files changed, 60 insertions, 8 deletions
diff --git a/generic/tclBasic.c b/generic/tclBasic.c index e91af9e..660aa67 100644 --- a/generic/tclBasic.c +++ b/generic/tclBasic.c @@ -662,7 +662,7 @@ Tcl_CreateInterp(void) TclRegisterCommandTypeName(TclEnsembleImplementationCmd, "ensemble"); TclRegisterCommandTypeName(TclAliasObjCmd, "alias"); TclRegisterCommandTypeName(TclLocalAliasObjCmd, "alias"); - TclRegisterCommandTypeName(TclSlaveObjCmd, "slave"); + TclRegisterCommandTypeName(TclSlaveObjCmd, "interp"); TclRegisterCommandTypeName(TclInvokeImportedCmd, "import"); TclRegisterCommandTypeName(TclOOPublicObjectCmd, "object"); TclRegisterCommandTypeName(TclOOPrivateObjectCmd, "privateObject"); @@ -3538,6 +3538,7 @@ Tcl_DeleteCommandFromToken( * TclNRExecuteByteCode looks up the command in the command hashtable). */ + cmdPtr->flags |= CMD_DEAD; TclCleanupCommandMacro(cmdPtr); return 0; } @@ -4246,7 +4247,7 @@ EvalObjvCore( * Caller gave it to us. */ - if (!(preCmdPtr->flags & CMD_IS_DELETED)) { + if (!(preCmdPtr->flags & CMD_DEAD)) { /* * So long as it exists, use it. */ diff --git a/generic/tclFileName.c b/generic/tclFileName.c index eb0b21c..14d456e 100644 --- a/generic/tclFileName.c +++ b/generic/tclFileName.c @@ -598,7 +598,7 @@ Tcl_SplitPath( for (i = 0; i < *argcPtr; i++) { Tcl_ListObjIndex(NULL, resultPtr, i, &eltPtr); str = TclGetStringFromObj(eltPtr, &len); - memcpy(p, str, len+1); + memcpy(p, str, len + 1); p += len+1; } diff --git a/generic/tclInt.h b/generic/tclInt.h index a2b8c20..817e150 100644 --- a/generic/tclInt.h +++ b/generic/tclInt.h @@ -1718,6 +1718,7 @@ typedef struct Command { #define CMD_COMPILES_EXPANDED 0x08 #define CMD_REDEF_IN_PROGRESS 0x10 #define CMD_VIA_RESOLVER 0x20 +#define CMD_DEAD 0x30 /* diff --git a/generic/tclLink.c b/generic/tclLink.c index 2f5571b..d35e4e1 100644 --- a/generic/tclLink.c +++ b/generic/tclLink.c @@ -911,8 +911,8 @@ LinkTraceProc( return (char *) "wrong size of char* value"; } if (linkPtr->flags & LINK_ALLOC_LAST) { - memcpy(linkPtr->lastValue.aryPtr, value, (size_t) valueLength); - memcpy(linkPtr->addr, value, (size_t) valueLength); + memcpy(linkPtr->lastValue.aryPtr, value, valueLength); + memcpy(linkPtr->addr, value, valueLength); } else { linkPtr->lastValue.c = '\0'; LinkedVar(char) = linkPtr->lastValue.c; @@ -925,8 +925,8 @@ LinkTraceProc( return (char *) "wrong size of binary value"; } if (linkPtr->flags & LINK_ALLOC_LAST) { - memcpy(linkPtr->lastValue.aryPtr, value, (size_t) valueLength); - memcpy(linkPtr->addr, value, (size_t) valueLength); + memcpy(linkPtr->lastValue.aryPtr, value, valueLength); + memcpy(linkPtr->addr, value, valueLength); } else { linkPtr->lastValue.uc = (unsigned char) *value; LinkedVar(unsigned char) = linkPtr->lastValue.uc; diff --git a/generic/tclTest.c b/generic/tclTest.c index ddfbbb0..cfe989c 100644 --- a/generic/tclTest.c +++ b/generic/tclTest.c @@ -312,7 +312,7 @@ static Tcl_FSNormalizePathProc TestReportNormalizePath; static Tcl_FSPathInFilesystemProc TestReportInFilesystem; static Tcl_FSFreeInternalRepProc TestReportFreeInternalRep; static Tcl_FSDupInternalRepProc TestReportDupInternalRep; - +static Tcl_CmdProc TestServiceModeCmd; static Tcl_FSStatProc SimpleStat; static Tcl_FSAccessProc SimpleAccess; static Tcl_FSOpenFileChannelProc SimpleOpenFileChannel; @@ -573,6 +573,8 @@ Tcltest_Init( NULL, NULL); Tcl_CreateObjCommand(interp, "testsaveresult", TestsaveresultCmd, NULL, NULL); + Tcl_CreateCommand(interp, "testservicemode", TestServiceModeCmd, + NULL, NULL); Tcl_CreateCommand(interp, "testsetassocdata", TestsetassocdataCmd, NULL, NULL); Tcl_CreateCommand(interp, "testsetnoerr", TestsetCmd, @@ -6163,6 +6165,54 @@ TestSocketCmd( /* *---------------------------------------------------------------------- * + * TestServiceModeCmd -- + * + * This procedure implements the "testservicemode" command which gets or + * sets the current Tcl ServiceMode. There are several tests which open + * a file and assign various handlers to it. For these tests to be + * deterministic it is important that file events not be processed until + * all of the handlers are in place. + * + * Results: + * A standard Tcl result. + * + * Side effects: + * May change the ServiceMode setting. + * + *---------------------------------------------------------------------- + */ + +static int +TestServiceModeCmd( + TCL_UNUSED(ClientData), + Tcl_Interp *interp, /* Current interpreter. */ + int argc, /* Number of arguments. */ + const char **argv) /* Argument strings. */ +{ + int newmode, oldmode; + if (argc > 2) { + Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], + " ?newmode?\"", NULL); + return TCL_ERROR; + } + oldmode = (Tcl_GetServiceMode() != TCL_SERVICE_NONE); + if (argc == 2) { + if (Tcl_GetInt(interp, argv[1], &newmode) == TCL_ERROR) { + return TCL_ERROR; + } + if (newmode == 0) { + Tcl_SetServiceMode(TCL_SERVICE_NONE); + } else { + Tcl_SetServiceMode(TCL_SERVICE_ALL); + } + } + Tcl_SetObjResult(interp, Tcl_NewIntObj(oldmode)); + return TCL_OK; +} + +/* + *---------------------------------------------------------------------- + * * TestWrongNumArgsObjCmd -- * * Test the Tcl_WrongNumArgs function. |
