From 11048e958a389a9cebfc3ee82550ab3cb6f6c231 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Sun, 23 Apr 2023 10:31:18 +0000 Subject: Remove TCL_8_COMPAT. No longer necessesary, because of TIP #660 --- generic/tclDecls.h | 36 ------------------------------------ 1 file changed, 36 deletions(-) diff --git a/generic/tclDecls.h b/generic/tclDecls.h index 9ad7b15..a8aa035 100644 --- a/generic/tclDecls.h +++ b/generic/tclDecls.h @@ -4243,42 +4243,6 @@ extern const TclStubs *tclStubsPtr; #define Tcl_GlobalEvalObj(interp, objPtr) \ Tcl_EvalObjEx(interp, objPtr, TCL_EVAL_GLOBAL) -#if defined(TCL_8_COMPAT) && !defined(BUILD_tcl) && TCL_MAJOR_VERSION > 8 -# ifdef USE_TCL_STUBS -# undef Tcl_Gets -# undef Tcl_GetsObj -# undef Tcl_Read -# undef Tcl_Ungets -# undef Tcl_Write -# undef Tcl_ReadChars -# undef Tcl_WriteChars -# undef Tcl_WriteObj -# undef Tcl_ReadRaw -# undef Tcl_WriteRaw -# define Tcl_Gets(chan, dsPtr) (((Tcl_WideInt)((tclStubsPtr->tcl_Gets)(chan, dsPtr)+1))-1) -# define Tcl_GetsObj(chan, objPtr) (((Tcl_WideInt)((tclStubsPtr->tcl_GetsObj)(chan, objPtr)+1))-1) -# define Tcl_Read(chan, bufPtr, toRead) (((Tcl_WideInt)((tclStubsPtr->tcl_Read)(chan, bufPtr, toRead)+1))-1) -# define Tcl_Ungets(chan, str, len, atHead) (((Tcl_WideInt)((tclStubsPtr->tcl_Ungets)(chan, str, len, atHead)+1))-1) -# define Tcl_Write(chan, s, slen) (((Tcl_WideInt)((tclStubsPtr->tcl_Write)(chan, s, slen)+1))-1) -# define Tcl_ReadChars(channel, objPtr, charsToRead, appendFlag) (((Tcl_WideInt)((tclStubsPtr->tcl_ReadChars)(channel, objPtr, charsToRead, appendFlag)+1))-1) -# define Tcl_WriteChars(chan, src, srcLen) (((Tcl_WideInt)((tclStubsPtr->tcl_WriteChars)(chan, src, srcLen)+1))-1) -# define Tcl_WriteObj(chan, objPtr) (((Tcl_WideInt)((tclStubsPtr->tcl_WriteObj)(chan, objPtr)+1))-1) -# define Tcl_ReadRaw(chan, dst, bytesToRead) (((Tcl_WideInt)((tclStubsPtr->tcl_ReadRaw)(chan, dst, bytesToRead)+1))-1) -# define Tcl_WriteRaw(chan, src, srcLen) (((Tcl_WideInt)((tclStubsPtr->tcl_WriteRaw()(chan, src, srcLen)+1))-1) -# else -# define Tcl_Gets(chan, dsPtr) (((Tcl_WideInt)((Tcl_Gets)(chan, dsPtr)+1))-1) -# define Tcl_GetsObj(chan, objPtr) (((Tcl_WideInt)((Tcl_GetsObj)(chan, objPtr)+1))-1) -# define Tcl_Read(chan, bufPtr, toRead) (((Tcl_WideInt)((Tcl_Read)(chan, bufPtr, toRead)+1))-1) -# define Tcl_Ungets(chan, str, len, atHead) (((Tcl_WideInt)((Tcl_Ungets)(chan, str, len, atHead)+1))-1) -# define Tcl_Write(chan, s, slen) (((Tcl_WideInt)((Tcl_Write)(chan, s, slen)+1))-1) -# define Tcl_ReadChars(channel, objPtr, charsToRead, appendFlag) (((Tcl_WideInt)((Tcl_ReadChars)(channel, objPtr, charsToRead, appendFlag)+1))-1) -# define Tcl_WriteChars(chan, src, srcLen) (((Tcl_WideInt)((Tcl_WriteChars)(chan, src, srcLen)+1))-1) -# define Tcl_WriteObj(chan, objPtr) (((Tcl_WideInt)((Tcl_WriteObj)(chan, objPtr)+1))-1) -# define Tcl_ReadRaw(chan, dst, bytesToRead) (((Tcl_WideInt)((Tcl_ReadRaw)(chan, dst, bytesToRead)+1))-1) -# define Tcl_WriteRaw(chan, src, srcLen) (((Tcl_WideInt)((Tcl_WriteRaw()(chan, src, srcLen)+1))-1) -# endif -#endif - #if TCL_MAJOR_VERSION > 8 # undef Tcl_Close # define Tcl_Close(interp, chan) Tcl_CloseEx(interp, chan, 0) -- cgit v0.12 From adab48a862ff6f51843a70841412086a21331469 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Sun, 23 Apr 2023 10:41:40 +0000 Subject: Support combination TCL_UTF_MAX=3 with TCL_NO_DEPRECATED=1 --- generic/tclStubInit.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/generic/tclStubInit.c b/generic/tclStubInit.c index 4c24c68..b28f190 100644 --- a/generic/tclStubInit.c +++ b/generic/tclStubInit.c @@ -85,7 +85,9 @@ # undef TclGetUnicodeFromObj # define TclGetStringFromObj 0 # define TclGetBytesFromObj 0 -# define TclGetUnicodeFromObj 0 +# if TCL_UTF_MAX > 3 +# define TclGetUnicodeFromObj 0 +# endif #endif #undef Tcl_Close #define Tcl_Close 0 -- cgit v0.12 From d252076f754874d48b808703fc817df4242d31da Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Sun, 23 Apr 2023 21:59:34 +0000 Subject: Missing !defined(TCL_NO_DEPRECATED) around TIP #616 macro's. Thanks Rolf for noticing! --- generic/tclBinary.c | 2 +- generic/tclDecls.h | 2 ++ generic/tclListObj.c | 2 +- generic/tclLiteral.c | 2 +- generic/tclUtil.c | 4 ++-- generic/tclZipfs.c | 2 +- 6 files changed, 8 insertions(+), 6 deletions(-) diff --git a/generic/tclBinary.c b/generic/tclBinary.c index d0aa089..3a9d62e 100644 --- a/generic/tclBinary.c +++ b/generic/tclBinary.c @@ -774,7 +774,7 @@ TclAppendBytesToByteArray( */ Tcl_Size attempt; - + /* Make sure we do not wrap when doubling */ if (needed <= (BYTEARRAY_MAX_LEN - needed)) { attempt = 2 * needed; diff --git a/generic/tclDecls.h b/generic/tclDecls.h index a8aa035..bab0fd3 100644 --- a/generic/tclDecls.h +++ b/generic/tclDecls.h @@ -4168,6 +4168,7 @@ extern const TclStubs *tclStubsPtr; # define Tcl_WCharLen (sizeof(wchar_t) != sizeof(short) \ ? (Tcl_Size (*)(wchar_t *))tclStubsPtr->tcl_UniCharLen \ : (Tcl_Size (*)(wchar_t *))Tcl_Char16Len) +#if TCL_MAJOR_VERSION < 9 || !defined(TCL_NO_DEPRECATED) # undef Tcl_ListObjGetElements # define Tcl_ListObjGetElements(interp, listPtr, objcPtr, objvPtr) (sizeof(*(objcPtr)) == sizeof(int) \ ? tclStubsPtr->tclListObjGetElements((interp), (listPtr), (int *)(void *)(objcPtr), (objvPtr)) \ @@ -4196,6 +4197,7 @@ extern const TclStubs *tclStubsPtr; # define Tcl_ParseArgsObjv(interp, argTable, objcPtr, objv, remObjv) (sizeof(*(objcPtr)) == sizeof(int) \ ? tclStubsPtr->tclParseArgsObjv((interp), (argTable), (int *)(void *)(objcPtr), (objv), (remObjv)) \ : tclStubsPtr->tcl_ParseArgsObjv((interp), (argTable), (Tcl_Size *)(void *)(objcPtr), (objv), (remObjv))) +#endif /* TCL_MAJOR_VERSION < 9 || !defined(TCL_NO_DEPRECATED) */ #else # define Tcl_WCharToUtfDString (sizeof(wchar_t) != sizeof(short) \ ? (char *(*)(const wchar_t *, Tcl_Size, Tcl_DString *))Tcl_UniCharToUtfDString \ diff --git a/generic/tclListObj.c b/generic/tclListObj.c index 39d2c11..6d3b587 100644 --- a/generic/tclListObj.c +++ b/generic/tclListObj.c @@ -2025,7 +2025,7 @@ Tcl_ListObjLength( return TCL_OK; } -Tcl_Size +Tcl_Size ListLength(Tcl_Obj *listPtr) { ListRep listRep; diff --git a/generic/tclLiteral.c b/generic/tclLiteral.c index 7ddb88a..9051b45 100644 --- a/generic/tclLiteral.c +++ b/generic/tclLiteral.c @@ -646,7 +646,7 @@ TclAddLiteralObj( if (litPtrPtr) { *litPtrPtr = lPtr; } - + return objIndex; } diff --git a/generic/tclUtil.c b/generic/tclUtil.c index 00e1212..b765a0f 100644 --- a/generic/tclUtil.c +++ b/generic/tclUtil.c @@ -3679,8 +3679,8 @@ GetEndOffsetFromObj( offset = irPtr->wideValue; if (offset == WIDE_MAX) { - /* - * Encodes end+1. This is distinguished from end+n as noted above + /* + * Encodes end+1. This is distinguished from end+n as noted above * NOTE: this may wrap around if the caller passes (as lset does) * listLen-1 as endValue and and listLen is 0. The -1 will be * interpreted as FF...FF and adding 1 will result in 0 which diff --git a/generic/tclZipfs.c b/generic/tclZipfs.c index 7843996..48e7415 100644 --- a/generic/tclZipfs.c +++ b/generic/tclZipfs.c @@ -5140,7 +5140,7 @@ ZipFSMatchMountPoints( { Tcl_HashEntry *hPtr; Tcl_HashSearch search; - size_t l; + size_t l; Tcl_Size normLength; const char *path = Tcl_GetStringFromObj(normPathPtr, &normLength); size_t len = normLength; -- cgit v0.12