diff options
| author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2023-03-31 11:06:35 (GMT) |
|---|---|---|
| committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2023-03-31 11:06:35 (GMT) |
| commit | cc936d0713b9e1b725a3296ecf05ab40139290e6 (patch) | |
| tree | 6a241009815d34816cc3f6cd275660e796a1575f | |
| parent | ed24f448c79bc5af4c0f6fd77826a6552271dd9c (diff) | |
| parent | 6bdd668a7ce4815e5beb82b3fe15262f99d44987 (diff) | |
| download | tcl-cc936d0713b9e1b725a3296ecf05ab40139290e6.zip tcl-cc936d0713b9e1b725a3296ecf05ab40139290e6.tar.gz tcl-cc936d0713b9e1b725a3296ecf05ab40139290e6.tar.bz2 | |
Merge 8.6
| -rw-r--r-- | generic/tclTest.c | 43 | ||||
| -rw-r--r-- | library/tzdata/Asia/Beirut | 2 | ||||
| -rw-r--r-- | win/tclWinChan.c | 12 | ||||
| -rw-r--r-- | win/tclWinInt.h | 2 |
4 files changed, 29 insertions, 30 deletions
diff --git a/generic/tclTest.c b/generic/tclTest.c index 53fa384..459c494 100644 --- a/generic/tclTest.c +++ b/generic/tclTest.c @@ -1000,8 +1000,7 @@ AsyncHandlerProc( { TestAsyncHandler *asyncPtr; int id = PTR2INT(clientData); - const char *listArgv[4]; - char *cmd; + const char *listArgv[4], *cmd; char string[TCL_INTEGER_SPACE]; Tcl_MutexLock(&asyncTestMutex); @@ -2065,6 +2064,22 @@ static int UtfExtWrapper( int flags; Tcl_Obj **flagObjs; int nflags; + static const struct { + const char *flagKey; + int flag; + } flagMap[] = { + {"start", TCL_ENCODING_START}, + {"end", TCL_ENCODING_END}, + {"stoponerror", TCL_ENCODING_STOPONERROR}, + {"noterminate", TCL_ENCODING_NO_TERMINATE}, + {"charlimit", TCL_ENCODING_CHAR_LIMIT}, + {"profiletcl8", TCL_ENCODING_PROFILE_TCL8}, + {"profilestrict", TCL_ENCODING_PROFILE_STRICT}, + {"profilereplace", TCL_ENCODING_PROFILE_REPLACE}, + {NULL, 0} + }; + int i; + Tcl_WideInt wide; if (objc < 7 || objc > 10) { Tcl_WrongNumArgs(interp, @@ -2083,21 +2098,6 @@ static int UtfExtWrapper( return TCL_ERROR; } - struct { - const char *flagKey; - int flag; - } flagMap[] = { - {"start", TCL_ENCODING_START}, - {"end", TCL_ENCODING_END}, - {"stoponerror", TCL_ENCODING_STOPONERROR}, - {"noterminate", TCL_ENCODING_NO_TERMINATE}, - {"charlimit", TCL_ENCODING_CHAR_LIMIT}, - {"profiletcl8", TCL_ENCODING_PROFILE_TCL8}, - {"profilestrict", TCL_ENCODING_PROFILE_STRICT}, - {"profilereplace", TCL_ENCODING_PROFILE_REPLACE}, - {NULL, 0} - }; - int i; for (i = 0; i < nflags; ++i) { int flag; if (Tcl_GetIntFromObj(NULL, flagObjs[i], &flag) == TCL_OK) { @@ -2118,7 +2118,6 @@ static int UtfExtWrapper( } /* Assumes state is integer if not "" */ - Tcl_WideInt wide; if (Tcl_GetWideIntFromObj(interp, objv[5], &wide) == TCL_OK) { encState = (Tcl_EncodingState)(size_t)wide; encStatePtr = &encState; @@ -2175,7 +2174,7 @@ static int UtfExtWrapper( memmove(bufPtr + dstLen, "\xAB\xCD\xEF\xAB", 4); /* overflow detection */ bytes = Tcl_GetByteArrayFromObj(objv[3], &srcLen); /* Last! to avoid shimmering */ result = (*transformer)(interp, encoding, (const char *)bytes, srcLen, flags, - encStatePtr, (char *) bufPtr, dstLen, + encStatePtr, (char *) bufPtr, dstLen, srcReadVar ? &srcRead : NULL, &dstWrote, dstCharsVar ? &dstChars : NULL); @@ -2298,7 +2297,7 @@ TestencodingObjCmd( Tcl_WrongNumArgs(interp, 2, objv, "name toutfcmd fromutfcmd"); return TCL_ERROR; } - encodingPtr = (TclEncoding*)ckalloc(sizeof(TclEncoding)); + encodingPtr = (TclEncoding *)ckalloc(sizeof(TclEncoding)); encodingPtr->interp = interp; string = Tcl_GetStringFromObj(objv[3], &length); @@ -8470,7 +8469,7 @@ InterpCmdResolver( Tcl_Interp *interp, const char *name, TCL_UNUSED(Tcl_Namespace *), - TCL_UNUSED(int) /*flags*/, + TCL_UNUSED(int) /* flags */, Tcl_Command *rPtr) { Interp *iPtr = (Interp *) interp; @@ -8655,7 +8654,7 @@ static int InterpCompiledVarResolver( TCL_UNUSED(Tcl_Interp *), const char *name, - TCL_UNUSED(int) /*length*/, + TCL_UNUSED(int) /* length */, TCL_UNUSED(Tcl_Namespace *), Tcl_ResolvedVarInfo **rPtr) { diff --git a/library/tzdata/Asia/Beirut b/library/tzdata/Asia/Beirut index a01a53a..ac0a64e 100644 --- a/library/tzdata/Asia/Beirut +++ b/library/tzdata/Asia/Beirut @@ -113,7 +113,7 @@ set TZData(:Asia/Beirut) { {1635627600 7200 0 EET} {1648332000 10800 1 EEST} {1667077200 7200 0 EET} - {1682028000 10800 1 EEST} + {1679781600 10800 1 EEST} {1698526800 7200 0 EET} {1711836000 10800 1 EEST} {1729976400 7200 0 EET} diff --git a/win/tclWinChan.c b/win/tclWinChan.c index c764dd2..8a4db89 100644 --- a/win/tclWinChan.c +++ b/win/tclWinChan.c @@ -99,6 +99,8 @@ static int FileTruncateProc(ClientData instanceData, long long length); static DWORD FileGetType(HANDLE handle); static int NativeIsComPort(const WCHAR *nativeName); +static Tcl_Channel OpenFileChannel(HANDLE handle, char *channelName, + int permissions, int appendMode); /* * This structure describes the channel type structure for file based IO. @@ -1035,7 +1037,7 @@ TclpOpenFileChannel( case FILE_TYPE_CHAR: case FILE_TYPE_DISK: case FILE_TYPE_UNKNOWN: - channel = TclWinOpenFileChannel(handle, channelName, + channel = OpenFileChannel(handle, channelName, channelPermissions, TEST_FLAG(mode, O_APPEND) ? FILE_APPEND : 0); break; @@ -1113,7 +1115,7 @@ Tcl_MakeFileChannel( case FILE_TYPE_DISK: case FILE_TYPE_CHAR: - channel = TclWinOpenFileChannel(handle, channelName, mode, 0); + channel = OpenFileChannel(handle, channelName, mode, 0); break; case FILE_TYPE_UNKNOWN: @@ -1247,7 +1249,7 @@ Tcl_MakeFileChannel( * is valid to something. */ - channel = TclWinOpenFileChannel(handle, channelName, mode, 0); + channel = OpenFileChannel(handle, channelName, mode, 0); } return channel; @@ -1336,7 +1338,7 @@ TclpGetDefaultStdChannel( /* *---------------------------------------------------------------------- * - * TclWinOpenFileChannel -- + * OpenFileChannel -- * * Constructs a File channel for the specified standard OS handle. This * is a helper function to break up the construction of channels into @@ -1353,7 +1355,7 @@ TclpGetDefaultStdChannel( */ Tcl_Channel -TclWinOpenFileChannel( +OpenFileChannel( HANDLE handle, /* Win32 HANDLE to swallow */ char *channelName, /* Buffer to receive channel name */ int permissions, /* OR'ed combination of TCL_READABLE, diff --git a/win/tclWinInt.h b/win/tclWinInt.h index 1b6e606..d5cf7b0 100644 --- a/win/tclWinInt.h +++ b/win/tclWinInt.h @@ -43,8 +43,6 @@ MODULE_SCOPE void TclWinInit(HINSTANCE hInst); MODULE_SCOPE TclFile TclWinMakeFile(HANDLE handle); MODULE_SCOPE Tcl_Channel TclWinOpenConsoleChannel(HANDLE handle, char *channelName, int permissions); -MODULE_SCOPE Tcl_Channel TclWinOpenFileChannel(HANDLE handle, char *channelName, - int permissions, int appendMode); MODULE_SCOPE Tcl_Channel TclWinOpenSerialChannel(HANDLE handle, char *channelName, int permissions); MODULE_SCOPE HANDLE TclWinSerialOpen(HANDLE handle, const WCHAR *name, |
