From f5ebd5a3cc1ef2c91382d3954be94bee505858c8 Mon Sep 17 00:00:00 2001 From: dgp Date: Thu, 12 May 2016 19:44:41 +0000 Subject: Remove the nsPtr field from the EnsembleCmdRep struct. Cannot see any justification for keeping it (can get via token), and test suite doesn't care. --- generic/tclEnsemble.c | 9 +-------- generic/tclInt.h | 2 -- 2 files changed, 1 insertion(+), 10 deletions(-) diff --git a/generic/tclEnsemble.c b/generic/tclEnsemble.c index 986a553..ecf10ff 100644 --- a/generic/tclEnsemble.c +++ b/generic/tclEnsemble.c @@ -1707,8 +1707,7 @@ NsEnsembleImplementationCmdNR( EnsembleCmdRep *ensembleCmd = objv[1+ensemblePtr->numParameters] ->internalRep.twoPtrValue.ptr1; - if (ensembleCmd->nsPtr == ensemblePtr->nsPtr && - ensembleCmd->epoch == ensemblePtr->epoch && + if (ensembleCmd->epoch == ensemblePtr->epoch && ensembleCmd->token == ensemblePtr->token) { prefixObj = ensembleCmd->realPrefixObj; Tcl_IncrRefCount(prefixObj); @@ -2227,7 +2226,6 @@ MakeCachedEnsembleCommand( if (objPtr->typePtr == &tclEnsembleCmdType) { ensembleCmd = objPtr->internalRep.twoPtrValue.ptr1; Tcl_DecrRefCount(ensembleCmd->realPrefixObj); - TclNsDecrRefCount(ensembleCmd->nsPtr); ckfree(ensembleCmd->fullSubcmdName); } else { /* @@ -2245,10 +2243,8 @@ MakeCachedEnsembleCommand( * Populate the internal rep. */ - ensembleCmd->nsPtr = ensemblePtr->nsPtr; ensembleCmd->epoch = ensemblePtr->epoch; ensembleCmd->token = ensemblePtr->token; - ensemblePtr->nsPtr->refCount++; ensembleCmd->realPrefixObj = prefixObjPtr; length = strlen(subcommandName)+1; ensembleCmd->fullSubcmdName = ckalloc(length); @@ -2636,7 +2632,6 @@ FreeEnsembleCmdRep( Tcl_DecrRefCount(ensembleCmd->realPrefixObj); ckfree(ensembleCmd->fullSubcmdName); - TclNsDecrRefCount(ensembleCmd->nsPtr); ckfree(ensembleCmd); objPtr->typePtr = NULL; } @@ -2670,10 +2665,8 @@ DupEnsembleCmdRep( copyPtr->typePtr = &tclEnsembleCmdType; copyPtr->internalRep.twoPtrValue.ptr1 = ensembleCopy; - ensembleCopy->nsPtr = ensembleCmd->nsPtr; ensembleCopy->epoch = ensembleCmd->epoch; ensembleCopy->token = ensembleCmd->token; - ensembleCopy->nsPtr->refCount++; ensembleCopy->realPrefixObj = ensembleCmd->realPrefixObj; Tcl_IncrRefCount(ensembleCopy->realPrefixObj); ensembleCopy->fullSubcmdName = ckalloc(length + 1); diff --git a/generic/tclInt.h b/generic/tclInt.h index 42c13dd..e00c392 100644 --- a/generic/tclInt.h +++ b/generic/tclInt.h @@ -395,8 +395,6 @@ struct NamespacePathEntry { */ typedef struct { - Namespace *nsPtr; /* The namespace backing the ensemble which - * this is a subcommand of. */ int epoch; /* Used to confirm when the data in this * really structure matches up with the * ensemble. */ -- cgit v0.12 From e0ed43c52629c283f02e749517e7fc83ace2942e Mon Sep 17 00:00:00 2001 From: dgp Date: Thu, 12 May 2016 19:49:06 +0000 Subject: The "ensembleCommand" Tcl_ObjType has no need for an UpdateString routine. It is entirely a caching type. No "pure" value can exist. --- generic/tclEnsemble.c | 32 +------------------------------- 1 file changed, 1 insertion(+), 31 deletions(-) diff --git a/generic/tclEnsemble.c b/generic/tclEnsemble.c index ecf10ff..ead96a3 100644 --- a/generic/tclEnsemble.c +++ b/generic/tclEnsemble.c @@ -34,7 +34,6 @@ static void MakeCachedEnsembleCommand(Tcl_Obj *objPtr, const char *subcmdName, Tcl_Obj *prefixObjPtr); static void FreeEnsembleCmdRep(Tcl_Obj *objPtr); static void DupEnsembleCmdRep(Tcl_Obj *objPtr, Tcl_Obj *copyPtr); -static void StringOfEnsembleCmdRep(Tcl_Obj *objPtr); static void CompileToInvokedCommand(Tcl_Interp *interp, Tcl_Parse *parsePtr, Tcl_Obj *replacements, Command *cmdPtr, CompileEnv *envPtr); @@ -81,7 +80,7 @@ const Tcl_ObjType tclEnsembleCmdType = { "ensembleCommand", /* the type's name */ FreeEnsembleCmdRep, /* freeIntRepProc */ DupEnsembleCmdRep, /* dupIntRepProc */ - StringOfEnsembleCmdRep, /* updateStringProc */ + NULL, /* updateStringProc */ NULL /* setFromAnyProc */ }; @@ -2677,35 +2676,6 @@ DupEnsembleCmdRep( /* *---------------------------------------------------------------------- * - * StringOfEnsembleCmdRep -- - * - * Creates a string representation of a Tcl_Obj that holds a subcommand - * of an ensemble. - * - * Results: - * None. - * - * Side effects: - * The object gains a string (UTF-8) representation. - * - *---------------------------------------------------------------------- - */ - -static void -StringOfEnsembleCmdRep( - Tcl_Obj *objPtr) -{ - EnsembleCmdRep *ensembleCmd = objPtr->internalRep.twoPtrValue.ptr1; - int length = strlen(ensembleCmd->fullSubcmdName); - - objPtr->length = length; - objPtr->bytes = ckalloc(length + 1); - memcpy(objPtr->bytes, ensembleCmd->fullSubcmdName, (unsigned) length+1); -} - -/* - *---------------------------------------------------------------------- - * * TclCompileEnsemble -- * * Procedure called to compile an ensemble command. Note that most -- cgit v0.12 From 67801a78ad4a2571cbdb9f8358f88edc001776dc Mon Sep 17 00:00:00 2001 From: dgp Date: Thu, 12 May 2016 20:23:23 +0000 Subject: Don't see why the intrep should make and keep copies of things already stored in the hash table. --- generic/tclEnsemble.c | 37 ++++++++++--------------------------- generic/tclIndexObj.c | 6 ++++-- generic/tclInt.h | 8 +++----- 3 files changed, 17 insertions(+), 34 deletions(-) diff --git a/generic/tclEnsemble.c b/generic/tclEnsemble.c index ead96a3..986b7c1 100644 --- a/generic/tclEnsemble.c +++ b/generic/tclEnsemble.c @@ -30,8 +30,7 @@ static int NsEnsembleStringOrder(const void *strPtr1, const void *strPtr2); static void DeleteEnsembleConfig(ClientData clientData); static void MakeCachedEnsembleCommand(Tcl_Obj *objPtr, - EnsembleConfig *ensemblePtr, - const char *subcmdName, Tcl_Obj *prefixObjPtr); + EnsembleConfig *ensemblePtr, Tcl_HashEntry *hPtr); static void FreeEnsembleCmdRep(Tcl_Obj *objPtr); static void DupEnsembleCmdRep(Tcl_Obj *objPtr, Tcl_Obj *copyPtr); static void CompileToInvokedCommand(Tcl_Interp *interp, @@ -1708,7 +1707,7 @@ NsEnsembleImplementationCmdNR( if (ensembleCmd->epoch == ensemblePtr->epoch && ensembleCmd->token == ensemblePtr->token) { - prefixObj = ensembleCmd->realPrefixObj; + prefixObj = Tcl_GetHashValue(ensembleCmd->hPtr); Tcl_IncrRefCount(prefixObj); goto runResultingSubcommand; } @@ -1726,16 +1725,13 @@ NsEnsembleImplementationCmdNR( hPtr = Tcl_FindHashEntry(&ensemblePtr->subcommandTable, TclGetString(objv[1 + ensemblePtr->numParameters])); if (hPtr != NULL) { - char *fullName = Tcl_GetHashKey(&ensemblePtr->subcommandTable, hPtr); - - prefixObj = Tcl_GetHashValue(hPtr); /* * Cache for later in the subcommand object. */ MakeCachedEnsembleCommand(objv[1 + ensemblePtr->numParameters], - ensemblePtr, fullName, prefixObj); + ensemblePtr, hPtr); } else if (!(ensemblePtr->flags & TCL_ENSEMBLE_PREFIX)) { /* * Could not map, no prefixing, go to unknown/error handling. @@ -1797,16 +1793,16 @@ NsEnsembleImplementationCmdNR( Tcl_Panic("full name %s not found in supposedly synchronized hash", fullName); } - prefixObj = Tcl_GetHashValue(hPtr); /* * Cache for later in the subcommand object. */ MakeCachedEnsembleCommand(objv[1 + ensemblePtr->numParameters], - ensemblePtr, fullName, prefixObj); + ensemblePtr, hPtr); } + prefixObj = Tcl_GetHashValue(hPtr); Tcl_IncrRefCount(prefixObj); runResultingSubcommand: @@ -2216,16 +2212,12 @@ static void MakeCachedEnsembleCommand( Tcl_Obj *objPtr, EnsembleConfig *ensemblePtr, - const char *subcommandName, - Tcl_Obj *prefixObjPtr) + Tcl_HashEntry *hPtr) { register EnsembleCmdRep *ensembleCmd; - int length; if (objPtr->typePtr == &tclEnsembleCmdType) { ensembleCmd = objPtr->internalRep.twoPtrValue.ptr1; - Tcl_DecrRefCount(ensembleCmd->realPrefixObj); - ckfree(ensembleCmd->fullSubcmdName); } else { /* * Kill the old internal rep, and replace it with a brand new one of @@ -2244,11 +2236,8 @@ MakeCachedEnsembleCommand( ensembleCmd->epoch = ensemblePtr->epoch; ensembleCmd->token = ensemblePtr->token; - ensembleCmd->realPrefixObj = prefixObjPtr; - length = strlen(subcommandName)+1; - ensembleCmd->fullSubcmdName = ckalloc(length); - memcpy(ensembleCmd->fullSubcmdName, subcommandName, (unsigned) length); - Tcl_IncrRefCount(ensembleCmd->realPrefixObj); + ensembleCmd->tablePtr = &ensemblePtr->subcommandTable; + ensembleCmd->hPtr = hPtr; } /* @@ -2629,8 +2618,6 @@ FreeEnsembleCmdRep( { EnsembleCmdRep *ensembleCmd = objPtr->internalRep.twoPtrValue.ptr1; - Tcl_DecrRefCount(ensembleCmd->realPrefixObj); - ckfree(ensembleCmd->fullSubcmdName); ckfree(ensembleCmd); objPtr->typePtr = NULL; } @@ -2660,17 +2647,13 @@ DupEnsembleCmdRep( { EnsembleCmdRep *ensembleCmd = objPtr->internalRep.twoPtrValue.ptr1; EnsembleCmdRep *ensembleCopy = ckalloc(sizeof(EnsembleCmdRep)); - int length = strlen(ensembleCmd->fullSubcmdName); copyPtr->typePtr = &tclEnsembleCmdType; copyPtr->internalRep.twoPtrValue.ptr1 = ensembleCopy; ensembleCopy->epoch = ensembleCmd->epoch; ensembleCopy->token = ensembleCmd->token; - ensembleCopy->realPrefixObj = ensembleCmd->realPrefixObj; - Tcl_IncrRefCount(ensembleCopy->realPrefixObj); - ensembleCopy->fullSubcmdName = ckalloc(length + 1); - memcpy(ensembleCopy->fullSubcmdName, ensembleCmd->fullSubcmdName, - (unsigned) length+1); + ensembleCopy->tablePtr = ensembleCmd->tablePtr; + ensembleCopy->hPtr = ensembleCmd->hPtr; } /* diff --git a/generic/tclIndexObj.c b/generic/tclIndexObj.c index ce8b9fb..d01e685 100644 --- a/generic/tclIndexObj.c +++ b/generic/tclIndexObj.c @@ -961,7 +961,7 @@ Tcl_WrongNumArgs( register EnsembleCmdRep *ecrPtr = origObjv[i]->internalRep.twoPtrValue.ptr1; - elementStr = ecrPtr->fullSubcmdName; + elementStr = Tcl_GetHashKey(ecrPtr->tablePtr, ecrPtr->hPtr); elemLen = strlen(elementStr); } else { elementStr = TclGetStringFromObj(origObjv[i], &elemLen); @@ -1014,8 +1014,10 @@ Tcl_WrongNumArgs( } else if (objv[i]->typePtr == &tclEnsembleCmdType) { register EnsembleCmdRep *ecrPtr = objv[i]->internalRep.twoPtrValue.ptr1; + const char *fullSubcmdName + = Tcl_GetHashKey(ecrPtr->tablePtr, ecrPtr->hPtr); - Tcl_AppendStringsToObj(objPtr, ecrPtr->fullSubcmdName, NULL); + Tcl_AppendStringsToObj(objPtr, fullSubcmdName, NULL); } else { /* * Quote the argument if it contains spaces (Bug 942757). diff --git a/generic/tclInt.h b/generic/tclInt.h index e00c392..48eecce 100644 --- a/generic/tclInt.h +++ b/generic/tclInt.h @@ -400,11 +400,9 @@ typedef struct { * ensemble. */ Tcl_Command token; /* Reference to the comamnd for which this * structure is a cache of the resolution. */ - char *fullSubcmdName; /* The full (local) name of the subcommand, - * allocated with ckalloc(). */ - Tcl_Obj *realPrefixObj; /* Object containing the prefix words of the - * command that implements this ensemble - * subcommand. */ + Tcl_HashTable *tablePtr; /* The subcommand hash table. */ + Tcl_HashEntry *hPtr; /* Direct link to entry in the subcommand + * hash table. */ } EnsembleCmdRep; /* -- cgit v0.12 From 6f3bd38c61b5deddb1bcd376c798ca8aa12351a7 Mon Sep 17 00:00:00 2001 From: dgp Date: Tue, 24 May 2016 19:28:50 +0000 Subject: Appears that the TclInitRewriteEnsemble() routine was created with an intent to refactor, but never actually got used. Work on continuing that effort. --- generic/tclBasic.c | 6 ++---- generic/tclEnsemble.c | 19 ++++++++++++++++++- generic/tclExecute.c | 8 +++++--- generic/tclNamesp.c | 1 + generic/tclOOMethod.c | 1 + generic/tclProc.c | 2 ++ 6 files changed, 29 insertions(+), 8 deletions(-) diff --git a/generic/tclBasic.c b/generic/tclBasic.c index e5d7406..b0c31cc 100644 --- a/generic/tclBasic.c +++ b/generic/tclBasic.c @@ -723,9 +723,7 @@ Tcl_CreateInterp(void) * Initialize the ensemble error message rewriting support. */ - iPtr->ensembleRewrite.sourceObjs = NULL; - iPtr->ensembleRewrite.numRemovedObjs = 0; - iPtr->ensembleRewrite.numInsertedObjs = 0; + TclResetRewriteEnsemble(interp, 1); /* * TIP#143: Initialise the resource limit support. @@ -4220,7 +4218,7 @@ EvalObjvCore( * TCL_EVAL_INVOKE was not set: clear rewrite rules */ - iPtr->ensembleRewrite.sourceObjs = NULL; + TclResetRewriteEnsemble(interp, 1); if (flags & TCL_EVAL_GLOBAL) { TEOV_SwitchVarFrame(interp); diff --git a/generic/tclEnsemble.c b/generic/tclEnsemble.c index 986a553..f108030 100644 --- a/generic/tclEnsemble.c +++ b/generic/tclEnsemble.c @@ -1876,6 +1876,15 @@ NsEnsembleImplementationCmdNR( * count both as inserted and removed arguments. */ +#if 1 + if (TclInitRewriteEnsemble(interp, 2 + ensemblePtr->numParameters, + prefixObjc + ensemblePtr->numParameters, objv)) { + TclNRAddCallback(interp, TclClearRootEnsemble, NULL, NULL, NULL, + NULL); + } + +#else + if (iPtr->ensembleRewrite.sourceObjs == NULL) { iPtr->ensembleRewrite.sourceObjs = objv; iPtr->ensembleRewrite.numRemovedObjs = @@ -1890,6 +1899,7 @@ NsEnsembleImplementationCmdNR( /* Position in objv of new front of insertion * relative to old one. */ if (ni > 0) { +//fprintf(stdout, "COVER\n"); fflush(stdout); iPtr->ensembleRewrite.numRemovedObjs += ni; iPtr->ensembleRewrite.numInsertedObjs += prefixObjc-1; } else { @@ -1897,6 +1907,8 @@ NsEnsembleImplementationCmdNR( } } +#endif + /* * Hand off to the target command. */ @@ -2005,15 +2017,20 @@ TclInitRewriteEnsemble( int isRootEnsemble = (iPtr->ensembleRewrite.sourceObjs == NULL); if (isRootEnsemble) { +//fprintf(stdout, "SET-SOURCE: '%s'\n", Tcl_GetString(objv[0])); fflush(stdout); iPtr->ensembleRewrite.sourceObjs = objv; iPtr->ensembleRewrite.numRemovedObjs = numRemoved; iPtr->ensembleRewrite.numInsertedObjs = numInserted; } else { int numIns = iPtr->ensembleRewrite.numInsertedObjs; +//fprintf(stdout, "Pre-SOURCE: '%s'\n", +//Tcl_GetString(iPtr->ensembleRewrite.sourceObjs[0])); fflush(stdout); + if (numIns < numRemoved) { +//fprintf(stdout, "COVER2\n"); fflush(stdout); iPtr->ensembleRewrite.numRemovedObjs += numRemoved - numIns; - iPtr->ensembleRewrite.numInsertedObjs += numInserted - 1; + iPtr->ensembleRewrite.numInsertedObjs = numInserted; } else { iPtr->ensembleRewrite.numInsertedObjs += numInserted - numRemoved; } diff --git a/generic/tclExecute.c b/generic/tclExecute.c index d4077f5..80598c1 100644 --- a/generic/tclExecute.c +++ b/generic/tclExecute.c @@ -3172,9 +3172,11 @@ TEBCresume( if (iPtr->flags & INTERP_DEBUG_FRAME) { ArgumentBCEnter(interp, codePtr, TD, pc, objc, objv); } - iPtr->ensembleRewrite.sourceObjs = objv; - iPtr->ensembleRewrite.numRemovedObjs = opnd; - iPtr->ensembleRewrite.numInsertedObjs = 1; + + if (!TclInitRewriteEnsemble(interp, opnd, 1, objv)) { +//fprintf(stdout, "INVOKE: '%s'\n", Tcl_GetString(objPtr)); fflush(stdout); + Tcl_Panic("INST_INVOKE_REPLACE is not ensemble root"); + } DECACHE_STACK_INFO(); pc += 6; TEBC_YIELD(); diff --git a/generic/tclNamesp.c b/generic/tclNamesp.c index 58a86d9..bad408e 100644 --- a/generic/tclNamesp.c +++ b/generic/tclNamesp.c @@ -3362,6 +3362,7 @@ NRNamespaceEvalCmd( - iPtr->ensembleRewrite.numInsertedObjs; framePtr->objv = iPtr->ensembleRewrite.sourceObjs; } + TclResetRewriteEnsemble(interp, 1); if (objc == 3) { /* diff --git a/generic/tclOOMethod.c b/generic/tclOOMethod.c index 34fa108..b86a203 100644 --- a/generic/tclOOMethod.c +++ b/generic/tclOOMethod.c @@ -732,6 +732,7 @@ InvokeProcedureMethod( * Now invoke the body of the method. */ +//fprintf(stdout, "eh? %p\n", ((Interp *)interp)->ensembleRewrite.sourceObjs); fflush(stdout); TclNRAddCallback(interp, FinalizePMCall, pmPtr, context, fdPtr, NULL); return TclNRInterpProcCore(interp, fdPtr->nameObj, Tcl_ObjectContextSkippedArgs(context), fdPtr->errProc); diff --git a/generic/tclProc.c b/generic/tclProc.c index 172b860..1a3bdb7 100644 --- a/generic/tclProc.c +++ b/generic/tclProc.c @@ -1786,6 +1786,8 @@ TclNRInterpProcCore( * Invoke the commands in the procedure's body. */ + TclResetRewriteEnsemble(interp, 1); + procPtr->refCount++; codePtr = procPtr->bodyPtr->internalRep.twoPtrValue.ptr1; -- cgit v0.12 From c0771697239c868133d1f53442b91259ab58cf25 Mon Sep 17 00:00:00 2001 From: dgp Date: Tue, 24 May 2016 19:29:58 +0000 Subject: The handling of ensemble rewriting here is not right, but I've not yet found the test case to demonstrate it. Checking in debugging code to spread to other dev platforms. --- generic/tclEnsemble.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/generic/tclEnsemble.c b/generic/tclEnsemble.c index 986a553..c947459 100644 --- a/generic/tclEnsemble.c +++ b/generic/tclEnsemble.c @@ -12,6 +12,7 @@ #include "tclInt.h" #include "tclCompile.h" +#include "assert.h" /* * Declarations for functions local to this file: @@ -1891,6 +1892,12 @@ NsEnsembleImplementationCmdNR( * relative to old one. */ if (ni > 0) { iPtr->ensembleRewrite.numRemovedObjs += ni; +fprintf(stdout, "%d == %d\n", +iPtr->ensembleRewrite.numInsertedObjs - 1, +ensemblePtr->numParameters); +fflush(stdout); +assert(iPtr->ensembleRewrite.numInsertedObjs - 1 == ensemblePtr->numParameters); + iPtr->ensembleRewrite.numInsertedObjs += prefixObjc-1; } else { iPtr->ensembleRewrite.numInsertedObjs += prefixObjc-2; -- cgit v0.12 From 76b6abb07e94280e27b013d5c2610b67776aa6a1 Mon Sep 17 00:00:00 2001 From: dgp Date: Tue, 24 May 2016 20:16:10 +0000 Subject: New test namespace-53.11 demonstrates the bug. --- generic/tclEnsemble.c | 8 +------- tests/namespace.test | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/generic/tclEnsemble.c b/generic/tclEnsemble.c index c947459..c85828b 100644 --- a/generic/tclEnsemble.c +++ b/generic/tclEnsemble.c @@ -12,7 +12,6 @@ #include "tclInt.h" #include "tclCompile.h" -#include "assert.h" /* * Declarations for functions local to this file: @@ -1892,13 +1891,8 @@ NsEnsembleImplementationCmdNR( * relative to old one. */ if (ni > 0) { iPtr->ensembleRewrite.numRemovedObjs += ni; -fprintf(stdout, "%d == %d\n", -iPtr->ensembleRewrite.numInsertedObjs - 1, -ensemblePtr->numParameters); -fflush(stdout); -assert(iPtr->ensembleRewrite.numInsertedObjs - 1 == ensemblePtr->numParameters); - iPtr->ensembleRewrite.numInsertedObjs += prefixObjc-1; +// iPtr->ensembleRewrite.numInsertedObjs = prefixObjc + ensemblePtr->numParameters; } else { iPtr->ensembleRewrite.numInsertedObjs += prefixObjc-2; } diff --git a/tests/namespace.test b/tests/namespace.test index cb9bc8c..2ba695a 100644 --- a/tests/namespace.test +++ b/tests/namespace.test @@ -2928,6 +2928,22 @@ test namespace-53.10 {ensembles: nested rewrite} -setup { 0 {1 v}\ 1 {wrong # args: should be "ns v x z2 a2"}\ 0 {2 v v2}} +test namespace-53.11 {ensembles: nested rewrite} -setup { + namespace eval ns { + namespace export x + namespace eval x { + proc z2 {a1 a2} {list 2 $a1 $a2} + namespace export z* + namespace ensemble create -parameter p + } + namespace ensemble create + } +} -body { + list [catch {ns x 1 z2} msg] $msg +} -cleanup { + namespace delete ns + unset -nocomplain msg +} -result {1 {wrong # args: should be "ns x 1 z2 a2"}} test namespace-54.1 {leak on namespace deletion} -constraints {memory} \ -setup { -- cgit v0.12 From 0a2318649c91cff9d31bef133fb6a96ad9786bed Mon Sep 17 00:00:00 2001 From: dgp Date: Tue, 24 May 2016 20:23:15 +0000 Subject: Now fix the bug. --- generic/tclEnsemble.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/generic/tclEnsemble.c b/generic/tclEnsemble.c index c85828b..7ef8042 100644 --- a/generic/tclEnsemble.c +++ b/generic/tclEnsemble.c @@ -1891,8 +1891,8 @@ NsEnsembleImplementationCmdNR( * relative to old one. */ if (ni > 0) { iPtr->ensembleRewrite.numRemovedObjs += ni; - iPtr->ensembleRewrite.numInsertedObjs += prefixObjc-1; -// iPtr->ensembleRewrite.numInsertedObjs = prefixObjc + ensemblePtr->numParameters; + iPtr->ensembleRewrite.numInsertedObjs + = prefixObjc + ensemblePtr->numParameters; } else { iPtr->ensembleRewrite.numInsertedObjs += prefixObjc-2; } -- cgit v0.12 From 13a6722593334f23786c8c20f446a8027a8ebe6c Mon Sep 17 00:00:00 2001 From: dgp Date: Tue, 24 May 2016 20:39:25 +0000 Subject: Adapt and tidy up the bug fix. --- generic/tclEnsemble.c | 34 ---------------------------------- 1 file changed, 34 deletions(-) diff --git a/generic/tclEnsemble.c b/generic/tclEnsemble.c index e37ad1a..1c91734 100644 --- a/generic/tclEnsemble.c +++ b/generic/tclEnsemble.c @@ -1832,7 +1832,6 @@ NsEnsembleImplementationCmdNR( Tcl_Obj *copyPtr; /* The actual list of words to dispatch to. * Will be freed by the dispatch engine. */ int prefixObjc, copyObjc; - Interp *iPtr = (Interp *) interp; /* * Get the prefix that we're rewriting to. To do this we need to @@ -1876,40 +1875,12 @@ NsEnsembleImplementationCmdNR( * count both as inserted and removed arguments. */ -#if 1 if (TclInitRewriteEnsemble(interp, 2 + ensemblePtr->numParameters, prefixObjc + ensemblePtr->numParameters, objv)) { TclNRAddCallback(interp, TclClearRootEnsemble, NULL, NULL, NULL, NULL); } -#else - - if (iPtr->ensembleRewrite.sourceObjs == NULL) { - iPtr->ensembleRewrite.sourceObjs = objv; - iPtr->ensembleRewrite.numRemovedObjs = - 2 + ensemblePtr->numParameters; - iPtr->ensembleRewrite.numInsertedObjs = - prefixObjc + ensemblePtr->numParameters; - TclNRAddCallback(interp, TclClearRootEnsemble, NULL, NULL, NULL, - NULL); - } else { - register int ni = 2 + ensemblePtr->numParameters - - iPtr->ensembleRewrite.numInsertedObjs; - /* Position in objv of new front of insertion - * relative to old one. */ - if (ni > 0) { -//fprintf(stdout, "COVER\n"); fflush(stdout); - iPtr->ensembleRewrite.numRemovedObjs += ni; - iPtr->ensembleRewrite.numInsertedObjs - = prefixObjc + ensemblePtr->numParameters; - } else { - iPtr->ensembleRewrite.numInsertedObjs += prefixObjc-2; - } - } - -#endif - /* * Hand off to the target command. */ @@ -2018,18 +1989,13 @@ TclInitRewriteEnsemble( int isRootEnsemble = (iPtr->ensembleRewrite.sourceObjs == NULL); if (isRootEnsemble) { -//fprintf(stdout, "SET-SOURCE: '%s'\n", Tcl_GetString(objv[0])); fflush(stdout); iPtr->ensembleRewrite.sourceObjs = objv; iPtr->ensembleRewrite.numRemovedObjs = numRemoved; iPtr->ensembleRewrite.numInsertedObjs = numInserted; } else { int numIns = iPtr->ensembleRewrite.numInsertedObjs; -//fprintf(stdout, "Pre-SOURCE: '%s'\n", -//Tcl_GetString(iPtr->ensembleRewrite.sourceObjs[0])); fflush(stdout); - if (numIns < numRemoved) { -//fprintf(stdout, "COVER2\n"); fflush(stdout); iPtr->ensembleRewrite.numRemovedObjs += numRemoved - numIns; iPtr->ensembleRewrite.numInsertedObjs = numInserted; } else { -- cgit v0.12 From ec75618b67ba6350be88fd617aac6122cecc5250 Mon Sep 17 00:00:00 2001 From: dgp Date: Wed, 25 May 2016 17:27:49 +0000 Subject: Refactor all iPtr->ensembleRewrite setting code into TclInitRewriteEnsemble() calls. This likely fixes many weird corner case bugs, and definitly makes future development and maintenance easier. --- generic/tclInterp.c | 32 ++++---------------------------- generic/tclOODefineCmds.c | 42 +++--------------------------------------- generic/tclOOMethod.c | 23 +++-------------------- generic/tclProc.c | 17 +++-------------- 4 files changed, 13 insertions(+), 101 deletions(-) diff --git a/generic/tclInterp.c b/generic/tclInterp.c index cd0dc18..66ce1e0 100644 --- a/generic/tclInterp.c +++ b/generic/tclInterp.c @@ -1795,11 +1795,9 @@ AliasNRCmd( int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument vector. */ { - Interp *iPtr = (Interp *) interp; Alias *aliasPtr = clientData; int prefc, cmdc, i; Tcl_Obj **prefv, **cmdv; - int isRootEnsemble = (iPtr->ensembleRewrite.sourceObjs == NULL); Tcl_Obj *listPtr; List *listRep; int flags = TCL_EVAL_INVOKE; @@ -1831,21 +1829,7 @@ AliasNRCmd( * only the source command should show, not the full target prefix. */ - if (isRootEnsemble) { - iPtr->ensembleRewrite.sourceObjs = objv; - iPtr->ensembleRewrite.numRemovedObjs = 1; - iPtr->ensembleRewrite.numInsertedObjs = prefc; - } else { - iPtr->ensembleRewrite.numInsertedObjs += prefc - 1; - } - - /* - * We are sending a 0-refCount obj, do not need a callback: it will be - * cleaned up automatically. But we may need to clear the rootEnsemble - * stuff ... - */ - - if (isRootEnsemble) { + if (TclInitRewriteEnsemble(interp, 1, prefc, objv)) { TclNRAddCallback(interp, TclClearRootEnsemble, NULL, NULL, NULL, NULL); } TclSkipTailcall(interp); @@ -1866,7 +1850,7 @@ AliasObjCmd( Tcl_Obj **prefv, **cmdv; Tcl_Obj *cmdArr[ALIAS_CMDV_PREALLOC]; Interp *tPtr = (Interp *) targetInterp; - int isRootEnsemble = (tPtr->ensembleRewrite.sourceObjs == NULL); + int isRootEnsemble; /* * Append the arguments to the command prefix and invoke the command in @@ -1896,13 +1880,7 @@ AliasObjCmd( * only the source command should show, not the full target prefix. */ - if (isRootEnsemble) { - tPtr->ensembleRewrite.sourceObjs = objv; - tPtr->ensembleRewrite.numRemovedObjs = 1; - tPtr->ensembleRewrite.numInsertedObjs = prefc; - } else { - tPtr->ensembleRewrite.numInsertedObjs += prefc - 1; - } + isRootEnsemble = TclInitRewriteEnsemble((Tcl_Interp *)tPtr, 1, prefc, objv); /* * Protect the target interpreter if it isn't the same as the source @@ -1925,9 +1903,7 @@ AliasObjCmd( */ if (isRootEnsemble) { - tPtr->ensembleRewrite.sourceObjs = NULL; - tPtr->ensembleRewrite.numRemovedObjs = 0; - tPtr->ensembleRewrite.numInsertedObjs = 0; + TclResetRewriteEnsemble((Tcl_Interp *)tPtr, 1); } /* diff --git a/generic/tclOODefineCmds.c b/generic/tclOODefineCmds.c index c880754..64209a0 100644 --- a/generic/tclOODefineCmds.c +++ b/generic/tclOODefineCmds.c @@ -847,7 +847,6 @@ TclOODefineObjCmd( TclDecrRefCount(objNameObj); } else { Tcl_Obj *objPtr, *obj2Ptr, **objs; - Interp *iPtr = (Interp *) interp; Tcl_Command cmd; int dummy; @@ -861,18 +860,7 @@ TclOODefineObjCmd( * the moment. Ugly! */ - if (iPtr->ensembleRewrite.sourceObjs == NULL) { - iPtr->ensembleRewrite.sourceObjs = objv; - iPtr->ensembleRewrite.numRemovedObjs = 3; - iPtr->ensembleRewrite.numInsertedObjs = 1; - } else { - int ni = iPtr->ensembleRewrite.numInsertedObjs; - if (ni < 3) { - iPtr->ensembleRewrite.numRemovedObjs += 3 - ni; - } else { - iPtr->ensembleRewrite.numInsertedObjs -= 2; - } - } + TclInitRewriteEnsemble(interp, 3, 1, objv); /* * Build the list of arguments using a Tcl_Obj as a workspace. See @@ -962,7 +950,6 @@ TclOOObjDefObjCmd( TclDecrRefCount(objNameObj); } else { Tcl_Obj *objPtr, *obj2Ptr, **objs; - Interp *iPtr = (Interp *) interp; Tcl_Command cmd; int dummy; @@ -976,18 +963,7 @@ TclOOObjDefObjCmd( * the moment. Ugly! */ - if (iPtr->ensembleRewrite.sourceObjs == NULL) { - iPtr->ensembleRewrite.sourceObjs = objv; - iPtr->ensembleRewrite.numRemovedObjs = 3; - iPtr->ensembleRewrite.numInsertedObjs = 1; - } else { - int ni = iPtr->ensembleRewrite.numInsertedObjs; - if (ni < 3) { - iPtr->ensembleRewrite.numRemovedObjs += 3 - ni; - } else { - iPtr->ensembleRewrite.numInsertedObjs -= 2; - } - } + TclInitRewriteEnsemble(interp, 3, 1, objv); /* * Build the list of arguments using a Tcl_Obj as a workspace. See @@ -1077,7 +1053,6 @@ TclOODefineSelfObjCmd( TclDecrRefCount(objNameObj); } else { Tcl_Obj *objPtr, *obj2Ptr, **objs; - Interp *iPtr = (Interp *) interp; Tcl_Command cmd; int dummy; @@ -1091,18 +1066,7 @@ TclOODefineSelfObjCmd( * the moment. Ugly! */ - if (iPtr->ensembleRewrite.sourceObjs == NULL) { - iPtr->ensembleRewrite.sourceObjs = objv; - iPtr->ensembleRewrite.numRemovedObjs = 2; - iPtr->ensembleRewrite.numInsertedObjs = 1; - } else { - int ni = iPtr->ensembleRewrite.numInsertedObjs; - if (ni < 2) { - iPtr->ensembleRewrite.numRemovedObjs += 2 - ni; - } else { - iPtr->ensembleRewrite.numInsertedObjs -= 1; - } - } + TclInitRewriteEnsemble(interp, 2, 1, objv); /* * Build the list of arguments using a Tcl_Obj as a workspace. See diff --git a/generic/tclOOMethod.c b/generic/tclOOMethod.c index b86a203..843f833 100644 --- a/generic/tclOOMethod.c +++ b/generic/tclOOMethod.c @@ -732,7 +732,6 @@ InvokeProcedureMethod( * Now invoke the body of the method. */ -//fprintf(stdout, "eh? %p\n", ((Interp *)interp)->ensembleRewrite.sourceObjs); fflush(stdout); TclNRAddCallback(interp, FinalizePMCall, pmPtr, context, fdPtr, NULL); return TclNRInterpProcCore(interp, fdPtr->nameObj, Tcl_ObjectContextSkippedArgs(context), fdPtr->errProc); @@ -1595,12 +1594,9 @@ InitEnsembleRewrite( int *lengthPtr) /* Where to write the resulting length of the * array of rewritten arguments. */ { - Interp *iPtr = (Interp *) interp; - int isRootEnsemble = (iPtr->ensembleRewrite.sourceObjs == NULL); - Tcl_Obj **argObjs; unsigned len = rewriteLength + objc - toRewrite; + Tcl_Obj **argObjs = TclStackAlloc(interp, sizeof(Tcl_Obj *) * len); - argObjs = TclStackAlloc(interp, sizeof(Tcl_Obj *) * len); memcpy(argObjs, rewriteObjs, rewriteLength * sizeof(Tcl_Obj *)); memcpy(argObjs + rewriteLength, objv + toRewrite, sizeof(Tcl_Obj *) * (objc - toRewrite)); @@ -1614,22 +1610,9 @@ InitEnsembleRewrite( * (and unavoidably). */ - if (isRootEnsemble) { - iPtr->ensembleRewrite.sourceObjs = objv; - iPtr->ensembleRewrite.numRemovedObjs = toRewrite; - iPtr->ensembleRewrite.numInsertedObjs = rewriteLength; - } else { - int numIns = iPtr->ensembleRewrite.numInsertedObjs; - - if (numIns < toRewrite) { - iPtr->ensembleRewrite.numRemovedObjs += toRewrite - numIns; - iPtr->ensembleRewrite.numInsertedObjs += rewriteLength - 1; - } else { - iPtr->ensembleRewrite.numInsertedObjs += - rewriteLength - toRewrite; - } + if (TclInitRewriteEnsemble(interp, toRewrite, rewriteLength, objv)) { + TclNRAddCallback(interp, TclClearRootEnsemble, NULL, NULL, NULL, NULL); } - *lengthPtr = len; return argObjs; } diff --git a/generic/tclProc.c b/generic/tclProc.c index 1a3bdb7..56d29a2 100644 --- a/generic/tclProc.c +++ b/generic/tclProc.c @@ -22,7 +22,6 @@ */ typedef struct { - int isRootEnsemble; Command cmd; ExtraFrameInfo efi; } ApplyExtraData; @@ -2636,7 +2635,7 @@ TclNRApplyObjCmd( Interp *iPtr = (Interp *) interp; Proc *procPtr = NULL; Tcl_Obj *lambdaPtr, *nsObjPtr; - int result, isRootEnsemble; + int result; Tcl_Namespace *nsPtr; ApplyExtraData *extraPtr; @@ -2719,15 +2718,9 @@ TclNRApplyObjCmd( extraPtr->efi.fields[0].clientData = lambdaPtr; extraPtr->cmd.clientData = &extraPtr->efi; - isRootEnsemble = (iPtr->ensembleRewrite.sourceObjs == NULL); - if (isRootEnsemble) { - iPtr->ensembleRewrite.sourceObjs = objv; - iPtr->ensembleRewrite.numRemovedObjs = 1; - iPtr->ensembleRewrite.numInsertedObjs = 0; - } else { - iPtr->ensembleRewrite.numInsertedObjs -= 1; + if (TclInitRewriteEnsemble(interp, 1, 0, objv)) { + TclNRAddCallback(interp, TclClearRootEnsemble, NULL, NULL, NULL, NULL); } - extraPtr->isRootEnsemble = isRootEnsemble; result = TclPushProcCallFrame(procPtr, interp, objc, objv, 1); if (result == TCL_OK) { @@ -2745,10 +2738,6 @@ ApplyNR2( { ApplyExtraData *extraPtr = data[0]; - if (extraPtr->isRootEnsemble) { - ((Interp *) interp)->ensembleRewrite.sourceObjs = NULL; - } - TclStackFree(interp, extraPtr); return result; } -- cgit v0.12 From 7be6a12649deec9f9d70b5d1a53140b5e0be42e0 Mon Sep 17 00:00:00 2001 From: dgp Date: Wed, 25 May 2016 18:19:27 +0000 Subject: Put in some missing Resets. --- generic/tclExecute.c | 4 +++- generic/tclOODefineCmds.c | 22 ++++++++++++++++------ 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/generic/tclExecute.c b/generic/tclExecute.c index 80598c1..61d75cb 100644 --- a/generic/tclExecute.c +++ b/generic/tclExecute.c @@ -3174,7 +3174,9 @@ TEBCresume( } if (!TclInitRewriteEnsemble(interp, opnd, 1, objv)) { -//fprintf(stdout, "INVOKE: '%s'\n", Tcl_GetString(objPtr)); fflush(stdout); +fprintf(stdout, "SOURCE: '%s'\n", Tcl_GetString( + ((Interp *)interp)->ensembleRewrite.sourceObjs[0])); fflush(stdout); +fprintf(stdout, "INVOKE: '%s'\n", Tcl_GetString(objPtr)); fflush(stdout); Tcl_Panic("INST_INVOKE_REPLACE is not ensemble root"); } DECACHE_STACK_INFO(); diff --git a/generic/tclOODefineCmds.c b/generic/tclOODefineCmds.c index 64209a0..8747ff5 100644 --- a/generic/tclOODefineCmds.c +++ b/generic/tclOODefineCmds.c @@ -848,7 +848,7 @@ TclOODefineObjCmd( } else { Tcl_Obj *objPtr, *obj2Ptr, **objs; Tcl_Command cmd; - int dummy; + int isRoot, dummy; /* * More than one argument: fire them through the ensemble processing @@ -860,7 +860,7 @@ TclOODefineObjCmd( * the moment. Ugly! */ - TclInitRewriteEnsemble(interp, 3, 1, objv); + isRoot = TclInitRewriteEnsemble(interp, 3, 1, objv); /* * Build the list of arguments using a Tcl_Obj as a workspace. See @@ -882,6 +882,9 @@ TclOODefineObjCmd( Tcl_ListObjGetElements(NULL, objPtr, &dummy, &objs); result = Tcl_EvalObjv(interp, objc-2, objs, TCL_EVAL_INVOKE); + if (isRoot) { + TclResetRewriteEnsemble(interp, 1); + } Tcl_DecrRefCount(objPtr); } DelRef(oPtr); @@ -915,7 +918,7 @@ TclOOObjDefObjCmd( Tcl_Obj *const *objv) { Foundation *fPtr = TclOOGetFoundation(interp); - int result; + int isRoot, result; Object *oPtr; if (objc < 3) { @@ -963,7 +966,7 @@ TclOOObjDefObjCmd( * the moment. Ugly! */ - TclInitRewriteEnsemble(interp, 3, 1, objv); + isRoot = TclInitRewriteEnsemble(interp, 3, 1, objv); /* * Build the list of arguments using a Tcl_Obj as a workspace. See @@ -985,6 +988,10 @@ TclOOObjDefObjCmd( Tcl_ListObjGetElements(NULL, objPtr, &dummy, &objs); result = Tcl_EvalObjv(interp, objc-2, objs, TCL_EVAL_INVOKE); + + if (isRoot) { + TclResetRewriteEnsemble(interp, 1); + } Tcl_DecrRefCount(objPtr); } DelRef(oPtr); @@ -1054,7 +1061,7 @@ TclOODefineSelfObjCmd( } else { Tcl_Obj *objPtr, *obj2Ptr, **objs; Tcl_Command cmd; - int dummy; + int isRoot, dummy; /* * More than one argument: fire them through the ensemble processing @@ -1066,7 +1073,7 @@ TclOODefineSelfObjCmd( * the moment. Ugly! */ - TclInitRewriteEnsemble(interp, 2, 1, objv); + isRoot = TclInitRewriteEnsemble(interp, 2, 1, objv); /* * Build the list of arguments using a Tcl_Obj as a workspace. See @@ -1088,6 +1095,9 @@ TclOODefineSelfObjCmd( Tcl_ListObjGetElements(NULL, objPtr, &dummy, &objs); result = Tcl_EvalObjv(interp, objc-1, objs, TCL_EVAL_INVOKE); + if (isRoot) { + TclResetRewriteEnsemble(interp, 1); + } Tcl_DecrRefCount(objPtr); } DelRef(oPtr); -- cgit v0.12 From 7934310e9e0c4d8136a7eb664890ea86eeb6b322 Mon Sep 17 00:00:00 2001 From: dgp Date: Thu, 26 May 2016 00:00:37 +0000 Subject: Another missing reset --- generic/tclNamesp.c | 1 + 1 file changed, 1 insertion(+) diff --git a/generic/tclNamesp.c b/generic/tclNamesp.c index bad408e..543e089 100644 --- a/generic/tclNamesp.c +++ b/generic/tclNamesp.c @@ -3803,6 +3803,7 @@ NRNamespaceInscopeCmd( - iPtr->ensembleRewrite.numInsertedObjs; framePtr->objv = iPtr->ensembleRewrite.sourceObjs; } + TclResetRewriteEnsemble(interp, 1); /* * Execute the command. If there is just one argument, just treat it as a -- cgit v0.12 From fc6928c19cf817f90924816477e7646e3ab9ccb0 Mon Sep 17 00:00:00 2001 From: dgp Date: Thu, 26 May 2016 16:33:37 +0000 Subject: Reduce to minimum set of TclResetRewriteEnsemble() calls. --- generic/tclExecute.c | 2 ++ generic/tclNamesp.c | 2 -- generic/tclOOMethod.c | 5 +++++ generic/tclProc.c | 2 -- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/generic/tclExecute.c b/generic/tclExecute.c index 61d75cb..67eabdb 100644 --- a/generic/tclExecute.c +++ b/generic/tclExecute.c @@ -2081,6 +2081,8 @@ TclNRExecuteByteCode( * Push the callback for bytecode execution */ + TclResetRewriteEnsemble(interp, 1); + TclNRAddCallback(interp, TEBCresume, TD, /* pc */ NULL, /* cleanup */ INT2PTR(0), NULL); return TCL_OK; diff --git a/generic/tclNamesp.c b/generic/tclNamesp.c index 543e089..58a86d9 100644 --- a/generic/tclNamesp.c +++ b/generic/tclNamesp.c @@ -3362,7 +3362,6 @@ NRNamespaceEvalCmd( - iPtr->ensembleRewrite.numInsertedObjs; framePtr->objv = iPtr->ensembleRewrite.sourceObjs; } - TclResetRewriteEnsemble(interp, 1); if (objc == 3) { /* @@ -3803,7 +3802,6 @@ NRNamespaceInscopeCmd( - iPtr->ensembleRewrite.numInsertedObjs; framePtr->objv = iPtr->ensembleRewrite.sourceObjs; } - TclResetRewriteEnsemble(interp, 1); /* * Execute the command. If there is just one argument, just treat it as a diff --git a/generic/tclOOMethod.c b/generic/tclOOMethod.c index 843f833..a311ddb 100644 --- a/generic/tclOOMethod.c +++ b/generic/tclOOMethod.c @@ -1458,6 +1458,11 @@ InvokeForwardMethod( argObjs = InitEnsembleRewrite(interp, objc, objv, skip, numPrefixes, prefixObjs, &len); Tcl_NRAddCallback(interp, FinalizeForwardCall, argObjs, NULL, NULL, NULL); + /* + * NOTE: The combination of direct set of iPtr->lookupNsPtr and the use + * of the TCL_EVAL_NOERR flag results in an evaluation configuration + * very much like TCL_EVAL_INVOKE. + */ ((Interp *)interp)->lookupNsPtr = (Namespace *) contextPtr->oPtr->namespacePtr; return TclNREvalObjv(interp, len, argObjs, TCL_EVAL_NOERR, NULL); diff --git a/generic/tclProc.c b/generic/tclProc.c index 56d29a2..70178f4 100644 --- a/generic/tclProc.c +++ b/generic/tclProc.c @@ -1785,8 +1785,6 @@ TclNRInterpProcCore( * Invoke the commands in the procedure's body. */ - TclResetRewriteEnsemble(interp, 1); - procPtr->refCount++; codePtr = procPtr->bodyPtr->internalRep.twoPtrValue.ptr1; -- cgit v0.12 From 05d072329e0a598e85eae4e081b6ea129a13c0d3 Mon Sep 17 00:00:00 2001 From: dgp Date: Thu, 26 May 2016 17:27:56 +0000 Subject: constructor invocation ensemble rewrite shenanigans also fit into the refactored routines. --- generic/tclOO.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/generic/tclOO.c b/generic/tclOO.c index 9df5029..0454bfe 100644 --- a/generic/tclOO.c +++ b/generic/tclOO.c @@ -1687,7 +1687,7 @@ Tcl_NewObjectInstance( TclOOGetCallContext(oPtr, NULL, CONSTRUCTOR, NULL); if (contextPtr != NULL) { - int result; + int isRoot, result; Tcl_InterpState state; state = Tcl_SaveInterpState(interp, TCL_OK); @@ -1698,13 +1698,14 @@ Tcl_NewObjectInstance( * Adjust the ensmble tracking record if necessary. [Bug 3514761] */ - if (((Interp*) interp)->ensembleRewrite.sourceObjs) { - ((Interp*) interp)->ensembleRewrite.numInsertedObjs += skip-1; - ((Interp*) interp)->ensembleRewrite.numRemovedObjs += skip-1; - } + isRoot = TclInitRewriteEnsemble(interp, skip, skip, objv); result = Tcl_NRCallObjProc(interp, TclOOInvokeContext, contextPtr, objc, objv); + if (isRoot) { + TclResetRewriteEnsemble(interp, 1); + } + /* * It's an error if the object was whacked in the constructor. * Force this if it isn't already an error (don't want to lose @@ -1827,9 +1828,8 @@ TclNRNewObjectInstance( * Adjust the ensmble tracking record if necessary. [Bug 3514761] */ - if (((Interp *) interp)->ensembleRewrite.sourceObjs) { - ((Interp *) interp)->ensembleRewrite.numInsertedObjs += skip - 1; - ((Interp *) interp)->ensembleRewrite.numRemovedObjs += skip - 1; + if (TclInitRewriteEnsemble(interp, skip, skip, objv)) { + TclNRAddCallback(interp, TclClearRootEnsemble, NULL, NULL, NULL, NULL); } /* -- cgit v0.12 From e7a661cb7c9005f267a6f4a6bd8e29dab1e91f61 Mon Sep 17 00:00:00 2001 From: dgp Date: Thu, 26 May 2016 17:29:34 +0000 Subject: excise debug scaffolding --- generic/tclExecute.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/generic/tclExecute.c b/generic/tclExecute.c index 67eabdb..aed6a48 100644 --- a/generic/tclExecute.c +++ b/generic/tclExecute.c @@ -3175,12 +3175,7 @@ TEBCresume( ArgumentBCEnter(interp, codePtr, TD, pc, objc, objv); } - if (!TclInitRewriteEnsemble(interp, opnd, 1, objv)) { -fprintf(stdout, "SOURCE: '%s'\n", Tcl_GetString( - ((Interp *)interp)->ensembleRewrite.sourceObjs[0])); fflush(stdout); -fprintf(stdout, "INVOKE: '%s'\n", Tcl_GetString(objPtr)); fflush(stdout); - Tcl_Panic("INST_INVOKE_REPLACE is not ensemble root"); - } + TclInitRewriteEnsemble(interp, opnd, 1, objv); DECACHE_STACK_INFO(); pc += 6; TEBC_YIELD(); -- cgit v0.12 From 87d7d0f11c17176fdca0ff935983866a2f9ec3aa Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Thu, 2 Jun 2016 12:27:55 +0000 Subject: (cherry-pick) Merge TIP #447: Execution Time Verbosity Levels in tcltest::configure. Tcltest 2.3.8 -> 2.4.0. --- doc/tcltest.n | 14 ++++++++++++-- library/tcltest/pkgIndex.tcl | 2 +- library/tcltest/tcltest.tcl | 36 +++++++++++++++++++++++++++++++----- unix/Makefile.in | 4 ++-- win/Makefile.in | 4 ++-- 5 files changed, 48 insertions(+), 12 deletions(-) diff --git a/doc/tcltest.n b/doc/tcltest.n index cedc763..05c1922 100644 --- a/doc/tcltest.n +++ b/doc/tcltest.n @@ -872,8 +872,8 @@ harness are doing. . Sets the type of output verbosity desired to \fIlevel\fR, a list of zero or more of the elements \fBbody\fR, \fBpass\fR, -\fBskip\fR, \fBstart\fR, \fBerror\fR and \fBline\fR. Default value -is +\fBskip\fR, \fBstart\fR, \fBerror\fR, \fBline\fR, \fBmsec\fR and \fBusec\fR. +Default value is .QW "\fBbody error\fR" . Levels are defined as: .RS @@ -890,6 +890,16 @@ Print errorInfo and errorCode, if they exist, when a test return code does not match its expected return code .IP "line (\fBl\fR)" Print source file line information of failed tests +.IP "msec (\fBm\fR)" +Print each test's execution time in milliseconds +.IP "usec (\fBu\fR)" +Print each test's execution time in microseconds +.PP +Note that the \fBmsec\fR and \fBusec\fR verbosity levels are provided as +indicative measures only. They do not tackle the problem of repeatibility which +should be considered in performance tests or benchmarks. To use these verbosity +levels to thoroughly track performance degradations, consider wrapping your +test bodies with \fBtime\fR commands. .PP The single letter abbreviations noted above are also recognized so that diff --git a/library/tcltest/pkgIndex.tcl b/library/tcltest/pkgIndex.tcl index 987725f..5ac8823 100644 --- a/library/tcltest/pkgIndex.tcl +++ b/library/tcltest/pkgIndex.tcl @@ -9,4 +9,4 @@ # full path name of this file's directory. if {![package vsatisfies [package provide Tcl] 8.5]} {return} -package ifneeded tcltest 2.3.8 [list source [file join $dir tcltest.tcl]] +package ifneeded tcltest 2.4.0 [list source [file join $dir tcltest.tcl]] diff --git a/library/tcltest/tcltest.tcl b/library/tcltest/tcltest.tcl index 29ef778..169b7d4 100644 --- a/library/tcltest/tcltest.tcl +++ b/library/tcltest/tcltest.tcl @@ -22,7 +22,7 @@ namespace eval tcltest { # When the version number changes, be sure to update the pkgIndex.tcl file, # and the install directory in the Makefiles. When the minor version # changes (new feature) be sure to update the man page as well. - variable Version 2.3.8 + variable Version 2.4.0 # Compatibility support for dumb variables defined in tcltest 1 # Do not use these. Call [package provide Tcl] and [info patchlevel] @@ -611,16 +611,27 @@ namespace eval tcltest { proc AcceptVerbose { level } { set level [AcceptList $level] + set levelMap { + l list + p pass + b body + s skip + t start + e error + l line + m msec + u usec + } + set levelRegexp "^([join [dict values $levelMap] |])\$" if {[llength $level] == 1} { - if {![regexp {^(pass|body|skip|start|error|line)$} $level]} { + if {![regexp $levelRegexp $level]} { # translate single characters abbreviations to expanded list - set level [string map {p pass b body s skip t start e error l line} \ - [split $level {}]] + set level [string map $levelMap [split $level {}]] } } set valid [list] foreach v $level { - if {[regexp {^(pass|body|skip|start|error|line)$} $v]} { + if {[regexp $levelRegexp $v]} { lappend valid $v } } @@ -1972,6 +1983,11 @@ proc tcltest::test {name description args} { # Only run the test body if the setup was successful if {!$setupFailure} { + # Register startup time + if {[IsVerbose msec] || [IsVerbose usec]} { + set timeStart [clock microseconds] + } + # Verbose notification of $body start if {[IsVerbose start]} { puts [outputChannel] "---- $name start" @@ -2076,6 +2092,16 @@ proc tcltest::test {name description args} { } } + if {[IsVerbose msec] || [IsVerbose usec]} { + set t [expr {[clock microseconds] - $timeStart}] + if {[IsVerbose usec]} { + puts [outputChannel] "++++ $name took $t μs" + } + if {[IsVerbose msec]} { + puts [outputChannel] "++++ $name took [expr {round($t/1000.)}] ms" + } + } + # if we didn't experience any failures, then we passed variable numTests if {!($setupFailure || $cleanupFailure || $coreFailure diff --git a/unix/Makefile.in b/unix/Makefile.in index b336074..7b3d820 100644 --- a/unix/Makefile.in +++ b/unix/Makefile.in @@ -849,8 +849,8 @@ install-libraries: libraries done; @echo "Installing package msgcat 1.6.0 as a Tcl Module"; @$(INSTALL_DATA) $(TOP_DIR)/library/msgcat/msgcat.tcl "$(SCRIPT_INSTALL_DIR)"/../tcl8/8.5/msgcat-1.6.0.tm; - @echo "Installing package tcltest 2.3.8 as a Tcl Module"; - @$(INSTALL_DATA) $(TOP_DIR)/library/tcltest/tcltest.tcl "$(SCRIPT_INSTALL_DIR)"/../tcl8/8.5/tcltest-2.3.8.tm; + @echo "Installing package tcltest 2.4.0 as a Tcl Module"; + @$(INSTALL_DATA) $(TOP_DIR)/library/tcltest/tcltest.tcl "$(SCRIPT_INSTALL_DIR)"/../tcl8/8.5/tcltest-2.4.0.tm; @echo "Installing package platform 1.0.14 as a Tcl Module"; @$(INSTALL_DATA) $(TOP_DIR)/library/platform/platform.tcl "$(SCRIPT_INSTALL_DIR)"/../tcl8/8.4/platform-1.0.14.tm; diff --git a/win/Makefile.in b/win/Makefile.in index cf72e1c..28ffe0a 100644 --- a/win/Makefile.in +++ b/win/Makefile.in @@ -660,8 +660,8 @@ install-libraries: libraries install-tzdata install-msgs done; @echo "Installing package msgcat 1.6.0 as a Tcl Module"; @$(COPY) $(ROOT_DIR)/library/msgcat/msgcat.tcl $(SCRIPT_INSTALL_DIR)/../tcl8/8.5/msgcat-1.6.0.tm; - @echo "Installing package tcltest 2.3.8 as a Tcl Module"; - @$(COPY) $(ROOT_DIR)/library/tcltest/tcltest.tcl $(SCRIPT_INSTALL_DIR)/../tcl8/8.5/tcltest-2.3.8.tm; + @echo "Installing package tcltest 2.4.0 as a Tcl Module"; + @$(COPY) $(ROOT_DIR)/library/tcltest/tcltest.tcl $(SCRIPT_INSTALL_DIR)/../tcl8/8.5/tcltest-2.4.0.tm; @echo "Installing package platform 1.0.14 as a Tcl Module"; @$(COPY) $(ROOT_DIR)/library/platform/platform.tcl $(SCRIPT_INSTALL_DIR)/../tcl8/8.4/platform-1.0.14.tm; @echo "Installing package platform::shell 1.1.4 as a Tcl Module"; -- cgit v0.12 From db70eaab0c68492bd005fd53714af9996947cd9f Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Thu, 2 Jun 2016 14:54:38 +0000 Subject: Fix [e14c77b845]: Compilation error over typedef. --- generic/tclInt.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/generic/tclInt.h b/generic/tclInt.h index 42c13dd..fa91528 100644 --- a/generic/tclInt.h +++ b/generic/tclInt.h @@ -48,7 +48,9 @@ #else #include #endif -#ifdef STDC_HEADERS +#if defined(_WIN32) +#include +#elif defined(STDC_HEADERS) #include #else typedef int ptrdiff_t; -- cgit v0.12 From 8afdb9286632c44763fe2b168b72cc6606ac52d4 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Thu, 9 Jun 2016 11:38:54 +0000 Subject: Fix [e14c77b845] for MSVC6: Compilation error over typedef --- generic/tclDate.c | 8 +------- generic/tclInt.h | 5 ++--- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/generic/tclDate.c b/generic/tclDate.c index 6222a8a..e4dd000 100644 --- a/generic/tclDate.c +++ b/generic/tclDate.c @@ -359,14 +359,8 @@ typedef short int yytype_int16; #ifndef YYSIZE_T # ifdef __SIZE_TYPE__ # define YYSIZE_T __SIZE_TYPE__ -# elif defined size_t -# define YYSIZE_T size_t -# elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -# include /* INFRINGES ON USER NAME SPACE */ -# define YYSIZE_T size_t # else -# define YYSIZE_T unsigned int +# define YYSIZE_T size_t # endif #endif diff --git a/generic/tclInt.h b/generic/tclInt.h index fa91528..7ea37bb 100644 --- a/generic/tclInt.h +++ b/generic/tclInt.h @@ -48,9 +48,8 @@ #else #include #endif -#if defined(_WIN32) -#include -#elif defined(STDC_HEADERS) +#if defined(STDC_HEADERS) || defined(__STDC__) || defined(__C99__FUNC__) \ + || defined(__cplusplus) || defined(_MSC_VER) #include #else typedef int ptrdiff_t; -- cgit v0.12 From b453d7479061b4f7fee8c55e790deab9f3e16de0 Mon Sep 17 00:00:00 2001 From: dgp Date: Fri, 10 Jun 2016 13:43:13 +0000 Subject: Corrects reported bug, but makes many tests fail. Something subtle about what we should expect when recording the line of a command that isn't known until runtime. --- generic/tclCompile.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/generic/tclCompile.c b/generic/tclCompile.c index 5030f89..8cdd9d2 100644 --- a/generic/tclCompile.c +++ b/generic/tclCompile.c @@ -2602,8 +2602,12 @@ EnterCmdWordData( TclAdvanceLines (&wordLine, last, tokenPtr->start); TclAdvanceContinuations (&wordLine, &wordNext, tokenPtr->start - envPtr->source); +#if 0 wwlines[wordIdx] = (TclWordKnownAtCompileTime(tokenPtr, NULL) ? wordLine : -1); +#else + wwlines[wordIdx] = wordLine; +#endif ePtr->line[wordIdx] = wordLine; ePtr->next[wordIdx] = wordNext; last = tokenPtr->start; -- cgit v0.12 From e83f835a195b90a303657bda68904f37b14b50aa Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Tue, 14 Jun 2016 09:12:46 +0000 Subject: (cherry-pick): Fix [e14c77b845]: Compilation error over typedef. --- generic/tclDate.c | 8 +------- generic/tclInt.h | 3 ++- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/generic/tclDate.c b/generic/tclDate.c index 0bda22f..1adcf1e 100644 --- a/generic/tclDate.c +++ b/generic/tclDate.c @@ -359,14 +359,8 @@ typedef short int yytype_int16; #ifndef YYSIZE_T # ifdef __SIZE_TYPE__ # define YYSIZE_T __SIZE_TYPE__ -# elif defined size_t -# define YYSIZE_T size_t -# elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -# include /* INFRINGES ON USER NAME SPACE */ -# define YYSIZE_T size_t # else -# define YYSIZE_T unsigned int +# define YYSIZE_T size_t # endif #endif diff --git a/generic/tclInt.h b/generic/tclInt.h index 18574c3..6113f23 100644 --- a/generic/tclInt.h +++ b/generic/tclInt.h @@ -48,7 +48,8 @@ #else #include #endif -#ifdef STDC_HEADERS +#if defined(STDC_HEADERS) || defined(__STDC__) || defined(__C99__FUNC__) \ + || defined(__cplusplus) || defined(_MSC_VER) #include #else typedef int ptrdiff_t; -- cgit v0.12 From acdd236f96616d9dd6707bc56fffacf95cb81b6a Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Tue, 14 Jun 2016 09:55:03 +0000 Subject: Fix [7393be0be6e7f91cbb2016fa777896e3895929e3|7393be0be6]: Tcl Thread library doesn't work in Debug build on Windows_x64 --- win/tclWinThrd.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/win/tclWinThrd.c b/win/tclWinThrd.c index 2413a78..7828e65 100644 --- a/win/tclWinThrd.c +++ b/win/tclWinThrd.c @@ -167,7 +167,6 @@ TclWinThreadStart( * from TclpThreadCreate */ { WinThread *winThreadPtr = (WinThread *) lpParameter; - unsigned int fpmask; LPTHREAD_START_ROUTINE lpOrigStartAddress; LPVOID lpOrigParameter; @@ -175,13 +174,11 @@ TclWinThreadStart( return TCL_ERROR; } - fpmask = _MCW_EM | _MCW_RC | _MCW_PC; - -#if defined(_MSC_VER) && _MSC_VER >= 1200 - fpmask |= _MCW_DN; + _controlfp(winThreadPtr->fpControl, _MCW_EM | _MCW_RC | 0x03000000 /* _MCW_DN */ +#if !defined(_WIN64) + | _MCW_PC #endif - - _controlfp(winThreadPtr->fpControl, fpmask); + ); lpOrigStartAddress = winThreadPtr->lpStartAddress; lpOrigParameter = winThreadPtr->lpParameter; -- cgit v0.12 From c755ef08151343eb145710489f8c999edbef15ff Mon Sep 17 00:00:00 2001 From: dgp Date: Thu, 16 Jun 2016 14:23:15 +0000 Subject: [16828b3744] Prototype fix for merging forward. --- generic/tclEvent.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/generic/tclEvent.c b/generic/tclEvent.c index ba2bb64..4de8f0b 100644 --- a/generic/tclEvent.c +++ b/generic/tclEvent.c @@ -1451,6 +1451,11 @@ VwaitVarProc( int *donePtr = clientData; *donePtr = 1; + + Tcl_UntraceVar(interp, name1, + TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS, + VwaitVarProc, clientData); + return NULL; } -- cgit v0.12 From 95fb48bf07be37ad0717475514d2c444602a0a6c Mon Sep 17 00:00:00 2001 From: dgp Date: Thu, 16 Jun 2016 16:14:28 +0000 Subject: Correct the patch. --- generic/tclEvent.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/generic/tclEvent.c b/generic/tclEvent.c index 95fbf79..906ecbb 100644 --- a/generic/tclEvent.c +++ b/generic/tclEvent.c @@ -1457,11 +1457,8 @@ VwaitVarProc( int *donePtr = clientData; *donePtr = 1; - - Tcl_UntraceVar(interp, name1, - TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS, + Tcl_UntraceVar(interp, name1, TCL_TRACE_WRITES|TCL_TRACE_UNSETS, VwaitVarProc, clientData); - return NULL; } -- cgit v0.12 From ac2ab0075f3bd2da55b9eb003f12455ca981df21 Mon Sep 17 00:00:00 2001 From: dgp Date: Thu, 16 Jun 2016 16:59:09 +0000 Subject: Improve fix and add test. --- generic/tclCompile.c | 7 ++----- tests/info.test | 17 +++++++++++++++++ 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/generic/tclCompile.c b/generic/tclCompile.c index 8cdd9d2..31e69ad 100644 --- a/generic/tclCompile.c +++ b/generic/tclCompile.c @@ -2602,12 +2602,9 @@ EnterCmdWordData( TclAdvanceLines (&wordLine, last, tokenPtr->start); TclAdvanceContinuations (&wordLine, &wordNext, tokenPtr->start - envPtr->source); -#if 0 wwlines[wordIdx] = - (TclWordKnownAtCompileTime(tokenPtr, NULL) ? wordLine : -1); -#else - wwlines[wordIdx] = wordLine; -#endif + ((wordIdx == 0) || TclWordKnownAtCompileTime(tokenPtr, NULL)) + ? wordLine : -1; ePtr->line[wordIdx] = wordLine; ePtr->next[wordIdx] = wordNext; last = tokenPtr->start; diff --git a/tests/info.test b/tests/info.test index 937da8c..d30bf9a 100644 --- a/tests/info.test +++ b/tests/info.test @@ -1818,6 +1818,23 @@ test info-38.2 {location information for uplevel, dl, direct-literal} -match glo * {type source line 1814 file info.test cmd etrace level 1} * {type source line 1812 file info.test cmd uplevel\\ \\\\ level 1}} -cleanup {interp delete sub} +test info-39.0 {Bug 4b61afd660} -setup { + proc probe {} { + return [dict get [info frame -1] line] + } + set body { + set cmd probe + $cmd + } + proc demo {} $body +} -body { + demo +} -cleanup { + unset -nocomplain body + rename demo {} + rename probe {} +} -result 3 + # cleanup catch {namespace delete test_ns_info1 test_ns_info2} ::tcltest::cleanupTests -- cgit v0.12 From 624ec168ecde5fbdbe83e4e7c558805b408fabcc Mon Sep 17 00:00:00 2001 From: dgp Date: Thu, 16 Jun 2016 17:06:25 +0000 Subject: [16828b3744] [vwait] *must* successfully undo its variable trace, or else it risks corrupting memory. Namespace teardown complexities were giving the traces an opportunity to survive. Added another (arguably better) Tcl_UntraceVar() call to be sure we avoid this problem. --- generic/tclEvent.c | 2 ++ tests/event.test | 9 +++++++++ 2 files changed, 11 insertions(+) diff --git a/generic/tclEvent.c b/generic/tclEvent.c index c664b38..4db524c 100644 --- a/generic/tclEvent.c +++ b/generic/tclEvent.c @@ -1379,6 +1379,8 @@ VwaitVarProc( int *donePtr = (int *) clientData; *donePtr = 1; + Tcl_UntraceVar(interp, name1, TCL_TRACE_WRITES|TCL_TRACE_UNSETS, + VwaitVarProc, clientData); return NULL; } diff --git a/tests/event.test b/tests/event.test index a7122f9..4996b97 100644 --- a/tests/event.test +++ b/tests/event.test @@ -559,6 +559,15 @@ test event-11.6 {Tcl_VwaitCmd procedure: round robin scheduling, same source} { removeFile $test2file list $x $y $z } {3 3 done} +test event-11.7 {Bug 16828b3744} { + after idle { + set ::t::v 1 + namespace delete ::t + } + namespace eval ::t { + vwait ::t::v + } +} {} test event-12.1 {Tcl_UpdateCmd procedure} { -- cgit v0.12 From b4bfd9a64a9a53cfbbd8a729a9a7ce7a0bcf95d0 Mon Sep 17 00:00:00 2001 From: dgp Date: Mon, 20 Jun 2016 19:23:17 +0000 Subject: [c383ebb5e4] Match DStringInit and DStringFree properly. --- generic/tclFileName.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generic/tclFileName.c b/generic/tclFileName.c index 39bac99..bf463f5 100644 --- a/generic/tclFileName.c +++ b/generic/tclFileName.c @@ -1595,8 +1595,8 @@ Tcl_GlobObjCmd( } else if (dir == PATH_GENERAL) { Tcl_DString str; + Tcl_DStringInit(&str); for (i = 0; i < objc; i++) { - Tcl_DStringInit(&str); if (dir == PATH_GENERAL) { TclDStringAppendDString(&str, &prefix); } -- cgit v0.12 From 4ca2f26fbcf054a93c71bb226f374e1b7d4fa698 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Tue, 21 Jun 2016 09:57:14 +0000 Subject: Upgrade internal Unicode tables to Unicode 9.0 --- generic/regc_locale.c | 393 ++++++------ generic/tclUniData.c | 1615 +++++++++++++++++++++++++------------------------ 2 files changed, 1035 insertions(+), 973 deletions(-) diff --git a/generic/regc_locale.c b/generic/regc_locale.c index 2a4248e..6444b55 100644 --- a/generic/regc_locale.c +++ b/generic/regc_locale.c @@ -140,35 +140,36 @@ static const crange alphaRangeTable[] = { {0x3f7, 0x481}, {0x48a, 0x52f}, {0x531, 0x556}, {0x561, 0x587}, {0x5d0, 0x5ea}, {0x5f0, 0x5f2}, {0x620, 0x64a}, {0x671, 0x6d3}, {0x6fa, 0x6fc}, {0x712, 0x72f}, {0x74d, 0x7a5}, {0x7ca, 0x7ea}, - {0x800, 0x815}, {0x840, 0x858}, {0x8a0, 0x8b4}, {0x904, 0x939}, - {0x958, 0x961}, {0x971, 0x980}, {0x985, 0x98c}, {0x993, 0x9a8}, - {0x9aa, 0x9b0}, {0x9b6, 0x9b9}, {0x9df, 0x9e1}, {0xa05, 0xa0a}, - {0xa13, 0xa28}, {0xa2a, 0xa30}, {0xa59, 0xa5c}, {0xa72, 0xa74}, - {0xa85, 0xa8d}, {0xa8f, 0xa91}, {0xa93, 0xaa8}, {0xaaa, 0xab0}, - {0xab5, 0xab9}, {0xb05, 0xb0c}, {0xb13, 0xb28}, {0xb2a, 0xb30}, - {0xb35, 0xb39}, {0xb5f, 0xb61}, {0xb85, 0xb8a}, {0xb8e, 0xb90}, - {0xb92, 0xb95}, {0xba8, 0xbaa}, {0xbae, 0xbb9}, {0xc05, 0xc0c}, - {0xc0e, 0xc10}, {0xc12, 0xc28}, {0xc2a, 0xc39}, {0xc58, 0xc5a}, - {0xc85, 0xc8c}, {0xc8e, 0xc90}, {0xc92, 0xca8}, {0xcaa, 0xcb3}, - {0xcb5, 0xcb9}, {0xd05, 0xd0c}, {0xd0e, 0xd10}, {0xd12, 0xd3a}, - {0xd5f, 0xd61}, {0xd7a, 0xd7f}, {0xd85, 0xd96}, {0xd9a, 0xdb1}, - {0xdb3, 0xdbb}, {0xdc0, 0xdc6}, {0xe01, 0xe30}, {0xe40, 0xe46}, - {0xe94, 0xe97}, {0xe99, 0xe9f}, {0xea1, 0xea3}, {0xead, 0xeb0}, - {0xec0, 0xec4}, {0xedc, 0xedf}, {0xf40, 0xf47}, {0xf49, 0xf6c}, - {0xf88, 0xf8c}, {0x1000, 0x102a}, {0x1050, 0x1055}, {0x105a, 0x105d}, - {0x106e, 0x1070}, {0x1075, 0x1081}, {0x10a0, 0x10c5}, {0x10d0, 0x10fa}, - {0x10fc, 0x1248}, {0x124a, 0x124d}, {0x1250, 0x1256}, {0x125a, 0x125d}, - {0x1260, 0x1288}, {0x128a, 0x128d}, {0x1290, 0x12b0}, {0x12b2, 0x12b5}, - {0x12b8, 0x12be}, {0x12c2, 0x12c5}, {0x12c8, 0x12d6}, {0x12d8, 0x1310}, - {0x1312, 0x1315}, {0x1318, 0x135a}, {0x1380, 0x138f}, {0x13a0, 0x13f5}, - {0x13f8, 0x13fd}, {0x1401, 0x166c}, {0x166f, 0x167f}, {0x1681, 0x169a}, - {0x16a0, 0x16ea}, {0x16f1, 0x16f8}, {0x1700, 0x170c}, {0x170e, 0x1711}, - {0x1720, 0x1731}, {0x1740, 0x1751}, {0x1760, 0x176c}, {0x176e, 0x1770}, - {0x1780, 0x17b3}, {0x1820, 0x1877}, {0x1880, 0x18a8}, {0x18b0, 0x18f5}, - {0x1900, 0x191e}, {0x1950, 0x196d}, {0x1970, 0x1974}, {0x1980, 0x19ab}, - {0x19b0, 0x19c9}, {0x1a00, 0x1a16}, {0x1a20, 0x1a54}, {0x1b05, 0x1b33}, - {0x1b45, 0x1b4b}, {0x1b83, 0x1ba0}, {0x1bba, 0x1be5}, {0x1c00, 0x1c23}, - {0x1c4d, 0x1c4f}, {0x1c5a, 0x1c7d}, {0x1ce9, 0x1cec}, {0x1cee, 0x1cf1}, + {0x800, 0x815}, {0x840, 0x858}, {0x8a0, 0x8b4}, {0x8b6, 0x8bd}, + {0x904, 0x939}, {0x958, 0x961}, {0x971, 0x980}, {0x985, 0x98c}, + {0x993, 0x9a8}, {0x9aa, 0x9b0}, {0x9b6, 0x9b9}, {0x9df, 0x9e1}, + {0xa05, 0xa0a}, {0xa13, 0xa28}, {0xa2a, 0xa30}, {0xa59, 0xa5c}, + {0xa72, 0xa74}, {0xa85, 0xa8d}, {0xa8f, 0xa91}, {0xa93, 0xaa8}, + {0xaaa, 0xab0}, {0xab5, 0xab9}, {0xb05, 0xb0c}, {0xb13, 0xb28}, + {0xb2a, 0xb30}, {0xb35, 0xb39}, {0xb5f, 0xb61}, {0xb85, 0xb8a}, + {0xb8e, 0xb90}, {0xb92, 0xb95}, {0xba8, 0xbaa}, {0xbae, 0xbb9}, + {0xc05, 0xc0c}, {0xc0e, 0xc10}, {0xc12, 0xc28}, {0xc2a, 0xc39}, + {0xc58, 0xc5a}, {0xc85, 0xc8c}, {0xc8e, 0xc90}, {0xc92, 0xca8}, + {0xcaa, 0xcb3}, {0xcb5, 0xcb9}, {0xd05, 0xd0c}, {0xd0e, 0xd10}, + {0xd12, 0xd3a}, {0xd54, 0xd56}, {0xd5f, 0xd61}, {0xd7a, 0xd7f}, + {0xd85, 0xd96}, {0xd9a, 0xdb1}, {0xdb3, 0xdbb}, {0xdc0, 0xdc6}, + {0xe01, 0xe30}, {0xe40, 0xe46}, {0xe94, 0xe97}, {0xe99, 0xe9f}, + {0xea1, 0xea3}, {0xead, 0xeb0}, {0xec0, 0xec4}, {0xedc, 0xedf}, + {0xf40, 0xf47}, {0xf49, 0xf6c}, {0xf88, 0xf8c}, {0x1000, 0x102a}, + {0x1050, 0x1055}, {0x105a, 0x105d}, {0x106e, 0x1070}, {0x1075, 0x1081}, + {0x10a0, 0x10c5}, {0x10d0, 0x10fa}, {0x10fc, 0x1248}, {0x124a, 0x124d}, + {0x1250, 0x1256}, {0x125a, 0x125d}, {0x1260, 0x1288}, {0x128a, 0x128d}, + {0x1290, 0x12b0}, {0x12b2, 0x12b5}, {0x12b8, 0x12be}, {0x12c2, 0x12c5}, + {0x12c8, 0x12d6}, {0x12d8, 0x1310}, {0x1312, 0x1315}, {0x1318, 0x135a}, + {0x1380, 0x138f}, {0x13a0, 0x13f5}, {0x13f8, 0x13fd}, {0x1401, 0x166c}, + {0x166f, 0x167f}, {0x1681, 0x169a}, {0x16a0, 0x16ea}, {0x16f1, 0x16f8}, + {0x1700, 0x170c}, {0x170e, 0x1711}, {0x1720, 0x1731}, {0x1740, 0x1751}, + {0x1760, 0x176c}, {0x176e, 0x1770}, {0x1780, 0x17b3}, {0x1820, 0x1877}, + {0x1880, 0x1884}, {0x1887, 0x18a8}, {0x18b0, 0x18f5}, {0x1900, 0x191e}, + {0x1950, 0x196d}, {0x1970, 0x1974}, {0x1980, 0x19ab}, {0x19b0, 0x19c9}, + {0x1a00, 0x1a16}, {0x1a20, 0x1a54}, {0x1b05, 0x1b33}, {0x1b45, 0x1b4b}, + {0x1b83, 0x1ba0}, {0x1bba, 0x1be5}, {0x1c00, 0x1c23}, {0x1c4d, 0x1c4f}, + {0x1c5a, 0x1c7d}, {0x1c80, 0x1c88}, {0x1ce9, 0x1cec}, {0x1cee, 0x1cf1}, {0x1d00, 0x1dbf}, {0x1e00, 0x1f15}, {0x1f18, 0x1f1d}, {0x1f20, 0x1f45}, {0x1f48, 0x1f4d}, {0x1f50, 0x1f57}, {0x1f5f, 0x1f7d}, {0x1f80, 0x1fb4}, {0x1fb6, 0x1fbc}, {0x1fc2, 0x1fc4}, {0x1fc6, 0x1fcc}, {0x1fd0, 0x1fd3}, @@ -183,7 +184,7 @@ static const crange alphaRangeTable[] = { {0x3131, 0x318e}, {0x31a0, 0x31ba}, {0x31f0, 0x31ff}, {0x3400, 0x4db5}, {0x4e00, 0x9fd5}, {0xa000, 0xa48c}, {0xa4d0, 0xa4fd}, {0xa500, 0xa60c}, {0xa610, 0xa61f}, {0xa640, 0xa66e}, {0xa67f, 0xa69d}, {0xa6a0, 0xa6e5}, - {0xa717, 0xa71f}, {0xa722, 0xa788}, {0xa78b, 0xa7ad}, {0xa7b0, 0xa7b7}, + {0xa717, 0xa71f}, {0xa722, 0xa788}, {0xa78b, 0xa7ae}, {0xa7b0, 0xa7b7}, {0xa7f7, 0xa801}, {0xa803, 0xa805}, {0xa807, 0xa80a}, {0xa80c, 0xa822}, {0xa840, 0xa873}, {0xa882, 0xa8b3}, {0xa8f2, 0xa8f7}, {0xa90a, 0xa925}, {0xa930, 0xa946}, {0xa960, 0xa97c}, {0xa984, 0xa9b2}, {0xa9e0, 0xa9e4}, @@ -193,6 +194,8 @@ static const crange alphaRangeTable[] = { {0xab09, 0xab0e}, {0xab11, 0xab16}, {0xab20, 0xab26}, {0xab28, 0xab2e}, {0xab30, 0xab5a}, {0xab5c, 0xab65}, {0xab70, 0xabe2}, {0xac00, 0xd7a3}, {0xd7b0, 0xd7c6}, {0xd7cb, 0xd7fb}, {0xdc00, 0xdc3e}, {0xdc40, 0xdc7e}, + {0xdc80, 0xdcbe}, {0xdcc0, 0xdcfe}, {0xdd00, 0xdd3e}, {0xdd40, 0xdd7e}, + {0xdd80, 0xddbe}, {0xddc0, 0xddfe}, {0xde00, 0xde3e}, {0xde40, 0xde7e}, {0xde80, 0xdebe}, {0xdec0, 0xdefe}, {0xdf00, 0xdf3e}, {0xdf40, 0xdf7e}, {0xdf80, 0xdfbe}, {0xdfc0, 0xdffe}, {0xf900, 0xfa6d}, {0xfa70, 0xfad9}, {0xfb00, 0xfb06}, {0xfb13, 0xfb17}, {0xfb1f, 0xfb28}, {0xfb2a, 0xfb36}, @@ -205,36 +208,38 @@ static const crange alphaRangeTable[] = { {0x10050, 0x1005d}, {0x10080, 0x100fa}, {0x10280, 0x1029c}, {0x102a0, 0x102d0}, {0x10300, 0x1031f}, {0x10330, 0x10340}, {0x10342, 0x10349}, {0x10350, 0x10375}, {0x10380, 0x1039d}, {0x103a0, 0x103c3}, {0x103c8, 0x103cf}, {0x10400, 0x1049d}, - {0x10500, 0x10527}, {0x10530, 0x10563}, {0x10600, 0x10736}, {0x10740, 0x10755}, - {0x10760, 0x10767}, {0x10800, 0x10805}, {0x1080a, 0x10835}, {0x1083f, 0x10855}, - {0x10860, 0x10876}, {0x10880, 0x1089e}, {0x108e0, 0x108f2}, {0x10900, 0x10915}, - {0x10920, 0x10939}, {0x10980, 0x109b7}, {0x10a10, 0x10a13}, {0x10a15, 0x10a17}, - {0x10a19, 0x10a33}, {0x10a60, 0x10a7c}, {0x10a80, 0x10a9c}, {0x10ac0, 0x10ac7}, - {0x10ac9, 0x10ae4}, {0x10b00, 0x10b35}, {0x10b40, 0x10b55}, {0x10b60, 0x10b72}, - {0x10b80, 0x10b91}, {0x10c00, 0x10c48}, {0x10c80, 0x10cb2}, {0x10cc0, 0x10cf2}, - {0x11003, 0x11037}, {0x11083, 0x110af}, {0x110d0, 0x110e8}, {0x11103, 0x11126}, - {0x11150, 0x11172}, {0x11183, 0x111b2}, {0x111c1, 0x111c4}, {0x11200, 0x11211}, - {0x11213, 0x1122b}, {0x11280, 0x11286}, {0x1128a, 0x1128d}, {0x1128f, 0x1129d}, - {0x1129f, 0x112a8}, {0x112b0, 0x112de}, {0x11305, 0x1130c}, {0x11313, 0x11328}, - {0x1132a, 0x11330}, {0x11335, 0x11339}, {0x1135d, 0x11361}, {0x11480, 0x114af}, + {0x104b0, 0x104d3}, {0x104d8, 0x104fb}, {0x10500, 0x10527}, {0x10530, 0x10563}, + {0x10600, 0x10736}, {0x10740, 0x10755}, {0x10760, 0x10767}, {0x10800, 0x10805}, + {0x1080a, 0x10835}, {0x1083f, 0x10855}, {0x10860, 0x10876}, {0x10880, 0x1089e}, + {0x108e0, 0x108f2}, {0x10900, 0x10915}, {0x10920, 0x10939}, {0x10980, 0x109b7}, + {0x10a10, 0x10a13}, {0x10a15, 0x10a17}, {0x10a19, 0x10a33}, {0x10a60, 0x10a7c}, + {0x10a80, 0x10a9c}, {0x10ac0, 0x10ac7}, {0x10ac9, 0x10ae4}, {0x10b00, 0x10b35}, + {0x10b40, 0x10b55}, {0x10b60, 0x10b72}, {0x10b80, 0x10b91}, {0x10c00, 0x10c48}, + {0x10c80, 0x10cb2}, {0x10cc0, 0x10cf2}, {0x11003, 0x11037}, {0x11083, 0x110af}, + {0x110d0, 0x110e8}, {0x11103, 0x11126}, {0x11150, 0x11172}, {0x11183, 0x111b2}, + {0x111c1, 0x111c4}, {0x11200, 0x11211}, {0x11213, 0x1122b}, {0x11280, 0x11286}, + {0x1128a, 0x1128d}, {0x1128f, 0x1129d}, {0x1129f, 0x112a8}, {0x112b0, 0x112de}, + {0x11305, 0x1130c}, {0x11313, 0x11328}, {0x1132a, 0x11330}, {0x11335, 0x11339}, + {0x1135d, 0x11361}, {0x11400, 0x11434}, {0x11447, 0x1144a}, {0x11480, 0x114af}, {0x11580, 0x115ae}, {0x115d8, 0x115db}, {0x11600, 0x1162f}, {0x11680, 0x116aa}, - {0x11700, 0x11719}, {0x118a0, 0x118df}, {0x11ac0, 0x11af8}, {0x12000, 0x12399}, - {0x12480, 0x12543}, {0x13000, 0x1342e}, {0x14400, 0x14646}, {0x16800, 0x16a38}, - {0x16a40, 0x16a5e}, {0x16ad0, 0x16aed}, {0x16b00, 0x16b2f}, {0x16b40, 0x16b43}, - {0x16b63, 0x16b77}, {0x16b7d, 0x16b8f}, {0x16f00, 0x16f44}, {0x16f93, 0x16f9f}, - {0x1bc00, 0x1bc6a}, {0x1bc70, 0x1bc7c}, {0x1bc80, 0x1bc88}, {0x1bc90, 0x1bc99}, - {0x1d400, 0x1d454}, {0x1d456, 0x1d49c}, {0x1d4a9, 0x1d4ac}, {0x1d4ae, 0x1d4b9}, - {0x1d4bd, 0x1d4c3}, {0x1d4c5, 0x1d505}, {0x1d507, 0x1d50a}, {0x1d50d, 0x1d514}, - {0x1d516, 0x1d51c}, {0x1d51e, 0x1d539}, {0x1d53b, 0x1d53e}, {0x1d540, 0x1d544}, - {0x1d54a, 0x1d550}, {0x1d552, 0x1d6a5}, {0x1d6a8, 0x1d6c0}, {0x1d6c2, 0x1d6da}, - {0x1d6dc, 0x1d6fa}, {0x1d6fc, 0x1d714}, {0x1d716, 0x1d734}, {0x1d736, 0x1d74e}, - {0x1d750, 0x1d76e}, {0x1d770, 0x1d788}, {0x1d78a, 0x1d7a8}, {0x1d7aa, 0x1d7c2}, - {0x1d7c4, 0x1d7cb}, {0x1e800, 0x1e8c4}, {0x1ee00, 0x1ee03}, {0x1ee05, 0x1ee1f}, - {0x1ee29, 0x1ee32}, {0x1ee34, 0x1ee37}, {0x1ee4d, 0x1ee4f}, {0x1ee67, 0x1ee6a}, - {0x1ee6c, 0x1ee72}, {0x1ee74, 0x1ee77}, {0x1ee79, 0x1ee7c}, {0x1ee80, 0x1ee89}, - {0x1ee8b, 0x1ee9b}, {0x1eea1, 0x1eea3}, {0x1eea5, 0x1eea9}, {0x1eeab, 0x1eebb}, - {0x20000, 0x2a6d6}, {0x2a700, 0x2b734}, {0x2b740, 0x2b81d}, {0x2b820, 0x2cea1}, - {0x2f800, 0x2fa1d} + {0x11700, 0x11719}, {0x118a0, 0x118df}, {0x11ac0, 0x11af8}, {0x11c00, 0x11c08}, + {0x11c0a, 0x11c2e}, {0x11c72, 0x11c8f}, {0x12000, 0x12399}, {0x12480, 0x12543}, + {0x13000, 0x1342e}, {0x14400, 0x14646}, {0x16800, 0x16a38}, {0x16a40, 0x16a5e}, + {0x16ad0, 0x16aed}, {0x16b00, 0x16b2f}, {0x16b40, 0x16b43}, {0x16b63, 0x16b77}, + {0x16b7d, 0x16b8f}, {0x16f00, 0x16f44}, {0x16f93, 0x16f9f}, {0x17000, 0x187ec}, + {0x18800, 0x18af2}, {0x1bc00, 0x1bc6a}, {0x1bc70, 0x1bc7c}, {0x1bc80, 0x1bc88}, + {0x1bc90, 0x1bc99}, {0x1d400, 0x1d454}, {0x1d456, 0x1d49c}, {0x1d4a9, 0x1d4ac}, + {0x1d4ae, 0x1d4b9}, {0x1d4bd, 0x1d4c3}, {0x1d4c5, 0x1d505}, {0x1d507, 0x1d50a}, + {0x1d50d, 0x1d514}, {0x1d516, 0x1d51c}, {0x1d51e, 0x1d539}, {0x1d53b, 0x1d53e}, + {0x1d540, 0x1d544}, {0x1d54a, 0x1d550}, {0x1d552, 0x1d6a5}, {0x1d6a8, 0x1d6c0}, + {0x1d6c2, 0x1d6da}, {0x1d6dc, 0x1d6fa}, {0x1d6fc, 0x1d714}, {0x1d716, 0x1d734}, + {0x1d736, 0x1d74e}, {0x1d750, 0x1d76e}, {0x1d770, 0x1d788}, {0x1d78a, 0x1d7a8}, + {0x1d7aa, 0x1d7c2}, {0x1d7c4, 0x1d7cb}, {0x1e800, 0x1e8c4}, {0x1e900, 0x1e943}, + {0x1ee00, 0x1ee03}, {0x1ee05, 0x1ee1f}, {0x1ee29, 0x1ee32}, {0x1ee34, 0x1ee37}, + {0x1ee4d, 0x1ee4f}, {0x1ee67, 0x1ee6a}, {0x1ee6c, 0x1ee72}, {0x1ee74, 0x1ee77}, + {0x1ee79, 0x1ee7c}, {0x1ee80, 0x1ee89}, {0x1ee8b, 0x1ee9b}, {0x1eea1, 0x1eea3}, + {0x1eea5, 0x1eea9}, {0x1eeab, 0x1eebb}, {0x20000, 0x2a6d6}, {0x2a700, 0x2b734}, + {0x2b740, 0x2b81d}, {0x2b820, 0x2cea1}, {0x2f800, 0x2fa1d} #endif }; @@ -249,24 +254,24 @@ static const chr alphaCharTable[] = { 0xa39, 0xa5e, 0xab2, 0xab3, 0xabd, 0xad0, 0xae0, 0xae1, 0xaf9, 0xb0f, 0xb10, 0xb32, 0xb33, 0xb3d, 0xb5c, 0xb5d, 0xb71, 0xb83, 0xb99, 0xb9a, 0xb9c, 0xb9e, 0xb9f, 0xba3, 0xba4, 0xbd0, 0xc3d, - 0xc60, 0xc61, 0xcbd, 0xcde, 0xce0, 0xce1, 0xcf1, 0xcf2, 0xd3d, - 0xd4e, 0xdbd, 0xe32, 0xe33, 0xe81, 0xe82, 0xe84, 0xe87, 0xe88, - 0xe8a, 0xe8d, 0xea5, 0xea7, 0xeaa, 0xeab, 0xeb2, 0xeb3, 0xebd, - 0xec6, 0xf00, 0x103f, 0x1061, 0x1065, 0x1066, 0x108e, 0x10c7, 0x10cd, - 0x1258, 0x12c0, 0x17d7, 0x17dc, 0x18aa, 0x1aa7, 0x1bae, 0x1baf, 0x1cf5, - 0x1cf6, 0x1f59, 0x1f5b, 0x1f5d, 0x1fbe, 0x2071, 0x207f, 0x2102, 0x2107, - 0x2115, 0x2124, 0x2126, 0x2128, 0x214e, 0x2183, 0x2184, 0x2cf2, 0x2cf3, - 0x2d27, 0x2d2d, 0x2d6f, 0x2e2f, 0x3005, 0x3006, 0x303b, 0x303c, 0xa62a, - 0xa62b, 0xa8fb, 0xa8fd, 0xa9cf, 0xaa7a, 0xaab1, 0xaab5, 0xaab6, 0xaac0, - 0xaac2, 0xfb1d, 0xfb3e, 0xfb40, 0xfb41, 0xfb43, 0xfb44 + 0xc60, 0xc61, 0xc80, 0xcbd, 0xcde, 0xce0, 0xce1, 0xcf1, 0xcf2, + 0xd3d, 0xd4e, 0xdbd, 0xe32, 0xe33, 0xe81, 0xe82, 0xe84, 0xe87, + 0xe88, 0xe8a, 0xe8d, 0xea5, 0xea7, 0xeaa, 0xeab, 0xeb2, 0xeb3, + 0xebd, 0xec6, 0xf00, 0x103f, 0x1061, 0x1065, 0x1066, 0x108e, 0x10c7, + 0x10cd, 0x1258, 0x12c0, 0x17d7, 0x17dc, 0x18aa, 0x1aa7, 0x1bae, 0x1baf, + 0x1cf5, 0x1cf6, 0x1f59, 0x1f5b, 0x1f5d, 0x1fbe, 0x2071, 0x207f, 0x2102, + 0x2107, 0x2115, 0x2124, 0x2126, 0x2128, 0x214e, 0x2183, 0x2184, 0x2cf2, + 0x2cf3, 0x2d27, 0x2d2d, 0x2d6f, 0x2e2f, 0x3005, 0x3006, 0x303b, 0x303c, + 0xa62a, 0xa62b, 0xa8fb, 0xa8fd, 0xa9cf, 0xaa7a, 0xaab1, 0xaab5, 0xaab6, + 0xaac0, 0xaac2, 0xfb1d, 0xfb3e, 0xfb40, 0xfb41, 0xfb43, 0xfb44 #if TCL_UTF_MAX > 4 ,0x1003c, 0x1003d, 0x10808, 0x10837, 0x10838, 0x1083c, 0x108f4, 0x108f5, 0x109be, 0x109bf, 0x10a00, 0x11176, 0x111da, 0x111dc, 0x11288, 0x1130f, 0x11310, 0x11332, - 0x11333, 0x1133d, 0x11350, 0x114c4, 0x114c5, 0x114c7, 0x11644, 0x118ff, 0x16f50, - 0x1b000, 0x1b001, 0x1d49e, 0x1d49f, 0x1d4a2, 0x1d4a5, 0x1d4a6, 0x1d4bb, 0x1d546, - 0x1ee21, 0x1ee22, 0x1ee24, 0x1ee27, 0x1ee39, 0x1ee3b, 0x1ee42, 0x1ee47, 0x1ee49, - 0x1ee4b, 0x1ee51, 0x1ee52, 0x1ee54, 0x1ee57, 0x1ee59, 0x1ee5b, 0x1ee5d, 0x1ee5f, - 0x1ee61, 0x1ee62, 0x1ee64, 0x1ee7e + 0x11333, 0x1133d, 0x11350, 0x114c4, 0x114c5, 0x114c7, 0x11644, 0x118ff, 0x11c40, + 0x16f50, 0x16fe0, 0x1b000, 0x1b001, 0x1d49e, 0x1d49f, 0x1d4a2, 0x1d4a5, 0x1d4a6, + 0x1d4bb, 0x1d546, 0x1ee21, 0x1ee22, 0x1ee24, 0x1ee27, 0x1ee39, 0x1ee3b, 0x1ee42, + 0x1ee47, 0x1ee49, 0x1ee4b, 0x1ee51, 0x1ee52, 0x1ee54, 0x1ee57, 0x1ee59, 0x1ee5b, + 0x1ee5d, 0x1ee5f, 0x1ee61, 0x1ee62, 0x1ee64, 0x1ee7e #endif }; @@ -289,7 +294,7 @@ static const crange controlRangeTable[] = { #define NUM_CONTROL_RANGE (sizeof(controlRangeTable)/sizeof(crange)) static const chr controlCharTable[] = { - 0xad, 0x61c, 0x6dd, 0x70f, 0x180e, 0xfeff + 0xad, 0x61c, 0x6dd, 0x70f, 0x8e2, 0x180e, 0xfeff #if TCL_UTF_MAX > 4 ,0x110bd, 0xe0001 #endif @@ -314,9 +319,10 @@ static const crange digitRangeTable[] = { {0xff10, 0xff19} #if TCL_UTF_MAX > 4 ,{0x104a0, 0x104a9}, {0x11066, 0x1106f}, {0x110f0, 0x110f9}, {0x11136, 0x1113f}, - {0x111d0, 0x111d9}, {0x112f0, 0x112f9}, {0x114d0, 0x114d9}, {0x11650, 0x11659}, - {0x116c0, 0x116c9}, {0x11730, 0x11739}, {0x118e0, 0x118e9}, {0x16a60, 0x16a69}, - {0x16b50, 0x16b59}, {0x1d7ce, 0x1d7ff} + {0x111d0, 0x111d9}, {0x112f0, 0x112f9}, {0x11450, 0x11459}, {0x114d0, 0x114d9}, + {0x11650, 0x11659}, {0x116c0, 0x116c9}, {0x11730, 0x11739}, {0x118e0, 0x118e9}, + {0x11c50, 0x11c59}, {0x16a60, 0x16a69}, {0x16b50, 0x16b59}, {0x1d7ce, 0x1d7ff}, + {0x1e950, 0x1e959} #endif }; @@ -339,7 +345,7 @@ static const crange punctRangeTable[] = { {0x1b5a, 0x1b60}, {0x1bfc, 0x1bff}, {0x1c3b, 0x1c3f}, {0x1cc0, 0x1cc7}, {0x2010, 0x2027}, {0x2030, 0x2043}, {0x2045, 0x2051}, {0x2053, 0x205e}, {0x2308, 0x230b}, {0x2768, 0x2775}, {0x27e6, 0x27ef}, {0x2983, 0x2998}, - {0x29d8, 0x29db}, {0x2cf9, 0x2cfc}, {0x2e00, 0x2e2e}, {0x2e30, 0x2e42}, + {0x29d8, 0x29db}, {0x2cf9, 0x2cfc}, {0x2e00, 0x2e2e}, {0x2e30, 0x2e44}, {0x3001, 0x3003}, {0x3008, 0x3011}, {0x3014, 0x301f}, {0xa60d, 0xa60f}, {0xa6f2, 0xa6f7}, {0xa874, 0xa877}, {0xa8f8, 0xa8fa}, {0xa9c1, 0xa9cd}, {0xaa5c, 0xaa5f}, {0xfe10, 0xfe19}, {0xfe30, 0xfe52}, {0xfe54, 0xfe61}, @@ -348,9 +354,9 @@ static const crange punctRangeTable[] = { #if TCL_UTF_MAX > 4 ,{0x10100, 0x10102}, {0x10a50, 0x10a58}, {0x10af0, 0x10af6}, {0x10b39, 0x10b3f}, {0x10b99, 0x10b9c}, {0x11047, 0x1104d}, {0x110be, 0x110c1}, {0x11140, 0x11143}, - {0x111c5, 0x111c9}, {0x111dd, 0x111df}, {0x11238, 0x1123d}, {0x115c1, 0x115d7}, - {0x11641, 0x11643}, {0x1173c, 0x1173e}, {0x12470, 0x12474}, {0x16b37, 0x16b3b}, - {0x1da87, 0x1da8b} + {0x111c5, 0x111c9}, {0x111dd, 0x111df}, {0x11238, 0x1123d}, {0x1144b, 0x1144f}, + {0x115c1, 0x115d7}, {0x11641, 0x11643}, {0x11660, 0x1166c}, {0x1173c, 0x1173e}, + {0x11c41, 0x11c45}, {0x12470, 0x12474}, {0x16b37, 0x16b3b}, {0x1da87, 0x1da8b} #endif }; @@ -371,8 +377,8 @@ static const chr punctCharTable[] = { 0xfe6b, 0xff1a, 0xff1b, 0xff1f, 0xff20, 0xff3f, 0xff5b, 0xff5d #if TCL_UTF_MAX > 4 ,0x1039f, 0x103d0, 0x1056f, 0x10857, 0x1091f, 0x1093f, 0x10a7f, 0x110bb, 0x110bc, - 0x11174, 0x11175, 0x111cd, 0x111db, 0x112a9, 0x114c6, 0x16a6e, 0x16a6f, 0x16af5, - 0x16b44, 0x1bc9f + 0x11174, 0x11175, 0x111cd, 0x111db, 0x112a9, 0x1145b, 0x1145d, 0x114c6, 0x11c70, + 0x11c71, 0x16a6e, 0x16a6f, 0x16af5, 0x16b44, 0x1bc9f, 0x1e95e, 0x1e95f #endif }; @@ -404,24 +410,24 @@ static const crange lowerRangeTable[] = { {0x199, 0x19b}, {0x1bd, 0x1bf}, {0x233, 0x239}, {0x24f, 0x293}, {0x295, 0x2af}, {0x37b, 0x37d}, {0x3ac, 0x3ce}, {0x3d5, 0x3d7}, {0x3ef, 0x3f3}, {0x430, 0x45f}, {0x561, 0x587}, {0x13f8, 0x13fd}, - {0x1d00, 0x1d2b}, {0x1d6b, 0x1d77}, {0x1d79, 0x1d9a}, {0x1e95, 0x1e9d}, - {0x1eff, 0x1f07}, {0x1f10, 0x1f15}, {0x1f20, 0x1f27}, {0x1f30, 0x1f37}, - {0x1f40, 0x1f45}, {0x1f50, 0x1f57}, {0x1f60, 0x1f67}, {0x1f70, 0x1f7d}, - {0x1f80, 0x1f87}, {0x1f90, 0x1f97}, {0x1fa0, 0x1fa7}, {0x1fb0, 0x1fb4}, - {0x1fc2, 0x1fc4}, {0x1fd0, 0x1fd3}, {0x1fe0, 0x1fe7}, {0x1ff2, 0x1ff4}, - {0x2146, 0x2149}, {0x2c30, 0x2c5e}, {0x2c76, 0x2c7b}, {0x2d00, 0x2d25}, - {0xa72f, 0xa731}, {0xa771, 0xa778}, {0xa793, 0xa795}, {0xab30, 0xab5a}, - {0xab60, 0xab65}, {0xab70, 0xabbf}, {0xfb00, 0xfb06}, {0xfb13, 0xfb17}, - {0xff41, 0xff5a} + {0x1c80, 0x1c88}, {0x1d00, 0x1d2b}, {0x1d6b, 0x1d77}, {0x1d79, 0x1d9a}, + {0x1e95, 0x1e9d}, {0x1eff, 0x1f07}, {0x1f10, 0x1f15}, {0x1f20, 0x1f27}, + {0x1f30, 0x1f37}, {0x1f40, 0x1f45}, {0x1f50, 0x1f57}, {0x1f60, 0x1f67}, + {0x1f70, 0x1f7d}, {0x1f80, 0x1f87}, {0x1f90, 0x1f97}, {0x1fa0, 0x1fa7}, + {0x1fb0, 0x1fb4}, {0x1fc2, 0x1fc4}, {0x1fd0, 0x1fd3}, {0x1fe0, 0x1fe7}, + {0x1ff2, 0x1ff4}, {0x2146, 0x2149}, {0x2c30, 0x2c5e}, {0x2c76, 0x2c7b}, + {0x2d00, 0x2d25}, {0xa72f, 0xa731}, {0xa771, 0xa778}, {0xa793, 0xa795}, + {0xab30, 0xab5a}, {0xab60, 0xab65}, {0xab70, 0xabbf}, {0xfb00, 0xfb06}, + {0xfb13, 0xfb17}, {0xff41, 0xff5a} #if TCL_UTF_MAX > 4 - ,{0x10428, 0x1044f}, {0x10cc0, 0x10cf2}, {0x118c0, 0x118df}, {0x1d41a, 0x1d433}, - {0x1d44e, 0x1d454}, {0x1d456, 0x1d467}, {0x1d482, 0x1d49b}, {0x1d4b6, 0x1d4b9}, - {0x1d4bd, 0x1d4c3}, {0x1d4c5, 0x1d4cf}, {0x1d4ea, 0x1d503}, {0x1d51e, 0x1d537}, - {0x1d552, 0x1d56b}, {0x1d586, 0x1d59f}, {0x1d5ba, 0x1d5d3}, {0x1d5ee, 0x1d607}, - {0x1d622, 0x1d63b}, {0x1d656, 0x1d66f}, {0x1d68a, 0x1d6a5}, {0x1d6c2, 0x1d6da}, - {0x1d6dc, 0x1d6e1}, {0x1d6fc, 0x1d714}, {0x1d716, 0x1d71b}, {0x1d736, 0x1d74e}, - {0x1d750, 0x1d755}, {0x1d770, 0x1d788}, {0x1d78a, 0x1d78f}, {0x1d7aa, 0x1d7c2}, - {0x1d7c4, 0x1d7c9} + ,{0x10428, 0x1044f}, {0x104d8, 0x104fb}, {0x10cc0, 0x10cf2}, {0x118c0, 0x118df}, + {0x1d41a, 0x1d433}, {0x1d44e, 0x1d454}, {0x1d456, 0x1d467}, {0x1d482, 0x1d49b}, + {0x1d4b6, 0x1d4b9}, {0x1d4bd, 0x1d4c3}, {0x1d4c5, 0x1d4cf}, {0x1d4ea, 0x1d503}, + {0x1d51e, 0x1d537}, {0x1d552, 0x1d56b}, {0x1d586, 0x1d59f}, {0x1d5ba, 0x1d5d3}, + {0x1d5ee, 0x1d607}, {0x1d622, 0x1d63b}, {0x1d656, 0x1d66f}, {0x1d68a, 0x1d6a5}, + {0x1d6c2, 0x1d6da}, {0x1d6dc, 0x1d6e1}, {0x1d6fc, 0x1d714}, {0x1d716, 0x1d71b}, + {0x1d736, 0x1d74e}, {0x1d750, 0x1d755}, {0x1d770, 0x1d788}, {0x1d78a, 0x1d78f}, + {0x1d7aa, 0x1d7c2}, {0x1d7c4, 0x1d7c9}, {0x1e922, 0x1e943} #endif }; @@ -513,15 +519,15 @@ static const crange upperRangeTable[] = { {0x1fc8, 0x1fcb}, {0x1fd8, 0x1fdb}, {0x1fe8, 0x1fec}, {0x1ff8, 0x1ffb}, {0x210b, 0x210d}, {0x2110, 0x2112}, {0x2119, 0x211d}, {0x212a, 0x212d}, {0x2130, 0x2133}, {0x2c00, 0x2c2e}, {0x2c62, 0x2c64}, {0x2c6d, 0x2c70}, - {0x2c7e, 0x2c80}, {0xa7aa, 0xa7ad}, {0xa7b0, 0xa7b4}, {0xff21, 0xff3a} + {0x2c7e, 0x2c80}, {0xa7aa, 0xa7ae}, {0xa7b0, 0xa7b4}, {0xff21, 0xff3a} #if TCL_UTF_MAX > 4 - ,{0x10400, 0x10427}, {0x10c80, 0x10cb2}, {0x118a0, 0x118bf}, {0x1d400, 0x1d419}, - {0x1d434, 0x1d44d}, {0x1d468, 0x1d481}, {0x1d4a9, 0x1d4ac}, {0x1d4ae, 0x1d4b5}, - {0x1d4d0, 0x1d4e9}, {0x1d507, 0x1d50a}, {0x1d50d, 0x1d514}, {0x1d516, 0x1d51c}, - {0x1d53b, 0x1d53e}, {0x1d540, 0x1d544}, {0x1d54a, 0x1d550}, {0x1d56c, 0x1d585}, - {0x1d5a0, 0x1d5b9}, {0x1d5d4, 0x1d5ed}, {0x1d608, 0x1d621}, {0x1d63c, 0x1d655}, - {0x1d670, 0x1d689}, {0x1d6a8, 0x1d6c0}, {0x1d6e2, 0x1d6fa}, {0x1d71c, 0x1d734}, - {0x1d756, 0x1d76e}, {0x1d790, 0x1d7a8} + ,{0x10400, 0x10427}, {0x104b0, 0x104d3}, {0x10c80, 0x10cb2}, {0x118a0, 0x118bf}, + {0x1d400, 0x1d419}, {0x1d434, 0x1d44d}, {0x1d468, 0x1d481}, {0x1d4a9, 0x1d4ac}, + {0x1d4ae, 0x1d4b5}, {0x1d4d0, 0x1d4e9}, {0x1d507, 0x1d50a}, {0x1d50d, 0x1d514}, + {0x1d516, 0x1d51c}, {0x1d53b, 0x1d53e}, {0x1d540, 0x1d544}, {0x1d54a, 0x1d550}, + {0x1d56c, 0x1d585}, {0x1d5a0, 0x1d5b9}, {0x1d5d4, 0x1d5ed}, {0x1d608, 0x1d621}, + {0x1d63c, 0x1d655}, {0x1d670, 0x1d689}, {0x1d6a8, 0x1d6c0}, {0x1d6e2, 0x1d6fa}, + {0x1d71c, 0x1d734}, {0x1d756, 0x1d76e}, {0x1d790, 0x1d7a8}, {0x1e900, 0x1e921} #endif }; @@ -610,26 +616,26 @@ static const crange graphRangeTable[] = { {0x5d0, 0x5ea}, {0x5f0, 0x5f4}, {0x606, 0x61b}, {0x61e, 0x6dc}, {0x6de, 0x70d}, {0x710, 0x74a}, {0x74d, 0x7b1}, {0x7c0, 0x7fa}, {0x800, 0x82d}, {0x830, 0x83e}, {0x840, 0x85b}, {0x8a0, 0x8b4}, - {0x8e3, 0x983}, {0x985, 0x98c}, {0x993, 0x9a8}, {0x9aa, 0x9b0}, - {0x9b6, 0x9b9}, {0x9bc, 0x9c4}, {0x9cb, 0x9ce}, {0x9df, 0x9e3}, - {0x9e6, 0x9fb}, {0xa01, 0xa03}, {0xa05, 0xa0a}, {0xa13, 0xa28}, - {0xa2a, 0xa30}, {0xa3e, 0xa42}, {0xa4b, 0xa4d}, {0xa59, 0xa5c}, - {0xa66, 0xa75}, {0xa81, 0xa83}, {0xa85, 0xa8d}, {0xa8f, 0xa91}, - {0xa93, 0xaa8}, {0xaaa, 0xab0}, {0xab5, 0xab9}, {0xabc, 0xac5}, - {0xac7, 0xac9}, {0xacb, 0xacd}, {0xae0, 0xae3}, {0xae6, 0xaf1}, - {0xb01, 0xb03}, {0xb05, 0xb0c}, {0xb13, 0xb28}, {0xb2a, 0xb30}, - {0xb35, 0xb39}, {0xb3c, 0xb44}, {0xb4b, 0xb4d}, {0xb5f, 0xb63}, - {0xb66, 0xb77}, {0xb85, 0xb8a}, {0xb8e, 0xb90}, {0xb92, 0xb95}, - {0xba8, 0xbaa}, {0xbae, 0xbb9}, {0xbbe, 0xbc2}, {0xbc6, 0xbc8}, - {0xbca, 0xbcd}, {0xbe6, 0xbfa}, {0xc00, 0xc03}, {0xc05, 0xc0c}, - {0xc0e, 0xc10}, {0xc12, 0xc28}, {0xc2a, 0xc39}, {0xc3d, 0xc44}, - {0xc46, 0xc48}, {0xc4a, 0xc4d}, {0xc58, 0xc5a}, {0xc60, 0xc63}, - {0xc66, 0xc6f}, {0xc78, 0xc7f}, {0xc81, 0xc83}, {0xc85, 0xc8c}, - {0xc8e, 0xc90}, {0xc92, 0xca8}, {0xcaa, 0xcb3}, {0xcb5, 0xcb9}, - {0xcbc, 0xcc4}, {0xcc6, 0xcc8}, {0xcca, 0xccd}, {0xce0, 0xce3}, - {0xce6, 0xcef}, {0xd01, 0xd03}, {0xd05, 0xd0c}, {0xd0e, 0xd10}, - {0xd12, 0xd3a}, {0xd3d, 0xd44}, {0xd46, 0xd48}, {0xd4a, 0xd4e}, - {0xd5f, 0xd63}, {0xd66, 0xd75}, {0xd79, 0xd7f}, {0xd85, 0xd96}, + {0x8b6, 0x8bd}, {0x8d4, 0x8e1}, {0x8e3, 0x983}, {0x985, 0x98c}, + {0x993, 0x9a8}, {0x9aa, 0x9b0}, {0x9b6, 0x9b9}, {0x9bc, 0x9c4}, + {0x9cb, 0x9ce}, {0x9df, 0x9e3}, {0x9e6, 0x9fb}, {0xa01, 0xa03}, + {0xa05, 0xa0a}, {0xa13, 0xa28}, {0xa2a, 0xa30}, {0xa3e, 0xa42}, + {0xa4b, 0xa4d}, {0xa59, 0xa5c}, {0xa66, 0xa75}, {0xa81, 0xa83}, + {0xa85, 0xa8d}, {0xa8f, 0xa91}, {0xa93, 0xaa8}, {0xaaa, 0xab0}, + {0xab5, 0xab9}, {0xabc, 0xac5}, {0xac7, 0xac9}, {0xacb, 0xacd}, + {0xae0, 0xae3}, {0xae6, 0xaf1}, {0xb01, 0xb03}, {0xb05, 0xb0c}, + {0xb13, 0xb28}, {0xb2a, 0xb30}, {0xb35, 0xb39}, {0xb3c, 0xb44}, + {0xb4b, 0xb4d}, {0xb5f, 0xb63}, {0xb66, 0xb77}, {0xb85, 0xb8a}, + {0xb8e, 0xb90}, {0xb92, 0xb95}, {0xba8, 0xbaa}, {0xbae, 0xbb9}, + {0xbbe, 0xbc2}, {0xbc6, 0xbc8}, {0xbca, 0xbcd}, {0xbe6, 0xbfa}, + {0xc00, 0xc03}, {0xc05, 0xc0c}, {0xc0e, 0xc10}, {0xc12, 0xc28}, + {0xc2a, 0xc39}, {0xc3d, 0xc44}, {0xc46, 0xc48}, {0xc4a, 0xc4d}, + {0xc58, 0xc5a}, {0xc60, 0xc63}, {0xc66, 0xc6f}, {0xc78, 0xc83}, + {0xc85, 0xc8c}, {0xc8e, 0xc90}, {0xc92, 0xca8}, {0xcaa, 0xcb3}, + {0xcb5, 0xcb9}, {0xcbc, 0xcc4}, {0xcc6, 0xcc8}, {0xcca, 0xccd}, + {0xce0, 0xce3}, {0xce6, 0xcef}, {0xd01, 0xd03}, {0xd05, 0xd0c}, + {0xd0e, 0xd10}, {0xd12, 0xd3a}, {0xd3d, 0xd44}, {0xd46, 0xd48}, + {0xd4a, 0xd4f}, {0xd54, 0xd63}, {0xd66, 0xd7f}, {0xd85, 0xd96}, {0xd9a, 0xdb1}, {0xdb3, 0xdbb}, {0xdc0, 0xdc6}, {0xdcf, 0xdd4}, {0xdd8, 0xddf}, {0xde6, 0xdef}, {0xdf2, 0xdf4}, {0xe01, 0xe3a}, {0xe3f, 0xe5b}, {0xe94, 0xe97}, {0xe99, 0xe9f}, {0xea1, 0xea3}, @@ -650,25 +656,25 @@ static const crange graphRangeTable[] = { {0x19de, 0x1a1b}, {0x1a1e, 0x1a5e}, {0x1a60, 0x1a7c}, {0x1a7f, 0x1a89}, {0x1a90, 0x1a99}, {0x1aa0, 0x1aad}, {0x1ab0, 0x1abe}, {0x1b00, 0x1b4b}, {0x1b50, 0x1b7c}, {0x1b80, 0x1bf3}, {0x1bfc, 0x1c37}, {0x1c3b, 0x1c49}, - {0x1c4d, 0x1c7f}, {0x1cc0, 0x1cc7}, {0x1cd0, 0x1cf6}, {0x1d00, 0x1df5}, - {0x1dfc, 0x1f15}, {0x1f18, 0x1f1d}, {0x1f20, 0x1f45}, {0x1f48, 0x1f4d}, + {0x1c4d, 0x1c88}, {0x1cc0, 0x1cc7}, {0x1cd0, 0x1cf6}, {0x1d00, 0x1df5}, + {0x1dfb, 0x1f15}, {0x1f18, 0x1f1d}, {0x1f20, 0x1f45}, {0x1f48, 0x1f4d}, {0x1f50, 0x1f57}, {0x1f5f, 0x1f7d}, {0x1f80, 0x1fb4}, {0x1fb6, 0x1fc4}, {0x1fc6, 0x1fd3}, {0x1fd6, 0x1fdb}, {0x1fdd, 0x1fef}, {0x1ff2, 0x1ff4}, {0x1ff6, 0x1ffe}, {0x2010, 0x2027}, {0x2030, 0x205e}, {0x2074, 0x208e}, {0x2090, 0x209c}, {0x20a0, 0x20be}, {0x20d0, 0x20f0}, {0x2100, 0x218b}, - {0x2190, 0x23fa}, {0x2400, 0x2426}, {0x2440, 0x244a}, {0x2460, 0x2b73}, + {0x2190, 0x23fe}, {0x2400, 0x2426}, {0x2440, 0x244a}, {0x2460, 0x2b73}, {0x2b76, 0x2b95}, {0x2b98, 0x2bb9}, {0x2bbd, 0x2bc8}, {0x2bca, 0x2bd1}, {0x2bec, 0x2bef}, {0x2c00, 0x2c2e}, {0x2c30, 0x2c5e}, {0x2c60, 0x2cf3}, {0x2cf9, 0x2d25}, {0x2d30, 0x2d67}, {0x2d7f, 0x2d96}, {0x2da0, 0x2da6}, {0x2da8, 0x2dae}, {0x2db0, 0x2db6}, {0x2db8, 0x2dbe}, {0x2dc0, 0x2dc6}, - {0x2dc8, 0x2dce}, {0x2dd0, 0x2dd6}, {0x2dd8, 0x2dde}, {0x2de0, 0x2e42}, + {0x2dc8, 0x2dce}, {0x2dd0, 0x2dd6}, {0x2dd8, 0x2dde}, {0x2de0, 0x2e44}, {0x2e80, 0x2e99}, {0x2e9b, 0x2ef3}, {0x2f00, 0x2fd5}, {0x2ff0, 0x2ffb}, {0x3001, 0x303f}, {0x3041, 0x3096}, {0x3099, 0x30ff}, {0x3105, 0x312d}, {0x3131, 0x318e}, {0x3190, 0x31ba}, {0x31c0, 0x31e3}, {0x31f0, 0x321e}, {0x3220, 0x32fe}, {0x3300, 0x4db5}, {0x4dc0, 0x9fd5}, {0xa000, 0xa48c}, - {0xa490, 0xa4c6}, {0xa4d0, 0xa62b}, {0xa640, 0xa6f7}, {0xa700, 0xa7ad}, + {0xa490, 0xa4c6}, {0xa4d0, 0xa62b}, {0xa640, 0xa6f7}, {0xa700, 0xa7ae}, {0xa7b0, 0xa7b7}, {0xa7f7, 0xa82b}, {0xa830, 0xa839}, {0xa840, 0xa877}, - {0xa880, 0xa8c4}, {0xa8ce, 0xa8d9}, {0xa8e0, 0xa8fd}, {0xa900, 0xa953}, + {0xa880, 0xa8c5}, {0xa8ce, 0xa8d9}, {0xa8e0, 0xa8fd}, {0xa900, 0xa953}, {0xa95f, 0xa97c}, {0xa980, 0xa9cd}, {0xa9cf, 0xa9d9}, {0xa9de, 0xa9fe}, {0xaa00, 0xaa36}, {0xaa40, 0xaa4d}, {0xaa50, 0xaa59}, {0xaa5c, 0xaac2}, {0xaadb, 0xaaf6}, {0xab01, 0xab06}, {0xab09, 0xab0e}, {0xab11, 0xab16}, @@ -687,54 +693,59 @@ static const crange graphRangeTable[] = { #if TCL_UTF_MAX > 4 ,{0x10000, 0x1000b}, {0x1000d, 0x10026}, {0x10028, 0x1003a}, {0x1003f, 0x1004d}, {0x10050, 0x1005d}, {0x10080, 0x100fa}, {0x10100, 0x10102}, {0x10107, 0x10133}, - {0x10137, 0x1018c}, {0x10190, 0x1019b}, {0x101d0, 0x101fd}, {0x10280, 0x1029c}, + {0x10137, 0x1018e}, {0x10190, 0x1019b}, {0x101d0, 0x101fd}, {0x10280, 0x1029c}, {0x102a0, 0x102d0}, {0x102e0, 0x102fb}, {0x10300, 0x10323}, {0x10330, 0x1034a}, {0x10350, 0x1037a}, {0x10380, 0x1039d}, {0x1039f, 0x103c3}, {0x103c8, 0x103d5}, - {0x10400, 0x1049d}, {0x104a0, 0x104a9}, {0x10500, 0x10527}, {0x10530, 0x10563}, - {0x10600, 0x10736}, {0x10740, 0x10755}, {0x10760, 0x10767}, {0x10800, 0x10805}, - {0x1080a, 0x10835}, {0x1083f, 0x10855}, {0x10857, 0x1089e}, {0x108a7, 0x108af}, - {0x108e0, 0x108f2}, {0x108fb, 0x1091b}, {0x1091f, 0x10939}, {0x10980, 0x109b7}, - {0x109bc, 0x109cf}, {0x109d2, 0x10a03}, {0x10a0c, 0x10a13}, {0x10a15, 0x10a17}, - {0x10a19, 0x10a33}, {0x10a38, 0x10a3a}, {0x10a3f, 0x10a47}, {0x10a50, 0x10a58}, - {0x10a60, 0x10a9f}, {0x10ac0, 0x10ae6}, {0x10aeb, 0x10af6}, {0x10b00, 0x10b35}, - {0x10b39, 0x10b55}, {0x10b58, 0x10b72}, {0x10b78, 0x10b91}, {0x10b99, 0x10b9c}, - {0x10ba9, 0x10baf}, {0x10c00, 0x10c48}, {0x10c80, 0x10cb2}, {0x10cc0, 0x10cf2}, - {0x10cfa, 0x10cff}, {0x10e60, 0x10e7e}, {0x11000, 0x1104d}, {0x11052, 0x1106f}, - {0x1107f, 0x110bc}, {0x110be, 0x110c1}, {0x110d0, 0x110e8}, {0x110f0, 0x110f9}, - {0x11100, 0x11134}, {0x11136, 0x11143}, {0x11150, 0x11176}, {0x11180, 0x111cd}, - {0x111d0, 0x111df}, {0x111e1, 0x111f4}, {0x11200, 0x11211}, {0x11213, 0x1123d}, - {0x11280, 0x11286}, {0x1128a, 0x1128d}, {0x1128f, 0x1129d}, {0x1129f, 0x112a9}, - {0x112b0, 0x112ea}, {0x112f0, 0x112f9}, {0x11300, 0x11303}, {0x11305, 0x1130c}, - {0x11313, 0x11328}, {0x1132a, 0x11330}, {0x11335, 0x11339}, {0x1133c, 0x11344}, - {0x1134b, 0x1134d}, {0x1135d, 0x11363}, {0x11366, 0x1136c}, {0x11370, 0x11374}, - {0x11480, 0x114c7}, {0x114d0, 0x114d9}, {0x11580, 0x115b5}, {0x115b8, 0x115dd}, - {0x11600, 0x11644}, {0x11650, 0x11659}, {0x11680, 0x116b7}, {0x116c0, 0x116c9}, + {0x10400, 0x1049d}, {0x104a0, 0x104a9}, {0x104b0, 0x104d3}, {0x104d8, 0x104fb}, + {0x10500, 0x10527}, {0x10530, 0x10563}, {0x10600, 0x10736}, {0x10740, 0x10755}, + {0x10760, 0x10767}, {0x10800, 0x10805}, {0x1080a, 0x10835}, {0x1083f, 0x10855}, + {0x10857, 0x1089e}, {0x108a7, 0x108af}, {0x108e0, 0x108f2}, {0x108fb, 0x1091b}, + {0x1091f, 0x10939}, {0x10980, 0x109b7}, {0x109bc, 0x109cf}, {0x109d2, 0x10a03}, + {0x10a0c, 0x10a13}, {0x10a15, 0x10a17}, {0x10a19, 0x10a33}, {0x10a38, 0x10a3a}, + {0x10a3f, 0x10a47}, {0x10a50, 0x10a58}, {0x10a60, 0x10a9f}, {0x10ac0, 0x10ae6}, + {0x10aeb, 0x10af6}, {0x10b00, 0x10b35}, {0x10b39, 0x10b55}, {0x10b58, 0x10b72}, + {0x10b78, 0x10b91}, {0x10b99, 0x10b9c}, {0x10ba9, 0x10baf}, {0x10c00, 0x10c48}, + {0x10c80, 0x10cb2}, {0x10cc0, 0x10cf2}, {0x10cfa, 0x10cff}, {0x10e60, 0x10e7e}, + {0x11000, 0x1104d}, {0x11052, 0x1106f}, {0x1107f, 0x110bc}, {0x110be, 0x110c1}, + {0x110d0, 0x110e8}, {0x110f0, 0x110f9}, {0x11100, 0x11134}, {0x11136, 0x11143}, + {0x11150, 0x11176}, {0x11180, 0x111cd}, {0x111d0, 0x111df}, {0x111e1, 0x111f4}, + {0x11200, 0x11211}, {0x11213, 0x1123e}, {0x11280, 0x11286}, {0x1128a, 0x1128d}, + {0x1128f, 0x1129d}, {0x1129f, 0x112a9}, {0x112b0, 0x112ea}, {0x112f0, 0x112f9}, + {0x11300, 0x11303}, {0x11305, 0x1130c}, {0x11313, 0x11328}, {0x1132a, 0x11330}, + {0x11335, 0x11339}, {0x1133c, 0x11344}, {0x1134b, 0x1134d}, {0x1135d, 0x11363}, + {0x11366, 0x1136c}, {0x11370, 0x11374}, {0x11400, 0x11459}, {0x11480, 0x114c7}, + {0x114d0, 0x114d9}, {0x11580, 0x115b5}, {0x115b8, 0x115dd}, {0x11600, 0x11644}, + {0x11650, 0x11659}, {0x11660, 0x1166c}, {0x11680, 0x116b7}, {0x116c0, 0x116c9}, {0x11700, 0x11719}, {0x1171d, 0x1172b}, {0x11730, 0x1173f}, {0x118a0, 0x118f2}, - {0x11ac0, 0x11af8}, {0x12000, 0x12399}, {0x12400, 0x1246e}, {0x12470, 0x12474}, - {0x12480, 0x12543}, {0x13000, 0x1342e}, {0x14400, 0x14646}, {0x16800, 0x16a38}, - {0x16a40, 0x16a5e}, {0x16a60, 0x16a69}, {0x16ad0, 0x16aed}, {0x16af0, 0x16af5}, - {0x16b00, 0x16b45}, {0x16b50, 0x16b59}, {0x16b5b, 0x16b61}, {0x16b63, 0x16b77}, - {0x16b7d, 0x16b8f}, {0x16f00, 0x16f44}, {0x16f50, 0x16f7e}, {0x16f8f, 0x16f9f}, - {0x1bc00, 0x1bc6a}, {0x1bc70, 0x1bc7c}, {0x1bc80, 0x1bc88}, {0x1bc90, 0x1bc99}, - {0x1bc9c, 0x1bc9f}, {0x1d000, 0x1d0f5}, {0x1d100, 0x1d126}, {0x1d129, 0x1d172}, - {0x1d17b, 0x1d1e8}, {0x1d200, 0x1d245}, {0x1d300, 0x1d356}, {0x1d360, 0x1d371}, - {0x1d400, 0x1d454}, {0x1d456, 0x1d49c}, {0x1d4a9, 0x1d4ac}, {0x1d4ae, 0x1d4b9}, - {0x1d4bd, 0x1d4c3}, {0x1d4c5, 0x1d505}, {0x1d507, 0x1d50a}, {0x1d50d, 0x1d514}, - {0x1d516, 0x1d51c}, {0x1d51e, 0x1d539}, {0x1d53b, 0x1d53e}, {0x1d540, 0x1d544}, - {0x1d54a, 0x1d550}, {0x1d552, 0x1d6a5}, {0x1d6a8, 0x1d7cb}, {0x1d7ce, 0x1da8b}, - {0x1da9b, 0x1da9f}, {0x1daa1, 0x1daaf}, {0x1e800, 0x1e8c4}, {0x1e8c7, 0x1e8d6}, - {0x1ee00, 0x1ee03}, {0x1ee05, 0x1ee1f}, {0x1ee29, 0x1ee32}, {0x1ee34, 0x1ee37}, - {0x1ee4d, 0x1ee4f}, {0x1ee67, 0x1ee6a}, {0x1ee6c, 0x1ee72}, {0x1ee74, 0x1ee77}, - {0x1ee79, 0x1ee7c}, {0x1ee80, 0x1ee89}, {0x1ee8b, 0x1ee9b}, {0x1eea1, 0x1eea3}, - {0x1eea5, 0x1eea9}, {0x1eeab, 0x1eebb}, {0x1f000, 0x1f02b}, {0x1f030, 0x1f093}, - {0x1f0a0, 0x1f0ae}, {0x1f0b1, 0x1f0bf}, {0x1f0c1, 0x1f0cf}, {0x1f0d1, 0x1f0f5}, - {0x1f100, 0x1f10c}, {0x1f110, 0x1f12e}, {0x1f130, 0x1f16b}, {0x1f170, 0x1f19a}, - {0x1f1e6, 0x1f202}, {0x1f210, 0x1f23a}, {0x1f240, 0x1f248}, {0x1f300, 0x1f579}, - {0x1f57b, 0x1f5a3}, {0x1f5a5, 0x1f6d0}, {0x1f6e0, 0x1f6ec}, {0x1f6f0, 0x1f6f3}, - {0x1f700, 0x1f773}, {0x1f780, 0x1f7d4}, {0x1f800, 0x1f80b}, {0x1f810, 0x1f847}, - {0x1f850, 0x1f859}, {0x1f860, 0x1f887}, {0x1f890, 0x1f8ad}, {0x1f910, 0x1f918}, - {0x1f980, 0x1f984}, {0x20000, 0x2a6d6}, {0x2a700, 0x2b734}, {0x2b740, 0x2b81d}, - {0x2b820, 0x2cea1}, {0x2f800, 0x2fa1d}, {0xe0100, 0xe01ef} + {0x11ac0, 0x11af8}, {0x11c00, 0x11c08}, {0x11c0a, 0x11c36}, {0x11c38, 0x11c45}, + {0x11c50, 0x11c6c}, {0x11c70, 0x11c8f}, {0x11c92, 0x11ca7}, {0x11ca9, 0x11cb6}, + {0x12000, 0x12399}, {0x12400, 0x1246e}, {0x12470, 0x12474}, {0x12480, 0x12543}, + {0x13000, 0x1342e}, {0x14400, 0x14646}, {0x16800, 0x16a38}, {0x16a40, 0x16a5e}, + {0x16a60, 0x16a69}, {0x16ad0, 0x16aed}, {0x16af0, 0x16af5}, {0x16b00, 0x16b45}, + {0x16b50, 0x16b59}, {0x16b5b, 0x16b61}, {0x16b63, 0x16b77}, {0x16b7d, 0x16b8f}, + {0x16f00, 0x16f44}, {0x16f50, 0x16f7e}, {0x16f8f, 0x16f9f}, {0x17000, 0x187ec}, + {0x18800, 0x18af2}, {0x1bc00, 0x1bc6a}, {0x1bc70, 0x1bc7c}, {0x1bc80, 0x1bc88}, + {0x1bc90, 0x1bc99}, {0x1bc9c, 0x1bc9f}, {0x1d000, 0x1d0f5}, {0x1d100, 0x1d126}, + {0x1d129, 0x1d172}, {0x1d17b, 0x1d1e8}, {0x1d200, 0x1d245}, {0x1d300, 0x1d356}, + {0x1d360, 0x1d371}, {0x1d400, 0x1d454}, {0x1d456, 0x1d49c}, {0x1d4a9, 0x1d4ac}, + {0x1d4ae, 0x1d4b9}, {0x1d4bd, 0x1d4c3}, {0x1d4c5, 0x1d505}, {0x1d507, 0x1d50a}, + {0x1d50d, 0x1d514}, {0x1d516, 0x1d51c}, {0x1d51e, 0x1d539}, {0x1d53b, 0x1d53e}, + {0x1d540, 0x1d544}, {0x1d54a, 0x1d550}, {0x1d552, 0x1d6a5}, {0x1d6a8, 0x1d7cb}, + {0x1d7ce, 0x1da8b}, {0x1da9b, 0x1da9f}, {0x1daa1, 0x1daaf}, {0x1e000, 0x1e006}, + {0x1e008, 0x1e018}, {0x1e01b, 0x1e021}, {0x1e026, 0x1e02a}, {0x1e800, 0x1e8c4}, + {0x1e8c7, 0x1e8d6}, {0x1e900, 0x1e94a}, {0x1e950, 0x1e959}, {0x1ee00, 0x1ee03}, + {0x1ee05, 0x1ee1f}, {0x1ee29, 0x1ee32}, {0x1ee34, 0x1ee37}, {0x1ee4d, 0x1ee4f}, + {0x1ee67, 0x1ee6a}, {0x1ee6c, 0x1ee72}, {0x1ee74, 0x1ee77}, {0x1ee79, 0x1ee7c}, + {0x1ee80, 0x1ee89}, {0x1ee8b, 0x1ee9b}, {0x1eea1, 0x1eea3}, {0x1eea5, 0x1eea9}, + {0x1eeab, 0x1eebb}, {0x1f000, 0x1f02b}, {0x1f030, 0x1f093}, {0x1f0a0, 0x1f0ae}, + {0x1f0b1, 0x1f0bf}, {0x1f0c1, 0x1f0cf}, {0x1f0d1, 0x1f0f5}, {0x1f100, 0x1f10c}, + {0x1f110, 0x1f12e}, {0x1f130, 0x1f16b}, {0x1f170, 0x1f1ac}, {0x1f1e6, 0x1f202}, + {0x1f210, 0x1f23b}, {0x1f240, 0x1f248}, {0x1f300, 0x1f6d2}, {0x1f6e0, 0x1f6ec}, + {0x1f6f0, 0x1f6f6}, {0x1f700, 0x1f773}, {0x1f780, 0x1f7d4}, {0x1f800, 0x1f80b}, + {0x1f810, 0x1f847}, {0x1f850, 0x1f859}, {0x1f860, 0x1f887}, {0x1f890, 0x1f8ad}, + {0x1f910, 0x1f91e}, {0x1f920, 0x1f927}, {0x1f933, 0x1f93e}, {0x1f940, 0x1f94b}, + {0x1f950, 0x1f95e}, {0x1f980, 0x1f991}, {0x20000, 0x2a6d6}, {0x2a700, 0x2b734}, + {0x2b740, 0x2b81d}, {0x2b820, 0x2cea1}, {0x2f800, 0x2fa1d}, {0xe0100, 0xe01ef} #endif }; @@ -747,20 +758,20 @@ static const chr graphCharTable[] = { 0xad0, 0xaf9, 0xb0f, 0xb10, 0xb32, 0xb33, 0xb47, 0xb48, 0xb56, 0xb57, 0xb5c, 0xb5d, 0xb82, 0xb83, 0xb99, 0xb9a, 0xb9c, 0xb9e, 0xb9f, 0xba3, 0xba4, 0xbd0, 0xbd7, 0xc55, 0xc56, 0xcd5, 0xcd6, - 0xcde, 0xcf1, 0xcf2, 0xd57, 0xd82, 0xd83, 0xdbd, 0xdca, 0xdd6, - 0xe81, 0xe82, 0xe84, 0xe87, 0xe88, 0xe8a, 0xe8d, 0xea5, 0xea7, - 0xeaa, 0xeab, 0xec6, 0x10c7, 0x10cd, 0x1258, 0x12c0, 0x1772, 0x1773, - 0x1940, 0x1cf8, 0x1cf9, 0x1f59, 0x1f5b, 0x1f5d, 0x2070, 0x2071, 0x2d27, - 0x2d2d, 0x2d6f, 0x2d70, 0xfb3e, 0xfb40, 0xfb41, 0xfb43, 0xfb44, 0xfffc, - 0xfffd + 0xcde, 0xcf1, 0xcf2, 0xd82, 0xd83, 0xdbd, 0xdca, 0xdd6, 0xe81, + 0xe82, 0xe84, 0xe87, 0xe88, 0xe8a, 0xe8d, 0xea5, 0xea7, 0xeaa, + 0xeab, 0xec6, 0x10c7, 0x10cd, 0x1258, 0x12c0, 0x1772, 0x1773, 0x1940, + 0x1cf8, 0x1cf9, 0x1f59, 0x1f5b, 0x1f5d, 0x2070, 0x2071, 0x2d27, 0x2d2d, + 0x2d6f, 0x2d70, 0xfb3e, 0xfb40, 0xfb41, 0xfb43, 0xfb44, 0xfffc, 0xfffd #if TCL_UTF_MAX > 4 ,0x1003c, 0x1003d, 0x101a0, 0x1056f, 0x10808, 0x10837, 0x10838, 0x1083c, 0x108f4, 0x108f5, 0x1093f, 0x10a05, 0x10a06, 0x11288, 0x1130f, 0x11310, 0x11332, 0x11333, - 0x11347, 0x11348, 0x11350, 0x11357, 0x118ff, 0x16a6e, 0x16a6f, 0x1b000, 0x1b001, - 0x1d49e, 0x1d49f, 0x1d4a2, 0x1d4a5, 0x1d4a6, 0x1d4bb, 0x1d546, 0x1ee21, 0x1ee22, - 0x1ee24, 0x1ee27, 0x1ee39, 0x1ee3b, 0x1ee42, 0x1ee47, 0x1ee49, 0x1ee4b, 0x1ee51, - 0x1ee52, 0x1ee54, 0x1ee57, 0x1ee59, 0x1ee5b, 0x1ee5d, 0x1ee5f, 0x1ee61, 0x1ee62, - 0x1ee64, 0x1ee7e, 0x1eef0, 0x1eef1, 0x1f250, 0x1f251, 0x1f9c0 + 0x11347, 0x11348, 0x11350, 0x11357, 0x1145b, 0x1145d, 0x118ff, 0x16a6e, 0x16a6f, + 0x16fe0, 0x1b000, 0x1b001, 0x1d49e, 0x1d49f, 0x1d4a2, 0x1d4a5, 0x1d4a6, 0x1d4bb, + 0x1d546, 0x1e023, 0x1e024, 0x1e95e, 0x1e95f, 0x1ee21, 0x1ee22, 0x1ee24, 0x1ee27, + 0x1ee39, 0x1ee3b, 0x1ee42, 0x1ee47, 0x1ee49, 0x1ee4b, 0x1ee51, 0x1ee52, 0x1ee54, + 0x1ee57, 0x1ee59, 0x1ee5b, 0x1ee5d, 0x1ee5f, 0x1ee61, 0x1ee62, 0x1ee64, 0x1ee7e, + 0x1eef0, 0x1eef1, 0x1f250, 0x1f251, 0x1f930, 0x1f9c0 #endif }; diff --git a/generic/tclUniData.c b/generic/tclUniData.c index d2f66fe..20fab8c 100644 --- a/generic/tclUniData.c +++ b/generic/tclUniData.c @@ -29,36 +29,36 @@ static const unsigned short pageMap[] = { 832, 864, 896, 928, 960, 992, 224, 1024, 224, 1056, 224, 224, 1088, 1120, 1152, 1184, 1216, 1248, 1280, 1312, 1344, 1376, 1408, 1344, 1344, 1440, 1472, 1504, 1536, 1568, 1344, 1344, 1600, 1632, 1664, 1696, 1728, - 1760, 1792, 1792, 1824, 1792, 1856, 1888, 1920, 1952, 1984, 2016, 2048, - 2080, 2112, 2144, 2176, 2208, 2240, 2272, 2304, 2336, 2368, 2400, 2432, - 2464, 2496, 2528, 2560, 2592, 2624, 2656, 2688, 2720, 2752, 2784, 2816, - 2848, 2880, 2784, 2912, 2944, 2976, 3008, 3040, 3072, 3104, 3136, 3168, - 3200, 1792, 3232, 3264, 3296, 1792, 3328, 3360, 3392, 3424, 3456, 3488, - 3520, 1792, 1344, 3552, 3584, 3616, 3648, 3680, 3712, 3744, 1344, 1344, - 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 3776, 1344, 3808, 3840, - 3872, 1344, 3904, 1344, 3936, 3968, 4000, 4032, 4032, 4064, 4096, 1344, + 1760, 1792, 1792, 1824, 1856, 1888, 1920, 1952, 1984, 2016, 2048, 2080, + 2112, 2144, 2176, 2208, 2240, 2272, 2304, 2336, 2368, 2400, 2432, 2464, + 2496, 2528, 2560, 2592, 2624, 2656, 2688, 2720, 2752, 2784, 2816, 2848, + 2880, 2912, 2944, 2976, 3008, 3040, 3072, 3104, 3136, 3168, 3200, 3232, + 3264, 1792, 3296, 3328, 3360, 1792, 3392, 3424, 3456, 3488, 3520, 3552, + 3584, 1792, 1344, 3616, 3648, 3680, 3712, 3744, 3776, 3808, 1344, 1344, + 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 3840, 1344, 3872, 3904, + 3936, 1344, 3968, 1344, 4000, 4032, 4064, 4096, 4096, 4128, 4160, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, - 1344, 1344, 1344, 1344, 1344, 4128, 4160, 1344, 1344, 4192, 4224, 4256, - 4288, 4320, 1344, 4352, 4384, 4416, 4448, 1344, 4480, 4512, 1344, 4544, - 1344, 4576, 4608, 4640, 4672, 4704, 1344, 4736, 4768, 4800, 4832, 1344, - 4864, 4896, 4928, 4960, 1792, 1792, 4992, 5024, 5056, 5088, 5120, 5152, - 1344, 5184, 1344, 5216, 5248, 5280, 1792, 1792, 5312, 5344, 5376, 5408, - 5440, 5472, 5504, 5440, 704, 5536, 224, 224, 224, 224, 5568, 224, 224, - 224, 5600, 5632, 5664, 5696, 5728, 5760, 5792, 5824, 5856, 5888, 5920, - 5952, 5984, 6016, 6048, 6080, 6112, 6144, 6176, 6208, 6240, 6272, 6304, - 6336, 6368, 6368, 6368, 6368, 6368, 6368, 6368, 6368, 6400, 6432, 4800, - 6464, 6496, 6528, 6560, 6592, 4800, 6624, 6656, 6688, 6720, 6752, 6784, - 6816, 4800, 4800, 4800, 4800, 4800, 6848, 6880, 6912, 4800, 4800, 4800, - 6944, 4800, 4800, 4800, 4800, 4800, 4800, 4800, 6976, 7008, 4800, 7040, - 7072, 4800, 4800, 4800, 4800, 4800, 4800, 4800, 4800, 6368, 6368, 6368, - 6368, 7104, 6368, 7136, 7168, 6368, 6368, 6368, 6368, 6368, 6368, 6368, - 6368, 4800, 7200, 7232, 7264, 7296, 7328, 7360, 7392, 7424, 7456, 7488, - 7520, 224, 224, 224, 7552, 7584, 7616, 1344, 7648, 7680, 7712, 7712, - 704, 7744, 7776, 7808, 1792, 7840, 4800, 4800, 7872, 4800, 4800, 4800, - 4800, 4800, 4800, 7904, 7936, 7968, 8000, 3136, 1344, 8032, 4096, 1344, - 8064, 8096, 8128, 1344, 1344, 8160, 8192, 4800, 8224, 8256, 8288, 8320, - 4800, 8288, 8352, 4800, 8256, 4800, 4800, 4800, 4800, 4800, 4800, 4800, - 4800, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, + 1344, 1344, 1344, 1344, 1344, 4192, 4224, 1344, 1344, 4256, 4288, 4320, + 4352, 4384, 1344, 4416, 4448, 4480, 4512, 1344, 4544, 4576, 4608, 4640, + 1344, 4672, 4704, 4736, 4768, 4800, 1344, 4832, 4864, 4896, 4928, 1344, + 4960, 4992, 5024, 5056, 1792, 1792, 5088, 5120, 5152, 5184, 5216, 5248, + 1344, 5280, 1344, 5312, 5344, 5376, 5408, 1792, 5440, 5472, 5504, 5536, + 5568, 5600, 5632, 5568, 704, 5664, 224, 224, 224, 224, 5696, 224, 224, + 224, 5728, 5760, 5792, 5824, 5856, 5888, 5920, 5952, 5984, 6016, 6048, + 6080, 6112, 6144, 6176, 6208, 6240, 6272, 6304, 6336, 6368, 6400, 6432, + 6464, 6496, 6496, 6496, 6496, 6496, 6496, 6496, 6496, 6528, 6560, 4896, + 6592, 6624, 6656, 6688, 6720, 4896, 6752, 6784, 6816, 6848, 6880, 6912, + 6944, 4896, 4896, 4896, 4896, 4896, 6976, 7008, 7040, 4896, 4896, 4896, + 7072, 4896, 4896, 4896, 4896, 4896, 4896, 4896, 7104, 7136, 4896, 7168, + 7200, 4896, 4896, 4896, 4896, 4896, 4896, 4896, 4896, 6496, 6496, 6496, + 6496, 7232, 6496, 7264, 7296, 6496, 6496, 6496, 6496, 6496, 6496, 6496, + 6496, 4896, 7328, 7360, 7392, 7424, 7456, 7488, 7520, 7552, 7584, 7616, + 7648, 224, 224, 224, 7680, 7712, 7744, 1344, 7776, 7808, 7840, 7840, + 704, 7872, 7904, 7936, 1792, 7968, 4896, 4896, 8000, 4896, 4896, 4896, + 4896, 4896, 4896, 8032, 8064, 8096, 8128, 3200, 1344, 8160, 4160, 1344, + 8192, 8224, 8256, 1344, 1344, 8288, 8320, 4896, 8352, 8384, 8416, 8448, + 4896, 8416, 8480, 4896, 8384, 4896, 4896, 4896, 4896, 4896, 4896, 4896, + 4896, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, @@ -75,7 +75,7 @@ static const unsigned short pageMap[] = { 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, - 1344, 1344, 4576, 4800, 4800, 1344, 1344, 1344, 1344, 1344, 1344, 1344, + 1344, 1344, 4672, 4896, 4896, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, @@ -129,16 +129,16 @@ static const unsigned short pageMap[] = { 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, - 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 4576, - 1792, 8384, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, + 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 4672, + 1792, 8512, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, - 1344, 8416, 4800, 8448, 5280, 1344, 1344, 1344, 1344, 1344, 1344, 1344, - 1344, 8480, 8512, 224, 8544, 8576, 1344, 1344, 8608, 8640, 8672, 224, - 8704, 8736, 8768, 1792, 8800, 8832, 8864, 1344, 8896, 8928, 8960, 8992, - 9024, 1632, 9056, 9088, 9120, 1888, 9152, 9184, 9216, 1344, 9248, 9280, - 9312, 1344, 9344, 9376, 9408, 9440, 9472, 9504, 9536, 9568, 9568, 1344, - 9600, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, + 1344, 8544, 4896, 8576, 5376, 1344, 1344, 1344, 1344, 1344, 1344, 1344, + 1344, 8608, 8640, 224, 8672, 8704, 1344, 1344, 8736, 8768, 8800, 224, + 8832, 8864, 8896, 1792, 8928, 8960, 8992, 1344, 9024, 9056, 9088, 9120, + 9152, 1632, 9184, 9216, 9248, 1920, 9280, 9312, 9344, 1344, 9376, 9408, + 9440, 1344, 9472, 9504, 9536, 9568, 9600, 9632, 9664, 9696, 9696, 1344, + 9728, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, @@ -167,95 +167,73 @@ static const unsigned short pageMap[] = { 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, - 1344, 1344, 9632, 9664, 9696, 9728, 9728, 9728, 9728, 9728, 9728, 9728, - 9728, 9728, 9728, 9728, 9728, 9728, 9728, 9728, 9728, 9728, 9728, 9728, - 9728, 9728, 9728, 9728, 9728, 9728, 9728, 9728, 9728, 9728, 9728, 9728, - 9728, 9728, 9728, 9728, 9728, 9728, 9728, 9728, 9728, 9728, 9728, 9728, - 9728, 9728, 9728, 9728, 9728, 9728, 9728, 9728, 9728, 9728, 9728, 9728, - 9728, 9728, 9728, 9728, 9728, 9728, 9728, 9728, 9728, 9760, 9760, 9760, - 9760, 9760, 9760, 9760, 9760, 9760, 9760, 9760, 9760, 9760, 9760, 9760, - 9760, 9760, 9760, 9760, 9760, 9760, 9760, 9760, 9760, 9760, 9760, 9760, - 9760, 9760, 9760, 9760, 9760, 9760, 9760, 9760, 9760, 9760, 9760, 9760, - 9760, 9760, 9760, 9760, 9760, 9760, 9760, 9760, 9760, 9760, 9760, 9760, - 9760, 9760, 9760, 9760, 9760, 9760, 9760, 9760, 9760, 9760, 9760, 9760, - 9760, 9760, 9760, 9760, 9760, 9760, 9760, 9760, 9760, 9760, 9760, 9760, - 9760, 9760, 9760, 9760, 9760, 9760, 9760, 9760, 9760, 9760, 9760, 9760, - 9760, 9760, 9760, 9760, 9760, 9760, 9760, 9760, 9760, 9760, 9760, 9760, - 9760, 9760, 9760, 9760, 9760, 9760, 9760, 9760, 9760, 9760, 9760, 9760, - 9760, 9760, 9760, 9760, 9760, 9760, 9760, 9760, 9760, 9760, 9760, 9760, - 9760, 9760, 9760, 9760, 9760, 9760, 9760, 9760, 9760, 9760, 9760, 9760, - 9760, 9760, 9760, 9760, 9760, 9760, 9760, 9760, 9760, 9760, 9760, 9760, - 9760, 9760, 9760, 9760, 9760, 9760, 9760, 9760, 9760, 9760, 9760, 9760, - 9760, 9760, 9760, 9760, 9760, 9760, 9760, 9760, 9760, 9760, 9760, 9760, - 9760, 9760, 9760, 9760, 9760, 9760, 9760, 9760, 9760, 9760, 9760, 9760, - 9760, 9760, 9760, 9760, 9760, 9760, 9760, 9760, 9760, 9760, 9760, 9760, - 9760, 9760, 9760, 9760, 9760, 1344, 1344, 1344, 1344, 1344, 1344, 1344, - 1344, 1344, 1344, 1344, 9792, 1344, 1344, 9824, 1792, 9856, 9888, 9920, - 1344, 1344, 9952, 9984, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, - 1344, 1344, 10016, 10048, 1344, 10080, 1344, 10112, 10144, 10176, 10208, - 10240, 10272, 1344, 1344, 1344, 10304, 10336, 64, 10368, 10400, 10432, - 4608, 10464, 10496 + 1344, 1344, 9760, 9792, 9824, 9856, 9856, 9856, 9856, 9856, 9856, 9856, + 9856, 9856, 9856, 9856, 9856, 9856, 9856, 9856, 9856, 9856, 9856, 9856, + 9856, 9856, 9856, 9856, 9856, 9856, 9856, 9856, 9856, 9856, 9856, 9856, + 9856, 9856, 9856, 9856, 9856, 9856, 9856, 9856, 9856, 9856, 9856, 9856, + 9856, 9856, 9856, 9856, 9856, 9856, 9856, 9856, 9856, 9856, 9856, 9856, + 9856, 9856, 9856, 9856, 9856, 9856, 9856, 9856, 9856, 9888, 9888, 9888, + 9888, 9888, 9888, 9888, 9888, 9888, 9888, 9888, 9888, 9888, 9888, 9888, + 9888, 9888, 9888, 9888, 9888, 9888, 9888, 9888, 9888, 9888, 9888, 9888, + 9888, 9888, 9888, 9888, 9888, 9888, 9888, 9888, 9888, 9888, 9888, 9888, + 9888, 9888, 9888, 9888, 9888, 9888, 9888, 9888, 9888, 9888, 9888, 9888, + 9888, 9888, 9888, 9888, 9888, 9888, 9888, 9888, 9888, 9888, 9888, 9888, + 9888, 9888, 9888, 9888, 9888, 9888, 9888, 9888, 9888, 9888, 9888, 9888, + 9888, 9888, 9888, 9888, 9888, 9888, 9888, 9888, 9888, 9888, 9888, 9888, + 9888, 9888, 9888, 9888, 9888, 9888, 9888, 9888, 9888, 9888, 9888, 9888, + 9888, 9888, 9888, 9888, 9888, 9888, 9888, 9888, 9888, 9888, 9888, 9888, + 9888, 9888, 9888, 9888, 9888, 9888, 9888, 9888, 9888, 9888, 9888, 9888, + 9888, 9888, 9888, 9888, 9888, 9888, 9888, 9888, 9888, 9888, 9888, 9888, + 9888, 9888, 9888, 9888, 9888, 9888, 9888, 9888, 9888, 9888, 9888, 9888, + 9888, 9888, 9888, 9888, 9888, 9888, 9888, 9888, 9888, 9888, 9888, 9888, + 9888, 9888, 9888, 9888, 9888, 9888, 9888, 9888, 9888, 9888, 9888, 9888, + 9888, 9888, 9888, 9888, 9888, 9888, 9888, 9888, 9888, 9888, 9888, 9888, + 9888, 9888, 9888, 9888, 9888, 9888, 9888, 9888, 9888, 9888, 9888, 9888, + 9888, 9888, 9888, 9888, 9888, 1344, 1344, 1344, 1344, 1344, 1344, 1344, + 1344, 1344, 1344, 1344, 9920, 1344, 1344, 9952, 1792, 9984, 10016, + 10048, 1344, 1344, 10080, 10112, 1344, 1344, 1344, 1344, 1344, 1344, + 1344, 1344, 1344, 1344, 10144, 10176, 1344, 10208, 1344, 10240, 10272, + 10304, 10336, 10368, 10400, 1344, 1344, 1344, 10432, 10464, 64, 10496, + 10528, 10560, 4704, 10592, 10624 #if TCL_UTF_MAX > 3 - ,10528, 10560, 10592, 1792, 1344, 1344, 1344, 8192, 10624, 10656, 10688, - 10720, 10752, 10784, 10816, 10848, 1792, 1792, 1792, 1792, 9120, 1344, - 10880, 10912, 1344, 10944, 10976, 11008, 11040, 1344, 11072, 1792, - 11104, 11136, 11168, 1344, 11200, 11232, 1792, 1792, 1344, 11264, 1344, - 11296, 1792, 1792, 1792, 1792, 1344, 1344, 1344, 1344, 1344, 1344, - 1344, 1344, 1344, 7680, 4576, 10112, 1792, 1792, 1792, 1792, 11328, - 11360, 11392, 11424, 4608, 11456, 1792, 11488, 11520, 11552, 1792, - 1792, 1344, 11584, 11616, 6688, 11648, 11680, 11712, 11744, 11776, - 1792, 11808, 11840, 1344, 11872, 11904, 11936, 11968, 12000, 1792, - 1792, 1344, 1344, 12032, 1792, 12064, 12096, 12128, 12160, 1792, 1792, - 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 12192, 1792, - 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 12224, - 12256, 12288, 12320, 5120, 12352, 12384, 12416, 12448, 12480, 12512, - 12544, 5120, 12576, 12608, 12640, 12672, 12704, 1792, 1792, 12736, - 12768, 12800, 12832, 12864, 2304, 12896, 12928, 1792, 1792, 1792, 1792, - 1792, 1792, 1792, 1792, 1344, 12960, 12992, 1792, 1792, 1792, 1792, - 1792, 1344, 13024, 13056, 1792, 1344, 13088, 13120, 1792, 1344, 13152, - 11232, 1792, 13184, 13216, 1792, 1792, 1792, 1792, 1792, 1792, 1792, - 1792, 1792, 1792, 1792, 13248, 13280, 13312, 1792, 1792, 1792, 1792, - 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1344, 13344, + ,10656, 10688, 10720, 1792, 1344, 1344, 1344, 8320, 10752, 10784, 10816, + 10848, 10880, 10912, 10944, 10976, 1792, 1792, 1792, 1792, 9248, 1344, + 11008, 11040, 1344, 11072, 11104, 11136, 11168, 1344, 11200, 1792, + 11232, 11264, 11296, 1344, 11328, 11360, 11392, 11424, 1344, 11456, + 1344, 11488, 1792, 1792, 1792, 1792, 1344, 1344, 1344, 1344, 1344, + 1344, 1344, 1344, 1344, 7808, 4672, 10240, 1792, 1792, 1792, 1792, + 11520, 11552, 11584, 11616, 4704, 11648, 1792, 11680, 11712, 11744, + 1792, 1792, 1344, 11776, 11808, 6816, 11840, 11872, 11904, 11936, 11968, + 1792, 12000, 12032, 1344, 12064, 12096, 12128, 12160, 12192, 1792, + 1792, 1344, 1344, 12224, 1792, 12256, 12288, 12320, 12352, 1792, 1792, + 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 12384, 1792, + 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 12416, + 12448, 12480, 12512, 5216, 12544, 12576, 12608, 12640, 12672, 12704, + 12736, 5216, 12768, 12800, 12832, 12864, 12896, 1792, 1792, 12928, + 12960, 12992, 13024, 13056, 2336, 13088, 13120, 1792, 1792, 1792, 1792, + 1344, 13152, 13184, 1792, 1344, 13216, 13248, 1792, 1792, 1792, 1792, + 1792, 1344, 13280, 13312, 1792, 1344, 13344, 13376, 13408, 1344, 13440, + 13472, 1792, 13504, 13536, 1792, 1792, 1792, 1792, 1792, 1792, 1792, + 1792, 1792, 1792, 1792, 13568, 13600, 13632, 1792, 1792, 1792, 1792, + 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1344, 13664, + 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 13696, 13728, 13760, + 13792, 13824, 13856, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, - 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, - 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, - 1792, 1792, 1792, 1792, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, + 1792, 1792, 1792, 1792, 1792, 1792, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, - 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 9824, 1792, 1792, 1792, - 10688, 10688, 10688, 13376, 1344, 1344, 1344, 1344, 1344, 1344, 13408, + 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 9952, 1792, + 1792, 1792, 10816, 10816, 10816, 13888, 1344, 1344, 1344, 1344, 1344, + 1344, 13920, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, - 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, - 1792, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, + 1792, 1792, 1792, 1792, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, - 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 13440, - 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, - 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, - 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, - 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, - 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, - 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, - 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, - 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, - 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, - 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, - 1792, 1792, 1792, 1792, 1792, 1792, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, - 13472, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, - 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, - 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, - 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, - 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, - 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, - 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, - 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, - 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, - 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, - 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, + 1344, 13952, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, @@ -265,14 +243,10 @@ static const unsigned short pageMap[] = { 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, - 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, - 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, - 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1344, 1344, 1344, 1344, 1344, + 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, - 13344, 4608, 13504, 1792, 1792, 10048, 13536, 1344, 13568, 13600, 13632, - 13664, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, + 1344, 1344, 1344, 13984, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, - 1792, 1792, 1792, 1792, 1792, 1344, 1344, 13696, 13728, 13760, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, @@ -293,7 +267,31 @@ static const unsigned short pageMap[] = { 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, + 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1344, 1344, + 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, + 1344, 1344, 1344, 13664, 4704, 14016, 1792, 1792, 10176, 14048, 1344, + 14080, 14112, 14144, 14176, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, + 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1344, 1344, 14208, + 14240, 14272, 1792, 1792, 14304, 1344, 1344, 1344, 1344, 1344, 1344, + 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, + 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, + 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, + 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, + 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, + 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, + 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, + 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, + 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, + 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, + 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, + 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, + 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, + 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, + 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, + 1344, 1344, 1344, 1344, 1344, 14336, 1344, 1344, 1344, 1344, 1344, + 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, + 1344, 1344, 1344, 1344, 1344, 1344, 14368, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, @@ -315,19 +313,18 @@ static const unsigned short pageMap[] = { 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, - 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 13792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, + 1792, 1792, 1792, 1792, 14400, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, - 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1344, - 1344, 1344, 13824, 13856, 13888, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, + 1792, 1792, 1792, 1792, 1792, 1344, 1344, 1344, 14432, 14464, 14496, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, @@ -337,40 +334,44 @@ static const unsigned short pageMap[] = { 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, - 1792, 1792, 1792, 1792, 4800, 4800, 4800, 4800, 4800, 4800, 4800, 7904, - 4800, 13920, 4800, 13952, 13984, 14016, 4800, 14048, 4800, 4800, 14080, - 1792, 1792, 1792, 1792, 1792, 4800, 4800, 14112, 14144, 1792, 1792, - 1792, 1792, 14176, 14208, 14240, 14272, 14304, 14336, 14368, 14400, - 14432, 14464, 14496, 14528, 14560, 14176, 14208, 14592, 14272, 14624, - 14656, 14688, 14400, 14720, 14752, 14784, 14816, 14848, 14880, 14912, - 14944, 14976, 15008, 15040, 4800, 4800, 4800, 4800, 4800, 4800, 4800, - 4800, 4800, 4800, 4800, 4800, 4800, 4800, 4800, 4800, 704, 15072, 704, - 15104, 15136, 15168, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, + 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 4896, 4896, + 4896, 4896, 4896, 4896, 4896, 8032, 4896, 14528, 4896, 14560, 14592, + 14624, 4896, 14656, 4896, 4896, 14688, 1792, 1792, 1792, 1792, 1792, + 4896, 4896, 14720, 14752, 1792, 1792, 1792, 1792, 14784, 14816, 14848, + 14880, 14912, 14944, 14976, 15008, 15040, 15072, 15104, 15136, 15168, + 14784, 14816, 15200, 14880, 15232, 15264, 15296, 15008, 15328, 15360, + 15392, 15424, 15456, 15488, 15520, 15552, 15584, 15616, 15648, 4896, + 4896, 4896, 4896, 4896, 4896, 4896, 4896, 4896, 4896, 4896, 4896, 4896, + 4896, 4896, 4896, 704, 15680, 704, 15712, 15744, 15776, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, + 1792, 1792, 1792, 1792, 15808, 15840, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, - 1792, 1792, 1344, 1344, 1344, 1344, 1344, 1344, 15200, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, + 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1344, 1344, 1344, + 1344, 1344, 1344, 15872, 1792, 15904, 15936, 15968, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, - 1792, 1792, 1792, 15232, 15264, 15296, 15328, 15360, 15392, 1792, 15424, - 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 4800, 15456, 4800, - 4800, 7872, 15488, 15520, 7904, 15552, 15584, 4800, 15456, 15616, 1792, - 1792, 15648, 15680, 15616, 15712, 1792, 1792, 1792, 1792, 1792, 4800, - 4800, 4800, 4800, 4800, 4800, 4800, 15744, 4800, 4800, 4800, 4800, - 4800, 4800, 4800, 4800, 4800, 4800, 4800, 7840, 4800, 15776, 4800, - 4800, 4800, 4800, 4800, 4800, 4800, 4800, 15808, 15840, 4800, 4800, - 4800, 7872, 4800, 4800, 15872, 1792, 15456, 4800, 15904, 4800, 15936, - 15968, 1792, 1792, 16000, 1792, 1792, 1792, 16032, 1792, 10784, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, + 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 16000, + 16032, 16064, 16096, 16128, 16160, 1792, 16192, 1792, 1792, 1792, 1792, + 1792, 1792, 1792, 1792, 4896, 16224, 4896, 4896, 8000, 16256, 16288, + 8032, 16320, 16352, 4896, 16224, 4896, 16384, 1792, 16416, 16448, 16480, + 16512, 1792, 1792, 1792, 1792, 1792, 4896, 4896, 4896, 4896, 4896, + 4896, 4896, 16544, 4896, 4896, 4896, 4896, 4896, 4896, 4896, 4896, + 4896, 4896, 4896, 4896, 4896, 4896, 4896, 4896, 4896, 4896, 4896, 4896, + 4896, 4896, 16576, 16608, 4896, 4896, 4896, 8000, 4896, 4896, 16640, + 1792, 16224, 4896, 16672, 4896, 16704, 16736, 1792, 1792, 16768, 16800, + 16832, 1792, 16864, 1792, 10912, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, + 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, @@ -481,8 +482,7 @@ static const unsigned short pageMap[] = { 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, - 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, - 1344, 1344, 7680, 1792, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, + 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 7808, 1792, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, @@ -493,7 +493,8 @@ static const unsigned short pageMap[] = { 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, - 1344, 1824, 1344, 1344, 1344, 1344, 1344, 1344, 11200, 1344, 1344, + 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 16896, 1344, 1344, + 1344, 1344, 1344, 1344, 11328, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, @@ -508,7 +509,7 @@ static const unsigned short pageMap[] = { 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, - 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 13792, + 1344, 1344, 1344, 1344, 1344, 1344, 14400, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, @@ -536,8 +537,8 @@ static const unsigned short pageMap[] = { 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, - 1792, 1792, 1792, 1792, 1792, 1792, 1344, 1344, 1344, 1344, 1344, 1344, - 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 11200 + 1792, 1792, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, + 1344, 1344, 1344, 1344, 1344, 1344, 11328 #endif /* TCL_UTF_MAX > 3 */ }; @@ -579,7 +580,7 @@ static const unsigned char groupMap[] = { 23, 24, 21, 21, 21, 21, 21, 21, 55, 23, 24, 56, 57, 58, 58, 23, 24, 59, 60, 61, 23, 24, 23, 24, 23, 24, 23, 24, 23, 24, 62, 63, 64, 65, 66, 21, 67, 67, 21, 68, 21, 69, 70, 21, 21, 21, 67, 71, 21, 72, 21, - 73, 74, 21, 75, 76, 21, 77, 78, 21, 21, 76, 21, 79, 80, 21, 21, 81, + 73, 74, 21, 75, 76, 74, 77, 78, 21, 21, 76, 21, 79, 80, 21, 21, 81, 21, 21, 21, 21, 21, 21, 21, 82, 21, 21, 83, 21, 21, 83, 21, 21, 21, 84, 83, 85, 86, 86, 87, 21, 21, 21, 21, 21, 88, 21, 15, 21, 21, 21, 21, 21, 21, 21, 21, 89, 90, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, @@ -654,453 +655,460 @@ static const unsigned char groupMap[] = { 92, 92, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 92, 92, 92, 92, 92, 92, 92, + 15, 15, 15, 15, 15, 15, 15, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 17, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, - 92, 92, 92, 92, 92, 92, 92, 92, 124, 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 92, 124, 92, 15, 124, - 124, 124, 92, 92, 92, 92, 92, 92, 92, 92, 124, 124, 124, 124, 92, 124, - 124, 15, 92, 92, 92, 92, 92, 92, 92, 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 92, 92, 3, 3, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 3, 91, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 92, 124, 124, 0, - 15, 15, 15, 15, 15, 15, 15, 15, 0, 0, 15, 15, 0, 0, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 15, 0, 15, 15, 15, 15, 15, 15, 15, 0, 15, 0, 0, 0, 15, 15, 15, 15, - 0, 0, 92, 15, 124, 124, 124, 92, 92, 92, 92, 0, 0, 124, 124, 0, 0, - 124, 124, 92, 15, 0, 0, 0, 0, 0, 0, 0, 0, 124, 0, 0, 0, 0, 15, 15, - 0, 15, 15, 15, 92, 92, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 15, 15, - 4, 4, 18, 18, 18, 18, 18, 18, 14, 4, 0, 0, 0, 0, 0, 92, 92, 124, 0, - 15, 15, 15, 15, 15, 15, 0, 0, 0, 0, 15, 15, 0, 0, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 0, 15, 15, 15, 15, 15, 15, 15, 0, 15, 15, 0, 15, 15, 0, 15, 15, 0, - 0, 92, 0, 124, 124, 124, 92, 92, 0, 0, 0, 0, 92, 92, 0, 0, 92, 92, - 92, 0, 0, 0, 92, 0, 0, 0, 0, 0, 0, 0, 15, 15, 15, 15, 0, 15, 0, 0, - 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 92, 92, 15, 15, 15, 92, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 92, 92, 124, 0, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 0, 15, 15, 15, 0, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 0, 15, 15, 15, - 15, 15, 15, 15, 0, 15, 15, 0, 15, 15, 15, 15, 15, 0, 0, 92, 15, 124, - 124, 124, 92, 92, 92, 92, 92, 0, 92, 92, 124, 0, 124, 124, 92, 0, 0, - 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 15, 92, 92, 0, - 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 3, 4, 0, 0, 0, 0, 0, 0, 0, 15, 0, - 0, 0, 0, 0, 0, 0, 92, 124, 124, 0, 15, 15, 15, 15, 15, 15, 15, 15, - 0, 0, 15, 15, 0, 0, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 0, 15, 15, 15, 15, 15, 15, - 15, 0, 15, 15, 0, 15, 15, 15, 15, 15, 0, 0, 92, 15, 124, 92, 124, 92, - 92, 92, 92, 0, 0, 124, 124, 0, 0, 124, 124, 92, 0, 0, 0, 0, 0, 0, 0, - 0, 92, 124, 0, 0, 0, 0, 15, 15, 0, 15, 15, 15, 92, 92, 0, 0, 9, 9, - 9, 9, 9, 9, 9, 9, 9, 9, 14, 15, 18, 18, 18, 18, 18, 18, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 92, 15, 0, 15, 15, 15, 15, 15, 15, 0, 0, 0, 15, 15, - 15, 0, 15, 15, 15, 15, 0, 0, 0, 15, 15, 0, 15, 0, 15, 15, 0, 0, 0, - 15, 15, 0, 0, 0, 15, 15, 15, 0, 0, 0, 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 0, 0, 0, 0, 124, 124, 92, 124, 124, 0, 0, 0, 124, 124, - 124, 0, 124, 124, 124, 92, 0, 0, 15, 0, 0, 0, 0, 0, 0, 124, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 18, - 18, 18, 14, 14, 14, 14, 14, 14, 4, 14, 0, 0, 0, 0, 0, 92, 124, 124, - 124, 0, 15, 15, 15, 15, 15, 15, 15, 15, 0, 15, 15, 15, 0, 15, 15, 15, + 92, 92, 92, 124, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 0, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 0, 0, 0, 15, 92, 92, 92, 124, 124, 124, 124, 0, 92, 92, - 92, 0, 92, 92, 92, 92, 0, 0, 0, 0, 0, 0, 0, 92, 92, 0, 15, 15, 15, - 0, 0, 0, 0, 0, 15, 15, 92, 92, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, - 0, 0, 0, 0, 0, 0, 0, 0, 18, 18, 18, 18, 18, 18, 18, 14, 0, 92, 124, - 124, 0, 15, 15, 15, 15, 15, 15, 15, 15, 0, 15, 15, 15, 0, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 0, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 0, 15, 15, 15, - 15, 15, 0, 0, 92, 15, 124, 92, 124, 124, 124, 124, 124, 0, 92, 124, - 124, 0, 124, 124, 92, 92, 0, 0, 0, 0, 0, 0, 0, 124, 124, 0, 0, 0, 0, - 0, 0, 0, 15, 0, 15, 15, 92, 92, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, - 0, 15, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 0, 0, 15, 124, 124, 124, 92, 92, 92, 92, 0, 124, - 124, 124, 0, 124, 124, 124, 92, 15, 0, 0, 0, 0, 0, 0, 0, 0, 124, 0, - 0, 0, 0, 0, 0, 0, 15, 15, 15, 92, 92, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, - 9, 9, 18, 18, 18, 18, 18, 18, 0, 0, 0, 14, 15, 15, 15, 15, 15, 15, - 0, 0, 124, 124, 0, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 0, 0, 0, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 0, 15, - 15, 15, 15, 15, 15, 15, 15, 15, 0, 15, 0, 0, 15, 15, 15, 15, 15, 15, - 15, 0, 0, 0, 92, 0, 0, 0, 0, 124, 124, 124, 92, 92, 92, 0, 92, 0, 124, - 124, 124, 124, 124, 124, 124, 124, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, - 9, 9, 9, 9, 9, 0, 0, 124, 124, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 92, 15, - 15, 92, 92, 92, 92, 92, 92, 92, 0, 0, 0, 0, 4, 15, 15, 15, 15, 15, - 15, 91, 92, 92, 92, 92, 92, 92, 92, 92, 3, 9, 9, 9, 9, 9, 9, 9, 9, - 9, 9, 3, 3, 0, 0, 0, 0, 0, 15, 15, 0, 15, 0, 0, 15, 15, 0, 15, 0, 0, - 15, 0, 0, 0, 0, 0, 0, 15, 15, 15, 15, 0, 15, 15, 15, 15, 15, 15, 15, - 0, 15, 15, 15, 0, 15, 0, 15, 0, 0, 15, 15, 0, 15, 15, 15, 15, 92, 15, - 15, 92, 92, 92, 92, 92, 92, 0, 92, 92, 15, 0, 0, 15, 15, 15, 15, 15, - 0, 91, 0, 92, 92, 92, 92, 92, 92, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, - 9, 0, 0, 15, 15, 15, 15, 15, 14, 14, 14, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 14, 3, 14, 14, 14, 92, 92, 14, 14, 14, 14, 14, 14, - 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, - 14, 92, 14, 92, 14, 92, 5, 6, 5, 6, 124, 124, 15, 15, 15, 15, 15, 15, - 15, 15, 0, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 92, 124, 92, 15, 124, 124, 124, 92, 92, + 92, 92, 92, 92, 92, 92, 124, 124, 124, 124, 92, 124, 124, 15, 92, 92, + 92, 92, 92, 92, 92, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 92, 92, + 3, 3, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 3, 91, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 92, 124, 124, 0, 15, 15, 15, 15, + 15, 15, 15, 15, 0, 0, 15, 15, 0, 0, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 0, 15, 15, + 15, 15, 15, 15, 15, 0, 15, 0, 0, 0, 15, 15, 15, 15, 0, 0, 92, 15, 124, + 124, 124, 92, 92, 92, 92, 0, 0, 124, 124, 0, 0, 124, 124, 92, 15, 0, + 0, 0, 0, 0, 0, 0, 0, 124, 0, 0, 0, 0, 15, 15, 0, 15, 15, 15, 92, 92, + 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 15, 15, 4, 4, 18, 18, 18, 18, 18, + 18, 14, 4, 0, 0, 0, 0, 0, 92, 92, 124, 0, 15, 15, 15, 15, 15, 15, 0, + 0, 0, 0, 15, 15, 0, 0, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 0, 15, 15, 15, 15, 15, + 15, 15, 0, 15, 15, 0, 15, 15, 0, 15, 15, 0, 0, 92, 0, 124, 124, 124, + 92, 92, 0, 0, 0, 0, 92, 92, 0, 0, 92, 92, 92, 0, 0, 0, 92, 0, 0, 0, + 0, 0, 0, 0, 15, 15, 15, 15, 0, 15, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, + 9, 9, 9, 9, 9, 9, 92, 92, 15, 15, 15, 92, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 92, 92, 124, 0, 15, 15, 15, 15, 15, 15, 15, 15, 15, 0, 15, 15, + 15, 0, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 0, 15, 15, 15, 15, 15, 15, 15, 0, 15, 15, + 0, 15, 15, 15, 15, 15, 0, 0, 92, 15, 124, 124, 124, 92, 92, 92, 92, + 92, 0, 92, 92, 124, 0, 124, 124, 92, 0, 0, 15, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 15, 15, 92, 92, 0, 0, 9, 9, 9, 9, 9, 9, 9, + 9, 9, 9, 3, 4, 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 0, 0, 92, 124, + 124, 0, 15, 15, 15, 15, 15, 15, 15, 15, 0, 0, 15, 15, 0, 0, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 0, 15, 15, 15, 15, 15, 15, 15, 0, 15, 15, 0, 15, 15, 15, + 15, 15, 0, 0, 92, 15, 124, 92, 124, 92, 92, 92, 92, 0, 0, 124, 124, + 0, 0, 124, 124, 92, 0, 0, 0, 0, 0, 0, 0, 0, 92, 124, 0, 0, 0, 0, 15, + 15, 0, 15, 15, 15, 92, 92, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 14, + 15, 18, 18, 18, 18, 18, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 92, 15, 0, + 15, 15, 15, 15, 15, 15, 0, 0, 0, 15, 15, 15, 0, 15, 15, 15, 15, 0, + 0, 0, 15, 15, 0, 15, 0, 15, 15, 0, 0, 0, 15, 15, 0, 0, 0, 15, 15, 15, + 0, 0, 0, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 0, 0, 0, 0, + 124, 124, 92, 124, 124, 0, 0, 0, 124, 124, 124, 0, 124, 124, 124, 92, + 0, 0, 15, 0, 0, 0, 0, 0, 0, 124, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 18, 18, 18, 14, 14, 14, 14, 14, + 14, 4, 14, 0, 0, 0, 0, 0, 92, 124, 124, 124, 0, 15, 15, 15, 15, 15, + 15, 15, 15, 0, 15, 15, 15, 0, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 0, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 0, 0, 0, 15, 92, + 92, 92, 124, 124, 124, 124, 0, 92, 92, 92, 0, 92, 92, 92, 92, 0, 0, + 0, 0, 0, 0, 0, 92, 92, 0, 15, 15, 15, 0, 0, 0, 0, 0, 15, 15, 92, 92, + 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 18, 18, + 18, 18, 18, 18, 18, 14, 15, 92, 124, 124, 0, 15, 15, 15, 15, 15, 15, + 15, 15, 0, 15, 15, 15, 0, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 0, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 0, 15, 15, 15, 15, 15, 0, 0, 92, 15, 124, 92, + 124, 124, 124, 124, 124, 0, 92, 124, 124, 0, 124, 124, 92, 92, 0, 0, + 0, 0, 0, 0, 0, 124, 124, 0, 0, 0, 0, 0, 0, 0, 15, 0, 15, 15, 92, 92, + 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 15, 15, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 92, 124, 124, 0, 15, 15, 15, 15, 15, 15, 15, 15, + 0, 15, 15, 15, 0, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 0, 0, 15, 124, 124, 124, + 92, 92, 92, 92, 0, 124, 124, 124, 0, 124, 124, 124, 92, 15, 14, 0, + 0, 0, 0, 15, 15, 15, 124, 18, 18, 18, 18, 18, 18, 18, 15, 15, 15, 92, + 92, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 18, 18, 18, 18, 18, 18, 18, + 18, 18, 14, 15, 15, 15, 15, 15, 15, 0, 0, 124, 124, 0, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 0, 0, 0, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 0, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 0, 15, 0, 0, 15, 15, 15, 15, 15, 15, 15, 0, 0, 0, 92, 0, 0, 0, 0, 124, + 124, 124, 92, 92, 92, 0, 92, 0, 124, 124, 124, 124, 124, 124, 124, + 124, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 124, 124, + 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 92, 15, 15, 92, 92, 92, 92, 92, 92, 92, + 0, 0, 0, 0, 4, 15, 15, 15, 15, 15, 15, 91, 92, 92, 92, 92, 92, 92, + 92, 92, 3, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 3, 3, 0, 0, 0, 0, 0, 15, 15, + 0, 15, 0, 0, 15, 15, 0, 15, 0, 0, 15, 0, 0, 0, 0, 0, 0, 15, 15, 15, + 15, 0, 15, 15, 15, 15, 15, 15, 15, 0, 15, 15, 15, 0, 15, 0, 15, 0, + 0, 15, 15, 0, 15, 15, 15, 15, 92, 15, 15, 92, 92, 92, 92, 92, 92, 0, + 92, 92, 15, 0, 0, 15, 15, 15, 15, 15, 0, 91, 0, 92, 92, 92, 92, 92, + 92, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 15, 15, 15, 15, 15, 14, + 14, 14, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 14, 3, 14, 14, + 14, 92, 92, 14, 14, 14, 14, 14, 14, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 18, + 18, 18, 18, 18, 18, 18, 18, 18, 18, 14, 92, 14, 92, 14, 92, 5, 6, 5, + 6, 124, 124, 15, 15, 15, 15, 15, 15, 15, 15, 0, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 0, 0, 0, 0, 92, 92, 92, 92, 92, 92, 92, 92, 92, - 92, 92, 92, 92, 92, 124, 92, 92, 92, 92, 92, 3, 92, 92, 15, 15, 15, - 15, 15, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 0, 92, 92, 92, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 0, 0, 0, 0, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 124, 92, 92, + 92, 92, 92, 3, 92, 92, 15, 15, 15, 15, 15, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 0, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, - 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 0, - 14, 14, 14, 14, 14, 14, 14, 14, 92, 14, 14, 14, 14, 14, 14, 0, 14, - 14, 3, 3, 3, 3, 3, 14, 14, 14, 14, 3, 3, 0, 0, 0, 0, 0, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, 124, 124, 92, 92, 92, 92, 124, 92, - 92, 92, 92, 92, 92, 124, 92, 92, 124, 124, 92, 92, 15, 9, 9, 9, 9, - 9, 9, 9, 9, 9, 9, 3, 3, 3, 3, 3, 3, 15, 15, 15, 15, 15, 15, 124, 124, - 92, 92, 15, 15, 15, 15, 92, 92, 92, 15, 124, 124, 124, 15, 15, 124, - 124, 124, 124, 124, 124, 124, 15, 15, 15, 92, 92, 92, 92, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 92, 124, 124, 92, 92, 124, - 124, 124, 124, 124, 124, 92, 15, 124, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, - 124, 124, 124, 92, 14, 14, 125, 125, 125, 125, 125, 125, 125, 125, + 92, 92, 92, 92, 92, 92, 92, 92, 0, 14, 14, 14, 14, 14, 14, 14, 14, + 92, 14, 14, 14, 14, 14, 14, 0, 14, 14, 3, 3, 3, 3, 3, 14, 14, 14, 14, + 3, 3, 0, 0, 0, 0, 0, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 124, + 124, 92, 92, 92, 92, 124, 92, 92, 92, 92, 92, 92, 124, 92, 92, 124, + 124, 92, 92, 15, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 3, 3, 3, 3, 3, 3, 15, + 15, 15, 15, 15, 15, 124, 124, 92, 92, 15, 15, 15, 15, 92, 92, 92, 15, + 124, 124, 124, 15, 15, 124, 124, 124, 124, 124, 124, 124, 15, 15, 15, + 92, 92, 92, 92, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 92, 124, 124, 92, 92, 124, 124, 124, 124, 124, 124, 92, 15, 124, 9, + 9, 9, 9, 9, 9, 9, 9, 9, 9, 124, 124, 124, 92, 14, 14, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, - 125, 125, 0, 125, 0, 0, 0, 0, 0, 125, 0, 0, 15, 15, 15, 15, 15, 15, + 125, 125, 125, 125, 125, 125, 125, 0, 125, 0, 0, 0, 0, 0, 125, 0, 0, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 3, 91, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 0, 15, 15, 15, 15, 0, 0, 15, 15, 15, 15, 15, 15, 15, 0, 15, 0, 15, - 15, 15, 15, 0, 0, 15, 15, 15, 15, 15, 15, 15, 15, 15, 0, 15, 15, 15, - 15, 0, 0, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 3, 91, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 0, 15, 15, 15, 15, 0, 0, 15, 15, 15, 15, 15, + 15, 15, 0, 15, 0, 15, 15, 15, 15, 0, 0, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 0, 15, 15, 15, 15, 0, 0, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 15, 0, 15, 15, 15, 15, 0, 0, 15, 15, 15, 15, 15, 15, 15, 0, 15, 0, - 15, 15, 15, 15, 0, 0, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 0, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 0, 15, 15, 15, 15, - 0, 0, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 0, 15, 15, 15, 15, 0, 0, 15, 15, 15, 15, + 15, 15, 15, 0, 15, 0, 15, 15, 15, 15, 0, 0, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 0, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 0, 0, 92, 92, 92, 3, 3, 3, 3, 3, 3, 3, 3, 3, 18, 18, 18, 18, - 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 0, - 0, 0, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 0, 0, 0, 0, 0, 0, 126, 126, - 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, + 15, 0, 15, 15, 15, 15, 0, 0, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 0, 0, 92, 92, 92, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, + 18, 18, 18, 18, 18, 0, 0, 0, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 0, + 0, 0, 0, 0, 0, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, - 126, 126, 126, 126, 104, 104, 104, 104, 104, 104, 0, 0, 110, 110, 110, - 110, 110, 110, 0, 0, 8, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 3, - 3, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 15, 2, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 5, 6, 0, 0, 0, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, 15, 3, 3, 3, 127, 127, 127, 15, 15, - 15, 15, 15, 15, 15, 15, 0, 0, 0, 0, 0, 0, 0, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 0, 15, 15, 15, 15, 92, 92, 92, 0, 0, 0, + 126, 126, 126, 126, 126, 126, 126, 126, 126, 104, 104, 104, 104, 104, + 104, 0, 0, 110, 110, 110, 110, 110, 110, 0, 0, 8, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 3, 3, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 2, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 5, + 6, 0, 0, 0, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 3, 3, 3, 127, + 127, 127, 15, 15, 15, 15, 15, 15, 15, 15, 0, 0, 0, 0, 0, 0, 0, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 0, 15, 15, 15, 15, + 92, 92, 92, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 92, 92, 92, 3, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 92, 92, 92, 3, 3, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 92, 92, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, 15, 0, 15, 15, 15, 0, 92, 92, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 92, 92, 124, 92, 92, 92, 92, - 92, 92, 92, 124, 124, 124, 124, 124, 124, 124, 124, 92, 124, 124, 92, - 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 3, 3, 3, 91, 3, 3, 3, 4, 15, - 92, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 18, 18, 18, - 18, 18, 18, 18, 18, 18, 18, 0, 0, 0, 0, 0, 0, 3, 3, 3, 3, 3, 3, 8, - 3, 3, 3, 3, 92, 92, 92, 17, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, - 0, 0, 0, 0, 15, 15, 15, 91, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 92, 92, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 0, 15, 15, 15, + 0, 92, 92, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 92, 92, + 124, 92, 92, 92, 92, 92, 92, 92, 124, 124, 124, 124, 124, 124, 124, + 124, 92, 124, 124, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 3, 3, + 3, 91, 3, 3, 3, 4, 15, 92, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, + 0, 0, 0, 0, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 0, 0, 0, 0, 0, + 0, 3, 3, 3, 3, 3, 3, 8, 3, 3, 3, 3, 92, 92, 92, 17, 0, 9, 9, 9, 9, + 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 15, 15, 15, 91, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, 0, 0, 0, 0, 0, 0, 0, 0, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 92, 15, 0, 0, 0, 0, 0, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 0, 0, 0, 0, + 0, 0, 0, 0, 15, 15, 15, 15, 15, 92, 92, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 92, 15, 0, 0, 0, 0, 0, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 0, 92, 92, 92, 124, 124, 124, 124, 92, 92, 124, 124, - 124, 0, 0, 0, 0, 124, 124, 92, 124, 124, 124, 124, 124, 124, 92, 92, - 92, 0, 0, 0, 0, 14, 0, 0, 0, 3, 3, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 0, 0, 15, 15, 15, 15, - 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 0, 0, 0, 0, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 0, - 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 18, 0, 0, 0, 14, 14, 14, + 15, 15, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 0, 92, 92, 92, 124, 124, 124, 124, 92, + 92, 124, 124, 124, 0, 0, 0, 0, 124, 124, 92, 124, 124, 124, 124, 124, + 124, 92, 92, 92, 0, 0, 0, 0, 14, 0, 0, 0, 3, 3, 9, 9, 9, 9, 9, 9, 9, + 9, 9, 9, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 0, 0, 15, + 15, 15, 15, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 0, 0, 0, 0, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 18, 0, 0, 0, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 92, 92, 124, 124, 92, 0, 0, 3, 3, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 124, 92, - 124, 92, 92, 92, 92, 92, 92, 92, 0, 92, 124, 92, 124, 124, 92, 92, - 92, 92, 92, 92, 92, 92, 124, 124, 124, 124, 124, 124, 92, 92, 92, 92, - 92, 92, 92, 92, 92, 92, 0, 0, 92, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, - 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 3, 3, - 3, 3, 3, 3, 3, 91, 3, 3, 3, 3, 3, 3, 0, 0, 92, 92, 92, 92, 92, 92, - 92, 92, 92, 92, 92, 92, 92, 92, 119, 0, 92, 92, 92, 92, 124, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 92, 124, 92, 92, 92, 92, - 92, 124, 92, 124, 124, 124, 124, 124, 92, 124, 124, 15, 15, 15, 15, - 15, 15, 15, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 3, 3, 3, 3, 3, - 3, 3, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 92, 92, 92, 92, 92, 92, - 92, 92, 92, 14, 14, 14, 14, 14, 14, 14, 14, 14, 0, 0, 0, 92, 92, 124, - 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 124, 92, 92, 92, - 92, 124, 124, 92, 92, 124, 92, 92, 92, 15, 15, 9, 9, 9, 9, 9, 9, 9, - 9, 9, 9, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 92, 124, 92, - 92, 124, 124, 124, 92, 124, 92, 92, 92, 124, 124, 0, 0, 0, 0, 0, 0, - 0, 0, 3, 3, 3, 3, 15, 15, 15, 15, 124, 124, 124, 124, 124, 124, 124, - 124, 92, 92, 92, 92, 92, 92, 92, 92, 124, 124, 92, 92, 0, 0, 0, 3, - 3, 3, 3, 3, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 15, 15, 15, 9, 9, - 9, 9, 9, 9, 9, 9, 9, 9, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 91, 91, 91, 91, 91, 91, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 0, 0, - 0, 0, 0, 0, 0, 0, 92, 92, 92, 3, 92, 92, 92, 92, 92, 92, 92, 92, 92, - 92, 92, 92, 92, 124, 92, 92, 92, 92, 92, 92, 92, 15, 15, 15, 15, 92, - 15, 15, 15, 15, 124, 124, 92, 15, 15, 0, 92, 92, 0, 0, 0, 0, 0, 0, + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 92, 92, 124, 124, 92, 0, 0, 3, 3, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 124, 92, 124, 92, 92, 92, 92, 92, 92, 92, 0, 92, 124, 92, 124, + 124, 92, 92, 92, 92, 92, 92, 92, 92, 124, 124, 124, 124, 124, 124, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 0, 0, 92, 9, 9, 9, 9, 9, 9, + 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, + 0, 0, 0, 3, 3, 3, 3, 3, 3, 3, 91, 3, 3, 3, 3, 3, 3, 0, 0, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 119, 0, 92, 92, 92, 92, + 124, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 92, 124, 92, + 92, 92, 92, 92, 124, 92, 124, 124, 124, 124, 124, 92, 124, 124, 15, + 15, 15, 15, 15, 15, 15, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 3, + 3, 3, 3, 3, 3, 3, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 14, 14, 14, 14, 14, 14, 14, 14, 14, 0, 0, 0, + 92, 92, 124, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 124, + 92, 92, 92, 92, 124, 124, 92, 92, 124, 92, 92, 92, 15, 15, 9, 9, 9, + 9, 9, 9, 9, 9, 9, 9, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 92, 124, 92, 92, 124, 124, 124, 92, 124, 92, 92, 92, 124, 124, 0, 0, + 0, 0, 0, 0, 0, 0, 3, 3, 3, 3, 15, 15, 15, 15, 124, 124, 124, 124, 124, + 124, 124, 124, 92, 92, 92, 92, 92, 92, 92, 92, 124, 124, 92, 92, 0, + 0, 0, 3, 3, 3, 3, 3, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 15, 15, + 15, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 91, 91, 91, 91, 91, 91, 3, 3, 128, 129, 130, 131, 131, + 132, 133, 134, 135, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 3, 3, 3, 3, 3, 3, 3, 3, 0, 0, 0, 0, 0, 0, 0, 0, + 92, 92, 92, 3, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 124, 92, 92, 92, 92, 92, 92, 92, 15, 15, 15, 15, 92, 15, 15, 15, 15, + 124, 124, 92, 15, 15, 0, 92, 92, 0, 0, 0, 0, 0, 0, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, - 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 91, 91, 91, 91, 91, 91, 91, + 21, 21, 21, 21, 21, 21, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, - 91, 91, 91, 91, 91, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, - 21, 91, 128, 21, 21, 21, 129, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, - 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, - 21, 21, 91, 91, 91, 91, 91, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, - 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 0, 0, 0, 0, 0, 0, 92, - 92, 92, 92, 23, 24, 23, 24, 23, 24, 23, 24, 23, 24, 23, 24, 23, 24, - 23, 24, 23, 24, 23, 24, 23, 24, 21, 21, 21, 21, 21, 130, 21, 21, 131, - 21, 132, 132, 132, 132, 132, 132, 132, 132, 133, 133, 133, 133, 133, - 133, 133, 133, 132, 132, 132, 132, 132, 132, 0, 0, 133, 133, 133, 133, - 133, 133, 0, 0, 132, 132, 132, 132, 132, 132, 132, 132, 133, 133, 133, - 133, 133, 133, 133, 133, 132, 132, 132, 132, 132, 132, 132, 132, 133, - 133, 133, 133, 133, 133, 133, 133, 132, 132, 132, 132, 132, 132, 0, - 0, 133, 133, 133, 133, 133, 133, 0, 0, 21, 132, 21, 132, 21, 132, 21, - 132, 0, 133, 0, 133, 0, 133, 0, 133, 132, 132, 132, 132, 132, 132, - 132, 132, 133, 133, 133, 133, 133, 133, 133, 133, 134, 134, 135, 135, - 135, 135, 136, 136, 137, 137, 138, 138, 139, 139, 0, 0, 132, 132, 132, - 132, 132, 132, 132, 132, 140, 140, 140, 140, 140, 140, 140, 140, 132, - 132, 132, 132, 132, 132, 132, 132, 140, 140, 140, 140, 140, 140, 140, - 140, 132, 132, 132, 132, 132, 132, 132, 132, 140, 140, 140, 140, 140, - 140, 140, 140, 132, 132, 21, 141, 21, 0, 21, 21, 133, 133, 142, 142, - 143, 11, 144, 11, 11, 11, 21, 141, 21, 0, 21, 21, 145, 145, 145, 145, - 143, 11, 11, 11, 132, 132, 21, 21, 0, 0, 21, 21, 133, 133, 146, 146, - 0, 11, 11, 11, 132, 132, 21, 21, 21, 113, 21, 21, 133, 133, 147, 147, - 117, 11, 11, 11, 0, 0, 21, 141, 21, 0, 21, 21, 148, 148, 149, 149, - 143, 11, 11, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 17, 17, 17, 17, 17, - 8, 8, 8, 8, 8, 8, 3, 3, 16, 20, 5, 16, 16, 20, 5, 16, 3, 3, 3, 3, 3, - 3, 3, 3, 150, 151, 17, 17, 17, 17, 17, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 16, 20, 3, 3, 3, 3, 12, 12, 3, 3, 3, 7, 5, 6, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 7, 3, 12, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, 17, 17, 17, - 17, 17, 0, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 18, 91, 0, 0, 18, - 18, 18, 18, 18, 18, 7, 7, 7, 5, 6, 91, 18, 18, 18, 18, 18, 18, 18, - 18, 18, 18, 7, 7, 7, 5, 6, 0, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, - 91, 91, 91, 0, 0, 0, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, - 92, 92, 92, 119, 119, 119, 119, 92, 119, 119, 119, 92, 92, 92, 92, - 92, 92, 92, 92, 92, 92, 92, 92, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 14, 14, 107, 14, 14, 14, 14, 107, 14, 14, 21, 107, 107, 107, - 21, 21, 107, 107, 107, 21, 14, 107, 14, 14, 7, 107, 107, 107, 107, - 107, 14, 14, 14, 14, 14, 14, 107, 14, 152, 14, 107, 14, 153, 154, 107, - 107, 14, 21, 107, 107, 155, 107, 21, 15, 15, 15, 15, 21, 14, 14, 21, - 21, 107, 107, 7, 7, 7, 7, 7, 107, 21, 21, 21, 21, 14, 7, 14, 14, 156, - 14, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, - 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, - 157, 157, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, - 158, 158, 158, 158, 127, 127, 127, 23, 24, 127, 127, 127, 127, 18, - 14, 14, 0, 0, 0, 0, 7, 7, 7, 7, 7, 14, 14, 14, 14, 14, 7, 7, 14, 14, - 14, 14, 7, 14, 14, 7, 14, 14, 7, 14, 14, 14, 14, 14, 14, 14, 7, 14, + 91, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 91, 136, 21, + 21, 21, 137, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, + 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 91, 91, + 91, 91, 91, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 0, 0, 0, 0, 0, 92, 92, 92, 92, 92, + 23, 24, 23, 24, 23, 24, 23, 24, 23, 24, 23, 24, 23, 24, 23, 24, 23, + 24, 23, 24, 23, 24, 21, 21, 21, 21, 21, 138, 21, 21, 139, 21, 140, + 140, 140, 140, 140, 140, 140, 140, 141, 141, 141, 141, 141, 141, 141, + 141, 140, 140, 140, 140, 140, 140, 0, 0, 141, 141, 141, 141, 141, 141, + 0, 0, 140, 140, 140, 140, 140, 140, 140, 140, 141, 141, 141, 141, 141, + 141, 141, 141, 140, 140, 140, 140, 140, 140, 140, 140, 141, 141, 141, + 141, 141, 141, 141, 141, 140, 140, 140, 140, 140, 140, 0, 0, 141, 141, + 141, 141, 141, 141, 0, 0, 21, 140, 21, 140, 21, 140, 21, 140, 0, 141, + 0, 141, 0, 141, 0, 141, 140, 140, 140, 140, 140, 140, 140, 140, 141, + 141, 141, 141, 141, 141, 141, 141, 142, 142, 143, 143, 143, 143, 144, + 144, 145, 145, 146, 146, 147, 147, 0, 0, 140, 140, 140, 140, 140, 140, + 140, 140, 148, 148, 148, 148, 148, 148, 148, 148, 140, 140, 140, 140, + 140, 140, 140, 140, 148, 148, 148, 148, 148, 148, 148, 148, 140, 140, + 140, 140, 140, 140, 140, 140, 148, 148, 148, 148, 148, 148, 148, 148, + 140, 140, 21, 149, 21, 0, 21, 21, 141, 141, 150, 150, 151, 11, 152, + 11, 11, 11, 21, 149, 21, 0, 21, 21, 153, 153, 153, 153, 151, 11, 11, + 11, 140, 140, 21, 21, 0, 0, 21, 21, 141, 141, 154, 154, 0, 11, 11, + 11, 140, 140, 21, 21, 21, 113, 21, 21, 141, 141, 155, 155, 117, 11, + 11, 11, 0, 0, 21, 149, 21, 0, 21, 21, 156, 156, 157, 157, 151, 11, + 11, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 17, 17, 17, 17, 17, 8, 8, 8, + 8, 8, 8, 3, 3, 16, 20, 5, 16, 16, 20, 5, 16, 3, 3, 3, 3, 3, 3, 3, 3, + 158, 159, 17, 17, 17, 17, 17, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 16, 20, + 3, 3, 3, 3, 12, 12, 3, 3, 3, 7, 5, 6, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 7, 3, 12, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, 17, 17, 17, 17, 17, 0, + 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 18, 91, 0, 0, 18, 18, 18, 18, + 18, 18, 7, 7, 7, 5, 6, 91, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, + 7, 7, 7, 5, 6, 0, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, + 0, 0, 0, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 119, 119, 119, 119, 92, 119, 119, 119, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, + 14, 107, 14, 14, 14, 14, 107, 14, 14, 21, 107, 107, 107, 21, 21, 107, + 107, 107, 21, 14, 107, 14, 14, 7, 107, 107, 107, 107, 107, 14, 14, + 14, 14, 14, 14, 107, 14, 160, 14, 107, 14, 161, 162, 107, 107, 14, + 21, 107, 107, 163, 107, 21, 15, 15, 15, 15, 21, 14, 14, 21, 21, 107, + 107, 7, 7, 7, 7, 7, 107, 21, 21, 21, 21, 14, 7, 14, 14, 164, 14, 18, + 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 165, 165, + 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, + 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, + 166, 166, 127, 127, 127, 23, 24, 127, 127, 127, 127, 18, 14, 14, 0, + 0, 0, 0, 7, 7, 7, 7, 7, 14, 14, 14, 14, 14, 7, 7, 14, 14, 14, 14, 7, + 14, 14, 7, 14, 14, 7, 14, 14, 14, 14, 14, 14, 14, 7, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 7, 7, 14, 14, 7, - 14, 7, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 7, - 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, - 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 14, 14, - 14, 14, 14, 14, 14, 14, 5, 6, 5, 6, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 7, 7, 14, 14, 14, 14, - 14, 14, 14, 5, 6, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 7, 7, 14, 14, 7, 14, 7, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 7, 7, 7, 7, 7, + 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, + 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 14, 14, 14, 14, 14, + 14, 14, 14, 5, 6, 5, 6, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 14, 14, 7, 7, 14, 14, 14, 14, 14, 14, 14, + 5, 6, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 7, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 7, - 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, - 7, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 7, 7, 7, 7, 7, 7, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 7, 7, 7, 7, 7, + 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 0, 0, 0, 0, 0, 14, 14, 14, 14, 14, 14, 14, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 7, 7, 7, 7, 7, 7, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 0, 14, 14, 14, 14, 14, 14, 14, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, - 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 14, + 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 159, 159, 159, 159, 159, 159, 159, - 159, 159, 159, 159, 159, 159, 159, 159, 159, 159, 159, 159, 159, 159, - 159, 159, 159, 159, 159, 160, 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, - 18, 18, 18, 18, 18, 18, 18, 18, 18, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 7, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 7, 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 167, 167, 167, 167, 167, 167, 167, 167, + 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, + 167, 167, 167, 167, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, + 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, + 168, 168, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, + 18, 18, 18, 18, 18, 18, 18, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 7, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 7, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 7, 7, 7, 7, 7, 7, 7, - 7, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 7, 14, + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 7, 7, 7, 7, 7, 7, 7, 7, 14, + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 7, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 5, 6, 5, 6, 5, 6, 5, 6, 5, 6, 5, 6, 5, 6, 18, + 14, 14, 14, 14, 14, 5, 6, 5, 6, 5, 6, 5, 6, 5, 6, 5, 6, 5, 6, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, - 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 7, 7, 7, 7, 7, 5, 6, 7, 7, 7, 7, 7, 7, + 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 7, 7, 7, 7, 7, 5, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, - 7, 7, 5, 6, 5, 6, 5, 6, 5, 6, 5, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, - 7, 7, 7, 7, 7, 7, 7, 7, 5, 6, 5, 6, 5, 6, 5, 6, 5, 6, 5, 6, 5, 6, 5, - 6, 5, 6, 5, 6, 5, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, - 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 5, 6, 5, 6, 7, 7, 7, 7, + 5, 6, 5, 6, 5, 6, 5, 6, 5, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, + 7, 7, 7, 7, 7, 7, 5, 6, 5, 6, 5, 6, 5, 6, 5, 6, 5, 6, 5, 6, 5, 6, 5, + 6, 5, 6, 5, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, + 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 5, 6, 5, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, - 7, 7, 7, 7, 7, 5, 6, 7, 7, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, - 7, 7, 7, 7, 7, 7, 14, 14, 7, 7, 7, 7, 7, 7, 14, 14, 14, 14, 14, 14, + 7, 7, 7, 5, 6, 7, 7, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, + 7, 7, 7, 7, 14, 14, 7, 7, 7, 7, 7, 7, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 0, - 0, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 0, - 0, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 0, 0, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 0, 0, 0, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 0, 14, - 14, 14, 14, 14, 14, 14, 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 14, 14, 14, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 122, 122, 122, 122, 122, 122, 122, + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 0, 0, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 0, 0, 0, 14, + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 0, 14, 14, 14, 14, 14, + 14, 14, 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 14, 14, 14, 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, - 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, 0, 123, + 122, 122, 122, 122, 122, 122, 122, 122, 122, 0, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, - 123, 123, 123, 123, 0, 23, 24, 161, 162, 163, 164, 165, 23, 24, 23, - 24, 23, 24, 166, 167, 168, 169, 21, 23, 24, 21, 23, 24, 21, 21, 21, - 21, 21, 91, 91, 170, 170, 23, 24, 23, 24, 21, 14, 14, 14, 14, 14, 14, - 23, 24, 23, 24, 92, 92, 92, 23, 24, 0, 0, 0, 0, 0, 3, 3, 3, 3, 18, - 3, 3, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, - 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, - 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 0, 171, 0, 0, - 0, 0, 0, 171, 0, 0, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 0, 0, 0, 0, 0, 0, 0, - 91, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 92, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 15, 15, 15, 15, 15, 15, 0, 15, - 15, 15, 15, 15, 15, 15, 0, 15, 15, 15, 15, 15, 15, 15, 0, 15, 15, 15, - 15, 15, 15, 15, 0, 3, 3, 16, 20, 16, 20, 3, 3, 3, 16, 20, 3, 16, 20, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 8, 3, 3, 8, 3, 16, 20, 3, 3, 16, 20, 5, - 6, 5, 6, 5, 6, 5, 6, 3, 3, 3, 3, 3, 91, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 8, 8, 3, 3, 3, 3, 8, 3, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 14, 14, 14, 14, + 123, 0, 23, 24, 169, 170, 171, 172, 173, 23, 24, 23, 24, 23, 24, 174, + 175, 176, 177, 21, 23, 24, 21, 23, 24, 21, 21, 21, 21, 21, 91, 91, + 178, 178, 23, 24, 23, 24, 21, 14, 14, 14, 14, 14, 14, 23, 24, 23, 24, + 92, 92, 92, 23, 24, 0, 0, 0, 0, 0, 3, 3, 3, 3, 18, 3, 3, 179, 179, + 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, + 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, + 179, 179, 179, 179, 179, 179, 179, 179, 0, 179, 0, 0, 0, 0, 0, 179, + 0, 0, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 0, 0, 0, 0, 0, 0, 0, 91, 3, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 92, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 15, 15, 15, 15, 15, 15, 15, 0, 15, 15, 15, 15, 15, + 15, 15, 0, 15, 15, 15, 15, 15, 15, 15, 0, 15, 15, 15, 15, 15, 15, 15, + 0, 3, 3, 16, 20, 16, 20, 3, 3, 3, 16, 20, 3, 16, 20, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 8, 3, 3, 8, 3, 16, 20, 3, 3, 16, 20, 5, 6, 5, 6, 5, 6, + 5, 6, 3, 3, 3, 3, 3, 91, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 8, 8, 3, 3, + 3, 3, 8, 3, 5, 3, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 0, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 0, 0, 0, 0, 2, 3, 3, 3, 14, 91, 15, - 127, 5, 6, 5, 6, 5, 6, 5, 6, 5, 6, 14, 14, 5, 6, 5, 6, 5, 6, 5, 6, - 8, 5, 6, 6, 14, 127, 127, 127, 127, 127, 127, 127, 127, 127, 92, 92, - 92, 92, 124, 124, 8, 91, 91, 91, 91, 91, 14, 14, 127, 127, 127, 91, - 15, 3, 14, 14, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 0, 0, 92, 92, 11, 11, 91, 91, - 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 3, 91, 91, 91, 15, 0, 0, - 0, 0, 0, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 0, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 14, 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 0, 0, 0, 0, 2, 3, 3, 3, 14, 91, 15, 127, 5, 6, 5, 6, 5, + 6, 5, 6, 5, 6, 14, 14, 5, 6, 5, 6, 5, 6, 5, 6, 8, 5, 6, 6, 14, 127, + 127, 127, 127, 127, 127, 127, 127, 127, 92, 92, 92, 92, 124, 124, 8, + 91, 91, 91, 91, 91, 14, 14, 127, 127, 127, 91, 15, 3, 14, 14, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 0, 0, 92, 92, 11, 11, 91, 91, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, 15, 0, 0, 0, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 3, 91, 91, 91, 15, 0, 0, 0, 0, 0, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 0, 14, 14, 18, 18, 18, 18, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 0, 0, 0, 0, 0, 14, 14, 14, 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 14, + 15, 15, 15, 0, 0, 0, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 0, 14, 14, 18, 18, 18, 18, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 14, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 0, 0, 0, 0, 0, 14, 14, + 14, 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 0, 18, 18, 18, - 18, 18, 18, 18, 18, 18, 18, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 0, 18, 18, 18, 18, 18, 18, 18, 18, 18, + 18, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 18, 18, 18, + 18, 18, 18, 18, 18, 14, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, + 18, 18, 18, 18, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, + 18, 18, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 91, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 0, 0, 0, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 18, 18, 18, 18, 18, 18, 18, 18, 14, 18, 18, 18, 18, 18, - 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 18, 18, 18, 18, 18, 18, 18, - 18, 18, 18, 18, 18, 18, 18, 18, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 91, 15, 15, 15, 15, + 14, 14, 14, 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 0, 0, 0, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 15, 15, 15, 15, 15, 91, 3, 3, 3, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 15, 15, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 23, 24, 23, + 24, 23, 24, 23, 24, 23, 24, 23, 24, 23, 24, 15, 92, 119, 119, 119, + 3, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 3, 91, 23, 24, 23, 24, 23, + 24, 23, 24, 23, 24, 23, 24, 23, 24, 23, 24, 23, 24, 23, 24, 23, 24, + 23, 24, 23, 24, 23, 24, 91, 91, 92, 92, 15, 15, 15, 15, 15, 15, 127, + 127, 127, 127, 127, 127, 127, 127, 127, 127, 92, 92, 3, 3, 3, 3, 3, + 3, 0, 0, 0, 0, 0, 0, 0, 0, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, + 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 91, 91, 91, 91, + 91, 91, 91, 91, 91, 11, 11, 23, 24, 23, 24, 23, 24, 23, 24, 23, 24, + 23, 24, 23, 24, 21, 21, 23, 24, 23, 24, 23, 24, 23, 24, 23, 24, 23, + 24, 23, 24, 23, 24, 23, 24, 23, 24, 23, 24, 23, 24, 23, 24, 23, 24, + 23, 24, 91, 21, 21, 21, 21, 21, 21, 21, 21, 23, 24, 23, 24, 180, 23, + 24, 23, 24, 23, 24, 23, 24, 23, 24, 91, 11, 11, 23, 24, 181, 21, 15, + 23, 24, 23, 24, 21, 21, 23, 24, 23, 24, 23, 24, 23, 24, 23, 24, 23, + 24, 23, 24, 23, 24, 23, 24, 23, 24, 182, 183, 184, 185, 182, 0, 186, + 187, 188, 189, 23, 24, 23, 24, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 91, 91, + 21, 15, 15, 15, 15, 15, 15, 15, 92, 15, 15, 15, 92, 15, 15, 15, 15, + 92, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 124, 124, 92, 92, 124, 14, 14, 14, 14, + 0, 0, 0, 0, 18, 18, 18, 18, 18, 18, 14, 14, 4, 14, 0, 0, 0, 0, 0, 0, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 91, 3, 3, 3, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 9, 9, 9, 9, 9, - 9, 9, 9, 9, 9, 15, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 23, 24, 23, 24, 23, 24, 23, 24, 23, 24, 23, 24, 23, - 24, 15, 92, 119, 119, 119, 3, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, - 3, 91, 23, 24, 23, 24, 23, 24, 23, 24, 23, 24, 23, 24, 23, 24, 23, - 24, 23, 24, 23, 24, 23, 24, 23, 24, 23, 24, 23, 24, 91, 91, 92, 92, - 15, 15, 15, 15, 15, 15, 127, 127, 127, 127, 127, 127, 127, 127, 127, - 127, 92, 92, 3, 3, 3, 3, 3, 3, 0, 0, 0, 0, 0, 0, 0, 0, 11, 11, 11, - 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, - 11, 11, 11, 91, 91, 91, 91, 91, 91, 91, 91, 91, 11, 11, 23, 24, 23, - 24, 23, 24, 23, 24, 23, 24, 23, 24, 23, 24, 21, 21, 23, 24, 23, 24, - 23, 24, 23, 24, 23, 24, 23, 24, 23, 24, 23, 24, 23, 24, 23, 24, 23, - 24, 23, 24, 23, 24, 23, 24, 23, 24, 91, 21, 21, 21, 21, 21, 21, 21, - 21, 23, 24, 23, 24, 172, 23, 24, 23, 24, 23, 24, 23, 24, 23, 24, 91, - 11, 11, 23, 24, 173, 21, 15, 23, 24, 23, 24, 21, 21, 23, 24, 23, 24, - 23, 24, 23, 24, 23, 24, 23, 24, 23, 24, 23, 24, 23, 24, 23, 24, 174, - 175, 176, 177, 0, 0, 178, 179, 180, 181, 23, 24, 23, 24, 0, 0, 0, 0, + 15, 15, 15, 3, 3, 3, 3, 0, 0, 0, 0, 0, 0, 0, 0, 124, 124, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 124, 124, 124, + 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 92, + 92, 0, 0, 0, 0, 0, 0, 0, 0, 3, 3, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, + 0, 0, 0, 0, 0, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 15, 15, 15, 15, 15, 15, 3, 3, 3, 15, 3, 15, 0, + 0, 15, 15, 15, 15, 15, 15, 92, 92, 92, 92, 92, 92, 92, 92, 3, 3, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 124, + 124, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 0, 0, 0, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 92, 124, 124, 92, 92, 92, 92, 124, + 124, 92, 124, 124, 124, 124, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 0, 91, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 3, 3, 15, 15, 15, + 15, 15, 92, 91, 15, 15, 15, 15, 15, 15, 15, 15, 15, 9, 9, 9, 9, 9, + 9, 9, 9, 9, 9, 15, 15, 15, 15, 15, 0, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 92, 92, 92, 92, 92, 92, 124, 124, 92, 92, 124, 124, 92, 92, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 15, 15, 15, 92, 15, 15, 15, 15, 15, 15, 15, + 15, 92, 124, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 3, 3, 3, 3, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 91, + 15, 15, 15, 15, 15, 15, 14, 14, 14, 15, 124, 92, 124, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 92, 15, 92, + 92, 92, 15, 15, 92, 92, 15, 15, 15, 15, 15, 92, 92, 15, 92, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 15, 91, 91, 21, 15, 15, 15, 15, 15, 15, 15, 92, 15, 15, - 15, 92, 15, 15, 15, 15, 92, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 124, 124, 92, 92, - 124, 14, 14, 14, 14, 0, 0, 0, 0, 18, 18, 18, 18, 18, 18, 14, 14, 4, - 14, 0, 0, 0, 0, 0, 0, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, 3, 3, 3, 3, 0, 0, 0, 0, 0, 0, 0, 0, - 124, 124, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 15, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, - 124, 124, 124, 92, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 3, 9, 9, 9, 9, 9, - 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 92, 92, 92, 92, 92, 92, 92, 92, 92, - 92, 92, 92, 92, 92, 92, 92, 92, 92, 15, 15, 15, 15, 15, 15, 3, 3, 3, - 15, 3, 15, 0, 0, 15, 15, 15, 15, 15, 15, 92, 92, 92, 92, 92, 92, 92, - 92, 3, 3, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, 92, 92, 92, 92, 92, 92, 92, 92, 92, - 92, 92, 124, 124, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, 0, 0, 0, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 92, 124, 124, 92, 92, - 92, 92, 124, 124, 92, 124, 124, 124, 124, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 0, 91, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 3, 3, - 15, 15, 15, 15, 15, 92, 91, 15, 15, 15, 15, 15, 15, 15, 15, 15, 9, - 9, 9, 9, 9, 9, 9, 9, 9, 9, 15, 15, 15, 15, 15, 0, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 92, 92, 92, 92, 92, 92, 124, 124, 92, 92, 124, 124, - 92, 92, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 15, 15, 92, 15, 15, 15, 15, - 15, 15, 15, 15, 92, 124, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, - 3, 3, 3, 3, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 91, 15, 15, 15, 15, 15, 15, 14, 14, 14, 15, 124, 92, 124, 15, - 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 92, 15, 92, 92, 92, 15, 15, 92, 92, 15, 15, 15, 15, 15, 92, 92, 15, - 92, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 15, 15, 91, 3, 3, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 15, 124, 92, 92, 124, 124, 3, 3, 15, 91, 91, 124, 92, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 15, 15, 15, 15, 15, 15, 0, 0, 15, 15, 15, 15, 15, 15, - 0, 0, 15, 15, 15, 15, 15, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 15, 15, - 15, 15, 15, 15, 0, 15, 15, 15, 15, 15, 15, 15, 0, 21, 21, 21, 21, 21, + 15, 15, 91, 3, 3, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 124, + 92, 92, 124, 124, 3, 3, 15, 91, 91, 124, 92, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 15, 15, 15, 15, 15, 15, 0, 0, 15, 15, 15, 15, 15, 15, 0, 0, 15, + 15, 15, 15, 15, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 15, 15, 15, 15, + 15, 15, 0, 15, 15, 15, 15, 15, 15, 15, 0, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, - 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 182, 21, 21, 21, - 21, 21, 21, 21, 11, 91, 91, 91, 91, 21, 21, 21, 21, 21, 21, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, - 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, - 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, - 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, 15, 15, 15, 124, - 124, 92, 124, 124, 92, 124, 124, 3, 124, 92, 0, 0, 9, 9, 9, 9, 9, 9, - 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 15, 15, 15, 15, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 0, 0, 0, 0, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 0, 0, 0, 0, 184, 184, 184, - 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, - 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, - 184, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, - 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, - 185, 185, 185, 185, 185, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 190, 21, 21, 21, 21, 21, + 21, 21, 11, 91, 91, 91, 91, 21, 21, 21, 21, 21, 21, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, + 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, + 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, + 191, 191, 191, 191, 191, 191, 191, 191, 191, 15, 15, 15, 124, 124, + 92, 124, 124, 92, 124, 124, 3, 124, 92, 0, 0, 9, 9, 9, 9, 9, 9, 9, + 9, 9, 9, 0, 0, 0, 0, 0, 0, 15, 15, 15, 15, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 0, 0, 0, 0, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 0, 0, 0, 0, 192, 192, 192, + 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, + 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, + 192, 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, + 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, + 193, 193, 193, 193, 193, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 0, 0, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 0, 0, 0, 0, 0, 0, 21, @@ -1155,229 +1163,263 @@ static const unsigned char groupMap[] = { 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 18, 18, 18, 18, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 18, 18, 14, 0, 0, 0, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 0, 0, 0, 0, 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 14, 14, 14, 18, 18, 14, 14, 14, 0, 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 0, 0, 0, 0, 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 92, 0, 0, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 92, 18, + 14, 14, 14, 92, 0, 0, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 92, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, - 18, 18, 18, 18, 18, 18, 18, 18, 18, 0, 0, 0, 0, 18, 18, 18, 18, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, 127, 15, 15, 15, 15, 15, 15, 15, 15, - 127, 0, 0, 0, 0, 0, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 0, 0, 0, 0, 18, 18, 18, 18, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 127, 15, 15, 15, 15, 15, 15, 15, + 15, 127, 0, 0, 0, 0, 0, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, 15, 92, 92, 92, 92, 92, 0, 0, 0, 0, - 0, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 92, 92, 92, 92, 92, 0, 0, 0, + 0, 0, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 0, 3, 15, 15, 15, 15, 0, 0, 0, 0, 15, 15, 15, 15, 15, 15, 15, 15, 3, 127, 127, 127, - 127, 127, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 186, 186, 186, 186, 186, 186, - 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, - 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, - 186, 186, 186, 186, 186, 186, 187, 187, 187, 187, 187, 187, 187, 187, - 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, - 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, - 187, 187, 187, 187, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 127, 127, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 194, 194, 194, 194, 194, 194, + 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, + 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, + 194, 194, 194, 194, 194, 194, 195, 195, 195, 195, 195, 195, 195, 195, + 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, + 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, + 195, 195, 195, 195, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 194, 194, 194, + 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, + 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, + 194, 194, 194, 194, 194, 0, 0, 0, 0, 195, 195, 195, 195, 195, 195, + 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, + 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, + 195, 195, 0, 0, 0, 0, 15, 15, 15, 15, 15, 15, 15, 15, 0, 0, 0, 0, 0, + 0, 0, 0, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 15, 15, 15, 15, 15, 0, 0, 15, + 0, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 15, 15, 15, 15, 15, 15, 15, 0, - 0, 0, 0, 0, 0, 0, 0, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 15, 15, 15, 15, - 15, 0, 0, 15, 0, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 0, 15, 15, 0, 0, 0, 15, + 0, 0, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 0, 3, 18, 18, 18, 18, 18, 18, 18, 18, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 0, 15, 15, - 0, 0, 0, 15, 0, 0, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 0, 3, 18, 18, 18, 18, 18, - 18, 18, 18, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, 15, 14, 14, 18, 18, 18, 18, 18, 18, - 18, 0, 0, 0, 0, 0, 0, 0, 18, 18, 18, 18, 18, 18, 18, 18, 18, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 0, 15, 15, 0, 0, 0, - 0, 0, 18, 18, 18, 18, 18, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 18, 18, 18, 18, 18, 18, - 0, 0, 0, 3, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 0, 0, 0, 0, 0, 3, 15, - 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 0, 0, 0, 0, 18, 18, 15, 15, 18, 18, 18, 18, - 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 0, 0, 18, 18, 18, 18, - 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 15, 92, 92, 92, 0, 92, 92, - 0, 0, 0, 0, 0, 92, 92, 92, 92, 15, 15, 15, 15, 0, 15, 15, 15, 0, 15, - 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, 15, 0, 0, 0, 0, 92, 92, 92, 0, 0, 0, - 0, 92, 18, 18, 18, 18, 18, 18, 18, 18, 0, 0, 0, 0, 0, 0, 0, 0, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 0, 0, 0, 0, 0, 0, 0, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 18, 18, 3, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 18, 18, 18, 15, 15, 15, 15, 15, 15, 15, 15, 14, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, 15, 92, 92, 0, 0, 0, 0, 18, 18, 18, - 18, 18, 3, 3, 3, 3, 3, 3, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 0, 0, 0, 3, 3, 3, 3, 3, 3, 3, 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 0, 0, 18, 18, - 18, 18, 18, 18, 18, 18, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, 0, 0, 0, 0, 0, 18, 18, 18, 18, 18, - 18, 18, 18, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 0, 0, 0, 0, 0, 0, 0, 3, 3, 3, 3, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 18, 18, 18, 18, 18, 18, 18, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 15, 15, 15, 15, 15, 15, 15, 15, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 97, + 15, 15, 15, 15, 15, 14, 14, 18, 18, 18, 18, 18, 18, 18, 0, 0, 0, 0, + 0, 0, 0, 18, 18, 18, 18, 18, 18, 18, 18, 18, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 0, 15, 15, 0, 0, 0, 0, 0, 18, 18, 18, + 18, 18, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 18, 18, 18, 18, 18, 18, 0, 0, 0, 3, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 0, 0, 0, 0, 0, 3, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 0, 0, 0, 0, 18, 18, 15, 15, 18, 18, 18, 18, 18, 18, 18, 18, + 18, 18, 18, 18, 18, 18, 18, 18, 0, 0, 18, 18, 18, 18, 18, 18, 18, 18, + 18, 18, 18, 18, 18, 18, 15, 92, 92, 92, 0, 92, 92, 0, 0, 0, 0, 0, 92, + 92, 92, 92, 15, 15, 15, 15, 0, 15, 15, 15, 0, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 0, 0, 0, 0, 92, 92, 92, 0, 0, 0, 0, 92, 18, 18, 18, + 18, 18, 18, 18, 18, 0, 0, 0, 0, 0, 0, 0, 0, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 0, 0, 0, 0, 0, 0, 0, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 18, 18, 3, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 18, + 18, 18, 15, 15, 15, 15, 15, 15, 15, 15, 14, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 92, 92, 0, 0, 0, 0, 18, 18, 18, 18, 18, 3, 3, 3, + 3, 3, 3, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 0, 0, 0, + 3, 3, 3, 3, 3, 3, 3, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 0, 0, 18, 18, 18, 18, 18, 18, + 18, 18, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 0, 0, 0, 0, 0, 18, 18, 18, 18, 18, 18, 18, 18, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 0, 0, 0, 0, 0, 0, 0, 3, 3, 3, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 18, 18, 18, 18, 18, 18, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 15, 15, 15, 15, 15, 15, 15, 15, 15, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, - 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 102, 102, 102, 102, 102, 102, 102, - 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, + 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, - 102, 102, 0, 0, 0, 0, 0, 0, 0, 18, 18, 18, 18, 18, 18, 18, 18, 18, + 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 0, 0, 0, + 0, 0, 0, 0, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, - 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 0, 124, 92, 124, 15, 15, + 18, 18, 18, 18, 18, 18, 0, 124, 92, 124, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 3, 3, 3, 3, 3, 3, 3, 0, 0, + 0, 0, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, + 18, 18, 18, 18, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 92, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 124, 124, 124, 92, 92, 92, 92, 124, 124, 92, + 92, 3, 3, 17, 3, 3, 3, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 3, 3, 3, - 3, 3, 3, 3, 0, 0, 0, 0, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, - 18, 18, 18, 18, 18, 18, 18, 18, 18, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 92, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 124, 124, 124, 92, 92, 92, - 92, 124, 124, 92, 92, 3, 3, 17, 3, 3, 3, 3, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 0, 0, 0, 0, 0, 0, 0, - 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 92, 92, 92, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 92, 92, 92, 92, 92, 124, 92, 92, 92, 92, 92, 92, 92, 92, 0, 9, 9, 9, - 9, 9, 9, 9, 9, 9, 9, 3, 3, 3, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 15, 15, 15, 15, 15, 15, 15, 15, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, + 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 92, 92, 92, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 92, 92, 92, 92, + 92, 124, 92, 92, 92, 92, 92, 92, 92, 92, 0, 9, 9, 9, 9, 9, 9, 9, 9, + 9, 9, 3, 3, 3, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 15, 92, 3, 3, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 124, 124, 124, - 92, 92, 92, 92, 92, 92, 92, 92, 92, 124, 124, 15, 15, 15, 15, 3, 3, - 3, 3, 3, 92, 92, 92, 3, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 15, 3, - 15, 3, 3, 3, 0, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, - 18, 18, 18, 18, 18, 18, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 0, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 92, 3, 3, 15, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 124, 124, 124, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 124, 124, 15, 15, 15, 15, 3, 3, 3, 3, 3, 92, 92, + 92, 3, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 15, 3, 15, 3, 3, 3, 0, 18, + 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, + 18, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 0, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, 124, 124, 124, 92, 92, 92, 124, 124, - 92, 124, 92, 92, 3, 3, 3, 3, 3, 3, 0, 0, 15, 15, 15, 15, 15, 15, 15, - 0, 15, 0, 15, 15, 15, 15, 0, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 0, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 3, 0, - 0, 0, 0, 0, 0, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 92, 124, 124, 124, 92, 92, 92, 92, 92, 92, 92, 92, 0, 0, 0, 0, 0, 9, - 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 92, 92, 124, 124, 0, 15, - 15, 15, 15, 15, 15, 15, 15, 0, 0, 15, 15, 0, 0, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, 92, 124, 124, 124, 124, 0, 0, 124, - 124, 0, 0, 124, 124, 124, 0, 0, 15, 0, 0, 0, 0, 0, 0, 124, 0, 0, 0, - 0, 0, 15, 15, 15, 15, 15, 124, 124, 0, 0, 92, 92, 92, 92, 92, 92, 92, - 0, 0, 0, 92, 92, 92, 92, 92, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 124, 124, 124, - 92, 92, 92, 92, 92, 92, 124, 92, 124, 124, 124, 124, 92, 92, 124, 92, - 92, 15, 15, 3, 15, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, - 9, 9, 0, 0, 0, 0, 0, 0, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 124, 124, 124, 92, 92, 92, 92, 0, 0, 124, 124, 124, - 124, 92, 92, 124, 92, 92, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 15, 15, 15, 15, 92, 92, 0, 0, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 124, 124, 124, - 92, 92, 92, 92, 92, 92, 92, 92, 124, 124, 92, 124, 92, 92, 3, 3, 3, - 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, - 0, 0, 0, 0, 0, 0, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 92, 124, - 92, 124, 124, 92, 92, 92, 92, 92, 92, 124, 92, 0, 0, 0, 0, 0, 0, 0, - 0, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 0, 0, 0, 92, 92, 92, 124, 124, - 92, 92, 92, 92, 124, 92, 92, 92, 92, 92, 0, 0, 0, 0, 9, 9, 9, 9, 9, - 9, 9, 9, 9, 9, 18, 18, 3, 3, 3, 14, 10, 10, 10, 10, 10, 10, 10, 10, + 15, 15, 15, 124, 124, 124, 92, 92, 92, 124, 124, 92, 124, 92, 92, 3, + 3, 3, 3, 3, 3, 92, 0, 15, 15, 15, 15, 15, 15, 15, 0, 15, 0, 15, 15, + 15, 15, 0, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 0, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 3, 0, 0, 0, 0, 0, 0, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 92, 124, 124, 124, + 92, 92, 92, 92, 92, 92, 92, 92, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, + 9, 9, 9, 0, 0, 0, 0, 0, 0, 92, 92, 124, 124, 0, 15, 15, 15, 15, 15, + 15, 15, 15, 0, 0, 15, 15, 0, 0, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 92, 124, 124, 124, 124, 0, 0, 124, 124, 0, 0, 124, + 124, 124, 0, 0, 15, 0, 0, 0, 0, 0, 0, 124, 0, 0, 0, 0, 0, 15, 15, 15, + 15, 15, 124, 124, 0, 0, 92, 92, 92, 92, 92, 92, 92, 0, 0, 0, 92, 92, + 92, 92, 92, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 124, 124, + 124, 92, 92, 92, 92, 92, 92, 92, 92, 124, 124, 92, 92, 92, 124, 92, + 15, 15, 15, 15, 3, 3, 3, 3, 3, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 3, + 0, 3, 0, 0, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 124, 124, 124, 92, 92, 92, 92, 92, 92, 124, 92, 124, 124, 124, + 124, 92, 92, 124, 92, 92, 15, 15, 3, 15, 0, 0, 0, 0, 0, 0, 0, 0, 9, + 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 124, 124, 124, 92, 92, 92, 92, + 0, 0, 124, 124, 124, 124, 92, 92, 124, 92, 92, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 15, 15, 15, 15, 92, + 92, 0, 0, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 124, 124, 124, 92, 92, 92, 92, 92, 92, 92, 92, 124, 124, 92, 124, + 92, 92, 3, 3, 3, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, + 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 92, 124, 92, 124, 124, 92, 92, + 92, 92, 92, 92, 124, 92, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, + 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 0, 0, 0, 92, 92, 92, 124, + 124, 92, 92, 92, 92, 124, 92, 92, 92, 92, 92, 0, 0, 0, 0, 9, 9, 9, + 9, 9, 9, 9, 9, 9, 9, 18, 18, 3, 3, 3, 14, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 10, 10, 10, 10, 10, 10, 10, 10, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, - 13, 13, 13, 13, 13, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 18, 18, 18, 18, 18, - 18, 18, 18, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 15, 15, 15, + 13, 13, 13, 13, 13, 13, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 18, 18, 18, 18, + 18, 18, 18, 18, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 0, 0, 0, 0, 0, 0, 0, 127, 127, 127, 127, 127, 127, - 127, 127, 127, 127, 127, 127, 127, 127, 127, 0, 3, 3, 3, 3, 3, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 15, 15, 15, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 15, 15, 15, 15, 15, 15, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 3, 3, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 0, 0, 92, 92, 92, 92, 92, 3, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 92, 92, 92, 92, 92, 92, 92, 3, 3, 3, 3, 3, 14, 14, 14, 14, 91, 91, - 91, 91, 3, 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, - 9, 9, 0, 18, 18, 18, 18, 18, 18, 18, 0, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 0, 0, 0, 0, - 0, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 15, - 15, 15, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 124, 124, 124, 124, - 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, + 15, 15, 15, 15, 15, 15, 0, 0, 0, 0, 0, 0, 0, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 0, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 124, 92, 92, 92, 92, 92, 92, 92, 0, 124, + 124, 124, 124, 92, 92, 124, 92, 15, 3, 3, 3, 3, 3, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 18, 18, 18, 18, 18, 18, 18, + 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 0, 0, 0, 3, 3, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 0, 0, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 0, 124, 92, 92, 92, 92, 92, 92, 92, 124, 92, 92, 124, 92, 92, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 127, 127, 127, 127, 127, 127, 127, 127, 127, + 127, 127, 127, 127, 127, 127, 0, 3, 3, 3, 3, 3, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 15, 15, 15, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 15, 15, 15, 15, 15, 15, 15, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, + 9, 9, 9, 9, 9, 0, 0, 0, 0, 3, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 0, 0, 92, 92, 92, 92, 92, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 92, 92, 92, + 92, 92, 92, 92, 3, 3, 3, 3, 3, 14, 14, 14, 14, 91, 91, 91, 91, 3, 14, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 18, + 18, 18, 18, 18, 18, 18, 0, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 0, 0, 0, 0, 0, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 15, 15, 15, 15, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 92, 92, 92, 92, 91, - 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 15, 15, 0, 0, 0, 0, + 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 92, 92, 92, 92, 91, 91, 91, + 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 0, 0, 0, 0, 0, - 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 0, 0, 0, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 0, 0, 0, 0, 0, 0, 0, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 0, 0, 14, 92, 92, 3, 17, 17, 17, 17, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 14, 14, 14, 14, 14, 14, 14, 0, 0, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 124, 124, 92, 92, 92, 14, 14, 14, 124, 124, 124, 124, 124, - 124, 17, 17, 17, 17, 17, 17, 17, 17, 92, 92, 92, 92, 92, 92, 92, 92, - 14, 14, 92, 92, 92, 92, 92, 92, 92, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 92, 92, 92, 92, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 14, 14, 92, 92, 92, 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, - 18, 18, 18, 18, 18, 18, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, - 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 21, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 15, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 0, 0, 0, 0, 0, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 0, 0, 0, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 0, 0, 0, 0, 0, 0, 0, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 0, 0, + 14, 92, 92, 3, 17, 17, 17, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 14, 14, 14, 14, + 14, 14, 0, 0, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 124, 124, 92, + 92, 92, 14, 14, 14, 124, 124, 124, 124, 124, 124, 17, 17, 17, 17, 17, + 17, 17, 17, 92, 92, 92, 92, 92, 92, 92, 92, 14, 14, 92, 92, 92, 92, + 92, 92, 92, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 92, + 92, 92, 92, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 14, 92, 92, + 92, 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, + 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 107, 107, 107, 107, 107, + 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, + 107, 107, 107, 107, 107, 107, 107, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, + 21, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, + 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 21, + 21, 21, 21, 21, 21, 21, 0, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, - 107, 107, 107, 107, 107, 21, 21, 21, 21, 21, 21, 21, 0, 21, 21, 21, + 107, 107, 107, 107, 107, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, + 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 107, 0, + 107, 107, 0, 0, 107, 0, 0, 107, 107, 0, 0, 107, 107, 107, 107, 0, 107, + 107, 107, 107, 107, 107, 107, 107, 21, 21, 21, 21, 0, 21, 0, 21, 21, + 21, 21, 21, 21, 21, 0, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, + 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, + 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 21, 21, + 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, + 21, 21, 21, 21, 21, 21, 21, 107, 107, 0, 107, 107, 107, 107, 0, 0, + 107, 107, 107, 107, 107, 107, 107, 107, 0, 107, 107, 107, 107, 107, + 107, 107, 0, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, + 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 107, 107, 0, 107, 107, + 107, 107, 0, 107, 107, 107, 107, 107, 0, 107, 0, 0, 0, 107, 107, 107, + 107, 107, 107, 107, 0, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, - 21, 21, 21, 21, 107, 0, 107, 107, 0, 0, 107, 0, 0, 107, 107, 0, 0, - 107, 107, 107, 107, 0, 107, 107, 107, 107, 107, 107, 107, 107, 21, - 21, 21, 21, 0, 21, 0, 21, 21, 21, 21, 21, 21, 21, 0, 21, 21, 21, 21, - 21, 21, 21, 21, 21, 21, 21, 107, 107, 107, 107, 107, 107, 107, 107, + 21, 21, 21, 21, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, + 107, 107, 107, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, + 21, 21, 21, 21, 21, 107, 107, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, + 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, - 107, 107, 107, 107, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, - 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 107, 107, 0, - 107, 107, 107, 107, 0, 0, 107, 107, 107, 107, 107, 107, 107, 107, 0, - 107, 107, 107, 107, 107, 107, 107, 0, 21, 21, 21, 21, 21, 21, 21, 21, - 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, - 21, 107, 107, 0, 107, 107, 107, 107, 0, 107, 107, 107, 107, 107, 0, - 107, 0, 0, 0, 107, 107, 107, 107, 107, 107, 107, 0, 21, 21, 21, 21, + 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, - 21, 21, 21, 21, 21, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, + 21, 21, 21, 21, 21, 21, 107, 107, 107, 107, 107, 107, 107, 107, 107, + 107, 107, 107, 107, 107, 107, 107, 21, 21, 21, 21, 21, 21, 0, 0, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, - 107, 107, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, - 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 107, 107, 107, 107, 107, - 107, 107, 107, 107, 107, 107, 107, 107, 107, 21, 21, 21, 21, 21, 21, - 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 107, 107, 21, 21, 21, + 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 7, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, - 21, 21, 21, 21, 21, 21, 107, 107, 107, 107, 107, 107, 107, 107, 107, + 21, 21, 21, 21, 7, 21, 21, 21, 21, 21, 21, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, - 107, 107, 107, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, - 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 107, 107, 107, - 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 21, - 21, 21, 21, 21, 21, 0, 0, 107, 107, 107, 107, 107, 107, 107, 107, 107, + 107, 107, 107, 107, 107, 107, 7, 21, 21, 21, 21, 21, 21, 21, 21, 21, + 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 7, + 21, 21, 21, 21, 21, 21, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 7, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 7, 21, 21, 21, 21, 21, @@ -1388,60 +1430,62 @@ static const unsigned char groupMap[] = { 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 7, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, - 21, 21, 7, 21, 21, 21, 21, 21, 21, 107, 107, 107, 107, 107, 107, 107, - 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, - 107, 107, 107, 107, 7, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, - 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 7, 21, 21, - 21, 21, 21, 21, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, - 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, - 7, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, - 21, 21, 21, 21, 21, 21, 21, 21, 21, 7, 21, 21, 21, 21, 21, 21, 107, - 21, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, + 21, 21, 7, 21, 21, 21, 21, 21, 21, 107, 21, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, - 9, 9, 9, 9, 9, 9, 9, 9, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, - 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 14, 14, 14, 14, 92, + 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, - 14, 14, 14, 14, 14, 14, 14, 14, 92, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 92, 14, 14, 3, 3, 3, 3, 3, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 92, 92, 92, 92, 92, 0, 92, 92, 92, 92, 92, - 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 92, 92, 92, 92, 92, 14, 14, 14, 14, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 14, 14, 14, 14, 14, 14, 14, + 14, 92, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 92, + 14, 14, 3, 3, 3, 3, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 92, 92, 92, 92, 92, 0, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 92, + 92, 92, 92, 92, 92, 92, 0, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 0, 0, 92, 92, 92, 92, 92, 92, 92, 0, 92, + 92, 0, 92, 92, 92, 92, 92, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 15, 15, 15, 15, 0, 0, 18, 18, 18, 18, 18, 18, 18, 18, 18, 92, 92, 92, 92, 92, 92, 92, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 15, 15, 15, 15, 0, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 0, 15, - 15, 0, 15, 0, 0, 15, 0, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 0, - 15, 15, 15, 15, 0, 15, 0, 15, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 15, - 0, 15, 0, 15, 0, 15, 15, 15, 0, 15, 15, 0, 15, 0, 0, 15, 0, 15, 0, - 15, 0, 15, 0, 15, 0, 15, 15, 0, 15, 0, 0, 15, 15, 15, 15, 0, 15, 15, - 15, 15, 15, 15, 15, 0, 15, 15, 15, 15, 0, 15, 15, 15, 15, 0, 15, 0, - 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 0, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 0, 0, 0, 0, 0, 15, 15, - 15, 0, 15, 15, 15, 15, 15, 0, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 7, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 0, 0, 0, 0, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 0, 0, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 0, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 0, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 18, 18, 18, 18, 18, 18, 18, 18, - 18, 18, 18, 18, 18, 0, 0, 0, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 0, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, + 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, + 196, 196, 196, 196, 196, 196, 196, 197, 197, 197, 197, 197, 197, 197, + 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, + 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, 92, + 92, 92, 92, 92, 92, 92, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, + 0, 0, 0, 0, 3, 3, 15, 15, 15, 15, 0, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 0, 15, 15, 0, 15, 0, 0, 15, 0, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 0, 15, 15, 15, 15, 0, 15, 0, 15, 0, 0, 0, 0, 0, 0, 15, + 0, 0, 0, 0, 15, 0, 15, 0, 15, 0, 15, 15, 15, 0, 15, 15, 0, 15, 0, 0, + 15, 0, 15, 0, 15, 0, 15, 0, 15, 0, 15, 15, 0, 15, 0, 0, 15, 15, 15, + 15, 0, 15, 15, 15, 15, 15, 15, 15, 0, 15, 15, 15, 15, 0, 15, 15, 15, + 15, 0, 15, 0, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 0, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 0, 0, 0, 0, + 0, 15, 15, 15, 0, 15, 15, 15, 15, 15, 0, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 0, 0, 0, + 0, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 0, 0, 14, + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 0, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 0, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 18, 18, 18, 18, 18, + 18, 18, 18, 18, 18, 18, 18, 18, 0, 0, 0, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 0, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 0, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 0, 0, 0, 0, 0, 0, 0, 14, 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 11, 11, 11, 11, 11, 14, - 14, 14, 14, 0, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 0, 0, 0, 0, 14, 14, 14, 14, 14, 14, 14, 14, 14, 0, 0, 0, 0, + 0, 0, 0, 14, 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 0, 0, 0, 14, 14, 14, 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 14, 14, 14, 14, 14, 14, 14, 14, 11, 11, 11, 11, 11, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 0, 0, 0, 14, 14, 14, 14, 14, 14, 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 14, 14, 14, 14, 14, 14, 14, 0, 0, 0, 0, 0, 0, 0, 0, 14, 14, 14, 14, 14, 14, @@ -1450,8 +1494,14 @@ static const unsigned char groupMap[] = { 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 0, 0, 0, 0, 0, 0, 0, 14, 14, 14, 14, 14, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 + 14, 14, 14, 14, 14, 14, 14, 14, 0, 14, 14, 14, 14, 14, 14, 14, 14, + 0, 0, 0, 0, 0, 0, 0, 0, 14, 0, 0, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 0, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 0, 0, + 0, 0, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 0, + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0 #endif /* TCL_UTF_MAX > 3 */ }; @@ -1486,15 +1536,16 @@ static const int groups[] = { 29761, 9793, 9537, 16449, 16193, 9858, 9602, 8066, 16514, 16258, 2113, 16002, 14722, 1, 12162, 13954, 2178, 22146, 20610, -1662, 29826, -15295, 24706, -1727, 20545, 7, 3905, 3970, 12353, 12418, - 8, 1859649, 9949249, 10, -9044862, -976254, 15234, -1949375, -1918, - -1983, -18814, -21886, -25470, -32638, -28542, -32126, -1981, - -2174, -18879, -2237, 1844610, -21951, -25535, -28607, -32703, - -32191, 13, 14, -1924287, -2145983, -2115007, 7233, 7298, 4170, - 4234, 6749, 6813, -2750143, -976319, -2746047, 2763650, 2762882, - -2759615, -2751679, -2760383, -2760127, -2768575, 1859714, -9044927, - -10823615, -10830783, -10833599, -10832575, -10830015, -10817983, - -10824127, -10818751, 237633, 237698, 9949314, 18, 17, 10305, - 10370 + 8, 1859649, 9949249, 10, 1601154, 1600898, 1598594, 1598082, 1598338, + 1596546, 1582466, -9027966, -9044862, -976254, 15234, -1949375, + -1918, -1983, -18814, -21886, -25470, -32638, -28542, -32126, + -1981, -2174, -18879, -2237, 1844610, -21951, -25535, -28607, + -32703, -32191, 13, 14, -1924287, -2145983, -2115007, 7233, 7298, + 4170, 4234, 6749, 6813, -2750143, -976319, -2746047, 2763650, + 2762882, -2759615, -2751679, -2760383, -2760127, -2768575, 1859714, + -9044927, -10823615, -10830783, -10833599, -10832575, -10830015, + -10817983, -10824127, -10818751, 237633, 237698, 9949314, 18, + 17, 10305, 10370, 8769, 8834 }; #if TCL_UTF_MAX > 3 -- cgit v0.12 From fa0cec87e3c5670b11c89aef1aba30201a22ea43 Mon Sep 17 00:00:00 2001 From: dgp Date: Tue, 21 Jun 2016 11:10:10 +0000 Subject: Repair earlier bug fix. Stopped crash, but botched the logic for multiple glob patterns. --- generic/tclFileName.c | 1 + 1 file changed, 1 insertion(+) diff --git a/generic/tclFileName.c b/generic/tclFileName.c index bf463f5..2136883 100644 --- a/generic/tclFileName.c +++ b/generic/tclFileName.c @@ -1597,6 +1597,7 @@ Tcl_GlobObjCmd( Tcl_DStringInit(&str); for (i = 0; i < objc; i++) { + Tcl_DStringSetLength(&str, 0); if (dir == PATH_GENERAL) { TclDStringAppendDString(&str, &prefix); } -- cgit v0.12 From f37d8b3d6914b1f9637faf57175429443591e0ef Mon Sep 17 00:00:00 2001 From: dgp Date: Wed, 22 Jun 2016 17:38:31 +0000 Subject: [16896d49fd] Tcl_DStrings should tolerate appends to self. --- generic/tclUtil.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/generic/tclUtil.c b/generic/tclUtil.c index bc1490e..34d4be2 100644 --- a/generic/tclUtil.c +++ b/generic/tclUtil.c @@ -2431,8 +2431,20 @@ Tcl_DStringAppend( memcpy(newString, dsPtr->string, (size_t) dsPtr->length); dsPtr->string = newString; } else { + int offset = -1; + + /* See [16896d49fd] */ + if (bytes >= dsPtr->string + && bytes <= dsPtr->string + dsPtr->length) { + offset = bytes - dsPtr->string; + } + dsPtr->string = ckrealloc((void *) dsPtr->string, (size_t) dsPtr->spaceAvl); + + if (offset >= 0) { + bytes = dsPtr->string + offset; + } } } @@ -2495,8 +2507,20 @@ Tcl_DStringAppendElement( memcpy(newString, dsPtr->string, (size_t) dsPtr->length); dsPtr->string = newString; } else { + int offset = -1; + + /* See [16896d49fd] */ + if (element >= dsPtr->string + && element <= dsPtr->string + dsPtr->length) { + offset = element - dsPtr->string; + } + dsPtr->string = (char *) ckrealloc((void *) dsPtr->string, (size_t) dsPtr->spaceAvl); + + if (offset >= 0) { + element = dsPtr->string + offset; + } } dst = dsPtr->string + dsPtr->length; } -- cgit v0.12 From 23df0f8727cefc64cb5b4a6c7a3af518d16fbd7c Mon Sep 17 00:00:00 2001 From: dkf Date: Wed, 22 Jun 2016 20:57:18 +0000 Subject: [c95b9fc0e3] Make errorcodes out of level parsing more consistent. --- generic/tclCmdIL.c | 4 ++-- generic/tclProc.c | 2 +- generic/tclVar.c | 3 ++- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/generic/tclCmdIL.c b/generic/tclCmdIL.c index 0d35397..c93e593 100644 --- a/generic/tclCmdIL.c +++ b/generic/tclCmdIL.c @@ -1203,7 +1203,7 @@ InfoFrameCmd( levelError: Tcl_SetObjResult(interp, Tcl_ObjPrintf( "bad level \"%s\"", TclGetString(objv[1]))); - Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "STACK_FRAME", + Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "LEVEL", TclGetString(objv[1]), NULL); code = TCL_ERROR; goto done; @@ -1638,7 +1638,7 @@ InfoLevelCmd( levelError: Tcl_SetObjResult(interp, Tcl_ObjPrintf( "bad level \"%s\"", TclGetString(objv[1]))); - Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "STACK_LEVEL", + Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "LEVEL", TclGetString(objv[1]), NULL); return TCL_ERROR; } diff --git a/generic/tclProc.c b/generic/tclProc.c index 172b860..e8c5955 100644 --- a/generic/tclProc.c +++ b/generic/tclProc.c @@ -870,7 +870,7 @@ TclObjGetFrame( } Tcl_SetObjResult(interp, Tcl_ObjPrintf("bad level \"%s\"", name)); - Tcl_SetErrorCode(interp, "TCL", "VALUE", "STACKLEVEL", NULL); + Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "LEVEL", name, NULL); return -1; } diff --git a/generic/tclVar.c b/generic/tclVar.c index 5574f30..51e2482 100644 --- a/generic/tclVar.c +++ b/generic/tclVar.c @@ -4938,7 +4938,8 @@ Tcl_UpvarObjCmd( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "bad level \"%s\"", TclGetString(levelObj))); - Tcl_SetErrorCode(interp, "TCL", "VALUE", "LEVEL", NULL); + Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "LEVEL", + TclGetString(levelObj), NULL); return TCL_ERROR; } -- cgit v0.12 From 6a513d71d369eed56569ff3bf3e05c4f80c2ccae Mon Sep 17 00:00:00 2001 From: dkf Date: Thu, 23 Jun 2016 08:20:16 +0000 Subject: [d553228d9f] Stop crashes in [dict update] with low refcount dictionaries. --- generic/tclExecute.c | 4 ++++ tests/dict.test | 7 +++++++ 2 files changed, 11 insertions(+) diff --git a/generic/tclExecute.c b/generic/tclExecute.c index d4077f5..38924c6 100644 --- a/generic/tclExecute.c +++ b/generic/tclExecute.c @@ -7706,6 +7706,7 @@ TEBCresume( goto gotError; } } + Tcl_IncrRefCount(dictPtr); if (TclListObjGetElements(interp, OBJ_AT_TOS, &length, &keyPtrPtr) != TCL_OK) { TRACE_ERROR(interp); @@ -7718,6 +7719,7 @@ TEBCresume( if (Tcl_DictObjGet(interp, dictPtr, keyPtrPtr[i], &valuePtr) != TCL_OK) { TRACE_ERROR(interp); + Tcl_DecrRefCount(dictPtr); goto gotError; } varPtr = LOCAL(duiPtr->varIndices[i]); @@ -7734,10 +7736,12 @@ TEBCresume( duiPtr->varIndices[i]) == NULL) { CACHE_STACK_INFO(); TRACE_ERROR(interp); + Tcl_DecrRefCount(dictPtr); goto gotError; } CACHE_STACK_INFO(); } + TclDecrRefCount(dictPtr); TRACE_APPEND(("OK\n")); NEXT_INST_F(9, 0, 0); diff --git a/tests/dict.test b/tests/dict.test index d5406d0..a6b0cb4 100644 --- a/tests/dict.test +++ b/tests/dict.test @@ -2048,6 +2048,13 @@ test dict-24.25 {dict map with huge dict (compiled)} { }} 100000 } 166666666600000 +test dict-25.1 {compiled dict update with low-refcount values [Bug d553228d9f]} { + # Test crashes on failure + apply {{} { + lassign {} item + dict update item item item two two {} + }} +} {} # cleanup ::tcltest::cleanupTests -- cgit v0.12 From 94c255833358445b9edae73af1ffbe1cc2c8ab42 Mon Sep 17 00:00:00 2001 From: max Date: Fri, 24 Jun 2016 16:40:30 +0000 Subject: [c30087b04f] Install man pages with permissions 644 instead of 444. --- unix/installManPage | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/unix/installManPage b/unix/installManPage index 4d615bf..1f1cbde 100755 --- a/unix/installManPage +++ b/unix/installManPage @@ -106,7 +106,7 @@ for Target in $Names; do First=$Target sed -e "/man\.macros/r $SrcDir/man.macros" -e "/man\.macros/d" \ $ManPage > $Dir/$First - chmod 444 $Dir/$First + chmod 644 $Dir/$First $Gzip $Dir/$First else ln $SymOrLoc$First$Gz $Dir/$Target$Gz -- cgit v0.12 From 2bd38cb7b01df731a4090c6a0f82d33cec5c2ad3 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Sun, 26 Jun 2016 09:00:06 +0000 Subject: (cherry-pick) [c30087b04f] Install man pages with permissions 644 instead of 444. --- unix/installManPage | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/unix/installManPage b/unix/installManPage index 4d615bf..1f1cbde 100755 --- a/unix/installManPage +++ b/unix/installManPage @@ -106,7 +106,7 @@ for Target in $Names; do First=$Target sed -e "/man\.macros/r $SrcDir/man.macros" -e "/man\.macros/d" \ $ManPage > $Dir/$First - chmod 444 $Dir/$First + chmod 644 $Dir/$First $Gzip $Dir/$First else ln $SymOrLoc$First$Gz $Dir/$Target$Gz -- cgit v0.12 From e11daf6fb666f377464fdedddde9126ba31658d7 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Sun, 26 Jun 2016 09:01:26 +0000 Subject: (cherry-pick) [c30087b04f] Install man pages with permissions 644 instead of 444. --- unix/installManPage | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/unix/installManPage b/unix/installManPage index 6bdccf0..1dbd232 100755 --- a/unix/installManPage +++ b/unix/installManPage @@ -105,7 +105,7 @@ for Target in $Names; do First=$Target sed -e "/man\.macros/r $SrcDir/man.macros" -e "/man\.macros/d" \ $ManPage > $Dir/$First - chmod 444 $Dir/$First + chmod 644 $Dir/$First $Gzip $Dir/$First else ln $SymOrLoc$First$Gz $Dir/$Target$Gz -- cgit v0.12 From 179f28ba4605cb66cd358eb8d6d57b42e7bf5bb9 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Sun, 26 Jun 2016 09:03:08 +0000 Subject: Add TCL_NOINLINE macro, useful for micro-optimizations --- generic/tcl.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/generic/tcl.h b/generic/tcl.h index 3cd90a9..be40368 100644 --- a/generic/tcl.h +++ b/generic/tcl.h @@ -144,6 +144,7 @@ extern "C" { #if defined(__GNUC__) && (__GNUC__ > 2) # define TCL_FORMAT_PRINTF(a,b) __attribute__ ((__format__ (__printf__, a, b))) # define TCL_NORETURN __attribute__ ((noreturn)) +# define TCL_NOINLINE __attribute__ ((noinline)) # if defined(BUILD_tcl) || defined(BUILD_tk) # define TCL_NORETURN1 __attribute__ ((noreturn)) # else @@ -153,8 +154,10 @@ extern "C" { # define TCL_FORMAT_PRINTF(a,b) # if defined(_MSC_VER) && (_MSC_VER >= 1310) # define TCL_NORETURN _declspec(noreturn) +# define TCL_NOINLINE __declspec(noinline) # else # define TCL_NORETURN /* nothing */ +# define TCL_NOINLINE /* nothing */ # endif # define TCL_NORETURN1 /* nothing */ #endif -- cgit v0.12 From a7534bc7ed966b9b399e86be1c6cc2004baf379c Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Mon, 27 Jun 2016 10:22:30 +0000 Subject: Make TCL_MAJOR_VERSION/TCL_MINOR_VERSION/TCL_STUB_MAGIC available to Tcl_InitStubs() arguments. Useful for debugging and detection of stub incompatibilities (e.g. for Tcl9) --- generic/tcl.h | 19 +++++++++---------- generic/tclPkg.c | 2 +- generic/tclStubLib.c | 20 +++++++++----------- 3 files changed, 19 insertions(+), 22 deletions(-) diff --git a/generic/tcl.h b/generic/tcl.h index be40368..6061ea8 100644 --- a/generic/tcl.h +++ b/generic/tcl.h @@ -2377,9 +2377,6 @@ typedef int (Tcl_NRPostProc) (ClientData data[], Tcl_Interp *interp, *---------------------------------------------------------------------------- * The following constant is used to test for older versions of Tcl in the * stubs tables. - * - * Jan Nijtman's plus patch uses 0xFCA1BACF, so we need to pick a different - * value since the stubs tables don't match. */ #define TCL_STUB_MAGIC ((int) 0xFCA3BACF) @@ -2392,17 +2389,19 @@ typedef int (Tcl_NRPostProc) (ClientData data[], Tcl_Interp *interp, */ const char * Tcl_InitStubs(Tcl_Interp *interp, const char *version, - int exact); + int exact, int magic); const char * TclTomMathInitializeStubs(Tcl_Interp *interp, const char *version, int epoch, int revision); -/* - * When not using stubs, make it a macro. - */ - -#ifndef USE_TCL_STUBS +#ifdef USE_TCL_STUBS +#define Tcl_InitStubs(interp, version, exact) \ + (Tcl_InitStubs)(interp, version, \ + (exact)|(TCL_MAJOR_VERSION<<8)|(TCL_MINOR_VERSION<<16), \ + TCL_STUB_MAGIC) +#else #define Tcl_InitStubs(interp, version, exact) \ - Tcl_PkgInitStubsCheck(interp, version, exact) + Tcl_PkgInitStubsCheck(interp, version, \ + (exact)|(TCL_MAJOR_VERSION<<8)|(TCL_MINOR_VERSION<<16)) #endif /* diff --git a/generic/tclPkg.c b/generic/tclPkg.c index f6e8b20..86777a8 100644 --- a/generic/tclPkg.c +++ b/generic/tclPkg.c @@ -1895,7 +1895,7 @@ Tcl_PkgInitStubsCheck( { const char *actualVersion = Tcl_PkgPresent(interp, "Tcl", version, 0); - if (exact && actualVersion) { + if ((exact&1) && actualVersion) { const char *p = version; int count = 0; diff --git a/generic/tclStubLib.c b/generic/tclStubLib.c index 859cbf9..afabdca 100644 --- a/generic/tclStubLib.c +++ b/generic/tclStubLib.c @@ -24,13 +24,10 @@ const TclIntStubs *tclIntStubsPtr = NULL; const TclIntPlatStubs *tclIntPlatStubsPtr = NULL; /* - * Use our own isDigit to avoid linking to libc on windows + * Use our own ISDIGIT to avoid linking to libc on windows */ -static int isDigit(const int c) -{ - return (c >= '0' && c <= '9'); -} +#define ISDIGIT(c) (((unsigned)((c)-'0')) <= 9) /* *---------------------------------------------------------------------- @@ -54,7 +51,8 @@ MODULE_SCOPE const char * Tcl_InitStubs( Tcl_Interp *interp, const char *version, - int exact) + int exact, + int magic) { Interp *iPtr = (Interp *) interp; const char *actualVersion = NULL; @@ -67,8 +65,8 @@ Tcl_InitStubs( * times. [Bug 615304] */ - if (!stubsPtr || (stubsPtr->magic != TCL_STUB_MAGIC)) { - iPtr->result = "interpreter uses an incompatible stubs mechanism"; + if (!stubsPtr || (stubsPtr->magic != (((exact&0xff00) >= 0x900) ? magic : TCL_STUB_MAGIC))) { + iPtr->result = (char *)"interpreter uses an incompatible stubs mechanism"; iPtr->freeProc = TCL_STATIC; return NULL; } @@ -77,12 +75,12 @@ Tcl_InitStubs( if (actualVersion == NULL) { return NULL; } - if (exact) { + if (exact&1) { const char *p = version; int count = 0; while (*p) { - count += !isDigit(*p++); + count += !ISDIGIT(*p++); } if (count == 1) { const char *q = actualVersion; @@ -91,7 +89,7 @@ Tcl_InitStubs( while (*p && (*p == *q)) { p++; q++; } - if (*p || isDigit(*q)) { + if (*p || ISDIGIT(*q)) { /* Construct error message */ stubsPtr->tcl_PkgRequireEx(interp, "Tcl", version, 1, NULL); return NULL; -- cgit v0.12 From 039129beee818bb0aa8a756e09cb8a1b3ac68f49 Mon Sep 17 00:00:00 2001 From: dkf Date: Mon, 27 Jun 2016 13:44:40 +0000 Subject: [c3d956be5b] Clearer text about positioning of optional arguments. --- doc/proc.n | 28 +++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/doc/proc.n b/doc/proc.n index 129f4df..fdccaca 100644 --- a/doc/proc.n +++ b/doc/proc.n @@ -34,8 +34,9 @@ one or two fields. If there is only a single field in the specifier then it is the name of the argument; if there are two fields, then the first is the argument name and the second is its default value. Arguments with default values that are followed by non-defaulted -arguments become required arguments. In 8.6 this will be considered an -error. +arguments become required arguments; enough actual arguments must be +supplied to allow all arguments up to and including the last required +formal argument. .PP When \fIname\fR is invoked a local variable will be created for each of the formal arguments to the procedure; its @@ -48,11 +49,14 @@ actual arguments for all the formal arguments that do not have defaults, and there must not be any extra actual arguments. Arguments with default values that are followed by non-defaulted -arguments become required arguments (in 8.6 it will be considered an -error). +arguments become de-facto required arguments, though this may change +in a future version of Tcl; portable code should ensure that all +optional arguments come after all required arguments. +.PP There is one special case to permit procedures with variable numbers of arguments. If the last formal argument has the name -\fBargs\fR, then a call to the procedure may contain more actual arguments +.QW \fBargs\fR , +then a call to the procedure may contain more actual arguments than the procedure has formal arguments. In this case, all of the actual arguments starting at the one that would be assigned to \fBargs\fR are combined into a list (as if the \fBlist\fR command had been used); this combined value @@ -80,6 +84,20 @@ If an error occurs while executing the procedure body, then the procedure-as-a-whole will return that same error. .SH EXAMPLES .PP +This is a procedure that takes two arguments and prints both their sum +and their product. It also returns the string +.QW OK +to the caller as an explicit result. +.PP +.CS +\fBproc\fR printSumProduct {x y} { + set sum [expr {$x + $y}] + set prod [expr {$x * $y}] + puts "sum is $sum, product is $prod" + return "OK" +} +.CE +.PP This is a procedure that accepts arbitrarily many arguments and prints them out, one by one. .PP -- cgit v0.12 From 2d4bd7bd8e4bc730323dccbc6b659954f3d1341c Mon Sep 17 00:00:00 2001 From: dkf Date: Mon, 27 Jun 2016 13:46:15 +0000 Subject: [c3d956be5b] Clearer text about positioning of optional arguments. --- doc/proc.n | 28 +++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/doc/proc.n b/doc/proc.n index 129f4df..fdccaca 100644 --- a/doc/proc.n +++ b/doc/proc.n @@ -34,8 +34,9 @@ one or two fields. If there is only a single field in the specifier then it is the name of the argument; if there are two fields, then the first is the argument name and the second is its default value. Arguments with default values that are followed by non-defaulted -arguments become required arguments. In 8.6 this will be considered an -error. +arguments become required arguments; enough actual arguments must be +supplied to allow all arguments up to and including the last required +formal argument. .PP When \fIname\fR is invoked a local variable will be created for each of the formal arguments to the procedure; its @@ -48,11 +49,14 @@ actual arguments for all the formal arguments that do not have defaults, and there must not be any extra actual arguments. Arguments with default values that are followed by non-defaulted -arguments become required arguments (in 8.6 it will be considered an -error). +arguments become de-facto required arguments, though this may change +in a future version of Tcl; portable code should ensure that all +optional arguments come after all required arguments. +.PP There is one special case to permit procedures with variable numbers of arguments. If the last formal argument has the name -\fBargs\fR, then a call to the procedure may contain more actual arguments +.QW \fBargs\fR , +then a call to the procedure may contain more actual arguments than the procedure has formal arguments. In this case, all of the actual arguments starting at the one that would be assigned to \fBargs\fR are combined into a list (as if the \fBlist\fR command had been used); this combined value @@ -80,6 +84,20 @@ If an error occurs while executing the procedure body, then the procedure-as-a-whole will return that same error. .SH EXAMPLES .PP +This is a procedure that takes two arguments and prints both their sum +and their product. It also returns the string +.QW OK +to the caller as an explicit result. +.PP +.CS +\fBproc\fR printSumProduct {x y} { + set sum [expr {$x + $y}] + set prod [expr {$x * $y}] + puts "sum is $sum, product is $prod" + return "OK" +} +.CE +.PP This is a procedure that accepts arbitrarily many arguments and prints them out, one by one. .PP -- cgit v0.12 From 2453f30fb9e0fd71b6fc37ef6df3385f2efaf6d5 Mon Sep 17 00:00:00 2001 From: dkf Date: Mon, 27 Jun 2016 14:27:43 +0000 Subject: [dd260aaf72] Allow the -dictionary option to be read from a pushed transform. --- doc/zlib.n | 18 ++++++++++++------ generic/tclZlib.c | 36 +++++++++++++++--------------------- tests/zlib.test | 20 ++++++++++++++++++++ 3 files changed, 47 insertions(+), 27 deletions(-) diff --git a/doc/zlib.n b/doc/zlib.n index 9f3078d..fd29e0d 100644 --- a/doc/zlib.n +++ b/doc/zlib.n @@ -174,7 +174,11 @@ to the \fBzlib push\fR command: .VS "TIP 400" Sets the compression dictionary to use when working with compressing or decompressing the data to be \fIbinData\fR. Not valid for transformations that -work with gzip-format data. +work with gzip-format data. The dictionary should consist of strings (byte +sequences) that are likely to be encountered later in the data to be compressed, +with the most commonly used strings preferably put towards the end of the +dictionary. Tcl provides no mechanism for choosing a good such dictionary for +a particular data sequence. .VE .TP \fB\-header\fI dictionary\fR @@ -207,11 +211,13 @@ compression algorithm depends on what format is being produced or consumed. .TP \fB\-dictionary\fI binData\fR .VS "TIP 400" -This read-write options gets or sets the compression dictionary to use when -working with compressing or decompressing the data to be \fIbinData\fR. It is -not valid for transformations that work with gzip-format data, and should not -normally be set on compressing transformations other than at the point where -the transformation is stacked. +This read-write options gets or sets the initial compression dictionary to use +when working with compressing or decompressing the data to be \fIbinData\fR. +It is not valid for transformations that work with gzip-format data, and should +not normally be set on compressing transformations other than at the point where +the transformation is stacked. Note that this cannot be used to get the +current active compression dictionary mid-stream, as that information is not +exposed by the underlying library. .VE .TP \fB\-flush\fI type\fR diff --git a/generic/tclZlib.c b/generic/tclZlib.c index 691d57a..dac47cf 100644 --- a/generic/tclZlib.c +++ b/generic/tclZlib.c @@ -2906,9 +2906,9 @@ ZlibTransformClose( } } } while (e != Z_STREAM_END); - e = deflateEnd(&cd->outStream); + (void) deflateEnd(&cd->outStream); } else { - e = inflateEnd(&cd->inStream); + (void) inflateEnd(&cd->inStream); } /* @@ -3344,10 +3344,13 @@ ZlibTransformGetOption( Tcl_DStringAppendElement(dsPtr, ""); } } else { - int len; - const char *str = Tcl_GetStringFromObj(cd->compDictObj, &len); + if (cd->compDictObj) { + int len; + const char *str = Tcl_GetStringFromObj(cd->compDictObj, &len); - Tcl_DStringAppend(dsPtr, str, len); + Tcl_DStringAppend(dsPtr, str, len); + } + return TCL_OK; } } @@ -3549,7 +3552,6 @@ ZlibStackChannelTransform( ZlibChannelData *cd = ckalloc(sizeof(ZlibChannelData)); Tcl_Channel chan; int wbits = 0; - int e; if (mode != TCL_ZLIB_STREAM_DEFLATE && mode != TCL_ZLIB_STREAM_INFLATE) { Tcl_Panic("unknown mode: %d", mode); @@ -3603,43 +3605,35 @@ ZlibStackChannelTransform( */ if (mode == TCL_ZLIB_STREAM_INFLATE) { - e = inflateInit2(&cd->inStream, wbits); - if (e != Z_OK) { + if (inflateInit2(&cd->inStream, wbits) != Z_OK) { goto error; } cd->inAllocated = DEFAULT_BUFFER_SIZE; cd->inBuffer = ckalloc(cd->inAllocated); if (cd->flags & IN_HEADER) { - e = inflateGetHeader(&cd->inStream, &cd->inHeader.header); - if (e != Z_OK) { + if (inflateGetHeader(&cd->inStream, &cd->inHeader.header) != Z_OK) { goto error; } } if (cd->format == TCL_ZLIB_FORMAT_RAW && cd->compDictObj) { - e = SetInflateDictionary(&cd->inStream, cd->compDictObj); - if (e != Z_OK) { + if (SetInflateDictionary(&cd->inStream, cd->compDictObj) != Z_OK) { goto error; } - TclDecrRefCount(cd->compDictObj); - cd->compDictObj = NULL; } } else { - e = deflateInit2(&cd->outStream, level, Z_DEFLATED, wbits, - MAX_MEM_LEVEL, Z_DEFAULT_STRATEGY); - if (e != Z_OK) { + if (deflateInit2(&cd->outStream, level, Z_DEFLATED, wbits, + MAX_MEM_LEVEL, Z_DEFAULT_STRATEGY) != Z_OK) { goto error; } cd->outAllocated = DEFAULT_BUFFER_SIZE; cd->outBuffer = ckalloc(cd->outAllocated); if (cd->flags & OUT_HEADER) { - e = deflateSetHeader(&cd->outStream, &cd->outHeader.header); - if (e != Z_OK) { + if (deflateSetHeader(&cd->outStream, &cd->outHeader.header) != Z_OK) { goto error; } } if (cd->compDictObj) { - e = SetDeflateDictionary(&cd->outStream, cd->compDictObj); - if (e != Z_OK) { + if (SetDeflateDictionary(&cd->outStream, cd->compDictObj) != Z_OK) { goto error; } } diff --git a/tests/zlib.test b/tests/zlib.test index 968469d..c9e5f10 100644 --- a/tests/zlib.test +++ b/tests/zlib.test @@ -401,6 +401,26 @@ test zlib-8.16 {Bug 3603553: buffer transfer with large writes} -setup { } -cleanup { removeFile $file } -result 57647 +test zlib-8.17 {Bug dd260aaf: fconfigure} -setup { + lassign [chan pipe] inSide outSide +} -constraints zlib -body { + zlib push inflate $inSide + zlib push deflate $outSide + list [chan configure $inSide -dictionary] [chan configure $outSide -dictionary] +} -cleanup { + catch {close $inSide} + catch {close $outSide} +} -result {{} {}} +test zlib-8.18 {Bug dd260aaf: fconfigure} -setup { + lassign [chan pipe] inSide outSide +} -constraints zlib -body { + zlib push inflate $inSide -dictionary "one two" + zlib push deflate $outSide -dictionary "one two" + list [chan configure $inSide -dictionary] [chan configure $outSide -dictionary] +} -cleanup { + catch {close $inSide} + catch {close $outSide} +} -result {{one two} {one two}} test zlib-9.1 "check fcopy with push" -constraints zlib -setup { set sfile [makeFile {} testsrc.gz] -- cgit v0.12 From c26fe8498a889a3a9e71f9502848e4db08dcb072 Mon Sep 17 00:00:00 2001 From: dgp Date: Mon, 27 Jun 2016 15:16:04 +0000 Subject: Streamline comment parsing. --- generic/tclParse.c | 67 +++++++++++++++++++++++++++--------------------------- 1 file changed, 33 insertions(+), 34 deletions(-) diff --git a/generic/tclParse.c b/generic/tclParse.c index 95abc45..4974c87 100644 --- a/generic/tclParse.c +++ b/generic/tclParse.c @@ -167,6 +167,8 @@ static int ParseTokens(const char *src, int numBytes, int mask, int flags, Tcl_Parse *parsePtr); static int ParseWhiteSpace(const char *src, int numBytes, int *incompletePtr, char *typePtr); +static int ParseAllWhiteSpace(const char *src, int numBytes, + int *incompletePtr); /* *---------------------------------------------------------------------- @@ -733,23 +735,32 @@ ParseWhiteSpace( *---------------------------------------------------------------------- */ -int -TclParseAllWhiteSpace( +static int +ParseAllWhiteSpace( const char *src, /* First character to parse. */ - int numBytes) /* Max number of byes to scan */ + int numBytes, /* Max number of byes to scan */ + int *incompletePtr) /* Set true if parse is incomplete. */ { - int dummy; char type; const char *p = src; do { - int scanned = ParseWhiteSpace(p, numBytes, &dummy, &type); + int scanned = ParseWhiteSpace(p, numBytes, incompletePtr, &type); p += scanned; numBytes -= scanned; } while (numBytes && (*p == '\n') && (p++, --numBytes)); return (p-src); } + +int +TclParseAllWhiteSpace( + const char *src, /* First character to parse. */ + int numBytes) /* Max number of byes to scan */ +{ + int dummy; + return ParseAllWhiteSpace(src, numBytes, &dummy); +} /* *---------------------------------------------------------------------- @@ -1021,17 +1032,12 @@ ParseComment( * command. */ { register const char *p = src; + int incomplete = parsePtr->incomplete; while (numBytes) { - char type; - int scanned; - - do { - scanned = ParseWhiteSpace(p, numBytes, - &parsePtr->incomplete, &type); - p += scanned; - numBytes -= scanned; - } while (numBytes && (*p == '\n') && (p++,numBytes--)); + int scanned = ParseAllWhiteSpace(p, numBytes, &incomplete); + p += scanned; + numBytes -= scanned; if ((numBytes == 0) || (*p != '#')) { break; @@ -1039,36 +1045,29 @@ ParseComment( if (parsePtr->commentStart == NULL) { parsePtr->commentStart = p; } - + + p++; + numBytes--; while (numBytes) { + if (*p == '\n') { + p++; + numBytes--; + break; + } if (*p == '\\') { - scanned = ParseWhiteSpace(p, numBytes, &parsePtr->incomplete, - &type); - if (scanned) { - p += scanned; - numBytes -= scanned; - } else { - /* - * General backslash substitution in comments isn't part - * of the formal spec, but test parse-15.47 and history - * indicate that it has been the de facto rule. Don't - * change it now. - */ - - TclParseBackslash(p, numBytes, &scanned, NULL); - p += scanned; - numBytes -= scanned; - } - } else { p++; numBytes--; - if (p[-1] == '\n') { + if (numBytes == 0) { break; } } + incomplete = (*p == '\n'); + p++; + numBytes--; } parsePtr->commentSize = p - parsePtr->commentStart; } + parsePtr->incomplete = incomplete; return (p - src); } -- cgit v0.12 From 40d07325fd099e39c32596c89888f080b1a7a307 Mon Sep 17 00:00:00 2001 From: dgp Date: Mon, 27 Jun 2016 19:01:34 +0000 Subject: Stop parsing white space where there cannot be any. --- generic/tclParse.c | 69 ++++++++++++++++++++++-------------------------------- 1 file changed, 28 insertions(+), 41 deletions(-) diff --git a/generic/tclParse.c b/generic/tclParse.c index 4974c87..3372318 100644 --- a/generic/tclParse.c +++ b/generic/tclParse.c @@ -294,12 +294,18 @@ Tcl_ParseCommand( } } + /* Jump to where we check for command termination */ + + parsePtr->commandStart = src; + type = CHAR_TYPE(*src); + scanned = 1; + goto start; + /* * The following loop parses the words of the command, one word in each * iteration through the loop. */ - parsePtr->commandStart = src; while (1) { int expandWord = 0; @@ -312,23 +318,6 @@ Tcl_ParseCommand( tokenPtr = &parsePtr->tokenPtr[wordIndex]; tokenPtr->type = TCL_TOKEN_WORD; - /* - * Skip white space before the word. Also skip a backslash-newline - * sequence: it should be treated just like white space. - */ - - scanned = ParseWhiteSpace(src,numBytes, &parsePtr->incomplete, &type); - src += scanned; - numBytes -= scanned; - if (numBytes == 0) { - parsePtr->term = src; - break; - } - if ((type & terminators) != 0) { - parsePtr->term = src; - src++; - break; - } tokenPtr->start = src; parsePtr->numTokens++; parsePtr->numWords++; @@ -555,12 +544,10 @@ Tcl_ParseCommand( */ scanned = ParseWhiteSpace(src,numBytes, &parsePtr->incomplete, &type); - if (scanned) { - src += scanned; - numBytes -= scanned; - continue; - } + src += scanned; + numBytes -= scanned; + start: if (numBytes == 0) { parsePtr->term = src; break; @@ -570,30 +557,30 @@ Tcl_ParseCommand( src++; break; } - if (src[-1] == '"') { - if (interp != NULL) { - Tcl_SetObjResult(interp, Tcl_NewStringObj( - "extra characters after close-quote", -1)); - } - parsePtr->errorType = TCL_PARSE_QUOTE_EXTRA; - } else { - if (interp != NULL) { - Tcl_SetObjResult(interp, Tcl_NewStringObj( - "extra characters after close-brace", -1)); + if (scanned == 0) { + if (src[-1] == '"') { + if (interp != NULL) { + Tcl_SetObjResult(interp, Tcl_NewStringObj( + "extra characters after close-quote", -1)); + } + parsePtr->errorType = TCL_PARSE_QUOTE_EXTRA; + } else { + if (interp != NULL) { + Tcl_SetObjResult(interp, Tcl_NewStringObj( + "extra characters after close-brace", -1)); + } + parsePtr->errorType = TCL_PARSE_BRACE_EXTRA; } - parsePtr->errorType = TCL_PARSE_BRACE_EXTRA; + parsePtr->term = src; + error: + Tcl_FreeParse(parsePtr); + parsePtr->commandSize = parsePtr->end - parsePtr->commandStart; + return TCL_ERROR; } - parsePtr->term = src; - goto error; } parsePtr->commandSize = src - parsePtr->commandStart; return TCL_OK; - - error: - Tcl_FreeParse(parsePtr); - parsePtr->commandSize = parsePtr->end - parsePtr->commandStart; - return TCL_ERROR; } /* -- cgit v0.12 From 00357e27055dd3b3dcc2b853833731d6db76c137 Mon Sep 17 00:00:00 2001 From: dgp Date: Mon, 27 Jun 2016 20:29:46 +0000 Subject: Re-order loop for fewer gotos. --- generic/tclParse.c | 82 ++++++++++++++++++++++++------------------------------ 1 file changed, 36 insertions(+), 46 deletions(-) diff --git a/generic/tclParse.c b/generic/tclParse.c index 3372318..568024b 100644 --- a/generic/tclParse.c +++ b/generic/tclParse.c @@ -294,21 +294,49 @@ Tcl_ParseCommand( } } - /* Jump to where we check for command termination */ - - parsePtr->commandStart = src; - type = CHAR_TYPE(*src); - scanned = 1; - goto start; - /* * The following loop parses the words of the command, one word in each * iteration through the loop. */ + parsePtr->commandStart = src; + type = CHAR_TYPE(*src); + scanned = 1; /* Can't have missing whitepsace before first word. */ while (1) { int expandWord = 0; + /* Are we at command termination? */ + + if ((numBytes == 0) || (type & terminators) != 0) { + parsePtr->term = src; + parsePtr->commandSize = src + (numBytes != 0) + - parsePtr->commandStart; + return TCL_OK; + } + + /* Are we missing white space after previous word? */ + + if (scanned == 0) { + if (src[-1] == '"') { + if (interp != NULL) { + Tcl_SetObjResult(interp, Tcl_NewStringObj( + "extra characters after close-quote", -1)); + } + parsePtr->errorType = TCL_PARSE_QUOTE_EXTRA; + } else { + if (interp != NULL) { + Tcl_SetObjResult(interp, Tcl_NewStringObj( + "extra characters after close-brace", -1)); + } + parsePtr->errorType = TCL_PARSE_BRACE_EXTRA; + } + parsePtr->term = src; + error: + Tcl_FreeParse(parsePtr); + parsePtr->commandSize = parsePtr->end - parsePtr->commandStart; + return TCL_ERROR; + } + /* * Create the token for the word. */ @@ -537,50 +565,12 @@ Tcl_ParseCommand( tokenPtr->type = TCL_TOKEN_SIMPLE_WORD; } - /* - * Do two additional checks: (a) make sure we're really at the end of - * a word (there might have been garbage left after a quoted or braced - * word), and (b) check for the end of the command. - */ + /* Parse the whitespace between words. */ scanned = ParseWhiteSpace(src,numBytes, &parsePtr->incomplete, &type); src += scanned; numBytes -= scanned; - - start: - if (numBytes == 0) { - parsePtr->term = src; - break; - } - if ((type & terminators) != 0) { - parsePtr->term = src; - src++; - break; - } - if (scanned == 0) { - if (src[-1] == '"') { - if (interp != NULL) { - Tcl_SetObjResult(interp, Tcl_NewStringObj( - "extra characters after close-quote", -1)); - } - parsePtr->errorType = TCL_PARSE_QUOTE_EXTRA; - } else { - if (interp != NULL) { - Tcl_SetObjResult(interp, Tcl_NewStringObj( - "extra characters after close-brace", -1)); - } - parsePtr->errorType = TCL_PARSE_BRACE_EXTRA; - } - parsePtr->term = src; - error: - Tcl_FreeParse(parsePtr); - parsePtr->commandSize = parsePtr->end - parsePtr->commandStart; - return TCL_ERROR; - } } - - parsePtr->commandSize = src - parsePtr->commandStart; - return TCL_OK; } /* -- cgit v0.12 From b2522c9c24b283a616ac38c4c987827c4fa86167 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Wed, 29 Jun 2016 11:39:00 +0000 Subject: Tcl_SetVar -> Tcl_SetVar2 and comparable replacements, eliminating functions which are deprecated. --- .fossil-settings/ignore-glob | 2 ++ doc/AddErrInfo.3 | 2 +- generic/tclBasic.c | 8 ++++---- generic/tclCmdIL.c | 4 ++-- generic/tclIOSock.c | 2 +- generic/tclInterp.c | 12 ++++++------ generic/tclMain.c | 6 ++++-- generic/tclOO.c | 4 ++-- generic/tclParse.c | 2 +- generic/tclTest.c | 24 ++++++++++++------------ generic/tclThreadTest.c | 6 +++--- tests/event.test | 6 +++--- unix/dltest/pkgua.c | 6 +++--- unix/tclUnixInit.c | 24 ++++++++++++------------ unix/tclUnixSock.c | 2 +- win/tclWinSock.c | 2 +- 16 files changed, 58 insertions(+), 54 deletions(-) diff --git a/.fossil-settings/ignore-glob b/.fossil-settings/ignore-glob index 9ed86b1..51ca1e2 100644 --- a/.fossil-settings/ignore-glob +++ b/.fossil-settings/ignore-glob @@ -17,8 +17,10 @@ */tclsh* */tcltest* */versions.vc +unix/autoMkindex.tcl unix/dltest.marker unix/tcl.pc +unix/tclIndex unix/pkgs/* win/pkgs/* win/tcl.hpj diff --git a/doc/AddErrInfo.3 b/doc/AddErrInfo.3 index caba125..0b59349 100644 --- a/doc/AddErrInfo.3 +++ b/doc/AddErrInfo.3 @@ -119,7 +119,7 @@ retrieve the stack trace when script evaluation returns \fBTCL_ERROR\fR, like so: .PP .CS -int code = Tcl_Eval(interp, script); +int code = Tcl_EvalEx(interp, script, -1, 0); if (code == TCL_ERROR) { Tcl_Obj *options = \fBTcl_GetReturnOptions\fR(interp, code); Tcl_Obj *key = Tcl_NewStringObj("-errorinfo", -1); diff --git a/generic/tclBasic.c b/generic/tclBasic.c index 25f7e78..e3ac714 100644 --- a/generic/tclBasic.c +++ b/generic/tclBasic.c @@ -941,8 +941,8 @@ Tcl_CreateInterp(void) * Set up other variables such as tcl_version and tcl_library */ - Tcl_SetVar(interp, "tcl_patchLevel", TCL_PATCH_LEVEL, TCL_GLOBAL_ONLY); - Tcl_SetVar(interp, "tcl_version", TCL_VERSION, TCL_GLOBAL_ONLY); + Tcl_SetVar2(interp, "tcl_patchLevel", NULL, TCL_PATCH_LEVEL, TCL_GLOBAL_ONLY); + Tcl_SetVar2(interp, "tcl_version", NULL, TCL_VERSION, TCL_GLOBAL_ONLY); Tcl_TraceVar2(interp, "tcl_precision", NULL, TCL_GLOBAL_ONLY|TCL_TRACE_READS|TCL_TRACE_WRITES|TCL_TRACE_UNSETS, TclPrecTraceProc, NULL); @@ -6848,7 +6848,7 @@ Tcl_VarEvalVA( Tcl_DStringAppend(&buf, string, -1); } - result = Tcl_Eval(interp, Tcl_DStringValue(&buf)); + result = Tcl_EvalEx(interp, Tcl_DStringValue(&buf), -1, 0); Tcl_DStringFree(&buf); return result; } @@ -6918,7 +6918,7 @@ Tcl_GlobalEval( savedVarFramePtr = iPtr->varFramePtr; iPtr->varFramePtr = iPtr->rootFramePtr; - result = Tcl_Eval(interp, command); + result = Tcl_EvalEx(interp, command, -1, 0); iPtr->varFramePtr = savedVarFramePtr; return result; } diff --git a/generic/tclCmdIL.c b/generic/tclCmdIL.c index c93e593..4cb81ea 100644 --- a/generic/tclCmdIL.c +++ b/generic/tclCmdIL.c @@ -1678,7 +1678,7 @@ InfoLibraryCmd( return TCL_ERROR; } - libDirName = Tcl_GetVar(interp, "tcl_library", TCL_GLOBAL_ONLY); + libDirName = Tcl_GetVar2(interp, "tcl_library", NULL, TCL_GLOBAL_ONLY); if (libDirName != NULL) { Tcl_SetObjResult(interp, Tcl_NewStringObj(libDirName, -1)); return TCL_OK; @@ -1804,7 +1804,7 @@ InfoPatchLevelCmd( return TCL_ERROR; } - patchlevel = Tcl_GetVar(interp, "tcl_patchLevel", + patchlevel = Tcl_GetVar2(interp, "tcl_patchLevel", NULL, (TCL_GLOBAL_ONLY | TCL_LEAVE_ERR_MSG)); if (patchlevel != NULL) { Tcl_SetObjResult(interp, Tcl_NewStringObj(patchlevel, -1)); diff --git a/generic/tclIOSock.c b/generic/tclIOSock.c index c5b7d28..f61073b 100644 --- a/generic/tclIOSock.c +++ b/generic/tclIOSock.c @@ -197,7 +197,7 @@ TclCreateSocketAddress( */ if (interp != NULL) { - family = Tcl_GetVar(interp, "::tcl::unsupported::socketAF", 0); + family = Tcl_GetVar2(interp, "::tcl::unsupported::socketAF", NULL, 0); if (family != NULL) { if (strcmp(family, "inet") == 0) { hints.ai_family = AF_INET; diff --git a/generic/tclInterp.c b/generic/tclInterp.c index 66ce1e0..c281d6d 100644 --- a/generic/tclInterp.c +++ b/generic/tclInterp.c @@ -336,7 +336,7 @@ Tcl_Init( Tcl_Interp *interp) /* Interpreter to initialize. */ { if (tclPreInitScript != NULL) { - if (Tcl_Eval(interp, tclPreInitScript) == TCL_ERROR) { + if (Tcl_EvalEx(interp, tclPreInitScript, -1, 0) == TCL_ERROR) { return TCL_ERROR; } } @@ -382,7 +382,7 @@ Tcl_Init( * alternate tclInit command before calling Tcl_Init(). */ - return Tcl_Eval(interp, + return Tcl_EvalEx(interp, "if {[namespace which -command tclInit] eq \"\"} {\n" " proc tclInit {} {\n" " global tcl_libPath tcl_library env tclDefaultLibrary\n" @@ -444,7 +444,7 @@ Tcl_Init( " error $msg\n" " }\n" "}\n" -"tclInit"); +"tclInit", -1, 0); } /* @@ -2368,7 +2368,7 @@ SlaveCreate( SlaveObjCmd, NRSlaveCmd, slaveInterp, SlaveObjCmdDeleteProc); Tcl_InitHashTable(&slavePtr->aliasTable, TCL_STRING_KEYS); Tcl_SetHashValue(hPtr, slavePtr); - Tcl_SetVar(slaveInterp, "tcl_interactive", "0", TCL_GLOBAL_ONLY); + Tcl_SetVar2(slaveInterp, "tcl_interactive", NULL, "0", TCL_GLOBAL_ONLY); /* * Inherit the recursion limit. @@ -3195,8 +3195,8 @@ Tcl_MakeSafe( * Assume these functions all work. [Bug 2895741] */ - (void) Tcl_Eval(interp, - "namespace eval ::tcl {namespace eval mathfunc {}}"); + (void) Tcl_EvalEx(interp, + "namespace eval ::tcl {namespace eval mathfunc {}}", -1, 0); (void) Tcl_CreateAlias(interp, "::tcl::mathfunc::min", master, "::tcl::mathfunc::min", 0, NULL); (void) Tcl_CreateAlias(interp, "::tcl::mathfunc::max", master, diff --git a/generic/tclMain.c b/generic/tclMain.c index 927de7e..de7e29e 100644 --- a/generic/tclMain.c +++ b/generic/tclMain.c @@ -246,7 +246,7 @@ Tcl_SourceRCFile( const char *fileName; Tcl_Channel chan; - fileName = Tcl_GetVar(interp, "tcl_rcFileName", TCL_GLOBAL_ONLY); + fileName = Tcl_GetVar2(interp, "tcl_rcFileName", NULL, TCL_GLOBAL_ONLY); if (fileName != NULL) { Tcl_Channel c; const char *fullName; @@ -266,14 +266,16 @@ Tcl_SourceRCFile( c = Tcl_OpenFileChannel(NULL, fullName, "r", 0); if (c != NULL) { + Tcl_Obj *fullNameObj = Tcl_NewStringObj(fullName, -1); Tcl_Close(NULL, c); - if (Tcl_EvalFile(interp, fullName) != TCL_OK) { + if (Tcl_FSEvalFile(interp, fullNameObj) != TCL_OK) { chan = Tcl_GetStdChannel(TCL_STDERR); if (chan) { Tcl_WriteObj(chan, Tcl_GetObjResult(interp)); Tcl_WriteChars(chan, "\n", 1); } } + Tcl_DecrRefCount(fullNameObj); } } Tcl_DStringFree(&temp); diff --git a/generic/tclOO.c b/generic/tclOO.c index 0454bfe..9dae778 100644 --- a/generic/tclOO.c +++ b/generic/tclOO.c @@ -269,7 +269,7 @@ TclOOInit( * to be fully provided. */ - if (Tcl_Eval(interp, initScript) != TCL_OK) { + if (Tcl_EvalEx(interp, initScript, -1, 0) != TCL_OK) { return TCL_ERROR; } @@ -463,7 +463,7 @@ InitFoundation( if (TclOODefineSlots(fPtr) != TCL_OK) { return TCL_ERROR; } - return Tcl_Eval(interp, slotScript); + return Tcl_EvalEx(interp, slotScript, -1, 0); } /* diff --git a/generic/tclParse.c b/generic/tclParse.c index 568024b..5577e87 100644 --- a/generic/tclParse.c +++ b/generic/tclParse.c @@ -1022,7 +1022,7 @@ ParseComment( if (parsePtr->commentStart == NULL) { parsePtr->commentStart = p; } - + p++; numBytes--; while (numBytes) { diff --git a/generic/tclTest.c b/generic/tclTest.c index 7c30d36..8290582 100644 --- a/generic/tclTest.c +++ b/generic/tclTest.c @@ -1294,7 +1294,7 @@ TestcmdtraceCmd( cmdTrace = Tcl_CreateObjTrace(interp, 50000, TCL_ALLOW_INLINE_COMPILATION, ObjTraceProc, (ClientData) &deleteCalled, ObjTraceDeleteProc); - result = Tcl_Eval(interp, argv[2]); + result = Tcl_EvalEx(interp, argv[2], -1, 0); Tcl_DeleteTrace(interp, cmdTrace); if (!deleteCalled) { Tcl_SetResult(interp, "Delete wasn't called", TCL_STATIC); @@ -1308,7 +1308,7 @@ TestcmdtraceCmd( Tcl_DStringInit(&buffer); t1 = Tcl_CreateTrace(interp, 1, CmdTraceProc, &buffer); t2 = Tcl_CreateTrace(interp, 50000, CmdTraceProc, &buffer); - result = Tcl_Eval(interp, argv[2]); + result = Tcl_EvalEx(interp, argv[2], -1, 0); if (result == TCL_OK) { Tcl_ResetResult(interp); Tcl_AppendResult(interp, Tcl_DStringValue(&buffer), NULL); @@ -1637,7 +1637,7 @@ DelDeleteProc( { DelCmd *dPtr = clientData; - Tcl_Eval(dPtr->interp, dPtr->deleteCmd); + Tcl_EvalEx(dPtr->interp, dPtr->deleteCmd, -1, 0); Tcl_ResetResult(dPtr->interp); ckfree(dPtr->deleteCmd); ckfree(dPtr); @@ -3972,7 +3972,7 @@ TestregexpObjCmd( varName = Tcl_GetString(objv[2]); TclRegExpRangeUniChar(regExpr, -1, &start, &end); sprintf(resinfo, "%d %d", start, end-1); - value = Tcl_SetVar(interp, varName, resinfo, 0); + value = Tcl_SetVar2(interp, varName, NULL, resinfo, 0); if (value == NULL) { Tcl_AppendResult(interp, "couldn't set variable \"", varName, "\"", NULL); @@ -3986,7 +3986,7 @@ TestregexpObjCmd( Tcl_RegExpGetInfo(regExpr, &info); varName = Tcl_GetString(objv[2]); sprintf(resinfo, "%ld", info.extendStart); - value = Tcl_SetVar(interp, varName, resinfo, 0); + value = Tcl_SetVar2(interp, varName, NULL, resinfo, 0); if (value == NULL) { Tcl_AppendResult(interp, "couldn't set variable \"", varName, "\"", NULL); @@ -4329,7 +4329,7 @@ StaticInitProc( Tcl_Interp *interp) /* Interpreter in which package is supposedly * being loaded. */ { - Tcl_SetVar(interp, "x", "loaded", TCL_GLOBAL_ONLY); + Tcl_SetVar2(interp, "x", NULL, "loaded", TCL_GLOBAL_ONLY); return TCL_OK; } @@ -4413,7 +4413,7 @@ TestupvarCmd( } else if (strcmp(argv[4], "namespace") == 0) { flags = TCL_NAMESPACE_ONLY; } - return Tcl_UpVar(interp, argv[1], argv[2], argv[3], flags); + return Tcl_UpVar2(interp, argv[1], argv[2], NULL, argv[3], flags); } else { if (strcmp(argv[5], "global") == 0) { flags = TCL_GLOBAL_ONLY; @@ -4907,10 +4907,10 @@ GetTimesObjCmd( timePer/100000); /* Tcl_SetVar 100000 times */ - fprintf(stderr, "Tcl_SetVar of \"12345\" 100000 times\n"); + fprintf(stderr, "Tcl_SetVar2 of \"12345\" 100000 times\n"); Tcl_GetTime(&start); for (i = 0; i < 100000; i++) { - s = Tcl_SetVar(interp, "a", "12345", TCL_LEAVE_ERR_MSG); + s = Tcl_SetVar2(interp, "a", NULL, "12345", TCL_LEAVE_ERR_MSG); if (s == NULL) { return TCL_ERROR; } @@ -4924,7 +4924,7 @@ GetTimesObjCmd( fprintf(stderr, "Tcl_GetVar of a==\"12345\" 100000 times\n"); Tcl_GetTime(&start); for (i = 0; i < 100000; i++) { - s = Tcl_GetVar(interp, "a", TCL_LEAVE_ERR_MSG); + s = Tcl_GetVar2(interp, "a", NULL, TCL_LEAVE_ERR_MSG); if (s == NULL) { return TCL_ERROR; } @@ -5194,7 +5194,7 @@ TestsaveresultCmd( if (((enum options) index) == RESULT_OBJECT) { result = Tcl_EvalObjEx(interp, objv[2], 0); } else { - result = Tcl_Eval(interp, Tcl_GetString(objv[2])); + result = Tcl_EvalEx(interp, Tcl_GetString(objv[2]), -1, 0); } if (discard) { @@ -6297,7 +6297,7 @@ TestReport( savedResult = Tcl_GetObjResult(interp); Tcl_IncrRefCount(savedResult); Tcl_SetObjResult(interp, Tcl_NewObj()); - Tcl_Eval(interp, Tcl_DStringValue(&ds)); + Tcl_EvalEx(interp, Tcl_DStringValue(&ds), -1, 0); Tcl_DStringFree(&ds); Tcl_ResetResult(interp); Tcl_SetObjResult(interp, savedResult); diff --git a/generic/tclThreadTest.c b/generic/tclThreadTest.c index 9c66313..1a05f80 100644 --- a/generic/tclThreadTest.c +++ b/generic/tclThreadTest.c @@ -657,7 +657,7 @@ ThreadErrorProc( sprintf(buf, "%" TCL_LL_MODIFIER "d", (Tcl_WideInt)(size_t)Tcl_GetCurrentThread()); - errorInfo = Tcl_GetVar(interp, "errorInfo", TCL_GLOBAL_ONLY); + errorInfo = Tcl_GetVar2(interp, "errorInfo", NULL, TCL_GLOBAL_ONLY); if (errorProcString == NULL) { errChannel = Tcl_GetStdChannel(TCL_STDERR); Tcl_WriteChars(errChannel, "Error from thread ", -1); @@ -1032,8 +1032,8 @@ ThreadEventProc( code = Tcl_EvalEx(interp, threadEventPtr->script,-1,TCL_EVAL_GLOBAL); Tcl_DeleteThreadExitHandler(ThreadFreeProc, threadEventPtr->script); if (code != TCL_OK) { - errorCode = Tcl_GetVar(interp, "errorCode", TCL_GLOBAL_ONLY); - errorInfo = Tcl_GetVar(interp, "errorInfo", TCL_GLOBAL_ONLY); + errorCode = Tcl_GetVar2(interp, "errorCode", NULL, TCL_GLOBAL_ONLY); + errorInfo = Tcl_GetVar2(interp, "errorInfo", NULL, TCL_GLOBAL_ONLY); } else { errorCode = errorInfo = NULL; } diff --git a/tests/event.test b/tests/event.test index 207c799..ef0947f 100644 --- a/tests/event.test +++ b/tests/event.test @@ -595,16 +595,16 @@ test event-11.7 {Bug 16828b3744} { test event-11.8 {Bug 16828b3744} -setup { oo::class create A { variable continue - + method start {} { after idle [self] destroy - + set continue 0 vwait [namespace current]::continue } destructor { set continue 1 - } + } } } -body { [A new] start diff --git a/unix/dltest/pkgua.c b/unix/dltest/pkgua.c index 417bedb..5de0101 100644 --- a/unix/dltest/pkgua.c +++ b/unix/dltest/pkgua.c @@ -224,7 +224,7 @@ Pkgua_Init( return code; } - Tcl_SetVar(interp, "::pkgua_loaded", ".", TCL_APPEND_VALUE); + Tcl_SetVar2(interp, "::pkgua_loaded", NULL, ".", TCL_APPEND_VALUE); cmdTokens = PkguaInterpToTokens(interp); cmdTokens[cmdIndex++] = @@ -299,7 +299,7 @@ Pkgua_Unload( PkguaDeleteTokens(interp); - Tcl_SetVar(interp, "::pkgua_detached", ".", TCL_APPEND_VALUE); + Tcl_SetVar2(interp, "::pkgua_detached", NULL, ".", TCL_APPEND_VALUE); if (flags == TCL_UNLOAD_DETACH_FROM_PROCESS) { /* @@ -309,7 +309,7 @@ Pkgua_Unload( */ PkguaFreeTokensHashTable(); - Tcl_SetVar(interp, "::pkgua_unloaded", ".", TCL_APPEND_VALUE); + Tcl_SetVar2(interp, "::pkgua_unloaded", NULL, ".", TCL_APPEND_VALUE); } return TCL_OK; } diff --git a/unix/tclUnixInit.c b/unix/tclUnixInit.c index 5fc0035..71b20e3 100644 --- a/unix/tclUnixInit.c +++ b/unix/tclUnixInit.c @@ -780,7 +780,7 @@ TclpSetVariables( if (!Tcl_CreateNamespace(interp, "::tcl::mac", NULL, NULL)) { Tcl_ResetResult(interp); } - Tcl_SetVar(interp, "::tcl::mac::locale", loc, TCL_GLOBAL_ONLY); + Tcl_SetVar2(interp, "::tcl::mac::locale", NULL, loc, TCL_GLOBAL_ONLY); } } CFRelease(localeRef); @@ -791,9 +791,9 @@ TclpSetVariables( const char *str; CFBundleRef bundleRef; - Tcl_SetVar(interp, "tclDefaultLibrary", tclLibPath, TCL_GLOBAL_ONLY); - Tcl_SetVar(interp, "tcl_pkgPath", tclLibPath, TCL_GLOBAL_ONLY); - Tcl_SetVar(interp, "tcl_pkgPath", " ", + Tcl_SetVar2(interp, "tclDefaultLibrary", NULL, tclLibPath, TCL_GLOBAL_ONLY); + Tcl_SetVar2(interp, "tcl_pkgPath", NULL, tclLibPath, TCL_GLOBAL_ONLY); + Tcl_SetVar2(interp, "tcl_pkgPath", NULL, " ", TCL_GLOBAL_ONLY | TCL_APPEND_VALUE); str = TclGetEnv("DYLD_FRAMEWORK_PATH", &ds); @@ -809,9 +809,9 @@ TclpSetVariables( *p = ' '; } } while (*p++); - Tcl_SetVar(interp, "tcl_pkgPath", Tcl_DStringValue(&ds), + Tcl_SetVar2(interp, "tcl_pkgPath", NULL, Tcl_DStringValue(&ds), TCL_GLOBAL_ONLY | TCL_APPEND_VALUE); - Tcl_SetVar(interp, "tcl_pkgPath", " ", + Tcl_SetVar2(interp, "tcl_pkgPath", NULL, " ", TCL_GLOBAL_ONLY | TCL_APPEND_VALUE); Tcl_DStringFree(&ds); } @@ -826,9 +826,9 @@ TclpSetVariables( (unsigned char*) tclLibPath, MAXPATHLEN) && ! TclOSstat(tclLibPath, &statBuf) && S_ISDIR(statBuf.st_mode)) { - Tcl_SetVar(interp, "tcl_pkgPath", tclLibPath, + Tcl_SetVar2(interp, "tcl_pkgPath", NULL, tclLibPath, TCL_GLOBAL_ONLY | TCL_APPEND_VALUE); - Tcl_SetVar(interp, "tcl_pkgPath", " ", + Tcl_SetVar2(interp, "tcl_pkgPath", NULL, " ", TCL_GLOBAL_ONLY | TCL_APPEND_VALUE); } CFRelease(frameworksURL); @@ -839,20 +839,20 @@ TclpSetVariables( (unsigned char*) tclLibPath, MAXPATHLEN) && ! TclOSstat(tclLibPath, &statBuf) && S_ISDIR(statBuf.st_mode)) { - Tcl_SetVar(interp, "tcl_pkgPath", tclLibPath, + Tcl_SetVar2(interp, "tcl_pkgPath", NULL, tclLibPath, TCL_GLOBAL_ONLY | TCL_APPEND_VALUE); - Tcl_SetVar(interp, "tcl_pkgPath", " ", + Tcl_SetVar2(interp, "tcl_pkgPath", NULL, " ", TCL_GLOBAL_ONLY | TCL_APPEND_VALUE); } CFRelease(frameworksURL); } } - Tcl_SetVar(interp, "tcl_pkgPath", pkgPath, + Tcl_SetVar2(interp, "tcl_pkgPath", NULL, pkgPath, TCL_GLOBAL_ONLY | TCL_APPEND_VALUE); } else #endif /* HAVE_COREFOUNDATION */ { - Tcl_SetVar(interp, "tcl_pkgPath", pkgPath, TCL_GLOBAL_ONLY); + Tcl_SetVar2(interp, "tcl_pkgPath", NULL, pkgPath, TCL_GLOBAL_ONLY); } #ifdef DJGPP diff --git a/unix/tclUnixSock.c b/unix/tclUnixSock.c index 9c5cd4b..8167077 100644 --- a/unix/tclUnixSock.c +++ b/unix/tclUnixSock.c @@ -735,7 +735,7 @@ TcpHostPortList( #endif /* NEED_FAKE_RFC2553 */ } /* Check if reverse DNS has been switched off globally */ - if (interp != NULL && Tcl_GetVar(interp, SUPPRESS_RDNS_VAR, 0) != NULL) { + if (interp != NULL && Tcl_GetVar2(interp, SUPPRESS_RDNS_VAR, NULL, 0) != NULL) { flags |= NI_NUMERICHOST; } if (getnameinfo(&addr.sa, salen, host, sizeof(host), NULL, 0, flags) == 0) { diff --git a/win/tclWinSock.c b/win/tclWinSock.c index cc77afe..4690708 100644 --- a/win/tclWinSock.c +++ b/win/tclWinSock.c @@ -1319,7 +1319,7 @@ TcpGetOptionProc( return TCL_OK; } - if (interp != NULL && Tcl_GetVar(interp, SUPPRESS_RDNS_VAR, 0) != NULL) { + if (interp != NULL && Tcl_GetVar2(interp, SUPPRESS_RDNS_VAR, NULL, 0) != NULL) { reverseDNS = NI_NUMERICHOST; } -- cgit v0.12 From bbccbfba7b9080ce0a137da9100b3ee550cdea41 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Wed, 29 Jun 2016 15:28:36 +0000 Subject: Eliminate internal use of TCL_STORAGE_CLASS, as it will be gone in 9.0 anyway --- generic/tclTest.c | 12 ++---------- macosx/README | 6 +++--- unix/dltest/pkga.c | 10 +--------- unix/dltest/pkgc.c | 12 ++---------- unix/dltest/pkgd.c | 12 ++---------- unix/dltest/pkge.c | 11 +---------- unix/dltest/pkgua.c | 16 ++++------------ win/tclWinDde.c | 27 +++++++-------------------- 8 files changed, 22 insertions(+), 84 deletions(-) diff --git a/generic/tclTest.c b/generic/tclTest.c index 8290582..33eaadd 100644 --- a/generic/tclTest.c +++ b/generic/tclTest.c @@ -42,16 +42,8 @@ * Declare external functions used in Windows tests. */ -/* - * TCL_STORAGE_CLASS is set unconditionally to DLLEXPORT because the - * Tcltest_Init declaration is in the source file itself, which is only - * accessed when we are building a library. - */ - -#undef TCL_STORAGE_CLASS -#define TCL_STORAGE_CLASS DLLEXPORT -EXTERN int Tcltest_Init(Tcl_Interp *interp); -EXTERN int Tcltest_SafeInit(Tcl_Interp *interp); +DLLEXPORT int Tcltest_Init(Tcl_Interp *interp); +DLLEXPORT int Tcltest_SafeInit(Tcl_Interp *interp); /* * Dynamic string shared by TestdcallCmd and DelCallbackProc; used to collect diff --git a/macosx/README b/macosx/README index bcffde3..551a18e 100644 --- a/macosx/README +++ b/macosx/README @@ -113,7 +113,7 @@ The following build configurations are available: The Xcode projects refer to the toplevel tcl source directory via the TCL_SRCROOT user build setting, by default this is set to the project-relative path '../../tcl', if your tcl source directory is named differently, e.g. -'../../tcl8.6', you need to manually change the TCL_SRCROOT setting by editing +'../../tcl8.7', you need to manually change the TCL_SRCROOT setting by editing your ${USER}.pbxuser file (located inside the Tcl.xcodeproj bundle directory) with a text editor. @@ -141,9 +141,9 @@ Detailed Instructions for building with macosx/GNUmakefile - Unpack the Tcl source release archive. - The following instructions assume the Tcl source tree is named "tcl${ver}", -(where ${ver} is a shell variable containing the Tcl version number e.g. '8.6'). +(where ${ver} is a shell variable containing the Tcl version number e.g. '8.7'). Setup this shell variable as follows: - ver="8.6" + ver="8.7" If you are building from CVS, omit this step (CVS source tree names usually do not contain a version number). diff --git a/unix/dltest/pkga.c b/unix/dltest/pkga.c index c4d3f32..2aee1b8 100644 --- a/unix/dltest/pkga.c +++ b/unix/dltest/pkga.c @@ -14,14 +14,6 @@ #include "tcl.h" /* - * TCL_STORAGE_CLASS is set unconditionally to DLLEXPORT because the - * Pkga_Init declaration is in the source file itself, which is only - * accessed when we are building a library. - */ -#undef TCL_STORAGE_CLASS -#define TCL_STORAGE_CLASS DLLEXPORT - -/* * Prototypes for procedures defined later in this file: */ @@ -124,7 +116,7 @@ Pkga_QuoteObjCmd( *---------------------------------------------------------------------- */ -EXTERN int +DLLEXPORT int Pkga_Init( Tcl_Interp *interp) /* Interpreter in which the package is to be * made available. */ diff --git a/unix/dltest/pkgc.c b/unix/dltest/pkgc.c index 557f21b..48e4d2a 100644 --- a/unix/dltest/pkgc.c +++ b/unix/dltest/pkgc.c @@ -15,14 +15,6 @@ #include "tcl.h" /* - * TCL_STORAGE_CLASS is set unconditionally to DLLEXPORT because the - * Pkgc_Init declaration is in the source file itself, which is only - * accessed when we are building a library. - */ -#undef TCL_STORAGE_CLASS -#define TCL_STORAGE_CLASS DLLEXPORT - -/* * Prototypes for procedures defined later in this file: */ @@ -114,7 +106,7 @@ Pkgc_UnsafeObjCmd( *---------------------------------------------------------------------- */ -EXTERN int +DLLEXPORT int Pkgc_Init( Tcl_Interp *interp) /* Interpreter in which the package is to be * made available. */ @@ -151,7 +143,7 @@ Pkgc_Init( *---------------------------------------------------------------------- */ -EXTERN int +DLLEXPORT int Pkgc_SafeInit( Tcl_Interp *interp) /* Interpreter in which the package is to be * made available. */ diff --git a/unix/dltest/pkgd.c b/unix/dltest/pkgd.c index 6e114e9..df7bbc9 100644 --- a/unix/dltest/pkgd.c +++ b/unix/dltest/pkgd.c @@ -15,14 +15,6 @@ #include "tcl.h" /* - * TCL_STORAGE_CLASS is set unconditionally to DLLEXPORT because the - * Pkgd_Init declaration is in the source file itself, which is only - * accessed when we are building a library. - */ -#undef TCL_STORAGE_CLASS -#define TCL_STORAGE_CLASS DLLEXPORT - -/* * Prototypes for procedures defined later in this file: */ @@ -114,7 +106,7 @@ Pkgd_UnsafeObjCmd( *---------------------------------------------------------------------- */ -EXTERN int +DLLEXPORT int Pkgd_Init( Tcl_Interp *interp) /* Interpreter in which the package is to be * made available. */ @@ -151,7 +143,7 @@ Pkgd_Init( *---------------------------------------------------------------------- */ -EXTERN int +DLLEXPORT int Pkgd_SafeInit( Tcl_Interp *interp) /* Interpreter in which the package is to be * made available. */ diff --git a/unix/dltest/pkge.c b/unix/dltest/pkge.c index 395cd0e..7160d90 100644 --- a/unix/dltest/pkge.c +++ b/unix/dltest/pkge.c @@ -13,15 +13,6 @@ #undef STATIC_BUILD #include "tcl.h" - -/* - * TCL_STORAGE_CLASS is set unconditionally to DLLEXPORT because the - * Pkge_Init declaration is in the source file itself, which is only - * accessed when we are building a library. - */ -#undef TCL_STORAGE_CLASS -#define TCL_STORAGE_CLASS DLLEXPORT - /* *---------------------------------------------------------------------- @@ -40,7 +31,7 @@ *---------------------------------------------------------------------- */ -EXTERN int +DLLEXPORT int Pkge_Init( Tcl_Interp *interp) /* Interpreter in which the package is to be * made available. */ diff --git a/unix/dltest/pkgua.c b/unix/dltest/pkgua.c index 5de0101..6d95640 100644 --- a/unix/dltest/pkgua.c +++ b/unix/dltest/pkgua.c @@ -15,14 +15,6 @@ #include "tcl.h" /* - * TCL_STORAGE_CLASS is set unconditionally to DLLEXPORT because the - * Pkgua_Init declaration is in the source file itself, which is only - * accessed when we are building a library. - */ -#undef TCL_STORAGE_CLASS -#define TCL_STORAGE_CLASS DLLEXPORT - -/* * Prototypes for procedures defined later in this file: */ @@ -200,7 +192,7 @@ PkguaQuoteObjCmd( *---------------------------------------------------------------------- */ -EXTERN int +DLLEXPORT int Pkgua_Init( Tcl_Interp *interp) /* Interpreter in which the package is to be * made available. */ @@ -253,7 +245,7 @@ Pkgua_Init( *---------------------------------------------------------------------- */ -EXTERN int +DLLEXPORT int Pkgua_SafeInit( Tcl_Interp *interp) /* Interpreter in which the package is to be * made available. */ @@ -278,7 +270,7 @@ Pkgua_SafeInit( *---------------------------------------------------------------------- */ -EXTERN int +DLLEXPORT int Pkgua_Unload( Tcl_Interp *interp, /* Interpreter from which the package is to be * unloaded. */ @@ -331,7 +323,7 @@ Pkgua_Unload( *---------------------------------------------------------------------- */ -EXTERN int +DLLEXPORT int Pkgua_SafeUnload( Tcl_Interp *interp, /* Interpreter from which the package is to be * unloaded. */ diff --git a/win/tclWinDde.c b/win/tclWinDde.c index ce0b413..c852728 100644 --- a/win/tclWinDde.c +++ b/win/tclWinDde.c @@ -34,16 +34,6 @@ #endif /* - * TCL_STORAGE_CLASS is set unconditionally to DLLEXPORT because the Dde_Init - * declaration is in the source file itself, which is only accessed when we - * are building a library. DO NOT MOVE BEFORE ANY #include LINES. ONLY USE - * EXTERN TO INDICATE EXPORTED FUNCTIONS FROM NOW ON. - */ - -#undef TCL_STORAGE_CLASS -#define TCL_STORAGE_CLASS DLLEXPORT - -/* * The following structure is used to keep track of the interpreters * registered by this process. */ @@ -69,13 +59,13 @@ typedef struct Conversation { Tcl_Obj *returnPackagePtr; /* The result package for this conversation. */ } Conversation; -typedef struct DdeEnumServices { +struct DdeEnumServices { Tcl_Interp *interp; int result; ATOM service; ATOM topic; HWND hwnd; -} DdeEnumServices; +}; typedef struct ThreadSpecificData { Conversation *currentConversations; @@ -135,8 +125,8 @@ static int DdeObjCmd(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); -EXTERN int Dde_Init(Tcl_Interp *interp); -EXTERN int Dde_SafeInit(Tcl_Interp *interp); +DLLEXPORT int Dde_Init(Tcl_Interp *interp); +DLLEXPORT int Dde_SafeInit(Tcl_Interp *interp); /* *---------------------------------------------------------------------- @@ -399,7 +389,7 @@ DdeSetServerName( Tcl_DString ds; Tcl_ListObjIndex(interp, srvPtrPtr[n], 1, &namePtr); - Tcl_WinUtfToTChar(Tcl_GetString(namePtr), -1, &ds); + Tcl_WinUtfToTChar(Tcl_GetString(namePtr), -1, &ds); if (_tcscmp(actualName, (TCHAR *)Tcl_DStringValue(&ds)) == 0) { suffix++; Tcl_DStringFree(&ds); @@ -1757,8 +1747,7 @@ DdeObjCmd( objPtr = Tcl_GetVar2Ex(sendInterp, "errorInfo", NULL, TCL_GLOBAL_ONLY); if (objPtr) { - string = Tcl_GetStringFromObj(objPtr, &length); - Tcl_AddObjErrorInfo(interp, string, length); + Tcl_AppendObjToErrorInfo(interp, objPtr); } objPtr = Tcl_GetVar2Ex(sendInterp, "errorCode", NULL, @@ -1853,9 +1842,7 @@ DdeObjCmd( Tcl_DecrRefCount(resultPtr); goto invalidServerResponse; } - length = -1; - string = Tcl_GetStringFromObj(objPtr, &length); - Tcl_AddObjErrorInfo(interp, string, length); + Tcl_AppendObjToErrorInfo(interp, objPtr); Tcl_ListObjIndex(NULL, resultPtr, 2, &objPtr); Tcl_SetObjErrorCode(interp, objPtr); -- cgit v0.12 From 9e0c4021277674c3182c3082c38a5915d872ae0a Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Wed, 29 Jun 2016 15:45:26 +0000 Subject: Remove Tcl_Main() function, since it's no longer being used: It has been a macro already for ages. --- generic/tclMain.c | 23 +++++------------------ 1 file changed, 5 insertions(+), 18 deletions(-) diff --git a/generic/tclMain.c b/generic/tclMain.c index de7e29e..28f8fd8 100644 --- a/generic/tclMain.c +++ b/generic/tclMain.c @@ -112,7 +112,7 @@ typedef enum { PROMPT_CONTINUE /* Print prompt for command continuation */ } PromptType; -typedef struct InteractiveState { +typedef struct { Tcl_Channel input; /* The standard input channel from which lines * are read. */ int tty; /* Non-zero means standard input is a @@ -267,8 +267,10 @@ Tcl_SourceRCFile( c = Tcl_OpenFileChannel(NULL, fullName, "r", 0); if (c != NULL) { Tcl_Obj *fullNameObj = Tcl_NewStringObj(fullName, -1); + Tcl_Close(NULL, c); - if (Tcl_FSEvalFile(interp, fullNameObj) != TCL_OK) { + Tcl_IncrRefCount(fullNameObj); + if (Tcl_FSEvalFileEx(interp, fullNameObj, NULL) != TCL_OK) { chan = Tcl_GetStdChannel(TCL_STDERR); if (chan) { Tcl_WriteObj(chan, Tcl_GetObjResult(interp)); @@ -285,7 +287,7 @@ Tcl_SourceRCFile( /*---------------------------------------------------------------------- * - * Tcl_Main, Tcl_MainEx -- + * Tcl_MainEx -- * * Main program for tclsh and most other Tcl-based applications. * @@ -636,21 +638,6 @@ Tcl_MainEx( Tcl_Exit(exitCode); } - -#if (TCL_MAJOR_VERSION == 8) && !defined(UNICODE) -#undef Tcl_Main -extern DLLEXPORT void -Tcl_Main( - int argc, /* Number of arguments. */ - char **argv, /* Array of argument strings. */ - Tcl_AppInitProc *appInitProc) - /* Application-specific initialization - * function to call after most initialization - * but before starting to execute commands. */ -{ - Tcl_MainEx(argc, argv, appInitProc, Tcl_CreateInterp()); -} -#endif /* TCL_MAJOR_VERSION == 8 && !UNICODE */ #ifndef TCL_ASCII_MAIN -- cgit v0.12 From 26a0c08c0bcf995a69ec76d8061febcc24c650c2 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Thu, 30 Jun 2016 13:16:44 +0000 Subject: Simplify use of "struct" keyword in many places. --- generic/tclStringRep.h | 2 +- generic/tclTimer.c | 2 +- generic/tclTrace.c | 2 +- macosx/tclMacOSXFCmd.c | 2 +- macosx/tclMacOSXNotify.c | 4 ++-- unix/tclUnixChan.c | 4 ++-- unix/tclUnixCompat.c | 2 +- unix/tclUnixInit.c | 2 +- unix/tclUnixNotfy.c | 4 ++-- unix/tclUnixPipe.c | 2 +- unix/tclUnixTest.c | 2 +- unix/tclUnixThrd.c | 8 ++++---- unix/tclUnixTime.c | 2 +- unix/tclXtNotify.c | 2 +- win/tclWinChan.c | 4 ++-- win/tclWinConsole.c | 6 +++--- win/tclWinDde.c | 2 +- win/tclWinNotify.c | 2 +- win/tclWinSerial.c | 4 ++-- win/tclWinThrd.c | 10 +++++----- win/tclWinTime.c | 4 ++-- 21 files changed, 36 insertions(+), 36 deletions(-) diff --git a/generic/tclStringRep.h b/generic/tclStringRep.h index 227e6bc..db6f7e4 100644 --- a/generic/tclStringRep.h +++ b/generic/tclStringRep.h @@ -46,7 +46,7 @@ * tcl.h, but do not do that unless you are sure what you're doing! */ -typedef struct String { +typedef struct { int numChars; /* The number of chars in the string. -1 means * this value has not been calculated. >= 0 * means that there is a valid Unicode rep, or diff --git a/generic/tclTimer.c b/generic/tclTimer.c index c10986a..c83b5f5 100644 --- a/generic/tclTimer.c +++ b/generic/tclTimer.c @@ -91,7 +91,7 @@ typedef struct IdleHandler { * The structure defined below is used in this file only. */ -typedef struct ThreadSpecificData { +typedef struct { TimerHandler *firstTimerHandlerPtr; /* First event in queue. */ int lastTimerId; /* Timer identifier of most recently created * timer. */ diff --git a/generic/tclTrace.c b/generic/tclTrace.c index 4e74c54..33e62b2 100644 --- a/generic/tclTrace.c +++ b/generic/tclTrace.c @@ -143,7 +143,7 @@ static int TraceVarEx(Tcl_Interp *interp, const char *part1, * trace procs */ -typedef struct StringTraceData { +typedef struct { ClientData clientData; /* Client data from Tcl_CreateTrace */ Tcl_CmdTraceProc *proc; /* Trace function from Tcl_CreateTrace */ } StringTraceData; diff --git a/macosx/tclMacOSXFCmd.c b/macosx/tclMacOSXFCmd.c index 8ecfd0b..7c643a3 100644 --- a/macosx/tclMacOSXFCmd.c +++ b/macosx/tclMacOSXFCmd.c @@ -106,7 +106,7 @@ typedef struct finderinfo { u_int32_t extendedFileInfo[4]; } __attribute__ ((__packed__)) finderinfo; -typedef struct fileinfobuf { +typedef struct { u_int32_t info_length; u_int32_t data[8]; } fileinfobuf; diff --git a/macosx/tclMacOSXNotify.c b/macosx/tclMacOSXNotify.c index 9b7bd1a..a7f26b7 100644 --- a/macosx/tclMacOSXNotify.c +++ b/macosx/tclMacOSXNotify.c @@ -217,7 +217,7 @@ typedef struct FileHandler { * handlers are ready to fire. */ -typedef struct FileHandlerEvent { +typedef struct { Tcl_Event header; /* Information that is standard for all * events. */ int fd; /* File descriptor that is ready. Used to find @@ -232,7 +232,7 @@ typedef struct FileHandlerEvent { * writable, and exceptional conditions. */ -typedef struct SelectMasks { +typedef struct { fd_set readable; fd_set writable; fd_set exceptional; diff --git a/unix/tclUnixChan.c b/unix/tclUnixChan.c index b4b2739..6418f48 100644 --- a/unix/tclUnixChan.c +++ b/unix/tclUnixChan.c @@ -61,7 +61,7 @@ * This structure describes per-instance state of a file based channel. */ -typedef struct FileState { +typedef struct { Tcl_Channel channel; /* Channel associated with this file. */ int fd; /* File handle. */ int validMask; /* OR'ed combination of TCL_READABLE, @@ -76,7 +76,7 @@ typedef struct FileState { * a platform-independant manner. */ -typedef struct TtyAttrs { +typedef struct { int baud; int parity; int data; diff --git a/unix/tclUnixCompat.c b/unix/tclUnixCompat.c index 2a68f7f..1247061 100644 --- a/unix/tclUnixCompat.c +++ b/unix/tclUnixCompat.c @@ -49,7 +49,7 @@ #ifdef TCL_THREADS -typedef struct ThreadSpecificData { +typedef struct { struct passwd pwd; #if defined(HAVE_GETPWNAM_R_5) || defined(HAVE_GETPWUID_R_5) #define NEED_PW_CLEANER 1 diff --git a/unix/tclUnixInit.c b/unix/tclUnixInit.c index 71b20e3..aaff9ec 100644 --- a/unix/tclUnixInit.c +++ b/unix/tclUnixInit.c @@ -115,7 +115,7 @@ static char pkgPath[sizeof(TCL_PACKAGE_PATH)+200] = TCL_PACKAGE_PATH; * first list checked for a mapping from env encoding to Tcl encoding name. */ -typedef struct LocaleTable { +typedef struct { const char *lang; const char *encoding; } LocaleTable; diff --git a/unix/tclUnixNotfy.c b/unix/tclUnixNotfy.c index 3422089..9f9301f 100644 --- a/unix/tclUnixNotfy.c +++ b/unix/tclUnixNotfy.c @@ -39,7 +39,7 @@ typedef struct FileHandler { * handlers are ready to fire. */ -typedef struct FileHandlerEvent { +typedef struct { Tcl_Event header; /* Information that is standard for all * events. */ int fd; /* File descriptor that is ready. Used to find @@ -54,7 +54,7 @@ typedef struct FileHandlerEvent { * writable, and exception conditions. */ -typedef struct SelectMasks { +typedef struct { fd_set readable; fd_set writable; fd_set exception; diff --git a/unix/tclUnixPipe.c b/unix/tclUnixPipe.c index 8b26694..be7b4eb 100644 --- a/unix/tclUnixPipe.c +++ b/unix/tclUnixPipe.c @@ -30,7 +30,7 @@ * This structure describes per-instance state of a pipe based channel. */ -typedef struct PipeState { +typedef struct { Tcl_Channel channel; /* Channel associated with this file. */ TclFile inFile; /* Output from pipe. */ TclFile outFile; /* Input to pipe. */ diff --git a/unix/tclUnixTest.c b/unix/tclUnixTest.c index c5ac52a..86e0925 100644 --- a/unix/tclUnixTest.c +++ b/unix/tclUnixTest.c @@ -37,7 +37,7 @@ * exercised by the "testfilehandler" command. */ -typedef struct Pipe { +typedef struct { TclFile readFile; /* File handle for reading from the pipe. NULL * means pipe doesn't exist yet. */ TclFile writeFile; /* File handle for writing from the pipe. */ diff --git a/unix/tclUnixThrd.c b/unix/tclUnixThrd.c index cf81850..8f8eb7f 100644 --- a/unix/tclUnixThrd.c +++ b/unix/tclUnixThrd.c @@ -15,7 +15,7 @@ #ifdef TCL_THREADS -typedef struct ThreadSpecificData { +typedef struct { char nabuf[16]; } ThreadSpecificData; @@ -675,7 +675,7 @@ TclpInetNtoa( #ifdef USE_THREAD_ALLOC static pthread_key_t key; -typedef struct allocMutex { +typedef struct { Tcl_Mutex tlock; pthread_mutex_t plock; } allocMutex; @@ -683,10 +683,10 @@ typedef struct allocMutex { Tcl_Mutex * TclpNewAllocMutex(void) { - struct allocMutex *lockPtr; + allocMutex *lockPtr; register pthread_mutex_t *plockPtr; - lockPtr = malloc(sizeof(struct allocMutex)); + lockPtr = malloc(sizeof(allocMutex)); if (lockPtr == NULL) { Tcl_Panic("could not allocate lock"); } diff --git a/unix/tclUnixTime.c b/unix/tclUnixTime.c index 315bcf9..df759d8 100644 --- a/unix/tclUnixTime.c +++ b/unix/tclUnixTime.c @@ -23,7 +23,7 @@ */ static Tcl_ThreadDataKey tmKey; -typedef struct ThreadSpecificData { +typedef struct { struct tm gmtime_buf; struct tm localtime_buf; } ThreadSpecificData; diff --git a/unix/tclXtNotify.c b/unix/tclXtNotify.c index a5d92d6..26db9f2 100644 --- a/unix/tclXtNotify.c +++ b/unix/tclXtNotify.c @@ -42,7 +42,7 @@ typedef struct FileHandler { * handlers are ready to fire. */ -typedef struct FileHandlerEvent { +typedef struct { Tcl_Event header; /* Information that is standard for all * events. */ int fd; /* File descriptor that is ready. Used to find diff --git a/win/tclWinChan.c b/win/tclWinChan.c index 78b510b..7518e3e 100644 --- a/win/tclWinChan.c +++ b/win/tclWinChan.c @@ -43,7 +43,7 @@ typedef struct FileInfo { * pending on the channel. */ } FileInfo; -typedef struct ThreadSpecificData { +typedef struct { /* * List of all file channels currently open. */ @@ -58,7 +58,7 @@ static Tcl_ThreadDataKey dataKey; * events are generated. */ -typedef struct FileEvent { +typedef struct { Tcl_Event header; /* Information that is standard for all * events. */ FileInfo *infoPtr; /* Pointer to file info structure. Note that diff --git a/win/tclWinConsole.c b/win/tclWinConsole.c index ab55035..5ce8a2b 100644 --- a/win/tclWinConsole.c +++ b/win/tclWinConsole.c @@ -49,7 +49,7 @@ TCL_DECLARE_MUTEX(consoleMutex) * threads. */ -typedef struct ConsoleThreadInfo { +typedef struct { HANDLE thread; /* Handle to reader or writer thread. */ HANDLE readyEvent; /* Manual-reset event to signal _to_ the main * thread when the worker thread has finished @@ -112,7 +112,7 @@ typedef struct ConsoleInfo { /* Data consumed by reader thread. */ } ConsoleInfo; -typedef struct ThreadSpecificData { +typedef struct { /* * The following pointer refers to the head of the list of consoles that * are being watched for file events. @@ -128,7 +128,7 @@ static Tcl_ThreadDataKey dataKey; * console events are generated. */ -typedef struct ConsoleEvent { +typedef struct { Tcl_Event header; /* Information that is standard for all * events. */ ConsoleInfo *infoPtr; /* Pointer to console info structure. Note diff --git a/win/tclWinDde.c b/win/tclWinDde.c index c852728..2589630 100644 --- a/win/tclWinDde.c +++ b/win/tclWinDde.c @@ -67,7 +67,7 @@ struct DdeEnumServices { HWND hwnd; }; -typedef struct ThreadSpecificData { +typedef struct { Conversation *currentConversations; /* A list of conversations currently being * processed. */ diff --git a/win/tclWinNotify.c b/win/tclWinNotify.c index 1ad022d..28c8445 100644 --- a/win/tclWinNotify.c +++ b/win/tclWinNotify.c @@ -27,7 +27,7 @@ * created for each thread that is using the notifier. */ -typedef struct ThreadSpecificData { +typedef struct { CRITICAL_SECTION crit; /* Monitor for this notifier. */ DWORD thread; /* Identifier for thread associated with this * notifier. */ diff --git a/win/tclWinSerial.c b/win/tclWinSerial.c index 0730a46..0ce5f4d 100644 --- a/win/tclWinSerial.c +++ b/win/tclWinSerial.c @@ -120,7 +120,7 @@ typedef struct SerialInfo { * [fconfigure -queue] */ } SerialInfo; -typedef struct ThreadSpecificData { +typedef struct { /* * The following pointer refers to the head of the list of serials that * are being watched for file events. @@ -136,7 +136,7 @@ static Tcl_ThreadDataKey dataKey; * events are generated. */ -typedef struct SerialEvent { +typedef struct { Tcl_Event header; /* Information that is standard for all * events. */ SerialInfo *infoPtr; /* Pointer to serial info structure. Note that diff --git a/win/tclWinThrd.c b/win/tclWinThrd.c index dbc5f26..26d745d 100644 --- a/win/tclWinThrd.c +++ b/win/tclWinThrd.c @@ -107,7 +107,7 @@ static Tcl_ThreadDataKey dataKey; * the queue. */ -typedef struct WinCondition { +typedef struct { CRITICAL_SECTION condLock; /* Lock to serialize queuing on the * condition. */ struct ThreadSpecificData *firstPtr; /* Queue pointers */ @@ -121,7 +121,7 @@ typedef struct WinCondition { #ifdef USE_THREAD_ALLOC static DWORD tlsKey; -typedef struct allocMutex { +typedef struct { Tcl_Mutex tlock; CRITICAL_SECTION wlock; } allocMutex; @@ -132,7 +132,7 @@ typedef struct allocMutex { * to TclWinThreadStart. */ -typedef struct WinThread { +typedef struct { LPTHREAD_START_ROUTINE lpStartAddress; /* Original startup routine */ LPVOID lpParameter; /* Original startup data */ unsigned int fpControl; /* Floating point control word from the @@ -940,9 +940,9 @@ TclpFinalizeCondition( Tcl_Mutex * TclpNewAllocMutex(void) { - struct allocMutex *lockPtr; + allocMutex *lockPtr; - lockPtr = malloc(sizeof(struct allocMutex)); + lockPtr = malloc(sizeof(allocMutex)); if (lockPtr == NULL) { Tcl_Panic("could not allocate lock"); } diff --git a/win/tclWinTime.c b/win/tclWinTime.c index 7045c72..7b5c18a 100644 --- a/win/tclWinTime.c +++ b/win/tclWinTime.c @@ -35,7 +35,7 @@ static const int leapDays[] = { -1, 30, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365 }; -typedef struct ThreadSpecificData { +typedef struct { char tzName[64]; /* Time zone name */ struct tm tm; /* time information */ } ThreadSpecificData; @@ -45,7 +45,7 @@ static Tcl_ThreadDataKey dataKey; * Data for managing high-resolution timers. */ -typedef struct TimeInfo { +typedef struct { CRITICAL_SECTION cs; /* Mutex guarding this structure. */ int initialized; /* Flag == 1 if this structure is * initialized. */ -- cgit v0.12 From e0b5fcdb1f044670d0a010d38b4b88fedf16ab0d Mon Sep 17 00:00:00 2001 From: dgp Date: Fri, 1 Jul 2016 12:21:15 +0000 Subject: Use the utility routines to eliminate the last bit of intrusion into the ensembleRewrite area. --- generic/tclProc.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/generic/tclProc.c b/generic/tclProc.c index b663caf..ae9e7cd 100644 --- a/generic/tclProc.c +++ b/generic/tclProc.c @@ -1087,12 +1087,10 @@ ProcWrongNumArgs( if (framePtr->isProcCallFrame & FRAME_IS_LAMBDA) { desiredObjs[0] = Tcl_NewStringObj("lambdaExpr", -1); } else { - ((Interp *) interp)->ensembleRewrite.numInsertedObjs -= skip - 1; - #ifdef AVOID_HACKS_FOR_ITCL desiredObjs[0] = framePtr->objv[skip-1]; #else - desiredObjs[0] = Tcl_NewListObj(skip, framePtr->objv); + desiredObjs[0] = Tcl_NewListObj(1, framePtr->objv + skip - 1); #endif /* AVOID_HACKS_FOR_ITCL */ } Tcl_IncrRefCount(desiredObjs[0]); @@ -1527,6 +1525,10 @@ InitArgsAndLocals( */ incorrectArgs: + if ((skip != 1) && + TclInitRewriteEnsemble(interp, skip-1, 0, framePtr->objv)) { + TclNRAddCallback(interp, TclClearRootEnsemble, NULL, NULL, NULL, NULL); + } memset(varPtr, 0, ((framePtr->compiledLocals + localCt)-varPtr) * sizeof(Var)); return ProcWrongNumArgs(interp, skip); @@ -2716,10 +2718,6 @@ TclNRApplyObjCmd( extraPtr->efi.fields[0].clientData = lambdaPtr; extraPtr->cmd.clientData = &extraPtr->efi; - if (TclInitRewriteEnsemble(interp, 1, 0, objv)) { - TclNRAddCallback(interp, TclClearRootEnsemble, NULL, NULL, NULL, NULL); - } - result = TclPushProcCallFrame(procPtr, interp, objc, objv, 1); if (result == TCL_OK) { TclNRAddCallback(interp, ApplyNR2, extraPtr, NULL, NULL, NULL); -- cgit v0.12 From 8c8ec10e78e872ffa4e4edef6ae16e03d5872efc Mon Sep 17 00:00:00 2001 From: dgp Date: Fri, 1 Jul 2016 13:20:37 +0000 Subject: Disable special hacks for Itcl 3 ensemble error message generation. Migration paths are in place to bring this to an end. --- generic/tclInt.h | 13 +++++++++++++ tests/indexObj.test | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/generic/tclInt.h b/generic/tclInt.h index 49a299c..85981d9 100644 --- a/generic/tclInt.h +++ b/generic/tclInt.h @@ -26,6 +26,19 @@ #undef ACCEPT_NAN /* + * In Tcl 8.7, stop supporting special hacks for legacy Itcl 3. + * Itcl 4 doesn't need them. Itcl 3 can be updated to not need them + * using the Tcl(Init|Reset)RewriteEnsemble() routines in all Tcl 8.6+ + * releases. Perhaps Tcl 8.7 will add even better public interfaces + * supporting all the re-invocation mechanisms extensions like Itcl 3 + * need. As an absolute last resort, folks who must make Itcl 3 work + * unchanged with Tcl 8.7 can remove this line to regain the migration + * support. Tcl 9 will no longer offer even that option. + */ + +#define AVOID_HACKS_FOR_ITCL 1 + +/* * Common include files needed by most of the Tcl source files are included * here, so that system-dependent personalizations for the include files only * have to be made in once place. This results in a few extra includes, but diff --git a/tests/indexObj.test b/tests/indexObj.test index 646cb02..126d062 100644 --- a/tests/indexObj.test +++ b/tests/indexObj.test @@ -109,7 +109,7 @@ test indexObj-5.6 {Tcl_WrongNumArgs} testindexobj { } "wrong # args: should be \"mycmd foo\"" # Contrast this with test proc-3.6; they have to be like this because # of [Bug 1066837] so Itcl won't break. -test indexObj-5.7 {Tcl_WrongNumArgs} testindexobj { +test indexObj-5.7 {Tcl_WrongNumArgs} {testindexobj obsolete} { testwrongnumargs 2 "fee fi" "fo fum" foo bar } "wrong # args: should be \"fo fum foo fee fi\"" -- cgit v0.12 From cb26a29db0b87479d3d6ff6b60448c60f029e547 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Fri, 1 Jul 2016 13:32:19 +0000 Subject: Use same internal representation for unicode strings in test-cases than in reality, in order to prevent surprises. --- generic/tclTestObj.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/generic/tclTestObj.c b/generic/tclTestObj.c index f36b07f..a637498 100644 --- a/generic/tclTestObj.c +++ b/generic/tclTestObj.c @@ -19,6 +19,7 @@ #endif #include "tclInt.h" #include "tommath.h" +#include "tclStringRep.h" /* @@ -46,13 +47,6 @@ static int TestobjCmd(ClientData dummy, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); static int TeststringobjCmd(ClientData dummy, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); - -typedef struct TestString { - int numChars; - int allocated; - int maxChars; - Tcl_UniChar unicode[2]; -} TestString; #define VARPTR_KEY "TCLOBJTEST_VARPTR" #define NUMBER_OF_OBJECT_VARS 20 @@ -1141,7 +1135,7 @@ TeststringobjCmd( int varIndex, option, i, length; #define MAX_STRINGS 11 const char *index, *string, *strings[MAX_STRINGS+1]; - TestString *strPtr; + String *strPtr; Tcl_Obj **varPtr; static const char *const options[] = { "append", "appendstrings", "get", "get2", "length", "length2", -- cgit v0.12 From dc9d79ca409ce43c255fbf0d12b742bdd795a1f7 Mon Sep 17 00:00:00 2001 From: dgp Date: Fri, 1 Jul 2016 14:08:22 +0000 Subject: Encapsulate the fetching of the ensemble rewrite root, used by [namespace]. --- generic/tclEnsemble.c | 34 ++++++++++++++++++++++++++++++++++ generic/tclInt.h | 2 ++ generic/tclNamesp.c | 19 ++----------------- 3 files changed, 38 insertions(+), 17 deletions(-) diff --git a/generic/tclEnsemble.c b/generic/tclEnsemble.c index fd2fa67..4e06518 100644 --- a/generic/tclEnsemble.c +++ b/generic/tclEnsemble.c @@ -2030,6 +2030,40 @@ TclResetRewriteEnsemble( iPtr->ensembleRewrite.numInsertedObjs = 0; } } +/* + *---------------------------------------------------------------------- + * + * TclFetchEnsembleRoot -- + * + * Returns the root of ensemble rewriting, if any. + * If no root exists, returns objv instead. + * + * Results: + * None. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------- + */ + +Tcl_Obj *const * +TclFetchEnsembleRoot( + Tcl_Interp *interp, + Tcl_Obj *const *objv, + int objc, + int *objcPtr) +{ + Interp *iPtr = (Interp *) interp; + + if (iPtr->ensembleRewrite.sourceObjs) { + *objcPtr = objc + iPtr->ensembleRewrite.numRemovedObjs + - iPtr->ensembleRewrite.numInsertedObjs; + return iPtr->ensembleRewrite.sourceObjs; + } + *objcPtr = objc; + return objv; +} /* * ---------------------------------------------------------------------- diff --git a/generic/tclInt.h b/generic/tclInt.h index a985206..b3cfc00 100644 --- a/generic/tclInt.h +++ b/generic/tclInt.h @@ -2905,6 +2905,8 @@ MODULE_SCOPE char * TclDStringAppendObj(Tcl_DString *dsPtr, MODULE_SCOPE char * TclDStringAppendDString(Tcl_DString *dsPtr, Tcl_DString *toAppendPtr); MODULE_SCOPE Tcl_Obj * TclDStringToObj(Tcl_DString *dsPtr); +MODULE_SCOPE Tcl_Obj *const * TclFetchEnsembleRoot(Tcl_Interp *interp, + Tcl_Obj *const *objv, int objc, int *objcPtr); MODULE_SCOPE void TclFinalizeAllocSubsystem(void); MODULE_SCOPE void TclFinalizeAsync(void); MODULE_SCOPE void TclFinalizeDoubleConversion(void); diff --git a/generic/tclNamesp.c b/generic/tclNamesp.c index 58a86d9..2c50a60 100644 --- a/generic/tclNamesp.c +++ b/generic/tclNamesp.c @@ -3354,14 +3354,7 @@ NRNamespaceEvalCmd( (void) TclPushStackFrame(interp, (Tcl_CallFrame **) framePtrPtr, namespacePtr, /*isProcCallFrame*/ 0); - if (iPtr->ensembleRewrite.sourceObjs == NULL) { - framePtr->objc = objc; - framePtr->objv = objv; - } else { - framePtr->objc = objc + iPtr->ensembleRewrite.numRemovedObjs - - iPtr->ensembleRewrite.numInsertedObjs; - framePtr->objv = iPtr->ensembleRewrite.sourceObjs; - } + framePtr->objv = TclFetchEnsembleRoot(interp, objv, objc, &framePtr->objc); if (objc == 3) { /* @@ -3768,7 +3761,6 @@ NRNamespaceInscopeCmd( { Tcl_Namespace *namespacePtr; CallFrame *framePtr, **framePtrPtr; - register Interp *iPtr = (Interp *) interp; int i; Tcl_Obj *cmdObjPtr; @@ -3794,14 +3786,7 @@ NRNamespaceInscopeCmd( (void) TclPushStackFrame(interp, (Tcl_CallFrame **) framePtrPtr, namespacePtr, /*isProcCallFrame*/ 0); - if (iPtr->ensembleRewrite.sourceObjs == NULL) { - framePtr->objc = objc; - framePtr->objv = objv; - } else { - framePtr->objc = objc + iPtr->ensembleRewrite.numRemovedObjs - - iPtr->ensembleRewrite.numInsertedObjs; - framePtr->objv = iPtr->ensembleRewrite.sourceObjs; - } + framePtr->objv = TclFetchEnsembleRoot(interp, objv, objc, &framePtr->objc); /* * Execute the command. If there is just one argument, just treat it as a -- cgit v0.12 From 064cf7ed1232f4b7eb6cea4be782bdd6d77e1c49 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Fri, 1 Jul 2016 14:11:38 +0000 Subject: Make test-case "for.test" pass, regardless of end-of-line spacing --- tests/for.test | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/tests/for.test b/tests/for.test index 8e701d6..c8a8187 100644 --- a/tests/for.test +++ b/tests/for.test @@ -451,7 +451,7 @@ proc formatMail {} { set c [string length $line] } } - set newline [string range $line 0 $c] + set newline [string trimright [string range $line 0 $c]] if {! $continuation} { append result $newline $NL } else { @@ -507,7 +507,7 @@ releases of the Tcl scripting language and the Tk toolk it. The first beta versions of these releases were released on August 30, 1996. These releas es contain only minor changes, -so we hope to have only a single beta release and to +so we hope to have only a single beta release and to go final in early October, 1996. @@ -519,34 +519,34 @@ and changes files in the distributions for more complet e information on what has changed, including both feature changes and bug fixes. - There are new options to the file command for + There are new options to the file command for copying files (file copy), - deleting files and directories (file delete), + deleting files and directories (file delete), creating directories (file mkdir), and renaming files (file rename). The implementation of exec has been improved great ly for Windows 95 and Windows NT. - There is a new memory allocator for the Macintosh + There is a new memory allocator for the Macintosh version, which should be more efficient than the old one. - Tk's grid geometry manager has been completely + Tk's grid geometry manager has been completely rewritten. The layout algorithm produces much better layouts than before , especially where rows or columns were stretchable. - There are new commands for creating common dialog + There are new commands for creating common dialog boxes: tk_chooseColor, tk_getOpenFile, tk_getSaveFile and - tk_messageBox. These use native dialog boxes if + tk_messageBox. These use native dialog boxes if they are available. There is a new virtual event mechanism for handlin g events in a more portable - way. See the new command event. It also allows + way. See the new command event. It also allows events (both physical and virtual) to be generated dynamically. -Tcl 7.6 and Tk 4.2 are backwards-compatible with Tcl +Tcl 7.6 and Tk 4.2 are backwards-compatible with Tcl 7.5 and Tk 4.1 except for changes in the C APIs for custom channel drivers. Scrip ts written for earlier releases @@ -556,27 +556,27 @@ Obtaining The Releases Binary Releases -Pre-compiled releases are available for the following +Pre-compiled releases are available for the following platforms: Windows 3.1, Windows 95, and Windows NT: Fetch - ftp://ftp.sunlabs.com/pub/tcl/win42b1.exe, then + ftp://ftp.sunlabs.com/pub/tcl/win42b1.exe, then execute it. The file is a - self-extracting executable. It will install the + self-extracting executable. It will install the Tcl and Tk libraries, the wish and tclsh programs, and documentation. Macintosh (both 68K and PowerPC): Fetch - ftp://ftp.sunlabs.com/pub/tcl/mactk4.2b1.sea.hqx. + ftp://ftp.sunlabs.com/pub/tcl/mactk4.2b1.sea.hqx. The file is in binhex format, - which is understood by Fetch, StuffIt, and many + which is understood by Fetch, StuffIt, and many other Mac utilities. The - unpacked file is a self-installing executable: + unpacked file is a self-installing executable: double-click on it and it will create a - folder containing all that you need to run Tcl + folder containing all that you need to run Tcl and Tk. - UNIX (Solaris 2.* and SunOS, other systems + UNIX (Solaris 2.* and SunOS, other systems soon to follow). Easy to install - binary packages are now for sale at the Sun Labs + binary packages are now for sale at the Sun Labs Tcl/Tk Shop. Check it out! } -- cgit v0.12 From 9076f328f235876d960fb4d78ecec610ac3e81fd Mon Sep 17 00:00:00 2001 From: dgp Date: Fri, 1 Jul 2016 18:54:36 +0000 Subject: [4402cfa58c] Rework the spell check machinery into something that will not be foiled by value sharing. --- generic/tclEnsemble.c | 186 ++++++++++++++++++++++++++++++++++++++++++++------ generic/tclIndexObj.c | 21 +++--- generic/tclInt.h | 5 +- 3 files changed, 177 insertions(+), 35 deletions(-) diff --git a/generic/tclEnsemble.c b/generic/tclEnsemble.c index 4e06518..75c2747 100644 --- a/generic/tclEnsemble.c +++ b/generic/tclEnsemble.c @@ -30,7 +30,8 @@ static int NsEnsembleStringOrder(const void *strPtr1, const void *strPtr2); static void DeleteEnsembleConfig(ClientData clientData); static void MakeCachedEnsembleCommand(Tcl_Obj *objPtr, - EnsembleConfig *ensemblePtr, Tcl_HashEntry *hPtr); + EnsembleConfig *ensemblePtr, Tcl_HashEntry *hPtr, + Tcl_Obj *fix); static void FreeEnsembleCmdRep(Tcl_Obj *objPtr); static void DupEnsembleCmdRep(Tcl_Obj *objPtr, Tcl_Obj *copyPtr); static void CompileToInvokedCommand(Tcl_Interp *interp, @@ -1641,6 +1642,8 @@ NsEnsembleImplementationCmdNR( * names. */ int reparseCount = 0; /* Number of reparses. */ Tcl_Obj *errorObj; /* Used for building error messages. */ + Tcl_Obj *subObj; + int subIdx; /* * Must recheck objc, since numParameters might have changed. Cf. test @@ -1648,7 +1651,8 @@ NsEnsembleImplementationCmdNR( */ restartEnsembleParse: - if (objc < 2 + ensemblePtr->numParameters) { + subIdx = 1 + ensemblePtr->numParameters; + if (objc < subIdx + 1) { /* * We don't have a subcommand argument. Make error message. */ @@ -1693,6 +1697,8 @@ NsEnsembleImplementationCmdNR( * up in there and go straight to dispatch. */ + subObj = objv[subIdx]; + if (ensemblePtr->epoch == ensemblePtr->nsPtr->exportLookupEpoch) { /* * Table of subcommands is still valid; therefore there might be a @@ -1701,14 +1707,16 @@ NsEnsembleImplementationCmdNR( * part where we do the invocation of the subcommand. */ - if (objv[1+ensemblePtr->numParameters]->typePtr==&tclEnsembleCmdType){ - EnsembleCmdRep *ensembleCmd = objv[1+ensemblePtr->numParameters] - ->internalRep.twoPtrValue.ptr1; + if (subObj->typePtr==&tclEnsembleCmdType){ + EnsembleCmdRep *ensembleCmd = subObj->internalRep.twoPtrValue.ptr1; if (ensembleCmd->epoch == ensemblePtr->epoch && ensembleCmd->token == ensemblePtr->token) { prefixObj = Tcl_GetHashValue(ensembleCmd->hPtr); Tcl_IncrRefCount(prefixObj); + if (ensembleCmd->fix) { + TclSpellFix(interp, objv, objc, subIdx, subObj, ensembleCmd->fix); + } goto runResultingSubcommand; } } @@ -1723,15 +1731,14 @@ NsEnsembleImplementationCmdNR( */ hPtr = Tcl_FindHashEntry(&ensemblePtr->subcommandTable, - TclGetString(objv[1 + ensemblePtr->numParameters])); + TclGetString(subObj)); if (hPtr != NULL) { /* * Cache for later in the subcommand object. */ - MakeCachedEnsembleCommand(objv[1 + ensemblePtr->numParameters], - ensemblePtr, hPtr); + MakeCachedEnsembleCommand(subObj, ensemblePtr, hPtr, NULL); } else if (!(ensemblePtr->flags & TCL_ENSEMBLE_PREFIX)) { /* * Could not map, no prefixing, go to unknown/error handling. @@ -1751,9 +1758,9 @@ NsEnsembleImplementationCmdNR( char *fullName = NULL; /* Full name of the subcommand. */ int stringLength, i; int tableLength = ensemblePtr->subcommandTable.numEntries; + Tcl_Obj *fix; - subcmdName = TclGetString(objv[1 + ensemblePtr->numParameters]); - stringLength = objv[1 + ensemblePtr->numParameters]->length; + subcmdName = Tcl_GetStringFromObj(subObj, &stringLength); for (i=0 ; isubcommandArrayPtr[i], @@ -1795,11 +1802,17 @@ NsEnsembleImplementationCmdNR( } /* + * Record the spelling correction for usage message. + */ + + fix = Tcl_NewStringObj(fullName, -1); + + /* * Cache for later in the subcommand object. */ - MakeCachedEnsembleCommand(objv[1 + ensemblePtr->numParameters], - ensemblePtr, hPtr); + MakeCachedEnsembleCommand(subObj, ensemblePtr, hPtr, fix); + TclSpellFix(interp, objv, objc, subIdx, subObj, fix); } prefixObj = Tcl_GetHashValue(hPtr); @@ -1912,20 +1925,17 @@ NsEnsembleImplementationCmdNR( Tcl_ResetResult(interp); Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "SUBCOMMAND", - TclGetString(objv[1+ensemblePtr->numParameters]), NULL); + TclGetString(subObj), NULL); if (ensemblePtr->subcommandTable.numEntries == 0) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "unknown subcommand \"%s\": namespace %s does not" - " export any commands", - TclGetString(objv[1+ensemblePtr->numParameters]), + " export any commands", TclGetString(subObj), ensemblePtr->nsPtr->fullName)); - Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "SUBCOMMAND", - TclGetString(objv[1+ensemblePtr->numParameters]), NULL); return TCL_ERROR; } errorObj = Tcl_ObjPrintf("unknown%s subcommand \"%s\": must be ", (ensemblePtr->flags & TCL_ENSEMBLE_PREFIX ? " or ambiguous" : ""), - TclGetString(objv[1+ensemblePtr->numParameters])); + TclGetString(subObj)); if (ensemblePtr->subcommandTable.numEntries == 1) { Tcl_AppendToObj(errorObj, ensemblePtr->subcommandArrayPtr[0], -1); } else { @@ -2030,6 +2040,127 @@ TclResetRewriteEnsemble( iPtr->ensembleRewrite.numInsertedObjs = 0; } } + +/* + *---------------------------------------------------------------------- + * + * TclSpellFix -- + * + * Record a spelling correction that needs making in the + * generation of the WrongNumArgs usage message. + * + * Results: + * None. + * + * Side effects: + * Can create an alternative ensemble rewrite structure. + * + *---------------------------------------------------------------------- + */ + +static int +FreeER( + ClientData data[], + Tcl_Interp *interp, + int result) +{ + Tcl_Obj **tmp = (Tcl_Obj **)data[0]; + + ckfree(tmp[2]); + ckfree(tmp); + return result; +} + +static int +FreeObj( + ClientData data[], + Tcl_Interp *interp, + int result) +{ + Tcl_Obj *objPtr = (Tcl_Obj *)data[0]; + + Tcl_DecrRefCount(objPtr); + return result; +} + +void +TclSpellFix( + Tcl_Interp *interp, + Tcl_Obj *const *objv, + int objc, + int badIdx, + Tcl_Obj *bad, + Tcl_Obj *fix) +{ + Interp *iPtr = (Interp *) interp; + Tcl_Obj *const *search; + Tcl_Obj **store; + int idx; + int size; + + if (iPtr->ensembleRewrite.sourceObjs == NULL) { + iPtr->ensembleRewrite.sourceObjs = objv; + iPtr->ensembleRewrite.numRemovedObjs = 0; + iPtr->ensembleRewrite.numInsertedObjs = 0; + } + + /* Compute the valid length of the ensemble root */ + + size = iPtr->ensembleRewrite.numRemovedObjs + objc + - iPtr->ensembleRewrite.numInsertedObjs; + + search = iPtr->ensembleRewrite.sourceObjs; + if (search[0] == NULL) { + /* Awful casting abuse here */ + search = (Tcl_Obj *const *) search[1]; + } + + if (badIdx < iPtr->ensembleRewrite.numInsertedObjs) { + /* + * Misspelled value was inserted. We cannot directly jump + * to the bad value, but have to search. + */ + idx = 1; + while (idx < size) { + if (search[idx] == bad) { + break; + } + idx++; + } + if (idx == size) { + return; + } + } else { + /* Jump to the misspelled value. */ + idx = iPtr->ensembleRewrite.numRemovedObjs + badIdx + - iPtr->ensembleRewrite.numInsertedObjs; + + /* Verify */ + if (search[idx] != bad) { + Tcl_Panic("SpellFix: programming error"); + } + } + + search = iPtr->ensembleRewrite.sourceObjs; + if (search[0] == NULL) { + store = (Tcl_Obj **)search[2]; + } else { + Tcl_Obj **tmp = ckalloc(3 * sizeof(Tcl_Obj *)); + tmp[0] = NULL; + tmp[1] = (Tcl_Obj *)iPtr->ensembleRewrite.sourceObjs; + tmp[2] = (Tcl_Obj *)ckalloc(size * sizeof(Tcl_Obj *)); + memcpy(tmp[2], tmp[1], size*sizeof(Tcl_Obj *)); + + iPtr->ensembleRewrite.sourceObjs = (Tcl_Obj *const *) tmp; + TclNRAddCallback(interp, FreeER, tmp, NULL, NULL, NULL); + store = (Tcl_Obj **)tmp[2]; + } + + store[idx] = fix; + Tcl_IncrRefCount(fix); + TclNRAddCallback(interp, FreeObj, fix, NULL, NULL, NULL); +} + /* *---------------------------------------------------------------------- * @@ -2230,12 +2361,16 @@ static void MakeCachedEnsembleCommand( Tcl_Obj *objPtr, EnsembleConfig *ensemblePtr, - Tcl_HashEntry *hPtr) + Tcl_HashEntry *hPtr, + Tcl_Obj *fix) { register EnsembleCmdRep *ensembleCmd; if (objPtr->typePtr == &tclEnsembleCmdType) { ensembleCmd = objPtr->internalRep.twoPtrValue.ptr1; + if (ensembleCmd->fix) { + Tcl_DecrRefCount(ensembleCmd->fix); + } } else { /* * Kill the old internal rep, and replace it with a brand new one of @@ -2254,7 +2389,10 @@ MakeCachedEnsembleCommand( ensembleCmd->epoch = ensemblePtr->epoch; ensembleCmd->token = ensemblePtr->token; - ensembleCmd->tablePtr = &ensemblePtr->subcommandTable; + if (fix) { + Tcl_IncrRefCount(fix); + } + ensembleCmd->fix = fix; ensembleCmd->hPtr = hPtr; } @@ -2636,6 +2774,9 @@ FreeEnsembleCmdRep( { EnsembleCmdRep *ensembleCmd = objPtr->internalRep.twoPtrValue.ptr1; + if (ensembleCmd->fix) { + Tcl_DecrRefCount(ensembleCmd->fix); + } ckfree(ensembleCmd); objPtr->typePtr = NULL; } @@ -2670,7 +2811,10 @@ DupEnsembleCmdRep( copyPtr->internalRep.twoPtrValue.ptr1 = ensembleCopy; ensembleCopy->epoch = ensembleCmd->epoch; ensembleCopy->token = ensembleCmd->token; - ensembleCopy->tablePtr = ensembleCmd->tablePtr; + ensembleCopy->fix = ensembleCmd->fix; + if (ensembleCopy->fix) { + Tcl_IncrRefCount(ensembleCopy->fix); + } ensembleCopy->hPtr = ensembleCmd->hPtr; } diff --git a/generic/tclIndexObj.c b/generic/tclIndexObj.c index d01e685..0e0ddc9 100644 --- a/generic/tclIndexObj.c +++ b/generic/tclIndexObj.c @@ -925,6 +925,14 @@ Tcl_WrongNumArgs( Tcl_Obj *const *origObjv = iPtr->ensembleRewrite.sourceObjs; /* + * Check for spelling fixes, and substitute the fixed values. + */ + + if (origObjv[0] == NULL) { + origObjv = (Tcl_Obj *const *)origObjv[2]; + } + + /* * We only know how to do rewriting if all the replaced objects are * actually arguments (in objv) to this function. Otherwise it just * gets too complicated and we'd be better off just giving a slightly @@ -957,12 +965,6 @@ Tcl_WrongNumArgs( elementStr = EXPAND_OF(indexRep); elemLen = strlen(elementStr); - } else if (origObjv[i]->typePtr == &tclEnsembleCmdType) { - register EnsembleCmdRep *ecrPtr = - origObjv[i]->internalRep.twoPtrValue.ptr1; - - elementStr = Tcl_GetHashKey(ecrPtr->tablePtr, ecrPtr->hPtr); - elemLen = strlen(elementStr); } else { elementStr = TclGetStringFromObj(origObjv[i], &elemLen); } @@ -1011,13 +1013,6 @@ Tcl_WrongNumArgs( register IndexRep *indexRep = objv[i]->internalRep.twoPtrValue.ptr1; Tcl_AppendStringsToObj(objPtr, EXPAND_OF(indexRep), NULL); - } else if (objv[i]->typePtr == &tclEnsembleCmdType) { - register EnsembleCmdRep *ecrPtr = - objv[i]->internalRep.twoPtrValue.ptr1; - const char *fullSubcmdName - = Tcl_GetHashKey(ecrPtr->tablePtr, ecrPtr->hPtr); - - Tcl_AppendStringsToObj(objPtr, fullSubcmdName, NULL); } else { /* * Quote the argument if it contains spaces (Bug 942757). diff --git a/generic/tclInt.h b/generic/tclInt.h index b3cfc00..03b648d 100644 --- a/generic/tclInt.h +++ b/generic/tclInt.h @@ -401,7 +401,7 @@ typedef struct { * ensemble. */ Tcl_Command token; /* Reference to the comamnd for which this * structure is a cache of the resolution. */ - Tcl_HashTable *tablePtr; /* The subcommand hash table. */ + Tcl_Obj *fix; /* Corrected spelling, if needed. */ Tcl_HashEntry *hPtr; /* Direct link to entry in the subcommand * hash table. */ } EnsembleCmdRep; @@ -3109,6 +3109,9 @@ MODULE_SCOPE void TclSetDuplicateObj(Tcl_Obj *dupPtr, Tcl_Obj *objPtr); MODULE_SCOPE void TclSetProcessGlobalValue(ProcessGlobalValue *pgvPtr, Tcl_Obj *newValue, Tcl_Encoding encoding); MODULE_SCOPE void TclSignalExitThread(Tcl_ThreadId id, int result); +MODULE_SCOPE void TclSpellFix(Tcl_Interp *interp, + Tcl_Obj *const *objv, int objc, int subIdx, + Tcl_Obj *bad, Tcl_Obj *fix); MODULE_SCOPE void * TclStackRealloc(Tcl_Interp *interp, void *ptr, int numBytes); MODULE_SCOPE int TclStringMatch(const char *str, int strLen, -- cgit v0.12 From 0402319830914ece12c185ad276b382cc4ef15ce Mon Sep 17 00:00:00 2001 From: dgp Date: Fri, 1 Jul 2016 19:16:56 +0000 Subject: Add some tests --- tests/namespace.test | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/tests/namespace.test b/tests/namespace.test index 2ba695a..c433241 100644 --- a/tests/namespace.test +++ b/tests/namespace.test @@ -2107,6 +2107,52 @@ test namespace-50.4 {chained ensembles affect error messages} -body { rename a {} rename c {} } +test namespace-50.5 {[4402cfa58c]} -setup { + proc bar {ev} {} + proc bingo {xx} {} + namespace ensemble create -command launch -map {foo bar event bingo} + set result {} +} -body { + catch {launch foo} m; lappend result $m + catch {launch ev} m; lappend result $m + catch {launch foo} m; lappend result $m +} -cleanup { + rename launch {} + rename bingo {} + rename bar {} +} -result {{wrong # args: should be "launch foo ev"} {wrong # args: should be "launch event xx"} {wrong # args: should be "launch foo ev"}} +test namespace-50.6 {[4402cfa58c]} -setup { + proc target {x y} {} + namespace ensemble create -command e2 -map {s2 target} + namespace ensemble create -command e1 -map {s1 e2} + set result {} +} -body { + set s s + catch {e1 s1 s2 a} m; lappend result $m + catch {e1 $s s2 a} m; lappend result $m + catch {e1 s1 $s a} m; lappend result $m + catch {e1 $s $s a} m; lappend result $m +} -cleanup { + rename e1 {} + rename e2 {} + rename target {} +} -result {{wrong # args: should be "e1 s1 s2 x y"} {wrong # args: should be "e1 s1 s2 x y"} {wrong # args: should be "e1 s1 s2 x y"} {wrong # args: should be "e1 s1 s2 x y"}} +test namespace-50.7 {[4402cfa58c]} -setup { + proc target {x y} {} + namespace ensemble create -command e2 -map {s2 target} + namespace ensemble create -command e1 -map {s1 e2} -parameters foo + set result {} +} -body { + set s s + catch {e1 s2 s1 a} m; lappend result $m + catch {e1 $s s1 a} m; lappend result $m + catch {e1 s2 $s a} m; lappend result $m + catch {e1 $s $s a} m; lappend result $m +} -cleanup { + rename e1 {} + rename e2 {} + rename target {} +} -result {{wrong # args: should be "e1 s2 s1 x y"} {wrong # args: should be "e1 s2 s1 x y"} {wrong # args: should be "e1 s2 s1 x y"} {wrong # args: should be "e1 s2 s1 x y"}} test namespace-51.1 {name resolution path control} -body { namespace eval ::test_ns_1 { -- cgit v0.12 From f7aa28a9960d172ef84736f3609940c5564d5325 Mon Sep 17 00:00:00 2001 From: dgp Date: Fri, 1 Jul 2016 19:42:38 +0000 Subject: The EnsembleCmdRep struct that is the internal rep for caching ensemble dispatches and spelling corrections can now be file static. --- generic/tclEnsemble.c | 26 +++++++++++++++++++++----- generic/tclInt.h | 17 ----------------- 2 files changed, 21 insertions(+), 22 deletions(-) diff --git a/generic/tclEnsemble.c b/generic/tclEnsemble.c index 75c2747..5c47ce3 100644 --- a/generic/tclEnsemble.c +++ b/generic/tclEnsemble.c @@ -76,7 +76,7 @@ enum EnsConfigOpts { * that implements it. */ -const Tcl_ObjType tclEnsembleCmdType = { +static const Tcl_ObjType ensembleCmdType = { "ensembleCommand", /* the type's name */ FreeEnsembleCmdRep, /* freeIntRepProc */ DupEnsembleCmdRep, /* dupIntRepProc */ @@ -84,6 +84,22 @@ const Tcl_ObjType tclEnsembleCmdType = { NULL /* setFromAnyProc */ }; +/* + * The internal rep for caching ensemble subcommand lookups and + * spell corrections. + */ + +typedef struct { + int epoch; /* Used to confirm when the data in this + * really structure matches up with the + * ensemble. */ + Tcl_Command token; /* Reference to the comamnd for which this + * structure is a cache of the resolution. */ + Tcl_Obj *fix; /* Corrected spelling, if needed. */ + Tcl_HashEntry *hPtr; /* Direct link to entry in the subcommand + * hash table. */ +} EnsembleCmdRep; + static inline Tcl_Obj * NewNsObj( @@ -1707,7 +1723,7 @@ NsEnsembleImplementationCmdNR( * part where we do the invocation of the subcommand. */ - if (subObj->typePtr==&tclEnsembleCmdType){ + if (subObj->typePtr==&ensembleCmdType){ EnsembleCmdRep *ensembleCmd = subObj->internalRep.twoPtrValue.ptr1; if (ensembleCmd->epoch == ensemblePtr->epoch && @@ -2366,7 +2382,7 @@ MakeCachedEnsembleCommand( { register EnsembleCmdRep *ensembleCmd; - if (objPtr->typePtr == &tclEnsembleCmdType) { + if (objPtr->typePtr == &ensembleCmdType) { ensembleCmd = objPtr->internalRep.twoPtrValue.ptr1; if (ensembleCmd->fix) { Tcl_DecrRefCount(ensembleCmd->fix); @@ -2380,7 +2396,7 @@ MakeCachedEnsembleCommand( TclFreeIntRep(objPtr); ensembleCmd = ckalloc(sizeof(EnsembleCmdRep)); objPtr->internalRep.twoPtrValue.ptr1 = ensembleCmd; - objPtr->typePtr = &tclEnsembleCmdType; + objPtr->typePtr = &ensembleCmdType; } /* @@ -2807,7 +2823,7 @@ DupEnsembleCmdRep( EnsembleCmdRep *ensembleCmd = objPtr->internalRep.twoPtrValue.ptr1; EnsembleCmdRep *ensembleCopy = ckalloc(sizeof(EnsembleCmdRep)); - copyPtr->typePtr = &tclEnsembleCmdType; + copyPtr->typePtr = &ensembleCmdType; copyPtr->internalRep.twoPtrValue.ptr1 = ensembleCopy; ensembleCopy->epoch = ensembleCmd->epoch; ensembleCopy->token = ensembleCmd->token; diff --git a/generic/tclInt.h b/generic/tclInt.h index 03b648d..fba4c7b 100644 --- a/generic/tclInt.h +++ b/generic/tclInt.h @@ -390,23 +390,6 @@ struct NamespacePathEntry { #define TCL_FIND_ONLY_NS 0x1000 /* - * The data cached in an ensemble subcommand's Tcl_Obj rep (reference in - * twoPtrValue.ptr1 field). This structure is not shared between Tcl_Objs - * referring to the same subcommand, even where one is a duplicate of another. - */ - -typedef struct { - int epoch; /* Used to confirm when the data in this - * really structure matches up with the - * ensemble. */ - Tcl_Command token; /* Reference to the comamnd for which this - * structure is a cache of the resolution. */ - Tcl_Obj *fix; /* Corrected spelling, if needed. */ - Tcl_HashEntry *hPtr; /* Direct link to entry in the subcommand - * hash table. */ -} EnsembleCmdRep; - -/* * The client data for an ensemble command. This consists of the table of * commands that are actually exported by the namespace, and an epoch counter * that, combined with the exportLookupEpoch field of the namespace structure, -- cgit v0.12 From a139661621ec842c91242c4b0fca910b9c964398 Mon Sep 17 00:00:00 2001 From: dgp Date: Sat, 2 Jul 2016 17:21:53 +0000 Subject: [f961d7d1dd] Repair usage message for ensemble parameters with spaces. --- generic/tclEnsemble.c | 13 +++---------- tests/namespace.test | 9 +++++++++ 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/generic/tclEnsemble.c b/generic/tclEnsemble.c index 5c47ce3..a86b5c4 100644 --- a/generic/tclEnsemble.c +++ b/generic/tclEnsemble.c @@ -1674,18 +1674,11 @@ NsEnsembleImplementationCmdNR( */ Tcl_DString buf; /* Message being built */ - Tcl_Obj **elemPtrs; /* Parameter names */ - int len; /* Number of parameters to append */ Tcl_DStringInit(&buf); - if (ensemblePtr->parameterList == NULL) { - len = 0; - } else if (TclListObjGetElements(NULL, ensemblePtr->parameterList, - &len, &elemPtrs) != TCL_OK) { - Tcl_Panic("List of ensemble parameters is not a list"); - } - for (; len>0; len--,elemPtrs++) { - TclDStringAppendObj(&buf, *elemPtrs); + if (ensemblePtr->parameterList) { + Tcl_DStringAppend(&buf, + TclGetString(ensemblePtr->parameterList), -1); TclDStringAppendLiteral(&buf, " "); } TclDStringAppendLiteral(&buf, "subcommand ?arg ...?"); diff --git a/tests/namespace.test b/tests/namespace.test index c433241..dc1d3bf 100644 --- a/tests/namespace.test +++ b/tests/namespace.test @@ -2153,6 +2153,15 @@ test namespace-50.7 {[4402cfa58c]} -setup { rename e2 {} rename target {} } -result {{wrong # args: should be "e1 s2 s1 x y"} {wrong # args: should be "e1 s2 s1 x y"} {wrong # args: should be "e1 s2 s1 x y"} {wrong # args: should be "e1 s2 s1 x y"}} +test namespace-50.8 {[f961d7d1dd]} -setup { + proc target {} {} + namespace ensemble create -command e -map {s target} -parameters {{a b}} +} -body { + e +} -returnCodes error -result {wrong # args: should be "e {a b} subcommand ?arg ...?"} -cleanup { + rename e {} + rename target {} +} test namespace-51.1 {name resolution path control} -body { namespace eval ::test_ns_1 { -- cgit v0.12 From 40f7c9d9a4db96328d9933e0675ece7362bffc1c Mon Sep 17 00:00:00 2001 From: dgp Date: Sat, 2 Jul 2016 17:55:51 +0000 Subject: [09fabeb1fd] test subdirs in sorted order. --- library/tcltest/tcltest.tcl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/tcltest/tcltest.tcl b/library/tcltest/tcltest.tcl index 169b7d4..f1ce970 100644 --- a/library/tcltest/tcltest.tcl +++ b/library/tcltest/tcltest.tcl @@ -2709,7 +2709,7 @@ proc tcltest::GetMatchingDirectories {rootdir} { DebugPuts 1 "No test directories remain after applying match\ and skip patterns!" } - return $matchDirs + return [lsort $matchDirs] } # tcltest::runAllTests -- -- cgit v0.12 From 2f4c482ac0cec564faea01f71d44f481d96f9e9e Mon Sep 17 00:00:00 2001 From: dgp Date: Sun, 3 Jul 2016 14:09:45 +0000 Subject: Use conventional list operations for ensemble dispatch. --- generic/tclEnsemble.c | 57 +++++++++++++++++++++------------------------------ 1 file changed, 23 insertions(+), 34 deletions(-) diff --git a/generic/tclEnsemble.c b/generic/tclEnsemble.c index a86b5c4..17ab35b 100644 --- a/generic/tclEnsemble.c +++ b/generic/tclEnsemble.c @@ -41,6 +41,9 @@ static int CompileBasicNArgCommand(Tcl_Interp *interp, Tcl_Parse *parsePtr, Command *cmdPtr, CompileEnv *envPtr); +static Tcl_NRPostProc FreeObj; +static Tcl_NRPostProc FreeER; + /* * The lists of subcommands and options for the [namespace ensemble] command. */ @@ -1843,45 +1846,31 @@ NsEnsembleImplementationCmdNR( */ { - Tcl_Obj **prefixObjv; /* The list of objects to substitute in as the - * target command prefix. */ Tcl_Obj *copyPtr; /* The actual list of words to dispatch to. * Will be freed by the dispatch engine. */ - int prefixObjc, copyObjc; + int prefixObjc; + + Tcl_ListObjLength(NULL, prefixObj, &prefixObjc); + if (0 && objc == 2) { /* - * Get the prefix that we're rewriting to. To do this we need to - * ensure that the internal representation of the list does not change - * so that we can safely keep the internal representations of the - * elements in the list. - * - * TODO: Use conventional list operations to make this code sane! + * TODO: This branch is disabled because it botches or exposes + * something wrong with nested ensemble usage messages. See + * tests oo-16.1 and oo-17.1 */ - - TclListObjGetElements(NULL, prefixObj, &prefixObjc, &prefixObjv); - - copyObjc = objc - 2 + prefixObjc; - copyPtr = Tcl_NewListObj(copyObjc, NULL); - if (copyObjc > 0) { - register Tcl_Obj **copyObjv; - /* Space used to construct the list of - * arguments to pass to the command that - * implements the ensemble subcommand. */ - register List *listRepPtr = copyPtr->internalRep.twoPtrValue.ptr1; - register int i; - - listRepPtr->elemCount = copyObjc; - copyObjv = &listRepPtr->elements; - memcpy(copyObjv, prefixObjv, sizeof(Tcl_Obj *) * prefixObjc); - memcpy(copyObjv+prefixObjc, objv+1, - sizeof(Tcl_Obj *) * ensemblePtr->numParameters); - memcpy(copyObjv+prefixObjc+ensemblePtr->numParameters, - objv+ensemblePtr->numParameters+2, - sizeof(Tcl_Obj *) * (objc-ensemblePtr->numParameters-2)); - - for (i=0; i < copyObjc; i++) { - Tcl_IncrRefCount(copyObjv[i]); - } + copyPtr = prefixObj; + Tcl_IncrRefCount(copyPtr); + TclNRAddCallback(interp, FreeObj, copyPtr, NULL, NULL, NULL); + } else { + int copyObjc = objc - 2 + prefixObjc; + + copyPtr = Tcl_NewListObj(copyObjc, NULL); + Tcl_ListObjAppendList(NULL, copyPtr, prefixObj); + Tcl_ListObjReplace(NULL, copyPtr, LIST_MAX, 0, + ensemblePtr->numParameters, objv+1); + Tcl_ListObjReplace(NULL, copyPtr, LIST_MAX, 0, + objc - 2 - ensemblePtr->numParameters, + objv + 2 + ensemblePtr->numParameters); } TclDecrRefCount(prefixObj); -- cgit v0.12 From 8bd5f8fc4af842fb4f757eabeb38dcc91a87b4bc Mon Sep 17 00:00:00 2001 From: dkf Date: Mon, 4 Jul 2016 08:18:53 +0000 Subject: Add ability to disassemble TclOO constructors and destructors ([1493a43044] motivates) --- generic/tclDisassemble.c | 135 ++++++++++++++++++++++++++++++++++++++++++++++- tests/compile.test | 99 +++++++++++++++++++++++++++++++++- 2 files changed, 232 insertions(+), 2 deletions(-) diff --git a/generic/tclDisassemble.c b/generic/tclDisassemble.c index c85fe13..1d616fb 100644 --- a/generic/tclDisassemble.c +++ b/generic/tclDisassemble.c @@ -6,7 +6,7 @@ * * Copyright (c) 1996-1998 Sun Microsystems, Inc. * Copyright (c) 2001 by Kevin B. Kenny. All rights reserved. - * Copyright (c) 2013 Donal K. Fellows. + * Copyright (c) 2013-2016 Donal K. Fellows. * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. @@ -1279,9 +1279,11 @@ Tcl_DisassembleObjCmd( Tcl_Obj *const objv[]) /* Argument objects. */ { static const char *const types[] = { + "constructor", "destructor", "lambda", "method", "objmethod", "proc", "script", NULL }; enum Types { + DISAS_CLASS_CONSTRUCTOR, DISAS_CLASS_DESTRUCTOR, DISAS_LAMBDA, DISAS_CLASS_METHOD, DISAS_OBJECT_METHOD, DISAS_PROC, DISAS_SCRIPT }; @@ -1290,6 +1292,7 @@ Tcl_DisassembleObjCmd( Proc *procPtr = NULL; Tcl_HashEntry *hPtr; Object *oPtr; + Method *methodPtr; if (objc < 2) { Tcl_WrongNumArgs(interp, 1, objv, "type ..."); @@ -1384,6 +1387,136 @@ Tcl_DisassembleObjCmd( codeObjPtr = objv[2]; break; + case DISAS_CLASS_CONSTRUCTOR: + if (objc != 3) { + Tcl_WrongNumArgs(interp, 2, objv, "className"); + return TCL_ERROR; + } + + /* + * Look up the body of a constructor. + */ + + oPtr = (Object *) Tcl_GetObjectFromObj(interp, objv[2]); + if (oPtr == NULL) { + return TCL_ERROR; + } + if (oPtr->classPtr == NULL) { + Tcl_SetObjResult(interp, Tcl_ObjPrintf( + "\"%s\" is not a class", TclGetString(objv[2]))); + Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "CLASS", + TclGetString(objv[2]), NULL); + return TCL_ERROR; + } + + methodPtr = oPtr->classPtr->constructorPtr; + if (methodPtr == NULL) { + Tcl_SetObjResult(interp, Tcl_ObjPrintf( + "\"%s\" has no defined constructor", + TclGetString(objv[2]))); + Tcl_SetErrorCode(interp, "TCL", "OPERATION", "DISASSEMBLE", + "CONSRUCTOR", NULL); + return TCL_ERROR; + } + procPtr = TclOOGetProcFromMethod(methodPtr); + if (procPtr == NULL) { + Tcl_SetObjResult(interp, Tcl_NewStringObj( + "body not available for this kind of constructor", -1)); + Tcl_SetErrorCode(interp, "TCL", "OPERATION", "DISASSEMBLE", + "METHODTYPE", NULL); + return TCL_ERROR; + } + + /* + * Compile if necessary. + */ + + if (procPtr->bodyPtr->typePtr != &tclByteCodeType) { + Command cmd; + + /* + * Yes, this is ugly, but we need to pass the namespace in to the + * compiler in two places. + */ + + cmd.nsPtr = (Namespace *) oPtr->namespacePtr; + procPtr->cmdPtr = &cmd; + result = TclProcCompileProc(interp, procPtr, procPtr->bodyPtr, + (Namespace *) oPtr->namespacePtr, "body of constructor", + TclGetString(objv[2])); + procPtr->cmdPtr = NULL; + if (result != TCL_OK) { + return result; + } + } + codeObjPtr = procPtr->bodyPtr; + break; + + case DISAS_CLASS_DESTRUCTOR: + if (objc != 3) { + Tcl_WrongNumArgs(interp, 2, objv, "className"); + return TCL_ERROR; + } + + /* + * Look up the body of a destructor. + */ + + oPtr = (Object *) Tcl_GetObjectFromObj(interp, objv[2]); + if (oPtr == NULL) { + return TCL_ERROR; + } + if (oPtr->classPtr == NULL) { + Tcl_SetObjResult(interp, Tcl_ObjPrintf( + "\"%s\" is not a class", TclGetString(objv[2]))); + Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "CLASS", + TclGetString(objv[2]), NULL); + return TCL_ERROR; + } + + methodPtr = oPtr->classPtr->destructorPtr; + if (methodPtr == NULL) { + Tcl_SetObjResult(interp, Tcl_ObjPrintf( + "\"%s\" has no defined destructor", + TclGetString(objv[2]))); + Tcl_SetErrorCode(interp, "TCL", "OPERATION", "DISASSEMBLE", + "DESRUCTOR", NULL); + return TCL_ERROR; + } + procPtr = TclOOGetProcFromMethod(methodPtr); + if (procPtr == NULL) { + Tcl_SetObjResult(interp, Tcl_NewStringObj( + "body not available for this kind of destructor", -1)); + Tcl_SetErrorCode(interp, "TCL", "OPERATION", "DISASSEMBLE", + "METHODTYPE", NULL); + return TCL_ERROR; + } + + /* + * Compile if necessary. + */ + + if (procPtr->bodyPtr->typePtr != &tclByteCodeType) { + Command cmd; + + /* + * Yes, this is ugly, but we need to pass the namespace in to the + * compiler in two places. + */ + + cmd.nsPtr = (Namespace *) oPtr->namespacePtr; + procPtr->cmdPtr = &cmd; + result = TclProcCompileProc(interp, procPtr, procPtr->bodyPtr, + (Namespace *) oPtr->namespacePtr, "body of destructor", + TclGetString(objv[2])); + procPtr->cmdPtr = NULL; + if (result != TCL_OK) { + return result; + } + } + codeObjPtr = procPtr->bodyPtr; + break; + case DISAS_CLASS_METHOD: if (objc != 4) { Tcl_WrongNumArgs(interp, 2, objv, "className methodName"); diff --git a/tests/compile.test b/tests/compile.test index bb12050..f021cf2 100644 --- a/tests/compile.test +++ b/tests/compile.test @@ -678,7 +678,7 @@ test compile-17.2 {Command interpretation binding for non-compiled code} -setup # change without warning. set disassemblables [linsert [join { - lambda method objmethod proc script + constructor destructor lambda method objmethod proc script } ", "] end-1 or] test compile-18.1 {disassembler - basics} -returnCodes error -body { tcl::unsupported::disassemble @@ -872,6 +872,103 @@ test compile-18.39 {disassembler - basics} -setup { } -cleanup { foo destroy } -result "$bytecodekeys initiallinenumber sourcefile" +test compile-18.40 {disassembler - basics} -returnCodes error -body { + tcl::unsupported::disassemble constructor +} -match glob -result {wrong # args: should be "* constructor className"} +test compile-18.41 {disassembler - basics} -returnCodes error -body { + tcl::unsupported::disassemble constructor nosuchclass +} -result {nosuchclass does not refer to an object} +test compile-18.42 {disassembler - basics} -returnCodes error -setup { + oo::object create justanobject +} -body { + tcl::unsupported::disassemble constructor justanobject +} -cleanup { + justanobject destroy +} -result {"justanobject" is not a class} +test compile-18.43 {disassembler - basics} -returnCodes error -setup { + oo::class create constructorless +} -body { + tcl::unsupported::disassemble constructor constructorless +} -cleanup { + constructorless destroy +} -result {"constructorless" has no defined constructor} +test compile-18.44 {disassembler - basics} -setup { + oo::class create foo {constructor {} {set x 1}} +} -body { + # Allow any string: the result format is not defined anywhere! + tcl::unsupported::disassemble constructor foo +} -cleanup { + foo destroy +} -match glob -result * +test compile-18.45 {disassembler - basics} -returnCodes error -body { + tcl::unsupported::getbytecode constructor +} -match glob -result {wrong # args: should be "* constructor className"} +test compile-18.46 {disassembler - basics} -returnCodes error -body { + tcl::unsupported::getbytecode constructor nosuchobject +} -result {nosuchobject does not refer to an object} +test compile-18.47 {disassembler - basics} -returnCodes error -setup { + oo::class create constructorless +} -body { + tcl::unsupported::getbytecode constructor constructorless +} -cleanup { + constructorless destroy +} -result {"constructorless" has no defined constructor} +test compile-18.48 {disassembler - basics} -setup { + oo::class create foo {constructor {} {set x 1}} +} -body { + dict keys [tcl::unsupported::getbytecode constructor foo] +} -cleanup { + foo destroy +} -result "$bytecodekeys" +# There is no compile-18.49 +test compile-18.50 {disassembler - basics} -returnCodes error -body { + tcl::unsupported::disassemble destructor +} -match glob -result {wrong # args: should be "* destructor className"} +test compile-18.51 {disassembler - basics} -returnCodes error -body { + tcl::unsupported::disassemble destructor nosuchclass +} -result {nosuchclass does not refer to an object} +test compile-18.52 {disassembler - basics} -returnCodes error -setup { + oo::object create justanobject +} -body { + tcl::unsupported::disassemble destructor justanobject +} -cleanup { + justanobject destroy +} -result {"justanobject" is not a class} +test compile-18.53 {disassembler - basics} -returnCodes error -setup { + oo::class create constructorless +} -body { + tcl::unsupported::disassemble destructor constructorless +} -cleanup { + constructorless destroy +} -result {"constructorless" has no defined destructor} +test compile-18.54 {disassembler - basics} -setup { + oo::class create foo {destructor {set x 1}} +} -body { + # Allow any string: the result format is not defined anywhere! + tcl::unsupported::disassemble destructor foo +} -cleanup { + foo destroy +} -match glob -result * +test compile-18.55 {disassembler - basics} -returnCodes error -body { + tcl::unsupported::getbytecode destructor +} -match glob -result {wrong # args: should be "* destructor className"} +test compile-18.56 {disassembler - basics} -returnCodes error -body { + tcl::unsupported::getbytecode destructor nosuchobject +} -result {nosuchobject does not refer to an object} +test compile-18.57 {disassembler - basics} -returnCodes error -setup { + oo::class create constructorless +} -body { + tcl::unsupported::getbytecode destructor constructorless +} -cleanup { + constructorless destroy +} -result {"constructorless" has no defined destructor} +test compile-18.58 {disassembler - basics} -setup { + oo::class create foo {destructor {set x 1}} +} -body { + dict keys [tcl::unsupported::getbytecode destructor foo] +} -cleanup { + foo destroy +} -result "$bytecodekeys" test compile-19.0 {Bug 3614102: reset stack housekeeping} -body { # This will panic in a --enable-symbols=compile build, unless bug is fixed. -- cgit v0.12 From ca96c2bbccf3088770bcf436a51cb20176f08232 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Mon, 4 Jul 2016 08:36:41 +0000 Subject: typo and end-of-line spacing --- doc/SetResult.3 | 2 +- generic/tclEnsemble.c | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/doc/SetResult.3 b/doc/SetResult.3 index dc8f487..e5b81d7 100644 --- a/doc/SetResult.3 +++ b/doc/SetResult.3 @@ -164,7 +164,7 @@ The source interpreter will have its result reset by this operation. .SH "DEPRECATED INTERFACES" .SS "OLD STRING PROCEDURES" .PP -Use of the following procedures (is deprecated +Use of the following procedures is deprecated since they manipulate the Tcl result as a string. Procedures such as \fBTcl_SetObjResult\fR that manipulate the result as a value diff --git a/generic/tclEnsemble.c b/generic/tclEnsemble.c index 17ab35b..6489dea 100644 --- a/generic/tclEnsemble.c +++ b/generic/tclEnsemble.c @@ -1866,9 +1866,9 @@ NsEnsembleImplementationCmdNR( copyPtr = Tcl_NewListObj(copyObjc, NULL); Tcl_ListObjAppendList(NULL, copyPtr, prefixObj); - Tcl_ListObjReplace(NULL, copyPtr, LIST_MAX, 0, + Tcl_ListObjReplace(NULL, copyPtr, LIST_MAX, 0, ensemblePtr->numParameters, objv+1); - Tcl_ListObjReplace(NULL, copyPtr, LIST_MAX, 0, + Tcl_ListObjReplace(NULL, copyPtr, LIST_MAX, 0, objc - 2 - ensemblePtr->numParameters, objv + 2 + ensemblePtr->numParameters); } @@ -2044,7 +2044,7 @@ TclResetRewriteEnsemble( * * TclSpellFix -- * - * Record a spelling correction that needs making in the + * Record a spelling correction that needs making in the * generation of the WrongNumArgs usage message. * * Results: @@ -2104,7 +2104,7 @@ TclSpellFix( /* Compute the valid length of the ensemble root */ - size = iPtr->ensembleRewrite.numRemovedObjs + objc + size = iPtr->ensembleRewrite.numRemovedObjs + objc - iPtr->ensembleRewrite.numInsertedObjs; search = iPtr->ensembleRewrite.sourceObjs; @@ -2366,7 +2366,7 @@ MakeCachedEnsembleCommand( if (objPtr->typePtr == &ensembleCmdType) { ensembleCmd = objPtr->internalRep.twoPtrValue.ptr1; - if (ensembleCmd->fix) { + if (ensembleCmd->fix) { Tcl_DecrRefCount(ensembleCmd->fix); } } else { -- cgit v0.12 From b49c883bbe8c5aa0620b7bc648e3172b784ef892 Mon Sep 17 00:00:00 2001 From: dgp Date: Mon, 4 Jul 2016 20:39:43 +0000 Subject: Fixup the ensemble rewrite conversions. --- generic/tclEnsemble.c | 7 +------ generic/tclExecute.c | 2 -- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/generic/tclEnsemble.c b/generic/tclEnsemble.c index 17ab35b..11ec3fc 100644 --- a/generic/tclEnsemble.c +++ b/generic/tclEnsemble.c @@ -1852,12 +1852,7 @@ NsEnsembleImplementationCmdNR( Tcl_ListObjLength(NULL, prefixObj, &prefixObjc); - if (0 && objc == 2) { - /* - * TODO: This branch is disabled because it botches or exposes - * something wrong with nested ensemble usage messages. See - * tests oo-16.1 and oo-17.1 - */ + if (objc == 2) { copyPtr = prefixObj; Tcl_IncrRefCount(copyPtr); TclNRAddCallback(interp, FreeObj, copyPtr, NULL, NULL, NULL); diff --git a/generic/tclExecute.c b/generic/tclExecute.c index 355b667..1389382 100644 --- a/generic/tclExecute.c +++ b/generic/tclExecute.c @@ -2081,8 +2081,6 @@ TclNRExecuteByteCode( * Push the callback for bytecode execution */ - TclResetRewriteEnsemble(interp, 1); - TclNRAddCallback(interp, TEBCresume, TD, /* pc */ NULL, /* cleanup */ INT2PTR(0), NULL); return TCL_OK; -- cgit v0.12 From db45aa4434d4a7af38b8c14072648bf9965d462b Mon Sep 17 00:00:00 2001 From: dgp Date: Tue, 5 Jul 2016 17:03:59 +0000 Subject: New tests to demo the remaining flaw in ensemble dispatch revisions. Itcl 4 also demonstrated these problems. --- generic/tclEnsemble.c | 8 +++++++- tests/oo.test | 12 ++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/generic/tclEnsemble.c b/generic/tclEnsemble.c index a9698be..818534e 100644 --- a/generic/tclEnsemble.c +++ b/generic/tclEnsemble.c @@ -1852,7 +1852,13 @@ NsEnsembleImplementationCmdNR( Tcl_ListObjLength(NULL, prefixObj, &prefixObjc); - if (objc == 2) { + if (0 && objc == 2) { + /* + * Branch disabled until it works. See oo-1[67].1.1 + * + * Key here is the difference between the canonical list invocation + * and compilation/execution paths. + */ copyPtr = prefixObj; Tcl_IncrRefCount(copyPtr); TclNRAddCallback(interp, FreeObj, copyPtr, NULL, NULL, NULL); diff --git a/tests/oo.test b/tests/oo.test index 895f7ed..48e093a 100644 --- a/tests/oo.test +++ b/tests/oo.test @@ -2017,6 +2017,12 @@ test oo-15.10 {variable binding must not bleed through oo::copy} -setup { test oo-16.1 {OO: object introspection} -body { info object } -returnCodes 1 -result "wrong \# args: should be \"info object subcommand ?arg ...?\"" +test oo-16.1.1 {OO: object introspection} -body { + catch {info object} m o + dict get $o -errorinfo +} -result "wrong \# args: should be \"info object subcommand ?arg ...?\" + while executing +\"info object\"" test oo-16.2 {OO: object introspection} -body { info object class NOTANOBJECT } -returnCodes 1 -result {NOTANOBJECT does not refer to an object} @@ -2156,6 +2162,12 @@ test oo-16.14 {OO: object introspection: TIP #436} -setup { test oo-17.1 {OO: class introspection} -body { info class } -returnCodes 1 -result "wrong \# args: should be \"info class subcommand ?arg ...?\"" +test oo-17.1.1 {OO: class introspection} -body { + catch {info class} m o + dict get $o -errorinfo +} -result "wrong \# args: should be \"info class subcommand ?arg ...?\" + while executing +\"info class\"" test oo-17.2 {OO: class introspection} -body { info class superclass NOTANOBJECT } -returnCodes 1 -result {NOTANOBJECT does not refer to an object} -- cgit v0.12 From 4b6e8293285a111598e5dc2d37921ca6ff732c45 Mon Sep 17 00:00:00 2001 From: dkf Date: Tue, 5 Jul 2016 22:05:16 +0000 Subject: Demonstrate that there is a problem. --- tests/oo.test | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/tests/oo.test b/tests/oo.test index 48e093a..88e1124 100644 --- a/tests/oo.test +++ b/tests/oo.test @@ -3424,6 +3424,36 @@ test oo-27.22 {variables declaration uniqueifies: Bug 3396896} -setup { } -cleanup { foo destroy } -result {v t} +test oo-27.23 {variable resolver leakage: Bug 1493a43044} -setup { + oo::class create Super + oo::class create Master { + superclass Super + variable member1 member2 + constructor {} { + set member1 master1 + set member2 master2 + } + method getChild {} { + Child new [self] + } + } + oo::class create Child { + superclass Super + variable member1 result + constructor {m} { + set [namespace current]::member1 child1 + namespace upvar [info object namespace $m] \ + member1 local1 member2 local2 + upvar 1 member1 local3 member2 local4 + set result [list $local1 $local2 $local3 $local4] + } + method result {} {return $result} + } +} -body { + [[Master new] getChild] result +} -cleanup { + Super destroy +} -result {master1 master2 master1 master2} # A feature that's not supported because the mechanism may change without # warning, but is supposed to work... -- cgit v0.12 From 891343f5d41ec457a94e65d9ae347de0f039c68a Mon Sep 17 00:00:00 2001 From: dgp Date: Wed, 6 Jul 2016 15:12:53 +0000 Subject: [bd7f17bce8] Revise ensemble dispatch to call TclNREvalObjv() which supports the TCL_EVAL_INVOKE flag that is needed. --- generic/tclEnsemble.c | 26 ++++++++++---------------- 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/generic/tclEnsemble.c b/generic/tclEnsemble.c index 818534e..fb41580 100644 --- a/generic/tclEnsemble.c +++ b/generic/tclEnsemble.c @@ -1848,31 +1848,24 @@ NsEnsembleImplementationCmdNR( { Tcl_Obj *copyPtr; /* The actual list of words to dispatch to. * Will be freed by the dispatch engine. */ - int prefixObjc; + Tcl_Obj **copyObjv; + int copyObjc, prefixObjc; Tcl_ListObjLength(NULL, prefixObj, &prefixObjc); - if (0 && objc == 2) { - /* - * Branch disabled until it works. See oo-1[67].1.1 - * - * Key here is the difference between the canonical list invocation - * and compilation/execution paths. - */ - copyPtr = prefixObj; - Tcl_IncrRefCount(copyPtr); - TclNRAddCallback(interp, FreeObj, copyPtr, NULL, NULL, NULL); + if (objc == 2) { + copyPtr = TclListObjCopy(NULL, prefixObj); } else { - int copyObjc = objc - 2 + prefixObjc; - - copyPtr = Tcl_NewListObj(copyObjc, NULL); + copyPtr = Tcl_NewListObj(objc - 2 + prefixObjc, NULL); Tcl_ListObjAppendList(NULL, copyPtr, prefixObj); Tcl_ListObjReplace(NULL, copyPtr, LIST_MAX, 0, - ensemblePtr->numParameters, objv+1); + ensemblePtr->numParameters, objv + 1); Tcl_ListObjReplace(NULL, copyPtr, LIST_MAX, 0, objc - 2 - ensemblePtr->numParameters, objv + 2 + ensemblePtr->numParameters); } + Tcl_IncrRefCount(copyPtr); + TclNRAddCallback(interp, FreeObj, copyPtr, NULL, NULL, NULL); TclDecrRefCount(prefixObj); /* @@ -1892,7 +1885,8 @@ NsEnsembleImplementationCmdNR( */ TclSkipTailcall(interp); - return TclNREvalObjEx(interp, copyPtr, TCL_EVAL_INVOKE, NULL,INT_MIN); + Tcl_ListObjGetElements(NULL, copyPtr, ©Objc, ©Objv); + return TclNREvalObjv(interp, copyObjc, copyObjv, TCL_EVAL_INVOKE, NULL); } unknownOrAmbiguousSubcommand: -- cgit v0.12 From 3b1d8286ed07d9ddcea89d5e11497062a77dc85e Mon Sep 17 00:00:00 2001 From: dgp Date: Wed, 6 Jul 2016 15:50:34 +0000 Subject: Simplify all the Tcl_NRPostProc declarations. --- generic/tclBasic.c | 2 +- generic/tclCmdIL.c | 3 +-- generic/tclCmdMZ.c | 12 ++++-------- generic/tclDictObj.c | 18 ++++++------------ generic/tclIOUtil.c | 3 +-- generic/tclInt.h | 3 +-- generic/tclOO.c | 9 +++------ generic/tclOOCall.c | 9 +++------ generic/tclOOMethod.c | 6 ++---- generic/tclTest.c | 3 +-- 10 files changed, 23 insertions(+), 45 deletions(-) diff --git a/generic/tclBasic.c b/generic/tclBasic.c index b0c31cc..7235be1 100644 --- a/generic/tclBasic.c +++ b/generic/tclBasic.c @@ -128,7 +128,7 @@ static void MathFuncWrongNumArgs(Tcl_Interp *interp, int expected, int actual, Tcl_Obj *const *objv); static Tcl_NRPostProc NRCoroutineCallerCallback; static Tcl_NRPostProc NRCoroutineExitCallback; -static int NRCommand(ClientData data[], Tcl_Interp *interp, int result); +static Tcl_NRPostProc NRCommand; static Tcl_ObjCmdProc OldMathFuncProc; static void OldMathFuncDeleteProc(ClientData clientData); diff --git a/generic/tclCmdIL.c b/generic/tclCmdIL.c index c93e593..0a1b4fe 100644 --- a/generic/tclCmdIL.c +++ b/generic/tclCmdIL.c @@ -105,8 +105,7 @@ typedef struct SortInfo { */ static int DictionaryCompare(const char *left, const char *right); -static int IfConditionCallback(ClientData data[], - Tcl_Interp *interp, int result); +static Tcl_NRPostProc IfConditionCallback; static int InfoArgsCmd(ClientData dummy, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); static int InfoBodyCmd(ClientData dummy, Tcl_Interp *interp, diff --git a/generic/tclCmdMZ.c b/generic/tclCmdMZ.c index 13f9e7d..885a0bc 100644 --- a/generic/tclCmdMZ.c +++ b/generic/tclCmdMZ.c @@ -22,14 +22,10 @@ static inline Tcl_Obj * During(Tcl_Interp *interp, int resultCode, Tcl_Obj *oldOptions, Tcl_Obj *errorInfo); -static int SwitchPostProc(ClientData data[], Tcl_Interp *interp, - int result); -static int TryPostBody(ClientData data[], Tcl_Interp *interp, - int result); -static int TryPostFinal(ClientData data[], Tcl_Interp *interp, - int result); -static int TryPostHandler(ClientData data[], Tcl_Interp *interp, - int result); +static Tcl_NRPostProc SwitchPostProc; +static Tcl_NRPostProc TryPostBody; +static Tcl_NRPostProc TryPostFinal; +static Tcl_NRPostProc TryPostHandler; static int UniCharIsAscii(int character); static int UniCharIsHexDigit(int character); diff --git a/generic/tclDictObj.c b/generic/tclDictObj.c index c8474e6..428173d 100644 --- a/generic/tclDictObj.c +++ b/generic/tclDictObj.c @@ -70,18 +70,12 @@ static inline void DeleteChainTable(struct Dict *dict); static inline Tcl_HashEntry *CreateChainEntry(struct Dict *dict, Tcl_Obj *keyPtr, int *newPtr); static inline int DeleteChainEntry(struct Dict *dict, Tcl_Obj *keyPtr); -static int FinalizeDictUpdate(ClientData data[], - Tcl_Interp *interp, int result); -static int FinalizeDictWith(ClientData data[], - Tcl_Interp *interp, int result); -static int DictForNRCmd(ClientData dummy, Tcl_Interp *interp, - int objc, Tcl_Obj *const *objv); -static int DictMapNRCmd(ClientData dummy, Tcl_Interp *interp, - int objc, Tcl_Obj *const *objv); -static int DictForLoopCallback(ClientData data[], - Tcl_Interp *interp, int result); -static int DictMapLoopCallback(ClientData data[], - Tcl_Interp *interp, int result); +static Tcl_NRPostProc FinalizeDictUpdate; +static Tcl_NRPostProc FinalizeDictWith; +static Tcl_ObjCmdProc DictForNRCmd; +static Tcl_ObjCmdProc DictMapNRCmd; +static Tcl_NRPostProc DictForLoopCallback; +static Tcl_NRPostProc DictMapLoopCallback; /* * Table of dict subcommand names and implementations. diff --git a/generic/tclIOUtil.c b/generic/tclIOUtil.c index 1330c02..3aa0ce5 100644 --- a/generic/tclIOUtil.c +++ b/generic/tclIOUtil.c @@ -71,8 +71,7 @@ typedef struct ThreadSpecificData { * Prototypes for functions defined later in this file. */ -static int EvalFileCallback(ClientData data[], - Tcl_Interp *interp, int result); +static Tcl_NRPostProc EvalFileCallback; static FilesystemRecord*FsGetFirstFilesystem(void); static void FsThrExitProc(ClientData cd); static Tcl_Obj * FsListMounts(Tcl_Obj *pathPtr, const char *pattern); diff --git a/generic/tclInt.h b/generic/tclInt.h index fba4c7b..afed61b 100644 --- a/generic/tclInt.h +++ b/generic/tclInt.h @@ -2851,8 +2851,7 @@ MODULE_SCOPE int TclCheckBadOctal(Tcl_Interp *interp, MODULE_SCOPE int TclChanCaughtErrorBypass(Tcl_Interp *interp, Tcl_Channel chan); MODULE_SCOPE Tcl_ObjCmdProc TclChannelNamesCmd; -MODULE_SCOPE int TclClearRootEnsemble(ClientData data[], - Tcl_Interp *interp, int result); +MODULE_SCOPE Tcl_NRPostProc TclClearRootEnsemble; MODULE_SCOPE ContLineLoc *TclContinuationsEnter(Tcl_Obj *objPtr, int num, int *loc); MODULE_SCOPE void TclContinuationsEnterDerived(Tcl_Obj *objPtr, diff --git a/generic/tclOO.c b/generic/tclOO.c index 0454bfe..ec666ee 100644 --- a/generic/tclOO.c +++ b/generic/tclOO.c @@ -68,12 +68,9 @@ static int CloneObjectMethod(Tcl_Interp *interp, Object *oPtr, static void DeletedDefineNamespace(ClientData clientData); static void DeletedObjdefNamespace(ClientData clientData); static void DeletedHelpersNamespace(ClientData clientData); -static int FinalizeAlloc(ClientData data[], - Tcl_Interp *interp, int result); -static int FinalizeNext(ClientData data[], - Tcl_Interp *interp, int result); -static int FinalizeObjectCall(ClientData data[], - Tcl_Interp *interp, int result); +static Tcl_NRPostProc FinalizeAlloc; +static Tcl_NRPostProc FinalizeNext; +static Tcl_NRPostProc FinalizeObjectCall; static int InitFoundation(Tcl_Interp *interp); static void KillFoundation(ClientData clientData, Tcl_Interp *interp); diff --git a/generic/tclOOCall.c b/generic/tclOOCall.c index facf90d..1797760 100644 --- a/generic/tclOOCall.c +++ b/generic/tclOOCall.c @@ -70,15 +70,12 @@ static void AddSimpleClassChainToCallContext(Class *classPtr, Class *const filterDecl); static int CmpStr(const void *ptr1, const void *ptr2); static void DupMethodNameRep(Tcl_Obj *srcPtr, Tcl_Obj *dstPtr); -static int FinalizeMethodRefs(ClientData data[], - Tcl_Interp *interp, int result); +static Tcl_NRPostProc FinalizeMethodRefs; static void FreeMethodNameRep(Tcl_Obj *objPtr); static inline int IsStillValid(CallChain *callPtr, Object *oPtr, int flags, int reuseMask); -static int ResetFilterFlags(ClientData data[], - Tcl_Interp *interp, int result); -static int SetFilterFlags(ClientData data[], - Tcl_Interp *interp, int result); +static Tcl_NRPostProc ResetFilterFlags; +static Tcl_NRPostProc SetFilterFlags; static inline void StashCallChain(Tcl_Obj *objPtr, CallChain *callPtr); /* diff --git a/generic/tclOOMethod.c b/generic/tclOOMethod.c index a311ddb..99a8bfc 100644 --- a/generic/tclOOMethod.c +++ b/generic/tclOOMethod.c @@ -70,10 +70,8 @@ static Tcl_Obj ** InitEnsembleRewrite(Tcl_Interp *interp, int objc, static int InvokeProcedureMethod(ClientData clientData, Tcl_Interp *interp, Tcl_ObjectContext context, int objc, Tcl_Obj *const *objv); -static int FinalizeForwardCall(ClientData data[], Tcl_Interp *interp, - int result); -static int FinalizePMCall(ClientData data[], Tcl_Interp *interp, - int result); +static Tcl_NRPostProc FinalizeForwardCall; +static Tcl_NRPostProc FinalizePMCall; static int PushMethodCallFrame(Tcl_Interp *interp, CallContext *contextPtr, ProcedureMethod *pmPtr, int objc, Tcl_Obj *const *objv, diff --git a/generic/tclTest.c b/generic/tclTest.c index 4695ab5..e33d263 100644 --- a/generic/tclTest.c +++ b/generic/tclTest.c @@ -413,8 +413,7 @@ static int TestHashSystemHashCmd(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); -static int NREUnwind_callback(ClientData data[], Tcl_Interp *interp, - int result); +static Tcl_NRPostProc NREUnwind_callback; static int TestNREUnwind(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); -- cgit v0.12 From 5afe70d02240e1acbe825478808f3ef27847c025 Mon Sep 17 00:00:00 2001 From: dgp Date: Wed, 6 Jul 2016 16:47:37 +0000 Subject: Create and use a utility Tcl_NRPostProc when decr ref count of values is all that is needed. --- generic/tclBasic.c | 19 +++++++++++++------ generic/tclEnsemble.c | 17 ++--------------- generic/tclInt.h | 1 + 3 files changed, 16 insertions(+), 21 deletions(-) diff --git a/generic/tclBasic.c b/generic/tclBasic.c index 7235be1..d6a460d 100644 --- a/generic/tclBasic.c +++ b/generic/tclBasic.c @@ -146,7 +146,6 @@ static int TEOV_RunEnterTraces(Tcl_Interp *interp, Command **cmdPtrPtr, Tcl_Obj *commandPtr, int objc, Tcl_Obj *const objv[]); static Tcl_NRPostProc RewindCoroutineCallback; -static Tcl_NRPostProc TailcallCleanup; static Tcl_NRPostProc TEOEx_ByteCodeCallback; static Tcl_NRPostProc TEOEx_ListCallback; static Tcl_NRPostProc TEOV_Error; @@ -8371,7 +8370,7 @@ TclNRTailcallEval( * a now-gone namespace: cleanup and return. */ - TailcallCleanup(data, interp, result); + Tcl_DecrRefCount(listPtr); return result; } @@ -8380,18 +8379,26 @@ TclNRTailcallEval( */ TclMarkTailcall(interp); - TclNRAddCallback(interp, TailcallCleanup, listPtr, NULL, NULL,NULL); + TclNRAddCallback(interp, TclNRReleaseValues, listPtr, NULL, NULL,NULL); iPtr->lookupNsPtr = (Namespace *) nsPtr; return TclNREvalObjv(interp, objc-1, objv+1, 0, NULL); } -static int -TailcallCleanup( +int +TclNRReleaseValues( ClientData data[], Tcl_Interp *interp, int result) { - Tcl_DecrRefCount((Tcl_Obj *) data[0]); + int i = 0; + while (i < 4) { + if (data[i]) { + Tcl_DecrRefCount((Tcl_Obj *) data[i]); + } else { + break; + } + i++; + } return result; } diff --git a/generic/tclEnsemble.c b/generic/tclEnsemble.c index fb41580..ee81aee 100644 --- a/generic/tclEnsemble.c +++ b/generic/tclEnsemble.c @@ -41,7 +41,6 @@ static int CompileBasicNArgCommand(Tcl_Interp *interp, Tcl_Parse *parsePtr, Command *cmdPtr, CompileEnv *envPtr); -static Tcl_NRPostProc FreeObj; static Tcl_NRPostProc FreeER; /* @@ -1865,7 +1864,7 @@ NsEnsembleImplementationCmdNR( objv + 2 + ensemblePtr->numParameters); } Tcl_IncrRefCount(copyPtr); - TclNRAddCallback(interp, FreeObj, copyPtr, NULL, NULL, NULL); + TclNRAddCallback(interp, TclNRReleaseValues, copyPtr, NULL, NULL, NULL); TclDecrRefCount(prefixObj); /* @@ -2064,18 +2063,6 @@ FreeER( return result; } -static int -FreeObj( - ClientData data[], - Tcl_Interp *interp, - int result) -{ - Tcl_Obj *objPtr = (Tcl_Obj *)data[0]; - - Tcl_DecrRefCount(objPtr); - return result; -} - void TclSpellFix( Tcl_Interp *interp, @@ -2151,7 +2138,7 @@ TclSpellFix( store[idx] = fix; Tcl_IncrRefCount(fix); - TclNRAddCallback(interp, FreeObj, fix, NULL, NULL, NULL); + TclNRAddCallback(interp, TclNRReleaseValues, fix, NULL, NULL, NULL); } /* diff --git a/generic/tclInt.h b/generic/tclInt.h index afed61b..a6cc627 100644 --- a/generic/tclInt.h +++ b/generic/tclInt.h @@ -2741,6 +2741,7 @@ MODULE_SCOPE Tcl_ObjCmdProc TclNRYieldObjCmd; MODULE_SCOPE Tcl_ObjCmdProc TclNRYieldmObjCmd; MODULE_SCOPE Tcl_ObjCmdProc TclNRYieldToObjCmd; MODULE_SCOPE Tcl_ObjCmdProc TclNRInvoke; +MODULE_SCOPE Tcl_NRPostProc TclNRReleaseValues; MODULE_SCOPE void TclSetTailcall(Tcl_Interp *interp, Tcl_Obj *tailcallPtr); MODULE_SCOPE void TclPushTailcallPoint(Tcl_Interp *interp); -- cgit v0.12 From 0aa3b5113db3c6c750aa4bbcfdb657dec48c0de1 Mon Sep 17 00:00:00 2001 From: ashok Date: Thu, 7 Jul 2016 06:30:58 +0000 Subject: Bugfix [5d7ea04580]. Treat .cmd and .ps1 files are executable on Windows. --- doc/file.n | 4 +++- tests/cmdAH.test | 23 +++++++++++------------ tests/fileName.test | 14 ++++++++------ win/tclWinFile.c | 4 +++- 4 files changed, 25 insertions(+), 20 deletions(-) diff --git a/doc/file.n b/doc/file.n index 8e765da..eeb67ed 100644 --- a/doc/file.n +++ b/doc/file.n @@ -162,7 +162,9 @@ returns \fB/home\fR (or something similar). \fBfile executable \fIname\fR . Returns \fB1\fR if file \fIname\fR is executable by the current user, -\fB0\fR otherwise. +\fB0\fR otherwise. On Windows, which does not have an executable attribute, +the command treats all directories and any files with extensions +\fBexe\fR, \fBcom\fR, \fBcmd\fR, \fBbat\fR or \fBps1\fR as executable. .TP \fBfile exists \fIname\fR . diff --git a/tests/cmdAH.test b/tests/cmdAH.test index 64cfeba..f2f7f8c 100644 --- a/tests/cmdAH.test +++ b/tests/cmdAH.test @@ -879,19 +879,18 @@ test cmdAH-18.3 {Tcl_FileObjCmd: executable} {unix testchmod} { test cmdAH-18.5 {Tcl_FileObjCmd: executable} -constraints {win} -body { # On pc, must be a .exe, .com, etc. set x [file exe $gorpfile] - set gorpexe [makeFile foo gorp.exe] - lappend x [file exe $gorpexe] -} -cleanup { - removeFile $gorpexe -} -result {0 1} -test cmdAH-18.5.1 {Tcl_FileObjCmd: executable} -constraints {win} -body { - # On pc, must be a .exe, .com, etc. - set x [file exe $gorpfile] - set gorpexe [makeFile foo gorp.exe] - lappend x [file exe [string toupper $gorpexe]] + set gorpexes {} + foreach ext {exe com cmd bat ps1} { + set gorpexe [makeFile foo gorp.$ext] + lappend gorpexes $gorpexe + lappend x [file exe $gorpexe] [file exe [string toupper $gorpexe]] + } + set x } -cleanup { - removeFile $gorpexe -} -result {0 1} + foreach gorpexe $gorpexes { + removeFile $gorpexe + } +} -result {0 1 1 1 1 1 1 1 1 1 1} test cmdAH-18.6 {Tcl_FileObjCmd: executable} {} { # Directories are always executable. file exe $dirfile diff --git a/tests/fileName.test b/tests/fileName.test index 51f00d1..a19bd1e 100644 --- a/tests/fileName.test +++ b/tests/fileName.test @@ -1468,14 +1468,16 @@ if {[testConstraint testsetplatform]} { } test filename-17.2 {windows specific glob with executable} -body { makeDirectory execglob - makeFile contents execglob/abc.exe - makeFile contents execglob/abc.notexecutable - glob -nocomplain -dir [temporaryDirectory]/execglob -tails -types x * + foreach ext {exe com cmd bat ps1 notexecutable} { + makeFile contents execglob/abc.$ext + } + lsort [glob -nocomplain -dir [temporaryDirectory]/execglob -tails -types x *] } -constraints {win} -cleanup { - removeFile execglob/abc.exe - removeFile execglob/abc.notexecutable + foreach ext {exe com cmd bat ps1 notexecutable} { + removeFile execglob/abc.$ext + } removeDirectory execglob -} -result {abc.exe} +} -result {abc.bat abc.cmd abc.com abc.exe abc.ps1} test filename-17.3 {Bug 2571597} win { set p /a file pathtype $p diff --git a/win/tclWinFile.c b/win/tclWinFile.c index 25c6ea4..4b0b884 100755 --- a/win/tclWinFile.c +++ b/win/tclWinFile.c @@ -1769,7 +1769,7 @@ NativeAccess( * NativeIsExec -- * * Determines if a path is executable. On windows this is simply defined - * by whether the path ends in any of ".exe", ".com", or ".bat" + * by whether the path ends in a standard executable extension. * * Results: * 1 = executable, 0 = not. @@ -1793,6 +1793,8 @@ NativeIsExec( if ((_tcsicmp(path+len-3, TEXT("exe")) == 0) || (_tcsicmp(path+len-3, TEXT("com")) == 0) + || (_tcsicmp(path+len-3, TEXT("cmd")) == 0) + || (_tcsicmp(path+len-3, TEXT("ps1")) == 0) || (_tcsicmp(path+len-3, TEXT("bat")) == 0)) { return 1; } -- cgit v0.12 From cb3f1f4d66a91e4efc123a4518e8fa171af58145 Mon Sep 17 00:00:00 2001 From: dkf Date: Thu, 7 Jul 2016 08:35:30 +0000 Subject: Also test the interpreted path. --- tests/oo.test | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/tests/oo.test b/tests/oo.test index 88e1124..2601c37 100644 --- a/tests/oo.test +++ b/tests/oo.test @@ -3442,10 +3442,12 @@ test oo-27.23 {variable resolver leakage: Bug 1493a43044} -setup { variable member1 result constructor {m} { set [namespace current]::member1 child1 - namespace upvar [info object namespace $m] \ - member1 local1 member2 local2 - upvar 1 member1 local3 member2 local4 - set result [list $local1 $local2 $local3 $local4] + set ns [info object namespace $m] + namespace upvar $ns member1 l1 member2 l2 + upvar 1 member1 l3 member2 l4 + [format namespace] upvar $ns member1 l5 member2 l6 + [format upvar] 1 member1 l7 member2 l8 + set result [list $l1 $l2 $l3 $l4 $l5 $l6 $l7 $l8] } method result {} {return $result} } @@ -3453,7 +3455,7 @@ test oo-27.23 {variable resolver leakage: Bug 1493a43044} -setup { [[Master new] getChild] result } -cleanup { Super destroy -} -result {master1 master2 master1 master2} +} -result {master1 master2 master1 master2 master1 master2 master1 master2} # A feature that's not supported because the mechanism may change without # warning, but is supposed to work... -- cgit v0.12 From 38f4a53699309fdec415cf81e5c2ba6137ff8cf4 Mon Sep 17 00:00:00 2001 From: dkf Date: Thu, 7 Jul 2016 10:08:44 +0000 Subject: Expose the AVOID_RESOLVERS flag to [namespace upvar] implementations, which seem to need it. --- generic/tclExecute.c | 4 ++-- generic/tclInt.h | 15 ++++++++++++++ generic/tclNamesp.c | 4 ++-- generic/tclVar.c | 55 ++++++++++++++++++++-------------------------------- 4 files changed, 40 insertions(+), 38 deletions(-) diff --git a/generic/tclExecute.c b/generic/tclExecute.c index 1389382..8ddefda 100644 --- a/generic/tclExecute.c +++ b/generic/tclExecute.c @@ -4413,8 +4413,8 @@ TEBCresume( savedNsPtr = iPtr->varFramePtr->nsPtr; iPtr->varFramePtr->nsPtr = (Namespace *) nsPtr; otherPtr = TclObjLookupVarEx(interp, OBJ_AT_TOS, NULL, - (TCL_NAMESPACE_ONLY | TCL_LEAVE_ERR_MSG), "access", - /*createPart1*/ 1, /*createPart2*/ 1, &varPtr); + (TCL_NAMESPACE_ONLY|TCL_LEAVE_ERR_MSG|TCL_AVOID_RESOLVERS), + "access", /*createPart1*/ 1, /*createPart2*/ 1, &varPtr); iPtr->varFramePtr->nsPtr = savedNsPtr; if (!otherPtr) { TRACE_ERROR(interp); diff --git a/generic/tclInt.h b/generic/tclInt.h index fba4c7b..6d2db5d 100644 --- a/generic/tclInt.h +++ b/generic/tclInt.h @@ -170,6 +170,21 @@ typedef struct Tcl_ResolverInfo { } Tcl_ResolverInfo; /* + * This flag bit should not interfere with TCL_GLOBAL_ONLY, + * TCL_NAMESPACE_ONLY, or TCL_LEAVE_ERR_MSG; it signals that the variable + * lookup is performed for upvar (or similar) purposes, with slightly + * different rules: + * - Bug #696893 - variable is either proc-local or in the current + * namespace; never follow the second (global) resolution path + * - Bug #631741 - do not use special namespace or interp resolvers + * + * It should also not collide with the (deprecated) TCL_PARSE_PART1 flag + * (Bug #835020) + */ + +#define TCL_AVOID_RESOLVERS 0x40000 + +/* *---------------------------------------------------------------- * Data structures related to namespaces. *---------------------------------------------------------------- diff --git a/generic/tclNamesp.c b/generic/tclNamesp.c index 2c50a60..5930859 100644 --- a/generic/tclNamesp.c +++ b/generic/tclNamesp.c @@ -4538,8 +4538,8 @@ NamespaceUpvarCmd( savedNsPtr = (Tcl_Namespace *) iPtr->varFramePtr->nsPtr; iPtr->varFramePtr->nsPtr = (Namespace *) nsPtr; otherPtr = TclObjLookupVarEx(interp, objv[0], NULL, - (TCL_NAMESPACE_ONLY | TCL_LEAVE_ERR_MSG), "access", - /*createPart1*/ 1, /*createPart2*/ 1, &arrayPtr); + (TCL_NAMESPACE_ONLY|TCL_LEAVE_ERR_MSG|TCL_AVOID_RESOLVERS), + "access", /*createPart1*/ 1, /*createPart2*/ 1, &arrayPtr); iPtr->varFramePtr->nsPtr = (Namespace *) savedNsPtr; if (otherPtr == NULL) { return TCL_ERROR; diff --git a/generic/tclVar.c b/generic/tclVar.c index 51e2482..47c6e14 100644 --- a/generic/tclVar.c +++ b/generic/tclVar.c @@ -742,21 +742,6 @@ TclObjLookupVarEx( } /* - * This flag bit should not interfere with TCL_GLOBAL_ONLY, - * TCL_NAMESPACE_ONLY, or TCL_LEAVE_ERR_MSG; it signals that the variable - * lookup is performed for upvar (or similar) purposes, with slightly - * different rules: - * - Bug #696893 - variable is either proc-local or in the current - * namespace; never follow the second (global) resolution path - * - Bug #631741 - do not use special namespace or interp resolvers - * - * It should also not collide with the (deprecated) TCL_PARSE_PART1 flag - * (Bug #835020) - */ - -#define AVOID_RESOLVERS 0x40000 - -/* *---------------------------------------------------------------------- * * TclLookupSimpleVar -- @@ -805,8 +790,8 @@ TclLookupSimpleVar( Tcl_Obj *varNamePtr, /* This is a simple variable name that could * represent a scalar or an array. */ int flags, /* Only TCL_GLOBAL_ONLY, TCL_NAMESPACE_ONLY, - * AVOID_RESOLVERS and TCL_LEAVE_ERR_MSG bits - * matter. */ + * TCL_AVOID_RESOLVERS and TCL_LEAVE_ERR_MSG + * bits matter. */ const int create, /* If 1, create hash table entry for varname, * if it doesn't already exist. If 0, return * error if it doesn't exist. */ @@ -846,7 +831,7 @@ TclLookupSimpleVar( */ if ((cxtNsPtr->varResProc != NULL || iPtr->resolverPtr != NULL) - && !(flags & AVOID_RESOLVERS)) { + && !(flags & TCL_AVOID_RESOLVERS)) { resPtr = iPtr->resolverPtr; if (cxtNsPtr->varResProc) { result = cxtNsPtr->varResProc(interp, varName, @@ -899,7 +884,7 @@ TclLookupSimpleVar( *indexPtr = -1; flags = (flags | TCL_GLOBAL_ONLY) & ~TCL_NAMESPACE_ONLY; } else { - if (flags & AVOID_RESOLVERS) { + if (flags & TCL_AVOID_RESOLVERS) { flags = (flags | TCL_NAMESPACE_ONLY); } if (flags & TCL_NAMESPACE_ONLY) { @@ -914,7 +899,7 @@ TclLookupSimpleVar( varPtr = (Var *) ObjFindNamespaceVar(interp, varNamePtr, (Tcl_Namespace *) cxtNsPtr, - (flags | AVOID_RESOLVERS) & ~TCL_LEAVE_ERR_MSG); + (flags | TCL_AVOID_RESOLVERS) & ~TCL_LEAVE_ERR_MSG); if (varPtr == NULL) { Tcl_Obj *tailPtr; @@ -4396,15 +4381,15 @@ TclPtrObjMakeUpvar( /* * Lookup and eventually create the new variable. Set the flag bit - * AVOID_RESOLVERS to indicate the special resolution rules for upvar - * purposes: + * TCL_AVOID_RESOLVERS to indicate the special resolution rules for + * upvar purposes: * - Bug #696893 - variable is either proc-local or in the current * namespace; never follow the second (global) resolution path. * - Bug #631741 - do not use special namespace or interp resolvers. */ varPtr = TclLookupSimpleVar(interp, myNamePtr, - myFlags|AVOID_RESOLVERS, /* create */ 1, &errMsg, &index); + myFlags|TCL_AVOID_RESOLVERS, /* create */ 1, &errMsg, &index); if (varPtr == NULL) { TclObjVarErrMsg(interp, myNamePtr, NULL, "create", errMsg, -1); Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "VARNAME", @@ -5695,11 +5680,12 @@ Tcl_FindNamespaceVar( * Otherwise, points to namespace in which to * resolve name. If NULL, look up name in the * current namespace. */ - int flags) /* An OR'd combination of: AVOID_RESOLVERS, - * TCL_GLOBAL_ONLY (look up name only in - * global namespace), TCL_NAMESPACE_ONLY (look - * up only in contextNsPtr, or the current - * namespace if contextNsPtr is NULL), and + int flags) /* An OR'd combination of: + * TCL_AVOID_RESOLVERS, TCL_GLOBAL_ONLY (look + * up name only in global namespace), + * TCL_NAMESPACE_ONLY (look up only in + * contextNsPtr, or the current namespace if + * contextNsPtr is NULL), and * TCL_LEAVE_ERR_MSG. If both TCL_GLOBAL_ONLY * and TCL_NAMESPACE_ONLY are given, * TCL_GLOBAL_ONLY is ignored. */ @@ -5725,11 +5711,12 @@ ObjFindNamespaceVar( * Otherwise, points to namespace in which to * resolve name. If NULL, look up name in the * current namespace. */ - int flags) /* An OR'd combination of: AVOID_RESOLVERS, - * TCL_GLOBAL_ONLY (look up name only in - * global namespace), TCL_NAMESPACE_ONLY (look - * up only in contextNsPtr, or the current - * namespace if contextNsPtr is NULL), and + int flags) /* An OR'd combination of: + * TCL_AVOID_RESOLVERS, TCL_GLOBAL_ONLY (look + * up name only in global namespace), + * TCL_NAMESPACE_ONLY (look up only in + * contextNsPtr, or the current namespace if + * contextNsPtr is NULL), and * TCL_LEAVE_ERR_MSG. If both TCL_GLOBAL_ONLY * and TCL_NAMESPACE_ONLY are given, * TCL_GLOBAL_ONLY is ignored. */ @@ -5759,7 +5746,7 @@ ObjFindNamespaceVar( cxtNsPtr = (Namespace *) TclGetCurrentNamespace(interp); } - if (!(flags & AVOID_RESOLVERS) && + if (!(flags & TCL_AVOID_RESOLVERS) && (cxtNsPtr->varResProc != NULL || iPtr->resolverPtr != NULL)) { resPtr = iPtr->resolverPtr; -- cgit v0.12 From fc2bc121acb78c5544d30d1e7ceb507397fe3e78 Mon Sep 17 00:00:00 2001 From: dgp Date: Thu, 7 Jul 2016 18:44:56 +0000 Subject: To use a Tcl_Command token [aka (Command *)] for epoch checking, we must not permit it to be freed while we hold it or else it could be mistaken for another token allocated later that just happens to reside at the same address. (Command *) preservation machinery already exists, just need to use it. An extension facing the same problem might have to rely on command delete traces. Earlier revisions used (Namespace *) lifetime to achieve the same results, but that's really an indirect (possibly non-robust) path to achieving the proper goal. Valgrind is happy now. --- generic/tclEnsemble.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/generic/tclEnsemble.c b/generic/tclEnsemble.c index 5c47ce3..24b6b9a 100644 --- a/generic/tclEnsemble.c +++ b/generic/tclEnsemble.c @@ -93,7 +93,7 @@ typedef struct { int epoch; /* Used to confirm when the data in this * really structure matches up with the * ensemble. */ - Tcl_Command token; /* Reference to the comamnd for which this + Command *token; /* Reference to the command for which this * structure is a cache of the resolution. */ Tcl_Obj *fix; /* Corrected spelling, if needed. */ Tcl_HashEntry *hPtr; /* Direct link to entry in the subcommand @@ -1727,7 +1727,7 @@ NsEnsembleImplementationCmdNR( EnsembleCmdRep *ensembleCmd = subObj->internalRep.twoPtrValue.ptr1; if (ensembleCmd->epoch == ensemblePtr->epoch && - ensembleCmd->token == ensemblePtr->token) { + ensembleCmd->token == (Command *)ensemblePtr->token) { prefixObj = Tcl_GetHashValue(ensembleCmd->hPtr); Tcl_IncrRefCount(prefixObj); if (ensembleCmd->fix) { @@ -2404,7 +2404,8 @@ MakeCachedEnsembleCommand( */ ensembleCmd->epoch = ensemblePtr->epoch; - ensembleCmd->token = ensemblePtr->token; + ensembleCmd->token = (Command *) ensemblePtr->token; + ensembleCmd->token->refCount++; if (fix) { Tcl_IncrRefCount(fix); } @@ -2790,6 +2791,7 @@ FreeEnsembleCmdRep( { EnsembleCmdRep *ensembleCmd = objPtr->internalRep.twoPtrValue.ptr1; + TclCleanupCommandMacro(ensembleCmd->token); if (ensembleCmd->fix) { Tcl_DecrRefCount(ensembleCmd->fix); } @@ -2827,6 +2829,7 @@ DupEnsembleCmdRep( copyPtr->internalRep.twoPtrValue.ptr1 = ensembleCopy; ensembleCopy->epoch = ensembleCmd->epoch; ensembleCopy->token = ensembleCmd->token; + ensembleCopy->token->refCount++; ensembleCopy->fix = ensembleCmd->fix; if (ensembleCopy->fix) { Tcl_IncrRefCount(ensembleCopy->fix); -- cgit v0.12 From 1d9f88074f824a962f99296d5aefece2fa918a99 Mon Sep 17 00:00:00 2001 From: dgp Date: Thu, 7 Jul 2016 19:50:02 +0000 Subject: Missed a cleanup line, which created a memleak. --- generic/tclEnsemble.c | 1 + 1 file changed, 1 insertion(+) diff --git a/generic/tclEnsemble.c b/generic/tclEnsemble.c index 24b6b9a..d2bd0a2 100644 --- a/generic/tclEnsemble.c +++ b/generic/tclEnsemble.c @@ -2384,6 +2384,7 @@ MakeCachedEnsembleCommand( if (objPtr->typePtr == &ensembleCmdType) { ensembleCmd = objPtr->internalRep.twoPtrValue.ptr1; + TclCleanupCommandMacro(ensembleCmd->token); if (ensembleCmd->fix) { Tcl_DecrRefCount(ensembleCmd->fix); } -- cgit v0.12 From 6e64f64efb7bf46602985c83e4ec87bfdefc8289 Mon Sep 17 00:00:00 2001 From: ashok Date: Fri, 8 Jul 2016 07:58:00 +0000 Subject: Bug [a47641a031]. TclJoinPath was calling TclNewFSPathObj with a first argument that was not an absolute path. Added a check for that. Fixes Windows test failures fileSystem-1.{3,4} --- generic/tclPathObj.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/generic/tclPathObj.c b/generic/tclPathObj.c index 99d576d..c2643bf 100644 --- a/generic/tclPathObj.c +++ b/generic/tclPathObj.c @@ -869,12 +869,16 @@ TclJoinPath( * object which can be normalized more efficiently. Currently we only * use the special case when we have exactly two elements, but we * could expand that in the future. + * + * Bugfix [a47641a0]. TclNewFSPathObj requires first argument + * to be an absolute path. Added a check for that elt is absolute. */ if ((i == (elements-2)) && (i == 0) - && (elt->typePtr == &tclFsPathType) - && !((elt->bytes != NULL) && (elt->bytes[0] == '\0'))) { - Tcl_Obj *tailObj = objv[i+1]; + && (elt->typePtr == &tclFsPathType) + && !((elt->bytes != NULL) && (elt->bytes[0] == '\0')) + && TclGetPathType(elt, NULL, NULL, NULL) == TCL_PATH_ABSOLUTE) { + Tcl_Obj *tailObj = objv[i+1]; type = TclGetPathType(tailObj, NULL, NULL, NULL); if (type == TCL_PATH_RELATIVE) { -- cgit v0.12 From f84ad84e4153f7bdce3247e5f5ab7477e74db51f Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Fri, 8 Jul 2016 10:28:48 +0000 Subject: Micro-optimization: Use TclGetStringFromObj in stead of Tcl_GetStringFromObj in many places where possible. --- generic/tclAssembly.c | 6 +++--- generic/tclBasic.c | 14 ++++++------- generic/tclBinary.c | 2 +- generic/tclCompCmds.c | 12 +++++------ generic/tclCompCmdsGR.c | 4 ++-- generic/tclCompCmdsSZ.c | 18 ++++++++-------- generic/tclCompile.c | 8 ++++---- generic/tclDisassemble.c | 4 ++-- generic/tclEncoding.c | 2 +- generic/tclEnsemble.c | 8 ++++---- generic/tclExecute.c | 6 +++--- generic/tclFileName.c | 32 ++++++++++++++--------------- generic/tclIORChan.c | 8 ++++---- generic/tclIORTrans.c | 4 ++-- generic/tclIOUtil.c | 28 ++++++++++++------------- generic/tclIndexObj.c | 10 ++++----- generic/tclInterp.c | 10 ++++----- generic/tclLink.c | 2 +- generic/tclLiteral.c | 8 ++++---- generic/tclMain.c | 8 ++++---- generic/tclOODefineCmds.c | 10 ++++----- generic/tclOOMethod.c | 2 +- generic/tclObj.c | 4 ++-- generic/tclOptimize.c | 4 ++-- generic/tclParse.c | 4 ++-- generic/tclPathObj.c | 52 +++++++++++++++++++++++------------------------ generic/tclPkg.c | 8 ++++---- generic/tclProc.c | 6 +++--- generic/tclStringObj.c | 2 +- generic/tclTimer.c | 4 ++-- generic/tclTrace.c | 8 ++++---- generic/tclUtil.c | 6 +++--- generic/tclZlib.c | 6 +++--- macosx/tclMacOSXFCmd.c | 2 +- unix/dltest/pkgua.c | 5 ++--- unix/tclUnixFCmd.c | 12 +++++------ unix/tclUnixFile.c | 6 +++--- unix/tclUnixInit.c | 2 +- win/tclWinFCmd.c | 6 +++--- win/tclWinFile.c | 8 ++++---- win/tclWinInit.c | 2 +- 41 files changed, 176 insertions(+), 177 deletions(-) diff --git a/generic/tclAssembly.c b/generic/tclAssembly.c index 8dd23a0..7a5ffcc 100644 --- a/generic/tclAssembly.c +++ b/generic/tclAssembly.c @@ -1299,7 +1299,7 @@ AssembleOneLine( if (GetNextOperand(assemEnvPtr, &tokenPtr, &operand1Obj) != TCL_OK) { goto cleanup; } - operand1 = Tcl_GetStringFromObj(operand1Obj, &operand1Len); + operand1 = TclGetStringFromObj(operand1Obj, &operand1Len); litIndex = TclRegisterNewLiteral(envPtr, operand1, operand1Len); BBEmitInst1or4(assemEnvPtr, tblIdx, litIndex, 0); break; @@ -1448,7 +1448,7 @@ AssembleOneLine( &operand1Obj) != TCL_OK) { goto cleanup; } else { - operand1 = Tcl_GetStringFromObj(operand1Obj, &operand1Len); + operand1 = TclGetStringFromObj(operand1Obj, &operand1Len); litIndex = TclRegisterNewLiteral(envPtr, operand1, operand1Len); /* @@ -2288,7 +2288,7 @@ FindLocalVar( if (GetNextOperand(assemEnvPtr, tokenPtrPtr, &varNameObj) != TCL_OK) { return -1; } - varNameStr = Tcl_GetStringFromObj(varNameObj, &varNameLen); + varNameStr = TclGetStringFromObj(varNameObj, &varNameLen); if (CheckNamespaceQualifiers(interp, varNameStr, varNameLen)) { Tcl_DecrRefCount(varNameObj); return -1; diff --git a/generic/tclBasic.c b/generic/tclBasic.c index a0b5505..53023d8 100644 --- a/generic/tclBasic.c +++ b/generic/tclBasic.c @@ -3943,7 +3943,7 @@ Tcl_Canceled( */ if (iPtr->asyncCancelMsg != NULL) { - message = Tcl_GetStringFromObj(iPtr->asyncCancelMsg, &length); + message = TclGetStringFromObj(iPtr->asyncCancelMsg, &length); } else { length = 0; } @@ -4042,7 +4042,7 @@ Tcl_CancelEval( */ if (resultObjPtr != NULL) { - result = Tcl_GetStringFromObj(resultObjPtr, &cancelInfo->length); + result = TclGetStringFromObj(resultObjPtr, &cancelInfo->length); cancelInfo->result = ckrealloc(cancelInfo->result,cancelInfo->length); memcpy(cancelInfo->result, result, (size_t) cancelInfo->length); TclDecrRefCount(resultObjPtr); /* Discard their result object. */ @@ -4554,7 +4554,7 @@ TEOV_Error( */ listPtr = Tcl_NewListObj(objc, objv); - cmdString = Tcl_GetStringFromObj(listPtr, &cmdLen); + cmdString = TclGetStringFromObj(listPtr, &cmdLen); Tcl_LogCommandInfo(interp, cmdString, cmdString, cmdLen); Tcl_DecrRefCount(listPtr); } @@ -4700,7 +4700,7 @@ TEOV_RunEnterTraces( Command *cmdPtr = *cmdPtrPtr; int newEpoch, cmdEpoch = cmdPtr->cmdEpoch; int length, traceCode = TCL_OK; - const char *command = Tcl_GetStringFromObj(commandPtr, &length); + const char *command = TclGetStringFromObj(commandPtr, &length); /* * Call trace functions. @@ -4752,7 +4752,7 @@ TEOV_RunLeaveTraces( Command *cmdPtr = data[2]; Tcl_Obj **objv = data[3]; int length; - const char *command = Tcl_GetStringFromObj(commandPtr, &length); + const char *command = TclGetStringFromObj(commandPtr, &length); if (!(cmdPtr->flags & CMD_IS_DELETED)) { if (cmdPtr->flags & CMD_HAS_EXEC_TRACES){ @@ -6117,7 +6117,7 @@ TclNREvalObjEx( Tcl_IncrRefCount(objPtr); - script = Tcl_GetStringFromObj(objPtr, &numSrcBytes); + script = TclGetStringFromObj(objPtr, &numSrcBytes); result = Tcl_EvalEx(interp, script, numSrcBytes, flags); TclDecrRefCount(objPtr); @@ -6148,7 +6148,7 @@ TEOEx_ByteCodeCallback( ProcessUnexpectedResult(interp, result); result = TCL_ERROR; - script = Tcl_GetStringFromObj(objPtr, &numSrcBytes); + script = TclGetStringFromObj(objPtr, &numSrcBytes); Tcl_LogCommandInfo(interp, script, script, numSrcBytes); } diff --git a/generic/tclBinary.c b/generic/tclBinary.c index 981f174..9a5771e 100644 --- a/generic/tclBinary.c +++ b/generic/tclBinary.c @@ -2500,7 +2500,7 @@ BinaryEncode64( } break; case OPT_WRAPCHAR: - wrapchar = Tcl_GetStringFromObj(objv[i+1], &wrapcharlen); + wrapchar = TclGetStringFromObj(objv[i+1], &wrapcharlen); if (wrapcharlen == 0) { maxlen = 0; } diff --git a/generic/tclCompCmds.c b/generic/tclCompCmds.c index 3ab03cc..bce17dc 100644 --- a/generic/tclCompCmds.c +++ b/generic/tclCompCmds.c @@ -801,7 +801,7 @@ TclCompileConcatCmd( Tcl_ListObjGetElements(NULL, listObj, &len, &objs); objPtr = Tcl_ConcatObj(len, objs); Tcl_DecrRefCount(listObj); - bytes = Tcl_GetStringFromObj(objPtr, &len); + bytes = TclGetStringFromObj(objPtr, &len); PushLiteral(envPtr, bytes, len); Tcl_DecrRefCount(objPtr); return TCL_OK; @@ -1209,7 +1209,7 @@ TclCompileDictCreateCmd( * We did! Excellent. The "verifyDict" is to do type forcing. */ - bytes = Tcl_GetStringFromObj(dictObj, &len); + bytes = TclGetStringFromObj(dictObj, &len); PushLiteral(envPtr, bytes, len); TclEmitOpcode( INST_DUP, envPtr); TclEmitOpcode( INST_DICT_VERIFY, envPtr); @@ -2650,7 +2650,7 @@ CompileEachloopCmd( int numBytes, varIndex; Tcl_ListObjIndex(NULL, varListObj, j, &varNameObj); - bytes = Tcl_GetStringFromObj(varNameObj, &numBytes); + bytes = TclGetStringFromObj(varNameObj, &numBytes); varIndex = LocalScalar(bytes, numBytes, envPtr); if (varIndex < 0) { code = TCL_ERROR; @@ -3087,7 +3087,7 @@ TclCompileFormatCmd( * literal. Job done. */ - bytes = Tcl_GetStringFromObj(tmpObj, &len); + bytes = TclGetStringFromObj(tmpObj, &len); PushLiteral(envPtr, bytes, len); Tcl_DecrRefCount(tmpObj); return TCL_OK; @@ -3158,7 +3158,7 @@ TclCompileFormatCmd( if (*++bytes == '%') { Tcl_AppendToObj(tmpObj, "%", 1); } else { - char *b = Tcl_GetStringFromObj(tmpObj, &len); + char *b = TclGetStringFromObj(tmpObj, &len); /* * If there is a non-empty literal from the format string, @@ -3192,7 +3192,7 @@ TclCompileFormatCmd( */ Tcl_AppendToObj(tmpObj, start, bytes - start); - bytes = Tcl_GetStringFromObj(tmpObj, &len); + bytes = TclGetStringFromObj(tmpObj, &len); if (len > 0) { PushLiteral(envPtr, bytes, len); i++; diff --git a/generic/tclCompCmdsGR.c b/generic/tclCompCmdsGR.c index ffe39ba..593a8af 100644 --- a/generic/tclCompCmdsGR.c +++ b/generic/tclCompCmdsGR.c @@ -2451,7 +2451,7 @@ TclCompileRegsubCmd( * replacement "simple"? */ - bytes = Tcl_GetStringFromObj(patternObj, &len); + bytes = TclGetStringFromObj(patternObj, &len); if (TclReToGlob(NULL, bytes, len, &pattern, &exact, &quantified) != TCL_OK || exact || quantified) { goto done; @@ -2499,7 +2499,7 @@ TclCompileRegsubCmd( result = TCL_OK; bytes = Tcl_DStringValue(&pattern) + 1; PushLiteral(envPtr, bytes, len); - bytes = Tcl_GetStringFromObj(replacementObj, &len); + bytes = TclGetStringFromObj(replacementObj, &len); PushLiteral(envPtr, bytes, len); CompileWord(envPtr, stringTokenPtr, interp, parsePtr->numWords-2); TclEmitOpcode( INST_STR_MAP, envPtr); diff --git a/generic/tclCompCmdsSZ.c b/generic/tclCompCmdsSZ.c index 101edbd..2503089 100644 --- a/generic/tclCompCmdsSZ.c +++ b/generic/tclCompCmdsSZ.c @@ -312,7 +312,7 @@ TclCompileStringCatCmd( Tcl_DecrRefCount(obj); if (folded) { int len; - const char *bytes = Tcl_GetStringFromObj(folded, &len); + const char *bytes = TclGetStringFromObj(folded, &len); PushLiteral(envPtr, bytes, len); Tcl_DecrRefCount(folded); @@ -330,7 +330,7 @@ TclCompileStringCatCmd( } if (folded) { int len; - const char *bytes = Tcl_GetStringFromObj(folded, &len); + const char *bytes = TclGetStringFromObj(folded, &len); PushLiteral(envPtr, bytes, len); Tcl_DecrRefCount(folded); @@ -948,12 +948,12 @@ TclCompileStringMapCmd( * correct semantics for mapping. */ - bytes = Tcl_GetStringFromObj(objv[0], &len); + bytes = TclGetStringFromObj(objv[0], &len); if (len == 0) { CompileWord(envPtr, stringTokenPtr, interp, 2); } else { PushLiteral(envPtr, bytes, len); - bytes = Tcl_GetStringFromObj(objv[1], &len); + bytes = TclGetStringFromObj(objv[1], &len); PushLiteral(envPtr, bytes, len); CompileWord(envPtr, stringTokenPtr, interp, 2); OP(STR_MAP); @@ -2825,7 +2825,7 @@ TclCompileTryCmd( } if (objc > 0) { int len; - const char *varname = Tcl_GetStringFromObj(objv[0], &len); + const char *varname = TclGetStringFromObj(objv[0], &len); resultVarIndices[i] = LocalScalar(varname, len, envPtr); if (resultVarIndices[i] < 0) { @@ -2837,7 +2837,7 @@ TclCompileTryCmd( } if (objc == 2) { int len; - const char *varname = Tcl_GetStringFromObj(objv[1], &len); + const char *varname = TclGetStringFromObj(objv[1], &len); optionVarIndices[i] = LocalScalar(varname, len, envPtr); if (optionVarIndices[i] < 0) { @@ -3040,7 +3040,7 @@ IssueTryClausesInstructions( OP4( DICT_GET, 1); TclAdjustStackDepth(-1, envPtr); OP44( LIST_RANGE_IMM, 0, len-1); - p = Tcl_GetStringFromObj(matchClauses[i], &len); + p = TclGetStringFromObj(matchClauses[i], &len); PushLiteral(envPtr, p, len); OP( STR_EQ); JUMP4( JUMP_FALSE, notECJumpSource); @@ -3251,7 +3251,7 @@ IssueTryClausesFinallyInstructions( OP4( DICT_GET, 1); TclAdjustStackDepth(-1, envPtr); OP44( LIST_RANGE_IMM, 0, len-1); - p = Tcl_GetStringFromObj(matchClauses[i], &len); + p = TclGetStringFromObj(matchClauses[i], &len); PushLiteral(envPtr, p, len); OP( STR_EQ); JUMP4( JUMP_FALSE, notECJumpSource); @@ -3579,7 +3579,7 @@ TclCompileUnsetCmd( const char *bytes; int len; - bytes = Tcl_GetStringFromObj(leadingWord, &len); + bytes = TclGetStringFromObj(leadingWord, &len); if (i == 1 && len == 11 && !strncmp("-nocomplain", bytes, 11)) { flags = 0; haveFlags++; diff --git a/generic/tclCompile.c b/generic/tclCompile.c index b1b67a8..0024f1e 100644 --- a/generic/tclCompile.c +++ b/generic/tclCompile.c @@ -1314,7 +1314,7 @@ CompileSubstObj( if (objPtr->typePtr != &substCodeType) { CompileEnv compEnv; int numBytes; - const char *bytes = Tcl_GetStringFromObj(objPtr, &numBytes); + const char *bytes = TclGetStringFromObj(objPtr, &numBytes); /* TODO: Check for more TIP 280 */ TclInitCompileEnv(interp, &compEnv, bytes, numBytes, NULL, 0); @@ -1792,7 +1792,7 @@ CompileCmdLiteral( CompileEnv *envPtr) { int numBytes; - const char *bytes = Tcl_GetStringFromObj(cmdObj, &numBytes); + const char *bytes = TclGetStringFromObj(cmdObj, &numBytes); int cmdLitIdx = TclRegisterNewCmdLiteral(envPtr, bytes, numBytes); Command *cmdPtr = (Command *) Tcl_GetCommandFromObj(interp, cmdObj); @@ -2729,7 +2729,7 @@ PreventCycle( * the intrep. */ int numBytes; - const char *bytes = Tcl_GetStringFromObj(objPtr, &numBytes); + const char *bytes = TclGetStringFromObj(objPtr, &numBytes); Tcl_Obj *copyPtr = Tcl_NewStringObj(bytes, numBytes); Tcl_IncrRefCount(copyPtr); @@ -2968,7 +2968,7 @@ TclFindCompiledLocal( varNamePtr = &cachePtr->varName0; for (i=0; i < cachePtr->numVars; varNamePtr++, i++) { if (*varNamePtr) { - localName = Tcl_GetStringFromObj(*varNamePtr, &len); + localName = TclGetStringFromObj(*varNamePtr, &len); if ((len == nameBytes) && !strncmp(name, localName, len)) { return i; } diff --git a/generic/tclDisassemble.c b/generic/tclDisassemble.c index 1d616fb..0d6da8e 100644 --- a/generic/tclDisassemble.c +++ b/generic/tclDisassemble.c @@ -193,7 +193,7 @@ TclPrintObject( char *bytes; int length; - bytes = Tcl_GetStringFromObj(objPtr, &length); + bytes = TclGetStringFromObj(objPtr, &length); TclPrintSource(outFile, bytes, TclMin(length, maxChars)); } @@ -650,7 +650,7 @@ FormatInstruction( int length; Tcl_AppendToObj(bufferObj, "\t# ", -1); - bytes = Tcl_GetStringFromObj(codePtr->objArrayPtr[opnd], &length); + bytes = TclGetStringFromObj(codePtr->objArrayPtr[opnd], &length); PrintSourceToObj(bufferObj, bytes, TclMin(length, 40)); } else if (suffixBuffer[0]) { Tcl_AppendPrintfToObj(bufferObj, "\t# %s", suffixBuffer); diff --git a/generic/tclEncoding.c b/generic/tclEncoding.c index 32055a3..99cb315 100644 --- a/generic/tclEncoding.c +++ b/generic/tclEncoding.c @@ -3633,7 +3633,7 @@ InitializeEncodingSearchPath( if (*encodingPtr) { ((Encoding *)(*encodingPtr))->refCount++; } - bytes = Tcl_GetStringFromObj(searchPathObj, &numBytes); + bytes = TclGetStringFromObj(searchPathObj, &numBytes); *lengthPtr = numBytes; *valuePtr = ckalloc(numBytes + 1); diff --git a/generic/tclEnsemble.c b/generic/tclEnsemble.c index ee81aee..d5d896a 100644 --- a/generic/tclEnsemble.c +++ b/generic/tclEnsemble.c @@ -1771,7 +1771,7 @@ NsEnsembleImplementationCmdNR( int tableLength = ensemblePtr->subcommandTable.numEntries; Tcl_Obj *fix; - subcmdName = Tcl_GetStringFromObj(subObj, &stringLength); + subcmdName = TclGetStringFromObj(subObj, &stringLength); for (i=0 ; isubcommandArrayPtr[i], @@ -2913,7 +2913,7 @@ TclCompileEnsemble( goto failed; } for (i=0 ; itokenPtr; i < parsePtr->numWords; i++, tokPtr = TokenAfter(tokPtr)) { if (i > 0 && i < numWords+1) { - bytes = Tcl_GetStringFromObj(words[i-1], &length); + bytes = TclGetStringFromObj(words[i-1], &length); PushLiteral(envPtr, bytes, length); continue; } @@ -3344,7 +3344,7 @@ CompileToInvokedCommand( objPtr = Tcl_NewObj(); Tcl_GetCommandFullName(interp, (Tcl_Command) cmdPtr, objPtr); - bytes = Tcl_GetStringFromObj(objPtr, &length); + bytes = TclGetStringFromObj(objPtr, &length); cmdLit = TclRegisterNewCmdLiteral(envPtr, bytes, length); TclSetCmdNameObj(interp, TclFetchLiteral(envPtr, cmdLit), cmdPtr); TclEmitPush(cmdLit, envPtr); diff --git a/generic/tclExecute.c b/generic/tclExecute.c index df0618c..a9c5de5 100644 --- a/generic/tclExecute.c +++ b/generic/tclExecute.c @@ -9826,7 +9826,7 @@ IllegalExprOperandType( if (GetNumberFromObj(NULL, opndPtr, &ptr, &type) != TCL_OK) { int numBytes; - const char *bytes = Tcl_GetStringFromObj(opndPtr, &numBytes); + const char *bytes = TclGetStringFromObj(opndPtr, &numBytes); if (numBytes == 0) { description = "empty string"; @@ -10455,7 +10455,7 @@ EvalStatsCmd( if (entryPtr->objPtr->typePtr == &tclByteCodeType) { numByteCodeLits++; } - (void) Tcl_GetStringFromObj(entryPtr->objPtr, &length); + (void) TclGetStringFromObj(entryPtr->objPtr, &length); refCountSum += entryPtr->refCount; objBytesIfUnshared += (entryPtr->refCount * sizeof(Tcl_Obj)); strBytesIfUnshared += (entryPtr->refCount * (length+1)); @@ -10677,7 +10677,7 @@ EvalStatsCmd( Tcl_SetObjResult(interp, objPtr); } else { Tcl_Channel outChan; - char *str = Tcl_GetStringFromObj(objv[1], &length); + char *str = TclGetStringFromObj(objv[1], &length); if (length) { if (strcmp(str, "stdout") == 0) { diff --git a/generic/tclFileName.c b/generic/tclFileName.c index 2136883..150fb8c 100644 --- a/generic/tclFileName.c +++ b/generic/tclFileName.c @@ -387,7 +387,7 @@ TclpGetNativePathType( { Tcl_PathType type = TCL_PATH_ABSOLUTE; int pathLen; - const char *path = Tcl_GetStringFromObj(pathPtr, &pathLen); + const char *path = TclGetStringFromObj(pathPtr, &pathLen); if (path[0] == '~') { /* @@ -578,7 +578,7 @@ Tcl_SplitPath( size = 1; for (i = 0; i < *argcPtr; i++) { Tcl_ListObjIndex(NULL, resultPtr, i, &eltPtr); - Tcl_GetStringFromObj(eltPtr, &len); + TclGetStringFromObj(eltPtr, &len); size += len + 1; } @@ -597,7 +597,7 @@ Tcl_SplitPath( p = (char *) &(*argvPtr)[(*argcPtr) + 1]; for (i = 0; i < *argcPtr; i++) { Tcl_ListObjIndex(NULL, resultPtr, i, &eltPtr); - str = Tcl_GetStringFromObj(eltPtr, &len); + str = TclGetStringFromObj(eltPtr, &len); memcpy(p, str, (size_t) len+1); p += len+1; } @@ -857,7 +857,7 @@ TclpNativeJoinPath( const char *p; const char *start; - start = Tcl_GetStringFromObj(prefix, &length); + start = TclGetStringFromObj(prefix, &length); /* * Remove the ./ from tilde prefixed elements, and drive-letter prefixed @@ -885,7 +885,7 @@ TclpNativeJoinPath( if (length > 0 && (start[length-1] != '/')) { Tcl_AppendToObj(prefix, "/", 1); - Tcl_GetStringFromObj(prefix, &length); + TclGetStringFromObj(prefix, &length); } needsSep = 0; @@ -921,7 +921,7 @@ TclpNativeJoinPath( if ((length > 0) && (start[length-1] != '/') && (start[length-1] != ':')) { Tcl_AppendToObj(prefix, "/", 1); - Tcl_GetStringFromObj(prefix, &length); + TclGetStringFromObj(prefix, &length); } needsSep = 0; @@ -1003,7 +1003,7 @@ Tcl_JoinPath( * Store the result. */ - resultStr = Tcl_GetStringFromObj(resultObj, &len); + resultStr = TclGetStringFromObj(resultObj, &len); Tcl_DStringAppend(resultPtr, resultStr, len); Tcl_DecrRefCount(resultObj); @@ -1249,7 +1249,7 @@ Tcl_GlobObjCmd( for (i = 1; i < objc; i++) { if (Tcl_GetIndexFromObj(interp, objv[i], options, "option", 0, &index) != TCL_OK) { - string = Tcl_GetStringFromObj(objv[i], &length); + string = TclGetStringFromObj(objv[i], &length); if (string[0] == '-') { /* * It looks like the command contains an option so signal an @@ -1357,7 +1357,7 @@ Tcl_GlobObjCmd( if (dir == PATH_GENERAL) { int pathlength; const char *last; - const char *first = Tcl_GetStringFromObj(pathOrDir,&pathlength); + const char *first = TclGetStringFromObj(pathOrDir,&pathlength); /* * Find the last path separator in the path @@ -1460,7 +1460,7 @@ Tcl_GlobObjCmd( const char *str; Tcl_ListObjIndex(interp, typePtr, length, &look); - str = Tcl_GetStringFromObj(look, &len); + str = TclGetStringFromObj(look, &len); if (strcmp("readonly", str) == 0) { globTypes->perm |= TCL_GLOB_PERM_RONLY; } else if (strcmp("hidden", str) == 0) { @@ -1992,7 +1992,7 @@ TclGlob( Tcl_Panic("Called TclGlob with TCL_GLOBMODE_TAILS and pathPrefix==NULL"); } - pre = Tcl_GetStringFromObj(pathPrefix, &prefixLen); + pre = TclGetStringFromObj(pathPrefix, &prefixLen); if (prefixLen > 0 && (strchr(separators, pre[prefixLen-1]) == NULL)) { /* @@ -2010,7 +2010,7 @@ TclGlob( Tcl_ListObjGetElements(NULL, filenamesObj, &objc, &objv); for (i = 0; i< objc; i++) { int len; - const char *oldStr = Tcl_GetStringFromObj(objv[i], &len); + const char *oldStr = TclGetStringFromObj(objv[i], &len); Tcl_Obj *elem; if (len == prefixLen) { @@ -2362,7 +2362,7 @@ DoGlob( Tcl_Obj *fixme, *newObj; Tcl_ListObjIndex(NULL, matchesObj, repair, &fixme); - bytes = Tcl_GetStringFromObj(fixme, &numBytes); + bytes = TclGetStringFromObj(fixme, &numBytes); newObj = Tcl_NewStringObj(bytes+2, numBytes-2); Tcl_ListObjReplace(NULL, matchesObj, repair, 1, 1, &newObj); @@ -2400,7 +2400,7 @@ DoGlob( Tcl_DStringAppend(&append, pattern, p-pattern); if (pathPtr != NULL) { - (void) Tcl_GetStringFromObj(pathPtr, &length); + (void) TclGetStringFromObj(pathPtr, &length); } else { length = 0; } @@ -2446,7 +2446,7 @@ DoGlob( */ int len; - const char *joined = Tcl_GetStringFromObj(joinedPtr,&len); + const char *joined = TclGetStringFromObj(joinedPtr,&len); if (strchr(separators, joined[len-1]) == NULL) { Tcl_AppendToObj(joinedPtr, "/", 1); @@ -2483,7 +2483,7 @@ DoGlob( */ int len; - const char *joined = Tcl_GetStringFromObj(joinedPtr,&len); + const char *joined = TclGetStringFromObj(joinedPtr,&len); if (strchr(separators, joined[len-1]) == NULL) { if (Tcl_FSGetPathType(pathPtr) != TCL_PATH_VOLUME_RELATIVE) { diff --git a/generic/tclIORChan.c b/generic/tclIORChan.c index f476a1a..1089d2b 100644 --- a/generic/tclIORChan.c +++ b/generic/tclIORChan.c @@ -1946,7 +1946,7 @@ ReflectGetOption( goto error; } else { int len; - const char *str = Tcl_GetStringFromObj(resObj, &len); + const char *str = TclGetStringFromObj(resObj, &len); if (len) { TclDStringAppendLiteral(dsPtr, " "); @@ -2319,7 +2319,7 @@ InvokeTclMethod( if (result != TCL_ERROR) { int cmdLen; - const char *cmdString = Tcl_GetStringFromObj(cmd, &cmdLen); + const char *cmdString = TclGetStringFromObj(cmd, &cmdLen); Tcl_IncrRefCount(cmd); Tcl_ResetResult(rcPtr->interp); @@ -3174,7 +3174,7 @@ ForwardProc( ForwardSetDynamicError(paramPtr, buf); } else { int len; - const char *str = Tcl_GetStringFromObj(resObj, &len); + const char *str = TclGetStringFromObj(resObj, &len); if (len) { TclDStringAppendLiteral(paramPtr->getOpt.value, " "); @@ -3273,7 +3273,7 @@ ForwardSetObjError( Tcl_Obj *obj) { int len; - const char *msgStr = Tcl_GetStringFromObj(obj, &len); + const char *msgStr = TclGetStringFromObj(obj, &len); len++; ForwardSetDynamicError(paramPtr, ckalloc(len)); diff --git a/generic/tclIORTrans.c b/generic/tclIORTrans.c index af86ba5..47e0bc8 100644 --- a/generic/tclIORTrans.c +++ b/generic/tclIORTrans.c @@ -2043,7 +2043,7 @@ InvokeTclMethod( if (result != TCL_ERROR) { Tcl_Obj *cmd = Tcl_NewListObj(cmdc, rtPtr->argv); int cmdLen; - const char *cmdString = Tcl_GetStringFromObj(cmd, &cmdLen); + const char *cmdString = TclGetStringFromObj(cmd, &cmdLen); Tcl_IncrRefCount(cmd); Tcl_ResetResult(rtPtr->interp); @@ -2807,7 +2807,7 @@ ForwardSetObjError( Tcl_Obj *obj) { int len; - const char *msgStr = Tcl_GetStringFromObj(obj, &len); + const char *msgStr = TclGetStringFromObj(obj, &len); len++; ForwardSetDynamicError(paramPtr, ckalloc(len)); diff --git a/generic/tclIOUtil.c b/generic/tclIOUtil.c index 3aa0ce5..397c3b1 100644 --- a/generic/tclIOUtil.c +++ b/generic/tclIOUtil.c @@ -544,8 +544,8 @@ TclFSCwdPointerEquals( int len1, len2; const char *str1, *str2; - str1 = Tcl_GetStringFromObj(tsdPtr->cwdPathPtr, &len1); - str2 = Tcl_GetStringFromObj(*pathPtrPtr, &len2); + str1 = TclGetStringFromObj(tsdPtr->cwdPathPtr, &len1); + str2 = TclGetStringFromObj(*pathPtrPtr, &len2); if ((len1 == len2) && !memcmp(str1, str2, len1)) { /* * They are equal, but different objects. Update so they will be @@ -688,7 +688,7 @@ FsUpdateCwd( ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&fsDataKey); if (cwdObj != NULL) { - str = Tcl_GetStringFromObj(cwdObj, &len); + str = TclGetStringFromObj(cwdObj, &len); } Tcl_MutexLock(&cwdMutex); @@ -1224,8 +1224,8 @@ FsAddMountsToGlobResult( if (norm != NULL) { const char *path, *mount; - mount = Tcl_GetStringFromObj(mElt, &mlen); - path = Tcl_GetStringFromObj(norm, &len); + mount = TclGetStringFromObj(mElt, &mlen); + path = TclGetStringFromObj(norm, &len); if (path[len-1] == '/') { /* * Deal with the root of the volume. @@ -1816,7 +1816,7 @@ Tcl_FSEvalFileEx( oldScriptFile = iPtr->scriptFile; iPtr->scriptFile = pathPtr; Tcl_IncrRefCount(iPtr->scriptFile); - string = Tcl_GetStringFromObj(objPtr, &length); + string = TclGetStringFromObj(objPtr, &length); /* * TIP #280 Force the evaluator to open a frame for a sourced file. @@ -1843,7 +1843,7 @@ Tcl_FSEvalFileEx( * Record information telling where the error occurred. */ - const char *pathString = Tcl_GetStringFromObj(pathPtr, &length); + const char *pathString = TclGetStringFromObj(pathPtr, &length); int limit = 150; int overflow = (length > limit); @@ -1994,7 +1994,7 @@ EvalFileCallback( */ int length; - const char *pathString = Tcl_GetStringFromObj(pathPtr, &length); + const char *pathString = TclGetStringFromObj(pathPtr, &length); const int limit = 150; int overflow = (length > limit); @@ -2846,8 +2846,8 @@ Tcl_FSGetCwd( int len1, len2; const char *str1, *str2; - str1 = Tcl_GetStringFromObj(tsdPtr->cwdPathPtr, &len1); - str2 = Tcl_GetStringFromObj(norm, &len2); + str1 = TclGetStringFromObj(tsdPtr->cwdPathPtr, &len1); + str2 = TclGetStringFromObj(norm, &len2); if ((len1 == len2) && (strcmp(str1, str2) == 0)) { /* * If the paths were equal, we can be more efficient and @@ -4115,7 +4115,7 @@ TclGetPathType( * caller. */ { int pathLen; - const char *path = Tcl_GetStringFromObj(pathPtr, &pathLen); + const char *path = TclGetStringFromObj(pathPtr, &pathLen); Tcl_PathType type; type = TclFSNonnativePathType(path, pathLen, filesystemPtrPtr, @@ -4227,7 +4227,7 @@ TclFSNonnativePathType( numVolumes--; Tcl_ListObjIndex(NULL, thisFsVolumes, numVolumes, &vol); - strVol = Tcl_GetStringFromObj(vol,&len); + strVol = TclGetStringFromObj(vol,&len); if (pathLen < len) { continue; } @@ -4574,8 +4574,8 @@ Tcl_FSRemoveDirectory( Tcl_Obj *normPath = Tcl_FSGetNormalizedPath(NULL, pathPtr); if (normPath != NULL) { - normPathStr = Tcl_GetStringFromObj(normPath, &normLen); - cwdStr = Tcl_GetStringFromObj(cwdPtr, &cwdLen); + normPathStr = TclGetStringFromObj(normPath, &normLen); + cwdStr = TclGetStringFromObj(cwdPtr, &cwdLen); if ((cwdLen >= normLen) && (strncmp(normPathStr, cwdStr, (size_t) normLen) == 0)) { /* diff --git a/generic/tclIndexObj.c b/generic/tclIndexObj.c index 0e0ddc9..2281d22 100644 --- a/generic/tclIndexObj.c +++ b/generic/tclIndexObj.c @@ -712,10 +712,10 @@ PrefixAllObjCmd( return result; } resultPtr = Tcl_NewListObj(0, NULL); - string = Tcl_GetStringFromObj(objv[2], &length); + string = TclGetStringFromObj(objv[2], &length); for (t = 0; t < tableObjc; t++) { - elemString = Tcl_GetStringFromObj(tableObjv[t], &elemLength); + elemString = TclGetStringFromObj(tableObjv[t], &elemLength); /* * A prefix cannot match if it is longest. @@ -768,13 +768,13 @@ PrefixLongestObjCmd( if (result != TCL_OK) { return result; } - string = Tcl_GetStringFromObj(objv[2], &length); + string = TclGetStringFromObj(objv[2], &length); resultString = NULL; resultLength = 0; for (t = 0; t < tableObjc; t++) { - elemString = Tcl_GetStringFromObj(tableObjv[t], &elemLength); + elemString = TclGetStringFromObj(tableObjv[t], &elemLength); /* * First check if the prefix string matches the element. A prefix @@ -1148,7 +1148,7 @@ Tcl_ParseArgsObjv( curArg = objv[srcIndex]; srcIndex++; objc--; - str = Tcl_GetStringFromObj(curArg, &length); + str = TclGetStringFromObj(curArg, &length); if (length > 0) { c = str[1]; } else { diff --git a/generic/tclInterp.c b/generic/tclInterp.c index c281d6d..a2de658 100644 --- a/generic/tclInterp.c +++ b/generic/tclInterp.c @@ -4502,7 +4502,7 @@ SlaveCommandLimitCmd( switch ((enum Options) index) { case OPT_CMD: scriptObj = objv[i+1]; - (void) Tcl_GetStringFromObj(objv[i+1], &scriptLen); + (void) TclGetStringFromObj(scriptObj, &scriptLen); break; case OPT_GRAN: granObj = objv[i+1]; @@ -4519,7 +4519,7 @@ SlaveCommandLimitCmd( break; case OPT_VAL: limitObj = objv[i+1]; - (void) Tcl_GetStringFromObj(objv[i+1], &limitLen); + (void) TclGetStringFromObj(objv[i+1], &limitLen); if (limitLen == 0) { break; } @@ -4711,7 +4711,7 @@ SlaveTimeLimitCmd( switch ((enum Options) index) { case OPT_CMD: scriptObj = objv[i+1]; - (void) Tcl_GetStringFromObj(objv[i+1], &scriptLen); + (void) TclGetStringFromObj(objv[i+1], &scriptLen); break; case OPT_GRAN: granObj = objv[i+1]; @@ -4728,7 +4728,7 @@ SlaveTimeLimitCmd( break; case OPT_MILLI: milliObj = objv[i+1]; - (void) Tcl_GetStringFromObj(objv[i+1], &milliLen); + (void) TclGetStringFromObj(objv[i+1], &milliLen); if (milliLen == 0) { break; } @@ -4746,7 +4746,7 @@ SlaveTimeLimitCmd( break; case OPT_SEC: secObj = objv[i+1]; - (void) Tcl_GetStringFromObj(objv[i+1], &secLen); + (void) TclGetStringFromObj(objv[i+1], &secLen); if (secLen == 0) { break; } diff --git a/generic/tclLink.c b/generic/tclLink.c index 2735256..e6dc657 100644 --- a/generic/tclLink.c +++ b/generic/tclLink.c @@ -526,7 +526,7 @@ LinkTraceProc( break; case TCL_LINK_STRING: - value = Tcl_GetStringFromObj(valueObj, &valueLength); + value = TclGetStringFromObj(valueObj, &valueLength); valueLength++; pp = (char **) linkPtr->addr; diff --git a/generic/tclLiteral.c b/generic/tclLiteral.c index 03200ca..e0425cf 100644 --- a/generic/tclLiteral.c +++ b/generic/tclLiteral.c @@ -671,7 +671,7 @@ AddLocalLiteralEntry( } if (!found) { - bytes = Tcl_GetStringFromObj(objPtr, &length); + bytes = TclGetStringFromObj(objPtr, &length); Tcl_Panic("%s: literal \"%.*s\" wasn't found locally", "AddLocalLiteralEntry", (length>60? 60 : length), bytes); } @@ -1147,14 +1147,14 @@ TclVerifyLocalLiteralTable( localPtr=localPtr->nextPtr) { count++; if (localPtr->refCount != -1) { - bytes = Tcl_GetStringFromObj(localPtr->objPtr, &length); + bytes = TclGetStringFromObj(localPtr->objPtr, &length); Tcl_Panic("%s: local literal \"%.*s\" had bad refCount %d", "TclVerifyLocalLiteralTable", (length>60? 60 : length), bytes, localPtr->refCount); } if (LookupLiteralEntry((Tcl_Interp *) envPtr->iPtr, localPtr->objPtr) == NULL) { - bytes = Tcl_GetStringFromObj(localPtr->objPtr, &length); + bytes = TclGetStringFromObj(localPtr->objPtr, &length); Tcl_Panic("%s: local literal \"%.*s\" is not global", "TclVerifyLocalLiteralTable", (length>60? 60 : length), bytes); @@ -1205,7 +1205,7 @@ TclVerifyGlobalLiteralTable( globalPtr=globalPtr->nextPtr) { count++; if (globalPtr->refCount < 1) { - bytes = Tcl_GetStringFromObj(globalPtr->objPtr, &length); + bytes = TclGetStringFromObj(globalPtr->objPtr, &length); Tcl_Panic("%s: global literal \"%.*s\" had bad refCount %d", "TclVerifyGlobalLiteralTable", (length>60? 60 : length), bytes, globalPtr->refCount); diff --git a/generic/tclMain.c b/generic/tclMain.c index 28f8fd8..f89bd5e 100644 --- a/generic/tclMain.c +++ b/generic/tclMain.c @@ -536,7 +536,7 @@ Tcl_MainEx( * error messages troubles deeper in, so lop it back off. */ - Tcl_GetStringFromObj(is.commandPtr, &length); + TclGetStringFromObj(is.commandPtr, &length); Tcl_SetObjLength(is.commandPtr, --length); code = Tcl_RecordAndEvalObj(interp, is.commandPtr, TCL_EVAL_GLOBAL); @@ -553,7 +553,7 @@ Tcl_MainEx( } else if (is.tty) { resultPtr = Tcl_GetObjResult(interp); Tcl_IncrRefCount(resultPtr); - Tcl_GetStringFromObj(resultPtr, &length); + TclGetStringFromObj(resultPtr, &length); chan = Tcl_GetStdChannel(TCL_STDOUT); if ((length > 0) && chan) { Tcl_WriteObj(chan, resultPtr); @@ -797,7 +797,7 @@ StdinProc( goto prompt; } isPtr->prompt = PROMPT_START; - Tcl_GetStringFromObj(commandPtr, &length); + TclGetStringFromObj(commandPtr, &length); Tcl_SetObjLength(commandPtr, --length); /* @@ -828,7 +828,7 @@ StdinProc( chan = Tcl_GetStdChannel(TCL_STDOUT); Tcl_IncrRefCount(resultPtr); - Tcl_GetStringFromObj(resultPtr, &length); + TclGetStringFromObj(resultPtr, &length); if ((length > 0) && (chan != NULL)) { Tcl_WriteObj(chan, resultPtr); Tcl_WriteChars(chan, "\n", 1); diff --git a/generic/tclOODefineCmds.c b/generic/tclOODefineCmds.c index 8747ff5..8c3f28c 100644 --- a/generic/tclOODefineCmds.c +++ b/generic/tclOODefineCmds.c @@ -525,7 +525,7 @@ TclOOUnknownDefinition( return TCL_ERROR; } - soughtStr = Tcl_GetStringFromObj(objv[1], &soughtLen); + soughtStr = TclGetStringFromObj(objv[1], &soughtLen); if (soughtLen == 0) { goto noMatch; } @@ -585,7 +585,7 @@ FindCommand( Tcl_Namespace *const namespacePtr) { int length; - const char *nameStr, *string = Tcl_GetStringFromObj(stringObj, &length); + const char *nameStr, *string = TclGetStringFromObj(stringObj, &length); register Namespace *const nsPtr = (Namespace *) namespacePtr; FOREACH_HASH_DECLS; Tcl_Command cmd, cmd2; @@ -774,7 +774,7 @@ GenerateErrorInfo( int length; Tcl_Obj *realNameObj = Tcl_ObjectDeleted((Tcl_Object) oPtr) ? savedNameObj : TclOOObjectName(interp, oPtr); - const char *objName = Tcl_GetStringFromObj(realNameObj, &length); + const char *objName = TclGetStringFromObj(realNameObj, &length); int limit = OBJNAME_LENGTH_IN_ERRORINFO_LIMIT; int overflow = (length > limit); @@ -1239,7 +1239,7 @@ TclOODefineConstructorObjCmd( } clsPtr = oPtr->classPtr; - Tcl_GetStringFromObj(objv[2], &bodyLength); + TclGetStringFromObj(objv[2], &bodyLength); if (bodyLength > 0) { /* * Create the method structure. @@ -1358,7 +1358,7 @@ TclOODefineDestructorObjCmd( } clsPtr = oPtr->classPtr; - Tcl_GetStringFromObj(objv[1], &bodyLength); + TclGetStringFromObj(objv[1], &bodyLength); if (bodyLength > 0) { /* * Create the method structure. diff --git a/generic/tclOOMethod.c b/generic/tclOOMethod.c index 99a8bfc..9c49caa 100644 --- a/generic/tclOOMethod.c +++ b/generic/tclOOMethod.c @@ -1166,7 +1166,7 @@ MethodErrorHandler( CallContext *contextPtr = ((Interp *) interp)->varFramePtr->clientData; Method *mPtr = contextPtr->callPtr->chain[contextPtr->index].mPtr; const char *objectName, *kindName, *methodName = - Tcl_GetStringFromObj(mPtr->namePtr, &nameLen); + TclGetStringFromObj(mPtr->namePtr, &nameLen); Object *declarerPtr; if (mPtr->declaringObjectPtr != NULL) { diff --git a/generic/tclObj.c b/generic/tclObj.c index a45a392..776b034 100644 --- a/generic/tclObj.c +++ b/generic/tclObj.c @@ -663,7 +663,7 @@ TclContinuationsEnterDerived( * better way which doesn't shimmer?) */ - Tcl_GetStringFromObj(objPtr, &length); + TclGetStringFromObj(objPtr, &length); end = start + length; /* First char after the word */ /* @@ -1989,7 +1989,7 @@ TclSetBooleanFromAny( badBoolean: if (interp != NULL) { int length; - const char *str = Tcl_GetStringFromObj(objPtr, &length); + const char *str = TclGetStringFromObj(objPtr, &length); Tcl_Obj *msg; TclNewLiteralStringObj(msg, "expected boolean value but got \""); diff --git a/generic/tclOptimize.c b/generic/tclOptimize.c index 827d89d..8267a7d 100644 --- a/generic/tclOptimize.c +++ b/generic/tclOptimize.c @@ -233,7 +233,7 @@ ConvertZeroEffectToNOP( TclGetUInt1AtPtr(currentInstPtr + 1)); int numBytes; - (void) Tcl_GetStringFromObj(litPtr, &numBytes); + (void) TclGetStringFromObj(litPtr, &numBytes); if (numBytes == 0) { blank = size + InstLength(nextInst); } @@ -248,7 +248,7 @@ ConvertZeroEffectToNOP( TclGetUInt4AtPtr(currentInstPtr + 1)); int numBytes; - (void) Tcl_GetStringFromObj(litPtr, &numBytes); + (void) TclGetStringFromObj(litPtr, &numBytes); if (numBytes == 0) { blank = size + InstLength(nextInst); } diff --git a/generic/tclParse.c b/generic/tclParse.c index 5577e87..3a04df4 100644 --- a/generic/tclParse.c +++ b/generic/tclParse.c @@ -2220,7 +2220,7 @@ TclSubstTokens( if (result == 0) { clPos = 0; } else { - Tcl_GetStringFromObj(result, &clPos); + TclGetStringFromObj(result, &clPos); } if (numCL >= maxNumCL) { @@ -2496,7 +2496,7 @@ TclObjCommandComplete( * check. */ { int length; - const char *script = Tcl_GetStringFromObj(objPtr, &length); + const char *script = TclGetStringFromObj(objPtr, &length); return CommandComplete(script, length); } diff --git a/generic/tclPathObj.c b/generic/tclPathObj.c index 99d576d..cf8d784 100644 --- a/generic/tclPathObj.c +++ b/generic/tclPathObj.c @@ -231,7 +231,7 @@ TclFSNormalizeAbsolutePath( retVal = Tcl_NewStringObj(path, dirSep - path); Tcl_IncrRefCount(retVal); } - Tcl_GetStringFromObj(retVal, &curLen); + TclGetStringFromObj(retVal, &curLen); if (curLen == 0) { Tcl_AppendToObj(retVal, dirSep, 1); } @@ -257,7 +257,7 @@ TclFSNormalizeAbsolutePath( retVal = Tcl_NewStringObj(path, dirSep - path); Tcl_IncrRefCount(retVal); } - Tcl_GetStringFromObj(retVal, &curLen); + TclGetStringFromObj(retVal, &curLen); if (curLen == 0) { Tcl_AppendToObj(retVal, dirSep, 1); } @@ -288,7 +288,7 @@ TclFSNormalizeAbsolutePath( */ const char *path = - Tcl_GetStringFromObj(retVal, &curLen); + TclGetStringFromObj(retVal, &curLen); while (--curLen >= 0) { if (IsSeparatorOrNull(path[curLen])) { @@ -303,7 +303,7 @@ TclFSNormalizeAbsolutePath( Tcl_SetObjLength(retVal, curLen+1); Tcl_AppendObjToObj(retVal, linkObj); TclDecrRefCount(linkObj); - linkStr = Tcl_GetStringFromObj(retVal, &curLen); + linkStr = TclGetStringFromObj(retVal, &curLen); } else { /* * Absolute link. @@ -316,7 +316,7 @@ TclFSNormalizeAbsolutePath( } else { retVal = linkObj; } - linkStr = Tcl_GetStringFromObj(retVal, &curLen); + linkStr = TclGetStringFromObj(retVal, &curLen); /* * Convert to forward-slashes on windows. @@ -333,7 +333,7 @@ TclFSNormalizeAbsolutePath( } } } else { - linkStr = Tcl_GetStringFromObj(retVal, &curLen); + linkStr = TclGetStringFromObj(retVal, &curLen); } /* @@ -404,7 +404,7 @@ TclFSNormalizeAbsolutePath( if (tclPlatform == TCL_PLATFORM_WINDOWS) { int len; - const char *path = Tcl_GetStringFromObj(retVal, &len); + const char *path = TclGetStringFromObj(retVal, &len); if (len == 2 && path[0] != 0 && path[1] == ':') { if (Tcl_IsShared(retVal)) { @@ -579,7 +579,7 @@ TclPathPart( int numBytes; const char *rest = - Tcl_GetStringFromObj(fsPathPtr->normPathPtr, &numBytes); + TclGetStringFromObj(fsPathPtr->normPathPtr, &numBytes); if (strchr(rest, '/') != NULL) { goto standardPath; @@ -617,7 +617,7 @@ TclPathPart( int numBytes; const char *rest = - Tcl_GetStringFromObj(fsPathPtr->normPathPtr, &numBytes); + TclGetStringFromObj(fsPathPtr->normPathPtr, &numBytes); if (strchr(rest, '/') != NULL) { goto standardPath; @@ -646,7 +646,7 @@ TclPathPart( const char *fileName, *extension; int length; - fileName = Tcl_GetStringFromObj(fsPathPtr->normPathPtr, + fileName = TclGetStringFromObj(fsPathPtr->normPathPtr, &length); extension = TclGetExtension(fileName); if (extension == NULL) { @@ -698,7 +698,7 @@ TclPathPart( int length; const char *fileName, *extension; - fileName = Tcl_GetStringFromObj(pathPtr, &length); + fileName = TclGetStringFromObj(pathPtr, &length); extension = TclGetExtension(fileName); if (extension == NULL) { Tcl_IncrRefCount(pathPtr); @@ -881,7 +881,7 @@ TclJoinPath( const char *str; int len; - str = Tcl_GetStringFromObj(tailObj, &len); + str = TclGetStringFromObj(tailObj, &len); if (len == 0) { /* * This happens if we try to handle the root volume '/'. @@ -943,7 +943,7 @@ TclJoinPath( } } } - strElt = Tcl_GetStringFromObj(elt, &strEltLen); + strElt = TclGetStringFromObj(elt, &strEltLen); type = TclGetPathType(elt, &fsPtr, &driveNameLength, &driveName); if (type != TCL_PATH_RELATIVE) { /* @@ -1030,9 +1030,9 @@ TclJoinPath( noQuickReturn: if (res == NULL) { res = Tcl_NewObj(); - ptr = Tcl_GetStringFromObj(res, &length); + ptr = TclGetStringFromObj(res, &length); } else { - ptr = Tcl_GetStringFromObj(res, &length); + ptr = TclGetStringFromObj(res, &length); } /* @@ -1077,7 +1077,7 @@ TclJoinPath( if (length > 0 && ptr[length -1] != '/') { Tcl_AppendToObj(res, &separator, 1); - Tcl_GetStringFromObj(res, &length); + TclGetStringFromObj(res, &length); } Tcl_SetObjLength(res, length + (int) strlen(strElt)); @@ -1372,7 +1372,7 @@ AppendPath( * intrep produce the same results; that is, bugward compatibility. If * we need to fix that bug here, it needs fixing in TclJoinPath() too. */ - bytes = Tcl_GetStringFromObj(tail, &numBytes); + bytes = TclGetStringFromObj(tail, &numBytes); if (numBytes == 0) { Tcl_AppendToObj(copy, "/", 1); } else { @@ -1431,7 +1431,7 @@ TclFSMakePathRelative( * too little below, leading to wrong answers returned by glob. */ - tempStr = Tcl_GetStringFromObj(cwdPtr, &cwdLen); + tempStr = TclGetStringFromObj(cwdPtr, &cwdLen); /* * Should we perhaps use 'Tcl_FSPathSeparator'? But then what about the @@ -1451,7 +1451,7 @@ TclFSMakePathRelative( } break; } - tempStr = Tcl_GetStringFromObj(pathPtr, &len); + tempStr = TclGetStringFromObj(pathPtr, &len); return Tcl_NewStringObj(tempStr + cwdLen, len - cwdLen); } @@ -1715,7 +1715,7 @@ Tcl_FSGetTranslatedStringPath( if (transPtr != NULL) { int len; - const char *orig = Tcl_GetStringFromObj(transPtr, &len); + const char *orig = TclGetStringFromObj(transPtr, &len); char *result = ckalloc(len+1); memcpy(result, orig, (size_t) len+1); @@ -1776,7 +1776,7 @@ Tcl_FSGetNormalizedPath( UpdateStringOfFsPath(pathPtr); } - Tcl_GetStringFromObj(fsPathPtr->normPathPtr, &tailLen); + TclGetStringFromObj(fsPathPtr->normPathPtr, &tailLen); if (tailLen) { copy = AppendPath(dir, fsPathPtr->normPathPtr); } else { @@ -1789,7 +1789,7 @@ Tcl_FSGetNormalizedPath( * We now own a reference on both 'dir' and 'copy' */ - (void) Tcl_GetStringFromObj(dir, &cwdLen); + (void) TclGetStringFromObj(dir, &cwdLen); cwdLen += (Tcl_GetString(copy)[cwdLen] == '/'); /* Normalize the combined string. */ @@ -1883,7 +1883,7 @@ Tcl_FSGetNormalizedPath( copy = AppendPath(fsPathPtr->cwdPtr, pathPtr); - (void) Tcl_GetStringFromObj(fsPathPtr->cwdPtr, &cwdLen); + (void) TclGetStringFromObj(fsPathPtr->cwdPtr, &cwdLen); cwdLen += (Tcl_GetString(copy)[cwdLen] == '/'); /* @@ -2333,7 +2333,7 @@ SetFsPathFromAny( * cmdAH.test exercise most of the code). */ - name = Tcl_GetStringFromObj(pathPtr, &len); + name = TclGetStringFromObj(pathPtr, &len); /* * Handle tilde substitutions, if needed. @@ -2602,7 +2602,7 @@ UpdateStringOfFsPath( copy = AppendPath(fsPathPtr->cwdPtr, fsPathPtr->normPathPtr); - pathPtr->bytes = Tcl_GetStringFromObj(copy, &cwdLen); + pathPtr->bytes = TclGetStringFromObj(copy, &cwdLen); pathPtr->length = cwdLen; copy->bytes = tclEmptyStringRep; copy->length = 0; @@ -2663,7 +2663,7 @@ TclNativePathInFilesystem( int len; - (void) Tcl_GetStringFromObj(pathPtr, &len); + (void) TclGetStringFromObj(pathPtr, &len); if (len == 0) { /* * We reject the empty path "". diff --git a/generic/tclPkg.c b/generic/tclPkg.c index 86777a8..244eb94 100644 --- a/generic/tclPkg.c +++ b/generic/tclPkg.c @@ -842,7 +842,7 @@ Tcl_PackageObjCmd( } else { pkgPtr = FindPackage(interp, argv2); } - argv3 = Tcl_GetStringFromObj(objv[3], &length); + argv3 = TclGetStringFromObj(objv[3], &length); for (availPtr = pkgPtr->availPtr, prevPtr = NULL; availPtr != NULL; prevPtr = availPtr, availPtr = availPtr->nextPtr) { @@ -883,7 +883,7 @@ Tcl_PackageObjCmd( prevPtr->nextPtr = availPtr; } } - argv4 = Tcl_GetStringFromObj(objv[4], &length); + argv4 = TclGetStringFromObj(objv[4], &length); DupBlock(availPtr->script, argv4, (unsigned) length + 1); break; } @@ -1034,7 +1034,7 @@ Tcl_PackageObjCmd( if (iPtr->packageUnknown != NULL) { ckfree(iPtr->packageUnknown); } - argv2 = Tcl_GetStringFromObj(objv[2], &length); + argv2 = TclGetStringFromObj(objv[2], &length); if (argv2[0] == 0) { iPtr->packageUnknown = NULL; } else { @@ -1682,7 +1682,7 @@ AddRequirementsToResult( int i, length; for (i = 0; i < reqc; i++) { - const char *v = Tcl_GetStringFromObj(reqv[i], &length); + const char *v = TclGetStringFromObj(reqv[i], &length); if ((length & 0x1) && (v[length/2] == '-') && (strncmp(v, v+((length+1)/2), length/2) == 0)) { diff --git a/generic/tclProc.c b/generic/tclProc.c index ae9e7cd..81d3b25 100644 --- a/generic/tclProc.c +++ b/generic/tclProc.c @@ -343,7 +343,7 @@ Tcl_ProcObjCmd( * The argument list is just "args"; check the body */ - procBody = Tcl_GetStringFromObj(objv[3], &numBytes); + procBody = TclGetStringFromObj(objv[3], &numBytes); if (TclParseAllWhiteSpace(procBody, numBytes) < numBytes) { goto done; } @@ -2083,7 +2083,7 @@ MakeProcError( * messages and trace information. */ { int overflow, limit = 60, nameLen; - const char *procName = Tcl_GetStringFromObj(procNameObj, &nameLen); + const char *procName = TclGetStringFromObj(procNameObj, &nameLen); overflow = (nameLen > limit); Tcl_AppendObjToErrorInfo(interp, Tcl_ObjPrintf( @@ -2764,7 +2764,7 @@ MakeLambdaError( * messages and trace information. */ { int overflow, limit = 60, nameLen; - const char *procName = Tcl_GetStringFromObj(procNameObj, &nameLen); + const char *procName = TclGetStringFromObj(procNameObj, &nameLen); overflow = (nameLen > limit); Tcl_AppendObjToErrorInfo(interp, Tcl_ObjPrintf( diff --git a/generic/tclStringObj.c b/generic/tclStringObj.c index b480735..e3cede6 100644 --- a/generic/tclStringObj.c +++ b/generic/tclStringObj.c @@ -2285,7 +2285,7 @@ Tcl_AppendFormatToObj( } } - Tcl_GetStringFromObj(segment, &segmentNumBytes); + TclGetStringFromObj(segment, &segmentNumBytes); if (segmentNumBytes > limit) { if (allocSegment) { Tcl_DecrRefCount(segment); diff --git a/generic/tclTimer.c b/generic/tclTimer.c index c83b5f5..6d3938b 100644 --- a/generic/tclTimer.c +++ b/generic/tclTimer.c @@ -900,10 +900,10 @@ Tcl_AfterObjCmd( } else { commandPtr = Tcl_ConcatObj(objc-2, objv+2);; } - command = Tcl_GetStringFromObj(commandPtr, &length); + command = TclGetStringFromObj(commandPtr, &length); for (afterPtr = assocPtr->firstAfterPtr; afterPtr != NULL; afterPtr = afterPtr->nextPtr) { - tempCommand = Tcl_GetStringFromObj(afterPtr->commandPtr, + tempCommand = TclGetStringFromObj(afterPtr->commandPtr, &tempLength); if ((length == tempLength) && !memcmp(command, tempCommand, (unsigned) length)) { diff --git a/generic/tclTrace.c b/generic/tclTrace.c index 33e62b2..0c73cba 100644 --- a/generic/tclTrace.c +++ b/generic/tclTrace.c @@ -278,7 +278,7 @@ Tcl_TraceObjCmd( opsList = Tcl_NewObj(); Tcl_IncrRefCount(opsList); - flagOps = Tcl_GetStringFromObj(objv[3], &numFlags); + flagOps = TclGetStringFromObj(objv[3], &numFlags); if (numFlags == 0) { Tcl_DecrRefCount(opsList); goto badVarOps; @@ -462,7 +462,7 @@ TraceExecutionObjCmd( break; } } - command = Tcl_GetStringFromObj(objv[5], &commandLength); + command = TclGetStringFromObj(objv[5], &commandLength); length = (size_t) commandLength; if ((enum traceOptions) optionIndex == TRACE_ADD) { TraceCommandInfo *tcmdPtr = ckalloc( @@ -701,7 +701,7 @@ TraceCommandObjCmd( } } - command = Tcl_GetStringFromObj(objv[5], &commandLength); + command = TclGetStringFromObj(objv[5], &commandLength); length = (size_t) commandLength; if ((enum traceOptions) optionIndex == TRACE_ADD) { TraceCommandInfo *tcmdPtr = ckalloc( @@ -904,7 +904,7 @@ TraceVariableObjCmd( break; } } - command = Tcl_GetStringFromObj(objv[5], &commandLength); + command = TclGetStringFromObj(objv[5], &commandLength); length = (size_t) commandLength; if ((enum traceOptions) optionIndex == TRACE_ADD) { CombinedTraceVarInfo *ctvarPtr = ckalloc( diff --git a/generic/tclUtil.c b/generic/tclUtil.c index 553593c..f0c7f77 100644 --- a/generic/tclUtil.c +++ b/generic/tclUtil.c @@ -1968,7 +1968,7 @@ Tcl_ConcatObj( if (TclListObjIsCanonical(objPtr)) { continue; } - Tcl_GetStringFromObj(objPtr, &length); + TclGetStringFromObj(objPtr, &length); if (length > 0) { break; } @@ -2677,7 +2677,7 @@ TclDStringAppendObj( Tcl_Obj *objPtr) { int length; - char *bytes = Tcl_GetStringFromObj(objPtr, &length); + char *bytes = TclGetStringFromObj(objPtr, &length); return Tcl_DStringAppend(dsPtr, bytes, length); } @@ -4000,7 +4000,7 @@ TclSetProcessGlobalValue( } else { Tcl_CreateExitHandler(FreeProcessGlobalValue, pgvPtr); } - bytes = Tcl_GetStringFromObj(newValue, &pgvPtr->numBytes); + bytes = TclGetStringFromObj(newValue, &pgvPtr->numBytes); pgvPtr->value = ckalloc(pgvPtr->numBytes + 1); memcpy(pgvPtr->value, bytes, (unsigned) pgvPtr->numBytes + 1); if (pgvPtr->encoding) { diff --git a/generic/tclZlib.c b/generic/tclZlib.c index dac47cf..10fa4f7 100644 --- a/generic/tclZlib.c +++ b/generic/tclZlib.c @@ -438,7 +438,7 @@ GenerateHeader( if (GetValue(interp, dictObj, "comment", &value) != TCL_OK) { goto error; } else if (value != NULL) { - valueStr = Tcl_GetStringFromObj(value, &len); + valueStr = TclGetStringFromObj(value, &len); Tcl_UtfToExternal(NULL, latin1enc, valueStr, len, 0, NULL, headerPtr->nativeCommentBuf, MAX_COMMENT_LEN-1, NULL, &len, NULL); @@ -459,7 +459,7 @@ GenerateHeader( if (GetValue(interp, dictObj, "filename", &value) != TCL_OK) { goto error; } else if (value != NULL) { - valueStr = Tcl_GetStringFromObj(value, &len); + valueStr = TclGetStringFromObj(value, &len); Tcl_UtfToExternal(NULL, latin1enc, valueStr, len, 0, NULL, headerPtr->nativeFilenameBuf, MAXPATHLEN-1, NULL, &len, NULL); headerPtr->nativeFilenameBuf[len] = '\0'; @@ -3346,7 +3346,7 @@ ZlibTransformGetOption( } else { if (cd->compDictObj) { int len; - const char *str = Tcl_GetStringFromObj(cd->compDictObj, &len); + const char *str = TclGetStringFromObj(cd->compDictObj, &len); Tcl_DStringAppend(dsPtr, str, len); } diff --git a/macosx/tclMacOSXFCmd.c b/macosx/tclMacOSXFCmd.c index 7c643a3..946e350 100644 --- a/macosx/tclMacOSXFCmd.c +++ b/macosx/tclMacOSXFCmd.c @@ -640,7 +640,7 @@ SetOSTypeFromAny( Tcl_DString ds; Tcl_Encoding encoding = Tcl_GetEncoding(NULL, "macRoman"); - string = Tcl_GetStringFromObj(objPtr, &length); + string = TclGetStringFromObj(objPtr, &length); Tcl_UtfToExternalDString(encoding, string, length, &ds); if (Tcl_DStringLength(&ds) > 4) { diff --git a/unix/dltest/pkgua.c b/unix/dltest/pkgua.c index 6d95640..8634a5e 100644 --- a/unix/dltest/pkgua.c +++ b/unix/dltest/pkgua.c @@ -11,7 +11,6 @@ * this file, and for a DISCLAIMER OF ALL WARRANTIES. */ -#undef STATIC_BUILD #include "tcl.h" /* @@ -70,7 +69,7 @@ PkguaInterpToTokens( int newEntry; Tcl_Command *cmdTokens; Tcl_HashEntry *entryPtr = - Tcl_CreateHashEntry(&interpTokenMap, (char *) interp, &newEntry); + Tcl_CreateHashEntry(&interpTokenMap, interp, &newEntry); if (newEntry) { cmdTokens = (Tcl_Command *) @@ -90,7 +89,7 @@ PkguaDeleteTokens( Tcl_Interp *interp) { Tcl_HashEntry *entryPtr = - Tcl_FindHashEntry(&interpTokenMap, (char *) interp); + Tcl_FindHashEntry(&interpTokenMap, interp); if (entryPtr) { Tcl_Free((char *) Tcl_GetHashValue(entryPtr)); diff --git a/unix/tclUnixFCmd.c b/unix/tclUnixFCmd.c index a1a409e..4d38f8e 100644 --- a/unix/tclUnixFCmd.c +++ b/unix/tclUnixFCmd.c @@ -1509,7 +1509,7 @@ SetGroupAttribute( const char *string; int length; - string = Tcl_GetStringFromObj(attributePtr, &length); + string = TclGetStringFromObj(attributePtr, &length); native = Tcl_UtfToExternalDString(NULL, string, length, &ds); groupPtr = TclpGetGrNam(native); /* INTL: Native. */ @@ -1576,7 +1576,7 @@ SetOwnerAttribute( const char *string; int length; - string = Tcl_GetStringFromObj(attributePtr, &length); + string = TclGetStringFromObj(attributePtr, &length); native = Tcl_UtfToExternalDString(NULL, string, length, &ds); pwPtr = TclpGetPwNam(native); /* INTL: Native. */ @@ -1948,7 +1948,7 @@ TclpObjNormalizePath( const char *currentPathEndPosition; int pathLen; char cur; - const char *path = Tcl_GetStringFromObj(pathPtr, &pathLen); + const char *path = TclGetStringFromObj(pathPtr, &pathLen); Tcl_DString ds; const char *nativePath; #ifndef NO_REALPATH @@ -2184,7 +2184,7 @@ TclUnixOpenTemporaryFile( */ if (dirObj) { - string = Tcl_GetStringFromObj(dirObj, &len); + string = TclGetStringFromObj(dirObj, &len); Tcl_UtfToExternalDString(NULL, string, len, &template); } else { Tcl_DStringInit(&template); @@ -2194,7 +2194,7 @@ TclUnixOpenTemporaryFile( TclDStringAppendLiteral(&template, "/"); if (basenameObj) { - string = Tcl_GetStringFromObj(basenameObj, &len); + string = TclGetStringFromObj(basenameObj, &len); Tcl_UtfToExternalDString(NULL, string, len, &tmp); TclDStringAppendDString(&template, &tmp); Tcl_DStringFree(&tmp); @@ -2206,7 +2206,7 @@ TclUnixOpenTemporaryFile( #ifdef HAVE_MKSTEMPS if (extensionObj) { - string = Tcl_GetStringFromObj(extensionObj, &len); + string = TclGetStringFromObj(extensionObj, &len); Tcl_UtfToExternalDString(NULL, string, len, &tmp); TclDStringAppendDString(&template, &tmp); fd = mkstemps(Tcl_DStringValue(&template), Tcl_DStringLength(&tmp)); diff --git a/unix/tclUnixFile.c b/unix/tclUnixFile.c index 7ffbf8d..886b5ad 100644 --- a/unix/tclUnixFile.c +++ b/unix/tclUnixFile.c @@ -269,7 +269,7 @@ TclpMatchInDirectory( Tcl_DString dsOrig; /* utf-8 encoding of dir */ Tcl_DStringInit(&dsOrig); - dirName = Tcl_GetStringFromObj(fileNamePtr, &dirLength); + dirName = TclGetStringFromObj(fileNamePtr, &dirLength); Tcl_DStringAppend(&dsOrig, dirName, dirLength); /* @@ -951,7 +951,7 @@ TclpObjLink( if (transPtr == NULL) { return NULL; } - target = Tcl_GetStringFromObj(transPtr, &targetLen); + target = TclGetStringFromObj(transPtr, &targetLen); target = Tcl_UtfToExternalDString(NULL, target, targetLen, &ds); Tcl_DecrRefCount(transPtr); @@ -1105,7 +1105,7 @@ TclNativeCreateNativeRep( Tcl_IncrRefCount(validPathPtr); } - str = Tcl_GetStringFromObj(validPathPtr, &len); + str = TclGetStringFromObj(validPathPtr, &len); Tcl_UtfToExternalDString(NULL, str, len, &ds); len = Tcl_DStringLength(&ds) + sizeof(char); if (strlen(Tcl_DStringValue(&ds)) < len - sizeof(char)) { diff --git a/unix/tclUnixInit.c b/unix/tclUnixInit.c index aaff9ec..57215f1 100644 --- a/unix/tclUnixInit.c +++ b/unix/tclUnixInit.c @@ -550,7 +550,7 @@ TclpInitLibraryPath( Tcl_DStringFree(&buffer); *encodingPtr = Tcl_GetEncoding(NULL, NULL); - str = Tcl_GetStringFromObj(pathPtr, lengthPtr); + str = TclGetStringFromObj(pathPtr, lengthPtr); *valuePtr = ckalloc((*lengthPtr) + 1); memcpy(*valuePtr, str, (size_t)(*lengthPtr)+1); Tcl_DecrRefCount(pathPtr); diff --git a/win/tclWinFCmd.c b/win/tclWinFCmd.c index 52ea8c6..8904a05 100644 --- a/win/tclWinFCmd.c +++ b/win/tclWinFCmd.c @@ -1526,7 +1526,7 @@ GetWinFileAttributes( */ int len; - const char *str = Tcl_GetStringFromObj(fileName,&len); + const char *str = TclGetStringFromObj(fileName,&len); if (len < 4) { if (len == 0) { @@ -1615,7 +1615,7 @@ ConvertFileNameFormat( Tcl_ListObjIndex(NULL, splitPath, i, &elt); - pathv = Tcl_GetStringFromObj(elt, &pathLen); + pathv = TclGetStringFromObj(elt, &pathLen); if ((pathv[0] == '/') || ((pathLen == 3) && (pathv[1] == ':')) || (strcmp(pathv, ".") == 0) || (strcmp(pathv, "..") == 0)) { /* @@ -1653,7 +1653,7 @@ ConvertFileNameFormat( */ Tcl_DStringInit(&ds); - tempString = Tcl_GetStringFromObj(tempPath,&tempLen); + tempString = TclGetStringFromObj(tempPath,&tempLen); nativeName = Tcl_WinUtfToTChar(tempString, tempLen, &ds); Tcl_DecrRefCount(tempPath); handle = FindFirstFile(nativeName, &data); diff --git a/win/tclWinFile.c b/win/tclWinFile.c index 4b0b884..c840a46 100755 --- a/win/tclWinFile.c +++ b/win/tclWinFile.c @@ -935,7 +935,7 @@ TclpMatchInDirectory( int len; DWORD attr; WIN32_FILE_ATTRIBUTE_DATA data; - const char *str = Tcl_GetStringFromObj(norm,&len); + const char *str = TclGetStringFromObj(norm,&len); native = Tcl_FSGetNativePath(pathPtr); @@ -995,7 +995,7 @@ TclpMatchInDirectory( */ Tcl_DStringInit(&dsOrig); - dirName = Tcl_GetStringFromObj(fileNamePtr, &dirLength); + dirName = TclGetStringFromObj(fileNamePtr, &dirLength); Tcl_DStringAppend(&dsOrig, dirName, dirLength); lastChar = dirName[dirLength -1]; @@ -2689,7 +2689,7 @@ TclpObjNormalizePath( tmpPathPtr = Tcl_NewStringObj(Tcl_DStringValue(&ds), nextCheckpoint); Tcl_AppendToObj(tmpPathPtr, lastValidPathEnd, -1); - path = Tcl_GetStringFromObj(tmpPathPtr, &len); + path = TclGetStringFromObj(tmpPathPtr, &len); Tcl_SetStringObj(pathPtr, path, len); Tcl_DecrRefCount(tmpPathPtr); } else { @@ -2775,7 +2775,7 @@ TclWinVolumeRelativeNormalize( int cwdLen; const char *drive = - Tcl_GetStringFromObj(useThisCwd, &cwdLen); + TclGetStringFromObj(useThisCwd, &cwdLen); char drive_cur = path[0]; if (drive_cur >= 'a') { diff --git a/win/tclWinInit.c b/win/tclWinInit.c index 8b600f6..b5a07aa 100644 --- a/win/tclWinInit.c +++ b/win/tclWinInit.c @@ -214,7 +214,7 @@ TclpInitLibraryPath( TclGetProcessGlobalValue(&sourceLibraryDir)); *encodingPtr = NULL; - bytes = Tcl_GetStringFromObj(pathPtr, lengthPtr); + bytes = TclGetStringFromObj(pathPtr, lengthPtr); *valuePtr = ckalloc((*lengthPtr) + 1); memcpy(*valuePtr, bytes, (size_t)(*lengthPtr)+1); Tcl_DecrRefCount(pathPtr); -- cgit v0.12 From 8f0cfce66a4fd94536faac0595c3d7d7c7844d64 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Fri, 8 Jul 2016 12:38:35 +0000 Subject: (cherry-pick): Bugfix [5d7ea04580]. Treat .cmd and .ps1 files are executable on Windows. --- doc/file.n | 4 +++- win/tclWinFile.c | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/doc/file.n b/doc/file.n index 36eae79..43eae7a 100644 --- a/doc/file.n +++ b/doc/file.n @@ -156,7 +156,9 @@ returns \fB/home\fR (or something similar). \fBfile executable \fIname\fR . Returns \fB1\fR if file \fIname\fR is executable by the current user, -\fB0\fR otherwise. +\fB0\fR otherwise. On Windows, which does not have an executable attribute, +the command treats all directories and any files with extensions +\fBexe\fR, \fBcom\fR, \fBcmd\fR, \fBbat\fR or \fBps1\fR as executable. .TP \fBfile exists \fIname\fR . diff --git a/win/tclWinFile.c b/win/tclWinFile.c index 41de4a8..e671058 100755 --- a/win/tclWinFile.c +++ b/win/tclWinFile.c @@ -1783,7 +1783,7 @@ NativeAccess( * NativeIsExec -- * * Determines if a path is executable. On windows this is simply defined - * by whether the path ends in any of ".exe", ".com", or ".bat" + * by whether the path ends in a standard executable extension. * * Results: * 1 = executable, 0 = not. @@ -1834,6 +1834,8 @@ NativeIsExec( if ((strcasecmp(p, "exe") == 0) || (strcasecmp(p, "com") == 0) + || (strcasecmp(p, "cmd") == 0) + || (strcasecmp(p, "ps1") == 0) || (strcasecmp(p, "bat") == 0)) { /* * File that ends with .exe, .com, or .bat is executable. -- cgit v0.12 From 8435bb9d68cdb26190ded1caca280eaac0314444 Mon Sep 17 00:00:00 2001 From: ashok Date: Sat, 9 Jul 2016 08:27:00 +0000 Subject: Bugfix [ae61a67192]. file {stat, type, size} etc. support for built-in special Windows files/devices like CON. --- generic/tclCmdAH.c | 19 ++++++++++++++++++ tests/cmdAH.test | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++++-- win/tclWinFile.c | 43 +++++++++++++++++++++++++++++++---------- win/tclWinPort.h | 14 ++++++++++++++ 4 files changed, 120 insertions(+), 12 deletions(-) diff --git a/generic/tclCmdAH.c b/generic/tclCmdAH.c index 54e0227..a53f1f7 100644 --- a/generic/tclCmdAH.c +++ b/generic/tclCmdAH.c @@ -1157,6 +1157,16 @@ FileAttrAccessTimeCmd( if (GetStatBuf(interp, objv[1], Tcl_FSStat, &buf) != TCL_OK) { return TCL_ERROR; } +#if defined(_WIN32) + /* We use a value of 0 to indicate the access time not available */ + if (buf.st_atime == 0) { + Tcl_SetObjResult(interp, Tcl_ObjPrintf( + "could not get access time for file \"%s\"", + TclGetString(objv[1]))); + return TCL_ERROR; + } +#endif + if (objc == 3) { /* * Need separate variable for reading longs from an object on 64-bit @@ -1229,6 +1239,15 @@ FileAttrModifyTimeCmd( if (GetStatBuf(interp, objv[1], Tcl_FSStat, &buf) != TCL_OK) { return TCL_ERROR; } +#if defined(_WIN32) + /* We use a value of 0 to indicate the modification time not available */ + if (buf.st_mtime == 0) { + Tcl_SetObjResult(interp, Tcl_ObjPrintf( + "could not get modification time for file \"%s\"", + TclGetString(objv[1]))); + return TCL_ERROR; + } +#endif if (objc == 3) { /* * Need separate variable for reading longs from an object on 64-bit diff --git a/tests/cmdAH.test b/tests/cmdAH.test index f2f7f8c..6240500 100644 --- a/tests/cmdAH.test +++ b/tests/cmdAH.test @@ -1026,6 +1026,16 @@ test cmdAH-20.6 {Tcl_FileObjCmd: atime touch} -setup { set modatime [file atime $file $newatime] expr {$newatime == $modatime ? 1 : "$newatime != $modatime"} } -result 1 +test cmdAH-20.7 { + Tcl_FileObjCmd: atime (built-in Windows names) +} -constraints {win} -body { + file atime con +} -result "could not get access time for file \"con\"" -returnCodes error +test cmdAH-20.7.1 { + Tcl_FileObjCmd: atime (built-in Windows names with dir path and extension) +} -constraints {win} -body { + file atime [file join [temporaryDirectory] CON.txt] +} -result "could not get access time for file \"[file join [temporaryDirectory] CON.txt]\"" -returnCodes error if {[testConstraint unix] && [file exists /tmp]} { removeFile touch.me /tmp @@ -1257,6 +1267,16 @@ test cmdAH-24.13 {Tcl_FileObjCmd: directory mtime} -setup { } -cleanup { file delete -force $dirname } -result {0 1} +test cmdAH-24.14 { + Tcl_FileObjCmd: mtime (built-in Windows names) +} -constraints {win} -body { + file mtime con +} -result "could not get modification time for file \"con\"" -returnCodes error +test cmdAH-24.14.1 { + Tcl_FileObjCmd: mtime (built-in Windows names with dir path and extension) +} -constraints {win} -body { + file mtime [file join [temporaryDirectory] CON.txt] +} -result "could not get modification time for file \"[file join [temporaryDirectory] CON.txt]\"" -returnCodes error # owned test cmdAH-25.1 {Tcl_FileObjCmd: owned} -returnCodes error -body { @@ -1306,6 +1326,16 @@ test cmdAH-27.2 {Tcl_FileObjCmd: size} { test cmdAH-27.3 {Tcl_FileObjCmd: size} { list [catch {file size _bogus_} msg] [string tolower $msg] $errorCode } {1 {could not read "_bogus_": no such file or directory} {POSIX ENOENT {no such file or directory}}} +test cmdAH-27.4 { + Tcl_FileObjCmd: size (built-in Windows names) +} -constraints {win} -body { + file size con +} -result 0 +test cmdAH-27.4.1 { + Tcl_FileObjCmd: size (built-in Windows names with dir path and extension) +} -constraints {win} -body { + file size [file join [temporaryDirectory] con.txt] +} -result 0 catch {testsetplatform $platform} removeFile $gorpfile @@ -1397,12 +1427,24 @@ test cmdAH-28.12 {Tcl_FileObjCmd: stat} -setup { } -cleanup { removeFile $filename } -result 1 +test cmdAH-28.13 {Tcl_FileObjCmd: stat (built-in Windows names)} -setup { + unset -nocomplain stat +} -body { + file stat con stat + lmap elem {atime ctime dev gid ino mode mtime nlink size type uid} {set stat($elem)} +} -result {0 0 -1 0 0 8630 0 0 0 characterSpecial 0} +test cmdAH-28.13.1 {Tcl_FileObjCmd: stat (built-in Windows names)} -setup { + unset -nocomplain stat +} -body { + file stat [file join [temporaryDirectory] CON.txt] stat + lmap elem {atime ctime dev gid ino mode mtime nlink size type uid} {set stat($elem)} +} -result {0 0 -1 0 0 8630 0 0 0 characterSpecial 0} unset -nocomplain stat # type test cmdAH-29.1 {Tcl_FileObjCmd: type} -returnCodes error -body { - file size a b -} -result {wrong # args: should be "file size name"} + file type a b +} -result {wrong # args: should be "file type name"} test cmdAH-29.2 {Tcl_FileObjCmd: type} { file type $dirfile } directory @@ -1437,6 +1479,16 @@ test cmdAH-29.4.1 {Tcl_FileObjCmd: type} -constraints {linkDirectory} -setup { test cmdAH-29.5 {Tcl_FileObjCmd: type} { list [catch {file type _bogus_} msg] [string tolower $msg] $errorCode } {1 {could not read "_bogus_": no such file or directory} {POSIX ENOENT {no such file or directory}}} +test cmdAH-29.6 { + Tcl_FileObjCmd: type (built-in Windows names) +} -constraints {win} -body { + file type con +} -result "characterSpecial" +test cmdAH-29.6.1 { + Tcl_FileObjCmd: type (built-in Windows names, with dir path and extension) +} -constraints {win} -body { + file type [file join [temporaryDirectory] CON.txt] +} -result "characterSpecial" # Error conditions test cmdAH-30.1 {Tcl_FileObjCmd: error conditions} -returnCodes error -body { diff --git a/win/tclWinFile.c b/win/tclWinFile.c index 4b0b884..7f6dff9 100755 --- a/win/tclWinFile.c +++ b/win/tclWinFile.c @@ -1953,6 +1953,7 @@ NativeStat( unsigned short mode; unsigned int inode = 0; HANDLE fileHandle; + DWORD fileType = FILE_TYPE_UNKNOWN; /* * If we can use 'createFile' on this, then we can use the resulting @@ -1960,6 +1961,14 @@ NativeStat( * other attributes reading APIs. If not, then we try to fall back on the * 'getFileAttributesExProc', and if that isn't available, then on even * simpler routines. + * + * Special consideration must be given to Windows hardcoded names + * like CON, NULL, COM1, LPT1 etc. For these, we still need to + * do the CreateFile as some may not exist (e.g. there is no CON + * in wish by default). However the subsequent GetFileInformationByHandle + * will fail. We do a WinIsReserved to see if it is one of the special + * names, and if successful, mock up a BY_HANDLE_FILE_INFORMATION + * structure. */ fileHandle = CreateFile(nativePath, GENERIC_READ, @@ -1970,19 +1979,26 @@ NativeStat( BY_HANDLE_FILE_INFORMATION data; if (GetFileInformationByHandle(fileHandle,&data) != TRUE) { - CloseHandle(fileHandle); - Tcl_SetErrno(ENOENT); - return -1; - } - CloseHandle(fileHandle); - + fileType = GetFileType(fileHandle); + CloseHandle(fileHandle); + if (fileType != FILE_TYPE_CHAR && fileType != FILE_TYPE_DISK) { + Tcl_SetErrno(ENOENT); + return -1; + } + /* Mock up the expected structure */ + memset(&data, 0, sizeof(data)); + statPtr->st_atime = 0; + statPtr->st_mtime = 0; + statPtr->st_ctime = 0; + } else { + CloseHandle(fileHandle); + statPtr->st_atime = ToCTime(data.ftLastAccessTime); + statPtr->st_mtime = ToCTime(data.ftLastWriteTime); + statPtr->st_ctime = ToCTime(data.ftCreationTime); + } attr = data.dwFileAttributes; - statPtr->st_size = ((Tcl_WideInt) data.nFileSizeLow) | (((Tcl_WideInt) data.nFileSizeHigh) << 32); - statPtr->st_atime = ToCTime(data.ftLastAccessTime); - statPtr->st_mtime = ToCTime(data.ftLastWriteTime); - statPtr->st_ctime = ToCTime(data.ftCreationTime); /* * On Unix, for directories, nlink apparently depends on the number of @@ -2038,6 +2054,13 @@ NativeStat( dev = NativeDev(nativePath); mode = NativeStatMode(attr, checkLinks, NativeIsExec(nativePath)); + if (fileType == FILE_TYPE_CHAR) { + mode &= ~S_IFMT; + mode |= S_IFCHR; + } else if (fileType == FILE_TYPE_DISK) { + mode &= ~S_IFMT; + mode |= S_IFBLK; + } statPtr->st_dev = (dev_t) dev; statPtr->st_ino = inode; diff --git a/win/tclWinPort.h b/win/tclWinPort.h index ca6b2bf..b486466 100644 --- a/win/tclWinPort.h +++ b/win/tclWinPort.h @@ -360,6 +360,20 @@ typedef DWORD_PTR * PDWORD_PTR; # define S_IFLNK 0120000 /* Symbolic Link */ #endif +/* + * Windows compilers do not define S_IFBLK. However, Tcl uses it in + * GetTypeFromMode to identify blockSpecial devices based on the + * value in the statsbuf st_mode field. We have no other way to pass this + * from NativeStat on Windows so are forced to define it here. + * The definition here is essentially what is seen on Linux and MingW. + * XXX - the root problem is Tcl using Unix definitions instead of + * abstracting the structure into a platform independent one. Sigh - perhaps + * Tcl 9 + */ +#ifndef S_IFBLK +# define S_IFBLK (S_IFDIR | S_IFCHR) +#endif + #ifndef S_ISREG # ifdef S_IFREG # define S_ISREG(m) (((m) & S_IFMT) == S_IFREG) -- cgit v0.12 From 673b7ecc2109080c1d8ab85bede83600d5dfff1e Mon Sep 17 00:00:00 2001 From: ashok Date: Sat, 9 Jul 2016 11:13:48 +0000 Subject: Bugfix [3613671]. file owned implementation for Windows. --- doc/file.n | 7 +++--- generic/tclCmdAH.c | 17 +++++--------- tests/cmdAH.test | 6 +++++ win/tclWinFile.c | 66 +++++++++++++++++++++++++++++++++++++++++++++++++++++- win/tclWinInt.h | 1 + 5 files changed, 81 insertions(+), 16 deletions(-) diff --git a/doc/file.n b/doc/file.n index eeb67ed..58b03d8 100644 --- a/doc/file.n +++ b/doc/file.n @@ -484,10 +484,9 @@ not the effective ones. .TP \fBWindows\fR\0\0\0\0 . -The \fBfile owned\fR subcommand currently always reports that the current user -is the owner of the file, without regard for what the operating system -believes to be true, making an ownership test useless. This issue (#3613671) -may be fixed in a future release of Tcl. +The \fBfile owned\fR subcommand uses the user identifier (SID) of +the process token, not the thread token which may be impersonating +some other user. .SH EXAMPLES .PP This procedure shows how to search for C files in a given directory diff --git a/generic/tclCmdAH.c b/generic/tclCmdAH.c index a53f1f7..13d3df5 100644 --- a/generic/tclCmdAH.c +++ b/generic/tclCmdAH.c @@ -12,6 +12,9 @@ */ #include "tclInt.h" +#ifdef _WIN32 +# include "tclWinInt.h" +#endif #include /* @@ -1600,21 +1603,13 @@ FileAttrIsOwnedCmd( Tcl_WrongNumArgs(interp, 1, objv, "name"); return TCL_ERROR; } - if (GetStatBuf(NULL, objv[1], Tcl_FSStat, &buf) == TCL_OK) { - /* - * For Windows, there are no user ids associated with a file, so we - * always return 1. - * - * TODO: use GetSecurityInfo to get the real owner of the file and - * test for equivalence to the current user. - */ - #if defined(_WIN32) || defined(__CYGWIN__) - value = 1; + value = TclWinFileOwned(objv[1]); #else + if (GetStatBuf(NULL, objv[1], Tcl_FSStat, &buf) == TCL_OK) { value = (geteuid() == buf.st_uid); -#endif } +#endif Tcl_SetObjResult(interp, Tcl_NewBooleanObj(value)); return TCL_OK; } diff --git a/tests/cmdAH.test b/tests/cmdAH.test index 6240500..c74bddb 100644 --- a/tests/cmdAH.test +++ b/tests/cmdAH.test @@ -1296,6 +1296,12 @@ test cmdAH-25.2.1 {Tcl_FileObjCmd: owned} -constraints unix -setup { test cmdAH-25.3 {Tcl_FileObjCmd: owned} {unix notRoot} { file owned / } 0 +test cmdAH-25.3.1 {Tcl_FileObjCmd: owned} -constraints win -body { + file owned $env(windir) +} -result 0 +test cmdAH-25.4 {Tcl_FileObjCmd: owned} -body { + file owned nosuchfile +} -result 0 # readlink test cmdAH-26.1 {Tcl_FileObjCmd: readlink} -returnCodes error -body { diff --git a/win/tclWinFile.c b/win/tclWinFile.c index 7f6dff9..3e8a171 100755 --- a/win/tclWinFile.c +++ b/win/tclWinFile.c @@ -16,8 +16,9 @@ #include "tclFileSystem.h" #include #include -#include /* For TclpGetUserHome(). */ +#include /* For TclpGetUserHome(). */ #include /* For TclpGetUserHome(). */ +#include /* For GetNamedSecurityInfo */ #ifdef _MSC_VER # pragma comment(lib, "userenv.lib") @@ -3134,6 +3135,69 @@ TclpUtime( } /* + *--------------------------------------------------------------------------- + * + * TclWinFileOwned -- + * + * Returns 1 if the specified file exists and is owned by the current + * user and 0 otherwise. Like the Unix case, the check is made using + * the real process SID, not the effective (impersonation) one. + * + *--------------------------------------------------------------------------- + */ + +int +TclWinFileOwned( + Tcl_Obj *pathPtr) /* File whose ownership is to be checked */ +{ + const TCHAR *native; + PSID ownerSid = NULL; + PSECURITY_DESCRIPTOR secd = NULL; + HANDLE token; + LPBYTE buf = NULL; + DWORD bufsz; + int owned = 0; + + native = Tcl_FSGetNativePath(pathPtr); + + if (GetNamedSecurityInfo(native, SE_FILE_OBJECT, + OWNER_SECURITY_INFORMATION, &ownerSid, + NULL, NULL, NULL, &secd) != ERROR_SUCCESS) { + /* Either not a file, or we do not have access to it in which + case we are in all likelihood not the owner */ + return 0; + } + + /* + * Getting the current process SID is a multi-step process. + * We make the assumption that if a call fails, this process is + * so underprivileged it could not possibly own anything. Normally + * a process can *always* look up its own token. + */ + if (OpenProcessToken(GetCurrentProcess(), TOKEN_QUERY, &token)) { + /* Find out how big the buffer needs to be */ + bufsz = 0; + GetTokenInformation(token, TokenUser, NULL, 0, &bufsz); + if (bufsz) { + buf = ckalloc(bufsz); + if (GetTokenInformation(token, TokenUser, buf, bufsz, &bufsz)) { + owned = EqualSid(ownerSid, ((PTOKEN_USER) buf)->User.Sid); + } + } + CloseHandle(token); + } + +vamoose: + /* Free allocations and be done */ + if (secd) + LocalFree(secd); /* Also frees ownerSid */ + if (buf) + ckfree(buf); + + return (owned != 0); /* Convert non-0 to 1 */ +} + +/* * Local Variables: * mode: c * c-basic-offset: 4 diff --git a/win/tclWinInt.h b/win/tclWinInt.h index 9df424f..6b098f8 100644 --- a/win/tclWinInt.h +++ b/win/tclWinInt.h @@ -72,6 +72,7 @@ MODULE_SCOPE int TclWinSymLinkCopyDirectory(const TCHAR *LinkOriginal, const TCHAR *LinkCopy); MODULE_SCOPE int TclWinSymLinkDelete(const TCHAR *LinkOriginal, int linkOnly); +MODULE_SCOPE int TclWinFileOwned(Tcl_Obj *); #if defined(TCL_THREADS) && defined(USE_THREAD_ALLOC) MODULE_SCOPE void TclWinFreeAllocCache(void); MODULE_SCOPE void TclFreeAllocCache(void *); -- cgit v0.12 From cc8c25008d6a30ceb0b4a6946e4a3d45431637c6 Mon Sep 17 00:00:00 2001 From: ashok Date: Sat, 9 Jul 2016 14:18:22 +0000 Subject: Bugfix [9ece99d58b]. Make exec understand .CMD files on Windows. --- tests/exec.test | 16 ++++++++++++++++ win/tclWinFile.c | 1 - win/tclWinPipe.c | 7 ++++--- 3 files changed, 20 insertions(+), 4 deletions(-) diff --git a/tests/exec.test b/tests/exec.test index 16a8320..38927d3 100644 --- a/tests/exec.test +++ b/tests/exec.test @@ -682,6 +682,22 @@ test exec-19.1 {exec >> uses O_APPEND} -constraints {exec unix} -setup { } -cleanup { removeFile $tmpfile } -result 14 + +# Tests to ensure batch files and .CMD (Bug 9ece99d58b) +# can be executed on Windows +test exec-20.0 {exec .bat file} -constraints {win} -body { + set log [makeFile {} exec20.log] + exec [makeFile "echo %1> $log" exec20.bat] "Testing exec-20.0" + viewFile $log +} -result "\"Testing exec-20.0\"" +test exec-20.1 {exec .CMD file} -constraints {win} -body { + set log [makeFile {} exec201.log] + exec [makeFile "echo %1> $log" exec201.CMD] "Testing exec-20.1" + viewFile $log +} -result "\"Testing exec-20.1\"" + + + # ---------------------------------------------------------------------- # cleanup diff --git a/win/tclWinFile.c b/win/tclWinFile.c index 3e8a171..dbfdfd0 100755 --- a/win/tclWinFile.c +++ b/win/tclWinFile.c @@ -1795,7 +1795,6 @@ NativeIsExec( if ((_tcsicmp(path+len-3, TEXT("exe")) == 0) || (_tcsicmp(path+len-3, TEXT("com")) == 0) || (_tcsicmp(path+len-3, TEXT("cmd")) == 0) - || (_tcsicmp(path+len-3, TEXT("ps1")) == 0) || (_tcsicmp(path+len-3, TEXT("bat")) == 0)) { return 1; } diff --git a/win/tclWinPipe.c b/win/tclWinPipe.c index aff8836..382addd 100644 --- a/win/tclWinPipe.c +++ b/win/tclWinPipe.c @@ -897,7 +897,7 @@ TclpGetPid( * * The complete Windows search path is searched to find the specified * executable. If an executable by the given name is not found, - * automatically tries appending ".com", ".exe", and ".bat" to the + * automatically tries appending standard extensions to the * executable name. * * Results: @@ -1292,7 +1292,7 @@ ApplicationType( Tcl_DString nameBuf, ds; const TCHAR *nativeName; TCHAR nativeFullPath[MAX_PATH]; - static const char extensions[][5] = {"", ".com", ".exe", ".bat"}; + static const char extensions[][5] = {"", ".com", ".exe", ".bat", ".cmd"}; /* * Look for the program as an external program. First try the name as it @@ -1337,7 +1337,8 @@ ApplicationType( Tcl_DStringFree(&ds); ext = strrchr(fullName, '.'); - if ((ext != NULL) && (strcasecmp(ext, ".bat") == 0)) { + if ((ext != NULL) && + (strcasecmp(ext, ".cmd") == 0 || strcasecmp(ext, ".bat") == 0)) { applType = APPL_DOS; break; } -- cgit v0.12 From 6b01fdf5d1344c640a5392e14bcdd7518758bbed Mon Sep 17 00:00:00 2001 From: ashok Date: Sat, 9 Jul 2016 14:23:24 +0000 Subject: Fixed docs for prior check-in (exec of .CMD files on Windows) --- doc/exec.n | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/doc/exec.n b/doc/exec.n index 9d58d90..70ace32 100644 --- a/doc/exec.n +++ b/doc/exec.n @@ -271,8 +271,9 @@ limitation as \fBexec\fR wants to communicate over pipes. The Expect extension addresses this issue when communicating with a TUI application. .PP When attempting to execute an application, \fBexec\fR first searches for -the name as it was specified. Then, in order, \fB.com\fR, \fB.exe\fR, and -\fB.bat\fR are appended to the end of the specified name and it searches +the name as it was specified. Then, in order, +\fB.com\fR, \fB.exe\fR, \fB.bat\fR and \fB.cmd\fR +are appended to the end of the specified name and it searches for the longer name. If a directory name was not specified as part of the application name, the following directories are automatically searched in order when attempting to locate the application: -- cgit v0.12 From 9130b29ef9ede2cafefe32403248930ba6f94dee Mon Sep 17 00:00:00 2001 From: dgp Date: Sat, 9 Jul 2016 14:26:56 +0000 Subject: Revise INST_INVOKE_REPLACE to call EvalObjv with TCL_EVAL_INVOKE and no longer call EvalObjEx which does not support it reliably. Also convert to conventional list operations. --- generic/tclExecute.c | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/generic/tclExecute.c b/generic/tclExecute.c index 8ddefda..52865e6 100644 --- a/generic/tclExecute.c +++ b/generic/tclExecute.c @@ -3153,20 +3153,7 @@ TEBCresume( fflush(stdout); } #endif /*TCL_COMPILE_DEBUG*/ - { - Tcl_Obj *copyPtr = Tcl_NewListObj(objc - opnd + 1, NULL); - register List *listRepPtr = copyPtr->internalRep.twoPtrValue.ptr1; - Tcl_Obj **copyObjv = &listRepPtr->elements; - int i; - listRepPtr->elemCount = objc - opnd + 1; - copyObjv[0] = objPtr; - memcpy(copyObjv+1, objv+opnd, sizeof(Tcl_Obj *) * (objc - opnd)); - for (i=1 ; idata.tebc.pc = (char *) pc; iPtr->cmdFramePtr = bcFramePtr; if (iPtr->flags & INTERP_DEBUG_FRAME) { @@ -3174,13 +3161,25 @@ TEBCresume( } TclInitRewriteEnsemble(interp, opnd, 1, objv); + + { + Tcl_Obj *copyPtr = Tcl_NewListObj(objc - opnd + 1, NULL); + + Tcl_ListObjAppendElement(NULL, copyPtr, objPtr); + Tcl_ListObjReplace(NULL, copyPtr, LIST_MAX, 0, + objc - opnd, objv + opnd); + objPtr = copyPtr; + } + DECACHE_STACK_INFO(); pc += 6; TEBC_YIELD(); TclMarkTailcall(interp); - TclNRAddCallback(interp, TclClearRootEnsemble, NULL,NULL,NULL,NULL); - return TclNREvalObjEx(interp, objPtr, TCL_EVAL_INVOKE, NULL, INT_MIN); + TclNRAddCallback(interp, TclClearRootEnsemble, NULL, NULL, NULL, NULL); + Tcl_ListObjGetElements(NULL, objPtr, &objc, &objv); + TclNRAddCallback(interp, TclNRReleaseValues, objPtr, NULL, NULL, NULL); + return TclNREvalObjv(interp, objc, objv, TCL_EVAL_INVOKE, NULL); /* * ----------------------------------------------------------------- -- cgit v0.12 From 39488ce3ef11fcbac48bd3c7e35b3ba3fb80c2de Mon Sep 17 00:00:00 2001 From: ashok Date: Sat, 9 Jul 2016 14:30:54 +0000 Subject: Fix missing constraints for Windows-specific tests --- tests/cmdAH.test | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/cmdAH.test b/tests/cmdAH.test index c74bddb..ef933cb 100644 --- a/tests/cmdAH.test +++ b/tests/cmdAH.test @@ -1433,13 +1433,13 @@ test cmdAH-28.12 {Tcl_FileObjCmd: stat} -setup { } -cleanup { removeFile $filename } -result 1 -test cmdAH-28.13 {Tcl_FileObjCmd: stat (built-in Windows names)} -setup { +test cmdAH-28.13 {Tcl_FileObjCmd: stat (built-in Windows names)} -constraints {win} -setup { unset -nocomplain stat } -body { file stat con stat lmap elem {atime ctime dev gid ino mode mtime nlink size type uid} {set stat($elem)} } -result {0 0 -1 0 0 8630 0 0 0 characterSpecial 0} -test cmdAH-28.13.1 {Tcl_FileObjCmd: stat (built-in Windows names)} -setup { +test cmdAH-28.13.1 {Tcl_FileObjCmd: stat (built-in Windows names)} -constraints {win} -setup { unset -nocomplain stat } -body { file stat [file join [temporaryDirectory] CON.txt] stat -- cgit v0.12 From 1a4a8552102094aeb6294acf74d78623df4206d3 Mon Sep 17 00:00:00 2001 From: ashok Date: Sun, 10 Jul 2016 06:33:20 +0000 Subject: Fix compiler warnings (const-ness and unused label) that did not show up in the non-optimized build before last checkin. --- win/tclWinFile.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/win/tclWinFile.c b/win/tclWinFile.c index dbfdfd0..4d7500b 100755 --- a/win/tclWinFile.c +++ b/win/tclWinFile.c @@ -3159,7 +3159,7 @@ TclWinFileOwned( native = Tcl_FSGetNativePath(pathPtr); - if (GetNamedSecurityInfo(native, SE_FILE_OBJECT, + if (GetNamedSecurityInfo((LPTSTR) native, SE_FILE_OBJECT, OWNER_SECURITY_INFORMATION, &ownerSid, NULL, NULL, NULL, &secd) != ERROR_SUCCESS) { /* Either not a file, or we do not have access to it in which @@ -3186,7 +3186,6 @@ TclWinFileOwned( CloseHandle(token); } -vamoose: /* Free allocations and be done */ if (secd) LocalFree(secd); /* Also frees ownerSid */ -- cgit v0.12 From 2d2ec051cf1bccebd8ceacb06ffb7ea6f332c72c Mon Sep 17 00:00:00 2001 From: ashok Date: Sun, 10 Jul 2016 06:41:54 +0000 Subject: Bugfix [da340d4f32]. clock-55.9 and clock-55.10 test failures. --- generic/tclClock.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/generic/tclClock.c b/generic/tclClock.c index 949cb1c..c3b29e9 100644 --- a/generic/tclClock.c +++ b/generic/tclClock.c @@ -1499,7 +1499,19 @@ GetJulianDayFromEraYearMonthDay( * Try an initial conversion in the Gregorian calendar. */ +#if 0 /* BUG http://core.tcl.tk/tcl/tktview?name=da340d4f32 */ ym1o4 = ym1 / 4; +#else + /* + * Have to make sure quotient is truncated towards 0 when negative. + * See above bug for details. The casts are necessary. + */ + if (ym1 >= 0) + ym1o4 = ym1 / 4; + else { + ym1o4 = - (int) (((unsigned int) -ym1) / 4); + } +#endif if (ym1 % 4 < 0) { ym1o4--; } -- cgit v0.12 From 3503e831432d62edd78f63cb90a322d3ad51d6a3 Mon Sep 17 00:00:00 2001 From: dkf Date: Sun, 10 Jul 2016 07:59:52 +0000 Subject: Fixes to namespace.test --- tests/namespace.test | 418 +++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 306 insertions(+), 112 deletions(-) diff --git a/tests/namespace.test b/tests/namespace.test index dc1d3bf..575695f 100644 --- a/tests/namespace.test +++ b/tests/namespace.test @@ -82,12 +82,14 @@ test namespace-4.2 {Tcl_PushCallFrame with isProcCallFrame=0} { test namespace-5.1 {Tcl_PopCallFrame, no vars} { namespace eval test_ns_1::blodge {} ;# pushes then pops frame } {} -test namespace-5.2 {Tcl_PopCallFrame, local vars must be deleted} { +test namespace-5.2 {Tcl_PopCallFrame, local vars must be deleted} -setup { + namespace eval test_ns_1 {} +} -body { proc test_ns_1::r {} { set a 123 } test_ns_1::r ;# pushes then pop's r's frame -} {123} +} -result {123} test namespace-6.1 {Tcl_CreateNamespace} { catch {namespace delete {*}[namespace children :: test_ns_*]} @@ -194,7 +196,6 @@ test namespace-7.7 {Bug 1655305} -setup { interp delete slave } -result {} - test namespace-8.1 {TclTeardownNamespace, delete global namespace} { catch {interp delete test_interp} interp create test_interp @@ -303,15 +304,24 @@ test namespace-9.4 {Tcl_Import, simple import} { } test_ns_import::p } {cmd1: 123} -test namespace-9.5 {Tcl_Import, RFE 1230597} { +test namespace-9.5 {Tcl_Import, RFE 1230597} -setup { + namespace eval test_ns_import {} + namespace eval test_ns_export {} +} -body { list [catch {namespace eval test_ns_import {namespace import ::test_ns_export::*}} msg] $msg -} {0 {}} -test namespace-9.6 {Tcl_Import, cmd redefinition ok if allowOverwrite!=0} { +} -result {0 {}} +test namespace-9.6 {Tcl_Import, cmd redefinition ok if allowOverwrite!=0} -setup { + namespace eval test_ns_import {} + namespace eval ::test_ns_export { + proc cmd1 {args} {return "cmd1: $args"} + namespace export cmd1 + } +} -body { namespace eval test_ns_import { namespace import -force ::test_ns_export::* cmd1 555 } -} {cmd1: 555} +} -result {cmd1: 555} test namespace-9.7 {Tcl_Import, links are preserved if cmd is redefined} { catch {namespace delete {*}[namespace children :: test_ns_*]} namespace eval test_ns_export { @@ -329,7 +339,6 @@ test namespace-9.7 {Tcl_Import, links are preserved if cmd is redefined} { [test_ns_import::cmd1 g h i] \ [test_ns_export::cmd1 j k l] } {{cmd1: a b c} {cmd1: d e f} {} ::test_ns_export::cmd1 ::test_ns_export::cmd1 {new1: g h i} {new1: j k l}} - test namespace-9.8 {Tcl_Import: Bug 1017299} -setup { namespace eval one { namespace export cmd @@ -354,7 +363,6 @@ test namespace-9.8 {Tcl_Import: Bug 1017299} -setup { } -cleanup { namespace delete one two three } -match glob -result *::one::cmd - test namespace-9.9 {Tcl_Import: Bug 1017299} -setup { namespace eval one { namespace export cmd @@ -388,7 +396,13 @@ test namespace-10.2 {Tcl_ForgetImport, ignores patterns that don't match} { namespace forget ::test_ns_export::wombat } } {} -test namespace-10.3 {Tcl_ForgetImport, deletes matching imported cmds} { +test namespace-10.3 {Tcl_ForgetImport, deletes matching imported cmds} -setup { + namespace eval test_ns_export { + namespace export cmd1 + proc cmd1 {args} {return "cmd1: $args"} + proc cmd2 {args} {return "cmd2: $args"} + } +} -body { namespace eval test_ns_import { namespace import ::test_ns_export::* proc p {} {return [cmd1 123]} @@ -398,8 +412,7 @@ test namespace-10.3 {Tcl_ForgetImport, deletes matching imported cmds} { lappend l [info commands ::test_ns_import::*] lappend l [catch {cmd1 777} msg] $msg } -} [list [lsort {::test_ns_import::p ::test_ns_import::cmd1}] ::test_ns_import::p 1 {invalid command name "cmd1"}] - +} -result [list [lsort {::test_ns_import::p ::test_ns_import::cmd1}] ::test_ns_import::p 1 {invalid command name "cmd1"}] test namespace-10.4 {Tcl_ForgetImport: Bug 560297} -setup { namespace eval origin { namespace export cmd @@ -417,7 +430,6 @@ test namespace-10.4 {Tcl_ForgetImport: Bug 560297} -setup { } -cleanup { namespace delete origin unrelated my } - test namespace-10.5 {Tcl_ForgetImport: Bug 560297} -setup { namespace eval origin { namespace export cmd @@ -433,7 +445,6 @@ test namespace-10.5 {Tcl_ForgetImport: Bug 560297} -setup { } -cleanup { namespace delete origin my } -returnCodes error -match glob -result * - test namespace-10.6 {Tcl_ForgetImport: Bug 560297} -setup { namespace eval origin { namespace export cmd @@ -450,7 +461,6 @@ test namespace-10.6 {Tcl_ForgetImport: Bug 560297} -setup { } -cleanup { namespace delete origin my your } -returnCodes error -match glob -result * - test namespace-10.7 {Tcl_ForgetImport: Bug 560297} -setup { namespace eval origin { namespace export cmd @@ -471,7 +481,6 @@ test namespace-10.7 {Tcl_ForgetImport: Bug 560297} -setup { } -cleanup { namespace delete origin link link2 my } -returnCodes error -match glob -result * - test namespace-10.8 {Tcl_ForgetImport: Bug 560297} -setup { namespace eval origin { namespace export cmd @@ -492,7 +501,6 @@ test namespace-10.8 {Tcl_ForgetImport: Bug 560297} -setup { } -cleanup { namespace delete origin link link2 my } - test namespace-10.9 {Tcl_ForgetImport: Bug 560297} -setup { namespace eval origin { namespace export cmd @@ -514,29 +522,47 @@ test namespace-10.9 {Tcl_ForgetImport: Bug 560297} -setup { namespace delete origin link link2 my } -returnCodes error -match glob -result * -test namespace-11.1 {TclGetOriginalCommand, check if not imported cmd} { +test namespace-11.1 {TclGetOriginalCommand, check if not imported cmd} -setup { catch {namespace delete {*}[namespace children :: test_ns_*]} +} -body { namespace eval test_ns_export { namespace export cmd1 proc cmd1 {args} {return "cmd1: $args"} } list [namespace origin set] [namespace origin test_ns_export::cmd1] -} {::set ::test_ns_export::cmd1} -test namespace-11.2 {TclGetOriginalCommand, directly imported cmd} { +} -result {::set ::test_ns_export::cmd1} +test namespace-11.2 {TclGetOriginalCommand, directly imported cmd} -setup { + catch {namespace delete {*}[namespace children :: test_ns_*]} + namespace eval test_ns_export { + namespace export cmd1 + proc cmd1 {args} {return "cmd1: $args"} + } +} -body { namespace eval test_ns_import1 { namespace import ::test_ns_export::* namespace export * proc p {} {namespace origin cmd1} } list [test_ns_import1::p] [namespace origin test_ns_import1::cmd1] -} {::test_ns_export::cmd1 ::test_ns_export::cmd1} -test namespace-11.3 {TclGetOriginalCommand, indirectly imported cmd} { +} -result {::test_ns_export::cmd1 ::test_ns_export::cmd1} +test namespace-11.3 {TclGetOriginalCommand, indirectly imported cmd} -setup { + catch {namespace delete {*}[namespace children :: test_ns_*]} + namespace eval test_ns_export { + namespace export cmd1 + proc cmd1 {args} {return "cmd1: $args"} + } + namespace eval test_ns_import1 { + namespace import ::test_ns_export::* + namespace export * + proc p {} {namespace origin cmd1} + } +} -body { namespace eval test_ns_import2 { namespace import ::test_ns_import1::* proc q {} {return [cmd1 123]} } list [test_ns_import2::q] [namespace origin test_ns_import2::cmd1] -} {{cmd1: 123} ::test_ns_export::cmd1} +} -result {{cmd1: 123} ::test_ns_export::cmd1} test namespace-12.1 {InvokeImportedCmd} { catch {namespace delete {*}[namespace children :: test_ns_*]} @@ -550,14 +576,23 @@ test namespace-12.1 {InvokeImportedCmd} { list [test_ns_import::cmd1] } {::test_ns_export} -test namespace-13.1 {DeleteImportedCmd, deletes imported cmds} { +test namespace-13.1 {DeleteImportedCmd, deletes imported cmds} -setup { + catch {namespace delete {*}[namespace children :: test_ns_*]} + namespace eval test_ns_export { + namespace export cmd1 + proc cmd1 {args} {namespace current} + } + namespace eval test_ns_import { + namespace import ::test_ns_export::* + } +} -body { namespace eval test_ns_import { set l {} lappend l [info commands ::test_ns_import::*] namespace forget ::test_ns_export::cmd1 lappend l [info commands ::test_ns_import::*] } -} {::test_ns_import::cmd1 {}} +} -result {::test_ns_import::cmd1 {}} test namespace-13.2 {DeleteImportedCmd, Bug a4494e28ed} { # Will panic if still buggy namespace eval src {namespace export foo; proc foo {} {}} @@ -568,7 +603,7 @@ test namespace-13.2 {DeleteImportedCmd, Bug a4494e28ed} { namespace delete src } {} -test namespace-14.1 {TclGetNamespaceForQualName, absolute names} { +test namespace-14.1 {TclGetNamespaceForQualName, absolute names} -setup { catch {namespace delete {*}[namespace children :: test_ns_*]} variable v 10 namespace eval test_ns_1::test_ns_2 { @@ -577,22 +612,41 @@ test namespace-14.1 {TclGetNamespaceForQualName, absolute names} { namespace eval test_ns_2 { variable v 30 } +} -body { namespace eval test_ns_1 { list $::v $::test_ns_2::v $::test_ns_1::test_ns_2::v \ [lsort [namespace children :: test_ns_*]] } -} [list 10 30 20 [lsort {::test_ns_1 ::test_ns_2}]] -test namespace-14.2 {TclGetNamespaceForQualName, invalid absolute names} { +} -result [list 10 30 20 [lsort {::test_ns_1 ::test_ns_2}]] +test namespace-14.2 {TclGetNamespaceForQualName, invalid absolute names} -setup { + catch {namespace delete {*}[namespace children :: test_ns_*]} + variable v 10 + namespace eval test_ns_1::test_ns_2 { + variable v 20 + } + namespace eval test_ns_2 { + variable v 30 + } +} -body { namespace eval test_ns_1 { list [catch {set ::test_ns_777::v} msg] $msg \ [catch {namespace children test_ns_777} msg] $msg } -} {1 {can't read "::test_ns_777::v": no such variable} 1 {namespace "test_ns_777" not found in "::test_ns_1"}} -test namespace-14.3 {TclGetNamespaceForQualName, relative names} { +} -result {1 {can't read "::test_ns_777::v": no such variable} 1 {namespace "test_ns_777" not found in "::test_ns_1"}} +test namespace-14.3 {TclGetNamespaceForQualName, relative names} -setup { + catch {namespace delete {*}[namespace children :: test_ns_*]} + variable v 10 + namespace eval test_ns_1::test_ns_2 { + variable v 20 + } + namespace eval test_ns_2 { + variable v 30 + } +} -body { namespace eval test_ns_1 { list $v $test_ns_2::v } -} {10 20} +} -result {10 20} test namespace-14.4 {TclGetNamespaceForQualName, relative ns names looked up only in current ns} { namespace eval test_ns_1::test_ns_2 { namespace eval foo {} @@ -619,57 +673,72 @@ test namespace-14.6 {TclGetNamespaceForQualName, relative ns names looked up onl [catch {namespace children test_ns_1} msg] $msg } } {::test_ns_1::test_ns_2::foo 1 {namespace "test_ns_1" not found in "::test_ns_1"}} -test namespace-14.7 {TclGetNamespaceForQualName, ignore extra :s if ns} { +test namespace-14.7 {TclGetNamespaceForQualName, ignore extra :s if ns} -setup { + namespace eval test_ns_1::test_ns_2::foo {} +} -body { namespace children test_ns_1::: -} {::test_ns_1::test_ns_2} -test namespace-14.8 {TclGetNamespaceForQualName, ignore extra :s if ns} { +} -result {::test_ns_1::test_ns_2} +test namespace-14.8 {TclGetNamespaceForQualName, ignore extra :s if ns} -setup { + namespace eval test_ns_1::test_ns_2::foo {} +} -body { namespace children :::test_ns_1:::::test_ns_2::: -} {::test_ns_1::test_ns_2::foo} +} -result {::test_ns_1::test_ns_2::foo} test namespace-14.9 {TclGetNamespaceForQualName, extra ::s are significant for vars} { set l {} lappend l [catch {set test_ns_1::test_ns_2::} msg] $msg namespace eval test_ns_1::test_ns_2 {variable {} 2525} lappend l [set test_ns_1::test_ns_2::] } {1 {can't read "test_ns_1::test_ns_2::": no such variable} 2525} -test namespace-14.10 {TclGetNamespaceForQualName, extra ::s are significant for vars} { - catch {unset test_ns_1::test_ns_2::} +test namespace-14.10 {TclGetNamespaceForQualName, extra ::s are significant for vars} -setup { + namespace eval test_ns_1::test_ns_2::foo {} + unset -nocomplain test_ns_1::test_ns_2:: set l {} +} -body { lappend l [catch {set test_ns_1::test_ns_2::} msg] $msg set test_ns_1::test_ns_2:: 314159 lappend l [set test_ns_1::test_ns_2::] -} {1 {can't read "test_ns_1::test_ns_2::": no such variable} 314159} -test namespace-14.11 {TclGetNamespaceForQualName, extra ::s are significant for commands} { +} -result {1 {can't read "test_ns_1::test_ns_2::": no such variable} 314159} +test namespace-14.11 {TclGetNamespaceForQualName, extra ::s are significant for commands} -setup { + namespace eval test_ns_1::test_ns_2::foo {} catch {rename test_ns_1::test_ns_2:: {}} set l {} +} -body { lappend l [catch {test_ns_1::test_ns_2:: hello} msg] $msg proc test_ns_1::test_ns_2:: {args} {return "\{\}: $args"} lappend l [test_ns_1::test_ns_2:: hello] -} {1 {invalid command name "test_ns_1::test_ns_2::"} {{}: hello}} -test namespace-14.12 {TclGetNamespaceForQualName, extra ::s are significant for vars} { +} -result {1 {invalid command name "test_ns_1::test_ns_2::"} {{}: hello}} +test namespace-14.12 {TclGetNamespaceForQualName, extra ::s are significant for vars} -setup { catch {namespace delete {*}[namespace children :: test_ns_*]} +} -body { namespace eval test_ns_1 { variable {} set test_ns_1::(x) y } set test_ns_1::(x) -} y -test namespace-14.13 {TclGetNamespaceForQualName, namespace other than global ns can't have empty name} { +} -result y +test namespace-14.13 {TclGetNamespaceForQualName, namespace other than global ns can't have empty name} -setup { catch {namespace delete {*}[namespace children :: test_ns_*]} - list [catch {namespace eval test_ns_1 {proc {} {} {}; namespace eval {} {}; {}}} msg] $msg -} {1 {can't create namespace "": only global namespace can have empty name}} +} -returnCodes error -body { + namespace eval test_ns_1 { + proc {} {} {} + namespace eval {} {} + {} + } +} -result {can't create namespace "": only global namespace can have empty name} -test namespace-15.1 {Tcl_FindNamespace, absolute name found} { +test namespace-15.1 {Tcl_FindNamespace, absolute name found} -setup { catch {namespace delete {*}[namespace children :: test_ns_*]} +} -body { namespace eval test_ns_delete { namespace eval test_ns_delete2 {} proc cmd {args} {namespace current} } list [namespace delete ::test_ns_delete::test_ns_delete2] \ [namespace children ::test_ns_delete] -} {{} {}} -test namespace-15.2 {Tcl_FindNamespace, absolute name not found} { - list [catch {namespace delete ::test_ns_delete::test_ns_delete2} msg] $msg -} {1 {unknown namespace "::test_ns_delete::test_ns_delete2" in namespace delete command}} +} -result {{} {}} +test namespace-15.2 {Tcl_FindNamespace, absolute name not found} -body { + namespace delete ::test_ns_delete::test_ns_delete2 +} -returnCodes error -result {unknown namespace "::test_ns_delete::test_ns_delete2" in namespace delete command} test namespace-15.3 {Tcl_FindNamespace, relative name found} { namespace eval test_ns_delete { namespace eval test_ns_delete2 {} @@ -685,17 +754,24 @@ test namespace-15.4 {Tcl_FindNamespace, relative name not found} { } } {1 {unknown namespace "test_ns_delete2" in namespace delete command}} -test namespace-16.1 {Tcl_FindCommand, absolute name found} { +test namespace-16.1 {Tcl_FindCommand, absolute name found} -setup { catch {namespace delete {*}[namespace children :: test_ns_*]} +} -body { namespace eval test_ns_1 { proc cmd {args} {return "[namespace current]::cmd: $args"} variable v "::test_ns_1::cmd" eval $v one } -} {::test_ns_1::cmd: one} -test namespace-16.2 {Tcl_FindCommand, absolute name found} { +} -result {::test_ns_1::cmd: one} +test namespace-16.2 {Tcl_FindCommand, absolute name found} -setup { + catch {namespace delete {*}[namespace children :: test_ns_*]} + namespace eval test_ns_1 { + proc cmd {args} {return "[namespace current]::cmd: $args"} + variable v "::test_ns_1::cmd" + } +} -body { eval $test_ns_1::v two -} {::test_ns_1::cmd: two} +} -result {::test_ns_1::cmd: two} test namespace-16.3 {Tcl_FindCommand, absolute name not found} { namespace eval test_ns_1 { variable v2 "::test_ns_1::ladidah" @@ -724,11 +800,16 @@ test namespace-16.7 {Tcl_FindCommand, relative name and TCL_GLOBAL_ONLY} { catch {rename unknown {}} catch {rename unknown.old unknown} -test namespace-16.8 {Tcl_FindCommand, relative name found} { +test namespace-16.8 {Tcl_FindCommand, relative name found} -setup { + catch {namespace delete {*}[namespace children :: test_ns_*]} + namespace eval test_ns_1 { + proc cmd {args} {return "[namespace current]::cmd: $args"} + } +} -body { namespace eval test_ns_1 { cmd a b c } -} {::test_ns_1::cmd: a b c} +} -result {::test_ns_1::cmd: a b c} test namespace-16.9 {Tcl_FindCommand, relative name found} -body { proc cmd2 {args} {return "[namespace current]::cmd2: $args"} namespace eval test_ns_1 { @@ -750,20 +831,21 @@ test namespace-16.10 {Tcl_FindCommand, relative name found, only look in current } -cleanup { catch {rename cmd2 {}} } -result {::::cmd2: a b c} -test namespace-16.11 {Tcl_FindCommand, relative name not found} { +test namespace-16.11 {Tcl_FindCommand, relative name not found} -body { namespace eval test_ns_1 { - list [catch {cmd3 a b c} msg] $msg + cmd3 a b c } -} {1 {invalid command name "cmd3"}} +} -returnCodes error -result {invalid command name "cmd3"} -catch {unset x} -test namespace-17.1 {Tcl_FindNamespaceVar, absolute name found} { +unset -nocomplain x +test namespace-17.1 {Tcl_FindNamespaceVar, absolute name found} -setup { catch {namespace delete {*}[namespace children :: test_ns_*]} +} -body { set x 314159 namespace eval test_ns_1 { set ::x } -} {314159} +} -result {314159} test namespace-17.2 {Tcl_FindNamespaceVar, absolute name found} { namespace eval test_ns_1 { variable x 777 @@ -778,27 +860,33 @@ test namespace-17.3 {Tcl_FindNamespaceVar, absolute name found} { set ::test_ns_1::test_ns_2::x } } {1111} -test namespace-17.4 {Tcl_FindNamespaceVar, absolute name not found} { +test namespace-17.4 {Tcl_FindNamespaceVar, absolute name not found} -body { namespace eval test_ns_1 { namespace eval test_ns_2 { variable x 1111 } - list [catch {set ::test_ns_1::test_ns_2::y} msg] $msg + set ::test_ns_1::test_ns_2::y } -} {1 {can't read "::test_ns_1::test_ns_2::y": no such variable}} -test namespace-17.5 {Tcl_FindNamespaceVar, absolute name and TCL_GLOBAL_ONLY} { +} -returnCodes error -result {can't read "::test_ns_1::test_ns_2::y": no such variable} +test namespace-17.5 {Tcl_FindNamespaceVar, absolute name and TCL_GLOBAL_ONLY} -setup { + namespace eval ::test_ns_1::test_ns_2 {} +} -body { namespace eval test_ns_1 { namespace eval test_ns_3 { variable ::test_ns_1::test_ns_2::x 2222 } } set ::test_ns_1::test_ns_2::x -} {2222} -test namespace-17.6 {Tcl_FindNamespaceVar, relative name found} { +} -result {2222} +test namespace-17.6 {Tcl_FindNamespaceVar, relative name found} -setup { + namespace eval test_ns_1 { + variable x 777 + } +} -body { namespace eval test_ns_1 { set x } -} {777} +} -result {777} test namespace-17.7 {Tcl_FindNamespaceVar, relative name found} { namespace eval test_ns_1 { unset x @@ -834,8 +922,9 @@ catch {unset x} catch {unset l} catch {rename foo {}} -test namespace-18.1 {TclResetShadowedCmdRefs, one-level check for command shadowing} { +test namespace-18.1 {TclResetShadowedCmdRefs, one-level check for command shadowing} -setup { catch {namespace delete {*}[namespace children :: test_ns_*]} +} -body { proc foo {} {return "global foo"} namespace eval test_ns_1 { proc trigger {} { @@ -849,7 +938,7 @@ test namespace-18.1 {TclResetShadowedCmdRefs, one-level check for command shadow proc foo {} {return "foo in test_ns_1"} } lappend l [test_ns_1::trigger] -} {{global foo} {foo in test_ns_1}} +} -result {{global foo} {foo in test_ns_1}} test namespace-18.2 {TclResetShadowedCmdRefs, multilevel check for command shadowing} { namespace eval test_ns_2 { proc foo {} {return "foo in ::test_ns_2"} @@ -873,22 +962,31 @@ test namespace-18.2 {TclResetShadowedCmdRefs, multilevel check for command shado catch {unset l} catch {rename foo {}} -test namespace-19.1 {GetNamespaceFromObj, global name found} { +test namespace-19.1 {GetNamespaceFromObj, global name found} -setup { catch {namespace delete {*}[namespace children :: test_ns_*]} +} -body { namespace eval test_ns_1::test_ns_2 {} namespace children ::test_ns_1 -} {::test_ns_1::test_ns_2} -test namespace-19.2 {GetNamespaceFromObj, relative name found} { +} -result {::test_ns_1::test_ns_2} +test namespace-19.2 {GetNamespaceFromObj, relative name found} -setup { + catch {namespace delete {*}[namespace children :: test_ns_*]} + namespace eval test_ns_1::test_ns_2 {} +} -body { namespace eval test_ns_1 { namespace children test_ns_2 } -} {} -test namespace-19.3 {GetNamespaceFromObj, name not found} -body { +} -result {} +test namespace-19.3 {GetNamespaceFromObj, name not found} -setup { + catch {namespace delete {*}[namespace children :: test_ns_*]} +} -body { namespace eval test_ns_1 { namespace children test_ns_99 } } -returnCodes error -result {namespace "test_ns_99" not found in "::test_ns_1"} -test namespace-19.4 {GetNamespaceFromObj, invalidation of cached ns refs} { +test namespace-19.4 {GetNamespaceFromObj, invalidation of cached ns refs} -setup { + catch {namespace delete {*}[namespace children :: test_ns_*]} + namespace eval test_ns_1::test_ns_2 {} +} -body { namespace eval test_ns_1 { proc foo {} { return [namespace children test_ns_2] @@ -900,7 +998,7 @@ test namespace-19.4 {GetNamespaceFromObj, invalidation of cached ns refs} { namespace delete test_ns_1::test_ns_2 namespace eval test_ns_1::test_ns_2::test_ns_3 {} lappend l [test_ns_1::foo] -} {{} ::test_ns_1::test_ns_2::test_ns_3} +} -result {{} ::test_ns_1::test_ns_2::test_ns_3} test namespace-20.1 {Tcl_NamespaceObjCmd, bad subcommand} { catch {namespace delete {*}[namespace children :: test_ns_*]} @@ -913,24 +1011,34 @@ test namespace-20.3 {Tcl_NamespaceObjCmd, abbreviations are okay} { namespace ch :: test_ns_* } {} -test namespace-21.1 {NamespaceChildrenCmd, no args} { +test namespace-21.1 {NamespaceChildrenCmd, no args} -setup { + catch {namespace delete {*}[namespace children :: test_ns_*]} +} -body { + namespace eval test_ns_1::test_ns_2 {} + expr {"::test_ns_1" in [namespace children]} +} -result {1} +test namespace-21.2 {NamespaceChildrenCmd, no args} -setup { catch {namespace delete {*}[namespace children :: test_ns_*]} namespace eval test_ns_1::test_ns_2 {} - expr {[string first ::test_ns_1 [namespace children]] != -1} -} {1} -test namespace-21.2 {NamespaceChildrenCmd, no args} { +} -body { namespace eval test_ns_1 { namespace children } -} {::test_ns_1::test_ns_2} -test namespace-21.3 {NamespaceChildrenCmd, ns name given} { +} -result {::test_ns_1::test_ns_2} +test namespace-21.3 {NamespaceChildrenCmd, ns name given} -setup { + catch {namespace delete {*}[namespace children :: test_ns_*]} + namespace eval test_ns_1::test_ns_2 {} +} -body { namespace children ::test_ns_1 -} {::test_ns_1::test_ns_2} -test namespace-21.4 {NamespaceChildrenCmd, ns name given} { +} -result {::test_ns_1::test_ns_2} +test namespace-21.4 {NamespaceChildrenCmd, ns name given} -setup { + catch {namespace delete {*}[namespace children :: test_ns_*]} + namespace eval test_ns_1::test_ns_2 {} +} -body { namespace eval test_ns_1 { namespace children test_ns_2 } -} {} +} -result {} test namespace-21.5 {NamespaceChildrenCmd, too many args} { namespace eval test_ns_1 { list [catch {namespace children test_ns_2 xxx yyy} msg] $msg @@ -940,10 +1048,13 @@ test namespace-21.6 {NamespaceChildrenCmd, glob-style pattern given} { namespace eval test_ns_1::test_ns_foo {} namespace children test_ns_1 *f* } {::test_ns_1::test_ns_foo} -test namespace-21.7 {NamespaceChildrenCmd, glob-style pattern given} { +test namespace-21.7 {NamespaceChildrenCmd, glob-style pattern given} -setup { + catch {namespace delete {*}[namespace children :: test_ns_*]} + namespace eval test_ns_1::test_ns_2 {} +} -body { namespace eval test_ns_1::test_ns_foo {} lsort [namespace children test_ns_1 test*] -} [lsort {::test_ns_1::test_ns_2 ::test_ns_1::test_ns_foo}] +} -result {::test_ns_1::test_ns_2 ::test_ns_1::test_ns_foo} test namespace-21.8 {NamespaceChildrenCmd, trivial pattern starting with ::} { namespace eval test_ns_1 {} namespace children [namespace current] [fq test_ns_1] @@ -1038,15 +1149,25 @@ test namespace-25.3 {NamespaceEvalCmd, new namespace} { } test_ns_1::p } {314159} -test namespace-25.4 {NamespaceEvalCmd, existing namespace} { +test namespace-25.4 {NamespaceEvalCmd, existing namespace} -setup { + namespace eval test_ns_1 { + variable v 314159 + proc p {} { + variable v + return $v + } + } +} -body { namespace eval test_ns_1 { proc q {} {return [expr {[p]+1}]} } test_ns_1::q -} {314160} -test namespace-25.5 {NamespaceEvalCmd, multiple args} { +} -result {314160} +test namespace-25.5 {NamespaceEvalCmd, multiple args} -setup { + namespace eval test_ns_1 {variable v 314159} +} -body { namespace eval test_ns_1 "set" "v" -} {314159} +} -result {314159} test namespace-25.6 {NamespaceEvalCmd, error in eval'd script} { list [catch {namespace eval test_ns_1 {xxxx}} msg] $msg $::errorInfo } {1 {invalid command name "xxxx"} {invalid command name "xxxx" @@ -1097,21 +1218,50 @@ test namespace-26.4 {NamespaceExportCmd, one pattern} { } list [info commands test_ns_2::*] [test_ns_2::cmd1 hello] } {::test_ns_2::cmd1 {cmd1: hello}} -test namespace-26.5 {NamespaceExportCmd, sequence of patterns, patterns accumulate} { +test namespace-26.5 {NamespaceExportCmd, sequence of patterns, patterns accumulate} -setup { + catch {namespace delete {*}[namespace children test_ns_*]} namespace eval test_ns_1 { + proc cmd1 {args} {return "cmd1: $args"} + proc cmd2 {args} {return "cmd2: $args"} + proc cmd3 {args} {return "cmd3: $args"} + proc cmd4 {args} {return "cmd4: $args"} namespace export cmd1 cmd3 } +} -body { namespace eval test_ns_2 { namespace import -force ::test_ns_1::* } list [lsort [info commands test_ns_2::*]] [test_ns_2::cmd3 hello] -} [list [lsort {::test_ns_2::cmd1 ::test_ns_2::cmd3}] {cmd3: hello}] -test namespace-26.6 {NamespaceExportCmd, no patterns means return uniq'ed export list} { +} -result {{::test_ns_2::cmd1 ::test_ns_2::cmd3} {cmd3: hello}} +test namespace-26.6 {NamespaceExportCmd, no patterns means return uniq'ed export list} -setup { + catch {namespace delete {*}[namespace children test_ns_*]} + namespace eval test_ns_1 { + proc cmd1 {args} {return "cmd1: $args"} + proc cmd2 {args} {return "cmd2: $args"} + proc cmd3 {args} {return "cmd3: $args"} + proc cmd4 {args} {return "cmd4: $args"} + namespace export cmd1 cmd3 + } +} -body { namespace eval test_ns_1 { namespace export } -} {cmd1 cmd3} -test namespace-26.7 {NamespaceExportCmd, -clear resets export list} { +} -result {cmd1 cmd3} +test namespace-26.7 {NamespaceExportCmd, -clear resets export list} -setup { + catch {namespace delete {*}[namespace children test_ns_*]} + namespace eval test_ns_1 { + proc cmd1 {args} {return "cmd1: $args"} + proc cmd2 {args} {return "cmd2: $args"} + proc cmd3 {args} {return "cmd3: $args"} + proc cmd4 {args} {return "cmd4: $args"} + } +} -body { + namespace eval test_ns_1 { + namespace export cmd1 cmd3 + } + namespace eval test_ns_2 { + namespace import ::test_ns_1::* + } namespace eval test_ns_1 { namespace export -clear cmd4 } @@ -1119,7 +1269,7 @@ test namespace-26.7 {NamespaceExportCmd, -clear resets export list} { namespace import ::test_ns_1::* } list [lsort [info commands test_ns_2::*]] [test_ns_2::cmd4 hello] -} [list [lsort {::test_ns_2::cmd4 ::test_ns_2::cmd1 ::test_ns_2::cmd3}] {cmd4: hello}] +} -result [list [lsort {::test_ns_2::cmd4 ::test_ns_2::cmd1 ::test_ns_2::cmd3}] {cmd4: hello}] test namespace-26.8 {NamespaceExportCmd, -clear resets export list} { catch {namespace delete foo} namespace eval foo { @@ -1202,14 +1352,23 @@ test namespace-29.4 {NamespaceInscopeCmd, simple case} { } namespace inscope test_ns_1 cmd } {::test_ns_1::cmd: v=747, args=} -test namespace-29.5 {NamespaceInscopeCmd, has lappend semantics} { +test namespace-29.5 {NamespaceInscopeCmd, has lappend semantics} -setup { + namespace eval test_ns_1 { + variable v 747 + proc cmd {args} { + variable v + return "[namespace current]::cmd: v=$v, args=$args" + } + } +} -body { list [namespace inscope test_ns_1 cmd x y z] \ [namespace eval test_ns_1 [concat cmd [list x y z]]] -} {{::test_ns_1::cmd: v=747, args=x y z} {::test_ns_1::cmd: v=747, args=x y z}} -test namespace-29.6 {NamespaceInscopeCmd, 1400572} { +} -result {{::test_ns_1::cmd: v=747, args=x y z} {::test_ns_1::cmd: v=747, args=x y z}} +test namespace-29.6 {NamespaceInscopeCmd, 1400572} -setup { + namespace eval test_ns_1 {} +} -body { namespace inscope test_ns_1 {info level 0} -} {namespace inscope test_ns_1 {info level 0}} - +} -result {namespace inscope test_ns_1 {info level 0}} test namespace-30.1 {NamespaceOriginCmd, bad args} { catch {namespace delete {*}[namespace children :: test_ns_*]} @@ -1330,7 +1489,8 @@ test namespace-34.3 {NamespaceWhichCmd, single arg is always command name} { test namespace-34.4 {NamespaceWhichCmd, bad args} { list [catch {namespace which a b} msg] $msg } {1 {wrong # args: should be "namespace which ?-command? ?-variable? name"}} -test namespace-34.5 {NamespaceWhichCmd, command lookup} { +test namespace-34.5 {NamespaceWhichCmd, command lookup} -setup { + catch {namespace delete {*}[namespace children test_ns_*]} namespace eval test_ns_1 { namespace export cmd* variable v1 111 @@ -1343,6 +1503,7 @@ test namespace-34.5 {NamespaceWhichCmd, command lookup} { variable v2 222 proc p {} {} } +} -body { namespace eval test_ns_3 { namespace import ::test_ns_2::* variable v3 333 @@ -1352,26 +1513,59 @@ test namespace-34.5 {NamespaceWhichCmd, command lookup} { [namespace which -command ::test_ns_2::cmd2] \ [catch {namespace which -command ::test_ns_2::noSuchCmd} msg] $msg } -} {::foreach ::test_ns_3::p ::test_ns_3::cmd1 ::test_ns_2::cmd2 0 {}} -test namespace-34.6 {NamespaceWhichCmd, -command is default} { +} -result {::foreach ::test_ns_3::p ::test_ns_3::cmd1 ::test_ns_2::cmd2 0 {}} +test namespace-34.6 {NamespaceWhichCmd, -command is default} -setup { + catch {namespace delete {*}[namespace children test_ns_*]} + namespace eval test_ns_1 { + namespace export cmd* + proc cmd1 {args} {return "cmd1: $args"} + proc cmd2 {args} {return "cmd2: $args"} + } + namespace eval test_ns_2 { + namespace export * + namespace import ::test_ns_1::* + proc p {} {} + } + namespace eval test_ns_3 { + namespace import ::test_ns_2::* + } +} -body { namespace eval test_ns_3 { list [namespace which foreach] \ [namespace which p] \ [namespace which cmd1] \ [namespace which ::test_ns_2::cmd2] } -} {::foreach ::test_ns_3::p ::test_ns_3::cmd1 ::test_ns_2::cmd2} -test namespace-34.7 {NamespaceWhichCmd, variable lookup} { +} -result {::foreach ::test_ns_3::p ::test_ns_3::cmd1 ::test_ns_2::cmd2} +test namespace-34.7 {NamespaceWhichCmd, variable lookup} -setup { + catch {namespace delete {*}[namespace children test_ns_*]} + namespace eval test_ns_1 { + namespace export cmd* + proc cmd1 {args} {return "cmd1: $args"} + proc cmd2 {args} {return "cmd2: $args"} + } + namespace eval test_ns_2 { + namespace export * + namespace import ::test_ns_1::* + variable v2 222 + proc p {} {} + } + namespace eval test_ns_3 { + variable v3 333 + namespace import ::test_ns_2::* + } +} -body { namespace eval test_ns_3 { list [namespace which -variable env] \ [namespace which -variable v3] \ [namespace which -variable ::test_ns_2::v2] \ [catch {namespace which -variable ::test_ns_2::noSuchVar} msg] $msg } -} {::env ::test_ns_3::v3 ::test_ns_2::v2 0 {}} +} -result {::env ::test_ns_3::v3 ::test_ns_2::v2 0 {}} -test namespace-35.1 {FreeNsNameInternalRep, resulting ref count > 0} { +test namespace-35.1 {FreeNsNameInternalRep, resulting ref count > 0} -setup { catch {namespace delete {*}[namespace children :: test_ns_*]} +} -body { namespace eval test_ns_1 { proc p {} { namespace delete [namespace current] @@ -1379,7 +1573,7 @@ test namespace-35.1 {FreeNsNameInternalRep, resulting ref count > 0} { } } test_ns_1::p -} {::test_ns_1} +} -result {::test_ns_1} test namespace-35.2 {FreeNsNameInternalRep, resulting ref count == 0} { namespace eval test_ns_1 { proc q {} { -- cgit v0.12 From 0754a0cceab613ca075ba25c3010f649ec3814a9 Mon Sep 17 00:00:00 2001 From: dkf Date: Sun, 10 Jul 2016 12:45:34 +0000 Subject: Fix to resolver.test --- tests/resolver.test | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/resolver.test b/tests/resolver.test index e73ea50..f3d22e5 100644 --- a/tests/resolver.test +++ b/tests/resolver.test @@ -135,6 +135,9 @@ test resolver-1.5 {cmdNameObj sharing vs. cmd resolver: other than global NS} -s z } } + namespace eval :: { + variable r2 "" + } } -constraints testinterpresolver -body { set r0 [namespace eval ::ns2 {x}] set r1 [namespace eval ::ns2 {z}] -- cgit v0.12 From 5c3df7890ed66305538ce9b69f0c584a45271c07 Mon Sep 17 00:00:00 2001 From: dkf Date: Sun, 10 Jul 2016 14:14:28 +0000 Subject: Fixes to namespace-old.test --- tests/namespace-old.test | 169 +++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 140 insertions(+), 29 deletions(-) diff --git a/tests/namespace-old.test b/tests/namespace-old.test index 1d8ba31..1d6a805 100644 --- a/tests/namespace-old.test +++ b/tests/namespace-old.test @@ -57,6 +57,12 @@ test namespace-old-1.9 {add elements to a namespace} { } } } {} +namespace eval test_ns_simple { + variable test_ns_x 0 + proc test {test_ns_x} { + return "test: $test_ns_x" + } +} test namespace-old-1.10 {commands in a namespace} { namespace eval test_ns_simple { info commands [namespace current]::*} } {::test_ns_simple::test} @@ -74,6 +80,12 @@ test namespace-old-1.13 {add to an existing namespace} { } } } "" +namespace eval test_ns_simple { + variable test_ns_y 123 + proc _backdoor {cmd} { + eval $cmd + } +} test namespace-old-1.14 {commands in a namespace} { lsort [namespace eval test_ns_simple {info commands [namespace current]::*}] } {::test_ns_simple::_backdoor ::test_ns_simple::test} @@ -128,6 +140,8 @@ test namespace-old-1.26 {namespace qualifiers are okay after $'s} { test namespace-old-1.27 {can create commands with null names} { proc test_ns_simple:: {args} {return $args} } {} +# Redeclare; later tests depend on it +proc test_ns_simple:: {args} {return $args} # ----------------------------------------------------------------------- # TEST: using "info" in namespace contexts @@ -212,6 +226,11 @@ test namespace-old-4.3 {command "namespace delete" doesn't support patterns} { } list [catch $cmd msg] $msg } {1 {unknown namespace "ns*" in namespace delete command}} +namespace eval test_ns_delete { + namespace eval ns1 {} + namespace eval ns2 {} + namespace eval another {} +} test namespace-old-4.4 {command "namespace delete" handles multiple args} { set cmd { namespace eval test_ns_delete { @@ -256,6 +275,24 @@ test namespace-old-5.3 {namespace qualifiers work in namespace command} { [namespace eval test_ns_hier1::test_ns_hier2 {namespace current}] \ [namespace eval ::test_ns_hier1::test_ns_hier2 {namespace current}] } {::test_ns_hier1 ::test_ns_hier1::test_ns_hier2 ::test_ns_hier1::test_ns_hier2} +set ::test_ns_var_global "var in ::" +proc test_ns_cmd_global {} {return "cmd in ::"} +namespace eval test_ns_hier1 { + variable test_ns_var_hier1 "particular to hier1" + proc test_ns_cmd_hier1 {} {return "particular to hier1"} + variable test_ns_level 1 + proc test_ns_show {} {return "[namespace current]: 1"} + namespace eval test_ns_hier2 { + variable test_ns_var_hier2 "particular to hier2" + proc test_ns_cmd_hier2 {} {return "particular to hier2"} + variable test_ns_level 2 + proc test_ns_show {} {return "[namespace current]: 2"} + namespace eval test_ns_hier3a {} + namespace eval test_ns_hier3b {} + } + namespace eval test_ns_hier2a {} + namespace eval test_ns_hier2b {} +} test namespace-old-5.4 {nested namespaces can access global namespace} { list [namespace eval test_ns_hier1 {set test_ns_var_global}] \ [namespace eval test_ns_hier1 {test_ns_cmd_global}] \ @@ -331,16 +368,12 @@ test namespace-old-5.21 {querying namespace parent for explicit namespace} { # ----------------------------------------------------------------------- # TEST: name resolution and caching # ----------------------------------------------------------------------- +set trigger {namespace eval test_ns_cache2 {namespace current}} +set trigger2 {namespace eval test_ns_cache2::test_ns_cache3 {namespace current}} test namespace-old-6.1 {relative ns names only looked up in current ns} { namespace eval test_ns_cache1 {} namespace eval test_ns_cache2 {} namespace eval test_ns_cache2::test_ns_cache3 {} - set trigger { - namespace eval test_ns_cache2 {namespace current} - } - set trigger2 { - namespace eval test_ns_cache2::test_ns_cache3 {namespace current} - } list [namespace eval test_ns_cache1 $trigger] \ [namespace eval test_ns_cache1 $trigger2] } {::test_ns_cache1::test_ns_cache2 ::test_ns_cache1::test_ns_cache2::test_ns_cache3} @@ -354,20 +387,19 @@ test namespace-old-6.3 {relative ns names only looked up in current ns} { list [namespace eval test_ns_cache1 $trigger] \ [namespace eval test_ns_cache1 $trigger2] } {::test_ns_cache1::test_ns_cache2 ::test_ns_cache1::test_ns_cache2::test_ns_cache3} +namespace eval test_ns_cache1::test_ns_cache2 {} test namespace-old-6.4 {relative ns names only looked up in current ns} { namespace delete test_ns_cache1::test_ns_cache2 list [namespace eval test_ns_cache1 $trigger] \ [namespace eval test_ns_cache1 $trigger2] } {::test_ns_cache1::test_ns_cache2 ::test_ns_cache1::test_ns_cache2::test_ns_cache3} +namespace eval test_ns_cache1 { + proc trigger {} {test_ns_cache_cmd} +} test namespace-old-6.5 {define test commands} { proc test_ns_cache_cmd {} { return "global version" } - namespace eval test_ns_cache1 { - proc trigger {} { - test_ns_cache_cmd - } - } test_ns_cache1::trigger } {global version} test namespace-old-6.6 {one-level check for command shadowing} { @@ -376,24 +408,36 @@ test namespace-old-6.6 {one-level check for command shadowing} { } test_ns_cache1::trigger } {cache1 version} -test namespace-old-6.7 {renaming commands changes command epoch} { - namespace eval test_ns_cache1 { - rename test_ns_cache_cmd test_ns_new +proc test_ns_cache_cmd {} { + return "global version" +} +test namespace-old-6.7 {renaming commands changes command epoch} -setup { + proc test_ns_cache1::test_ns_cache_cmd {} { + return "cache1 version" } - test_ns_cache1::trigger -} {global version} -test namespace-old-6.8 {renaming back handles shadowing} { - namespace eval test_ns_cache1 { - rename test_ns_new test_ns_cache_cmd +} -body { + list [test_ns_cache1::trigger] \ + [namespace eval test_ns_cache1 {rename test_ns_cache_cmd test_ns_new}]\ + [test_ns_cache1::trigger] +} -result {{cache1 version} {} {global version}} +test namespace-old-6.8 {renaming back handles shadowing} -setup { + proc test_ns_cache1::test_ns_new {} { + return "cache1 version" } - test_ns_cache1::trigger -} {cache1 version} -test namespace-old-6.9 {deleting commands changes command epoch} { - namespace eval test_ns_cache1 { - rename test_ns_cache_cmd "" +} -body { + list [test_ns_cache1::trigger] \ + [namespace eval test_ns_cache1 {rename test_ns_new test_ns_cache_cmd}]\ + [test_ns_cache1::trigger] +} -result {{global version} {} {cache1 version}} +test namespace-old-6.9 {deleting commands changes command epoch} -setup { + proc test_ns_cache1::test_ns_cache_cmd {} { + return "cache1 version" } - test_ns_cache1::trigger -} {global version} +} -body { + list [test_ns_cache1::trigger] \ + [namespace eval test_ns_cache1 {rename test_ns_cache_cmd ""}] \ + [test_ns_cache1::trigger] +} -result {{cache1 version} {} {global version}} test namespace-old-6.10 {define test namespaces} { namespace eval test_ns_cache2 { proc test_ns_cache_cmd {} { @@ -412,6 +456,12 @@ test namespace-old-6.10 {define test namespaces} { } list [test_ns_cache1::trigger] [test_ns_cache1::test_ns_cache2::trigger] } {{global cache2 version} {global version}} +namespace eval test_ns_cache1 { + proc trigger {} { test_ns_cache2::test_ns_cache_cmd } + namespace eval test_ns_cache2 { + proc trigger {} { test_ns_cache_cmd } + } +} test namespace-old-6.11 {commands affect all parent namespaces} { proc test_ns_cache1::test_ns_cache2::test_ns_cache_cmd {} { return "cache2 version" @@ -423,18 +473,22 @@ test namespace-old-6.12 {define test variables} { set trigger {set test_ns_cache_var} namespace eval test_ns_cache1 $trigger } {global version} + set trigger {set test_ns_cache_var} test namespace-old-6.13 {one-level check for variable shadowing} { namespace eval test_ns_cache1 { variable test_ns_cache_var "cache1 version" } namespace eval test_ns_cache1 $trigger } {cache1 version} +variable ::test_ns_cache_var "global version" test namespace-old-6.14 {deleting variables changes variable epoch} { namespace eval test_ns_cache1 { - unset test_ns_cache_var + variable test_ns_cache_var "cache1 version" } - namespace eval test_ns_cache1 $trigger -} {global version} + list [namespace eval test_ns_cache1 $trigger] \ + [namespace eval test_ns_cache1 {unset test_ns_cache_var}] \ + [namespace eval test_ns_cache1 $trigger] +} {{cache1 version} {} {global version}} test namespace-old-6.15 {define test namespaces} { namespace eval test_ns_cache2 { variable test_ns_cache_var "global cache2 version" @@ -443,6 +497,7 @@ test namespace-old-6.15 {define test namespaces} { list [namespace eval test_ns_cache1 $trigger2] \ [namespace eval test_ns_cache1::test_ns_cache2 $trigger] } {{global cache2 version} {global version}} +set trigger2 {set test_ns_cache2::test_ns_cache_var} test namespace-old-6.16 {public variables affect all parent namespaces} { variable test_ns_cache1::test_ns_cache2::test_ns_cache_var "cache2 version" list [namespace eval test_ns_cache1 $trigger2] \ @@ -467,6 +522,7 @@ test namespace-old-6.19 {querying: namespace which -command} { test namespace-old-6.20 {command "namespace which" may not find commands} { namespace eval test_ns_cache1 {namespace which -command xyzzy} } {} +variable test_ns_cache1::test_ns_cache2::test_ns_cache_var "cache2 version" test namespace-old-6.21 {querying: namespace which -variable} { namespace eval test_ns_cache1::test_ns_cache2 { namespace which -variable test_ns_cache_var @@ -493,6 +549,18 @@ test namespace-old-7.1 {define test namespace} { } } } {} +namespace eval test_ns_uplevel { + variable x 0 + variable y 1 + proc show_vars {num} { + return [uplevel $num {info vars}] + } + proc test_uplevel {num} { + set a 0 + set b 1 + namespace eval ::test_ns_uplevel " return \[show_vars $num\] " + } +} test namespace-old-7.2 {uplevel can access namespace call frame} { list [expr {"x" in [test_ns_uplevel::test_uplevel 1]}] \ [expr {"y" in [test_ns_uplevel::test_uplevel 1]}] @@ -526,6 +594,17 @@ test namespace-old-7.8 {namespaces are included in the call stack} { } } } {} +namespace eval test_ns_upvar { + variable scope "test_ns_upvar" + proc show_val {var num} { + upvar $num $var x + return $x + } + proc test_upvar {num} { + set scope "test_ns_upvar::test_upvar" + namespace eval ::test_ns_upvar " return \[show_val scope $num\] " + } +} test namespace-old-7.9 {upvar can access namespace call frame} { test_ns_upvar::test_upvar 1 } {test_ns_upvar} @@ -581,6 +660,15 @@ test namespace-old-9.3 {define test namespaces for import} { } lsort [info commands test_ns_export::*] } {::test_ns_export::cmd1 ::test_ns_export::cmd2 ::test_ns_export::cmd3 ::test_ns_export::cmd4 ::test_ns_export::cmd5 ::test_ns_export::cmd6} +namespace eval test_ns_export { + namespace export cmd1 cmd2 cmd3 + proc cmd1 {args} {return "cmd1: $args"} + proc cmd2 {args} {return "cmd2: $args"} + proc cmd3 {args} {return "cmd3: $args"} + proc cmd4 {args} {return "cmd4: $args"} + proc cmd5 {args} {return "cmd5: $args"} + proc cmd6 {args} {return "cmd6: $args"} +} test namespace-old-9.4 {check export status} { set x "" namespace eval test_ns_import { @@ -592,6 +680,10 @@ test namespace-old-9.4 {check export status} { } set x } {::test_ns_import::cmd1 ::test_ns_import::cmd2 ::test_ns_import::cmd3} +namespace eval test_ns_import { + namespace export cmd1 cmd2 + namespace import ::test_ns_export::* +} test namespace-old-9.5 {empty import list in "namespace import" command} { namespace eval test_ns_import_empty { namespace import ::test_ns_export::* @@ -615,6 +707,7 @@ test namespace-old-9.8 {only exported commands are imported} { namespace import test_ns_import::cmd* set x [lsort [info commands cmd*]] } {cmd1 cmd2} +namespace import test_ns_import::cmd* test namespace-old-9.9 {imported commands work just the same as original} { list [cmd1 test 1 2 3] [test_ns_import::cmd1 test 4 5 6] } {{cmd1: test 1 2 3} {cmd1: test 4 5 6}} @@ -629,10 +722,19 @@ test namespace-old-9.10 {commands can be imported from many namespaces} { namespace import test_ns_import2::* lsort [concat [info commands cmd*] [info commands ncmd*]] } {cmd1 cmd2 ncmd ncmd1 ncmd2} +namespace eval test_ns_import2 { + namespace export ncmd ncmd1 ncmd2 + proc ncmd {args} {return "ncmd: $args"} + proc ncmd1 {args} {return "ncmd1: $args"} + proc ncmd2 {args} {return "ncmd2: $args"} + proc ncmd3 {args} {return "ncmd3: $args"} +} +namespace import test_ns_import2::* test namespace-old-9.11 {imported commands can be removed by deleting them} { rename cmd1 "" lsort [concat [info commands cmd*] [info commands ncmd*]] } {cmd2 ncmd ncmd1 ncmd2} +catch { rename cmd1 "" } test namespace-old-9.12 {command "namespace forget" checks for valid namespaces} { list [catch {namespace forget xyzzy::*} msg] $msg } {1 {unknown namespace in namespace forget pattern "xyzzy::*"}} @@ -653,6 +755,7 @@ test namespace-old-9.15 {existing commands can't be overwritten} { [cmd1 3 5] } {1 {can't import command "cmd1": already exists} 8} test namespace-old-9.16 {use "-force" option to override existing commands} { + proc cmd1 {x y} { return [expr $x+$y] } list [cmd1 3 5] \ [namespace import -force test_ns_import::cmd?] \ [cmd1 3 5] @@ -711,10 +814,18 @@ test namespace-old-10.6 {with many args, each "scope" adds new args} { set sval [namespace eval test_ns_inscope {namespace code {one two}}] namespace code "$sval three" } {::namespace inscope ::test_ns_inscope {one two} three} +namespace eval test_ns_inscope { + proc show {args} { + return "show: $args" + } +} test namespace-old-10.7 {scoped commands work with eval} { set cref [namespace eval test_ns_inscope {namespace code show}] list [eval $cref "a" "b c" "d e f"] } {{show: a b c d e f}} +namespace eval test_ns_inscope { + variable x "x-value" +} test namespace-old-10.8 {scoped commands execute in namespace context} { set cref [namespace eval test_ns_inscope { namespace code {set x "some new value"} -- cgit v0.12 From 958e525baf3292c31b387ce0306a8dc984419c6c Mon Sep 17 00:00:00 2001 From: dgp Date: Sun, 10 Jul 2016 19:28:57 +0000 Subject: [96fe2f1cc7] Plug memory leak. --- generic/tclExecute.c | 1 + 1 file changed, 1 insertion(+) diff --git a/generic/tclExecute.c b/generic/tclExecute.c index 52865e6..c0cbd9e 100644 --- a/generic/tclExecute.c +++ b/generic/tclExecute.c @@ -3168,6 +3168,7 @@ TEBCresume( Tcl_ListObjAppendElement(NULL, copyPtr, objPtr); Tcl_ListObjReplace(NULL, copyPtr, LIST_MAX, 0, objc - opnd, objv + opnd); + Tcl_DecrRefCount(objPtr); objPtr = copyPtr; } -- cgit v0.12 From d6146b2e552c294199df0354470b89fe955a7345 Mon Sep 17 00:00:00 2001 From: dgp Date: Mon, 11 Jul 2016 17:13:09 +0000 Subject: Avoid memory leak in test. --- tests/socket.test | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/socket.test b/tests/socket.test index 8473602..d43c41c 100644 --- a/tests/socket.test +++ b/tests/socket.test @@ -1782,7 +1782,6 @@ test socket_$af-13.1 {Testing use of shared socket between two threads} -body { set i 0 vwait x close $f - thread::wait }]] set port [thread::send $serverthread {set listen}] set s [socket $localhost $port] -- cgit v0.12 From 59ded443ac132275413b2e6f6e9cb4eb6cba468b Mon Sep 17 00:00:00 2001 From: dgp Date: Mon, 11 Jul 2016 21:56:32 +0000 Subject: [cea0344a1] Restore a clearing of the ensemble rewrite in one execution path so attempts to use the data after free are not made. Test namespace-50.9 demonstrates the need for this. --- generic/tclExecute.c | 7 +++++++ tests/namespace.test | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/generic/tclExecute.c b/generic/tclExecute.c index c0cbd9e..e539161 100644 --- a/generic/tclExecute.c +++ b/generic/tclExecute.c @@ -2078,6 +2078,13 @@ TclNRExecuteByteCode( #endif /* + * Test namespace-50.9 demonstrates the need for this call. + * Use a --enable-symbols=mem bug to see. + */ + + TclResetRewriteEnsemble(interp, 1); + + /* * Push the callback for bytecode execution */ diff --git a/tests/namespace.test b/tests/namespace.test index 575695f..55505f1 100644 --- a/tests/namespace.test +++ b/tests/namespace.test @@ -2356,6 +2356,13 @@ test namespace-50.8 {[f961d7d1dd]} -setup { rename e {} rename target {} } +test namespace-50.9 {[cea0344a51]} -body { + namespace eval foo { + namespace eval bar { + namespace delete foo + } + } +} -returnCodes error -result {unknown namespace "foo" in namespace delete command} test namespace-51.1 {name resolution path control} -body { namespace eval ::test_ns_1 { -- cgit v0.12 From 2db2dfd35e31ce264948ce805c95046062ff5ccd Mon Sep 17 00:00:00 2001 From: dgp Date: Tue, 12 Jul 2016 13:23:21 +0000 Subject: Start RC branch for Tcl 8.6.6 --- README | 2 +- generic/tcl.h | 4 ++-- library/init.tcl | 2 +- unix/configure | 2 +- unix/configure.in | 2 +- unix/tcl.spec | 2 +- win/configure | 2 +- win/configure.in | 2 +- 8 files changed, 9 insertions(+), 9 deletions(-) diff --git a/README b/README index f3e50dd..401b6e6 100644 --- a/README +++ b/README @@ -1,5 +1,5 @@ README: Tcl - This is the Tcl 8.6.5 source distribution. + This is the Tcl 8.6.6 source distribution. http://sourceforge.net/projects/tcl/files/Tcl/ You can get any source release of Tcl from the URL above. diff --git a/generic/tcl.h b/generic/tcl.h index 3490049..3037ceb 100644 --- a/generic/tcl.h +++ b/generic/tcl.h @@ -56,10 +56,10 @@ extern "C" { #define TCL_MAJOR_VERSION 8 #define TCL_MINOR_VERSION 6 #define TCL_RELEASE_LEVEL TCL_FINAL_RELEASE -#define TCL_RELEASE_SERIAL 5 +#define TCL_RELEASE_SERIAL 6 #define TCL_VERSION "8.6" -#define TCL_PATCH_LEVEL "8.6.5" +#define TCL_PATCH_LEVEL "8.6.6" /* *---------------------------------------------------------------------------- diff --git a/library/init.tcl b/library/init.tcl index 9fd2170..9ca4514 100644 --- a/library/init.tcl +++ b/library/init.tcl @@ -16,7 +16,7 @@ if {[info commands package] == ""} { error "version mismatch: library\nscripts expect Tcl version 7.5b1 or later but the loaded version is\nonly [info patchlevel]" } -package require -exact Tcl 8.6.5 +package require -exact Tcl 8.6.6 # Compute the auto path to use in this interpreter. # The values on the path come from several locations: diff --git a/unix/configure b/unix/configure index 2e774f7..38c3f9a 100755 --- a/unix/configure +++ b/unix/configure @@ -1335,7 +1335,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu TCL_VERSION=8.6 TCL_MAJOR_VERSION=8 TCL_MINOR_VERSION=6 -TCL_PATCH_LEVEL=".5" +TCL_PATCH_LEVEL=".6" VERSION=${TCL_VERSION} EXTRA_INSTALL_BINARIES=${EXTRA_INSTALL_BINARIES:-"@:"} diff --git a/unix/configure.in b/unix/configure.in index 5d4cfbe..1d86213 100644 --- a/unix/configure.in +++ b/unix/configure.in @@ -25,7 +25,7 @@ m4_ifdef([SC_USE_CONFIG_HEADERS], [ TCL_VERSION=8.6 TCL_MAJOR_VERSION=8 TCL_MINOR_VERSION=6 -TCL_PATCH_LEVEL=".5" +TCL_PATCH_LEVEL=".6" VERSION=${TCL_VERSION} EXTRA_INSTALL_BINARIES=${EXTRA_INSTALL_BINARIES:-"@:"} diff --git a/unix/tcl.spec b/unix/tcl.spec index 3044311..8bf77f3 100644 --- a/unix/tcl.spec +++ b/unix/tcl.spec @@ -4,7 +4,7 @@ Name: tcl Summary: Tcl scripting language development environment -Version: 8.6.5 +Version: 8.6.6 Release: 2 License: BSD Group: Development/Languages diff --git a/win/configure b/win/configure index 2336111..e8e4b87 100755 --- a/win/configure +++ b/win/configure @@ -1311,7 +1311,7 @@ SHELL=/bin/sh TCL_VERSION=8.6 TCL_MAJOR_VERSION=8 TCL_MINOR_VERSION=6 -TCL_PATCH_LEVEL=".5" +TCL_PATCH_LEVEL=".6" VER=$TCL_MAJOR_VERSION$TCL_MINOR_VERSION TCL_DDE_VERSION=1.4 diff --git a/win/configure.in b/win/configure.in index a72b993..8bb9c48 100644 --- a/win/configure.in +++ b/win/configure.in @@ -14,7 +14,7 @@ SHELL=/bin/sh TCL_VERSION=8.6 TCL_MAJOR_VERSION=8 TCL_MINOR_VERSION=6 -TCL_PATCH_LEVEL=".5" +TCL_PATCH_LEVEL=".6" VER=$TCL_MAJOR_VERSION$TCL_MINOR_VERSION TCL_DDE_VERSION=1.4 -- cgit v0.12 From 71e7049f8ea65780583e847f2b3055b519395517 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Tue, 12 Jul 2016 13:44:26 +0000 Subject: Make hash type changable by compiling with -DTCL_HASH_TYPE=size_t (for example). Default (unsigned) cannot be changed in Tcl 8.x, that must wait until Tcl 9. --- doc/Hash.3 | 2 +- generic/tcl.h | 6 +++++- generic/tclHash.c | 12 ++++++------ generic/tclInt.h | 2 +- generic/tclObj.c | 4 ++-- 5 files changed, 15 insertions(+), 11 deletions(-) diff --git a/doc/Hash.3 b/doc/Hash.3 index 4dc3623..aa79b86 100644 --- a/doc/Hash.3 +++ b/doc/Hash.3 @@ -281,7 +281,7 @@ The \fIhashKeyProc\fR member contains the address of a function called to calculate a hash value for the key. .PP .CS -typedef unsigned int \fBTcl_HashKeyProc\fR( +typedef TCL_HASH_TYPE \fBTcl_HashKeyProc\fR( Tcl_HashTable *\fItablePtr\fR, void *\fIkeyPtr\fR); .CE diff --git a/generic/tcl.h b/generic/tcl.h index 6061ea8..ded8d0b 100644 --- a/generic/tcl.h +++ b/generic/tcl.h @@ -1157,11 +1157,15 @@ typedef struct Tcl_DString { * Forward declarations of Tcl_HashTable and related types. */ +#ifndef TCL_HASH_TYPE +# define TCL_HASH_TYPE unsigned +#endif + typedef struct Tcl_HashKeyType Tcl_HashKeyType; typedef struct Tcl_HashTable Tcl_HashTable; typedef struct Tcl_HashEntry Tcl_HashEntry; -typedef unsigned (Tcl_HashKeyProc) (Tcl_HashTable *tablePtr, void *keyPtr); +typedef TCL_HASH_TYPE (Tcl_HashKeyProc) (Tcl_HashTable *tablePtr, void *keyPtr); typedef int (Tcl_CompareHashKeysProc) (void *keyPtr, Tcl_HashEntry *hPtr); typedef Tcl_HashEntry * (Tcl_AllocHashEntryProc) (Tcl_HashTable *tablePtr, void *keyPtr); diff --git a/generic/tclHash.c b/generic/tclHash.c index 3ea9dd9..ac9d40e 100644 --- a/generic/tclHash.c +++ b/generic/tclHash.c @@ -43,7 +43,7 @@ static Tcl_HashEntry * AllocArrayEntry(Tcl_HashTable *tablePtr, void *keyPtr); static int CompareArrayKeys(void *keyPtr, Tcl_HashEntry *hPtr); -static unsigned int HashArrayKey(Tcl_HashTable *tablePtr, void *keyPtr); +static TCL_HASH_TYPE HashArrayKey(Tcl_HashTable *tablePtr, void *keyPtr); /* * Prototypes for the one word hash key methods. Not actually declared because @@ -65,7 +65,7 @@ static unsigned int HashOneWordKey(Tcl_HashTable *tablePtr, void *keyPtr); static Tcl_HashEntry * AllocStringEntry(Tcl_HashTable *tablePtr, void *keyPtr); static int CompareStringKeys(void *keyPtr, Tcl_HashEntry *hPtr); -static unsigned int HashStringKey(Tcl_HashTable *tablePtr, void *keyPtr); +static TCL_HASH_TYPE HashStringKey(Tcl_HashTable *tablePtr, void *keyPtr); /* * Function prototypes for static functions in this file: @@ -774,7 +774,7 @@ CompareArrayKeys( *---------------------------------------------------------------------- */ -static unsigned int +static TCL_HASH_TYPE HashArrayKey( Tcl_HashTable *tablePtr, /* Hash table. */ void *keyPtr) /* Key from which to compute hash value. */ @@ -787,7 +787,7 @@ HashArrayKey( count--, array++) { result += *array; } - return result; + return (TCL_HASH_TYPE) result; } /* @@ -870,7 +870,7 @@ CompareStringKeys( *---------------------------------------------------------------------- */ -static unsigned +static TCL_HASH_TYPE HashStringKey( Tcl_HashTable *tablePtr, /* Hash table. */ void *keyPtr) /* Key from which to compute hash value. */ @@ -916,7 +916,7 @@ HashStringKey( result += (result << 3) + UCHAR(c); } } - return result; + return (TCL_HASH_TYPE) result; } /* diff --git a/generic/tclInt.h b/generic/tclInt.h index c01b0c1..33476ed 100644 --- a/generic/tclInt.h +++ b/generic/tclInt.h @@ -3977,7 +3977,7 @@ MODULE_SCOPE int TclObjCallVarTraces(Interp *iPtr, Var *arrayPtr, MODULE_SCOPE int TclCompareObjKeys(void *keyPtr, Tcl_HashEntry *hPtr); MODULE_SCOPE void TclFreeObjEntry(Tcl_HashEntry *hPtr); -MODULE_SCOPE unsigned TclHashObjKey(Tcl_HashTable *tablePtr, void *keyPtr); +MODULE_SCOPE TCL_HASH_TYPE TclHashObjKey(Tcl_HashTable *tablePtr, void *keyPtr); MODULE_SCOPE int TclFullFinalizationRequested(void); diff --git a/generic/tclObj.c b/generic/tclObj.c index 776b034..0cd7839 100644 --- a/generic/tclObj.c +++ b/generic/tclObj.c @@ -4048,7 +4048,7 @@ TclFreeObjEntry( *---------------------------------------------------------------------- */ -unsigned int +TCL_HASH_TYPE TclHashObjKey( Tcl_HashTable *tablePtr, /* Hash table. */ void *keyPtr) /* Key from which to compute hash value. */ @@ -4098,7 +4098,7 @@ TclHashObjKey( result += (result << 3) + UCHAR(*++string); } } - return result; + return (TCL_HASH_TYPE) result; } /* -- cgit v0.12 From bcd1ebff474ba386f8fb7db75692a39ce5bcb8ca Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Tue, 12 Jul 2016 14:02:17 +0000 Subject: Fix "file owned" for Cygwin: st_uid is only 16-bit there. --- generic/tclCmdAH.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/generic/tclCmdAH.c b/generic/tclCmdAH.c index 13d3df5..88cc17d 100644 --- a/generic/tclCmdAH.c +++ b/generic/tclCmdAH.c @@ -1596,14 +1596,19 @@ FileAttrIsOwnedCmd( int objc, Tcl_Obj *const objv[]) { +#ifdef __CYGWIN__ +#define geteuid() (short)(geteuid)() +#endif +#if !defined(_WIN32) Tcl_StatBuf buf; +#endif int value = 0; if (objc != 2) { Tcl_WrongNumArgs(interp, 1, objv, "name"); return TCL_ERROR; } -#if defined(_WIN32) || defined(__CYGWIN__) +#if defined(_WIN32) value = TclWinFileOwned(objv[1]); #else if (GetStatBuf(NULL, objv[1], Tcl_FSStat, &buf) == TCL_OK) { -- cgit v0.12 From 2707284613f1df3c587790ac8a2757dc8592db63 Mon Sep 17 00:00:00 2001 From: dgp Date: Tue, 12 Jul 2016 16:24:35 +0000 Subject: Dup test name. Bump to TclOO 1.0.5. --- generic/tclOO.h | 2 +- tests/info.test | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/generic/tclOO.h b/generic/tclOO.h index 696908a..46f01fb 100644 --- a/generic/tclOO.h +++ b/generic/tclOO.h @@ -24,7 +24,7 @@ * win/tclooConfig.sh */ -#define TCLOO_VERSION "1.0.4" +#define TCLOO_VERSION "1.0.5" #define TCLOO_PATCHLEVEL TCLOO_VERSION #include "tcl.h" diff --git a/tests/info.test b/tests/info.test index e0fddb3..c4fd379 100644 --- a/tests/info.test +++ b/tests/info.test @@ -2398,7 +2398,7 @@ test info-33.35 {{*}, literal, simple, bytecompiled} -body { # ------------------------------------------------------------------------- unset -nocomplain res -test info-39.0 {Bug 4b61afd660} -setup { +test info-39.1 {Bug 4b61afd660} -setup { proc probe {} { return [dict get [info frame -1] line] } -- cgit v0.12 From 5fce2d6fcdbb4dcfaf883bece8154b866450c010 Mon Sep 17 00:00:00 2001 From: dgp Date: Tue, 12 Jul 2016 16:46:08 +0000 Subject: tzdata2016f --- library/tzdata/America/Cambridge_Bay | 2 +- library/tzdata/America/Inuvik | 2 +- library/tzdata/America/Iqaluit | 2 +- library/tzdata/America/Pangnirtung | 2 +- library/tzdata/America/Rankin_Inlet | 2 +- library/tzdata/America/Resolute | 2 +- library/tzdata/America/Yellowknife | 2 +- library/tzdata/Antarctica/Casey | 2 +- library/tzdata/Antarctica/Davis | 4 +- library/tzdata/Antarctica/DumontDUrville | 4 +- library/tzdata/Antarctica/Macquarie | 4 +- library/tzdata/Antarctica/Mawson | 2 +- library/tzdata/Antarctica/Palmer | 2 +- library/tzdata/Antarctica/Rothera | 2 +- library/tzdata/Antarctica/Syowa | 2 +- library/tzdata/Antarctica/Troll | 2 +- library/tzdata/Antarctica/Vostok | 2 +- library/tzdata/Asia/Baku | 2 +- library/tzdata/Asia/Novokuznetsk | 133 +++++++++++++++--------------- library/tzdata/Asia/Novosibirsk | 135 ++++++++++++++++--------------- library/tzdata/Europe/Minsk | 6 +- library/tzdata/Indian/Kerguelen | 2 +- 22 files changed, 159 insertions(+), 159 deletions(-) diff --git a/library/tzdata/America/Cambridge_Bay b/library/tzdata/America/Cambridge_Bay index 23004bb..3115ee1 100644 --- a/library/tzdata/America/Cambridge_Bay +++ b/library/tzdata/America/Cambridge_Bay @@ -1,7 +1,7 @@ # created by tools/tclZIC.tcl - do not edit set TZData(:America/Cambridge_Bay) { - {-9223372036854775808 0 0 zzz} + {-9223372036854775808 0 0 -00} {-1577923200 -25200 0 MST} {-880210800 -21600 1 MWT} {-769395600 -21600 1 MPT} diff --git a/library/tzdata/America/Inuvik b/library/tzdata/America/Inuvik index dd0d151..08f0fd6 100644 --- a/library/tzdata/America/Inuvik +++ b/library/tzdata/America/Inuvik @@ -1,7 +1,7 @@ # created by tools/tclZIC.tcl - do not edit set TZData(:America/Inuvik) { - {-9223372036854775808 0 0 zzz} + {-9223372036854775808 0 0 -00} {-536457600 -28800 0 PST} {-147888000 -21600 1 PDDT} {-131558400 -28800 0 PST} diff --git a/library/tzdata/America/Iqaluit b/library/tzdata/America/Iqaluit index 2a2e9fe..ff82866 100644 --- a/library/tzdata/America/Iqaluit +++ b/library/tzdata/America/Iqaluit @@ -1,7 +1,7 @@ # created by tools/tclZIC.tcl - do not edit set TZData(:America/Iqaluit) { - {-9223372036854775808 0 0 zzz} + {-9223372036854775808 0 0 -00} {-865296000 -14400 0 EWT} {-769395600 -14400 1 EPT} {-765396000 -18000 0 EST} diff --git a/library/tzdata/America/Pangnirtung b/library/tzdata/America/Pangnirtung index 640808e..14d8516 100644 --- a/library/tzdata/America/Pangnirtung +++ b/library/tzdata/America/Pangnirtung @@ -1,7 +1,7 @@ # created by tools/tclZIC.tcl - do not edit set TZData(:America/Pangnirtung) { - {-9223372036854775808 0 0 zzz} + {-9223372036854775808 0 0 -00} {-1546300800 -14400 0 AST} {-880221600 -10800 1 AWT} {-769395600 -10800 1 APT} diff --git a/library/tzdata/America/Rankin_Inlet b/library/tzdata/America/Rankin_Inlet index 770ec5d..9ce9f8d 100644 --- a/library/tzdata/America/Rankin_Inlet +++ b/library/tzdata/America/Rankin_Inlet @@ -1,7 +1,7 @@ # created by tools/tclZIC.tcl - do not edit set TZData(:America/Rankin_Inlet) { - {-9223372036854775808 0 0 zzz} + {-9223372036854775808 0 0 -00} {-410227200 -21600 0 CST} {-147895200 -14400 1 CDDT} {-131565600 -21600 0 CST} diff --git a/library/tzdata/America/Resolute b/library/tzdata/America/Resolute index b4c0bab..a9881b4 100644 --- a/library/tzdata/America/Resolute +++ b/library/tzdata/America/Resolute @@ -1,7 +1,7 @@ # created by tools/tclZIC.tcl - do not edit set TZData(:America/Resolute) { - {-9223372036854775808 0 0 zzz} + {-9223372036854775808 0 0 -00} {-704937600 -21600 0 CST} {-147895200 -14400 1 CDDT} {-131565600 -21600 0 CST} diff --git a/library/tzdata/America/Yellowknife b/library/tzdata/America/Yellowknife index 44ca658..c6c4ed5 100644 --- a/library/tzdata/America/Yellowknife +++ b/library/tzdata/America/Yellowknife @@ -1,7 +1,7 @@ # created by tools/tclZIC.tcl - do not edit set TZData(:America/Yellowknife) { - {-9223372036854775808 0 0 zzz} + {-9223372036854775808 0 0 -00} {-1104537600 -25200 0 MST} {-880210800 -21600 1 MWT} {-769395600 -21600 1 MPT} diff --git a/library/tzdata/Antarctica/Casey b/library/tzdata/Antarctica/Casey index 56d5df7..2573dac 100644 --- a/library/tzdata/Antarctica/Casey +++ b/library/tzdata/Antarctica/Casey @@ -1,7 +1,7 @@ # created by tools/tclZIC.tcl - do not edit set TZData(:Antarctica/Casey) { - {-9223372036854775808 0 0 zzz} + {-9223372036854775808 0 0 -00} {-31536000 28800 0 AWST} {1255802400 39600 0 CAST} {1267714800 28800 0 AWST} diff --git a/library/tzdata/Antarctica/Davis b/library/tzdata/Antarctica/Davis index 2762d2f..c98be2f 100644 --- a/library/tzdata/Antarctica/Davis +++ b/library/tzdata/Antarctica/Davis @@ -1,9 +1,9 @@ # created by tools/tclZIC.tcl - do not edit set TZData(:Antarctica/Davis) { - {-9223372036854775808 0 0 zzz} + {-9223372036854775808 0 0 -00} {-409190400 25200 0 DAVT} - {-163062000 0 0 zzz} + {-163062000 0 0 -00} {-28857600 25200 0 DAVT} {1255806000 18000 0 DAVT} {1268251200 25200 0 DAVT} diff --git a/library/tzdata/Antarctica/DumontDUrville b/library/tzdata/Antarctica/DumontDUrville index 41dc1e3..8d21d45 100644 --- a/library/tzdata/Antarctica/DumontDUrville +++ b/library/tzdata/Antarctica/DumontDUrville @@ -1,8 +1,8 @@ # created by tools/tclZIC.tcl - do not edit set TZData(:Antarctica/DumontDUrville) { - {-9223372036854775808 0 0 zzz} + {-9223372036854775808 0 0 -00} {-725846400 36000 0 PMT} - {-566992800 0 0 zzz} + {-566992800 0 0 -00} {-415497600 36000 0 DDUT} } diff --git a/library/tzdata/Antarctica/Macquarie b/library/tzdata/Antarctica/Macquarie index 07ddff6..9ed0630 100644 --- a/library/tzdata/Antarctica/Macquarie +++ b/library/tzdata/Antarctica/Macquarie @@ -1,12 +1,12 @@ # created by tools/tclZIC.tcl - do not edit set TZData(:Antarctica/Macquarie) { - {-9223372036854775808 0 0 zzz} + {-9223372036854775808 0 0 -00} {-2214259200 36000 0 AEST} {-1680508800 39600 1 AEDT} {-1669892400 39600 0 AEDT} {-1665392400 36000 0 AEST} - {-1601719200 0 0 zzz} + {-1601719200 0 0 -00} {-94730400 36000 0 AEST} {-71136000 39600 1 AEDT} {-55411200 36000 0 AEST} diff --git a/library/tzdata/Antarctica/Mawson b/library/tzdata/Antarctica/Mawson index ba03ba1..e50aa07 100644 --- a/library/tzdata/Antarctica/Mawson +++ b/library/tzdata/Antarctica/Mawson @@ -1,7 +1,7 @@ # created by tools/tclZIC.tcl - do not edit set TZData(:Antarctica/Mawson) { - {-9223372036854775808 0 0 zzz} + {-9223372036854775808 0 0 -00} {-501206400 21600 0 MAWT} {1255809600 18000 0 MAWT} } diff --git a/library/tzdata/Antarctica/Palmer b/library/tzdata/Antarctica/Palmer index 5767985..62b17e1 100644 --- a/library/tzdata/Antarctica/Palmer +++ b/library/tzdata/Antarctica/Palmer @@ -1,7 +1,7 @@ # created by tools/tclZIC.tcl - do not edit set TZData(:Antarctica/Palmer) { - {-9223372036854775808 0 0 zzz} + {-9223372036854775808 0 0 -00} {-157766400 -14400 0 ART} {-152654400 -14400 0 ART} {-132955200 -10800 1 ARST} diff --git a/library/tzdata/Antarctica/Rothera b/library/tzdata/Antarctica/Rothera index 24d7f3e..3a219c7 100644 --- a/library/tzdata/Antarctica/Rothera +++ b/library/tzdata/Antarctica/Rothera @@ -1,6 +1,6 @@ # created by tools/tclZIC.tcl - do not edit set TZData(:Antarctica/Rothera) { - {-9223372036854775808 0 0 zzz} + {-9223372036854775808 0 0 -00} {218246400 -10800 0 ROTT} } diff --git a/library/tzdata/Antarctica/Syowa b/library/tzdata/Antarctica/Syowa index 4d046b5..1fe030a 100644 --- a/library/tzdata/Antarctica/Syowa +++ b/library/tzdata/Antarctica/Syowa @@ -1,6 +1,6 @@ # created by tools/tclZIC.tcl - do not edit set TZData(:Antarctica/Syowa) { - {-9223372036854775808 0 0 zzz} + {-9223372036854775808 0 0 -00} {-407808000 10800 0 SYOT} } diff --git a/library/tzdata/Antarctica/Troll b/library/tzdata/Antarctica/Troll index 7d2b042..09727a8 100644 --- a/library/tzdata/Antarctica/Troll +++ b/library/tzdata/Antarctica/Troll @@ -1,7 +1,7 @@ # created by tools/tclZIC.tcl - do not edit set TZData(:Antarctica/Troll) { - {-9223372036854775808 0 0 zzz} + {-9223372036854775808 0 0 -00} {1108166400 0 0 UTC} {1111885200 7200 1 CEST} {1130634000 0 0 UTC} diff --git a/library/tzdata/Antarctica/Vostok b/library/tzdata/Antarctica/Vostok index f846f65..a59868b 100644 --- a/library/tzdata/Antarctica/Vostok +++ b/library/tzdata/Antarctica/Vostok @@ -1,6 +1,6 @@ # created by tools/tclZIC.tcl - do not edit set TZData(:Antarctica/Vostok) { - {-9223372036854775808 0 0 zzz} + {-9223372036854775808 0 0 -00} {-380073600 21600 0 VOST} } diff --git a/library/tzdata/Asia/Baku b/library/tzdata/Asia/Baku index bc0701a..e9ee835 100644 --- a/library/tzdata/Asia/Baku +++ b/library/tzdata/Asia/Baku @@ -28,7 +28,7 @@ set TZData(:Asia/Baku) { {683496000 14400 0 AZST} {686098800 10800 0 AZT} {701823600 14400 1 AZST} - {717537600 14400 0 AZT} + {717548400 14400 0 AZT} {820440000 14400 0 AZT} {828234000 18000 1 AZST} {846378000 14400 0 AZT} diff --git a/library/tzdata/Asia/Novokuznetsk b/library/tzdata/Asia/Novokuznetsk index f079faa..a43a984 100644 --- a/library/tzdata/Asia/Novokuznetsk +++ b/library/tzdata/Asia/Novokuznetsk @@ -2,71 +2,70 @@ set TZData(:Asia/Novokuznetsk) { {-9223372036854775808 20928 0 LMT} - {-1441259328 21600 0 KRAT} - {-1247551200 25200 0 KRAMMTT} - {354906000 28800 1 KRAST} - {370713600 25200 0 KRAT} - {386442000 28800 1 KRAST} - {402249600 25200 0 KRAT} - {417978000 28800 1 KRAST} - {433785600 25200 0 KRAT} - {449600400 28800 1 KRAST} - {465332400 25200 0 KRAT} - {481057200 28800 1 KRAST} - {496782000 25200 0 KRAT} - {512506800 28800 1 KRAST} - {528231600 25200 0 KRAT} - {543956400 28800 1 KRAST} - {559681200 25200 0 KRAT} - {575406000 28800 1 KRAST} - {591130800 25200 0 KRAT} - {606855600 28800 1 KRAST} - {622580400 25200 0 KRAT} - {638305200 28800 1 KRAST} - {654634800 25200 0 KRAT} - {670359600 21600 0 KRAMMTT} - {670363200 25200 1 KRAST} - {686088000 21600 0 KRAT} - {695764800 25200 0 KRAMMTT} - {701809200 28800 1 KRAST} - {717534000 25200 0 KRAT} - {733258800 28800 1 KRAST} - {748983600 25200 0 KRAT} - {764708400 28800 1 KRAST} - {780433200 25200 0 KRAT} - {796158000 28800 1 KRAST} - {811882800 25200 0 KRAT} - {828212400 28800 1 KRAST} - {846356400 25200 0 KRAT} - {859662000 28800 1 KRAST} - {877806000 25200 0 KRAT} - {891111600 28800 1 KRAST} - {909255600 25200 0 KRAT} - {922561200 28800 1 KRAST} - {941310000 25200 0 KRAT} - {954010800 28800 1 KRAST} - {972759600 25200 0 KRAT} - {985460400 28800 1 KRAST} - {1004209200 25200 0 KRAT} - {1017514800 28800 1 KRAST} - {1035658800 25200 0 KRAT} - {1048964400 28800 1 KRAST} - {1067108400 25200 0 KRAT} - {1080414000 28800 1 KRAST} - {1099162800 25200 0 KRAT} - {1111863600 28800 1 KRAST} - {1130612400 25200 0 KRAT} - {1143313200 28800 1 KRAST} - {1162062000 25200 0 KRAT} - {1174762800 28800 1 KRAST} - {1193511600 25200 0 KRAT} - {1206817200 28800 1 KRAST} - {1224961200 25200 0 KRAT} - {1238266800 28800 1 KRAST} - {1256410800 25200 0 KRAT} - {1269716400 21600 0 NOVMMTT} - {1269720000 25200 1 NOVST} - {1288468800 21600 0 NOVT} - {1301169600 25200 0 NOVT} - {1414263600 25200 0 KRAT} + {-1441259328 21600 0 +06} + {-1247551200 25200 0 +08} + {354906000 28800 1 +08} + {370713600 25200 0 +07} + {386442000 28800 1 +08} + {402249600 25200 0 +07} + {417978000 28800 1 +08} + {433785600 25200 0 +07} + {449600400 28800 1 +08} + {465332400 25200 0 +07} + {481057200 28800 1 +08} + {496782000 25200 0 +07} + {512506800 28800 1 +08} + {528231600 25200 0 +07} + {543956400 28800 1 +08} + {559681200 25200 0 +07} + {575406000 28800 1 +08} + {591130800 25200 0 +07} + {606855600 28800 1 +08} + {622580400 25200 0 +07} + {638305200 28800 1 +08} + {654634800 25200 0 +07} + {670359600 21600 0 +07} + {670363200 25200 1 +07} + {686088000 21600 0 +06} + {695764800 25200 0 +08} + {701809200 28800 1 +08} + {717534000 25200 0 +07} + {733258800 28800 1 +08} + {748983600 25200 0 +07} + {764708400 28800 1 +08} + {780433200 25200 0 +07} + {796158000 28800 1 +08} + {811882800 25200 0 +07} + {828212400 28800 1 +08} + {846356400 25200 0 +07} + {859662000 28800 1 +08} + {877806000 25200 0 +07} + {891111600 28800 1 +08} + {909255600 25200 0 +07} + {922561200 28800 1 +08} + {941310000 25200 0 +07} + {954010800 28800 1 +08} + {972759600 25200 0 +07} + {985460400 28800 1 +08} + {1004209200 25200 0 +07} + {1017514800 28800 1 +08} + {1035658800 25200 0 +07} + {1048964400 28800 1 +08} + {1067108400 25200 0 +07} + {1080414000 28800 1 +08} + {1099162800 25200 0 +07} + {1111863600 28800 1 +08} + {1130612400 25200 0 +07} + {1143313200 28800 1 +08} + {1162062000 25200 0 +07} + {1174762800 28800 1 +08} + {1193511600 25200 0 +07} + {1206817200 28800 1 +08} + {1224961200 25200 0 +07} + {1238266800 28800 1 +08} + {1256410800 25200 0 +07} + {1269716400 21600 0 +07} + {1269720000 25200 1 +07} + {1288468800 21600 0 +06} + {1301169600 25200 0 +07} } diff --git a/library/tzdata/Asia/Novosibirsk b/library/tzdata/Asia/Novosibirsk index 54c83fa..21f5c00 100644 --- a/library/tzdata/Asia/Novosibirsk +++ b/library/tzdata/Asia/Novosibirsk @@ -2,71 +2,72 @@ set TZData(:Asia/Novosibirsk) { {-9223372036854775808 19900 0 LMT} - {-1579476700 21600 0 NOVT} - {-1247551200 25200 0 NOVMMTT} - {354906000 28800 1 NOVST} - {370713600 25200 0 NOVT} - {386442000 28800 1 NOVST} - {402249600 25200 0 NOVT} - {417978000 28800 1 NOVST} - {433785600 25200 0 NOVT} - {449600400 28800 1 NOVST} - {465332400 25200 0 NOVT} - {481057200 28800 1 NOVST} - {496782000 25200 0 NOVT} - {512506800 28800 1 NOVST} - {528231600 25200 0 NOVT} - {543956400 28800 1 NOVST} - {559681200 25200 0 NOVT} - {575406000 28800 1 NOVST} - {591130800 25200 0 NOVT} - {606855600 28800 1 NOVST} - {622580400 25200 0 NOVT} - {638305200 28800 1 NOVST} - {654634800 25200 0 NOVT} - {670359600 21600 0 NOVMMTT} - {670363200 25200 1 NOVST} - {686088000 21600 0 NOVT} - {695764800 25200 0 NOVMMTT} - {701809200 28800 1 NOVST} - {717534000 25200 0 NOVT} - {733258800 28800 1 NOVST} - {738090000 25200 0 NOVST} - {748987200 21600 0 NOVT} - {764712000 25200 1 NOVST} - {780436800 21600 0 NOVT} - {796161600 25200 1 NOVST} - {811886400 21600 0 NOVT} - {828216000 25200 1 NOVST} - {846360000 21600 0 NOVT} - {859665600 25200 1 NOVST} - {877809600 21600 0 NOVT} - {891115200 25200 1 NOVST} - {909259200 21600 0 NOVT} - {922564800 25200 1 NOVST} - {941313600 21600 0 NOVT} - {954014400 25200 1 NOVST} - {972763200 21600 0 NOVT} - {985464000 25200 1 NOVST} - {1004212800 21600 0 NOVT} - {1017518400 25200 1 NOVST} - {1035662400 21600 0 NOVT} - {1048968000 25200 1 NOVST} - {1067112000 21600 0 NOVT} - {1080417600 25200 1 NOVST} - {1099166400 21600 0 NOVT} - {1111867200 25200 1 NOVST} - {1130616000 21600 0 NOVT} - {1143316800 25200 1 NOVST} - {1162065600 21600 0 NOVT} - {1174766400 25200 1 NOVST} - {1193515200 21600 0 NOVT} - {1206820800 25200 1 NOVST} - {1224964800 21600 0 NOVT} - {1238270400 25200 1 NOVST} - {1256414400 21600 0 NOVT} - {1269720000 25200 1 NOVST} - {1288468800 21600 0 NOVT} - {1301169600 25200 0 NOVT} - {1414263600 21600 0 NOVT} + {-1579476700 21600 0 +06} + {-1247551200 25200 0 +08} + {354906000 28800 1 +08} + {370713600 25200 0 +07} + {386442000 28800 1 +08} + {402249600 25200 0 +07} + {417978000 28800 1 +08} + {433785600 25200 0 +07} + {449600400 28800 1 +08} + {465332400 25200 0 +07} + {481057200 28800 1 +08} + {496782000 25200 0 +07} + {512506800 28800 1 +08} + {528231600 25200 0 +07} + {543956400 28800 1 +08} + {559681200 25200 0 +07} + {575406000 28800 1 +08} + {591130800 25200 0 +07} + {606855600 28800 1 +08} + {622580400 25200 0 +07} + {638305200 28800 1 +08} + {654634800 25200 0 +07} + {670359600 21600 0 +07} + {670363200 25200 1 +07} + {686088000 21600 0 +06} + {695764800 25200 0 +08} + {701809200 28800 1 +08} + {717534000 25200 0 +07} + {733258800 28800 1 +08} + {738090000 25200 0 +07} + {748987200 21600 0 +06} + {764712000 25200 1 +07} + {780436800 21600 0 +06} + {796161600 25200 1 +07} + {811886400 21600 0 +06} + {828216000 25200 1 +07} + {846360000 21600 0 +06} + {859665600 25200 1 +07} + {877809600 21600 0 +06} + {891115200 25200 1 +07} + {909259200 21600 0 +06} + {922564800 25200 1 +07} + {941313600 21600 0 +06} + {954014400 25200 1 +07} + {972763200 21600 0 +06} + {985464000 25200 1 +07} + {1004212800 21600 0 +06} + {1017518400 25200 1 +07} + {1035662400 21600 0 +06} + {1048968000 25200 1 +07} + {1067112000 21600 0 +06} + {1080417600 25200 1 +07} + {1099166400 21600 0 +06} + {1111867200 25200 1 +07} + {1130616000 21600 0 +06} + {1143316800 25200 1 +07} + {1162065600 21600 0 +06} + {1174766400 25200 1 +07} + {1193515200 21600 0 +06} + {1206820800 25200 1 +07} + {1224964800 21600 0 +06} + {1238270400 25200 1 +07} + {1256414400 21600 0 +06} + {1269720000 25200 1 +07} + {1288468800 21600 0 +06} + {1301169600 25200 0 +07} + {1414263600 21600 0 +06} + {1469304000 25200 0 +07} } diff --git a/library/tzdata/Europe/Minsk b/library/tzdata/Europe/Minsk index 5e47063..2857e5b 100644 --- a/library/tzdata/Europe/Minsk +++ b/library/tzdata/Europe/Minsk @@ -30,10 +30,10 @@ set TZData(:Europe/Minsk) { {606870000 14400 1 MSD} {622594800 10800 0 MSK} {631141200 10800 0 MSK} - {670374000 10800 1 EEST} + {670374000 7200 0 EEMMTT} + {670377600 10800 1 EEST} {686102400 7200 0 EET} - {701820000 10800 1 EEST} - {717544800 10800 0 EEST} + {701827200 10800 1 EEST} {717552000 7200 0 EET} {733276800 10800 1 EEST} {749001600 7200 0 EET} diff --git a/library/tzdata/Indian/Kerguelen b/library/tzdata/Indian/Kerguelen index b41b85a..8820010 100644 --- a/library/tzdata/Indian/Kerguelen +++ b/library/tzdata/Indian/Kerguelen @@ -1,6 +1,6 @@ # created by tools/tclZIC.tcl - do not edit set TZData(:Indian/Kerguelen) { - {-9223372036854775808 0 0 zzz} + {-9223372036854775808 0 0 -00} {-631152000 18000 0 TFT} } -- cgit v0.12 From b158cee02890bb3c7bfc278400fd93b16fa35490 Mon Sep 17 00:00:00 2001 From: dkf Date: Tue, 12 Jul 2016 21:25:27 +0000 Subject: [3606388] Make variable-related tests work on their own. --- tests/set-old.test | 4 +- tests/set.test | 113 +++++++++++++++++++++++++++++++++-------------------- tests/var.test | 46 +++++++++++++++------- 3 files changed, 105 insertions(+), 58 deletions(-) diff --git a/tests/set-old.test b/tests/set-old.test index 94b6901..1c68f91 100644 --- a/tests/set-old.test +++ b/tests/set-old.test @@ -14,7 +14,7 @@ # of this file, and for a DISCLAIMER OF ALL WARRANTIES. if {[lsearch [namespace children] ::tcltest] == -1} { - package require tcltest + package require tcltest 2 namespace import -force ::tcltest::* } @@ -865,6 +865,8 @@ test set-old-10.13 {array enumeration errors} { list [catch {array done a b c} msg] $msg } {1 {wrong # args: should be "array donesearch arrayName searchId"}} test set-old-10.14 {array enumeration errors} { + catch {unset a} + set a(a) a list [catch {array done a b} msg] $msg } {1 {illegal search identifier "b"}} test set-old-10.15 {array enumeration errors} { diff --git a/tests/set.test b/tests/set.test index 18119f5..374ff7a 100644 --- a/tests/set.test +++ b/tests/set.test @@ -22,7 +22,7 @@ testConstraint testset2 [llength [info commands testset2]] catch {unset x} catch {unset i} - + test set-1.1 {TclCompileSetCmd: missing variable name} { list [catch {set} msg] $msg } {1 {wrong # args: should be "set varName ?newValue?"}} @@ -39,16 +39,18 @@ test set-1.4 {TclCompileSetCmd: simple variable name in quotes} { set i 17 list [set "i"] $i } {17 17} -test set-1.5 {TclCompileSetCmd: simple variable name in braces} { +test set-1.5 {TclCompileSetCmd: simple variable name in braces} -setup { catch {unset {a simple var}} +} -body { set {a simple var} 27 list [set {a simple var}] ${a simple var} -} {27 27} -test set-1.6 {TclCompileSetCmd: simple array variable name} { +} -result {27 27} +test set-1.6 {TclCompileSetCmd: simple array variable name} -setup { catch {unset a} +} -body { set a(foo) 37 list [set a(foo)] $a(foo) -} {37 37} +} -result {37 37} test set-1.7 {TclCompileSetCmd: non-simple (computed) variable name} { set x "i" set i 77 @@ -149,22 +151,24 @@ test set-1.14 {TclCompileSetCmd: simple local name, >255 locals} { } 260locals } {1234} -test set-1.15 {TclCompileSetCmd: variable is array} { +test set-1.15 {TclCompileSetCmd: variable is array} -setup { catch {unset a} +} -body { set x 27 set x [set a(foo) 11] catch {unset a} set x -} 11 -test set-1.16 {TclCompileSetCmd: variable is array, elem substitutions} { +} -result 11 +test set-1.16 {TclCompileSetCmd: variable is array, elem substitutions} -setup { catch {unset a} +} -body { set i 5 set x 789 set a(foo5) 27 set x [set a(foo$i)] catch {unset a} set x -} 27 +} -result 27 test set-1.17 {TclCompileSetCmd: doing assignment, simple int} { set i 5 @@ -211,7 +215,7 @@ test set-1.25 {TclCompileSetCmd: var is array, braced (no subs)} { test set-1.26 {TclCompileSetCmd: various array constructs} { # Test all kinds of array constructs that TclCompileSetCmd # may feel inclined to tamper with. - proc p {} { + apply {{} { set a x set be(hej) 1 ; # hej set be($a) 1 ; # x @@ -230,28 +234,33 @@ test set-1.26 {TclCompileSetCmd: various array constructs} { set [string range bet 0 1](foo) 1 ; # foo set be([set be(a:$a)][set b\e($a)]) 1 ; # 51 return [lsort [array names be]] - } - p + }} } [lsort {hej x $a x,hej x,x c(x ww a:x hej,1,hej hug {a a} {x ,ugg,hej} x,h"ej {b c} foo 51}]; # " just a matching end quote -test set-2.1 {set command: runtime error, bad variable name} { +test set-2.1 {set command: runtime error, bad variable name} -setup { unset -nocomplain {"foo} +} -body { list [catch {set {"foo}} msg] $msg $::errorInfo -} {1 {can't read ""foo": no such variable} {can't read ""foo": no such variable +} -result {1 {can't read ""foo": no such variable} {can't read ""foo": no such variable while executing "set {"foo}"}} -test set-2.2 {set command: runtime error, not array variable} { - catch {unset b} +# Stop my editor highlighter " from being confused +test set-2.2 {set command: runtime error, not array variable} -setup { + unset -nocomplain b +} -body { set b 44 list [catch {set b(123)} msg] $msg -} {1 {can't read "b(123)": variable isn't array}} -test set-2.3 {set command: runtime error, errors in reading variables} { - catch {unset a} +} -result {1 {can't read "b(123)": variable isn't array}} +test set-2.3 {set command: runtime error, errors in reading variables} -setup { + unset -nocomplain a +} -body { set a(6) 44 list [catch {set a(18)} msg] $msg -} {1 {can't read "a(18)": no such element in array}} -test set-2.4 {set command: runtime error, readonly variable} -body { +} -result {1 {can't read "a(18)": no such element in array}} +test set-2.4 {set command: runtime error, readonly variable} -setup { + unset -nocomplain x +} -body { proc readonly args {error "variable is read-only"} set x 123 trace var x w readonly @@ -260,12 +269,18 @@ test set-2.4 {set command: runtime error, readonly variable} -body { while executing * "set x 1"}} -test set-2.5 {set command: runtime error, basic array operations} { +test set-2.5 {set command: runtime error, basic array operations} -setup { + unset -nocomplain a +} -body { + array set a {} list [catch {set a(other)} msg] $msg -} {1 {can't read "a(other)": no such element in array}} -test set-2.6 {set command: runtime error, basic array operations} { +} -result {1 {can't read "a(other)": no such element in array}} +test set-2.6 {set command: runtime error, basic array operations} -setup { + unset -nocomplain a +} -body { + array set a {} list [catch {set a} msg] $msg -} {1 {can't read "a": variable is array}} +} -result {1 {can't read "a": variable is array}} # Test the uncompiled version of set @@ -479,25 +494,29 @@ test set-3.24 {uncompiled set command: too many arguments} { $z msg } {wrong # args: should be "set varName ?newValue?"} -test set-4.1 {uncompiled set command: runtime error, bad variable name} { +test set-4.1 {uncompiled set command: runtime error, bad variable name} -setup { unset -nocomplain {"foo} +} -body { set z set list [catch {$z {"foo}} msg] $msg $::errorInfo -} {1 {can't read ""foo": no such variable} {can't read ""foo": no such variable +} -result {1 {can't read ""foo": no such variable} {can't read ""foo": no such variable while executing "$z {"foo}"}} -test set-4.2 {uncompiled set command: runtime error, not array variable} { - set z set +# Stop my editor highlighter " from being confused +test set-4.2 {uncompiled set command: runtime error, not array variable} -setup { catch {unset b} +} -body { + set z set $z b 44 list [catch {$z b(123)} msg] $msg -} {1 {can't read "b(123)": variable isn't array}} -test set-4.3 {uncompiled set command: runtime error, errors in reading variables} { - set z set - catch {unset a} +} -result {1 {can't read "b(123)": variable isn't array}} +test set-4.3 {uncompiled set command: runtime error, errors in reading variables} -setup { + catch {unset a} +} -body { + set z set $z a(6) 44 list [catch {$z a(18)} msg] $msg -} {1 {can't read "a(18)": no such element in array}} +} -result {1 {can't read "a(18)": no such element in array}} test set-4.4 {uncompiled set command: runtime error, readonly variable} -body { set z set proc readonly args {error "variable is read-only"} @@ -508,27 +527,33 @@ test set-4.4 {uncompiled set command: runtime error, readonly variable} -body { while executing * "$z x 1"}} -test set-4.5 {uncompiled set command: runtime error, basic array operations} { +test set-4.5 {uncompiled set command: runtime error, basic array operations} -setup { + unset -nocomplain a + array set a {} +} -body { set z set list [catch {$z a(other)} msg] $msg -} {1 {can't read "a(other)": no such element in array}} -test set-4.6 {set command: runtime error, basic array operations} { +} -result {1 {can't read "a(other)": no such element in array}} +test set-4.6 {set command: runtime error, basic array operations} -setup { + unset -nocomplain a + array set a {} +} -body { set z set list [catch {$z a} msg] $msg -} {1 {can't read "a": variable is array}} +} -result {1 {can't read "a": variable is array}} -test set-5.1 {error on malformed array name} testset2 { +test set-5.1 {error on malformed array name} -constraints testset2 -setup { unset -nocomplain z +} -body { catch {testset2 z(a) b} msg catch {testset2 z(b) a} msg1 list $msg $msg1 -} {{can't read "z(a)(b)": variable isn't array} {can't read "z(b)(a)": variable isn't array}} - +} -result {{can't read "z(a)(b)": variable isn't array} {can't read "z(b)(a)": variable isn't array}} # In a mem-debug build, this test will crash unless Bug 3602706 is fixed. test set-5.2 {Bug 3602706} -body { testset2 ::tcl_platform not-in-there } -returnCodes error -result * -match glob - + # cleanup catch {unset a} catch {unset b} @@ -537,3 +562,7 @@ catch {unset x} catch {unset z} ::tcltest::cleanupTests return + +# Local Variables: +# mode: tcl +# End: diff --git a/tests/var.test b/tests/var.test index b6b09fd..690bd10 100644 --- a/tests/var.test +++ b/tests/var.test @@ -44,10 +44,12 @@ test var-1.1 {TclLookupVar, Array handling} -setup { set arr(foo) 37 list [$x i] $i [$x arr(foo)] $arr(foo) } -result {11 11 38 38} +set ::x "global value" +namespace eval test_ns_var { + variable x "namespace value" +} test var-1.2 {TclLookupVar, TCL_GLOBAL_ONLY implies global namespace var} { - set x "global value" namespace eval test_ns_var { - variable x "namespace value" proc p {} { global x ;# specifies TCL_GLOBAL_ONLY to get global x return $x @@ -261,6 +263,7 @@ test var-3.7 {MakeUpvar, my var has ::s} -setup { } } -result {789789} test var-3.8 {MakeUpvar, my var already exists in global ns} -setup { + upvar #0 aaaaa xxxxx catch {unset aaaaa} catch {unset xxxxx} } -body { @@ -274,6 +277,8 @@ test var-3.9 {MakeUpvar, my var has invalid ns name} -setup { } -returnCodes error -body { set aaaaa 789789 upvar #0 aaaaa test_ns_fred::lnk +} -cleanup { + unset ::aaaaa } -result {can't create "test_ns_fred::lnk": parent namespace doesn't exist} test var-3.10 {MakeUpvar, between namespaces} -body { namespace eval {} { @@ -282,8 +287,6 @@ test var-3.10 {MakeUpvar, between namespaces} -body { set foo::bar 1 list $bar $foo::bar } -} -cleanup { - unset ::aaaaa } -result {1 1} test var-3.11 {MakeUpvar, my var looks like array elem} -setup { catch {unset aaaaa} @@ -322,9 +325,11 @@ test var-5.2 {Tcl_GetVariableFullName, namespace variable} { namespace which -variable martha } } {::test_ns_var::martha} -test var-5.3 {Tcl_GetVariableFullName, namespace variable} { +test var-5.3 {Tcl_GetVariableFullName, namespace variable} -setup { + namespace eval test_ns_var {variable martha} +} -body { namespace which -variable test_ns_var::martha -} {::test_ns_var::martha} +} -result {::test_ns_var::martha} test var-6.1 {Tcl_GlobalObjCmd, variable is qualified by a namespace name} { namespace eval test_ns_var { @@ -348,6 +353,7 @@ test var-6.2 {Tcl_GlobalObjCmd, variable is qualified by a namespace name} { test_ns_var::p } {java} test var-6.3 {Tcl_GlobalObjCmd, variable named {} qualified by a namespace name} { + namespace eval ::test_ns_var::test_ns_nested {} set ::test_ns_var::test_ns_nested:: 24 apply {{} { global ::test_ns_var::test_ns_nested:: @@ -389,20 +395,26 @@ test var-7.2 {Tcl_VariableObjCmd, if new and no value, leave undefined} { } list [info exists test_ns_var::two] [catch {set test_ns_var::two} msg] $msg } {0 1 {can't read "test_ns_var::two": no such variable}} -test var-7.3 {Tcl_VariableObjCmd, "define" var already created above} { +test var-7.3 {Tcl_VariableObjCmd, "define" var already created above} -setup { + catch {namespace delete test_ns_var} + namespace eval test_ns_var {variable one 1} +} -body { namespace eval test_ns_var { variable two 2 } list [lsort [info vars test_ns_var::*]] \ [namespace eval test_ns_var {set two}] -} [list [lsort {::test_ns_var::two ::test_ns_var::one}] 2] -test var-7.4 {Tcl_VariableObjCmd, list of vars} { +} -result [list [lsort {::test_ns_var::two ::test_ns_var::one}] 2] +test var-7.4 {Tcl_VariableObjCmd, list of vars} -setup { + catch {namespace delete test_ns_var} + namespace eval test_ns_var {variable one 1; variable two 2} +} -body { namespace eval test_ns_var { variable three 3 four 4 } list [lsort [info vars test_ns_var::*]] \ [namespace eval test_ns_var {expr $three+$four}] -} [list [lsort {::test_ns_var::four ::test_ns_var::three ::test_ns_var::two ::test_ns_var::one}] 7] +} -result [list [lsort {::test_ns_var::four ::test_ns_var::three ::test_ns_var::two ::test_ns_var::one}] 7] test var-7.5 {Tcl_VariableObjCmd, value for last var is optional} -setup { catch {unset a} catch {unset five} @@ -476,7 +488,9 @@ test var-7.9 {Tcl_VariableObjCmd, mark as namespace var so var persists until na [lsort {::test_ns_var2::x ::test_ns_var2::z}] 0 0\ {1 {can't unset "test_ns_var2::z": no such variable}}\ {}] -test var-7.10 {Tcl_VariableObjCmd, variable cmd inside proc creates local link var} { +test var-7.10 {Tcl_VariableObjCmd, variable cmd inside proc creates local link var} -setup { + namespace eval test_ns_var { variable eight 8 } +} -body { namespace eval test_ns_var { proc p {} { variable eight @@ -484,14 +498,16 @@ test var-7.10 {Tcl_VariableObjCmd, variable cmd inside proc creates local link v } p } -} {8 eight} -test var-7.11 {Tcl_VariableObjCmd, variable cmd inside proc creates local link var} { +} -result {8 eight} +test var-7.11 {Tcl_VariableObjCmd, variable cmd inside proc creates local link var} -setup { + namespace eval test_ns_var { variable eight 8 } +} -body { proc p {} { ;# note this proc is at global :: scope variable test_ns_var::eight list [set eight] [info vars] } p -} {8 eight} +} -result {8 eight} test var-7.12 {Tcl_VariableObjCmd, variable cmd inside proc creates local link var} { namespace eval test_ns_var { variable {} {My name is empty} @@ -774,7 +790,7 @@ test var-17.1 {TclArraySet [Bug 1669489]} -setup { test var-18.1 {array unset and unset traces: Bug 2939073} -setup { set already 0 - unset x + unset -nocomplain x } -body { array set x {e 1 i 1} trace add variable x unset {apply {args { -- cgit v0.12 From 09c67efdce34a8588ab4cb53e007e8ec603dc081 Mon Sep 17 00:00:00 2001 From: dkf Date: Tue, 12 Jul 2016 21:30:34 +0000 Subject: [3606125] Make parser-related tests work on their own. --- tests/parseOld.test | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/tests/parseOld.test b/tests/parseOld.test index a6e07a2b..504d063 100644 --- a/tests/parseOld.test +++ b/tests/parseOld.test @@ -13,7 +13,7 @@ # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. -package require tcltest +package require tcltest 2 namespace import ::tcltest::* ::tcltest::loadTestedCommands @@ -37,7 +37,7 @@ proc getArgs args { global argv set argv $args } - + # Basic argument parsing. test parseOld-1.1 {basic argument parsing} { @@ -296,6 +296,7 @@ test parseOld-8.4 {semi-colons} { # The following checks are to ensure that the interpreter's result # gets re-initialized by Tcl_Eval in all the right places. +set a 22 test parseOld-9.1 {result initialization} {concat abc} abc test parseOld-9.2 {result initialization} {concat abc; proc foo {} {}} {} test parseOld-9.3 {result initialization} {concat abc; proc foo {} $a} {} @@ -408,6 +409,8 @@ test parseOld-11.7 {long values} { set b [concat 1111 2222 3333 4444 5555 6666 7777 8888 9999 aaaa bbbb cccc dddd eeee ffff gggg hhhh iiii jjjj kkkk llll mmmm nnnn oooo pppp qqqq rrrr ssss tttt uuuu vvvv wwww xxxx yyyy zzzz AAAA BBBB CCCC DDDD EEEE FFFF GGGG HHHH] llength $b } 43 +# Duplicate action of previous test +llength [set b [concat 1111 2222 3333 4444 5555 6666 7777 8888 9999 aaaa bbbb cccc dddd eeee ffff gggg hhhh iiii jjjj kkkk llll mmmm nnnn oooo pppp qqqq rrrr ssss tttt uuuu vvvv wwww xxxx yyyy zzzz AAAA BBBB CCCC DDDD EEEE FFFF GGGG HHHH]] test parseOld-11.8 {long values} { set b } $a @@ -538,8 +541,12 @@ test parseOld-15.4 {TclScriptEnd procedure} { test parseOld-15.5 {TclScriptEnd procedure} { info complete "xyz \[abc" } {0} - + # cleanup set argv $savedArgv ::tcltest::cleanupTests return + +# Local Variables: +# mode: tcl +# End: -- cgit v0.12 From ab2a78be642be26075e2998347d71359a6b3c500 Mon Sep 17 00:00:00 2001 From: dgp Date: Wed, 13 Jul 2016 19:06:22 +0000 Subject: New private flag value INDEX_TEMP_TABLE. Used to signal to Tcl_GetIndexFromObj*() routines that the table in which lookups are done has a fleeting existence. Thus there is no value in caching any results, since the cache can never be useful. Improvement over existing hackery where cache is stored and then freed to avoid bogus results. Likely candidate to eventually push to the public interface. --- generic/tclFCmd.c | 10 ++-------- generic/tclIndexObj.c | 13 +++++++------ generic/tclInt.h | 9 +++++++++ 3 files changed, 18 insertions(+), 14 deletions(-) diff --git a/generic/tclFCmd.c b/generic/tclFCmd.c index bb814ea..80898fc 100644 --- a/generic/tclFCmd.c +++ b/generic/tclFCmd.c @@ -1079,12 +1079,9 @@ TclFileAttrsCmd( } if (Tcl_GetIndexFromObj(interp, objv[0], attributeStrings, - "option", 0, &index) != TCL_OK) { + "option", INDEX_TEMP_TABLE, &index) != TCL_OK) { goto end; } - if (attributeStringsAllocated != NULL) { - TclFreeIntRep(objv[0]); - } if (Tcl_FSFileAttrsGet(interp, index, filePtr, &objPtr) != TCL_OK) { goto end; @@ -1107,12 +1104,9 @@ TclFileAttrsCmd( for (i = 0; i < objc ; i += 2) { if (Tcl_GetIndexFromObj(interp, objv[i], attributeStrings, - "option", 0, &index) != TCL_OK) { + "option", INDEX_TEMP_TABLE, &index) != TCL_OK) { goto end; } - if (attributeStringsAllocated != NULL) { - TclFreeIntRep(objv[i]); - } if (i + 1 == objc) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "value for \"%s\" missing", TclGetString(objv[i]))); diff --git a/generic/tclIndexObj.c b/generic/tclIndexObj.c index 2281d22..c6873af 100644 --- a/generic/tclIndexObj.c +++ b/generic/tclIndexObj.c @@ -114,6 +114,7 @@ Tcl_GetIndexFromObj( int flags, /* 0 or TCL_EXACT */ int *indexPtr) /* Place to store resulting integer index. */ { + if (!(flags & INDEX_TEMP_TABLE)) { /* * See if there is a valid cached result from a previous lookup (doing the @@ -135,6 +136,7 @@ Tcl_GetIndexFromObj( return TCL_OK; } } + } return Tcl_GetIndexFromObjStruct(interp, objPtr, tablePtr, sizeof(char *), msg, flags, indexPtr); } @@ -211,13 +213,8 @@ GetIndexFromObjList( tablePtr[objc] = NULL; result = Tcl_GetIndexFromObjStruct(interp, objPtr, tablePtr, - sizeof(char *), msg, flags, indexPtr); - - /* - * The internal rep must be cleared since tablePtr will go away. - */ + sizeof(char *), msg, flags | INDEX_TEMP_TABLE, indexPtr); - TclFreeIntRep(objPtr); ckfree(tablePtr); return result; @@ -279,6 +276,7 @@ Tcl_GetIndexFromObjStruct( * See if there is a valid cached result from a previous lookup. */ + if (!(flags & INDEX_TEMP_TABLE)) { if (objPtr->typePtr == &indexType) { indexRep = objPtr->internalRep.twoPtrValue.ptr1; if (indexRep->tablePtr==tablePtr && indexRep->offset==offset) { @@ -286,6 +284,7 @@ Tcl_GetIndexFromObjStruct( return TCL_OK; } } + } /* * Lookup the value of the object in the table. Accept unique @@ -340,6 +339,7 @@ Tcl_GetIndexFromObjStruct( * operation. */ + if (!(flags & INDEX_TEMP_TABLE)) { if (objPtr->typePtr == &indexType) { indexRep = objPtr->internalRep.twoPtrValue.ptr1; } else { @@ -351,6 +351,7 @@ Tcl_GetIndexFromObjStruct( indexRep->tablePtr = (void *) tablePtr; indexRep->offset = offset; indexRep->index = index; + } *indexPtr = index; return TCL_OK; diff --git a/generic/tclInt.h b/generic/tclInt.h index 33476ed..4ecac7d 100644 --- a/generic/tclInt.h +++ b/generic/tclInt.h @@ -2548,6 +2548,15 @@ typedef struct TclFileAttrProcs { } TclFileAttrProcs; /* + * Private flag value which controls Tcl_GetIndexFromObj*() routines + * to instruct them not to cache lookups because the table will not + * live long enough to make it worthwhile. Must not clash with public + * flag value TCL_EXACT. + */ + +#define INDEX_TEMP_TABLE 2 + +/* * Opaque handle used in pipeline routines to encapsulate platform-dependent * state. */ -- cgit v0.12 From b91a1c74a96cb667373be1fa8b3da13dc82d071d Mon Sep 17 00:00:00 2001 From: dkf Date: Thu, 14 Jul 2016 08:05:35 +0000 Subject: Tidy up some references to INDEX_TEMP_TABLE. --- generic/tclIndexObj.c | 31 +++++++++++++------------------ 1 file changed, 13 insertions(+), 18 deletions(-) diff --git a/generic/tclIndexObj.c b/generic/tclIndexObj.c index c6873af..6a3e4e3 100644 --- a/generic/tclIndexObj.c +++ b/generic/tclIndexObj.c @@ -114,15 +114,13 @@ Tcl_GetIndexFromObj( int flags, /* 0 or TCL_EXACT */ int *indexPtr) /* Place to store resulting integer index. */ { - if (!(flags & INDEX_TEMP_TABLE)) { - /* * See if there is a valid cached result from a previous lookup (doing the * check here saves the overhead of calling Tcl_GetIndexFromObjStruct in * the common case where the result is cached). */ - if (objPtr->typePtr == &indexType) { + if (!(flags & INDEX_TEMP_TABLE) && objPtr->typePtr == &indexType) { IndexRep *indexRep = objPtr->internalRep.twoPtrValue.ptr1; /* @@ -136,7 +134,6 @@ Tcl_GetIndexFromObj( return TCL_OK; } } - } return Tcl_GetIndexFromObjStruct(interp, objPtr, tablePtr, sizeof(char *), msg, flags, indexPtr); } @@ -276,15 +273,13 @@ Tcl_GetIndexFromObjStruct( * See if there is a valid cached result from a previous lookup. */ - if (!(flags & INDEX_TEMP_TABLE)) { - if (objPtr->typePtr == &indexType) { + if (!(flags & INDEX_TEMP_TABLE) && objPtr->typePtr == &indexType) { indexRep = objPtr->internalRep.twoPtrValue.ptr1; if (indexRep->tablePtr==tablePtr && indexRep->offset==offset) { *indexPtr = indexRep->index; return TCL_OK; } } - } /* * Lookup the value of the object in the table. Accept unique @@ -340,17 +335,17 @@ Tcl_GetIndexFromObjStruct( */ if (!(flags & INDEX_TEMP_TABLE)) { - if (objPtr->typePtr == &indexType) { - indexRep = objPtr->internalRep.twoPtrValue.ptr1; - } else { - TclFreeIntRep(objPtr); - indexRep = ckalloc(sizeof(IndexRep)); - objPtr->internalRep.twoPtrValue.ptr1 = indexRep; - objPtr->typePtr = &indexType; - } - indexRep->tablePtr = (void *) tablePtr; - indexRep->offset = offset; - indexRep->index = index; + if (objPtr->typePtr == &indexType) { + indexRep = objPtr->internalRep.twoPtrValue.ptr1; + } else { + TclFreeIntRep(objPtr); + indexRep = ckalloc(sizeof(IndexRep)); + objPtr->internalRep.twoPtrValue.ptr1 = indexRep; + objPtr->typePtr = &indexType; + } + indexRep->tablePtr = (void *) tablePtr; + indexRep->offset = offset; + indexRep->index = index; } *indexPtr = index; -- cgit v0.12 From c65f04435b80a065f992d534fcd8bfc9a5a0e8ef Mon Sep 17 00:00:00 2001 From: dkf Date: Thu, 14 Jul 2016 08:31:00 +0000 Subject: [77d58e3a7a] Test case independence: chanio, cmdah, env, history. --- tests/chanio.test | 23 +++++++++++++++++++---- tests/cmdAH.test | 8 ++++++-- tests/env.test | 12 ++++++++++-- tests/history.test | 5 +++++ 4 files changed, 40 insertions(+), 8 deletions(-) diff --git a/tests/chanio.test b/tests/chanio.test index 2738fc6..29f42c3 100644 --- a/tests/chanio.test +++ b/tests/chanio.test @@ -4160,12 +4160,20 @@ test chan-io-33.4 {Tcl_Gets with long line} -setup { } -cleanup { chan close $f } -result {abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ} -test chan-io-33.5 {Tcl_Gets with long line} { +test chan-io-33.5 {Tcl_Gets with long line} -setup { + set f [open $path(test3) w] + puts -nonewline $f "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" + puts -nonewline $f "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" + puts -nonewline $f "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" + puts -nonewline $f "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" + puts $f "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" + close $f +} -body { set f [open $path(test3)] set x [chan gets $f y] chan close $f list $x $y -} {260 abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ} +} -result {260 abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ} test chan-io-33.6 {Tcl_Gets and end of file} -setup { file delete $path(test3) set x {} @@ -6765,7 +6773,12 @@ test chan-io-52.10 {TclCopyChannel & encodings} {fcopy} { chan close $out file size $path(utf8-fcopy.txt) } 5 -test chan-io-52.11 {TclCopyChannel & encodings} {fcopy} { +test chan-io-52.11 {TclCopyChannel & encodings} -setup { + set f [open $path(utf8-fcopy.txt) w] + fconfigure $f -encoding utf-8 + puts $f "\u0410\u0410" + close $f +} -constraints {fcopy} -body { # binary to encoding => the input has to be in utf-8 to make sense to the # encoder set in [open $path(utf8-fcopy.txt) r] @@ -6777,7 +6790,9 @@ test chan-io-52.11 {TclCopyChannel & encodings} {fcopy} { chan close $in chan close $out file size $path(kyrillic.txt) -} 3 +} -cleanup { + file delete $path(utf8-fcopy.txt) +} -result 3 test chan-io-53.1 {CopyData} -setup { file delete $path(test1) diff --git a/tests/cmdAH.test b/tests/cmdAH.test index ef933cb..6418aae 100644 --- a/tests/cmdAH.test +++ b/tests/cmdAH.test @@ -141,9 +141,13 @@ test cmdAH-2.6.2 {cd} -constraints {unix nonPortable} -setup { } -cleanup { cd $dir } -result {/} -test cmdAH-2.6.3 {Tcl_CdObjCmd, bug #3118489} -returnCodes error -body { +test cmdAH-2.6.3 {Tcl_CdObjCmd, bug #3118489} -setup { + set dir [pwd] +} -returnCodes error -body { cd .\0 -} -result "couldn't change working directory to \".\0\": no such file or directory" +} -cleanup { + cd $dir +} -match glob -result "couldn't change working directory to \".\0\": *" test cmdAH-2.7 {Tcl_ConcatObjCmd} { concat } {} diff --git a/tests/env.test b/tests/env.test index 9f59fbc..0dd4f98 100644 --- a/tests/env.test +++ b/tests/env.test @@ -19,7 +19,7 @@ if {[lsearch [namespace children] ::tcltest] == -1} { # Some tests require the "exec" command. # Skip them if exec is not defined. testConstraint exec [llength [info commands exec]] - + # # These tests will run on any platform (and indeed crashed on the Mac). So put # them before you test for the existance of exec. @@ -147,6 +147,7 @@ test env-2.2 {adding environment variables} -setup { } -result {NAME1=test string} test env-2.3 {adding environment variables} -setup { encoding system iso8859-1 + set env(NAME1) "test string" } -constraints {exec} -body { set env(NAME2) "more" getenv @@ -156,6 +157,8 @@ test env-2.3 {adding environment variables} -setup { NAME2=more} test env-2.4 {adding environment variables} -setup { encoding system iso8859-1 + set env(NAME1) "test string" + set env(NAME2) "more" } -constraints {exec} -body { set env(XYZZY) "garbage" getenv @@ -165,7 +168,9 @@ test env-2.4 {adding environment variables} -setup { NAME2=more XYZZY=garbage} +set env(NAME1) "test string" set env(NAME2) "new value" +set env(XYZZY) "garbage" test env-3.1 {changing environment variables} -setup { encoding system iso8859-1 } -constraints {exec} -body { @@ -177,6 +182,7 @@ test env-3.1 {changing environment variables} -setup { } -result {NAME1=test string NAME2=new value XYZZY=garbage} +unset -nocomplain env(NAME2) test env-4.1 {unsetting environment variables: default} -setup { encoding system iso8859-1 @@ -195,6 +201,7 @@ test env-4.2 {unsetting environment variables} -setup { unset env(XYZZY) encoding system $sysenc } -result {XYZZY=garbage} +unset -nocomplain env(NAME1) env(XYZZY) test env-4.3 {setting international environment variables} -setup { encoding system iso8859-1 } -constraints {exec} -body { @@ -213,6 +220,7 @@ test env-4.4 {changing international environment variables} -setup { } -result {\u00a7=\u00a7} test env-4.5 {unsetting international environment variables} -setup { encoding system iso8859-1 + set env(\ua7) \ua7 } -body { set env(\ub6) \ua7 unset env(\ua7) @@ -323,7 +331,7 @@ test env-7.3 {[9b4702]: testing existence of env(some_thing) should not destroy return [info exists ::env(test7_3)] }} } -result 1 - + # Restore the environment variables at the end of the test. foreach name [array names env] { diff --git a/tests/history.test b/tests/history.test index c562796..7549beb 100644 --- a/tests/history.test +++ b/tests/history.test @@ -233,6 +233,7 @@ if {[testConstraint history]} { test history-8.1 {clear option} history {catch {history clear junk}} 1 test history-8.2 {clear option} history {history clear} {} if {[testConstraint history]} { + history clear history add "Testing" } test history-8.3 {clear option} history {history} { 1 Testing} @@ -248,3 +249,7 @@ test history-9.2 {miscellaneous} history { # cleanup ::tcltest::cleanupTests return + +# Local Variables: +# mode: tcl +# End: -- cgit v0.12 From 18d118050e87e9f2665c7da4358836e37dbd7a0f Mon Sep 17 00:00:00 2001 From: dgp Date: Thu, 14 Jul 2016 14:40:37 +0000 Subject: New test demonstrates memleak discovered by Rolf Ade. --- tests/var.test | 30 ++++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/tests/var.test b/tests/var.test index e223f6e..803bbda 100644 --- a/tests/var.test +++ b/tests/var.test @@ -26,6 +26,21 @@ testConstraint testupvar [llength [info commands testupvar]] testConstraint testgetvarfullname [llength [info commands testgetvarfullname]] testConstraint testsetnoerr [llength [info commands testsetnoerr]] testConstraint memory [llength [info commands memory]] +if {[testConstraint memory]} { + proc getbytes {} { + return [lindex [split [memory info] \n] 3 3] + } + proc leaktest {script {iterations 3}} { + set end [getbytes] + for {set i 0} {$i < $iterations} {incr i} { + uplevel 1 $script + set tmp $end + set end [getbytes] + } + return [expr {$end - $tmp}] + } +} + catch {rename p ""} catch {namespace delete test_ns_var} @@ -912,9 +927,6 @@ test var-21.0 {PushVarNameWord OBOE in compiled unset} -setup { } -result 1 test var-22.0 {leak in array element unset: Bug a3309d01db} -setup { - proc getbytes {} { - lindex [split [memory info] \n] 3 3 - } proc doit k { variable A set A($k) {} @@ -934,13 +946,9 @@ test var-22.0 {leak in array element unset: Bug a3309d01db} -setup { set leakedBytes [expr {$end - $tmp}] } -cleanup { array unset A - rename getbytes {} rename doit {} } -result 0 test var-22.1 {leak in localVarName intrep: Bug 80304238ac} -setup { - proc getbytes {} { - lindex [split [memory info] \n] 3 3 - } proc doit {} { interp create slave slave eval { @@ -962,15 +970,21 @@ test var-22.1 {leak in localVarName intrep: Bug 80304238ac} -setup { set leakedBytes [expr {$end - $tmp}] } -cleanup { array unset A - rename getbytes {} rename doit {} } -result 0 +test var-22.2 {leak in parsedVarName} -constraints memory -body { + set i 0 + leaktest {lappend x($i)} +} -cleanup { + unset -nocomplain i x +} -result 0 catch {namespace delete ns} catch {unset arr} catch {unset v} +catch {rename getbytes ""} catch {rename p ""} catch {namespace delete test_ns_var} catch {namespace delete test_ns_var2} -- cgit v0.12 From 35eb3535af4c4a03667bbf2b4fcde538d5e875fe Mon Sep 17 00:00:00 2001 From: dgp Date: Thu, 14 Jul 2016 15:17:58 +0000 Subject: Plug memory leak created in recent variable Tcl_ObjType reform. --- generic/tclVar.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/generic/tclVar.c b/generic/tclVar.c index a9bedd7..091baf8 100644 --- a/generic/tclVar.c +++ b/generic/tclVar.c @@ -577,11 +577,7 @@ TclObjLookupVarEx( } return NULL; } - if ((part2Ptr = part1Ptr->internalRep.twoPtrValue.ptr2)) { - if (createPart2) { - Tcl_IncrRefCount(part2Ptr); - } - } + part2Ptr = part1Ptr->internalRep.twoPtrValue.ptr2; part1Ptr = part1Ptr->internalRep.twoPtrValue.ptr1; typePtr = part1Ptr->typePtr; if (typePtr == &localVarNameType) { @@ -622,9 +618,6 @@ TclObjLookupVarEx( len1 = i; part2Ptr = Tcl_NewStringObj(part2, len2); - if (createPart2) { - Tcl_IncrRefCount(part2Ptr); - } /* * Free the internal rep of the original part1Ptr, now renamed -- cgit v0.12 From 10f81d78ff4d5f5931412700726ce05d14d02fad Mon Sep 17 00:00:00 2001 From: dgp Date: Thu, 14 Jul 2016 17:58:45 +0000 Subject: Stop checking case that can never happen. --- generic/tclNamesp.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/generic/tclNamesp.c b/generic/tclNamesp.c index 5930859..1fef919 100644 --- a/generic/tclNamesp.c +++ b/generic/tclNamesp.c @@ -2883,9 +2883,9 @@ GetNamespaceFromObj( resNamePtr = objPtr->internalRep.twoPtrValue.ptr1; nsPtr = resNamePtr->nsPtr; refNsPtr = resNamePtr->refNsPtr; - if (!(nsPtr->flags & NS_DYING) && (interp == nsPtr->interp) && - (!refNsPtr || ((interp == refNsPtr->interp) && - (refNsPtr== (Namespace *) Tcl_GetCurrentNamespace(interp))))){ + if (!(nsPtr->flags & NS_DYING) && (interp == nsPtr->interp) + && (!refNsPtr || (refNsPtr == + (Namespace *) TclGetCurrentNamespace(interp)))) { *nsPtrPtr = (Tcl_Namespace *) nsPtr; return TCL_OK; } @@ -4779,7 +4779,7 @@ SetNsNameFromAny( if ((name[0] == ':') && (name[1] == ':')) { resNamePtr->refNsPtr = NULL; } else { - resNamePtr->refNsPtr = (Namespace *) Tcl_GetCurrentNamespace(interp); + resNamePtr->refNsPtr = (Namespace *) TclGetCurrentNamespace(interp); } resNamePtr->refCount = 1; TclFreeIntRep(objPtr); -- cgit v0.12 From b136b0307e6b079262352c8541c019519fb34f6e Mon Sep 17 00:00:00 2001 From: dgp Date: Fri, 15 Jul 2016 02:33:11 +0000 Subject: One of the validity checks for the "cmdName" type is to see if the resolved command has been deleted by checking for the CMD_IS_DELETED flag. Only one thing sets this flag -- Tcl_DeleteCommandFromToken(), and every time it sets that flag it also bumps the cmdEpoch of the Command as well. The "cmdName" type is already validating that epoch. It gains nothing to be checking the CMD_IS_DELETED flag too. Eliminated the pointless test. --- generic/tclObj.c | 1 - 1 file changed, 1 deletion(-) diff --git a/generic/tclObj.c b/generic/tclObj.c index 0cd7839..8aaf78e 100644 --- a/generic/tclObj.c +++ b/generic/tclObj.c @@ -4156,7 +4156,6 @@ Tcl_GetCommandFromObj( register Command *cmdPtr = resPtr->cmdPtr; if ((cmdPtr->cmdEpoch == resPtr->cmdEpoch) - && !(cmdPtr->flags & CMD_IS_DELETED) && (interp == cmdPtr->nsPtr->interp) && !(cmdPtr->nsPtr->flags & NS_DYING)) { register Namespace *refNsPtr = (Namespace *) -- cgit v0.12 From 048a4d7e224034d072341b7c9c633801ca9fa19b Mon Sep 17 00:00:00 2001 From: ashok Date: Fri, 15 Jul 2016 03:12:09 +0000 Subject: Fix docs and test failures. I had rolled back .PS1 (Powershell files) as being executable without fixing tests and docs. --- doc/file.n | 2 +- tests/cmdAH.test | 7 ++++--- tests/fileName.test | 4 ++-- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/doc/file.n b/doc/file.n index 58b03d8..2f8b70c 100644 --- a/doc/file.n +++ b/doc/file.n @@ -164,7 +164,7 @@ returns \fB/home\fR (or something similar). Returns \fB1\fR if file \fIname\fR is executable by the current user, \fB0\fR otherwise. On Windows, which does not have an executable attribute, the command treats all directories and any files with extensions -\fBexe\fR, \fBcom\fR, \fBcmd\fR, \fBbat\fR or \fBps1\fR as executable. +\fBexe\fR, \fBcom\fR, \fBcmd\fR or \fBbat\fR as executable. .TP \fBfile exists \fIname\fR . diff --git a/tests/cmdAH.test b/tests/cmdAH.test index 6418aae..b4ef605 100644 --- a/tests/cmdAH.test +++ b/tests/cmdAH.test @@ -882,9 +882,10 @@ test cmdAH-18.3 {Tcl_FileObjCmd: executable} {unix testchmod} { } 1 test cmdAH-18.5 {Tcl_FileObjCmd: executable} -constraints {win} -body { # On pc, must be a .exe, .com, etc. - set x [file exe $gorpfile] + set x {} set gorpexes {} - foreach ext {exe com cmd bat ps1} { + foreach ext {exe com cmd bat} { + lappend x [file exe nosuchfile.$ext] set gorpexe [makeFile foo gorp.$ext] lappend gorpexes $gorpexe lappend x [file exe $gorpexe] [file exe [string toupper $gorpexe]] @@ -894,7 +895,7 @@ test cmdAH-18.5 {Tcl_FileObjCmd: executable} -constraints {win} -body { foreach gorpexe $gorpexes { removeFile $gorpexe } -} -result {0 1 1 1 1 1 1 1 1 1 1} +} -result {0 1 1 0 1 1 0 1 1 0 1 1} test cmdAH-18.6 {Tcl_FileObjCmd: executable} {} { # Directories are always executable. file exe $dirfile diff --git a/tests/fileName.test b/tests/fileName.test index a19bd1e..387d844 100644 --- a/tests/fileName.test +++ b/tests/fileName.test @@ -1468,7 +1468,7 @@ if {[testConstraint testsetplatform]} { } test filename-17.2 {windows specific glob with executable} -body { makeDirectory execglob - foreach ext {exe com cmd bat ps1 notexecutable} { + foreach ext {exe com cmd bat notexecutable} { makeFile contents execglob/abc.$ext } lsort [glob -nocomplain -dir [temporaryDirectory]/execglob -tails -types x *] @@ -1477,7 +1477,7 @@ test filename-17.2 {windows specific glob with executable} -body { removeFile execglob/abc.$ext } removeDirectory execglob -} -result {abc.bat abc.cmd abc.com abc.exe abc.ps1} +} -result {abc.bat abc.cmd abc.com abc.exe} test filename-17.3 {Bug 2571597} win { set p /a file pathtype $p -- cgit v0.12 From cbd642eea303b0db3eec81529c27f2045984f22a Mon Sep 17 00:00:00 2001 From: dkf Date: Fri, 15 Jul 2016 05:39:09 +0000 Subject: [77d58e3a7a] Test case independence: interp. --- tests/interp.test | 47 +++++++++++++++++++++++++++++++++-------------- 1 file changed, 33 insertions(+), 14 deletions(-) diff --git a/tests/interp.test b/tests/interp.test index 4bc9fe2..f9c1aec 100644 --- a/tests/interp.test +++ b/tests/interp.test @@ -71,9 +71,11 @@ test interp-2.2 {basic interpreter creation} { test interp-2.3 {basic interpreter creation} { catch {interp create -safe} } 0 -test interp-2.4 {basic interpreter creation} { - list [catch {interp create a} msg] $msg -} {1 {interpreter named "a" already exists, cannot create}} +test interp-2.4 {basic interpreter creation} -setup { + catch {interp create a} +} -returnCodes error -body { + interp create a +} -result {interpreter named "a" already exists, cannot create} test interp-2.5 {basic interpreter creation} { interp create b -safe } b @@ -89,11 +91,13 @@ test interp-2.8 {basic interpreter creation} { test interp-2.9 {basic interpreter creation} { interp create -safe -- -froboz1 } -froboz1 -test interp-2.10 {basic interpreter creation} { +test interp-2.10 {basic interpreter creation} -setup { + catch {interp create a} +} -body { interp create {a x1} interp create {a x2} interp create {a x3} -safe -} {a x3} +} -result {a x3} test interp-2.11 {anonymous interps vs existing procs} { set x [interp create] regexp "interp(\[0-9]+)" $x dummy thenum @@ -140,19 +144,26 @@ test interp-3.5 {testing interp exists and interp slaves} -body { test interp-3.6 {testing interp exists and interp slaves} { interp exists } 1 -test interp-3.7 {testing interp exists and interp slaves} { +test interp-3.7 {testing interp exists and interp slaves} -setup { + catch {interp create a} +} -body { interp slaves -} a +} -result a test interp-3.8 {testing interp exists and interp slaves} -body { interp slaves a b c } -returnCodes error -result {wrong # args: should be "interp slaves ?path?"} -test interp-3.9 {testing interp exists and interp slaves} { +test interp-3.9 {testing interp exists and interp slaves} -setup { + catch {interp create a} +} -body { interp create {a a2} -safe expr {"a2" in [interp slaves a]} -} 1 -test interp-3.10 {testing interp exists and interp slaves} { +} -result 1 +test interp-3.10 {testing interp exists and interp slaves} -setup { + catch {interp create a} + catch {interp create {a a2}} +} -body { interp exists {a a2} -} 1 +} -result 1 # Part 3: Testing "interp delete" test interp-3.11 {testing interp delete} { @@ -222,6 +233,7 @@ test interp-6.3 {testing eval} { a eval {proc foo {} {expr 3 + 5}} a eval foo } 8 +catch {a eval {proc foo {} {expr 3 + 5}}} test interp-6.4 {testing eval} { interp eval a foo } 8 @@ -230,6 +242,7 @@ test interp-6.5 {testing eval} { interp eval {a x2} {proc frob {} {expr 4 * 9}} interp eval {a x2} frob } 36 +catch {interp create {a x2}} test interp-6.6 {testing eval} -returnCodes error -body { interp eval {a x2} foo } -result {invalid command name "foo"} @@ -243,9 +256,11 @@ proc in_master {args} { test interp-7.1 {testing basic alias creation} { a alias foo in_master } foo +catch {a alias foo in_master} test interp-7.2 {testing basic alias creation} { a alias bar in_master a1 a2 a3 } bar +catch {a alias bar in_master a1 a2 a3} # Test 6.3 has been deleted. test interp-7.3 {testing basic alias creation} { a alias foo @@ -476,9 +491,13 @@ test interp-13.4 {testing issafe arg checking} { } {1 {wrong # args: should be "a issafe"}} # part 14: testing interp aliases -test interp-14.1 {testing interp aliases} { - interp aliases -} "" +test interp-14.1 {testing interp aliases} -setup { + interp create abc +} -body { + interp eval abc {interp aliases} +} -cleanup { + interp delete abc +} -result "" test interp-14.2 {testing interp aliases} { catch {interp delete a} interp create a -- cgit v0.12 From 059c3bec3a774772ceff7fc2fcc5c7bf690ab8cf Mon Sep 17 00:00:00 2001 From: dgp Date: Fri, 15 Jul 2016 12:36:33 +0000 Subject: Stop using the tclCmdNameType to store failed command lookups. If we don't find a command, there's nothing to store, so better not to shimmer at all. --- generic/tclObj.c | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/generic/tclObj.c b/generic/tclObj.c index 8aaf78e..e335ac3 100644 --- a/generic/tclObj.c +++ b/generic/tclObj.c @@ -4152,7 +4152,7 @@ Tcl_GetCommandFromObj( */ resPtr = objPtr->internalRep.twoPtrValue.ptr1; - if ((objPtr->typePtr == &tclCmdNameType) && (resPtr != NULL)) { + if (objPtr->typePtr == &tclCmdNameType) { register Command *cmdPtr = resPtr->cmdPtr; if ((cmdPtr->cmdEpoch == resPtr->cmdEpoch) @@ -4281,7 +4281,6 @@ FreeCmdNameInternalRep( { register ResolvedCmdName *resPtr = objPtr->internalRep.twoPtrValue.ptr1; - if (resPtr != NULL) { /* * Decrement the reference count of the ResolvedCmdName structure. If * there are no more uses, free the ResolvedCmdName structure. @@ -4299,7 +4298,6 @@ FreeCmdNameInternalRep( TclCleanupCommandMacro(cmdPtr); ckfree(resPtr); } - } objPtr->typePtr = NULL; } @@ -4332,9 +4330,7 @@ DupCmdNameInternalRep( copyPtr->internalRep.twoPtrValue.ptr1 = resPtr; copyPtr->internalRep.twoPtrValue.ptr2 = NULL; - if (resPtr != NULL) { resPtr->refCount++; - } copyPtr->typePtr = &tclCmdNameType; } @@ -4387,16 +4383,23 @@ SetCmdNameFromAny( Tcl_FindCommand(interp, name, /*ns*/ NULL, /*flags*/ 0); /* + * Stop shimmering and caching nothing when we found nothing. Just + * report the failure to find the command as an error. + */ + + if (cmdPtr == NULL) { + return TCL_ERROR; + } + + /* * Free the old internalRep before setting the new one. Do this after * getting the string rep to allow the conversion code (in particular, * Tcl_GetStringFromObj) to use that old internalRep. */ - if (cmdPtr) { cmdPtr->refCount++; resPtr = objPtr->internalRep.twoPtrValue.ptr1; - if ((objPtr->typePtr == &tclCmdNameType) - && resPtr && (resPtr->refCount == 1)) { + if ((objPtr->typePtr == &tclCmdNameType) && (resPtr->refCount == 1)) { /* * Reuse the old ResolvedCmdName struct instead of freeing it */ @@ -4434,12 +4437,6 @@ SetCmdNameFromAny( resPtr->refNsId = currNsPtr->nsId; resPtr->refNsCmdEpoch = currNsPtr->cmdRefEpoch; } - } else { - TclFreeIntRep(objPtr); - objPtr->internalRep.twoPtrValue.ptr1 = NULL; - objPtr->internalRep.twoPtrValue.ptr2 = NULL; - objPtr->typePtr = &tclCmdNameType; - } return TCL_OK; } -- cgit v0.12 From ed70e9d86101ea6352b6623c9ca09ef68749abd9 Mon Sep 17 00:00:00 2001 From: dgp Date: Fri, 15 Jul 2016 14:19:07 +0000 Subject: Factor the cmdName intrep setting code into common utility routine. --- generic/tclObj.c | 138 +++++++++++++++++++++++++------------------------------ 1 file changed, 63 insertions(+), 75 deletions(-) diff --git a/generic/tclObj.c b/generic/tclObj.c index e335ac3..b145d7e 100644 --- a/generic/tclObj.c +++ b/generic/tclObj.c @@ -4203,54 +4203,73 @@ Tcl_GetCommandFromObj( *---------------------------------------------------------------------- */ -void -TclSetCmdNameObj( - Tcl_Interp *interp, /* Points to interpreter containing command - * that should be cached in objPtr. */ - register Tcl_Obj *objPtr, /* Points to Tcl object to be changed to a - * CmdName object. */ - Command *cmdPtr) /* Points to Command structure that the - * CmdName object should refer to. */ +static void +SetCmdNameObj( + Tcl_Interp *interp, + Tcl_Obj *objPtr, + Command *cmdPtr, + ResolvedCmdName *resPtr) { Interp *iPtr = (Interp *) interp; - register ResolvedCmdName *resPtr; - register Namespace *currNsPtr; - const char *name; + ResolvedCmdName *fillPtr; + const char *name = TclGetString(objPtr); - if (objPtr->typePtr == &tclCmdNameType) { - return; + if (resPtr) { + fillPtr = resPtr; + } else { + fillPtr = ckalloc(sizeof(ResolvedCmdName)); + fillPtr->refCount = 1; } + fillPtr->cmdPtr = cmdPtr; cmdPtr->refCount++; - resPtr = ckalloc(sizeof(ResolvedCmdName)); - resPtr->cmdPtr = cmdPtr; - resPtr->cmdEpoch = cmdPtr->cmdEpoch; - resPtr->refCount = 1; + fillPtr->cmdEpoch = cmdPtr->cmdEpoch; - name = TclGetString(objPtr); - if ((*name++ == ':') && (*name == ':')) { + /* NOTE: relying on NULL termination here. */ + if ((name[0] == ':') && (name[1] == ':')) { /* - * The name is fully qualified: set the referring namespace to - * NULL. + * Fully qualified names always resolve to same thing. No need + * to record resolution context information. */ - resPtr->refNsPtr = NULL; + fillPtr->refNsPtr = NULL; + fillPtr->refNsId = 0; /* Will not be read */ + fillPtr->refNsCmdEpoch = 0; /* Will not be read */ } else { /* - * Get the current namespace. + * Record current state of current namespace as the resolution + * context of this command name lookup. */ + Namespace *currNsPtr = iPtr->varFramePtr->nsPtr; - currNsPtr = iPtr->varFramePtr->nsPtr; + fillPtr->refNsPtr = currNsPtr; + fillPtr->refNsId = currNsPtr->nsId; + fillPtr->refNsCmdEpoch = currNsPtr->cmdRefEpoch; + } - resPtr->refNsPtr = currNsPtr; - resPtr->refNsId = currNsPtr->nsId; - resPtr->refNsCmdEpoch = currNsPtr->cmdRefEpoch; + if (resPtr == NULL) { + TclFreeIntRep(objPtr); + + objPtr->internalRep.twoPtrValue.ptr1 = fillPtr; + objPtr->internalRep.twoPtrValue.ptr2 = NULL; + objPtr->typePtr = &tclCmdNameType; } +} - TclFreeIntRep(objPtr); - objPtr->internalRep.twoPtrValue.ptr1 = resPtr; - objPtr->internalRep.twoPtrValue.ptr2 = NULL; - objPtr->typePtr = &tclCmdNameType; +void +TclSetCmdNameObj( + Tcl_Interp *interp, /* Points to interpreter containing command + * that should be cached in objPtr. */ + register Tcl_Obj *objPtr, /* Points to Tcl object to be changed to a + * CmdName object. */ + Command *cmdPtr) /* Points to Command structure that the + * CmdName object should refer to. */ +{ + if (objPtr->typePtr == &tclCmdNameType) { + return; + } + + SetCmdNameObj(interp, objPtr, cmdPtr, NULL); } /* @@ -4360,10 +4379,8 @@ SetCmdNameFromAny( Tcl_Interp *interp, /* Used for error reporting if not NULL. */ register Tcl_Obj *objPtr) /* The object to convert. */ { - Interp *iPtr = (Interp *) interp; const char *name; register Command *cmdPtr; - Namespace *currNsPtr; register ResolvedCmdName *resPtr; if (interp == NULL) { @@ -4391,52 +4408,23 @@ SetCmdNameFromAny( return TCL_ERROR; } - /* - * Free the old internalRep before setting the new one. Do this after - * getting the string rep to allow the conversion code (in particular, - * Tcl_GetStringFromObj) to use that old internalRep. - */ - - cmdPtr->refCount++; - resPtr = objPtr->internalRep.twoPtrValue.ptr1; - if ((objPtr->typePtr == &tclCmdNameType) && (resPtr->refCount == 1)) { - /* - * Reuse the old ResolvedCmdName struct instead of freeing it - */ + resPtr = objPtr->internalRep.twoPtrValue.ptr1; + if ((objPtr->typePtr == &tclCmdNameType) && (resPtr->refCount == 1)) { + /* + * Re-use existing ResolvedCmdName struct when possible. + * Cleanup the old fields that need it. + */ - Command *oldCmdPtr = resPtr->cmdPtr; + Command *oldCmdPtr = resPtr->cmdPtr; - if (--oldCmdPtr->refCount == 0) { - TclCleanupCommandMacro(oldCmdPtr); - } - } else { - TclFreeIntRep(objPtr); - resPtr = ckalloc(sizeof(ResolvedCmdName)); - resPtr->refCount = 1; - objPtr->internalRep.twoPtrValue.ptr1 = resPtr; - objPtr->internalRep.twoPtrValue.ptr2 = NULL; - objPtr->typePtr = &tclCmdNameType; + if (--oldCmdPtr->refCount == 0) { + TclCleanupCommandMacro(oldCmdPtr); } - resPtr->cmdPtr = cmdPtr; - resPtr->cmdEpoch = cmdPtr->cmdEpoch; - if ((*name++ == ':') && (*name == ':')) { - /* - * The name is fully qualified: set the referring namespace to - * NULL. - */ - - resPtr->refNsPtr = NULL; - } else { - /* - * Get the current namespace. - */ - - currNsPtr = iPtr->varFramePtr->nsPtr; + } else { + resPtr = NULL; + } - resPtr->refNsPtr = currNsPtr; - resPtr->refNsId = currNsPtr->nsId; - resPtr->refNsCmdEpoch = currNsPtr->cmdRefEpoch; - } + SetCmdNameObj(interp, objPtr, cmdPtr, resPtr); return TCL_OK; } -- cgit v0.12 From 9cc388df3d06570e47d68f284a74f4fa26b45426 Mon Sep 17 00:00:00 2001 From: dgp Date: Fri, 15 Jul 2016 14:20:34 +0000 Subject: Remove unmaintained disabled speculative code. Such things are for branches and history. --- generic/tclProc.c | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/generic/tclProc.c b/generic/tclProc.c index 81d3b25..bed520a 100644 --- a/generic/tclProc.c +++ b/generic/tclProc.c @@ -2654,30 +2654,6 @@ TclNRApplyObjCmd( procPtr = lambdaPtr->internalRep.twoPtrValue.ptr1; } -#define JOE_EXTENSION 0 -/* - * Note: this code is NOT FUNCTIONAL due to the NR implementation; DO NOT - * ENABLE! Leaving here as reminder to (a) TIP the suggestion, and (b) adapt - * the code. (MS) - */ - -#if JOE_EXTENSION - else { - /* - * Joe English's suggestion to allow cmdNames to function as lambdas. - */ - - Tcl_Obj *elemPtr; - int numElem; - - if ((lambdaPtr->typePtr == &tclCmdNameType) || - (TclListObjGetElements(interp, lambdaPtr, &numElem, - &elemPtr) == TCL_OK && numElem == 1)) { - return Tcl_EvalObjv(interp, objc-1, objv+1, 0); - } - } -#endif - if ((procPtr == NULL) || (procPtr->iPtr != iPtr)) { result = SetLambdaFromAny(interp, lambdaPtr); if (result != TCL_OK) { -- cgit v0.12 From 9015a7b063d96172512c54d84395d2b260d4d330 Mon Sep 17 00:00:00 2001 From: dkf Date: Sat, 16 Jul 2016 11:42:38 +0000 Subject: [77d58e3a7a] Test case independence: io, load, msgcat, namespace, safe. --- tests/io.test | 16 ++++++++++++++-- tests/load.test | 54 ++++++++++++++++++++++++++++++++++------------------ tests/msgcat.test | 11 +++++++++-- tests/namespace.test | 13 ++++++++----- tests/safe.test | 20 ++++++------------- 5 files changed, 72 insertions(+), 42 deletions(-) diff --git a/tests/io.test b/tests/io.test index 6b6ad6d..9573cc6 100644 --- a/tests/io.test +++ b/tests/io.test @@ -4285,6 +4285,13 @@ test io-33.4 {Tcl_Gets with long line} { close $f set x } {abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ} +set f [open $path(test3) w] +puts -nonewline $f "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" +puts -nonewline $f "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" +puts -nonewline $f "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" +puts -nonewline $f "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" +puts $f "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" +close $f test io-33.5 {Tcl_Gets with long line} { set f [open $path(test3)] set x [gets $f y] @@ -7141,7 +7148,12 @@ test io-52.10 {TclCopyChannel & encodings} {fcopy} { file size $path(utf8-fcopy.txt) } 5 -test io-52.11 {TclCopyChannel & encodings} {fcopy} { +test io-52.11 {TclCopyChannel & encodings} -setup { + set out [open $path(utf8-fcopy.txt) w] + fconfigure $out -encoding utf-8 -translation lf + puts $out "\u0410\u0410" + close $out +} -constraints {fcopy} -body { # binary to encoding => the input has to be # in utf-8 to make sense to the encoder @@ -7157,7 +7169,7 @@ test io-52.11 {TclCopyChannel & encodings} {fcopy} { close $out file size $path(kyrillic.txt) -} 3 +} -result 3 test io-52.12 {coverage of -translation auto} { file delete $path(test1) $path(test2) diff --git a/tests/load.test b/tests/load.test index 9536271..7c4b47f 100644 --- a/tests/load.test +++ b/tests/load.test @@ -124,9 +124,11 @@ test load-3.2 {error in _Init procedure, slave interpreter} \ test load-4.1 {reloading package into same interpreter} [list $dll $loaded] { list [catch {load [file join $testDir pkga$ext] pkga} msg] $msg } {0 {}} -test load-4.2 {reloading package into same interpreter} [list $dll $loaded] { - list [catch {load [file join $testDir pkga$ext] pkgb} msg] $msg -} [list 1 "file \"[file join $testDir pkga$ext]\" is already loaded for package \"Pkga\""] +test load-4.2 {reloading package into same interpreter} -setup { + catch {load [file join $testDir pkga$ext] pkga} +} -constraints [list $dll $loaded] -returnCodes error -body { + load [file join $testDir pkga$ext] pkgb +} -result "file \"[file join $testDir pkga$ext]\" is already loaded for package \"Pkga\"" test load-5.1 {file name not specified and no static package: pick default} \ [list $dll $loaded] { @@ -169,26 +171,40 @@ test load-7.3 {Tcl_StaticPackage procedure} [list teststaticpkg] { load {} More set x } {not loaded} -test load-7.4 {Tcl_StaticPackage procedure, redundant calls} \ - [list teststaticpkg $dll $loaded] { - teststaticpkg Double 0 1 - teststaticpkg Double 0 1 - info loaded - } [concat [list {{} Double} {{} More} {{} Another} {{} Test} [list [file join $testDir pkge$ext] Pkge] [list [file join $testDir pkgb$ext] Pkgb] [list [file join $testDir pkga$ext] Pkga]] $alreadyTotalLoaded] +catch {load [file join $testDir pkga$ext] pkga} +catch {load [file join $testDir pkgb$ext] pkgb} +catch {load [file join $testDir pkge$ext] pkge} +set currentRealPackages [list [list [file join $testDir pkge$ext] Pkge] [list [file join $testDir pkgb$ext] Pkgb] [list [file join $testDir pkga$ext] Pkga]] +test load-7.4 {Tcl_StaticPackage procedure, redundant calls} -setup { + teststaticpkg Test 1 0 + teststaticpkg Another 0 0 + teststaticpkg More 0 1 +} -constraints [list teststaticpkg $dll $loaded] -body { + teststaticpkg Double 0 1 + teststaticpkg Double 0 1 + info loaded +} -result [list {{} Double} {{} More} {{} Another} {{} Test} {*}$currentRealPackages {*}$alreadyTotalLoaded] +teststaticpkg Test 1 1 +teststaticpkg Another 0 1 +teststaticpkg More 0 1 +teststaticpkg Double 0 1 test load-8.1 {TclGetLoadedPackages procedure} [list teststaticpkg $dll $loaded] { - info loaded -} [concat [list {{} Double} {{} More} {{} Another} {{} Test} [list [file join $testDir pkge$ext] Pkge] [list [file join $testDir pkgb$ext] Pkgb] [list [file join $testDir pkga$ext] Pkga]] $alreadyTotalLoaded] -test load-8.2 {TclGetLoadedPackages procedure} [list teststaticpkg] { - list [catch {info loaded gorp} msg] $msg -} {1 {could not find interpreter "gorp"}} -test load-8.3 {TclGetLoadedPackages procedure} [list teststaticpkg $dll $loaded] { - list [info loaded {}] [info loaded child] -} [list [concat [list {{} Double} {{} More} {{} Another} {{} Test} [list [file join $testDir pkga$ext] Pkga]] $alreadyLoaded] [list {{} Test} [list [file join $testDir pkgb$ext] Pkgb]]] + lsort -index 1 [info loaded] +} [lsort -index 1 [list {{} Double} {{} More} {{} Another} {{} Test} {*}$currentRealPackages {*}$alreadyTotalLoaded]] +test load-8.2 {TclGetLoadedPackages procedure} -body { + info loaded gorp +} -returnCodes error -result {could not find interpreter "gorp"} +test load-8.3a {TclGetLoadedPackages procedure} [list teststaticpkg $dll $loaded] { + lsort -index 1 [info loaded {}] +} [lsort -index 1 [list {{} Double} {{} More} {{} Another} {{} Test} [list [file join $testDir pkga$ext] Pkga] [list [file join $testDir pkgb$ext] Pkgb] {*}$alreadyLoaded]] +test load-8.3b {TclGetLoadedPackages procedure} [list teststaticpkg $dll $loaded] { + lsort -index 1 [info loaded child] +} [lsort -index 1 [list {{} Test} [list [file join $testDir pkgb$ext] Pkgb]]] test load-8.4 {TclGetLoadedPackages procedure} [list $dll $loaded teststaticpkg] { load [file join $testDir pkgb$ext] pkgb - list [info loaded {}] [lsort [info commands pkgb_*]] -} [list [concat [list [list [file join $testDir pkgb$ext] Pkgb] {{} Double} {{} More} {{} Another} {{} Test} [list [file join $testDir pkga$ext] Pkga]] $alreadyLoaded] {pkgb_demo pkgb_sub pkgb_unsafe}] + list [lsort -index 1 [info loaded {}]] [lsort [info commands pkgb_*]] +} [list [lsort -index 1 [concat [list [list [file join $testDir pkgb$ext] Pkgb] {{} Double} {{} More} {{} Another} {{} Test} [list [file join $testDir pkga$ext] Pkga]] $alreadyLoaded]] {pkgb_demo pkgb_sub pkgb_unsafe}] interp delete child test load-9.1 {Tcl_StaticPackage, load already-loaded package into another interp} \ diff --git a/tests/msgcat.test b/tests/msgcat.test index 8647f9c..ae35272 100644 --- a/tests/msgcat.test +++ b/tests/msgcat.test @@ -68,6 +68,7 @@ namespace eval ::msgcat::test { set result c } } + test msgcat-0.$count [list \ locale initialization from environment variables $setVars \ ] -setup { @@ -973,7 +974,10 @@ namespace eval ::msgcat::test { } set bgerrorsaved [interp bgerror {}] interp bgerror {} [namespace code callbackproc] - + + variable locale + if {![info exist locale]} { set locale [mclocale] } + test msgcat-14.1 {invokation loadcmd} -setup { mcforgetpackage mclocale $locale @@ -1068,7 +1072,7 @@ namespace eval ::msgcat::test { mc k1 } -returnCodes 1\ -result {fail} - + interp bgerror {} $bgerrorsaved cleanupTests @@ -1076,3 +1080,6 @@ namespace eval ::msgcat::test { namespace delete ::msgcat::test return +# Local Variables: +# mode: tcl +# End: diff --git a/tests/namespace.test b/tests/namespace.test index 55505f1..de7009d 100644 --- a/tests/namespace.test +++ b/tests/namespace.test @@ -846,6 +846,7 @@ test namespace-17.1 {Tcl_FindNamespaceVar, absolute name found} -setup { set ::x } } -result {314159} +variable ::x 314159 test namespace-17.2 {Tcl_FindNamespaceVar, absolute name found} { namespace eval test_ns_1 { variable x 777 @@ -889,23 +890,25 @@ test namespace-17.6 {Tcl_FindNamespaceVar, relative name found} -setup { } -result {777} test namespace-17.7 {Tcl_FindNamespaceVar, relative name found} { namespace eval test_ns_1 { + variable x 777 unset x set x ;# must be global x now } } {314159} -test namespace-17.8 {Tcl_FindNamespaceVar, relative name not found} { +test namespace-17.8 {Tcl_FindNamespaceVar, relative name not found} -body { namespace eval test_ns_1 { - list [catch {set wuzzat} msg] $msg + set wuzzat } -} {1 {can't read "wuzzat": no such variable}} +} -returnCodes error -result {can't read "wuzzat": no such variable} test namespace-17.9 {Tcl_FindNamespaceVar, relative name and TCL_GLOBAL_ONLY} { namespace eval test_ns_1 { variable a hello } set test_ns_1::a } {hello} -test namespace-17.10 {Tcl_FindNamespaceVar, interference with cached varNames} { +test namespace-17.10 {Tcl_FindNamespaceVar, interference with cached varNames} -setup { namespace eval test_ns_1 {} +} -body { proc test_ns {} { set ::test_ns_1::a 0 } @@ -916,7 +919,7 @@ test namespace-17.10 {Tcl_FindNamespaceVar, interference with cached varNames} { namespace eval test_ns_1 set a 1 namespace delete test_ns_1 return $a -} 1 +} -result 1 catch {unset a} catch {unset x} diff --git a/tests/safe.test b/tests/safe.test index 94c1755..6c9c6c9 100644 --- a/tests/safe.test +++ b/tests/safe.test @@ -211,8 +211,8 @@ test safe-7.3 {check that safe subinterpreters work} { } {ok {} 0} # test source control on file name +set i "a" test safe-8.1 {safe source control on file} -setup { - set i "a" catch {safe::interpDelete $i} } -body { safe::interpCreate $i @@ -221,7 +221,6 @@ test safe-8.1 {safe source control on file} -setup { safe::interpDelete $i } -result {wrong # args: should be "source ?-encoding E? fileName"} test safe-8.2 {safe source control on file} -setup { - set i "a" catch {safe::interpDelete $i} } -body { safe::interpCreate $i @@ -230,7 +229,6 @@ test safe-8.2 {safe source control on file} -setup { safe::interpDelete $i } -result {wrong # args: should be "source ?-encoding E? fileName"} test safe-8.3 {safe source control on file} -setup { - set i "a" catch {safe::interpDelete $i} set log {} proc safe-test-log {str} {lappend ::log $str} @@ -245,7 +243,6 @@ test safe-8.3 {safe source control on file} -setup { safe::interpDelete $i } -result {1 {permission denied} {{ERROR for slave a : ".": is a directory}}} test safe-8.4 {safe source control on file} -setup { - set i "a" catch {safe::interpDelete $i} set log {} proc safe-test-log {str} {global log; lappend log $str} @@ -260,7 +257,6 @@ test safe-8.4 {safe source control on file} -setup { safe::interpDelete $i } -result {1 {permission denied} {{ERROR for slave a : "/abc/def": not in access_path}}} test safe-8.5 {safe source control on file} -setup { - set i "a" catch {safe::interpDelete $i} set log {} proc safe-test-log {str} {global log; lappend log $str} @@ -279,7 +275,6 @@ test safe-8.5 {safe source control on file} -setup { safe::interpDelete $i } -result [list 1 {no such file or directory} [list "ERROR for slave a : [file join [info library] blah]:no such file or directory"]] test safe-8.6 {safe source control on file} -setup { - set i "a" catch {safe::interpDelete $i} set log {} proc safe-test-log {str} {global log; lappend log $str} @@ -296,7 +291,6 @@ test safe-8.6 {safe source control on file} -setup { safe::interpDelete $i } -result [list 1 {no such file or directory} [list "ERROR for slave a : [file join [info library] blah.tcl]:no such file or directory"]] test safe-8.7 {safe source control on file} -setup { - set i "a" catch {safe::interpDelete $i} set log {} proc safe-test-log {str} {global log; lappend log $str} @@ -315,7 +309,6 @@ test safe-8.7 {safe source control on file} -setup { safe::interpDelete $i } -result [list 1 {no such file or directory} [list "ERROR for slave a : [file join [info library] xxxxxxxxxxx.tcl]:no such file or directory"]] test safe-8.8 {safe source forbids -rsrc} -setup { - set i "a" catch {safe::interpDelete $i} safe::interpCreate $i } -body { @@ -349,8 +342,8 @@ test safe-8.10 {safe source and return} -setup { removeFile $returnScript } -result ok +set i "a" test safe-9.1 {safe interps' deleteHook} -setup { - set i "a" catch {safe::interpDelete $i} set res {} } -body { @@ -365,7 +358,6 @@ test safe-9.1 {safe interps' deleteHook} -setup { list [interp eval $i exit] $res } -result {{} {arg1 arg2 a}} test safe-9.2 {safe interps' error in deleteHook} -setup { - set i "a" catch {safe::interpDelete $i} set res {} set log {} @@ -531,14 +523,14 @@ test safe-11.7.1 {testing safe encoding} -setup { } -body { catch {interp eval $i encoding convertfrom} m o dict get $o -errorinfo -} -returnCodes ok -cleanup { +} -returnCodes ok -match glob -cleanup { unset -nocomplain m o safe::interpDelete $i } -result {wrong # args: should be "encoding convertfrom ?encoding? data" while executing "encoding convertfrom" invoked from within -"::interp invokehidden interp1 encoding convertfrom" +"::interp invokehidden interp* encoding convertfrom" invoked from within "encoding convertfrom" invoked from within @@ -555,14 +547,14 @@ test safe-11.8.1 {testing safe encoding} -setup { } -body { catch {interp eval $i encoding convertto} m o dict get $o -errorinfo -} -returnCodes ok -cleanup { +} -returnCodes ok -match glob -cleanup { unset -nocomplain m o safe::interpDelete $i } -result {wrong # args: should be "encoding convertto ?encoding? data" while executing "encoding convertto" invoked from within -"::interp invokehidden interp1 encoding convertto" +"::interp invokehidden interp* encoding convertto" invoked from within "encoding convertto" invoked from within -- cgit v0.12 From 812e86e692342eea4435ae5eb01bce552c7350e2 Mon Sep 17 00:00:00 2001 From: dkf Date: Sun, 17 Jul 2016 11:56:28 +0000 Subject: [77d58e3a7a] Test case independence: unload. --- tests/tcltest.test | 7 ++- tests/unload.test | 170 +++++++++++++++++++++++++++++++++++++---------------- 2 files changed, 125 insertions(+), 52 deletions(-) diff --git a/tests/tcltest.test b/tests/tcltest.test index e66678b..728a018 100644 --- a/tests/tcltest.test +++ b/tests/tcltest.test @@ -46,6 +46,7 @@ makeFile { cd [temporaryDirectory] testConstraint exec [llength [info commands exec]] + # test -help # Child processes because -help [exit]s. test tcltest-1.1 {tcltest -help} {exec} { @@ -1824,9 +1825,13 @@ test tcltest-26.2 {Bug/RFE 1017151} -setup { ---- errorInfo: body error * ---- errorInfo(cleanup): cleanup error*} - + cleanupTests } namespace delete ::tcltest::test return + +# Local Variables: +# mode: tcl +# End: diff --git a/tests/unload.test b/tests/unload.test index 5a374c4..73f1091 100644 --- a/tests/unload.test +++ b/tests/unload.test @@ -45,6 +45,14 @@ testConstraint teststaticpkg [llength [info commands teststaticpkg]] testConstraint testsimplefilesystem \ [llength [info commands testsimplefilesystem]] +proc loadIfNotPresent {pkg args} { + global testDir ext + set loaded [lmap x [info loaded {*}$args] {lindex $x 1}] + if {[string totitle $pkg] ni $loaded} { + load [file join $testDir $pkg$ext] + } +} + # Basic tests: parameter testing... test unload-1.1 {basic errors} -returnCodes error -body { unload @@ -73,7 +81,7 @@ set pkgua_detached {} set pkgua_unloaded {} # Tests for loading/unloading in trusted (non-safe) interpreters... test unload-2.1 {basic loading of non-unloadable package, with guess for package name} [list $dll $loaded] { - load [file join $testDir pkga$ext] + loadIfNotPresent pkga list [pkga_eq abc def] [lsort [info commands pkga_*]] } {0 {pkga_eq pkga_quote}} test unload-2.2 {basic loading of unloadable package, with guess for package name} [list $dll $loaded] { @@ -82,28 +90,43 @@ test unload-2.2 {basic loading of unloadable package, with guess for package nam [pkgua_eq abc def] [lsort [info commands pkgua_*]] \ $pkgua_loaded $pkgua_detached $pkgua_unloaded } {{} {} {} {} 0 {pkgua_eq pkgua_quote} . {} {}} -test unload-2.3 {basic unloading of non-unloadable package, with guess for package name} [list $dll $loaded] { - list [catch {unload [file join $testDir pkga$ext]} msg] \ - [string map [list [file join $testDir pkga$ext] file] $msg] -} {1 {file "file" cannot be unloaded under a trusted interpreter}} -test unload-2.4 {basic unloading of unloadable package, with guess for package name} [list $dll $loaded] { +test unload-2.3 {basic unloading of non-unloadable package, with guess for package name} -setup { + loadIfNotPresent pkga +} -constraints [list $dll $loaded] -returnCodes error -match glob -body { + unload [file join $testDir pkga$ext] +} -result {file "*" cannot be unloaded under a trusted interpreter} +test unload-2.4 {basic unloading of unloadable package, with guess for package name} -setup { + loadIfNotPresent pkgua +} -constraints [list $dll $loaded] -body { list $pkgua_loaded $pkgua_detached $pkgua_unloaded \ [unload [file join $testDir pkgua$ext]] \ [info commands pkgua_*] \ $pkgua_loaded $pkgua_detached $pkgua_unloaded -} {. {} {} {} {} . . .} -test unload-2.5 {reloading of unloaded package, with guess for package name} [list $dll $loaded] { +} -result {. {} {} {} {} . . .} +test unload-2.5 {reloading of unloaded package, with guess for package name} -setup { + if {$pkgua_loaded eq ""} { + loadIfNotPresent pkgua + unload [file join $testDir pkgua$ext] + } +} -constraints [list $dll $loaded] -body { list $pkgua_loaded $pkgua_detached $pkgua_unloaded \ [load [file join $testDir pkgua$ext]] \ [pkgua_eq abc def] [lsort [info commands pkgua_*]] \ $pkgua_loaded $pkgua_detached $pkgua_unloaded -} {. . . {} 0 {pkgua_eq pkgua_quote} .. . .} -test unload-2.6 {basic unloading of re-loaded package, with guess for package name} [list $dll $loaded] { +} -result {. . . {} 0 {pkgua_eq pkgua_quote} .. . .} +test unload-2.6 {basic unloading of re-loaded package, with guess for package name} -setup { + # Establish expected state + if {$pkgua_loaded eq ""} { + loadIfNotPresent pkgua + unload [file join $testDir pkgua$ext] + load [file join $testDir pkgua$ext] + } +} -constraints [list $dll $loaded] -body { list $pkgua_loaded $pkgua_detached $pkgua_unloaded \ [unload [file join $testDir pkgua$ext]] \ [info commands pkgua_*] \ $pkgua_loaded $pkgua_detached $pkgua_unloaded -} {.. . . {} {} .. .. ..} +} -result {.. . . {} {} .. .. ..} # Tests for loading/unloading in safe interpreters... interp create -safe child @@ -127,38 +150,52 @@ test unload-3.2 {basic loading of unloadable package in a safe interpreter, with [lsort [child eval info commands pkgua_*]] \ [child eval {list $pkgua_loaded $pkgua_detached $pkgua_unloaded}] } {{{} {} {}} {} 0 {pkgua_eq pkgua_quote} {. {} {}}} -test unload-3.3 {unloading of a package that has never been loaded from a safe interpreter} \ - [list $dll $loaded] { - list [catch {unload [file join $testDir pkga$ext] {} child} msg] \ - [string map [list [file join $testDir pkga$ext] file] $msg] -} {1 {file "file" has never been loaded in this interpreter}} -test unload-3.4 {basic unloading of a non-unloadable package from a safe interpreter, with guess for package name} \ - [list $dll $loaded] { - list [catch {unload [file join $testDir pkgb$ext] {} child} msg] \ - [string map [list [file join $testDir pkgb$ext] file] $msg] -} {1 {file "file" cannot be unloaded under a safe interpreter}} -test unload-3.5 {basic unloading of an unloadable package from a safe interpreter, with guess for package name} \ - [list $dll $loaded] { +test unload-3.3 {unloading of a package that has never been loaded from a safe interpreter} -setup { + loadIfNotPresent pkga +} -constraints [list $dll $loaded] -returnCodes error -match glob -body { + unload [file join $testDir pkga$ext] {} child +} -result {file "*" has never been loaded in this interpreter} +test unload-3.4 {basic unloading of a non-unloadable package from a safe interpreter, with guess for package name} -setup { + if {[lsearch -index 1 [info loaded child] Pkgb] == -1} { + load [file join $testDir pkgb$ext] pKgB child + } +} -constraints [list $dll $loaded] -returnCodes error -match glob -body { + unload [file join $testDir pkgb$ext] {} child +} -result {file "*" cannot be unloaded under a safe interpreter} +test unload-3.5 {basic unloading of an unloadable package from a safe interpreter, with guess for package name} -setup { + if {[lsearch -index 1 [info loaded child] Pkgua] == -1} { + load [file join $testDir pkgua$ext] pkgua child + } +} -constraints [list $dll $loaded] -body { list [child eval {list $pkgua_loaded $pkgua_detached $pkgua_unloaded}] \ [unload [file join $testDir pkgua$ext] {} child] \ [child eval info commands pkgua_*] \ [child eval {list $pkgua_loaded $pkgua_detached $pkgua_unloaded}] -} {{. {} {}} {} {} {. . .}} -test unload-3.6 {reloading of unloaded package in a safe interpreter, with guess for package name} \ - [list $dll $loaded] { +} -result {{. {} {}} {} {} {. . .}} +test unload-3.6 {reloading of unloaded package in a safe interpreter, with guess for package name} -setup { + if {[child eval set pkgua_loaded] eq ""} { + load [file join $testDir pkgua$ext] {} child + unload [file join $testDir pkgua$ext] {} child + } +} -constraints [list $dll $loaded] -body { list [child eval {list $pkgua_loaded $pkgua_detached $pkgua_unloaded}] \ [load [file join $testDir pkgua$ext] {} child] \ [child eval pkgua_eq abc def] \ [lsort [child eval info commands pkgua_*]] \ [child eval {list $pkgua_loaded $pkgua_detached $pkgua_unloaded}] -} {{. . .} {} 0 {pkgua_eq pkgua_quote} {.. . .}} -test unload-3.7 {basic unloading of re-loaded package from a safe interpreter, with package name conversion} \ - [list $dll $loaded] { +} -result {{. . .} {} 0 {pkgua_eq pkgua_quote} {.. . .}} +test unload-3.7 {basic unloading of re-loaded package from a safe interpreter, with package name conversion} -setup { + if {[child eval set pkgua_loaded] eq ""} { + load [file join $testDir pkgua$ext] {} child + unload [file join $testDir pkgua$ext] {} child + load [file join $testDir pkgua$ext] {} child + } +} -constraints [list $dll $loaded] -body { list [child eval {list $pkgua_loaded $pkgua_detached $pkgua_unloaded}] \ [unload [file join $testDir pkgua$ext] pKgUa child] \ [child eval info commands pkgua_*] \ [child eval {list $pkgua_loaded $pkgua_detached $pkgua_unloaded}] -} {{.. . .} {} {} {.. .. ..}} +} -result {{.. . .} {} {} {.. .. ..}} # Tests for loading/unloading of a package among multiple interpreters... interp create child-trusted @@ -167,56 +204,89 @@ child-trusted eval { set pkgua_detached {} set pkgua_unloaded {} } +array set load {M 0 C 0 T 0} ## Load package in main trusted interpreter... -test unload-4.1 {loading of unloadable package in trusted interpreter, with guess for package name} \ - [list $dll $loaded] { +test unload-4.1 {loading of unloadable package in trusted interpreter, with guess for package name} -setup { + set pkgua_loaded "" + set pkgua_detached "" + set pkgua_unloaded "" + incr load(M) +} -constraints [list $dll $loaded] -body { list [list $pkgua_loaded $pkgua_detached $pkgua_unloaded] \ [load [file join $testDir pkgua$ext]] \ [pkgua_eq abc def] [lsort [info commands pkgua_*]] \ [list $pkgua_loaded $pkgua_detached $pkgua_unloaded] -} {{.. .. ..} {} 0 {pkgua_eq pkgua_quote} {... .. ..}} +} -result {{{} {} {}} {} 0 {pkgua_eq pkgua_quote} {. {} {}}} ## Load package in child-safe interpreter... -test unload-4.2 {basic loading of unloadable package in a safe interpreter, with package name conversion} \ - [list $dll $loaded] { +test unload-4.2 {basic loading of unloadable package in a safe interpreter, with package name conversion} -setup { + child eval { + set pkgua_loaded "" + set pkgua_detached "" + set pkgua_unloaded "" + } + incr load(C) +} -constraints [list $dll $loaded] -body { list [child eval {list $pkgua_loaded $pkgua_detached $pkgua_unloaded}] \ [load [file join $testDir pkgua$ext] pKgUA child] \ [child eval pkgua_eq abc def] \ [lsort [child eval info commands pkgua_*]] \ [child eval {list $pkgua_loaded $pkgua_detached $pkgua_unloaded}] -} {{.. .. ..} {} 0 {pkgua_eq pkgua_quote} {... .. ..}} +} -result {{{} {} {}} {} 0 {pkgua_eq pkgua_quote} {. {} {}}} ## Load package in child-trusted interpreter... -test unload-4.3 {basic loading of unloadable package in a second trusted interpreter, with package name conversion} \ - [list $dll $loaded] { +test unload-4.3 {basic loading of unloadable package in a second trusted interpreter, with package name conversion} -setup { + incr load(T) +} -constraints [list $dll $loaded] -body { list [child-trusted eval {list $pkgua_loaded $pkgua_detached $pkgua_unloaded}] \ [load [file join $testDir pkgua$ext] pkguA child-trusted] \ [child-trusted eval pkgua_eq abc def] \ [lsort [child-trusted eval info commands pkgua_*]] \ [child-trusted eval {list $pkgua_loaded $pkgua_detached $pkgua_unloaded}] -} {{{} {} {}} {} 0 {pkgua_eq pkgua_quote} {. {} {}}} +} -result {{{} {} {}} {} 0 {pkgua_eq pkgua_quote} {. {} {}}} ## Unload the package from the main trusted interpreter... -test unload-4.4 {basic unloading of unloadable package from trusted interpreter, with guess for package name} \ - [list $dll $loaded] { +test unload-4.4 {basic unloading of unloadable package from trusted interpreter, with guess for package name} -setup { + if {!$load(M)} { + load [file join $testDir pkgua$ext] + } + if {!$load(C)} { + load [file join $testDir pkgua$ext] {} child + incr load(C) + } + if {!$load(T)} { + load [file join $testDir pkgua$ext] {} child-trusted + incr load(T) + } +} -constraints [list $dll $loaded] -body { list [list $pkgua_loaded $pkgua_detached $pkgua_unloaded] \ [unload [file join $testDir pkgua$ext]] \ [info commands pkgua_*] \ [list $pkgua_loaded $pkgua_detached $pkgua_unloaded] -} {{... .. ..} {} {} {... ... ..}} +} -result {{. {} {}} {} {} {. . {}}} ## Unload the package from the child safe interpreter... -test unload-4.5 {basic unloading of unloadable package from a safe interpreter, with guess for package name} \ - [list $dll $loaded] { +test unload-4.5 {basic unloading of unloadable package from a safe interpreter, with guess for package name} -setup { + if {!$load(C)} { + load [file join $testDir pkgua$ext] {} child + } + if {!$load(T)} { + load [file join $testDir pkgua$ext] {} child-trusted + incr load(T) + } +} -constraints [list $dll $loaded] -body { list [child eval {list $pkgua_loaded $pkgua_detached $pkgua_unloaded}] \ [unload [file join $testDir pkgua$ext] {} child] \ [child eval info commands pkgua_*] \ [child eval {list $pkgua_loaded $pkgua_detached $pkgua_unloaded}] -} {{... .. ..} {} {} {... ... ..}} +} -result {{. {} {}} {} {} {. . {}}} ## Unload the package from the child trusted interpreter... -test unload-4.6 {basic unloading of unloadable package from a safe interpreter, with guess for package name} \ - [list $dll $loaded] { +test unload-4.6 {basic unloading of unloadable package from a safe interpreter, with guess for package name} -setup { + if {!$load(T)} { + load [file join $testDir pkgua$ext] {} child-trusted + } +} -constraints [list $dll $loaded] -body { list [child-trusted eval {list $pkgua_loaded $pkgua_detached $pkgua_unloaded}] \ [unload [file join $testDir pkgua$ext] {} child-trusted] \ [child-trusted eval info commands pkgua_*] \ [child-trusted eval {list $pkgua_loaded $pkgua_detached $pkgua_unloaded}] -} {{. {} {}} {} {} {. . .}} +} -result {{. {} {}} {} {} {. . .}} test unload-5.1 {unload a module loaded from vfs} \ -constraints [list $dll $loaded testsimplefilesystem] \ @@ -230,9 +300,7 @@ test unload-5.1 {unload a module loaded from vfs} \ list [catch {unload simplefs:/pkgua$ext} msg] $msg } \ -result {0 {}} - - - + # cleanup interp delete child interp delete child-trusted -- cgit v0.12 From 30b6493bb7a01568ed7fa236badef647b30ad038 Mon Sep 17 00:00:00 2001 From: dkf Date: Sun, 17 Jul 2016 12:02:27 +0000 Subject: [77d58e3a7a] Test case independence: var. --- tests/var.test | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/var.test b/tests/var.test index 690bd10..297034a 100644 --- a/tests/var.test +++ b/tests/var.test @@ -169,7 +169,9 @@ test var-1.17 {TclLookupVar, resurrect array element via upvar to deleted array: set result } } {0 2 1 {can't set "foo": upvar refers to element in deleted array}} -test var-1.18 {TclLookupVar, resurrect array element via upvar to deleted array: uncompiled code path} { +test var-1.18 {TclLookupVar, resurrect array element via upvar to deleted array: uncompiled code path} -setup { + unset -nocomplain test_ns_var::x +} -body { namespace eval test_ns_var { variable result {} variable x @@ -181,7 +183,7 @@ test var-1.18 {TclLookupVar, resurrect array element via upvar to deleted array: namespace delete [namespace current] set result } -} {0 2 1 {can't set "foo": upvar refers to element in deleted array}} +} -result {0 2 1 {can't set "foo": upvar refers to element in deleted array}} test var-1.19 {TclLookupVar, right error message when parsing variable name} -body { [format set] thisvar(doesntexist) } -returnCodes error -result {can't read "thisvar(doesntexist)": no such variable} -- cgit v0.12 From a127a9e4aa8b2a9a386cd7fe694bfef8f1cf5264 Mon Sep 17 00:00:00 2001 From: dgp Date: Mon, 18 Jul 2016 16:26:44 +0000 Subject: [104f2885bb] Rework the "chan" Tcl_ObjType to properly validate cached channel name lookups. --- generic/tclIO.c | 161 ++++++++++++++++++++++++++------------------------------ generic/tclIO.h | 6 +-- tests/io.test | 19 +++++++ 3 files changed, 97 insertions(+), 89 deletions(-) diff --git a/generic/tclIO.c b/generic/tclIO.c index 7bc849e..615fe60 100644 --- a/generic/tclIO.c +++ b/generic/tclIO.c @@ -312,14 +312,20 @@ static int WillRead(Channel *chanPtr); && (strncmp(optionName, (nameString), len) == 0)) /* - * The ChannelObjType type. We actually store the ChannelState structure - * as that lives longest and we want to return the bottomChanPtr when - * requested (consistent with Tcl_GetChannel). The setFromAny and - * updateString can be NULL as they should not be called. + * The ChannelObjType type. Used to store the result of looking up + * a channel name in the context of an interp. Saves the lookup + * result and values needed to check its continued validity. */ +typedef struct ResolvedChanName { + ChannelState *statePtr; /* The saved lookup result */ + Tcl_Interp *interp; /* The interp in which the lookup was done. */ + int epoch; /* The epoch of the channel when the lookup + * was done. Use to verify validity. */ + int refCount; /* Share this struct among many Tcl_Obj. */ +} ResolvedChanName; + static void DupChannelIntRep(Tcl_Obj *objPtr, Tcl_Obj *copyPtr); -static int SetChannelFromAny(Tcl_Interp *interp, Tcl_Obj *objPtr); static void FreeChannelIntRep(Tcl_Obj *objPtr); static Tcl_ObjType chanObjType = { @@ -327,18 +333,9 @@ static Tcl_ObjType chanObjType = { FreeChannelIntRep, /* freeIntRepProc */ DupChannelIntRep, /* dupIntRepProc */ NULL, /* updateStringProc */ - NULL /* setFromAnyProc SetChannelFromAny */ + NULL /* setFromAnyProc */ }; -#define GET_CHANNELSTATE(objPtr) \ - ((ChannelState *) (objPtr)->internalRep.twoPtrValue.ptr1) -#define SET_CHANNELSTATE(objPtr, storePtr) \ - ((objPtr)->internalRep.twoPtrValue.ptr1 = (void *) (storePtr)) -#define GET_CHANNELINTERP(objPtr) \ - ((Tcl_Interp *) (objPtr)->internalRep.twoPtrValue.ptr2) -#define SET_CHANNELINTERP(objPtr, storePtr) \ - ((objPtr)->internalRep.twoPtrValue.ptr2 = (void *) (storePtr)) - #define BUSY_STATE(st,fl) \ ((((st)->csPtrR) && ((fl) & TCL_READABLE)) || \ (((st)->csPtrW) && ((fl) & TCL_WRITABLE))) @@ -936,7 +933,7 @@ DeleteChannelTable( */ Tcl_DeleteHashEntry(hPtr); - SetFlag(statePtr, CHANNEL_TAINTED); + statePtr->epoch++; statePtr->refCount--; if (statePtr->refCount <= 0) { if (!GotFlag(statePtr, BG_FLUSH_SCHEDULED)) { @@ -1280,7 +1277,7 @@ DetachChannel( return TCL_ERROR; } Tcl_DeleteHashEntry(hPtr); - SetFlag(statePtr, CHANNEL_TAINTED); + statePtr->epoch++; /* * Remove channel handlers that refer to this interpreter, so that @@ -1413,12 +1410,57 @@ TclGetChannelFromObj( int flags) { ChannelState *statePtr; + ResolvedChanName *resPtr = NULL; + Tcl_Channel chan; + + if (interp == NULL) { + return TCL_ERROR; + } + + if (objPtr->typePtr == &chanObjType) { + /* + * Confirm validity of saved lookup results. + */ + + resPtr = (ResolvedChanName *) objPtr->internalRep.twoPtrValue.ptr1; + statePtr = resPtr->statePtr; + if ((resPtr->interp == interp) /* Same interp context */ + /* No epoch change in channel since lookup */ + && (resPtr->epoch == statePtr->epoch)) { + + /* Have a valid saved lookup. Jump to end to return it. */ + goto valid; + } + } + + chan = Tcl_GetChannel(interp, TclGetString(objPtr), NULL); - if (SetChannelFromAny(interp, objPtr) != TCL_OK) { + if (chan == NULL) { + if (resPtr) { + FreeChannelIntRep(objPtr); + } return TCL_ERROR; } - statePtr = GET_CHANNELSTATE(objPtr); + if (resPtr && resPtr->refCount == 1) { + /* Re-use the ResolvedCmdName struct */ + Tcl_Release((ClientData) resPtr->statePtr); + + } else { + TclFreeIntRep(objPtr); + + resPtr = (ResolvedChanName *) ckalloc(sizeof(ResolvedChanName)); + resPtr->refCount = 1; + objPtr->internalRep.twoPtrValue.ptr1 = (ClientData) resPtr; + objPtr->typePtr = &chanObjType; + } + statePtr = ((Channel *)chan)->state; + resPtr->statePtr = statePtr; + Tcl_Preserve((ClientData) statePtr); + resPtr->interp = interp; + resPtr->epoch = statePtr->epoch; + + valid: *channelPtr = (Tcl_Channel) (statePtr->bottomChanPtr); if (modePtr != NULL) { @@ -1568,6 +1610,8 @@ Tcl_CreateChannel( statePtr->chanMsg = NULL; statePtr->unreportedMsg = NULL; + statePtr->epoch = 0; + /* * Link the channel into the list of all channels; create an on-exit * handler if there is not one already, to close off all the channels in @@ -10439,78 +10483,17 @@ DupChannelIntRep( register Tcl_Obj *copyPtr) /* Object with internal rep to set. Must not * currently have an internal rep.*/ { - ChannelState *statePtr = GET_CHANNELSTATE(srcPtr); + ResolvedChanName *resPtr + = (ResolvedChanName *) srcPtr->internalRep.twoPtrValue.ptr1; - SET_CHANNELSTATE(copyPtr, statePtr); - SET_CHANNELINTERP(copyPtr, GET_CHANNELINTERP(srcPtr)); - Tcl_Preserve((ClientData) statePtr); + resPtr->refCount++; + copyPtr->internalRep.twoPtrValue.ptr1 = resPtr; copyPtr->typePtr = srcPtr->typePtr; } /* *---------------------------------------------------------------------- * - * SetChannelFromAny -- - * - * Create an internal representation of type "Channel" for an object. - * - * Results: - * This operation always succeeds and returns TCL_OK. - * - * Side effects: - * Any old internal reputation for objPtr is freed and the internal - * representation is set to "Channel". - * - *---------------------------------------------------------------------- - */ - -static int -SetChannelFromAny( - Tcl_Interp *interp, /* Used for error reporting if not NULL. */ - register Tcl_Obj *objPtr) /* The object to convert. */ -{ - ChannelState *statePtr; - - if (interp == NULL) { - return TCL_ERROR; - } - if (objPtr->typePtr == &chanObjType) { - /* - * TODO: TAINT Flag and dup'd channel values? - * The channel is valid until any call to DetachChannel occurs. - * Ensure consistency checks are done. - */ - - statePtr = GET_CHANNELSTATE(objPtr); - if (GotFlag(statePtr, CHANNEL_TAINTED|CHANNEL_CLOSED)) { - ResetFlag(statePtr, CHANNEL_TAINTED); - Tcl_Release((ClientData) statePtr); - objPtr->typePtr = NULL; - } else if (interp != GET_CHANNELINTERP(objPtr)) { - Tcl_Release((ClientData) statePtr); - objPtr->typePtr = NULL; - } - } - if (objPtr->typePtr != &chanObjType) { - Tcl_Channel chan = Tcl_GetChannel(interp, TclGetString(objPtr), NULL); - - if (chan == NULL) { - return TCL_ERROR; - } - - TclFreeIntRep(objPtr); - statePtr = ((Channel *)chan)->state; - Tcl_Preserve((ClientData) statePtr); - SET_CHANNELSTATE(objPtr, statePtr); - SET_CHANNELINTERP(objPtr, interp); - objPtr->typePtr = &chanObjType; - } - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * * FreeChannelIntRep -- * * Release statePtr storage. @@ -10528,7 +10511,15 @@ static void FreeChannelIntRep( Tcl_Obj *objPtr) /* Object with internal rep to free. */ { - Tcl_Release((ClientData) GET_CHANNELSTATE(objPtr)); + ResolvedChanName *resPtr + = (ResolvedChanName *) objPtr->internalRep.twoPtrValue.ptr1; + + objPtr->typePtr = NULL; + if (--resPtr->refCount) { + return; + } + Tcl_Release((ClientData) resPtr->statePtr); + ckfree((char *)resPtr); } #if 0 diff --git a/generic/tclIO.h b/generic/tclIO.h index 348a9c5..d096798 100644 --- a/generic/tclIO.h +++ b/generic/tclIO.h @@ -214,6 +214,8 @@ typedef struct ChannelState { * because it happened in the background. The * value is the chanMg, if any. #219's * companion to 'unreportedError'. */ + int epoch; /* Used to test validity of stored channelname + * lookup results. */ } ChannelState; /* @@ -275,10 +277,6 @@ typedef struct ChannelState { * usable, but it may not be closed * again from within the close * handler. */ -#define CHANNEL_TAINTED (1<<20) /* Channel stack structure has changed. - * Used by Channel Tcl_Obj type to - * determine if we have to revalidate - * the channel. */ /* * Local Variables: diff --git a/tests/io.test b/tests/io.test index 50c5808..7275b42 100644 --- a/tests/io.test +++ b/tests/io.test @@ -38,6 +38,7 @@ testConstraint testfevent [llength [info commands testfevent]] testConstraint testchannelevent [llength [info commands testchannelevent]] testConstraint testmainthread [llength [info commands testmainthread]] testConstraint testthread [llength [info commands testthread]] +testConstraint testobj [llength [info commands testobj]] # You need a *very* special environment to do some tests. In # particular, many file systems do not support large-files... @@ -8522,6 +8523,24 @@ test io-73.5 {effect of eof on encoding end flags} -setup { removeFile io-73.5 } -result [list 1 1 more\u00a0data 1] +test io-74.1 {[104f2885bb] improper cache validity check} -setup { + set fn [makeFile {} io-74.1] + set rfd [open $fn r] + testobj freeallvars + interp create slave +} -constraints testobj -body { + teststringobj set 1 [string range $rfd 0 end] + read [teststringobj get 1] + testobj duplicate 1 2 + interp transfer {} $rfd slave + catch {read [teststringobj get 1]} + read [teststringobj get 2] +} -cleanup { + interp delete slave + testobj freeallvars + removeFile io-74.1 +} -returnCodes error -match glob -result {can not find channel named "*"} + # ### ### ### ######### ######### ######### # cleanup -- cgit v0.12 From 3030616f91ca88f302a094e9f7388f5c7971fe3a Mon Sep 17 00:00:00 2001 From: dgp Date: Tue, 19 Jul 2016 15:00:51 +0000 Subject: Remove outdated comment. --- generic/tclVar.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/generic/tclVar.c b/generic/tclVar.c index 47c6e14..2adffbc 100644 --- a/generic/tclVar.c +++ b/generic/tclVar.c @@ -219,10 +219,6 @@ static Tcl_SetFromAnyProc PanicOnSetVarName; * or NULL if it is this same obj * twoPtrValue.ptr2: index into locals table * - * nsVarName - INTERNALREP DEFINITION: - * twoPtrValue.ptr1: pointer to the namespace containing the reference - * twoPtrValue.ptr2: pointer to the corresponding Var - * * parsedVarName - INTERNALREP DEFINITION: * twoPtrValue.ptr1: pointer to the array name Tcl_Obj, or NULL if it is a * scalar variable -- cgit v0.12 From 883ca7abcd437926de756a838f60e7574f111881 Mon Sep 17 00:00:00 2001 From: dgp Date: Tue, 19 Jul 2016 19:31:28 +0000 Subject: [0363f0146c] Fix [array startsearch] id handling to support var name variations --- generic/tclInt.h | 1 - generic/tclObj.c | 1 - generic/tclVar.c | 171 ++++++++++--------------------------------------------- 3 files changed, 31 insertions(+), 142 deletions(-) diff --git a/generic/tclInt.h b/generic/tclInt.h index 4ecac7d..b39c8ea 100644 --- a/generic/tclInt.h +++ b/generic/tclInt.h @@ -2707,7 +2707,6 @@ MODULE_SCOPE const Tcl_ObjType tclListType; MODULE_SCOPE const Tcl_ObjType tclDictType; MODULE_SCOPE const Tcl_ObjType tclProcBodyType; MODULE_SCOPE const Tcl_ObjType tclStringType; -MODULE_SCOPE const Tcl_ObjType tclArraySearchType; MODULE_SCOPE const Tcl_ObjType tclEnsembleCmdType; #ifndef TCL_WIDE_INT_IS_LONG MODULE_SCOPE const Tcl_ObjType tclWideIntType; diff --git a/generic/tclObj.c b/generic/tclObj.c index b145d7e..df17f13 100644 --- a/generic/tclObj.c +++ b/generic/tclObj.c @@ -402,7 +402,6 @@ TclInitObjSubsystem(void) Tcl_RegisterObjType(&tclListType); Tcl_RegisterObjType(&tclDictType); Tcl_RegisterObjType(&tclByteCodeType); - Tcl_RegisterObjType(&tclArraySearchType); Tcl_RegisterObjType(&tclCmdNameType); Tcl_RegisterObjType(&tclRegexpType); Tcl_RegisterObjType(&tclProcBodyType); diff --git a/generic/tclVar.c b/generic/tclVar.c index 091baf8..a4f1ec5 100644 --- a/generic/tclVar.c +++ b/generic/tclVar.c @@ -149,6 +149,7 @@ static const char *isArrayElement = */ typedef struct ArraySearch { + Tcl_Obj *name; /* Name of this search */ int id; /* Integer id used to distinguish among * multiple concurrent searches for the same * array. */ @@ -188,8 +189,6 @@ static ArraySearch * ParseSearchId(Tcl_Interp *interp, const Var *varPtr, static void UnsetVarStruct(Var *varPtr, Var *arrayPtr, Interp *iPtr, Tcl_Obj *part1Ptr, Tcl_Obj *part2Ptr, int flags, int index); -static int SetArraySearchObj(Tcl_Interp *interp, - Tcl_Obj *objPtr); /* * Functions defined in this file that may be exported in the future for use @@ -235,22 +234,6 @@ static const Tcl_ObjType tclParsedVarNameType = { FreeParsedVarName, DupParsedVarName, NULL, NULL }; -/* - * Type of Tcl_Objs used to speed up array searches. - * - * INTERNALREP DEFINITION: - * twoPtrValue.ptr1: searchIdNumber (cast to pointer) - * twoPtrValue.ptr2: variableNameStartInString (cast to pointer) - * - * Note that the value stored in ptr2 is the offset into the string of the - * start of the variable name and not the address of the variable name itself, - * as this can be safely copied. - */ - -const Tcl_ObjType tclArraySearchType = { - "array search", - NULL, NULL, NULL, SetArraySearchObj -}; Var * TclVarHashCreateVar( @@ -2966,8 +2949,9 @@ ArrayStartSearchCmd( searchPtr->nextEntry = VarHashFirstEntry(varPtr->value.tablePtr, &searchPtr->search); Tcl_SetHashValue(hPtr, searchPtr); - Tcl_SetObjResult(interp, - Tcl_ObjPrintf("s-%d-%s", searchPtr->id, varName)); + searchPtr->name = Tcl_ObjPrintf("s-%d-%s", searchPtr->id, varName); + Tcl_IncrRefCount(searchPtr->name); + Tcl_SetObjResult(interp, searchPtr->name); return TCL_OK; } @@ -3291,6 +3275,7 @@ ArrayDoneSearchCmd( } } } + Tcl_DecrRefCount(searchPtr->name); ckfree(searchPtr); return TCL_OK; } @@ -4930,75 +4915,6 @@ Tcl_UpvarObjCmd( /* *---------------------------------------------------------------------- * - * SetArraySearchObj -- - * - * This function converts the given tcl object into one that has the - * "array search" internal type. - * - * Results: - * TCL_OK if the conversion succeeded, and TCL_ERROR if it failed (when - * an error message will be placed in the interpreter's result.) - * - * Side effects: - * Updates the internal type and representation of the object to make - * this an array-search object. See the tclArraySearchType declaration - * above for details of the internal representation. - * - *---------------------------------------------------------------------- - */ - -static int -SetArraySearchObj( - Tcl_Interp *interp, - Tcl_Obj *objPtr) -{ - const char *string; - char *end; /* Can't be const due to strtoul defn. */ - int id; - size_t offset; - - /* - * Get the string representation. Make it up-to-date if necessary. - */ - - string = TclGetString(objPtr); - - /* - * Parse the id into the three parts separated by dashes. - */ - - if ((string[0] != 's') || (string[1] != '-')) { - goto syntax; - } - id = strtoul(string+2, &end, 10); - if ((end == (string+2)) || (*end != '-')) { - goto syntax; - } - - /* - * Can't perform value check in this context, so place reference to place - * in string to use for the check in the object instead. - */ - - end++; - offset = end - string; - - TclFreeIntRep(objPtr); - objPtr->typePtr = &tclArraySearchType; - objPtr->internalRep.twoPtrValue.ptr1 = INT2PTR(id); - objPtr->internalRep.twoPtrValue.ptr2 = INT2PTR(offset); - return TCL_OK; - - syntax: - Tcl_SetObjResult(interp, Tcl_ObjPrintf( - "illegal search identifier \"%s\"", string)); - Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "ARRAYSEARCH", string, NULL); - return TCL_ERROR; -} - -/* - *---------------------------------------------------------------------- - * * ParseSearchId -- * * This function translates from a tcl object to a pointer to an active @@ -5009,10 +4925,6 @@ SetArraySearchObj( * or NULL if there isn't one. If NULL is returned, the interp's result * contains an error message. * - * Side effects: - * The tcl object might have its internal type and representation - * modified. - * *---------------------------------------------------------------------- */ @@ -5028,65 +4940,43 @@ ParseSearchId( * name. */ { Interp *iPtr = (Interp *) interp; - register const char *string; - register size_t offset; - int id; ArraySearch *searchPtr; - const char *varName = TclGetString(varNamePtr); - - /* - * Parse the id. - */ - - if ((handleObj->typePtr != &tclArraySearchType) - && (SetArraySearchObj(interp, handleObj) != TCL_OK)) { - return NULL; - } - - /* - * Extract the information out of the Tcl_Obj. - */ - - id = PTR2INT(handleObj->internalRep.twoPtrValue.ptr1); - string = TclGetString(handleObj); - offset = PTR2INT(handleObj->internalRep.twoPtrValue.ptr2); - - /* - * This test cannot be placed inside the Tcl_Obj machinery, since it is - * dependent on the variable context. - */ - - if (strcmp(string+offset, varName) != 0) { - Tcl_SetObjResult(interp, Tcl_ObjPrintf( - "search identifier \"%s\" isn't for variable \"%s\"", - string, varName)); - goto badLookup; - } - - /* - * Search through the list of active searches on the interpreter to see if - * the desired one exists. - * - * Note that we cannot store the searchPtr directly in the Tcl_Obj as that - * would run into trouble when DeleteSearches() was called so we must scan - * this list every time. - */ + const char *handle = TclGetString(handleObj); + char *end; if (varPtr->flags & VAR_SEARCH_ACTIVE) { Tcl_HashEntry *hPtr = Tcl_FindHashEntry(&iPtr->varSearches, varPtr); + /* First look for same (Tcl_Obj *) */ for (searchPtr = Tcl_GetHashValue(hPtr); searchPtr != NULL; searchPtr = searchPtr->nextPtr) { - if (searchPtr->id == id) { + if (searchPtr->name == handleObj) { return searchPtr; } } + /* Fallback: do string compares. */ + for (searchPtr = Tcl_GetHashValue(hPtr); searchPtr != NULL; + searchPtr = searchPtr->nextPtr) { + if (strcmp(TclGetString(searchPtr->name), handle) == 0) { + return searchPtr; + } + } + } + if ((handle[0] != 's') || (handle[1] != '-') + || (strtoul(handle + 2, &end, 10), end == (handle + 2)) + || (*end != '-')) { + Tcl_SetObjResult(interp, Tcl_ObjPrintf( + "illegal search identifier \"%s\"", handle)); + } else if (strcmp(end + 1, TclGetString(varNamePtr)) != 0) { + Tcl_SetObjResult(interp, Tcl_ObjPrintf( + "search identifier \"%s\" isn't for variable \"%s\"", + handle, TclGetString(varNamePtr))); + } else { + Tcl_SetObjResult(interp, Tcl_ObjPrintf( + "couldn't find search \"%s\"", handle)); } - Tcl_SetObjResult(interp, Tcl_ObjPrintf( - "couldn't find search \"%s\"", string)); - badLookup: - Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "ARRAYSEARCH", string, NULL); + Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "ARRAYSEARCH", handle, NULL); return NULL; } @@ -5121,6 +5011,7 @@ DeleteSearches( for (searchPtr = Tcl_GetHashValue(sPtr); searchPtr != NULL; searchPtr = nextPtr) { nextPtr = searchPtr->nextPtr; + Tcl_DecrRefCount(searchPtr->name); ckfree(searchPtr); } arrayVarPtr->flags &= ~VAR_SEARCH_ACTIVE; -- cgit v0.12 From 27f4a98be411aa6878d45e7e86e5c90cf2208c92 Mon Sep 17 00:00:00 2001 From: dgp Date: Tue, 19 Jul 2016 19:33:35 +0000 Subject: "array search" is no longer a registered Tcl_ObjType. --- tests/obj.test | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/obj.test b/tests/obj.test index 7bf00f7..a8d2d20 100644 --- a/tests/obj.test +++ b/tests/obj.test @@ -26,7 +26,6 @@ testConstraint wideBiggerThanInt [expr {wide(0x80000000) != int(0x80000000)}] test obj-1.1 {Tcl_AppendAllObjTypes, and InitTypeTable, Tcl_RegisterObjType} testobj { set r 1 foreach {t} { - {array search} bytearray bytecode cmdName -- cgit v0.12 From c235e3492b4494286cee64ae3a29ff161c62a821 Mon Sep 17 00:00:00 2001 From: dgp Date: Tue, 19 Jul 2016 20:40:27 +0000 Subject: Factor out common prologue. --- generic/tclVar.c | 176 +++++++++++++++---------------------------------------- 1 file changed, 48 insertions(+), 128 deletions(-) diff --git a/generic/tclVar.c b/generic/tclVar.c index 1d08832..56c5a05 100644 --- a/generic/tclVar.c +++ b/generic/tclVar.c @@ -189,6 +189,7 @@ static ArraySearch * ParseSearchId(Tcl_Interp *interp, const Var *varPtr, static void UnsetVarStruct(Var *varPtr, Var *arrayPtr, Interp *iPtr, Tcl_Obj *part1Ptr, Tcl_Obj *part2Ptr, int flags, int index); +static Var * VerifyArray(Tcl_Interp *interp, Tcl_Obj *varNameObj); /* * Functions defined in this file that may be exported in the future for use @@ -2870,34 +2871,22 @@ TclArraySet( */ /* ARGSUSED */ -static int -ArrayStartSearchCmd( - ClientData clientData, + +static Var * +VerifyArray( Tcl_Interp *interp, - int objc, - Tcl_Obj *const objv[]) + Tcl_Obj *varNameObj) { Interp *iPtr = (Interp *) interp; - Var *varPtr, *arrayPtr; - Tcl_HashEntry *hPtr; - Tcl_Obj *varNameObj; - int isNew; - ArraySearch *searchPtr; - const char *varName; - - if (objc != 2) { - Tcl_WrongNumArgs(interp, 1, objv, "arrayName"); - return TCL_ERROR; - } - varNameObj = objv[1]; + const char *varName = TclGetString(varNameObj); + Var *arrayPtr; /* * Locate the array variable. */ - varPtr = TclObjLookupVarEx(interp, varNameObj, NULL, /*flags*/ 0, + Var *varPtr = TclObjLookupVarEx(interp, varNameObj, NULL, /*flags*/ 0, /*msg*/ 0, /*createPart1*/ 0, /*createPart2*/ 0, &arrayPtr); - varName = TclGetString(varNameObj); /* * Special array trace used to keep the env array in sync for array names, @@ -2909,7 +2898,7 @@ ArrayStartSearchCmd( if (TclObjCallVarTraces(iPtr, arrayPtr, varPtr, varNameObj, NULL, (TCL_LEAVE_ERR_MSG|TCL_NAMESPACE_ONLY|TCL_GLOBAL_ONLY| TCL_TRACE_ARRAY), /* leaveErrMsg */ 1, -1) == TCL_ERROR) { - return TCL_ERROR; + return NULL; } } @@ -2919,11 +2908,36 @@ ArrayStartSearchCmd( * traces. */ - if ((varPtr == NULL) || !TclIsVarArray(varPtr) - || TclIsVarUndefined(varPtr)) { + if ((varPtr == NULL) || !TclIsVarArray(varPtr) || TclIsVarUndefined(varPtr)) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "\"%s\" isn't an array", varName)); Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "ARRAY", varName, NULL); + return NULL; + } + + return varPtr; +} + +static int +ArrayStartSearchCmd( + ClientData clientData, + Tcl_Interp *interp, + int objc, + Tcl_Obj *const objv[]) +{ + Interp *iPtr = (Interp *) interp; + Var *varPtr; + Tcl_HashEntry *hPtr; + int isNew; + ArraySearch *searchPtr; + + if (objc != 2) { + Tcl_WrongNumArgs(interp, 1, objv, "arrayName"); + return TCL_ERROR; + } + + varPtr = VerifyArray(interp, objv[1]); + if (varPtr == NULL) { return TCL_ERROR; } @@ -2945,7 +2959,7 @@ ArrayStartSearchCmd( searchPtr->nextEntry = VarHashFirstEntry(varPtr->value.tablePtr, &searchPtr->search); Tcl_SetHashValue(hPtr, searchPtr); - searchPtr->name = Tcl_ObjPrintf("s-%d-%s", searchPtr->id, varName); + searchPtr->name = Tcl_ObjPrintf("s-%d-%s", searchPtr->id, TclGetString(objv[1])); Tcl_IncrRefCount(searchPtr->name); Tcl_SetObjResult(interp, searchPtr->name); return TCL_OK; @@ -2977,7 +2991,7 @@ ArrayAnyMoreCmd( Tcl_Obj *const objv[]) { Interp *iPtr = (Interp *) interp; - Var *varPtr, *arrayPtr; + Var *varPtr; Tcl_Obj *varNameObj, *searchObj; int gotValue; ArraySearch *searchPtr; @@ -2989,42 +3003,11 @@ ArrayAnyMoreCmd( varNameObj = objv[1]; searchObj = objv[2]; - /* - * Locate the array variable. - */ - - varPtr = TclObjLookupVarEx(interp, varNameObj, NULL, /*flags*/ 0, - /*msg*/ 0, /*createPart1*/ 0, /*createPart2*/ 0, &arrayPtr); - - /* - * Special array trace used to keep the env array in sync for array names, - * array get, etc. - */ - - if (varPtr && (varPtr->flags & VAR_TRACED_ARRAY) - && (TclIsVarArray(varPtr) || TclIsVarUndefined(varPtr))) { - if (TclObjCallVarTraces(iPtr, arrayPtr, varPtr, varNameObj, NULL, - (TCL_LEAVE_ERR_MSG|TCL_NAMESPACE_ONLY|TCL_GLOBAL_ONLY| - TCL_TRACE_ARRAY), /* leaveErrMsg */ 1, -1) == TCL_ERROR) { - return TCL_ERROR; - } - } - - /* - * Verify that it is indeed an array variable. This test comes after the - * traces - the variable may actually become an array as an effect of said - * traces. - */ - - if ((varPtr == NULL) || !TclIsVarArray(varPtr) - || TclIsVarUndefined(varPtr)) { - Tcl_SetObjResult(interp, Tcl_ObjPrintf( - "\"%s\" isn't an array", TclGetString(varNameObj))); - Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "ARRAY", - TclGetString(varNameObj), NULL); + varPtr = VerifyArray(interp, varNameObj); + if (varPtr == NULL) { return TCL_ERROR; } - + /* * Get the search. */ @@ -3083,8 +3066,7 @@ ArrayNextElementCmd( int objc, Tcl_Obj *const objv[]) { - Interp *iPtr = (Interp *) interp; - Var *varPtr, *arrayPtr; + Var *varPtr; Tcl_Obj *varNameObj, *searchObj; ArraySearch *searchPtr; @@ -3095,41 +3077,10 @@ ArrayNextElementCmd( varNameObj = objv[1]; searchObj = objv[2]; - /* - * Locate the array variable. - */ - - varPtr = TclObjLookupVarEx(interp, varNameObj, NULL, /*flags*/ 0, - /*msg*/ 0, /*createPart1*/ 0, /*createPart2*/ 0, &arrayPtr); - - /* - * Special array trace used to keep the env array in sync for array names, - * array get, etc. - */ - - if (varPtr && (varPtr->flags & VAR_TRACED_ARRAY) - && (TclIsVarArray(varPtr) || TclIsVarUndefined(varPtr))) { - if (TclObjCallVarTraces(iPtr, arrayPtr, varPtr, varNameObj, NULL, - (TCL_LEAVE_ERR_MSG|TCL_NAMESPACE_ONLY|TCL_GLOBAL_ONLY| - TCL_TRACE_ARRAY), /* leaveErrMsg */ 1, -1) == TCL_ERROR) { - return TCL_ERROR; - } - } - - /* - * Verify that it is indeed an array variable. This test comes after the - * traces - the variable may actually become an array as an effect of said - * traces. - */ - - if ((varPtr == NULL) || !TclIsVarArray(varPtr) - || TclIsVarUndefined(varPtr)) { - Tcl_SetObjResult(interp, Tcl_ObjPrintf( - "\"%s\" isn't an array", TclGetString(varNameObj))); - Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "ARRAY", - TclGetString(varNameObj), NULL); + varPtr = VerifyArray(interp, varNameObj); + if (varPtr == NULL) { return TCL_ERROR; - } + } /* * Get the search. @@ -3193,7 +3144,7 @@ ArrayDoneSearchCmd( Tcl_Obj *const objv[]) { Interp *iPtr = (Interp *) interp; - Var *varPtr, *arrayPtr; + Var *varPtr; Tcl_HashEntry *hPtr; Tcl_Obj *varNameObj, *searchObj; ArraySearch *searchPtr, *prevPtr; @@ -3205,39 +3156,8 @@ ArrayDoneSearchCmd( varNameObj = objv[1]; searchObj = objv[2]; - /* - * Locate the array variable. - */ - - varPtr = TclObjLookupVarEx(interp, varNameObj, NULL, /*flags*/ 0, - /*msg*/ 0, /*createPart1*/ 0, /*createPart2*/ 0, &arrayPtr); - - /* - * Special array trace used to keep the env array in sync for array names, - * array get, etc. - */ - - if (varPtr && (varPtr->flags & VAR_TRACED_ARRAY) - && (TclIsVarArray(varPtr) || TclIsVarUndefined(varPtr))) { - if (TclObjCallVarTraces(iPtr, arrayPtr, varPtr, varNameObj, NULL, - (TCL_LEAVE_ERR_MSG|TCL_NAMESPACE_ONLY|TCL_GLOBAL_ONLY| - TCL_TRACE_ARRAY), /* leaveErrMsg */ 1, -1) == TCL_ERROR) { - return TCL_ERROR; - } - } - - /* - * Verify that it is indeed an array variable. This test comes after the - * traces - the variable may actually become an array as an effect of said - * traces. - */ - - if ((varPtr == NULL) || !TclIsVarArray(varPtr) - || TclIsVarUndefined(varPtr)) { - Tcl_SetObjResult(interp, Tcl_ObjPrintf( - "\"%s\" isn't an array", TclGetString(varNameObj))); - Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "ARRAY", - TclGetString(varNameObj), NULL); + varPtr = VerifyArray(interp, varNameObj); + if (varPtr == NULL) { return TCL_ERROR; } -- cgit v0.12 From 05c0da6eee9a84deb417980eb524efd8395516ec Mon Sep 17 00:00:00 2001 From: venkat Date: Wed, 20 Jul 2016 03:05:01 +0000 Subject: Update tzdata to 2016f from ietf.org --- library/tzdata/America/Cambridge_Bay | 2 +- library/tzdata/America/Inuvik | 2 +- library/tzdata/America/Iqaluit | 2 +- library/tzdata/America/Pangnirtung | 2 +- library/tzdata/America/Rankin_Inlet | 2 +- library/tzdata/America/Resolute | 2 +- library/tzdata/America/Yellowknife | 2 +- library/tzdata/Antarctica/Casey | 2 +- library/tzdata/Antarctica/Davis | 4 +- library/tzdata/Antarctica/DumontDUrville | 4 +- library/tzdata/Antarctica/Macquarie | 4 +- library/tzdata/Antarctica/Mawson | 2 +- library/tzdata/Antarctica/Palmer | 2 +- library/tzdata/Antarctica/Rothera | 2 +- library/tzdata/Antarctica/Syowa | 2 +- library/tzdata/Antarctica/Troll | 2 +- library/tzdata/Antarctica/Vostok | 2 +- library/tzdata/Asia/Baku | 2 +- library/tzdata/Asia/Novokuznetsk | 133 +++++++++++++++--------------- library/tzdata/Asia/Novosibirsk | 135 ++++++++++++++++--------------- library/tzdata/Europe/Minsk | 6 +- library/tzdata/Indian/Kerguelen | 2 +- 22 files changed, 159 insertions(+), 159 deletions(-) diff --git a/library/tzdata/America/Cambridge_Bay b/library/tzdata/America/Cambridge_Bay index 23004bb..3115ee1 100644 --- a/library/tzdata/America/Cambridge_Bay +++ b/library/tzdata/America/Cambridge_Bay @@ -1,7 +1,7 @@ # created by tools/tclZIC.tcl - do not edit set TZData(:America/Cambridge_Bay) { - {-9223372036854775808 0 0 zzz} + {-9223372036854775808 0 0 -00} {-1577923200 -25200 0 MST} {-880210800 -21600 1 MWT} {-769395600 -21600 1 MPT} diff --git a/library/tzdata/America/Inuvik b/library/tzdata/America/Inuvik index dd0d151..08f0fd6 100644 --- a/library/tzdata/America/Inuvik +++ b/library/tzdata/America/Inuvik @@ -1,7 +1,7 @@ # created by tools/tclZIC.tcl - do not edit set TZData(:America/Inuvik) { - {-9223372036854775808 0 0 zzz} + {-9223372036854775808 0 0 -00} {-536457600 -28800 0 PST} {-147888000 -21600 1 PDDT} {-131558400 -28800 0 PST} diff --git a/library/tzdata/America/Iqaluit b/library/tzdata/America/Iqaluit index 2a2e9fe..ff82866 100644 --- a/library/tzdata/America/Iqaluit +++ b/library/tzdata/America/Iqaluit @@ -1,7 +1,7 @@ # created by tools/tclZIC.tcl - do not edit set TZData(:America/Iqaluit) { - {-9223372036854775808 0 0 zzz} + {-9223372036854775808 0 0 -00} {-865296000 -14400 0 EWT} {-769395600 -14400 1 EPT} {-765396000 -18000 0 EST} diff --git a/library/tzdata/America/Pangnirtung b/library/tzdata/America/Pangnirtung index 640808e..14d8516 100644 --- a/library/tzdata/America/Pangnirtung +++ b/library/tzdata/America/Pangnirtung @@ -1,7 +1,7 @@ # created by tools/tclZIC.tcl - do not edit set TZData(:America/Pangnirtung) { - {-9223372036854775808 0 0 zzz} + {-9223372036854775808 0 0 -00} {-1546300800 -14400 0 AST} {-880221600 -10800 1 AWT} {-769395600 -10800 1 APT} diff --git a/library/tzdata/America/Rankin_Inlet b/library/tzdata/America/Rankin_Inlet index 770ec5d..9ce9f8d 100644 --- a/library/tzdata/America/Rankin_Inlet +++ b/library/tzdata/America/Rankin_Inlet @@ -1,7 +1,7 @@ # created by tools/tclZIC.tcl - do not edit set TZData(:America/Rankin_Inlet) { - {-9223372036854775808 0 0 zzz} + {-9223372036854775808 0 0 -00} {-410227200 -21600 0 CST} {-147895200 -14400 1 CDDT} {-131565600 -21600 0 CST} diff --git a/library/tzdata/America/Resolute b/library/tzdata/America/Resolute index b4c0bab..a9881b4 100644 --- a/library/tzdata/America/Resolute +++ b/library/tzdata/America/Resolute @@ -1,7 +1,7 @@ # created by tools/tclZIC.tcl - do not edit set TZData(:America/Resolute) { - {-9223372036854775808 0 0 zzz} + {-9223372036854775808 0 0 -00} {-704937600 -21600 0 CST} {-147895200 -14400 1 CDDT} {-131565600 -21600 0 CST} diff --git a/library/tzdata/America/Yellowknife b/library/tzdata/America/Yellowknife index 44ca658..c6c4ed5 100644 --- a/library/tzdata/America/Yellowknife +++ b/library/tzdata/America/Yellowknife @@ -1,7 +1,7 @@ # created by tools/tclZIC.tcl - do not edit set TZData(:America/Yellowknife) { - {-9223372036854775808 0 0 zzz} + {-9223372036854775808 0 0 -00} {-1104537600 -25200 0 MST} {-880210800 -21600 1 MWT} {-769395600 -21600 1 MPT} diff --git a/library/tzdata/Antarctica/Casey b/library/tzdata/Antarctica/Casey index 56d5df7..2573dac 100644 --- a/library/tzdata/Antarctica/Casey +++ b/library/tzdata/Antarctica/Casey @@ -1,7 +1,7 @@ # created by tools/tclZIC.tcl - do not edit set TZData(:Antarctica/Casey) { - {-9223372036854775808 0 0 zzz} + {-9223372036854775808 0 0 -00} {-31536000 28800 0 AWST} {1255802400 39600 0 CAST} {1267714800 28800 0 AWST} diff --git a/library/tzdata/Antarctica/Davis b/library/tzdata/Antarctica/Davis index 2762d2f..c98be2f 100644 --- a/library/tzdata/Antarctica/Davis +++ b/library/tzdata/Antarctica/Davis @@ -1,9 +1,9 @@ # created by tools/tclZIC.tcl - do not edit set TZData(:Antarctica/Davis) { - {-9223372036854775808 0 0 zzz} + {-9223372036854775808 0 0 -00} {-409190400 25200 0 DAVT} - {-163062000 0 0 zzz} + {-163062000 0 0 -00} {-28857600 25200 0 DAVT} {1255806000 18000 0 DAVT} {1268251200 25200 0 DAVT} diff --git a/library/tzdata/Antarctica/DumontDUrville b/library/tzdata/Antarctica/DumontDUrville index 41dc1e3..8d21d45 100644 --- a/library/tzdata/Antarctica/DumontDUrville +++ b/library/tzdata/Antarctica/DumontDUrville @@ -1,8 +1,8 @@ # created by tools/tclZIC.tcl - do not edit set TZData(:Antarctica/DumontDUrville) { - {-9223372036854775808 0 0 zzz} + {-9223372036854775808 0 0 -00} {-725846400 36000 0 PMT} - {-566992800 0 0 zzz} + {-566992800 0 0 -00} {-415497600 36000 0 DDUT} } diff --git a/library/tzdata/Antarctica/Macquarie b/library/tzdata/Antarctica/Macquarie index 07ddff6..9ed0630 100644 --- a/library/tzdata/Antarctica/Macquarie +++ b/library/tzdata/Antarctica/Macquarie @@ -1,12 +1,12 @@ # created by tools/tclZIC.tcl - do not edit set TZData(:Antarctica/Macquarie) { - {-9223372036854775808 0 0 zzz} + {-9223372036854775808 0 0 -00} {-2214259200 36000 0 AEST} {-1680508800 39600 1 AEDT} {-1669892400 39600 0 AEDT} {-1665392400 36000 0 AEST} - {-1601719200 0 0 zzz} + {-1601719200 0 0 -00} {-94730400 36000 0 AEST} {-71136000 39600 1 AEDT} {-55411200 36000 0 AEST} diff --git a/library/tzdata/Antarctica/Mawson b/library/tzdata/Antarctica/Mawson index ba03ba1..e50aa07 100644 --- a/library/tzdata/Antarctica/Mawson +++ b/library/tzdata/Antarctica/Mawson @@ -1,7 +1,7 @@ # created by tools/tclZIC.tcl - do not edit set TZData(:Antarctica/Mawson) { - {-9223372036854775808 0 0 zzz} + {-9223372036854775808 0 0 -00} {-501206400 21600 0 MAWT} {1255809600 18000 0 MAWT} } diff --git a/library/tzdata/Antarctica/Palmer b/library/tzdata/Antarctica/Palmer index 5767985..62b17e1 100644 --- a/library/tzdata/Antarctica/Palmer +++ b/library/tzdata/Antarctica/Palmer @@ -1,7 +1,7 @@ # created by tools/tclZIC.tcl - do not edit set TZData(:Antarctica/Palmer) { - {-9223372036854775808 0 0 zzz} + {-9223372036854775808 0 0 -00} {-157766400 -14400 0 ART} {-152654400 -14400 0 ART} {-132955200 -10800 1 ARST} diff --git a/library/tzdata/Antarctica/Rothera b/library/tzdata/Antarctica/Rothera index 24d7f3e..3a219c7 100644 --- a/library/tzdata/Antarctica/Rothera +++ b/library/tzdata/Antarctica/Rothera @@ -1,6 +1,6 @@ # created by tools/tclZIC.tcl - do not edit set TZData(:Antarctica/Rothera) { - {-9223372036854775808 0 0 zzz} + {-9223372036854775808 0 0 -00} {218246400 -10800 0 ROTT} } diff --git a/library/tzdata/Antarctica/Syowa b/library/tzdata/Antarctica/Syowa index 4d046b5..1fe030a 100644 --- a/library/tzdata/Antarctica/Syowa +++ b/library/tzdata/Antarctica/Syowa @@ -1,6 +1,6 @@ # created by tools/tclZIC.tcl - do not edit set TZData(:Antarctica/Syowa) { - {-9223372036854775808 0 0 zzz} + {-9223372036854775808 0 0 -00} {-407808000 10800 0 SYOT} } diff --git a/library/tzdata/Antarctica/Troll b/library/tzdata/Antarctica/Troll index 7d2b042..09727a8 100644 --- a/library/tzdata/Antarctica/Troll +++ b/library/tzdata/Antarctica/Troll @@ -1,7 +1,7 @@ # created by tools/tclZIC.tcl - do not edit set TZData(:Antarctica/Troll) { - {-9223372036854775808 0 0 zzz} + {-9223372036854775808 0 0 -00} {1108166400 0 0 UTC} {1111885200 7200 1 CEST} {1130634000 0 0 UTC} diff --git a/library/tzdata/Antarctica/Vostok b/library/tzdata/Antarctica/Vostok index f846f65..a59868b 100644 --- a/library/tzdata/Antarctica/Vostok +++ b/library/tzdata/Antarctica/Vostok @@ -1,6 +1,6 @@ # created by tools/tclZIC.tcl - do not edit set TZData(:Antarctica/Vostok) { - {-9223372036854775808 0 0 zzz} + {-9223372036854775808 0 0 -00} {-380073600 21600 0 VOST} } diff --git a/library/tzdata/Asia/Baku b/library/tzdata/Asia/Baku index bc0701a..e9ee835 100644 --- a/library/tzdata/Asia/Baku +++ b/library/tzdata/Asia/Baku @@ -28,7 +28,7 @@ set TZData(:Asia/Baku) { {683496000 14400 0 AZST} {686098800 10800 0 AZT} {701823600 14400 1 AZST} - {717537600 14400 0 AZT} + {717548400 14400 0 AZT} {820440000 14400 0 AZT} {828234000 18000 1 AZST} {846378000 14400 0 AZT} diff --git a/library/tzdata/Asia/Novokuznetsk b/library/tzdata/Asia/Novokuznetsk index f079faa..a43a984 100644 --- a/library/tzdata/Asia/Novokuznetsk +++ b/library/tzdata/Asia/Novokuznetsk @@ -2,71 +2,70 @@ set TZData(:Asia/Novokuznetsk) { {-9223372036854775808 20928 0 LMT} - {-1441259328 21600 0 KRAT} - {-1247551200 25200 0 KRAMMTT} - {354906000 28800 1 KRAST} - {370713600 25200 0 KRAT} - {386442000 28800 1 KRAST} - {402249600 25200 0 KRAT} - {417978000 28800 1 KRAST} - {433785600 25200 0 KRAT} - {449600400 28800 1 KRAST} - {465332400 25200 0 KRAT} - {481057200 28800 1 KRAST} - {496782000 25200 0 KRAT} - {512506800 28800 1 KRAST} - {528231600 25200 0 KRAT} - {543956400 28800 1 KRAST} - {559681200 25200 0 KRAT} - {575406000 28800 1 KRAST} - {591130800 25200 0 KRAT} - {606855600 28800 1 KRAST} - {622580400 25200 0 KRAT} - {638305200 28800 1 KRAST} - {654634800 25200 0 KRAT} - {670359600 21600 0 KRAMMTT} - {670363200 25200 1 KRAST} - {686088000 21600 0 KRAT} - {695764800 25200 0 KRAMMTT} - {701809200 28800 1 KRAST} - {717534000 25200 0 KRAT} - {733258800 28800 1 KRAST} - {748983600 25200 0 KRAT} - {764708400 28800 1 KRAST} - {780433200 25200 0 KRAT} - {796158000 28800 1 KRAST} - {811882800 25200 0 KRAT} - {828212400 28800 1 KRAST} - {846356400 25200 0 KRAT} - {859662000 28800 1 KRAST} - {877806000 25200 0 KRAT} - {891111600 28800 1 KRAST} - {909255600 25200 0 KRAT} - {922561200 28800 1 KRAST} - {941310000 25200 0 KRAT} - {954010800 28800 1 KRAST} - {972759600 25200 0 KRAT} - {985460400 28800 1 KRAST} - {1004209200 25200 0 KRAT} - {1017514800 28800 1 KRAST} - {1035658800 25200 0 KRAT} - {1048964400 28800 1 KRAST} - {1067108400 25200 0 KRAT} - {1080414000 28800 1 KRAST} - {1099162800 25200 0 KRAT} - {1111863600 28800 1 KRAST} - {1130612400 25200 0 KRAT} - {1143313200 28800 1 KRAST} - {1162062000 25200 0 KRAT} - {1174762800 28800 1 KRAST} - {1193511600 25200 0 KRAT} - {1206817200 28800 1 KRAST} - {1224961200 25200 0 KRAT} - {1238266800 28800 1 KRAST} - {1256410800 25200 0 KRAT} - {1269716400 21600 0 NOVMMTT} - {1269720000 25200 1 NOVST} - {1288468800 21600 0 NOVT} - {1301169600 25200 0 NOVT} - {1414263600 25200 0 KRAT} + {-1441259328 21600 0 +06} + {-1247551200 25200 0 +08} + {354906000 28800 1 +08} + {370713600 25200 0 +07} + {386442000 28800 1 +08} + {402249600 25200 0 +07} + {417978000 28800 1 +08} + {433785600 25200 0 +07} + {449600400 28800 1 +08} + {465332400 25200 0 +07} + {481057200 28800 1 +08} + {496782000 25200 0 +07} + {512506800 28800 1 +08} + {528231600 25200 0 +07} + {543956400 28800 1 +08} + {559681200 25200 0 +07} + {575406000 28800 1 +08} + {591130800 25200 0 +07} + {606855600 28800 1 +08} + {622580400 25200 0 +07} + {638305200 28800 1 +08} + {654634800 25200 0 +07} + {670359600 21600 0 +07} + {670363200 25200 1 +07} + {686088000 21600 0 +06} + {695764800 25200 0 +08} + {701809200 28800 1 +08} + {717534000 25200 0 +07} + {733258800 28800 1 +08} + {748983600 25200 0 +07} + {764708400 28800 1 +08} + {780433200 25200 0 +07} + {796158000 28800 1 +08} + {811882800 25200 0 +07} + {828212400 28800 1 +08} + {846356400 25200 0 +07} + {859662000 28800 1 +08} + {877806000 25200 0 +07} + {891111600 28800 1 +08} + {909255600 25200 0 +07} + {922561200 28800 1 +08} + {941310000 25200 0 +07} + {954010800 28800 1 +08} + {972759600 25200 0 +07} + {985460400 28800 1 +08} + {1004209200 25200 0 +07} + {1017514800 28800 1 +08} + {1035658800 25200 0 +07} + {1048964400 28800 1 +08} + {1067108400 25200 0 +07} + {1080414000 28800 1 +08} + {1099162800 25200 0 +07} + {1111863600 28800 1 +08} + {1130612400 25200 0 +07} + {1143313200 28800 1 +08} + {1162062000 25200 0 +07} + {1174762800 28800 1 +08} + {1193511600 25200 0 +07} + {1206817200 28800 1 +08} + {1224961200 25200 0 +07} + {1238266800 28800 1 +08} + {1256410800 25200 0 +07} + {1269716400 21600 0 +07} + {1269720000 25200 1 +07} + {1288468800 21600 0 +06} + {1301169600 25200 0 +07} } diff --git a/library/tzdata/Asia/Novosibirsk b/library/tzdata/Asia/Novosibirsk index 54c83fa..21f5c00 100644 --- a/library/tzdata/Asia/Novosibirsk +++ b/library/tzdata/Asia/Novosibirsk @@ -2,71 +2,72 @@ set TZData(:Asia/Novosibirsk) { {-9223372036854775808 19900 0 LMT} - {-1579476700 21600 0 NOVT} - {-1247551200 25200 0 NOVMMTT} - {354906000 28800 1 NOVST} - {370713600 25200 0 NOVT} - {386442000 28800 1 NOVST} - {402249600 25200 0 NOVT} - {417978000 28800 1 NOVST} - {433785600 25200 0 NOVT} - {449600400 28800 1 NOVST} - {465332400 25200 0 NOVT} - {481057200 28800 1 NOVST} - {496782000 25200 0 NOVT} - {512506800 28800 1 NOVST} - {528231600 25200 0 NOVT} - {543956400 28800 1 NOVST} - {559681200 25200 0 NOVT} - {575406000 28800 1 NOVST} - {591130800 25200 0 NOVT} - {606855600 28800 1 NOVST} - {622580400 25200 0 NOVT} - {638305200 28800 1 NOVST} - {654634800 25200 0 NOVT} - {670359600 21600 0 NOVMMTT} - {670363200 25200 1 NOVST} - {686088000 21600 0 NOVT} - {695764800 25200 0 NOVMMTT} - {701809200 28800 1 NOVST} - {717534000 25200 0 NOVT} - {733258800 28800 1 NOVST} - {738090000 25200 0 NOVST} - {748987200 21600 0 NOVT} - {764712000 25200 1 NOVST} - {780436800 21600 0 NOVT} - {796161600 25200 1 NOVST} - {811886400 21600 0 NOVT} - {828216000 25200 1 NOVST} - {846360000 21600 0 NOVT} - {859665600 25200 1 NOVST} - {877809600 21600 0 NOVT} - {891115200 25200 1 NOVST} - {909259200 21600 0 NOVT} - {922564800 25200 1 NOVST} - {941313600 21600 0 NOVT} - {954014400 25200 1 NOVST} - {972763200 21600 0 NOVT} - {985464000 25200 1 NOVST} - {1004212800 21600 0 NOVT} - {1017518400 25200 1 NOVST} - {1035662400 21600 0 NOVT} - {1048968000 25200 1 NOVST} - {1067112000 21600 0 NOVT} - {1080417600 25200 1 NOVST} - {1099166400 21600 0 NOVT} - {1111867200 25200 1 NOVST} - {1130616000 21600 0 NOVT} - {1143316800 25200 1 NOVST} - {1162065600 21600 0 NOVT} - {1174766400 25200 1 NOVST} - {1193515200 21600 0 NOVT} - {1206820800 25200 1 NOVST} - {1224964800 21600 0 NOVT} - {1238270400 25200 1 NOVST} - {1256414400 21600 0 NOVT} - {1269720000 25200 1 NOVST} - {1288468800 21600 0 NOVT} - {1301169600 25200 0 NOVT} - {1414263600 21600 0 NOVT} + {-1579476700 21600 0 +06} + {-1247551200 25200 0 +08} + {354906000 28800 1 +08} + {370713600 25200 0 +07} + {386442000 28800 1 +08} + {402249600 25200 0 +07} + {417978000 28800 1 +08} + {433785600 25200 0 +07} + {449600400 28800 1 +08} + {465332400 25200 0 +07} + {481057200 28800 1 +08} + {496782000 25200 0 +07} + {512506800 28800 1 +08} + {528231600 25200 0 +07} + {543956400 28800 1 +08} + {559681200 25200 0 +07} + {575406000 28800 1 +08} + {591130800 25200 0 +07} + {606855600 28800 1 +08} + {622580400 25200 0 +07} + {638305200 28800 1 +08} + {654634800 25200 0 +07} + {670359600 21600 0 +07} + {670363200 25200 1 +07} + {686088000 21600 0 +06} + {695764800 25200 0 +08} + {701809200 28800 1 +08} + {717534000 25200 0 +07} + {733258800 28800 1 +08} + {738090000 25200 0 +07} + {748987200 21600 0 +06} + {764712000 25200 1 +07} + {780436800 21600 0 +06} + {796161600 25200 1 +07} + {811886400 21600 0 +06} + {828216000 25200 1 +07} + {846360000 21600 0 +06} + {859665600 25200 1 +07} + {877809600 21600 0 +06} + {891115200 25200 1 +07} + {909259200 21600 0 +06} + {922564800 25200 1 +07} + {941313600 21600 0 +06} + {954014400 25200 1 +07} + {972763200 21600 0 +06} + {985464000 25200 1 +07} + {1004212800 21600 0 +06} + {1017518400 25200 1 +07} + {1035662400 21600 0 +06} + {1048968000 25200 1 +07} + {1067112000 21600 0 +06} + {1080417600 25200 1 +07} + {1099166400 21600 0 +06} + {1111867200 25200 1 +07} + {1130616000 21600 0 +06} + {1143316800 25200 1 +07} + {1162065600 21600 0 +06} + {1174766400 25200 1 +07} + {1193515200 21600 0 +06} + {1206820800 25200 1 +07} + {1224964800 21600 0 +06} + {1238270400 25200 1 +07} + {1256414400 21600 0 +06} + {1269720000 25200 1 +07} + {1288468800 21600 0 +06} + {1301169600 25200 0 +07} + {1414263600 21600 0 +06} + {1469304000 25200 0 +07} } diff --git a/library/tzdata/Europe/Minsk b/library/tzdata/Europe/Minsk index 5e47063..2857e5b 100644 --- a/library/tzdata/Europe/Minsk +++ b/library/tzdata/Europe/Minsk @@ -30,10 +30,10 @@ set TZData(:Europe/Minsk) { {606870000 14400 1 MSD} {622594800 10800 0 MSK} {631141200 10800 0 MSK} - {670374000 10800 1 EEST} + {670374000 7200 0 EEMMTT} + {670377600 10800 1 EEST} {686102400 7200 0 EET} - {701820000 10800 1 EEST} - {717544800 10800 0 EEST} + {701827200 10800 1 EEST} {717552000 7200 0 EET} {733276800 10800 1 EEST} {749001600 7200 0 EET} diff --git a/library/tzdata/Indian/Kerguelen b/library/tzdata/Indian/Kerguelen index b41b85a..8820010 100644 --- a/library/tzdata/Indian/Kerguelen +++ b/library/tzdata/Indian/Kerguelen @@ -1,6 +1,6 @@ # created by tools/tclZIC.tcl - do not edit set TZData(:Indian/Kerguelen) { - {-9223372036854775808 0 0 zzz} + {-9223372036854775808 0 0 -00} {-631152000 18000 0 TFT} } -- cgit v0.12 From fcf66a8c31f5c02f6b8337c822d21e55c07df7f6 Mon Sep 17 00:00:00 2001 From: dgp Date: Wed, 20 Jul 2016 15:43:08 +0000 Subject: Use the new private flag INDEX_TEMP_TABLE in testing command too. --- generic/tclTestObj.c | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/generic/tclTestObj.c b/generic/tclTestObj.c index a637498..6053ae3 100644 --- a/generic/tclTestObj.c +++ b/generic/tclTestObj.c @@ -577,23 +577,9 @@ TestindexobjCmd( } argv[objc-4] = NULL; - /* - * Tcl_GetIndexFromObj assumes that the table is statically-allocated so - * that its address is different for each index object. If we accidently - * allocate a table at the same address as that cached in the index - * object, clear out the object's cached state. - */ - - if (objv[3]->typePtr != NULL - && !strcmp("index", objv[3]->typePtr->name)) { - indexRep = objv[3]->internalRep.twoPtrValue.ptr1; - if (indexRep->tablePtr == (void *) argv) { - TclFreeIntRep(objv[3]); - } - } - result = Tcl_GetIndexFromObj((setError? interp : NULL), objv[3], - argv, "token", (allowAbbrev? 0 : TCL_EXACT), &index); + argv, "token", INDEX_TEMP_TABLE|(allowAbbrev? 0 : TCL_EXACT), + &index); ckfree(argv); if (result == TCL_OK) { Tcl_SetIntObj(Tcl_GetObjResult(interp), index); -- cgit v0.12 From 1eff5acecce7c6cae25d692ba941f02c9961dc74 Mon Sep 17 00:00:00 2001 From: dgp Date: Wed, 20 Jul 2016 16:32:16 +0000 Subject: Use strchr() to parse array variable syntax. --- generic/tclVar.c | 58 +++++++++++++++----------------------------------------- 1 file changed, 15 insertions(+), 43 deletions(-) diff --git a/generic/tclVar.c b/generic/tclVar.c index 56c5a05..20fce82 100644 --- a/generic/tclVar.c +++ b/generic/tclVar.c @@ -504,9 +504,8 @@ TclObjLookupVarEx( register Var *varPtr; /* Points to the variable's in-frame Var * structure. */ const char *part1; - int index, len1, len2; + int index, len; int parsed = 0; - Tcl_Obj *objPtr; const Tcl_ObjType *typePtr = part1Ptr->typePtr; const char *errMsg = NULL; CallFrame *varFramePtr = iPtr->varFramePtr; @@ -566,18 +565,17 @@ TclObjLookupVarEx( } parsed = 1; } - part1 = TclGetStringFromObj(part1Ptr, &len1); + part1 = TclGetStringFromObj(part1Ptr, &len); - if (!parsed && len1 && (*(part1 + len1 - 1) == ')')) { + if (!parsed && len && (*(part1 + len - 1) == ')')) { /* * part1Ptr is possibly an unparsed array element. */ - register int i; + part2 = strchr(part1, '('); + if (part2) { + Tcl_Obj *arrayPtr; - len2 = -1; - for (i = 0; i < len1; i++) { - if (*(part1 + i) == '(') { if (part2Ptr != NULL) { if (flags & TCL_LEAVE_ERR_MSG) { TclObjVarErrMsg(interp, part1Ptr, part2Ptr, msg, @@ -588,44 +586,18 @@ TclObjLookupVarEx( return NULL; } - /* - * part1Ptr points to an array element; first copy the element - * name to a new string part2. - */ - - part2 = part1 + i + 1; - len2 = len1 - i - 2; - len1 = i; - - part2Ptr = Tcl_NewStringObj(part2, len2); - - /* - * Free the internal rep of the original part1Ptr, now renamed - * objPtr, and set it to tclParsedVarNameType. - */ + arrayPtr = Tcl_NewStringObj(part1, (part2 - part1)); + part2Ptr = Tcl_NewStringObj(part2 + 1, len - (part2 - part1) - 2); - objPtr = part1Ptr; - TclFreeIntRep(objPtr); - objPtr->typePtr = &tclParsedVarNameType; + TclFreeIntRep(part1Ptr); - /* - * Define a new string object to hold the new part1Ptr, i.e., - * the array name. Set the internal rep of objPtr, reset - * typePtr and part1 to contain the references to the array - * name. - */ - - TclNewStringObj(part1Ptr, part1, len1); - Tcl_IncrRefCount(part1Ptr); - - objPtr->internalRep.twoPtrValue.ptr1 = part1Ptr; - Tcl_IncrRefCount(part2Ptr); - objPtr->internalRep.twoPtrValue.ptr2 = part2Ptr; + Tcl_IncrRefCount(arrayPtr); + part1Ptr->internalRep.twoPtrValue.ptr1 = arrayPtr; + Tcl_IncrRefCount(part2Ptr); + part1Ptr->internalRep.twoPtrValue.ptr2 = part2Ptr; + part1Ptr->typePtr = &tclParsedVarNameType; - typePtr = part1Ptr->typePtr; - part1 = TclGetString(part1Ptr); - break; - } + part1Ptr = arrayPtr; } } -- cgit v0.12 From a7a2c2e589efa82857ba0a2526acede975aa89d0 Mon Sep 17 00:00:00 2001 From: dgp Date: Wed, 20 Jul 2016 17:39:04 +0000 Subject: Streamline TclObjLookupVarEx --- generic/tclVar.c | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/generic/tclVar.c b/generic/tclVar.c index 20fce82..55eb436 100644 --- a/generic/tclVar.c +++ b/generic/tclVar.c @@ -501,15 +501,13 @@ TclObjLookupVarEx( * is set to NULL. */ { Interp *iPtr = (Interp *) interp; + CallFrame *varFramePtr = iPtr->varFramePtr; register Var *varPtr; /* Points to the variable's in-frame Var * structure. */ - const char *part1; - int index, len; - int parsed = 0; - const Tcl_ObjType *typePtr = part1Ptr->typePtr; const char *errMsg = NULL; - CallFrame *varFramePtr = iPtr->varFramePtr; - const char *part2 = part2Ptr? TclGetString(part2Ptr):NULL; + int index, parsed = 0; + const Tcl_ObjType *typePtr = part1Ptr->typePtr; + *arrayPtrPtr = NULL; if (typePtr == &localVarNameType) { @@ -525,7 +523,7 @@ TclObjLookupVarEx( */ Tcl_Obj *namePtr = part1Ptr->internalRep.twoPtrValue.ptr1; - Tcl_Obj *checkNamePtr = localName(iPtr->varFramePtr, localIndex); + Tcl_Obj *checkNamePtr = localName(varFramePtr, localIndex); if ((!namePtr && (checkNamePtr == part1Ptr)) || (namePtr && (checkNamePtr == namePtr))) { @@ -565,15 +563,21 @@ TclObjLookupVarEx( } parsed = 1; } - part1 = TclGetStringFromObj(part1Ptr, &len); - if (!parsed && len && (*(part1 + len - 1) == ')')) { + if (!parsed) { + /* * part1Ptr is possibly an unparsed array element. */ - part2 = strchr(part1, '('); - if (part2) { + int len; + const char *part1 = TclGetStringFromObj(part1Ptr, &len); + + if (len > 1 && (part1[len - 1] == ')')) { + + const char *part2 = strchr(part1, '('); + + if (part2) { Tcl_Obj *arrayPtr; if (part2Ptr != NULL) { @@ -598,6 +602,7 @@ TclObjLookupVarEx( part1Ptr->typePtr = &tclParsedVarNameType; part1Ptr = arrayPtr; + } } } @@ -607,8 +612,6 @@ TclObjLookupVarEx( * the cached types if possible. */ - TclFreeIntRep(part1Ptr); - varPtr = TclLookupSimpleVar(interp, part1Ptr, flags, createPart1, &errMsg, &index); if (varPtr == NULL) { @@ -624,11 +627,12 @@ TclObjLookupVarEx( * Cache the newly found variable if possible. */ + TclFreeIntRep(part1Ptr); if (index >= 0) { /* * An indexed local variable. */ - Tcl_Obj *cachedNamePtr = localName(iPtr->varFramePtr, index); + Tcl_Obj *cachedNamePtr = localName(varFramePtr, index); part1Ptr->typePtr = &localVarNameType; if (part1Ptr != cachedNamePtr) { -- cgit v0.12 From 5ad954783e49a00f738e29083586df9f8c9411e0 Mon Sep 17 00:00:00 2001 From: dgp Date: Wed, 20 Jul 2016 20:39:16 +0000 Subject: Stop internals intrusion into lists. --- generic/tclExecute.c | 21 ++++----------------- 1 file changed, 4 insertions(+), 17 deletions(-) diff --git a/generic/tclExecute.c b/generic/tclExecute.c index f1205b0..a2a465a 100644 --- a/generic/tclExecute.c +++ b/generic/tclExecute.c @@ -5283,23 +5283,10 @@ TEBCresume( toIdx = objc-1; } if (fromIdx == 0 && toIdx != objc-1 && !Tcl_IsShared(valuePtr)) { - /* - * BEWARE! This is looking inside the implementation of the - * list type. - */ - - List *listPtr = valuePtr->internalRep.twoPtrValue.ptr1; - - if (listPtr->refCount == 1) { - for (index=toIdx+1; indexelemCount = toIdx+1; - listPtr->canonicalFlag = 1; - TclInvalidateStringRep(valuePtr); - TRACE_APPEND(("%.30s\n", O2S(valuePtr))); - NEXT_INST_F(9, 0, 0); - } + Tcl_ListObjReplace(interp, valuePtr, + toIdx + 1, LIST_MAX, 0, NULL); + TRACE_APPEND(("%.30s\n", O2S(valuePtr))); + NEXT_INST_F(9, 0, 0); } objResultPtr = Tcl_NewListObj(toIdx-fromIdx+1, objv+fromIdx); } else { -- cgit v0.12 From fa9c51579645df87feccb20a43ac952d79e2e0c9 Mon Sep 17 00:00:00 2001 From: dgp Date: Thu, 21 Jul 2016 16:20:38 +0000 Subject: Update changes file. --- changes | 74 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) diff --git a/changes b/changes index 1e24269..2ba6d42 100644 --- a/changes +++ b/changes @@ -8624,3 +8624,77 @@ improvements to regexp engine from Postgres (lane,porter,fellows,seltenreich) 2016-02-22 (bug)[9b4702] [info exists env(missing)] kills trace (nijtmans) --- Released 8.6.5, February 29, 2016 --- http://core.tcl.tk/tcl/ for details + +2016-03-01 (bug)[803042] mem leak due to reference cycle (porter) + +2016-03-08 (bug)[bbc304] reflected watch race condition (porter) + +2016-03-17 (bug)[fadc99] compile-5.3 (rodriguez,porter) + +2016-03-17 (enhancement)[1a25fd] compile [variable ${ns}::v] (porter) + +2016-03-20 (bug)[1af8de] crash in compiled [string replace] (harder,fellows) + +2016-03-21 (bug)[d30718] segv in notifier finalize (hirofumi,nijtmans) + +2016-03-23 (enhancement)[7d0db7] parallel make (yarda,nijtmans) + +2016-03-23 [f12535] enable test bindings customization (vogel,nijtmans) + +2016-04-04 (bug)[47ac84] compiled [lreplace] fixes (aspect,ferrieux,fellows) + *** POTENTIAL INCOMPATIBILITY *** + +2016-04-08 (bug)[866368] RE \w includes 'Punctuation Connector' (nijtmans) + +2016-04-08 (bug)[2538f3] Win crash Tcl_OpenTcpServer() (griffin) + +2016-04-10 [07d13d] Restore TclBlend support lost in 8.6.1 (buratti) + +2016-05-13 (bug)[3154ea] Mem corruption in assembler exceptions (tkob,kenny) + +2016-05-13 (bug) registry package support any Unicode env (nijtmans) +=> registry 1.3.2 + +2016-05-21 (bug)[f7d4e] [namespace delete] performance (fellows) + +2016-06-02 (TIP 447) execution time verbosity option (cerutti) +=> tcltest 2.4.0 + +2016-06-16 (bug)[16828b] crash due to [vwait] trace undo fail (dah,porter) + +2016-06-16 (enhancement)[4b61af] good [info frame] from more cases (beric) + +2016-06-21 (bug)[c383eb] crash in [glob -path a] (oehlmann,porter) + +2016-06-21 (update) Update Unicode data to 9.0 (nijtmans) + *** POTENTIAL INCOMPATIBILITY *** + +2016-06-22 (bug)[16896d] Tcl_DString tolerate append to self. (dah,porter) + +2016-06-23 (bug)[d55322] crash in [dict update] (yorick,fellows) + +2016-06-27 (bug)[dd260a] crash in [chan configure -dictionary] (madden,aspect) + +2016-07-02 (bug)[f961d7] usage message with parameters with spaces (porter) + *** POTENTIAL INCOMPATIBILITY *** + +2016-07-02 (enhancement)[09fabc] Sort order of -relateddir (lanam) + +2016-07-07 (bug)[5d7ca0] Win: [file executable] for .cmd and .ps1 (nadkarni) + *** POTENTIAL INCOMPATIBILITY *** + +2016-07-08 (bug)[a47641] [file normalize] & Windows junctions (nadkarni) + +2016-07-09 [ae61a6] [file] handling of Win hardcoded names (CON) (nadkarni) + *** POTENTIAL INCOMPATIBILITY *** + +2016-07-09 [3613671] [file owned] (more) useful on Win (nadkarni) + +2016-07-09 (bug)[1493a4] [namespace upvar] use of resolvers (beric,fellows) + *** POTENTIAL INCOMPATIBILITY *** + +2016-07-10 (bug)[da340d] integer division in clock math (nadkarni) + +2016-07-20 tzdata updated to Olson's tzdata2016f (venkat) + +--- Released 8.6.6, August ?, 2016 --- http://core.tcl.tk/tcl/ for details -- cgit v0.12 From 6239155e85e232727ff14b9f2a6992158ca5a781 Mon Sep 17 00:00:00 2001 From: dgp Date: Fri, 22 Jul 2016 14:00:01 +0000 Subject: Set release date --- changes | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changes b/changes index 2ba6d42..034380b 100644 --- a/changes +++ b/changes @@ -8697,4 +8697,4 @@ improvements to regexp engine from Postgres (lane,porter,fellows,seltenreich) 2016-07-20 tzdata updated to Olson's tzdata2016f (venkat) ---- Released 8.6.6, August ?, 2016 --- http://core.tcl.tk/tcl/ for details +--- Released 8.6.6, July 27, 2016 --- http://core.tcl.tk/tcl/ for details -- cgit v0.12 From 7b960b4cdbdb05dd87c12eff280e839eace1cd54 Mon Sep 17 00:00:00 2001 From: dgp Date: Fri, 22 Jul 2016 15:28:50 +0000 Subject: test repairs --- tests/chanio.test | 2 -- tests/info.test | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/tests/chanio.test b/tests/chanio.test index 29f42c3..9a27233 100644 --- a/tests/chanio.test +++ b/tests/chanio.test @@ -6790,8 +6790,6 @@ test chan-io-52.11 {TclCopyChannel & encodings} -setup { chan close $in chan close $out file size $path(kyrillic.txt) -} -cleanup { - file delete $path(utf8-fcopy.txt) } -result 3 test chan-io-53.1 {CopyData} -setup { diff --git a/tests/info.test b/tests/info.test index c4fd379..42f5a96 100644 --- a/tests/info.test +++ b/tests/info.test @@ -1841,7 +1841,7 @@ test info-30.48 {Bug 2850901} testevalex { # ------------------------------------------------------------------------- # literal sharing 2, bug 2933089 -test info-39.1 {location information not confused by literal sharing, bug 2933089} -setup { +test info-40.1 {location information not confused by literal sharing, bug 2933089} -setup { set result {} proc print_one {} {} -- cgit v0.12 From 3e6a6753f751ed2cec8c6119d295e4ae7be26852 Mon Sep 17 00:00:00 2001 From: dkf Date: Sun, 24 Jul 2016 12:45:07 +0000 Subject: Make a few tests more resilient to differences in the semantics of pipes between operating systems. --- doc/chan.n | 12 ++++++++++++ tests/zlib.test | 12 ++++++++---- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/doc/chan.n b/doc/chan.n index 7ea0d19..cc53d3b 100644 --- a/doc/chan.n +++ b/doc/chan.n @@ -547,6 +547,18 @@ this, spawn with "2>@" or ">@" redirection operators onto the write side of a pipe, and then immediately close it in the parent. This is necessary to get an EOF on the read side once the child has exited or otherwise closed its output. +.RS +.PP +Note that the pipe buffering semantics can vary at the operating system level +substantially; it is not safe to assume that a write performed on the output +side of the pipe will appear instantly to the input side. This is a +fundamental difference and Tcl cannot conceal it. The overall stream semantics +\fIare\fR compatible, so blocking reads and writes will not see most of the +differences, but the details of what exactly gets written when are not. This +is most likely to show up when using pipelines for testing; care should be +taken to ensure that deadlocks do not occur and that potential short reads are +allowed for. +.RE .VE 8.6 .TP \fBchan pop \fIchannelId\fR diff --git a/tests/zlib.test b/tests/zlib.test index c9e5f10..8a040d8 100644 --- a/tests/zlib.test +++ b/tests/zlib.test @@ -251,9 +251,10 @@ test zlib-8.8 {transformation and fconfigure} -setup { } -constraints zlib -body { zlib push compress $outSide -dictionary $spdyDict fconfigure $outSide -blocking 0 -translation binary -buffering none - fconfigure $inSide -blocking 0 -translation binary + fconfigure $inSide -blocking 1 -translation binary puts -nonewline $outSide $spdyHeaders chan pop $outSide + chan close $outSide set compressed [read $inSide] catch {zlib decompress $compressed} err opt list [string length [zlib compress $spdyHeaders]] \ @@ -269,10 +270,11 @@ test zlib-8.9 {transformation and fconfigure} -setup { } -constraints zlib -body { zlib push compress $outSide -dictionary $spdyDict fconfigure $outSide -blocking 0 -translation binary -buffering none - fconfigure $inSide -blocking 0 -translation binary + fconfigure $inSide -blocking 1 -translation binary puts -nonewline $outSide $spdyHeaders set result [fconfigure $outSide -checksum] chan pop $outSide + chan close $outSide $strm put -dictionary $spdyDict [read $inSide] lappend result [string length $spdyHeaders] [string length [$strm get]] } -cleanup { @@ -285,9 +287,10 @@ test zlib-8.10 {transformation and fconfigure} -setup { } -constraints {zlib recentZlib} -body { zlib push deflate $outSide -dictionary $spdyDict fconfigure $outSide -blocking 0 -translation binary -buffering none - fconfigure $inSide -blocking 0 -translation binary + fconfigure $inSide -blocking 1 -translation binary puts -nonewline $outSide $spdyHeaders chan pop $outSide + chan close $outSide set compressed [read $inSide] catch { zlib inflate $compressed @@ -306,9 +309,10 @@ test zlib-8.11 {transformation and fconfigure} -setup { } -constraints zlib -body { zlib push deflate $outSide -dictionary $spdyDict fconfigure $outSide -blocking 0 -translation binary -buffering none - fconfigure $inSide -blocking 0 -translation binary + fconfigure $inSide -blocking 1 -translation binary puts -nonewline $outSide $spdyHeaders chan pop $outSide + chan close $outSide $strm put -dictionary $spdyDict [read $inSide] list [string length $spdyHeaders] [string length [$strm get]] } -cleanup { -- cgit v0.12 From f6a4d71bada6d59b1daf550d919038e8e34ba666 Mon Sep 17 00:00:00 2001 From: dkf Date: Sun, 24 Jul 2016 13:09:40 +0000 Subject: [6a19dedc2e] "Clarified" what the units are that [chan copy] uses for -size and that synchronous copying returns. --- doc/chan.n | 14 ++++++++------ doc/fcopy.n | 12 +++++++++--- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/doc/chan.n b/doc/chan.n index 7ea0d19..36d56f8 100644 --- a/doc/chan.n +++ b/doc/chan.n @@ -287,12 +287,14 @@ slow destinations like network sockets. .RS .PP The \fBchan copy\fR command transfers data from \fIinputChan\fR until -end of file or \fIsize\fR bytes have been transferred. If no -\fB\-size\fR argument is given, then the copy goes until end of file. -All the data read from \fIinputChan\fR is copied to \fIoutputChan\fR. -Without the \fB\-command\fR option, \fBchan copy\fR blocks until the -copy is complete and returns the number of bytes written to -\fIoutputChan\fR. +end of file or \fIsize\fR bytes or characters have been transferred; +\fIsize\fR is in bytes if the two channels are using the same encoding, +and is in characters otherwise. If no \fB\-size\fR argument is given, +then the copy goes until end of file. All the data read from +\fIinputChan\fR is copied to \fIoutputChan\fR. Without the +\fB\-command\fR option, \fBchan copy\fR blocks until the copy is +complete and returns the number of bytes or characters (using the same +rules as for the \fB\-size\fR option) written to \fIoutputChan\fR. .PP The \fB\-command\fR argument makes \fBchan copy\fR work in the background. In this case it returns immediately and the diff --git a/doc/fcopy.n b/doc/fcopy.n index e5dd1d6..d39c803 100644 --- a/doc/fcopy.n +++ b/doc/fcopy.n @@ -25,12 +25,15 @@ network sockets. .PP The \fBfcopy\fR command transfers data from \fIinchan\fR until end of file -or \fIsize\fR bytes have been -transferred. If no \fB\-size\fR argument is given, +or \fIsize\fR bytes or characters have been +transferred; \fIsize\fR is in bytes if the two channels are using the +same encoding, and is in characters otherwise. +If no \fB\-size\fR argument is given, then the copy goes until end of file. All the data read from \fIinchan\fR is copied to \fIoutchan\fR. Without the \fB\-command\fR option, \fBfcopy\fR blocks until the copy is complete -and returns the number of bytes written to \fIoutchan\fR. +and returns the number of bytes or characters (using the same rules as +for the \fB\-size\fR option) written to \fIoutchan\fR. .PP The \fB\-command\fR argument makes \fBfcopy\fR work in the background. In this case it returns immediately and the \fIcallback\fR is invoked @@ -174,3 +177,6 @@ vwait done eof(n), fblocked(n), fconfigure(n), file(n) .SH KEYWORDS blocking, channel, end of line, end of file, nonblocking, read, translation +'\" Local Variables: +'\" mode: nroff +'\" End: -- cgit v0.12 From 53b6bf7310b56ceb0c4d2d16a0252a3c600924b1 Mon Sep 17 00:00:00 2001 From: Joe Mistachkin Date: Tue, 9 Aug 2016 21:03:28 +0000 Subject: Fix the 'htmlhelp' target so that it compiles cleanly and includes all the appropriate HTML files. --- win/makefile.vc | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/win/makefile.vc b/win/makefile.vc index eb9a594..7c65aea 100644 --- a/win/makefile.vc +++ b/win/makefile.vc @@ -747,7 +747,7 @@ htmlhelp: chmsetup $(CHMFILE) $(CHMFILE): $(DOCDIR)\* @$(TCLSH) $(TOOLSDIR)\tcltk-man2html.tcl @echo Compiling HTML help project - @$(HHC) <<$(HHPFILE) >NUL + -$(HHC) <<$(HHPFILE) >NUL [OPTIONS] Compatibility=1.1 or later Compiled file=$(HTMLBASE).chm @@ -758,12 +758,12 @@ Title=Tcl/Tk $(DOT_VERSION) Help [FILES] contents.htm docs.css -Keywords -TclCmd -TclLib -TkCmd -TkLib -UserCmd +Keywords\*.htm +TclCmd\*.htm +TclLib\*.htm +TkCmd\*.htm +TkLib\*.htm +UserCmd\*.htm << chmsetup: -- cgit v0.12 From 5842060393afb827aa8caa426fdd32a58e7f8005 Mon Sep 17 00:00:00 2001 From: Joe Mistachkin Date: Wed, 10 Aug 2016 03:13:46 +0000 Subject: Set the default topic, enable full-text search, and put all help output files under OUT_DIR. --- win/makefile.vc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/win/makefile.vc b/win/makefile.vc index 7c65aea..f401541 100644 --- a/win/makefile.vc +++ b/win/makefile.vc @@ -737,7 +737,7 @@ gentommath_h: !ifndef HHC HHC=""%ProgramFiles%\HTML Help Workshop\hhc.exe"" !endif -HTMLDIR=$(ROOT)\html +HTMLDIR=$(OUT_DIR)\html HTMLBASE=TclTk$(VERSION) HHPFILE=$(HTMLDIR)\$(HTMLBASE).hhp CHMFILE=$(HTMLDIR)\$(HTMLBASE).chm @@ -745,14 +745,16 @@ CHMFILE=$(HTMLDIR)\$(HTMLBASE).chm htmlhelp: chmsetup $(CHMFILE) $(CHMFILE): $(DOCDIR)\* - @$(TCLSH) $(TOOLSDIR)\tcltk-man2html.tcl + @$(TCLSH) $(TOOLSDIR)\tcltk-man2html.tcl "--htmldir=$(HTMLDIR)" @echo Compiling HTML help project -$(HHC) <<$(HHPFILE) >NUL [OPTIONS] Compatibility=1.1 or later Compiled file=$(HTMLBASE).chm +Default topic=contents.htm Display compile progress=no Error log file=$(HTMLBASE).log +Full-text search=Yes Language=0x409 English (United States) Title=Tcl/Tk $(DOT_VERSION) Help [FILES] -- cgit v0.12 From a6063330c474dde9b388bfeda1b1bb746aebf23a Mon Sep 17 00:00:00 2001 From: dgp Date: Fri, 26 Aug 2016 13:46:37 +0000 Subject: Merge dup-removal into search loop so we avoid pre-processing efforts on data that are never used. Contributed patch from Brian Griffin. --- library/auto.tcl | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/library/auto.tcl b/library/auto.tcl index 02edcc4..97ea8af 100644 --- a/library/auto.tcl +++ b/library/auto.tcl @@ -122,11 +122,9 @@ proc tcl_findLibrary {basename version patch initScript enVarName varName} { # uniquify $dirs in order array set seen {} foreach i $dirs { - # Take note that the [file normalize] below has been noted to cause - # difficulties for the freewrap utility. See Bug 1072136. Until - # freewrap resolves the matter, one might work around the problem by - # disabling that branch. + # Make sure $i is unique under normalization. Avoid repeated [source]. if {[interp issafe]} { + # Safe interps have no [file normalize]. set norm $i } else { set norm [file normalize $i] @@ -135,10 +133,7 @@ proc tcl_findLibrary {basename version patch initScript enVarName varName} { continue } set seen($norm) {} - lappend uniqdirs $i - } - set dirs $uniqdirs - foreach i $dirs { + set the_library $i set file [file join $i $initScript] -- cgit v0.12 From d84492f3906d20d05b547a4fa90286fe0a59bb37 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Tue, 30 Aug 2016 13:00:32 +0000 Subject: Don't ever allow UTF-8 sequences of more than 4 characters to be generated or parsed, even when TCL_UTF_MAX>4: According to current Unicode standard, a byte string of >4 characters can never form a single UTF-8 character. And a few minor micro-optimizations related to UTF-8 handling. --- generic/tclUtf.c | 68 ++++++++++++++++++++------------------------------------ 1 file changed, 24 insertions(+), 44 deletions(-) diff --git a/generic/tclUtf.c b/generic/tclUtf.c index b878149..68119a4 100644 --- a/generic/tclUtf.c +++ b/generic/tclUtf.c @@ -73,16 +73,7 @@ static const unsigned char totalBytes[256] = { #else 1,1,1,1,1,1,1,1, #endif -#if TCL_UTF_MAX > 4 - 5,5,5,5, -#else - 1,1,1,1, -#endif -#if TCL_UTF_MAX > 5 - 6,6,6,6 -#else - 1,1,1,1 -#endif + 1,1,1,1,1,1,1,1 }; /* @@ -111,14 +102,14 @@ INLINE static int UtfCount( int ch) /* The Tcl_UniChar whose size is returned. */ { - if ((ch > 0) && (ch < UNICODE_SELF)) { + if ((unsigned)(ch - 1) < (UNICODE_SELF - 1)) { return 1; } if (ch <= 0x7FF) { return 2; } #if TCL_UTF_MAX > 3 - if ((ch > 0xFFFF) && (ch <= 0x10FFFF)) { + if (((unsigned)(ch - 0x10000) <= 0xfffff)) { return 4; } #endif @@ -152,7 +143,7 @@ Tcl_UniCharToUtf( * large enough to hold the UTF-8 character * (at most TCL_UTF_MAX bytes). */ { - if ((ch > 0) && (ch < UNICODE_SELF)) { + if ((unsigned)(ch - 1) < (UNICODE_SELF - 1)) { buf[0] = (char) ch; return 1; } @@ -180,11 +171,7 @@ Tcl_UniCharToUtf( } } #endif - three: - buf[2] = (char) ((ch | 0x80) & 0xBF); - buf[1] = (char) (((ch >> 6) | 0x80) & 0xBF); - buf[0] = (char) ((ch >> 12) | 0xE0); - return 3; + goto three; } #if TCL_UTF_MAX > 3 @@ -199,7 +186,11 @@ Tcl_UniCharToUtf( } ch = 0xFFFD; - goto three; +three: + buf[2] = (char) ((ch | 0x80) & 0xBF); + buf[1] = (char) (((ch >> 6) | 0x80) & 0xBF); + buf[0] = (char) ((ch >> 12) | 0xE0); + return 3; } /* @@ -314,9 +305,6 @@ Tcl_UtfToUniChar( * A two-byte-character lead-byte not followed by trail-byte * represents itself. */ - - *chPtr = (Tcl_UniChar) byte; - return 1; } else if (byte < 0xF0) { if (((src[1] & 0xC0) == 0x80) && ((src[2] & 0xC0) == 0x80)) { /* @@ -332,31 +320,23 @@ Tcl_UtfToUniChar( * A three-byte-character lead-byte not followed by two trail-bytes * represents itself. */ - - *chPtr = (Tcl_UniChar) byte; - return 1; } #if TCL_UTF_MAX > 3 - { - int ch, total, trail; - - total = totalBytes[byte]; - trail = total - 1; - if (trail > 0) { - ch = byte & (0x3F >> trail); - do { - src++; - if ((*src & 0xC0) != 0x80) { - *chPtr = byte; - return 1; - } - ch <<= 6; - ch |= (*src & 0x3F); - trail--; - } while (trail > 0); - *chPtr = ch; - return total; + else if (byte < 0xF8) { + if (((src[1] & 0xC0) == 0x80) && ((src[2] & 0xC0) == 0x80) && ((src[3] & 0xC0) == 0x80)) { + /* + * Four-byte-character lead byte followed by three trail bytes. + */ + + *chPtr = (Tcl_UniChar) (((byte & 0x0E) << 18) | ((src[1] & 0x3F) << 12) + | ((src[2] & 0x3F) << 6) | (src[3] & 0x3F)); + return 4; } + + /* + * A three-byte-character lead-byte not followed by two trail-bytes + * represents itself. + */ } #endif -- cgit v0.12 From 68caa10ca3562292a830860aaa37289795fe68b7 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Fri, 2 Sep 2016 12:11:01 +0000 Subject: Proposed patch for [d4e7780ca1681cd095dbd81fe264feff75c988f7|d4e7780ca1], by Gustaf Neumann --- generic/tclCompExpr.c | 2 +- generic/tclCompile.c | 16 ++++-- generic/tclCompile.h | 5 +- generic/tclEnsemble.c | 9 +++- generic/tclInt.h | 10 ++-- generic/tclLiteral.c | 33 ++++++++---- generic/tclNamesp.c | 3 ++ generic/tclObj.c | 9 +++- generic/tclTest.c | 104 ++++++++++++++++++++++++++++++------- tests/resolver.test | 141 ++++++++++++++++++++++++++++++++++++++++++++++---- 10 files changed, 279 insertions(+), 53 deletions(-) diff --git a/generic/tclCompExpr.c b/generic/tclCompExpr.c index 4390282..ab5e8af 100644 --- a/generic/tclCompExpr.c +++ b/generic/tclCompExpr.c @@ -2272,7 +2272,7 @@ CompileExprTree( Tcl_DStringAppend(&cmdName, p, length); TclEmitPush(TclRegisterNewCmdLiteral(envPtr, Tcl_DStringValue(&cmdName), - Tcl_DStringLength(&cmdName)), envPtr); + Tcl_DStringLength(&cmdName), 0), envPtr); Tcl_DStringFree(&cmdName); /* diff --git a/generic/tclCompile.c b/generic/tclCompile.c index c0203dd..4e4ead6 100644 --- a/generic/tclCompile.c +++ b/generic/tclCompile.c @@ -1781,10 +1781,20 @@ CompileCmdLiteral( CompileEnv *envPtr) { int numBytes; - const char *bytes = Tcl_GetStringFromObj(cmdObj, &numBytes); - int cmdLitIdx = TclRegisterNewCmdLiteral(envPtr, bytes, numBytes); - Command *cmdPtr = (Command *) Tcl_GetCommandFromObj(interp, cmdObj); + const char *bytes; + Command *cmdPtr; + int cmdLitIdx, extraLiteralFlags = 0; + + cmdPtr = (Command *) Tcl_GetCommandFromObj(interp, cmdObj); + if (cmdPtr != NULL) { + if ((cmdPtr->flags & CMD_VIA_RESOLVER)) { + extraLiteralFlags = LITERAL_UNSHARED; + } + } + bytes = Tcl_GetStringFromObj(cmdObj, &numBytes); + cmdLitIdx = TclRegisterNewCmdLiteral(envPtr, bytes, numBytes, extraLiteralFlags); + if (cmdPtr) { TclSetCmdNameObj(interp, TclFetchLiteral(envPtr, cmdLitIdx), cmdPtr); } diff --git a/generic/tclCompile.h b/generic/tclCompile.h index d5bc86b..fa76f83 100644 --- a/generic/tclCompile.h +++ b/generic/tclCompile.h @@ -1208,6 +1208,7 @@ MODULE_SCOPE int TclPushProcCallFrame(ClientData clientData, #define LITERAL_ON_HEAP 0x01 #define LITERAL_CMD_NAME 0x02 +#define LITERAL_UNSHARED 0x04 /* * Form of TclRegisterLiteral with flags == 0. In that case, it is safe to @@ -1229,8 +1230,8 @@ MODULE_SCOPE int TclPushProcCallFrame(ClientData clientData, * int length); */ -#define TclRegisterNewCmdLiteral(envPtr, bytes, length) \ - TclRegisterLiteral(envPtr, (char *)(bytes), length, LITERAL_CMD_NAME) +#define TclRegisterNewCmdLiteral(envPtr, bytes, length, extraLiteralFlags) \ + TclRegisterLiteral(envPtr, (char *)(bytes), length, ((extraLiteralFlags)|LITERAL_CMD_NAME)) /* * Macro used to manually adjust the stack requirements; used in cases where diff --git a/generic/tclEnsemble.c b/generic/tclEnsemble.c index 8e5e410..22c475f 100644 --- a/generic/tclEnsemble.c +++ b/generic/tclEnsemble.c @@ -3306,7 +3306,7 @@ CompileToInvokedCommand( Tcl_Token *tokPtr; Tcl_Obj *objPtr, **words; char *bytes; - int length, i, numWords, cmdLit; + int length, i, numWords, cmdLit, extraLiteralFlags = 0; DefineLineInformation; /* @@ -3349,7 +3349,12 @@ CompileToInvokedCommand( objPtr = Tcl_NewObj(); Tcl_GetCommandFullName(interp, (Tcl_Command) cmdPtr, objPtr); bytes = Tcl_GetStringFromObj(objPtr, &length); - cmdLit = TclRegisterNewCmdLiteral(envPtr, bytes, length); + if (cmdPtr != NULL) { + if ((cmdPtr->flags & CMD_VIA_RESOLVER)) { + extraLiteralFlags = LITERAL_UNSHARED; + } + } + cmdLit = TclRegisterNewCmdLiteral(envPtr, bytes, length, extraLiteralFlags); TclSetCmdNameObj(interp, TclFetchLiteral(envPtr, cmdLit), cmdPtr); TclEmitPush(cmdLit, envPtr); TclDecrRefCount(objPtr); diff --git a/generic/tclInt.h b/generic/tclInt.h index 4f7ea6e..4d3c0b1 100644 --- a/generic/tclInt.h +++ b/generic/tclInt.h @@ -1677,11 +1677,13 @@ typedef struct Command { * (these last two flags are defined in tcl.h) */ -#define CMD_IS_DELETED 0x1 -#define CMD_TRACE_ACTIVE 0x2 -#define CMD_HAS_EXEC_TRACES 0x4 -#define CMD_COMPILES_EXPANDED 0x8 +#define CMD_IS_DELETED 0x01 +#define CMD_TRACE_ACTIVE 0x02 +#define CMD_HAS_EXEC_TRACES 0x04 +#define CMD_COMPILES_EXPANDED 0x08 #define CMD_REDEF_IN_PROGRESS 0x10 +#define CMD_VIA_RESOLVER 0x20 + /* *---------------------------------------------------------------- diff --git a/generic/tclLiteral.c b/generic/tclLiteral.c index 03200ca..864d050 100644 --- a/generic/tclLiteral.c +++ b/generic/tclLiteral.c @@ -214,15 +214,16 @@ TclCreateLiteral( if (globalPtrPtr) { *globalPtrPtr = globalPtr; } - if (flags & LITERAL_ON_HEAP) { + if ((flags & LITERAL_ON_HEAP)) { ckfree(bytes); } globalPtr->refCount++; return objPtr; } } + if (!newPtr) { - if (flags & LITERAL_ON_HEAP) { + if ((flags & LITERAL_ON_HEAP)) { ckfree(bytes); } return NULL; @@ -235,13 +236,24 @@ TclCreateLiteral( TclNewObj(objPtr); Tcl_IncrRefCount(objPtr); - if (flags & LITERAL_ON_HEAP) { + if ((flags & LITERAL_ON_HEAP)) { objPtr->bytes = bytes; objPtr->length = length; } else { TclInitStringRep(objPtr, bytes, length); } + if ((flags & LITERAL_UNSHARED)) { + /* + * Make clear, that no global value is returned + */ + if (globalPtrPtr != NULL) { + *globalPtrPtr = NULL; + } + /*fprintf(stderr, "UNSHARED LITERAL <%s>\n", bytes);*/ + return objPtr; + } + #ifdef TCL_COMPILE_DEBUG if (LookupLiteralEntry((Tcl_Interp *) iPtr, objPtr) != NULL) { Tcl_Panic("%s: literal \"%.*s\" found globally but shouldn't be", @@ -417,7 +429,7 @@ TclRegisterLiteral( * the namespace as the interp's global NS. */ - if (flags & LITERAL_CMD_NAME) { + if ((flags & LITERAL_CMD_NAME)) { if ((length >= 2) && (bytes[0] == ':') && (bytes[1] == ':')) { nsPtr = iPtr->globalNsPtr; } else { @@ -426,17 +438,17 @@ TclRegisterLiteral( } else { nsPtr = NULL; } - + /* * Is it in the interpreter's global literal table? If not, create it. */ - + globalPtr = NULL; objPtr = TclCreateLiteral(iPtr, bytes, length, hash, &new, nsPtr, flags, &globalPtr); objIndex = AddLocalLiteralEntry(envPtr, objPtr, localHash); #ifdef TCL_COMPILE_DEBUG - if (globalPtr->refCount < 1) { + if (globalPtr != NULL && globalPtr->refCount < 1) { Tcl_Panic("%s: global literal \"%.*s\" had bad refCount %d", "TclRegisterLiteral", (length>60? 60 : length), bytes, globalPtr->refCount); @@ -1155,9 +1167,10 @@ TclVerifyLocalLiteralTable( if (LookupLiteralEntry((Tcl_Interp *) envPtr->iPtr, localPtr->objPtr) == NULL) { bytes = Tcl_GetStringFromObj(localPtr->objPtr, &length); - Tcl_Panic("%s: local literal \"%.*s\" is not global", - "TclVerifyLocalLiteralTable", - (length>60? 60 : length), bytes); + //Tcl_Panic("%s: local literal \"%.*s\" is not global", + // "TclVerifyLocalLiteralTable", + // (length>60? 60 : length), bytes); + /*fprintf(stderr, "local literal \"%s\" is not global\n",bytes);*/ } if (localPtr->objPtr->bytes == NULL) { Tcl_Panic("%s: literal has NULL string rep", diff --git a/generic/tclNamesp.c b/generic/tclNamesp.c index 5930859..a8d351f 100644 --- a/generic/tclNamesp.c +++ b/generic/tclNamesp.c @@ -2566,7 +2566,9 @@ Tcl_FindCommand( } if (result == TCL_OK) { + ((Command *)cmd)->flags |= CMD_VIA_RESOLVER; return cmd; + } else if (result != TCL_CONTINUE) { return NULL; } @@ -2658,6 +2660,7 @@ Tcl_FindCommand( } if (cmdPtr != NULL) { + cmdPtr->flags &= ~CMD_VIA_RESOLVER; return (Tcl_Command) cmdPtr; } diff --git a/generic/tclObj.c b/generic/tclObj.c index 628c3a7..661ab48 100644 --- a/generic/tclObj.c +++ b/generic/tclObj.c @@ -4219,7 +4219,10 @@ TclSetCmdNameObj( const char *name; if (objPtr->typePtr == &tclCmdNameType) { - return; + resPtr = objPtr->internalRep.twoPtrValue.ptr1; + if (resPtr->cmdPtr == cmdPtr) { + return; + } } cmdPtr->refCount++; @@ -4397,7 +4400,9 @@ SetCmdNameFromAny( cmdPtr->refCount++; resPtr = objPtr->internalRep.twoPtrValue.ptr1; if ((objPtr->typePtr == &tclCmdNameType) - && resPtr && (resPtr->refCount == 1)) { + && resPtr != NULL + && (resPtr->refCount == 1) + ) { /* * Reuse the old ResolvedCmdName struct instead of freeing it */ diff --git a/generic/tclTest.c b/generic/tclTest.c index e33d263..522e966 100644 --- a/generic/tclTest.c +++ b/generic/tclTest.c @@ -7295,29 +7295,88 @@ InterpCmdResolver( int flags, Tcl_Command *rPtr) { - Interp *iPtr = (Interp *) interp; - CallFrame *varFramePtr = iPtr->varFramePtr; - Proc *procPtr = (varFramePtr->isProcCallFrame & FRAME_IS_PROC) ? - varFramePtr->procPtr : NULL; - Namespace *ns2NsPtr = (Namespace *) - Tcl_FindNamespace(interp, "::ns2", NULL, 0); - - if (procPtr && (procPtr->cmdPtr->nsPtr == iPtr->globalNsPtr - || (ns2NsPtr && procPtr->cmdPtr->nsPtr == ns2NsPtr))) { - const char *callingCmdName = + Interp *iPtr = (Interp *) interp; + CallFrame *varFramePtr = iPtr->varFramePtr; + Proc *procPtr = (varFramePtr->isProcCallFrame & FRAME_IS_PROC) ? varFramePtr->procPtr : NULL; + Namespace *callerNsPtr = varFramePtr->nsPtr; + Tcl_Command resolvedCmdPtr = NULL; + + /* + * Just do something special on a cmd literal "z" in two cases: + * A) when the caller is a proc "x", and the proc is either in "::" or in "::ns2". + * B) the caller's namespace is "ctx1" or "ctx2" + */ + if ( (name[0] == 'z') && (name[1] == '\0') ) { + Namespace *ns2NsPtr = (Namespace *) Tcl_FindNamespace(interp, "::ns2", NULL, 0); + + if (procPtr != NULL + && ((procPtr->cmdPtr->nsPtr == iPtr->globalNsPtr) + || (ns2NsPtr != NULL && procPtr->cmdPtr->nsPtr == ns2NsPtr) + ) + ) { + /* + * Case A) + * + * - The context, in which this resolver becomes active, is + * determined by the name of the caller proc, which has to be + * named "x". + * + * - To determine the name of the caller proc, the proc is taken + * from the topmost stack frame. + * + * - Note that the context is NOT provided during byte-code + * compilation (e.g. in TclProcCompileProc) + * + * When these conditions hold, this function resolves the + * passed-in cmd literal into a cmd "y", which is taken from the + * the global namespace (for simplicity). + */ + + const char *callingCmdName = Tcl_GetCommandName(interp, (Tcl_Command) procPtr->cmdPtr); + + if ( callingCmdName[0] == 'x' && callingCmdName[1] == '\0' ) { + resolvedCmdPtr = Tcl_FindCommand(interp, "y", NULL, TCL_GLOBAL_ONLY); + } + } else if (callerNsPtr != NULL) { + /* + * Case B) + * + * - The context, in which this resolver becomes active, is + * determined by the name of the parent namespace, which has + * to be named "ctx1" or "ctx2". + * + * - To determine the name of the parent namesace, it is taken + * from the 2nd highest stack frame. + * + * - Note that the context can be provided during byte-code + * compilation (e.g. in TclProcCompileProc) + * + * When these conditions hold, this function resolves the + * passed-in cmd literal into a cmd "y" or "Y" depending on the + * context. The resolved procs are taken from the the global + * namespace (for simplicity). + */ - if ((callingCmdName[0] == 'x') && (callingCmdName[1] == '\0') - && (name[0] == 'z') && (name[1] == '\0')) { - Tcl_Command sourceCmdPtr = Tcl_FindCommand(interp, "y", NULL, - TCL_GLOBAL_ONLY); + CallFrame *parentFramePtr = varFramePtr->callerPtr; + char *context = parentFramePtr != NULL ? parentFramePtr->nsPtr->name : "(NULL)"; - if (sourceCmdPtr != NULL) { - *rPtr = sourceCmdPtr; - return TCL_OK; + if (strcmp(context, "ctx1") == 0 && (name[0] == 'z') && (name[1] == '\0')) { + resolvedCmdPtr = Tcl_FindCommand(interp, "y", NULL, TCL_GLOBAL_ONLY); + /* fprintf(stderr, "... y ==> %p\n", resolvedCmdPtr);*/ + + } else if (strcmp(context, "ctx2") == 0 && (name[0] == 'z') && (name[1] == '\0')) { + resolvedCmdPtr = Tcl_FindCommand(interp, "Y", NULL, TCL_GLOBAL_ONLY); + /*fprintf(stderr, "... Y ==> %p\n", resolvedCmdPtr);*/ } } + + if (resolvedCmdPtr != NULL) { + *rPtr = resolvedCmdPtr; + return TCL_OK; + } } + return TCL_CONTINUE; } @@ -7449,10 +7508,17 @@ TestInterpResolverCmd( int idx; #define RESOLVER_KEY "testInterpResolver" - if (objc != 2) { - Tcl_WrongNumArgs(interp, 1, objv, "up|down"); + if (objc < 2 || objc >3) { + Tcl_WrongNumArgs(interp, 1, objv, "up|down ?interp?"); return TCL_ERROR; } + if (objc == 3) { + interp = Tcl_GetSlave(interp, Tcl_GetString(objv[2])); + if (interp == NULL) { + Tcl_AppendResult(interp, "provided interpreter not found", NULL); + return TCL_ERROR; + } + } if (Tcl_GetIndexFromObj(interp, objv[1], table, "operation", TCL_EXACT, &idx) != TCL_OK) { return TCL_ERROR; diff --git a/tests/resolver.test b/tests/resolver.test index f3d22e5..01e2e0b 100644 --- a/tests/resolver.test +++ b/tests/resolver.test @@ -38,10 +38,12 @@ test resolver-1.1 {cmdNameObj sharing vs. cmd resolver: namespace import} -setup # is turned into a command literal shared for a given (here: the global) # namespace. set r0 [x]; # --> The result of [x] is "Y" + # 2) After having requested cmd resolution above, we can now use the # globally shared CmdName Tcl_Obj "z", now bound to cmd ::y. This is # certainly questionable, but defensible set r1 [z]; # --> The result of [z] is "Y" + # 3) We import from the namespace ns1 another z. [namespace import] takes # care "shadowed" cmd references, however, till now cmd literals have not # been touched. This is, however, necessary since the BC compiler (used in @@ -59,12 +61,12 @@ test resolver-1.1 {cmdNameObj sharing vs. cmd resolver: namespace import} -setup rename ::y "" namespace delete ::ns1 } -result {Y Y Z} + + test resolver-1.2 {cmdNameObj sharing vs. cmd resolver: proc creation} -setup { testinterpresolver up proc ::y {} { return Y } - proc ::x {} { - z - } + proc ::x {} { z } } -constraints testinterpresolver -body { set r0 [x] set r1 [z] @@ -80,6 +82,8 @@ test resolver-1.2 {cmdNameObj sharing vs. cmd resolver: proc creation} -setup { rename ::foo "" rename ::z "" } -result {Y Y Z} + + test resolver-1.3 {cmdNameObj sharing vs. cmd resolver: rename} -setup { testinterpresolver up proc ::Z {} { return Z } @@ -101,6 +105,8 @@ test resolver-1.3 {cmdNameObj sharing vs. cmd resolver: rename} -setup { rename ::y "" rename ::z "" } -result {Y Y Z} + + test resolver-1.4 {cmdNameObj sharing vs. cmd resolver: interp expose} -setup { testinterpresolver up proc ::Z {} { return Z } @@ -123,6 +129,8 @@ test resolver-1.4 {cmdNameObj sharing vs. cmd resolver: interp expose} -setup { rename ::y "" rename ::z "" } -result {Y Y Z} + + test resolver-1.5 {cmdNameObj sharing vs. cmd resolver: other than global NS} -setup { testinterpresolver up namespace eval ::ns1 { @@ -131,9 +139,7 @@ test resolver-1.5 {cmdNameObj sharing vs. cmd resolver: other than global NS} -s } proc ::y {} { return Y } namespace eval ::ns2 { - proc x {} { - z - } + proc x {} { z } } namespace eval :: { variable r2 "" @@ -151,13 +157,13 @@ test resolver-1.5 {cmdNameObj sharing vs. cmd resolver: other than global NS} -s namespace delete ::ns2 namespace delete ::ns1 } -result {Y Y Z} + + test resolver-1.6 {cmdNameObj sharing vs. cmd resolver: interp alias} -setup { testinterpresolver up proc ::Z {} { return Z } proc ::y {} { return Y } - proc ::x {} { - z - } + proc ::x {} { z } } -constraints testinterpresolver -body { set r0 [x] set r1 [z] @@ -187,7 +193,7 @@ test resolver-2.1 {compiled var resolver: Bug #3383616} -setup { # During the compilation the compiled var resolver, the resolve-specific # var info is allocated, during the execution of the body, the variable is # fetched and cached. - x; + x # During later calls, the cached variable is reused. x # When the proc is freed, the resolver-specific resolver var info is @@ -196,6 +202,121 @@ test resolver-2.1 {compiled var resolver: Bug #3383616} -setup { } -cleanup { testinterpresolver down } -result {} + + +# +# The test resolver-3.1* test bad interactions of resolvers on the "global" +# (per interp) literal pools. A resolver might resolve a cmd literal depending +# on a context differently, whereas the cmd literal sharing assumed that the +# namespace containing the literal solely determines the resolved cmd (and is +# resolver-agnostic). +# +# In order to make the test cases for the per-interpreter cmd literal pool +# reproducable and to minimize interactions between test cases, we use a slave +# interpreter per test-case. +# +# +# Testing resolver in namespace-based context "ctx1" +# +test resolver-3.1a { + interp command resolver, + resolve literal "z" in proc "x1" in context "ctx1" +} -setup { + + interp create i0 + testinterpresolver up i0 + i0 eval { + proc y {} { return yy } + namespace eval ::ns { + proc x1 {} { z } + } + } +} -constraints testinterpresolver -body { + + set r [i0 eval {namespace eval ::ctx1 { + ::ns::x1 + }}] + + return $r +} -cleanup { + testinterpresolver down i0 + interp delete i0 +} -result {yy} + +# +# Testing resolver in namespace-based context "ctx2" +# +test resolver-3.1b { + interp command resolver, + resolve literal "z" in proc "x2" in context "ctx2" +} -setup { + + interp create i0 + testinterpresolver up i0 + i0 eval { + proc Y {} { return YY } + namespace eval ::ns { + proc x2 {} { z } + } + } +} -constraints testinterpresolver -body { + + set r [i0 eval {namespace eval ::ctx2 { + ::ns::x2 + }}] + + return $r +} -cleanup { + testinterpresolver down i0 + interp delete i0 +} -result {YY} + +# +# Testing resolver in namespace-based context "ctx1" and "ctx2" in the same +# interpreter. +# + +test resolver-3.1c { + interp command resolver, + resolve literal "z" in proc "x1" in context "ctx1", + resolve literal "z" in proc "x2" in context "ctx2" + + Test, whether the shared cmd literal created by the first byte-code + compilation interacts with the second one. +} -setup { + + interp create i0 + testinterpresolver up i0 + + i0 eval { + proc y {} { return yy } + proc Y {} { return YY } + namespace eval ::ns { + proc x1 {} { z } + proc x2 {} { z } + } + } + +} -constraints testinterpresolver -body { + + set r1 [i0 eval {namespace eval ::ctx1 { + ::ns::x1 + }}] + + set r2 [i0 eval {namespace eval ::ctx2 { + ::ns::x2 + }}] + + set r3 [i0 eval {namespace eval ::ctx1 { + ::ns::x1 + }}] + + return [list $r1 $r2 $r3] +} -cleanup { + testinterpresolver down i0 + interp delete i0 +} -result {yy YY yy} + cleanupTests return -- cgit v0.12 From b41a44e3942c841677cdcf7cd46be77c5c27ab08 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Mon, 5 Sep 2016 13:14:45 +0000 Subject: Some patch clean-up, no change in functionality --- generic/tclCompExpr.c | 2 +- generic/tclCompile.c | 4 ++-- generic/tclCompile.h | 4 ++-- generic/tclEnsemble.c | 2 +- generic/tclLiteral.c | 20 ++++++++------------ generic/tclTest.c | 18 +++++++++--------- tests/resolver.test | 26 ++++++++++---------------- 7 files changed, 33 insertions(+), 43 deletions(-) diff --git a/generic/tclCompExpr.c b/generic/tclCompExpr.c index ab5e8af..4390282 100644 --- a/generic/tclCompExpr.c +++ b/generic/tclCompExpr.c @@ -2272,7 +2272,7 @@ CompileExprTree( Tcl_DStringAppend(&cmdName, p, length); TclEmitPush(TclRegisterNewCmdLiteral(envPtr, Tcl_DStringValue(&cmdName), - Tcl_DStringLength(&cmdName), 0), envPtr); + Tcl_DStringLength(&cmdName)), envPtr); Tcl_DStringFree(&cmdName); /* diff --git a/generic/tclCompile.c b/generic/tclCompile.c index 4e4ead6..ee36bff 100644 --- a/generic/tclCompile.c +++ b/generic/tclCompile.c @@ -1793,8 +1793,8 @@ CompileCmdLiteral( } bytes = Tcl_GetStringFromObj(cmdObj, &numBytes); - cmdLitIdx = TclRegisterNewCmdLiteral(envPtr, bytes, numBytes, extraLiteralFlags); - + cmdLitIdx = TclRegisterLiteral(envPtr, (char *)bytes, numBytes, extraLiteralFlags|LITERAL_CMD_NAME); + if (cmdPtr) { TclSetCmdNameObj(interp, TclFetchLiteral(envPtr, cmdLitIdx), cmdPtr); } diff --git a/generic/tclCompile.h b/generic/tclCompile.h index fa76f83..ba6ad44 100644 --- a/generic/tclCompile.h +++ b/generic/tclCompile.h @@ -1230,8 +1230,8 @@ MODULE_SCOPE int TclPushProcCallFrame(ClientData clientData, * int length); */ -#define TclRegisterNewCmdLiteral(envPtr, bytes, length, extraLiteralFlags) \ - TclRegisterLiteral(envPtr, (char *)(bytes), length, ((extraLiteralFlags)|LITERAL_CMD_NAME)) +#define TclRegisterNewCmdLiteral(envPtr, bytes, length) \ + TclRegisterLiteral(envPtr, (char *)(bytes), length, LITERAL_CMD_NAME) /* * Macro used to manually adjust the stack requirements; used in cases where diff --git a/generic/tclEnsemble.c b/generic/tclEnsemble.c index 22c475f..67ee65e 100644 --- a/generic/tclEnsemble.c +++ b/generic/tclEnsemble.c @@ -3354,7 +3354,7 @@ CompileToInvokedCommand( extraLiteralFlags = LITERAL_UNSHARED; } } - cmdLit = TclRegisterNewCmdLiteral(envPtr, bytes, length, extraLiteralFlags); + cmdLit = TclRegisterLiteral(envPtr, (char *)bytes, length, extraLiteralFlags|LITERAL_CMD_NAME); TclSetCmdNameObj(interp, TclFetchLiteral(envPtr, cmdLit), cmdPtr); TclEmitPush(cmdLit, envPtr); TclDecrRefCount(objPtr); diff --git a/generic/tclLiteral.c b/generic/tclLiteral.c index 864d050..484b86b 100644 --- a/generic/tclLiteral.c +++ b/generic/tclLiteral.c @@ -214,16 +214,15 @@ TclCreateLiteral( if (globalPtrPtr) { *globalPtrPtr = globalPtr; } - if ((flags & LITERAL_ON_HEAP)) { + if (flags & LITERAL_ON_HEAP) { ckfree(bytes); } globalPtr->refCount++; return objPtr; } } - if (!newPtr) { - if ((flags & LITERAL_ON_HEAP)) { + if (flags & LITERAL_ON_HEAP) { ckfree(bytes); } return NULL; @@ -236,15 +235,15 @@ TclCreateLiteral( TclNewObj(objPtr); Tcl_IncrRefCount(objPtr); - if ((flags & LITERAL_ON_HEAP)) { + if (flags & LITERAL_ON_HEAP) { objPtr->bytes = bytes; objPtr->length = length; } else { TclInitStringRep(objPtr, bytes, length); } - if ((flags & LITERAL_UNSHARED)) { - /* + if (flags & LITERAL_UNSHARED) { + /* * Make clear, that no global value is returned */ if (globalPtrPtr != NULL) { @@ -429,7 +428,7 @@ TclRegisterLiteral( * the namespace as the interp's global NS. */ - if ((flags & LITERAL_CMD_NAME)) { + if (flags & LITERAL_CMD_NAME) { if ((length >= 2) && (bytes[0] == ':') && (bytes[1] == ':')) { nsPtr = iPtr->globalNsPtr; } else { @@ -438,10 +437,11 @@ TclRegisterLiteral( } else { nsPtr = NULL; } - + /* * Is it in the interpreter's global literal table? If not, create it. */ + globalPtr = NULL; objPtr = TclCreateLiteral(iPtr, bytes, length, hash, &new, nsPtr, flags, &globalPtr); @@ -1167,10 +1167,6 @@ TclVerifyLocalLiteralTable( if (LookupLiteralEntry((Tcl_Interp *) envPtr->iPtr, localPtr->objPtr) == NULL) { bytes = Tcl_GetStringFromObj(localPtr->objPtr, &length); - //Tcl_Panic("%s: local literal \"%.*s\" is not global", - // "TclVerifyLocalLiteralTable", - // (length>60? 60 : length), bytes); - /*fprintf(stderr, "local literal \"%s\" is not global\n",bytes);*/ } if (localPtr->objPtr->bytes == NULL) { Tcl_Panic("%s: literal has NULL string rep", diff --git a/generic/tclTest.c b/generic/tclTest.c index 522e966..1e595d6 100644 --- a/generic/tclTest.c +++ b/generic/tclTest.c @@ -7308,21 +7308,21 @@ InterpCmdResolver( */ if ( (name[0] == 'z') && (name[1] == '\0') ) { Namespace *ns2NsPtr = (Namespace *) Tcl_FindNamespace(interp, "::ns2", NULL, 0); - + if (procPtr != NULL && ((procPtr->cmdPtr->nsPtr == iPtr->globalNsPtr) || (ns2NsPtr != NULL && procPtr->cmdPtr->nsPtr == ns2NsPtr) ) ) { /* - * Case A) + * Case A) * * - The context, in which this resolver becomes active, is * determined by the name of the caller proc, which has to be * named "x". * * - To determine the name of the caller proc, the proc is taken - * from the topmost stack frame. + * from the topmost stack frame. * * - Note that the context is NOT provided during byte-code * compilation (e.g. in TclProcCompileProc) @@ -7331,23 +7331,23 @@ InterpCmdResolver( * passed-in cmd literal into a cmd "y", which is taken from the * the global namespace (for simplicity). */ - + const char *callingCmdName = Tcl_GetCommandName(interp, (Tcl_Command) procPtr->cmdPtr); - + if ( callingCmdName[0] == 'x' && callingCmdName[1] == '\0' ) { resolvedCmdPtr = Tcl_FindCommand(interp, "y", NULL, TCL_GLOBAL_ONLY); } } else if (callerNsPtr != NULL) { /* - * Case B) + * Case B) * * - The context, in which this resolver becomes active, is * determined by the name of the parent namespace, which has * to be named "ctx1" or "ctx2". * * - To determine the name of the parent namesace, it is taken - * from the 2nd highest stack frame. + * from the 2nd highest stack frame. * * - Note that the context can be provided during byte-code * compilation (e.g. in TclProcCompileProc) @@ -7364,13 +7364,13 @@ InterpCmdResolver( if (strcmp(context, "ctx1") == 0 && (name[0] == 'z') && (name[1] == '\0')) { resolvedCmdPtr = Tcl_FindCommand(interp, "y", NULL, TCL_GLOBAL_ONLY); /* fprintf(stderr, "... y ==> %p\n", resolvedCmdPtr);*/ - + } else if (strcmp(context, "ctx2") == 0 && (name[0] == 'z') && (name[1] == '\0')) { resolvedCmdPtr = Tcl_FindCommand(interp, "Y", NULL, TCL_GLOBAL_ONLY); /*fprintf(stderr, "... Y ==> %p\n", resolvedCmdPtr);*/ } } - + if (resolvedCmdPtr != NULL) { *rPtr = resolvedCmdPtr; return TCL_OK; diff --git a/tests/resolver.test b/tests/resolver.test index 01e2e0b..dc38ff0 100644 --- a/tests/resolver.test +++ b/tests/resolver.test @@ -38,12 +38,10 @@ test resolver-1.1 {cmdNameObj sharing vs. cmd resolver: namespace import} -setup # is turned into a command literal shared for a given (here: the global) # namespace. set r0 [x]; # --> The result of [x] is "Y" - # 2) After having requested cmd resolution above, we can now use the # globally shared CmdName Tcl_Obj "z", now bound to cmd ::y. This is # certainly questionable, but defensible set r1 [z]; # --> The result of [z] is "Y" - # 3) We import from the namespace ns1 another z. [namespace import] takes # care "shadowed" cmd references, however, till now cmd literals have not # been touched. This is, however, necessary since the BC compiler (used in @@ -61,12 +59,12 @@ test resolver-1.1 {cmdNameObj sharing vs. cmd resolver: namespace import} -setup rename ::y "" namespace delete ::ns1 } -result {Y Y Z} - - test resolver-1.2 {cmdNameObj sharing vs. cmd resolver: proc creation} -setup { testinterpresolver up proc ::y {} { return Y } - proc ::x {} { z } + proc ::x {} { + z + } } -constraints testinterpresolver -body { set r0 [x] set r1 [z] @@ -82,8 +80,6 @@ test resolver-1.2 {cmdNameObj sharing vs. cmd resolver: proc creation} -setup { rename ::foo "" rename ::z "" } -result {Y Y Z} - - test resolver-1.3 {cmdNameObj sharing vs. cmd resolver: rename} -setup { testinterpresolver up proc ::Z {} { return Z } @@ -105,8 +101,6 @@ test resolver-1.3 {cmdNameObj sharing vs. cmd resolver: rename} -setup { rename ::y "" rename ::z "" } -result {Y Y Z} - - test resolver-1.4 {cmdNameObj sharing vs. cmd resolver: interp expose} -setup { testinterpresolver up proc ::Z {} { return Z } @@ -129,8 +123,6 @@ test resolver-1.4 {cmdNameObj sharing vs. cmd resolver: interp expose} -setup { rename ::y "" rename ::z "" } -result {Y Y Z} - - test resolver-1.5 {cmdNameObj sharing vs. cmd resolver: other than global NS} -setup { testinterpresolver up namespace eval ::ns1 { @@ -139,7 +131,9 @@ test resolver-1.5 {cmdNameObj sharing vs. cmd resolver: other than global NS} -s } proc ::y {} { return Y } namespace eval ::ns2 { - proc x {} { z } + proc x {} { + z + } } namespace eval :: { variable r2 "" @@ -157,13 +151,13 @@ test resolver-1.5 {cmdNameObj sharing vs. cmd resolver: other than global NS} -s namespace delete ::ns2 namespace delete ::ns1 } -result {Y Y Z} - - test resolver-1.6 {cmdNameObj sharing vs. cmd resolver: interp alias} -setup { testinterpresolver up proc ::Z {} { return Z } proc ::y {} { return Y } - proc ::x {} { z } + proc ::x {} { + z + } } -constraints testinterpresolver -body { set r0 [x] set r1 [z] @@ -193,7 +187,7 @@ test resolver-2.1 {compiled var resolver: Bug #3383616} -setup { # During the compilation the compiled var resolver, the resolve-specific # var info is allocated, during the execution of the body, the variable is # fetched and cached. - x + x; # During later calls, the cached variable is reused. x # When the proc is freed, the resolver-specific resolver var info is -- cgit v0.12 From 8dac135fc9c8efae2cc3113bc975ab871ff2271f Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Mon, 5 Sep 2016 13:55:00 +0000 Subject: Allow additional optional "interp" argument for testinterpresolver command. Not used yet in any test-case. Protect panic in tclLiteral.c for possible null-pointer access. (cherry-picked from Gustaf Neuman's interpresolver patch). Eliminate some unecessary spacing. --- generic/tclCmdAH.c | 2 +- generic/tclExecute.c | 2 +- generic/tclLiteral.c | 3 ++- generic/tclTest.c | 13 ++++++++++--- tests/resolver.test | 2 +- win/tclWinFile.c | 8 ++++---- win/tclWinPipe.c | 2 +- win/tclWinPort.h | 2 +- 8 files changed, 21 insertions(+), 13 deletions(-) diff --git a/generic/tclCmdAH.c b/generic/tclCmdAH.c index 88cc17d..4c299f8 100644 --- a/generic/tclCmdAH.c +++ b/generic/tclCmdAH.c @@ -1597,7 +1597,7 @@ FileAttrIsOwnedCmd( Tcl_Obj *const objv[]) { #ifdef __CYGWIN__ -#define geteuid() (short)(geteuid)() +#define geteuid() (short)(geteuid)() #endif #if !defined(_WIN32) Tcl_StatBuf buf; diff --git a/generic/tclExecute.c b/generic/tclExecute.c index e539161..34d92d3 100644 --- a/generic/tclExecute.c +++ b/generic/tclExecute.c @@ -3173,7 +3173,7 @@ TEBCresume( Tcl_Obj *copyPtr = Tcl_NewListObj(objc - opnd + 1, NULL); Tcl_ListObjAppendElement(NULL, copyPtr, objPtr); - Tcl_ListObjReplace(NULL, copyPtr, LIST_MAX, 0, + Tcl_ListObjReplace(NULL, copyPtr, LIST_MAX, 0, objc - opnd, objv + opnd); Tcl_DecrRefCount(objPtr); objPtr = copyPtr; diff --git a/generic/tclLiteral.c b/generic/tclLiteral.c index 03200ca..26c21db 100644 --- a/generic/tclLiteral.c +++ b/generic/tclLiteral.c @@ -431,12 +431,13 @@ TclRegisterLiteral( * Is it in the interpreter's global literal table? If not, create it. */ + globalPtr = NULL; objPtr = TclCreateLiteral(iPtr, bytes, length, hash, &new, nsPtr, flags, &globalPtr); objIndex = AddLocalLiteralEntry(envPtr, objPtr, localHash); #ifdef TCL_COMPILE_DEBUG - if (globalPtr->refCount < 1) { + if (globalPtr != NULL && globalPtr->refCount < 1) { Tcl_Panic("%s: global literal \"%.*s\" had bad refCount %d", "TclRegisterLiteral", (length>60? 60 : length), bytes, globalPtr->refCount); diff --git a/generic/tclTest.c b/generic/tclTest.c index e33d263..b3508f1 100644 --- a/generic/tclTest.c +++ b/generic/tclTest.c @@ -7449,9 +7449,16 @@ TestInterpResolverCmd( int idx; #define RESOLVER_KEY "testInterpResolver" - if (objc != 2) { - Tcl_WrongNumArgs(interp, 1, objv, "up|down"); - return TCL_ERROR; + if ((objc < 2) || (objc > 3)) { + Tcl_WrongNumArgs(interp, 1, objv, "up|down ?interp?"); + return TCL_ERROR; + } + if (objc == 3) { + interp = Tcl_GetSlave(interp, Tcl_GetString(objv[2])); + if (interp == NULL) { + Tcl_AppendResult(interp, "provided interpreter not found", NULL); + return TCL_ERROR; + } } if (Tcl_GetIndexFromObj(interp, objv[1], table, "operation", TCL_EXACT, &idx) != TCL_OK) { diff --git a/tests/resolver.test b/tests/resolver.test index f3d22e5..aaad02c 100644 --- a/tests/resolver.test +++ b/tests/resolver.test @@ -187,7 +187,7 @@ test resolver-2.1 {compiled var resolver: Bug #3383616} -setup { # During the compilation the compiled var resolver, the resolve-specific # var info is allocated, during the execution of the body, the variable is # fetched and cached. - x; + x # During later calls, the cached variable is reused. x # When the proc is freed, the resolver-specific resolver var info is diff --git a/win/tclWinFile.c b/win/tclWinFile.c index 4d7500b..6662327 100755 --- a/win/tclWinFile.c +++ b/win/tclWinFile.c @@ -3166,8 +3166,8 @@ TclWinFileOwned( case we are in all likelihood not the owner */ return 0; } - - /* + + /* * Getting the current process SID is a multi-step process. * We make the assumption that if a call fails, this process is * so underprivileged it could not possibly own anything. Normally @@ -3191,10 +3191,10 @@ TclWinFileOwned( LocalFree(secd); /* Also frees ownerSid */ if (buf) ckfree(buf); - + return (owned != 0); /* Convert non-0 to 1 */ } - + /* * Local Variables: * mode: c diff --git a/win/tclWinPipe.c b/win/tclWinPipe.c index 382addd..4666deb 100644 --- a/win/tclWinPipe.c +++ b/win/tclWinPipe.c @@ -1337,7 +1337,7 @@ ApplicationType( Tcl_DStringFree(&ds); ext = strrchr(fullName, '.'); - if ((ext != NULL) && + if ((ext != NULL) && (strcasecmp(ext, ".cmd") == 0 || strcasecmp(ext, ".bat") == 0)) { applType = APPL_DOS; break; diff --git a/win/tclWinPort.h b/win/tclWinPort.h index b486466..159a708 100644 --- a/win/tclWinPort.h +++ b/win/tclWinPort.h @@ -360,7 +360,7 @@ typedef DWORD_PTR * PDWORD_PTR; # define S_IFLNK 0120000 /* Symbolic Link */ #endif -/* +/* * Windows compilers do not define S_IFBLK. However, Tcl uses it in * GetTypeFromMode to identify blockSpecial devices based on the * value in the statsbuf st_mode field. We have no other way to pass this -- cgit v0.12 From 2501ad1ea2dd8592c15e7f3bda1f9c298fa446a6 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Mon, 5 Sep 2016 14:52:01 +0000 Subject: some more clean-up --- generic/tclCompile.c | 10 ++++------ generic/tclEnsemble.c | 10 ++++------ generic/tclLiteral.c | 4 +++- generic/tclObj.c | 12 +++++------- 4 files changed, 16 insertions(+), 20 deletions(-) diff --git a/generic/tclCompile.c b/generic/tclCompile.c index ee36bff..f6b3c52 100644 --- a/generic/tclCompile.c +++ b/generic/tclCompile.c @@ -1783,17 +1783,15 @@ CompileCmdLiteral( int numBytes; const char *bytes; Command *cmdPtr; - int cmdLitIdx, extraLiteralFlags = 0; + int cmdLitIdx, extraLiteralFlags = LITERAL_CMD_NAME; cmdPtr = (Command *) Tcl_GetCommandFromObj(interp, cmdObj); - if (cmdPtr != NULL) { - if ((cmdPtr->flags & CMD_VIA_RESOLVER)) { - extraLiteralFlags = LITERAL_UNSHARED; - } + if ((cmdPtr != NULL) && (cmdPtr->flags & CMD_VIA_RESOLVER)) { + extraLiteralFlags |= LITERAL_UNSHARED; } bytes = Tcl_GetStringFromObj(cmdObj, &numBytes); - cmdLitIdx = TclRegisterLiteral(envPtr, (char *)bytes, numBytes, extraLiteralFlags|LITERAL_CMD_NAME); + cmdLitIdx = TclRegisterLiteral(envPtr, (char *)bytes, numBytes, extraLiteralFlags); if (cmdPtr) { TclSetCmdNameObj(interp, TclFetchLiteral(envPtr, cmdLitIdx), cmdPtr); diff --git a/generic/tclEnsemble.c b/generic/tclEnsemble.c index 67ee65e..6fedf29 100644 --- a/generic/tclEnsemble.c +++ b/generic/tclEnsemble.c @@ -3306,7 +3306,7 @@ CompileToInvokedCommand( Tcl_Token *tokPtr; Tcl_Obj *objPtr, **words; char *bytes; - int length, i, numWords, cmdLit, extraLiteralFlags = 0; + int length, i, numWords, cmdLit, extraLiteralFlags = LITERAL_CMD_NAME; DefineLineInformation; /* @@ -3349,12 +3349,10 @@ CompileToInvokedCommand( objPtr = Tcl_NewObj(); Tcl_GetCommandFullName(interp, (Tcl_Command) cmdPtr, objPtr); bytes = Tcl_GetStringFromObj(objPtr, &length); - if (cmdPtr != NULL) { - if ((cmdPtr->flags & CMD_VIA_RESOLVER)) { - extraLiteralFlags = LITERAL_UNSHARED; - } + if ((cmdPtr != NULL) && (cmdPtr->flags & CMD_VIA_RESOLVER)) { + extraLiteralFlags |= LITERAL_UNSHARED; } - cmdLit = TclRegisterLiteral(envPtr, (char *)bytes, length, extraLiteralFlags|LITERAL_CMD_NAME); + cmdLit = TclRegisterLiteral(envPtr, (char *)bytes, length, extraLiteralFlags); TclSetCmdNameObj(interp, TclFetchLiteral(envPtr, cmdLit), cmdPtr); TclEmitPush(cmdLit, envPtr); TclDecrRefCount(objPtr); diff --git a/generic/tclLiteral.c b/generic/tclLiteral.c index 484b86b..c329ed7 100644 --- a/generic/tclLiteral.c +++ b/generic/tclLiteral.c @@ -249,7 +249,6 @@ TclCreateLiteral( if (globalPtrPtr != NULL) { *globalPtrPtr = NULL; } - /*fprintf(stderr, "UNSHARED LITERAL <%s>\n", bytes);*/ return objPtr; } @@ -1167,6 +1166,9 @@ TclVerifyLocalLiteralTable( if (LookupLiteralEntry((Tcl_Interp *) envPtr->iPtr, localPtr->objPtr) == NULL) { bytes = Tcl_GetStringFromObj(localPtr->objPtr, &length); + Tcl_Panic("%s: local literal \"%.*s\" is not global", + "TclVerifyLocalLiteralTable", + (length>60? 60 : length), bytes); } if (localPtr->objPtr->bytes == NULL) { Tcl_Panic("%s: literal has NULL string rep", diff --git a/generic/tclObj.c b/generic/tclObj.c index 661ab48..283c8d2 100644 --- a/generic/tclObj.c +++ b/generic/tclObj.c @@ -4219,10 +4219,10 @@ TclSetCmdNameObj( const char *name; if (objPtr->typePtr == &tclCmdNameType) { - resPtr = objPtr->internalRep.twoPtrValue.ptr1; - if (resPtr->cmdPtr == cmdPtr) { - return; - } + resPtr = objPtr->internalRep.twoPtrValue.ptr1; + if (resPtr->cmdPtr == cmdPtr) { + return; + } } cmdPtr->refCount++; @@ -4400,9 +4400,7 @@ SetCmdNameFromAny( cmdPtr->refCount++; resPtr = objPtr->internalRep.twoPtrValue.ptr1; if ((objPtr->typePtr == &tclCmdNameType) - && resPtr != NULL - && (resPtr->refCount == 1) - ) { + && resPtr && (resPtr->refCount == 1)) { /* * Reuse the old ResolvedCmdName struct instead of freeing it */ -- cgit v0.12 From 2a4281604ab70d1943a74f592e151c6a203f0bdd Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Tue, 6 Sep 2016 08:25:18 +0000 Subject: Additiona patch/suggestion from Gustaf. This indeed fixes the crash in oo.test. Looks good to me, so only waiting for final feedback from Gustaf and eventually feedback from other people. --- generic/tclLiteral.c | 7 ------- generic/tclObj.c | 2 +- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/generic/tclLiteral.c b/generic/tclLiteral.c index c329ed7..6b3560d 100644 --- a/generic/tclLiteral.c +++ b/generic/tclLiteral.c @@ -1163,13 +1163,6 @@ TclVerifyLocalLiteralTable( "TclVerifyLocalLiteralTable", (length>60? 60 : length), bytes, localPtr->refCount); } - if (LookupLiteralEntry((Tcl_Interp *) envPtr->iPtr, - localPtr->objPtr) == NULL) { - bytes = Tcl_GetStringFromObj(localPtr->objPtr, &length); - Tcl_Panic("%s: local literal \"%.*s\" is not global", - "TclVerifyLocalLiteralTable", - (length>60? 60 : length), bytes); - } if (localPtr->objPtr->bytes == NULL) { Tcl_Panic("%s: literal has NULL string rep", "TclVerifyLocalLiteralTable"); diff --git a/generic/tclObj.c b/generic/tclObj.c index 283c8d2..29c8e23 100644 --- a/generic/tclObj.c +++ b/generic/tclObj.c @@ -4220,7 +4220,7 @@ TclSetCmdNameObj( if (objPtr->typePtr == &tclCmdNameType) { resPtr = objPtr->internalRep.twoPtrValue.ptr1; - if (resPtr->cmdPtr == cmdPtr) { + if (resPtr != NULL && resPtr->cmdPtr == cmdPtr) { return; } } -- cgit v0.12 From 907e3ead5a3a2615c5721af947895bb4cacd3c99 Mon Sep 17 00:00:00 2001 From: dkf Date: Tue, 6 Sep 2016 10:44:45 +0000 Subject: Fixed bug in pushed transforms with full internal buffers not writing out. --- generic/tclZlib.c | 48 +++++++++++++++++++++++++++++++++--------------- tests/zlib.test | 23 +++++++++++++++++++++++ 2 files changed, 56 insertions(+), 15 deletions(-) diff --git a/generic/tclZlib.c b/generic/tclZlib.c index dac47cf..c9d7b88 100644 --- a/generic/tclZlib.c +++ b/generic/tclZlib.c @@ -2864,7 +2864,7 @@ ZlibTransformClose( Tcl_Interp *interp) { ZlibChannelData *cd = instanceData; - int e, result = TCL_OK; + int e, written, result = TCL_OK; /* * Delete the support timer. @@ -2882,6 +2882,17 @@ ZlibTransformClose( cd->outStream.next_out = (Bytef *) cd->outBuffer; cd->outStream.avail_out = (unsigned) cd->outAllocated; e = deflate(&cd->outStream, Z_FINISH); + written = cd->outAllocated - cd->outStream.avail_out; + + /* + * Can't be sure that deflate() won't declare the buffer to be + * full (with Z_BUF_ERROR) so handle that case. + */ + + if (e == Z_BUF_ERROR) { + e = Z_OK; + written = cd->outAllocated; + } if (e != Z_OK && e != Z_STREAM_END) { /* TODO: is this the right way to do errors on close? */ if (!TclInThreadExit()) { @@ -2890,20 +2901,17 @@ ZlibTransformClose( result = TCL_ERROR; break; } - if (cd->outStream.avail_out != (unsigned) cd->outAllocated) { - if (Tcl_WriteRaw(cd->parent, cd->outBuffer, - cd->outAllocated - cd->outStream.avail_out) < 0) { - /* TODO: is this the right way to do errors on close? - * Note: when close is called from FinalizeIOSubsystem - * then interp may be NULL */ - if (!TclInThreadExit() && interp) { - Tcl_SetObjResult(interp, Tcl_ObjPrintf( - "error while finalizing file: %s", - Tcl_PosixError(interp))); - } - result = TCL_ERROR; - break; + if (written && Tcl_WriteRaw(cd->parent, cd->outBuffer, written) < 0) { + /* TODO: is this the right way to do errors on close? + * Note: when close is called from FinalizeIOSubsystem then + * interp may be NULL */ + if (!TclInThreadExit() && interp) { + Tcl_SetObjResult(interp, Tcl_ObjPrintf( + "error while finalizing file: %s", + Tcl_PosixError(interp))); } + result = TCL_ERROR; + break; } } while (e != Z_STREAM_END); (void) deflateEnd(&cd->outStream); @@ -3084,7 +3092,17 @@ ZlibTransformOutput( e = deflate(&cd->outStream, Z_NO_FLUSH); produced = cd->outAllocated - cd->outStream.avail_out; - if (e == Z_OK && produced > 0) { + if ((e == Z_OK && produced > 0) || e == Z_BUF_ERROR) { + /* + * deflate() indicates that it is out of space by returning + * Z_BUF_ERROR; in that case, we must write the whole buffer out + * and retry to compress what is left. + */ + + if (e == Z_BUF_ERROR) { + produced = cd->outAllocated; + e = Z_OK; + } if (Tcl_WriteRaw(cd->parent, cd->outBuffer, produced) < 0) { *errorCodePtr = Tcl_GetErrno(); return -1; diff --git a/tests/zlib.test b/tests/zlib.test index 8a040d8..15dbb34 100644 --- a/tests/zlib.test +++ b/tests/zlib.test @@ -917,6 +917,29 @@ test zlib-12.1 {Tk Bug 9eb55debc5} -constraints zlib -setup { } -cleanup { $stream close } -result {12026 18000} +test zlib-12.2 {Patrick Dunnigan's issue} -constraints zlib -setup { + set filesrc [makeFile {} test.input] + set filedst [makeFile {} test.output] + set f [open $filesrc "wb"] + for {set i 0} {$i < 10000} {incr i} { + puts -nonewline $f "x" + } + close $f +} -body { + set fin [open $filesrc "rb"] + set fout [open $filedst "wb"] + set header [dict create filename "test.input" time 0] + try { + fcopy $fin [zlib push gzip $fout -header $header] + } finally { + close $fin + close $fout + } + file size $filedst +} -cleanup { + removeFile $filesrc + removeFile $filedst +} -result 4152 ::tcltest::cleanupTests return -- cgit v0.12 From a8ee2c14547d09ebb8f93ee3cea938302ea7a4c8 Mon Sep 17 00:00:00 2001 From: dgp Date: Tue, 6 Sep 2016 20:30:07 +0000 Subject: [4dbdd9af14] Proposed fix for mem leak. --- generic/tclVar.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/generic/tclVar.c b/generic/tclVar.c index bdc64b7..55eb91c 100644 --- a/generic/tclVar.c +++ b/generic/tclVar.c @@ -4498,7 +4498,6 @@ TclDeleteNamespaceVars( Tcl_GetVariableFullName(interp, (Tcl_Var) varPtr, objPtr); UnsetVarStruct(varPtr, NULL, iPtr, /* part1 */ objPtr, NULL, flags); - Tcl_DecrRefCount(objPtr); /* free no longer needed obj */ /* * Remove the variable from the table and force it undefined in case @@ -4527,6 +4526,12 @@ TclDeleteNamespaceVars( } } } + + if (!TclIsVarUndefined(varPtr)) { + UnsetVarStruct(varPtr, NULL, iPtr, /* part1 */ objPtr, + NULL, flags); + } + Tcl_DecrRefCount(objPtr); /* free no longer needed obj */ VarHashRefCount(varPtr)--; VarHashDeleteEntry(varPtr); } -- cgit v0.12 From a05766d3d315e7ecba48b10b3d24d98a7cd450df Mon Sep 17 00:00:00 2001 From: dgp Date: Wed, 7 Sep 2016 16:19:42 +0000 Subject: Improve the comments and add a test. --- generic/tclVar.c | 13 +++++++++++-- tests/var.test | 31 +++++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+), 2 deletions(-) diff --git a/generic/tclVar.c b/generic/tclVar.c index 55eb91c..e95307e 100644 --- a/generic/tclVar.c +++ b/generic/tclVar.c @@ -4500,8 +4500,12 @@ TclDeleteNamespaceVars( NULL, flags); /* - * Remove the variable from the table and force it undefined in case - * an unset trace brought it back from the dead. + * We just unset the variable. However, an unset trace might + * have re-set it, or might have re-established traces on it. + * This namespace and its vartable are going away unconditionally, + * so we cannot let such things linger. That would be a leak. + * + * First we destroy all traces. ... */ if (TclIsVarTraced(varPtr)) { @@ -4527,6 +4531,11 @@ TclDeleteNamespaceVars( } } + /* + * ...and then, if the variable still holds a value, we unset it + * again. This time with no traces left, we're sure it goes away. + */ + if (!TclIsVarUndefined(varPtr)) { UnsetVarStruct(varPtr, NULL, iPtr, /* part1 */ objPtr, NULL, flags); diff --git a/tests/var.test b/tests/var.test index c852ca9..30e340e 100644 --- a/tests/var.test +++ b/tests/var.test @@ -22,6 +22,21 @@ if {[lsearch [namespace children] ::tcltest] == -1} { testConstraint testupvar [llength [info commands testupvar]] testConstraint testgetvarfullname [llength [info commands testgetvarfullname]] testConstraint testsetnoerr [llength [info commands testsetnoerr]] +testConstraint memory [llength [info commands memory]] +if {[testConstraint memory]} { + proc getbytes {} { + return [lindex [split [memory info] \n] 3 3] + } + proc leaktest {script {iterations 3}} { + set end [getbytes] + for {set i 0} {$i < $iterations} {incr i} { + uplevel 1 $script + set tmp $end + set end [getbytes] + } + return [expr {$end - $tmp}] + } +} catch {rename p ""} catch {namespace delete test_ns_var} @@ -540,6 +555,22 @@ test var-8.2 {TclDeleteNamespaceVars, "unset" traces on ns delete are called wit list [namespace delete test_ns_var] $::info } {{} {::test_ns_var::v {} u}} +test var-8.3 {TclDeleteNamespaceVars, mem leak} -constraints memory -setup { + proc ::t {a i o} { + set $a 321 + } +} -body { + leaktest { + namespace eval n { + variable v 123 + trace variable v u ::t + } + namespace delete n + } +} -cleanup { + rename ::t {} +} -result 0 + test var-9.1 {behaviour of TclGet/SetVar simple get/set} testsetnoerr { catch {unset u}; catch {unset v} list \ -- cgit v0.12 From fc743498e7623e7cefbe124ef936d30de91e3625 Mon Sep 17 00:00:00 2001 From: dgp Date: Wed, 7 Sep 2016 18:31:58 +0000 Subject: Attempt to fix [7f02ff1efa]. Make trace-18.1 fail. Suspect test is an experiment that preserves the bug. --- generic/tclNamesp.c | 20 +++++++------------- generic/tclVar.c | 49 +++++++++++++++++++++++++++++++++---------------- 2 files changed, 40 insertions(+), 29 deletions(-) diff --git a/generic/tclNamesp.c b/generic/tclNamesp.c index 7f6ecf5..74dfaf8 100644 --- a/generic/tclNamesp.c +++ b/generic/tclNamesp.c @@ -382,19 +382,6 @@ Tcl_PopCallFrame( register CallFrame *framePtr = iPtr->framePtr; Namespace *nsPtr; - /* - * It's important to remove the call frame from the interpreter's stack of - * call frames before deleting local variables, so that traces invoked by - * the variable deletion don't see the partially-deleted frame. - */ - - if (framePtr->callerPtr) { - iPtr->framePtr = framePtr->callerPtr; - iPtr->varFramePtr = framePtr->callerVarPtr; - } else { - /* Tcl_PopCallFrame: trying to pop rootCallFrame! */ - } - if (framePtr->varTablePtr != NULL) { TclDeleteVars(iPtr, framePtr->varTablePtr); ckfree(framePtr->varTablePtr); @@ -422,6 +409,13 @@ Tcl_PopCallFrame( } framePtr->nsPtr = NULL; + if (framePtr->callerPtr) { + iPtr->framePtr = framePtr->callerPtr; + iPtr->varFramePtr = framePtr->callerVarPtr; + } else { + /* Tcl_PopCallFrame: trying to pop rootCallFrame! */ + } + if (framePtr->tailcallPtr) { TclSetTailcall(interp, framePtr->tailcallPtr); } diff --git a/generic/tclVar.c b/generic/tclVar.c index 48e09f6..0b371ee 100644 --- a/generic/tclVar.c +++ b/generic/tclVar.c @@ -5032,27 +5032,44 @@ TclDeleteVars( TclVarHashTable *tablePtr) /* Hash table containing variables to * delete. */ { - Tcl_Interp *interp = (Tcl_Interp *) iPtr; Tcl_HashSearch search; register Var *varPtr; - int flags; - Namespace *currNsPtr = (Namespace *) TclGetCurrentNamespace(interp); - - /* - * Determine what flags to pass to the trace callback functions. - */ - - flags = TCL_TRACE_UNSETS; - if (tablePtr == &iPtr->globalNsPtr->varTable) { - flags |= TCL_GLOBAL_ONLY; - } else if (tablePtr == &currNsPtr->varTable) { - flags |= TCL_NAMESPACE_ONLY; - } for (varPtr = VarHashFirstVar(tablePtr, &search); varPtr != NULL; varPtr = VarHashFirstVar(tablePtr, &search)) { - UnsetVarStruct(varPtr, NULL, iPtr, VarHashGetKey(varPtr), NULL, flags, - -1); + VarHashRefCount(varPtr)++; + + UnsetVarStruct(varPtr, NULL, iPtr, VarHashGetKey(varPtr), + NULL, TCL_TRACE_UNSETS, -1); + + if (TclIsVarTraced(varPtr)) { + Tcl_HashEntry *tPtr = Tcl_FindHashEntry(&iPtr->varTraces, varPtr); + VarTrace *tracePtr = Tcl_GetHashValue(tPtr); + ActiveVarTrace *activePtr; + + while (tracePtr) { + VarTrace *prevPtr = tracePtr; + + tracePtr = tracePtr->nextPtr; + prevPtr->nextPtr = NULL; + Tcl_EventuallyFree(prevPtr, TCL_DYNAMIC); + } + Tcl_DeleteHashEntry(tPtr); + varPtr->flags &= ~VAR_ALL_TRACES; + for (activePtr = iPtr->activeVarTracePtr; activePtr != NULL; + activePtr = activePtr->nextPtr) { + if (activePtr->varPtr == varPtr) { + activePtr->nextTracePtr = NULL; + } + } + } + + if (!TclIsVarUndefined(varPtr)) { + UnsetVarStruct(varPtr, NULL, iPtr, VarHashGetKey(varPtr), + NULL, TCL_TRACE_UNSETS, -1); + } + + VarHashRefCount(varPtr)--; VarHashDeleteEntry(varPtr); } VarHashDeleteTable(tablePtr); -- cgit v0.12 From 69e6c8e2f7cc9c7cd816bb7acfe52c7b4556e4cb Mon Sep 17 00:00:00 2001 From: dgp Date: Thu, 8 Sep 2016 02:34:37 +0000 Subject: New test trace-18.5 for the bug. Updated trace-18.1 which was tuned to it. --- tests/trace.test | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/tests/trace.test b/tests/trace.test index 1099f48..3b69d38 100644 --- a/tests/trace.test +++ b/tests/trace.test @@ -1227,7 +1227,7 @@ test trace-17.3 {traced variables must survive procedure exits} { test trace-18.1 {unset traces on procedure returns} { proc p1 {x y} {set a 44; p2 14} - proc p2 {z} {trace add variable z unset {traceCheck {lsort [uplevel 1 {info vars}]}}} + proc p2 {z} {trace add variable z unset {traceCheck {lsort [uplevel 2 {info vars}]}}} set info {} p1 foo bar set info @@ -1263,6 +1263,27 @@ test trace-18.4 {namespace delete / trace vdelete combo, Bug \#1338280} { rename doTrace {} set info } 1110 +test trace-18.5 {Bug 7f02ff1efa} -setup { + proc constant {name value} { + upvar 1 $name c + set c $value + trace variable c wu [list reset $value] + } + proc reset {v a i o} { + uplevel 1 [list constant $a $v] + } + proc demo {} { + constant pi 3.14 + } +} -body { + unset -nocomplain pi + demo + info exists pi +} -cleanup { + rename demo {} + rename reset {} + rename constant {} +} -result 0 # Delete arrays when done, so they can be re-used as scalars # elsewhere. -- cgit v0.12 From 768ec09104da815f43907bc6c3f829d03d4d4fc9 Mon Sep 17 00:00:00 2001 From: gahr Date: Fri, 9 Sep 2016 07:28:45 +0000 Subject: Remove unnecessary use of fpsetround. See https://bugs.freebsd.org/212512 --- unix/tclUnixInit.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/unix/tclUnixInit.c b/unix/tclUnixInit.c index 57215f1..91fb986 100644 --- a/unix/tclUnixInit.c +++ b/unix/tclUnixInit.c @@ -391,14 +391,6 @@ TclpInitPlatform(void) #endif /* SIGPIPE */ #if defined(__FreeBSD__) && defined(__GNUC__) - /* - * Adjust the rounding mode to be more conventional. Note that FreeBSD - * only provides the __fpsetreg() used by the following two for the GNU - * Compiler. When using, say, Intel's icc they break. (Partially based on - * patch in BSD ports system from root@celsius.bychok.com) - */ - - fpsetround(FP_RN); (void) fpsetmask(0L); #endif -- cgit v0.12 From f26a4a0948cbd769519cf1e79ea027511051b2bd Mon Sep 17 00:00:00 2001 From: dgp Date: Fri, 9 Sep 2016 12:36:53 +0000 Subject: Revert b98ee56376. The "bug" fixed was documented behavior. --- generic/tclNamesp.c | 20 +++++++++++++------- generic/tclVar.c | 49 ++++++++++++++++--------------------------------- tests/trace.test | 23 +---------------------- 3 files changed, 30 insertions(+), 62 deletions(-) diff --git a/generic/tclNamesp.c b/generic/tclNamesp.c index 74dfaf8..7f6ecf5 100644 --- a/generic/tclNamesp.c +++ b/generic/tclNamesp.c @@ -382,6 +382,19 @@ Tcl_PopCallFrame( register CallFrame *framePtr = iPtr->framePtr; Namespace *nsPtr; + /* + * It's important to remove the call frame from the interpreter's stack of + * call frames before deleting local variables, so that traces invoked by + * the variable deletion don't see the partially-deleted frame. + */ + + if (framePtr->callerPtr) { + iPtr->framePtr = framePtr->callerPtr; + iPtr->varFramePtr = framePtr->callerVarPtr; + } else { + /* Tcl_PopCallFrame: trying to pop rootCallFrame! */ + } + if (framePtr->varTablePtr != NULL) { TclDeleteVars(iPtr, framePtr->varTablePtr); ckfree(framePtr->varTablePtr); @@ -409,13 +422,6 @@ Tcl_PopCallFrame( } framePtr->nsPtr = NULL; - if (framePtr->callerPtr) { - iPtr->framePtr = framePtr->callerPtr; - iPtr->varFramePtr = framePtr->callerVarPtr; - } else { - /* Tcl_PopCallFrame: trying to pop rootCallFrame! */ - } - if (framePtr->tailcallPtr) { TclSetTailcall(interp, framePtr->tailcallPtr); } diff --git a/generic/tclVar.c b/generic/tclVar.c index 0b371ee..48e09f6 100644 --- a/generic/tclVar.c +++ b/generic/tclVar.c @@ -5032,44 +5032,27 @@ TclDeleteVars( TclVarHashTable *tablePtr) /* Hash table containing variables to * delete. */ { + Tcl_Interp *interp = (Tcl_Interp *) iPtr; Tcl_HashSearch search; register Var *varPtr; + int flags; + Namespace *currNsPtr = (Namespace *) TclGetCurrentNamespace(interp); - for (varPtr = VarHashFirstVar(tablePtr, &search); varPtr != NULL; - varPtr = VarHashFirstVar(tablePtr, &search)) { - VarHashRefCount(varPtr)++; - - UnsetVarStruct(varPtr, NULL, iPtr, VarHashGetKey(varPtr), - NULL, TCL_TRACE_UNSETS, -1); - - if (TclIsVarTraced(varPtr)) { - Tcl_HashEntry *tPtr = Tcl_FindHashEntry(&iPtr->varTraces, varPtr); - VarTrace *tracePtr = Tcl_GetHashValue(tPtr); - ActiveVarTrace *activePtr; - - while (tracePtr) { - VarTrace *prevPtr = tracePtr; - - tracePtr = tracePtr->nextPtr; - prevPtr->nextPtr = NULL; - Tcl_EventuallyFree(prevPtr, TCL_DYNAMIC); - } - Tcl_DeleteHashEntry(tPtr); - varPtr->flags &= ~VAR_ALL_TRACES; - for (activePtr = iPtr->activeVarTracePtr; activePtr != NULL; - activePtr = activePtr->nextPtr) { - if (activePtr->varPtr == varPtr) { - activePtr->nextTracePtr = NULL; - } - } - } + /* + * Determine what flags to pass to the trace callback functions. + */ - if (!TclIsVarUndefined(varPtr)) { - UnsetVarStruct(varPtr, NULL, iPtr, VarHashGetKey(varPtr), - NULL, TCL_TRACE_UNSETS, -1); - } + flags = TCL_TRACE_UNSETS; + if (tablePtr == &iPtr->globalNsPtr->varTable) { + flags |= TCL_GLOBAL_ONLY; + } else if (tablePtr == &currNsPtr->varTable) { + flags |= TCL_NAMESPACE_ONLY; + } - VarHashRefCount(varPtr)--; + for (varPtr = VarHashFirstVar(tablePtr, &search); varPtr != NULL; + varPtr = VarHashFirstVar(tablePtr, &search)) { + UnsetVarStruct(varPtr, NULL, iPtr, VarHashGetKey(varPtr), NULL, flags, + -1); VarHashDeleteEntry(varPtr); } VarHashDeleteTable(tablePtr); diff --git a/tests/trace.test b/tests/trace.test index 3b69d38..1099f48 100644 --- a/tests/trace.test +++ b/tests/trace.test @@ -1227,7 +1227,7 @@ test trace-17.3 {traced variables must survive procedure exits} { test trace-18.1 {unset traces on procedure returns} { proc p1 {x y} {set a 44; p2 14} - proc p2 {z} {trace add variable z unset {traceCheck {lsort [uplevel 2 {info vars}]}}} + proc p2 {z} {trace add variable z unset {traceCheck {lsort [uplevel 1 {info vars}]}}} set info {} p1 foo bar set info @@ -1263,27 +1263,6 @@ test trace-18.4 {namespace delete / trace vdelete combo, Bug \#1338280} { rename doTrace {} set info } 1110 -test trace-18.5 {Bug 7f02ff1efa} -setup { - proc constant {name value} { - upvar 1 $name c - set c $value - trace variable c wu [list reset $value] - } - proc reset {v a i o} { - uplevel 1 [list constant $a $v] - } - proc demo {} { - constant pi 3.14 - } -} -body { - unset -nocomplain pi - demo - info exists pi -} -cleanup { - rename demo {} - rename reset {} - rename constant {} -} -result 0 # Delete arrays when done, so they can be re-used as scalars # elsewhere. -- cgit v0.12 From c4f177f41c24e304076debfea279222a38b88060 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Thu, 15 Sep 2016 13:22:49 +0000 Subject: Proposed fix for [c7d0bc9a549714e0]. Thanks to mr_calvin --- generic/tclLiteral.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generic/tclLiteral.c b/generic/tclLiteral.c index aeb8213..4ae94a0 100644 --- a/generic/tclLiteral.c +++ b/generic/tclLiteral.c @@ -234,7 +234,6 @@ TclCreateLiteral( */ TclNewObj(objPtr); - Tcl_IncrRefCount(objPtr); if ((flags & LITERAL_ON_HEAP)) { objPtr->bytes = bytes; objPtr->length = length; @@ -261,6 +260,7 @@ TclCreateLiteral( globalPtr = ckalloc(sizeof(LiteralEntry)); globalPtr->objPtr = objPtr; + Tcl_IncrRefCount(objPtr); globalPtr->refCount = 1; globalPtr->nsPtr = nsPtr; globalPtr->nextPtr = globalTablePtr->buckets[globalHash]; -- cgit v0.12 From 65d17884a3fc402968d737201112e8006e371434 Mon Sep 17 00:00:00 2001 From: Joe Mistachkin Date: Mon, 19 Sep 2016 18:48:16 +0000 Subject: Permit static linking to the MSVCRT as a stand-alone option. Enable WinXP SDK compatibility. --- win/coffbase.txt | 4 ++-- win/rules.vc | 7 ++++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/win/coffbase.txt b/win/coffbase.txt index 3314f26..0142bb3 100644 --- a/win/coffbase.txt +++ b/win/coffbase.txt @@ -13,8 +13,8 @@ ; linker with the `-base:@$(TCLDIR)\win\coffbase.txt,` option. tcl 0x10000000 0x00200000 -tcldde 0x10200000 0x00010000 -tclreg 0x10210000 0x00010000 +tcldde 0x10200000 0x00020000 +tclreg 0x10210000 0x00020000 tk 0x10220000 0x00200000 expect 0x10480000 0x00080000 itcl 0x10500000 0x00080000 diff --git a/win/rules.vc b/win/rules.vc index d4c2f35..cd06e96 100644 --- a/win/rules.vc +++ b/win/rules.vc @@ -159,7 +159,7 @@ DEBUGFLAGS = $(DEBUGFLAGS) -RTC1 DEBUGFLAGS = $(DEBUGFLAGS) -GZ !endif -COMPILERFLAGS =-W3 -DUNICODE -D_UNICODE +COMPILERFLAGS =-W3 -DUNICODE -D_UNICODE -D_USING_V110_SDK71_=1 # In v13 -GL and -YX are incompatible. !if [nmakehlp -c -YX] @@ -230,6 +230,10 @@ STATIC_BUILD = 1 !else STATIC_BUILD = 0 !endif +!if [nmakehlp -f $(OPTS) "nomsvcrt"] +!message *** Doing nomsvcrt +MSVCRT = 0 +!else !if [nmakehlp -f $(OPTS) "msvcrt"] !message *** Doing msvcrt MSVCRT = 1 @@ -240,6 +244,7 @@ MSVCRT = 1 MSVCRT = 0 !endif !endif +!endif !if [nmakehlp -f $(OPTS) "staticpkg"] && $(STATIC_BUILD) !message *** Doing staticpkg TCL_USE_STATIC_PACKAGES = 1 -- cgit v0.12 From 46c577d5c882b4ad5ca458e7591b3391327194d9 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Wed, 21 Sep 2016 09:15:34 +0000 Subject: Make it more likely that compiled with VS2012/VS2013 actually work on Windows XP. See: [https://tedwvc.wordpress.com/2014/01/01/how-to-target-xp-with-vc2012-or-vc2013-and-continue-to-use-the-windows-8-x-sdk/] --- win/Makefile.in | 2 +- win/rules.vc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/win/Makefile.in b/win/Makefile.in index ada9448..6376470 100644 --- a/win/Makefile.in +++ b/win/Makefile.in @@ -81,7 +81,7 @@ CFLAGS_OPTIMIZE = @CFLAGS_OPTIMIZE@ #CFLAGS = $(CFLAGS_DEBUG) #CFLAGS = $(CFLAGS_OPTIMIZE) #CFLAGS = $(CFLAGS_DEBUG) $(CFLAGS_OPTIMIZE) -CFLAGS = @CFLAGS@ @CFLAGS_DEFAULT@ +CFLAGS = @CFLAGS@ @CFLAGS_DEFAULT@ -D_ATL_XP_TARGETING # To enable compilation debugging reverse the comment characters on one of the # following lines. diff --git a/win/rules.vc b/win/rules.vc index 78a167a..aa4ed1e 100644 --- a/win/rules.vc +++ b/win/rules.vc @@ -159,7 +159,7 @@ DEBUGFLAGS = $(DEBUGFLAGS) -RTC1 DEBUGFLAGS = $(DEBUGFLAGS) -GZ !endif -COMPILERFLAGS =-W3 +COMPILERFLAGS =-W3 /D_ATL_XP_TARGETING # In v13 -GL and -YX are incompatible. !if [nmakehlp -c -YX] -- cgit v0.12 From 93b5865bd7cf7a93bd9c8aa6719edba1101992f2 Mon Sep 17 00:00:00 2001 From: gahr Date: Tue, 27 Sep 2016 20:06:49 +0000 Subject: [4d5ae7d88a] Restore default-to-error logic in TcpConnect --- unix/tclUnixSock.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/unix/tclUnixSock.c b/unix/tclUnixSock.c index 8167077..3942df8 100644 --- a/unix/tclUnixSock.c +++ b/unix/tclUnixSock.c @@ -1098,7 +1098,7 @@ TcpConnect( { socklen_t optlen; int async_callback = statePtr->flags & TCP_ASYNC_PENDING; - int ret = -1, error = errno; + int ret = -1, error = EHOSTUNREACH; int async = statePtr->flags & TCP_ASYNC_CONNECT; if (async_callback) { -- cgit v0.12 From daea02d5448a5b21b217c522a799bbcbb2c28def Mon Sep 17 00:00:00 2001 From: venkat Date: Sun, 2 Oct 2016 19:24:52 +0000 Subject: Update tzdata to 2016g from ietf.org --- library/tzdata/America/Los_Angeles | 36 +-- library/tzdata/America/Tijuana | 14 +- library/tzdata/Antarctica/Casey | 10 +- library/tzdata/Antarctica/Davis | 12 +- library/tzdata/Antarctica/DumontDUrville | 4 +- library/tzdata/Antarctica/Mawson | 4 +- library/tzdata/Antarctica/Rothera | 2 +- library/tzdata/Antarctica/Syowa | 2 +- library/tzdata/Antarctica/Troll | 382 +++++++++++++++---------------- library/tzdata/Antarctica/Vostok | 2 +- library/tzdata/Asia/Anadyr | 134 +++++------ library/tzdata/Asia/Ashgabat | 52 ++--- library/tzdata/Asia/Baku | 138 +++++------ library/tzdata/Asia/Bishkek | 105 ++++----- library/tzdata/Asia/Chita | 134 +++++------ library/tzdata/Asia/Dushanbe | 48 ++-- library/tzdata/Asia/Irkutsk | 132 +++++------ library/tzdata/Asia/Kamchatka | 132 +++++------ library/tzdata/Asia/Khandyga | 136 +++++------ library/tzdata/Asia/Krasnoyarsk | 132 +++++------ library/tzdata/Asia/Magadan | 134 +++++------ library/tzdata/Asia/Omsk | 132 +++++------ library/tzdata/Asia/Rangoon | 10 +- library/tzdata/Asia/Sakhalin | 137 ++++++----- library/tzdata/Asia/Samarkand | 53 +++-- library/tzdata/Asia/Srednekolymsk | 132 +++++------ library/tzdata/Asia/Tashkent | 53 +++-- library/tzdata/Asia/Tbilisi | 108 ++++----- library/tzdata/Asia/Ust-Nera | 132 +++++------ library/tzdata/Asia/Vladivostok | 132 +++++------ library/tzdata/Asia/Yakutsk | 132 +++++------ library/tzdata/Asia/Yangon | 9 + library/tzdata/Asia/Yekaterinburg | 132 +++++------ library/tzdata/Asia/Yerevan | 129 ++++++----- library/tzdata/Etc/GMT+1 | 2 +- library/tzdata/Etc/GMT+10 | 2 +- library/tzdata/Etc/GMT+11 | 2 +- library/tzdata/Etc/GMT+12 | 2 +- library/tzdata/Etc/GMT+2 | 2 +- library/tzdata/Etc/GMT+3 | 2 +- library/tzdata/Etc/GMT+4 | 2 +- library/tzdata/Etc/GMT+5 | 2 +- library/tzdata/Etc/GMT+6 | 2 +- library/tzdata/Etc/GMT+7 | 2 +- library/tzdata/Etc/GMT+8 | 2 +- library/tzdata/Etc/GMT+9 | 2 +- library/tzdata/Etc/GMT-1 | 2 +- library/tzdata/Etc/GMT-10 | 2 +- library/tzdata/Etc/GMT-11 | 2 +- library/tzdata/Etc/GMT-12 | 2 +- library/tzdata/Etc/GMT-13 | 2 +- library/tzdata/Etc/GMT-14 | 2 +- library/tzdata/Etc/GMT-2 | 2 +- library/tzdata/Etc/GMT-3 | 2 +- library/tzdata/Etc/GMT-4 | 2 +- library/tzdata/Etc/GMT-5 | 2 +- library/tzdata/Etc/GMT-6 | 2 +- library/tzdata/Etc/GMT-7 | 2 +- library/tzdata/Etc/GMT-8 | 2 +- library/tzdata/Etc/GMT-9 | 2 +- library/tzdata/Europe/Istanbul | 190 +-------------- library/tzdata/Europe/Kaliningrad | 2 +- library/tzdata/Europe/Kirov | 2 +- library/tzdata/Europe/Minsk | 3 +- library/tzdata/Europe/Moscow | 4 +- library/tzdata/Europe/Samara | 136 +++++------ library/tzdata/Europe/Ulyanovsk | 2 +- library/tzdata/Europe/Volgograd | 133 ++++++----- library/tzdata/Indian/Kerguelen | 2 +- 69 files changed, 1698 insertions(+), 1864 deletions(-) create mode 100644 library/tzdata/Asia/Yangon diff --git a/library/tzdata/America/Los_Angeles b/library/tzdata/America/Los_Angeles index da6ca99..8e26526 100644 --- a/library/tzdata/America/Los_Angeles +++ b/library/tzdata/America/Los_Angeles @@ -11,41 +11,41 @@ set TZData(:America/Los_Angeles) { {-769395600 -25200 1 PPT} {-765385200 -28800 0 PST} {-757353600 -28800 0 PST} - {-687967200 -25200 1 PDT} + {-687967140 -25200 1 PDT} {-662655600 -28800 0 PST} - {-620834400 -25200 1 PDT} + {-620838000 -25200 1 PDT} {-608137200 -28800 0 PST} - {-589384800 -25200 1 PDT} + {-589388400 -25200 1 PDT} {-576082800 -28800 0 PST} - {-557935200 -25200 1 PDT} + {-557938800 -25200 1 PDT} {-544633200 -28800 0 PST} - {-526485600 -25200 1 PDT} + {-526489200 -25200 1 PDT} {-513183600 -28800 0 PST} - {-495036000 -25200 1 PDT} + {-495039600 -25200 1 PDT} {-481734000 -28800 0 PST} - {-463586400 -25200 1 PDT} + {-463590000 -25200 1 PDT} {-450284400 -28800 0 PST} - {-431532000 -25200 1 PDT} + {-431535600 -25200 1 PDT} {-418230000 -28800 0 PST} - {-400082400 -25200 1 PDT} + {-400086000 -25200 1 PDT} {-386780400 -28800 0 PST} - {-368632800 -25200 1 PDT} + {-368636400 -25200 1 PDT} {-355330800 -28800 0 PST} - {-337183200 -25200 1 PDT} + {-337186800 -25200 1 PDT} {-323881200 -28800 0 PST} - {-305733600 -25200 1 PDT} + {-305737200 -25200 1 PDT} {-292431600 -28800 0 PST} - {-273679200 -25200 1 PDT} + {-273682800 -25200 1 PDT} {-260982000 -28800 0 PST} - {-242229600 -25200 1 PDT} + {-242233200 -25200 1 PDT} {-226508400 -28800 0 PST} - {-210780000 -25200 1 PDT} + {-210783600 -25200 1 PDT} {-195058800 -28800 0 PST} - {-179330400 -25200 1 PDT} + {-179334000 -25200 1 PDT} {-163609200 -28800 0 PST} - {-147880800 -25200 1 PDT} + {-147884400 -25200 1 PDT} {-131554800 -28800 0 PST} - {-116431200 -25200 1 PDT} + {-116434800 -25200 1 PDT} {-100105200 -28800 0 PST} {-94665600 -28800 0 PST} {-84376800 -25200 1 PDT} diff --git a/library/tzdata/America/Tijuana b/library/tzdata/America/Tijuana index 6118cde..4b7ebe7 100644 --- a/library/tzdata/America/Tijuana +++ b/library/tzdata/America/Tijuana @@ -14,19 +14,19 @@ set TZData(:America/Tijuana) { {-686073600 -25200 1 PDT} {-661539600 -28800 0 PST} {-504892800 -28800 0 PST} - {-495036000 -25200 1 PDT} + {-495039600 -25200 1 PDT} {-481734000 -28800 0 PST} - {-463586400 -25200 1 PDT} + {-463590000 -25200 1 PDT} {-450284400 -28800 0 PST} - {-431532000 -25200 1 PDT} + {-431535600 -25200 1 PDT} {-418230000 -28800 0 PST} - {-400082400 -25200 1 PDT} + {-400086000 -25200 1 PDT} {-386780400 -28800 0 PST} - {-368632800 -25200 1 PDT} + {-368636400 -25200 1 PDT} {-355330800 -28800 0 PST} - {-337183200 -25200 1 PDT} + {-337186800 -25200 1 PDT} {-323881200 -28800 0 PST} - {-305733600 -25200 1 PDT} + {-305737200 -25200 1 PDT} {-292431600 -28800 0 PST} {-283968000 -28800 0 PST} {189331200 -28800 0 PST} diff --git a/library/tzdata/Antarctica/Casey b/library/tzdata/Antarctica/Casey index 2573dac..3035ab9 100644 --- a/library/tzdata/Antarctica/Casey +++ b/library/tzdata/Antarctica/Casey @@ -2,9 +2,9 @@ set TZData(:Antarctica/Casey) { {-9223372036854775808 0 0 -00} - {-31536000 28800 0 AWST} - {1255802400 39600 0 CAST} - {1267714800 28800 0 AWST} - {1319738400 39600 0 CAST} - {1329843600 28800 0 AWST} + {-31536000 28800 0 +08} + {1255802400 39600 0 +11} + {1267714800 28800 0 +08} + {1319738400 39600 0 +11} + {1329843600 28800 0 +08} } diff --git a/library/tzdata/Antarctica/Davis b/library/tzdata/Antarctica/Davis index c98be2f..9bb178b 100644 --- a/library/tzdata/Antarctica/Davis +++ b/library/tzdata/Antarctica/Davis @@ -2,11 +2,11 @@ set TZData(:Antarctica/Davis) { {-9223372036854775808 0 0 -00} - {-409190400 25200 0 DAVT} + {-409190400 25200 0 +07} {-163062000 0 0 -00} - {-28857600 25200 0 DAVT} - {1255806000 18000 0 DAVT} - {1268251200 25200 0 DAVT} - {1319742000 18000 0 DAVT} - {1329854400 25200 0 DAVT} + {-28857600 25200 0 +07} + {1255806000 18000 0 +05} + {1268251200 25200 0 +07} + {1319742000 18000 0 +05} + {1329854400 25200 0 +07} } diff --git a/library/tzdata/Antarctica/DumontDUrville b/library/tzdata/Antarctica/DumontDUrville index 8d21d45..f734aed 100644 --- a/library/tzdata/Antarctica/DumontDUrville +++ b/library/tzdata/Antarctica/DumontDUrville @@ -2,7 +2,7 @@ set TZData(:Antarctica/DumontDUrville) { {-9223372036854775808 0 0 -00} - {-725846400 36000 0 PMT} + {-725846400 36000 0 +10} {-566992800 0 0 -00} - {-415497600 36000 0 DDUT} + {-415497600 36000 0 +10} } diff --git a/library/tzdata/Antarctica/Mawson b/library/tzdata/Antarctica/Mawson index e50aa07..4828b1a 100644 --- a/library/tzdata/Antarctica/Mawson +++ b/library/tzdata/Antarctica/Mawson @@ -2,6 +2,6 @@ set TZData(:Antarctica/Mawson) { {-9223372036854775808 0 0 -00} - {-501206400 21600 0 MAWT} - {1255809600 18000 0 MAWT} + {-501206400 21600 0 +06} + {1255809600 18000 0 +05} } diff --git a/library/tzdata/Antarctica/Rothera b/library/tzdata/Antarctica/Rothera index 3a219c7..7f0134f 100644 --- a/library/tzdata/Antarctica/Rothera +++ b/library/tzdata/Antarctica/Rothera @@ -2,5 +2,5 @@ set TZData(:Antarctica/Rothera) { {-9223372036854775808 0 0 -00} - {218246400 -10800 0 ROTT} + {218246400 -10800 0 -03} } diff --git a/library/tzdata/Antarctica/Syowa b/library/tzdata/Antarctica/Syowa index 1fe030a..a44dd5c 100644 --- a/library/tzdata/Antarctica/Syowa +++ b/library/tzdata/Antarctica/Syowa @@ -2,5 +2,5 @@ set TZData(:Antarctica/Syowa) { {-9223372036854775808 0 0 -00} - {-407808000 10800 0 SYOT} + {-407808000 10800 0 +03} } diff --git a/library/tzdata/Antarctica/Troll b/library/tzdata/Antarctica/Troll index 09727a8..fe44578 100644 --- a/library/tzdata/Antarctica/Troll +++ b/library/tzdata/Antarctica/Troll @@ -2,195 +2,195 @@ set TZData(:Antarctica/Troll) { {-9223372036854775808 0 0 -00} - {1108166400 0 0 UTC} - {1111885200 7200 1 CEST} - {1130634000 0 0 UTC} - {1143334800 7200 1 CEST} - {1162083600 0 0 UTC} - {1174784400 7200 1 CEST} - {1193533200 0 0 UTC} - {1206838800 7200 1 CEST} - {1224982800 0 0 UTC} - {1238288400 7200 1 CEST} - {1256432400 0 0 UTC} - {1269738000 7200 1 CEST} - {1288486800 0 0 UTC} - {1301187600 7200 1 CEST} - {1319936400 0 0 UTC} - {1332637200 7200 1 CEST} - {1351386000 0 0 UTC} - {1364691600 7200 1 CEST} - {1382835600 0 0 UTC} - {1396141200 7200 1 CEST} - {1414285200 0 0 UTC} - {1427590800 7200 1 CEST} - {1445734800 0 0 UTC} - {1459040400 7200 1 CEST} - {1477789200 0 0 UTC} - {1490490000 7200 1 CEST} - {1509238800 0 0 UTC} - {1521939600 7200 1 CEST} - {1540688400 0 0 UTC} - {1553994000 7200 1 CEST} - {1572138000 0 0 UTC} - {1585443600 7200 1 CEST} - {1603587600 0 0 UTC} - {1616893200 7200 1 CEST} - {1635642000 0 0 UTC} - {1648342800 7200 1 CEST} - {1667091600 0 0 UTC} - {1679792400 7200 1 CEST} - {1698541200 0 0 UTC} - {1711846800 7200 1 CEST} - {1729990800 0 0 UTC} - {1743296400 7200 1 CEST} - {1761440400 0 0 UTC} - {1774746000 7200 1 CEST} - {1792890000 0 0 UTC} - {1806195600 7200 1 CEST} - {1824944400 0 0 UTC} - {1837645200 7200 1 CEST} - {1856394000 0 0 UTC} - {1869094800 7200 1 CEST} - {1887843600 0 0 UTC} - {1901149200 7200 1 CEST} - {1919293200 0 0 UTC} - {1932598800 7200 1 CEST} - {1950742800 0 0 UTC} - {1964048400 7200 1 CEST} - {1982797200 0 0 UTC} - {1995498000 7200 1 CEST} - {2014246800 0 0 UTC} - {2026947600 7200 1 CEST} - {2045696400 0 0 UTC} - {2058397200 7200 1 CEST} - {2077146000 0 0 UTC} - {2090451600 7200 1 CEST} - {2108595600 0 0 UTC} - {2121901200 7200 1 CEST} - {2140045200 0 0 UTC} - {2153350800 7200 1 CEST} - {2172099600 0 0 UTC} - {2184800400 7200 1 CEST} - {2203549200 0 0 UTC} - {2216250000 7200 1 CEST} - {2234998800 0 0 UTC} - {2248304400 7200 1 CEST} - {2266448400 0 0 UTC} - {2279754000 7200 1 CEST} - {2297898000 0 0 UTC} - {2311203600 7200 1 CEST} - {2329347600 0 0 UTC} - {2342653200 7200 1 CEST} - {2361402000 0 0 UTC} - {2374102800 7200 1 CEST} - {2392851600 0 0 UTC} - {2405552400 7200 1 CEST} - {2424301200 0 0 UTC} - {2437606800 7200 1 CEST} - {2455750800 0 0 UTC} - {2469056400 7200 1 CEST} - {2487200400 0 0 UTC} - {2500506000 7200 1 CEST} - {2519254800 0 0 UTC} - {2531955600 7200 1 CEST} - {2550704400 0 0 UTC} - {2563405200 7200 1 CEST} - {2582154000 0 0 UTC} - {2595459600 7200 1 CEST} - {2613603600 0 0 UTC} - {2626909200 7200 1 CEST} - {2645053200 0 0 UTC} - {2658358800 7200 1 CEST} - {2676502800 0 0 UTC} - {2689808400 7200 1 CEST} - {2708557200 0 0 UTC} - {2721258000 7200 1 CEST} - {2740006800 0 0 UTC} - {2752707600 7200 1 CEST} - {2771456400 0 0 UTC} - {2784762000 7200 1 CEST} - {2802906000 0 0 UTC} - {2816211600 7200 1 CEST} - {2834355600 0 0 UTC} - {2847661200 7200 1 CEST} - {2866410000 0 0 UTC} - {2879110800 7200 1 CEST} - {2897859600 0 0 UTC} - {2910560400 7200 1 CEST} - {2929309200 0 0 UTC} - {2942010000 7200 1 CEST} - {2960758800 0 0 UTC} - {2974064400 7200 1 CEST} - {2992208400 0 0 UTC} - {3005514000 7200 1 CEST} - {3023658000 0 0 UTC} - {3036963600 7200 1 CEST} - {3055712400 0 0 UTC} - {3068413200 7200 1 CEST} - {3087162000 0 0 UTC} - {3099862800 7200 1 CEST} - {3118611600 0 0 UTC} - {3131917200 7200 1 CEST} - {3150061200 0 0 UTC} - {3163366800 7200 1 CEST} - {3181510800 0 0 UTC} - {3194816400 7200 1 CEST} - {3212960400 0 0 UTC} - {3226266000 7200 1 CEST} - {3245014800 0 0 UTC} - {3257715600 7200 1 CEST} - {3276464400 0 0 UTC} - {3289165200 7200 1 CEST} - {3307914000 0 0 UTC} - {3321219600 7200 1 CEST} - {3339363600 0 0 UTC} - {3352669200 7200 1 CEST} - {3370813200 0 0 UTC} - {3384118800 7200 1 CEST} - {3402867600 0 0 UTC} - {3415568400 7200 1 CEST} - {3434317200 0 0 UTC} - {3447018000 7200 1 CEST} - {3465766800 0 0 UTC} - {3479072400 7200 1 CEST} - {3497216400 0 0 UTC} - {3510522000 7200 1 CEST} - {3528666000 0 0 UTC} - {3541971600 7200 1 CEST} - {3560115600 0 0 UTC} - {3573421200 7200 1 CEST} - {3592170000 0 0 UTC} - {3604870800 7200 1 CEST} - {3623619600 0 0 UTC} - {3636320400 7200 1 CEST} - {3655069200 0 0 UTC} - {3668374800 7200 1 CEST} - {3686518800 0 0 UTC} - {3699824400 7200 1 CEST} - {3717968400 0 0 UTC} - {3731274000 7200 1 CEST} - {3750022800 0 0 UTC} - {3762723600 7200 1 CEST} - {3781472400 0 0 UTC} - {3794173200 7200 1 CEST} - {3812922000 0 0 UTC} - {3825622800 7200 1 CEST} - {3844371600 0 0 UTC} - {3857677200 7200 1 CEST} - {3875821200 0 0 UTC} - {3889126800 7200 1 CEST} - {3907270800 0 0 UTC} - {3920576400 7200 1 CEST} - {3939325200 0 0 UTC} - {3952026000 7200 1 CEST} - {3970774800 0 0 UTC} - {3983475600 7200 1 CEST} - {4002224400 0 0 UTC} - {4015530000 7200 1 CEST} - {4033674000 0 0 UTC} - {4046979600 7200 1 CEST} - {4065123600 0 0 UTC} - {4078429200 7200 1 CEST} - {4096573200 0 0 UTC} + {1108166400 0 0 +00} + {1111885200 7200 1 +02} + {1130634000 0 0 +00} + {1143334800 7200 1 +02} + {1162083600 0 0 +00} + {1174784400 7200 1 +02} + {1193533200 0 0 +00} + {1206838800 7200 1 +02} + {1224982800 0 0 +00} + {1238288400 7200 1 +02} + {1256432400 0 0 +00} + {1269738000 7200 1 +02} + {1288486800 0 0 +00} + {1301187600 7200 1 +02} + {1319936400 0 0 +00} + {1332637200 7200 1 +02} + {1351386000 0 0 +00} + {1364691600 7200 1 +02} + {1382835600 0 0 +00} + {1396141200 7200 1 +02} + {1414285200 0 0 +00} + {1427590800 7200 1 +02} + {1445734800 0 0 +00} + {1459040400 7200 1 +02} + {1477789200 0 0 +00} + {1490490000 7200 1 +02} + {1509238800 0 0 +00} + {1521939600 7200 1 +02} + {1540688400 0 0 +00} + {1553994000 7200 1 +02} + {1572138000 0 0 +00} + {1585443600 7200 1 +02} + {1603587600 0 0 +00} + {1616893200 7200 1 +02} + {1635642000 0 0 +00} + {1648342800 7200 1 +02} + {1667091600 0 0 +00} + {1679792400 7200 1 +02} + {1698541200 0 0 +00} + {1711846800 7200 1 +02} + {1729990800 0 0 +00} + {1743296400 7200 1 +02} + {1761440400 0 0 +00} + {1774746000 7200 1 +02} + {1792890000 0 0 +00} + {1806195600 7200 1 +02} + {1824944400 0 0 +00} + {1837645200 7200 1 +02} + {1856394000 0 0 +00} + {1869094800 7200 1 +02} + {1887843600 0 0 +00} + {1901149200 7200 1 +02} + {1919293200 0 0 +00} + {1932598800 7200 1 +02} + {1950742800 0 0 +00} + {1964048400 7200 1 +02} + {1982797200 0 0 +00} + {1995498000 7200 1 +02} + {2014246800 0 0 +00} + {2026947600 7200 1 +02} + {2045696400 0 0 +00} + {2058397200 7200 1 +02} + {2077146000 0 0 +00} + {2090451600 7200 1 +02} + {2108595600 0 0 +00} + {2121901200 7200 1 +02} + {2140045200 0 0 +00} + {2153350800 7200 1 +02} + {2172099600 0 0 +00} + {2184800400 7200 1 +02} + {2203549200 0 0 +00} + {2216250000 7200 1 +02} + {2234998800 0 0 +00} + {2248304400 7200 1 +02} + {2266448400 0 0 +00} + {2279754000 7200 1 +02} + {2297898000 0 0 +00} + {2311203600 7200 1 +02} + {2329347600 0 0 +00} + {2342653200 7200 1 +02} + {2361402000 0 0 +00} + {2374102800 7200 1 +02} + {2392851600 0 0 +00} + {2405552400 7200 1 +02} + {2424301200 0 0 +00} + {2437606800 7200 1 +02} + {2455750800 0 0 +00} + {2469056400 7200 1 +02} + {2487200400 0 0 +00} + {2500506000 7200 1 +02} + {2519254800 0 0 +00} + {2531955600 7200 1 +02} + {2550704400 0 0 +00} + {2563405200 7200 1 +02} + {2582154000 0 0 +00} + {2595459600 7200 1 +02} + {2613603600 0 0 +00} + {2626909200 7200 1 +02} + {2645053200 0 0 +00} + {2658358800 7200 1 +02} + {2676502800 0 0 +00} + {2689808400 7200 1 +02} + {2708557200 0 0 +00} + {2721258000 7200 1 +02} + {2740006800 0 0 +00} + {2752707600 7200 1 +02} + {2771456400 0 0 +00} + {2784762000 7200 1 +02} + {2802906000 0 0 +00} + {2816211600 7200 1 +02} + {2834355600 0 0 +00} + {2847661200 7200 1 +02} + {2866410000 0 0 +00} + {2879110800 7200 1 +02} + {2897859600 0 0 +00} + {2910560400 7200 1 +02} + {2929309200 0 0 +00} + {2942010000 7200 1 +02} + {2960758800 0 0 +00} + {2974064400 7200 1 +02} + {2992208400 0 0 +00} + {3005514000 7200 1 +02} + {3023658000 0 0 +00} + {3036963600 7200 1 +02} + {3055712400 0 0 +00} + {3068413200 7200 1 +02} + {3087162000 0 0 +00} + {3099862800 7200 1 +02} + {3118611600 0 0 +00} + {3131917200 7200 1 +02} + {3150061200 0 0 +00} + {3163366800 7200 1 +02} + {3181510800 0 0 +00} + {3194816400 7200 1 +02} + {3212960400 0 0 +00} + {3226266000 7200 1 +02} + {3245014800 0 0 +00} + {3257715600 7200 1 +02} + {3276464400 0 0 +00} + {3289165200 7200 1 +02} + {3307914000 0 0 +00} + {3321219600 7200 1 +02} + {3339363600 0 0 +00} + {3352669200 7200 1 +02} + {3370813200 0 0 +00} + {3384118800 7200 1 +02} + {3402867600 0 0 +00} + {3415568400 7200 1 +02} + {3434317200 0 0 +00} + {3447018000 7200 1 +02} + {3465766800 0 0 +00} + {3479072400 7200 1 +02} + {3497216400 0 0 +00} + {3510522000 7200 1 +02} + {3528666000 0 0 +00} + {3541971600 7200 1 +02} + {3560115600 0 0 +00} + {3573421200 7200 1 +02} + {3592170000 0 0 +00} + {3604870800 7200 1 +02} + {3623619600 0 0 +00} + {3636320400 7200 1 +02} + {3655069200 0 0 +00} + {3668374800 7200 1 +02} + {3686518800 0 0 +00} + {3699824400 7200 1 +02} + {3717968400 0 0 +00} + {3731274000 7200 1 +02} + {3750022800 0 0 +00} + {3762723600 7200 1 +02} + {3781472400 0 0 +00} + {3794173200 7200 1 +02} + {3812922000 0 0 +00} + {3825622800 7200 1 +02} + {3844371600 0 0 +00} + {3857677200 7200 1 +02} + {3875821200 0 0 +00} + {3889126800 7200 1 +02} + {3907270800 0 0 +00} + {3920576400 7200 1 +02} + {3939325200 0 0 +00} + {3952026000 7200 1 +02} + {3970774800 0 0 +00} + {3983475600 7200 1 +02} + {4002224400 0 0 +00} + {4015530000 7200 1 +02} + {4033674000 0 0 +00} + {4046979600 7200 1 +02} + {4065123600 0 0 +00} + {4078429200 7200 1 +02} + {4096573200 0 0 +00} } diff --git a/library/tzdata/Antarctica/Vostok b/library/tzdata/Antarctica/Vostok index a59868b..7f345a2 100644 --- a/library/tzdata/Antarctica/Vostok +++ b/library/tzdata/Antarctica/Vostok @@ -2,5 +2,5 @@ set TZData(:Antarctica/Vostok) { {-9223372036854775808 0 0 -00} - {-380073600 21600 0 VOST} + {-380073600 21600 0 +06} } diff --git a/library/tzdata/Asia/Anadyr b/library/tzdata/Asia/Anadyr index 2e8ffc7..d1314c6 100644 --- a/library/tzdata/Asia/Anadyr +++ b/library/tzdata/Asia/Anadyr @@ -2,71 +2,71 @@ set TZData(:Asia/Anadyr) { {-9223372036854775808 42596 0 LMT} - {-1441194596 43200 0 ANAT} - {-1247572800 46800 0 ANAMMTT} - {354884400 50400 1 ANAST} - {370692000 46800 0 ANAT} - {386420400 43200 0 ANAMMTT} - {386424000 46800 1 ANAST} - {402231600 43200 0 ANAT} - {417960000 46800 1 ANAST} - {433767600 43200 0 ANAT} - {449582400 46800 1 ANAST} - {465314400 43200 0 ANAT} - {481039200 46800 1 ANAST} - {496764000 43200 0 ANAT} - {512488800 46800 1 ANAST} - {528213600 43200 0 ANAT} - {543938400 46800 1 ANAST} - {559663200 43200 0 ANAT} - {575388000 46800 1 ANAST} - {591112800 43200 0 ANAT} - {606837600 46800 1 ANAST} - {622562400 43200 0 ANAT} - {638287200 46800 1 ANAST} - {654616800 43200 0 ANAT} - {670341600 39600 0 ANAMMTT} - {670345200 43200 1 ANAST} - {686070000 39600 0 ANAT} - {695746800 43200 0 ANAMMTT} - {701791200 46800 1 ANAST} - {717516000 43200 0 ANAT} - {733240800 46800 1 ANAST} - {748965600 43200 0 ANAT} - {764690400 46800 1 ANAST} - {780415200 43200 0 ANAT} - {796140000 46800 1 ANAST} - {811864800 43200 0 ANAT} - {828194400 46800 1 ANAST} - {846338400 43200 0 ANAT} - {859644000 46800 1 ANAST} - {877788000 43200 0 ANAT} - {891093600 46800 1 ANAST} - {909237600 43200 0 ANAT} - {922543200 46800 1 ANAST} - {941292000 43200 0 ANAT} - {953992800 46800 1 ANAST} - {972741600 43200 0 ANAT} - {985442400 46800 1 ANAST} - {1004191200 43200 0 ANAT} - {1017496800 46800 1 ANAST} - {1035640800 43200 0 ANAT} - {1048946400 46800 1 ANAST} - {1067090400 43200 0 ANAT} - {1080396000 46800 1 ANAST} - {1099144800 43200 0 ANAT} - {1111845600 46800 1 ANAST} - {1130594400 43200 0 ANAT} - {1143295200 46800 1 ANAST} - {1162044000 43200 0 ANAT} - {1174744800 46800 1 ANAST} - {1193493600 43200 0 ANAT} - {1206799200 46800 1 ANAST} - {1224943200 43200 0 ANAT} - {1238248800 46800 1 ANAST} - {1256392800 43200 0 ANAT} - {1269698400 39600 0 ANAMMTT} - {1269702000 43200 1 ANAST} - {1288450800 39600 0 ANAT} - {1301151600 43200 0 ANAT} + {-1441194596 43200 0 +12} + {-1247572800 46800 0 +14} + {354884400 50400 1 +14} + {370692000 46800 0 +13} + {386420400 43200 0 +13} + {386424000 46800 1 +13} + {402231600 43200 0 +12} + {417960000 46800 1 +13} + {433767600 43200 0 +12} + {449582400 46800 1 +13} + {465314400 43200 0 +12} + {481039200 46800 1 +13} + {496764000 43200 0 +12} + {512488800 46800 1 +13} + {528213600 43200 0 +12} + {543938400 46800 1 +13} + {559663200 43200 0 +12} + {575388000 46800 1 +13} + {591112800 43200 0 +12} + {606837600 46800 1 +13} + {622562400 43200 0 +12} + {638287200 46800 1 +13} + {654616800 43200 0 +12} + {670341600 39600 0 +12} + {670345200 43200 1 +12} + {686070000 39600 0 +11} + {695746800 43200 0 +13} + {701791200 46800 1 +13} + {717516000 43200 0 +12} + {733240800 46800 1 +13} + {748965600 43200 0 +12} + {764690400 46800 1 +13} + {780415200 43200 0 +12} + {796140000 46800 1 +13} + {811864800 43200 0 +12} + {828194400 46800 1 +13} + {846338400 43200 0 +12} + {859644000 46800 1 +13} + {877788000 43200 0 +12} + {891093600 46800 1 +13} + {909237600 43200 0 +12} + {922543200 46800 1 +13} + {941292000 43200 0 +12} + {953992800 46800 1 +13} + {972741600 43200 0 +12} + {985442400 46800 1 +13} + {1004191200 43200 0 +12} + {1017496800 46800 1 +13} + {1035640800 43200 0 +12} + {1048946400 46800 1 +13} + {1067090400 43200 0 +12} + {1080396000 46800 1 +13} + {1099144800 43200 0 +12} + {1111845600 46800 1 +13} + {1130594400 43200 0 +12} + {1143295200 46800 1 +13} + {1162044000 43200 0 +12} + {1174744800 46800 1 +13} + {1193493600 43200 0 +12} + {1206799200 46800 1 +13} + {1224943200 43200 0 +12} + {1238248800 46800 1 +13} + {1256392800 43200 0 +12} + {1269698400 39600 0 +12} + {1269702000 43200 1 +12} + {1288450800 39600 0 +11} + {1301151600 43200 0 +12} } diff --git a/library/tzdata/Asia/Ashgabat b/library/tzdata/Asia/Ashgabat index 64bdb3a..fa6a619 100644 --- a/library/tzdata/Asia/Ashgabat +++ b/library/tzdata/Asia/Ashgabat @@ -2,30 +2,30 @@ set TZData(:Asia/Ashgabat) { {-9223372036854775808 14012 0 LMT} - {-1441166012 14400 0 ASHT} - {-1247544000 18000 0 ASHT} - {354913200 21600 1 ASHST} - {370720800 18000 0 ASHT} - {386449200 21600 1 ASHST} - {402256800 18000 0 ASHT} - {417985200 21600 1 ASHST} - {433792800 18000 0 ASHT} - {449607600 21600 1 ASHST} - {465339600 18000 0 ASHT} - {481064400 21600 1 ASHST} - {496789200 18000 0 ASHT} - {512514000 21600 1 ASHST} - {528238800 18000 0 ASHT} - {543963600 21600 1 ASHST} - {559688400 18000 0 ASHT} - {575413200 21600 1 ASHST} - {591138000 18000 0 ASHT} - {606862800 21600 1 ASHST} - {622587600 18000 0 ASHT} - {638312400 21600 1 ASHST} - {654642000 18000 0 ASHT} - {670366800 14400 0 ASHT} - {670370400 18000 1 ASHST} - {686095200 14400 0 ASHT} - {695772000 18000 0 TMT} + {-1441166012 14400 0 +04} + {-1247544000 18000 0 +05} + {354913200 21600 1 +06} + {370720800 18000 0 +05} + {386449200 21600 1 +06} + {402256800 18000 0 +05} + {417985200 21600 1 +06} + {433792800 18000 0 +05} + {449607600 21600 1 +06} + {465339600 18000 0 +05} + {481064400 21600 1 +06} + {496789200 18000 0 +05} + {512514000 21600 1 +06} + {528238800 18000 0 +05} + {543963600 21600 1 +06} + {559688400 18000 0 +05} + {575413200 21600 1 +06} + {591138000 18000 0 +05} + {606862800 21600 1 +06} + {622587600 18000 0 +05} + {638312400 21600 1 +06} + {654642000 18000 0 +05} + {670366800 14400 0 +04} + {670370400 18000 1 +05} + {686095200 14400 0 +04} + {695772000 18000 0 +05} } diff --git a/library/tzdata/Asia/Baku b/library/tzdata/Asia/Baku index e9ee835..f945b89 100644 --- a/library/tzdata/Asia/Baku +++ b/library/tzdata/Asia/Baku @@ -2,73 +2,73 @@ set TZData(:Asia/Baku) { {-9223372036854775808 11964 0 LMT} - {-1441163964 10800 0 BAKT} - {-405140400 14400 0 BAKT} - {354916800 18000 1 BAKST} - {370724400 14400 0 BAKT} - {386452800 18000 1 BAKST} - {402260400 14400 0 BAKT} - {417988800 18000 1 BAKST} - {433796400 14400 0 BAKT} - {449611200 18000 1 BAKST} - {465343200 14400 0 BAKT} - {481068000 18000 1 BAKST} - {496792800 14400 0 BAKT} - {512517600 18000 1 BAKST} - {528242400 14400 0 BAKT} - {543967200 18000 1 BAKST} - {559692000 14400 0 BAKT} - {575416800 18000 1 BAKST} - {591141600 14400 0 BAKT} - {606866400 18000 1 BAKST} - {622591200 14400 0 BAKT} - {638316000 18000 1 BAKST} - {654645600 14400 0 BAKT} - {670370400 14400 1 BAKST} - {683496000 14400 0 AZST} - {686098800 10800 0 AZT} - {701823600 14400 1 AZST} - {717548400 14400 0 AZT} - {820440000 14400 0 AZT} - {828234000 18000 1 AZST} - {846378000 14400 0 AZT} - {852062400 14400 0 AZT} - {859680000 18000 1 AZST} - {877824000 14400 0 AZT} - {891129600 18000 1 AZST} - {909273600 14400 0 AZT} - {922579200 18000 1 AZST} - {941328000 14400 0 AZT} - {954028800 18000 1 AZST} - {972777600 14400 0 AZT} - {985478400 18000 1 AZST} - {1004227200 14400 0 AZT} - {1017532800 18000 1 AZST} - {1035676800 14400 0 AZT} - {1048982400 18000 1 AZST} - {1067126400 14400 0 AZT} - {1080432000 18000 1 AZST} - {1099180800 14400 0 AZT} - {1111881600 18000 1 AZST} - {1130630400 14400 0 AZT} - {1143331200 18000 1 AZST} - {1162080000 14400 0 AZT} - {1174780800 18000 1 AZST} - {1193529600 14400 0 AZT} - {1206835200 18000 1 AZST} - {1224979200 14400 0 AZT} - {1238284800 18000 1 AZST} - {1256428800 14400 0 AZT} - {1269734400 18000 1 AZST} - {1288483200 14400 0 AZT} - {1301184000 18000 1 AZST} - {1319932800 14400 0 AZT} - {1332633600 18000 1 AZST} - {1351382400 14400 0 AZT} - {1364688000 18000 1 AZST} - {1382832000 14400 0 AZT} - {1396137600 18000 1 AZST} - {1414281600 14400 0 AZT} - {1427587200 18000 1 AZST} - {1445731200 14400 0 AZT} + {-1441163964 10800 0 +03} + {-405140400 14400 0 +04} + {354916800 18000 1 +05} + {370724400 14400 0 +04} + {386452800 18000 1 +05} + {402260400 14400 0 +04} + {417988800 18000 1 +05} + {433796400 14400 0 +04} + {449611200 18000 1 +05} + {465343200 14400 0 +04} + {481068000 18000 1 +05} + {496792800 14400 0 +04} + {512517600 18000 1 +05} + {528242400 14400 0 +04} + {543967200 18000 1 +05} + {559692000 14400 0 +04} + {575416800 18000 1 +05} + {591141600 14400 0 +04} + {606866400 18000 1 +05} + {622591200 14400 0 +04} + {638316000 18000 1 +05} + {654645600 14400 0 +04} + {670370400 10800 0 +03} + {670374000 14400 1 +04} + {686098800 10800 0 +03} + {701823600 14400 1 +04} + {717548400 14400 0 +04} + {820440000 14400 0 +04} + {828234000 18000 1 +05} + {846378000 14400 0 +04} + {852062400 14400 0 +04} + {859680000 18000 1 +05} + {877824000 14400 0 +04} + {891129600 18000 1 +05} + {909273600 14400 0 +04} + {922579200 18000 1 +05} + {941328000 14400 0 +04} + {954028800 18000 1 +05} + {972777600 14400 0 +04} + {985478400 18000 1 +05} + {1004227200 14400 0 +04} + {1017532800 18000 1 +05} + {1035676800 14400 0 +04} + {1048982400 18000 1 +05} + {1067126400 14400 0 +04} + {1080432000 18000 1 +05} + {1099180800 14400 0 +04} + {1111881600 18000 1 +05} + {1130630400 14400 0 +04} + {1143331200 18000 1 +05} + {1162080000 14400 0 +04} + {1174780800 18000 1 +05} + {1193529600 14400 0 +04} + {1206835200 18000 1 +05} + {1224979200 14400 0 +04} + {1238284800 18000 1 +05} + {1256428800 14400 0 +04} + {1269734400 18000 1 +05} + {1288483200 14400 0 +04} + {1301184000 18000 1 +05} + {1319932800 14400 0 +04} + {1332633600 18000 1 +05} + {1351382400 14400 0 +04} + {1364688000 18000 1 +05} + {1382832000 14400 0 +04} + {1396137600 18000 1 +05} + {1414281600 14400 0 +04} + {1427587200 18000 1 +05} + {1445731200 14400 0 +04} } diff --git a/library/tzdata/Asia/Bishkek b/library/tzdata/Asia/Bishkek index 6ba3896..a02d789 100644 --- a/library/tzdata/Asia/Bishkek +++ b/library/tzdata/Asia/Bishkek @@ -2,56 +2,57 @@ set TZData(:Asia/Bishkek) { {-9223372036854775808 17904 0 LMT} - {-1441169904 18000 0 FRUT} - {-1247547600 21600 0 FRUT} - {354909600 25200 1 FRUST} - {370717200 21600 0 FRUT} - {386445600 25200 1 FRUST} - {402253200 21600 0 FRUT} - {417981600 25200 1 FRUST} - {433789200 21600 0 FRUT} - {449604000 25200 1 FRUST} - {465336000 21600 0 FRUT} - {481060800 25200 1 FRUST} - {496785600 21600 0 FRUT} - {512510400 25200 1 FRUST} - {528235200 21600 0 FRUT} - {543960000 25200 1 FRUST} - {559684800 21600 0 FRUT} - {575409600 25200 1 FRUST} - {591134400 21600 0 FRUT} - {606859200 25200 1 FRUST} - {622584000 21600 0 FRUT} - {638308800 25200 1 FRUST} - {654638400 21600 0 FRUT} - {670363200 21600 1 FRUST} - {683582400 21600 0 KGT} - {703018800 21600 1 KGST} - {717530400 18000 0 KGT} - {734468400 21600 1 KGST} - {748980000 18000 0 KGT} - {765918000 21600 1 KGST} - {780429600 18000 0 KGT} - {797367600 21600 1 KGST} - {811879200 18000 0 KGT} - {828817200 21600 1 KGST} - {843933600 18000 0 KGT} - {859671000 21600 1 KGST} - {877811400 18000 0 KGT} - {891120600 21600 1 KGST} - {909261000 18000 0 KGT} - {922570200 21600 1 KGST} - {941315400 18000 0 KGT} - {954019800 21600 1 KGST} - {972765000 18000 0 KGT} - {985469400 21600 1 KGST} - {1004214600 18000 0 KGT} - {1017523800 21600 1 KGST} - {1035664200 18000 0 KGT} - {1048973400 21600 1 KGST} - {1067113800 18000 0 KGT} - {1080423000 21600 1 KGST} - {1099168200 18000 0 KGT} - {1111872600 21600 1 KGST} - {1123783200 21600 0 KGT} + {-1441169904 18000 0 +05} + {-1247547600 21600 0 +06} + {354909600 25200 1 +07} + {370717200 21600 0 +06} + {386445600 25200 1 +07} + {402253200 21600 0 +06} + {417981600 25200 1 +07} + {433789200 21600 0 +06} + {449604000 25200 1 +07} + {465336000 21600 0 +06} + {481060800 25200 1 +07} + {496785600 21600 0 +06} + {512510400 25200 1 +07} + {528235200 21600 0 +06} + {543960000 25200 1 +07} + {559684800 21600 0 +06} + {575409600 25200 1 +07} + {591134400 21600 0 +06} + {606859200 25200 1 +07} + {622584000 21600 0 +06} + {638308800 25200 1 +07} + {654638400 21600 0 +06} + {670363200 18000 0 +05} + {670366800 21600 1 +06} + {683586000 18000 0 +05} + {703018800 21600 1 +06} + {717530400 18000 0 +05} + {734468400 21600 1 +06} + {748980000 18000 0 +05} + {765918000 21600 1 +06} + {780429600 18000 0 +05} + {797367600 21600 1 +06} + {811879200 18000 0 +05} + {828817200 21600 1 +06} + {843933600 18000 0 +05} + {859671000 21600 1 +06} + {877811400 18000 0 +05} + {891120600 21600 1 +06} + {909261000 18000 0 +05} + {922570200 21600 1 +06} + {941315400 18000 0 +05} + {954019800 21600 1 +06} + {972765000 18000 0 +05} + {985469400 21600 1 +06} + {1004214600 18000 0 +05} + {1017523800 21600 1 +06} + {1035664200 18000 0 +05} + {1048973400 21600 1 +06} + {1067113800 18000 0 +05} + {1080423000 21600 1 +06} + {1099168200 18000 0 +05} + {1111872600 21600 1 +06} + {1123783200 21600 0 +06} } diff --git a/library/tzdata/Asia/Chita b/library/tzdata/Asia/Chita index 2517beb..279c016 100644 --- a/library/tzdata/Asia/Chita +++ b/library/tzdata/Asia/Chita @@ -2,71 +2,71 @@ set TZData(:Asia/Chita) { {-9223372036854775808 27232 0 LMT} - {-1579419232 28800 0 YAKT} - {-1247558400 32400 0 YAKMMTT} - {354898800 36000 1 YAKST} - {370706400 32400 0 YAKT} - {386434800 36000 1 YAKST} - {402242400 32400 0 YAKT} - {417970800 36000 1 YAKST} - {433778400 32400 0 YAKT} - {449593200 36000 1 YAKST} - {465325200 32400 0 YAKT} - {481050000 36000 1 YAKST} - {496774800 32400 0 YAKT} - {512499600 36000 1 YAKST} - {528224400 32400 0 YAKT} - {543949200 36000 1 YAKST} - {559674000 32400 0 YAKT} - {575398800 36000 1 YAKST} - {591123600 32400 0 YAKT} - {606848400 36000 1 YAKST} - {622573200 32400 0 YAKT} - {638298000 36000 1 YAKST} - {654627600 32400 0 YAKT} - {670352400 28800 0 YAKMMTT} - {670356000 32400 1 YAKST} - {686080800 28800 0 YAKT} - {695757600 32400 0 YAKMMTT} - {701802000 36000 1 YAKST} - {717526800 32400 0 YAKT} - {733251600 36000 1 YAKST} - {748976400 32400 0 YAKT} - {764701200 36000 1 YAKST} - {780426000 32400 0 YAKT} - {796150800 36000 1 YAKST} - {811875600 32400 0 YAKT} - {828205200 36000 1 YAKST} - {846349200 32400 0 YAKT} - {859654800 36000 1 YAKST} - {877798800 32400 0 YAKT} - {891104400 36000 1 YAKST} - {909248400 32400 0 YAKT} - {922554000 36000 1 YAKST} - {941302800 32400 0 YAKT} - {954003600 36000 1 YAKST} - {972752400 32400 0 YAKT} - {985453200 36000 1 YAKST} - {1004202000 32400 0 YAKT} - {1017507600 36000 1 YAKST} - {1035651600 32400 0 YAKT} - {1048957200 36000 1 YAKST} - {1067101200 32400 0 YAKT} - {1080406800 36000 1 YAKST} - {1099155600 32400 0 YAKT} - {1111856400 36000 1 YAKST} - {1130605200 32400 0 YAKT} - {1143306000 36000 1 YAKST} - {1162054800 32400 0 YAKT} - {1174755600 36000 1 YAKST} - {1193504400 32400 0 YAKT} - {1206810000 36000 1 YAKST} - {1224954000 32400 0 YAKT} - {1238259600 36000 1 YAKST} - {1256403600 32400 0 YAKT} - {1269709200 36000 1 YAKST} - {1288458000 32400 0 YAKT} - {1301158800 36000 0 YAKT} - {1414252800 28800 0 IRKT} - {1459015200 32400 0 YAKT} + {-1579419232 28800 0 +08} + {-1247558400 32400 0 +10} + {354898800 36000 1 +10} + {370706400 32400 0 +09} + {386434800 36000 1 +10} + {402242400 32400 0 +09} + {417970800 36000 1 +10} + {433778400 32400 0 +09} + {449593200 36000 1 +10} + {465325200 32400 0 +09} + {481050000 36000 1 +10} + {496774800 32400 0 +09} + {512499600 36000 1 +10} + {528224400 32400 0 +09} + {543949200 36000 1 +10} + {559674000 32400 0 +09} + {575398800 36000 1 +10} + {591123600 32400 0 +09} + {606848400 36000 1 +10} + {622573200 32400 0 +09} + {638298000 36000 1 +10} + {654627600 32400 0 +09} + {670352400 28800 0 +09} + {670356000 32400 1 +09} + {686080800 28800 0 +08} + {695757600 32400 0 +10} + {701802000 36000 1 +10} + {717526800 32400 0 +09} + {733251600 36000 1 +10} + {748976400 32400 0 +09} + {764701200 36000 1 +10} + {780426000 32400 0 +09} + {796150800 36000 1 +10} + {811875600 32400 0 +09} + {828205200 36000 1 +10} + {846349200 32400 0 +09} + {859654800 36000 1 +10} + {877798800 32400 0 +09} + {891104400 36000 1 +10} + {909248400 32400 0 +09} + {922554000 36000 1 +10} + {941302800 32400 0 +09} + {954003600 36000 1 +10} + {972752400 32400 0 +09} + {985453200 36000 1 +10} + {1004202000 32400 0 +09} + {1017507600 36000 1 +10} + {1035651600 32400 0 +09} + {1048957200 36000 1 +10} + {1067101200 32400 0 +09} + {1080406800 36000 1 +10} + {1099155600 32400 0 +09} + {1111856400 36000 1 +10} + {1130605200 32400 0 +09} + {1143306000 36000 1 +10} + {1162054800 32400 0 +09} + {1174755600 36000 1 +10} + {1193504400 32400 0 +09} + {1206810000 36000 1 +10} + {1224954000 32400 0 +09} + {1238259600 36000 1 +10} + {1256403600 32400 0 +09} + {1269709200 36000 1 +10} + {1288458000 32400 0 +09} + {1301158800 36000 0 +10} + {1414252800 28800 0 +08} + {1459015200 32400 0 +09} } diff --git a/library/tzdata/Asia/Dushanbe b/library/tzdata/Asia/Dushanbe index 59f8cb6..e9ed132 100644 --- a/library/tzdata/Asia/Dushanbe +++ b/library/tzdata/Asia/Dushanbe @@ -2,28 +2,28 @@ set TZData(:Asia/Dushanbe) { {-9223372036854775808 16512 0 LMT} - {-1441168512 18000 0 DUST} - {-1247547600 21600 0 DUST} - {354909600 25200 1 DUSST} - {370717200 21600 0 DUST} - {386445600 25200 1 DUSST} - {402253200 21600 0 DUST} - {417981600 25200 1 DUSST} - {433789200 21600 0 DUST} - {449604000 25200 1 DUSST} - {465336000 21600 0 DUST} - {481060800 25200 1 DUSST} - {496785600 21600 0 DUST} - {512510400 25200 1 DUSST} - {528235200 21600 0 DUST} - {543960000 25200 1 DUSST} - {559684800 21600 0 DUST} - {575409600 25200 1 DUSST} - {591134400 21600 0 DUST} - {606859200 25200 1 DUSST} - {622584000 21600 0 DUST} - {638308800 25200 1 DUSST} - {654638400 21600 0 DUST} - {670363200 21600 1 DUSST} - {684363600 18000 0 TJT} + {-1441168512 18000 0 +05} + {-1247547600 21600 0 +06} + {354909600 25200 1 +07} + {370717200 21600 0 +06} + {386445600 25200 1 +07} + {402253200 21600 0 +06} + {417981600 25200 1 +07} + {433789200 21600 0 +06} + {449604000 25200 1 +07} + {465336000 21600 0 +06} + {481060800 25200 1 +07} + {496785600 21600 0 +06} + {512510400 25200 1 +07} + {528235200 21600 0 +06} + {543960000 25200 1 +07} + {559684800 21600 0 +06} + {575409600 25200 1 +07} + {591134400 21600 0 +06} + {606859200 25200 1 +07} + {622584000 21600 0 +06} + {638308800 25200 1 +07} + {654638400 21600 0 +06} + {670363200 21600 1 +06} + {684363600 18000 0 +05} } diff --git a/library/tzdata/Asia/Irkutsk b/library/tzdata/Asia/Irkutsk index ebe00c3..9666969 100644 --- a/library/tzdata/Asia/Irkutsk +++ b/library/tzdata/Asia/Irkutsk @@ -3,70 +3,70 @@ set TZData(:Asia/Irkutsk) { {-9223372036854775808 25025 0 LMT} {-2840165825 25025 0 IMT} - {-1575874625 25200 0 IRKT} - {-1247554800 28800 0 IRKMMTT} - {354902400 32400 1 IRKST} - {370710000 28800 0 IRKT} - {386438400 32400 1 IRKST} - {402246000 28800 0 IRKT} - {417974400 32400 1 IRKST} - {433782000 28800 0 IRKT} - {449596800 32400 1 IRKST} - {465328800 28800 0 IRKT} - {481053600 32400 1 IRKST} - {496778400 28800 0 IRKT} - {512503200 32400 1 IRKST} - {528228000 28800 0 IRKT} - {543952800 32400 1 IRKST} - {559677600 28800 0 IRKT} - {575402400 32400 1 IRKST} - {591127200 28800 0 IRKT} - {606852000 32400 1 IRKST} - {622576800 28800 0 IRKT} - {638301600 32400 1 IRKST} - {654631200 28800 0 IRKT} - {670356000 25200 0 IRKMMTT} - {670359600 28800 1 IRKST} - {686084400 25200 0 IRKT} - {695761200 28800 0 IRKMMTT} - {701805600 32400 1 IRKST} - {717530400 28800 0 IRKT} - {733255200 32400 1 IRKST} - {748980000 28800 0 IRKT} - {764704800 32400 1 IRKST} - {780429600 28800 0 IRKT} - {796154400 32400 1 IRKST} - {811879200 28800 0 IRKT} - {828208800 32400 1 IRKST} - {846352800 28800 0 IRKT} - {859658400 32400 1 IRKST} - {877802400 28800 0 IRKT} - {891108000 32400 1 IRKST} - {909252000 28800 0 IRKT} - {922557600 32400 1 IRKST} - {941306400 28800 0 IRKT} - {954007200 32400 1 IRKST} - {972756000 28800 0 IRKT} - {985456800 32400 1 IRKST} - {1004205600 28800 0 IRKT} - {1017511200 32400 1 IRKST} - {1035655200 28800 0 IRKT} - {1048960800 32400 1 IRKST} - {1067104800 28800 0 IRKT} - {1080410400 32400 1 IRKST} - {1099159200 28800 0 IRKT} - {1111860000 32400 1 IRKST} - {1130608800 28800 0 IRKT} - {1143309600 32400 1 IRKST} - {1162058400 28800 0 IRKT} - {1174759200 32400 1 IRKST} - {1193508000 28800 0 IRKT} - {1206813600 32400 1 IRKST} - {1224957600 28800 0 IRKT} - {1238263200 32400 1 IRKST} - {1256407200 28800 0 IRKT} - {1269712800 32400 1 IRKST} - {1288461600 28800 0 IRKT} - {1301162400 32400 0 IRKT} - {1414256400 28800 0 IRKT} + {-1575874625 25200 0 +07} + {-1247554800 28800 0 +09} + {354902400 32400 1 +09} + {370710000 28800 0 +08} + {386438400 32400 1 +09} + {402246000 28800 0 +08} + {417974400 32400 1 +09} + {433782000 28800 0 +08} + {449596800 32400 1 +09} + {465328800 28800 0 +08} + {481053600 32400 1 +09} + {496778400 28800 0 +08} + {512503200 32400 1 +09} + {528228000 28800 0 +08} + {543952800 32400 1 +09} + {559677600 28800 0 +08} + {575402400 32400 1 +09} + {591127200 28800 0 +08} + {606852000 32400 1 +09} + {622576800 28800 0 +08} + {638301600 32400 1 +09} + {654631200 28800 0 +08} + {670356000 25200 0 +08} + {670359600 28800 1 +08} + {686084400 25200 0 +07} + {695761200 28800 0 +09} + {701805600 32400 1 +09} + {717530400 28800 0 +08} + {733255200 32400 1 +09} + {748980000 28800 0 +08} + {764704800 32400 1 +09} + {780429600 28800 0 +08} + {796154400 32400 1 +09} + {811879200 28800 0 +08} + {828208800 32400 1 +09} + {846352800 28800 0 +08} + {859658400 32400 1 +09} + {877802400 28800 0 +08} + {891108000 32400 1 +09} + {909252000 28800 0 +08} + {922557600 32400 1 +09} + {941306400 28800 0 +08} + {954007200 32400 1 +09} + {972756000 28800 0 +08} + {985456800 32400 1 +09} + {1004205600 28800 0 +08} + {1017511200 32400 1 +09} + {1035655200 28800 0 +08} + {1048960800 32400 1 +09} + {1067104800 28800 0 +08} + {1080410400 32400 1 +09} + {1099159200 28800 0 +08} + {1111860000 32400 1 +09} + {1130608800 28800 0 +08} + {1143309600 32400 1 +09} + {1162058400 28800 0 +08} + {1174759200 32400 1 +09} + {1193508000 28800 0 +08} + {1206813600 32400 1 +09} + {1224957600 28800 0 +08} + {1238263200 32400 1 +09} + {1256407200 28800 0 +08} + {1269712800 32400 1 +09} + {1288461600 28800 0 +08} + {1301162400 32400 0 +09} + {1414256400 28800 0 +08} } diff --git a/library/tzdata/Asia/Kamchatka b/library/tzdata/Asia/Kamchatka index 2b77154..818fc2d 100644 --- a/library/tzdata/Asia/Kamchatka +++ b/library/tzdata/Asia/Kamchatka @@ -2,70 +2,70 @@ set TZData(:Asia/Kamchatka) { {-9223372036854775808 38076 0 LMT} - {-1487759676 39600 0 PETT} - {-1247569200 43200 0 PETMMTT} - {354888000 46800 1 PETST} - {370695600 43200 0 PETT} - {386424000 46800 1 PETST} - {402231600 43200 0 PETT} - {417960000 46800 1 PETST} - {433767600 43200 0 PETT} - {449582400 46800 1 PETST} - {465314400 43200 0 PETT} - {481039200 46800 1 PETST} - {496764000 43200 0 PETT} - {512488800 46800 1 PETST} - {528213600 43200 0 PETT} - {543938400 46800 1 PETST} - {559663200 43200 0 PETT} - {575388000 46800 1 PETST} - {591112800 43200 0 PETT} - {606837600 46800 1 PETST} - {622562400 43200 0 PETT} - {638287200 46800 1 PETST} - {654616800 43200 0 PETT} - {670341600 39600 0 PETMMTT} - {670345200 43200 1 PETST} - {686070000 39600 0 PETT} - {695746800 43200 0 PETMMTT} - {701791200 46800 1 PETST} - {717516000 43200 0 PETT} - {733240800 46800 1 PETST} - {748965600 43200 0 PETT} - {764690400 46800 1 PETST} - {780415200 43200 0 PETT} - {796140000 46800 1 PETST} - {811864800 43200 0 PETT} - {828194400 46800 1 PETST} - {846338400 43200 0 PETT} - {859644000 46800 1 PETST} - {877788000 43200 0 PETT} - {891093600 46800 1 PETST} - {909237600 43200 0 PETT} - {922543200 46800 1 PETST} - {941292000 43200 0 PETT} - {953992800 46800 1 PETST} - {972741600 43200 0 PETT} - {985442400 46800 1 PETST} - {1004191200 43200 0 PETT} - {1017496800 46800 1 PETST} - {1035640800 43200 0 PETT} - {1048946400 46800 1 PETST} - {1067090400 43200 0 PETT} - {1080396000 46800 1 PETST} - {1099144800 43200 0 PETT} - {1111845600 46800 1 PETST} - {1130594400 43200 0 PETT} - {1143295200 46800 1 PETST} - {1162044000 43200 0 PETT} - {1174744800 46800 1 PETST} - {1193493600 43200 0 PETT} - {1206799200 46800 1 PETST} - {1224943200 43200 0 PETT} - {1238248800 46800 1 PETST} - {1256392800 43200 0 PETT} - {1269698400 39600 0 PETMMTT} - {1269702000 43200 1 PETST} - {1288450800 39600 0 PETT} - {1301151600 43200 0 PETT} + {-1487759676 39600 0 +11} + {-1247569200 43200 0 +13} + {354888000 46800 1 +13} + {370695600 43200 0 +12} + {386424000 46800 1 +13} + {402231600 43200 0 +12} + {417960000 46800 1 +13} + {433767600 43200 0 +12} + {449582400 46800 1 +13} + {465314400 43200 0 +12} + {481039200 46800 1 +13} + {496764000 43200 0 +12} + {512488800 46800 1 +13} + {528213600 43200 0 +12} + {543938400 46800 1 +13} + {559663200 43200 0 +12} + {575388000 46800 1 +13} + {591112800 43200 0 +12} + {606837600 46800 1 +13} + {622562400 43200 0 +12} + {638287200 46800 1 +13} + {654616800 43200 0 +12} + {670341600 39600 0 +12} + {670345200 43200 1 +12} + {686070000 39600 0 +11} + {695746800 43200 0 +13} + {701791200 46800 1 +13} + {717516000 43200 0 +12} + {733240800 46800 1 +13} + {748965600 43200 0 +12} + {764690400 46800 1 +13} + {780415200 43200 0 +12} + {796140000 46800 1 +13} + {811864800 43200 0 +12} + {828194400 46800 1 +13} + {846338400 43200 0 +12} + {859644000 46800 1 +13} + {877788000 43200 0 +12} + {891093600 46800 1 +13} + {909237600 43200 0 +12} + {922543200 46800 1 +13} + {941292000 43200 0 +12} + {953992800 46800 1 +13} + {972741600 43200 0 +12} + {985442400 46800 1 +13} + {1004191200 43200 0 +12} + {1017496800 46800 1 +13} + {1035640800 43200 0 +12} + {1048946400 46800 1 +13} + {1067090400 43200 0 +12} + {1080396000 46800 1 +13} + {1099144800 43200 0 +12} + {1111845600 46800 1 +13} + {1130594400 43200 0 +12} + {1143295200 46800 1 +13} + {1162044000 43200 0 +12} + {1174744800 46800 1 +13} + {1193493600 43200 0 +12} + {1206799200 46800 1 +13} + {1224943200 43200 0 +12} + {1238248800 46800 1 +13} + {1256392800 43200 0 +12} + {1269698400 39600 0 +12} + {1269702000 43200 1 +12} + {1288450800 39600 0 +11} + {1301151600 43200 0 +12} } diff --git a/library/tzdata/Asia/Khandyga b/library/tzdata/Asia/Khandyga index b898e0d..07bffac 100644 --- a/library/tzdata/Asia/Khandyga +++ b/library/tzdata/Asia/Khandyga @@ -2,72 +2,72 @@ set TZData(:Asia/Khandyga) { {-9223372036854775808 32533 0 LMT} - {-1579424533 28800 0 YAKT} - {-1247558400 32400 0 YAKMMTT} - {354898800 36000 1 YAKST} - {370706400 32400 0 YAKT} - {386434800 36000 1 YAKST} - {402242400 32400 0 YAKT} - {417970800 36000 1 YAKST} - {433778400 32400 0 YAKT} - {449593200 36000 1 YAKST} - {465325200 32400 0 YAKT} - {481050000 36000 1 YAKST} - {496774800 32400 0 YAKT} - {512499600 36000 1 YAKST} - {528224400 32400 0 YAKT} - {543949200 36000 1 YAKST} - {559674000 32400 0 YAKT} - {575398800 36000 1 YAKST} - {591123600 32400 0 YAKT} - {606848400 36000 1 YAKST} - {622573200 32400 0 YAKT} - {638298000 36000 1 YAKST} - {654627600 32400 0 YAKT} - {670352400 28800 0 YAKMMTT} - {670356000 32400 1 YAKST} - {686080800 28800 0 YAKT} - {695757600 32400 0 YAKMMTT} - {701802000 36000 1 YAKST} - {717526800 32400 0 YAKT} - {733251600 36000 1 YAKST} - {748976400 32400 0 YAKT} - {764701200 36000 1 YAKST} - {780426000 32400 0 YAKT} - {796150800 36000 1 YAKST} - {811875600 32400 0 YAKT} - {828205200 36000 1 YAKST} - {846349200 32400 0 YAKT} - {859654800 36000 1 YAKST} - {877798800 32400 0 YAKT} - {891104400 36000 1 YAKST} - {909248400 32400 0 YAKT} - {922554000 36000 1 YAKST} - {941302800 32400 0 YAKT} - {954003600 36000 1 YAKST} - {972752400 32400 0 YAKT} - {985453200 36000 1 YAKST} - {1004202000 32400 0 YAKT} - {1017507600 36000 1 YAKST} - {1035651600 32400 0 YAKT} - {1048957200 36000 1 YAKST} - {1067101200 32400 0 YAKT} - {1072882800 36000 0 VLAMMTT} - {1080403200 39600 1 VLAST} - {1099152000 36000 0 VLAT} - {1111852800 39600 1 VLAST} - {1130601600 36000 0 VLAT} - {1143302400 39600 1 VLAST} - {1162051200 36000 0 VLAT} - {1174752000 39600 1 VLAST} - {1193500800 36000 0 VLAT} - {1206806400 39600 1 VLAST} - {1224950400 36000 0 VLAT} - {1238256000 39600 1 VLAST} - {1256400000 36000 0 VLAT} - {1269705600 39600 1 VLAST} - {1288454400 36000 0 VLAT} - {1301155200 39600 0 VLAT} - {1315832400 36000 0 YAKT} - {1414252800 32400 0 YAKT} + {-1579424533 28800 0 +08} + {-1247558400 32400 0 +10} + {354898800 36000 1 +10} + {370706400 32400 0 +09} + {386434800 36000 1 +10} + {402242400 32400 0 +09} + {417970800 36000 1 +10} + {433778400 32400 0 +09} + {449593200 36000 1 +10} + {465325200 32400 0 +09} + {481050000 36000 1 +10} + {496774800 32400 0 +09} + {512499600 36000 1 +10} + {528224400 32400 0 +09} + {543949200 36000 1 +10} + {559674000 32400 0 +09} + {575398800 36000 1 +10} + {591123600 32400 0 +09} + {606848400 36000 1 +10} + {622573200 32400 0 +09} + {638298000 36000 1 +10} + {654627600 32400 0 +09} + {670352400 28800 0 +09} + {670356000 32400 1 +09} + {686080800 28800 0 +08} + {695757600 32400 0 +10} + {701802000 36000 1 +10} + {717526800 32400 0 +09} + {733251600 36000 1 +10} + {748976400 32400 0 +09} + {764701200 36000 1 +10} + {780426000 32400 0 +09} + {796150800 36000 1 +10} + {811875600 32400 0 +09} + {828205200 36000 1 +10} + {846349200 32400 0 +09} + {859654800 36000 1 +10} + {877798800 32400 0 +09} + {891104400 36000 1 +10} + {909248400 32400 0 +09} + {922554000 36000 1 +10} + {941302800 32400 0 +09} + {954003600 36000 1 +10} + {972752400 32400 0 +09} + {985453200 36000 1 +10} + {1004202000 32400 0 +09} + {1017507600 36000 1 +10} + {1035651600 32400 0 +09} + {1048957200 36000 1 +10} + {1067101200 32400 0 +09} + {1072882800 36000 0 +11} + {1080403200 39600 1 +11} + {1099152000 36000 0 +10} + {1111852800 39600 1 +11} + {1130601600 36000 0 +10} + {1143302400 39600 1 +11} + {1162051200 36000 0 +10} + {1174752000 39600 1 +11} + {1193500800 36000 0 +10} + {1206806400 39600 1 +11} + {1224950400 36000 0 +10} + {1238256000 39600 1 +11} + {1256400000 36000 0 +10} + {1269705600 39600 1 +11} + {1288454400 36000 0 +10} + {1301155200 39600 0 +11} + {1315832400 36000 0 +10} + {1414252800 32400 0 +09} } diff --git a/library/tzdata/Asia/Krasnoyarsk b/library/tzdata/Asia/Krasnoyarsk index 3c6285e..0721425 100644 --- a/library/tzdata/Asia/Krasnoyarsk +++ b/library/tzdata/Asia/Krasnoyarsk @@ -2,70 +2,70 @@ set TZData(:Asia/Krasnoyarsk) { {-9223372036854775808 22286 0 LMT} - {-1577513486 21600 0 KRAT} - {-1247551200 25200 0 KRAMMTT} - {354906000 28800 1 KRAST} - {370713600 25200 0 KRAT} - {386442000 28800 1 KRAST} - {402249600 25200 0 KRAT} - {417978000 28800 1 KRAST} - {433785600 25200 0 KRAT} - {449600400 28800 1 KRAST} - {465332400 25200 0 KRAT} - {481057200 28800 1 KRAST} - {496782000 25200 0 KRAT} - {512506800 28800 1 KRAST} - {528231600 25200 0 KRAT} - {543956400 28800 1 KRAST} - {559681200 25200 0 KRAT} - {575406000 28800 1 KRAST} - {591130800 25200 0 KRAT} - {606855600 28800 1 KRAST} - {622580400 25200 0 KRAT} - {638305200 28800 1 KRAST} - {654634800 25200 0 KRAT} - {670359600 21600 0 KRAMMTT} - {670363200 25200 1 KRAST} - {686088000 21600 0 KRAT} - {695764800 25200 0 KRAMMTT} - {701809200 28800 1 KRAST} - {717534000 25200 0 KRAT} - {733258800 28800 1 KRAST} - {748983600 25200 0 KRAT} - {764708400 28800 1 KRAST} - {780433200 25200 0 KRAT} - {796158000 28800 1 KRAST} - {811882800 25200 0 KRAT} - {828212400 28800 1 KRAST} - {846356400 25200 0 KRAT} - {859662000 28800 1 KRAST} - {877806000 25200 0 KRAT} - {891111600 28800 1 KRAST} - {909255600 25200 0 KRAT} - {922561200 28800 1 KRAST} - {941310000 25200 0 KRAT} - {954010800 28800 1 KRAST} - {972759600 25200 0 KRAT} - {985460400 28800 1 KRAST} - {1004209200 25200 0 KRAT} - {1017514800 28800 1 KRAST} - {1035658800 25200 0 KRAT} - {1048964400 28800 1 KRAST} - {1067108400 25200 0 KRAT} - {1080414000 28800 1 KRAST} - {1099162800 25200 0 KRAT} - {1111863600 28800 1 KRAST} - {1130612400 25200 0 KRAT} - {1143313200 28800 1 KRAST} - {1162062000 25200 0 KRAT} - {1174762800 28800 1 KRAST} - {1193511600 25200 0 KRAT} - {1206817200 28800 1 KRAST} - {1224961200 25200 0 KRAT} - {1238266800 28800 1 KRAST} - {1256410800 25200 0 KRAT} - {1269716400 28800 1 KRAST} - {1288465200 25200 0 KRAT} - {1301166000 28800 0 KRAT} - {1414260000 25200 0 KRAT} + {-1577513486 21600 0 +06} + {-1247551200 25200 0 +08} + {354906000 28800 1 +08} + {370713600 25200 0 +07} + {386442000 28800 1 +08} + {402249600 25200 0 +07} + {417978000 28800 1 +08} + {433785600 25200 0 +07} + {449600400 28800 1 +08} + {465332400 25200 0 +07} + {481057200 28800 1 +08} + {496782000 25200 0 +07} + {512506800 28800 1 +08} + {528231600 25200 0 +07} + {543956400 28800 1 +08} + {559681200 25200 0 +07} + {575406000 28800 1 +08} + {591130800 25200 0 +07} + {606855600 28800 1 +08} + {622580400 25200 0 +07} + {638305200 28800 1 +08} + {654634800 25200 0 +07} + {670359600 21600 0 +07} + {670363200 25200 1 +07} + {686088000 21600 0 +06} + {695764800 25200 0 +08} + {701809200 28800 1 +08} + {717534000 25200 0 +07} + {733258800 28800 1 +08} + {748983600 25200 0 +07} + {764708400 28800 1 +08} + {780433200 25200 0 +07} + {796158000 28800 1 +08} + {811882800 25200 0 +07} + {828212400 28800 1 +08} + {846356400 25200 0 +07} + {859662000 28800 1 +08} + {877806000 25200 0 +07} + {891111600 28800 1 +08} + {909255600 25200 0 +07} + {922561200 28800 1 +08} + {941310000 25200 0 +07} + {954010800 28800 1 +08} + {972759600 25200 0 +07} + {985460400 28800 1 +08} + {1004209200 25200 0 +07} + {1017514800 28800 1 +08} + {1035658800 25200 0 +07} + {1048964400 28800 1 +08} + {1067108400 25200 0 +07} + {1080414000 28800 1 +08} + {1099162800 25200 0 +07} + {1111863600 28800 1 +08} + {1130612400 25200 0 +07} + {1143313200 28800 1 +08} + {1162062000 25200 0 +07} + {1174762800 28800 1 +08} + {1193511600 25200 0 +07} + {1206817200 28800 1 +08} + {1224961200 25200 0 +07} + {1238266800 28800 1 +08} + {1256410800 25200 0 +07} + {1269716400 28800 1 +08} + {1288465200 25200 0 +07} + {1301166000 28800 0 +08} + {1414260000 25200 0 +07} } diff --git a/library/tzdata/Asia/Magadan b/library/tzdata/Asia/Magadan index afe78da..0626899 100644 --- a/library/tzdata/Asia/Magadan +++ b/library/tzdata/Asia/Magadan @@ -2,71 +2,71 @@ set TZData(:Asia/Magadan) { {-9223372036854775808 36192 0 LMT} - {-1441188192 36000 0 MAGT} - {-1247565600 39600 0 MAGMMTT} - {354891600 43200 1 MAGST} - {370699200 39600 0 MAGT} - {386427600 43200 1 MAGST} - {402235200 39600 0 MAGT} - {417963600 43200 1 MAGST} - {433771200 39600 0 MAGT} - {449586000 43200 1 MAGST} - {465318000 39600 0 MAGT} - {481042800 43200 1 MAGST} - {496767600 39600 0 MAGT} - {512492400 43200 1 MAGST} - {528217200 39600 0 MAGT} - {543942000 43200 1 MAGST} - {559666800 39600 0 MAGT} - {575391600 43200 1 MAGST} - {591116400 39600 0 MAGT} - {606841200 43200 1 MAGST} - {622566000 39600 0 MAGT} - {638290800 43200 1 MAGST} - {654620400 39600 0 MAGT} - {670345200 36000 0 MAGMMTT} - {670348800 39600 1 MAGST} - {686073600 36000 0 MAGT} - {695750400 39600 0 MAGMMTT} - {701794800 43200 1 MAGST} - {717519600 39600 0 MAGT} - {733244400 43200 1 MAGST} - {748969200 39600 0 MAGT} - {764694000 43200 1 MAGST} - {780418800 39600 0 MAGT} - {796143600 43200 1 MAGST} - {811868400 39600 0 MAGT} - {828198000 43200 1 MAGST} - {846342000 39600 0 MAGT} - {859647600 43200 1 MAGST} - {877791600 39600 0 MAGT} - {891097200 43200 1 MAGST} - {909241200 39600 0 MAGT} - {922546800 43200 1 MAGST} - {941295600 39600 0 MAGT} - {953996400 43200 1 MAGST} - {972745200 39600 0 MAGT} - {985446000 43200 1 MAGST} - {1004194800 39600 0 MAGT} - {1017500400 43200 1 MAGST} - {1035644400 39600 0 MAGT} - {1048950000 43200 1 MAGST} - {1067094000 39600 0 MAGT} - {1080399600 43200 1 MAGST} - {1099148400 39600 0 MAGT} - {1111849200 43200 1 MAGST} - {1130598000 39600 0 MAGT} - {1143298800 43200 1 MAGST} - {1162047600 39600 0 MAGT} - {1174748400 43200 1 MAGST} - {1193497200 39600 0 MAGT} - {1206802800 43200 1 MAGST} - {1224946800 39600 0 MAGT} - {1238252400 43200 1 MAGST} - {1256396400 39600 0 MAGT} - {1269702000 43200 1 MAGST} - {1288450800 39600 0 MAGT} - {1301151600 43200 0 MAGT} - {1414245600 36000 0 MAGT} - {1461427200 39600 0 MAGT} + {-1441188192 36000 0 +10} + {-1247565600 39600 0 +12} + {354891600 43200 1 +12} + {370699200 39600 0 +11} + {386427600 43200 1 +12} + {402235200 39600 0 +11} + {417963600 43200 1 +12} + {433771200 39600 0 +11} + {449586000 43200 1 +12} + {465318000 39600 0 +11} + {481042800 43200 1 +12} + {496767600 39600 0 +11} + {512492400 43200 1 +12} + {528217200 39600 0 +11} + {543942000 43200 1 +12} + {559666800 39600 0 +11} + {575391600 43200 1 +12} + {591116400 39600 0 +11} + {606841200 43200 1 +12} + {622566000 39600 0 +11} + {638290800 43200 1 +12} + {654620400 39600 0 +11} + {670345200 36000 0 +11} + {670348800 39600 1 +11} + {686073600 36000 0 +10} + {695750400 39600 0 +12} + {701794800 43200 1 +12} + {717519600 39600 0 +11} + {733244400 43200 1 +12} + {748969200 39600 0 +11} + {764694000 43200 1 +12} + {780418800 39600 0 +11} + {796143600 43200 1 +12} + {811868400 39600 0 +11} + {828198000 43200 1 +12} + {846342000 39600 0 +11} + {859647600 43200 1 +12} + {877791600 39600 0 +11} + {891097200 43200 1 +12} + {909241200 39600 0 +11} + {922546800 43200 1 +12} + {941295600 39600 0 +11} + {953996400 43200 1 +12} + {972745200 39600 0 +11} + {985446000 43200 1 +12} + {1004194800 39600 0 +11} + {1017500400 43200 1 +12} + {1035644400 39600 0 +11} + {1048950000 43200 1 +12} + {1067094000 39600 0 +11} + {1080399600 43200 1 +12} + {1099148400 39600 0 +11} + {1111849200 43200 1 +12} + {1130598000 39600 0 +11} + {1143298800 43200 1 +12} + {1162047600 39600 0 +11} + {1174748400 43200 1 +12} + {1193497200 39600 0 +11} + {1206802800 43200 1 +12} + {1224946800 39600 0 +11} + {1238252400 43200 1 +12} + {1256396400 39600 0 +11} + {1269702000 43200 1 +12} + {1288450800 39600 0 +11} + {1301151600 43200 0 +12} + {1414245600 36000 0 +10} + {1461427200 39600 0 +11} } diff --git a/library/tzdata/Asia/Omsk b/library/tzdata/Asia/Omsk index a6fa180..74163d5 100644 --- a/library/tzdata/Asia/Omsk +++ b/library/tzdata/Asia/Omsk @@ -2,70 +2,70 @@ set TZData(:Asia/Omsk) { {-9223372036854775808 17610 0 LMT} - {-1582088010 18000 0 OMST} - {-1247547600 21600 0 OMSMMTT} - {354909600 25200 1 OMSST} - {370717200 21600 0 OMST} - {386445600 25200 1 OMSST} - {402253200 21600 0 OMST} - {417981600 25200 1 OMSST} - {433789200 21600 0 OMST} - {449604000 25200 1 OMSST} - {465336000 21600 0 OMST} - {481060800 25200 1 OMSST} - {496785600 21600 0 OMST} - {512510400 25200 1 OMSST} - {528235200 21600 0 OMST} - {543960000 25200 1 OMSST} - {559684800 21600 0 OMST} - {575409600 25200 1 OMSST} - {591134400 21600 0 OMST} - {606859200 25200 1 OMSST} - {622584000 21600 0 OMST} - {638308800 25200 1 OMSST} - {654638400 21600 0 OMST} - {670363200 18000 0 OMSMMTT} - {670366800 21600 1 OMSST} - {686091600 18000 0 OMST} - {695768400 21600 0 OMSMMTT} - {701812800 25200 1 OMSST} - {717537600 21600 0 OMST} - {733262400 25200 1 OMSST} - {748987200 21600 0 OMST} - {764712000 25200 1 OMSST} - {780436800 21600 0 OMST} - {796161600 25200 1 OMSST} - {811886400 21600 0 OMST} - {828216000 25200 1 OMSST} - {846360000 21600 0 OMST} - {859665600 25200 1 OMSST} - {877809600 21600 0 OMST} - {891115200 25200 1 OMSST} - {909259200 21600 0 OMST} - {922564800 25200 1 OMSST} - {941313600 21600 0 OMST} - {954014400 25200 1 OMSST} - {972763200 21600 0 OMST} - {985464000 25200 1 OMSST} - {1004212800 21600 0 OMST} - {1017518400 25200 1 OMSST} - {1035662400 21600 0 OMST} - {1048968000 25200 1 OMSST} - {1067112000 21600 0 OMST} - {1080417600 25200 1 OMSST} - {1099166400 21600 0 OMST} - {1111867200 25200 1 OMSST} - {1130616000 21600 0 OMST} - {1143316800 25200 1 OMSST} - {1162065600 21600 0 OMST} - {1174766400 25200 1 OMSST} - {1193515200 21600 0 OMST} - {1206820800 25200 1 OMSST} - {1224964800 21600 0 OMST} - {1238270400 25200 1 OMSST} - {1256414400 21600 0 OMST} - {1269720000 25200 1 OMSST} - {1288468800 21600 0 OMST} - {1301169600 25200 0 OMST} - {1414263600 21600 0 OMST} + {-1582088010 18000 0 +05} + {-1247547600 21600 0 +07} + {354909600 25200 1 +07} + {370717200 21600 0 +06} + {386445600 25200 1 +07} + {402253200 21600 0 +06} + {417981600 25200 1 +07} + {433789200 21600 0 +06} + {449604000 25200 1 +07} + {465336000 21600 0 +06} + {481060800 25200 1 +07} + {496785600 21600 0 +06} + {512510400 25200 1 +07} + {528235200 21600 0 +06} + {543960000 25200 1 +07} + {559684800 21600 0 +06} + {575409600 25200 1 +07} + {591134400 21600 0 +06} + {606859200 25200 1 +07} + {622584000 21600 0 +06} + {638308800 25200 1 +07} + {654638400 21600 0 +06} + {670363200 18000 0 +06} + {670366800 21600 1 +06} + {686091600 18000 0 +05} + {695768400 21600 0 +07} + {701812800 25200 1 +07} + {717537600 21600 0 +06} + {733262400 25200 1 +07} + {748987200 21600 0 +06} + {764712000 25200 1 +07} + {780436800 21600 0 +06} + {796161600 25200 1 +07} + {811886400 21600 0 +06} + {828216000 25200 1 +07} + {846360000 21600 0 +06} + {859665600 25200 1 +07} + {877809600 21600 0 +06} + {891115200 25200 1 +07} + {909259200 21600 0 +06} + {922564800 25200 1 +07} + {941313600 21600 0 +06} + {954014400 25200 1 +07} + {972763200 21600 0 +06} + {985464000 25200 1 +07} + {1004212800 21600 0 +06} + {1017518400 25200 1 +07} + {1035662400 21600 0 +06} + {1048968000 25200 1 +07} + {1067112000 21600 0 +06} + {1080417600 25200 1 +07} + {1099166400 21600 0 +06} + {1111867200 25200 1 +07} + {1130616000 21600 0 +06} + {1143316800 25200 1 +07} + {1162065600 21600 0 +06} + {1174766400 25200 1 +07} + {1193515200 21600 0 +06} + {1206820800 25200 1 +07} + {1224964800 21600 0 +06} + {1238270400 25200 1 +07} + {1256414400 21600 0 +06} + {1269720000 25200 1 +07} + {1288468800 21600 0 +06} + {1301169600 25200 0 +07} + {1414263600 21600 0 +06} } diff --git a/library/tzdata/Asia/Rangoon b/library/tzdata/Asia/Rangoon index 4f3ac02..8ea2748 100644 --- a/library/tzdata/Asia/Rangoon +++ b/library/tzdata/Asia/Rangoon @@ -1,9 +1,5 @@ # created by tools/tclZIC.tcl - do not edit - -set TZData(:Asia/Rangoon) { - {-9223372036854775808 23080 0 LMT} - {-2840163880 23080 0 RMT} - {-1577946280 23400 0 BURT} - {-873268200 32400 0 JST} - {-778410000 23400 0 MMT} +if {![info exists TZData(Asia/Yangon)]} { + LoadTimeZoneFile Asia/Yangon } +set TZData(:Asia/Rangoon) $TZData(:Asia/Yangon) diff --git a/library/tzdata/Asia/Sakhalin b/library/tzdata/Asia/Sakhalin index 1de22f4..4ba7c8c 100644 --- a/library/tzdata/Asia/Sakhalin +++ b/library/tzdata/Asia/Sakhalin @@ -2,73 +2,72 @@ set TZData(:Asia/Sakhalin) { {-9223372036854775808 34248 0 LMT} - {-2031039048 32400 0 JCST} - {-1017824400 32400 0 JST} - {-768560400 39600 0 SAKMMTT} - {354891600 43200 1 SAKST} - {370699200 39600 0 SAKT} - {386427600 43200 1 SAKST} - {402235200 39600 0 SAKT} - {417963600 43200 1 SAKST} - {433771200 39600 0 SAKT} - {449586000 43200 1 SAKST} - {465318000 39600 0 SAKT} - {481042800 43200 1 SAKST} - {496767600 39600 0 SAKT} - {512492400 43200 1 SAKST} - {528217200 39600 0 SAKT} - {543942000 43200 1 SAKST} - {559666800 39600 0 SAKT} - {575391600 43200 1 SAKST} - {591116400 39600 0 SAKT} - {606841200 43200 1 SAKST} - {622566000 39600 0 SAKT} - {638290800 43200 1 SAKST} - {654620400 39600 0 SAKT} - {670345200 36000 0 SAKMMTT} - {670348800 39600 1 SAKST} - {686073600 36000 0 SAKT} - {695750400 39600 0 SAKMMTT} - {701794800 43200 1 SAKST} - {717519600 39600 0 SAKT} - {733244400 43200 1 SAKST} - {748969200 39600 0 SAKT} - {764694000 43200 1 SAKST} - {780418800 39600 0 SAKT} - {796143600 43200 1 SAKST} - {811868400 39600 0 SAKT} - {828198000 43200 1 SAKST} - {846342000 39600 0 SAKT} - {859647600 36000 0 SAKMMTT} - {859651200 39600 1 SAKST} - {877795200 36000 0 SAKT} - {891100800 39600 1 SAKST} - {909244800 36000 0 SAKT} - {922550400 39600 1 SAKST} - {941299200 36000 0 SAKT} - {954000000 39600 1 SAKST} - {972748800 36000 0 SAKT} - {985449600 39600 1 SAKST} - {1004198400 36000 0 SAKT} - {1017504000 39600 1 SAKST} - {1035648000 36000 0 SAKT} - {1048953600 39600 1 SAKST} - {1067097600 36000 0 SAKT} - {1080403200 39600 1 SAKST} - {1099152000 36000 0 SAKT} - {1111852800 39600 1 SAKST} - {1130601600 36000 0 SAKT} - {1143302400 39600 1 SAKST} - {1162051200 36000 0 SAKT} - {1174752000 39600 1 SAKST} - {1193500800 36000 0 SAKT} - {1206806400 39600 1 SAKST} - {1224950400 36000 0 SAKT} - {1238256000 39600 1 SAKST} - {1256400000 36000 0 SAKT} - {1269705600 39600 1 SAKST} - {1288454400 36000 0 SAKT} - {1301155200 39600 0 SAKT} - {1414249200 36000 0 SAKT} - {1459008000 39600 0 SAKT} + {-2031039048 32400 0 +09} + {-768560400 39600 0 +12} + {354891600 43200 1 +12} + {370699200 39600 0 +11} + {386427600 43200 1 +12} + {402235200 39600 0 +11} + {417963600 43200 1 +12} + {433771200 39600 0 +11} + {449586000 43200 1 +12} + {465318000 39600 0 +11} + {481042800 43200 1 +12} + {496767600 39600 0 +11} + {512492400 43200 1 +12} + {528217200 39600 0 +11} + {543942000 43200 1 +12} + {559666800 39600 0 +11} + {575391600 43200 1 +12} + {591116400 39600 0 +11} + {606841200 43200 1 +12} + {622566000 39600 0 +11} + {638290800 43200 1 +12} + {654620400 39600 0 +11} + {670345200 36000 0 +11} + {670348800 39600 1 +11} + {686073600 36000 0 +10} + {695750400 39600 0 +12} + {701794800 43200 1 +12} + {717519600 39600 0 +11} + {733244400 43200 1 +12} + {748969200 39600 0 +11} + {764694000 43200 1 +12} + {780418800 39600 0 +11} + {796143600 43200 1 +12} + {811868400 39600 0 +11} + {828198000 43200 1 +12} + {846342000 39600 0 +11} + {859647600 36000 0 +11} + {859651200 39600 1 +11} + {877795200 36000 0 +10} + {891100800 39600 1 +11} + {909244800 36000 0 +10} + {922550400 39600 1 +11} + {941299200 36000 0 +10} + {954000000 39600 1 +11} + {972748800 36000 0 +10} + {985449600 39600 1 +11} + {1004198400 36000 0 +10} + {1017504000 39600 1 +11} + {1035648000 36000 0 +10} + {1048953600 39600 1 +11} + {1067097600 36000 0 +10} + {1080403200 39600 1 +11} + {1099152000 36000 0 +10} + {1111852800 39600 1 +11} + {1130601600 36000 0 +10} + {1143302400 39600 1 +11} + {1162051200 36000 0 +10} + {1174752000 39600 1 +11} + {1193500800 36000 0 +10} + {1206806400 39600 1 +11} + {1224950400 36000 0 +10} + {1238256000 39600 1 +11} + {1256400000 36000 0 +10} + {1269705600 39600 1 +11} + {1288454400 36000 0 +10} + {1301155200 39600 0 +11} + {1414249200 36000 0 +10} + {1459008000 39600 0 +11} } diff --git a/library/tzdata/Asia/Samarkand b/library/tzdata/Asia/Samarkand index 4b3b49f..43ad774 100644 --- a/library/tzdata/Asia/Samarkand +++ b/library/tzdata/Asia/Samarkand @@ -2,31 +2,30 @@ set TZData(:Asia/Samarkand) { {-9223372036854775808 16073 0 LMT} - {-1441168073 14400 0 SAMT} - {-1247544000 18000 0 SAMT} - {354913200 21600 1 SAMST} - {370720800 21600 0 TAST} - {386445600 18000 0 SAMT} - {386449200 21600 1 SAMST} - {402256800 18000 0 SAMT} - {417985200 21600 1 SAMST} - {433792800 18000 0 SAMT} - {449607600 21600 1 SAMST} - {465339600 18000 0 SAMT} - {481064400 21600 1 SAMST} - {496789200 18000 0 SAMT} - {512514000 21600 1 SAMST} - {528238800 18000 0 SAMT} - {543963600 21600 1 SAMST} - {559688400 18000 0 SAMT} - {575413200 21600 1 SAMST} - {591138000 18000 0 SAMT} - {606862800 21600 1 SAMST} - {622587600 18000 0 SAMT} - {638312400 21600 1 SAMST} - {654642000 18000 0 SAMT} - {670366800 21600 1 SAMST} - {683665200 21600 0 UZST} - {686091600 18000 0 UZT} - {694206000 18000 0 UZT} + {-1441168073 14400 0 +04} + {-1247544000 18000 0 +05} + {354913200 21600 1 +06} + {370720800 21600 0 +06} + {386445600 18000 0 +05} + {386449200 21600 1 +06} + {402256800 18000 0 +05} + {417985200 21600 1 +06} + {433792800 18000 0 +05} + {449607600 21600 1 +06} + {465339600 18000 0 +05} + {481064400 21600 1 +06} + {496789200 18000 0 +05} + {512514000 21600 1 +06} + {528238800 18000 0 +05} + {543963600 21600 1 +06} + {559688400 18000 0 +05} + {575413200 21600 1 +06} + {591138000 18000 0 +05} + {606862800 21600 1 +06} + {622587600 18000 0 +05} + {638312400 21600 1 +06} + {654642000 18000 0 +05} + {670366800 21600 1 +06} + {686091600 18000 0 +05} + {694206000 18000 0 +05} } diff --git a/library/tzdata/Asia/Srednekolymsk b/library/tzdata/Asia/Srednekolymsk index a0586aa..1099a4b 100644 --- a/library/tzdata/Asia/Srednekolymsk +++ b/library/tzdata/Asia/Srednekolymsk @@ -2,70 +2,70 @@ set TZData(:Asia/Srednekolymsk) { {-9223372036854775808 36892 0 LMT} - {-1441188892 36000 0 MAGT} - {-1247565600 39600 0 MAGMMTT} - {354891600 43200 1 MAGST} - {370699200 39600 0 MAGT} - {386427600 43200 1 MAGST} - {402235200 39600 0 MAGT} - {417963600 43200 1 MAGST} - {433771200 39600 0 MAGT} - {449586000 43200 1 MAGST} - {465318000 39600 0 MAGT} - {481042800 43200 1 MAGST} - {496767600 39600 0 MAGT} - {512492400 43200 1 MAGST} - {528217200 39600 0 MAGT} - {543942000 43200 1 MAGST} - {559666800 39600 0 MAGT} - {575391600 43200 1 MAGST} - {591116400 39600 0 MAGT} - {606841200 43200 1 MAGST} - {622566000 39600 0 MAGT} - {638290800 43200 1 MAGST} - {654620400 39600 0 MAGT} - {670345200 36000 0 MAGMMTT} - {670348800 39600 1 MAGST} - {686073600 36000 0 MAGT} - {695750400 39600 0 MAGMMTT} - {701794800 43200 1 MAGST} - {717519600 39600 0 MAGT} - {733244400 43200 1 MAGST} - {748969200 39600 0 MAGT} - {764694000 43200 1 MAGST} - {780418800 39600 0 MAGT} - {796143600 43200 1 MAGST} - {811868400 39600 0 MAGT} - {828198000 43200 1 MAGST} - {846342000 39600 0 MAGT} - {859647600 43200 1 MAGST} - {877791600 39600 0 MAGT} - {891097200 43200 1 MAGST} - {909241200 39600 0 MAGT} - {922546800 43200 1 MAGST} - {941295600 39600 0 MAGT} - {953996400 43200 1 MAGST} - {972745200 39600 0 MAGT} - {985446000 43200 1 MAGST} - {1004194800 39600 0 MAGT} - {1017500400 43200 1 MAGST} - {1035644400 39600 0 MAGT} - {1048950000 43200 1 MAGST} - {1067094000 39600 0 MAGT} - {1080399600 43200 1 MAGST} - {1099148400 39600 0 MAGT} - {1111849200 43200 1 MAGST} - {1130598000 39600 0 MAGT} - {1143298800 43200 1 MAGST} - {1162047600 39600 0 MAGT} - {1174748400 43200 1 MAGST} - {1193497200 39600 0 MAGT} - {1206802800 43200 1 MAGST} - {1224946800 39600 0 MAGT} - {1238252400 43200 1 MAGST} - {1256396400 39600 0 MAGT} - {1269702000 43200 1 MAGST} - {1288450800 39600 0 MAGT} - {1301151600 43200 0 MAGT} - {1414245600 39600 0 SRET} + {-1441188892 36000 0 +10} + {-1247565600 39600 0 +12} + {354891600 43200 1 +12} + {370699200 39600 0 +11} + {386427600 43200 1 +12} + {402235200 39600 0 +11} + {417963600 43200 1 +12} + {433771200 39600 0 +11} + {449586000 43200 1 +12} + {465318000 39600 0 +11} + {481042800 43200 1 +12} + {496767600 39600 0 +11} + {512492400 43200 1 +12} + {528217200 39600 0 +11} + {543942000 43200 1 +12} + {559666800 39600 0 +11} + {575391600 43200 1 +12} + {591116400 39600 0 +11} + {606841200 43200 1 +12} + {622566000 39600 0 +11} + {638290800 43200 1 +12} + {654620400 39600 0 +11} + {670345200 36000 0 +11} + {670348800 39600 1 +11} + {686073600 36000 0 +10} + {695750400 39600 0 +12} + {701794800 43200 1 +12} + {717519600 39600 0 +11} + {733244400 43200 1 +12} + {748969200 39600 0 +11} + {764694000 43200 1 +12} + {780418800 39600 0 +11} + {796143600 43200 1 +12} + {811868400 39600 0 +11} + {828198000 43200 1 +12} + {846342000 39600 0 +11} + {859647600 43200 1 +12} + {877791600 39600 0 +11} + {891097200 43200 1 +12} + {909241200 39600 0 +11} + {922546800 43200 1 +12} + {941295600 39600 0 +11} + {953996400 43200 1 +12} + {972745200 39600 0 +11} + {985446000 43200 1 +12} + {1004194800 39600 0 +11} + {1017500400 43200 1 +12} + {1035644400 39600 0 +11} + {1048950000 43200 1 +12} + {1067094000 39600 0 +11} + {1080399600 43200 1 +12} + {1099148400 39600 0 +11} + {1111849200 43200 1 +12} + {1130598000 39600 0 +11} + {1143298800 43200 1 +12} + {1162047600 39600 0 +11} + {1174748400 43200 1 +12} + {1193497200 39600 0 +11} + {1206802800 43200 1 +12} + {1224946800 39600 0 +11} + {1238252400 43200 1 +12} + {1256396400 39600 0 +11} + {1269702000 43200 1 +12} + {1288450800 39600 0 +11} + {1301151600 43200 0 +12} + {1414245600 39600 0 +11} } diff --git a/library/tzdata/Asia/Tashkent b/library/tzdata/Asia/Tashkent index 1477376..7b6abe4 100644 --- a/library/tzdata/Asia/Tashkent +++ b/library/tzdata/Asia/Tashkent @@ -2,31 +2,30 @@ set TZData(:Asia/Tashkent) { {-9223372036854775808 16631 0 LMT} - {-1441168631 18000 0 TAST} - {-1247547600 21600 0 TAST} - {354909600 25200 1 TASST} - {370717200 21600 0 TAST} - {386445600 25200 1 TASST} - {402253200 21600 0 TAST} - {417981600 25200 1 TASST} - {433789200 21600 0 TAST} - {449604000 25200 1 TASST} - {465336000 21600 0 TAST} - {481060800 25200 1 TASST} - {496785600 21600 0 TAST} - {512510400 25200 1 TASST} - {528235200 21600 0 TAST} - {543960000 25200 1 TASST} - {559684800 21600 0 TAST} - {575409600 25200 1 TASST} - {591134400 21600 0 TAST} - {606859200 25200 1 TASST} - {622584000 21600 0 TAST} - {638308800 25200 1 TASST} - {654638400 21600 0 TAST} - {670363200 18000 0 TAST} - {670366800 21600 1 TASST} - {683665200 21600 0 UZST} - {686091600 18000 0 UZT} - {694206000 18000 0 UZT} + {-1441168631 18000 0 +05} + {-1247547600 21600 0 +06} + {354909600 25200 1 +07} + {370717200 21600 0 +06} + {386445600 25200 1 +07} + {402253200 21600 0 +06} + {417981600 25200 1 +07} + {433789200 21600 0 +06} + {449604000 25200 1 +07} + {465336000 21600 0 +06} + {481060800 25200 1 +07} + {496785600 21600 0 +06} + {512510400 25200 1 +07} + {528235200 21600 0 +06} + {543960000 25200 1 +07} + {559684800 21600 0 +06} + {575409600 25200 1 +07} + {591134400 21600 0 +06} + {606859200 25200 1 +07} + {622584000 21600 0 +06} + {638308800 25200 1 +07} + {654638400 21600 0 +06} + {670363200 18000 0 +05} + {670366800 21600 1 +06} + {686091600 18000 0 +05} + {694206000 18000 0 +05} } diff --git a/library/tzdata/Asia/Tbilisi b/library/tzdata/Asia/Tbilisi index 54b278a..60d253c 100644 --- a/library/tzdata/Asia/Tbilisi +++ b/library/tzdata/Asia/Tbilisi @@ -3,58 +3,58 @@ set TZData(:Asia/Tbilisi) { {-9223372036854775808 10751 0 LMT} {-2840151551 10751 0 TBMT} - {-1441162751 10800 0 TBIT} - {-405140400 14400 0 TBIT} - {354916800 18000 1 TBIST} - {370724400 14400 0 TBIT} - {386452800 18000 1 TBIST} - {402260400 14400 0 TBIT} - {417988800 18000 1 TBIST} - {433796400 14400 0 TBIT} - {449611200 18000 1 TBIST} - {465343200 14400 0 TBIT} - {481068000 18000 1 TBIST} - {496792800 14400 0 TBIT} - {512517600 18000 1 TBIST} - {528242400 14400 0 TBIT} - {543967200 18000 1 TBIST} - {559692000 14400 0 TBIT} - {575416800 18000 1 TBIST} - {591141600 14400 0 TBIT} - {606866400 18000 1 TBIST} - {622591200 14400 0 TBIT} - {638316000 18000 1 TBIST} - {654645600 14400 0 TBIT} - {670370400 14400 1 TBIST} - {671140800 14400 0 GEST} - {686098800 10800 0 GET} - {694213200 10800 0 GET} - {701816400 14400 1 GEST} - {717537600 10800 0 GET} - {733266000 14400 1 GEST} - {748987200 10800 0 GET} - {764715600 14400 1 GEST} - {780440400 14400 0 GET} - {796161600 18000 1 GEST} - {811882800 14400 0 GET} - {828216000 18000 1 GEST} - {846360000 18000 1 GEST} - {859662000 18000 0 GEST} - {877806000 14400 0 GET} - {891115200 18000 1 GEST} - {909255600 14400 0 GET} - {922564800 18000 1 GEST} - {941310000 14400 0 GET} - {954014400 18000 1 GEST} - {972759600 14400 0 GET} - {985464000 18000 1 GEST} - {1004209200 14400 0 GET} - {1017518400 18000 1 GEST} - {1035658800 14400 0 GET} - {1048968000 18000 1 GEST} - {1067108400 14400 0 GET} - {1080417600 18000 1 GEST} - {1088280000 14400 0 GEST} - {1099177200 10800 0 GET} - {1111878000 14400 0 GET} + {-1441162751 10800 0 +03} + {-405140400 14400 0 +04} + {354916800 18000 1 +05} + {370724400 14400 0 +04} + {386452800 18000 1 +05} + {402260400 14400 0 +04} + {417988800 18000 1 +05} + {433796400 14400 0 +04} + {449611200 18000 1 +05} + {465343200 14400 0 +04} + {481068000 18000 1 +05} + {496792800 14400 0 +04} + {512517600 18000 1 +05} + {528242400 14400 0 +04} + {543967200 18000 1 +05} + {559692000 14400 0 +04} + {575416800 18000 1 +05} + {591141600 14400 0 +04} + {606866400 18000 1 +05} + {622591200 14400 0 +04} + {638316000 18000 1 +05} + {654645600 14400 0 +04} + {670370400 10800 0 +03} + {670374000 14400 1 +04} + {686098800 10800 0 +03} + {694213200 10800 0 +03} + {701816400 14400 1 +04} + {717537600 10800 0 +03} + {733266000 14400 1 +04} + {748987200 10800 0 +03} + {764715600 14400 1 +04} + {780440400 14400 0 +04} + {796161600 18000 1 +05} + {811882800 14400 0 +04} + {828216000 18000 1 +05} + {846360000 18000 1 +05} + {859662000 18000 0 +05} + {877806000 14400 0 +04} + {891115200 18000 1 +05} + {909255600 14400 0 +04} + {922564800 18000 1 +05} + {941310000 14400 0 +04} + {954014400 18000 1 +05} + {972759600 14400 0 +04} + {985464000 18000 1 +05} + {1004209200 14400 0 +04} + {1017518400 18000 1 +05} + {1035658800 14400 0 +04} + {1048968000 18000 1 +05} + {1067108400 14400 0 +04} + {1080417600 18000 1 +05} + {1088280000 14400 0 +04} + {1099177200 10800 0 +03} + {1111878000 14400 0 +04} } diff --git a/library/tzdata/Asia/Ust-Nera b/library/tzdata/Asia/Ust-Nera index 3380b7b..021fa62 100644 --- a/library/tzdata/Asia/Ust-Nera +++ b/library/tzdata/Asia/Ust-Nera @@ -2,70 +2,70 @@ set TZData(:Asia/Ust-Nera) { {-9223372036854775808 34374 0 LMT} - {-1579426374 28800 0 YAKT} - {354898800 43200 0 MAGST} - {370699200 39600 0 MAGT} - {386427600 43200 1 MAGST} - {402235200 39600 0 MAGT} - {417963600 43200 1 MAGST} - {433771200 39600 0 MAGT} - {449586000 43200 1 MAGST} - {465318000 39600 0 MAGT} - {481042800 43200 1 MAGST} - {496767600 39600 0 MAGT} - {512492400 43200 1 MAGST} - {528217200 39600 0 MAGT} - {543942000 43200 1 MAGST} - {559666800 39600 0 MAGT} - {575391600 43200 1 MAGST} - {591116400 39600 0 MAGT} - {606841200 43200 1 MAGST} - {622566000 39600 0 MAGT} - {638290800 43200 1 MAGST} - {654620400 39600 0 MAGT} - {670345200 36000 0 MAGMMTT} - {670348800 39600 1 MAGST} - {686073600 36000 0 MAGT} - {695750400 39600 0 MAGMMTT} - {701794800 43200 1 MAGST} - {717519600 39600 0 MAGT} - {733244400 43200 1 MAGST} - {748969200 39600 0 MAGT} - {764694000 43200 1 MAGST} - {780418800 39600 0 MAGT} - {796143600 43200 1 MAGST} - {811868400 39600 0 MAGT} - {828198000 43200 1 MAGST} - {846342000 39600 0 MAGT} - {859647600 43200 1 MAGST} - {877791600 39600 0 MAGT} - {891097200 43200 1 MAGST} - {909241200 39600 0 MAGT} - {922546800 43200 1 MAGST} - {941295600 39600 0 MAGT} - {953996400 43200 1 MAGST} - {972745200 39600 0 MAGT} - {985446000 43200 1 MAGST} - {1004194800 39600 0 MAGT} - {1017500400 43200 1 MAGST} - {1035644400 39600 0 MAGT} - {1048950000 43200 1 MAGST} - {1067094000 39600 0 MAGT} - {1080399600 43200 1 MAGST} - {1099148400 39600 0 MAGT} - {1111849200 43200 1 MAGST} - {1130598000 39600 0 MAGT} - {1143298800 43200 1 MAGST} - {1162047600 39600 0 MAGT} - {1174748400 43200 1 MAGST} - {1193497200 39600 0 MAGT} - {1206802800 43200 1 MAGST} - {1224946800 39600 0 MAGT} - {1238252400 43200 1 MAGST} - {1256396400 39600 0 MAGT} - {1269702000 43200 1 MAGST} - {1288450800 39600 0 MAGT} - {1301151600 43200 0 MAGT} - {1315828800 39600 0 VLAT} - {1414249200 36000 0 VLAT} + {-1579426374 28800 0 +08} + {354898800 43200 0 +12} + {370699200 39600 0 +11} + {386427600 43200 1 +12} + {402235200 39600 0 +11} + {417963600 43200 1 +12} + {433771200 39600 0 +11} + {449586000 43200 1 +12} + {465318000 39600 0 +11} + {481042800 43200 1 +12} + {496767600 39600 0 +11} + {512492400 43200 1 +12} + {528217200 39600 0 +11} + {543942000 43200 1 +12} + {559666800 39600 0 +11} + {575391600 43200 1 +12} + {591116400 39600 0 +11} + {606841200 43200 1 +12} + {622566000 39600 0 +11} + {638290800 43200 1 +12} + {654620400 39600 0 +11} + {670345200 36000 0 +11} + {670348800 39600 1 +11} + {686073600 36000 0 +10} + {695750400 39600 0 +12} + {701794800 43200 1 +12} + {717519600 39600 0 +11} + {733244400 43200 1 +12} + {748969200 39600 0 +11} + {764694000 43200 1 +12} + {780418800 39600 0 +11} + {796143600 43200 1 +12} + {811868400 39600 0 +11} + {828198000 43200 1 +12} + {846342000 39600 0 +11} + {859647600 43200 1 +12} + {877791600 39600 0 +11} + {891097200 43200 1 +12} + {909241200 39600 0 +11} + {922546800 43200 1 +12} + {941295600 39600 0 +11} + {953996400 43200 1 +12} + {972745200 39600 0 +11} + {985446000 43200 1 +12} + {1004194800 39600 0 +11} + {1017500400 43200 1 +12} + {1035644400 39600 0 +11} + {1048950000 43200 1 +12} + {1067094000 39600 0 +11} + {1080399600 43200 1 +12} + {1099148400 39600 0 +11} + {1111849200 43200 1 +12} + {1130598000 39600 0 +11} + {1143298800 43200 1 +12} + {1162047600 39600 0 +11} + {1174748400 43200 1 +12} + {1193497200 39600 0 +11} + {1206802800 43200 1 +12} + {1224946800 39600 0 +11} + {1238252400 43200 1 +12} + {1256396400 39600 0 +11} + {1269702000 43200 1 +12} + {1288450800 39600 0 +11} + {1301151600 43200 0 +12} + {1315828800 39600 0 +11} + {1414249200 36000 0 +10} } diff --git a/library/tzdata/Asia/Vladivostok b/library/tzdata/Asia/Vladivostok index b279d1c..e8f651c 100644 --- a/library/tzdata/Asia/Vladivostok +++ b/library/tzdata/Asia/Vladivostok @@ -2,70 +2,70 @@ set TZData(:Asia/Vladivostok) { {-9223372036854775808 31651 0 LMT} - {-1487321251 32400 0 VLAT} - {-1247562000 36000 0 VLAMMTT} - {354895200 39600 1 VLAST} - {370702800 36000 0 VLAT} - {386431200 39600 1 VLAST} - {402238800 36000 0 VLAT} - {417967200 39600 1 VLAST} - {433774800 36000 0 VLAT} - {449589600 39600 1 VLAST} - {465321600 36000 0 VLAT} - {481046400 39600 1 VLAST} - {496771200 36000 0 VLAT} - {512496000 39600 1 VLAST} - {528220800 36000 0 VLAT} - {543945600 39600 1 VLAST} - {559670400 36000 0 VLAT} - {575395200 39600 1 VLAST} - {591120000 36000 0 VLAT} - {606844800 39600 1 VLAST} - {622569600 36000 0 VLAT} - {638294400 39600 1 VLAST} - {654624000 36000 0 VLAT} - {670348800 32400 0 VLAMMTT} - {670352400 36000 1 VLAST} - {686077200 32400 0 VLAT} - {695754000 36000 0 VLAMMTT} - {701798400 39600 1 VLAST} - {717523200 36000 0 VLAT} - {733248000 39600 1 VLAST} - {748972800 36000 0 VLAT} - {764697600 39600 1 VLAST} - {780422400 36000 0 VLAT} - {796147200 39600 1 VLAST} - {811872000 36000 0 VLAT} - {828201600 39600 1 VLAST} - {846345600 36000 0 VLAT} - {859651200 39600 1 VLAST} - {877795200 36000 0 VLAT} - {891100800 39600 1 VLAST} - {909244800 36000 0 VLAT} - {922550400 39600 1 VLAST} - {941299200 36000 0 VLAT} - {954000000 39600 1 VLAST} - {972748800 36000 0 VLAT} - {985449600 39600 1 VLAST} - {1004198400 36000 0 VLAT} - {1017504000 39600 1 VLAST} - {1035648000 36000 0 VLAT} - {1048953600 39600 1 VLAST} - {1067097600 36000 0 VLAT} - {1080403200 39600 1 VLAST} - {1099152000 36000 0 VLAT} - {1111852800 39600 1 VLAST} - {1130601600 36000 0 VLAT} - {1143302400 39600 1 VLAST} - {1162051200 36000 0 VLAT} - {1174752000 39600 1 VLAST} - {1193500800 36000 0 VLAT} - {1206806400 39600 1 VLAST} - {1224950400 36000 0 VLAT} - {1238256000 39600 1 VLAST} - {1256400000 36000 0 VLAT} - {1269705600 39600 1 VLAST} - {1288454400 36000 0 VLAT} - {1301155200 39600 0 VLAT} - {1414249200 36000 0 VLAT} + {-1487321251 32400 0 +09} + {-1247562000 36000 0 +11} + {354895200 39600 1 +11} + {370702800 36000 0 +10} + {386431200 39600 1 +11} + {402238800 36000 0 +10} + {417967200 39600 1 +11} + {433774800 36000 0 +10} + {449589600 39600 1 +11} + {465321600 36000 0 +10} + {481046400 39600 1 +11} + {496771200 36000 0 +10} + {512496000 39600 1 +11} + {528220800 36000 0 +10} + {543945600 39600 1 +11} + {559670400 36000 0 +10} + {575395200 39600 1 +11} + {591120000 36000 0 +10} + {606844800 39600 1 +11} + {622569600 36000 0 +10} + {638294400 39600 1 +11} + {654624000 36000 0 +10} + {670348800 32400 0 +10} + {670352400 36000 1 +10} + {686077200 32400 0 +09} + {695754000 36000 0 +11} + {701798400 39600 1 +11} + {717523200 36000 0 +10} + {733248000 39600 1 +11} + {748972800 36000 0 +10} + {764697600 39600 1 +11} + {780422400 36000 0 +10} + {796147200 39600 1 +11} + {811872000 36000 0 +10} + {828201600 39600 1 +11} + {846345600 36000 0 +10} + {859651200 39600 1 +11} + {877795200 36000 0 +10} + {891100800 39600 1 +11} + {909244800 36000 0 +10} + {922550400 39600 1 +11} + {941299200 36000 0 +10} + {954000000 39600 1 +11} + {972748800 36000 0 +10} + {985449600 39600 1 +11} + {1004198400 36000 0 +10} + {1017504000 39600 1 +11} + {1035648000 36000 0 +10} + {1048953600 39600 1 +11} + {1067097600 36000 0 +10} + {1080403200 39600 1 +11} + {1099152000 36000 0 +10} + {1111852800 39600 1 +11} + {1130601600 36000 0 +10} + {1143302400 39600 1 +11} + {1162051200 36000 0 +10} + {1174752000 39600 1 +11} + {1193500800 36000 0 +10} + {1206806400 39600 1 +11} + {1224950400 36000 0 +10} + {1238256000 39600 1 +11} + {1256400000 36000 0 +10} + {1269705600 39600 1 +11} + {1288454400 36000 0 +10} + {1301155200 39600 0 +11} + {1414249200 36000 0 +10} } diff --git a/library/tzdata/Asia/Yakutsk b/library/tzdata/Asia/Yakutsk index 0074379..8ee153a 100644 --- a/library/tzdata/Asia/Yakutsk +++ b/library/tzdata/Asia/Yakutsk @@ -2,70 +2,70 @@ set TZData(:Asia/Yakutsk) { {-9223372036854775808 31138 0 LMT} - {-1579423138 28800 0 YAKT} - {-1247558400 32400 0 YAKMMTT} - {354898800 36000 1 YAKST} - {370706400 32400 0 YAKT} - {386434800 36000 1 YAKST} - {402242400 32400 0 YAKT} - {417970800 36000 1 YAKST} - {433778400 32400 0 YAKT} - {449593200 36000 1 YAKST} - {465325200 32400 0 YAKT} - {481050000 36000 1 YAKST} - {496774800 32400 0 YAKT} - {512499600 36000 1 YAKST} - {528224400 32400 0 YAKT} - {543949200 36000 1 YAKST} - {559674000 32400 0 YAKT} - {575398800 36000 1 YAKST} - {591123600 32400 0 YAKT} - {606848400 36000 1 YAKST} - {622573200 32400 0 YAKT} - {638298000 36000 1 YAKST} - {654627600 32400 0 YAKT} - {670352400 28800 0 YAKMMTT} - {670356000 32400 1 YAKST} - {686080800 28800 0 YAKT} - {695757600 32400 0 YAKMMTT} - {701802000 36000 1 YAKST} - {717526800 32400 0 YAKT} - {733251600 36000 1 YAKST} - {748976400 32400 0 YAKT} - {764701200 36000 1 YAKST} - {780426000 32400 0 YAKT} - {796150800 36000 1 YAKST} - {811875600 32400 0 YAKT} - {828205200 36000 1 YAKST} - {846349200 32400 0 YAKT} - {859654800 36000 1 YAKST} - {877798800 32400 0 YAKT} - {891104400 36000 1 YAKST} - {909248400 32400 0 YAKT} - {922554000 36000 1 YAKST} - {941302800 32400 0 YAKT} - {954003600 36000 1 YAKST} - {972752400 32400 0 YAKT} - {985453200 36000 1 YAKST} - {1004202000 32400 0 YAKT} - {1017507600 36000 1 YAKST} - {1035651600 32400 0 YAKT} - {1048957200 36000 1 YAKST} - {1067101200 32400 0 YAKT} - {1080406800 36000 1 YAKST} - {1099155600 32400 0 YAKT} - {1111856400 36000 1 YAKST} - {1130605200 32400 0 YAKT} - {1143306000 36000 1 YAKST} - {1162054800 32400 0 YAKT} - {1174755600 36000 1 YAKST} - {1193504400 32400 0 YAKT} - {1206810000 36000 1 YAKST} - {1224954000 32400 0 YAKT} - {1238259600 36000 1 YAKST} - {1256403600 32400 0 YAKT} - {1269709200 36000 1 YAKST} - {1288458000 32400 0 YAKT} - {1301158800 36000 0 YAKT} - {1414252800 32400 0 YAKT} + {-1579423138 28800 0 +08} + {-1247558400 32400 0 +10} + {354898800 36000 1 +10} + {370706400 32400 0 +09} + {386434800 36000 1 +10} + {402242400 32400 0 +09} + {417970800 36000 1 +10} + {433778400 32400 0 +09} + {449593200 36000 1 +10} + {465325200 32400 0 +09} + {481050000 36000 1 +10} + {496774800 32400 0 +09} + {512499600 36000 1 +10} + {528224400 32400 0 +09} + {543949200 36000 1 +10} + {559674000 32400 0 +09} + {575398800 36000 1 +10} + {591123600 32400 0 +09} + {606848400 36000 1 +10} + {622573200 32400 0 +09} + {638298000 36000 1 +10} + {654627600 32400 0 +09} + {670352400 28800 0 +09} + {670356000 32400 1 +09} + {686080800 28800 0 +08} + {695757600 32400 0 +10} + {701802000 36000 1 +10} + {717526800 32400 0 +09} + {733251600 36000 1 +10} + {748976400 32400 0 +09} + {764701200 36000 1 +10} + {780426000 32400 0 +09} + {796150800 36000 1 +10} + {811875600 32400 0 +09} + {828205200 36000 1 +10} + {846349200 32400 0 +09} + {859654800 36000 1 +10} + {877798800 32400 0 +09} + {891104400 36000 1 +10} + {909248400 32400 0 +09} + {922554000 36000 1 +10} + {941302800 32400 0 +09} + {954003600 36000 1 +10} + {972752400 32400 0 +09} + {985453200 36000 1 +10} + {1004202000 32400 0 +09} + {1017507600 36000 1 +10} + {1035651600 32400 0 +09} + {1048957200 36000 1 +10} + {1067101200 32400 0 +09} + {1080406800 36000 1 +10} + {1099155600 32400 0 +09} + {1111856400 36000 1 +10} + {1130605200 32400 0 +09} + {1143306000 36000 1 +10} + {1162054800 32400 0 +09} + {1174755600 36000 1 +10} + {1193504400 32400 0 +09} + {1206810000 36000 1 +10} + {1224954000 32400 0 +09} + {1238259600 36000 1 +10} + {1256403600 32400 0 +09} + {1269709200 36000 1 +10} + {1288458000 32400 0 +09} + {1301158800 36000 0 +10} + {1414252800 32400 0 +09} } diff --git a/library/tzdata/Asia/Yangon b/library/tzdata/Asia/Yangon new file mode 100644 index 0000000..40cfa02 --- /dev/null +++ b/library/tzdata/Asia/Yangon @@ -0,0 +1,9 @@ +# created by tools/tclZIC.tcl - do not edit + +set TZData(:Asia/Yangon) { + {-9223372036854775808 23080 0 LMT} + {-2840163880 23080 0 RMT} + {-1577946280 23400 0 BURT} + {-873268200 32400 0 JST} + {-778410000 23400 0 MMT} +} diff --git a/library/tzdata/Asia/Yekaterinburg b/library/tzdata/Asia/Yekaterinburg index fdd89b0..d2133b1 100644 --- a/library/tzdata/Asia/Yekaterinburg +++ b/library/tzdata/Asia/Yekaterinburg @@ -3,70 +3,70 @@ set TZData(:Asia/Yekaterinburg) { {-9223372036854775808 14553 0 LMT} {-1688270553 13505 0 PMT} - {-1592610305 14400 0 SVET} - {-1247544000 18000 0 SVEMMTT} - {354913200 21600 1 SVEST} - {370720800 18000 0 SVET} - {386449200 21600 1 SVEST} - {402256800 18000 0 SVET} - {417985200 21600 1 SVEST} - {433792800 18000 0 SVET} - {449607600 21600 1 SVEST} - {465339600 18000 0 SVET} - {481064400 21600 1 SVEST} - {496789200 18000 0 SVET} - {512514000 21600 1 SVEST} - {528238800 18000 0 SVET} - {543963600 21600 1 SVEST} - {559688400 18000 0 SVET} - {575413200 21600 1 SVEST} - {591138000 18000 0 SVET} - {606862800 21600 1 SVEST} - {622587600 18000 0 SVET} - {638312400 21600 1 SVEST} - {654642000 18000 0 SVET} - {670366800 14400 0 SVEMMTT} - {670370400 18000 1 SVEST} - {686095200 14400 0 SVET} - {695772000 18000 0 YEKMMTT} - {701816400 21600 1 YEKST} - {717541200 18000 0 YEKT} - {733266000 21600 1 YEKST} - {748990800 18000 0 YEKT} - {764715600 21600 1 YEKST} - {780440400 18000 0 YEKT} - {796165200 21600 1 YEKST} - {811890000 18000 0 YEKT} - {828219600 21600 1 YEKST} - {846363600 18000 0 YEKT} - {859669200 21600 1 YEKST} - {877813200 18000 0 YEKT} - {891118800 21600 1 YEKST} - {909262800 18000 0 YEKT} - {922568400 21600 1 YEKST} - {941317200 18000 0 YEKT} - {954018000 21600 1 YEKST} - {972766800 18000 0 YEKT} - {985467600 21600 1 YEKST} - {1004216400 18000 0 YEKT} - {1017522000 21600 1 YEKST} - {1035666000 18000 0 YEKT} - {1048971600 21600 1 YEKST} - {1067115600 18000 0 YEKT} - {1080421200 21600 1 YEKST} - {1099170000 18000 0 YEKT} - {1111870800 21600 1 YEKST} - {1130619600 18000 0 YEKT} - {1143320400 21600 1 YEKST} - {1162069200 18000 0 YEKT} - {1174770000 21600 1 YEKST} - {1193518800 18000 0 YEKT} - {1206824400 21600 1 YEKST} - {1224968400 18000 0 YEKT} - {1238274000 21600 1 YEKST} - {1256418000 18000 0 YEKT} - {1269723600 21600 1 YEKST} - {1288472400 18000 0 YEKT} - {1301173200 21600 0 YEKT} - {1414267200 18000 0 YEKT} + {-1592610305 14400 0 +04} + {-1247544000 18000 0 +06} + {354913200 21600 1 +06} + {370720800 18000 0 +05} + {386449200 21600 1 +06} + {402256800 18000 0 +05} + {417985200 21600 1 +06} + {433792800 18000 0 +05} + {449607600 21600 1 +06} + {465339600 18000 0 +05} + {481064400 21600 1 +06} + {496789200 18000 0 +05} + {512514000 21600 1 +06} + {528238800 18000 0 +05} + {543963600 21600 1 +06} + {559688400 18000 0 +05} + {575413200 21600 1 +06} + {591138000 18000 0 +05} + {606862800 21600 1 +06} + {622587600 18000 0 +05} + {638312400 21600 1 +06} + {654642000 18000 0 +05} + {670366800 14400 0 +05} + {670370400 18000 1 +05} + {686095200 14400 0 +04} + {695772000 18000 0 +06} + {701816400 21600 1 +06} + {717541200 18000 0 +05} + {733266000 21600 1 +06} + {748990800 18000 0 +05} + {764715600 21600 1 +06} + {780440400 18000 0 +05} + {796165200 21600 1 +06} + {811890000 18000 0 +05} + {828219600 21600 1 +06} + {846363600 18000 0 +05} + {859669200 21600 1 +06} + {877813200 18000 0 +05} + {891118800 21600 1 +06} + {909262800 18000 0 +05} + {922568400 21600 1 +06} + {941317200 18000 0 +05} + {954018000 21600 1 +06} + {972766800 18000 0 +05} + {985467600 21600 1 +06} + {1004216400 18000 0 +05} + {1017522000 21600 1 +06} + {1035666000 18000 0 +05} + {1048971600 21600 1 +06} + {1067115600 18000 0 +05} + {1080421200 21600 1 +06} + {1099170000 18000 0 +05} + {1111870800 21600 1 +06} + {1130619600 18000 0 +05} + {1143320400 21600 1 +06} + {1162069200 18000 0 +05} + {1174770000 21600 1 +06} + {1193518800 18000 0 +05} + {1206824400 21600 1 +06} + {1224968400 18000 0 +05} + {1238274000 21600 1 +06} + {1256418000 18000 0 +05} + {1269723600 21600 1 +06} + {1288472400 18000 0 +05} + {1301173200 21600 0 +06} + {1414267200 18000 0 +05} } diff --git a/library/tzdata/Asia/Yerevan b/library/tzdata/Asia/Yerevan index c552403..0ffb69e 100644 --- a/library/tzdata/Asia/Yerevan +++ b/library/tzdata/Asia/Yerevan @@ -2,69 +2,68 @@ set TZData(:Asia/Yerevan) { {-9223372036854775808 10680 0 LMT} - {-1441162680 10800 0 YERT} - {-405140400 14400 0 YERT} - {354916800 18000 1 YERST} - {370724400 14400 0 YERT} - {386452800 18000 1 YERST} - {402260400 14400 0 YERT} - {417988800 18000 1 YERST} - {433796400 14400 0 YERT} - {449611200 18000 1 YERST} - {465343200 14400 0 YERT} - {481068000 18000 1 YERST} - {496792800 14400 0 YERT} - {512517600 18000 1 YERST} - {528242400 14400 0 YERT} - {543967200 18000 1 YERST} - {559692000 14400 0 YERT} - {575416800 18000 1 YERST} - {591141600 14400 0 YERT} - {606866400 18000 1 YERST} - {622591200 14400 0 YERT} - {638316000 18000 1 YERST} - {654645600 14400 0 YERT} - {670370400 14400 1 YERST} - {685569600 14400 0 AMST} - {686098800 10800 0 AMT} - {701823600 14400 1 AMST} - {717548400 10800 0 AMT} - {733273200 14400 1 AMST} - {748998000 10800 0 AMT} - {764722800 14400 1 AMST} - {780447600 10800 0 AMT} - {796172400 14400 1 AMST} - {811897200 14400 0 AMT} - {852062400 14400 0 AMT} - {859672800 18000 1 AMST} - {877816800 14400 0 AMT} - {891122400 18000 1 AMST} - {909266400 14400 0 AMT} - {922572000 18000 1 AMST} - {941320800 14400 0 AMT} - {954021600 18000 1 AMST} - {972770400 14400 0 AMT} - {985471200 18000 1 AMST} - {1004220000 14400 0 AMT} - {1017525600 18000 1 AMST} - {1035669600 14400 0 AMT} - {1048975200 18000 1 AMST} - {1067119200 14400 0 AMT} - {1080424800 18000 1 AMST} - {1099173600 14400 0 AMT} - {1111874400 18000 1 AMST} - {1130623200 14400 0 AMT} - {1143324000 18000 1 AMST} - {1162072800 14400 0 AMT} - {1174773600 18000 1 AMST} - {1193522400 14400 0 AMT} - {1206828000 18000 1 AMST} - {1224972000 14400 0 AMT} - {1238277600 18000 1 AMST} - {1256421600 14400 0 AMT} - {1269727200 18000 1 AMST} - {1288476000 14400 0 AMT} - {1301176800 18000 1 AMST} - {1319925600 14400 0 AMT} - {1328731200 14400 0 AMT} + {-1441162680 10800 0 +03} + {-405140400 14400 0 +04} + {354916800 18000 1 +05} + {370724400 14400 0 +04} + {386452800 18000 1 +05} + {402260400 14400 0 +04} + {417988800 18000 1 +05} + {433796400 14400 0 +04} + {449611200 18000 1 +05} + {465343200 14400 0 +04} + {481068000 18000 1 +05} + {496792800 14400 0 +04} + {512517600 18000 1 +05} + {528242400 14400 0 +04} + {543967200 18000 1 +05} + {559692000 14400 0 +04} + {575416800 18000 1 +05} + {591141600 14400 0 +04} + {606866400 18000 1 +05} + {622591200 14400 0 +04} + {638316000 18000 1 +05} + {654645600 14400 0 +04} + {670370400 10800 0 +03} + {670374000 14400 1 +04} + {686098800 10800 0 +03} + {701823600 14400 1 +04} + {717548400 10800 0 +03} + {733273200 14400 1 +04} + {748998000 10800 0 +03} + {764722800 14400 1 +04} + {780447600 10800 0 +03} + {796172400 14400 1 +04} + {811897200 14400 0 +04} + {852062400 14400 0 +04} + {859672800 18000 1 +05} + {877816800 14400 0 +04} + {891122400 18000 1 +05} + {909266400 14400 0 +04} + {922572000 18000 1 +05} + {941320800 14400 0 +04} + {954021600 18000 1 +05} + {972770400 14400 0 +04} + {985471200 18000 1 +05} + {1004220000 14400 0 +04} + {1017525600 18000 1 +05} + {1035669600 14400 0 +04} + {1048975200 18000 1 +05} + {1067119200 14400 0 +04} + {1080424800 18000 1 +05} + {1099173600 14400 0 +04} + {1111874400 18000 1 +05} + {1130623200 14400 0 +04} + {1143324000 18000 1 +05} + {1162072800 14400 0 +04} + {1174773600 18000 1 +05} + {1193522400 14400 0 +04} + {1206828000 18000 1 +05} + {1224972000 14400 0 +04} + {1238277600 18000 1 +05} + {1256421600 14400 0 +04} + {1269727200 18000 1 +05} + {1288476000 14400 0 +04} + {1301176800 18000 1 +05} + {1319925600 14400 0 +04} } diff --git a/library/tzdata/Etc/GMT+1 b/library/tzdata/Etc/GMT+1 index 12f97ba..70d39cf 100644 --- a/library/tzdata/Etc/GMT+1 +++ b/library/tzdata/Etc/GMT+1 @@ -1,5 +1,5 @@ # created by tools/tclZIC.tcl - do not edit set TZData(:Etc/GMT+1) { - {-9223372036854775808 -3600 0 GMT+1} + {-9223372036854775808 -3600 0 -01} } diff --git a/library/tzdata/Etc/GMT+10 b/library/tzdata/Etc/GMT+10 index 6ea50bb..9165a08 100644 --- a/library/tzdata/Etc/GMT+10 +++ b/library/tzdata/Etc/GMT+10 @@ -1,5 +1,5 @@ # created by tools/tclZIC.tcl - do not edit set TZData(:Etc/GMT+10) { - {-9223372036854775808 -36000 0 GMT+10} + {-9223372036854775808 -36000 0 -10} } diff --git a/library/tzdata/Etc/GMT+11 b/library/tzdata/Etc/GMT+11 index c91b169..a1aaf74 100644 --- a/library/tzdata/Etc/GMT+11 +++ b/library/tzdata/Etc/GMT+11 @@ -1,5 +1,5 @@ # created by tools/tclZIC.tcl - do not edit set TZData(:Etc/GMT+11) { - {-9223372036854775808 -39600 0 GMT+11} + {-9223372036854775808 -39600 0 -11} } diff --git a/library/tzdata/Etc/GMT+12 b/library/tzdata/Etc/GMT+12 index 29a4cee..d2c082a 100644 --- a/library/tzdata/Etc/GMT+12 +++ b/library/tzdata/Etc/GMT+12 @@ -1,5 +1,5 @@ # created by tools/tclZIC.tcl - do not edit set TZData(:Etc/GMT+12) { - {-9223372036854775808 -43200 0 GMT+12} + {-9223372036854775808 -43200 0 -12} } diff --git a/library/tzdata/Etc/GMT+2 b/library/tzdata/Etc/GMT+2 index 8c6b526..46cca7d 100644 --- a/library/tzdata/Etc/GMT+2 +++ b/library/tzdata/Etc/GMT+2 @@ -1,5 +1,5 @@ # created by tools/tclZIC.tcl - do not edit set TZData(:Etc/GMT+2) { - {-9223372036854775808 -7200 0 GMT+2} + {-9223372036854775808 -7200 0 -02} } diff --git a/library/tzdata/Etc/GMT+3 b/library/tzdata/Etc/GMT+3 index 862571d..e1e3001 100644 --- a/library/tzdata/Etc/GMT+3 +++ b/library/tzdata/Etc/GMT+3 @@ -1,5 +1,5 @@ # created by tools/tclZIC.tcl - do not edit set TZData(:Etc/GMT+3) { - {-9223372036854775808 -10800 0 GMT+3} + {-9223372036854775808 -10800 0 -03} } diff --git a/library/tzdata/Etc/GMT+4 b/library/tzdata/Etc/GMT+4 index a933bbc..32afa24 100644 --- a/library/tzdata/Etc/GMT+4 +++ b/library/tzdata/Etc/GMT+4 @@ -1,5 +1,5 @@ # created by tools/tclZIC.tcl - do not edit set TZData(:Etc/GMT+4) { - {-9223372036854775808 -14400 0 GMT+4} + {-9223372036854775808 -14400 0 -04} } diff --git a/library/tzdata/Etc/GMT+5 b/library/tzdata/Etc/GMT+5 index 80cc25c..747abf5 100644 --- a/library/tzdata/Etc/GMT+5 +++ b/library/tzdata/Etc/GMT+5 @@ -1,5 +1,5 @@ # created by tools/tclZIC.tcl - do not edit set TZData(:Etc/GMT+5) { - {-9223372036854775808 -18000 0 GMT+5} + {-9223372036854775808 -18000 0 -05} } diff --git a/library/tzdata/Etc/GMT+6 b/library/tzdata/Etc/GMT+6 index bc57bd6..1096839 100644 --- a/library/tzdata/Etc/GMT+6 +++ b/library/tzdata/Etc/GMT+6 @@ -1,5 +1,5 @@ # created by tools/tclZIC.tcl - do not edit set TZData(:Etc/GMT+6) { - {-9223372036854775808 -21600 0 GMT+6} + {-9223372036854775808 -21600 0 -06} } diff --git a/library/tzdata/Etc/GMT+7 b/library/tzdata/Etc/GMT+7 index d419eb9..6d47863 100644 --- a/library/tzdata/Etc/GMT+7 +++ b/library/tzdata/Etc/GMT+7 @@ -1,5 +1,5 @@ # created by tools/tclZIC.tcl - do not edit set TZData(:Etc/GMT+7) { - {-9223372036854775808 -25200 0 GMT+7} + {-9223372036854775808 -25200 0 -07} } diff --git a/library/tzdata/Etc/GMT+8 b/library/tzdata/Etc/GMT+8 index 705ad40..33c0f69 100644 --- a/library/tzdata/Etc/GMT+8 +++ b/library/tzdata/Etc/GMT+8 @@ -1,5 +1,5 @@ # created by tools/tclZIC.tcl - do not edit set TZData(:Etc/GMT+8) { - {-9223372036854775808 -28800 0 GMT+8} + {-9223372036854775808 -28800 0 -08} } diff --git a/library/tzdata/Etc/GMT+9 b/library/tzdata/Etc/GMT+9 index 4086639..4119bf4 100644 --- a/library/tzdata/Etc/GMT+9 +++ b/library/tzdata/Etc/GMT+9 @@ -1,5 +1,5 @@ # created by tools/tclZIC.tcl - do not edit set TZData(:Etc/GMT+9) { - {-9223372036854775808 -32400 0 GMT+9} + {-9223372036854775808 -32400 0 -09} } diff --git a/library/tzdata/Etc/GMT-1 b/library/tzdata/Etc/GMT-1 index a44dd1f..e7ac44b 100644 --- a/library/tzdata/Etc/GMT-1 +++ b/library/tzdata/Etc/GMT-1 @@ -1,5 +1,5 @@ # created by tools/tclZIC.tcl - do not edit set TZData(:Etc/GMT-1) { - {-9223372036854775808 3600 0 GMT-1} + {-9223372036854775808 3600 0 +01} } diff --git a/library/tzdata/Etc/GMT-10 b/library/tzdata/Etc/GMT-10 index 1c50d01..fdbd1e3 100644 --- a/library/tzdata/Etc/GMT-10 +++ b/library/tzdata/Etc/GMT-10 @@ -1,5 +1,5 @@ # created by tools/tclZIC.tcl - do not edit set TZData(:Etc/GMT-10) { - {-9223372036854775808 36000 0 GMT-10} + {-9223372036854775808 36000 0 +10} } diff --git a/library/tzdata/Etc/GMT-11 b/library/tzdata/Etc/GMT-11 index d07710f..4b28ad0 100644 --- a/library/tzdata/Etc/GMT-11 +++ b/library/tzdata/Etc/GMT-11 @@ -1,5 +1,5 @@ # created by tools/tclZIC.tcl - do not edit set TZData(:Etc/GMT-11) { - {-9223372036854775808 39600 0 GMT-11} + {-9223372036854775808 39600 0 +11} } diff --git a/library/tzdata/Etc/GMT-12 b/library/tzdata/Etc/GMT-12 index a23b98d..594bac3 100644 --- a/library/tzdata/Etc/GMT-12 +++ b/library/tzdata/Etc/GMT-12 @@ -1,5 +1,5 @@ # created by tools/tclZIC.tcl - do not edit set TZData(:Etc/GMT-12) { - {-9223372036854775808 43200 0 GMT-12} + {-9223372036854775808 43200 0 +12} } diff --git a/library/tzdata/Etc/GMT-13 b/library/tzdata/Etc/GMT-13 index 1a6700a..f61159e 100644 --- a/library/tzdata/Etc/GMT-13 +++ b/library/tzdata/Etc/GMT-13 @@ -1,5 +1,5 @@ # created by tools/tclZIC.tcl - do not edit set TZData(:Etc/GMT-13) { - {-9223372036854775808 46800 0 GMT-13} + {-9223372036854775808 46800 0 +13} } diff --git a/library/tzdata/Etc/GMT-14 b/library/tzdata/Etc/GMT-14 index 3707e21..493800f 100644 --- a/library/tzdata/Etc/GMT-14 +++ b/library/tzdata/Etc/GMT-14 @@ -1,5 +1,5 @@ # created by tools/tclZIC.tcl - do not edit set TZData(:Etc/GMT-14) { - {-9223372036854775808 50400 0 GMT-14} + {-9223372036854775808 50400 0 +14} } diff --git a/library/tzdata/Etc/GMT-2 b/library/tzdata/Etc/GMT-2 index f9dea16..51fdbed 100644 --- a/library/tzdata/Etc/GMT-2 +++ b/library/tzdata/Etc/GMT-2 @@ -1,5 +1,5 @@ # created by tools/tclZIC.tcl - do not edit set TZData(:Etc/GMT-2) { - {-9223372036854775808 7200 0 GMT-2} + {-9223372036854775808 7200 0 +02} } diff --git a/library/tzdata/Etc/GMT-3 b/library/tzdata/Etc/GMT-3 index 99145b8..7aed39d 100644 --- a/library/tzdata/Etc/GMT-3 +++ b/library/tzdata/Etc/GMT-3 @@ -1,5 +1,5 @@ # created by tools/tclZIC.tcl - do not edit set TZData(:Etc/GMT-3) { - {-9223372036854775808 10800 0 GMT-3} + {-9223372036854775808 10800 0 +03} } diff --git a/library/tzdata/Etc/GMT-4 b/library/tzdata/Etc/GMT-4 index 27b4fec..6ca6372 100644 --- a/library/tzdata/Etc/GMT-4 +++ b/library/tzdata/Etc/GMT-4 @@ -1,5 +1,5 @@ # created by tools/tclZIC.tcl - do not edit set TZData(:Etc/GMT-4) { - {-9223372036854775808 14400 0 GMT-4} + {-9223372036854775808 14400 0 +04} } diff --git a/library/tzdata/Etc/GMT-5 b/library/tzdata/Etc/GMT-5 index dbe3df7..6c47a31 100644 --- a/library/tzdata/Etc/GMT-5 +++ b/library/tzdata/Etc/GMT-5 @@ -1,5 +1,5 @@ # created by tools/tclZIC.tcl - do not edit set TZData(:Etc/GMT-5) { - {-9223372036854775808 18000 0 GMT-5} + {-9223372036854775808 18000 0 +05} } diff --git a/library/tzdata/Etc/GMT-6 b/library/tzdata/Etc/GMT-6 index 414dbfa..202e7f8 100644 --- a/library/tzdata/Etc/GMT-6 +++ b/library/tzdata/Etc/GMT-6 @@ -1,5 +1,5 @@ # created by tools/tclZIC.tcl - do not edit set TZData(:Etc/GMT-6) { - {-9223372036854775808 21600 0 GMT-6} + {-9223372036854775808 21600 0 +06} } diff --git a/library/tzdata/Etc/GMT-7 b/library/tzdata/Etc/GMT-7 index 2bd59db..c6deaf3 100644 --- a/library/tzdata/Etc/GMT-7 +++ b/library/tzdata/Etc/GMT-7 @@ -1,5 +1,5 @@ # created by tools/tclZIC.tcl - do not edit set TZData(:Etc/GMT-7) { - {-9223372036854775808 25200 0 GMT-7} + {-9223372036854775808 25200 0 +07} } diff --git a/library/tzdata/Etc/GMT-8 b/library/tzdata/Etc/GMT-8 index 7303721..4bed42e 100644 --- a/library/tzdata/Etc/GMT-8 +++ b/library/tzdata/Etc/GMT-8 @@ -1,5 +1,5 @@ # created by tools/tclZIC.tcl - do not edit set TZData(:Etc/GMT-8) { - {-9223372036854775808 28800 0 GMT-8} + {-9223372036854775808 28800 0 +08} } diff --git a/library/tzdata/Etc/GMT-9 b/library/tzdata/Etc/GMT-9 index 46e6878..2a7625b 100644 --- a/library/tzdata/Etc/GMT-9 +++ b/library/tzdata/Etc/GMT-9 @@ -1,5 +1,5 @@ # created by tools/tclZIC.tcl - do not edit set TZData(:Etc/GMT-9) { - {-9223372036854775808 32400 0 GMT-9} + {-9223372036854775808 32400 0 +09} } diff --git a/library/tzdata/Europe/Istanbul b/library/tzdata/Europe/Istanbul index 8eadbc3..f7b0c24 100644 --- a/library/tzdata/Europe/Istanbul +++ b/library/tzdata/Europe/Istanbul @@ -57,17 +57,17 @@ set TZData(:Europe/Istanbul) { {228866400 10800 1 EEST} {245797200 7200 0 EET} {260316000 10800 1 EEST} - {277246800 14400 0 TRST} - {291769200 14400 1 TRST} - {308779200 10800 0 TRT} - {323827200 14400 1 TRST} - {340228800 10800 0 TRT} - {354672000 14400 1 TRST} - {371678400 10800 0 TRT} - {386121600 14400 1 TRST} - {403128000 10800 0 TRT} - {428446800 14400 1 TRST} - {433886400 10800 0 TRT} + {277246800 14400 0 +04} + {291769200 14400 1 +04} + {308779200 10800 0 +03} + {323827200 14400 1 +04} + {340228800 10800 0 +03} + {354672000 14400 1 +04} + {371678400 10800 0 +03} + {386121600 14400 1 +04} + {403128000 10800 0 +03} + {428446800 14400 1 +04} + {433886400 10800 0 +03} {482792400 7200 0 EET} {482796000 10800 1 EEST} {496702800 7200 0 EET} @@ -136,171 +136,5 @@ set TZData(:Europe/Istanbul) { {1445734800 10800 1 EEST} {1446944400 7200 0 EET} {1459040400 10800 1 EEST} - {1477789200 7200 0 EET} - {1490490000 10800 1 EEST} - {1509238800 7200 0 EET} - {1521939600 10800 1 EEST} - {1540688400 7200 0 EET} - {1553994000 10800 1 EEST} - {1572138000 7200 0 EET} - {1585443600 10800 1 EEST} - {1603587600 7200 0 EET} - {1616893200 10800 1 EEST} - {1635642000 7200 0 EET} - {1648342800 10800 1 EEST} - {1667091600 7200 0 EET} - {1679792400 10800 1 EEST} - {1698541200 7200 0 EET} - {1711846800 10800 1 EEST} - {1729990800 7200 0 EET} - {1743296400 10800 1 EEST} - {1761440400 7200 0 EET} - {1774746000 10800 1 EEST} - {1792890000 7200 0 EET} - {1806195600 10800 1 EEST} - {1824944400 7200 0 EET} - {1837645200 10800 1 EEST} - {1856394000 7200 0 EET} - {1869094800 10800 1 EEST} - {1887843600 7200 0 EET} - {1901149200 10800 1 EEST} - {1919293200 7200 0 EET} - {1932598800 10800 1 EEST} - {1950742800 7200 0 EET} - {1964048400 10800 1 EEST} - {1982797200 7200 0 EET} - {1995498000 10800 1 EEST} - {2014246800 7200 0 EET} - {2026947600 10800 1 EEST} - {2045696400 7200 0 EET} - {2058397200 10800 1 EEST} - {2077146000 7200 0 EET} - {2090451600 10800 1 EEST} - {2108595600 7200 0 EET} - {2121901200 10800 1 EEST} - {2140045200 7200 0 EET} - {2153350800 10800 1 EEST} - {2172099600 7200 0 EET} - {2184800400 10800 1 EEST} - {2203549200 7200 0 EET} - {2216250000 10800 1 EEST} - {2234998800 7200 0 EET} - {2248304400 10800 1 EEST} - {2266448400 7200 0 EET} - {2279754000 10800 1 EEST} - {2297898000 7200 0 EET} - {2311203600 10800 1 EEST} - {2329347600 7200 0 EET} - {2342653200 10800 1 EEST} - {2361402000 7200 0 EET} - {2374102800 10800 1 EEST} - {2392851600 7200 0 EET} - {2405552400 10800 1 EEST} - {2424301200 7200 0 EET} - {2437606800 10800 1 EEST} - {2455750800 7200 0 EET} - {2469056400 10800 1 EEST} - {2487200400 7200 0 EET} - {2500506000 10800 1 EEST} - {2519254800 7200 0 EET} - {2531955600 10800 1 EEST} - {2550704400 7200 0 EET} - {2563405200 10800 1 EEST} - {2582154000 7200 0 EET} - {2595459600 10800 1 EEST} - {2613603600 7200 0 EET} - {2626909200 10800 1 EEST} - {2645053200 7200 0 EET} - {2658358800 10800 1 EEST} - {2676502800 7200 0 EET} - {2689808400 10800 1 EEST} - {2708557200 7200 0 EET} - {2721258000 10800 1 EEST} - {2740006800 7200 0 EET} - {2752707600 10800 1 EEST} - {2771456400 7200 0 EET} - {2784762000 10800 1 EEST} - {2802906000 7200 0 EET} - {2816211600 10800 1 EEST} - {2834355600 7200 0 EET} - {2847661200 10800 1 EEST} - {2866410000 7200 0 EET} - {2879110800 10800 1 EEST} - {2897859600 7200 0 EET} - {2910560400 10800 1 EEST} - {2929309200 7200 0 EET} - {2942010000 10800 1 EEST} - {2960758800 7200 0 EET} - {2974064400 10800 1 EEST} - {2992208400 7200 0 EET} - {3005514000 10800 1 EEST} - {3023658000 7200 0 EET} - {3036963600 10800 1 EEST} - {3055712400 7200 0 EET} - {3068413200 10800 1 EEST} - {3087162000 7200 0 EET} - {3099862800 10800 1 EEST} - {3118611600 7200 0 EET} - {3131917200 10800 1 EEST} - {3150061200 7200 0 EET} - {3163366800 10800 1 EEST} - {3181510800 7200 0 EET} - {3194816400 10800 1 EEST} - {3212960400 7200 0 EET} - {3226266000 10800 1 EEST} - {3245014800 7200 0 EET} - {3257715600 10800 1 EEST} - {3276464400 7200 0 EET} - {3289165200 10800 1 EEST} - {3307914000 7200 0 EET} - {3321219600 10800 1 EEST} - {3339363600 7200 0 EET} - {3352669200 10800 1 EEST} - {3370813200 7200 0 EET} - {3384118800 10800 1 EEST} - {3402867600 7200 0 EET} - {3415568400 10800 1 EEST} - {3434317200 7200 0 EET} - {3447018000 10800 1 EEST} - {3465766800 7200 0 EET} - {3479072400 10800 1 EEST} - {3497216400 7200 0 EET} - {3510522000 10800 1 EEST} - {3528666000 7200 0 EET} - {3541971600 10800 1 EEST} - {3560115600 7200 0 EET} - {3573421200 10800 1 EEST} - {3592170000 7200 0 EET} - {3604870800 10800 1 EEST} - {3623619600 7200 0 EET} - {3636320400 10800 1 EEST} - {3655069200 7200 0 EET} - {3668374800 10800 1 EEST} - {3686518800 7200 0 EET} - {3699824400 10800 1 EEST} - {3717968400 7200 0 EET} - {3731274000 10800 1 EEST} - {3750022800 7200 0 EET} - {3762723600 10800 1 EEST} - {3781472400 7200 0 EET} - {3794173200 10800 1 EEST} - {3812922000 7200 0 EET} - {3825622800 10800 1 EEST} - {3844371600 7200 0 EET} - {3857677200 10800 1 EEST} - {3875821200 7200 0 EET} - {3889126800 10800 1 EEST} - {3907270800 7200 0 EET} - {3920576400 10800 1 EEST} - {3939325200 7200 0 EET} - {3952026000 10800 1 EEST} - {3970774800 7200 0 EET} - {3983475600 10800 1 EEST} - {4002224400 7200 0 EET} - {4015530000 10800 1 EEST} - {4033674000 7200 0 EET} - {4046979600 10800 1 EEST} - {4065123600 7200 0 EET} - {4078429200 10800 1 EEST} - {4096573200 7200 0 EET} + {1473199200 10800 0 +03} } diff --git a/library/tzdata/Europe/Kaliningrad b/library/tzdata/Europe/Kaliningrad index 85add82..e1713ae 100644 --- a/library/tzdata/Europe/Kaliningrad +++ b/library/tzdata/Europe/Kaliningrad @@ -80,6 +80,6 @@ set TZData(:Europe/Kaliningrad) { {1256428800 7200 0 EET} {1269734400 10800 1 EEST} {1288483200 7200 0 EET} - {1301184000 10800 0 FET} + {1301184000 10800 0 +03} {1414278000 7200 0 EET} } diff --git a/library/tzdata/Europe/Kirov b/library/tzdata/Europe/Kirov index 82ffc9e..8762d22 100644 --- a/library/tzdata/Europe/Kirov +++ b/library/tzdata/Europe/Kirov @@ -2,7 +2,7 @@ set TZData(:Europe/Kirov) { {-9223372036854775808 11928 0 LMT} - {-1593825528 10800 0 +03} + {-1593820800 10800 0 +03} {-1247540400 14400 0 +05} {354916800 18000 1 +05} {370724400 14400 0 +04} diff --git a/library/tzdata/Europe/Minsk b/library/tzdata/Europe/Minsk index 2857e5b..7a6232e 100644 --- a/library/tzdata/Europe/Minsk +++ b/library/tzdata/Europe/Minsk @@ -71,6 +71,5 @@ set TZData(:Europe/Minsk) { {1256428800 7200 0 EET} {1269734400 10800 1 EEST} {1288483200 7200 0 EET} - {1301184000 10800 0 FET} - {1414274400 10800 0 MSK} + {1301184000 10800 0 +03} } diff --git a/library/tzdata/Europe/Moscow b/library/tzdata/Europe/Moscow index 1e2f45b..9b513b1 100644 --- a/library/tzdata/Europe/Moscow +++ b/library/tzdata/Europe/Moscow @@ -9,10 +9,10 @@ set TZData(:Europe/Moscow) { {-1627965079 16279 1 MDST} {-1618716679 12679 1 MST} {-1596429079 16279 1 MDST} - {-1593822679 14400 0 MSD} + {-1593820800 14400 0 MSD} {-1589860800 10800 0 MSK} {-1542427200 14400 1 MSD} - {-1539493200 18000 1 MSM} + {-1539493200 18000 1 +05} {-1525323600 14400 1 MSD} {-1491188400 7200 0 EET} {-1247536800 10800 0 MSD} diff --git a/library/tzdata/Europe/Samara b/library/tzdata/Europe/Samara index 08203c0..8f21c57 100644 --- a/library/tzdata/Europe/Samara +++ b/library/tzdata/Europe/Samara @@ -2,72 +2,72 @@ set TZData(:Europe/Samara) { {-9223372036854775808 12020 0 LMT} - {-1593825620 10800 0 SAMT} - {-1247540400 14400 0 SAMT} - {-1102305600 14400 0 KUYMMTT} - {354916800 18000 1 KUYST} - {370724400 14400 0 KUYT} - {386452800 18000 1 KUYST} - {402260400 14400 0 KUYT} - {417988800 18000 1 KUYST} - {433796400 14400 0 KUYT} - {449611200 18000 1 KUYST} - {465343200 14400 0 KUYT} - {481068000 18000 1 KUYST} - {496792800 14400 0 KUYT} - {512517600 18000 1 KUYST} - {528242400 14400 0 KUYT} - {543967200 18000 1 KUYST} - {559692000 14400 0 KUYT} - {575416800 18000 1 KUYST} - {591141600 14400 0 KUYT} - {606866400 10800 0 MSD} - {606870000 14400 1 MSD} - {622594800 10800 0 MSK} - {638319600 14400 1 MSD} - {654649200 10800 0 MSK} - {670374000 7200 0 EEMMTT} - {670377600 10800 1 EEST} - {686102400 10800 0 SAMT} - {687916800 14400 0 SAMT} - {701820000 18000 1 SAMST} - {717544800 14400 0 SAMT} - {733269600 18000 1 SAMST} - {748994400 14400 0 SAMT} - {764719200 18000 1 SAMST} - {780444000 14400 0 SAMT} - {796168800 18000 1 SAMST} - {811893600 14400 0 SAMT} - {828223200 18000 1 SAMST} - {846367200 14400 0 SAMT} - {859672800 18000 1 SAMST} - {877816800 14400 0 SAMT} - {891122400 18000 1 SAMST} - {909266400 14400 0 SAMT} - {922572000 18000 1 SAMST} - {941320800 14400 0 SAMT} - {954021600 18000 1 SAMST} - {972770400 14400 0 SAMT} - {985471200 18000 1 SAMST} - {1004220000 14400 0 SAMT} - {1017525600 18000 1 SAMST} - {1035669600 14400 0 SAMT} - {1048975200 18000 1 SAMST} - {1067119200 14400 0 SAMT} - {1080424800 18000 1 SAMST} - {1099173600 14400 0 SAMT} - {1111874400 18000 1 SAMST} - {1130623200 14400 0 SAMT} - {1143324000 18000 1 SAMST} - {1162072800 14400 0 SAMT} - {1174773600 18000 1 SAMST} - {1193522400 14400 0 SAMT} - {1206828000 18000 1 SAMST} - {1224972000 14400 0 SAMT} - {1238277600 18000 1 SAMST} - {1256421600 14400 0 SAMT} - {1269727200 10800 0 SAMMMTT} - {1269730800 14400 1 SAMST} - {1288479600 10800 0 SAMT} - {1301180400 14400 0 SAMT} + {-1593820800 10800 0 +03} + {-1247540400 14400 0 +04} + {-1102305600 14400 0 +05} + {354916800 18000 1 +05} + {370724400 14400 0 +04} + {386452800 18000 1 +05} + {402260400 14400 0 +04} + {417988800 18000 1 +05} + {433796400 14400 0 +04} + {449611200 18000 1 +05} + {465343200 14400 0 +04} + {481068000 18000 1 +05} + {496792800 14400 0 +04} + {512517600 18000 1 +05} + {528242400 14400 0 +04} + {543967200 18000 1 +05} + {559692000 14400 0 +04} + {575416800 18000 1 +05} + {591141600 14400 0 +04} + {606866400 10800 0 +04} + {606870000 14400 1 +04} + {622594800 10800 0 +03} + {638319600 14400 1 +04} + {654649200 10800 0 +03} + {670374000 7200 0 +03} + {670377600 10800 1 +03} + {686102400 10800 0 +03} + {687916800 14400 0 +04} + {701820000 18000 1 +05} + {717544800 14400 0 +04} + {733269600 18000 1 +05} + {748994400 14400 0 +04} + {764719200 18000 1 +05} + {780444000 14400 0 +04} + {796168800 18000 1 +05} + {811893600 14400 0 +04} + {828223200 18000 1 +05} + {846367200 14400 0 +04} + {859672800 18000 1 +05} + {877816800 14400 0 +04} + {891122400 18000 1 +05} + {909266400 14400 0 +04} + {922572000 18000 1 +05} + {941320800 14400 0 +04} + {954021600 18000 1 +05} + {972770400 14400 0 +04} + {985471200 18000 1 +05} + {1004220000 14400 0 +04} + {1017525600 18000 1 +05} + {1035669600 14400 0 +04} + {1048975200 18000 1 +05} + {1067119200 14400 0 +04} + {1080424800 18000 1 +05} + {1099173600 14400 0 +04} + {1111874400 18000 1 +05} + {1130623200 14400 0 +04} + {1143324000 18000 1 +05} + {1162072800 14400 0 +04} + {1174773600 18000 1 +05} + {1193522400 14400 0 +04} + {1206828000 18000 1 +05} + {1224972000 14400 0 +04} + {1238277600 18000 1 +05} + {1256421600 14400 0 +04} + {1269727200 10800 0 +04} + {1269730800 14400 1 +04} + {1288479600 10800 0 +03} + {1301180400 14400 0 +04} } diff --git a/library/tzdata/Europe/Ulyanovsk b/library/tzdata/Europe/Ulyanovsk index d5c33b5..8fb3f9e 100644 --- a/library/tzdata/Europe/Ulyanovsk +++ b/library/tzdata/Europe/Ulyanovsk @@ -2,7 +2,7 @@ set TZData(:Europe/Ulyanovsk) { {-9223372036854775808 11616 0 LMT} - {-1593825216 10800 0 +03} + {-1593820800 10800 0 +03} {-1247540400 14400 0 +05} {354916800 18000 1 +05} {370724400 14400 0 +04} diff --git a/library/tzdata/Europe/Volgograd b/library/tzdata/Europe/Volgograd index 83996b0..05e1044 100644 --- a/library/tzdata/Europe/Volgograd +++ b/library/tzdata/Europe/Volgograd @@ -2,71 +2,70 @@ set TZData(:Europe/Volgograd) { {-9223372036854775808 10660 0 LMT} - {-1577761060 10800 0 TSAT} - {-1411873200 10800 0 STAT} - {-1247540400 14400 0 STAT} - {-256881600 14400 0 VOLMMTT} - {354916800 18000 1 VOLST} - {370724400 14400 0 VOLT} - {386452800 18000 1 VOLST} - {402260400 14400 0 VOLT} - {417988800 18000 1 VOLST} - {433796400 14400 0 VOLT} - {449611200 18000 1 VOLST} - {465343200 14400 0 VOLT} - {481068000 18000 1 VOLST} - {496792800 14400 0 VOLT} - {512517600 18000 1 VOLST} - {528242400 14400 0 VOLT} - {543967200 18000 1 VOLST} - {559692000 14400 0 VOLT} - {575416800 10800 0 VOLMMTT} - {575420400 14400 1 VOLST} - {591145200 10800 0 VOLT} - {606870000 14400 1 VOLST} - {622594800 10800 0 VOLT} - {638319600 14400 1 VOLST} - {654649200 10800 0 VOLT} - {670374000 14400 0 VOLT} - {701820000 10800 0 MSD} - {701823600 14400 1 MSD} - {717548400 10800 0 MSK} - {733273200 14400 1 MSD} - {748998000 10800 0 MSK} - {764722800 14400 1 MSD} - {780447600 10800 0 MSK} - {796172400 14400 1 MSD} - {811897200 10800 0 MSK} - {828226800 14400 1 MSD} - {846370800 10800 0 MSK} - {859676400 14400 1 MSD} - {877820400 10800 0 MSK} - {891126000 14400 1 MSD} - {909270000 10800 0 MSK} - {922575600 14400 1 MSD} - {941324400 10800 0 MSK} - {954025200 14400 1 MSD} - {972774000 10800 0 MSK} - {985474800 14400 1 MSD} - {1004223600 10800 0 MSK} - {1017529200 14400 1 MSD} - {1035673200 10800 0 MSK} - {1048978800 14400 1 MSD} - {1067122800 10800 0 MSK} - {1080428400 14400 1 MSD} - {1099177200 10800 0 MSK} - {1111878000 14400 1 MSD} - {1130626800 10800 0 MSK} - {1143327600 14400 1 MSD} - {1162076400 10800 0 MSK} - {1174777200 14400 1 MSD} - {1193526000 10800 0 MSK} - {1206831600 14400 1 MSD} - {1224975600 10800 0 MSK} - {1238281200 14400 1 MSD} - {1256425200 10800 0 MSK} - {1269730800 14400 1 MSD} - {1288479600 10800 0 MSK} - {1301180400 14400 0 MSK} - {1414274400 10800 0 MSK} + {-1577761060 10800 0 +03} + {-1247540400 14400 0 +04} + {-256881600 14400 0 +05} + {354916800 18000 1 +05} + {370724400 14400 0 +04} + {386452800 18000 1 +05} + {402260400 14400 0 +04} + {417988800 18000 1 +05} + {433796400 14400 0 +04} + {449611200 18000 1 +05} + {465343200 14400 0 +04} + {481068000 18000 1 +05} + {496792800 14400 0 +04} + {512517600 18000 1 +05} + {528242400 14400 0 +04} + {543967200 18000 1 +05} + {559692000 14400 0 +04} + {575416800 10800 0 +04} + {575420400 14400 1 +04} + {591145200 10800 0 +03} + {606870000 14400 1 +04} + {622594800 10800 0 +03} + {638319600 14400 1 +04} + {654649200 10800 0 +03} + {670374000 14400 0 +04} + {701820000 10800 0 +04} + {701823600 14400 1 +04} + {717548400 10800 0 +03} + {733273200 14400 1 +04} + {748998000 10800 0 +03} + {764722800 14400 1 +04} + {780447600 10800 0 +03} + {796172400 14400 1 +04} + {811897200 10800 0 +03} + {828226800 14400 1 +04} + {846370800 10800 0 +03} + {859676400 14400 1 +04} + {877820400 10800 0 +03} + {891126000 14400 1 +04} + {909270000 10800 0 +03} + {922575600 14400 1 +04} + {941324400 10800 0 +03} + {954025200 14400 1 +04} + {972774000 10800 0 +03} + {985474800 14400 1 +04} + {1004223600 10800 0 +03} + {1017529200 14400 1 +04} + {1035673200 10800 0 +03} + {1048978800 14400 1 +04} + {1067122800 10800 0 +03} + {1080428400 14400 1 +04} + {1099177200 10800 0 +03} + {1111878000 14400 1 +04} + {1130626800 10800 0 +03} + {1143327600 14400 1 +04} + {1162076400 10800 0 +03} + {1174777200 14400 1 +04} + {1193526000 10800 0 +03} + {1206831600 14400 1 +04} + {1224975600 10800 0 +03} + {1238281200 14400 1 +04} + {1256425200 10800 0 +03} + {1269730800 14400 1 +04} + {1288479600 10800 0 +03} + {1301180400 14400 0 +04} + {1414274400 10800 0 +03} } diff --git a/library/tzdata/Indian/Kerguelen b/library/tzdata/Indian/Kerguelen index 8820010..93f2d94 100644 --- a/library/tzdata/Indian/Kerguelen +++ b/library/tzdata/Indian/Kerguelen @@ -2,5 +2,5 @@ set TZData(:Indian/Kerguelen) { {-9223372036854775808 0 0 -00} - {-631152000 18000 0 TFT} + {-631152000 18000 0 +05} } -- cgit v0.12 From 0bb135c827e61a652002b80bbdd7fdb07861cfbe Mon Sep 17 00:00:00 2001 From: pooryorick Date: Mon, 3 Oct 2016 01:10:16 +0000 Subject: Fix [2bf561854c55a], interp alias to command whose name is the empty string. --- generic/tclInterp.c | 11 +++-------- tests/interp.test | 11 +++++++++++ 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/generic/tclInterp.c b/generic/tclInterp.c index a2de658..1bfe76a 100644 --- a/generic/tclInterp.c +++ b/generic/tclInterp.c @@ -660,14 +660,9 @@ NRInterpCmd( if (masterInterp == NULL) { return TCL_ERROR; } - if (TclGetString(objv[5])[0] == '\0') { - if (objc == 6) { - return AliasDelete(interp, slaveInterp, objv[3]); - } - } else { - return AliasCreate(interp, slaveInterp, masterInterp, objv[3], - objv[5], objc - 6, objv + 6); - } + + return AliasCreate(interp, slaveInterp, masterInterp, objv[3], + objv[5], objc - 6, objv + 6); } goto aliasArgs; } diff --git a/tests/interp.test b/tests/interp.test index 34b5bf9..ed76f1a 100644 --- a/tests/interp.test +++ b/tests/interp.test @@ -606,6 +606,17 @@ test interp-14.10 {testing interp-alias: error messages} -setup { invoked from within "a 1"} +test interp-14.11 {{interp alias} {target named the empty string} {bug 2bf56185}} -setup { + set interp [interp create [info cmdcount]] + interp eval $interp { + proc {} args {return $args} + } + +} -body { + interp alias {} p1 $interp {} + p1 one two three +} -result {one two three} + # part 15: testing file sharing test interp-15.1 {testing file sharing} { catch {interp delete z} -- cgit v0.12 From a9141cc7056ed9c6778e8fcfb770fcdef7cae3a6 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Mon, 3 Oct 2016 14:53:32 +0000 Subject: (cherry-pick): Fix [2bf561854c55a], interp alias to command whose name is the empty string. --- generic/tclInterp.c | 11 +++-------- tests/interp.test | 11 +++++++++++ 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/generic/tclInterp.c b/generic/tclInterp.c index 66ce1e0..8a0d653 100644 --- a/generic/tclInterp.c +++ b/generic/tclInterp.c @@ -660,14 +660,9 @@ NRInterpCmd( if (masterInterp == NULL) { return TCL_ERROR; } - if (TclGetString(objv[5])[0] == '\0') { - if (objc == 6) { - return AliasDelete(interp, slaveInterp, objv[3]); - } - } else { - return AliasCreate(interp, slaveInterp, masterInterp, objv[3], - objv[5], objc - 6, objv + 6); - } + + return AliasCreate(interp, slaveInterp, masterInterp, objv[3], + objv[5], objc - 6, objv + 6); } goto aliasArgs; } diff --git a/tests/interp.test b/tests/interp.test index f9c1aec..6000ffd 100644 --- a/tests/interp.test +++ b/tests/interp.test @@ -606,6 +606,17 @@ test interp-14.10 {testing interp-alias: error messages} -setup { invoked from within "a 1"} +test interp-14.11 {{interp alias} {target named the empty string} {bug 2bf56185}} -setup { + set interp [interp create [info cmdcount]] + interp eval $interp { + proc {} args {return $args} + } + +} -body { + interp alias {} p1 $interp {} + p1 one two three +} -result {one two three} + # part 15: testing file sharing test interp-15.1 {testing file sharing} { catch {interp delete z} -- cgit v0.12 From 2735ae8a8f3cd9a14778858d17f195bf54fc3303 Mon Sep 17 00:00:00 2001 From: pooryorick Date: Mon, 3 Oct 2016 16:49:58 +0000 Subject: Fix documentation of [expr] operators, replacing "divisor" with "dividend" --- doc/expr.n | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/expr.n b/doc/expr.n index b76b6a2..e25515d 100644 --- a/doc/expr.n +++ b/doc/expr.n @@ -133,15 +133,15 @@ Exponentiation. Valid for any numeric operands. Multiply, divide, remainder. None of these operators may be applied to string operands, and remainder may be applied only to integers. -The remainder will always have the same sign as the divisor and +The remainder always has the same sign as the divisor and an absolute value smaller than the absolute value of the divisor. .RS .PP When applied to integers, the division and remainder operators can be considered to partition the number line into a sequence of equal-sized adjacent non-overlapping pieces where each piece is the size of the divisor; -the division result identifies which piece the divisor lay within, and the -remainder result identifies where within that piece the divisor lay. A +the division result identifies which piece the dividend lies within, and the +remainder result identifies where within that piece the dividend lies. A consequence of this is that the result of .QW "-57 \fB/\fR 10" is always -6, and the result of -- cgit v0.12 From 5b377a6192b167ec34c088deab0eed8aa80253bb Mon Sep 17 00:00:00 2001 From: max Date: Tue, 4 Oct 2016 13:31:49 +0000 Subject: When opening a server socket on an ephemeral port, make sure that the port number that gets picked for IPv4 is also available on IPv6. If not, start all over for up to ten times to find a port number that is available on both protocols. --- unix/tclUnixSock.c | 39 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) diff --git a/unix/tclUnixSock.c b/unix/tclUnixSock.c index 8167077..f7bd0be 100644 --- a/unix/tclUnixSock.c +++ b/unix/tclUnixSock.c @@ -1429,7 +1429,7 @@ Tcl_OpenTcpServer( * clients. */ ClientData acceptProcData) /* Data for the callback. */ { - int status = 0, sock = -1, reuseaddr = 1, chosenport = 0; + int status = 0, sock = -1, reuseaddr = 1, chosenport; struct addrinfo *addrlist = NULL, *addrPtr; /* socket address */ TcpState *statePtr = NULL; char channelName[SOCK_CHAN_LENGTH]; @@ -1444,6 +1444,37 @@ Tcl_OpenTcpServer( enum { LOOKUP, SOCKET, BIND, LISTEN } howfar = LOOKUP; int my_errno = 0; + /* + * If we were called with port 0 to listen on a random port number, we + * copy the port number from the first member of the addrinfo list to all + * subsequent members, so that IPv4 and IPv6 listen on the same port. This + * might fail to bind() with EADDRINUSE if a port is free on the first + * address family in the list but already used on the other. In this case + * we revert everything we've done so far and start from scratch hoping + * that next time we'll find a port number that is usable on all address + * families. We try this at most MAXRETRY times to avoid an endless loop + * if all ports are taken. + */ + int retry = 0; +#define MAXRETRY 10 + + repeat: + if (retry > 0) { + if (statePtr != NULL) { + TcpCloseProc(statePtr, NULL); + statePtr = NULL; + } + if (addrlist != NULL) { + freeaddrinfo(addrlist); + addrlist = NULL; + } + if (retry >= MAXRETRY) { + goto error; + } + } + retry++; + chosenport = 0; + if (!TclCreateSocketAddress(interp, &addrlist, myHost, port, 1, &errorMsg)) { my_errno = errno; goto error; @@ -1512,6 +1543,9 @@ Tcl_OpenTcpServer( } close(sock); sock = -1; + if (port == 0 && errno == EADDRINUSE) { + goto repeat; + } continue; } if (port == 0 && chosenport == 0) { @@ -1535,6 +1569,9 @@ Tcl_OpenTcpServer( } close(sock); sock = -1; + if (port == 0 && errno == EADDRINUSE) { + goto repeat; + } continue; } if (statePtr == NULL) { -- cgit v0.12 From fb0c1827eb055322b7c6f0c5dc80673dbbbf1f9f Mon Sep 17 00:00:00 2001 From: dkf Date: Tue, 4 Oct 2016 19:11:07 +0000 Subject: [4d5ae7d88a] Stop crashes with asynchronous connects to hosts without addresses. --- unix/tclUnixSock.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/unix/tclUnixSock.c b/unix/tclUnixSock.c index 9c5cd4b..ca8d677 100644 --- a/unix/tclUnixSock.c +++ b/unix/tclUnixSock.c @@ -1098,7 +1098,7 @@ TcpConnect( { socklen_t optlen; int async_callback = statePtr->flags & TCP_ASYNC_PENDING; - int ret = -1, error = errno; + int ret = -1, error = EHOSTUNREACH; int async = statePtr->flags & TCP_ASYNC_CONNECT; if (async_callback) { -- cgit v0.12 From 2655e9896fe938d39815b319a328f7dcfe1651bc Mon Sep 17 00:00:00 2001 From: pooryorick Date: Wed, 5 Oct 2016 00:05:55 +0000 Subject: Rewrite expr documentation. Among other things, fixes [ef5373e6fa0617ee]. --- doc/expr.n | 385 +++++++++++++++++++++++++++---------------------------------- 1 file changed, 171 insertions(+), 214 deletions(-) diff --git a/doc/expr.n b/doc/expr.n index e25515d..7458129 100644 --- a/doc/expr.n +++ b/doc/expr.n @@ -17,14 +17,14 @@ expr \- Evaluate an expression .BE .SH DESCRIPTION .PP -Concatenates \fIarg\fRs (adding separator spaces between them), -evaluates the result as a Tcl expression, and returns the value. -The operators permitted in Tcl expressions include a subset of +Concatenates \fIarg\fRs, separated by a space, into an expresion, and evaluates +that expression, returning its value. +The operators permitted in an expression include a subset of the operators permitted in C expressions. For those operators common to both Tcl and C, Tcl applies the same meaning and precedence as the corresponding C operators. -Expressions almost always yield numeric results -(integer or floating-point values). +The value of an expressions is often a numeric result, either an integer or a +floating-point value, but may also be a non-numeric value. For example, the expression .PP .CS @@ -32,78 +32,68 @@ For example, the expression .CE .PP evaluates to 14.2. -Tcl expressions differ from C expressions in the way that -operands are specified. Also, Tcl expressions support -non-numeric operands and string comparisons, as well as some +Expressions differ from C expressions in the way that +operands are specified. Also, expressions support +non-numeric operands, string comparisons, and some additional operators not found in C. +.PP +When an expression evaluates to an integer, the value is the decimal form of +the integer, and when an expression evaluates to a floating-point number, the +value is the form produced by the \fB%g\fR format specifier of Tcl's +\fBformat\fR command. .SS OPERANDS .PP -A Tcl expression consists of a combination of operands, operators, -parentheses and commas. -White space may be used between the operands and operators and -parentheses (or commas); it is ignored by the expression's instructions. -Where possible, operands are interpreted as integer values. -Integer values may be specified in decimal (the normal case), in binary -(if the first two characters of the operand are \fB0b\fR), in octal -(if the first two characters of the operand are \fB0o\fR), or in hexadecimal -(if the first two characters of the operand are \fB0x\fR). For -compatibility with older Tcl releases, an octal integer value is also -indicated simply when the first character of the operand is \fB0\fR, -whether or not the second character is also \fBo\fR. -If an operand does not have one of the integer formats given -above, then it is treated as a floating-point number if that is -possible. Floating-point numbers may be specified in any of several -common formats making use of the decimal digits, the decimal point \fB.\fR, -the characters \fBe\fR or \fBE\fR indicating scientific notation, and -the sign characters \fB+\fR or \fB\-\fR. For example, all of the -following are valid floating-point numbers: 2.1, 3., 6e4, 7.91e+16. -Also recognized as floating point values are the strings \fBInf\fR -and \fBNaN\fR making use of any case for each character. -If no numeric interpretation is possible (note that all literal -operands that are not numeric or boolean must be quoted with either -braces or with double quotes), then an operand is left as a string -(and only a limited set of operators may be applied to it). -.PP -Operands may be specified in any of the following ways: +An expression consists of a combination of operands, operators, parentheses and +commas, possibly with whitespace between any of these elements, which is +ignored. +An integer operand may be specified in decimal, binary +(the first two characters are \fB0b\fR), octal +(the first two characters are \fB0o\fR), or hexadecimal +(the first two characters are \fB0x\fR) form. For +compatibility with older Tcl releases, an operand that begins with \fB0\fR is +interpreted as an octal integer even if the second character is not \fBo\fR. +A floating-point number may be specified in any of several +common decimal formats, and may use the decimal point \fB.\fR, +\fBe\fR or \fBE\fR for scientific notation, and +the sign characters \fB+\fR and \fB\-\fR. The +following are all valid floating-point numbers: 2.1, 3., 6e4, 7.91e+16. +The strings \fBInf\fR +and \fBNaN\fR, in any combination of case, are also recognized as floating point +values. An operand that doesn't have a numeric interpretation must be quoted +with either braces or with double quotes. +.PP +An operand may be specified in any of the following ways: .IP [1] As a numeric value, either integer or floating-point. .IP [2] As a boolean value, using any form understood by \fBstring is\fR \fBboolean\fR. .IP [3] -As a Tcl variable, using standard \fB$\fR notation. -The variable's value will be used as the operand. +As a variable, using standard \fB$\fR notation. +The value of the variable is then the value of the operand. .IP [4] As a string enclosed in double-quotes. -The expression parser will perform backslash, variable, and -command substitutions on the information between the quotes, -and use the resulting value as the operand +Backslash, variable, and command substitution are performed as described in +\fBTcl\fR. .IP [5] As a string enclosed in braces. -The characters between the open brace and matching close brace -will be used as the operand without any substitutions. +The operand is treated as a braced value as described in \fBTcl\fR. .IP [6] As a Tcl command enclosed in brackets. -The command will be executed and its result will be used as -the operand. +Command substitution is performed as described in \fBTcl\fR. .IP [7] -As a mathematical function whose arguments have any of the above -forms for operands, such as \fBsin($x)\fR. See \fBMATH FUNCTIONS\fR below for +As a mathematical function such as \fBsin($x)\fR, whose arguments have any of the above +forms for operands. See \fBMATH FUNCTIONS\fR below for a discussion of how mathematical functions are handled. .PP -Where the above substitutions occur (e.g. inside quoted strings), they -are performed by the expression's instructions. -However, the command parser may already have performed one round of -substitution before the expression processor was called. -As discussed below, it is usually best to enclose expressions -in braces to prevent the command parser from performing substitutions -on the contents. +Because \fBexpr\fR parses and performs substitutions on values that have +already been parsed and substituted by \fBTcl\fR, it is usually best to enclose +expressions in braces to avoid the first round of substitutions by +\fBTcl\fR. .PP -For some examples of simple expressions, suppose the variable -\fBa\fR has the value 3 and -the variable \fBb\fR has the value 6. -Then the command on the left side of each of the lines below -will produce the value on the right side of the line: +Below are some examples of simple expressions where the value of \fBa\fR is 3 +and the value of \fBb\fR is 6. The command on the left side of each line +produces the value on the right side. .PP .CS .ta 6c @@ -114,34 +104,41 @@ will produce the value on the right side of the line: .CE .SS OPERATORS .PP -The valid operators (most of which are also available as commands in -the \fBtcl::mathop\fR namespace; see the \fBmathop\fR(n) manual page -for details) are listed below, grouped in decreasing order of precedence: +For operators having both a numeric mode and a string mode, the numeric mode is +chosen when all operands have a numeric interpretation. The integer +interpretation of an operand is preferred over the floating-point +interpretation. To ensure string operations on arbitrary values it is generally a +good idea to use \fBeq\fR, \fBne\fR, or the \fBstring\fR command instead of +more versatile operators such as \fB==\fR. +.PP +Unless otherwise specified, operators accept non-numeric operands. The value +of a boolean operation is 1 if true, 0 otherwise. See also \fBstring is\fR +\fBboolean\fR. The valid operators, most of which are also available as +commands in the \fBtcl::mathop\fR namespace (see \fBmathop\fR(n)), are listed +below, grouped in decreasing order of precedence: .TP 20 \fB\-\0\0+\0\0~\0\0!\fR . -Unary minus, unary plus, bit-wise NOT, logical NOT. None of these operators -may be applied to string operands, and bit-wise NOT may be -applied only to integers. +Unary minus, unary plus, bit-wise NOT, logical NOT. These operators +may only be applied to numeric operands, and bit-wise NOT may only be +applied to integers. .TP 20 \fB**\fR . -Exponentiation. Valid for any numeric operands. +Exponentiation. Valid for numeric operands. .TP 20 \fB*\0\0/\0\0%\fR . -Multiply, divide, remainder. None of these operators may be -applied to string operands, and remainder may be applied only -to integers. -The remainder always has the same sign as the divisor and -an absolute value smaller than the absolute value of the divisor. +Multiply and divide, which are valid for numeric operands, and remainder, which +is valid for integers. The remainder, an absolute value smaller than the +absolute value of the divisor, has the same sign as the divisor. .RS .PP -When applied to integers, the division and remainder operators can be -considered to partition the number line into a sequence of equal-sized -adjacent non-overlapping pieces where each piece is the size of the divisor; -the division result identifies which piece the dividend lies within, and the -remainder result identifies where within that piece the dividend lies. A +When applied to integers, division and remainder can be +considered to partition the number line into a sequence of +adjacent non-overlapping pieces, where each piece is the size of the divisor; +the quotient identifies which piece the dividend lies within, and the +remainder identifies where within that piece the dividend lies. A consequence of this is that the result of .QW "-57 \fB/\fR 10" is always -6, and the result of @@ -151,177 +148,157 @@ is always 3. .TP 20 \fB+\0\0\-\fR . -Add and subtract. Valid for any numeric operands. +Add and subtract. Valid for numeric operands. .TP 20 \fB<<\0\0>>\fR . -Left and right shift. Valid for integer operands only. +Left and right shift. Valid for integers. A right shift always propagates the sign bit. .TP 20 \fB<\0\0>\0\0<=\0\0>=\fR . -Boolean less, greater, less than or equal, and greater than or equal. -Each operator produces 1 if the condition is true, 0 otherwise. -These operators may be applied to strings as well as numeric operands, -in which case string comparison is used. +Boolean less than, greater than, less than or equal, and greater than or equal. .TP 20 \fB==\0\0!=\fR . -Boolean equal and not equal. Each operator produces a zero/one result. -Valid for all operand types. +Boolean equal and not equal. .TP 20 \fBeq\0\0ne\fR . -Boolean string equal and string not equal. Each operator produces a -zero/one result. The operand types are interpreted only as strings. +Boolean string equal and string not equal. .TP 20 \fBin\0\0ni\fR . -List containment and negated list containment. Each operator produces -a zero/one result and treats its first argument as a string and its -second argument as a Tcl list. The \fBin\fR operator indicates -whether the first argument is a member of the second argument list; -the \fBni\fR operator inverts the sense of the result. +List containment and negated list containment. The first argument is +interpreted as a string, the second as a list. \fBin\fR tests for membership +in the list, and \fBni\fR is the inverse. .TP 20 \fB&\fR . -Bit-wise AND. Valid for integer operands only. +Bit-wise AND. Valid for integer operands. .TP 20 \fB^\fR . -Bit-wise exclusive OR. Valid for integer operands only. +Bit-wise exclusive OR. Valid for integer operands. .TP 20 \fB|\fR . -Bit-wise OR. Valid for integer operands only. +Bit-wise OR. Valid for integer operands. .TP 20 \fB&&\fR . -Logical AND. Produces a 1 result if both operands are non-zero, -0 otherwise. -Valid for boolean and numeric (integers or floating-point) operands only. +Logical AND. If both operands are true, the result is 1, or 0 otherwise. + .TP 20 \fB||\fR . -Logical OR. Produces a 0 result if both operands are zero, 1 otherwise. -Valid for boolean and numeric (integers or floating-point) operands only. +Logical OR. If both operands are false, the result is 0, or 1 otherwise. .TP 20 \fIx\fB?\fIy\fB:\fIz\fR . -If-then-else, as in C. If \fIx\fR -evaluates to non-zero, then the result is the value of \fIy\fR. -Otherwise the result is the value of \fIz\fR. -The \fIx\fR operand must have a boolean or numeric value. -.PP -See the C manual for more details on the results -produced by each operator. -The exponentiation operator promotes types like the multiply and -divide operators, and produces a result that is the same as the output -of the \fBpow\fR function (after any type conversions.) -All of the binary operators but exponentiation group left-to-right -within the same precedence level; exponentiation groups right-to-left. For example, the command +If-then-else, as in C. If \fIx\fR is false , the result is the value of +\fIy\fR. Otherwise the result is the value of \fIz\fR. +.PP +The exponentiation operator promotes types in the same way as the multiply +and divide operators, and the result is is the same as the result of +\fBpow\fR. +exponentiation groups right-to-left within a precedence level. Other binary +operators group left-to-right. For example, the value of .PP .CS \fBexpr\fR {4*2 < 7} .CE .PP -returns 0, while +is 0, while the value of .PP .CS \fBexpr\fR {2**3**2} .CE .PP -returns 512. +is 512. .PP -The \fB&&\fR, \fB||\fR, and \fB?:\fR operators have +\fB&&\fR, \fB||\fR, and \fB?:\fR feature .QW "lazy evaluation" , just as in C, which means that operands are not evaluated if they are -not needed to determine the outcome. For example, in the command +not needed to determine the outcome. For example, in .PP .CS \fBexpr\fR {$v ? [a] : [b]} .CE .PP -only one of -.QW \fB[a]\fR -or -.QW \fB[b]\fR -will actually be evaluated, -depending on the value of \fB$v\fR. Note, however, that this is -only true if the entire expression is enclosed in braces; otherwise -the Tcl parser will evaluate both -.QW \fB[a]\fR -and -.QW \fB[b]\fR -before invoking the \fBexpr\fR command. +only one of \fB[a]\fR or \fB[b]\fR is evaluated, +depending on the value of \fB$v\fR. This is not true of the normal Tcl parser, +so it is normally recommended to enclose the arguments to \fBexpr\fR in braces. +Without braces, as in +\fBexpr\fR $v ? [a] : [b] +both \fB[a]\fR and \fB[b]\fR are evaluated before \fBexpr\fR is even called. +.PP +For more details on the results +produced by each operator, see the documentation for C. .SS "MATH FUNCTIONS" .PP -When the expression parser encounters a mathematical function -such as \fBsin($x)\fR, it replaces it with a call to an ordinary -Tcl function in the \fBtcl::mathfunc\fR namespace. The processing -of an expression such as: +A mathematical function such as \fBsin($x)\fR is replaced with a call to an ordinary +Tcl command in the \fBtcl::mathfunc\fR namespace. The evaluation +of an expression such as .PP .CS \fBexpr\fR {sin($x+$y)} .CE .PP -is the same in every way as the processing of: +is the same in every way as the evaluation of .PP .CS \fBexpr\fR {[tcl::mathfunc::sin [\fBexpr\fR {$x+$y}]]} .CE .PP -which in turn is the same as the processing of: +which in turn is the same as the evaluation of .PP .CS tcl::mathfunc::sin [\fBexpr\fR {$x+$y}] .CE .PP -The executor will search for \fBtcl::mathfunc::sin\fR using the usual -rules for resolving functions in namespaces. Either -\fB::tcl::mathfunc::sin\fR or \fB[namespace -current]::tcl::mathfunc::sin\fR will satisfy the request, and others -may as well (depending on the current \fBnamespace path\fR setting). +\fBtcl::mathfunc::sin\fR is resolved as described in +\fBNAMESPACE RESOLUTION\fR in the \fBnamespace\fR documentation. Given the +default value of \fBnamespace path\fR, \fB[namespace +current]::tcl::mathfunc::sin\fR or \fB::tcl::mathfunc::sin\fR are the typical +resolutions. .PP -Some mathematical functions have several arguments, separated by commas like in C. Thus: +As in C, a mathematical function may accept multiple arguments separated by commas. Thus, .PP .CS \fBexpr\fR {hypot($x,$y)} .CE .PP -ends up as +becomes .PP .CS tcl::mathfunc::hypot $x $y .CE .PP -See the \fBmathfunc\fR(n) manual page for the math functions that are +See the \fBmathfunc\fR(n) documentation for the math functions that are available by default. .SS "TYPES, OVERFLOW, AND PRECISION" .PP -All internal computations involving integers are done calling on the -LibTomMath multiple precision integer library as required so that all -integer calculations are performed exactly. Note that in Tcl releases -prior to 8.5, integer calculations were performed with one of the C types +When needed to guarantee exact performance, internal computations involving +integers use the LibTomMath multiple precision integer library. In Tcl releases +prior to 8.5, integer calculations were performed using one of the C types \fIlong int\fR or \fITcl_WideInt\fR, causing implicit range truncation in those calculations where values overflowed the range of those types. -Any code that relied on these implicit truncations will need to explicitly -add \fBint()\fR or \fBwide()\fR function calls to expressions at the points -where such truncation is required to take place. +Any code that relied on these implicit truncations should instead call +\fBint()\fR or \fBwide()\fR, which do truncate. .PP -All internal computations involving floating-point are -done with the C type \fIdouble\fR. +Internal floating-point computations are +performed using the C type \fIdouble\fR. When converting a string to floating-point, exponent overflow is detected and results in the \fIdouble\fR value of \fBInf\fR or \fB\-Inf\fR as appropriate. Floating-point overflow and underflow are detected to the degree supported by the hardware, which is generally -pretty reliable. +fairly reliable. .PP -Conversion among internal representations for integer, floating-point, -and string operands is done automatically as needed. -For arithmetic computations, integers are used until some -floating-point number is introduced, after which floating-point is used. -For example, +Conversion among internal representations for integer, floating-point, and +string operands is done automatically as needed. For arithmetic computations, +integers are used until some floating-point number is introduced, after which +floating-point values are used. For example, .PP .CS \fBexpr\fR {5 / 4} @@ -335,82 +312,62 @@ returns 1, while .CE .PP both return 1.25. -Floating-point values are always returned with a +A floating-point result can be distinguished from an integer result by the +presence of either .QW \fB.\fR -or an +or .QW \fBe\fR -so that they will not look like integer values. For example, +.PP +. For example, .PP .CS \fBexpr\fR {20.0/5.0} .CE .PP returns \fB4.0\fR, not \fB4\fR. -.SS "STRING OPERATIONS" -.PP -String values may be used as operands of the comparison operators, -although the expression evaluator tries to do comparisons as integer -or floating-point when it can, -i.e., when all arguments to the operator allow numeric interpretations, -except in the case of the \fBeq\fR and \fBne\fR operators. -If one of the operands of a comparison is a string and the other -has a numeric value, a canonical string representation of the numeric -operand value is generated to compare with the string operand. -Canonical string representation for integer values is a decimal string -format. Canonical string representation for floating-point values -is that produced by the \fB%g\fR format specifier of Tcl's -\fBformat\fR command. For example, the commands -.PP -.CS -\fBexpr\fR {"0x03" > "2"} -\fBexpr\fR {"0y" > "0x12"} -.CE -.PP -both return 1. The first comparison is done using integer -comparison, and the second is done using string comparison. -Because of Tcl's tendency to treat values as numbers whenever -possible, it is not generally a good idea to use operators like \fB==\fR -when you really want string comparison and the values of the -operands could be arbitrary; it is better in these cases to use -the \fBeq\fR or \fBne\fR operators, or the \fBstring\fR command instead. .SH "PERFORMANCE CONSIDERATIONS" .PP -Enclose expressions in braces for the best speed and the smallest -storage requirements. -This allows the Tcl bytecode compiler to generate the best code. -.PP -As mentioned above, expressions are substituted twice: -once by the Tcl parser and once by the \fBexpr\fR command. -For example, the commands +Where an expression contains syntax that Tcl would otherwise perform +substitutions on, enclosing an expression in braces or otherwise quoting it +so that it's a static value allows the Tcl compiler to generate bytecode for +the expression, resulting in better speed and smaller storage requirements. +This also avoids issues that can arise if Tcl is allowed to perform +substitution on the value before \fBexpr\fR is called. .PP +In the following example, the value of the expression is 11 because the Tcl parser first +substitutes \fB$b\fR and \fBexpr\fR then substitutes \fB$a\fR. Enclosing the +expression in braces would result in a syntax error. .CS set a 3 set b {$a + 2} \fBexpr\fR $b*4 .CE .PP -return 11, not a multiple of 4. -This is because the Tcl parser will first substitute \fB$a + 2\fR for -the variable \fBb\fR, -then the \fBexpr\fR command will evaluate the expression \fB$a + 2*4\fR. -.PP -Most expressions do not require a second round of substitutions. -Either they are enclosed in braces or, if not, -their variable and command substitutions yield numbers or strings -that do not themselves require substitutions. -However, because a few unbraced expressions -need two rounds of substitutions, -the bytecode compiler must emit -additional instructions to handle this situation. -The most expensive code is required for -unbraced expressions that contain command substitutions. -These expressions must be implemented by generating new code -each time the expression is executed. -When the expression is unbraced to allow the substitution of a function or -operator, consider using the commands documented in the \fBmathfunc\fR(n) or -\fBmathop\fR(n) manual pages directly instead. + +When an expression is generated at runtime, like the one above is, the bytcode +compiler must ensure that new code is generated each time the expression +is evaluated. This is the most costly kind of expression from a performance +perspective. In such cases, consider directly using the commands described in +the \fBmathfunc\fR(n) or \fBmathop\fR(n) documentation instead of \fBexpr\fR. + +Most expressions are not formed at runtime, but are literal strings or contain +substitutions that don't introduce other substitutions. To allow the bytecode +compiler to work with an expression as a string literal at compilation time, +ensure that it contains no substitutions or that it is enclosed in braces or +otherwise quoted to prevent Tcl from performing substitutions, allowing +\fBexpr\fR to perform them instead. .SH EXAMPLES .PP +A numeric comparison whose result is 1: +.CS +\fBexpr\fR {"0x03" > "2"} +.CE +.PP +A string comparison whose result is 1: +.CS +\fBexpr\fR {"0y" > "0x12"} +.CE +.PP Define a procedure that computes an .QW interesting mathematical function: @@ -444,8 +401,8 @@ each other: puts "a and b are [\fBexpr\fR {$a eq $b ? {equal} : {different}}]" .CE .PP -Set a variable to whether an environment variable is both defined at -all and also set to a true boolean value: +Set a variable indicating whether an environment variable is defined and has +value of true: .PP .CS set isTrue [\fBexpr\fR { -- cgit v0.12 From 69e7f1b52d7d59ea5b1b6cb027c8fbdc88b9d38d Mon Sep 17 00:00:00 2001 From: pooryorick Date: Wed, 5 Oct 2016 04:53:49 +0000 Subject: Fix typos in expr documentation. --- doc/expr.n | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/doc/expr.n b/doc/expr.n index 7458129..89c982c 100644 --- a/doc/expr.n +++ b/doc/expr.n @@ -17,13 +17,13 @@ expr \- Evaluate an expression .BE .SH DESCRIPTION .PP -Concatenates \fIarg\fRs, separated by a space, into an expresion, and evaluates +Concatenates \fIarg\fRs, separated by a space, into an expression, and evaluates that expression, returning its value. The operators permitted in an expression include a subset of the operators permitted in C expressions. For those operators common to both Tcl and C, Tcl applies the same meaning and precedence as the corresponding C operators. -The value of an expressions is often a numeric result, either an integer or a +The value of an expression is often a numeric result, either an integer or a floating-point value, but may also be a non-numeric value. For example, the expression .PP @@ -33,7 +33,7 @@ For example, the expression .PP evaluates to 14.2. Expressions differ from C expressions in the way that -operands are specified. Also, expressions support +operands are specified. Expressions also support non-numeric operands, string comparisons, and some additional operators not found in C. .PP @@ -199,10 +199,10 @@ Logical OR. If both operands are false, the result is 0, or 1 otherwise. If-then-else, as in C. If \fIx\fR is false , the result is the value of \fIy\fR. Otherwise the result is the value of \fIz\fR. .PP -The exponentiation operator promotes types in the same way as the multiply -and divide operators, and the result is is the same as the result of +The exponentiation operator promotes types in the same way that the multiply +and divide operators do, and the result is is the same as the result of \fBpow\fR. -exponentiation groups right-to-left within a precedence level. Other binary +Exponentiation groups right-to-left within a precedence level. Other binary operators group left-to-right. For example, the value of .PP .CS @@ -217,9 +217,9 @@ is 0, while the value of .PP is 512. .PP -\fB&&\fR, \fB||\fR, and \fB?:\fR feature +As in C, \fB&&\fR, \fB||\fR, and \fB?:\fR feature .QW "lazy evaluation" , -just as in C, which means that operands are not evaluated if they are +which means that operands are not evaluated if they are not needed to determine the outcome. For example, in .PP .CS @@ -258,7 +258,7 @@ tcl::mathfunc::sin [\fBexpr\fR {$x+$y}] .CE .PP \fBtcl::mathfunc::sin\fR is resolved as described in -\fBNAMESPACE RESOLUTION\fR in the \fBnamespace\fR documentation. Given the +\fBNAMESPACE RESOLUTION\fR in the \fBnamespace\fR(n) documentation. Given the default value of \fBnamespace path\fR, \fB[namespace current]::tcl::mathfunc::sin\fR or \fB::tcl::mathfunc::sin\fR are the typical resolutions. @@ -288,8 +288,8 @@ Any code that relied on these implicit truncations should instead call \fBint()\fR or \fBwide()\fR, which do truncate. .PP Internal floating-point computations are -performed using the C type \fIdouble\fR. -When converting a string to floating-point, exponent overflow is +performed using the \fIdouble\fR C type. +When converting a string to floating-point value, exponent overflow is detected and results in the \fIdouble\fR value of \fBInf\fR or \fB\-Inf\fR as appropriate. Floating-point overflow and underflow are detected to the degree supported by the hardware, which is generally -- cgit v0.12 From be3376f36c02b2b317b509aed67b7751e656ecbb Mon Sep 17 00:00:00 2001 From: dgp Date: Fri, 7 Oct 2016 18:52:57 +0000 Subject: Update [string map] tests to get illustration of need for pure dict restriction up to date with ordered dicts. --- generic/tclCmdMZ.c | 2 +- tests/string.test | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/generic/tclCmdMZ.c b/generic/tclCmdMZ.c index 885a0bc..5479971 100644 --- a/generic/tclCmdMZ.c +++ b/generic/tclCmdMZ.c @@ -1873,7 +1873,7 @@ StringMapCmd( /* * This test is tricky, but has to be that way or you get other strange - * inconsistencies (see test string-10.20 for illustration why!) + * inconsistencies (see test string-10.20.1 for illustration why!) */ if (objv[objc-2]->typePtr == &tclDictType && objv[objc-2]->bytes == NULL){ diff --git a/tests/string.test b/tests/string.test index 418bc61..5fdb510 100644 --- a/tests/string.test +++ b/tests/string.test @@ -901,6 +901,10 @@ test string-10.20 {string map, dictionaries don't alter map ordering} { set map {aa X a Y} list [string map [dict create aa X a Y] aaa] [string map $map aaa] [dict size $map] [string map $map aaa] } {XY XY 2 XY} +test string-10.20.1 {string map, dictionaries don't alter map ordering} { + set map {a X b Y a Z} + list [string map [dict create a X b Y a Z] aaa] [string map $map aaa] [dict size $map] [string map $map aaa] +} {ZZZ XXX 2 XXX} test string-10.21 {string map, ABR checks} { string map {longstring foob} long } long -- cgit v0.12 From b7a3af751c2791b0659d8fde644ea66d90f58791 Mon Sep 17 00:00:00 2001 From: dkf Date: Sat, 8 Oct 2016 16:38:42 +0000 Subject: [838e99a76d] Ensure that encodings are handled with application/xml and friends. --- library/http/http.tcl | 34 +++++++++++++++++++++++++++++++++- tests/http.test | 7 +++++++ tests/httpd | 4 ++++ 3 files changed, 44 insertions(+), 1 deletion(-) diff --git a/library/http/http.tcl b/library/http/http.tcl index 4c99f62..2975f82 100644 --- a/library/http/http.tcl +++ b/library/http/http.tcl @@ -1019,7 +1019,7 @@ proc http::Event {sock token} { fconfigure $sock -translation binary if { - $state(-binary) || ![string match -nocase text* $state(type)] + $state(-binary) || [IsBinaryContentType $state(type)] } then { # Turn off conversions for non-text data set state(binary) 1 @@ -1161,6 +1161,38 @@ proc http::Event {sock token} { } } +# http::IsBinaryContentType -- +# +# Determine if the content-type means that we should definitely transfer +# the data as binary. [Bug 838e99a76d] +# +# Arguments +# type The content-type of the data. +# +# Results: +# Boolean, true if we definitely should be binary. + +proc http::IsBinaryContentType {type} { + lassign [split [string tolower $type] "/;"] major minor + if {$major eq "text"} { + return false + } + # There's a bunch of XML-as-application-format things about. See RFC 3023 + # and so on. + if {$major eq "application"} { + set minor [string trimright $minor] + if {$minor in {"xml" "xml-external-parsed-entity" "xml-dtd"}} { + return false + } + } + # Not just application/foobar+xml but also image/svg+xml, so let us not + # restrict things for now... + if {[string match "*+xml" $minor]} { + return false + } + return true +} + # http::getTextLine -- # # Get one line with the stream in blocking crlf mode diff --git a/tests/http.test b/tests/http.test index 2fc0a51..322fb36 100644 --- a/tests/http.test +++ b/tests/http.test @@ -132,6 +132,7 @@ set tail /a/b/c set url //[info hostname]:$port/a/b/c set fullurl HTTP://user:pass@[info hostname]:$port/a/b/c set binurl //[info hostname]:$port/binary +set xmlurl //[info hostname]:$port/xml set posturl //[info hostname]:$port/post set badposturl //[info hostname]:$port/droppost set authorityurl //[info hostname]:$port @@ -364,6 +365,12 @@ test http-3.31 {http::geturl fragment without path} -body { } -cleanup { catch { http::cleanup $token } } -result 200 +test http-3.32 {http::geturl application/xml is text} -body { + set token [http::geturl "$xmlurl"] + scan [http::data $token] "<%\[^>]>%c<%\[^>]>" +} -cleanup { + catch { http::cleanup $token } +} -result {test 4660 /test} test http-4.1 {http::Event} { set token [http::geturl $url -keepalive 0] diff --git a/tests/httpd b/tests/httpd index 232e80a..8753912 100644 --- a/tests/httpd +++ b/tests/httpd @@ -171,6 +171,10 @@ proc httpdRespond { sock } { set html "$bindata[info hostname]:$port$data(url)" set type application/octet-stream } + *xml* { + set html [encoding convertto utf-8 "\u1234"] + set type "application/xml;charset=UTF-8" + } *post* { set html "Got [string length $data(query)] bytes" set type text/plain -- cgit v0.12 From 853a65b021ddcacfc6bccd71160cf2fcf925aeff Mon Sep 17 00:00:00 2001 From: dkf Date: Sat, 8 Oct 2016 17:10:02 +0000 Subject: [74bc0e44f5] Document result of [http::unregister]. --- doc/http.n | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/doc/http.n b/doc/http.n index 8aeb286..c6e8983 100644 --- a/doc/http.n +++ b/doc/http.n @@ -369,7 +369,9 @@ set token [::http::geturl https://my.secure.site/] .TP \fB::http::unregister\fR \fIproto\fR This procedure unregisters a protocol handler that was previously -registered via \fB::http::register\fR. +registered via \fB::http::register\fR, returning a two-item list of +the default port and handler command that was previously installed +(via \fB::http::register\fR) if there was such a handler. .SH ERRORS The \fB::http::geturl\fR procedure will raise errors in the following cases: invalid command line options, -- cgit v0.12 From 58165211fc0567001df02564b1b06e64f66c5ab1 Mon Sep 17 00:00:00 2001 From: ferrieux Date: Sun, 9 Oct 2016 10:35:24 +0000 Subject: Be more accurate about scan's %i --- doc/scan.n | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/doc/scan.n b/doc/scan.n index d963d6c..0c24fea 100644 --- a/doc/scan.n +++ b/doc/scan.n @@ -123,9 +123,7 @@ with conversion character \fBu\fR. .TP \fBi\fR . -The input substring must be an integer. The base (i.e. decimal, binary, -octal, or hexadecimal) is determined in the same fashion as described in -\fBexpr\fR. The integer value is stored in the variable, +The input substring must be an integer. The base (i.e. decimal, octal, or hexadecimal) is determined by the C convention (leading 0 for octal; prefix 0x for hexadecimal). The integer value is stored in the variable, truncated as required by the size modifier value. .TP \fBc\fR -- cgit v0.12 From e68205abcae7f231dd47d201507b33330f1406aa Mon Sep 17 00:00:00 2001 From: dkf Date: Sun, 9 Oct 2016 12:03:30 +0000 Subject: Be more accurate about scan's %i --- doc/scan.n | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/doc/scan.n b/doc/scan.n index d963d6c..0c24fea 100644 --- a/doc/scan.n +++ b/doc/scan.n @@ -123,9 +123,7 @@ with conversion character \fBu\fR. .TP \fBi\fR . -The input substring must be an integer. The base (i.e. decimal, binary, -octal, or hexadecimal) is determined in the same fashion as described in -\fBexpr\fR. The integer value is stored in the variable, +The input substring must be an integer. The base (i.e. decimal, octal, or hexadecimal) is determined by the C convention (leading 0 for octal; prefix 0x for hexadecimal). The integer value is stored in the variable, truncated as required by the size modifier value. .TP \fBc\fR -- cgit v0.12 From 1c4fbbc3332e525ff1368d9ba26681d826d2efde Mon Sep 17 00:00:00 2001 From: dkf Date: Sun, 9 Oct 2016 15:21:26 +0000 Subject: [7114ac6141] Improve testing and docs of Tcl_GetInt and Tcl_GetDouble. No behaviour change. --- doc/GetInt.3 | 31 +++++++++++++++++++++++-------- tests/get.test | 22 ++++++++++++++++++++-- 2 files changed, 43 insertions(+), 10 deletions(-) diff --git a/doc/GetInt.3 b/doc/GetInt.3 index 4e9d636..3e7204c 100644 --- a/doc/GetInt.3 +++ b/doc/GetInt.3 @@ -51,27 +51,42 @@ in the interpreter's result, and nothing is stored at *\fIintPtr\fR or *\fIdoublePtr\fR or *\fIboolPtr\fR. .PP \fBTcl_GetInt\fR expects \fIsrc\fR to consist of a collection -of integer digits, optionally signed and optionally preceded by -white space. If the first two characters of \fIsrc\fR +of integer digits, optionally signed and optionally preceded and +followed by white space. If the first two characters of \fIsrc\fR after the optional white space and sign are -.QW 0x +.QW \fB0x\fR then \fIsrc\fR is expected to be in hexadecimal form; otherwise, +if the first such characters are +.QW \fB0o\fR +then \fIsrc\fR is expected to be in octal form; otherwise, +if the first such characters are +.QW \fB0b\fR +then \fIsrc\fR is expected to be in binary form; otherwise, if the first such character is -.QW 0 +.QW \fB0\fR then \fIsrc\fR is expected to be in octal form; otherwise, \fIsrc\fR is expected to be in decimal form. .PP \fBTcl_GetDouble\fR expects \fIsrc\fR to consist of a floating-point number, which is: white space; a sign; a sequence of digits; a -decimal point; a sequence of digits; the letter -.QW e ; +decimal point +.QW \fB.\fR ; +a sequence of digits; the letter +.QW \fBe\fR ; a signed decimal exponent; and more white space. Any of the fields may be omitted, except that the digits either before or after the decimal point must be present and if the -.QW e -is present then it must be followed by the exponent number. +.QW \fBe\fR +is present then it must be followed by the exponent number. If there +are no fields apart from the sign and initial sequence of digits +(i.e., no decimal point or exponent indicator), that +initial sequence of digits should take one of the forms that +\fBTcl_GetInt\fR supports, described above. The use of +.QW \fB,\fR +as a decimal point is not supported nor should any other sort of +inter-digit separator be present. .PP \fBTcl_GetBoolean\fR expects \fIsrc\fR to specify a boolean value. If \fIsrc\fR is any of \fB0\fR, \fBfalse\fR, diff --git a/tests/get.test b/tests/get.test index d51ec6d..7aa06c1 100644 --- a/tests/get.test +++ b/tests/get.test @@ -19,9 +19,10 @@ if {[lsearch [namespace children] ::tcltest] == -1} { catch [list package require -exact Tcltest [info patchlevel]] testConstraint testgetint [llength [info commands testgetint]] +testConstraint testdoubleobj [llength [info commands testdoubleobj]] testConstraint longIs32bit [expr {int(0x80000000) < 0}] testConstraint longIs64bit [expr {int(0x8000000000000000) < 0}] - + test get-1.1 {Tcl_GetInt procedure} testgetint { testgetint 44 { 22} } {66} @@ -95,7 +96,24 @@ test get-3.2 {Tcl_GetDouble(FromObj), bad numbers} { } set result } {0 1 0 1 1 {expected floating-point number but got "++1.0"} 1 {expected floating-point number but got "+-1.0"} 1 {expected floating-point number but got "-+1.0"} 0 -1 1 {expected floating-point number but got "--1.0"} 1 {expected floating-point number but got "- +1.0"}} - +# Bug 7114ac6141 +test get-3.3 {tcl_GetInt with iffy numbers} testgetint { + lmap x {0 " 0" "0 " " 0 " " 0xa " " 010 " " 0o10 " " 0b10 "} { + catch {testgetint 44 $x} x + set x + } +} {44 44 44 44 54 52 52 46} +test get-3.4 {Tcl_GetDouble with iffy numbers} testdoubleobj { + lmap x {0 0.0 " .0" ".0 " " 0e0 " "09" "- 0" "-0" "0o12" "0b10"} { + catch {testdoubleobj set 1 $x} x + set x + } +} {0.0 0.0 0.0 0.0 0.0 {expected floating-point number but got "09" (looks like invalid octal number)} {expected floating-point number but got "- 0"} 0.0 10.0 2.0} + # cleanup ::tcltest::cleanupTests return + +# Local Variables: +# mode: tcl +# End: -- cgit v0.12 From 30167250619d18f94b8b003d07734e58d8777f87 Mon Sep 17 00:00:00 2001 From: dkf Date: Sun, 9 Oct 2016 16:01:53 +0000 Subject: [62b36e326c] Noted edge case in behaviour of [concat] with empty arguments. --- doc/concat.n | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/concat.n b/doc/concat.n index 252f52c..f68a06e 100644 --- a/doc/concat.n +++ b/doc/concat.n @@ -21,6 +21,7 @@ This command joins each of its arguments together with spaces after trimming leading and trailing white-space from each of them. If all the arguments are lists, this has the same effect as concatenating them into a single list. +Arguments that are empty (after trimming) are ignored entirely. It permits any number of arguments; if no \fIarg\fRs are supplied, the result is an empty string. .SH EXAMPLES -- cgit v0.12 From c20fffb1c16d1b8a7ed25de25f292df6297d176f Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Tue, 11 Oct 2016 21:35:27 +0000 Subject: Fix [3cc1d91345]: duplicate calls to TclpFreeAllocCache() on thread exists --- unix/tclUnixInit.c | 2 +- unix/tclUnixThrd.c | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/unix/tclUnixInit.c b/unix/tclUnixInit.c index a8cd00d..a873f6e 100644 --- a/unix/tclUnixInit.c +++ b/unix/tclUnixInit.c @@ -833,7 +833,7 @@ TclpSetVariables( CFLocaleRef localeRef; - if (CFLocaleCopyCurrent != NULL && CFLocaleGetIdentifier != NULL && + if (&CFLocaleCopyCurrent != NULL && &CFLocaleGetIdentifier != NULL && (localeRef = CFLocaleCopyCurrent())) { CFStringRef locale = CFLocaleGetIdentifier(localeRef); diff --git a/unix/tclUnixThrd.c b/unix/tclUnixThrd.c index a7a294d..1841242 100644 --- a/unix/tclUnixThrd.c +++ b/unix/tclUnixThrd.c @@ -810,7 +810,8 @@ TclpFreeAllocCache( { if (ptr != NULL) { /* - * Called by the pthread lib when a thread exits + * Called by TclFinalizeThreadAllocThread() during the thread + * finalization initiated from Tcl_FinalizeThread() */ TclFreeAllocCache(ptr); @@ -818,7 +819,7 @@ TclpFreeAllocCache( } else if (initialized) { /* - * Called by us in TclFinalizeThreadAlloc() during the library + * Called by TclFinalizeThreadAlloc() during the process * finalization initiated from Tcl_Finalize() */ @@ -833,7 +834,7 @@ TclpGetAllocCache(void) if (!initialized) { pthread_mutex_lock(allocLockPtr); if (!initialized) { - pthread_key_create(&key, TclpFreeAllocCache); + pthread_key_create(&key, NULL); initialized = 1; } pthread_mutex_unlock(allocLockPtr); -- cgit v0.12 From 2b3a9ba90da9d322fea0de66b8c59427a69b4ec2 Mon Sep 17 00:00:00 2001 From: dkf Date: Wed, 12 Oct 2016 09:57:15 +0000 Subject: [74bc0e44f5] Doc tweak. --- doc/http.n | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/doc/http.n b/doc/http.n index c6e8983..26f1298 100644 --- a/doc/http.n +++ b/doc/http.n @@ -371,7 +371,8 @@ set token [::http::geturl https://my.secure.site/] This procedure unregisters a protocol handler that was previously registered via \fB::http::register\fR, returning a two-item list of the default port and handler command that was previously installed -(via \fB::http::register\fR) if there was such a handler. +(via \fB::http::register\fR) if there was such a handler, and an error if +there was no such handler. .SH ERRORS The \fB::http::geturl\fR procedure will raise errors in the following cases: invalid command line options, -- cgit v0.12 From bd297e53d9c852c7011018a23ac73ecd1ab0a76a Mon Sep 17 00:00:00 2001 From: dgp Date: Wed, 12 Oct 2016 13:31:07 +0000 Subject: [be003d570f] TclParseNumber() failed to fully implement TCL_PARSE_OCTAL_ONLY. --- generic/tclStrToD.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/generic/tclStrToD.c b/generic/tclStrToD.c index d05fe5d..b89ce45 100644 --- a/generic/tclStrToD.c +++ b/generic/tclStrToD.c @@ -589,6 +589,9 @@ TclParseNumber( acceptPoint = p; acceptLen = len; if (c == 'x' || c == 'X') { + if (flags & TCL_PARSE_OCTAL_ONLY) { + goto endgame; + } state = ZERO_X; break; } @@ -599,6 +602,9 @@ TclParseNumber( goto zeroo; } if (c == 'b' || c == 'B') { + if (flags & TCL_PARSE_OCTAL_ONLY) { + goto endgame; + } state = ZERO_B; break; } -- cgit v0.12 From 88bcb2bce724073d31acb1aa04d9f630b469e576 Mon Sep 17 00:00:00 2001 From: dgp Date: Wed, 12 Oct 2016 13:38:28 +0000 Subject: Add a test too. --- tests/scan.test | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/scan.test b/tests/scan.test index 109746f..68c44b0 100644 --- a/tests/scan.test +++ b/tests/scan.test @@ -439,6 +439,9 @@ test scan-5.13 {integer scanning and overflow} { test scan-5.14 {integer scanning} { scan 0xff %u } 0 +test scan-5.15 {Bug be003d570f} { + scan 0x40 %o +} 0 test scan-6.1 {floating-point scanning} { set a {}; set b {}; set c {}; set d {} -- cgit v0.12 From 915c9e49675d816fa2018e7b3b35903264bfffb4 Mon Sep 17 00:00:00 2001 From: dgp Date: Wed, 12 Oct 2016 13:46:14 +0000 Subject: [be003d570f] TclParseNumber() failed to fully implement TCL_PARSE_BINARY_ONLY. --- generic/tclStrToD.c | 2 +- tests/scan.test | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/generic/tclStrToD.c b/generic/tclStrToD.c index dc85124..6da6df3 100644 --- a/generic/tclStrToD.c +++ b/generic/tclStrToD.c @@ -630,7 +630,7 @@ TclParseNumber( acceptPoint = p; acceptLen = len; if (c == 'x' || c == 'X') { - if (flags & TCL_PARSE_OCTAL_ONLY) { + if (flags & (TCL_PARSE_OCTAL_ONLY|TCL_PARSE_BINARY_ONLY)) { goto endgame; } state = ZERO_X; diff --git a/tests/scan.test b/tests/scan.test index d814ce9..7540c9c 100644 --- a/tests/scan.test +++ b/tests/scan.test @@ -538,6 +538,9 @@ test scan-5.14 {integer scanning} { test scan-5.15 {Bug be003d570f} { scan 0x40 %o } 0 +test scan-5.16 {Bug be003d570f} { + scan 0x40 %b +} 0 test scan-6.1 {floating-point scanning} -setup { set a {}; set b {}; set c {}; set d {} -- cgit v0.12 From 61df5f46580699c45d9263e3e98a0cf3f2006672 Mon Sep 17 00:00:00 2001 From: dgp Date: Thu, 13 Oct 2016 15:37:45 +0000 Subject: Streamline the substring copying case of [string replace] bytecode execution. --- generic/tclExecute.c | 66 ++++++++++++++++++---------------------------------- 1 file changed, 23 insertions(+), 43 deletions(-) diff --git a/generic/tclExecute.c b/generic/tclExecute.c index 34d92d3..cd27f6b 100644 --- a/generic/tclExecute.c +++ b/generic/tclExecute.c @@ -5804,57 +5804,37 @@ TEBCresume( * Remove substring using copying. */ - if (length3 == 0) { - if (fromIdx > 0) { - objResultPtr = Tcl_NewUnicodeObj(ustring1, fromIdx); - if (toIdx < length) { - Tcl_AppendUnicodeToObj(objResultPtr, ustring1 + toIdx + 1, - length - toIdx); - } - } else { - objResultPtr = Tcl_NewUnicodeObj(ustring1 + toIdx + 1, - length - toIdx); - } - TclDecrRefCount(value3Ptr); - TRACE_APPEND(("\"%.30s\"\n", O2S(objResultPtr))); - NEXT_INST_F(1, 1, 1); - } - - /* - * Splice string pieces by full copying. - */ - + objResultPtr = NULL; if (fromIdx > 0) { objResultPtr = Tcl_NewUnicodeObj(ustring1, fromIdx); - Tcl_AppendObjToObj(objResultPtr, value3Ptr); - if (toIdx < length) { - Tcl_AppendUnicodeToObj(objResultPtr, ustring1 + toIdx + 1, - length - toIdx); + } + if (length3 > 0) { + if (objResultPtr) { + Tcl_AppendObjToObj(objResultPtr, value3Ptr); + } else if (Tcl_IsShared(value3Ptr)) { + objResultPtr = Tcl_DuplicateObj(value3Ptr); + } else { + objResultPtr = value3Ptr; } - } else if (Tcl_IsShared(value3Ptr)) { - objResultPtr = Tcl_DuplicateObj(value3Ptr); - if (toIdx < length) { + } + if (toIdx < length) { + if (objResultPtr) { Tcl_AppendUnicodeToObj(objResultPtr, ustring1 + toIdx + 1, length - toIdx); - } - } else { - /* - * Be careful with splicing the stack in this case; we have a - * refCount:1 object in value3Ptr and we want to append to it and - * make it be the refCount:1 object at the top of the stack - * afterwards. [Bug 82e7f67325] - */ - - if (toIdx < length) { - Tcl_AppendUnicodeToObj(value3Ptr, ustring1 + toIdx + 1, + } else { + objResultPtr = Tcl_NewUnicodeObj(ustring1 + toIdx + 1, length - toIdx); } - TRACE_APPEND(("\"%.30s\"\n", O2S(value3Ptr))); - TclDecrRefCount(valuePtr); - OBJ_AT_TOS = value3Ptr; /* Tricky! */ - NEXT_INST_F(1, 0, 0); } - TclDecrRefCount(value3Ptr); + if (objResultPtr == NULL) { + /* This has to be the case [string replace $s 0 end {}] */ + /* which has result {} which is same as value3Ptr. */ + objResultPtr = value3Ptr; + } + if (objResultPtr != value3Ptr) { + /* See [Bug 82e7f67325] */ + TclDecrRefCount(value3Ptr); + } TRACE_APPEND(("\"%.30s\"\n", O2S(objResultPtr))); NEXT_INST_F(1, 1, 1); -- cgit v0.12 From dca9bb39489c9c228b3c1ccc6019e3cee3699c7a Mon Sep 17 00:00:00 2001 From: dgp Date: Thu, 13 Oct 2016 16:43:05 +0000 Subject: Stop invading the String internals to work around a bug. Fix it instead. --- generic/tclExecute.c | 13 ------------- generic/tclStringObj.c | 10 ++++++++++ 2 files changed, 10 insertions(+), 13 deletions(-) diff --git a/generic/tclExecute.c b/generic/tclExecute.c index cd27f6b..56e3f72 100644 --- a/generic/tclExecute.c +++ b/generic/tclExecute.c @@ -19,7 +19,6 @@ #include "tclCompile.h" #include "tclOOInt.h" #include "tommath.h" -#include "tclStringRep.h" #include #include @@ -5744,16 +5743,6 @@ TEBCresume( if (length3 - 1 == toIdx - fromIdx) { unsigned char *bytes1, *bytes2; - /* - * Flush the info in the string internal rep that refers to the - * about-to-be-invalidated UTF-8 rep. This indicates that a new - * buffer needs to be allocated, and assumes that the value is - * already of tclStringTypePtr type, which should be true provided - * we call it after Tcl_GetUnicodeFromObj. - */ -#define MarkStringInternalRepForFlush(objPtr) \ - (GET_STRING(objPtr)->allocated = 0) - if (Tcl_IsShared(valuePtr)) { objResultPtr = Tcl_DuplicateObj(valuePtr); if (TclIsPureByteArray(objResultPtr) @@ -5766,7 +5755,6 @@ TEBCresume( ustring2 = Tcl_GetUnicodeFromObj(value3Ptr, NULL); memcpy(ustring1 + fromIdx, ustring2, length3 * sizeof(Tcl_UniChar)); - MarkStringInternalRepForFlush(objResultPtr); } Tcl_InvalidateStringRep(objResultPtr); TclDecrRefCount(value3Ptr); @@ -5783,7 +5771,6 @@ TEBCresume( ustring2 = Tcl_GetUnicodeFromObj(value3Ptr, NULL); memcpy(ustring1 + fromIdx, ustring2, length3 * sizeof(Tcl_UniChar)); - MarkStringInternalRepForFlush(valuePtr); } Tcl_InvalidateStringRep(valuePtr); TclDecrRefCount(value3Ptr); diff --git a/generic/tclStringObj.c b/generic/tclStringObj.c index 11a57e9..60b08ae 100644 --- a/generic/tclStringObj.c +++ b/generic/tclStringObj.c @@ -3025,6 +3025,16 @@ UpdateStringOfString( { String *stringPtr = GET_STRING(objPtr); + /* + * This routine is only called when we need to generate the + * string rep objPtr->bytes because it does not exist -- it is NULL. + * In that circumstance, any lingering claim about the size of + * memory pointed to by that NULL pointer is clearly bogus, and + * needs a reset. + */ + + stringPtr->allocated = 0; + if (stringPtr->numChars == 0) { TclInitStringRep(objPtr, tclEmptyStringRep, 0); } else { -- cgit v0.12 From 23b011c32d44c8182e0a04316704b590bd2920dd Mon Sep 17 00:00:00 2001 From: dgp Date: Thu, 13 Oct 2016 16:50:06 +0000 Subject: Another streamline. --- generic/tclExecute.c | 48 +++++++++++++++++++----------------------------- 1 file changed, 19 insertions(+), 29 deletions(-) diff --git a/generic/tclExecute.c b/generic/tclExecute.c index 56e3f72..e7ff8dc 100644 --- a/generic/tclExecute.c +++ b/generic/tclExecute.c @@ -5745,37 +5745,27 @@ TEBCresume( if (Tcl_IsShared(valuePtr)) { objResultPtr = Tcl_DuplicateObj(valuePtr); - if (TclIsPureByteArray(objResultPtr) - && TclIsPureByteArray(value3Ptr)) { - bytes1 = Tcl_GetByteArrayFromObj(objResultPtr, NULL); - bytes2 = Tcl_GetByteArrayFromObj(value3Ptr, NULL); - memcpy(bytes1 + fromIdx, bytes2, length3); - } else { - ustring1 = Tcl_GetUnicodeFromObj(objResultPtr, NULL); - ustring2 = Tcl_GetUnicodeFromObj(value3Ptr, NULL); - memcpy(ustring1 + fromIdx, ustring2, - length3 * sizeof(Tcl_UniChar)); - } - Tcl_InvalidateStringRep(objResultPtr); - TclDecrRefCount(value3Ptr); - TRACE_APPEND(("\"%.30s\"\n", O2S(objResultPtr))); - NEXT_INST_F(1, 1, 1); } else { - if (TclIsPureByteArray(valuePtr) - && TclIsPureByteArray(value3Ptr)) { - bytes1 = Tcl_GetByteArrayFromObj(valuePtr, NULL); - bytes2 = Tcl_GetByteArrayFromObj(value3Ptr, NULL); - memcpy(bytes1 + fromIdx, bytes2, length3); - } else { - ustring1 = Tcl_GetUnicodeFromObj(valuePtr, NULL); - ustring2 = Tcl_GetUnicodeFromObj(value3Ptr, NULL); - memcpy(ustring1 + fromIdx, ustring2, - length3 * sizeof(Tcl_UniChar)); - } - Tcl_InvalidateStringRep(valuePtr); - TclDecrRefCount(value3Ptr); - TRACE_APPEND(("\"%.30s\"\n", O2S(valuePtr))); + objResultPtr = valuePtr; + } + if (TclIsPureByteArray(objResultPtr) + && TclIsPureByteArray(value3Ptr)) { + bytes1 = Tcl_GetByteArrayFromObj(objResultPtr, NULL); + bytes2 = Tcl_GetByteArrayFromObj(value3Ptr, NULL); + memcpy(bytes1 + fromIdx, bytes2, length3); + } else { + ustring1 = Tcl_GetUnicodeFromObj(objResultPtr, NULL); + ustring2 = Tcl_GetUnicodeFromObj(value3Ptr, NULL); + memcpy(ustring1 + fromIdx, ustring2, + length3 * sizeof(Tcl_UniChar)); + } + Tcl_InvalidateStringRep(objResultPtr); + TclDecrRefCount(value3Ptr); + TRACE_APPEND(("\"%.30s\"\n", O2S(objResultPtr))); + if (objResultPtr == valuePtr) { NEXT_INST_F(1, 0, 0); + } else { + NEXT_INST_F(1, 1, 1); } } -- cgit v0.12 From d3c6e22da28dddf8b1f028900647c9221ffcd64a Mon Sep 17 00:00:00 2001 From: dgp Date: Fri, 14 Oct 2016 19:28:46 +0000 Subject: [eb6b68c1a9] Simple fix for [string replace] error demonstrated by new test. --- generic/tclExecute.c | 11 ----------- tests/stringComp.test | 3 +++ 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/generic/tclExecute.c b/generic/tclExecute.c index e7ff8dc..2ab0277 100644 --- a/generic/tclExecute.c +++ b/generic/tclExecute.c @@ -5724,17 +5724,6 @@ TEBCresume( length3 = Tcl_GetCharLength(value3Ptr); /* - * Remove substring. In-place. - */ - - if (length3 == 0 && !Tcl_IsShared(valuePtr) && toIdx == length) { - TclDecrRefCount(value3Ptr); - Tcl_SetObjLength(valuePtr, fromIdx); - TRACE_APPEND(("\"%.30s\"\n", O2S(valuePtr))); - NEXT_INST_F(1, 0, 0); - } - - /* * See if we can splice in place. This happens when the number of * characters being replaced is the same as the number of characters * in the string to be inserted. diff --git a/tests/stringComp.test b/tests/stringComp.test index 140a270..2aeb08e 100644 --- a/tests/stringComp.test +++ b/tests/stringComp.test @@ -738,6 +738,9 @@ test stringComp-14.4 {Bug 1af8de570511} { string replace $val[unset val] 1 1 $y }} 4 x } 0x00 +test stringComp-14.5 {} { + string length [string replace [string repeat a\u00fe 2] 3 end {}] +} 3 ## string tolower ## not yet bc -- cgit v0.12 From 2f570b44ce96781099a36c1e8a084cb69cb4862f Mon Sep 17 00:00:00 2001 From: dgp Date: Tue, 18 Oct 2016 19:16:35 +0000 Subject: Use memcmp where possible. --- generic/tclCmdMZ.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/generic/tclCmdMZ.c b/generic/tclCmdMZ.c index 5479971..591e31c 100644 --- a/generic/tclCmdMZ.c +++ b/generic/tclCmdMZ.c @@ -1242,8 +1242,8 @@ StringFirstCmd( * Scan forward to find the first character. */ - if ((*p == *needleStr) && (TclUniCharNcmp(needleStr, p, - (unsigned long) needleLen) == 0)) { + if ((*p == *needleStr) && (memcmp(needleStr, p, + sizeof(Tcl_UniChar) * (size_t)needleLen) == 0)) { match = p - haystackStr; break; } -- cgit v0.12 From d7ad9bc43170b443a5c667ad0338873cebda5ced Mon Sep 17 00:00:00 2001 From: dgp Date: Thu, 20 Oct 2016 17:54:47 +0000 Subject: EVIL HACKs are bad. Unnecessary ones are intolerable. Bad tests cause trouble. --- generic/tclCompCmds.c | 11 ----------- tests/format.test | 7 +++++-- 2 files changed, 5 insertions(+), 13 deletions(-) diff --git a/generic/tclCompCmds.c b/generic/tclCompCmds.c index 3ab03cc..7dba232 100644 --- a/generic/tclCompCmds.c +++ b/generic/tclCompCmds.c @@ -3206,17 +3206,6 @@ TclCompileFormatCmd( */ TclEmitInstInt1(INST_STR_CONCAT1, i, envPtr); - } else { - /* - * EVIL HACK! Force there to be a string representation in the case - * where there's just a "%s" in the format; case covered by the test - * format-20.1 (and it is horrible...) - */ - - TclEmitOpcode(INST_DUP, envPtr); - PushStringLiteral(envPtr, ""); - TclEmitOpcode(INST_STR_EQ, envPtr); - TclEmitOpcode(INST_POP, envPtr); } return TCL_OK; } diff --git a/tests/format.test b/tests/format.test index 27eac31..e199398 100644 --- a/tests/format.test +++ b/tests/format.test @@ -564,9 +564,12 @@ test format-19.3 {Bug 2830354} { test format-20.1 {Bug 2932421: plain %s caused intrep change of args} -body { set x [dict create a b c d] format %s $x - # After this, obj in $x should be a dict with a non-NULL bytes field + # After this, obj in $x should be a dict + # We are testing to make sure it has not been shimmered to a + # different intrep when that is not necessary. + # Whether or not there is a string rep - we should not care! tcl::unsupported::representation $x -} -match glob -result {value is a dict with *, string representation "*"} +} -match glob -result {value is a dict *} # cleanup catch {unset a} -- cgit v0.12 From 2ab238514bcdab640de8b1805337200932e2cd79 Mon Sep 17 00:00:00 2001 From: dgp Date: Thu, 20 Oct 2016 20:02:19 +0000 Subject: Repair recently opened memleak. --- generic/tclExecute.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/generic/tclExecute.c b/generic/tclExecute.c index 2ab0277..b9ef582 100644 --- a/generic/tclExecute.c +++ b/generic/tclExecute.c @@ -5797,10 +5797,14 @@ TEBCresume( /* which has result {} which is same as value3Ptr. */ objResultPtr = value3Ptr; } - if (objResultPtr != value3Ptr) { + if (objResultPtr == value3Ptr) { /* See [Bug 82e7f67325] */ - TclDecrRefCount(value3Ptr); + TclDecrRefCount(OBJ_AT_TOS); + OBJ_AT_TOS = value3Ptr; + TRACE_APPEND(("\"%.30s\"\n", O2S(value3Ptr))); + NEXT_INST_F(1, 0, 0); } + TclDecrRefCount(value3Ptr); TRACE_APPEND(("\"%.30s\"\n", O2S(objResultPtr))); NEXT_INST_F(1, 1, 1); -- cgit v0.12 From 84a8c8047b4c22b4b2ff8db0695a568676068ada Mon Sep 17 00:00:00 2001 From: venkat Date: Wed, 26 Oct 2016 08:03:17 +0000 Subject: Update timezone data to tzdata2016h from IETF --- library/tzdata/Asia/Colombo | 14 ++-- library/tzdata/Asia/Gaza | 168 ++++++++++++++++++++--------------------- library/tzdata/Asia/Hebron | 168 ++++++++++++++++++++--------------------- library/tzdata/Europe/Istanbul | 22 +++--- 4 files changed, 186 insertions(+), 186 deletions(-) diff --git a/library/tzdata/Asia/Colombo b/library/tzdata/Asia/Colombo index ca7bffc..7a14a9b 100644 --- a/library/tzdata/Asia/Colombo +++ b/library/tzdata/Asia/Colombo @@ -3,11 +3,11 @@ set TZData(:Asia/Colombo) { {-9223372036854775808 19164 0 LMT} {-2840159964 19172 0 MMT} - {-2019705572 19800 0 IST} - {-883287000 21600 1 IHST} - {-862639200 23400 1 IST} - {-764051400 19800 0 IST} - {832962600 23400 0 LKT} - {846266400 21600 0 LKT} - {1145039400 19800 0 IST} + {-2019705572 19800 0 +0530} + {-883287000 21600 1 +06} + {-862639200 23400 1 +0630} + {-764051400 19800 0 +0530} + {832962600 23400 0 +0630} + {846266400 21600 0 +06} + {1145039400 19800 0 +0530} } diff --git a/library/tzdata/Asia/Gaza b/library/tzdata/Asia/Gaza index 6adfe6d..ab53317 100644 --- a/library/tzdata/Asia/Gaza +++ b/library/tzdata/Asia/Gaza @@ -108,171 +108,171 @@ set TZData(:Asia/Gaza) { {1427493600 10800 1 EEST} {1445547600 7200 0 EET} {1458946800 10800 1 EEST} - {1476997200 7200 0 EET} + {1477692000 7200 0 EET} {1490396400 10800 1 EEST} - {1509051600 7200 0 EET} + {1509141600 7200 0 EET} {1522450800 10800 1 EEST} - {1540501200 7200 0 EET} + {1540591200 7200 0 EET} {1553900400 10800 1 EEST} - {1571950800 7200 0 EET} + {1572040800 7200 0 EET} {1585350000 10800 1 EEST} - {1603400400 7200 0 EET} + {1604095200 7200 0 EET} {1616799600 10800 1 EEST} - {1634850000 7200 0 EET} + {1635544800 7200 0 EET} {1648249200 10800 1 EEST} - {1666299600 7200 0 EET} + {1666994400 7200 0 EET} {1679698800 10800 1 EEST} - {1698354000 7200 0 EET} + {1698444000 7200 0 EET} {1711753200 10800 1 EEST} - {1729803600 7200 0 EET} + {1729893600 7200 0 EET} {1743202800 10800 1 EEST} - {1761253200 7200 0 EET} + {1761343200 7200 0 EET} {1774652400 10800 1 EEST} - {1792702800 7200 0 EET} + {1793397600 7200 0 EET} {1806102000 10800 1 EEST} - {1824152400 7200 0 EET} + {1824847200 7200 0 EET} {1837551600 10800 1 EEST} - {1856206800 7200 0 EET} + {1856296800 7200 0 EET} {1869606000 10800 1 EEST} - {1887656400 7200 0 EET} + {1887746400 7200 0 EET} {1901055600 10800 1 EEST} - {1919106000 7200 0 EET} + {1919196000 7200 0 EET} {1932505200 10800 1 EEST} - {1950555600 7200 0 EET} + {1950645600 7200 0 EET} {1963954800 10800 1 EEST} - {1982005200 7200 0 EET} + {1982700000 7200 0 EET} {1995404400 10800 1 EEST} - {2013454800 7200 0 EET} + {2014149600 7200 0 EET} {2026854000 10800 1 EEST} - {2045509200 7200 0 EET} + {2045599200 7200 0 EET} {2058908400 10800 1 EEST} - {2076958800 7200 0 EET} + {2077048800 7200 0 EET} {2090358000 10800 1 EEST} - {2108408400 7200 0 EET} + {2108498400 7200 0 EET} {2121807600 10800 1 EEST} - {2139858000 7200 0 EET} + {2140552800 7200 0 EET} {2153257200 10800 1 EEST} - {2171307600 7200 0 EET} + {2172002400 7200 0 EET} {2184706800 10800 1 EEST} - {2202757200 7200 0 EET} + {2203452000 7200 0 EET} {2216761200 10800 1 EEST} - {2234811600 7200 0 EET} + {2234901600 7200 0 EET} {2248210800 10800 1 EEST} - {2266261200 7200 0 EET} + {2266351200 7200 0 EET} {2279660400 10800 1 EEST} - {2297710800 7200 0 EET} + {2297800800 7200 0 EET} {2311110000 10800 1 EEST} - {2329160400 7200 0 EET} + {2329855200 7200 0 EET} {2342559600 10800 1 EEST} - {2360610000 7200 0 EET} + {2361304800 7200 0 EET} {2374009200 10800 1 EEST} - {2392664400 7200 0 EET} + {2392754400 7200 0 EET} {2406063600 10800 1 EEST} - {2424114000 7200 0 EET} + {2424204000 7200 0 EET} {2437513200 10800 1 EEST} - {2455563600 7200 0 EET} + {2455653600 7200 0 EET} {2468962800 10800 1 EEST} - {2487013200 7200 0 EET} + {2487708000 7200 0 EET} {2500412400 10800 1 EEST} - {2518462800 7200 0 EET} + {2519157600 7200 0 EET} {2531862000 10800 1 EEST} - {2549912400 7200 0 EET} + {2550607200 7200 0 EET} {2563311600 10800 1 EEST} - {2581966800 7200 0 EET} + {2582056800 7200 0 EET} {2595366000 10800 1 EEST} - {2613416400 7200 0 EET} + {2613506400 7200 0 EET} {2626815600 10800 1 EEST} - {2644866000 7200 0 EET} + {2644956000 7200 0 EET} {2658265200 10800 1 EEST} - {2676315600 7200 0 EET} + {2677010400 7200 0 EET} {2689714800 10800 1 EEST} - {2707765200 7200 0 EET} + {2708460000 7200 0 EET} {2721164400 10800 1 EEST} - {2739819600 7200 0 EET} + {2739909600 7200 0 EET} {2753218800 10800 1 EEST} - {2771269200 7200 0 EET} + {2771359200 7200 0 EET} {2784668400 10800 1 EEST} - {2802718800 7200 0 EET} + {2802808800 7200 0 EET} {2816118000 10800 1 EEST} - {2834168400 7200 0 EET} + {2834258400 7200 0 EET} {2847567600 10800 1 EEST} - {2865618000 7200 0 EET} + {2866312800 7200 0 EET} {2879017200 10800 1 EEST} - {2897067600 7200 0 EET} + {2897762400 7200 0 EET} {2910466800 10800 1 EEST} - {2929122000 7200 0 EET} + {2929212000 7200 0 EET} {2942521200 10800 1 EEST} - {2960571600 7200 0 EET} + {2960661600 7200 0 EET} {2973970800 10800 1 EEST} - {2992021200 7200 0 EET} + {2992111200 7200 0 EET} {3005420400 10800 1 EEST} - {3023470800 7200 0 EET} + {3024165600 7200 0 EET} {3036870000 10800 1 EEST} - {3054920400 7200 0 EET} + {3055615200 7200 0 EET} {3068319600 10800 1 EEST} - {3086370000 7200 0 EET} + {3087064800 7200 0 EET} {3100374000 10800 1 EEST} - {3118424400 7200 0 EET} + {3118514400 7200 0 EET} {3131823600 10800 1 EEST} - {3149874000 7200 0 EET} + {3149964000 7200 0 EET} {3163273200 10800 1 EEST} - {3181323600 7200 0 EET} + {3181413600 7200 0 EET} {3194722800 10800 1 EEST} - {3212773200 7200 0 EET} + {3213468000 7200 0 EET} {3226172400 10800 1 EEST} - {3244222800 7200 0 EET} + {3244917600 7200 0 EET} {3257622000 10800 1 EEST} - {3276277200 7200 0 EET} + {3276367200 7200 0 EET} {3289676400 10800 1 EEST} - {3307726800 7200 0 EET} + {3307816800 7200 0 EET} {3321126000 10800 1 EEST} - {3339176400 7200 0 EET} + {3339266400 7200 0 EET} {3352575600 10800 1 EEST} - {3370626000 7200 0 EET} + {3371320800 7200 0 EET} {3384025200 10800 1 EEST} - {3402075600 7200 0 EET} + {3402770400 7200 0 EET} {3415474800 10800 1 EEST} - {3433525200 7200 0 EET} + {3434220000 7200 0 EET} {3446924400 10800 1 EEST} - {3465579600 7200 0 EET} + {3465669600 7200 0 EET} {3478978800 10800 1 EEST} - {3497029200 7200 0 EET} + {3497119200 7200 0 EET} {3510428400 10800 1 EEST} - {3528478800 7200 0 EET} + {3528568800 7200 0 EET} {3541878000 10800 1 EEST} - {3559928400 7200 0 EET} + {3560623200 7200 0 EET} {3573327600 10800 1 EEST} - {3591378000 7200 0 EET} + {3592072800 7200 0 EET} {3604777200 10800 1 EEST} - {3623432400 7200 0 EET} + {3623522400 7200 0 EET} {3636831600 10800 1 EEST} - {3654882000 7200 0 EET} + {3654972000 7200 0 EET} {3668281200 10800 1 EEST} - {3686331600 7200 0 EET} + {3686421600 7200 0 EET} {3699730800 10800 1 EEST} - {3717781200 7200 0 EET} + {3717871200 7200 0 EET} {3731180400 10800 1 EEST} - {3749230800 7200 0 EET} + {3749925600 7200 0 EET} {3762630000 10800 1 EEST} - {3780680400 7200 0 EET} + {3781375200 7200 0 EET} {3794079600 10800 1 EEST} - {3812734800 7200 0 EET} + {3812824800 7200 0 EET} {3826134000 10800 1 EEST} - {3844184400 7200 0 EET} + {3844274400 7200 0 EET} {3857583600 10800 1 EEST} - {3875634000 7200 0 EET} + {3875724000 7200 0 EET} {3889033200 10800 1 EEST} - {3907083600 7200 0 EET} + {3907778400 7200 0 EET} {3920482800 10800 1 EEST} - {3938533200 7200 0 EET} + {3939228000 7200 0 EET} {3951932400 10800 1 EEST} - {3969982800 7200 0 EET} + {3970677600 7200 0 EET} {3983986800 10800 1 EEST} - {4002037200 7200 0 EET} + {4002127200 7200 0 EET} {4015436400 10800 1 EEST} - {4033486800 7200 0 EET} + {4033576800 7200 0 EET} {4046886000 10800 1 EEST} - {4064936400 7200 0 EET} + {4065026400 7200 0 EET} {4078335600 10800 1 EEST} - {4096386000 7200 0 EET} + {4097080800 7200 0 EET} } diff --git a/library/tzdata/Asia/Hebron b/library/tzdata/Asia/Hebron index 2db45f2..c9f94f2 100644 --- a/library/tzdata/Asia/Hebron +++ b/library/tzdata/Asia/Hebron @@ -107,171 +107,171 @@ set TZData(:Asia/Hebron) { {1427493600 10800 1 EEST} {1445547600 7200 0 EET} {1458946800 10800 1 EEST} - {1476997200 7200 0 EET} + {1477692000 7200 0 EET} {1490396400 10800 1 EEST} - {1509051600 7200 0 EET} + {1509141600 7200 0 EET} {1522450800 10800 1 EEST} - {1540501200 7200 0 EET} + {1540591200 7200 0 EET} {1553900400 10800 1 EEST} - {1571950800 7200 0 EET} + {1572040800 7200 0 EET} {1585350000 10800 1 EEST} - {1603400400 7200 0 EET} + {1604095200 7200 0 EET} {1616799600 10800 1 EEST} - {1634850000 7200 0 EET} + {1635544800 7200 0 EET} {1648249200 10800 1 EEST} - {1666299600 7200 0 EET} + {1666994400 7200 0 EET} {1679698800 10800 1 EEST} - {1698354000 7200 0 EET} + {1698444000 7200 0 EET} {1711753200 10800 1 EEST} - {1729803600 7200 0 EET} + {1729893600 7200 0 EET} {1743202800 10800 1 EEST} - {1761253200 7200 0 EET} + {1761343200 7200 0 EET} {1774652400 10800 1 EEST} - {1792702800 7200 0 EET} + {1793397600 7200 0 EET} {1806102000 10800 1 EEST} - {1824152400 7200 0 EET} + {1824847200 7200 0 EET} {1837551600 10800 1 EEST} - {1856206800 7200 0 EET} + {1856296800 7200 0 EET} {1869606000 10800 1 EEST} - {1887656400 7200 0 EET} + {1887746400 7200 0 EET} {1901055600 10800 1 EEST} - {1919106000 7200 0 EET} + {1919196000 7200 0 EET} {1932505200 10800 1 EEST} - {1950555600 7200 0 EET} + {1950645600 7200 0 EET} {1963954800 10800 1 EEST} - {1982005200 7200 0 EET} + {1982700000 7200 0 EET} {1995404400 10800 1 EEST} - {2013454800 7200 0 EET} + {2014149600 7200 0 EET} {2026854000 10800 1 EEST} - {2045509200 7200 0 EET} + {2045599200 7200 0 EET} {2058908400 10800 1 EEST} - {2076958800 7200 0 EET} + {2077048800 7200 0 EET} {2090358000 10800 1 EEST} - {2108408400 7200 0 EET} + {2108498400 7200 0 EET} {2121807600 10800 1 EEST} - {2139858000 7200 0 EET} + {2140552800 7200 0 EET} {2153257200 10800 1 EEST} - {2171307600 7200 0 EET} + {2172002400 7200 0 EET} {2184706800 10800 1 EEST} - {2202757200 7200 0 EET} + {2203452000 7200 0 EET} {2216761200 10800 1 EEST} - {2234811600 7200 0 EET} + {2234901600 7200 0 EET} {2248210800 10800 1 EEST} - {2266261200 7200 0 EET} + {2266351200 7200 0 EET} {2279660400 10800 1 EEST} - {2297710800 7200 0 EET} + {2297800800 7200 0 EET} {2311110000 10800 1 EEST} - {2329160400 7200 0 EET} + {2329855200 7200 0 EET} {2342559600 10800 1 EEST} - {2360610000 7200 0 EET} + {2361304800 7200 0 EET} {2374009200 10800 1 EEST} - {2392664400 7200 0 EET} + {2392754400 7200 0 EET} {2406063600 10800 1 EEST} - {2424114000 7200 0 EET} + {2424204000 7200 0 EET} {2437513200 10800 1 EEST} - {2455563600 7200 0 EET} + {2455653600 7200 0 EET} {2468962800 10800 1 EEST} - {2487013200 7200 0 EET} + {2487708000 7200 0 EET} {2500412400 10800 1 EEST} - {2518462800 7200 0 EET} + {2519157600 7200 0 EET} {2531862000 10800 1 EEST} - {2549912400 7200 0 EET} + {2550607200 7200 0 EET} {2563311600 10800 1 EEST} - {2581966800 7200 0 EET} + {2582056800 7200 0 EET} {2595366000 10800 1 EEST} - {2613416400 7200 0 EET} + {2613506400 7200 0 EET} {2626815600 10800 1 EEST} - {2644866000 7200 0 EET} + {2644956000 7200 0 EET} {2658265200 10800 1 EEST} - {2676315600 7200 0 EET} + {2677010400 7200 0 EET} {2689714800 10800 1 EEST} - {2707765200 7200 0 EET} + {2708460000 7200 0 EET} {2721164400 10800 1 EEST} - {2739819600 7200 0 EET} + {2739909600 7200 0 EET} {2753218800 10800 1 EEST} - {2771269200 7200 0 EET} + {2771359200 7200 0 EET} {2784668400 10800 1 EEST} - {2802718800 7200 0 EET} + {2802808800 7200 0 EET} {2816118000 10800 1 EEST} - {2834168400 7200 0 EET} + {2834258400 7200 0 EET} {2847567600 10800 1 EEST} - {2865618000 7200 0 EET} + {2866312800 7200 0 EET} {2879017200 10800 1 EEST} - {2897067600 7200 0 EET} + {2897762400 7200 0 EET} {2910466800 10800 1 EEST} - {2929122000 7200 0 EET} + {2929212000 7200 0 EET} {2942521200 10800 1 EEST} - {2960571600 7200 0 EET} + {2960661600 7200 0 EET} {2973970800 10800 1 EEST} - {2992021200 7200 0 EET} + {2992111200 7200 0 EET} {3005420400 10800 1 EEST} - {3023470800 7200 0 EET} + {3024165600 7200 0 EET} {3036870000 10800 1 EEST} - {3054920400 7200 0 EET} + {3055615200 7200 0 EET} {3068319600 10800 1 EEST} - {3086370000 7200 0 EET} + {3087064800 7200 0 EET} {3100374000 10800 1 EEST} - {3118424400 7200 0 EET} + {3118514400 7200 0 EET} {3131823600 10800 1 EEST} - {3149874000 7200 0 EET} + {3149964000 7200 0 EET} {3163273200 10800 1 EEST} - {3181323600 7200 0 EET} + {3181413600 7200 0 EET} {3194722800 10800 1 EEST} - {3212773200 7200 0 EET} + {3213468000 7200 0 EET} {3226172400 10800 1 EEST} - {3244222800 7200 0 EET} + {3244917600 7200 0 EET} {3257622000 10800 1 EEST} - {3276277200 7200 0 EET} + {3276367200 7200 0 EET} {3289676400 10800 1 EEST} - {3307726800 7200 0 EET} + {3307816800 7200 0 EET} {3321126000 10800 1 EEST} - {3339176400 7200 0 EET} + {3339266400 7200 0 EET} {3352575600 10800 1 EEST} - {3370626000 7200 0 EET} + {3371320800 7200 0 EET} {3384025200 10800 1 EEST} - {3402075600 7200 0 EET} + {3402770400 7200 0 EET} {3415474800 10800 1 EEST} - {3433525200 7200 0 EET} + {3434220000 7200 0 EET} {3446924400 10800 1 EEST} - {3465579600 7200 0 EET} + {3465669600 7200 0 EET} {3478978800 10800 1 EEST} - {3497029200 7200 0 EET} + {3497119200 7200 0 EET} {3510428400 10800 1 EEST} - {3528478800 7200 0 EET} + {3528568800 7200 0 EET} {3541878000 10800 1 EEST} - {3559928400 7200 0 EET} + {3560623200 7200 0 EET} {3573327600 10800 1 EEST} - {3591378000 7200 0 EET} + {3592072800 7200 0 EET} {3604777200 10800 1 EEST} - {3623432400 7200 0 EET} + {3623522400 7200 0 EET} {3636831600 10800 1 EEST} - {3654882000 7200 0 EET} + {3654972000 7200 0 EET} {3668281200 10800 1 EEST} - {3686331600 7200 0 EET} + {3686421600 7200 0 EET} {3699730800 10800 1 EEST} - {3717781200 7200 0 EET} + {3717871200 7200 0 EET} {3731180400 10800 1 EEST} - {3749230800 7200 0 EET} + {3749925600 7200 0 EET} {3762630000 10800 1 EEST} - {3780680400 7200 0 EET} + {3781375200 7200 0 EET} {3794079600 10800 1 EEST} - {3812734800 7200 0 EET} + {3812824800 7200 0 EET} {3826134000 10800 1 EEST} - {3844184400 7200 0 EET} + {3844274400 7200 0 EET} {3857583600 10800 1 EEST} - {3875634000 7200 0 EET} + {3875724000 7200 0 EET} {3889033200 10800 1 EEST} - {3907083600 7200 0 EET} + {3907778400 7200 0 EET} {3920482800 10800 1 EEST} - {3938533200 7200 0 EET} + {3939228000 7200 0 EET} {3951932400 10800 1 EEST} - {3969982800 7200 0 EET} + {3970677600 7200 0 EET} {3983986800 10800 1 EEST} - {4002037200 7200 0 EET} + {4002127200 7200 0 EET} {4015436400 10800 1 EEST} - {4033486800 7200 0 EET} + {4033576800 7200 0 EET} {4046886000 10800 1 EEST} - {4064936400 7200 0 EET} + {4065026400 7200 0 EET} {4078335600 10800 1 EEST} - {4096386000 7200 0 EET} + {4097080800 7200 0 EET} } diff --git a/library/tzdata/Europe/Istanbul b/library/tzdata/Europe/Istanbul index f7b0c24..d00533f 100644 --- a/library/tzdata/Europe/Istanbul +++ b/library/tzdata/Europe/Istanbul @@ -71,23 +71,23 @@ set TZData(:Europe/Istanbul) { {482792400 7200 0 EET} {482796000 10800 1 EEST} {496702800 7200 0 EET} - {512524800 10800 1 EEST} - {528249600 7200 0 EET} - {543974400 10800 1 EEST} - {559699200 7200 0 EET} - {575424000 10800 1 EEST} - {591148800 7200 0 EET} - {606873600 10800 1 EEST} - {622598400 7200 0 EET} - {638323200 10800 1 EEST} - {654652800 7200 0 EET} + {512521200 10800 1 EEST} + {528246000 7200 0 EET} + {543970800 10800 1 EEST} + {559695600 7200 0 EET} + {575420400 10800 1 EEST} + {591145200 7200 0 EET} + {606870000 10800 1 EEST} + {622594800 7200 0 EET} + {638319600 10800 1 EEST} + {654649200 7200 0 EET} {670374000 10800 1 EEST} {686098800 7200 0 EET} {701823600 10800 1 EEST} {717548400 7200 0 EET} {733273200 10800 1 EEST} {748998000 7200 0 EET} - {764722800 10800 1 EEST} + {764118000 10800 1 EEST} {780447600 7200 0 EET} {796172400 10800 1 EEST} {811897200 7200 0 EET} -- cgit v0.12 From ec332750d28a86537a3fc721decc3bb74d850dc9 Mon Sep 17 00:00:00 2001 From: dgp Date: Thu, 27 Oct 2016 19:39:49 +0000 Subject: Start bringing all `string cat` operations into one place so it can be coded correctly one time instead of badly multiple times. --- generic/tclCmdMZ.c | 17 ++++++++--------- generic/tclInt.h | 2 ++ generic/tclStringObj.c | 40 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 50 insertions(+), 9 deletions(-) diff --git a/generic/tclCmdMZ.c b/generic/tclCmdMZ.c index 591e31c..1a08674 100644 --- a/generic/tclCmdMZ.c +++ b/generic/tclCmdMZ.c @@ -2855,7 +2855,7 @@ StringCatCmd( int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { - int i; + int code; Tcl_Obj *objResultPtr; if (objc < 2) { @@ -2872,16 +2872,15 @@ StringCatCmd( Tcl_SetObjResult(interp, objv[1]); return TCL_OK; } - objResultPtr = objv[1]; - if (Tcl_IsShared(objResultPtr)) { - objResultPtr = Tcl_DuplicateObj(objResultPtr); - } - for(i = 2;i < objc;i++) { - Tcl_AppendObjToObj(objResultPtr, objv[i]); + + code = TclStringCatObjv(interp, objc-1, objv+1, &objResultPtr); + + if (code == TCL_OK) { + Tcl_SetObjResult(interp, objResultPtr); + return TCL_OK; } - Tcl_SetObjResult(interp, objResultPtr); - return TCL_OK; + return code; } /* diff --git a/generic/tclInt.h b/generic/tclInt.h index da1b5c5..36c1a81 100644 --- a/generic/tclInt.h +++ b/generic/tclInt.h @@ -3135,6 +3135,8 @@ MODULE_SCOPE void TclSpellFix(Tcl_Interp *interp, Tcl_Obj *bad, Tcl_Obj *fix); MODULE_SCOPE void * TclStackRealloc(Tcl_Interp *interp, void *ptr, int numBytes); +MODULE_SCOPE int TclStringCatObjv(Tcl_Interp *interp, int objc, + Tcl_Obj *const objv[], Tcl_Obj **objPtrPtr); MODULE_SCOPE int TclStringMatch(const char *str, int strLen, const char *pattern, int ptnLen, int flags); MODULE_SCOPE int TclStringMatchObj(Tcl_Obj *stringObj, diff --git a/generic/tclStringObj.c b/generic/tclStringObj.c index 2930fa1..1828d20 100644 --- a/generic/tclStringObj.c +++ b/generic/tclStringObj.c @@ -2598,6 +2598,46 @@ TclGetStringStorage( *sizePtr = stringPtr->allocated; return objPtr->bytes; } + +/* + *--------------------------------------------------------------------------- + * + * TclStringCatObjv -- + * + * Performs the [string cat] function. + * + * Results: + * A standard Tcl result. + * + * Side effects: + * Writes to *objPtrPtr the address of Tcl_Obj that is concatenation + * of all objc values in objv. + * + *--------------------------------------------------------------------------- + */ + +int +TclStringCatObjv( + Tcl_Interp *interp, + int objc, + Tcl_Obj * const objv[], + Tcl_Obj **objPtrPtr) +{ + Tcl_Obj *objResultPtr; + + /* assert (objc >= 2) */ + + objResultPtr = *objv++; objc--; + if (Tcl_IsShared(objResultPtr)) { + objResultPtr = Tcl_DuplicateObj(objResultPtr); + } + while (objc--) { + Tcl_AppendObjToObj(objResultPtr, *objv++); + } + *objPtrPtr = objResultPtr; + return TCL_OK; +} + /* *--------------------------------------------------------------------------- * -- cgit v0.12 From 6beda912ab0f8bd8784d7b1a973d3897c89b75c0 Mon Sep 17 00:00:00 2001 From: dgp Date: Thu, 27 Oct 2016 20:06:36 +0000 Subject: Convert INST_STR_CONCAT1 to the common `string cat` implementation. --- generic/tclExecute.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/generic/tclExecute.c b/generic/tclExecute.c index b19754e..fcf5ba9 100644 --- a/generic/tclExecute.c +++ b/generic/tclExecute.c @@ -2692,6 +2692,13 @@ TEBCresume( opnd = TclGetUInt1AtPtr(pc+1); +#if 1 + if (TCL_OK != TclStringCatObjv(interp, opnd, &OBJ_AT_DEPTH(opnd-1), + &objResultPtr)) { + TRACE_ERROR(interp); + goto gotError; + } +#else /* * Detect only-bytearray-or-null case. */ @@ -2828,6 +2835,7 @@ TEBCresume( } } } +#endif TRACE_WITH_OBJ(("%u => ", opnd), objResultPtr); NEXT_INST_V(2, opnd, 1); -- cgit v0.12 From 4968966c028c3577f5ef3e604cf1e98b7c37d824 Mon Sep 17 00:00:00 2001 From: dgp Date: Fri, 28 Oct 2016 14:06:15 +0000 Subject: Add obvious optimization to Tcl_GetCharLength(). --- generic/tclStringObj.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/generic/tclStringObj.c b/generic/tclStringObj.c index 2930fa1..e878167 100644 --- a/generic/tclStringObj.c +++ b/generic/tclStringObj.c @@ -409,6 +409,15 @@ Tcl_GetCharLength( int numChars; /* + * Quick, no-shimmer return for short string reps. + */ + + if ((objPtr->bytes) && (objPtr->length < 2)) { + /* 0 bytes -> 0 chars; 1 byte -> 1 char */ + return objPtr->length; + } + + /* * Optimize the case where we're really dealing with a bytearray object * without string representation; we don't need to convert to a string to * perform the get-length operation. -- cgit v0.12 From e0d5715972ba45f8d23f0349033503b2195b1664 Mon Sep 17 00:00:00 2001 From: dgp Date: Fri, 28 Oct 2016 14:23:25 +0000 Subject: Add warning commentary making important assumptions explicit. --- generic/tclCmdIL.c | 8 ++++++++ generic/tclStringObj.c | 2 ++ 2 files changed, 10 insertions(+) diff --git a/generic/tclCmdIL.c b/generic/tclCmdIL.c index 02e5812..b303bb6 100644 --- a/generic/tclCmdIL.c +++ b/generic/tclCmdIL.c @@ -2025,6 +2025,14 @@ Tcl_JoinObjCmd( resObjPtr = Tcl_NewObj(); for (i = 0; i < listLen; i++) { if (i > 0) { + + /* + * NOTE: This code is relying on Tcl_AppendObjToObj() **NOT** + * to shimmer joinObjPtr. If it did, then the case where + * objv[1] and objv[2] are the same value would not be safe. + * Accessing elemPtrs would crash. + */ + Tcl_AppendObjToObj(resObjPtr, joinObjPtr); } Tcl_AppendObjToObj(resObjPtr, elemPtrs[i]); diff --git a/generic/tclStringObj.c b/generic/tclStringObj.c index 86f0c62..67e86c5 100644 --- a/generic/tclStringObj.c +++ b/generic/tclStringObj.c @@ -1261,6 +1261,8 @@ Tcl_AppendUnicodeToObj( * Side effects: * The string rep of appendObjPtr is appended to the string * representation of objPtr. + * IMPORTANT: This routine does not and MUST NOT shimmer appendObjPtr. + * Callers are counting on that. * *---------------------------------------------------------------------- */ -- cgit v0.12 From 335716b81d99c7476e68979fe48b20b0f2bfeeee Mon Sep 17 00:00:00 2001 From: dgp Date: Fri, 28 Oct 2016 14:45:54 +0000 Subject: Add obvious optimizations to [join] implementation. --- generic/tclCmdIL.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/generic/tclCmdIL.c b/generic/tclCmdIL.c index bb3c9b7..7f4ca1d 100644 --- a/generic/tclCmdIL.c +++ b/generic/tclCmdIL.c @@ -2173,6 +2173,16 @@ Tcl_JoinObjCmd( return TCL_ERROR; } + if (listLen == 0) { + /* No elements to join; default empty result is correct. */ + return TCL_OK; + } + if (listLen == 1) { + /* One element; return it */ + Tcl_SetObjResult(interp, elemPtrs[0]); + return TCL_OK; + } + joinObjPtr = (objc == 2) ? Tcl_NewStringObj(" ", 1) : objv[2]; Tcl_IncrRefCount(joinObjPtr); -- cgit v0.12 From dff4ed85a2e6fac50d5e9d7caee4a7f1dffcd835 Mon Sep 17 00:00:00 2001 From: dgp Date: Fri, 28 Oct 2016 15:46:49 +0000 Subject: Add optimization to [dict append]. --- generic/tclDictObj.c | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/generic/tclDictObj.c b/generic/tclDictObj.c index 428173d..f99f984 100644 --- a/generic/tclDictObj.c +++ b/generic/tclDictObj.c @@ -2305,17 +2305,26 @@ DictAppendCmd( return TCL_ERROR; } - if (valuePtr == NULL) { - TclNewObj(valuePtr); - } else if (Tcl_IsShared(valuePtr)) { - valuePtr = Tcl_DuplicateObj(valuePtr); - } + if ((objc > 3) || (valuePtr == NULL)) { + /* Only go through append activites when something will change. */ + + if (valuePtr == NULL) { + TclNewObj(valuePtr); + } else if (Tcl_IsShared(valuePtr)) { + valuePtr = Tcl_DuplicateObj(valuePtr); + } - for (i=3 ; i Date: Fri, 28 Oct 2016 16:55:44 +0000 Subject: revise [dict append] to make use of common [string cat] engine. --- generic/tclDictObj.c | 30 ++++++++++++++++++++++++------ 1 file changed, 24 insertions(+), 6 deletions(-) diff --git a/generic/tclDictObj.c b/generic/tclDictObj.c index f99f984..3be968a 100644 --- a/generic/tclDictObj.c +++ b/generic/tclDictObj.c @@ -2282,7 +2282,7 @@ DictAppendCmd( Tcl_Obj *const *objv) { Tcl_Obj *dictPtr, *valuePtr, *resultPtr; - int i, allocatedDict = 0; + int allocatedDict = 0; if (objc < 3) { Tcl_WrongNumArgs(interp, 1, objv, "dictVarName key ?value ...?"); @@ -2307,15 +2307,33 @@ DictAppendCmd( if ((objc > 3) || (valuePtr == NULL)) { /* Only go through append activites when something will change. */ + Tcl_Obj *appendObjPtr = NULL; - if (valuePtr == NULL) { + if (objc > 3) { + /* Something to append */ + + if (objc == 4) { + appendObjPtr = objv[3]; + } else if (TCL_OK != TclStringCatObjv(interp, objc-3, objv+3, + &appendObjPtr)) { + return TCL_ERROR; + } + } + + if (appendObjPtr == NULL) { + /* => (objc == 3) => (valuePtr == NULL) */ TclNewObj(valuePtr); - } else if (Tcl_IsShared(valuePtr)) { - valuePtr = Tcl_DuplicateObj(valuePtr); + } else if (valuePtr == NULL) { + valuePtr = appendObjPtr; + appendObjPtr = NULL; } - for (i=3 ; i Date: Fri, 28 Oct 2016 20:33:55 +0000 Subject: WIP --- generic/tclCmdIL.c | 5 ++--- generic/tclCmdMZ.c | 3 ++- generic/tclDictObj.c | 4 ++-- generic/tclExecute.c | 4 ++-- generic/tclInt.h | 5 +++-- generic/tclStringObj.c | 58 +++++++++++++++++++++++++++++++++++++++++++++++++- 6 files changed, 68 insertions(+), 11 deletions(-) diff --git a/generic/tclCmdIL.c b/generic/tclCmdIL.c index 09adc8d..73bd36f 100644 --- a/generic/tclCmdIL.c +++ b/generic/tclCmdIL.c @@ -2187,9 +2187,8 @@ Tcl_JoinObjCmd( Tcl_IncrRefCount(joinObjPtr); if (Tcl_GetCharLength(joinObjPtr) == 0) { - Tcl_IncrRefCount(elemPtrs[0]); - TclStringCatObjv(interp, listLen, elemPtrs, &resObjPtr); - Tcl_DecrRefCount(elemPtrs[0]); + TclStringCatObjv(interp, /* inPlace */ 0, listLen, elemPtrs, + &resObjPtr); } else { int i; diff --git a/generic/tclCmdMZ.c b/generic/tclCmdMZ.c index 1a08674..10c2ef3 100644 --- a/generic/tclCmdMZ.c +++ b/generic/tclCmdMZ.c @@ -2873,7 +2873,8 @@ StringCatCmd( return TCL_OK; } - code = TclStringCatObjv(interp, objc-1, objv+1, &objResultPtr); + code = TclStringCatObjv(interp, /* inPlace */ 1, objc-1, objv+1, + &objResultPtr); if (code == TCL_OK) { Tcl_SetObjResult(interp, objResultPtr); diff --git a/generic/tclDictObj.c b/generic/tclDictObj.c index 3be968a..9686c6f 100644 --- a/generic/tclDictObj.c +++ b/generic/tclDictObj.c @@ -2314,8 +2314,8 @@ DictAppendCmd( if (objc == 4) { appendObjPtr = objv[3]; - } else if (TCL_OK != TclStringCatObjv(interp, objc-3, objv+3, - &appendObjPtr)) { + } else if (TCL_OK != TclStringCatObjv(interp, /* inPlace */ 1, + objc-3, objv+3, &appendObjPtr)) { return TCL_ERROR; } } diff --git a/generic/tclExecute.c b/generic/tclExecute.c index fcf5ba9..1cf8548 100644 --- a/generic/tclExecute.c +++ b/generic/tclExecute.c @@ -2693,8 +2693,8 @@ TEBCresume( opnd = TclGetUInt1AtPtr(pc+1); #if 1 - if (TCL_OK != TclStringCatObjv(interp, opnd, &OBJ_AT_DEPTH(opnd-1), - &objResultPtr)) { + if (TCL_OK != TclStringCatObjv(interp, /* inPlace */ 1, + opnd, &OBJ_AT_DEPTH(opnd-1), &objResultPtr)) { TRACE_ERROR(interp); goto gotError; } diff --git a/generic/tclInt.h b/generic/tclInt.h index 36c1a81..8a647f0 100644 --- a/generic/tclInt.h +++ b/generic/tclInt.h @@ -3135,8 +3135,9 @@ MODULE_SCOPE void TclSpellFix(Tcl_Interp *interp, Tcl_Obj *bad, Tcl_Obj *fix); MODULE_SCOPE void * TclStackRealloc(Tcl_Interp *interp, void *ptr, int numBytes); -MODULE_SCOPE int TclStringCatObjv(Tcl_Interp *interp, int objc, - Tcl_Obj *const objv[], Tcl_Obj **objPtrPtr); +MODULE_SCOPE int TclStringCatObjv(Tcl_Interp *interp, int inPlace, + int objc, Tcl_Obj *const objv[], + Tcl_Obj **objPtrPtr); MODULE_SCOPE int TclStringMatch(const char *str, int strLen, const char *pattern, int ptnLen, int flags); MODULE_SCOPE int TclStringMatchObj(Tcl_Obj *stringObj, diff --git a/generic/tclStringObj.c b/generic/tclStringObj.c index cc30602..c248749 100644 --- a/generic/tclStringObj.c +++ b/generic/tclStringObj.c @@ -2630,18 +2630,74 @@ TclGetStringStorage( int TclStringCatObjv( Tcl_Interp *interp, + int inPlace, int objc, Tcl_Obj * const objv[], Tcl_Obj **objPtrPtr) { Tcl_Obj *objResultPtr; + int i, length = 0, binary = 1, first = 0; /* assert (objc >= 2) */ + /* + * GOALS: Avoid shimmering & string rep generation. + * Produce pure bytearray when possible. + * Error on overflow. + */ + + for (i = 0; i < objc && binary; i++) { + Tcl_Obj *objPtr = objv[i]; + + if (objPtr->bytes) { + if (objPtr->length == 0) { + continue; + } + binary = 0; + } else if (!TclIsPureByteArray(objPtr)) { + binary = 0; + } + } + + if (binary) { + for (i = 0; i < objc && length >= 0; i++) { + if (objv[i]->bytes == NULL) { + int numBytes; + + Tcl_GetByteArrayFromObj(objv[i], &numBytes); + if (length == 0) { + first = i; + } + length += numBytes; + } + } + if (length < 0) { + if (interp) { + Tcl_SetObjResult(interp, Tcl_ObjPrintf( + "max size for a Tcl value (%d bytes) exceeded", + INT_MAX)); + Tcl_SetErrorCode(interp, "TCL", "MEMORY", NULL); + } + return TCL_ERROR; + } + if (length == 0) { + /* Total length of zero means every value has length zero */ + *objPtrPtr = objv[0]; + return TCL_OK; + } + } + + objv += first; objc -= first; objResultPtr = *objv++; objc--; - if (Tcl_IsShared(objResultPtr)) { + if (!inPlace || Tcl_IsShared(objResultPtr)) { objResultPtr = Tcl_DuplicateObj(objResultPtr); } + + if (binary) { + Tcl_SetByteArrayLength(objResultPtr, length); + } + + while (objc--) { Tcl_AppendObjToObj(objResultPtr, *objv++); } -- cgit v0.12 From a913c1c36df3e3fc5c44926e7b267593f4bfdacb Mon Sep 17 00:00:00 2001 From: dkf Date: Sat, 29 Oct 2016 21:03:25 +0000 Subject: Added test for bug --- tests/zlib.test | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/tests/zlib.test b/tests/zlib.test index 15dbb34..ae8742b 100644 --- a/tests/zlib.test +++ b/tests/zlib.test @@ -138,6 +138,25 @@ test zlib-7.7 {zlib stream: Bug 25842c161} -constraints zlib -body { } -cleanup { catch {$s close} } -result "" +# Also causes Tk Bug 10f2e7872b +test zlib-7.8 {zlib stream: Bug b26e38a3e4} -constraints zlib -setup { + expr srand(12345) + set randdata {} + for {set i 0} {$i<6001} {incr i} { + append randdata [binary format c [expr {int(256*rand())}]] + } +} -body { + set strm [zlib stream compress] + for {set i 1} {$i<3000} {incr i} { + $strm put $randdata + } + $strm put -finalize $randdata + set data [$strm get] + list [string length $data] [string length [zlib decompress $data]] +} -cleanup { + catch {$strm close} + unset -nocomplain randdata data +} -result {120185 18003000} test zlib-8.1 {zlib transformation} -constraints zlib -setup { set file [makeFile {} test.gz] -- cgit v0.12 From f50fc619a4f614dc4011b6bf50add8f947d6cb35 Mon Sep 17 00:00:00 2001 From: dkf Date: Sun, 30 Oct 2016 05:02:46 +0000 Subject: Fix the bug. Make use of zlib API in this area more like a Tcl API with wrapper function. --- generic/tclZlib.c | 144 ++++++++++++++++++++++++++++++++---------------------- 1 file changed, 86 insertions(+), 58 deletions(-) diff --git a/generic/tclZlib.c b/generic/tclZlib.c index c9d7b88..53cd14b 100644 --- a/generic/tclZlib.c +++ b/generic/tclZlib.c @@ -177,6 +177,8 @@ static Tcl_ObjCmdProc ZlibStreamPutCmd; static void ConvertError(Tcl_Interp *interp, int code, uLong adler); static Tcl_Obj * ConvertErrorToList(int code, uLong adler); +static inline int Deflate(z_streamp strm, void *bufferPtr, + int bufferSize, int flush, int *writtenPtr); static void ExtractHeader(gz_header *headerPtr, Tcl_Obj *dictObj); static int GenerateHeader(Tcl_Interp *interp, Tcl_Obj *dictObj, GzipHeader *headerPtr, int *extraSizePtr); @@ -578,6 +580,10 @@ ExtractHeader( } } +/* + * Disentangle the worst of how the zlib API is used. + */ + static int SetInflateDictionary( z_streamp strm, @@ -605,6 +611,38 @@ SetDeflateDictionary( } return Z_OK; } + +static inline int +Deflate( + z_streamp strm, + void *bufferPtr, + int bufferSize, + int flush, + int *writtenPtr) +{ + int e; + + strm->next_out = (Bytef *) bufferPtr; + strm->avail_out = (unsigned) bufferSize; + e = deflate(strm, flush); + if (writtenPtr != NULL) { + *writtenPtr = bufferSize - strm->avail_out; + } + return e; +} + +static inline void +AppendByteArray( + Tcl_Obj *listObj, + void *buffer, + int size) +{ + if (size > 0) { + Tcl_Obj *baObj = Tcl_NewByteArrayObj((unsigned char *) buffer, size); + + Tcl_ListObjAppendElement(NULL, listObj, baObj); + } +} /* *---------------------------------------------------------------------- @@ -1139,6 +1177,8 @@ Tcl_ZlibStreamSetCompressionDictionary( *---------------------------------------------------------------------- */ +#define BUFFER_SIZE_LIMIT 0xFFFF + int Tcl_ZlibStreamPut( Tcl_ZlibStream zshandle, /* As obtained from Tcl_ZlibStreamInit */ @@ -1148,8 +1188,7 @@ Tcl_ZlibStreamPut( { ZlibStreamHandle *zshPtr = (ZlibStreamHandle *) zshandle; char *dataTmp = NULL; - int e, size, outSize; - Tcl_Obj *obj; + int e, size, outSize, toStore; if (zshPtr->streamEnd) { if (zshPtr->interp) { @@ -1175,26 +1214,45 @@ Tcl_ZlibStreamPut( if (HaveDictToSet(zshPtr)) { e = SetDeflateDictionary(&zshPtr->stream, zshPtr->compDictObj); if (e != Z_OK) { - if (zshPtr->interp) { - ConvertError(zshPtr->interp, e, zshPtr->stream.adler); - } + ConvertError(zshPtr->interp, e, zshPtr->stream.adler); return TCL_ERROR; } DictWasSet(zshPtr); } /* - * Deflatebound doesn't seem to take various header sizes into - * account, so we add 100 extra bytes. + * deflateBound() doesn't seem to take various header sizes into + * account, so we add 100 extra bytes. However, we can also loop + * around again so we also set an upper bound on the output buffer + * size. */ - outSize = deflateBound(&zshPtr->stream, zshPtr->stream.avail_in)+100; - zshPtr->stream.avail_out = outSize; - dataTmp = ckalloc(zshPtr->stream.avail_out); - zshPtr->stream.next_out = (Bytef *) dataTmp; + outSize = deflateBound(&zshPtr->stream, size) + 100; + if (outSize > BUFFER_SIZE_LIMIT) { + outSize = BUFFER_SIZE_LIMIT; + } + dataTmp = ckalloc(outSize); + + while (1) { + e = Deflate(&zshPtr->stream, dataTmp, outSize, flush, &toStore); + + /* + * Test if we've filled the buffer up and have to ask deflate() to + * give us some more. Note that the condition for needing to + * repeat a buffer transfer when the result is Z_OK is whether + * there is no more space in the buffer we provided; the zlib + * library does not necessarily return a different code in that + * case. [Bug b26e38a3e4] [Tk Bug 10f2e7872b] + */ + + if ((e != Z_BUF_ERROR) && (e != Z_OK || toStore < outSize)) { + if ((e == Z_OK) || (flush == Z_FINISH && e == Z_STREAM_END)) { + break; + } + ConvertError(zshPtr->interp, e, zshPtr->stream.adler); + return TCL_ERROR; + } - e = deflate(&zshPtr->stream, flush); - while (e == Z_BUF_ERROR || (flush == Z_FINISH && e == Z_OK)) { /* * Output buffer too small to hold the data being generated or we * are doing the end-of-stream flush (which can spit out masses of @@ -1202,45 +1260,21 @@ Tcl_ZlibStreamPut( * saving the old generated data to the outData list. */ - obj = Tcl_NewByteArrayObj((unsigned char *) dataTmp, outSize); - Tcl_ListObjAppendElement(NULL, zshPtr->outData, obj); + AppendByteArray(zshPtr->outData, dataTmp, outSize); - if (outSize < 0xFFFF) { - outSize = 0xFFFF; /* There may be *lots* of data left to - * output... */ + if (outSize < BUFFER_SIZE_LIMIT) { + outSize = BUFFER_SIZE_LIMIT; + /* There may be *lots* of data left to output... */ dataTmp = ckrealloc(dataTmp, outSize); } - zshPtr->stream.avail_out = outSize; - zshPtr->stream.next_out = (Bytef *) dataTmp; - - e = deflate(&zshPtr->stream, flush); - } - - if (e != Z_OK && !(flush==Z_FINISH && e==Z_STREAM_END)) { - if (zshPtr->interp) { - ConvertError(zshPtr->interp, e, zshPtr->stream.adler); - } - return TCL_ERROR; } /* - * And append the final data block. + * And append the final data block to the outData list. */ - if (outSize - zshPtr->stream.avail_out > 0) { - obj = Tcl_NewByteArrayObj((unsigned char *) dataTmp, - outSize - zshPtr->stream.avail_out); - - /* - * Now append the compressed data to the outData list. - */ - - Tcl_ListObjAppendElement(NULL, zshPtr->outData, obj); - } - - if (dataTmp) { - ckfree(dataTmp); - } + AppendByteArray(zshPtr->outData, dataTmp, toStore); + ckfree(dataTmp); } else { /* * This is easy. Just append to the inData list. @@ -1356,9 +1390,7 @@ Tcl_ZlibStreamGet( if (IsRawStream(zshPtr) && HaveDictToSet(zshPtr)) { e = SetInflateDictionary(&zshPtr->stream, zshPtr->compDictObj); if (e != Z_OK) { - if (zshPtr->interp) { - ConvertError(zshPtr->interp, e, zshPtr->stream.adler); - } + ConvertError(zshPtr->interp, e, zshPtr->stream.adler); return TCL_ERROR; } DictWasSet(zshPtr); @@ -2879,10 +2911,8 @@ ZlibTransformClose( if (cd->mode == TCL_ZLIB_STREAM_DEFLATE) { cd->outStream.avail_in = 0; do { - cd->outStream.next_out = (Bytef *) cd->outBuffer; - cd->outStream.avail_out = (unsigned) cd->outAllocated; - e = deflate(&cd->outStream, Z_FINISH); - written = cd->outAllocated - cd->outStream.avail_out; + e = Deflate(&cd->outStream, cd->outBuffer, cd->outAllocated, + Z_FINISH, &written); /* * Can't be sure that deflate() won't declare the buffer to be @@ -3086,17 +3116,15 @@ ZlibTransformOutput( cd->outStream.next_in = (Bytef *) buf; cd->outStream.avail_in = toWrite; do { - cd->outStream.next_out = (Bytef *) cd->outBuffer; - cd->outStream.avail_out = cd->outAllocated; - - e = deflate(&cd->outStream, Z_NO_FLUSH); - produced = cd->outAllocated - cd->outStream.avail_out; + e = Deflate(&cd->outStream, cd->outBuffer, cd->outAllocated, + Z_NO_FLUSH, &produced); if ((e == Z_OK && produced > 0) || e == Z_BUF_ERROR) { /* * deflate() indicates that it is out of space by returning - * Z_BUF_ERROR; in that case, we must write the whole buffer out - * and retry to compress what is left. + * Z_BUF_ERROR *or* by simply returning Z_OK with no remaining + * space; in either case, we must write the whole buffer out and + * retry to compress what is left. */ if (e == Z_BUF_ERROR) { -- cgit v0.12 From 4ebcee3015caa6c14ae484220d113c943bc1f736 Mon Sep 17 00:00:00 2001 From: dkf Date: Sun, 30 Oct 2016 05:07:47 +0000 Subject: One more place where the internal API change can be used easily. --- generic/tclZlib.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/generic/tclZlib.c b/generic/tclZlib.c index 53cd14b..e5a5946 100644 --- a/generic/tclZlib.c +++ b/generic/tclZlib.c @@ -3177,10 +3177,8 @@ ZlibTransformFlush( * Get the bytes to go out of the compression engine. */ - cd->outStream.next_out = (Bytef *) cd->outBuffer; - cd->outStream.avail_out = cd->outAllocated; - - e = deflate(&cd->outStream, flushType); + e = Deflate(&cd->outStream, cd->outBuffer, cd->outAllocated, + flushType, &len); if (e != Z_OK && e != Z_BUF_ERROR) { ConvertError(interp, e, cd->outStream.adler); return TCL_ERROR; @@ -3190,7 +3188,6 @@ ZlibTransformFlush( * Write the bytes we've received to the next layer. */ - len = cd->outStream.next_out - (Bytef *) cd->outBuffer; if (len > 0 && Tcl_WriteRaw(cd->parent, cd->outBuffer, len) < 0) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "problem flushing channel: %s", -- cgit v0.12 From df54f23b9fdd17bc3eb02a15f3fd9513e6261b7e Mon Sep 17 00:00:00 2001 From: dkf Date: Sun, 30 Oct 2016 08:22:13 +0000 Subject: [1ae12987cb] Ensure that deleting the [history] command deletes its storage. --- library/history.tcl | 24 ++++++++++++++++++++++ tests/history.test | 58 +++++++++++++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 80 insertions(+), 2 deletions(-) diff --git a/library/history.tcl b/library/history.tcl index 51d2404..ef9099b 100644 --- a/library/history.tcl +++ b/library/history.tcl @@ -56,6 +56,30 @@ proc ::history {args} { tailcall apply {arglist {tailcall history {*}$arglist} ::tcl} $args } +# (unnamed) -- +# +# Callback when [::history] is destroyed. Destroys the implementation. +# +# Parameters: +# oldName what the command was called. +# newName what the command is now called (an empty string). +# op the operation (= delete). +# +# Results: +# none +# +# Side Effects: +# The implementation of the [::history] command ceases to exist. + +trace add command ::history delete [list apply {{oldName newName op} { + variable history + unset -nocomplain history + foreach c [info procs ::tcl::Hist*] { + rename $c {} + } + rename ::tcl::history {} +} ::tcl}] + # tcl::HistAdd -- # # Add an item to the history, and optionally eval it at the global scope diff --git a/tests/history.test b/tests/history.test index 7549beb..3201ad7 100644 --- a/tests/history.test +++ b/tests/history.test @@ -11,8 +11,8 @@ # See the file "license.terms" for information on usage and redistribution of # this file, and for a DISCLAIMER OF ALL WARRANTIES. -if {[lsearch [namespace children] ::tcltest] == -1} { - package require tcltest +if {"::tcltest" ni [namespace children]} { + package require tcltest 2 namespace import -force ::tcltest::* } @@ -245,6 +245,60 @@ test history-9.2 {miscellaneous} history { catch {history gorp} msg set msg } {unknown or ambiguous subcommand "gorp": must be add, change, clear, event, info, keep, nextid, or redo} + +# History retains references; Bug 1ae12987cb +test history-10.1 {references kept by history} -constraints history -setup { + interp create histtest + histtest eval { + # Trigger any autoloading that might be present + catch {history} + proc refcount {x} { + set rep [::tcl::unsupported::representation $x] + regexp {with a refcount of (\d+)} $rep -> rc + # Ignore the references due to calling this procedure + return [expr {$rc - 3}] + } + } +} -body { + histtest eval { + # A fresh object, refcount 1 from the variable we write it to + set obj [expr rand()] + set baseline [refcount $obj] + lappend result [refcount $obj] + history add [list list $obj] + lappend result [refcount $obj] + history clear + lappend result [refcount $obj] + } +} -cleanup { + interp delete histtest +} -result {1 2 1} +test history-10.2 {references kept by history} -constraints history -setup { + interp create histtest + histtest eval { + # Trigger any autoloading that might be present + catch {history} + proc refcount {x} { + set rep [::tcl::unsupported::representation $x] + regexp {with a refcount of (\d+)} $rep -> rc + # Ignore the references due to calling this procedure + return [expr {$rc - 3}] + } + } +} -body { + histtest eval { + # A fresh object, refcount 1 from the variable we write it to + set obj [expr rand()] + set baseline [refcount $obj] + lappend result [refcount $obj] + history add [list list $obj] + lappend result [refcount $obj] + rename history {} + lappend result [refcount $obj] + } +} -cleanup { + interp delete histtest +} -result {1 2 1} # cleanup ::tcltest::cleanupTests -- cgit v0.12 From 5ddd3f071bddef971e50673d7700162700561cf6 Mon Sep 17 00:00:00 2001 From: dkf Date: Sun, 30 Oct 2016 16:16:29 +0000 Subject: [253ba6e818] Improved description of [variable] behaviour. --- doc/variable.n | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/doc/variable.n b/doc/variable.n index a6e545f..8228859 100644 --- a/doc/variable.n +++ b/doc/variable.n @@ -45,7 +45,8 @@ linked to the corresponding namespace variables (and therefore these variables are listed by \fBinfo vars\fR.) In this way the \fBvariable\fR command resembles the \fBglobal\fR command, although the \fBglobal\fR command -only links to variables in the global namespace. +resolves variable names with respect to the global namespace instead +of the current namespace of the procedure. If any \fIvalue\fRs are given, they are used to modify the values of the associated namespace variables. If a namespace variable does not exist, @@ -98,3 +99,7 @@ namespace eval foo { global(n), namespace(n), upvar(n) .SH KEYWORDS global, namespace, procedure, variable +.\" Local variables: +.\" mode: nroff +.\" fill-column: 78 +.\" End: -- cgit v0.12 From 1cb5e0af9770c565d370fbb5cf713af0d1f561de Mon Sep 17 00:00:00 2001 From: dgp Date: Mon, 31 Oct 2016 14:17:31 +0000 Subject: Coverage tests for INST_STR_CONCAT1 byterarray ops. --- tests/binary.test | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tests/binary.test b/tests/binary.test index 40b1315..7738f69 100644 --- a/tests/binary.test +++ b/tests/binary.test @@ -2837,6 +2837,19 @@ test binary-76.2 {binary string appending growth algorithm} win { # Append to it string length [append str [binary format a* foo]] } 3 + +test binary-77.1 {string cat ops on all bytearrays} { + apply {{a b} { + return [binary format H* $a][binary format H* $b] + }} ab cd +} [binary format H* abcd] +test binary-77.2 {string cat ops on all bytearrays} { + apply {{a b} { + set one [binary format H* $a] + return $one[binary format H* $b] + }} ab cd +} [binary format H* abcd] + # ---------------------------------------------------------------------- # cleanup -- cgit v0.12 From 77c9a433f701214eafd76617a8e3c67316ebf08e Mon Sep 17 00:00:00 2001 From: dgp Date: Mon, 31 Oct 2016 16:15:16 +0000 Subject: Complete the "pure binary" implementation of the [string cat] engine. --- generic/tclStringObj.c | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/generic/tclStringObj.c b/generic/tclStringObj.c index c248749..c0d85a0 100644 --- a/generic/tclStringObj.c +++ b/generic/tclStringObj.c @@ -2694,12 +2694,26 @@ TclStringCatObjv( } if (binary) { - Tcl_SetByteArrayLength(objResultPtr, length); - } - - - while (objc--) { - Tcl_AppendObjToObj(objResultPtr, *objv++); + /* Efficiently produce a pure binary result */ + unsigned char *dst; + int start; + + Tcl_GetByteArrayFromObj(objResultPtr, &start); + dst = Tcl_SetByteArrayLength(objResultPtr, length) + start; + while (objc--) { + Tcl_Obj *objPtr = *objv++; + + if (objPtr->bytes == NULL) { + int more; + unsigned char *src = Tcl_GetByteArrayFromObj(objPtr, &more); + memcpy(dst, src, (size_t) more); + dst += more; + } + } + } else { + while (objc--) { + Tcl_AppendObjToObj(objResultPtr, *objv++); + } } *objPtrPtr = objResultPtr; return TCL_OK; -- cgit v0.12 From b550e65a968434e0f17d097f85df3fb64347e1ce Mon Sep 17 00:00:00 2001 From: dgp Date: Mon, 31 Oct 2016 18:10:21 +0000 Subject: Reduce copies in the pure binary implementation of [string cat]. --- generic/tclStringObj.c | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/generic/tclStringObj.c b/generic/tclStringObj.c index c0d85a0..1723804 100644 --- a/generic/tclStringObj.c +++ b/generic/tclStringObj.c @@ -2688,18 +2688,21 @@ TclStringCatObjv( } objv += first; objc -= first; - objResultPtr = *objv++; objc--; - if (!inPlace || Tcl_IsShared(objResultPtr)) { - objResultPtr = Tcl_DuplicateObj(objResultPtr); - } if (binary) { /* Efficiently produce a pure binary result */ unsigned char *dst; - int start; - Tcl_GetByteArrayFromObj(objResultPtr, &start); - dst = Tcl_SetByteArrayLength(objResultPtr, length) + start; + if (inPlace && !Tcl_IsShared(*objv)) { + int start; + + objResultPtr = *objv++; objc--; + Tcl_GetByteArrayFromObj(objResultPtr, &start); + dst = Tcl_SetByteArrayLength(objResultPtr, length) + start; + } else { + objResultPtr = Tcl_NewByteArrayObj(NULL, length); + dst = Tcl_SetByteArrayLength(objResultPtr, length); + } while (objc--) { Tcl_Obj *objPtr = *objv++; @@ -2711,6 +2714,15 @@ TclStringCatObjv( } } } else { + + + objResultPtr = *objv++; objc--; + if (!inPlace || Tcl_IsShared(objResultPtr)) { + objResultPtr = Tcl_DuplicateObj(objResultPtr); + } + + + while (objc--) { Tcl_AppendObjToObj(objResultPtr, *objv++); } -- cgit v0.12 From ff2f0e85be431ad093ea78333f98942321ea1779 Mon Sep 17 00:00:00 2001 From: dgp Date: Tue, 1 Nov 2016 15:07:30 +0000 Subject: Expand all the cases of the [string cat] engine. --- generic/tclStringObj.c | 156 ++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 129 insertions(+), 27 deletions(-) diff --git a/generic/tclStringObj.c b/generic/tclStringObj.c index 1723804..05dcba4 100644 --- a/generic/tclStringObj.c +++ b/generic/tclStringObj.c @@ -2637,60 +2637,113 @@ TclStringCatObjv( { Tcl_Obj *objResultPtr; int i, length = 0, binary = 1, first = 0; + int allowUniChar = 1, requestUniChar = 0; /* assert (objc >= 2) */ /* + * Analyze to determine what representation result should be. * GOALS: Avoid shimmering & string rep generation. * Produce pure bytearray when possible. * Error on overflow. */ - for (i = 0; i < objc && binary; i++) { + for (i = 0; i < objc && (binary || allowUniChar); i++) { Tcl_Obj *objPtr = objv[i]; if (objPtr->bytes) { - if (objPtr->length == 0) { - continue; + /* Value has a string rep. */ + if (objPtr->length) { + /* + * Non-empty string rep. Not a pure bytearray, so we + * won't create a pure bytearray + */ + binary = 0; + if ((objPtr->typePtr) && (objPtr->typePtr != &tclStringType)) { + /* Prevent shimmer of non-string types. */ + allowUniChar = 0; + } + } + } else { + /* assert (objPtr->typePtr != NULL) -- stork! */ + if (TclIsPureByteArray(objPtr)) { + allowUniChar = 0; + } else { + binary = 0; + if (objPtr->typePtr == &tclStringType) { + /* Have a pure Unicode value; ask to preserve it */ + requestUniChar = 1; + } else { + /* Have another type; prevent shimmer */ + allowUniChar = 0; + } } - binary = 0; - } else if (!TclIsPureByteArray(objPtr)) { - binary = 0; } } if (binary) { + /* Result will be pure byte array. Pre-size it */ for (i = 0; i < objc && length >= 0; i++) { - if (objv[i]->bytes == NULL) { + Tcl_Obj *objPtr = objv[i]; + + if (objPtr->bytes == NULL) { int numBytes; - Tcl_GetByteArrayFromObj(objv[i], &numBytes); + Tcl_GetByteArrayFromObj(objPtr, &numBytes); if (length == 0) { first = i; } length += numBytes; } } - if (length < 0) { - if (interp) { - Tcl_SetObjResult(interp, Tcl_ObjPrintf( - "max size for a Tcl value (%d bytes) exceeded", - INT_MAX)); - Tcl_SetErrorCode(interp, "TCL", "MEMORY", NULL); + } else if (allowUniChar && requestUniChar) { + /* Result will be pure Tcl_UniChar array. Pre-size it. */ + for (i = 0; i < objc && length >= 0; i++) { + Tcl_Obj *objPtr = objv[i]; + + if ((objPtr->bytes == NULL) || (objPtr->length)) { + int numChars; + + Tcl_GetUnicodeFromObj(objPtr, &numChars); + if (length == 0) { + first = i; + } + length += numChars; } - return TCL_ERROR; } - if (length == 0) { - /* Total length of zero means every value has length zero */ - *objPtrPtr = objv[0]; - return TCL_OK; + } else { + /* Result will be concat of string reps. Pre-size it. */ + for (i = 0; i < objc && length >= 0; i++) { + Tcl_Obj *objPtr = objv[i]; + int numBytes; + + Tcl_GetStringFromObj(objPtr, &numBytes); + if ((length == 0) && numBytes) { + first = i; + } + length += numBytes; + } + } + + if (length < 0) { + if (interp) { + Tcl_SetObjResult(interp, Tcl_ObjPrintf( + "max size for a Tcl value (%d bytes) exceeded", INT_MAX)); + Tcl_SetErrorCode(interp, "TCL", "MEMORY", NULL); } - } + return TCL_ERROR; + } + + if (length == 0) { + /* Total length of zero means every value has length zero */ + *objPtrPtr = objv[0]; + return TCL_OK; + } objv += first; objc -= first; if (binary) { - /* Efficiently produce a pure binary result */ + /* Efficiently produce a pure byte array result */ unsigned char *dst; if (inPlace && !Tcl_IsShared(*objv)) { @@ -2713,18 +2766,67 @@ TclStringCatObjv( dst += more; } } - } else { + } else if (allowUniChar && requestUniChar) { + /* Efficiently produce a pure Tcl_UniChar array result */ + Tcl_UniChar *dst; + if (inPlace && !Tcl_IsShared(*objv)) { + int start; - objResultPtr = *objv++; objc--; - if (!inPlace || Tcl_IsShared(objResultPtr)) { - objResultPtr = Tcl_DuplicateObj(objResultPtr); - } + objResultPtr = *objv++; objc--; + + /* Ugly interface! Force resize of the unicode array. */ + Tcl_GetUnicodeFromObj(objResultPtr, &start); + Tcl_InvalidateStringRep(objResultPtr); + Tcl_SetObjLength(objResultPtr, length); + dst = Tcl_GetUnicode(objResultPtr) + start; + } else { + Tcl_UniChar ch = 0; + + /* Ugly interface! No scheme to init array size. */ + objResultPtr = Tcl_NewUnicodeObj(&ch, 0); + Tcl_SetObjLength(objResultPtr, length); + dst = Tcl_GetUnicode(objResultPtr); + } + while (objc--) { + Tcl_Obj *objPtr = *objv++; + + if ((objPtr->bytes == NULL) || (objPtr->length)) { + int more; + Tcl_UniChar *src = Tcl_GetUnicodeFromObj(objPtr, &more); + memcpy(dst, src, more * sizeof(Tcl_UniChar)); + dst += more; + } + } + } else { + /* Efficiently concatenate string reps */ + char *dst; + if (inPlace && !Tcl_IsShared(*objv)) { + int start; + objResultPtr = *objv++; objc--; + Tcl_GetStringFromObj(objResultPtr, &start); + Tcl_SetObjLength(objResultPtr, length); + dst = Tcl_GetString(objResultPtr) + start; + if (length > start) { + TclFreeIntRep(objResultPtr); + } + } else { + objResultPtr = Tcl_NewObj(); + Tcl_SetObjLength(objResultPtr, length); + dst = Tcl_GetString(objResultPtr); + } while (objc--) { - Tcl_AppendObjToObj(objResultPtr, *objv++); + Tcl_Obj *objPtr = *objv++; + + if ((objPtr->bytes == NULL) || (objPtr->length)) { + int more; + char *src = Tcl_GetStringFromObj(objPtr, &more); + memcpy(dst, src, (size_t) more); + dst += more; + } } } *objPtrPtr = objResultPtr; -- cgit v0.12 From 418ded1bc9df7ae0976ce3793aa0190c93609332 Mon Sep 17 00:00:00 2001 From: dgp Date: Tue, 1 Nov 2016 15:12:07 +0000 Subject: Trim away obsolete code. --- generic/tclExecute.c | 146 +-------------------------------------------------- 1 file changed, 1 insertion(+), 145 deletions(-) diff --git a/generic/tclExecute.c b/generic/tclExecute.c index 1cf8548..83b83f1 100644 --- a/generic/tclExecute.c +++ b/generic/tclExecute.c @@ -2684,162 +2684,18 @@ TEBCresume( NEXT_INST_F(5, 0, 0); } - case INST_STR_CONCAT1: { - int appendLen = 0; - char *bytes, *p; - Tcl_Obj **currPtr; - int onlyb = 1; + case INST_STR_CONCAT1: opnd = TclGetUInt1AtPtr(pc+1); -#if 1 if (TCL_OK != TclStringCatObjv(interp, /* inPlace */ 1, opnd, &OBJ_AT_DEPTH(opnd-1), &objResultPtr)) { TRACE_ERROR(interp); goto gotError; } -#else - /* - * Detect only-bytearray-or-null case. - */ - - for (currPtr=&OBJ_AT_DEPTH(opnd-1); currPtr<=&OBJ_AT_TOS; currPtr++) { - if (((*currPtr)->typePtr != &tclByteArrayType) - && ((*currPtr)->bytes != tclEmptyStringRep)) { - onlyb = 0; - break; - } else if (((*currPtr)->typePtr == &tclByteArrayType) && - ((*currPtr)->bytes != NULL)) { - onlyb = 0; - break; - } - } - - /* - * Compute the length to be appended. - */ - - if (onlyb) { - for (currPtr = &OBJ_AT_DEPTH(opnd-2); - appendLen >= 0 && currPtr <= &OBJ_AT_TOS; currPtr++) { - if ((*currPtr)->bytes != tclEmptyStringRep) { - Tcl_GetByteArrayFromObj(*currPtr, &length); - appendLen += length; - } - } - } else { - for (currPtr = &OBJ_AT_DEPTH(opnd-2); - appendLen >= 0 && currPtr <= &OBJ_AT_TOS; currPtr++) { - bytes = TclGetStringFromObj(*currPtr, &length); - if (bytes != NULL) { - appendLen += length; - } - } - } - - if (appendLen < 0) { - /* TODO: convert panic to error ? */ - Tcl_Panic("max size for a Tcl value (%d bytes) exceeded", INT_MAX); - } - - /* - * If nothing is to be appended, just return the first object by - * dropping all the others from the stack; this saves both the - * computation and copy of the string rep of the first object, - * enabling the fast '$x[set x {}]' idiom for 'K $x [set x {}]'. - */ - - if (appendLen == 0) { - TRACE_WITH_OBJ(("%u => ", opnd), objResultPtr); - NEXT_INST_V(2, (opnd-1), 0); - } - - /* - * If the first object is shared, we need a new obj for the result; - * otherwise, we can reuse the first object. In any case, make sure it - * has enough room to accomodate all the concatenated bytes. Note that - * if it is unshared its bytes are copied by ckrealloc, so that we set - * the loop parameters to avoid copying them again: p points to the - * end of the already copied bytes, currPtr to the second object. - */ - - objResultPtr = OBJ_AT_DEPTH(opnd-1); - if (!onlyb) { - bytes = TclGetStringFromObj(objResultPtr, &length); - if (length + appendLen < 0) { - /* TODO: convert panic to error ? */ - Tcl_Panic("max size for a Tcl value (%d bytes) exceeded", - INT_MAX); - } -#ifndef TCL_COMPILE_DEBUG - if (bytes != tclEmptyStringRep && !Tcl_IsShared(objResultPtr)) { - TclFreeIntRep(objResultPtr); - objResultPtr->bytes = ckrealloc(bytes, length+appendLen+1); - objResultPtr->length = length + appendLen; - p = TclGetString(objResultPtr) + length; - currPtr = &OBJ_AT_DEPTH(opnd - 2); - } else -#endif - { - p = ckalloc(length + appendLen + 1); - TclNewObj(objResultPtr); - objResultPtr->bytes = p; - objResultPtr->length = length + appendLen; - currPtr = &OBJ_AT_DEPTH(opnd - 1); - } - - /* - * Append the remaining characters. - */ - - for (; currPtr <= &OBJ_AT_TOS; currPtr++) { - bytes = TclGetStringFromObj(*currPtr, &length); - if (bytes != NULL) { - memcpy(p, bytes, (size_t) length); - p += length; - } - } - *p = '\0'; - } else { - bytes = (char *) Tcl_GetByteArrayFromObj(objResultPtr, &length); - if (length + appendLen < 0) { - /* TODO: convert panic to error ? */ - Tcl_Panic("max size for a Tcl value (%d bytes) exceeded", - INT_MAX); - } -#ifndef TCL_COMPILE_DEBUG - if (!Tcl_IsShared(objResultPtr)) { - bytes = (char *) Tcl_SetByteArrayLength(objResultPtr, - length + appendLen); - p = bytes + length; - currPtr = &OBJ_AT_DEPTH(opnd - 2); - } else -#endif - { - TclNewObj(objResultPtr); - bytes = (char *) Tcl_SetByteArrayLength(objResultPtr, - length + appendLen); - p = bytes; - currPtr = &OBJ_AT_DEPTH(opnd - 1); - } - - /* - * Append the remaining characters. - */ - - for (; currPtr <= &OBJ_AT_TOS; currPtr++) { - if ((*currPtr)->bytes != tclEmptyStringRep) { - bytes = (char *) Tcl_GetByteArrayFromObj(*currPtr,&length); - memcpy(p, bytes, (size_t) length); - p += length; - } - } - } -#endif TRACE_WITH_OBJ(("%u => ", opnd), objResultPtr); NEXT_INST_V(2, opnd, 1); - } case INST_CONCAT_STK: /* -- cgit v0.12 From cdc8b6080c2a2f05f3f66adfa3184405f04dc003 Mon Sep 17 00:00:00 2001 From: dgp Date: Tue, 1 Nov 2016 15:42:50 +0000 Subject: Replace indexing with pointer increments. --- generic/tclStringObj.c | 31 ++++++++++++++++++------------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/generic/tclStringObj.c b/generic/tclStringObj.c index 05dcba4..7fd7cc1 100644 --- a/generic/tclStringObj.c +++ b/generic/tclStringObj.c @@ -2635,8 +2635,8 @@ TclStringCatObjv( Tcl_Obj * const objv[], Tcl_Obj **objPtrPtr) { - Tcl_Obj *objResultPtr; - int i, length = 0, binary = 1, first = 0; + Tcl_Obj *objPtr, *objResultPtr, * const *ov; + int oc, length = 0, binary = 1, first = 0; int allowUniChar = 1, requestUniChar = 0; /* assert (objc >= 2) */ @@ -2648,8 +2648,9 @@ TclStringCatObjv( * Error on overflow. */ - for (i = 0; i < objc && (binary || allowUniChar); i++) { - Tcl_Obj *objPtr = objv[i]; + ov = objv, oc = objc; + while (oc-- && (binary || allowUniChar)) { + objPtr = *ov++; if (objPtr->bytes) { /* Value has a string rep. */ @@ -2683,43 +2684,47 @@ TclStringCatObjv( if (binary) { /* Result will be pure byte array. Pre-size it */ - for (i = 0; i < objc && length >= 0; i++) { - Tcl_Obj *objPtr = objv[i]; + ov = objv; oc = objc; + while (oc-- && (length >= 0)) { + objPtr = *ov++; if (objPtr->bytes == NULL) { int numBytes; Tcl_GetByteArrayFromObj(objPtr, &numBytes); if (length == 0) { - first = i; + first = objc - oc - 1; } length += numBytes; } } } else if (allowUniChar && requestUniChar) { /* Result will be pure Tcl_UniChar array. Pre-size it. */ - for (i = 0; i < objc && length >= 0; i++) { - Tcl_Obj *objPtr = objv[i]; + ov = objv; oc = objc; + while (oc-- && (length >= 0)) { + objPtr = *ov++; if ((objPtr->bytes == NULL) || (objPtr->length)) { int numChars; Tcl_GetUnicodeFromObj(objPtr, &numChars); if (length == 0) { - first = i; + first = objc - oc - 1; } length += numChars; } } } else { /* Result will be concat of string reps. Pre-size it. */ - for (i = 0; i < objc && length >= 0; i++) { - Tcl_Obj *objPtr = objv[i]; + ov = objv; oc = objc; + while (oc-- && (length >= 0)) { int numBytes; + objPtr = *ov++; + Tcl_GetStringFromObj(objPtr, &numBytes); if ((length == 0) && numBytes) { - first = i; + first = objc - oc - 1; } length += numBytes; } -- cgit v0.12 From b9a27c7e1b9c334d15b042404b291c62708bf44a Mon Sep 17 00:00:00 2001 From: Joe Mistachkin Date: Wed, 2 Nov 2016 01:42:49 +0000 Subject: Fix the generated copyright sections in the HTML help file. --- tools/tcltk-man2html-utils.tcl | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tools/tcltk-man2html-utils.tcl b/tools/tcltk-man2html-utils.tcl index 8fd1245..9052049 100644 --- a/tools/tcltk-man2html-utils.tcl +++ b/tools/tcltk-man2html-utils.tcl @@ -57,9 +57,14 @@ proc copyright {copyright {level {}}} { } proc copyout {copyrights {level {}}} { + set count 0 set out "
" foreach c $copyrights { + if {$count > 0} { + append out
+ } append out "[copyright $c $level]\n" + incr count } append out "
" return $out -- cgit v0.12 From 39bf6f7c801c908cc4fff7f87e191d13f14937df Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Wed, 2 Nov 2016 12:41:04 +0000 Subject: Update http version number to 2.7.14, due to [838e99a76d] --- library/http/http.tcl | 2 +- library/http/pkgIndex.tcl | 2 +- unix/Makefile.in | 4 ++-- win/Makefile.in | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/library/http/http.tcl b/library/http/http.tcl index 2975f82..7aaa669 100644 --- a/library/http/http.tcl +++ b/library/http/http.tcl @@ -11,7 +11,7 @@ package require Tcl 8.4 # Keep this in sync with pkgIndex.tcl and with the install directories in # Makefiles -package provide http 2.7.13 +package provide http 2.7.14 namespace eval http { # Allow resourcing to not clobber existing data diff --git a/library/http/pkgIndex.tcl b/library/http/pkgIndex.tcl index be8b883..3de8e25 100644 --- a/library/http/pkgIndex.tcl +++ b/library/http/pkgIndex.tcl @@ -1,4 +1,4 @@ # Tcl package index file, version 1.1 if {![package vsatisfies [package provide Tcl] 8.4]} {return} -package ifneeded http 2.7.13 [list tclPkgSetup $dir http 2.7.13 {{http.tcl source {::http::config ::http::formatQuery ::http::geturl ::http::reset ::http::wait ::http::register ::http::unregister ::http::mapReply}}}] +package ifneeded http 2.7.14 [list tclPkgSetup $dir http 2.7.14 {{http.tcl source {::http::config ::http::formatQuery ::http::geturl ::http::reset ::http::wait ::http::register ::http::unregister ::http::mapReply}}}] diff --git a/unix/Makefile.in b/unix/Makefile.in index fc5b03f..50f4bb3 100644 --- a/unix/Makefile.in +++ b/unix/Makefile.in @@ -776,8 +776,8 @@ install-libraries: libraries $(INSTALL_TZDATA) install-msgs do \ $(INSTALL_DATA) $$i "$(SCRIPT_INSTALL_DIR)"/http1.0; \ done; - @echo "Installing package http 2.7.13 as a Tcl Module"; - @$(INSTALL_DATA) $(TOP_DIR)/library/http/http.tcl "$(SCRIPT_INSTALL_DIR)"/../tcl8/8.4/http-2.7.13.tm; + @echo "Installing package http 2.7.14 as a Tcl Module"; + @$(INSTALL_DATA) $(TOP_DIR)/library/http/http.tcl "$(SCRIPT_INSTALL_DIR)"/../tcl8/8.4/http-2.7.14.tm; @echo "Installing package opt0.4 files to $(SCRIPT_INSTALL_DIR)/opt0.4/"; @for i in $(TOP_DIR)/library/opt/*.tcl ; \ do \ diff --git a/win/Makefile.in b/win/Makefile.in index 6376470..d9b52fa 100644 --- a/win/Makefile.in +++ b/win/Makefile.in @@ -650,8 +650,8 @@ install-libraries: libraries install-tzdata install-msgs do \ $(COPY) "$$j" "$(SCRIPT_INSTALL_DIR)/http1.0"; \ done; - @echo "Installing package http 2.7.13 as a Tcl Module"; - @$(COPY) $(ROOT_DIR)/library/http/http.tcl $(SCRIPT_INSTALL_DIR)/../tcl8/8.4/http-2.7.13.tm; + @echo "Installing package http 2.7.14 as a Tcl Module"; + @$(COPY) $(ROOT_DIR)/library/http/http.tcl $(SCRIPT_INSTALL_DIR)/../tcl8/8.4/http-2.7.14.tm; @echo "Installing library opt0.4 directory"; @for j in $(ROOT_DIR)/library/opt/*.tcl; \ do \ -- cgit v0.12 From 0f21498784cb704ce6098fcc71b786e422fb2b8d Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Fri, 4 Nov 2016 11:32:44 +0000 Subject: Make packages msgcat and tcltest work unmodified in "novem". --- library/msgcat/msgcat.tcl | 2 +- library/tcltest/tcltest.tcl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/library/msgcat/msgcat.tcl b/library/msgcat/msgcat.tcl index a43f13e..928474d 100644 --- a/library/msgcat/msgcat.tcl +++ b/library/msgcat/msgcat.tcl @@ -11,7 +11,7 @@ # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. -package require Tcl 8.5 +package require Tcl 8.5- # When the version number changes, be sure to update the pkgIndex.tcl file, # and the installation directory in the Makefiles. package provide msgcat 1.6.0 diff --git a/library/tcltest/tcltest.tcl b/library/tcltest/tcltest.tcl index cde2660..75975d2 100644 --- a/library/tcltest/tcltest.tcl +++ b/library/tcltest/tcltest.tcl @@ -16,7 +16,7 @@ # Contributions from Don Porter, NIST, 2002. (not subject to US copyright) # All rights reserved. -package require Tcl 8.5 ;# -verbose line uses [info frame] +package require Tcl 8.5- ;# -verbose line uses [info frame] namespace eval tcltest { # When the version number changes, be sure to update the pkgIndex.tcl file, -- cgit v0.12 From 6f7ca1db34f65411ee5779dcab9c0a0255adb713 Mon Sep 17 00:00:00 2001 From: gahr Date: Fri, 4 Nov 2016 14:21:04 +0000 Subject: [824752f10e] Avoid calling Tcl_SetObjResult if interp is NULL --- generic/tclListObj.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/generic/tclListObj.c b/generic/tclListObj.c index c4b5cfc..22f1960 100644 --- a/generic/tclListObj.c +++ b/generic/tclListObj.c @@ -855,8 +855,11 @@ Tcl_ListObjReplace( } if (objc > LIST_MAX - (numElems - count)) { - Tcl_SetObjResult(interp, Tcl_ObjPrintf( - "max length of a Tcl list (%d elements) exceeded", LIST_MAX)); + if (interp != NULL) { + Tcl_SetObjResult(interp, Tcl_ObjPrintf( + "max length of a Tcl list (%d elements) exceeded", + LIST_MAX)); + } return TCL_ERROR; } isShared = (listRepPtr->refCount > 1); -- cgit v0.12 From 09077eceec17bc1586d2aefe2c38b857425045e6 Mon Sep 17 00:00:00 2001 From: dgp Date: Fri, 4 Nov 2016 14:37:50 +0000 Subject: [824752f10e] More robust, portable check for integer overflow. --- generic/tclListObj.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/generic/tclListObj.c b/generic/tclListObj.c index 22f1960..e1dba8c 100644 --- a/generic/tclListObj.c +++ b/generic/tclListObj.c @@ -846,11 +846,8 @@ Tcl_ListObjReplace( } if (count < 0) { count = 0; - } else if (numElems < first+count || first+count < 0) { - /* - * The 'first+count < 0' condition here guards agains integer - * overflow in determining 'first+count' - */ + } else if (first > INT_MAX - count /* Handle integer overflow */ + || numElems < first+count) { count = numElems - first; } -- cgit v0.12 From 480c51780a02e0e4bb97435754100d850b948ffa Mon Sep 17 00:00:00 2001 From: dgp Date: Fri, 4 Nov 2016 14:48:36 +0000 Subject: [824752f10e] More robust, portable check for integer overflow. --- generic/tclListObj.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/generic/tclListObj.c b/generic/tclListObj.c index 2929423..344d0fd 100644 --- a/generic/tclListObj.c +++ b/generic/tclListObj.c @@ -897,11 +897,8 @@ Tcl_ListObjReplace( } if (count < 0) { count = 0; - } else if (numElems < first+count || first+count < 0) { - /* - * The 'first+count < 0' condition here guards agains integer - * overflow in determining 'first+count'. - */ + } else if (first > INT_MAX - count /* Handle integer overflow */ + || numElems < first+count) { count = numElems - first; } -- cgit v0.12 From 1c9ca6b643b52cbe7a965109dbda2a25c6aa65ff Mon Sep 17 00:00:00 2001 From: dgp Date: Fri, 4 Nov 2016 14:54:38 +0000 Subject: [8245752f10e] Use LIST_MAX instead of INT_MAX for unknown number of elements to the end of the list. --- generic/tclEnsemble.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generic/tclEnsemble.c b/generic/tclEnsemble.c index 6fedf29..c1b0890 100644 --- a/generic/tclEnsemble.c +++ b/generic/tclEnsemble.c @@ -3135,7 +3135,7 @@ TclCompileEnsemble( * any extra elements that might have been appended by failing * pathways above. */ - (void) Tcl_ListObjReplace(NULL, replaced, depth-1, INT_MAX, 0, NULL); + (void) Tcl_ListObjReplace(NULL, replaced, depth-1, LIST_MAX, 0, NULL); /* * TODO: Reconsider whether we ought to call CompileToInvokedCommand() -- cgit v0.12 From 5f1098561b5067a8f429be371166ed3b1e6189e4 Mon Sep 17 00:00:00 2001 From: dgp Date: Fri, 4 Nov 2016 21:29:30 +0000 Subject: First draft refactoring the [string first] functionality. --- generic/tclExecute.c | 4 +++ generic/tclInt.h | 2 ++ generic/tclStringObj.c | 84 ++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 90 insertions(+) diff --git a/generic/tclExecute.c b/generic/tclExecute.c index 83b83f1..5ea199d 100644 --- a/generic/tclExecute.c +++ b/generic/tclExecute.c @@ -5720,6 +5720,9 @@ TEBCresume( NEXT_INST_V(1, 3, 1); case INST_STR_FIND: +#if 1 + match = TclStringFind(OBJ_UNDER_TOS, OBJ_AT_TOS, 0); +#else ustring1 = Tcl_GetUnicodeFromObj(OBJ_AT_TOS, &length); /* Haystack */ ustring2 = Tcl_GetUnicodeFromObj(OBJ_UNDER_TOS, &length2);/* Needle */ @@ -5734,6 +5737,7 @@ TEBCresume( } } } +#endif TRACE(("%.20s %.20s => %d\n", O2S(OBJ_UNDER_TOS), O2S(OBJ_AT_TOS), match)); diff --git a/generic/tclInt.h b/generic/tclInt.h index 8a647f0..26592f9 100644 --- a/generic/tclInt.h +++ b/generic/tclInt.h @@ -3138,6 +3138,8 @@ MODULE_SCOPE void * TclStackRealloc(Tcl_Interp *interp, void *ptr, MODULE_SCOPE int TclStringCatObjv(Tcl_Interp *interp, int inPlace, int objc, Tcl_Obj *const objv[], Tcl_Obj **objPtrPtr); +MODULE_SCOPE int TclStringFind(Tcl_Obj *needle, Tcl_Obj *haystack, + unsigned int start); MODULE_SCOPE int TclStringMatch(const char *str, int strLen, const char *pattern, int ptnLen, int flags); MODULE_SCOPE int TclStringMatchObj(Tcl_Obj *stringObj, diff --git a/generic/tclStringObj.c b/generic/tclStringObj.c index b486106..6e1529c 100644 --- a/generic/tclStringObj.c +++ b/generic/tclStringObj.c @@ -2841,6 +2841,90 @@ TclStringCatObjv( /* *--------------------------------------------------------------------------- * + * TclStringFind -- + * + * Implements the [string first] operation. + * + * Results: + * If needle is found as a substring of haystack, the index of the + * first instance of such a find is returned. If needle is not present + * as a substring of haystack, -1 is returned. + * + * Side effects: + * needle and haystack may have their Tcl_ObjType changed. + * + *--------------------------------------------------------------------------- + */ + +int +TclStringFind( + Tcl_Obj *needle, + Tcl_Obj *haystack, + unsigned int start) +{ + int ln, lh; + + if (TclIsPureByteArray(needle) && TclIsPureByteArray(haystack)) { + unsigned char *end, *try, *bh; + unsigned char *bn = Tcl_GetByteArrayFromObj(needle, &ln); + + if (ln == 0) { + /* + * We don't find empty substrings. Bizarre! + * + * TODO: When we one day make this a true substring + * finder, change this to "return 0" + */ + return -1; + } + + bh = Tcl_GetByteArrayFromObj(haystack, &lh); + end = bh + lh; + + try = bh + start; + while (try + ln <= end) { + try = memchr(try, bn[0], end - try); + + if (try == NULL) { + return -1; + } + if (0 == memcmp(try+1, bn+1, ln-1)) { + return (try - bh); + } + try++; + } + return -1; + } + + /* TODO: Detect and optimize case with single byte chars only */ + + { + Tcl_UniChar *try, *end, *uh; + Tcl_UniChar *un = Tcl_GetUnicodeFromObj(needle, &ln); + + if (ln == 0) { + /* See above */ + return -1; + } + + uh = Tcl_GetUnicodeFromObj(haystack, &lh); + end = uh + lh; + + try = uh + start; + while (try + ln <= end) { + if ((*try == *un) + && (0 == memcmp(try+1, un+1, (ln-1)*sizeof(Tcl_UniChar)))) { + return (try - uh); + } + try++; + } + return -1; + } +} + +/* + *--------------------------------------------------------------------------- + * * TclStringObjReverse -- * * Implements the [string reverse] operation. -- cgit v0.12 From a4cbbc51f40fedd5a20c14571c23b10d5e311c8a Mon Sep 17 00:00:00 2001 From: dgp Date: Mon, 7 Nov 2016 19:28:25 +0000 Subject: Implement direct eval [string first] with the refactored engine. --- generic/tclCmdMZ.c | 78 +++++++----------------------------------------------- 1 file changed, 9 insertions(+), 69 deletions(-) diff --git a/generic/tclCmdMZ.c b/generic/tclCmdMZ.c index 10c2ef3..be77b1f 100644 --- a/generic/tclCmdMZ.c +++ b/generic/tclCmdMZ.c @@ -1176,8 +1176,7 @@ StringFirstCmd( int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { - Tcl_UniChar *needleStr, *haystackStr; - int match, start, needleLen, haystackLen; + int start = 0; if (objc < 3 || objc > 4) { Tcl_WrongNumArgs(interp, 1, objv, @@ -1185,82 +1184,23 @@ StringFirstCmd( return TCL_ERROR; } - /* - * We are searching haystackStr for the sequence needleStr. - */ - - match = -1; - start = 0; - haystackLen = -1; - - needleStr = Tcl_GetUnicodeFromObj(objv[1], &needleLen); - haystackStr = Tcl_GetUnicodeFromObj(objv[2], &haystackLen); - if (objc == 4) { - /* - * If a startIndex is specified, we will need to fast forward to that - * point in the string before we think about a match. - */ + int size = Tcl_GetCharLength(objv[2]); - if (TclGetIntForIndexM(interp, objv[3], haystackLen-1, - &start) != TCL_OK){ + if (TCL_OK != TclGetIntForIndexM(interp, objv[3], size - 1, &start)) { return TCL_ERROR; } - /* - * Reread to prevent shimmering problems. - */ - - needleStr = Tcl_GetUnicodeFromObj(objv[1], &needleLen); - haystackStr = Tcl_GetUnicodeFromObj(objv[2], &haystackLen); - - if (start >= haystackLen) { - goto str_first_done; - } else if (start > 0) { - haystackStr += start; - haystackLen -= start; - } else if (start < 0) { - /* - * Invalid start index mapped to string start; Bug #423581 - */ - + if (start < 0) { start = 0; } - } - - /* - * If the length of the needle is more than the length of the haystack, it - * cannot be contained in there so we can avoid searching. [Bug 2960021] - */ - - if (needleLen > 0 && needleLen <= haystackLen) { - register Tcl_UniChar *p, *end; - - end = haystackStr + haystackLen - needleLen + 1; - for (p = haystackStr; p < end; p++) { - /* - * Scan forward to find the first character. - */ - - if ((*p == *needleStr) && (memcmp(needleStr, p, - sizeof(Tcl_UniChar) * (size_t)needleLen) == 0)) { - match = p - haystackStr; - break; - } + if (start >= size) { + Tcl_SetObjResult(interp, Tcl_NewIntObj(-1)); + return TCL_OK; } } - - /* - * Compute the character index of the matching string by counting the - * number of characters before the match. - */ - - if ((match != -1) && (objc == 4)) { - match += start; - } - - str_first_done: - Tcl_SetObjResult(interp, Tcl_NewIntObj(match)); + Tcl_SetObjResult(interp, Tcl_NewIntObj(TclStringFind(objv[1], + objv[2], start))); return TCL_OK; } -- cgit v0.12 From b2c104021f192aefe7b82d283176e941b7f0a01e Mon Sep 17 00:00:00 2001 From: dgp Date: Mon, 7 Nov 2016 19:41:15 +0000 Subject: Consolidate the "find empty string" cases. --- generic/tclStringObj.c | 27 +++++++++++---------------- 1 file changed, 11 insertions(+), 16 deletions(-) diff --git a/generic/tclStringObj.c b/generic/tclStringObj.c index 6e1529c..0c0121e 100644 --- a/generic/tclStringObj.c +++ b/generic/tclStringObj.c @@ -2862,22 +2862,22 @@ TclStringFind( Tcl_Obj *haystack, unsigned int start) { - int ln, lh; + int lh, ln = Tcl_GetCharLength(needle); + + if (ln == 0) { + /* + * We don't find empty substrings. Bizarre! + * + * TODO: When we one day make this a true substring + * finder, change this to "return 0" + */ + return -1; + } if (TclIsPureByteArray(needle) && TclIsPureByteArray(haystack)) { unsigned char *end, *try, *bh; unsigned char *bn = Tcl_GetByteArrayFromObj(needle, &ln); - if (ln == 0) { - /* - * We don't find empty substrings. Bizarre! - * - * TODO: When we one day make this a true substring - * finder, change this to "return 0" - */ - return -1; - } - bh = Tcl_GetByteArrayFromObj(haystack, &lh); end = bh + lh; @@ -2902,11 +2902,6 @@ TclStringFind( Tcl_UniChar *try, *end, *uh; Tcl_UniChar *un = Tcl_GetUnicodeFromObj(needle, &ln); - if (ln == 0) { - /* See above */ - return -1; - } - uh = Tcl_GetUnicodeFromObj(haystack, &lh); end = uh + lh; -- cgit v0.12 From 96b75029d111bab1f01acea88795c774b96b4f6e Mon Sep 17 00:00:00 2001 From: dgp Date: Mon, 7 Nov 2016 20:04:22 +0000 Subject: Optimize case of all single-byte chars. --- generic/tclStringObj.c | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/generic/tclStringObj.c b/generic/tclStringObj.c index 0c0121e..edba881 100644 --- a/generic/tclStringObj.c +++ b/generic/tclStringObj.c @@ -2896,9 +2896,27 @@ TclStringFind( return -1; } - /* TODO: Detect and optimize case with single byte chars only */ + lh = Tcl_GetCharLength(haystack); + if (haystack->bytes && (lh == haystack->length)) { + /* haystack is all single-byte chars */ - { + if (needle->bytes && (ln == needle->length)) { + /* needle is also all single-byte chars */ + char *found = strstr(haystack->bytes + start, needle->bytes); + + if (found) { + return (found - haystack->bytes); + } else { + return -1; + } + } else { + /* + * Cannot find substring with a multi-byte char inside + * a string with no multi-byte chars. + */ + return -1; + } + } else { Tcl_UniChar *try, *end, *uh; Tcl_UniChar *un = Tcl_GetUnicodeFromObj(needle, &ln); -- cgit v0.12 From b1c86e9055e5384cf165f8e509583067d4b32796 Mon Sep 17 00:00:00 2001 From: dgp Date: Mon, 7 Nov 2016 20:18:30 +0000 Subject: Purge disabled code. --- generic/tclExecute.c | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/generic/tclExecute.c b/generic/tclExecute.c index 5ea199d..a44451f 100644 --- a/generic/tclExecute.c +++ b/generic/tclExecute.c @@ -5720,24 +5720,7 @@ TEBCresume( NEXT_INST_V(1, 3, 1); case INST_STR_FIND: -#if 1 match = TclStringFind(OBJ_UNDER_TOS, OBJ_AT_TOS, 0); -#else - ustring1 = Tcl_GetUnicodeFromObj(OBJ_AT_TOS, &length); /* Haystack */ - ustring2 = Tcl_GetUnicodeFromObj(OBJ_UNDER_TOS, &length2);/* Needle */ - - match = -1; - if (length2 > 0 && length2 <= length) { - end = ustring1 + length - length2 + 1; - for (p=ustring1 ; p %d\n", O2S(OBJ_UNDER_TOS), O2S(OBJ_AT_TOS), match)); -- cgit v0.12 From cad330bea5eb1c5fa6958b11506b10529846eb00 Mon Sep 17 00:00:00 2001 From: dgp Date: Tue, 8 Nov 2016 02:56:11 +0000 Subject: Route all [string last] operations through a common implementation. --- generic/tclCmdMZ.c | 67 +++++-------------------------- generic/tclExecute.c | 15 +------ generic/tclInt.h | 4 +- generic/tclStringObj.c | 106 ++++++++++++++++++++++++++++++++++++++++++++++++- tests/string.test | 4 +- 5 files changed, 122 insertions(+), 74 deletions(-) diff --git a/generic/tclCmdMZ.c b/generic/tclCmdMZ.c index be77b1f..e9a6933 100644 --- a/generic/tclCmdMZ.c +++ b/generic/tclCmdMZ.c @@ -1229,76 +1229,31 @@ StringLastCmd( int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { - Tcl_UniChar *needleStr, *haystackStr, *p; - int match, start, needleLen, haystackLen; + int last = INT_MAX - 1; if (objc < 3 || objc > 4) { Tcl_WrongNumArgs(interp, 1, objv, - "needleString haystackString ?startIndex?"); + "needleString haystackString ?lastIndex?"); return TCL_ERROR; } - /* - * We are searching haystackString for the sequence needleString. - */ - - match = -1; - start = 0; - haystackLen = -1; - - needleStr = Tcl_GetUnicodeFromObj(objv[1], &needleLen); - haystackStr = Tcl_GetUnicodeFromObj(objv[2], &haystackLen); - if (objc == 4) { - /* - * If a startIndex is specified, we will need to restrict the string - * range to that char index in the string - */ + int size = Tcl_GetCharLength(objv[2]); - if (TclGetIntForIndexM(interp, objv[3], haystackLen-1, - &start) != TCL_OK){ + if (TCL_OK != TclGetIntForIndexM(interp, objv[3], size - 1, &last)) { return TCL_ERROR; } - /* - * Reread to prevent shimmering problems. - */ - - needleStr = Tcl_GetUnicodeFromObj(objv[1], &needleLen); - haystackStr = Tcl_GetUnicodeFromObj(objv[2], &haystackLen); - - if (start < 0) { - goto str_last_done; - } else if (start < haystackLen) { - p = haystackStr + start + 1 - needleLen; - } else { - p = haystackStr + haystackLen - needleLen; + if (last < 0) { + Tcl_SetObjResult(interp, Tcl_NewIntObj(-1)); + return TCL_OK; } - } else { - p = haystackStr + haystackLen - needleLen; - } - - /* - * If the length of the needle is more than the length of the haystack, it - * cannot be contained in there so we can avoid searching. [Bug 2960021] - */ - - if (needleLen > 0 && needleLen <= haystackLen) { - for (; p >= haystackStr; p--) { - /* - * Scan backwards to find the first character. - */ - - if ((*p == *needleStr) && !memcmp(needleStr, p, - sizeof(Tcl_UniChar) * (size_t)needleLen)) { - match = p - haystackStr; - break; - } + if (last >= size) { + last = size - 1; } } - - str_last_done: - Tcl_SetObjResult(interp, Tcl_NewIntObj(match)); + Tcl_SetObjResult(interp, Tcl_NewIntObj(TclStringLast(objv[1], + objv[2], last))); return TCL_OK; } diff --git a/generic/tclExecute.c b/generic/tclExecute.c index a44451f..0d48071 100644 --- a/generic/tclExecute.c +++ b/generic/tclExecute.c @@ -5728,23 +5728,10 @@ TEBCresume( NEXT_INST_F(1, 2, 1); case INST_STR_FIND_LAST: - ustring1 = Tcl_GetUnicodeFromObj(OBJ_AT_TOS, &length); /* Haystack */ - ustring2 = Tcl_GetUnicodeFromObj(OBJ_UNDER_TOS, &length2);/* Needle */ - - match = -1; - if (length2 > 0 && length2 <= length) { - for (p=ustring1+length-length2 ; p>=ustring1 ; p--) { - if ((*p == *ustring2) && - memcmp(ustring2,p,sizeof(Tcl_UniChar)*length2) == 0) { - match = p - ustring1; - break; - } - } - } + match = TclStringLast(OBJ_UNDER_TOS, OBJ_AT_TOS, INT_MAX - 1); TRACE(("%.20s %.20s => %d\n", O2S(OBJ_UNDER_TOS), O2S(OBJ_AT_TOS), match)); - TclNewIntObj(objResultPtr, match); NEXT_INST_F(1, 2, 1); diff --git a/generic/tclInt.h b/generic/tclInt.h index 26592f9..e468f3d 100644 --- a/generic/tclInt.h +++ b/generic/tclInt.h @@ -3139,7 +3139,9 @@ MODULE_SCOPE int TclStringCatObjv(Tcl_Interp *interp, int inPlace, int objc, Tcl_Obj *const objv[], Tcl_Obj **objPtrPtr); MODULE_SCOPE int TclStringFind(Tcl_Obj *needle, Tcl_Obj *haystack, - unsigned int start); + int start); +MODULE_SCOPE int TclStringLast(Tcl_Obj *needle, Tcl_Obj *haystack, + int last); MODULE_SCOPE int TclStringMatch(const char *str, int strLen, const char *pattern, int ptnLen, int flags); MODULE_SCOPE int TclStringMatchObj(Tcl_Obj *stringObj, diff --git a/generic/tclStringObj.c b/generic/tclStringObj.c index edba881..f7791fe 100644 --- a/generic/tclStringObj.c +++ b/generic/tclStringObj.c @@ -2860,7 +2860,7 @@ int TclStringFind( Tcl_Obj *needle, Tcl_Obj *haystack, - unsigned int start) + int start) { int lh, ln = Tcl_GetCharLength(needle); @@ -2938,6 +2938,110 @@ TclStringFind( /* *--------------------------------------------------------------------------- * + * TclStringLast -- + * + * Implements the [string last] operation. + * + * Results: + * If needle is found as a substring of haystack, the index of the + * last instance of such a find is returned. If needle is not present + * as a substring of haystack, -1 is returned. + * + * Side effects: + * needle and haystack may have their Tcl_ObjType changed. + * + *--------------------------------------------------------------------------- + */ + +int +TclStringLast( + Tcl_Obj *needle, + Tcl_Obj *haystack, + int last) +{ + int lh, ln = Tcl_GetCharLength(needle); + + if (ln == 0) { + /* + * We don't find empty substrings. Bizarre! + * + * TODO: When we one day make this a true substring + * finder, change this to "return 0" + */ + return -1; + } + + if (ln > last + 1) { + return -1; + } + + if (TclIsPureByteArray(needle) && TclIsPureByteArray(haystack)) { + unsigned char *try, *bh; + unsigned char *bn = Tcl_GetByteArrayFromObj(needle, &ln); + + bh = Tcl_GetByteArrayFromObj(haystack, &lh); + + if (last + 1 > lh) { + last = lh - 1; + } + try = bh + last + 1 - ln; + while (try >= bh) { + if ((*try == bn[0]) + && (0 == memcmp(try+1, bn+1, ln-1))) { + return (try - bh); + } + try--; + } + return -1; + } + + lh = Tcl_GetCharLength(haystack); + if (last + 1 > lh) { + last = lh - 1; + } + if (haystack->bytes && (lh == haystack->length)) { + /* haystack is all single-byte chars */ + + if (needle->bytes && (ln == needle->length)) { + /* needle is also all single-byte chars */ + + char *try = haystack->bytes + last + 1 - ln; + while (try >= haystack->bytes) { + if ((*try == needle->bytes[0]) + && (0 == memcmp(try+1, needle->bytes + 1, ln - 1))) { + return (try - haystack->bytes); + } + try--; + } + return -1; + } else { + /* + * Cannot find substring with a multi-byte char inside + * a string with no multi-byte chars. + */ + return -1; + } + } else { + Tcl_UniChar *try, *uh; + Tcl_UniChar *un = Tcl_GetUnicodeFromObj(needle, &ln); + + uh = Tcl_GetUnicodeFromObj(haystack, &lh); + + try = uh + last + 1 - ln; + while (try >= uh) { + if ((*try == un[0]) + && (0 == memcmp(try+1, un+1, (ln-1)*sizeof(Tcl_UniChar)))) { + return (try - uh); + } + try--; + } + return -1; + } +} + +/* + *--------------------------------------------------------------------------- + * * TclStringObjReverse -- * * Implements the [string reverse] operation. diff --git a/tests/string.test b/tests/string.test index 5fdb510..11cbcff 100644 --- a/tests/string.test +++ b/tests/string.test @@ -756,13 +756,13 @@ catch {rename largest_int {}} test string-7.1 {string last, too few args} { list [catch {string last a} msg] $msg -} {1 {wrong # args: should be "string last needleString haystackString ?startIndex?"}} +} {1 {wrong # args: should be "string last needleString haystackString ?lastIndex?"}} test string-7.2 {string last, bad args} { list [catch {string last a b c} msg] $msg } {1 {bad index "c": must be integer?[+-]integer? or end?[+-]integer?}} test string-7.3 {string last, too many args} { list [catch {string last a b c d} msg] $msg -} {1 {wrong # args: should be "string last needleString haystackString ?startIndex?"}} +} {1 {wrong # args: should be "string last needleString haystackString ?lastIndex?"}} test string-7.4 {string last} { string la xxx xxxx123xx345x678 } 1 -- cgit v0.12 From 8d91041a73bf5f80947854d55f3d226494df1e45 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Thu, 10 Nov 2016 14:19:28 +0000 Subject: On OSX, there is a conflict with the "define panic" and definitions in "mach.h". --- generic/tcl.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/generic/tcl.h b/generic/tcl.h index 3037ceb..a8ebaed 100644 --- a/generic/tcl.h +++ b/generic/tcl.h @@ -2631,7 +2631,9 @@ EXTERN void Tcl_GetMemoryInfo(Tcl_DString *dsPtr); # define Tcl_Ckrealloc Tcl_Realloc # define Tcl_Return Tcl_SetResult # define Tcl_TildeSubst Tcl_TranslateFileName +#ifndef MAC_OSX_TCL /* On OSX, there is a conflict with "mach.h" */ # define panic Tcl_Panic +#endif # define panicVA Tcl_PanicVA #endif /* !TCL_NO_DEPRECATED */ -- cgit v0.12 From 5341582764e9fd525adc2b70e060a7c338dd5ee8 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Fri, 11 Nov 2016 10:53:10 +0000 Subject: Fix [79614fb8b61983ac8ef30ea8752c310465798fc7|79614fb8b6]: "glob", "encoding system" and encoding-free filesystems --- generic/tclEncoding.c | 3 ++- generic/tclIOUtil.c | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/generic/tclEncoding.c b/generic/tclEncoding.c index 54a49aa..6c16827 100644 --- a/generic/tclEncoding.c +++ b/generic/tclEncoding.c @@ -979,7 +979,7 @@ Tcl_GetEncodingNames( * Side effects: * The reference count of the new system encoding is incremented. The * reference count of the old system encoding is decremented and it may - * be freed. + * be freed. All VFS cached information is invalidated. * *------------------------------------------------------------------------ */ @@ -1010,6 +1010,7 @@ Tcl_SetSystemEncoding( FreeEncoding(systemEncoding); systemEncoding = encoding; Tcl_MutexUnlock(&encodingMutex); + Tcl_FSMountsChanged(NULL); return TCL_OK; } diff --git a/generic/tclIOUtil.c b/generic/tclIOUtil.c index 82ffd88..e1c5709 100644 --- a/generic/tclIOUtil.c +++ b/generic/tclIOUtil.c @@ -699,8 +699,8 @@ FsGetFirstFilesystem(void) } /* - * The epoch can be changed both by filesystems being added or removed and by - * env(HOME) changing. + * The epoch can be changed by filesystems being added or removed, by changing + * the "system encoding" and by env(HOME) changing. */ int -- cgit v0.12 From 5ce60a33287e4745db2567abbed8ae8cc909b8c2 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Fri, 11 Nov 2016 14:53:58 +0000 Subject: Fix harmless gcc warning message: using "unsigned" doesn't serve any purpose, actually. --- generic/tclInt.decls | 2 +- generic/tclIntPlatDecls.h | 12 ++++++------ generic/tclTest.c | 6 +++--- unix/tclUnixCompat.c | 4 ++-- win/tclWin32Dll.c | 4 ++-- win/tclWinTime.c | 2 +- 6 files changed, 15 insertions(+), 15 deletions(-) diff --git a/generic/tclInt.decls b/generic/tclInt.decls index c00dff1..8314925 100644 --- a/generic/tclInt.decls +++ b/generic/tclInt.decls @@ -1246,7 +1246,7 @@ declare 19 macosx { } declare 29 {win unix} { - int TclWinCPUID(unsigned int index, unsigned int *regs) + int TclWinCPUID(int index, int *regs) } # Added in 8.6; core of TclpOpenTemporaryFile declare 30 {win unix} { diff --git a/generic/tclIntPlatDecls.h b/generic/tclIntPlatDecls.h index ac06787..494d6f1 100644 --- a/generic/tclIntPlatDecls.h +++ b/generic/tclIntPlatDecls.h @@ -98,7 +98,7 @@ EXTERN int TclUnixCopyFile(const char *src, const char *dst, /* Slot 27 is reserved */ /* Slot 28 is reserved */ /* 29 */ -EXTERN int TclWinCPUID(unsigned int index, unsigned int *regs); +EXTERN int TclWinCPUID(int index, int *regs); /* 30 */ EXTERN int TclUnixOpenTemporaryFile(Tcl_Obj *dirObj, Tcl_Obj *basenameObj, Tcl_Obj *extensionObj, @@ -173,7 +173,7 @@ EXTERN void TclWinFlushDirtyChannels(void); /* 28 */ EXTERN void TclWinResetInterfaces(void); /* 29 */ -EXTERN int TclWinCPUID(unsigned int index, unsigned int *regs); +EXTERN int TclWinCPUID(int index, int *regs); /* 30 */ EXTERN int TclUnixOpenTemporaryFile(Tcl_Obj *dirObj, Tcl_Obj *basenameObj, Tcl_Obj *extensionObj, @@ -247,7 +247,7 @@ EXTERN void TclMacOSXNotifierAddRunLoopMode( /* Slot 27 is reserved */ /* Slot 28 is reserved */ /* 29 */ -EXTERN int TclWinCPUID(unsigned int index, unsigned int *regs); +EXTERN int TclWinCPUID(int index, int *regs); /* 30 */ EXTERN int TclUnixOpenTemporaryFile(Tcl_Obj *dirObj, Tcl_Obj *basenameObj, Tcl_Obj *extensionObj, @@ -288,7 +288,7 @@ typedef struct TclIntPlatStubs { void (*reserved26)(void); void (*reserved27)(void); void (*reserved28)(void); - int (*tclWinCPUID) (unsigned int index, unsigned int *regs); /* 29 */ + int (*tclWinCPUID) (int index, int *regs); /* 29 */ int (*tclUnixOpenTemporaryFile) (Tcl_Obj *dirObj, Tcl_Obj *basenameObj, Tcl_Obj *extensionObj, Tcl_Obj *resultingNameObj); /* 30 */ #endif /* UNIX */ #if defined(_WIN32) || defined(__CYGWIN__) /* WIN */ @@ -321,7 +321,7 @@ typedef struct TclIntPlatStubs { void (*tclWinSetInterfaces) (int wide); /* 26 */ void (*tclWinFlushDirtyChannels) (void); /* 27 */ void (*tclWinResetInterfaces) (void); /* 28 */ - int (*tclWinCPUID) (unsigned int index, unsigned int *regs); /* 29 */ + int (*tclWinCPUID) (int index, int *regs); /* 29 */ int (*tclUnixOpenTemporaryFile) (Tcl_Obj *dirObj, Tcl_Obj *basenameObj, Tcl_Obj *extensionObj, Tcl_Obj *resultingNameObj); /* 30 */ #endif /* WIN */ #ifdef MAC_OSX_TCL /* MACOSX */ @@ -354,7 +354,7 @@ typedef struct TclIntPlatStubs { void (*reserved26)(void); void (*reserved27)(void); void (*reserved28)(void); - int (*tclWinCPUID) (unsigned int index, unsigned int *regs); /* 29 */ + int (*tclWinCPUID) (int index, int *regs); /* 29 */ int (*tclUnixOpenTemporaryFile) (Tcl_Obj *dirObj, Tcl_Obj *basenameObj, Tcl_Obj *extensionObj, Tcl_Obj *resultingNameObj); /* 30 */ #endif /* MACOSX */ } TclIntPlatStubs; diff --git a/generic/tclTest.c b/generic/tclTest.c index 47d85e1..e30c4d0 100644 --- a/generic/tclTest.c +++ b/generic/tclTest.c @@ -6751,7 +6751,7 @@ TestcpuidCmd( Tcl_Obj *const * objv) /* Parameter vector */ { int status, index, i; - unsigned int regs[4]; + int regs[4]; Tcl_Obj *regsObjs[4]; if (objc != 2) { @@ -6761,14 +6761,14 @@ TestcpuidCmd( if (Tcl_GetIntFromObj(interp, objv[1], &index) != TCL_OK) { return TCL_ERROR; } - status = TclWinCPUID((unsigned) index, regs); + status = TclWinCPUID(index, regs); if (status != TCL_OK) { Tcl_SetObjResult(interp, Tcl_NewStringObj("operation not available", -1)); return status; } for (i=0 ; i<4 ; ++i) { - regsObjs[i] = Tcl_NewIntObj((int) regs[i]); + regsObjs[i] = Tcl_NewIntObj(regs[i]); } Tcl_SetObjResult(interp, Tcl_NewListObj(4, regsObjs)); return TCL_OK; diff --git a/unix/tclUnixCompat.c b/unix/tclUnixCompat.c index 1247061..ea6067e 100644 --- a/unix/tclUnixCompat.c +++ b/unix/tclUnixCompat.c @@ -988,8 +988,8 @@ CopyString( int TclWinCPUID( - unsigned int index, /* Which CPUID value to retrieve. */ - unsigned int *regsPtr) /* Registers after the CPUID. */ + int index, /* Which CPUID value to retrieve. */ + int *regsPtr) /* Registers after the CPUID. */ { int status = TCL_ERROR; diff --git a/win/tclWin32Dll.c b/win/tclWin32Dll.c index 688fa8d..d8a8717 100644 --- a/win/tclWin32Dll.c +++ b/win/tclWin32Dll.c @@ -603,8 +603,8 @@ Tcl_WinTCharToUtf( int TclWinCPUID( - unsigned int index, /* Which CPUID value to retrieve. */ - unsigned int *regsPtr) /* Registers after the CPUID. */ + int index, /* Which CPUID value to retrieve. */ + int *regsPtr) /* Registers after the CPUID. */ { int status = TCL_ERROR; diff --git a/win/tclWinTime.c b/win/tclWinTime.c index 7b5c18a..f4e08fa 100644 --- a/win/tclWinTime.c +++ b/win/tclWinTime.c @@ -341,7 +341,7 @@ NativeGetTime( */ SYSTEM_INFO systemInfo; - unsigned int regs[4]; + int regs[4]; GetSystemInfo(&systemInfo); if (TclWinCPUID(0, regs) == TCL_OK -- cgit v0.12 From afdcf4fe9ca39a7388f020b9a44fb487547195e7 Mon Sep 17 00:00:00 2001 From: venkat Date: Sat, 12 Nov 2016 11:18:31 +0000 Subject: Update to tzdata2016i from IETF --- library/tzdata/Antarctica/Casey | 1 + library/tzdata/Europe/Malta | 28 +++--- library/tzdata/Europe/Rome | 33 +++---- library/tzdata/Pacific/Tongatapu | 185 +++++++++++++++++++++++++++++++++++++-- 4 files changed, 208 insertions(+), 39 deletions(-) diff --git a/library/tzdata/Antarctica/Casey b/library/tzdata/Antarctica/Casey index 3035ab9..beb0f9e 100644 --- a/library/tzdata/Antarctica/Casey +++ b/library/tzdata/Antarctica/Casey @@ -7,4 +7,5 @@ set TZData(:Antarctica/Casey) { {1267714800 28800 0 +08} {1319738400 39600 0 +11} {1329843600 28800 0 +08} + {1477065600 39600 0 +11} } diff --git a/library/tzdata/Europe/Malta b/library/tzdata/Europe/Malta index b84f68e..0ebe2f6 100644 --- a/library/tzdata/Europe/Malta +++ b/library/tzdata/Europe/Malta @@ -3,23 +3,23 @@ set TZData(:Europe/Malta) { {-9223372036854775808 3484 0 LMT} {-2403478684 3600 0 CET} - {-1690851600 7200 1 CEST} - {-1680483600 3600 0 CET} + {-1690765200 7200 1 CEST} + {-1680487200 3600 0 CET} {-1664758800 7200 1 CEST} - {-1649034000 3600 0 CET} + {-1648951200 3600 0 CET} {-1635123600 7200 1 CEST} - {-1616979600 3600 0 CET} + {-1616896800 3600 0 CET} {-1604278800 7200 1 CEST} - {-1585530000 3600 0 CET} + {-1585533600 3600 0 CET} {-1571014800 7200 1 CEST} - {-1555290000 3600 0 CET} + {-1555293600 3600 0 CET} {-932432400 7200 1 CEST} {-857257200 3600 0 CET} {-844556400 7200 1 CEST} {-828226800 3600 0 CET} - {-812502000 7200 1 CEST} - {-796777200 3600 0 CET} - {-781052400 7200 0 CEST} + {-812588400 7200 1 CEST} + {-798073200 3600 0 CET} + {-781052400 7200 1 CEST} {-766717200 3600 0 CET} {-750898800 7200 1 CEST} {-733359600 3600 0 CET} @@ -30,17 +30,17 @@ set TZData(:Europe/Malta) { {-114051600 7200 1 CEST} {-103168800 3600 0 CET} {-81997200 7200 1 CEST} - {-71719200 3600 0 CET} + {-71715600 3600 0 CET} {-50547600 7200 1 CEST} - {-40269600 3600 0 CET} + {-40266000 3600 0 CET} {-18493200 7200 1 CEST} - {-8215200 3600 0 CET} + {-8211600 3600 0 CET} {12956400 7200 1 CEST} - {23234400 3600 0 CET} + {23238000 3600 0 CET} {43801200 7200 1 CEST} {54687600 3600 0 CET} {75855600 7200 1 CEST} - {86738400 3600 0 CET} + {86742000 3600 0 CET} {102380400 7200 0 CEST} {118105200 3600 0 CET} {135730800 7200 1 CEST} diff --git a/library/tzdata/Europe/Rome b/library/tzdata/Europe/Rome index 64948b8..f53340c 100644 --- a/library/tzdata/Europe/Rome +++ b/library/tzdata/Europe/Rome @@ -3,24 +3,25 @@ set TZData(:Europe/Rome) { {-9223372036854775808 2996 0 LMT} {-3259097396 2996 0 RMT} - {-2403564596 3600 0 CET} - {-1690851600 7200 1 CEST} - {-1680483600 3600 0 CET} + {-2403565200 3600 0 CET} + {-1690765200 7200 1 CEST} + {-1680487200 3600 0 CET} {-1664758800 7200 1 CEST} - {-1649034000 3600 0 CET} + {-1648951200 3600 0 CET} {-1635123600 7200 1 CEST} - {-1616979600 3600 0 CET} + {-1616896800 3600 0 CET} {-1604278800 7200 1 CEST} - {-1585530000 3600 0 CET} + {-1585533600 3600 0 CET} {-1571014800 7200 1 CEST} - {-1555290000 3600 0 CET} + {-1555293600 3600 0 CET} {-932432400 7200 1 CEST} {-857257200 3600 0 CET} {-844556400 7200 1 CEST} + {-830307600 7200 0 CEST} {-828226800 3600 0 CET} {-812502000 7200 1 CEST} - {-804819600 3600 0 CET} - {-798080400 3600 0 CET} + {-807152400 7200 0 CEST} + {-798073200 3600 0 CET} {-781052400 7200 1 CEST} {-766717200 3600 0 CET} {-750898800 7200 1 CEST} @@ -32,21 +33,21 @@ set TZData(:Europe/Rome) { {-114051600 7200 1 CEST} {-103168800 3600 0 CET} {-81997200 7200 1 CEST} - {-71719200 3600 0 CET} + {-71715600 3600 0 CET} {-50547600 7200 1 CEST} - {-40269600 3600 0 CET} + {-40266000 3600 0 CET} {-18493200 7200 1 CEST} - {-8215200 3600 0 CET} + {-8211600 3600 0 CET} {12956400 7200 1 CEST} - {23234400 3600 0 CET} + {23238000 3600 0 CET} {43801200 7200 1 CEST} {54687600 3600 0 CET} {75855600 7200 1 CEST} - {86738400 3600 0 CET} + {86742000 3600 0 CET} {107910000 7200 1 CEST} - {118188000 3600 0 CET} + {118191600 3600 0 CET} {138754800 7200 1 CEST} - {149637600 3600 0 CET} + {149641200 3600 0 CET} {170809200 7200 1 CEST} {181090800 3600 0 CET} {202258800 7200 1 CEST} diff --git a/library/tzdata/Pacific/Tongatapu b/library/tzdata/Pacific/Tongatapu index da9f857..731b4f6 100644 --- a/library/tzdata/Pacific/Tongatapu +++ b/library/tzdata/Pacific/Tongatapu @@ -2,13 +2,180 @@ set TZData(:Pacific/Tongatapu) { {-9223372036854775808 44360 0 LMT} - {-2177497160 44400 0 TOT} - {-915193200 46800 0 TOT} - {915102000 46800 0 TOT} - {939214800 50400 1 TOST} - {953384400 46800 0 TOT} - {973342800 50400 1 TOST} - {980596800 46800 0 TOT} - {1004792400 50400 1 TOST} - {1012046400 46800 0 TOT} + {-2177497160 44400 0 +1220} + {-915193200 46800 0 +13} + {915102000 46800 0 +13} + {939214800 50400 1 +14} + {953384400 46800 0 +13} + {973342800 50400 1 +14} + {980596800 46800 0 +13} + {1004792400 50400 1 +14} + {1012046400 46800 0 +13} + {1478350800 50400 1 +14} + {1484398800 46800 0 +13} + {1509800400 50400 1 +14} + {1516453200 46800 0 +13} + {1541250000 50400 1 +14} + {1547902800 46800 0 +13} + {1572699600 50400 1 +14} + {1579352400 46800 0 +13} + {1604149200 50400 1 +14} + {1610802000 46800 0 +13} + {1636203600 50400 1 +14} + {1642251600 46800 0 +13} + {1667653200 50400 1 +14} + {1673701200 46800 0 +13} + {1699102800 50400 1 +14} + {1705755600 46800 0 +13} + {1730552400 50400 1 +14} + {1737205200 46800 0 +13} + {1762002000 50400 1 +14} + {1768654800 46800 0 +13} + {1793451600 50400 1 +14} + {1800104400 46800 0 +13} + {1825506000 50400 1 +14} + {1831554000 46800 0 +13} + {1856955600 50400 1 +14} + {1863608400 46800 0 +13} + {1888405200 50400 1 +14} + {1895058000 46800 0 +13} + {1919854800 50400 1 +14} + {1926507600 46800 0 +13} + {1951304400 50400 1 +14} + {1957957200 46800 0 +13} + {1983358800 50400 1 +14} + {1989406800 46800 0 +13} + {2014808400 50400 1 +14} + {2020856400 46800 0 +13} + {2046258000 50400 1 +14} + {2052910800 46800 0 +13} + {2077707600 50400 1 +14} + {2084360400 46800 0 +13} + {2109157200 50400 1 +14} + {2115810000 46800 0 +13} + {2140606800 50400 1 +14} + {2147259600 46800 0 +13} + {2172661200 50400 1 +14} + {2178709200 46800 0 +13} + {2204110800 50400 1 +14} + {2210158800 46800 0 +13} + {2235560400 50400 1 +14} + {2242213200 46800 0 +13} + {2267010000 50400 1 +14} + {2273662800 46800 0 +13} + {2298459600 50400 1 +14} + {2305112400 46800 0 +13} + {2329909200 50400 1 +14} + {2336562000 46800 0 +13} + {2361963600 50400 1 +14} + {2368011600 46800 0 +13} + {2393413200 50400 1 +14} + {2400066000 46800 0 +13} + {2424862800 50400 1 +14} + {2431515600 46800 0 +13} + {2456312400 50400 1 +14} + {2462965200 46800 0 +13} + {2487762000 50400 1 +14} + {2494414800 46800 0 +13} + {2519816400 50400 1 +14} + {2525864400 46800 0 +13} + {2551266000 50400 1 +14} + {2557314000 46800 0 +13} + {2582715600 50400 1 +14} + {2589368400 46800 0 +13} + {2614165200 50400 1 +14} + {2620818000 46800 0 +13} + {2645614800 50400 1 +14} + {2652267600 46800 0 +13} + {2677064400 50400 1 +14} + {2683717200 46800 0 +13} + {2709118800 50400 1 +14} + {2715166800 46800 0 +13} + {2740568400 50400 1 +14} + {2747221200 46800 0 +13} + {2772018000 50400 1 +14} + {2778670800 46800 0 +13} + {2803467600 50400 1 +14} + {2810120400 46800 0 +13} + {2834917200 50400 1 +14} + {2841570000 46800 0 +13} + {2866971600 50400 1 +14} + {2873019600 46800 0 +13} + {2898421200 50400 1 +14} + {2904469200 46800 0 +13} + {2929870800 50400 1 +14} + {2936523600 46800 0 +13} + {2961320400 50400 1 +14} + {2967973200 46800 0 +13} + {2992770000 50400 1 +14} + {2999422800 46800 0 +13} + {3024219600 50400 1 +14} + {3030872400 46800 0 +13} + {3056274000 50400 1 +14} + {3062322000 46800 0 +13} + {3087723600 50400 1 +14} + {3093771600 46800 0 +13} + {3119173200 50400 1 +14} + {3125826000 46800 0 +13} + {3150622800 50400 1 +14} + {3157275600 46800 0 +13} + {3182072400 50400 1 +14} + {3188725200 46800 0 +13} + {3213522000 50400 1 +14} + {3220174800 46800 0 +13} + {3245576400 50400 1 +14} + {3251624400 46800 0 +13} + {3277026000 50400 1 +14} + {3283678800 46800 0 +13} + {3308475600 50400 1 +14} + {3315128400 46800 0 +13} + {3339925200 50400 1 +14} + {3346578000 46800 0 +13} + {3371374800 50400 1 +14} + {3378027600 46800 0 +13} + {3403429200 50400 1 +14} + {3409477200 46800 0 +13} + {3434878800 50400 1 +14} + {3440926800 46800 0 +13} + {3466328400 50400 1 +14} + {3472981200 46800 0 +13} + {3497778000 50400 1 +14} + {3504430800 46800 0 +13} + {3529227600 50400 1 +14} + {3535880400 46800 0 +13} + {3560677200 50400 1 +14} + {3567330000 46800 0 +13} + {3592731600 50400 1 +14} + {3598779600 46800 0 +13} + {3624181200 50400 1 +14} + {3630834000 46800 0 +13} + {3655630800 50400 1 +14} + {3662283600 46800 0 +13} + {3687080400 50400 1 +14} + {3693733200 46800 0 +13} + {3718530000 50400 1 +14} + {3725182800 46800 0 +13} + {3750584400 50400 1 +14} + {3756632400 46800 0 +13} + {3782034000 50400 1 +14} + {3788082000 46800 0 +13} + {3813483600 50400 1 +14} + {3820136400 46800 0 +13} + {3844933200 50400 1 +14} + {3851586000 46800 0 +13} + {3876382800 50400 1 +14} + {3883035600 46800 0 +13} + {3907832400 50400 1 +14} + {3914485200 46800 0 +13} + {3939886800 50400 1 +14} + {3945934800 46800 0 +13} + {3971336400 50400 1 +14} + {3977384400 46800 0 +13} + {4002786000 50400 1 +14} + {4009438800 46800 0 +13} + {4034235600 50400 1 +14} + {4040888400 46800 0 +13} + {4065685200 50400 1 +14} + {4072338000 46800 0 +13} + {4097134800 50400 1 +14} } -- cgit v0.12 From a9263ba9069329f5c9f64a6a965cfce12f18ab15 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Mon, 14 Nov 2016 14:20:13 +0000 Subject: Better fix for the usability of TCL_NO_DEPRECATED on MacOSX. --- generic/tcl.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/generic/tcl.h b/generic/tcl.h index 4fb5bb2..f79eb86 100644 --- a/generic/tcl.h +++ b/generic/tcl.h @@ -2418,7 +2418,9 @@ EXTERN void Tcl_GetMemoryInfo _ANSI_ARGS_((Tcl_DString *dsPtr)); # define Tcl_Ckrealloc Tcl_Realloc # define Tcl_Return Tcl_SetResult # define Tcl_TildeSubst Tcl_TranslateFileName +#if !defined(__APPLE__) /* On OSX, there is a conflict with "mach/mach.h" */ # define panic Tcl_Panic +#endif # define panicVA Tcl_PanicVA #endif -- cgit v0.12 From def4c8ce29b135940f12eb623a5bebb5bafd67fa Mon Sep 17 00:00:00 2001 From: dgp Date: Mon, 14 Nov 2016 17:01:37 +0000 Subject: See Itcl Bug [1b28657c0e]. The methodNameType fails to honor the Tcl_ObjType contract. Need dkf review on suitability of this fix. --- generic/tclOOCall.c | 1 + 1 file changed, 1 insertion(+) diff --git a/generic/tclOOCall.c b/generic/tclOOCall.c index 1797760..814fb0b 100644 --- a/generic/tclOOCall.c +++ b/generic/tclOOCall.c @@ -179,6 +179,7 @@ StashCallChain( CallChain *callPtr) { callPtr->refCount++; + Tcl_GetString(objPtr); TclFreeIntRep(objPtr); objPtr->typePtr = &methodNameType; objPtr->internalRep.twoPtrValue.ptr1 = callPtr; -- cgit v0.12 From 47302d8e0457f8f002223bf6c5536f9226fbd59c Mon Sep 17 00:00:00 2001 From: dkf Date: Tue, 15 Nov 2016 13:31:02 +0000 Subject: Slightly more efficient version as this is Hot Path code. --- generic/tclOOCall.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generic/tclOOCall.c b/generic/tclOOCall.c index 814fb0b..8003345 100644 --- a/generic/tclOOCall.c +++ b/generic/tclOOCall.c @@ -179,7 +179,7 @@ StashCallChain( CallChain *callPtr) { callPtr->refCount++; - Tcl_GetString(objPtr); + TclGetString(objPtr); TclFreeIntRep(objPtr); objPtr->typePtr = &methodNameType; objPtr->internalRep.twoPtrValue.ptr1 = callPtr; -- cgit v0.12 From 29606e4a7b43adb9f923fb5781d3b9a93d9ba1c8 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Wed, 16 Nov 2016 10:55:40 +0000 Subject: Use more "size_t" in stead of "int" internall. Also eliminate a lot of type-casts which are not necessary any more. --- compat/opendir.c | 2 +- compat/waitpid.c | 2 +- generic/tclBasic.c | 18 +++++++++--------- generic/tclCompCmdsSZ.c | 8 ++++---- generic/tclCompile.c | 8 ++++---- generic/tclConfig.c | 8 ++++---- generic/tclEncoding.c | 22 +++++++++++----------- generic/tclEnsemble.c | 2 +- generic/tclExecute.c | 8 ++++---- generic/tclIORChan.c | 18 +++++++++--------- generic/tclIORTrans.c | 26 +++++++++++++------------- generic/tclInt.h | 26 +++++++++++++------------- generic/tclListObj.c | 2 +- generic/tclOODefineCmds.c | 12 ++++++------ generic/tclOOInt.h | 2 +- generic/tclUtil.c | 27 +++++++++++++-------------- macosx/tclMacOSXFCmd.c | 6 +++--- unix/tclUnixInit.c | 9 +++++---- unix/tclUnixSock.c | 6 +++--- win/tclWin32Dll.c | 2 +- win/tclWinInit.c | 17 +++++++++-------- win/tclWinPort.h | 2 +- win/tclWinSock.c | 6 +++--- win/tclWinThrd.c | 2 +- 24 files changed, 121 insertions(+), 120 deletions(-) diff --git a/compat/opendir.c b/compat/opendir.c index 22e8a3a..7a49566 100644 --- a/compat/opendir.c +++ b/compat/opendir.c @@ -106,5 +106,5 @@ closedir( close(dirp->dd_fd); dirp->dd_fd = -1; dirp->dd_loc = 0; - ckfree((char *) dirp); + ckfree(dirp); } diff --git a/compat/waitpid.c b/compat/waitpid.c index e03275a..d4473a8 100644 --- a/compat/waitpid.c +++ b/compat/waitpid.c @@ -100,7 +100,7 @@ waitpid( } else { prevPtr->nextPtr = waitPtr->nextPtr; } - ckfree((char *) waitPtr); + ckfree(waitPtr); return result; } diff --git a/generic/tclBasic.c b/generic/tclBasic.c index 53023d8..39f2dd4 100644 --- a/generic/tclBasic.c +++ b/generic/tclBasic.c @@ -966,11 +966,11 @@ Tcl_CreateInterp(void) Tcl_PkgProvideEx(interp, "Tcl", TCL_PATCH_LEVEL, &tclStubs); if (TclTommath_Init(interp) != TCL_OK) { - Tcl_Panic("%s", Tcl_GetString(Tcl_GetObjResult(interp))); + Tcl_Panic("%s", TclGetString(Tcl_GetObjResult(interp))); } if (TclOOInit(interp) != TCL_OK) { - Tcl_Panic("%s", Tcl_GetString(Tcl_GetObjResult(interp))); + Tcl_Panic("%s", TclGetString(Tcl_GetObjResult(interp))); } /* @@ -980,7 +980,7 @@ Tcl_CreateInterp(void) #ifdef HAVE_ZLIB if (TclZlibInit(interp) != TCL_OK) { - Tcl_Panic("%s", Tcl_GetString(Tcl_GetObjResult(interp))); + Tcl_Panic("%s", TclGetString(Tcl_GetObjResult(interp))); } #endif @@ -1635,7 +1635,7 @@ DeleteInterpProc( } Tcl_DeleteHashTable(iPtr->lineLAPtr); - ckfree((char *) iPtr->lineLAPtr); + ckfree(iPtr->lineLAPtr); iPtr->lineLAPtr = NULL; if (iPtr->lineLABCPtr->numEntries && !TclInExit()) { @@ -2403,7 +2403,7 @@ TclInvokeStringCommand( TclStackAlloc(interp, (unsigned)(objc + 1) * sizeof(char *)); for (i = 0; i < objc; i++) { - argv[i] = Tcl_GetString(objv[i]); + argv[i] = TclGetString(objv[i]); } argv[objc] = 0; @@ -2657,7 +2657,7 @@ TclRenameCommand( } Tcl_DStringAppend(&newFullName, newTail, -1); cmdPtr->refCount++; - CallCommandTraces(iPtr, cmdPtr, Tcl_GetString(oldFullName), + CallCommandTraces(iPtr, cmdPtr, TclGetString(oldFullName), Tcl_DStringValue(&newFullName), TCL_TRACE_RENAME); Tcl_DStringFree(&newFullName); @@ -3523,7 +3523,7 @@ OldMathFuncProc( Tcl_SetObjResult(interp, Tcl_NewStringObj( "argument to math function didn't have numeric value", -1)); - TclCheckBadOctal(interp, Tcl_GetString(valuePtr)); + TclCheckBadOctal(interp, TclGetString(valuePtr)); ckfree(args); return TCL_ERROR; } @@ -7884,7 +7884,7 @@ MathFuncWrongNumArgs( int found, /* Actual parameter count. */ Tcl_Obj *const *objv) /* Actual parameter vector. */ { - const char *name = Tcl_GetString(objv[0]); + const char *name = TclGetString(objv[0]); const char *tail = name + strlen(name); while (tail > name+1) { @@ -8817,7 +8817,7 @@ TclNRInterpCoroutine( if (!COR_IS_SUSPENDED(corPtr)) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "coroutine \"%s\" is already running", - Tcl_GetString(objv[0]))); + TclGetString(objv[0]))); Tcl_SetErrorCode(interp, "TCL", "COROUTINE", "BUSY", NULL); return TCL_ERROR; } diff --git a/generic/tclCompCmdsSZ.c b/generic/tclCompCmdsSZ.c index 10b3cc8..25d10d6 100644 --- a/generic/tclCompCmdsSZ.c +++ b/generic/tclCompCmdsSZ.c @@ -1902,10 +1902,10 @@ TclCompileSwitchCmd( } if (numWords % 2) { abort: - ckfree((char *) bodyToken); - ckfree((char *) bodyTokenArray); - ckfree((char *) bodyLines); - ckfree((char *) bodyContLines); + ckfree(bodyToken); + ckfree(bodyTokenArray); + ckfree(bodyLines); + ckfree(bodyContLines); return TCL_ERROR; } } else if (numWords % 2 || numWords == 0) { diff --git a/generic/tclCompile.c b/generic/tclCompile.c index c588731..c02a940 100644 --- a/generic/tclCompile.c +++ b/generic/tclCompile.c @@ -1380,14 +1380,14 @@ ReleaseCmdWordData( Tcl_DecrRefCount(eclPtr->path); } for (i=0 ; inuloc ; i++) { - ckfree((char *) eclPtr->loc[i].line); + ckfree(eclPtr->loc[i].line); } if (eclPtr->loc != NULL) { - ckfree((char *) eclPtr->loc); + ckfree(eclPtr->loc); } - ckfree((char *) eclPtr); + ckfree(eclPtr); } /* @@ -1801,7 +1801,7 @@ CompileCmdLiteral( extraLiteralFlags |= LITERAL_UNSHARED; } - bytes = Tcl_GetStringFromObj(cmdObj, &numBytes); + bytes = TclGetStringFromObj(cmdObj, &numBytes); cmdLitIdx = TclRegisterLiteral(envPtr, bytes, numBytes, extraLiteralFlags); if (cmdPtr) { diff --git a/generic/tclConfig.c b/generic/tclConfig.c index 2fb3e92..eb6807c 100644 --- a/generic/tclConfig.c +++ b/generic/tclConfig.c @@ -232,7 +232,7 @@ QueryConfigObjCmd( Tcl_SetObjResult(interp, Tcl_NewStringObj("package not known", -1)); Tcl_SetErrorCode(interp, "TCL", "FATAL", "PKGCFG_BASE", - Tcl_GetString(pkgName), NULL); + TclGetString(pkgName), NULL); return TCL_ERROR; } @@ -247,7 +247,7 @@ QueryConfigObjCmd( || val == NULL) { Tcl_SetObjResult(interp, Tcl_NewStringObj("key not known", -1)); Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "CONFIG", - Tcl_GetString(objv[2]), NULL); + TclGetString(objv[2]), NULL); return TCL_ERROR; } @@ -333,9 +333,9 @@ QueryConfigDelete( Tcl_DictObjRemove(NULL, pDB, pkgName); Tcl_DecrRefCount(pkgName); if (cdPtr->encoding) { - ckfree((char *)cdPtr->encoding); + ckfree(cdPtr->encoding); } - ckfree((char *)cdPtr); + ckfree(cdPtr); } /* diff --git a/generic/tclEncoding.c b/generic/tclEncoding.c index 42be211..8a4dc3b 100644 --- a/generic/tclEncoding.c +++ b/generic/tclEncoding.c @@ -305,7 +305,7 @@ Tcl_GetEncodingFromObj( Tcl_Obj *objPtr, Tcl_Encoding *encodingPtr) { - const char *name = Tcl_GetString(objPtr); + const char *name = TclGetString(objPtr); if (objPtr->typePtr != &encodingType) { Tcl_Encoding encoding = Tcl_GetEncoding(interp, name); @@ -705,7 +705,7 @@ Tcl_GetDefaultEncodingDir(void) } Tcl_ListObjIndex(NULL, searchPath, 0, &first); - return Tcl_GetString(first); + return TclGetString(first); } /* @@ -1519,10 +1519,10 @@ OpenEncodingFileChannel( } } if (!verified) { - const char *dirString = Tcl_GetString(directory); + const char *dirString = TclGetString(directory); for (i=0; itoUnicode[hi] = pageMemPtr; p += 2; @@ -3600,11 +3600,11 @@ unilen( static void InitializeEncodingSearchPath( char **valuePtr, - int *lengthPtr, + size_t *lengthPtr, Tcl_Encoding *encodingPtr) { const char *bytes; - int i, numDirs, numBytes; + int i, numDirs; Tcl_Obj *libPathObj, *encodingObj, *searchPathObj; TclNewLiteralStringObj(encodingObj, "encoding"); @@ -3634,11 +3634,11 @@ InitializeEncodingSearchPath( if (*encodingPtr) { ((Encoding *)(*encodingPtr))->refCount++; } - bytes = TclGetStringFromObj(searchPathObj, &numBytes); + bytes = TclGetString(searchPathObj); - *lengthPtr = numBytes; - *valuePtr = ckalloc(numBytes + 1); - memcpy(*valuePtr, bytes, (size_t) numBytes + 1); + *lengthPtr = searchPathObj->length; + *valuePtr = ckalloc(*lengthPtr + 1); + memcpy(*valuePtr, bytes, *lengthPtr + 1); Tcl_DecrRefCount(searchPathObj); } diff --git a/generic/tclEnsemble.c b/generic/tclEnsemble.c index a499ce9..c6407a4 100644 --- a/generic/tclEnsemble.c +++ b/generic/tclEnsemble.c @@ -1605,7 +1605,7 @@ TclMakeEnsemble( Tcl_DStringFree(&buf); Tcl_DStringFree(&hiddenBuf); if (nameParts != NULL) { - ckfree((char *) nameParts); + ckfree(nameParts); } return ensemble; } diff --git a/generic/tclExecute.c b/generic/tclExecute.c index 0d48071..1cfc030 100644 --- a/generic/tclExecute.c +++ b/generic/tclExecute.c @@ -1274,7 +1274,7 @@ TclStackFree( Tcl_Obj **markerPtr, *marker; if (iPtr == NULL || iPtr->execEnvPtr == NULL) { - ckfree((char *) freePtr); + ckfree(freePtr); return; } @@ -2537,7 +2537,7 @@ TEBCresume( /* FIXME: What is the right thing to trace? */ fprintf(stdout, "%d: (%u) yielding to [%.30s]\n", iPtr->numLevels, (unsigned)(pc - codePtr->codeStart), - Tcl_GetString(valuePtr)); + TclGetString(valuePtr)); } fflush(stdout); } @@ -9558,7 +9558,7 @@ ValidatePcAndStackTop( TclNewLiteralStringObj(message, "\n executing "); Tcl_IncrRefCount(message); Tcl_AppendLimitedToObj(message, cmd, numChars, 100, NULL); - fprintf(stderr,"%s\n", Tcl_GetString(message)); + fprintf(stderr,"%s\n", TclGetString(message)); Tcl_DecrRefCount(message); } else { fprintf(stderr, "\n"); @@ -10021,7 +10021,7 @@ TclExprFloatError( "unknown floating-point error, errno = %d", errno); Tcl_SetErrorCode(interp, "ARITH", "UNKNOWN", - Tcl_GetString(objPtr), NULL); + TclGetString(objPtr), NULL); Tcl_SetObjResult(interp, objPtr); } } diff --git a/generic/tclIORChan.c b/generic/tclIORChan.c index 1089d2b..2fed3f4 100644 --- a/generic/tclIORChan.c +++ b/generic/tclIORChan.c @@ -591,7 +591,7 @@ TclChanCreateObjCmd( if (Tcl_ListObjGetElements(NULL, resObj, &listc, &listv) != TCL_OK) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "chan handler \"%s initialize\" returned non-list: %s", - Tcl_GetString(cmdObj), Tcl_GetString(resObj))); + TclGetString(cmdObj), TclGetString(resObj))); Tcl_DecrRefCount(resObj); goto error; } @@ -617,35 +617,35 @@ TclChanCreateObjCmd( if ((REQUIRED_METHODS & methods) != REQUIRED_METHODS) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "chan handler \"%s\" does not support all required methods", - Tcl_GetString(cmdObj))); + TclGetString(cmdObj))); goto error; } if ((mode & TCL_READABLE) && !HAS(methods, METH_READ)) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "chan handler \"%s\" lacks a \"read\" method", - Tcl_GetString(cmdObj))); + TclGetString(cmdObj))); goto error; } if ((mode & TCL_WRITABLE) && !HAS(methods, METH_WRITE)) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "chan handler \"%s\" lacks a \"write\" method", - Tcl_GetString(cmdObj))); + TclGetString(cmdObj))); goto error; } if (!IMPLIES(HAS(methods, METH_CGET), HAS(methods, METH_CGETALL))) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "chan handler \"%s\" supports \"cget\" but not \"cgetall\"", - Tcl_GetString(cmdObj))); + TclGetString(cmdObj))); goto error; } if (!IMPLIES(HAS(methods, METH_CGETALL), HAS(methods, METH_CGET))) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "chan handler \"%s\" supports \"cgetall\" but not \"cget\"", - Tcl_GetString(cmdObj))); + TclGetString(cmdObj))); goto error; } @@ -1152,7 +1152,7 @@ ReflectClose( tctPtr = ((Channel *)rcPtr->chan)->typePtr; if (tctPtr && tctPtr != &tclRChannelType) { - ckfree((char *)tctPtr); + ckfree(tctPtr); ((Channel *)rcPtr->chan)->typePtr = NULL; } Tcl_EventuallyFree(rcPtr, (Tcl_FreeProc *) FreeReflectedChannel); @@ -1221,7 +1221,7 @@ ReflectClose( #endif tctPtr = ((Channel *)rcPtr->chan)->typePtr; if (tctPtr && tctPtr != &tclRChannelType) { - ckfree((char *)tctPtr); + ckfree(tctPtr); ((Channel *)rcPtr->chan)->typePtr = NULL; } Tcl_EventuallyFree(rcPtr, (Tcl_FreeProc *) FreeReflectedChannel); @@ -2398,7 +2398,7 @@ ErrnoReturn( if (((Tcl_GetIntFromObj(rcPtr->interp, resObj, &code) != TCL_OK) || (code >= 0))) { - if (strcmp("EAGAIN", Tcl_GetString(resObj)) == 0) { + if (strcmp("EAGAIN", TclGetString(resObj)) == 0) { code = -EAGAIN; } else { code = 0; diff --git a/generic/tclIORTrans.c b/generic/tclIORTrans.c index 47e0bc8..8375926 100644 --- a/generic/tclIORTrans.c +++ b/generic/tclIORTrans.c @@ -554,7 +554,7 @@ TclChanPushObjCmd( */ chanObj = objv[CHAN]; - parentChan = Tcl_GetChannel(interp, Tcl_GetString(chanObj), &mode); + parentChan = Tcl_GetChannel(interp, TclGetString(chanObj), &mode); if (parentChan == NULL) { return TCL_ERROR; } @@ -608,7 +608,7 @@ TclChanPushObjCmd( if (Tcl_ListObjGetElements(NULL, resObj, &listc, &listv) != TCL_OK) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "chan handler \"%s initialize\" returned non-list: %s", - Tcl_GetString(cmdObj), Tcl_GetString(resObj))); + TclGetString(cmdObj), TclGetString(resObj))); Tcl_DecrRefCount(resObj); goto error; } @@ -619,7 +619,7 @@ TclChanPushObjCmd( "method", TCL_EXACT, &methIndex) != TCL_OK) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "chan handler \"%s initialize\" returned %s", - Tcl_GetString(cmdObj), + TclGetString(cmdObj), Tcl_GetString(Tcl_GetObjResult(interp)))); Tcl_DecrRefCount(resObj); goto error; @@ -633,7 +633,7 @@ TclChanPushObjCmd( if ((REQUIRED_METHODS & methods) != REQUIRED_METHODS) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "chan handler \"%s\" does not support all required methods", - Tcl_GetString(cmdObj))); + TclGetString(cmdObj))); goto error; } @@ -655,7 +655,7 @@ TclChanPushObjCmd( if (!mode) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "chan handler \"%s\" makes the channel inaccessible", - Tcl_GetString(cmdObj))); + TclGetString(cmdObj))); goto error; } @@ -666,14 +666,14 @@ TclChanPushObjCmd( if (!IMPLIES(HAS(methods, METH_DRAIN), HAS(methods, METH_READ))) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "chan handler \"%s\" supports \"drain\" but not \"read\"", - Tcl_GetString(cmdObj))); + TclGetString(cmdObj))); goto error; } if (!IMPLIES(HAS(methods, METH_FLUSH), HAS(methods, METH_WRITE))) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "chan handler \"%s\" supports \"flush\" but not \"write\"", - Tcl_GetString(cmdObj))); + TclGetString(cmdObj))); goto error; } @@ -694,14 +694,14 @@ TclChanPushObjCmd( */ rtmPtr = GetReflectedTransformMap(interp); - hPtr = Tcl_CreateHashEntry(&rtmPtr->map, Tcl_GetString(rtId), &isNew); + hPtr = Tcl_CreateHashEntry(&rtmPtr->map, TclGetString(rtId), &isNew); if (!isNew && rtPtr != Tcl_GetHashValue(hPtr)) { Tcl_Panic("TclChanPushObjCmd: duplicate transformation handle"); } Tcl_SetHashValue(hPtr, rtPtr); #ifdef TCL_THREADS rtmPtr = GetThreadReflectedTransformMap(); - hPtr = Tcl_CreateHashEntry(&rtmPtr->map, Tcl_GetString(rtId), &isNew); + hPtr = Tcl_CreateHashEntry(&rtmPtr->map, TclGetString(rtId), &isNew); Tcl_SetHashValue(hPtr, rtPtr); #endif /* TCL_THREADS */ @@ -1027,7 +1027,7 @@ ReflectClose( #ifdef TCL_THREADS rtmPtr = GetThreadReflectedTransformMap(); - hPtr = Tcl_FindHashEntry(&rtmPtr->map, Tcl_GetString(rtPtr->handle)); + hPtr = Tcl_FindHashEntry(&rtmPtr->map, TclGetString(rtPtr->handle)); if (hPtr) { Tcl_DeleteHashEntry(hPtr); } @@ -2568,7 +2568,7 @@ ForwardProc( */ rtmPtr = GetReflectedTransformMap(interp); - hPtr = Tcl_FindHashEntry(&rtmPtr->map, Tcl_GetString(rtPtr->handle)); + hPtr = Tcl_FindHashEntry(&rtmPtr->map, TclGetString(rtPtr->handle)); Tcl_DeleteHashEntry(hPtr); /* @@ -2578,7 +2578,7 @@ ForwardProc( */ rtmPtr = GetThreadReflectedTransformMap(); - hPtr = Tcl_FindHashEntry(&rtmPtr->map, Tcl_GetString(rtPtr->handle)); + hPtr = Tcl_FindHashEntry(&rtmPtr->map, TclGetString(rtPtr->handle)); Tcl_DeleteHashEntry(hPtr); FreeReflectedTransformArgs(rtPtr); @@ -2955,7 +2955,7 @@ ResultClear( return; } - ckfree((char *) rPtr->buf); + ckfree(rPtr->buf); rPtr->buf = NULL; rPtr->allocated = 0; } diff --git a/generic/tclInt.h b/generic/tclInt.h index e468f3d..3e55004 100644 --- a/generic/tclInt.h +++ b/generic/tclInt.h @@ -2608,7 +2608,7 @@ typedef Tcl_ObjCmdProc *TclObjCmdProcType; *---------------------------------------------------------------- */ -typedef void (TclInitProcessGlobalValueProc)(char **valuePtr, int *lengthPtr, +typedef void (TclInitProcessGlobalValueProc)(char **valuePtr, size_t *lengthPtr, Tcl_Encoding *encodingPtr); /* @@ -2620,9 +2620,9 @@ typedef void (TclInitProcessGlobalValueProc)(char **valuePtr, int *lengthPtr, */ typedef struct ProcessGlobalValue { - int epoch; /* Epoch counter to detect changes in the + size_t epoch; /* Epoch counter to detect changes in the * master value. */ - int numBytes; /* Length of the master string. */ + size_t numBytes; /* Length of the master string. */ char *value; /* The master string value. */ Tcl_Encoding encoding; /* system encoding when master string was * initialized. */ @@ -3072,7 +3072,7 @@ MODULE_SCOPE int TclpThreadCreate(Tcl_ThreadId *idPtr, int stackSize, int flags); MODULE_SCOPE int TclpFindVariable(const char *name, int *lengthPtr); MODULE_SCOPE void TclpInitLibraryPath(char **valuePtr, - int *lengthPtr, Tcl_Encoding *encodingPtr); + size_t *lengthPtr, Tcl_Encoding *encodingPtr); MODULE_SCOPE void TclpInitLock(void); MODULE_SCOPE void TclpInitPlatform(void); MODULE_SCOPE void TclpInitUnlock(void); @@ -4074,7 +4074,7 @@ typedef const char *TclDTraceStr; TCL_DTRACE_OBJ_FREE(objPtr); \ if ((objPtr)->bytes \ && ((objPtr)->bytes != tclEmptyStringRep)) { \ - ckfree((char *) (objPtr)->bytes); \ + ckfree((objPtr)->bytes); \ } \ (objPtr)->length = -1; \ TclFreeObjStorage(objPtr); \ @@ -4097,7 +4097,7 @@ typedef const char *TclDTraceStr; (objPtr) = (Tcl_Obj *) ckalloc(sizeof(Tcl_Obj)) # define TclFreeObjStorageEx(interp, objPtr) \ - ckfree((char *) (objPtr)) + ckfree(objPtr) #undef USE_THREAD_ALLOC #undef USE_TCLALLOC @@ -4256,7 +4256,7 @@ MODULE_SCOPE void TclDbInitNewObj(Tcl_Obj *objPtr, const char *file, */ #define TclGetString(objPtr) \ - ((objPtr)->bytes? (objPtr)->bytes : Tcl_GetString((objPtr))) + ((objPtr)->bytes? (objPtr)->bytes : Tcl_GetString(objPtr)) #define TclGetStringFromObj(objPtr, lenPtr) \ ((objPtr)->bytes \ @@ -4291,11 +4291,11 @@ MODULE_SCOPE void TclDbInitNewObj(Tcl_Obj *objPtr, const char *file, */ #define TclInvalidateStringRep(objPtr) \ - if (objPtr->bytes != NULL) { \ - if (objPtr->bytes != tclEmptyStringRep) { \ - ckfree((char *) objPtr->bytes); \ + if ((objPtr)->bytes != NULL) { \ + if ((objPtr)->bytes != tclEmptyStringRep) { \ + ckfree((objPtr)->bytes); \ } \ - objPtr->bytes = NULL; \ + (objPtr)->bytes = NULL; \ } /* @@ -4706,7 +4706,7 @@ MODULE_SCOPE Tcl_PackageInitProc Procbodytest_SafeInit; #define TclCleanupCommandMacro(cmdPtr) \ if ((cmdPtr)->refCount-- <= 1) { \ - ckfree((char *) (cmdPtr));\ + ckfree(cmdPtr);\ } /* @@ -4864,7 +4864,7 @@ typedef struct NRE_callback { #else #define TCLNR_ALLOC(interp, ptr) \ (ptr = ((ClientData) ckalloc(sizeof(NRE_callback)))) -#define TCLNR_FREE(interp, ptr) ckfree((char *) (ptr)) +#define TCLNR_FREE(interp, ptr) ckfree(ptr) #endif #if NRE_ENABLE_ASSERTS diff --git a/generic/tclListObj.c b/generic/tclListObj.c index 344d0fd..c9fd333 100644 --- a/generic/tclListObj.c +++ b/generic/tclListObj.c @@ -1898,7 +1898,7 @@ SetListFromAny( while (--elemPtrs >= &listRepPtr->elements) { Tcl_DecrRefCount(*elemPtrs); } - ckfree((char *) listRepPtr); + ckfree(listRepPtr); return TCL_ERROR; } if (elemStart == limit) { diff --git a/generic/tclOODefineCmds.c b/generic/tclOODefineCmds.c index 8c3f28c..5b0dfc3 100644 --- a/generic/tclOODefineCmds.c +++ b/generic/tclOODefineCmds.c @@ -2217,7 +2217,7 @@ ClassSuperSet( "attempt to form circular dependency graph", -1)); Tcl_SetErrorCode(interp, "TCL", "OO", "CIRCULARITY", NULL); failedAfterAlloc: - ckfree((char *) superclasses); + ckfree(superclasses); return TCL_ERROR; } } @@ -2234,7 +2234,7 @@ ClassSuperSet( FOREACH(superPtr, oPtr->classPtr->superclasses) { TclOORemoveFromSubclasses(oPtr->classPtr, superPtr); } - ckfree((char *) oPtr->classPtr->superclasses.list); + ckfree(oPtr->classPtr->superclasses.list); } oPtr->classPtr->superclasses.list = superclasses; oPtr->classPtr->superclasses.num = superc; @@ -2323,7 +2323,7 @@ ClassVarsSet( } for (i=0 ; iclassPtr->variables.list); + ckfree(oPtr->classPtr->variables.list); } else if (i) { oPtr->classPtr->variables.list = (Tcl_Obj **) ckrealloc((char *) oPtr->classPtr->variables.list, @@ -2604,7 +2604,7 @@ ObjVarsSet( } for (i=0 ; ivariables.list); + ckfree(oPtr->variables.list); } else if (i) { oPtr->variables.list = (Tcl_Obj **) ckrealloc((char *) oPtr->variables.list, diff --git a/generic/tclOOInt.h b/generic/tclOOInt.h index b75ffdb..ae24dee 100644 --- a/generic/tclOOInt.h +++ b/generic/tclOOInt.h @@ -592,7 +592,7 @@ MODULE_SCOPE void TclOOSetupVariableResolver(Tcl_Namespace *nsPtr); #define AddRef(ptr) ((ptr)->refCount++) #define DelRef(ptr) do { \ if ((ptr)->refCount-- <= 1) { \ - ckfree((char *) (ptr)); \ + ckfree(ptr); \ } \ } while(0) diff --git a/generic/tclUtil.c b/generic/tclUtil.c index f0c7f77..531f386 100644 --- a/generic/tclUtil.c +++ b/generic/tclUtil.c @@ -2953,7 +2953,7 @@ Tcl_DStringGetResult( dsPtr->length = 0; dsPtr->spaceAvl = TCL_DSTRING_STATIC_SIZE; } else { - dsPtr->string = Tcl_GetString(iPtr->objResultPtr); + dsPtr->string = TclGetString(iPtr->objResultPtr); dsPtr->length = iPtr->objResultPtr->length; dsPtr->spaceAvl = dsPtr->length + 1; TclFreeIntRep(iPtr->objResultPtr); @@ -3639,7 +3639,7 @@ TclGetIntForIndex( parseError: if (interp != NULL) { - bytes = Tcl_GetString(objPtr); + bytes = TclGetString(objPtr); Tcl_SetObjResult(interp, Tcl_ObjPrintf( "bad index \"%s\": must be integer?[+-]integer? or" " end?[+-]integer?", bytes)); @@ -4000,9 +4000,10 @@ TclSetProcessGlobalValue( } else { Tcl_CreateExitHandler(FreeProcessGlobalValue, pgvPtr); } - bytes = TclGetStringFromObj(newValue, &pgvPtr->numBytes); + bytes = TclGetString(newValue); + pgvPtr->numBytes = newValue->length; pgvPtr->value = ckalloc(pgvPtr->numBytes + 1); - memcpy(pgvPtr->value, bytes, (unsigned) pgvPtr->numBytes + 1); + memcpy(pgvPtr->value, bytes, pgvPtr->numBytes + 1); if (pgvPtr->encoding) { Tcl_FreeEncoding(pgvPtr->encoding); } @@ -4017,7 +4018,7 @@ TclSetProcessGlobalValue( Tcl_IncrRefCount(newValue); cacheMap = GetThreadHash(&pgvPtr->key); ClearHash(cacheMap); - hPtr = Tcl_CreateHashEntry(cacheMap, INT2PTR(pgvPtr->epoch), &dummy); + hPtr = Tcl_CreateHashEntry(cacheMap, (void *)(pgvPtr->epoch), &dummy); Tcl_SetHashValue(hPtr, newValue); Tcl_MutexUnlock(&pgvPtr->mutex); } @@ -4043,7 +4044,7 @@ TclGetProcessGlobalValue( Tcl_Obj *value = NULL; Tcl_HashTable *cacheMap; Tcl_HashEntry *hPtr; - int epoch = pgvPtr->epoch; + size_t epoch = pgvPtr->epoch; if (pgvPtr->encoding) { Tcl_Encoding current = Tcl_GetEncoding(NULL, NULL); @@ -4058,8 +4059,7 @@ TclGetProcessGlobalValue( Tcl_DString native, newValue; Tcl_MutexLock(&pgvPtr->mutex); - pgvPtr->epoch++; - epoch = pgvPtr->epoch; + epoch = ++pgvPtr->epoch; Tcl_UtfToExternalDString(pgvPtr->encoding, pgvPtr->value, pgvPtr->numBytes, &native); Tcl_ExternalToUtfDString(current, Tcl_DStringValue(&native), @@ -4078,7 +4078,7 @@ TclGetProcessGlobalValue( } } cacheMap = GetThreadHash(&pgvPtr->key); - hPtr = Tcl_FindHashEntry(cacheMap, (char *) INT2PTR(epoch)); + hPtr = Tcl_FindHashEntry(cacheMap, (void *) (epoch)); if (NULL == hPtr) { int dummy; @@ -4111,7 +4111,7 @@ TclGetProcessGlobalValue( value = Tcl_NewStringObj(pgvPtr->value, pgvPtr->numBytes); hPtr = Tcl_CreateHashEntry(cacheMap, - INT2PTR(pgvPtr->epoch), &dummy); + (void *)(pgvPtr->epoch), &dummy); Tcl_MutexUnlock(&pgvPtr->mutex); Tcl_SetHashValue(hPtr, value); Tcl_IncrRefCount(value); @@ -4194,11 +4194,10 @@ TclGetObjNameOfExecutable(void) const char * Tcl_GetNameOfExecutable(void) { - int numBytes; - const char *bytes = - Tcl_GetStringFromObj(TclGetObjNameOfExecutable(), &numBytes); + Tcl_Obj *obj = TclGetObjNameOfExecutable(); + const char *bytes = TclGetString(obj); - if (numBytes == 0) { + if (obj->length == 0) { return NULL; } return bytes; diff --git a/macosx/tclMacOSXFCmd.c b/macosx/tclMacOSXFCmd.c index 946e350..75fda4b 100644 --- a/macosx/tclMacOSXFCmd.c +++ b/macosx/tclMacOSXFCmd.c @@ -636,12 +636,12 @@ SetOSTypeFromAny( Tcl_Obj *objPtr) /* Pointer to the object to convert */ { const char *string; - int length, result = TCL_OK; + int result = TCL_OK; Tcl_DString ds; Tcl_Encoding encoding = Tcl_GetEncoding(NULL, "macRoman"); - string = TclGetStringFromObj(objPtr, &length); - Tcl_UtfToExternalDString(encoding, string, length, &ds); + string = TclGetString(objPtr); + Tcl_UtfToExternalDString(encoding, string, objPtr->length, &ds); if (Tcl_DStringLength(&ds) > 4) { if (interp) { diff --git a/unix/tclUnixInit.c b/unix/tclUnixInit.c index 31177a3..1e35b92 100644 --- a/unix/tclUnixInit.c +++ b/unix/tclUnixInit.c @@ -453,7 +453,7 @@ TclpInitPlatform(void) void TclpInitLibraryPath( char **valuePtr, - int *lengthPtr, + size_t *lengthPtr, Tcl_Encoding *encodingPtr) { #define LIBRARY_SIZE 32 @@ -542,9 +542,10 @@ TclpInitLibraryPath( Tcl_DStringFree(&buffer); *encodingPtr = Tcl_GetEncoding(NULL, NULL); - str = TclGetStringFromObj(pathPtr, lengthPtr); - *valuePtr = ckalloc((*lengthPtr) + 1); - memcpy(*valuePtr, str, (size_t)(*lengthPtr)+1); + str = TclGetString(pathPtr); + *lengthPtr = pathPtr->length; + *valuePtr = ckalloc(*lengthPtr + 1); + memcpy(*valuePtr, str, *lengthPtr + 1); Tcl_DecrRefCount(pathPtr); } diff --git a/unix/tclUnixSock.c b/unix/tclUnixSock.c index 5d11a28..170aea9 100644 --- a/unix/tclUnixSock.c +++ b/unix/tclUnixSock.c @@ -203,7 +203,7 @@ void printaddrinfo(struct addrinfo *addrlist, char *prefix) static void InitializeHostName( char **valuePtr, - int *lengthPtr, + size_t *lengthPtr, Tcl_Encoding *encodingPtr) { const char *native = NULL; @@ -271,8 +271,8 @@ InitializeHostName( *encodingPtr = Tcl_GetEncoding(NULL, NULL); *lengthPtr = strlen(native); - *valuePtr = ckalloc((*lengthPtr) + 1); - memcpy(*valuePtr, native, (size_t)(*lengthPtr)+1); + *valuePtr = ckalloc(*lengthPtr + 1); + memcpy(*valuePtr, native, *lengthPtr + 1); } /* diff --git a/win/tclWin32Dll.c b/win/tclWin32Dll.c index d8a8717..e4adb1d 100644 --- a/win/tclWin32Dll.c +++ b/win/tclWin32Dll.c @@ -49,7 +49,7 @@ BOOL APIENTRY DllMain(HINSTANCE hInst, DWORD reason, */ typedef struct MountPointMap { - const TCHAR *volumeName; /* Native wide string volume name. */ + TCHAR *volumeName; /* Native wide string volume name. */ TCHAR driveLetter; /* Drive letter corresponding to the volume * name. */ struct MountPointMap *nextPtr; diff --git a/win/tclWinInit.c b/win/tclWinInit.c index b5a07aa..d2ee7e1 100644 --- a/win/tclWinInit.c +++ b/win/tclWinInit.c @@ -172,7 +172,7 @@ TclpInitPlatform(void) void TclpInitLibraryPath( char **valuePtr, - int *lengthPtr, + size_t *lengthPtr, Tcl_Encoding *encodingPtr) { #define LIBRARY_SIZE 64 @@ -214,9 +214,10 @@ TclpInitLibraryPath( TclGetProcessGlobalValue(&sourceLibraryDir)); *encodingPtr = NULL; - bytes = TclGetStringFromObj(pathPtr, lengthPtr); - *valuePtr = ckalloc((*lengthPtr) + 1); - memcpy(*valuePtr, bytes, (size_t)(*lengthPtr)+1); + bytes = TclGetString(pathPtr); + *lengthPtr = pathPtr->length; + *valuePtr = ckalloc(*lengthPtr + 1); + memcpy(*valuePtr, bytes, *lengthPtr + 1); Tcl_DecrRefCount(pathPtr); } @@ -334,7 +335,7 @@ AppendEnvironment( static void InitializeDefaultLibraryDir( char **valuePtr, - int *lengthPtr, + size_t *lengthPtr, Tcl_Encoding *encodingPtr) { HMODULE hModule = TclWinGetTclInstance(); @@ -361,7 +362,7 @@ InitializeDefaultLibraryDir( *lengthPtr = strlen(name); *valuePtr = ckalloc(*lengthPtr + 1); *encodingPtr = NULL; - memcpy(*valuePtr, name, (size_t) *lengthPtr + 1); + memcpy(*valuePtr, name, *lengthPtr + 1); } /* @@ -385,7 +386,7 @@ InitializeDefaultLibraryDir( static void InitializeSourceLibraryDir( char **valuePtr, - int *lengthPtr, + size_t *lengthPtr, Tcl_Encoding *encodingPtr) { HMODULE hModule = TclWinGetTclInstance(); @@ -412,7 +413,7 @@ InitializeSourceLibraryDir( *lengthPtr = strlen(name); *valuePtr = ckalloc(*lengthPtr + 1); *encodingPtr = NULL; - memcpy(*valuePtr, name, (size_t) *lengthPtr + 1); + memcpy(*valuePtr, name, *lengthPtr + 1); } /* diff --git a/win/tclWinPort.h b/win/tclWinPort.h index 159a708..41201c7 100644 --- a/win/tclWinPort.h +++ b/win/tclWinPort.h @@ -551,7 +551,7 @@ typedef DWORD_PTR * PDWORD_PTR; * address platform-specific issues. */ -#define TclpReleaseFile(file) ckfree((char *) file) +#define TclpReleaseFile(file) ckfree(file) /* * The following macros and declarations wrap the C runtime library diff --git a/win/tclWinSock.c b/win/tclWinSock.c index 4690708..ec881d2 100644 --- a/win/tclWinSock.c +++ b/win/tclWinSock.c @@ -331,7 +331,7 @@ void printaddrinfolist(struct addrinfo *addrlist, char *prefix) void InitializeHostName( char **valuePtr, - int *lengthPtr, + size_t *lengthPtr, Tcl_Encoding *encodingPtr) { TCHAR tbuf[MAX_COMPUTERNAME_LENGTH + 1]; @@ -368,8 +368,8 @@ InitializeHostName( *encodingPtr = Tcl_GetEncoding(NULL, "utf-8"); *lengthPtr = Tcl_DStringLength(&ds); - *valuePtr = ckalloc((*lengthPtr) + 1); - memcpy(*valuePtr, Tcl_DStringValue(&ds), (size_t)(*lengthPtr)+1); + *valuePtr = ckalloc(*lengthPtr + 1); + memcpy(*valuePtr, Tcl_DStringValue(&ds), *lengthPtr + 1); Tcl_DStringFree(&ds); } diff --git a/win/tclWinThrd.c b/win/tclWinThrd.c index e46b0a0..b9cde72 100644 --- a/win/tclWinThrd.c +++ b/win/tclWinThrd.c @@ -180,7 +180,7 @@ TclWinThreadStart( lpOrigStartAddress = winThreadPtr->lpStartAddress; lpOrigParameter = winThreadPtr->lpParameter; - ckfree((char *)winThreadPtr); + ckfree(winThreadPtr); return lpOrigStartAddress(lpOrigParameter); } -- cgit v0.12