From f61c3bdb284cedeb0db64a332f84bba54262565c Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Tue, 1 May 2018 19:02:32 +0000 Subject: Start implementing TIP #497. regexp's now are >BMP-aware. WIP --- generic/regc_locale.c | 4 +- generic/regcustom.h | 12 ++--- generic/regex.h | 2 +- generic/tclInt.h | 9 ++++ generic/tclRegexp.c | 39 +++++++++------- generic/tclUtf.c | 125 ++++++++++++++++++++++++++++++++++++++++++++++++++ 6 files changed, 162 insertions(+), 29 deletions(-) diff --git a/generic/regc_locale.c b/generic/regc_locale.c index 002b264..19ac511 100644 --- a/generic/regc_locale.c +++ b/generic/regc_locale.c @@ -828,7 +828,7 @@ element( */ Tcl_DStringInit(&ds); - np = Tcl_UniCharToUtfDString(startp, (int)len, &ds); + np = TclUnicodeToUtfDString(startp, (int)len, &ds); for (cn=cnames; cn->name!=NULL; cn++) { if (strlen(cn->name)==len && strncmp(cn->name, np, len)==0) { break; /* NOTE BREAK OUT */ @@ -1000,7 +1000,7 @@ cclass( len = endp - startp; Tcl_DStringInit(&ds); - np = Tcl_UniCharToUtfDString(startp, (int)len, &ds); + np = TclUnicodeToUtfDString(startp, (int)len, &ds); /* * Map the name to the corresponding enumerated value. diff --git a/generic/regcustom.h b/generic/regcustom.h index 095385d..5befada 100644 --- a/generic/regcustom.h +++ b/generic/regcustom.h @@ -66,7 +66,7 @@ #undef __REG_NOCHAR #endif /* Interface types */ -#define __REG_WIDE_T Tcl_UniChar +#define __REG_WIDE_T unsigned #define __REG_REGOFF_T long /* Not really right, but good enough... */ /* Names and declarations */ #define __REG_WIDE_COMPILE TclReComp @@ -81,22 +81,16 @@ * Internal character type and related. */ -typedef Tcl_UniChar chr; /* The type itself. */ +typedef unsigned chr; /* The type itself. */ typedef int pchr; /* What it promotes to. */ typedef unsigned uchr; /* Unsigned type that will hold a chr. */ typedef int celt; /* Type to hold chr, or NOCELT */ #define NOCELT (-1) /* Celt value which is not valid chr */ #define CHR(c) (UCHAR(c)) /* Turn char literal into chr literal */ #define DIGITVAL(c) ((c)-'0') /* Turn chr digit into its value */ -#if TCL_UTF_MAX > 4 #define CHRBITS 32 /* Bits in a chr; must not use sizeof */ #define CHR_MIN 0x00000000 /* Smallest and largest chr; the value */ -#define CHR_MAX 0x10ffff /* CHR_MAX-CHR_MIN+1 should fit in uchr */ -#else -#define CHRBITS 16 /* Bits in a chr; must not use sizeof */ -#define CHR_MIN 0x0000 /* Smallest and largest chr; the value */ -#define CHR_MAX 0xffff /* CHR_MAX-CHR_MIN+1 should fit in uchr */ -#endif +#define CHR_MAX 0x0010ffff /* CHR_MAX-CHR_MIN+1 should fit in uchr */ /* * Functions operating on chr. diff --git a/generic/regex.h b/generic/regex.h index 8845f72..0b559f4 100644 --- a/generic/regex.h +++ b/generic/regex.h @@ -99,7 +99,7 @@ extern "C" { #undef __REG_NOCHAR #endif /* interface types */ -#define __REG_WIDE_T Tcl_UniChar +#define __REG_WIDE_T unsigned #define __REG_REGOFF_T long /* not really right, but good enough... */ /* names and declarations */ #define __REG_WIDE_COMPILE TclReComp diff --git a/generic/tclInt.h b/generic/tclInt.h index 50048e9..28549d9 100644 --- a/generic/tclInt.h +++ b/generic/tclInt.h @@ -3985,6 +3985,15 @@ MODULE_SCOPE int TclPtrUnsetVarIdx(Tcl_Interp *interp, Var *varPtr, MODULE_SCOPE void TclInvalidateNsPath(Namespace *nsPtr); MODULE_SCOPE void TclFindArrayPtrElements(Var *arrayPtr, Tcl_HashTable *tablePtr); +#if TCL_UTF_MAX <= 4 +MODULE_SCOPE char * TclUnicodeToUtfDString(const unsigned *uniStr, + int uniLength, Tcl_DString *dsPtr); +MODULE_SCOPE unsigned * TclUtfToUnicodeDString(const char *src, int length, + Tcl_DString *dsPtr); +#else +# define TclUnicodeToUtfDString Tcl_UniCharToUtfDString +# define TclUtfToUnicodeDString Tcl_UtfToUniCharDString +#endif /* * The new extended interface to the variable traces. diff --git a/generic/tclRegexp.c b/generic/tclRegexp.c index 5f8dc20..79b979c 100644 --- a/generic/tclRegexp.c +++ b/generic/tclRegexp.c @@ -90,8 +90,8 @@ static void DupRegexpInternalRep(Tcl_Obj *srcPtr, static void FinalizeRegexp(ClientData clientData); static void FreeRegexp(TclRegexp *regexpPtr); static void FreeRegexpInternalRep(Tcl_Obj *objPtr); -static int RegExpExecUniChar(Tcl_Interp *interp, Tcl_RegExp re, - const Tcl_UniChar *uniString, int numChars, +static int RegExpExecUnicode(Tcl_Interp *interp, Tcl_RegExp re, + const __REG_WIDE_T *uniString, int numChars, int nmatches, int flags); static int SetRegexpFromAny(Tcl_Interp *interp, Tcl_Obj *objPtr); @@ -175,7 +175,7 @@ Tcl_RegExpExec( int flags, result, numChars; TclRegexp *regexp = (TclRegexp *) re; Tcl_DString ds; - const Tcl_UniChar *ustr; + const __REG_WIDE_T *ustr; /* * If the starting point is offset from the beginning of the buffer, then @@ -200,9 +200,9 @@ Tcl_RegExpExec( */ Tcl_DStringInit(&ds); - ustr = Tcl_UtfToUniCharDString(text, -1, &ds); - numChars = Tcl_DStringLength(&ds) / sizeof(Tcl_UniChar); - result = RegExpExecUniChar(interp, re, ustr, numChars, -1 /* nmatches */, + ustr = TclUtfToUnicodeDString(text, -1, &ds); + numChars = Tcl_DStringLength(&ds) / sizeof(__REG_WIDE_T); + result = RegExpExecUnicode(interp, re, ustr, numChars, -1 /* nmatches */, flags); Tcl_DStringFree(&ds); @@ -261,7 +261,7 @@ Tcl_RegExpRange( /* *--------------------------------------------------------------------------- * - * RegExpExecUniChar -- + * RegExpExecUnicode -- * * Execute the regular expression matcher using a compiled form of a * regular expression and save information about any match that is found. @@ -279,12 +279,12 @@ Tcl_RegExpRange( */ static int -RegExpExecUniChar( +RegExpExecUnicode( Tcl_Interp *interp, /* Interpreter to use for error reporting. */ Tcl_RegExp re, /* Compiled regular expression; returned by a * previous call to Tcl_GetRegExpFromObj */ - const Tcl_UniChar *wString, /* String against which to match re. */ - int numChars, /* Length of Tcl_UniChar string (must be + const __REG_WIDE_T *wString, /* String against which to match re. */ + int numChars, /* Length of Unicode string (must be * >=0). */ int nmatches, /* How many subexpression matches (counting * the whole match as subexpression 0) are of @@ -432,8 +432,9 @@ Tcl_RegExpExecObj( int flags) /* Regular expression execution flags. */ { TclRegexp *regexpPtr = (TclRegexp *) re; - Tcl_UniChar *udata; - int length; + Tcl_DString ds; + __REG_WIDE_T *udata; + int length, result; int reflags = regexpPtr->flags; #define TCL_REG_GLOBOK_FLAGS \ (TCL_REG_ADVANCED | TCL_REG_NOSUB | TCL_REG_NOCASE) @@ -464,7 +465,9 @@ Tcl_RegExpExecObj( regexpPtr->string = NULL; regexpPtr->objPtr = textObj; - udata = Tcl_GetUnicodeFromObj(textObj, &length); + Tcl_DStringInit(&ds); + udata = TclUtfToUnicodeDString(Tcl_GetString(textObj), -1, &ds); + length = Tcl_DStringLength(&ds)/sizeof(__REG_WIDE_T); if (offset > length) { offset = length; @@ -472,7 +475,9 @@ Tcl_RegExpExecObj( udata += offset; length -= offset; - return RegExpExecUniChar(interp, re, udata, length, nmatches, flags); + result = RegExpExecUnicode(interp, re, udata, length, nmatches, flags); + Tcl_DStringFree(&ds); + return result; } /* @@ -858,7 +863,7 @@ CompileRegexp( int flags) /* Compilation flags. */ { TclRegexp *regexpPtr; - const Tcl_UniChar *uniString; + const __REG_WIDE_T *uniString; int numChars, status, i, exact; Tcl_DString stringBuf; ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); @@ -923,8 +928,8 @@ CompileRegexp( */ Tcl_DStringInit(&stringBuf); - uniString = Tcl_UtfToUniCharDString(string, length, &stringBuf); - numChars = Tcl_DStringLength(&stringBuf) / sizeof(Tcl_UniChar); + uniString = TclUtfToUnicodeDString(string, length, &stringBuf); + numChars = Tcl_DStringLength(&stringBuf) / sizeof(__REG_WIDE_T); /* * Compile the string and check for errors. diff --git a/generic/tclUtf.c b/generic/tclUtf.c index 1d73a7a..259a124 100644 --- a/generic/tclUtf.c +++ b/generic/tclUtf.c @@ -235,6 +235,63 @@ Tcl_UniCharToUtfDString( /* *--------------------------------------------------------------------------- * + * TclUnicodeToUtfDString -- + * + * Convert the given Unicode string to UTF-8. + * + * Results: + * The return value is a pointer to the UTF-8 representation of the + * Unicode string. Storage for the return value is appended to the end of + * dsPtr. + * + * Side effects: + * None. + * + *--------------------------------------------------------------------------- + */ + +#if TCL_UTF_MAX <= 4 +char * +TclUnicodeToUtfDString( + const unsigned *uniStr, /* Unicode string to convert to UTF-8. */ + int uniLength, /* Length of Unicode string in Tcl_UniChars + * (must be >= 0). */ + Tcl_DString *dsPtr) /* UTF-8 representation of string is appended + * to this previously initialized DString. */ +{ + const unsigned *w, *wEnd; + char *p, *string; + int oldLength; + + /* + * UTF-8 string length in bytes will be <= Unicode string length * 4. + */ + + oldLength = Tcl_DStringLength(dsPtr); + Tcl_DStringSetLength(dsPtr, (oldLength + uniLength + 1) * 4); + string = Tcl_DStringValue(dsPtr) + oldLength; + + p = string; + wEnd = uniStr + uniLength; + for (w = uniStr; w < wEnd; ) { + if ((*w & 0xD800) == 0xD800) { + *p++ = (*w >> 12) | 0xE0; + *p++ = ((*w >> 6) & 0x3F) | 0x80; + *p++ = (*w & 0x3F) | 0xE0; + } else { + p += Tcl_UniCharToUtf(*w, p); + } + w++; + } + Tcl_DStringSetLength(dsPtr, oldLength + (p - string)); + + return string; +} +#endif + +/* + *--------------------------------------------------------------------------- + * * Tcl_UtfToUniChar -- * * Extract the Tcl_UniChar represented by the UTF-8 string. Bad UTF-8 @@ -439,6 +496,74 @@ Tcl_UtfToUniCharDString( /* *--------------------------------------------------------------------------- * + * TclUtfToUnicodeDString -- + * + * Convert the UTF-8 string to Unicode. + * + * Results: + * The return value is a pointer to the Unicode representation of the + * UTF-8 string. Storage for the return value is appended to the end of + * dsPtr. The Unicode string is terminated with a Unicode NULL character. + * + * Side effects: + * None. + * + *--------------------------------------------------------------------------- + */ +#if TCL_UTF_MAX <= 4 +unsigned * +TclUtfToUnicodeDString( + const char *src, /* UTF-8 string to convert to Unicode. */ + int length, /* Length of UTF-8 string in bytes, or -1 for + * strlen(). */ + Tcl_DString *dsPtr) /* Unicode representation of string is + * appended to this previously initialized + * DString. */ +{ + Tcl_UniChar ch = 0; + unsigned *w, *wString; + const char *p, *end; + int oldLength, len; + + if (length < 0) { + length = strlen(src); + } + + /* + * Unicode string length in Tcl_UniChars will be <= UTF-8 string length in + * bytes. + */ + + oldLength = Tcl_DStringLength(dsPtr); +/* TODO: fix overreach! */ + Tcl_DStringSetLength(dsPtr, + (int) ((oldLength + length + 1) * sizeof(unsigned))); + wString = (unsigned *) (Tcl_DStringValue(dsPtr) + oldLength); + + w = wString; + end = src + length; + for (p = src; p < end; ) { + len = TclUtfToUniChar(p, &ch); + if (!len) { + int high = ch; + len = TclUtfToUniChar(p, &ch); + *w++ = ((high & 0x7ff) << 10) + (ch & 0x7ff) + 0x10000; + } else { + *w++ = ch; + } + p += len; + } + *w = '\0'; + Tcl_DStringSetLength(dsPtr, + (oldLength + ((char *) w - (char *) wString))); + + return wString; +} +#endif + +/* + *--------------------------------------------------------------------------- + * * Tcl_UtfCharComplete -- * * Determine if the UTF-8 string of the given length is long enough to be -- cgit v0.12 From 8265ea67d6285031031eeee4037a3b9b35262a10 Mon Sep 17 00:00:00 2001 From: dgp Date: Sat, 11 May 2019 15:04:57 +0000 Subject: Convert deprecation to elimination for Tcl 9. --- doc/TraceVar.3 | 5 +++-- generic/tcl.h | 4 ---- generic/tclTrace.c | 16 ---------------- 3 files changed, 3 insertions(+), 22 deletions(-) diff --git a/doc/TraceVar.3 b/doc/TraceVar.3 index ef5d80a..dd72563 100644 --- a/doc/TraceVar.3 +++ b/doc/TraceVar.3 @@ -5,7 +5,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -.TH Tcl_TraceVar 3 8.7 Tcl "Tcl Library Procedures" +.TH Tcl_TraceVar 3 9.0 Tcl "Tcl Library Procedures" .so man.macros .BS .SH NAME @@ -333,7 +333,8 @@ The routine \fBTcl_InterpDeleted\fR is an important tool for this. When \fBTcl_InterpDeleted\fR returns 1, \fIproc\fR will not be able to invoke any scripts in \fIinterp\fR. You may encounter old code using a deprecated flag value \fBTCL_INTERP_DESTROYED\fR to signal this -condition, but any supported code should be converted to stop using it. +condition, but Tcl 9 no longer supports this. Any supported code +must be converted to stop using it. .PP A trace procedure can be called at any time, even when there are partially formed results stored in the interpreter. If diff --git a/generic/tcl.h b/generic/tcl.h index ee8ab68..160de7a 100644 --- a/generic/tcl.h +++ b/generic/tcl.h @@ -887,10 +887,6 @@ typedef struct Tcl_DString { #define TCL_TRACE_UNSETS 0x40 #define TCL_TRACE_DESTROYED 0x80 -#if !defined(TCL_NO_DEPRECATED) && TCL_MAJOR_VERSION < 9 -#define TCL_INTERP_DESTROYED 0x100 -#endif - #define TCL_LEAVE_ERR_MSG 0x200 #define TCL_TRACE_ARRAY 0x800 #ifndef TCL_REMOVE_OBSOLETE_TRACES diff --git a/generic/tclTrace.c b/generic/tclTrace.c index 56010e4..e3b02b7 100644 --- a/generic/tclTrace.c +++ b/generic/tclTrace.c @@ -2565,9 +2565,6 @@ TclObjCallVarTraces( leaveErrMsg); } -#undef TCL_INTERP_DESTROYED -#define TCL_INTERP_DESTROYED 0x100 - int TclCallVarTraces( Interp *iPtr, /* Interpreter containing variable. */ @@ -2647,13 +2644,6 @@ TclCallVarTraces( } /* - * Ignore any caller-provided TCL_INTERP_DESTROYED flag. Only we can - * set it correctly. - */ - - flags &= ~TCL_INTERP_DESTROYED; - - /* * Invoke traces on the array containing the variable, if relevant. */ @@ -2675,9 +2665,6 @@ TclCallVarTraces( if (state == NULL) { state = Tcl_SaveInterpState((Tcl_Interp *) iPtr, code); } - if (Tcl_InterpDeleted((Tcl_Interp *) iPtr)) { - flags |= TCL_INTERP_DESTROYED; - } result = tracePtr->traceProc(tracePtr->clientData, (Tcl_Interp *) iPtr, part1, part2, flags); if (result != NULL) { @@ -2719,9 +2706,6 @@ TclCallVarTraces( if (state == NULL) { state = Tcl_SaveInterpState((Tcl_Interp *) iPtr, code); } - if (Tcl_InterpDeleted((Tcl_Interp *) iPtr)) { - flags |= TCL_INTERP_DESTROYED; - } result = tracePtr->traceProc(tracePtr->clientData, (Tcl_Interp *) iPtr, part1, part2, flags); if (result != NULL) { -- cgit v0.12 From 4864626e88652c0a09494ade3aacab44a122777e Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Fri, 5 Jul 2019 13:34:24 +0000 Subject: Fix [4718b41c56d8c135] for win32. Now timestamps on Win32 can be > 19 january 2038. Caveat: Now Tcl MUST be compiled with VS2005+, or any other compiler which has C headers compatible with VC2005+ (latest mingw-w64 is OK too!) Tcl on Win32 is now no longer compiled with _USE_32BIT_TIME_T, so this is (potentially) binary incompatible. --- generic/tcl.h | 19 ++++--------------- generic/tclBasic.c | 8 ++++---- win/tclWinFile.c | 14 +++++++------- win/tclWinPort.h | 3 +-- 4 files changed, 16 insertions(+), 28 deletions(-) diff --git a/generic/tcl.h b/generic/tcl.h index 46561b5..37895b8 100644 --- a/generic/tcl.h +++ b/generic/tcl.h @@ -308,15 +308,7 @@ typedef unsigned TCL_WIDE_INT_TYPE Tcl_WideUInt; #define Tcl_DoubleAsWide(val) ((Tcl_WideInt)((double)(val))) #if defined(_WIN32) -# ifdef __BORLANDC__ - typedef struct stati64 Tcl_StatBuf; -# elif defined(_WIN64) - typedef struct __stat64 Tcl_StatBuf; -# elif (defined(_MSC_VER) && (_MSC_VER < 1400)) || defined(_USE_32BIT_TIME_T) - typedef struct _stati64 Tcl_StatBuf; -# else - typedef struct _stat32i64 Tcl_StatBuf; -# endif /* _MSC_VER < 1400 */ + typedef struct __stat64 Tcl_StatBuf; #elif defined(__CYGWIN__) typedef struct { dev_t st_dev; @@ -329,13 +321,10 @@ typedef unsigned TCL_WIDE_INT_TYPE Tcl_WideUInt; dev_t st_rdev; /* Here is a 4-byte gap */ long long st_size; - struct {long tv_sec;} st_atim; - struct {long tv_sec;} st_mtim; - struct {long tv_sec;} st_ctim; - /* Here is a 4-byte gap */ + struct {long long tv_sec;} st_atim; + struct {long long tv_sec;} st_mtim; + struct {long long tv_sec;} st_ctim; } Tcl_StatBuf; -#elif defined(HAVE_STRUCT_STAT64) && !defined(__APPLE__) - typedef struct stat64 Tcl_StatBuf; #else typedef struct stat Tcl_StatBuf; #endif diff --git a/generic/tclBasic.c b/generic/tclBasic.c index f957dc8..d35fa47 100644 --- a/generic/tclBasic.c +++ b/generic/tclBasic.c @@ -639,14 +639,14 @@ Tcl_CreateInterp(void) } #if defined(_WIN32) && !defined(_WIN64) - if (sizeof(time_t) != 4) { + if (sizeof(time_t) != 8) { /*NOTREACHED*/ - Tcl_Panic(" is not compatible with MSVC"); + Tcl_Panic(" is not compatible with VS2005+"); } if ((offsetof(Tcl_StatBuf,st_atime) != 32) - || (offsetof(Tcl_StatBuf,st_ctime) != 40)) { + || (offsetof(Tcl_StatBuf,st_ctime) != 48)) { /*NOTREACHED*/ - Tcl_Panic(" is not compatible with MSVC"); + Tcl_Panic(" is not compatible with VS2005+"); } #endif diff --git a/win/tclWinFile.c b/win/tclWinFile.c index 080156e..14c4378 100644 --- a/win/tclWinFile.c +++ b/win/tclWinFile.c @@ -149,8 +149,8 @@ typedef struct { * Other typedefs required by this code. */ -static time_t ToCTime(FILETIME fileTime); -static void FromCTime(time_t posixTime, FILETIME *fileTime); +static __time64_t ToCTime(FILETIME fileTime); +static void FromCTime(__time64_t posixTime, FILETIME *fileTime); /* * Declarations for local functions defined in this file: @@ -2265,7 +2265,7 @@ NativeStatMode( * * ToCTime -- * - * Converts a Windows FILETIME to a time_t in UTC. + * Converts a Windows FILETIME to a __time64_t in UTC. * * Results: * Returns the count of seconds from the Posix epoch. @@ -2273,7 +2273,7 @@ NativeStatMode( *------------------------------------------------------------------------ */ -static time_t +static __time64_t ToCTime( FILETIME fileTime) /* UTC time */ { @@ -2282,7 +2282,7 @@ ToCTime( convertedTime.LowPart = fileTime.dwLowDateTime; convertedTime.HighPart = (LONG) fileTime.dwHighDateTime; - return (time_t) ((convertedTime.QuadPart - + return (__time64_t) ((convertedTime.QuadPart - (Tcl_WideInt) POSIX_EPOCH_AS_FILETIME) / (Tcl_WideInt) 10000000); } @@ -2291,7 +2291,7 @@ ToCTime( * * FromCTime -- * - * Converts a time_t to a Windows FILETIME + * Converts a __time64_t to a Windows FILETIME * * Results: * Returns the count of 100-ns ticks seconds from the Windows epoch. @@ -2301,7 +2301,7 @@ ToCTime( static void FromCTime( - time_t posixTime, + __time64_t posixTime, FILETIME *fileTime) /* UTC Time */ { LARGE_INTEGER convertedTime; diff --git a/win/tclWinPort.h b/win/tclWinPort.h index e74ee1c..5bcf76c 100644 --- a/win/tclWinPort.h +++ b/win/tclWinPort.h @@ -15,8 +15,7 @@ #define _TCLWINPORT #if !defined(_WIN64) && defined(BUILD_tcl) -/* See [Bug 3354324]: file mtime sets wrong time */ -# define _USE_32BIT_TIME_T +# define __MINGW_USE_VC2005_COMPAT #endif /* -- cgit v0.12 From 44952e7c43df343677cc3b6e2e455bda44b416f2 Mon Sep 17 00:00:00 2001 From: sebres Date: Fri, 12 Jul 2019 14:32:39 +0000 Subject: restore test-cases covering bug-4718b41c56 (partially revert last checkin, cherrypick from 8.7), set constraint time64bit to 1 (always valid in 9.0) --- tests/cmdAH.test | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/tests/cmdAH.test b/tests/cmdAH.test index 54c4413..3d8f4f5 100644 --- a/tests/cmdAH.test +++ b/tests/cmdAH.test @@ -21,6 +21,7 @@ catch [list package require -exact Tcltest [info patchlevel]] testConstraint testchmod [llength [info commands testchmod]] testConstraint testsetplatform [llength [info commands testsetplatform]] testConstraint testvolumetype [llength [info commands testvolumetype]] +testConstraint time64bit 1 testConstraint linkDirectory [expr { ![testConstraint win] || ($::tcl_platform(osVersion) >= 5.0 @@ -1288,6 +1289,22 @@ test cmdAH-24.14.1 { file mtime [file join [temporaryDirectory] CON.txt] } -match regexp -result {could not (?:get modification time|read)} -returnCodes error +# 3155760000 is 64-bit unix time, Wed Jan 01 00:00:00 GMT 2070: +test cmdAH-24.20.1 {Tcl_FileObjCmd: atime 64-bit time_t, bug [4718b41c56]} -constraints {time64bit} -setup { + set filename [makeFile "" foo.text] +} -body { + list [file atime $filename 3155760000] [file atime $filename] +} -cleanup { + removeFile $filename +} -result {3155760000 3155760000} +test cmdAH-24.20.2 {Tcl_FileObjCmd: mtime 64-bit time_t, bug [4718b41c56]} -constraints {time64bit} -setup { + set filename [makeFile "" foo.text] +} -body { + list [file mtime $filename 3155760000] [file mtime $filename] +} -cleanup { + file delete -force $filename +} -result {3155760000 3155760000} + # owned test cmdAH-25.1 {Tcl_FileObjCmd: owned} -returnCodes error -body { file owned a b -- cgit v0.12 From 9888ccda67f1a91d95ba372d5f008f939da39b6b Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Mon, 5 Aug 2019 20:15:15 +0000 Subject: Fix signature of TclWCharToUtfDString for TCL_UTF_MAX=6, and handling of length -1 --- generic/tclInt.h | 4 ++-- generic/tclUtf.c | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/generic/tclInt.h b/generic/tclInt.h index cb08a54..1631316 100644 --- a/generic/tclInt.h +++ b/generic/tclInt.h @@ -3175,9 +3175,9 @@ MODULE_SCOPE void TclRegisterCommandTypeName( #if (TCL_UTF_MAX > 4) && (defined(__CYGWIN__) || defined(_WIN32)) MODULE_SCOPE int TclUtfToWChar(const char *src, WCHAR *chPtr); MODULE_SCOPE char * TclWCharToUtfDString(const WCHAR *uniStr, - int uniLength, Tcl_DString *dsPtr); + size_t uniLength, Tcl_DString *dsPtr); MODULE_SCOPE WCHAR * TclUtfToWCharDString(const char *src, - int length, Tcl_DString *dsPtr); + size_t length, Tcl_DString *dsPtr); #else # define TclUtfToWChar TclUtfToUniChar # define TclWCharToUtfDString Tcl_UniCharToUtfDString diff --git a/generic/tclUtf.c b/generic/tclUtf.c index ef89a6a..e27e465 100644 --- a/generic/tclUtf.c +++ b/generic/tclUtf.c @@ -269,7 +269,7 @@ Tcl_UniCharToUtfDString( char * TclWCharToUtfDString( const WCHAR *uniStr, /* WCHAR string to convert to UTF-8. */ - int uniLength, /* Length of WCHAR string in Tcl_UniChars + size_t uniLength, /* Length of WCHAR string in Tcl_UniChars * (must be >= 0). */ Tcl_DString *dsPtr) /* UTF-8 representation of string is appended * to this previously initialized DString. */ @@ -636,7 +636,7 @@ Tcl_UtfToUniCharDString( WCHAR * TclUtfToWCharDString( const char *src, /* UTF-8 string to convert to Unicode. */ - int length, /* Length of UTF-8 string in bytes, or -1 for + size_t length, /* Length of UTF-8 string in bytes, or -1 for * strlen(). */ Tcl_DString *dsPtr) /* Unicode representation of string is * appended to this previously initialized @@ -646,7 +646,7 @@ TclUtfToWCharDString( const char *p, *end; int oldLength; - if (length < 0) { + if (length == TCL_AUTO_LENGTH) { length = strlen(src); } -- cgit v0.12 From 6ba55114e28426856f8905b08e31340c268459d5 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Sun, 11 Aug 2019 21:17:35 +0000 Subject: Fix handling of length (size_t)-1 in tclMain.c. This should fix handling of command-line arguments with TCL_UTF_MAX=6, necessary to make tclsh run at all ... --- generic/tclMain.c | 2 +- generic/tclUtf.c | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/generic/tclMain.c b/generic/tclMain.c index ea69b2d..31e6438 100644 --- a/generic/tclMain.c +++ b/generic/tclMain.c @@ -70,7 +70,7 @@ NewNativeObj( Tcl_DString ds; #ifdef UNICODE - if (length > 0) { + if (length != TCL_AUTO_LENGTH) { length *= sizeof(WCHAR); } Tcl_WinTCharToUtf(string, length, &ds); diff --git a/generic/tclUtf.c b/generic/tclUtf.c index e27e465..c3b5163 100644 --- a/generic/tclUtf.c +++ b/generic/tclUtf.c @@ -276,7 +276,8 @@ TclWCharToUtfDString( { const WCHAR *w, *wEnd; char *p, *string; - int oldLength, len = 1; + size_t oldLength; + int len = 1; /* * UTF-8 string length in bytes will be <= Unicode string length * 4. @@ -644,14 +645,14 @@ TclUtfToWCharDString( { WCHAR ch = 0, *w, *wString; const char *p, *end; - int oldLength; + size_t oldLength; if (length == TCL_AUTO_LENGTH) { length = strlen(src); } /* - * Unicode string length in Tcl_UniChars will be <= UTF-8 string length in + * Unicode string length in WCHARs will be <= UTF-8 string length in * bytes. */ -- cgit v0.12 From cef22b73ee8b85982687b86863635d8e57e7c959 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Thu, 5 Sep 2019 07:17:54 +0000 Subject: previous commit should not have been a merge-mark ... --- win/tclWinPort.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/win/tclWinPort.h b/win/tclWinPort.h index 5bcf76c..aae6592 100644 --- a/win/tclWinPort.h +++ b/win/tclWinPort.h @@ -14,7 +14,7 @@ #ifndef _TCLWINPORT #define _TCLWINPORT -#if !defined(_WIN64) && defined(BUILD_tcl) +#if !defined(_WIN64) # define __MINGW_USE_VC2005_COMPAT #endif -- cgit v0.12 From 556c0dbc24744d656c4e3b7ebe4810fd1dc089a5 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Sat, 14 Sep 2019 13:11:55 +0000 Subject: Two paces where TCL_AUTO_LENGTH should be used --- generic/tclUtf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/generic/tclUtf.c b/generic/tclUtf.c index 644939b..b12e8bf 100644 --- a/generic/tclUtf.c +++ b/generic/tclUtf.c @@ -240,7 +240,7 @@ Tcl_UniCharToUtfDString( if (uniStr == NULL) { return NULL; } - if (uniLength < 0) { + if (uniLength == TCL_AUTO_LENGTH) { uniLength = 0; w = uniStr; while (*w != '\0') { @@ -282,7 +282,7 @@ Tcl_Char16ToUtfDString( if (uniStr == NULL) { return NULL; } - if (uniLength < 0) { + if (uniLength == TCL_AUTO_LENGTH) { uniLength = 0; w = uniStr; -- cgit v0.12 From 0153d6f564a91a55104e15fd3fbeb0afc9735302 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Wed, 25 Sep 2019 11:51:41 +0000 Subject: Make Tcl_WinUtfToTChar/Tcl_WinTCharToUtf really deprecate in 9.0 (now that no battery-extensions use it any more) Remove two functions which are not used any more (they changed to macro's earlier) --- generic/tclObj.c | 129 ------------------------------------------------- generic/tclPlatDecls.h | 2 +- 2 files changed, 1 insertion(+), 130 deletions(-) diff --git a/generic/tclObj.c b/generic/tclObj.c index f8fecbd..d711adb 100644 --- a/generic/tclObj.c +++ b/generic/tclObj.c @@ -2503,135 +2503,6 @@ UpdateStringOfInt( /* *---------------------------------------------------------------------- * - * Tcl_NewLongObj -- - * - * If a client is compiled with TCL_MEM_DEBUG defined, calls to - * Tcl_NewLongObj to create a new long integer object end up calling the - * debugging function Tcl_DbNewLongObj instead. - * - * Otherwise, if the client is compiled without TCL_MEM_DEBUG defined, - * calls to Tcl_NewLongObj result in a call to one of the two - * Tcl_NewLongObj implementations below. We provide two implementations - * so that the Tcl core can be compiled to do memory debugging of the - * core even if a client does not request it for itself. - * - * Integer and long integer objects share the same "integer" type - * implementation. We store all integers as longs and Tcl_GetIntFromObj - * checks whether the current value of the long can be represented by an - * int. - * - * Results: - * The newly created object is returned. This object will have an invalid - * string representation. The returned object has ref count 0. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -#ifndef TCL_NO_DEPRECATED -#undef Tcl_NewLongObj -#ifdef TCL_MEM_DEBUG - -Tcl_Obj * -Tcl_NewLongObj( - long longValue) /* Long integer used to initialize the - * new object. */ -{ - return Tcl_DbNewWideIntObj(longValue, "unknown", 0); -} - -#else /* if not TCL_MEM_DEBUG */ - -Tcl_Obj * -Tcl_NewLongObj( - long longValue) /* Long integer used to initialize the - * new object. */ -{ - Tcl_Obj *objPtr; - - TclNewIntObj(objPtr, longValue); - return objPtr; -} -#endif /* if TCL_MEM_DEBUG */ -#endif /* TCL_NO_DEPRECATED */ - -/* - *---------------------------------------------------------------------- - * - * Tcl_DbNewLongObj -- - * - * If a client is compiled with TCL_MEM_DEBUG defined, calls to - * Tcl_NewIntObj and Tcl_NewLongObj to create new integer or long integer - * objects end up calling the debugging function Tcl_DbNewLongObj - * instead. We provide two implementations of Tcl_DbNewLongObj so that - * whether the Tcl core is compiled to do memory debugging of the core is - * independent of whether a client requests debugging for itself. - * - * When the core is compiled with TCL_MEM_DEBUG defined, Tcl_DbNewLongObj - * calls Tcl_DbCkalloc directly with the file name and line number from - * its caller. This simplifies debugging since then the [memory active] - * command will report the caller's file name and line number when - * reporting objects that haven't been freed. - * - * Otherwise, when the core is compiled without TCL_MEM_DEBUG defined, - * this function just returns the result of calling Tcl_NewLongObj. - * - * Results: - * The newly created long integer object is returned. This object will - * have an invalid string representation. The returned object has ref - * count 0. - * - * Side effects: - * Allocates memory. - * - *---------------------------------------------------------------------- - */ - -#ifndef TCL_NO_DEPRECATED -#undef Tcl_DbNewLongObj -#ifdef TCL_MEM_DEBUG - -Tcl_Obj * -Tcl_DbNewLongObj( - long longValue, /* Long integer used to initialize the new - * object. */ - const char *file, /* The name of the source file calling this - * function; used for debugging. */ - int line) /* Line number in the source file; used for - * debugging. */ -{ - Tcl_Obj *objPtr; - - TclDbNewObj(objPtr, file, line); - /* Optimized TclInvalidateStringRep */ - objPtr->bytes = NULL; - - objPtr->internalRep.wideValue = longValue; - objPtr->typePtr = &tclIntType; - return objPtr; -} - -#else /* if not TCL_MEM_DEBUG */ - -Tcl_Obj * -Tcl_DbNewLongObj( - long longValue, /* Long integer used to initialize the new - * object. */ - const char *file, /* The name of the source file calling this - * function; used for debugging. */ - int line) /* Line number in the source file; used for - * debugging. */ -{ - return Tcl_NewWideIntObj(longValue); -} -#endif /* TCL_MEM_DEBUG */ -#endif /* TCL_NO_DEPRECATED */ - -/* - *---------------------------------------------------------------------- - * * Tcl_GetLongFromObj -- * * Attempt to return an long integer from the Tcl object "objPtr". If the diff --git a/generic/tclPlatDecls.h b/generic/tclPlatDecls.h index b1f6ecd..18e464c 100644 --- a/generic/tclPlatDecls.h +++ b/generic/tclPlatDecls.h @@ -99,7 +99,7 @@ extern const TclPlatStubs *tclPlatStubsPtr; #undef TCL_STORAGE_CLASS #define TCL_STORAGE_CLASS DLLIMPORT -#if defined(USE_TCL_STUBS) && defined(_WIN32) +#if defined(USE_TCL_STUBS) && defined(_WIN32) && !defined(TCL_NO_DEPRECATED) #define Tcl_WinUtfToTChar(string, len, dsPtr) (Tcl_DStringInit(dsPtr), \ (TCHAR *)Tcl_UtfToChar16DString((string), (len), (dsPtr))) #define Tcl_WinTCharToUtf(string, len, dsPtr) (Tcl_DStringInit(dsPtr), \ -- cgit v0.12 From 80a7abf7e553cc0c0ea01f10df7790996460b133 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Fri, 27 Sep 2019 13:02:39 +0000 Subject: Adapt test-case to full-utf correct behaviour --- tests/string.test | 14 +++++++------- tests/utf.test | 10 +++++----- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/tests/string.test b/tests/string.test index c54b5ba..299c765 100644 --- a/tests/string.test +++ b/tests/string.test @@ -31,7 +31,7 @@ proc makeShared {s} {uplevel 1 [list lappend copy $s]; return $s} testConstraint testobj [expr {[info commands testobj] ne {}}] testConstraint testindexobj [expr {[info commands testindexobj] ne {}}] testConstraint testevalex [expr {[info commands testevalex] ne {}}] -testConstraint tip389 [expr {[string length \U010000] == 2}] +testConstraint fullutf [expr {[string length \U010000] == 1}] # Used for constraining memory leak tests testConstraint memory [llength [info commands memory]] @@ -505,9 +505,9 @@ test string-5.19.$noComp {string index, bytearray object out of bounds} { test string-5.20.$noComp {string index, bytearray object out of bounds} { run {string index [binary format I* {0x50515253 0x52}] 20} } {} -test string-5.21.$noComp {string index, surrogates, bug [11ae2be95dac9417]} tip389 { +test string-5.21.$noComp {string index, surrogates, bug [11ae2be95dac9417]} fullutf { run {list [string index a\U100000b 1] [string index a\U100000b 2] [string index a\U100000b 3]} -} [list \U100000 {} b] +} [list \U100000 b {}] proc largest_int {} { @@ -1502,9 +1502,9 @@ test string-12.22.$noComp {string range, shimmering binary/index} { binary scan $s a* x run {string range $s $s end} } 000000001 -test string-12.23.$noComp {string range, surrogates, bug [11ae2be95dac9417]} tip389 { +test string-12.23.$noComp {string range, surrogates, bug [11ae2be95dac9417]} fullutf { run {list [string range a\U100000b 1 1] [string range a\U100000b 2 2] [string range a\U100000b 3 3]} -} [list \U100000 {} b] +} [list \U100000 b {}] test string-13.1.$noComp {string repeat} { list [catch {run {string repeat}} msg] $msg @@ -1743,10 +1743,10 @@ test string-17.7.$noComp {string totitle, unicode} { test string-17.8.$noComp {string totitle, compiled} { lindex [run {string totitle [list aa bb [list cc]]}] 0 } Aa -test string-17.9.$noComp {string totitle, surrogates, bug [11ae2be95dac9417]} tip389 { +test string-17.9.$noComp {string totitle, surrogates, bug [11ae2be95dac9417]} fullutf { run {list [string totitle a\U118c0c 1 1] [string totitle a\U118c0c 2 2] \ [string totitle a\U118c0c 3 3]} -} [list a\U118a0c a\U118c0C a\U118c0C] +} [list a\U118a0c a\U118c0C a\U118c0c] test string-18.1.$noComp {string trim} { list [catch {run {string trim}} msg] $msg diff --git a/tests/utf.test b/tests/utf.test index 979c4a6..45698e4 100644 --- a/tests/utf.test +++ b/tests/utf.test @@ -21,7 +21,7 @@ testConstraint testbytestring [llength [info commands testbytestring]] catch {unset x} # Some tests require support for 4-byte UTF-8 sequences -testConstraint tip389 [expr {[string length \U010000] == 2}] +testConstraint fullutf [expr {[string length \U010000] == 1}] test utf-1.1 {Tcl_UniCharToUtf: 1 byte sequences} testbytestring { expr {"\x01" eq [testbytestring "\x01"]} @@ -78,12 +78,12 @@ test utf-2.6 {Tcl_UtfToUniChar: lead (3-byte) followed by 1 trail} testbytestrin test utf-2.7 {Tcl_UtfToUniChar: lead (3-byte) followed by 2 trail} testbytestring { string length [testbytestring "\xE4\xb9\x8e"] } {1} -test utf-2.8 {Tcl_UtfToUniChar: lead (4-byte) followed by 3 trail} -constraints {tip389 testbytestring} -body { +test utf-2.8 {Tcl_UtfToUniChar: lead (4-byte) followed by 3 trail} -constraints {fullutf testbytestring} -body { string length [testbytestring "\xF0\x90\x80\x80"] -} -result {2} -test utf-2.9 {Tcl_UtfToUniChar: lead (4-byte) followed by 3 trail} -constraints {tip389 testbytestring} -body { +} -result {1} +test utf-2.9 {Tcl_UtfToUniChar: lead (4-byte) followed by 3 trail} -constraints {fullutf testbytestring} -body { string length [testbytestring "\xF4\x8F\xBF\xBF"] -} -result {2} +} -result {1} test utf-2.10 {Tcl_UtfToUniChar: lead (4-byte) followed by 3 trail, underflow} testbytestring { string length [testbytestring "\xF0\x8F\xBF\xBF"] } {4} -- cgit v0.12 From e9121854f920a1649aab0470f552174d29c41c9d Mon Sep 17 00:00:00 2001 From: Kevin Walzer Date: Fri, 25 Oct 2019 01:16:54 +0000 Subject: Remove /System from auto_path on macOS because Apple has deprecated its own ancient installation of Tcl/Tk --- unix/configure | 4 ++-- unix/configure.ac | 4 ++-- unix/tcl.m4 | 2 -- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/unix/configure b/unix/configure index e9607db..57fbd11 100755 --- a/unix/configure +++ b/unix/configure @@ -10375,9 +10375,9 @@ VERSION=${TCL_VERSION} if test "$FRAMEWORK_BUILD" = "1" ; then test -z "$TCL_PACKAGE_PATH" && \ - TCL_PACKAGE_PATH="~/Library/Tcl /Library/Tcl /System/Library/Tcl ~/Library/Frameworks /Library/Frameworks /System/Library/Frameworks" + TCL_PACKAGE_PATH="~/Library/Tcl /Library/Tcl ~/Library/Frameworks /Library/Frameworks" test -z "$TCL_MODULE_PATH" && \ - TCL_MODULE_PATH="~/Library/Tcl /Library/Tcl /System/Library/Tcl" + TCL_MODULE_PATH="~/Library/Tcl /Library/Tcl" elif test "$prefix/lib" != "$libdir"; then TCL_PACKAGE_PATH="${libdir} ${prefix}/lib ${TCL_PACKAGE_PATH}" else diff --git a/unix/configure.ac b/unix/configure.ac index 8335b20..fe88066 100644 --- a/unix/configure.ac +++ b/unix/configure.ac @@ -930,9 +930,9 @@ VERSION=${TCL_VERSION} if test "$FRAMEWORK_BUILD" = "1" ; then test -z "$TCL_PACKAGE_PATH" && \ - TCL_PACKAGE_PATH="~/Library/Tcl /Library/Tcl /System/Library/Tcl ~/Library/Frameworks /Library/Frameworks /System/Library/Frameworks" + TCL_PACKAGE_PATH="~/Library/Tcl /Library/Tcl ~/Library/Frameworks /Library/Frameworks" test -z "$TCL_MODULE_PATH" && \ - TCL_MODULE_PATH="~/Library/Tcl /Library/Tcl /System/Library/Tcl" + TCL_MODULE_PATH="~/Library/Tcl /Library/Tcl" elif test "$prefix/lib" != "$libdir"; then TCL_PACKAGE_PATH="${libdir} ${prefix}/lib ${TCL_PACKAGE_PATH}" else diff --git a/unix/tcl.m4 b/unix/tcl.m4 index e592e18..5edb91a 100644 --- a/unix/tcl.m4 +++ b/unix/tcl.m4 @@ -77,7 +77,6 @@ AC_DEFUN([SC_PATH_TCLCONFIG], [ for i in `ls -d ~/Library/Frameworks 2>/dev/null` \ `ls -d /Library/Frameworks 2>/dev/null` \ `ls -d /Network/Library/Frameworks 2>/dev/null` \ - `ls -d /System/Library/Frameworks 2>/dev/null` \ ; do if test -f "$i/Tcl.framework/tclConfig.sh" ; then ac_cv_c_tclconfig="`(cd $i/Tcl.framework; pwd)`" @@ -210,7 +209,6 @@ AC_DEFUN([SC_PATH_TKCONFIG], [ for i in `ls -d ~/Library/Frameworks 2>/dev/null` \ `ls -d /Library/Frameworks 2>/dev/null` \ `ls -d /Network/Library/Frameworks 2>/dev/null` \ - `ls -d /System/Library/Frameworks 2>/dev/null` \ ; do if test -f "$i/Tk.framework/tkConfig.sh" ; then ac_cv_c_tkconfig="`(cd $i/Tk.framework; pwd)`" -- cgit v0.12 From 2d699b3818a62e40f4875dcbe68dc6b9bff12d24 Mon Sep 17 00:00:00 2001 From: pooryorick Date: Fri, 25 Oct 2019 13:17:28 +0000 Subject: If NO_REALPATH is defined, raise an error instead of building a broken Tcl. --- unix/tclUnixFCmd.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/unix/tclUnixFCmd.c b/unix/tclUnixFCmd.c index db49024..dd868ef 100644 --- a/unix/tclUnixFCmd.c +++ b/unix/tclUnixFCmd.c @@ -268,6 +268,11 @@ MODULE_SCOPE long tclMacOSXDarwinRelease; #else # define haveRealpath 1 #endif +#else /* NO_REALPATH */ +/* + * At least TclpObjNormalizedPath now requires REALPATH +*/ +#error NO_REALPATH is not supported #endif /* NO_REALPATH */ #ifdef HAVE_FTS -- cgit v0.12 From 2cd7aa2260d55c56deb2a17a759a8b1fe2f62ef2 Mon Sep 17 00:00:00 2001 From: Kevin Walzer Date: Sun, 27 Oct 2019 22:14:41 +0000 Subject: Remove /System from auto_path on macOS; change seems to have been overwritten by other merge --- macosx/README | 4 ++-- unix/configure.ac | 4 ++-- unix/tcl.m4 | 2 -- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/macosx/README b/macosx/README index 8340dfa..6384bf0 100644 --- a/macosx/README +++ b/macosx/README @@ -36,8 +36,8 @@ Weak-linking is available on OS X 10.2 or later, it additionally allows Tcl built on 10.x to run on any 10.y with x > y >= z (for a chosen z >= 2). - Tcl extensions can be installed in any of: - $HOME/Library/Tcl /Library/Tcl /System/Library/Tcl - $HOME/Library/Frameworks /Library/Frameworks /System/Library/Frameworks + $HOME/Library/Tcl /Library/Tcl + $HOME/Library/Frameworks /Library/Frameworks (searched in that order). Given a potential package directory $pkg, Tcl on OSX checks for the file $pkg/Resources/Scripts/pkgIndex.tcl as well as the usual $pkg/pkgIndex.tcl. diff --git a/unix/configure.ac b/unix/configure.ac index 8335b20..3bd6919 100644 --- a/unix/configure.ac +++ b/unix/configure.ac @@ -930,9 +930,9 @@ VERSION=${TCL_VERSION} if test "$FRAMEWORK_BUILD" = "1" ; then test -z "$TCL_PACKAGE_PATH" && \ - TCL_PACKAGE_PATH="~/Library/Tcl /Library/Tcl /System/Library/Tcl ~/Library/Frameworks /Library/Frameworks /System/Library/Frameworks" + TCL_PACKAGE_PATH="~/Library/Tcl /Library/Tcl ~/Library/Frameworks /Library/Frameworks /System/Library/Frameworks" test -z "$TCL_MODULE_PATH" && \ - TCL_MODULE_PATH="~/Library/Tcl /Library/Tcl /System/Library/Tcl" + TCL_MODULE_PATH="~/Library/Tcl /Library/Tcl" elif test "$prefix/lib" != "$libdir"; then TCL_PACKAGE_PATH="${libdir} ${prefix}/lib ${TCL_PACKAGE_PATH}" else diff --git a/unix/tcl.m4 b/unix/tcl.m4 index e592e18..5edb91a 100644 --- a/unix/tcl.m4 +++ b/unix/tcl.m4 @@ -77,7 +77,6 @@ AC_DEFUN([SC_PATH_TCLCONFIG], [ for i in `ls -d ~/Library/Frameworks 2>/dev/null` \ `ls -d /Library/Frameworks 2>/dev/null` \ `ls -d /Network/Library/Frameworks 2>/dev/null` \ - `ls -d /System/Library/Frameworks 2>/dev/null` \ ; do if test -f "$i/Tcl.framework/tclConfig.sh" ; then ac_cv_c_tclconfig="`(cd $i/Tcl.framework; pwd)`" @@ -210,7 +209,6 @@ AC_DEFUN([SC_PATH_TKCONFIG], [ for i in `ls -d ~/Library/Frameworks 2>/dev/null` \ `ls -d /Library/Frameworks 2>/dev/null` \ `ls -d /Network/Library/Frameworks 2>/dev/null` \ - `ls -d /System/Library/Frameworks 2>/dev/null` \ ; do if test -f "$i/Tk.framework/tkConfig.sh" ; then ac_cv_c_tkconfig="`(cd $i/Tk.framework; pwd)`" -- cgit v0.12 From 56f2abbf899a635cf10a1ab0993ff76f2ef6a13e Mon Sep 17 00:00:00 2001 From: Kevin Walzer Date: Sun, 27 Oct 2019 22:22:50 +0000 Subject: further refinement of configure to remove /System --- unix/configure | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/unix/configure b/unix/configure index e9607db..57fbd11 100755 --- a/unix/configure +++ b/unix/configure @@ -10375,9 +10375,9 @@ VERSION=${TCL_VERSION} if test "$FRAMEWORK_BUILD" = "1" ; then test -z "$TCL_PACKAGE_PATH" && \ - TCL_PACKAGE_PATH="~/Library/Tcl /Library/Tcl /System/Library/Tcl ~/Library/Frameworks /Library/Frameworks /System/Library/Frameworks" + TCL_PACKAGE_PATH="~/Library/Tcl /Library/Tcl ~/Library/Frameworks /Library/Frameworks" test -z "$TCL_MODULE_PATH" && \ - TCL_MODULE_PATH="~/Library/Tcl /Library/Tcl /System/Library/Tcl" + TCL_MODULE_PATH="~/Library/Tcl /Library/Tcl" elif test "$prefix/lib" != "$libdir"; then TCL_PACKAGE_PATH="${libdir} ${prefix}/lib ${TCL_PACKAGE_PATH}" else -- cgit v0.12 From 16ee735e92526dcb8faceb4889bbcc7200f0993b Mon Sep 17 00:00:00 2001 From: dgp Date: Tue, 5 Nov 2019 22:05:21 +0000 Subject: Bump to version 9.0a1 for release. --- README.md | 2 +- generic/tcl.h | 4 ++-- library/init.tcl | 2 +- unix/configure | 2 +- unix/configure.ac | 2 +- unix/tcl.spec | 2 +- win/configure | 2 +- win/configure.ac | 2 +- 8 files changed, 9 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 240cdf2..559c1c9 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # README: Tcl -This is the **Tcl 9.0a0** source distribution. +This is the **Tcl 9.0a1** source distribution. You can get any source release of Tcl from [our distribution site](https://sourceforge.net/projects/tcl/files/Tcl/). diff --git a/generic/tcl.h b/generic/tcl.h index 03189c6..97dd42b 100644 --- a/generic/tcl.h +++ b/generic/tcl.h @@ -51,10 +51,10 @@ extern "C" { #define TCL_MAJOR_VERSION 9 #define TCL_MINOR_VERSION 0 #define TCL_RELEASE_LEVEL TCL_ALPHA_RELEASE -#define TCL_RELEASE_SERIAL 0 +#define TCL_RELEASE_SERIAL 1 #define TCL_VERSION "9.0" -#define TCL_PATCH_LEVEL "9.0a0" +#define TCL_PATCH_LEVEL "9.0a1" #if defined(RC_INVOKED) /* diff --git a/library/init.tcl b/library/init.tcl index 0879064..9ca3eba 100644 --- a/library/init.tcl +++ b/library/init.tcl @@ -19,7 +19,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 9.0a0 +package require -exact Tcl 9.0a1 # 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 e10128e..a0d565a 100755 --- a/unix/configure +++ b/unix/configure @@ -2382,7 +2382,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu TCL_VERSION=9.0 TCL_MAJOR_VERSION=9 TCL_MINOR_VERSION=0 -TCL_PATCH_LEVEL="a0" +TCL_PATCH_LEVEL="a1" VERSION=${TCL_VERSION} EXTRA_INSTALL_BINARIES=${EXTRA_INSTALL_BINARIES:-"@:"} diff --git a/unix/configure.ac b/unix/configure.ac index 1b80fb3..19f1c64 100644 --- a/unix/configure.ac +++ b/unix/configure.ac @@ -25,7 +25,7 @@ m4_ifdef([SC_USE_CONFIG_HEADERS], [ TCL_VERSION=9.0 TCL_MAJOR_VERSION=9 TCL_MINOR_VERSION=0 -TCL_PATCH_LEVEL="a0" +TCL_PATCH_LEVEL="a1" VERSION=${TCL_VERSION} EXTRA_INSTALL_BINARIES=${EXTRA_INSTALL_BINARIES:-"@:"} diff --git a/unix/tcl.spec b/unix/tcl.spec index 0858ee7..e703e27 100644 --- a/unix/tcl.spec +++ b/unix/tcl.spec @@ -4,7 +4,7 @@ Name: tcl Summary: Tcl scripting language development environment -Version: 9.0a0 +Version: 9.0a1 Release: 2 License: BSD Group: Development/Languages diff --git a/win/configure b/win/configure index 4dd6a28..e7a301f 100755 --- a/win/configure +++ b/win/configure @@ -2197,7 +2197,7 @@ SHELL=/bin/sh TCL_VERSION=9.0 TCL_MAJOR_VERSION=9 TCL_MINOR_VERSION=0 -TCL_PATCH_LEVEL="a0" +TCL_PATCH_LEVEL="a1" VER=$TCL_MAJOR_VERSION$TCL_MINOR_VERSION TCL_DDE_VERSION=1.4 diff --git a/win/configure.ac b/win/configure.ac index 985aa0a..9901f64 100644 --- a/win/configure.ac +++ b/win/configure.ac @@ -14,7 +14,7 @@ SHELL=/bin/sh TCL_VERSION=9.0 TCL_MAJOR_VERSION=9 TCL_MINOR_VERSION=0 -TCL_PATCH_LEVEL="a0" +TCL_PATCH_LEVEL="a1" VER=$TCL_MAJOR_VERSION$TCL_MINOR_VERSION TCL_DDE_VERSION=1.4 -- cgit v0.12 From 6802d4740cdcf85a687bdf5144b8c4c91301f78d Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Wed, 6 Nov 2019 22:18:37 +0000 Subject: Twice ckfree() -> Tcl_Free() --- generic/tclCompile.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/generic/tclCompile.c b/generic/tclCompile.c index 1c284df..a2dc7cb 100644 --- a/generic/tclCompile.c +++ b/generic/tclCompile.c @@ -2182,7 +2182,7 @@ TclCompileScript( Tcl_LogCommandInfo(interp, script, parsePtr->commandStart, parsePtr->term + 1 - parsePtr->commandStart); TclCompileSyntaxError(interp, envPtr); - ckfree(parsePtr); + Tcl_Free(parsePtr); return; } @@ -2258,7 +2258,7 @@ TclCompileScript( Tcl_FreeParse(parsePtr); } while (numBytes > 0); - ckfree(parsePtr); + Tcl_Free(parsePtr); } if (lastCmdIdx == -1) { -- cgit v0.12 From cbeadca7616cf2561c856e6bb03ab041b33d7a36 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Wed, 6 Nov 2019 22:30:07 +0000 Subject: Silence MSVC C4090 warnings when using ckfree() in certain situations. Problem reported by fvogel. --- generic/tcl.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/generic/tcl.h b/generic/tcl.h index 03189c6..bd05166 100644 --- a/generic/tcl.h +++ b/generic/tcl.h @@ -2269,7 +2269,12 @@ EXTERN int TclZipfs_AppHook(int *argc, char ***argv); */ #define ckalloc Tcl_Alloc -#define ckfree Tcl_Free +#ifdef _MSC_VER + /* Silence invalid C4090 warnings */ +# define ckfree(a) Tcl_Free((char *)(a)) +#else +# define ckfree Tcl_Free +#endif #define ckrealloc Tcl_Realloc #define attemptckalloc Tcl_AttemptAlloc #define attemptckrealloc Tcl_AttemptRealloc -- cgit v0.12 From 8665d6160812e8c89fef07e3510761c9b13147ff Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Thu, 7 Nov 2019 08:41:17 +0000 Subject: Silence MSVC C4090 warnings when using ckrealloc(). Also make sure that Tcl itself doesn't use ckalloc() and friends any more. --- generic/tcl.h | 24 ++++++++++++++---------- generic/tclCompile.c | 2 +- generic/tclTomMathDecls.h | 17 ++++------------- 3 files changed, 19 insertions(+), 24 deletions(-) diff --git a/generic/tcl.h b/generic/tcl.h index bd05166..1050cfb 100644 --- a/generic/tcl.h +++ b/generic/tcl.h @@ -2265,19 +2265,23 @@ EXTERN int TclZipfs_AppHook(int *argc, char ***argv); /* *---------------------------------------------------------------------------- * The following declarations map ckalloc and ckfree to Tcl_Alloc and - * Tcl_Free. + * Tcl_Free for use in Tcl-8.x-compatible extensions. */ -#define ckalloc Tcl_Alloc -#ifdef _MSC_VER - /* Silence invalid C4090 warnings */ -# define ckfree(a) Tcl_Free((char *)(a)) -#else -# define ckfree Tcl_Free +#ifndef BUILD_tcl +# define ckalloc Tcl_Alloc +# define attemptckalloc Tcl_AttemptAlloc +# ifdef _MSC_VER + /* Silence invalid C4090 warnings */ +# define ckfree(a) Tcl_Free((char *)(a)) +# define ckrealloc(a,b) Tcl_Realloc((char *)(a),(b)) +# define attemptckrealloc(a,b) Tcl_AttemptRealloc((char *)(a),(b)) +# else +# define ckfree Tcl_Free +# define ckrealloc Tcl_Realloc +# define attemptckrealloc Tcl_AttemptRealloc +# endif #endif -#define ckrealloc Tcl_Realloc -#define attemptckalloc Tcl_AttemptAlloc -#define attemptckrealloc Tcl_AttemptRealloc #ifndef TCL_MEM_DEBUG diff --git a/generic/tclCompile.c b/generic/tclCompile.c index a2dc7cb..59c5ba0 100644 --- a/generic/tclCompile.c +++ b/generic/tclCompile.c @@ -2169,7 +2169,7 @@ TclCompileScript( * many nested compilations (body enclosed in body) can cause abnormal * program termination with a stack overflow exception, bug [fec0c17d39]. */ - Tcl_Parse *parsePtr = ckalloc(sizeof(Tcl_Parse)); + Tcl_Parse *parsePtr = Tcl_Alloc(sizeof(Tcl_Parse)); do { const char *next; diff --git a/generic/tclTomMathDecls.h b/generic/tclTomMathDecls.h index d69a018..3eaff4e 100644 --- a/generic/tclTomMathDecls.h +++ b/generic/tclTomMathDecls.h @@ -34,19 +34,10 @@ /* Define custom memory allocation for libtommath */ -/* MODULE_SCOPE void* TclBNAlloc( size_t ); */ -#define TclBNAlloc(s) ((void*)Tcl_Alloc((size_t)(s))) -/* MODULE_SCOPE void* TclBNCalloc( size_t, size_t ); */ -#define TclBNCalloc(m,s) memset(ckalloc((size_t)(m)*(size_t)(s)),0,(size_t)(m)*(size_t)(s)) -/* MODULE_SCOPE void* TclBNRealloc( void*, size_t ); */ -#define TclBNRealloc(x,s) ((void*)Tcl_Realloc((char*)(x),(size_t)(s))) -/* MODULE_SCOPE void TclBNFree( void* ); */ -#define TclBNFree(x) (Tcl_Free((char*)(x))) - -#define MP_MALLOC(size) TclBNAlloc(size) -#define MP_CALLOC(nmemb, size) TclBNCalloc(nmemb, size) -#define MP_REALLOC(mem, oldsize, newsize) TclBNRealloc(mem, newsize) -#define MP_FREE(mem, size) TclBNFree(mem) +#define MP_MALLOC(size) Tcl_Alloc(size) +#define MP_CALLOC(nmemb, size) memset(Tcl_Alloc((nmemb)*(size)),0,(nmemb)*(size)) +#define MP_REALLOC(mem, oldsize, newsize) Tcl_Realloc(mem, newsize) +#define MP_FREE(mem, size) Tcl_Free(mem) MODULE_SCOPE void TclBN_s_mp_reverse(unsigned char *s, size_t len); -- cgit v0.12 From 69aedf8b1703268a158483088544f839dc3206d5 Mon Sep 17 00:00:00 2001 From: dgp Date: Fri, 22 Nov 2019 21:01:36 +0000 Subject: reset changes baseline --- changes | 228 +++++++++++++++++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 199 insertions(+), 29 deletions(-) diff --git a/changes b/changes index 2ce48bd..bf50b63 100644 --- a/changes +++ b/changes @@ -8796,6 +8796,55 @@ improvements to regexp engine from Postgres (lane,porter,fellows,seltenreich) --- Released 8.6.7, August 9, 2017 --- https://core.tcl-lang.org/tcl/ for details +Changes to 8.7a1 include all changes to the 8.6 line through 8.6.7, +plus the following, which focuses on the high-level feature changes +in this changeset (new minor version) rather than bug fixes: + +2016-03-17 (bug)[0b8c38] socket accept callbacks always in global ns (porter) + *** POTENTIAL INCOMPATIBILITY *** + +2016-07-01 Hack accommodations for legacy Itcl 3 disabled (porter) + +2016-07-12 Make TCL_HASH_TYPE build-time configurable (nijtmans) + +2016-07-19 (bug)[0363f0] Partial array search ID reform (porter) + +2016-07-19 (feature removed) Tcl_ObjType "array search" unregistered (porter) + *** POTENTIAL INCOMPATIBILITY for Tcl_GetObjType("array search") *** + +2016-10-04 Server socket on port 0 chooses port supporting IPv4 * IPv6 (max) + +2016-11-25 [array names -regexp] supports backrefs (goth) + +2017-01-04 (TIP 456) New routine Tcl_OpenTcpServerEx() (limeboy) + +2017-01-04 (TIP 459) New subcommand [package files] (nijtmans) + +2017-01-16 threaded allocator initialization repair (vasiljevic,nijtmans) + +2017-01-30 Add to Win shell builtins: assoc ftype move (ashok) + +2017-03-31 TCL_MEM_DEBUG facilities better support 64-bit memory (nijtmans) + +2017-04-13 \u escaped content in msg files converted to true utf-8 (nijtmans) + +2017-05-18 (TIP 458) New epoll or kqueue notifiers are default (alborboz) + +2017-05-31 Purge build support for SunOS-4.* (stu) + +2017-06-22 (TIP 463) New option [regsub ... -command ...] (fellows) + +2017-06-22 (TIP 470) Tcl_GetDefineContextObject();[oo::define [self]] (fellows) +=> TclOO 1.2.0 + +2017-06-23 (TIP 472) Support 0d as prefix of decimal numbers (iyer,griffin) + +2017-08-31 (bug)[2a9465] http state 100 continue handling broken (oehlmann) + +2017-09-02 (bug)[0e4d88] replace command, delete trace kills namespace (porter) + +--- Released 8.7a1, September 8, 2017 --- http://core.tcl.tk/tcl/ for details + 2017-08-10 [array names -regexp] supports backrefs (goth) 2017-08-10 Fix gcc build failures due to #pragma placement (cassoff,fellows) @@ -8895,58 +8944,179 @@ improvements to regexp engine from Postgres (lane,porter,fellows,seltenreich) - Released 8.6.9, November 16, 2018 - details at http://core.tcl-lang.org/tcl/ - -Changes to 8.7a1 include all changes to the 8.6 line through 8.6.7, +2018-11-22 (bug)[7a9dc5] [file normalize ~/~foo] segfault (sebres) + +2018-12-30 (bug)[3cf3a9] variable 'timezone' deprecated in vc2017 (nijtmans) + +2019-01-09 (bug)[cc1e91] [list [list {*}[set a " "]]] regression (sebres) + +2019-02-01 (bug)[e3f481] tests var-1.2[01] (sebres) + +2019-03-01 (new) Update to Unicode 12.0 (nijtmans) + +2019-03-05 (new)[TIP 527] New command [timerate] (sebres) + +2019-03-08 (bug)[39fed4] [package require] memory validity (hume,porter) + +2019-04-23 (new) New command tcl::unsupported::corotype (fellows) + +2019-05-04 (bug) memlink when namespace deletion kills linked var (porter) + +2019-05-28 (new) README file converted to README.md in Markdown (nijtmans) + +2019-06-17 (bug)[8b9854] [info level 0] regression with ensembles (porter) + +2019-06-20 (bug)[6bdadf] crash multi-arg write-traced [lappend] (fellows,porter) + +2019-06-21 (bug)[f8a33c] crash Tcl_Exit before init (brooks,sebres) + +2019-08-27 (bug)[fa6bf3] Bytecode fails epoch recovery at numLevel=0 (sebres) + +2019-08-29 (bug)[fec0c1] C stack overflow compiling bytecode (ade,sebres) + +2019-09-12 tzdata updated to Olson's tzdata2019c (jima) + +2019-09-20 (new) registry/dde no longer need -DUNICODE (nijtmans) +=> registry 1.3.4 +=> dde 1.4.2 + +2019-10-02 (bug)[16768d] Fix [info hostname] on NetBSD (rytaro) + +2019-10-23 (new) libtommath updated to release 1.2.0 (nijtmans) + +2019-10-25 OSX: system Tcl deprecated. End default use of its packages. (walzer) + +2019-10-28 (bug)[bcd100] bad fs cache when system encoding changes (coulter) + +2019-11-15 (bug)[135804] segfault in [next] after destroy (coulter,sebres) + +- Released 8.6.10, Nov 21, 2019 - details at http://core.tcl-lang.org/tcl/ - + +Changes to 8.7a3 include all changes to the 8.6 line through 8.6.10, plus the following, which focuses on the high-level feature changes in this changeset (new minor version) rather than bug fixes: -2016-03-17 (bug)[0b8c38] socket accept callbacks always in global ns (porter) - *** POTENTIAL INCOMPATIBILITY *** +2017-11-01 (bug)[3c32a3] crash deleting class mixed into instance (coulter) -2016-07-01 Hack accommodations for legacy Itcl 3 disabled (porter) +2017-11-03 [TIP 345] eliminate the encoding 'identity' (porter) -2016-07-12 Make TCL_HASH_TYPE build-time configurable (nijtmans) +2017-11-04 (bug)[0d902e] [string first] on ASCII stored as Unicode (fellows) -2016-07-19 (bug)[0363f0] Partial array search ID reform (porter) +2017-11-17 [TIP 422] Mark all Tcl_*VA() routines deprecated. (nijtmans) -2016-07-19 (feature removed) Tcl_ObjType "array search" unregistered (porter) - *** POTENTIAL INCOMPATIBILITY for Tcl_GetObjType("array search") *** +2017-11-20 (support) Ended use of the obsolete values.h header (culler) -2016-10-04 Server socket on port 0 chooses port supporting IPv4 * IPv6 (max) +2017-11-30 (bug)[8e1e31] [lsort] ordering of U+0000 (nijtmans) -2016-11-25 [array names -regexp] supports backrefs (goth) +2017-12-07 [TIP 487] Terminate support for pre-XP Windows (nijtmans) -2017-01-04 (TIP 456) New routine Tcl_OpenTcpServerEx() (limeboy) +2017-12-08 [TIP 477] Reform of nmake build (nadkarni) -2017-01-04 (TIP 459) New subcommand [package files] (nijtmans) +2017-12-20 (bug)[ba1419] Crash: complex ensemble delete, namespace-7.8 (coulter) -2017-01-16 threaded allocator initialization repair (vasiljevic,nijtmans) +2018-01-17 [TIP 485] Removal of many deprecated features (nijtmans) -2017-01-30 Add to Win shell builtins: assoc ftype move (ashok) +2018-01-27 (bug) Crash in [join $l $l], join-4.1 (porter) -2017-03-31 TCL_MEM_DEBUG facilities better support 64-bit memory (nijtmans) +2018-02-06 [TIP 493] Cease Distribution of http 1.0 (porter) -2017-04-13 \u escaped content in msg files converted to true utf-8 (nijtmans) +2018-02-06 [TIP 484] internal rep for native ints are all 64-bit (nijtmans) -2017-05-18 (TIP 458) New epoll or kqueue notifiers are default (alborboz) +2018-02-14 [TIP 476] Scan/Printf consistency (nijtmans) -2017-05-31 Purge build support for SunOS-4.* (stu) +2018-03-05 [TIP 351] [lsearch] striding -2017-06-22 (TIP 463) New option [regsub ... -command ...] (fellows) +2018-03-05 [TIPs 330,336] tighten access to Interp fields (porter) -2017-06-22 (TIP 470) Tcl_GetDefineContextObject();[oo::define [self]] (fellows) -=> TclOO 1.2.0 +2018-03-12 [TIP 462] [::tcl::process] -2017-06-23 (TIP 472) Support 0d as prefix of decimal numbers (iyer,griffin) +2018-03-12 [TIP 490] add oo support for msgcat => msgcat 1.7.0 (oehlmann) -2017-08-31 (bug)[2a9465] http state 100 continue handling broken (oehlmann) +2018-03-12 [TIP 499] custom locale preference list (oehlmann) +=> msgcat 1.7.0 -2017-09-02 (bug)[0e4d88] replace command, delete trace kills namespace (porter) +2018-03-20 [TIP 503] End CONST84 support for Tcl 8.3 (porter) ---- Released 8.7a1, September 8, 2017 --- http://core.tcl.tk/tcl/ for details +2018-03-30 Refactored [lrange] (spjuth) -2018-03-12 (TIP 490) add oo support for msgcat => msgcat 1.7.0 (oehlmann) +2018-04-20 [TIP 389] Unicode beyond BMP (nijtmans) -2018-03-12 (TIP 499) custom locale preference list (oehlmann) -=> msgcat 1.7.0 +2018-04-20 [TIP 421] [array for] + +2018-05-11 [TIP 425] Windows panic callback use of UTF-8 + +2018-05-17 [TIP 491] Phase out --disable-threads support + +2018-06-03 [TIP 500] TclOO Private Methods and Variables + +2018-07-26 (bug)[ba921a] [string cat] of bytearrays (coulter,porter) + +2018-09-02 [TIP 478] Many new features in TclOO (lester,fellows) + +2018-09-04 (bug)[540bed] [binary format w] from bignum (nijtmans) + +2018-09-12 [TIP 430] zipfs and embedded script library (woods) + +2018-09-26 [TIP 508] [array default] (bonnet,fellows) + +2018-09-27 [TIP 515] level value reform (nijtmans) + +2018-09-27 [TIP 516] More OO slot operations (fellows) + +2018-09-27 [TIP 426] [info cmdtype] (fellows) + +2018-09-28 [TIP 509] Cross platform reentrant mutex + +2018-10-08 [TIP 514] native integers are 64-bit + +2018-10-12 [TIP 502] index value reform (porter) + +2018-11-06 [TIP 406] http cookies (fellows) + +2018-11-06 [TIP 445] Tcl_ObjType utilities (migrate to Tcl 9) (porter) + +2018-11-06 [TIP 501] [string is dict] + +2018-11-06 [TIP 519] inline export/unexport option for [oo::define] + +2018-11-06 [TIP 523] [lpop] + +2018-11-06 [TIP 524] TclOO custom dialects + +2018-11-06 [TIP 506] Tcl_(Incr|Decr)RefCount macros -> functions (porter) + +2018-11-15 [TIP 512] No stub for Tcl_SetExitProc() + +2019-04-08 (bug)[45b9fa] crash in [try] (coulter) + +2019-04-14 [TIP 160] terminal and serial channel controls + +2019-04-14 [TIP 312] more types for Tcl_LinkVar + +2019-04-14 [TIP 367] [lremove] + +2019-04-14 [TIP 504] [string insert] + +2019-04-16 [TIP 342] [dict getwithdefault] + +2019-05-25 [TIP 431] [file tempdir] + +2019-05-25 [TIP 383] [coroinject], [coroprobe] + +2019-05-31 [TIP 544] Tcl_GetIntForIndex() + +2019-06-12 Replace TclOffset() with offsetof() + +2019-06-15 [TIP 461] string compare operators for [expr] + +2019-06-16 [TIP 521] floating point classification functions for [expr] + +2019-06-20 (bug)[6bdadf] crash multi-arg traced [lappend] (fellows) + +2019-06-28 [TIP 547] New encodings utf-16, ucs-2 + +2019-09-14 [TIP 414] Tcl_InitSubsystems() + +2019-09-14 [TIP 548] wchar_t conversion functions -- Released 8.7a3, Nov 30, 2018 --- http://core.tcl-lang.org/tcl/ for details - +- Released 8.7a3, Nov 21, 2019 --- http://core.tcl-lang.org/tcl/ for details - -- cgit v0.12 From 5a7c86fa3290bf11eb1a4c98246a130cbee7d023 Mon Sep 17 00:00:00 2001 From: dgp Date: Fri, 22 Nov 2019 21:08:12 +0000 Subject: Start record of the changes only in Tcl 9. --- changes | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/changes b/changes index bf50b63..11da99a 100644 --- a/changes +++ b/changes @@ -9120,3 +9120,14 @@ in this changeset (new minor version) rather than bug fixes: 2019-09-14 [TIP 548] wchar_t conversion functions - Released 8.7a3, Nov 21, 2019 --- http://core.tcl-lang.org/tcl/ for details - + +Changes to 9.0a1 include all changes to the 8.7 line through 8.7a3, +plus the following, which focuses on the high-level feature changes +in this changeset (new minor version) rather than bug fixes: + +2017-11-03 [TIP 114] Leading zero integer no longer means octal + + + + +- Released 9.0a1, Nov 25, 2019 --- http://core.tcl-lang.org/tcl/ for details - -- cgit v0.12 From 18e4f3d635ef84d601225e1f064d80dea6a665d9 Mon Sep 17 00:00:00 2001 From: dgp Date: Fri, 22 Nov 2019 21:26:09 +0000 Subject: complete changes --- changes | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/changes b/changes index 11da99a..8112306 100644 --- a/changes +++ b/changes @@ -9127,7 +9127,16 @@ in this changeset (new minor version) rather than bug fixes: 2017-11-03 [TIP 114] Leading zero integer no longer means octal +2017-11-03 [TIP 278] Revise variable name resolution, solve "Creative Writing" +2017-11-03 [TIPs 330,336] Encapsulate struct Tcl_Interp +2017-11-17 [TIP 422] Remove all Tcl_*VA() routines + +2017-12-15 [TIP 488] Disable magic $::tcl_precision + +2018-10-08 [TIP 494] Increased support for size_t value ranges + +2019-05-31 [TIP 537] 64-bit indices in regexp matching - Released 9.0a1, Nov 25, 2019 --- http://core.tcl-lang.org/tcl/ for details - -- cgit v0.12 From 8f533db35fcc6fecc814d6e6e5b966fb7225c045 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Fri, 13 Dec 2019 13:33:33 +0000 Subject: Remove deprecated libtommath stub entries --- generic/tclStubInit.c | 50 ++++------------------------------------------- generic/tclTomMath.decls | 28 ++++++++++++++------------ generic/tclTomMathDecls.h | 42 ++++++++++++--------------------------- 3 files changed, 32 insertions(+), 88 deletions(-) diff --git a/generic/tclStubInit.c b/generic/tclStubInit.c index 95303d7..4980c79 100644 --- a/generic/tclStubInit.c +++ b/generic/tclStubInit.c @@ -128,20 +128,6 @@ #define TclBN_mp_toom_sqr s_mp_toom_sqr -mp_err TclBN_mp_set_int(mp_int *a, unsigned long i) -{ - TclBN_mp_set_u64(a, i); - return MP_OKAY; -} - -static mp_err TclBN_mp_set_long(mp_int *a, unsigned long i) -{ - TclBN_mp_set_u64(a, i); - return MP_OKAY; -} - -#define TclBN_mp_set_ul (void (*)(mp_int *a, unsigned long i))TclBN_mp_set_long - mp_err MP_WUR TclBN_mp_expt_u32(const mp_int *a, unsigned int b, mp_int *c) { return mp_expt_u32(a, b, c); } @@ -182,34 +168,6 @@ mp_err TclBN_mp_mul_d(const mp_int *a, unsigned int b, mp_int *c) { return mp_mul_d(a, b, c); } -mp_err TclBN_mp_div_3(const mp_int *a, mp_int *c, unsigned int *d) { - mp_digit d2; - mp_err result = mp_div_d(a, 3, c, &d2); - if (d) { - *d = d2; - } - return result; -} - -int TclBN_mp_expt_d_ex(const mp_int *a, unsigned int b, mp_int *c, int fast) -{ - return TclBN_mp_expt_u32(a, b, c); -} - -mp_err TclBN_mp_init_ul(mp_int *a, unsigned long b) -{ - return TclBN_mp_init_u64(a,b); -} - -mp_err TclBN_mp_init_l(mp_int *a, long b) -{ - return TclBN_mp_init_i64(a,b); -} - -void TclBN_mp_set(mp_int *a, unsigned int b) { - TclBN_mp_set_u64(a, b); -} - #ifdef _WIN32 # define TclUnixWaitForFile 0 # define TclUnixCopyFile 0 @@ -758,7 +716,7 @@ const TclTomMathStubs tclTomMathStubs = { TclBN_mp_read_radix, /* 36 */ TclBN_mp_rshd, /* 37 */ TclBN_mp_shrink, /* 38 */ - TclBN_mp_set, /* 39 */ + 0, /* 39 */ 0, /* 40 */ TclBN_mp_sqrt, /* 41 */ TclBN_mp_sub, /* 42 */ @@ -780,10 +738,10 @@ const TclTomMathStubs tclTomMathStubs = { 0, /* 58 */ 0, /* 59 */ 0, /* 60 */ - TclBN_mp_init_ul, /* 61 */ - TclBN_mp_set_ul, /* 62 */ + 0, /* 61 */ + 0, /* 62 */ TclBN_mp_cnt_lsb, /* 63 */ - TclBN_mp_init_l, /* 64 */ + 0, /* 64 */ TclBN_mp_init_i64, /* 65 */ TclBN_mp_init_u64, /* 66 */ 0, /* 67 */ diff --git a/generic/tclTomMath.decls b/generic/tclTomMath.decls index 0753bad..9afb284 100644 --- a/generic/tclTomMath.decls +++ b/generic/tclTomMath.decls @@ -141,9 +141,10 @@ declare 37 { declare 38 { mp_err MP_WUR TclBN_mp_shrink(mp_int *a) } -declare 39 {deprecated {macro calling mp_set_u64}} { - void TclBN_mp_set(mp_int *a, unsigned int b) -} +# Removed in 9.0 +#declare 39 {deprecated {macro calling mp_set_u64}} { +# void TclBN_mp_set(mp_int *a, unsigned int b) +#} # Removed in 9.0 #declare 40 {nostub {is private function in libtommath}} { # mp_err TclBN_mp_sqr(const mp_int *a, mp_int *b) @@ -179,18 +180,21 @@ declare 48 { declare 49 { void TclBN_mp_zero(mp_int *a) } -declare 61 {deprecated {macro calling mp_init_u64}} { - mp_err TclBN_mp_init_ul(mp_int *a, unsigned long i) -} -declare 62 {deprecated {macro calling mp_set_u64}} { - void TclBN_mp_set_ul(mp_int *a, unsigned long i) -} +# Removed in 9.0 +#declare 61 {deprecated {macro calling mp_init_u64}} { +# mp_err TclBN_mp_init_ul(mp_int *a, unsigned long i) +#} +# Removed in 9.0 +#declare 62 {deprecated {macro calling mp_set_u64}} { +# void TclBN_mp_set_ul(mp_int *a, unsigned long i) +#} declare 63 { int MP_WUR TclBN_mp_cnt_lsb(const mp_int *a) } -declare 64 {deprecated {macro calling mp_init_i64}} { - int TclBN_mp_init_l(mp_int *bignum, long initVal) -} +# Removed in 9.0 +#declare 64 {deprecated {macro calling mp_init_i64}} { +# int TclBN_mp_init_l(mp_int *bignum, long initVal) +#} declare 65 { int MP_WUR TclBN_mp_init_i64(mp_int *bignum, int64_t initVal) } diff --git a/generic/tclTomMathDecls.h b/generic/tclTomMathDecls.h index 1fe5ea9..d182171 100644 --- a/generic/tclTomMathDecls.h +++ b/generic/tclTomMathDecls.h @@ -152,12 +152,6 @@ MODULE_SCOPE mp_err TclBN_s_mp_sub_d(const mp_int *a, mp_digit b, mp_int *c); #define s_mp_toom_sqr TclBN_mp_toom_sqr #endif /* !TCL_WITH_EXTERNAL_TOMMATH */ -#define mp_init_set_int(a,b) (MP_DEPRECATED_PRAGMA("replaced by mp_init_ul") TclBN_mp_init_u64(a,(unsigned int)(b))) -#define mp_set_int(a,b) (MP_DEPRECATED_PRAGMA("replaced by mp_set_ul") (TclBN_mp_set_u64((a),((unsigned int)(b))),MP_OKAY)) -#define mp_set_long(a,b) (MP_DEPRECATED_PRAGMA("replaced by mp_set_ul") (TclBN_mp_set_u64((a),(long)(b)),MP_OKAY)) -#define mp_set_long_long(a,b) (MP_DEPRECATED_PRAGMA("replaced by mp_set_u64") (TclBN_mp_set_u64((a),(b)),MP_OKAY)) -#define mp_unsigned_bin_size(mp) (MP_DEPRECATED_PRAGMA("replaced by mp_ubin_size") (int)TclBN_mp_ubin_size(mp)) - #undef TCL_STORAGE_CLASS #ifdef BUILD_tcl # define TCL_STORAGE_CLASS DLLEXPORT @@ -275,9 +269,7 @@ EXTERN mp_err TclBN_mp_read_radix(mp_int *a, const char *str, EXTERN void TclBN_mp_rshd(mp_int *a, int shift); /* 38 */ EXTERN mp_err TclBN_mp_shrink(mp_int *a) MP_WUR; -/* 39 */ -TCL_DEPRECATED("macro calling mp_set_u64") -void TclBN_mp_set(mp_int *a, unsigned int b); +/* Slot 39 is reserved */ /* Slot 40 is reserved */ /* 41 */ EXTERN mp_err TclBN_mp_sqrt(const mp_int *a, mp_int *b) MP_WUR; @@ -308,17 +300,11 @@ EXTERN void TclBN_mp_zero(mp_int *a); /* Slot 58 is reserved */ /* Slot 59 is reserved */ /* Slot 60 is reserved */ -/* 61 */ -TCL_DEPRECATED("macro calling mp_init_u64") -mp_err TclBN_mp_init_ul(mp_int *a, unsigned long i); -/* 62 */ -TCL_DEPRECATED("macro calling mp_set_u64") -void TclBN_mp_set_ul(mp_int *a, unsigned long i); +/* Slot 61 is reserved */ +/* Slot 62 is reserved */ /* 63 */ EXTERN int TclBN_mp_cnt_lsb(const mp_int *a) MP_WUR; -/* 64 */ -TCL_DEPRECATED("macro calling mp_init_i64") -int TclBN_mp_init_l(mp_int *bignum, long initVal); +/* Slot 64 is reserved */ /* 65 */ EXTERN int TclBN_mp_init_i64(mp_int *bignum, int64_t initVal) MP_WUR; /* 66 */ @@ -392,7 +378,7 @@ typedef struct TclTomMathStubs { mp_err (*tclBN_mp_read_radix) (mp_int *a, const char *str, int radix) MP_WUR; /* 36 */ void (*tclBN_mp_rshd) (mp_int *a, int shift); /* 37 */ mp_err (*tclBN_mp_shrink) (mp_int *a) MP_WUR; /* 38 */ - TCL_DEPRECATED_API("macro calling mp_set_u64") void (*tclBN_mp_set) (mp_int *a, unsigned int b); /* 39 */ + void (*reserved39)(void); void (*reserved40)(void); mp_err (*tclBN_mp_sqrt) (const mp_int *a, mp_int *b) MP_WUR; /* 41 */ mp_err (*tclBN_mp_sub) (const mp_int *a, const mp_int *b, mp_int *c) MP_WUR; /* 42 */ @@ -414,10 +400,10 @@ typedef struct TclTomMathStubs { void (*reserved58)(void); void (*reserved59)(void); void (*reserved60)(void); - TCL_DEPRECATED_API("macro calling mp_init_u64") mp_err (*tclBN_mp_init_ul) (mp_int *a, unsigned long i); /* 61 */ - TCL_DEPRECATED_API("macro calling mp_set_u64") void (*tclBN_mp_set_ul) (mp_int *a, unsigned long i); /* 62 */ + void (*reserved61)(void); + void (*reserved62)(void); int (*tclBN_mp_cnt_lsb) (const mp_int *a) MP_WUR; /* 63 */ - TCL_DEPRECATED_API("macro calling mp_init_i64") int (*tclBN_mp_init_l) (mp_int *bignum, long initVal); /* 64 */ + void (*reserved64)(void); int (*tclBN_mp_init_i64) (mp_int *bignum, int64_t initVal) MP_WUR; /* 65 */ int (*tclBN_mp_init_u64) (mp_int *bignum, uint64_t initVal) MP_WUR; /* 66 */ void (*reserved67)(void); @@ -525,8 +511,7 @@ extern const TclTomMathStubs *tclTomMathStubsPtr; (tclTomMathStubsPtr->tclBN_mp_rshd) /* 37 */ #define TclBN_mp_shrink \ (tclTomMathStubsPtr->tclBN_mp_shrink) /* 38 */ -#define TclBN_mp_set \ - (tclTomMathStubsPtr->tclBN_mp_set) /* 39 */ +/* Slot 39 is reserved */ /* Slot 40 is reserved */ #define TclBN_mp_sqrt \ (tclTomMathStubsPtr->tclBN_mp_sqrt) /* 41 */ @@ -554,14 +539,11 @@ extern const TclTomMathStubs *tclTomMathStubsPtr; /* Slot 58 is reserved */ /* Slot 59 is reserved */ /* Slot 60 is reserved */ -#define TclBN_mp_init_ul \ - (tclTomMathStubsPtr->tclBN_mp_init_ul) /* 61 */ -#define TclBN_mp_set_ul \ - (tclTomMathStubsPtr->tclBN_mp_set_ul) /* 62 */ +/* Slot 61 is reserved */ +/* Slot 62 is reserved */ #define TclBN_mp_cnt_lsb \ (tclTomMathStubsPtr->tclBN_mp_cnt_lsb) /* 63 */ -#define TclBN_mp_init_l \ - (tclTomMathStubsPtr->tclBN_mp_init_l) /* 64 */ +/* Slot 64 is reserved */ #define TclBN_mp_init_i64 \ (tclTomMathStubsPtr->tclBN_mp_init_i64) /* 65 */ #define TclBN_mp_init_u64 \ -- cgit v0.12 From 9118bcfb5fc11ee3cb496e1da2d648c6ea447a6b Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Fri, 13 Dec 2019 15:09:59 +0000 Subject: More tweaks to libtommath functions signatures: No need any more to stay binary compatible with Tcl 8.x, so we can use the mp_digit type now. --- generic/tclStubInit.c | 54 +++----------------- generic/tclTomMath.decls | 25 +++++----- generic/tclTomMathDecls.h | 124 +++++++++++----------------------------------- 3 files changed, 51 insertions(+), 152 deletions(-) diff --git a/generic/tclStubInit.c b/generic/tclStubInit.c index 4980c79..8cae2f5 100644 --- a/generic/tclStubInit.c +++ b/generic/tclStubInit.c @@ -65,24 +65,29 @@ #undef Tcl_UtfToUniChar #define TclBN_mp_add mp_add +#define TclBN_mp_add_d mp_add_d #define TclBN_mp_and mp_and #define TclBN_mp_clamp mp_clamp #define TclBN_mp_clear mp_clear #define TclBN_mp_clear_multi mp_clear_multi #define TclBN_mp_cmp mp_cmp +#define TclBN_mp_cmp_d mp_cmp_d #define TclBN_mp_cmp_mag mp_cmp_mag #define TclBN_mp_cnt_lsb mp_cnt_lsb #define TclBN_mp_copy mp_copy #define TclBN_mp_count_bits mp_count_bits #define TclBN_mp_div mp_div +#define TclBN_mp_div_d mp_div_d #define TclBN_mp_div_2 mp_div_2 #define TclBN_mp_div_2d mp_div_2d #define TclBN_mp_exch mp_exch +#define TclBN_mp_expt_u32 mp_expt_u32 #define TclBN_mp_get_mag_u64 mp_get_mag_u64 #define TclBN_mp_grow mp_grow #define TclBN_mp_init mp_init #define TclBN_mp_init_copy mp_init_copy #define TclBN_mp_init_multi mp_init_multi +#define TclBN_mp_init_set mp_init_set #define TclBN_mp_init_size mp_init_size #define TclBN_mp_init_i64 mp_init_i64 #define TclBN_mp_init_u64 mp_init_u64 @@ -90,6 +95,7 @@ #define TclBN_mp_mod mp_mod #define TclBN_mp_mod_2d mp_mod_2d #define TclBN_mp_mul mp_mul +#define TclBN_mp_mul_d mp_mul_d #define TclBN_mp_mul_2 mp_mul_2 #define TclBN_mp_mul_2d mp_mul_2d #define TclBN_mp_neg mp_neg @@ -104,11 +110,8 @@ #define TclBN_mp_sqr mp_sqr #define TclBN_mp_sqrt mp_sqrt #define TclBN_mp_sub mp_sub +#define TclBN_mp_sub_d mp_sub_d #define TclBN_mp_signed_rsh mp_signed_rsh -#define TclBN_mp_tc_and TclBN_mp_and -#define TclBN_mp_tc_div_2d mp_signed_rsh -#define TclBN_mp_tc_or TclBN_mp_or -#define TclBN_mp_tc_xor TclBN_mp_xor #define TclBN_mp_to_radix mp_to_radix #define TclBN_mp_to_ubin mp_to_ubin #define TclBN_mp_ubin_size mp_ubin_size @@ -127,47 +130,6 @@ #define TclBN_mp_toom_mul s_mp_toom_mul #define TclBN_mp_toom_sqr s_mp_toom_sqr - -mp_err MP_WUR TclBN_mp_expt_u32(const mp_int *a, unsigned int b, mp_int *c) { - return mp_expt_u32(a, b, c); -} -mp_err TclBN_mp_add_d(const mp_int *a, unsigned int b, mp_int *c) { - return mp_add_d(a, b, c); -} -mp_err TclBN_mp_cmp_d(const mp_int *a, unsigned int b) { - return mp_cmp_d(a, b); -} -mp_err TclBN_mp_sub_d(const mp_int *a, unsigned int b, mp_int *c) { - return mp_sub_d(a, b, c); -} -mp_err TclBN_mp_div_d(const mp_int *a, unsigned int b, mp_int *c, unsigned int *d) { - mp_digit d2; - mp_err result = mp_div_d(a, b, c, (d ? &d2 : NULL)); - if (d) { - *d = d2; - } - return result; -} -mp_err TclBN_mp_div_ld(const mp_int *a, uint64_t b, mp_int *c, uint64_t *d) { - mp_err result; - mp_digit d2; - - if ((b | (mp_digit)-1) != (mp_digit)-1) { - return MP_VAL; - } - result = mp_div_d(a, b, c, (d ? &d2 : NULL)); - if (d) { - *d = d2; - } - return result; -} -mp_err TclBN_mp_init_set(mp_int *a, unsigned int b) { - return mp_init_set(a, b); -} -mp_err TclBN_mp_mul_d(const mp_int *a, unsigned int b, mp_int *c) { - return mp_mul_d(a, b, c); -} - #ifdef _WIN32 # define TclUnixWaitForFile 0 # define TclUnixCopyFile 0 @@ -756,7 +718,7 @@ const TclTomMathStubs tclTomMathStubs = { TclBN_mp_signed_rsh, /* 76 */ 0, /* 77 */ TclBN_mp_to_ubin, /* 78 */ - TclBN_mp_div_ld, /* 79 */ + 0, /* 79 */ TclBN_mp_to_radix, /* 80 */ }; diff --git a/generic/tclTomMath.decls b/generic/tclTomMath.decls index 9afb284..a47f7ef 100644 --- a/generic/tclTomMath.decls +++ b/generic/tclTomMath.decls @@ -33,7 +33,7 @@ declare 2 { mp_err MP_WUR TclBN_mp_add(const mp_int *a, const mp_int *b, mp_int *c) } declare 3 { - mp_err MP_WUR TclBN_mp_add_d(const mp_int *a, unsigned int b, mp_int *c) + mp_err MP_WUR TclBN_mp_add_d(const mp_int *a, mp_digit b, mp_int *c) } declare 4 { mp_err MP_WUR TclBN_mp_and(const mp_int *a, const mp_int *b, mp_int *c) @@ -51,7 +51,7 @@ declare 8 { mp_ord MP_WUR TclBN_mp_cmp(const mp_int *a, const mp_int *b) } declare 9 { - mp_ord MP_WUR TclBN_mp_cmp_d(const mp_int *a, unsigned int b) + mp_ord MP_WUR TclBN_mp_cmp_d(const mp_int *a, mp_digit b) } declare 10 { mp_ord MP_WUR TclBN_mp_cmp_mag(const mp_int *a, const mp_int *b) @@ -66,7 +66,7 @@ declare 13 { mp_err MP_WUR TclBN_mp_div(const mp_int *a, const mp_int *b, mp_int *q, mp_int *r) } declare 14 { - mp_err MP_WUR TclBN_mp_div_d(const mp_int *a, unsigned int b, mp_int *q, unsigned int *r) + mp_err MP_WUR TclBN_mp_div_d(const mp_int *a, mp_digit b, mp_int *q, mp_digit *r) } declare 15 { mp_err MP_WUR TclBN_mp_div_2(const mp_int *a, mp_int *q) @@ -76,13 +76,13 @@ declare 16 { } # Removed in 9.0 #declare 17 {deprecated {is private function in libtommath}} { -# mp_err TclBN_mp_div_3(const mp_int *a, mp_int *q, unsigned int *r) +# mp_err TclBN_mp_div_3(const mp_int *a, mp_int *q, mp_digit *r) #} declare 18 { void TclBN_mp_exch(mp_int *a, mp_int *b) } declare 19 { - mp_err MP_WUR TclBN_mp_expt_u32(const mp_int *a, unsigned int b, mp_int *c) + mp_err MP_WUR TclBN_mp_expt_u32(const mp_int *a, uint32_t b, mp_int *c) } declare 20 { mp_err MP_WUR TclBN_mp_grow(mp_int *a, int size) @@ -97,7 +97,7 @@ declare 23 { mp_err MP_WUR TclBN_mp_init_multi(mp_int *a, ...) } declare 24 { - mp_err MP_WUR TclBN_mp_init_set(mp_int *a, unsigned int b) + mp_err MP_WUR TclBN_mp_init_set(mp_int *a, mp_digit b) } declare 25 { mp_err MP_WUR TclBN_mp_init_size(mp_int *a, int size) @@ -115,7 +115,7 @@ declare 29 { mp_err MP_WUR TclBN_mp_mul(const mp_int *a, const mp_int *b, mp_int *p) } declare 30 { - mp_err MP_WUR TclBN_mp_mul_d(const mp_int *a, unsigned int b, mp_int *p) + mp_err MP_WUR TclBN_mp_mul_d(const mp_int *a, mp_digit b, mp_int *p) } declare 31 { mp_err MP_WUR TclBN_mp_mul_2(const mp_int *a, mp_int *p) @@ -156,7 +156,7 @@ declare 42 { mp_err MP_WUR TclBN_mp_sub(const mp_int *a, const mp_int *b, mp_int *c) } declare 43 { - mp_err MP_WUR TclBN_mp_sub_d(const mp_int *a, unsigned int b, mp_int *c) + mp_err MP_WUR TclBN_mp_sub_d(const mp_int *a, mp_digit b, mp_int *c) } # Removed in 9.0 #declare 44 { @@ -204,7 +204,7 @@ declare 66 { # Removed in 9.0 #declare 67 { -# mp_err TclBN_mp_expt_d_ex(const mp_int *a, unsigned int b, mp_int *c, int fast) +# mp_err TclBN_mp_expt_d_ex(const mp_int *a, mp_digit b, mp_int *c, int fast) #} # Added in libtommath 1.0.1 declare 68 { @@ -238,9 +238,10 @@ declare 76 { declare 78 { int MP_WUR TclBN_mp_to_ubin(const mp_int *a, unsigned char *buf, size_t maxlen, size_t *written) } -declare 79 { - mp_err MP_WUR TclBN_mp_div_ld(const mp_int *a, uint64_t b, mp_int *q, uint64_t *r) -} +# Removed in 9.0 +#declare 79 { +# mp_err MP_WUR TclBN_mp_div_ld(const mp_int *a, mp_digit b, mp_int *q, mp_digit *r) +#} declare 80 { int MP_WUR TclBN_mp_to_radix(const mp_int *a, char *str, size_t maxlen, size_t *written, int radix) } diff --git a/generic/tclTomMathDecls.h b/generic/tclTomMathDecls.h index d182171..6716f9a 100644 --- a/generic/tclTomMathDecls.h +++ b/generic/tclTomMathDecls.h @@ -35,13 +35,13 @@ /* Define custom memory allocation for libtommath */ /* MODULE_SCOPE void* TclBNAlloc( size_t ); */ -#define TclBNAlloc(s) ((void*)ckalloc((size_t)(s))) +#define TclBNAlloc(s) ((void*)Tcl_Alloc(s)) /* MODULE_SCOPE void* TclBNCalloc( size_t, size_t ); */ -#define TclBNCalloc(m,s) memset(ckalloc((size_t)(m)*(size_t)(s)),0,(size_t)(m)*(size_t)(s)) +#define TclBNCalloc(m,s) memset(Tcl_Alloc((size_t)(m)*(size_t)(s)),0,(size_t)(m)*(size_t)(s)) /* MODULE_SCOPE void* TclBNRealloc( void*, size_t ); */ -#define TclBNRealloc(x,s) ((void*)ckrealloc((char*)(x),(size_t)(s))) +#define TclBNRealloc(x,s) ((void*)Tcl_Realloc((char*)(x),(size_t)(s))) /* MODULE_SCOPE void TclBNFree( void* ); */ -#define TclBNFree(x) (ckfree((char*)(x))) +#define TclBNFree(x) (Tcl_Free((char*)(x))) #undef MP_MALLOC #undef MP_CALLOC @@ -56,57 +56,45 @@ # define MODULE_SCOPE extern #endif -MODULE_SCOPE mp_err TclBN_s_mp_add_d(const mp_int *a, mp_digit b, mp_int *c); -MODULE_SCOPE mp_ord TclBN_s_mp_cmp_d(const mp_int *a, mp_digit b); -MODULE_SCOPE mp_err TclBN_s_mp_div_d(const mp_int *a, mp_digit b, mp_int *c, mp_digit *d); -MODULE_SCOPE mp_err TclBN_s_mp_div_3(const mp_int *a, mp_int *c, mp_digit *b); -MODULE_SCOPE mp_err TclBN_s_mp_expt_u32(const mp_int *a, uint32_t b, mp_int *c); -MODULE_SCOPE mp_err TclBN_s_mp_init_set(mp_int *a, mp_digit b); -MODULE_SCOPE mp_err TclBN_s_mp_mul_d(const mp_int *a, mp_digit b, mp_int *c); -MODULE_SCOPE void TclBN_s_mp_reverse(unsigned char *s, size_t len); -MODULE_SCOPE void TclBN_s_mp_set(mp_int *a, mp_digit b); -MODULE_SCOPE mp_err TclBN_s_mp_sub_d(const mp_int *a, mp_digit b, mp_int *c); - - /* Rename the global symbols in libtommath to avoid linkage conflicts */ #ifndef TCL_WITH_EXTERNAL_TOMMATH #define bn_reverse TclBN_reverse #define mp_add TclBN_mp_add -#define mp_add_d TclBN_s_mp_add_d +#define mp_add_d TclBN_mp_add_d #define mp_and TclBN_mp_and #define mp_clamp TclBN_mp_clamp #define mp_clear TclBN_mp_clear #define mp_clear_multi TclBN_mp_clear_multi #define mp_cmp TclBN_mp_cmp -#define mp_cmp_d TclBN_s_mp_cmp_d +#define mp_cmp_d TclBN_mp_cmp_d #define mp_cmp_mag TclBN_mp_cmp_mag #define mp_cnt_lsb TclBN_mp_cnt_lsb #define mp_copy TclBN_mp_copy #define mp_count_bits TclBN_mp_count_bits #define mp_div TclBN_mp_div -#define mp_div_d TclBN_s_mp_div_d +#define mp_div_d TclBN_mp_div_d #define mp_div_2 TclBN_mp_div_2 -#define mp_div_3 TclBN_s_mp_div_3 +#define mp_div_3 TclBN_mp_div_3 #define mp_div_2d TclBN_mp_div_2d #define mp_exch TclBN_mp_exch #define mp_expt_d TclBN_mp_expt_d #define mp_expt_d_ex TclBN_mp_expt_d_ex -#define mp_expt_u32 TclBN_s_mp_expt_u32 +#define mp_expt_u32 TclBN_mp_expt_u32 #define mp_get_mag_u64 TclBN_mp_get_mag_u64 #define mp_grow TclBN_mp_grow #define mp_init TclBN_mp_init #define mp_init_copy TclBN_mp_init_copy #define mp_init_i64 TclBN_mp_init_i64 #define mp_init_multi TclBN_mp_init_multi -#define mp_init_set TclBN_s_mp_init_set +#define mp_init_set TclBN_mp_init_set #define mp_init_size TclBN_mp_init_size #define mp_init_u64 TclBN_mp_init_u64 #define mp_lshd TclBN_mp_lshd #define mp_mod TclBN_mp_mod #define mp_mod_2d TclBN_mp_mod_2d #define mp_mul TclBN_mp_mul -#define mp_mul_d TclBN_s_mp_mul_d +#define mp_mul_d TclBN_mp_mul_d #define mp_mul_2 TclBN_mp_mul_2 #define mp_mul_2d TclBN_mp_mul_2d #define mp_neg TclBN_mp_neg @@ -124,7 +112,7 @@ MODULE_SCOPE mp_err TclBN_s_mp_sub_d(const mp_int *a, mp_digit b, mp_int *c); #define mp_sqr TclBN_mp_sqr #define mp_sqrt TclBN_mp_sqrt #define mp_sub TclBN_mp_sub -#define mp_sub_d TclBN_s_mp_sub_d +#define mp_sub_d TclBN_mp_sub_d #define mp_signed_rsh TclBN_mp_signed_rsh #define mp_tc_and TclBN_mp_and #define mp_tc_div_2d TclBN_mp_signed_rsh @@ -187,7 +175,7 @@ EXTERN int TclBN_revision(void) MP_WUR; EXTERN mp_err TclBN_mp_add(const mp_int *a, const mp_int *b, mp_int *c) MP_WUR; /* 3 */ -EXTERN mp_err TclBN_mp_add_d(const mp_int *a, unsigned int b, +EXTERN mp_err TclBN_mp_add_d(const mp_int *a, mp_digit b, mp_int *c) MP_WUR; /* 4 */ EXTERN mp_err TclBN_mp_and(const mp_int *a, const mp_int *b, @@ -201,7 +189,7 @@ EXTERN void TclBN_mp_clear_multi(mp_int *a, ...); /* 8 */ EXTERN mp_ord TclBN_mp_cmp(const mp_int *a, const mp_int *b) MP_WUR; /* 9 */ -EXTERN mp_ord TclBN_mp_cmp_d(const mp_int *a, unsigned int b) MP_WUR; +EXTERN mp_ord TclBN_mp_cmp_d(const mp_int *a, mp_digit b) MP_WUR; /* 10 */ EXTERN mp_ord TclBN_mp_cmp_mag(const mp_int *a, const mp_int *b) MP_WUR; /* 11 */ @@ -212,8 +200,8 @@ EXTERN int TclBN_mp_count_bits(const mp_int *a) MP_WUR; EXTERN mp_err TclBN_mp_div(const mp_int *a, const mp_int *b, mp_int *q, mp_int *r) MP_WUR; /* 14 */ -EXTERN mp_err TclBN_mp_div_d(const mp_int *a, unsigned int b, - mp_int *q, unsigned int *r) MP_WUR; +EXTERN mp_err TclBN_mp_div_d(const mp_int *a, mp_digit b, + mp_int *q, mp_digit *r) MP_WUR; /* 15 */ EXTERN mp_err TclBN_mp_div_2(const mp_int *a, mp_int *q) MP_WUR; /* 16 */ @@ -223,7 +211,7 @@ EXTERN mp_err TclBN_mp_div_2d(const mp_int *a, int b, mp_int *q, /* 18 */ EXTERN void TclBN_mp_exch(mp_int *a, mp_int *b); /* 19 */ -EXTERN mp_err TclBN_mp_expt_u32(const mp_int *a, unsigned int b, +EXTERN mp_err TclBN_mp_expt_u32(const mp_int *a, uint32_t b, mp_int *c) MP_WUR; /* 20 */ EXTERN mp_err TclBN_mp_grow(mp_int *a, int size) MP_WUR; @@ -234,7 +222,7 @@ EXTERN mp_err TclBN_mp_init_copy(mp_int *a, const mp_int *b) MP_WUR; /* 23 */ EXTERN mp_err TclBN_mp_init_multi(mp_int *a, ...) MP_WUR; /* 24 */ -EXTERN mp_err TclBN_mp_init_set(mp_int *a, unsigned int b) MP_WUR; +EXTERN mp_err TclBN_mp_init_set(mp_int *a, mp_digit b) MP_WUR; /* 25 */ EXTERN mp_err TclBN_mp_init_size(mp_int *a, int size) MP_WUR; /* 26 */ @@ -248,7 +236,7 @@ EXTERN mp_err TclBN_mp_mod_2d(const mp_int *a, int b, mp_int *r) MP_WUR; EXTERN mp_err TclBN_mp_mul(const mp_int *a, const mp_int *b, mp_int *p) MP_WUR; /* 30 */ -EXTERN mp_err TclBN_mp_mul_d(const mp_int *a, unsigned int b, +EXTERN mp_err TclBN_mp_mul_d(const mp_int *a, mp_digit b, mp_int *p) MP_WUR; /* 31 */ EXTERN mp_err TclBN_mp_mul_2(const mp_int *a, mp_int *p) MP_WUR; @@ -277,7 +265,7 @@ EXTERN mp_err TclBN_mp_sqrt(const mp_int *a, mp_int *b) MP_WUR; EXTERN mp_err TclBN_mp_sub(const mp_int *a, const mp_int *b, mp_int *c) MP_WUR; /* 43 */ -EXTERN mp_err TclBN_mp_sub_d(const mp_int *a, unsigned int b, +EXTERN mp_err TclBN_mp_sub_d(const mp_int *a, mp_digit b, mp_int *c) MP_WUR; /* Slot 44 is reserved */ /* Slot 45 is reserved */ @@ -328,9 +316,7 @@ EXTERN mp_err TclBN_mp_signed_rsh(const mp_int *a, int b, /* 78 */ EXTERN int TclBN_mp_to_ubin(const mp_int *a, unsigned char *buf, size_t maxlen, size_t *written) MP_WUR; -/* 79 */ -EXTERN mp_err TclBN_mp_div_ld(const mp_int *a, uint64_t b, - mp_int *q, uint64_t *r) MP_WUR; +/* Slot 79 is reserved */ /* 80 */ EXTERN int TclBN_mp_to_radix(const mp_int *a, char *str, size_t maxlen, size_t *written, int radix) MP_WUR; @@ -342,34 +328,34 @@ typedef struct TclTomMathStubs { int (*tclBN_epoch) (void) MP_WUR; /* 0 */ int (*tclBN_revision) (void) MP_WUR; /* 1 */ mp_err (*tclBN_mp_add) (const mp_int *a, const mp_int *b, mp_int *c) MP_WUR; /* 2 */ - mp_err (*tclBN_mp_add_d) (const mp_int *a, unsigned int b, mp_int *c) MP_WUR; /* 3 */ + mp_err (*tclBN_mp_add_d) (const mp_int *a, mp_digit b, mp_int *c) MP_WUR; /* 3 */ mp_err (*tclBN_mp_and) (const mp_int *a, const mp_int *b, mp_int *c) MP_WUR; /* 4 */ void (*tclBN_mp_clamp) (mp_int *a); /* 5 */ void (*tclBN_mp_clear) (mp_int *a); /* 6 */ void (*tclBN_mp_clear_multi) (mp_int *a, ...); /* 7 */ mp_ord (*tclBN_mp_cmp) (const mp_int *a, const mp_int *b) MP_WUR; /* 8 */ - mp_ord (*tclBN_mp_cmp_d) (const mp_int *a, unsigned int b) MP_WUR; /* 9 */ + mp_ord (*tclBN_mp_cmp_d) (const mp_int *a, mp_digit b) MP_WUR; /* 9 */ mp_ord (*tclBN_mp_cmp_mag) (const mp_int *a, const mp_int *b) MP_WUR; /* 10 */ mp_err (*tclBN_mp_copy) (const mp_int *a, mp_int *b) MP_WUR; /* 11 */ int (*tclBN_mp_count_bits) (const mp_int *a) MP_WUR; /* 12 */ mp_err (*tclBN_mp_div) (const mp_int *a, const mp_int *b, mp_int *q, mp_int *r) MP_WUR; /* 13 */ - mp_err (*tclBN_mp_div_d) (const mp_int *a, unsigned int b, mp_int *q, unsigned int *r) MP_WUR; /* 14 */ + mp_err (*tclBN_mp_div_d) (const mp_int *a, mp_digit b, mp_int *q, mp_digit *r) MP_WUR; /* 14 */ mp_err (*tclBN_mp_div_2) (const mp_int *a, mp_int *q) MP_WUR; /* 15 */ mp_err (*tclBN_mp_div_2d) (const mp_int *a, int b, mp_int *q, mp_int *r) MP_WUR; /* 16 */ void (*reserved17)(void); void (*tclBN_mp_exch) (mp_int *a, mp_int *b); /* 18 */ - mp_err (*tclBN_mp_expt_u32) (const mp_int *a, unsigned int b, mp_int *c) MP_WUR; /* 19 */ + mp_err (*tclBN_mp_expt_u32) (const mp_int *a, uint32_t b, mp_int *c) MP_WUR; /* 19 */ mp_err (*tclBN_mp_grow) (mp_int *a, int size) MP_WUR; /* 20 */ mp_err (*tclBN_mp_init) (mp_int *a) MP_WUR; /* 21 */ mp_err (*tclBN_mp_init_copy) (mp_int *a, const mp_int *b) MP_WUR; /* 22 */ mp_err (*tclBN_mp_init_multi) (mp_int *a, ...) MP_WUR; /* 23 */ - mp_err (*tclBN_mp_init_set) (mp_int *a, unsigned int b) MP_WUR; /* 24 */ + mp_err (*tclBN_mp_init_set) (mp_int *a, mp_digit b) MP_WUR; /* 24 */ mp_err (*tclBN_mp_init_size) (mp_int *a, int size) MP_WUR; /* 25 */ mp_err (*tclBN_mp_lshd) (mp_int *a, int shift) MP_WUR; /* 26 */ mp_err (*tclBN_mp_mod) (const mp_int *a, const mp_int *b, mp_int *r) MP_WUR; /* 27 */ mp_err (*tclBN_mp_mod_2d) (const mp_int *a, int b, mp_int *r) MP_WUR; /* 28 */ mp_err (*tclBN_mp_mul) (const mp_int *a, const mp_int *b, mp_int *p) MP_WUR; /* 29 */ - mp_err (*tclBN_mp_mul_d) (const mp_int *a, unsigned int b, mp_int *p) MP_WUR; /* 30 */ + mp_err (*tclBN_mp_mul_d) (const mp_int *a, mp_digit b, mp_int *p) MP_WUR; /* 30 */ mp_err (*tclBN_mp_mul_2) (const mp_int *a, mp_int *p) MP_WUR; /* 31 */ mp_err (*tclBN_mp_mul_2d) (const mp_int *a, int d, mp_int *p) MP_WUR; /* 32 */ mp_err (*tclBN_mp_neg) (const mp_int *a, mp_int *b) MP_WUR; /* 33 */ @@ -382,7 +368,7 @@ typedef struct TclTomMathStubs { void (*reserved40)(void); mp_err (*tclBN_mp_sqrt) (const mp_int *a, mp_int *b) MP_WUR; /* 41 */ mp_err (*tclBN_mp_sub) (const mp_int *a, const mp_int *b, mp_int *c) MP_WUR; /* 42 */ - mp_err (*tclBN_mp_sub_d) (const mp_int *a, unsigned int b, mp_int *c) MP_WUR; /* 43 */ + mp_err (*tclBN_mp_sub_d) (const mp_int *a, mp_digit b, mp_int *c) MP_WUR; /* 43 */ void (*reserved44)(void); void (*reserved45)(void); void (*reserved46)(void); @@ -418,7 +404,7 @@ typedef struct TclTomMathStubs { mp_err (*tclBN_mp_signed_rsh) (const mp_int *a, int b, mp_int *c) MP_WUR; /* 76 */ void (*reserved77)(void); int (*tclBN_mp_to_ubin) (const mp_int *a, unsigned char *buf, size_t maxlen, size_t *written) MP_WUR; /* 78 */ - mp_err (*tclBN_mp_div_ld) (const mp_int *a, uint64_t b, mp_int *q, uint64_t *r) MP_WUR; /* 79 */ + void (*reserved79)(void); int (*tclBN_mp_to_radix) (const mp_int *a, char *str, size_t maxlen, size_t *written, int radix) MP_WUR; /* 80 */ } TclTomMathStubs; @@ -565,8 +551,7 @@ extern const TclTomMathStubs *tclTomMathStubsPtr; /* Slot 77 is reserved */ #define TclBN_mp_to_ubin \ (tclTomMathStubsPtr->tclBN_mp_to_ubin) /* 78 */ -#define TclBN_mp_div_ld \ - (tclTomMathStubsPtr->tclBN_mp_div_ld) /* 79 */ +/* Slot 79 is reserved */ #define TclBN_mp_to_radix \ (tclTomMathStubsPtr->tclBN_mp_to_radix) /* 80 */ @@ -574,55 +559,6 @@ extern const TclTomMathStubs *tclTomMathStubsPtr; /* !END!: Do not edit above this line. */ -#if defined(USE_TCL_STUBS) -#undef mp_add_d -#define mp_add_d TclBN_mp_add_d -#undef mp_cmp_d -#define mp_cmp_d TclBN_mp_cmp_d -#undef mp_div_d -#ifdef MP_64BIT -#define mp_div_d TclBN_mp_div_ld -#else -#define mp_div_d TclBN_mp_div_d -#endif -#undef mp_sub_d -#define mp_sub_d TclBN_mp_sub_d -#undef mp_init_set -#define mp_init_set TclBN_mp_init_set -#undef mp_mul_d -#define mp_mul_d TclBN_mp_mul_d -#undef mp_set -#define mp_set TclBN_mp_set -#undef mp_expt_u32 -#define mp_expt_u32 TclBN_mp_expt_u32 -#endif /* USE_TCL_STUBS */ - -#define TclBNInitBignumFromLong(a,b) \ - do { \ - (a)->dp = NULL; \ - (void)mp_init_i64((a),(b)); \ - if ((a)->dp == NULL) { \ - Tcl_Panic("initialization failure in TclBNInitBignumFromLong"); \ - } \ - } while (0) -#undef TclBNInitBignumFromWideInt -#define TclBNInitBignumFromWideInt(a,b) \ - do { \ - (a)->dp = NULL; \ - (void)mp_init_i64((a),(b)); \ - if ((a)->dp == NULL) { \ - Tcl_Panic("initialization failure in TclBNInitBignumFromWideInt"); \ - } \ - } while (0) -#undef TclBNInitBignumFromWideUInt -#define TclBNInitBignumFromWideUInt(a,b) \ - do { \ - (a)->dp = NULL; \ - (void)mp_init_u64((a),(b)); \ - if ((a)->dp == NULL) { \ - Tcl_Panic("initialization failure in TclBNInitBignumFromWideUInt"); \ - } \ - } while (0) #undef mp_get_ll #define mp_get_ll(a) ((long long)mp_get_i64(a)) #undef mp_set_ll -- cgit v0.12 From be44843404a002a18aca9b059109c34cb538a8f3 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Fri, 13 Dec 2019 20:35:56 +0000 Subject: Fix [435acb846c]: libtommath - missing declarations --- generic/tclTomMathDecls.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/generic/tclTomMathDecls.h b/generic/tclTomMathDecls.h index 6716f9a..9a13a1a 100644 --- a/generic/tclTomMathDecls.h +++ b/generic/tclTomMathDecls.h @@ -56,6 +56,10 @@ # define MODULE_SCOPE extern #endif +MODULE_SCOPE mp_err TclBN_mp_sqr(const mp_int *a, mp_int *b); +MODULE_SCOPE mp_err TclBN_mp_div_3(const mp_int *a, mp_int *q, mp_digit *r); + + /* Rename the global symbols in libtommath to avoid linkage conflicts */ #ifndef TCL_WITH_EXTERNAL_TOMMATH -- cgit v0.12 From f5a8aaadf8c1f3c677edfbdde0c7619089a37705 Mon Sep 17 00:00:00 2001 From: dgp Date: Mon, 30 Dec 2019 21:00:09 +0000 Subject: Remove TclInitCompiledLocals(), internal routine marked deprecated in 8.5+. --- generic/tclInt.decls | 9 +++++---- generic/tclIntDecls.h | 9 +++------ generic/tclProc.c | 48 ------------------------------------------------ generic/tclStubInit.c | 2 +- 4 files changed, 9 insertions(+), 59 deletions(-) diff --git a/generic/tclInt.decls b/generic/tclInt.decls index bcdea6c..8b1b3a6 100644 --- a/generic/tclInt.decls +++ b/generic/tclInt.decls @@ -215,10 +215,11 @@ declare 46 { # Tcl_Obj *TclIncrVar2(Tcl_Interp *interp, Tcl_Obj *part1Ptr, # Tcl_Obj *part2Ptr, long incrAmount, int part1NotParsed) #} -declare 50 { - void TclInitCompiledLocals(Tcl_Interp *interp, CallFrame *framePtr, - Namespace *nsPtr) -} +# Removed in 9.0: +#declare 50 { +# void TclInitCompiledLocals(Tcl_Interp *interp, CallFrame *framePtr, +# Namespace *nsPtr) +#} declare 51 { int TclInterpInit(Tcl_Interp *interp) } diff --git a/generic/tclIntDecls.h b/generic/tclIntDecls.h index 260ef3e..580c959 100644 --- a/generic/tclIntDecls.h +++ b/generic/tclIntDecls.h @@ -142,9 +142,7 @@ EXTERN int TclInExit(void); /* Slot 47 is reserved */ /* Slot 48 is reserved */ /* Slot 49 is reserved */ -/* 50 */ -EXTERN void TclInitCompiledLocals(Tcl_Interp *interp, - CallFrame *framePtr, Namespace *nsPtr); +/* Slot 50 is reserved */ /* 51 */ EXTERN int TclInterpInit(Tcl_Interp *interp); /* Slot 52 is reserved */ @@ -638,7 +636,7 @@ typedef struct TclIntStubs { void (*reserved47)(void); void (*reserved48)(void); void (*reserved49)(void); - void (*tclInitCompiledLocals) (Tcl_Interp *interp, CallFrame *framePtr, Namespace *nsPtr); /* 50 */ + void (*reserved50)(void); int (*tclInterpInit) (Tcl_Interp *interp); /* 51 */ void (*reserved52)(void); int (*tclInvokeObjectCommand) (void *clientData, Tcl_Interp *interp, int argc, const char **argv); /* 53 */ @@ -937,8 +935,7 @@ extern const TclIntStubs *tclIntStubsPtr; /* Slot 47 is reserved */ /* Slot 48 is reserved */ /* Slot 49 is reserved */ -#define TclInitCompiledLocals \ - (tclIntStubsPtr->tclInitCompiledLocals) /* 50 */ +/* Slot 50 is reserved */ #define TclInterpInit \ (tclIntStubsPtr->tclInterpInit) /* 51 */ /* Slot 52 is reserved */ diff --git a/generic/tclProc.c b/generic/tclProc.c index ee57865..7aa553c 100644 --- a/generic/tclProc.c +++ b/generic/tclProc.c @@ -1099,54 +1099,6 @@ ProcWrongNumArgs( /* *---------------------------------------------------------------------- * - * TclInitCompiledLocals -- - * - * This routine is invoked in order to initialize the compiled locals - * table for a new call frame. - * - * DEPRECATED: functionality has been inlined elsewhere; this function - * remains to insure binary compatibility with Itcl. - * - * Results: - * None. - * - * Side effects: - * May invoke various name resolvers in order to determine which - * variables are being referenced at runtime. - * - *---------------------------------------------------------------------- - */ - -void -TclInitCompiledLocals( - Tcl_Interp *interp, /* Current interpreter. */ - CallFrame *framePtr, /* Call frame to initialize. */ - Namespace *nsPtr) /* Pointer to current namespace. */ -{ - Var *varPtr = framePtr->compiledLocals; - Tcl_Obj *bodyPtr; - ByteCode *codePtr; - - bodyPtr = framePtr->procPtr->bodyPtr; - ByteCodeGetIntRep(bodyPtr, &tclByteCodeType, codePtr); - if (codePtr == NULL) { - Tcl_Panic("body object for proc attached to frame is not a byte code type"); - } - - if (framePtr->numCompiledLocals) { - if (!codePtr->localCachePtr) { - InitLocalCache(framePtr->procPtr) ; - } - framePtr->localCachePtr = codePtr->localCachePtr; - framePtr->localCachePtr->refCount++; - } - - InitResolvedLocals(interp, codePtr, varPtr, nsPtr); -} - -/* - *---------------------------------------------------------------------- - * * InitResolvedLocals -- * * This routine is invoked in order to initialize the compiled locals diff --git a/generic/tclStubInit.c b/generic/tclStubInit.c index 8cae2f5..7250bd8 100644 --- a/generic/tclStubInit.c +++ b/generic/tclStubInit.c @@ -312,7 +312,7 @@ static const TclIntStubs tclIntStubs = { 0, /* 47 */ 0, /* 48 */ 0, /* 49 */ - TclInitCompiledLocals, /* 50 */ + 0, /* 50 */ TclInterpInit, /* 51 */ 0, /* 52 */ TclInvokeObjectCommand, /* 53 */ -- cgit v0.12 From fc63e758a4d1537762b5a86ee42f762547a4931a Mon Sep 17 00:00:00 2001 From: dgp Date: Mon, 13 Jan 2020 16:49:42 +0000 Subject: Implement TIP 559 --- doc/SetResult.3 | 12 +----------- generic/tcl.decls | 7 ++++--- generic/tclDecls.h | 8 +++----- generic/tclResult.c | 30 ------------------------------ generic/tclStubInit.c | 2 +- 5 files changed, 9 insertions(+), 50 deletions(-) diff --git a/doc/SetResult.3 b/doc/SetResult.3 index 07e2344..1355d6b 100644 --- a/doc/SetResult.3 +++ b/doc/SetResult.3 @@ -9,7 +9,7 @@ .so man.macros .BS .SH NAME -Tcl_SetObjResult, Tcl_GetObjResult, Tcl_SetResult, Tcl_GetStringResult, Tcl_AppendResult, Tcl_AppendElement, Tcl_ResetResult, Tcl_TransferResult, Tcl_FreeResult \- manipulate Tcl result +Tcl_SetObjResult, Tcl_GetObjResult, Tcl_SetResult, Tcl_GetStringResult, Tcl_AppendResult, Tcl_AppendElement, Tcl_ResetResult, Tcl_TransferResult \- manipulate Tcl result .SH SYNOPSIS .nf \fB#include \fR @@ -31,8 +31,6 @@ const char * \fBTcl_TransferResult\fR(\fIsourceInterp, code, targetInterp\fR) .sp \fBTcl_AppendElement\fR(\fIinterp, element\fR) -.sp -\fBTcl_FreeResult\fR(\fIinterp\fR) .SH ARGUMENTS .AS Tcl_FreeProc sourceInterp out .AP Tcl_Interp *interp out @@ -177,14 +175,6 @@ single character or ends in the characters .QW " {" ) then no space is added. -.PP -\fBTcl_FreeResult\fR performs part of the work -of \fBTcl_ResetResult\fR. -It frees up the memory associated with \fIinterp\fR's result. -It also sets \fIinterp->freeProc\fR to zero, but does not -change \fIinterp->result\fR or clear error state. -\fBTcl_FreeResult\fR is most commonly used when a procedure -is about to replace one result value with another. .SH "THE TCL_FREEPROC ARGUMENT TO TCL_SETRESULT" .PP \fBTcl_SetResult\fR's \fIfreeProc\fR argument specifies how diff --git a/generic/tcl.decls b/generic/tcl.decls index f852601..98cddd5 100644 --- a/generic/tcl.decls +++ b/generic/tcl.decls @@ -540,9 +540,10 @@ declare 145 { declare 146 { int Tcl_Flush(Tcl_Channel chan) } -declare 147 { - void Tcl_FreeResult(Tcl_Interp *interp) -} +# Removed in 9.0, TIP 559 +#declare 147 { +# void Tcl_FreeResult(Tcl_Interp *interp) +#} declare 148 { int Tcl_GetAlias(Tcl_Interp *interp, const char *slaveCmd, Tcl_Interp **targetInterpPtr, const char **targetCmdPtr, diff --git a/generic/tclDecls.h b/generic/tclDecls.h index be71893..d944676 100644 --- a/generic/tclDecls.h +++ b/generic/tclDecls.h @@ -434,8 +434,7 @@ EXTERN Tcl_HashEntry * Tcl_FirstHashEntry(Tcl_HashTable *tablePtr, Tcl_HashSearch *searchPtr); /* 146 */ EXTERN int Tcl_Flush(Tcl_Channel chan); -/* 147 */ -EXTERN void Tcl_FreeResult(Tcl_Interp *interp); +/* Slot 147 is reserved */ /* 148 */ EXTERN int Tcl_GetAlias(Tcl_Interp *interp, const char *slaveCmd, @@ -1941,7 +1940,7 @@ typedef struct TclStubs { void (*reserved144)(void); Tcl_HashEntry * (*tcl_FirstHashEntry) (Tcl_HashTable *tablePtr, Tcl_HashSearch *searchPtr); /* 145 */ int (*tcl_Flush) (Tcl_Channel chan); /* 146 */ - void (*tcl_FreeResult) (Tcl_Interp *interp); /* 147 */ + void (*reserved147)(void); int (*tcl_GetAlias) (Tcl_Interp *interp, const char *slaveCmd, Tcl_Interp **targetInterpPtr, const char **targetCmdPtr, int *argcPtr, const char ***argvPtr); /* 148 */ int (*tcl_GetAliasObj) (Tcl_Interp *interp, const char *slaveCmd, Tcl_Interp **targetInterpPtr, const char **targetCmdPtr, int *objcPtr, Tcl_Obj ***objv); /* 149 */ void * (*tcl_GetAssocData) (Tcl_Interp *interp, const char *name, Tcl_InterpDeleteProc **procPtr); /* 150 */ @@ -2754,8 +2753,7 @@ extern const TclStubs *tclStubsPtr; (tclStubsPtr->tcl_FirstHashEntry) /* 145 */ #define Tcl_Flush \ (tclStubsPtr->tcl_Flush) /* 146 */ -#define Tcl_FreeResult \ - (tclStubsPtr->tcl_FreeResult) /* 147 */ +/* Slot 147 is reserved */ #define Tcl_GetAlias \ (tclStubsPtr->tcl_GetAlias) /* 148 */ #define Tcl_GetAliasObj \ diff --git a/generic/tclResult.c b/generic/tclResult.c index 3ca3c7b..69edd39 100644 --- a/generic/tclResult.c +++ b/generic/tclResult.c @@ -373,36 +373,6 @@ Tcl_AppendElement( /* *---------------------------------------------------------------------- * - * Tcl_FreeResult -- - * - * This function frees up the memory associated with an interpreter's - * result, resetting the interpreter's result object. Tcl_FreeResult is - * most commonly used when a function is about to replace one result - * value with another. - * - * Results: - * None. - * - * Side effects: - * Frees the memory associated with interp's result but does not change - * any part of the error dictionary (i.e., the errorinfo and errorcode - * remain the same). - * - *---------------------------------------------------------------------- - */ - -void -Tcl_FreeResult( - Tcl_Interp *interp)/* Interpreter for which to free result. */ -{ - Interp *iPtr = (Interp *) interp; - - ResetObjResult(iPtr); -} - -/* - *---------------------------------------------------------------------- - * * Tcl_ResetResult -- * * This function resets both the interpreter's string and object results. diff --git a/generic/tclStubInit.c b/generic/tclStubInit.c index 01434b9..3ca9fe4 100644 --- a/generic/tclStubInit.c +++ b/generic/tclStubInit.c @@ -894,7 +894,7 @@ const TclStubs tclStubs = { 0, /* 144 */ Tcl_FirstHashEntry, /* 145 */ Tcl_Flush, /* 146 */ - Tcl_FreeResult, /* 147 */ + 0, /* 147 */ Tcl_GetAlias, /* 148 */ Tcl_GetAliasObj, /* 149 */ Tcl_GetAssocData, /* 150 */ -- cgit v0.12 From b77246e08bf5f354f35ac9a388296a3fcb5a2a95 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Tue, 21 Jan 2020 09:21:30 +0000 Subject: Enable test-cases stringObj-15.[5-8]: "nodep" restriction doesn't work in 9.0. --- tests/stringObj.test | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/tests/stringObj.test b/tests/stringObj.test index 3779bca..8b10897 100644 --- a/tests/stringObj.test +++ b/tests/stringObj.test @@ -24,7 +24,6 @@ testConstraint testobj [llength [info commands testobj]] testConstraint testbytestring [llength [info commands testbytestring]] testConstraint testdstring [llength [info commands testdstring]] testConstraint tip389 [expr {[string length \U010000] == 2}] -testConstraint nodep [info exists tcl_precision] test stringObj-1.1 {string type registration} testobj { set t [testobj types] @@ -466,19 +465,19 @@ test stringObj-15.4 {Tcl_Append*ToObj: self appends} testobj { teststringobj set 1 foo teststringobj appendself 1 3 } foo -test stringObj-15.5 {Tcl_Append*ToObj: self appends} {testobj tip389 nodep} { +test stringObj-15.5 {Tcl_Append*ToObj: self appends} {testobj tip389} { teststringobj set 1 foo teststringobj appendself2 1 0 } foofoo -test stringObj-15.6 {Tcl_Append*ToObj: self appends} {testobj tip389 nodep} { +test stringObj-15.6 {Tcl_Append*ToObj: self appends} {testobj tip389} { teststringobj set 1 foo teststringobj appendself2 1 1 } foooo -test stringObj-15.7 {Tcl_Append*ToObj: self appends} {testobj tip389 nodep} { +test stringObj-15.7 {Tcl_Append*ToObj: self appends} {testobj tip389} { teststringobj set 1 foo teststringobj appendself2 1 2 } fooo -test stringObj-15.8 {Tcl_Append*ToObj: self appends} {testobj tip389 nodep} { +test stringObj-15.8 {Tcl_Append*ToObj: self appends} {testobj tip389} { teststringobj set 1 foo teststringobj appendself2 1 3 } foo -- cgit v0.12 From f4a42dff0150fceaeadfb3812a70c54f149e17ca Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Sun, 1 Mar 2020 12:35:04 +0000 Subject: re-generate configure script (option -Wc++-compat was still missing) --- unix/configure | 10 +++++++++- win/configure | 4 ++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/unix/configure b/unix/configure index 892288d..1ba1e5c 100755 --- a/unix/configure +++ b/unix/configure @@ -5036,7 +5036,15 @@ fi if test "$GCC" = yes; then : CFLAGS_OPTIMIZE=-O2 - CFLAGS_WARNING="-Wall -Wextra -Wwrite-strings -Wsign-compare -Wpointer-arith" + CFLAGS_WARNING="-Wall -Wextra -Wwrite-strings -Wpointer-arith" + case "${CC}" in + *++) + ;; + *) + CFLAGS_WARNING="${CFLAGS_WARNING} -Wc++-compat -Wdeclaration-after-statement" + ;; + esac + else diff --git a/win/configure b/win/configure index c210d89..6ceae65 100755 --- a/win/configure +++ b/win/configure @@ -4196,7 +4196,7 @@ $as_echo "using shared flags" >&6; } CFLAGS_DEBUG=-g CFLAGS_OPTIMIZE="-O2 -fomit-frame-pointer" - CFLAGS_WARNING="-Wall -Wextra -Wwrite-strings -Wsign-compare -Wpointer-arith" + CFLAGS_WARNING="-Wall -Wextra -Wwrite-strings -Wpointer-arith" LDFLAGS_DEBUG= LDFLAGS_OPTIMIZE= @@ -4205,7 +4205,7 @@ $as_echo "using shared flags" >&6; } CFLAGS_WARNING="${CFLAGS_WARNING} -Wno-format" ;; *) - CFLAGS_WARNING="${CFLAGS_WARNING} -Wdeclaration-after-statement" + CFLAGS_WARNING="${CFLAGS_WARNING} -Wc++-compat -Wdeclaration-after-statement" ;; esac -- cgit v0.12 From 72f5a0b42fd69b0ccad811c45ab2d2b265a67b63 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Wed, 11 Mar 2020 10:20:51 +0000 Subject: Put back dummy Tcl_DriverCloseProc/Tcl_DriverSeekProc (just defined as "void"). Needed to make Tk compile with C++ against 9.0 headers. --- generic/tcl.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/generic/tcl.h b/generic/tcl.h index 29f64bc..874f6e9 100644 --- a/generic/tcl.h +++ b/generic/tcl.h @@ -1240,12 +1240,14 @@ typedef void (Tcl_ScaleTimeProc) (Tcl_Time *timebuf, void *clientData); */ typedef int (Tcl_DriverBlockModeProc) (void *instanceData, int mode); +typedef void Tcl_DriverCloseProc; typedef int (Tcl_DriverClose2Proc) (void *instanceData, Tcl_Interp *interp, int flags); typedef int (Tcl_DriverInputProc) (void *instanceData, char *buf, int toRead, int *errorCodePtr); typedef int (Tcl_DriverOutputProc) (void *instanceData, const char *buf, int toWrite, int *errorCodePtr); +typedef void Tcl_DriverSeekProc; typedef int (Tcl_DriverSetOptionProc) (void *instanceData, Tcl_Interp *interp, const char *optionName, const char *value); -- cgit v0.12 From b6f9e488f51114487c444153373a1b89728d76fd Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Wed, 25 Mar 2020 15:37:25 +0000 Subject: Fix for windows build (Windows doesn't have "%z" printf modifier) --- generic/tclBinary.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generic/tclBinary.c b/generic/tclBinary.c index 77258bb..7c41aab 100644 --- a/generic/tclBinary.c +++ b/generic/tclBinary.c @@ -473,7 +473,7 @@ TclGetBytesFromObj( Tcl_UtfToUniChar(nonbyte, &ch); Tcl_SetObjResult(interp, Tcl_ObjPrintf( - "expected byte sequence but character %zu " + "expected byte sequence but character %" TCL_Z_MODIFIER "u " "was '%1s' (U+%04X)", baPtr->bad, nonbyte, ch)); Tcl_SetErrorCode(interp, "TCL", "VALUE", "BYTES", NULL); } -- cgit v0.12 From ce51daca482df2b6dfe2f0433ec5366c9729666c Mon Sep 17 00:00:00 2001 From: dgp Date: Sun, 29 Mar 2020 21:47:12 +0000 Subject: Let the private, internal TclGetBytesFromObj handle size_t lengths --- generic/tclBinary.c | 36 ++++++++++++++++++++---------------- generic/tclInt.h | 2 +- 2 files changed, 21 insertions(+), 17 deletions(-) diff --git a/generic/tclBinary.c b/generic/tclBinary.c index 0a64e96..0e5b942 100644 --- a/generic/tclBinary.c +++ b/generic/tclBinary.c @@ -453,7 +453,7 @@ unsigned char * TclGetBytesFromObj( Tcl_Interp *interp, /* For error reporting */ Tcl_Obj *objPtr, /* Value to extract from */ - int *lengthPtr) /* If non-NULL, filled with length of the + size_t *lengthPtr) /* If non-NULL, filled with length of the * array of bytes in the ByteArray object. */ { ByteArray *baPtr; @@ -512,23 +512,27 @@ Tcl_GetByteArrayFromObj( int *lengthPtr) /* If non-NULL, filled with length of the * array of bytes in the ByteArray object. */ { - ByteArray *baPtr; - const Tcl_ObjIntRep *irPtr; - unsigned char *result = TclGetBytesFromObj(NULL, objPtr, lengthPtr); + size_t size; + unsigned char *result = TclGetBytesFromObj(NULL, objPtr, &size); - if (result) { - return result; - } + if (result == NULL) { + ByteArray *baPtr; + const Tcl_ObjIntRep *irPtr = TclFetchIntRep(objPtr, &tclByteArrayType); - irPtr = TclFetchIntRep(objPtr, &tclByteArrayType); - assert(irPtr != NULL); + assert(irPtr != NULL); - baPtr = GET_BYTEARRAY(irPtr); + baPtr = GET_BYTEARRAY(irPtr); + result = baPtr->bytes; + size = baPtr->used; + } if (lengthPtr != NULL) { - *lengthPtr = baPtr->used; + if (size > INT_MAX) { + Tcl_Panic("more bytes than Tcl_GetByteArrayFromObj can return"); + } + *lengthPtr = (int) size; } - return baPtr->bytes; + return result; } /* @@ -556,7 +560,7 @@ Tcl_GetByteArrayFromObj( unsigned char * Tcl_SetByteArrayLength( Tcl_Obj *objPtr, /* The ByteArray object. */ - size_t length) /* New length for internal byte array. */ + size_t length) /* New length for internal byte array. */ { ByteArray *byteArrayPtr; Tcl_ObjIntRep *irPtr; @@ -2698,7 +2702,7 @@ BinaryEncode64( unsigned char *data, *limit; int maxlen = 0; const char *wrapchar = "\n"; - int wrapcharlen = 1; + size_t wrapcharlen = 1; int i, index, size, outindex = 0, purewrap = 1; size_t offset, count = 0; enum { OPT_MAXLEN, OPT_WRAPCHAR }; @@ -3103,8 +3107,8 @@ BinaryDecode64( unsigned char *begin = NULL; unsigned char *cursor = NULL; int pure = 1, strict = 0; - int i, index, size, cut = 0; - int count = 0; + int i, index, cut = 0; + size_t size, count = 0; Tcl_UniChar ch; enum { OPT_STRICT }; static const char *const optStrings[] = { "-strict", NULL }; diff --git a/generic/tclInt.h b/generic/tclInt.h index 6ff11d3..a6635aa 100644 --- a/generic/tclInt.h +++ b/generic/tclInt.h @@ -2958,7 +2958,7 @@ MODULE_SCOPE void TclFSUnloadTempFile(Tcl_LoadHandle loadHandle); MODULE_SCOPE int * TclGetAsyncReadyPtr(void); MODULE_SCOPE Tcl_Obj * TclGetBgErrorHandler(Tcl_Interp *interp); MODULE_SCOPE unsigned char * TclGetBytesFromObj(Tcl_Interp *interp, - Tcl_Obj *objPtr, int *lengthPtr); + Tcl_Obj *objPtr, size_t *lengthPtr); MODULE_SCOPE int TclGetChannelFromObj(Tcl_Interp *interp, Tcl_Obj *objPtr, Tcl_Channel *chanPtr, int *modePtr, int flags); -- cgit v0.12 From 2a007ddb5067d4496a8d1007a8a6ed5151bc7f5e Mon Sep 17 00:00:00 2001 From: dgp Date: Sun, 29 Mar 2020 22:10:28 +0000 Subject: Change of variables. --- generic/tclBinary.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/generic/tclBinary.c b/generic/tclBinary.c index 0e5b942..67183a5 100644 --- a/generic/tclBinary.c +++ b/generic/tclBinary.c @@ -512,27 +512,27 @@ Tcl_GetByteArrayFromObj( int *lengthPtr) /* If non-NULL, filled with length of the * array of bytes in the ByteArray object. */ { - size_t size; - unsigned char *result = TclGetBytesFromObj(NULL, objPtr, &size); + size_t numBytes; + unsigned char *bytes = TclGetBytesFromObj(NULL, objPtr, &numBytes); - if (result == NULL) { + if (bytes == NULL) { ByteArray *baPtr; const Tcl_ObjIntRep *irPtr = TclFetchIntRep(objPtr, &tclByteArrayType); assert(irPtr != NULL); baPtr = GET_BYTEARRAY(irPtr); - result = baPtr->bytes; - size = baPtr->used; + bytes = baPtr->bytes; + numBytes = baPtr->used; } if (lengthPtr != NULL) { - if (size > INT_MAX) { + if (numBytes > INT_MAX) { Tcl_Panic("more bytes than Tcl_GetByteArrayFromObj can return"); } - *lengthPtr = (int) size; + *lengthPtr = (int) numBytes; } - return result; + return bytes; } /* -- cgit v0.12 From 9e82ddc739533d80820c3d1d91f873b25132380a Mon Sep 17 00:00:00 2001 From: dgp Date: Mon, 30 Mar 2020 03:23:26 +0000 Subject: Adjustments for easier merging. --- generic/tclBinary.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/generic/tclBinary.c b/generic/tclBinary.c index 67183a5..0e22298 100644 --- a/generic/tclBinary.c +++ b/generic/tclBinary.c @@ -512,7 +512,7 @@ Tcl_GetByteArrayFromObj( int *lengthPtr) /* If non-NULL, filled with length of the * array of bytes in the ByteArray object. */ { - size_t numBytes; + size_t numBytes = 0; unsigned char *bytes = TclGetBytesFromObj(NULL, objPtr, &numBytes); if (bytes == NULL) { @@ -526,11 +526,19 @@ Tcl_GetByteArrayFromObj( numBytes = baPtr->used; } - if (lengthPtr != NULL) { + /* Macro TclGetByteArrayFromObj passes NULL for lengthPtr as + * a trick to get around changing size. */ + if (lengthPtr) { if (numBytes > INT_MAX) { - Tcl_Panic("more bytes than Tcl_GetByteArrayFromObj can return"); + /* Caller asked for an int length, but true length is outside + * the int range. This case will be developed out of existence + * in Tcl 9. As interim measure, fail. */ + + *lengthPtr = 0; + return NULL; + } else { + *lengthPtr = (int) numBytes; } - *lengthPtr = (int) numBytes; } return bytes; } -- cgit v0.12 From 998384d14959533914f0aa6cacaa0bd26a590ba2 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Tue, 31 Mar 2020 07:09:46 +0000 Subject: Internal API simplifications: Don't use types like HINSTANCE/HMODULE any more, just void*. Has effect only on Win32 and Cygwin. --- generic/tclInt.decls | 8 ++++---- generic/tclIntPlatDecls.h | 12 ++++++------ generic/tclZipfs.c | 2 +- unix/tclSelectNotfy.c | 29 +++++++++++++++-------------- unix/tclUnixInit.c | 22 +++++++++++----------- unix/tclUnixPort.h | 3 --- win/tclWin32Dll.c | 2 +- win/tclWinError.c | 6 +++--- win/tclWinInit.c | 4 ++-- win/tclWinNotify.c | 6 +++--- win/tclWinSock.c | 4 ++-- 11 files changed, 48 insertions(+), 50 deletions(-) diff --git a/generic/tclInt.decls b/generic/tclInt.decls index 82d9249..b9cec96 100644 --- a/generic/tclInt.decls +++ b/generic/tclInt.decls @@ -1082,11 +1082,11 @@ interface tclIntPlat # Windows specific functions declare 0 win { - void TclWinConvertError(DWORD errCode) + void TclWinConvertError(int errCode) } # Removed in 9.0: #declare 1 win { -# void TclWinConvertWSAError(DWORD errCode) +# void TclWinConvertWSAError(int errCode) #} # Removed in 9.0: #declare 2 win { @@ -1099,7 +1099,7 @@ declare 0 win { # char *optval, int *optlen) #} declare 4 win { - HINSTANCE TclWinGetTclInstance(void) + void *TclWinGetTclInstance(void) } # new for 8.4.20+/8.5.12+ Cygwin only declare 5 win { @@ -1177,7 +1177,7 @@ declare 19 win { TclFile TclpOpenFile(const char *fname, int mode) } declare 20 win { - void TclWinAddProcess(HANDLE hProcess, size_t id) + void TclWinAddProcess(void *hProcess, size_t id) } # Removed in 9.0: #declare 21 win { diff --git a/generic/tclIntPlatDecls.h b/generic/tclIntPlatDecls.h index fc6cd0b..87a25db 100644 --- a/generic/tclIntPlatDecls.h +++ b/generic/tclIntPlatDecls.h @@ -114,12 +114,12 @@ EXTERN int TclUnixOpenTemporaryFile(Tcl_Obj *dirObj, #endif /* UNIX */ #if defined(_WIN32) || defined(__CYGWIN__) /* WIN */ /* 0 */ -EXTERN void TclWinConvertError(DWORD errCode); +EXTERN void TclWinConvertError(int errCode); /* Slot 1 is reserved */ /* Slot 2 is reserved */ /* Slot 3 is reserved */ /* 4 */ -EXTERN HINSTANCE TclWinGetTclInstance(void); +EXTERN void * TclWinGetTclInstance(void); /* 5 */ EXTERN int TclUnixWaitForFile(int fd, int mask, int timeout); /* Slot 6 is reserved */ @@ -155,7 +155,7 @@ EXTERN TclFile TclpMakeFile(Tcl_Channel channel, int direction); /* 19 */ EXTERN TclFile TclpOpenFile(const char *fname, int mode); /* 20 */ -EXTERN void TclWinAddProcess(HANDLE hProcess, size_t id); +EXTERN void TclWinAddProcess(void *hProcess, size_t id); /* Slot 21 is reserved */ /* 22 */ EXTERN TclFile TclpCreateTempFile(const char *contents); @@ -285,11 +285,11 @@ typedef struct TclIntPlatStubs { int (*tclUnixOpenTemporaryFile) (Tcl_Obj *dirObj, Tcl_Obj *basenameObj, Tcl_Obj *extensionObj, Tcl_Obj *resultingNameObj); /* 30 */ #endif /* UNIX */ #if defined(_WIN32) || defined(__CYGWIN__) /* WIN */ - void (*tclWinConvertError) (DWORD errCode); /* 0 */ + void (*tclWinConvertError) (int errCode); /* 0 */ void (*reserved1)(void); void (*reserved2)(void); void (*reserved3)(void); - HINSTANCE (*tclWinGetTclInstance) (void); /* 4 */ + void * (*tclWinGetTclInstance) (void); /* 4 */ int (*tclUnixWaitForFile) (int fd, int mask, int timeout); /* 5 */ void (*reserved6)(void); void (*reserved7)(void); @@ -305,7 +305,7 @@ typedef struct TclIntPlatStubs { int (*tclUnixCopyFile) (const char *src, const char *dst, const Tcl_StatBuf *statBufPtr, int dontCopyAtts); /* 17 */ TclFile (*tclpMakeFile) (Tcl_Channel channel, int direction); /* 18 */ TclFile (*tclpOpenFile) (const char *fname, int mode); /* 19 */ - void (*tclWinAddProcess) (HANDLE hProcess, size_t id); /* 20 */ + void (*tclWinAddProcess) (void *hProcess, size_t id); /* 20 */ void (*reserved21)(void); TclFile (*tclpCreateTempFile) (const char *contents); /* 22 */ void (*reserved23)(void); diff --git a/generic/tclZipfs.c b/generic/tclZipfs.c index aa68935..7398ab8 100644 --- a/generic/tclZipfs.c +++ b/generic/tclZipfs.c @@ -3205,7 +3205,7 @@ TclZipfs_TclLibrary(void) */ #if defined(_WIN32) - hModule = TclWinGetTclInstance(); + hModule = (HMODULE)TclWinGetTclInstance(); GetModuleFileNameW(hModule, wName, MAX_PATH); WideCharToMultiByte(CP_UTF8, 0, wName, -1, dllName, sizeof(dllName), NULL, NULL); diff --git a/unix/tclSelectNotfy.c b/unix/tclSelectNotfy.c index 52b012a..8b19578 100644 --- a/unix/tclSelectNotfy.c +++ b/unix/tclSelectNotfy.c @@ -216,11 +216,12 @@ extern "C" { typedef struct { void *hwnd; /* Messaging window. */ unsigned int *message; /* Message payload. */ - int wParam; /* Event-specific "word" parameter. */ - int lParam; /* Event-specific "long" parameter. */ + size_t wParam; /* Event-specific "word" parameter. */ + size_t lParam; /* Event-specific "long" parameter. */ int time; /* Event timestamp. */ int x; /* Event location (where meaningful). */ int y; + int lPrivate; } MSG; typedef struct { @@ -232,7 +233,7 @@ typedef struct { void *hIcon; void *hCursor; void *hbrBackground; - void *lpszMenuName; + const void *lpszMenuName; const void *lpszClassName; } WNDCLASSW; @@ -243,14 +244,14 @@ extern void __stdcall CloseHandle(void *); extern void *__stdcall CreateEventW(void *, unsigned char, unsigned char, void *); extern void *__stdcall CreateWindowExW(void *, const void *, const void *, - DWORD, int, int, int, int, void *, void *, void *, + unsigned int, int, int, int, int, void *, void *, void *, void *); -extern DWORD __stdcall DefWindowProcW(void *, int, void *, void *); +extern unsigned int __stdcall DefWindowProcW(void *, int, void *, void *); extern unsigned char __stdcall DestroyWindow(void *); extern int __stdcall DispatchMessageW(const MSG *); extern unsigned char __stdcall GetMessageW(MSG *, void *, int, int); -extern void __stdcall MsgWaitForMultipleObjects(DWORD, void *, - unsigned char, DWORD, DWORD); +extern void __stdcall MsgWaitForMultipleObjects(unsigned int, void *, + unsigned char, unsigned int, unsigned int); extern unsigned char __stdcall PeekMessageW(MSG *, void *, int, int, int); extern unsigned char __stdcall PostMessageW(void *, unsigned int, void *, void *); @@ -264,7 +265,7 @@ extern unsigned char __stdcall TranslateMessage(const MSG *); */ static const wchar_t className[] = L"TclNotifier"; -static DWORD __stdcall NotifierProc(void *hwnd, unsigned int message, +static unsigned int __stdcall NotifierProc(void *hwnd, unsigned int message, void *wParam, void *lParam); #ifdef __cplusplus } @@ -322,7 +323,7 @@ Tcl_InitNotifier(void) RegisterClassW(&clazz); tsdPtr->hwnd = CreateWindowExW(NULL, clazz.lpszClassName, clazz.lpszClassName, 0, 0, 0, 0, 0, NULL, NULL, - TclWinGetTclInstance(), NULL); + clazz.hInstance, NULL); tsdPtr->event = CreateEventW(NULL, 1 /* manual */, 0 /* !signaled */, NULL); #else @@ -598,7 +599,7 @@ Tcl_DeleteFileHandler( #if defined(__CYGWIN__) -static DWORD __stdcall +static unsigned int __stdcall NotifierProc( void *hwnd, unsigned int message, @@ -649,6 +650,7 @@ Tcl_WaitForEvent( FileHandler *filePtr; int mask; Tcl_Time vTime; + ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); #if TCL_THREADS int waitForFiles; # ifdef __CYGWIN__ @@ -664,7 +666,6 @@ Tcl_WaitForEvent( struct timeval timeout, *timeoutPtr; int numFound; #endif /* TCL_THREADS */ - ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); /* * Set up the timeout structure. Note that if there are no events to @@ -769,7 +770,7 @@ Tcl_WaitForEvent( if (!tsdPtr->eventReady) { #ifdef __CYGWIN__ if (!PeekMessageW(&msg, NULL, 0, 0, 0)) { - DWORD timeout; + unsigned int timeout; if (timePtr) { timeout = timePtr->sec * 1000 + timePtr->usec / 1000; @@ -804,12 +805,12 @@ Tcl_WaitForEvent( * Retrieve and dispatch the message. */ - DWORD result = GetMessageW(&msg, NULL, 0, 0); + unsigned int result = GetMessageW(&msg, NULL, 0, 0); if (result == 0) { PostQuitMessage(msg.wParam); /* What to do here? */ - } else if (result != (DWORD) -1) { + } else if (result != (unsigned int) -1) { TranslateMessage(&msg); DispatchMessageW(&msg); } diff --git a/unix/tclUnixInit.c b/unix/tclUnixInit.c index 137747f..e6f44e7 100644 --- a/unix/tclUnixInit.c +++ b/unix/tclUnixInit.c @@ -54,29 +54,29 @@ static const char *const processors[NUMPROCESSORS] = { typedef struct { union { - DWORD dwOemId; + unsigned int dwOemId; struct { int wProcessorArchitecture; int wReserved; }; }; - DWORD dwPageSize; + unsigned int dwPageSize; void *lpMinimumApplicationAddress; void *lpMaximumApplicationAddress; void *dwActiveProcessorMask; - DWORD dwNumberOfProcessors; - DWORD dwProcessorType; - DWORD dwAllocationGranularity; + unsigned int dwNumberOfProcessors; + unsigned int dwProcessorType; + unsigned int dwAllocationGranularity; int wProcessorLevel; int wProcessorRevision; } SYSTEM_INFO; typedef struct { - DWORD dwOSVersionInfoSize; - DWORD dwMajorVersion; - DWORD dwMinorVersion; - DWORD dwBuildNumber; - DWORD dwPlatformId; + unsigned int dwOSVersionInfoSize; + unsigned int dwMajorVersion; + unsigned int dwMinorVersion; + unsigned int dwBuildNumber; + unsigned int dwPlatformId; wchar_t szCSDVersion[128]; } OSVERSIONINFOW; #endif @@ -873,7 +873,7 @@ TclpSetVariables( #ifdef __CYGWIN__ unameOK = 1; if (!osInfoInitialized) { - HANDLE handle = GetModuleHandleW(L"NTDLL"); + void *handle = GetModuleHandleW(L"NTDLL"); int(__stdcall *getversion)(void *) = (int(__stdcall *)(void *))GetProcAddress(handle, "RtlGetVersion"); osInfo.dwOSVersionInfoSize = sizeof(OSVERSIONINFOW); diff --git a/unix/tclUnixPort.h b/unix/tclUnixPort.h index b3ad0bf..77426c8 100644 --- a/unix/tclUnixPort.h +++ b/unix/tclUnixPort.h @@ -90,11 +90,8 @@ typedef off_t Tcl_SeekOffset; extern "C" { #endif /* Make some symbols available without including */ -# define DWORD unsigned int # define CP_UTF8 65001 # define GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS 0x00000004 -# define HANDLE void * -# define HINSTANCE void * # define SOCKET unsigned int # define WSAEWOULDBLOCK 10035 typedef unsigned short WCHAR; diff --git a/win/tclWin32Dll.c b/win/tclWin32Dll.c index de0ddad..737567b 100644 --- a/win/tclWin32Dll.c +++ b/win/tclWin32Dll.c @@ -152,7 +152,7 @@ DllMain( *---------------------------------------------------------------------- */ -HINSTANCE +void * TclWinGetTclInstance(void) { return hInstance; diff --git a/win/tclWinError.c b/win/tclWinError.c index fc07b3e..f93f000 100644 --- a/win/tclWinError.c +++ b/win/tclWinError.c @@ -349,11 +349,11 @@ static const unsigned char wsaErrorTable[] = { void TclWinConvertError( - DWORD errCode) /* Win32 error code. */ + int errCode) /* Win32 error code. */ { - if (errCode >= sizeof(errorTable)/sizeof(errorTable[0])) { + if ((unsigned)errCode >= sizeof(errorTable)/sizeof(errorTable[0])) { errCode -= WSAEWOULDBLOCK; - if (errCode >= sizeof(wsaErrorTable)/sizeof(wsaErrorTable[0])) { + if ((unsigned)errCode >= sizeof(wsaErrorTable)/sizeof(wsaErrorTable[0])) { Tcl_SetErrno(errorTable[1]); } else { Tcl_SetErrno(wsaErrorTable[errCode]); diff --git a/win/tclWinInit.c b/win/tclWinInit.c index 122c4ae..7bd46cc 100644 --- a/win/tclWinInit.c +++ b/win/tclWinInit.c @@ -344,7 +344,7 @@ InitializeDefaultLibraryDir( size_t *lengthPtr, Tcl_Encoding *encodingPtr) { - HMODULE hModule = TclWinGetTclInstance(); + HMODULE hModule = (HMODULE)TclWinGetTclInstance(); WCHAR wName[MAX_PATH + LIBRARY_SIZE]; char name[(MAX_PATH + LIBRARY_SIZE) * 3]; char *end, *p; @@ -392,7 +392,7 @@ InitializeSourceLibraryDir( size_t *lengthPtr, Tcl_Encoding *encodingPtr) { - HMODULE hModule = TclWinGetTclInstance(); + HMODULE hModule = (HMODULE)TclWinGetTclInstance(); WCHAR wName[MAX_PATH + LIBRARY_SIZE]; char name[(MAX_PATH + LIBRARY_SIZE) * 3]; char *end, *p; diff --git a/win/tclWinNotify.c b/win/tclWinNotify.c index 2ab4efa..022c7f4 100644 --- a/win/tclWinNotify.c +++ b/win/tclWinNotify.c @@ -103,7 +103,7 @@ Tcl_InitNotifier(void) clazz.style = 0; clazz.cbClsExtra = 0; clazz.cbWndExtra = 0; - clazz.hInstance = TclWinGetTclInstance(); + clazz.hInstance = (HINSTANCE)TclWinGetTclInstance(); clazz.hbrBackground = NULL; clazz.lpszMenuName = NULL; clazz.lpszClassName = className; @@ -195,7 +195,7 @@ Tcl_FinalizeNotifier( if (notifierCount) { notifierCount--; if (notifierCount == 0) { - UnregisterClassW(className, TclWinGetTclInstance()); + UnregisterClassW(className, (HINSTANCE)TclWinGetTclInstance()); } } LeaveCriticalSection(¬ifierMutex); @@ -360,7 +360,7 @@ Tcl_ServiceModeHook( if (mode == TCL_SERVICE_ALL && !tsdPtr->hwnd) { tsdPtr->hwnd = CreateWindowW(className, className, - WS_TILED, 0, 0, 0, 0, NULL, NULL, TclWinGetTclInstance(), + WS_TILED, 0, 0, 0, 0, NULL, NULL, (HINSTANCE)TclWinGetTclInstance(), NULL); /* diff --git a/win/tclWinSock.c b/win/tclWinSock.c index 0bdb499..a02e846 100644 --- a/win/tclWinSock.c +++ b/win/tclWinSock.c @@ -2485,7 +2485,7 @@ InitSockets(void) windowClass.style = 0; windowClass.cbClsExtra = 0; windowClass.cbWndExtra = 0; - windowClass.hInstance = TclWinGetTclInstance(); + windowClass.hInstance = (HINSTANCE)TclWinGetTclInstance(); windowClass.hbrBackground = NULL; windowClass.lpszMenuName = NULL; windowClass.lpszClassName = className; @@ -2616,7 +2616,7 @@ SocketExitHandler( */ TclpFinalizeSockets(); - UnregisterClassW(className, TclWinGetTclInstance()); + UnregisterClassW(className, (HINSTANCE)TclWinGetTclInstance()); initialized = 0; Tcl_MutexUnlock(&socketMutex); } -- cgit v0.12 From 6e29f3da25b3a8130905e992528fda0b9c12f8e1 Mon Sep 17 00:00:00 2001 From: dgp Date: Tue, 31 Mar 2020 16:21:11 +0000 Subject: Missed one int -> size_t in the merge. --- generic/tclBinary.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generic/tclBinary.c b/generic/tclBinary.c index d013076..0e1e54e 100644 --- a/generic/tclBinary.c +++ b/generic/tclBinary.c @@ -2879,7 +2879,7 @@ BinaryEncodeUu( objv[i + 1], &wrapcharlen); { const unsigned char *p = wrapchar; - int numBytes = wrapcharlen; + size_t numBytes = wrapcharlen; while (numBytes) { switch (*p) { -- cgit v0.12 From f47fbe763af41b982b9233bca58795cd34b2c259 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Mon, 6 Apr 2020 13:24:34 +0000 Subject: Fix build with --enable-symbols=mem --- generic/tclCkalloc.c | 62 +++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 57 insertions(+), 5 deletions(-) diff --git a/generic/tclCkalloc.c b/generic/tclCkalloc.c index 6efef86..e37d0b8 100644 --- a/generic/tclCkalloc.c +++ b/generic/tclCkalloc.c @@ -20,7 +20,9 @@ #define FALSE 0 #define TRUE 1 +#undef Tcl_Alloc #undef Tcl_Free +#undef Tcl_Realloc #undef Tcl_AttemptAlloc #undef Tcl_AttemptRealloc @@ -690,7 +692,7 @@ Tcl_DbCkrealloc( if (copySize > memp->length) { copySize = memp->length; } - newPtr = Tcl_DbCkalloc(size, file, line); + newPtr = (char *)Tcl_DbCkalloc(size, file, line); memcpy(newPtr, ptr, copySize); Tcl_DbCkfree(ptr, file, line); return newPtr; @@ -721,7 +723,7 @@ Tcl_AttemptDbCkrealloc( if (copySize > memp->length) { copySize = memp->length; } - newPtr = Tcl_AttemptDbCkalloc(size, file, line); + newPtr = (char *)Tcl_AttemptDbCkalloc(size, file, line); if (newPtr == NULL) { return NULL; } @@ -734,6 +736,59 @@ Tcl_AttemptDbCkrealloc( /* *---------------------------------------------------------------------- * + * Tcl_Alloc, et al. -- + * + * These functions are defined in terms of the debugging versions when + * TCL_MEM_DEBUG is set. + * + * Results: + * Same as the debug versions. + * + * Side effects: + * Same as the debug versions. + * + *---------------------------------------------------------------------- + */ + +void * +Tcl_Alloc( + size_t size) +{ + return Tcl_DbCkalloc(size, "unknown", 0); +} + +void * +Tcl_AttemptAlloc( + size_t size) +{ + return Tcl_AttemptDbCkalloc(size, "unknown", 0); +} + +void +Tcl_Free( + void *ptr) +{ + Tcl_DbCkfree(ptr, "unknown", 0); +} + +void * +Tcl_Realloc( + void *ptr, + size_t size) +{ + return Tcl_DbCkrealloc(ptr, size, "unknown", 0); +} +void * +Tcl_AttemptRealloc( + void *ptr, + size_t size) +{ + return Tcl_AttemptDbCkrealloc(ptr, size, "unknown", 0); +} + +/* + *---------------------------------------------------------------------- + * * MemoryCmd -- * * Implements the Tcl "memory" command, which provides Tcl-level control @@ -992,7 +1047,6 @@ Tcl_InitMemory( *---------------------------------------------------------------------- */ -#undef Tcl_Alloc void * Tcl_Alloc( size_t size) @@ -1069,7 +1123,6 @@ Tcl_AttemptDbCkalloc( *---------------------------------------------------------------------- */ -#undef Tcl_Realloc void * Tcl_Realloc( void *ptr, @@ -1141,7 +1194,6 @@ Tcl_AttemptDbCkrealloc( *---------------------------------------------------------------------- */ -#undef Tcl_Free void Tcl_Free( void *ptr) -- cgit v0.12 From 3a2ad288cae5e522cfc2797e0d10c81746ed20d0 Mon Sep 17 00:00:00 2001 From: dgp Date: Tue, 14 Apr 2020 15:57:08 +0000 Subject: Remove test not suitable for Tcl 9. --- tests/encoding.test | 5 ----- 1 file changed, 5 deletions(-) diff --git a/tests/encoding.test b/tests/encoding.test index 5c1ea6c..f21fd0e 100644 --- a/tests/encoding.test +++ b/tests/encoding.test @@ -326,11 +326,6 @@ test encoding-15.3.b {UtfToUtfProc null character input} testbytestring { binary scan [testbytestring $y] H* z set z } 00 -test encoding-15.3.c {UtfToUtfProc null character input} { - set y [encoding convertfrom utf-8 [encoding convertto utf-8 \u0000]] - binary scan [encoding convertto identity $y] H* z - set z -} c080 test encoding-15.4 {UtfToUtfProc emoji character input} -body { set x \xED\xA0\xBD\xED\xB8\x82 set y [encoding convertfrom utf-8 \xED\xA0\xBD\xED\xB8\x82] -- cgit v0.12 From fc7ca4202ee105ad3bbd576d2a3bf2e5d5793825 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Mon, 20 Apr 2020 21:07:35 +0000 Subject: Change a few variables from type "int" to "size_t". Always test TCL_UTF_MAX for <= 3 or > 3, because that's the only 2 flavours we really have. --- generic/tclDisassemble.c | 2 +- generic/tclObj.c | 4 ++-- generic/tclUtf.c | 6 +++--- macosx/tclMacOSXFCmd.c | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/generic/tclDisassemble.c b/generic/tclDisassemble.c index 49904bd..85a17b0 100644 --- a/generic/tclDisassemble.c +++ b/generic/tclDisassemble.c @@ -832,7 +832,7 @@ UpdateStringOfInstName( if (inst > LAST_INST_OPCODE) { dst = Tcl_InitStringRep(objPtr, NULL, TCL_INTEGER_SPACE + 5); - TclOOM(dst, TCL_INTEGER_SPACE + 5); + TclOOM(dst, (size_t)TCL_INTEGER_SPACE + 5); sprintf(dst, "inst_%" TCL_Z_MODIFIER "u", inst); (void) Tcl_InitStringRep(objPtr, NULL, strlen(dst)); } else { diff --git a/generic/tclObj.c b/generic/tclObj.c index 7853507..8a628a7 100644 --- a/generic/tclObj.c +++ b/generic/tclObj.c @@ -2381,7 +2381,7 @@ UpdateStringOfDouble( { char *dst = Tcl_InitStringRep(objPtr, NULL, TCL_DOUBLE_SPACE); - TclOOM(dst, TCL_DOUBLE_SPACE + 1); + TclOOM(dst, (size_t)TCL_DOUBLE_SPACE + 1); Tcl_PrintDouble(NULL, objPtr->internalRep.doubleValue, dst); (void) Tcl_InitStringRep(objPtr, NULL, strlen(dst)); @@ -2494,7 +2494,7 @@ UpdateStringOfInt( { char *dst = Tcl_InitStringRep( objPtr, NULL, TCL_INTEGER_SPACE); - TclOOM(dst, TCL_INTEGER_SPACE + 1); + TclOOM(dst, (size_t)TCL_INTEGER_SPACE + 1); (void) Tcl_InitStringRep(objPtr, NULL, TclFormatInt(dst, objPtr->internalRep.wideValue)); } diff --git a/generic/tclUtf.c b/generic/tclUtf.c index 5b0c9e9..6e0a7db 100644 --- a/generic/tclUtf.c +++ b/generic/tclUtf.c @@ -344,7 +344,7 @@ Tcl_Char16ToUtfDString( * Tcl_UtfCharComplete() before calling this routine to ensure that * enough bytes remain in the string. * - * If TCL_UTF_MAX <= 4, special handling of Surrogate pairs is done: + * If TCL_UTF_MAX <= 3, special handling of Surrogate pairs is done: * For any UTF-8 string containing a character outside of the BMP, the * first call to this function will fill *chPtr with the high surrogate * and generate a return value of 1. Calling Tcl_UtfToUniChar again @@ -1031,13 +1031,13 @@ Tcl_UtfAtIndex( size_t index) /* The position of the desired character. */ { Tcl_UniChar ch = 0; -#if TCL_UTF_MAX <= 4 +#if TCL_UTF_MAX <= 3 size_t len = 0; #endif if (index != TCL_INDEX_NONE) { while (index--) { -#if TCL_UTF_MAX <= 4 +#if TCL_UTF_MAX <= 3 src += (len = TclUtfToUniChar(src, &ch)); #else src += TclUtfToUniChar(src, &ch); diff --git a/macosx/tclMacOSXFCmd.c b/macosx/tclMacOSXFCmd.c index 8dc3775..e00739a 100644 --- a/macosx/tclMacOSXFCmd.c +++ b/macosx/tclMacOSXFCmd.c @@ -693,7 +693,7 @@ UpdateStringOfOSType( Tcl_Obj *objPtr) /* OSType object whose string rep to * update. */ { - const int size = TCL_UTF_MAX * 4; + const size_t size = TCL_UTF_MAX * 4; char *dst = Tcl_InitStringRep(objPtr, NULL, size); OSType osType = (OSType) objPtr->internalRep.wideValue; int written = 0; -- cgit v0.12 From 4a86cf8b0011b3ea785b6e92ca8ab5aa5372a707 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Sun, 26 Apr 2020 15:30:12 +0000 Subject: Since Tcl_NumUtfChars() now can return a value of more that 32 bits .... --- generic/tclDisassemble.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/generic/tclDisassemble.c b/generic/tclDisassemble.c index 85a17b0..9cb899e 100644 --- a/generic/tclDisassemble.c +++ b/generic/tclDisassemble.c @@ -1194,10 +1194,10 @@ DisassembleByteCodeAsDicts( */ Tcl_DictObjPut(NULL, cmd, Tcl_NewStringObj("scriptfrom", -1), - Tcl_NewIntObj(Tcl_NumUtfChars(codePtr->source, + Tcl_NewWideIntObj(Tcl_NumUtfChars(codePtr->source, sourceOffset))); Tcl_DictObjPut(NULL, cmd, Tcl_NewStringObj("scriptto", -1), - Tcl_NewIntObj(Tcl_NumUtfChars(codePtr->source, + Tcl_NewWideIntObj(Tcl_NumUtfChars(codePtr->source, sourceOffset + sourceLength - 1))); Tcl_DictObjPut(NULL, cmd, Tcl_NewStringObj("script", -1), Tcl_NewStringObj(codePtr->source+sourceOffset, sourceLength)); -- cgit v0.12 From 2e6739312916740bb0300654d3e97bde5a10112d Mon Sep 17 00:00:00 2001 From: dgp Date: Mon, 27 Apr 2020 16:10:54 +0000 Subject: [a444889cbe] Quick fix to satisfy Travis. Might revise later. --- tests/utf.test | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/utf.test b/tests/utf.test index ad030f4..7a97db1 100644 --- a/tests/utf.test +++ b/tests/utf.test @@ -775,7 +775,7 @@ test utf-9.2 {Tcl_UtfAtIndex: index > 0} { test utf-9.3 {Tcl_UtfAtIndex: index = 0, Emoji} { string range \U1F600G 0 0 } "\U1F600" -test utf-9.4 {Tcl_UtfAtIndex: index > 0, Emoji} fullutf { +test utf-9.4 {Tcl_UtfAtIndex: index > 0, Emoji} ucs4 { string range \U1F600G 1 1 } {G} -- cgit v0.12 From fb50a7f7b52d70cb9a3f8b0225a988d5c83e92ef Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Sat, 6 Jun 2020 21:19:17 +0000 Subject: Fix Travis build for Windows in debug mode. --- win/tclWinPort.h | 1 + 1 file changed, 1 insertion(+) diff --git a/win/tclWinPort.h b/win/tclWinPort.h index c6ddf40..59ba138 100644 --- a/win/tclWinPort.h +++ b/win/tclWinPort.h @@ -485,6 +485,7 @@ typedef DWORD_PTR * PDWORD_PTR; #if defined(_MSC_VER) # pragma warning(disable:4146) # pragma warning(disable:4244) +# pragma warning(disable:4307) # if _MSC_VER >= 1400 # pragma warning(disable:4267) # pragma warning(disable:4996) -- cgit v0.12 From f2b9098a94578c0b0d0091a71f9a92231a1f5426 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Mon, 8 Jun 2020 20:02:28 +0000 Subject: Still ... need to disable C4305 on Win32 (32-bit only) --- win/tclWinPort.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/win/tclWinPort.h b/win/tclWinPort.h index c6ddf40..4f39e63 100644 --- a/win/tclWinPort.h +++ b/win/tclWinPort.h @@ -485,6 +485,9 @@ typedef DWORD_PTR * PDWORD_PTR; #if defined(_MSC_VER) # pragma warning(disable:4146) # pragma warning(disable:4244) +#if !defined(_WIN64) +# pragma warning(disable:4305) +#endif # if _MSC_VER >= 1400 # pragma warning(disable:4267) # pragma warning(disable:4996) -- cgit v0.12 From 97399b2494ad5212668ee6daac2929a4d48cee3f Mon Sep 17 00:00:00 2001 From: andy Date: Fri, 19 Jun 2020 06:06:07 +0000 Subject: Correct man page per [ad8df845fef2c76d95b9f1aaa4815f3b23d4c472] --- doc/lset.n | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/lset.n b/doc/lset.n index afc721f..fbcf7e4 100644 --- a/doc/lset.n +++ b/doc/lset.n @@ -116,6 +116,8 @@ The indicated return value also becomes the new value of \fIx\fR \fBlset\fR x {2 1} j \fI\(-> {a b c} {d e f} {g j i}\fR \fBlset\fR x {2 3} j + \fI\(-> {a b c} {d e f} {g h i j}\fR +\fBlset\fR x {2 4} j \fI\(-> list index out of range\fR .CE .PP -- cgit v0.12 From 326bd29be7c2d61536c5eaba30da96d47973c529 Mon Sep 17 00:00:00 2001 From: andy Date: Mon, 6 Jul 2020 00:22:26 +0000 Subject: Clarify index order --- doc/lsearch.n | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/lsearch.n b/doc/lsearch.n index c5dc98f..72c91dc 100644 --- a/doc/lsearch.n +++ b/doc/lsearch.n @@ -65,8 +65,8 @@ These options may be given with all matching styles. . Changes the result to be the list of all matching indices (or all matching values if \fB\-inline\fR is specified as well.) If indices are returned, the -indices will be in numeric order. If values are returned, the order of the -values will be the order of those values within the input \fIlist\fR. +indices will be in ascending numeric order. If values are returned, the order +of the values will be the order of those values within the input \fIlist\fR. .TP \fB\-inline\fR . -- cgit v0.12 From f78ef1eea29afd567e722620db2fbfe19400a154 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Fri, 21 Aug 2020 12:28:26 +0000 Subject: Fix [43b434812a]: Tcl 9.0 uses stat64() but not struct stat64 on Linux i686 --- generic/tcl.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/generic/tcl.h b/generic/tcl.h index d6de75d..1da4df8 100644 --- a/generic/tcl.h +++ b/generic/tcl.h @@ -325,6 +325,8 @@ typedef unsigned TCL_WIDE_INT_TYPE Tcl_WideUInt; struct {long long tv_sec;} st_mtim; struct {long long tv_sec;} st_ctim; } Tcl_StatBuf; +#elif defined(HAVE_STRUCT_STAT64) && !defined(__APPLE__) + typedef struct stat64 Tcl_StatBuf; #else typedef struct stat Tcl_StatBuf; #endif -- cgit v0.12 From 264c574c2318f22417646a35593e266af7053952 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Sat, 5 Sep 2020 22:10:31 +0000 Subject: ckfree -> Tcl_Free --- generic/tclInt.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generic/tclInt.h b/generic/tclInt.h index fc86c21..4632887 100644 --- a/generic/tclInt.h +++ b/generic/tclInt.h @@ -4912,7 +4912,7 @@ MODULE_SCOPE Tcl_PackageInitProc Procbodytest_SafeInit; #define TclCleanupCommandMacro(cmdPtr) \ if ((cmdPtr)->refCount-- <= 1) { \ - ckfree(cmdPtr);\ + Tcl_Free(cmdPtr);\ } /* -- cgit v0.12 From 278837f261adb88e6a802f3ebaf63e232c12e77f Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Fri, 11 Sep 2020 14:23:14 +0000 Subject: More usage for TclNewWideIntObjFromSize(), TCL_IO_FAILURE -> TCL_INDEX_NONE where appropriate --- generic/tclCmdIL.c | 2 +- generic/tclStringObj.c | 12 ++++-------- unix/tclUnixInit.c | 4 ++-- win/tclWinInit.c | 4 ++-- win/tclWinPipe.c | 4 ++-- 5 files changed, 11 insertions(+), 15 deletions(-) diff --git a/generic/tclCmdIL.c b/generic/tclCmdIL.c index c88b4d2..7bad8b5 100644 --- a/generic/tclCmdIL.c +++ b/generic/tclCmdIL.c @@ -3835,7 +3835,7 @@ Tcl_LsearchObjCmd( } Tcl_SetObjResult(interp, itemPtr); } else { - Tcl_SetObjResult(interp, Tcl_NewWideIntObj(index)); + Tcl_SetObjResult(interp, TclNewWideIntObjFromSize((size_t)index)); } } else if (index < 0) { /* diff --git a/generic/tclStringObj.c b/generic/tclStringObj.c index f9b2775..7ba20ec 100644 --- a/generic/tclStringObj.c +++ b/generic/tclStringObj.c @@ -3454,8 +3454,7 @@ TclStringFirst( size_t start) { size_t lh = 0, ln = Tcl_GetCharLength(needle); - Tcl_Obj *result; - size_t value = TCL_IO_FAILURE; + size_t value = TCL_INDEX_NONE; Tcl_UniChar *check, *end, *uh, *un; if (start == TCL_INDEX_NONE) { @@ -3532,8 +3531,7 @@ TclStringFirst( } } firstEnd: - TclNewIntObj(result, TclWideIntFromSize(value)); - return result; + return TclNewWideIntObjFromSize(value); } /* @@ -3561,8 +3559,7 @@ TclStringLast( size_t last) { size_t lh = 0, ln = Tcl_GetCharLength(needle); - Tcl_Obj *result; - size_t value = TCL_IO_FAILURE; + size_t value = TCL_INDEX_NONE; Tcl_UniChar *check, *uh, *un; if (ln == 0) { @@ -3619,8 +3616,7 @@ TclStringLast( check--; } lastEnd: - TclNewIntObj(result, TclWideIntFromSize(value)); - return result; + return TclNewWideIntObjFromSize(value); } /* diff --git a/unix/tclUnixInit.c b/unix/tclUnixInit.c index a0a2c30..98c37f5 100644 --- a/unix/tclUnixInit.c +++ b/unix/tclUnixInit.c @@ -988,7 +988,7 @@ TclpSetVariables( * * Results: * The return value is the index in environ of an entry with the name - * "name", or TCL_IO_FAILURE if there is no such entry. The integer at *lengthPtr is + * "name", or TCL_INDEX_NONE if there is no such entry. The integer at *lengthPtr is * filled in with the length of name (if a matching entry is found) or * the length of the environ array (if no matching entry is found). * @@ -1007,7 +1007,7 @@ TclpFindVariable( * entries in environ (for unsuccessful * searches). */ { - size_t i, result = TCL_IO_FAILURE; + size_t i, result = TCL_INDEX_NONE; const char *env, *p1, *p2; Tcl_DString envString; diff --git a/win/tclWinInit.c b/win/tclWinInit.c index f6c9f83..4726bb3 100644 --- a/win/tclWinInit.c +++ b/win/tclWinInit.c @@ -614,7 +614,7 @@ TclpSetVariables( * * Results: * The return value is the index in environ of an entry with the name - * "name", or TCL_IO_FAILURE if there is no such entry. The integer + * "name", or TCL_INDEX_NONE if there is no such entry. The integer * at *lengthPtr is filled in with the length of name (if a matching * entry is found) or the length of the environ array (if no * matching entry is found). @@ -637,7 +637,7 @@ TclpFindVariable( * entries in environ (for unsuccessful * searches). */ { - size_t i, length, result = TCL_IO_FAILURE; + size_t i, length, result = TCL_INDEX_NONE; const WCHAR *env; const char *p1, *p2; char *envUpper, *nameUpper; diff --git a/win/tclWinPipe.c b/win/tclWinPipe.c index d0fa84b..2576028 100644 --- a/win/tclWinPipe.c +++ b/win/tclWinPipe.c @@ -851,7 +851,7 @@ TclpCloseFile( * Results: * Returns the process id for the child process. If the pid was not known * by Tcl, either because the pid was not created by Tcl or the child - * process has already been reaped, TCL_IO_FAILURE is returned. + * process has already been reaped, TCL_INDEX_NONE is returned. * * Side effects: * None. @@ -875,7 +875,7 @@ TclpGetPid( } } Tcl_MutexUnlock(&pipeMutex); - return TCL_IO_FAILURE; + return TCL_INDEX_NONE; } /* -- cgit v0.12 From f0ab6a724c11e0e8083b6152c3968a147507c8b5 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Fri, 18 Sep 2020 08:33:51 +0000 Subject: New macro TclNewIndexObj() which does the same as TclNewWideIntObjFromSize() but optimized the same way as TclNewIntObj(). --- generic/tclCmdIL.c | 29 ++++++++++++++++++----------- generic/tclCmdMZ.c | 28 +++++++++++++++++----------- generic/tclExecute.c | 4 ++-- generic/tclInt.h | 29 ++++++++++++++--------------- generic/tclRegexp.c | 2 +- generic/tclScan.c | 2 +- generic/tclStringObj.c | 8 ++++++-- generic/tclTest.c | 8 ++++---- 8 files changed, 63 insertions(+), 47 deletions(-) diff --git a/generic/tclCmdIL.c b/generic/tclCmdIL.c index 7bad8b5..24e8f39 100644 --- a/generic/tclCmdIL.c +++ b/generic/tclCmdIL.c @@ -3518,7 +3518,8 @@ Tcl_LsearchObjCmd( if (allMatches || inlineReturn) { Tcl_ResetResult(interp); } else { - Tcl_SetObjResult(interp, Tcl_NewWideIntObj(-1)); + TclNewIndexObj(itemPtr, -1); + Tcl_SetObjResult(interp, itemPtr); } goto done; } @@ -3648,7 +3649,7 @@ Tcl_LsearchObjCmd( * our first match might not be the first occurrence. * Consider: 0 0 0 1 1 1 2 2 2 * - * To maintain consistancy with standard lsearch semantics, we + * To maintain consistency with standard lsearch semantics, we * must find the leftmost occurrence of the pattern in the * list. Thus we don't just stop searching here. This * variation means that a search always makes log n @@ -3806,10 +3807,12 @@ Tcl_LsearchObjCmd( } else if (returnSubindices) { int j; - itemPtr = TclNewWideIntObjFromSize(i+groupOffset); + TclNewIndexObj(itemPtr, i+groupOffset); for (j=0 ; jpayload.index; for (j = 0; j < groupSize; j++) { if (indices) { - objPtr = TclNewWideIntObjFromSize(idx + j - groupOffset); + TclNewIndexObj(objPtr, idx + j - groupOffset); newArray[i++] = objPtr; Tcl_IncrRefCount(objPtr); } else { @@ -4433,7 +4440,7 @@ Tcl_LsortObjCmd( } } else if (indices) { for (i=0; elementPtr != NULL ; elementPtr = elementPtr->nextPtr) { - objPtr = TclNewWideIntObjFromSize(elementPtr->payload.index); + TclNewIndexObj(objPtr, elementPtr->payload.index); newArray[i++] = objPtr; Tcl_IncrRefCount(objPtr); } diff --git a/generic/tclCmdMZ.c b/generic/tclCmdMZ.c index 738c6e5..43d8a8e 100644 --- a/generic/tclCmdMZ.c +++ b/generic/tclCmdMZ.c @@ -389,8 +389,8 @@ Tcl_RegexpObjCmd( end = TCL_INDEX_NONE; } - objs[0] = TclNewWideIntObjFromSize(start); - objs[1] = TclNewWideIntObjFromSize(end); + TclNewIndexObj(objs[0], start); + TclNewIndexObj(objs[1], end); newPtr = Tcl_NewListObj(2, objs); } else { @@ -1909,10 +1909,11 @@ StringIsCmd( */ str_is_done: - if ((result == 0) && (failVarObj != NULL) && - Tcl_ObjSetVar2(interp, failVarObj, NULL, TclNewWideIntObjFromSize(failat), - TCL_LEAVE_ERR_MSG) == NULL) { - return TCL_ERROR; + if ((result == 0) && (failVarObj != NULL)) { + TclNewIndexObj(objPtr, failat); + if (Tcl_ObjSetVar2(interp, failVarObj, NULL, objPtr, TCL_LEAVE_ERR_MSG) == NULL) { + return TCL_ERROR; + } } Tcl_SetObjResult(interp, Tcl_NewBooleanObj(result)); return TCL_OK; @@ -2506,6 +2507,7 @@ StringStartCmd( int ch; const char *p, *string; size_t numChars, length, cur, index; + Tcl_Obj *obj; if (objc != 3) { Tcl_WrongNumArgs(interp, 1, objv, "string index"); @@ -2545,7 +2547,8 @@ StringStartCmd( cur += 1; } } - Tcl_SetObjResult(interp, TclNewWideIntObjFromSize(cur)); + TclNewIndexObj(obj, cur); + Tcl_SetObjResult(interp, obj); return TCL_OK; } @@ -2576,6 +2579,7 @@ StringEndCmd( int ch; const char *p, *end, *string; size_t length, numChars, cur, index; + Tcl_Obj *obj; if (objc != 3) { Tcl_WrongNumArgs(interp, 1, objv, "string index"); @@ -2606,7 +2610,8 @@ StringEndCmd( } else { cur = numChars + 1; } - Tcl_SetObjResult(interp, TclNewWideIntObjFromSize(cur)); + TclNewIndexObj(obj, cur); + Tcl_SetObjResult(interp, obj); return TCL_OK; } @@ -3781,10 +3786,11 @@ TclNRSwitchObjCmd( Tcl_Obj *rangeObjAry[2]; if (info.matches[j].end + 1 > 1) { - rangeObjAry[0] = TclNewWideIntObjFromSize(info.matches[j].start); - rangeObjAry[1] = TclNewWideIntObjFromSize(info.matches[j].end-1); + TclNewIndexObj(rangeObjAry[0], info.matches[j].start); + TclNewIndexObj(rangeObjAry[1], info.matches[j].end-1); } else { - rangeObjAry[0] = rangeObjAry[1] = Tcl_NewWideIntObj(-1); + TclNewIndexObj(rangeObjAry[1], -1); + rangeObjAry[0] = rangeObjAry[1]; } /* diff --git a/generic/tclExecute.c b/generic/tclExecute.c index 40bb351..19bcc22 100644 --- a/generic/tclExecute.c +++ b/generic/tclExecute.c @@ -5034,7 +5034,7 @@ TEBCresume( case INST_STR_LEN: valuePtr = OBJ_AT_TOS; slength = Tcl_GetCharLength(valuePtr); - objResultPtr = TclNewWideIntObjFromSize(slength); + TclNewIntObj(objResultPtr, slength); TRACE(("\"%.20s\" => %" TCL_Z_MODIFIER "u\n", O2S(valuePtr), slength)); NEXT_INST_F(1, 1, 1); @@ -5178,7 +5178,7 @@ TEBCresume( fromIdx = TclGetInt4AtPtr(pc+1); toIdx = TclGetInt4AtPtr(pc+5); slength = Tcl_GetCharLength(valuePtr); - TRACE(("\"%.20s\" %" TCL_LL_MODIFIER "d %" TCL_LL_MODIFIER "d => ", O2S(valuePtr), TclWideIntFromSize(fromIdx), TclWideIntFromSize(toIdx))); + TRACE(("\"%.20s\" %d %d => ", O2S(valuePtr), (int)(fromIdx), (int)(toIdx))); /* Every range of an empty value is an empty value */ if (slength == 0) { diff --git a/generic/tclInt.h b/generic/tclInt.h index 839c4a5..04a1866 100644 --- a/generic/tclInt.h +++ b/generic/tclInt.h @@ -4810,6 +4810,17 @@ MODULE_SCOPE Tcl_PackageInitProc Procbodytest_SafeInit; TCL_DTRACE_OBJ_CREATE(objPtr); \ } while (0) +#define TclNewIndexObj(objPtr, w) \ + do { \ + TclIncrObjsAllocated(); \ + TclAllocObjStorage(objPtr); \ + (objPtr)->refCount = 0; \ + (objPtr)->bytes = NULL; \ + (objPtr)->internalRep.wideValue = (Tcl_WideInt)((w) + 1) - 1; \ + (objPtr)->typePtr = &tclIntType; \ + TCL_DTRACE_OBJ_CREATE(objPtr); \ + } while (0) + #define TclNewDoubleObj(objPtr, d) \ do { \ TclIncrObjsAllocated(); \ @@ -4835,6 +4846,9 @@ MODULE_SCOPE Tcl_PackageInitProc Procbodytest_SafeInit; #define TclNewIntObj(objPtr, w) \ (objPtr) = Tcl_NewWideIntObj(w) +#define TclNewIndexObj(objPtr, w) \ + (objPtr) = Tcl_NewWideIntObj((Tcl_WideInt)((w) + 1) - 1) + #define TclNewDoubleObj(objPtr, d) \ (objPtr) = Tcl_NewDoubleObj(d) @@ -5022,21 +5036,6 @@ MODULE_SCOPE Tcl_PackageInitProc Procbodytest_SafeInit; #endif /* TCL_MEM_DEBUG */ /* - * Macros to convert size_t to wide-int (and wide-int object) considering - * platform-related negative value ((size_t)-1), if wide-int and size_t - * have different dimensions (e. g. 32-bit platform). - */ - -#if (!defined(TCL_WIDE_INT_IS_LONG) || (LONG_MAX > UINT_MAX)) && (SIZE_MAX <= UINT_MAX) -# define TclWideIntFromSize(value) (((Tcl_WideInt)(((size_t)(value))+1))-1) -# define TclNewWideIntObjFromSize(value) \ - Tcl_NewWideIntObj(TclWideIntFromSize(value)) -#else -# define TclWideIntFromSize(value) ((Tcl_WideInt)(value)) -# define TclNewWideIntObjFromSize Tcl_NewWideIntObj -#endif - -/* * Support for Clang Static Analyzer */ diff --git a/generic/tclRegexp.c b/generic/tclRegexp.c index 068b701..f67fcee 100644 --- a/generic/tclRegexp.c +++ b/generic/tclRegexp.c @@ -676,7 +676,7 @@ TclRegAbout( */ TclNewObj(resultObj); - TclNewIntObj(infoObj, regexpPtr->re.re_nsub); + TclNewIndexObj(infoObj, regexpPtr->re.re_nsub); Tcl_ListObjAppendElement(NULL, resultObj, infoObj); /* diff --git a/generic/tclScan.c b/generic/tclScan.c index 6ca76c4..f018b14 100644 --- a/generic/tclScan.c +++ b/generic/tclScan.c @@ -1089,7 +1089,7 @@ Tcl_ScanObjCmd( if (code == TCL_OK) { if (underflow && (nconversions == 0)) { if (numVars) { - TclNewIntObj(objPtr, -1); + TclNewIndexObj(objPtr, -1); } else { if (objPtr) { Tcl_SetListObj(objPtr, 0, NULL); diff --git a/generic/tclStringObj.c b/generic/tclStringObj.c index 5a16b85..1471ce1 100644 --- a/generic/tclStringObj.c +++ b/generic/tclStringObj.c @@ -3456,6 +3456,7 @@ TclStringFirst( size_t lh = 0, ln = Tcl_GetCharLength(needle); size_t value = TCL_INDEX_NONE; Tcl_UniChar *check, *end, *uh, *un; + Tcl_Obj *obj; if (start == TCL_INDEX_NONE) { start = 0; @@ -3531,7 +3532,8 @@ TclStringFirst( } } firstEnd: - return TclNewWideIntObjFromSize(value); + TclNewIndexObj(obj, value); + return obj; } /* @@ -3561,6 +3563,7 @@ TclStringLast( size_t lh = 0, ln = Tcl_GetCharLength(needle); size_t value = TCL_INDEX_NONE; Tcl_UniChar *check, *uh, *un; + Tcl_Obj *obj; if (ln == 0) { /* @@ -3616,7 +3619,8 @@ TclStringLast( check--; } lastEnd: - return TclNewWideIntObjFromSize(value); + TclNewIndexObj(obj, value); + return obj; } /* diff --git a/generic/tclTest.c b/generic/tclTest.c index 3a5f0ef..fcd14b5 100644 --- a/generic/tclTest.c +++ b/generic/tclTest.c @@ -3905,7 +3905,7 @@ TestregexpObjCmd( varName = Tcl_GetString(objv[2]); TclRegExpRangeUniChar(regExpr, -1, &start, &end); - sprintf(resinfo, "%" TCL_LL_MODIFIER "d %" TCL_LL_MODIFIER "d", TclWideIntFromSize(start), TclWideIntFromSize(end-1)); + sprintf(resinfo, "%d %d", (int)start, (int)(end-1)); value = Tcl_SetVar2(interp, varName, NULL, resinfo, 0); if (value == NULL) { Tcl_AppendResult(interp, "couldn't set variable \"", @@ -3919,7 +3919,7 @@ TestregexpObjCmd( Tcl_RegExpGetInfo(regExpr, &info); varName = Tcl_GetString(objv[2]); - sprintf(resinfo, "%" TCL_LL_MODIFIER "d", TclWideIntFromSize(info.extendStart)); + sprintf(resinfo, "%d", (int)info.extendStart); value = Tcl_SetVar2(interp, varName, NULL, resinfo, 0); if (value == NULL) { Tcl_AppendResult(interp, "couldn't set variable \"", @@ -3967,8 +3967,8 @@ TestregexpObjCmd( end--; } - objs[0] = TclNewWideIntObjFromSize(start); - objs[1] = TclNewWideIntObjFromSize(end); + objs[0] = Tcl_NewIntObj(start); + objs[1] = Tcl_NewIntObj(end); newPtr = Tcl_NewListObj(2, objs); } else { -- cgit v0.12 From 57849b86a1aeba3bfaa8605ee966af4ad76eabbe Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Fri, 18 Sep 2020 23:05:34 +0000 Subject: Fix gcc warnings, compiling on 32-bit Linux --- generic/tclCmdMZ.c | 4 ++-- generic/tclListObj.c | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/generic/tclCmdMZ.c b/generic/tclCmdMZ.c index 43d8a8e..06bd0db 100644 --- a/generic/tclCmdMZ.c +++ b/generic/tclCmdMZ.c @@ -195,7 +195,7 @@ Tcl_RegexpObjCmd( if (++i >= objc) { goto endOfForLoop; } - if (TclGetIntForIndexM(interp, objv[i], WIDE_MAX - 1, &temp) != TCL_OK) { + if (TclGetIntForIndexM(interp, objv[i], (size_t)WIDE_MAX - 1, &temp) != TCL_OK) { goto optionError; } if (startIndex) { @@ -551,7 +551,7 @@ Tcl_RegsubObjCmd( if (++idx >= (size_t)objc) { goto endOfForLoop; } - if (TclGetIntForIndexM(interp, objv[idx], WIDE_MAX - 1, &temp) != TCL_OK) { + if (TclGetIntForIndexM(interp, objv[idx], (size_t)WIDE_MAX - 1, &temp) != TCL_OK) { goto optionError; } if (startIndex) { diff --git a/generic/tclListObj.c b/generic/tclListObj.c index 9918b64..3bba674 100644 --- a/generic/tclListObj.c +++ b/generic/tclListObj.c @@ -1246,7 +1246,7 @@ TclLindexList( ListGetIntRep(argPtr, listRepPtr); if ((listRepPtr == NULL) - && TclGetIntForIndexM(NULL , argPtr, WIDE_MAX - 1, &index) == TCL_OK) { + && TclGetIntForIndexM(NULL , argPtr, (size_t)WIDE_MAX - 1, &index) == TCL_OK) { /* * argPtr designates a single index. */ @@ -1352,7 +1352,7 @@ TclLindexFlat( */ while (++i < indexCount) { - if (TclGetIntForIndexM(interp, indexArray[i], WIDE_MAX - 1, &index) + if (TclGetIntForIndexM(interp, indexArray[i], (size_t)WIDE_MAX - 1, &index) != TCL_OK) { Tcl_DecrRefCount(sublistCopy); return NULL; @@ -1416,7 +1416,7 @@ TclLsetList( ListGetIntRep(indexArgPtr, listRepPtr); if (listRepPtr == NULL - && TclGetIntForIndexM(NULL, indexArgPtr, WIDE_MAX - 1, &index) == TCL_OK) { + && TclGetIntForIndexM(NULL, indexArgPtr, (size_t)WIDE_MAX - 1, &index) == TCL_OK) { /* * indexArgPtr designates a single index. */ -- cgit v0.12 From 7b7d6e211690e9884c7ef6189d5c1e4fe4c3e3ee Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Sun, 20 Sep 2020 08:59:39 +0000 Subject: Fix [bf58b04202]: compiler warning in tclEnv.c --- generic/tclEnv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generic/tclEnv.c b/generic/tclEnv.c index fc659f1..d0c59f0 100644 --- a/generic/tclEnv.c +++ b/generic/tclEnv.c @@ -772,7 +772,7 @@ TclFinalizeEnvironment(void) if (env.cache) { #ifdef PURIFY - int i; + size_t i; for (i = 0; i < env.cacheSize; i++) { Tcl_Free(env.cache[i]); } -- cgit v0.12 From 516be1cd2e22bd4585f3133ce2d2dc990dccff65 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Sun, 20 Sep 2020 09:05:38 +0000 Subject: Fix [9ffffcbeee]: compiler warnings in regcomp.c --- generic/regc_lex.c | 2 +- generic/regcomp.c | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/generic/regc_lex.c b/generic/regc_lex.c index a303ec6..0cd7dd6 100644 --- a/generic/regc_lex.c +++ b/generic/regc_lex.c @@ -894,7 +894,7 @@ lexescape( * Ugly heuristic (first test is "exactly 1 digit?") */ - if (v->now - save == 0 || ((int) c > 0 && (int)c <= v->nsubexp)) { + if (v->now - save == 0 || ((int) c > 0 && (size_t)c <= v->nsubexp)) { NOTE(REG_UBACKREF); RETV(BACKREF, (chr)c); } diff --git a/generic/regcomp.c b/generic/regcomp.c index 1aaaaed..33121a7 100644 --- a/generic/regcomp.c +++ b/generic/regcomp.c @@ -205,11 +205,11 @@ struct vars { int cflags; /* copy of compile flags */ int lasttype; /* type of previous token */ int nexttype; /* type of next token */ - int nextvalue; /* value (if any) of next token */ + size_t nextvalue; /* value (if any) of next token */ int lexcon; /* lexical context type (see lex.c) */ - int nsubexp; /* subexpression count */ + size_t nsubexp; /* subexpression count */ struct subre **subs; /* subRE pointer vector */ - int nsubs; /* length of vector */ + size_t nsubs; /* length of vector */ struct subre *sub10[10]; /* initial vector, enough for most */ struct nfa *nfa; /* the NFA */ struct colormap *cm; /* character color map */ @@ -222,7 +222,7 @@ struct vars { struct cvec *cv; /* interface cvec */ struct cvec *cv2; /* utility cvec */ struct subre *lacons; /* lookahead-constraint vector */ - int nlacons; /* size of lacons */ + size_t nlacons; /* size of lacons */ size_t spaceused; /* approx. space used for compilation */ }; @@ -287,7 +287,7 @@ compile( { AllocVars(v); struct guts *g; - int i, j; + size_t i, j; FILE *debug = (flags®_PROGRESS) ? stdout : NULL; #define CNOERR() { if (ISERR()) return freev(v, v->err); } @@ -410,7 +410,7 @@ compile( assert(v->nlacons == 0 || v->lacons != NULL); for (i = 1; i < v->nlacons; i++) { if (debug != NULL) { - fprintf(debug, "\n\n\n========= LA%d ==========\n", i); + fprintf(debug, "\n\n\n========= LA%" TCL_Z_MODIFIER "d ==========\n", i); } nfanode(v, &v->lacons[i], debug); } @@ -474,7 +474,7 @@ moresubs( size_t wanted) /* want enough room for this one */ { struct subre **p; - int n; + size_t n; assert(wanted > 0 && wanted >= v->nsubs); n = wanted * 3 / 2 + 1; @@ -794,7 +794,7 @@ parseqatom( struct subre *t; int cap; /* capturing parens? */ int pos; /* positive lookahead? */ - int subno; /* capturing-parens or backref number */ + size_t subno; /* capturing-parens or backref number */ int atomtype; int qprefer; /* quantifier short/long preference */ int f; -- cgit v0.12 From fb77f1148fc73f9da5350bc2f4681c62a5c3ec6a Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Sun, 20 Sep 2020 11:17:56 +0000 Subject: Default utf-8 for source command --- doc/FileSystem.3 | 4 ++-- generic/tclIOUtil.c | 36 ++++++++++++++++++------------------ 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/doc/FileSystem.3 b/doc/FileSystem.3 index 681e834..856a05d 100644 --- a/doc/FileSystem.3 +++ b/doc/FileSystem.3 @@ -414,7 +414,7 @@ caller (with a reference count of 0). the encoding identified by \fIencodingName\fR and evaluates its contents as a Tcl script. It returns the same information as \fBTcl_EvalObjEx\fR. -If \fIencodingName\fR is NULL, the system encoding is used for +If \fIencodingName\fR is NULL, the utf-8 encoding is used for reading the file contents. If the file could not be read then a Tcl error is returned to describe why the file could not be read. @@ -430,7 +430,7 @@ or which will be safely substituted by the Tcl interpreter into .QW ^Z . \fBTcl_FSEvalFile\fR is a simpler version of -\fBTcl_FSEvalFileEx\fR that always uses the system encoding +\fBTcl_FSEvalFileEx\fR that always uses utf-8 when reading the file. .PP \fBTcl_FSLoadFile\fR dynamically loads a binary code file into memory and diff --git a/generic/tclIOUtil.c b/generic/tclIOUtil.c index 3d6c47e..5811f62 100644 --- a/generic/tclIOUtil.c +++ b/generic/tclIOUtil.c @@ -1684,7 +1684,7 @@ Tcl_FSEvalFileEx( * Tilde-substitution is performed on this * pathname. */ const char *encodingName) /* Either the name of an encoding or NULL to - use the system encoding. */ + use the utf-8 encoding. */ { size_t length; int result = TCL_ERROR; @@ -1723,16 +1723,16 @@ Tcl_FSEvalFileEx( /* * If the encoding is specified, set the channel to that encoding. - * Otherwise don't touch it, leaving things up to the system encoding. If - * the encoding is unknown report an error. + * Otherwise use utf-8. */ - if (encodingName != NULL) { - if (Tcl_SetChannelOption(interp, chan, "-encoding", encodingName) - != TCL_OK) { - Tcl_CloseEx(interp,chan,0); - return result; - } + if (encodingName == NULL) { + encodingName = "utf-8"; + } + if (Tcl_SetChannelOption(interp, chan, "-encoding", encodingName) + != TCL_OK) { + Tcl_CloseEx(interp,chan,0); + return result; } TclNewObj(objPtr); @@ -1822,7 +1822,7 @@ TclNREvalFile( * evaluate. Tilde-substitution is performed on * this pathname. */ const char *encodingName) /* The name of an encoding to use, or NULL to - * use the system encoding. */ + * use the utf-8 encoding. */ { Tcl_StatBuf statBuf; Tcl_Obj *oldScriptFile, *objPtr; @@ -1859,16 +1859,16 @@ TclNREvalFile( /* * If the encoding is specified, set the channel to that encoding. - * Otherwise don't touch it, leaving things up to the system encoding. If - * the encoding is unknown report an error. + * Otherwise use utf-8. */ - if (encodingName != NULL) { - if (Tcl_SetChannelOption(interp, chan, "-encoding", encodingName) - != TCL_OK) { - Tcl_CloseEx(interp, chan, 0); - return TCL_ERROR; - } + if (encodingName == NULL) { + encodingName = "utf-8"; + } + if (Tcl_SetChannelOption(interp, chan, "-encoding", encodingName) + != TCL_OK) { + Tcl_CloseEx(interp, chan, 0); + return TCL_ERROR; } TclNewObj(objPtr); -- cgit v0.12 From abc23e672315cb78ec468f0d96c592d0ea346ac9 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Thu, 24 Sep 2020 12:54:15 +0000 Subject: TCL_CFGVAL_ENCODING now defaults to "utf-8" as well. No explicit "-encoding utf-8" for "source" any more, since that's the default --- doc/InitSubSyst.3 | 4 ++-- library/clock.tcl | 2 +- library/init.tcl | 4 ++-- library/tm.tcl | 2 +- tests/source.test | 6 +++--- unix/README | 2 +- unix/configure | 4 ++-- unix/tcl.m4 | 4 ++-- unix/tclUnixInit.c | 2 +- win/configure | 3 +-- win/tcl.m4 | 3 +-- 11 files changed, 17 insertions(+), 19 deletions(-) diff --git a/doc/InitSubSyst.3 b/doc/InitSubSyst.3 index 3c138a4..7551145 100644 --- a/doc/InitSubSyst.3 +++ b/doc/InitSubSyst.3 @@ -23,9 +23,9 @@ first thing in the application's main program. .PP \fBTcl_InitSubsystems\fR is very similar in use to \fBTcl_FindExecutable\fR. It can be used when Tcl is -used as utility library, no other encodings than utf8, +used as utility library, no other encodings than utf-8, iso8859-1 or unicode are used, and no interest exists in the value of \fBinfo nameofexecutable\fR. The system encoding will not -be extracted from the environment, but falls back to iso8859-1. +be extracted from the environment, but falls back to utf-8. .SH KEYWORDS binary, executable file diff --git a/library/clock.tcl b/library/clock.tcl index 2e42a98..54919f2 100644 --- a/library/clock.tcl +++ b/library/clock.tcl @@ -3314,7 +3314,7 @@ proc ::tcl::clock::LoadTimeZoneFile { fileName } { "time zone \":$fileName\" not valid" } try { - source -encoding utf-8 [file join $DataDir $fileName] + source [file join $DataDir $fileName] } on error {} { return -code error \ -errorcode [list CLOCK badTimeZone :$fileName] \ diff --git a/library/init.tcl b/library/init.tcl index a13d3eb..f73d9e2 100644 --- a/library/init.tcl +++ b/library/init.tcl @@ -112,7 +112,7 @@ if {[interp issafe]} { foreach cmd {add format scan} { proc ::tcl::clock::$cmd args { variable TclLibDir - source -encoding utf-8 [file join $TclLibDir clock.tcl] + source [file join $TclLibDir clock.tcl] return [uplevel 1 [info level 0]] } } @@ -442,7 +442,7 @@ proc auto_load_index {} { continue } else { set error [catch { - fconfigure $f -encoding utf-8 -eofchar \032 + fconfigure $f -eofchar \032 set id [gets $f] if {$id eq "# Tcl autoload index file, version 2.0"} { eval [read $f] diff --git a/library/tm.tcl b/library/tm.tcl index c60084c..3c0ec22 100644 --- a/library/tm.tcl +++ b/library/tm.tcl @@ -267,7 +267,7 @@ proc ::tcl::tm::UnknownHandler {original name args} { # of the package file is the last element in the list. package ifneeded $pkgname $pkgversion \ - "[::list package provide $pkgname $pkgversion];[::list source -encoding utf-8 $file]" + "[::list package provide $pkgname $pkgversion];[::list source $file]" # We abort in this unknown handler only if we got a # satisfying candidate for the requested package. diff --git a/tests/source.test b/tests/source.test index c6cccd6..378d62e 100644 --- a/tests/source.test +++ b/tests/source.test @@ -114,7 +114,7 @@ test source-2.7 {utf-8 with BOM} -setup { puts $out "\ufeffset y new-y" close $out set y old-y - source -encoding utf-8 $sourcefile + source $sourcefile return $y } -cleanup { removeFile $sourcefile @@ -226,7 +226,7 @@ test source-7.1 {source -encoding test} -setup { close $f } -body { set x unset - source -encoding utf-8 $sourcefile + source $sourcefile set x } -cleanup { removeFile source.file @@ -269,7 +269,7 @@ test source-7.5 {source -encoding: correct operation} -setup { puts $f "proc \u20ac {} {return foo}" close $f } -body { - source -encoding utf-8 $sourcefile + source $sourcefile \u20ac } -cleanup { removeFile source.file diff --git a/unix/README b/unix/README index 3340dc6..3c1a207 100644 --- a/unix/README +++ b/unix/README @@ -91,7 +91,7 @@ How To Compile And Install Tcl: for descriptions of the probes made available, see http://wiki.tcl.tk/DTrace for more details --with-encoding=ENCODING Specifies the encoding for compile-time - configuration values. Defaults to iso8859-1, + configuration values. Defaults to utf-8, which is also sufficient for ASCII. --with-tzdata=FLAG Specifies whether to install timezone data. By default, the configure script tries to detect diff --git a/unix/configure b/unix/configure index 464e320..de45627 100755 --- a/unix/configure +++ b/unix/configure @@ -1430,7 +1430,7 @@ Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-encoding encoding for configuration values (default: - iso8859-1) + utf-8) --with-system-libtommath use external libtommath (default: true if available, false otherwise) @@ -3982,7 +3982,7 @@ _ACEOF else -$as_echo "#define TCL_CFGVAL_ENCODING \"iso8859-1\"" >>confdefs.h +$as_echo "#define TCL_CFGVAL_ENCODING \"utf-8\"" >>confdefs.h fi diff --git a/unix/tcl.m4 b/unix/tcl.m4 index bd22cc8..4cd1d53 100644 --- a/unix/tcl.m4 +++ b/unix/tcl.m4 @@ -2445,14 +2445,14 @@ AC_DEFUN([SC_TCL_64BIT_FLAGS], [ AC_DEFUN([SC_TCL_CFG_ENCODING], [ AC_ARG_WITH(encoding, AC_HELP_STRING([--with-encoding], - [encoding for configuration values (default: iso8859-1)]), + [encoding for configuration values (default: utf-8)]), with_tcencoding=${withval}) if test x"${with_tcencoding}" != x ; then AC_DEFINE_UNQUOTED(TCL_CFGVAL_ENCODING,"${with_tcencoding}", [What encoding should be used for embedded configuration info?]) else - AC_DEFINE(TCL_CFGVAL_ENCODING,"iso8859-1", + AC_DEFINE(TCL_CFGVAL_ENCODING,"utf-8", [What encoding should be used for embedded configuration info?]) fi ]) diff --git a/unix/tclUnixInit.c b/unix/tclUnixInit.c index 98c37f5..e88b084 100644 --- a/unix/tclUnixInit.c +++ b/unix/tclUnixInit.c @@ -92,7 +92,7 @@ typedef struct { */ #ifndef TCL_DEFAULT_ENCODING -#define TCL_DEFAULT_ENCODING "iso8859-1" +#define TCL_DEFAULT_ENCODING "utf-8" #endif /* diff --git a/win/configure b/win/configure index c07092b..0ac7710 100755 --- a/win/configure +++ b/win/configure @@ -3747,8 +3747,7 @@ fi _ACEOF else - # Default encoding on windows is not "iso8859-1" - $as_echo "#define TCL_CFGVAL_ENCODING \"cp1252\"" >>confdefs.h + $as_echo "#define TCL_CFGVAL_ENCODING \"utf-8\"" >>confdefs.h fi diff --git a/win/tcl.m4 b/win/tcl.m4 index 0553760..a7276b9 100644 --- a/win/tcl.m4 +++ b/win/tcl.m4 @@ -1085,8 +1085,7 @@ AC_DEFUN([SC_TCL_CFG_ENCODING], [ if test x"${with_tcencoding}" != x ; then AC_DEFINE_UNQUOTED(TCL_CFGVAL_ENCODING,"${with_tcencoding}") else - # Default encoding on windows is not "iso8859-1" - AC_DEFINE(TCL_CFGVAL_ENCODING,"cp1252") + AC_DEFINE(TCL_CFGVAL_ENCODING,"utf-8") fi ]) -- cgit v0.12 From 29577449a18c6d97285f1f6ba67a00f7c00d2792 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Fri, 25 Sep 2020 14:17:14 +0000 Subject: Use utf-8 as default encoding for configuration information --- unix/README | 2 +- unix/configure | 4 ++-- unix/tcl.m4 | 4 ++-- win/configure | 3 +-- win/makefile.vc | 2 +- win/rules.vc | 2 +- win/tcl.m4 | 3 +-- 7 files changed, 9 insertions(+), 11 deletions(-) diff --git a/unix/README b/unix/README index 3340dc6..3c1a207 100644 --- a/unix/README +++ b/unix/README @@ -91,7 +91,7 @@ How To Compile And Install Tcl: for descriptions of the probes made available, see http://wiki.tcl.tk/DTrace for more details --with-encoding=ENCODING Specifies the encoding for compile-time - configuration values. Defaults to iso8859-1, + configuration values. Defaults to utf-8, which is also sufficient for ASCII. --with-tzdata=FLAG Specifies whether to install timezone data. By default, the configure script tries to detect diff --git a/unix/configure b/unix/configure index d3a4856..d48d687 100755 --- a/unix/configure +++ b/unix/configure @@ -1430,7 +1430,7 @@ Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-encoding encoding for configuration values (default: - iso8859-1) + utf-8) --with-system-libtommath use external libtommath (default: true if available, false otherwise) @@ -3982,7 +3982,7 @@ _ACEOF else -$as_echo "#define TCL_CFGVAL_ENCODING \"iso8859-1\"" >>confdefs.h +$as_echo "#define TCL_CFGVAL_ENCODING \"utf-8\"" >>confdefs.h fi diff --git a/unix/tcl.m4 b/unix/tcl.m4 index 056cf1f..a4824ff 100644 --- a/unix/tcl.m4 +++ b/unix/tcl.m4 @@ -2445,14 +2445,14 @@ AC_DEFUN([SC_TCL_64BIT_FLAGS], [ AC_DEFUN([SC_TCL_CFG_ENCODING], [ AC_ARG_WITH(encoding, AC_HELP_STRING([--with-encoding], - [encoding for configuration values (default: iso8859-1)]), + [encoding for configuration values (default: utf-8)]), with_tcencoding=${withval}) if test x"${with_tcencoding}" != x ; then AC_DEFINE_UNQUOTED(TCL_CFGVAL_ENCODING,"${with_tcencoding}", [What encoding should be used for embedded configuration info?]) else - AC_DEFINE(TCL_CFGVAL_ENCODING,"iso8859-1", + AC_DEFINE(TCL_CFGVAL_ENCODING,"utf-8", [What encoding should be used for embedded configuration info?]) fi ]) diff --git a/win/configure b/win/configure index f099510..b08eb15 100755 --- a/win/configure +++ b/win/configure @@ -3749,8 +3749,7 @@ fi _ACEOF else - # Default encoding on windows is not "iso8859-1" - $as_echo "#define TCL_CFGVAL_ENCODING \"cp1252\"" >>confdefs.h + $as_echo "#define TCL_CFGVAL_ENCODING \"utf-8\"" >>confdefs.h fi diff --git a/win/makefile.vc b/win/makefile.vc index e3de98e..0edeac1 100644 --- a/win/makefile.vc +++ b/win/makefile.vc @@ -116,7 +116,7 @@ # # CFG_ENCODING=encoding # name of encoding for configuration information. Defaults -# to cp1252 +# to utf-8 # # Examples: # c:\tcl_src\win\>nmake -f makefile.vc release diff --git a/win/rules.vc b/win/rules.vc index 61df910..33d6075 100644 --- a/win/rules.vc +++ b/win/rules.vc @@ -504,7 +504,7 @@ _VC_MANIFEST_EMBED_DLL=if exist $@.manifest mt -nologo -manifest $@.manifest -ou !endif !ifndef CFG_ENCODING -CFG_ENCODING = \"cp1252\" +CFG_ENCODING = \"utf-8\" !endif ################################################################ diff --git a/win/tcl.m4 b/win/tcl.m4 index 4824e8e..0fd2271 100644 --- a/win/tcl.m4 +++ b/win/tcl.m4 @@ -1085,8 +1085,7 @@ AC_DEFUN([SC_TCL_CFG_ENCODING], [ if test x"${with_tcencoding}" != x ; then AC_DEFINE_UNQUOTED(TCL_CFGVAL_ENCODING,"${with_tcencoding}") else - # Default encoding on windows is not "iso8859-1" - AC_DEFINE(TCL_CFGVAL_ENCODING,"cp1252") + AC_DEFINE(TCL_CFGVAL_ENCODING,"utf-8") fi ]) -- cgit v0.12 From f3ae2684eb9584f9f0ca5e6bdcaabd75347e3224 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Thu, 15 Oct 2020 09:19:29 +0000 Subject: Something strange going on on Travis with (long-gone) safe-stock86.test --- .travis.yml | 1 + tests/safe.test | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 8712ebf..2630474 100644 --- a/.travis.yml +++ b/.travis.yml @@ -361,6 +361,7 @@ jobs: script: - make dist before_install: + - rm -rf tests/safe-stock8*.test - touch generic/tclStubInit.c generic/tclOOStubInit.c - cd ${BUILD_DIR} install: diff --git a/tests/safe.test b/tests/safe.test index b91da86..1c27c1e 100644 --- a/tests/safe.test +++ b/tests/safe.test @@ -13,7 +13,7 @@ # - Tests 5.* test the example packages themselves before they # are used to test Safe Base interpreters. # - Alternative tests using stock packages of Tcl 8.6 are in file -# safe-stock86.test. +# safe-stock.test. # # Copyright (c) 1995-1996 Sun Microsystems, Inc. # Copyright (c) 1998-1999 by Scriptics Corporation. @@ -170,7 +170,7 @@ test safe-4.6 {safe::interpDelete, indirectly} -setup { a eval exit } -result "" -# The old test "safe-5.1" has been moved to "safe-stock86-9.8". +# The old test "safe-5.1" has been moved to "safe-stock-9.8". # A replacement test using example files is "safe-9.8". # Tests 5.* test the example files before using them to test safe interpreters. -- cgit v0.12 From 59a788a6c454bbc917cee3d29d17bcec03e0eefc Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Thu, 15 Oct 2020 11:02:21 +0000 Subject: Fix [53d5155335]: Typo in interp.n --- doc/interp.n | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/interp.n b/doc/interp.n index bfbf9fd..1127632 100644 --- a/doc/interp.n +++ b/doc/interp.n @@ -58,7 +58,7 @@ kernel call) between a child interpreter and its parent. See \fBALIAS INVOCATION\fR, below, for more details on how the alias mechanism works. .PP -A qualified interpreter name is a proper Tcl lists containing a subset of its +A qualified interpreter name is a proper Tcl list containing a subset of its ancestors in the interpreter hierarchy, terminated by the string naming the interpreter in its immediate parent. Interpreter names are relative to the interpreter in which they are used. For example, if -- cgit v0.12 From 546165585c006c1b86a25fbc88ee6843ba15dffb Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Thu, 15 Oct 2020 13:05:20 +0000 Subject: Remove use of CFG_ENCODING from rules.vc/makefile.vc: It will become obsolete with TIP #587. In stead, move the default handling to tclPkgConfig.c for now --- generic/tclPkgConfig.c | 8 ++++++++ win/makefile.vc | 4 ---- win/rules.vc | 11 ++--------- 3 files changed, 10 insertions(+), 13 deletions(-) diff --git a/generic/tclPkgConfig.c b/generic/tclPkgConfig.c index 466d535..727e872 100644 --- a/generic/tclPkgConfig.c +++ b/generic/tclPkgConfig.c @@ -35,6 +35,14 @@ #include "tclInt.h" +#ifndef TCL_CFGVAL_ENCODING +# ifdef _WIN32 +# define TCL_CFGVAL_ENCODING "cp1252" +# else +# define TCL_CFGVAL_ENCODING "iso8859-1" +# endif +#endif + /* * Use C preprocessor statements to define the various values for the embedded * configuration information. diff --git a/win/makefile.vc b/win/makefile.vc index acdb3a6..99cae58 100644 --- a/win/makefile.vc +++ b/win/makefile.vc @@ -114,10 +114,6 @@ # TESTPAT= # Reads the tests requested to be run from this file. # -# CFG_ENCODING=encoding -# name of encoding for configuration information. Defaults -# to cp1252 -# # Examples: # c:\tcl_src\win\>nmake -f makefile.vc release # c:\tcl_src\win\>nmake -f makefile.vc test diff --git a/win/rules.vc b/win/rules.vc index 6dca6d9..f3e5439 100644 --- a/win/rules.vc +++ b/win/rules.vc @@ -415,9 +415,6 @@ _INSTALLDIR=$(_INSTALLDIR)\lib # NATIVE_ARCH - set to IX86 or AMD64 for the host machine # MACHINE - same as $(ARCH) - legacy # _VC_MANIFEST_EMBED_{DLL,EXE} - commands for embedding a manifest if needed -# CFG_ENCODING - set to an character encoding. -# TBD - this is passed to compiler as TCL_CFGVAL_ENCODING but can't -# see where it is used cc32 = $(CC) # built-in default. link32 = link @@ -503,10 +500,6 @@ _VC_MANIFEST_EMBED_EXE=if exist $@.manifest mt -nologo -manifest $@.manifest -ou _VC_MANIFEST_EMBED_DLL=if exist $@.manifest mt -nologo -manifest $@.manifest -outputresource:$@;2 !endif -!ifndef CFG_ENCODING -CFG_ENCODING = \"cp1252\" -!endif - ################################################################ # 4. Build the nmakehlp program # This is a helper app we need to overcome nmake's limiting @@ -1043,7 +1036,7 @@ BUILDDIRTOP =$(BUILDDIRTOP)_$(MACHINE) BUILDDIRTOP =$(BUILDDIRTOP)_VC$(VCVER) !endif -!if !$(DEBUG) || $(DEBUG) && $(UNCHECKED) +!if !$(DEBUG) || $(TCL_VERSION) > 86 || $(DEBUG) && $(UNCHECKED) SUFX = $(SUFX:g=) !endif @@ -1292,7 +1285,7 @@ INCLUDE_INSTALL_DIR = $(_INSTALLDIR)\..\include # baselibs - minimum Windows libraries required. Parent makefile can # define PRJ_LIBS before including rules.rc if additional libs are needed -OPTDEFINES = /DTCL_CFGVAL_ENCODING=$(CFG_ENCODING) /DSTDC_HEADERS +OPTDEFINES = /DSTDC_HEADERS !if $(VCVERSION) >= 1600 OPTDEFINES = $(OPTDEFINES) /DHAVE_STDINT_H=1 !else -- cgit v0.12 From 69875ee99d8bc12504eab91f901bd8bfc9272afa Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Fri, 16 Oct 2020 15:03:08 +0000 Subject: Fix env.test when running under wine on Linux. Mark other tests with "notWine", which fail currently under wine --- tests/cmdAH.test | 5 +++-- tests/env.test | 4 +++- tests/fCmd.test | 41 +++++++++++++++++++++-------------------- tests/fileName.test | 37 +++++++++++++++++++------------------ tests/registry.test | 5 +++-- tests/socket.test | 11 ++++++----- tests/winDde.test | 3 ++- tests/winFCmd.test | 37 +++++++++++++++++++------------------ tests/winFile.test | 7 ++++--- tests/winPipe.test | 17 ++++++++++------- 10 files changed, 90 insertions(+), 77 deletions(-) diff --git a/tests/cmdAH.test b/tests/cmdAH.test index e1fd920..8f01816 100644 --- a/tests/cmdAH.test +++ b/tests/cmdAH.test @@ -30,6 +30,7 @@ testConstraint linkDirectory [expr { ($::tcl_platform(osVersion) >= 5.0 && [lindex [file system [temporaryDirectory]] 1] eq "NTFS") }] +testConstraint notWine [expr {$::tcl_platform(platform) ne "windows" || ![info exists ::env(TRAVIS_OS_NAME)] || ![string match linux $::env(TRAVIS_OS_NAME)]}] global env set cmdAHwd [pwd] @@ -1348,7 +1349,7 @@ 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 { +test cmdAH-25.3.1 {Tcl_FileObjCmd: owned} -constraints {win notWine} -body { if {[info exists env(SystemRoot)]} { file owned $env(SystemRoot) } else { @@ -1538,7 +1539,7 @@ test cmdAH-29.4 {Tcl_FileObjCmd: type} -constraints {unix} -setup { } -cleanup { file delete $linkfile } -result link -test cmdAH-29.4.1 {Tcl_FileObjCmd: type} -constraints {linkDirectory} -setup { +test cmdAH-29.4.1 {Tcl_FileObjCmd: type} -constraints {linkDirectory notWine} -setup { set tempdir [makeDirectory temp] } -body { set linkdir [file join [temporaryDirectory] link.dir] diff --git a/tests/env.test b/tests/env.test index bad9e66..c901148 100644 --- a/tests/env.test +++ b/tests/env.test @@ -104,7 +104,9 @@ variable keep { SHLIB_PATH SYSTEMDRIVE SYSTEMROOT DYLD_LIBRARY_PATH DYLD_FRAMEWORK_PATH DYLD_NEW_LOCAL_SHARED_REGIONS DYLD_NO_FIX_PREBINDING __CF_USER_TEXT_ENCODING SECURITYSESSIONID LANG WINDIR TERM - CommonProgramFiles ProgramFiles CommonProgramW6432 ProgramW6432 + CommonProgramFiles CommonProgramFiles(x86) ProgramFiles + ProgramFiles(x86) CommonProgramW6432 ProgramW6432 + WINECONFIGDIR WINEDATADIR WINEDLLDIR0 WINEHOMEDIR } variable printenvScript [makeFile [string map [list @keep@ [list $keep]] { diff --git a/tests/fCmd.test b/tests/fCmd.test index 53313dc..a1e0a6e 100644 --- a/tests/fCmd.test +++ b/tests/fCmd.test @@ -41,6 +41,7 @@ if {[testConstraint win]} { testConstraint reg 1 } } +testConstraint notWine [expr {$::tcl_platform(platform) ne "windows" || ![info exists ::env(TRAVIS_OS_NAME)] || ![string match linux $::env(TRAVIS_OS_NAME)]}] set tmpspace /tmp;# default value # Find a group that exists on this Unix system, or else skip tests that @@ -416,7 +417,7 @@ test fCmd-5.4 {TclFileDeleteCmd: multiple files} -constraints notRoot -setup { } -cleanup {cleanup} -result {1 1 1 0 0 0} test fCmd-5.5 {TclFileDeleteCmd: stop at first error} -setup { cleanup -} -constraints {notRoot unixOrWin} -body { +} -constraints {notRoot unixOrWin notWine} -body { createfile tf1 createfile tf2 file mkdir td1 @@ -563,7 +564,7 @@ test fCmd-6.15 {CopyRenameOneFile: TclpRenameFile succeeds} -setup { } -result 1 test fCmd-6.16 {CopyRenameOneFile: TclpCopyRenameOneFile fails} -setup { cleanup -} -constraints {notRoot} -body { +} -constraints {notRoot notWine} -body { file mkdir [file join td1 td2] createfile [file join td1 td2 tf1] file mkdir td2 @@ -572,12 +573,12 @@ test fCmd-6.16 {CopyRenameOneFile: TclpCopyRenameOneFile fails} -setup { [subst {error renaming "td2" to "[file join td1 td2]": file *}] test fCmd-6.17 {CopyRenameOneFile: errno == EINVAL} -setup { cleanup -} -constraints {notRoot} -returnCodes error -body { +} -constraints {notRoot notWine} -returnCodes error -body { file rename -force $root tf1 } -result [subst {error renaming "$root" to "tf1": trying to rename a volume or move a directory into itself}] test fCmd-6.18 {CopyRenameOneFile: errno != EXDEV} -setup { cleanup -} -constraints {notRoot} -body { +} -constraints {notRoot notWine} -body { file mkdir [file join td1 td2] createfile [file join td1 td2 tf1] file mkdir td2 @@ -811,7 +812,7 @@ test fCmd-9.4.b {file rename: comprehensive: dir to new name} -setup { } -result {{td3 td4} 1 0} test fCmd-9.5 {file rename: comprehensive: file to self} -setup { cleanup -} -constraints {notRoot testchmod} -body { +} -constraints {notRoot testchmod notWine} -body { createfile tf1 tf1 createfile tf2 tf2 testchmod 0o444 tf2 @@ -841,7 +842,7 @@ test fCmd-9.6.b {file rename: comprehensive: dir to self} -setup { } -result {{td1 td2} 1 0} test fCmd-9.7 {file rename: comprehensive: file to existing file} -setup { cleanup -} -constraints {notRoot testchmod} -body { +} -constraints {notRoot testchmod notWine} -body { createfile tf1 createfile tf2 createfile tfs1 @@ -902,7 +903,7 @@ test fCmd-9.8 {file rename: comprehensive: dir to empty dir} -setup { # Test can hit EEXIST or EBUSY, depending on underlying filesystem test fCmd-9.9 {file rename: comprehensive: dir to non-empty dir} -setup { cleanup -} -constraints {notRoot testchmod} -body { +} -constraints {notRoot testchmod notWine} -body { file mkdir tds1 file mkdir tds2 file mkdir [file join tdd1 tds1 xxx] @@ -966,14 +967,14 @@ test fCmd-9.12 {file rename: comprehensive: target exists} -setup { # Test can hit EEXIST or EBUSY, depending on underlying filesystem test fCmd-9.13 {file rename: comprehensive: can't overwrite target} -setup { cleanup -} -constraints {notRoot} -body { +} -constraints {notRoot notWine} -body { file mkdir [file join td1 td2] [file join td2 td1 td4] file rename -force td1 td2 } -returnCodes error -match glob -result \ [subst {error renaming "td1" to "[file join td2 td1]": file *}] test fCmd-9.14 {file rename: comprehensive: dir into self} -setup { cleanup -} -constraints {notRoot} -body { +} -constraints {notRoot notWine} -body { file mkdir td1 list [glob td*] [list [catch {file rename td1 td1} msg] $msg] } -result [subst {td1 {1 {error renaming "td1" to "[file join td1 td1]": trying to rename a volume or move a directory into itself}}}] @@ -1068,7 +1069,7 @@ test fCmd-10.3.1 {file copy: comprehensive: dir to new name} -setup { } -result [list {td1 td2 td3 td4} [file join td3 tdx] [file join td4 tdy] 1 1] test fCmd-10.4 {file copy: comprehensive: file to existing file} -setup { cleanup -} -constraints {notRoot testchmod} -body { +} -constraints {notRoot testchmod notWine} -body { createfile tf1 createfile tf2 createfile tfs1 @@ -2401,7 +2402,7 @@ test fCmd-28.10.1 {file link: linking to nonexistent path} -setup { test fCmd-28.11 {file link: success with directory} -setup { cd [temporaryDirectory] file delete -force abc.link -} -constraints {linkDirectory} -body { +} -constraints {linkDirectory notWine} -body { file link abc.link abc.dir } -cleanup { cd [workingDirectory] @@ -2409,7 +2410,7 @@ test fCmd-28.11 {file link: success with directory} -setup { test fCmd-28.12 {file link: cd into a link} -setup { cd [temporaryDirectory] file delete -force abc.link -} -constraints {linkDirectory} -body { +} -constraints {linkDirectory notWine} -body { file link abc.link abc.dir set orig [pwd] cd abc.link @@ -2435,7 +2436,7 @@ test fCmd-28.12 {file link: cd into a link} -setup { file delete -force abc.link cd [workingDirectory] } -result ok -test fCmd-28.13 {file link} -constraints {linkDirectory} -setup { +test fCmd-28.13 {file link} -constraints {linkDirectory notWine} -setup { cd [temporaryDirectory] file link abc.link abc.dir } -body { @@ -2469,7 +2470,7 @@ test fCmd-28.15.1 {file link: copies link not dir} -setup { test fCmd-28.15.2 {file link: copies link not dir} -setup { cd [temporaryDirectory] file delete -force abc.link -} -constraints {linkDirectory} -body { +} -constraints {linkDirectory notWine} -body { file link abc.link abc.dir file copy abc.link abc2.link list [file type abc2.link] [file tail [file link abc2.link]] @@ -2490,7 +2491,7 @@ cd [workingDirectory] test fCmd-28.16 {file link: glob inside link} -setup { cd [temporaryDirectory] file delete -force abc.link -} -constraints {linkDirectory} -body { +} -constraints {linkDirectory notWine} -body { file link abc.link abc.dir lsort [glob -dir abc.link -tails *] } -cleanup { @@ -2500,13 +2501,13 @@ test fCmd-28.16 {file link: glob inside link} -setup { test fCmd-28.17 {file link: glob -type l} -setup { cd [temporaryDirectory] file link abc.link abc.dir -} -constraints {linkDirectory} -body { +} -constraints {linkDirectory notWine} -body { glob -dir [pwd] -type l -tails abc* } -cleanup { file delete -force abc.link cd [workingDirectory] } -result {abc.link} -test fCmd-28.18 {file link: glob -type d} -constraints linkDirectory -setup { +test fCmd-28.18 {file link: glob -type d} -constraints {linkDirectory notWine} -setup { cd [temporaryDirectory] file link abc.link abc.dir } -body { @@ -2517,7 +2518,7 @@ test fCmd-28.18 {file link: glob -type d} -constraints linkDirectory -setup { } -result [lsort [list abc.link abc.dir abc2.dir]] test fCmd-28.19 {file link: relative paths} -setup { cd [temporaryDirectory] -} -constraints {win linkDirectory} -body { +} -constraints {win linkDirectory notWine} -body { file mkdir d1/d2/d3 file link d1/l2 d1/d2 } -cleanup { @@ -2575,12 +2576,12 @@ test fCmd-30.1 {file writable on 'My Documents'} -setup { } -constraints {win reg} -body { file writable $mydocsname } -result 1 -test fCmd-30.2 {file readable on 'NTUSER.DAT'} -constraints {win} -body { +test fCmd-30.2 {file readable on 'NTUSER.DAT'} -constraints {win notWine} -body { expr {[info exists env(USERPROFILE)] && [file exists $env(USERPROFILE)/NTUSER.DAT] && [file readable $env(USERPROFILE)/NTUSER.DAT]} } -result {1} -test fCmd-30.3 {file readable on 'pagefile.sys'} -constraints {win} -body { +test fCmd-30.3 {file readable on 'pagefile.sys'} -constraints {win notWine} -body { set r {} if {[info exists env(SystemDrive)]} { set path $env(SystemDrive)/pagefile.sys diff --git a/tests/fileName.test b/tests/fileName.test index c73efac..ac93383 100644 --- a/tests/fileName.test +++ b/tests/fileName.test @@ -31,6 +31,7 @@ if {[testConstraint win]} { testConstraint symbolicLinkFile 0 testConstraint sharedCdrive [expr {![catch {cd //[info hostname]/c}]}] } +testConstraint notWine [expr {$::tcl_platform(platform) ne "windows" || ![info exists ::env(TRAVIS_OS_NAME)] || ![string match linux $::env(TRAVIS_OS_NAME)]}] # This match compares the first two words of the result. If the wanted result # is "equal", then this is successful if the words are equal. If the wanted # result is "not equal", then this is successful if the words are different. @@ -789,7 +790,7 @@ test filename-11.17 {Tcl_GlobCmd} {unix} { [file join $globname x,z1.c]\ [file join $globname x1.c]\ [file join $globname y1.c] [file join $globname z1.c]]] -test filename-11.17.1 {Tcl_GlobCmd} {win} { +test filename-11.17.1 {Tcl_GlobCmd} {win notWine} { lsort [glob -directory $globname *] } [lsort [list [file join $globname a1] [file join $globname a2]\ [file join $globname .1]\ @@ -800,7 +801,7 @@ test filename-11.17.1 {Tcl_GlobCmd} {win} { [file join $globname y1.c] [file join $globname z1.c]]] test filename-11.17.2 {Tcl_GlobCmd} -setup { set dir [pwd] -} -constraints {notRoot linkDirectory} -body { +} -constraints {notRoot linkDirectory notWine} -body { cd $globname file link -symbolic link a1 cd $dir @@ -813,7 +814,7 @@ test filename-11.17.2 {Tcl_GlobCmd} -setup { # Simpler version of the above test to illustrate a given bug. test filename-11.17.3 {Tcl_GlobCmd} -setup { set dir [pwd] -} -constraints {notRoot linkDirectory} -body { +} -constraints {notRoot linkDirectory notWine} -body { cd $globname file link -symbolic link a1 cd $dir @@ -828,7 +829,7 @@ test filename-11.17.3 {Tcl_GlobCmd} -setup { # Make sure the bugfix isn't too simple. We don't want to break 'glob -type l' test filename-11.17.4 {Tcl_GlobCmd} -setup { set dir [pwd] -} -constraints {notRoot linkDirectory} -body { +} -constraints {notRoot linkDirectory notWine} -body { cd $globname file link -symbolic link a1 cd $dir @@ -846,7 +847,7 @@ test filename-11.17.6 {Tcl_GlobCmd} { [list "weird name.c" x,z1.c x1.c y1.c z1.c]]] test filename-11.17.7 {Tcl_GlobCmd: broken link and glob -l} -setup { set dir [pwd] -} -constraints {linkDirectory} -body { +} -constraints {linkDirectory notWine} -body { cd $globname file mkdir nonexistent file link -symbolic link nonexistent @@ -878,7 +879,7 @@ test filename-11.18 {Tcl_GlobCmd} {unix} { [file join $globname x,z1.c]\ [file join $globname x1.c]\ [file join $globname y1.c] [file join $globname z1.c]]] -test filename-11.18.1 {Tcl_GlobCmd} {win} { +test filename-11.18.1 {Tcl_GlobCmd} {win notWine} { lsort [glob -path $globname/ *] } [lsort [list [file join $globname a1] [file join $globname a2]\ [file join $globname .1]\ @@ -895,7 +896,7 @@ test filename-11.19 {Tcl_GlobCmd} {unix} { [file join $globname x,z1.c]\ [file join $globname x1.c]\ [file join $globname y1.c] [file join $globname z1.c]]] -test filename-11.19.1 {Tcl_GlobCmd} {win} { +test filename-11.19.1 {Tcl_GlobCmd} {win notWine} { lsort [glob -join -path [string range $globname 0 5] * *] } [lsort [list [file join $globname a1] [file join $globname a2]\ [file join $globname .1]\ @@ -904,7 +905,7 @@ test filename-11.19.1 {Tcl_GlobCmd} {win} { [file join $globname x,z1.c]\ [file join $globname x1.c]\ [file join $globname y1.c] [file join $globname z1.c]]] -test filename-11.20 {Tcl_GlobCmd} { +test filename-11.20 {Tcl_GlobCmd} notWine { lsort [glob -type d -dir $globname *] } [lsort [list [file join $globname a1]\ [file join $globname a2]\ @@ -934,7 +935,7 @@ test filename-11.22 {Tcl_GlobCmd} {unix} { [file join $globname x,z1.c]\ [file join $globname x1.c]\ [file join $globname y1.c] [file join $globname z1.c]]] -test filename-11.22.1 {Tcl_GlobCmd} {win} { +test filename-11.22.1 {Tcl_GlobCmd} {win notWine} { lsort [glob -dir $globname *] } [lsort [list [file join $globname a1] [file join $globname a2]\ [file join $globname .1]\ @@ -951,7 +952,7 @@ test filename-11.23 {Tcl_GlobCmd} {unix} { [file join $globname x,z1.c]\ [file join $globname x1.c]\ [file join $globname y1.c] [file join $globname z1.c]]] -test filename-11.23.1 {Tcl_GlobCmd} {win} { +test filename-11.23.1 {Tcl_GlobCmd} {win notWine} { lsort [glob -path $globname/ *] } [lsort [list [file join $globname a1] [file join $globname a2]\ [file join $globname .1]\ @@ -968,7 +969,7 @@ test filename-11.24 {Tcl_GlobCmd} {unix} { [file join $globname x,z1.c]\ [file join $globname x1.c]\ [file join $globname y1.c] [file join $globname z1.c]]] -test filename-11.24.1 {Tcl_GlobCmd} {win} { +test filename-11.24.1 {Tcl_GlobCmd} {win notWine} { lsort [glob -join -path [string range $globname 0 5] * *] } [lsort [list [file join $globname a1] [file join $globname a2]\ [file join $globname .1]\ @@ -977,17 +978,17 @@ test filename-11.24.1 {Tcl_GlobCmd} {win} { [file join $globname x,z1.c]\ [file join $globname x1.c]\ [file join $globname y1.c] [file join $globname z1.c]]] -test filename-11.25 {Tcl_GlobCmd} { +test filename-11.25 {Tcl_GlobCmd} notWine { lsort [glob -type d -dir $globname *] } [lsort [list [file join $globname a1]\ [file join $globname a2]\ [file join $globname a3]]] -test filename-11.25.1 {Tcl_GlobCmd} { +test filename-11.25.1 {Tcl_GlobCmd} notWine { lsort [glob -type {d r} -dir $globname *] } [lsort [list [file join $globname a1]\ [file join $globname a2]\ [file join $globname a3]]] -test filename-11.25.2 {Tcl_GlobCmd} { +test filename-11.25.2 {Tcl_GlobCmd} notWine { lsort [glob -type {d r w} -dir $globname *] } [lsort [list [file join $globname a1]\ [file join $globname a2]\ @@ -1231,10 +1232,10 @@ test filename-14.5 {asterisks, question marks, and brackets} -setup { test filename-14.7 {asterisks, question marks, and brackets} {unix} { lsort [glob globTest/*] } {globTest/a1 globTest/a2 globTest/a3 {globTest/weird name.c} globTest/x,z1.c globTest/x1.c globTest/y1.c globTest/z1.c} -test filename-14.7.1 {asterisks, question marks, and brackets} {win} { +test filename-14.7.1 {asterisks, question marks, and brackets} {win notWine} { lsort [glob globTest/*] } {globTest/.1 globTest/a1 globTest/a2 globTest/a3 {globTest/weird name.c} globTest/x,z1.c globTest/x1.c globTest/y1.c globTest/z1.c} -test filename-14.9 {asterisks, question marks, and brackets} {unixOrWin} { +test filename-14.9 {asterisks, question marks, and brackets} {unixOrWin notWine} { lsort [glob globTest/.*] } {globTest/. globTest/.. globTest/.1} test filename-14.11 {asterisks, question marks, and brackets} {unixOrWin} { @@ -1243,7 +1244,7 @@ test filename-14.11 {asterisks, question marks, and brackets} {unixOrWin} { test filename-14.13 {asterisks, question marks, and brackets} {unixOrWin} { lsort [glob {globTest/[xyab]1.*}] } {globTest/x1.c globTest/y1.c} -test filename-14.15 {asterisks, question marks, and brackets} {unixOrWin} { +test filename-14.15 {asterisks, question marks, and brackets} {unixOrWin notWine} { lsort [glob globTest/*/] } {globTest/a1/ globTest/a2/ globTest/a3/} test filename-14.17 {asterisks, question marks, and brackets} -setup { @@ -1283,7 +1284,7 @@ test filename-14.25 {type specific globbing} {unix} { [file join $globname x,z1.c]\ [file join $globname x1.c]\ [file join $globname y1.c] [file join $globname z1.c]]] -test filename-14.25.1 {type specific globbing} {win} { +test filename-14.25.1 {type specific globbing} {win notWine} { lsort [glob -dir globTest -types f *] } [lsort [list \ [file join $globname .1]\ diff --git a/tests/registry.test b/tests/registry.test index 53e48fe..dbf4575 100644 --- a/tests/registry.test +++ b/tests/registry.test @@ -24,6 +24,7 @@ if {[testConstraint win]} { testConstraint reg 1 } } +testConstraint notWine [expr {$::tcl_platform(platform) ne "windows" || ![info exists ::env(TRAVIS_OS_NAME)] || ![string match linux $::env(TRAVIS_OS_NAME)]}] # determine the current locale testConstraint english [expr { @@ -673,10 +674,10 @@ test registry-12.2 {BroadcastValue} -constraints {win reg} -body { test registry-12.3 {BroadcastValue} -constraints {win reg} -body { registry broadcast "" - 500 } -returnCodes error -result "wrong # args: should be \"registry broadcast keyName ?-timeout milliseconds?\"" -test registry-12.4 {BroadcastValue} -constraints {win reg} -body { +test registry-12.4 {BroadcastValue} -constraints {win reg notWine} -body { registry broadcast {Environment} } -result {1 0} -test registry-12.5 {BroadcastValue} -constraints {win reg} -body { +test registry-12.5 {BroadcastValue} -constraints {win reg notWine} -body { registry b {} } -result {1 0} diff --git a/tests/socket.test b/tests/socket.test index 868c17a..6a045b1 100644 --- a/tests/socket.test +++ b/tests/socket.test @@ -72,6 +72,7 @@ catch [list package require -exact Tcltest [info patchlevel]] if {[expr {[info exists ::env(TRAVIS_OSX_IMAGE)] && [string match xcode* $::env(TRAVIS_OSX_IMAGE)]}]} { return } +testConstraint notWine [expr {$::tcl_platform(platform) ne "windows" || ![info exists ::env(TRAVIS_OS_NAME)] || ![string match linux $::env(TRAVIS_OS_NAME)]}] # Some tests require the Thread package or exec command testConstraint thread [expr {0 == [catch {package require Thread 2.7-}]}] @@ -734,7 +735,7 @@ test socket_$af-2.12 {} [list socket stdio supported_$af] { close $f set ::done } 0 -test socket_$af-2.13 {Bug 1758a0b603} {socket stdio} { +test socket_$af-2.13 {Bug 1758a0b603} {socket stdio notWine} { file delete $path(script) set f [open $path(script) w] puts $f { @@ -1543,7 +1544,7 @@ test socket_$af-11.11 {testing spurious events} -setup { after cancel $timer sendCommand {close $server} } -result {0 2690 1} -test socket_$af-11.12 {testing EOF stickyness} -constraints [list socket supported_$af doTestsWithRemoteServer] -setup { +test socket_$af-11.12 {testing EOF stickyness} -constraints [list socket supported_$af doTestsWithRemoteServer notWine] -setup { set counter 0 set done 0 set port [sendCommand { @@ -2101,7 +2102,7 @@ test socket-14.4 {[socket -async] and both, readdable and writable fileevents} \ } -result {{} bye} # FIXME: we should also have an IPv6 counterpart of this test socket-14.5 {[socket -async] which fails before any connect() can be made} \ - -constraints {socket supported_inet} \ + -constraints {socket supported_inet notWine} \ -body { # address from rfc5737 socket -async -myaddr 192.0.2.42 127.0.0.1 [randport] @@ -2436,7 +2437,7 @@ test socket-14.12 {[socket -async] background progress triggered by [fconfigure } -result {connection refused} test socket-14.13 {testing writable event when quick failure} \ - -constraints {socket win supported_inet} \ + -constraints {socket win supported_inet notWine} \ -body { # Test for bug 336441ed59 where a quick background fail was ignored @@ -2520,7 +2521,7 @@ test socket-14.18 {bug c6ed4acfd8: running async socket connect made other conne } -result {} test socket-14.19 {tip 456 -- introduce the -reuseport option} \ - -constraints {socket} \ + -constraints {socket notWine} \ -body { proc accept {channel address port} {} set port [randport] diff --git a/tests/winDde.test b/tests/winDde.test index 99ac8af..78a36f8 100644 --- a/tests/winDde.test +++ b/tests/winDde.test @@ -24,6 +24,7 @@ if {[testConstraint win]} { testConstraint dde 1 } } +testConstraint notWine [expr {$::tcl_platform(platform) ne "windows" || ![info exists ::env(TRAVIS_OS_NAME)] || ![string match linux $::env(TRAVIS_OS_NAME)]}] # ------------------------------------------------------------------------- @@ -161,7 +162,7 @@ test winDde-3.6 {DDE request utf-8} -constraints dde -body { } -result 196 # Set variable a to A with diaeresis (unicode C4) using binary execute # and compose utf-8 (e.g. "c3 84" ) manualy -test winDde-3.7 {DDE request binary} -constraints dde -body { +test winDde-3.7 {DDE request binary} -constraints {dde notWine} -body { set \xe1 "not set" dde execute -binary TclEval self [list set \xc3\xa1 \xc3\x84\x00] scan [set \xe1] %c diff --git a/tests/winFCmd.test b/tests/winFCmd.test index ef62cec..70db379 100644 --- a/tests/winFCmd.test +++ b/tests/winFCmd.test @@ -29,6 +29,7 @@ testConstraint cdrom 0 testConstraint exdev 0 testConstraint longFileNames 0 testConstraint knownMsvcBug [expr {![info exists ::env(TRAVIS_OS_NAME)] || ![string match windows $::env(TRAVIS_OS_NAME)]}] +testConstraint notWine [expr {$::tcl_platform(platform) ne "windows" || ![info exists ::env(TRAVIS_OS_NAME)] || ![string match linux $::env(TRAVIS_OS_NAME)]}] proc createfile {file {string a}} { set f [open $file w] @@ -132,25 +133,25 @@ test winFCmd-1.1 {TclpRenameFile: errno: EACCES} -body { } -constraints {win cdrom testfile} -returnCodes error -result EACCES test winFCmd-1.2 {TclpRenameFile: errno: EEXIST} -setup { cleanup -} -constraints {win testfile} -body { +} -constraints {win testfile notWine} -body { file mkdir td1/td2/td3 file mkdir td2 testfile mv td2 td1/td2 } -returnCodes error -result EEXIST test winFCmd-1.3 {TclpRenameFile: errno: EINVAL} -setup { cleanup -} -constraints {win testfile} -body { +} -constraints {win testfile notWine} -body { testfile mv / td1 } -returnCodes error -result EINVAL test winFCmd-1.4 {TclpRenameFile: errno: EINVAL} -setup { cleanup -} -constraints {win testfile} -body { +} -constraints {win testfile notWine} -body { file mkdir td1 testfile mv td1 td1/td2 } -returnCodes error -result EINVAL test winFCmd-1.5 {TclpRenameFile: errno: EISDIR} -setup { cleanup -} -constraints {win testfile} -body { +} -constraints {win testfile notWine} -body { file mkdir td1 createfile tf1 testfile mv tf1 td1 @@ -255,7 +256,7 @@ test winFCmd-1.22 {TclpRenameFile: long dst} -setup { } -returnCodes error -result ENAMETOOLONG test winFCmd-1.23 {TclpRenameFile: move dir into self} -setup { cleanup -} -constraints {win testfile} -body { +} -constraints {win testfile notWine} -body { file mkdir td1 testfile mv [pwd]/td1 td1/td2 } -returnCodes error -result EINVAL @@ -300,21 +301,21 @@ test winFCmd-1.29 {TclpRenameFile: src is dir} -setup { } -returnCodes error -result ENOTDIR test winFCmd-1.30 {TclpRenameFile: dst is dir} -setup { cleanup -} -constraints {win testfile} -body { +} -constraints {win testfile notWine} -body { file mkdir td1 file mkdir td2/td2 testfile mv td1 td2 } -returnCodes error -result EEXIST test winFCmd-1.31 {TclpRenameFile: TclpRemoveDirectory fails} -setup { cleanup -} -constraints {win testfile} -body { +} -constraints {win testfile notWine} -body { file mkdir td1 file mkdir td2/td2 testfile mv td1 td2 } -returnCodes error -result EEXIST test winFCmd-1.32 {TclpRenameFile: TclpRemoveDirectory succeeds} -setup { cleanup -} -constraints {win testfile} -body { +} -constraints {win testfile notWine} -body { file mkdir td1/td2 file mkdir td2 testfile mv td1 td2 @@ -343,7 +344,7 @@ test winFCmd-1.34 {TclpRenameFile: src is dir, dst is not} -setup { } -returnCodes error -result ENOTDIR test winFCmd-1.35 {TclpRenameFile: src is not dir, dst is} -setup { cleanup -} -constraints {win testfile} -body { +} -constraints {win testfile notWine} -body { file mkdir td1 createfile tf1 testfile mv tf1 td1 @@ -394,7 +395,7 @@ proc MakeFiles {dirname} { test winFCmd-1.38 {TclpRenameFile: check rename of conflicting inodes} -setup { cleanup -} -constraints {win winNonZeroInodes knownMsvcBug} -body { +} -constraints {win winNonZeroInodes knownMsvcBug notWine} -body { file mkdir td1 foreach {a b} [MakeFiles td1] break file rename -force $a $b @@ -639,7 +640,7 @@ test winFCmd-5.1 {TclpCopyDirectory: calls TraverseWinTree} -setup { test winFCmd-6.1 {TclpRemoveDirectory: errno: EACCES} -setup { cleanup -} -constraints {winVista testfile testchmod knownMsvcBug} -body { +} -constraints {winVista testfile testchmod knownMsvcBug notWine} -body { file mkdir td1 testchmod 0 td1 testfile rmdir td1 @@ -693,7 +694,7 @@ test winFCmd-6.8 {TclpRemoveDirectory: RemoveDirectory fails} -setup { } -result {1 {tf1 ENOTDIR}} test winFCmd-6.9 {TclpRemoveDirectory: errno == EACCES} -setup { cleanup -} -constraints {winVista testfile testchmod knownMsvcBug} -body { +} -constraints {winVista testfile testchmod knownMsvcBug notWine} -body { file mkdir td1 testchmod 0 td1 testfile rmdir td1 @@ -704,14 +705,14 @@ test winFCmd-6.9 {TclpRemoveDirectory: errno == EACCES} -setup { } -result {td1 EACCES} test winFCmd-6.11 {TclpRemoveDirectory: attr == -1} -setup { cleanup -} -constraints {win testfile} -body { +} -constraints {win testfile notWine} -body { testfile rmdir / # WinXP returns EEXIST, WinNT seems to return EACCES. No policy # decision has been made as to which is correct. } -returnCodes error -match regexp -result {^/ E(ACCES|EXIST)$} test winFCmd-6.13 {TclpRemoveDirectory: write-protected} -setup { cleanup -} -constraints {winVista testfile testchmod knownMsvcBug} -body { +} -constraints {winVista testfile testchmod knownMsvcBug notWine} -body { file mkdir td1 testchmod 0 td1 testfile rmdir td1 @@ -940,7 +941,7 @@ test winFCmd-9.1 {TraversalDelete: DOTREE_F} -setup { } -result {} test winFCmd-9.3 {TraversalDelete: DOTREE_PRED} -setup { cleanup -} -constraints {winVista testfile testchmod knownMsvcBug} -body { +} -constraints {winVista testfile testchmod knownMsvcBug notWine} -body { file mkdir td1/td2 testchmod 0 td1 testfile rmdir -force td1 @@ -1129,7 +1130,7 @@ test winFCmd-15.2 {SetWinFileAttributes - archive} -constraints {win} -setup { } -cleanup { cleanup } -result {{} 1} -test winFCmd-15.3 {SetWinFileAttributes - archive} -constraints {win} -setup { +test winFCmd-15.3 {SetWinFileAttributes - archive} -constraints {win notWine} -setup { cleanup } -body { createfile td1 {} @@ -1137,7 +1138,7 @@ test winFCmd-15.3 {SetWinFileAttributes - archive} -constraints {win} -setup { } -cleanup { cleanup } -result {{} 0} -test winFCmd-15.4 {SetWinFileAttributes - hidden} -constraints {win} -setup { +test winFCmd-15.4 {SetWinFileAttributes - hidden} -constraints {win notWine} -setup { cleanup } -body { createfile td1 {} @@ -1170,7 +1171,7 @@ test winFCmd-15.7 {SetWinFileAttributes - readonly} -setup { } -cleanup { cleanup } -result {{} 0} -test winFCmd-15.8 {SetWinFileAttributes - system} -constraints {win} -setup { +test winFCmd-15.8 {SetWinFileAttributes - system} -constraints {win notWine} -setup { cleanup } -body { createfile td1 {} diff --git a/tests/winFile.test b/tests/winFile.test index d8d1b7c..2c0988a 100644 --- a/tests/winFile.test +++ b/tests/winFile.test @@ -24,6 +24,7 @@ testConstraint notNTFS 0 if {[testConstraint testvolumetype]} { testConstraint notNTFS [expr {[testvolumetype] eq "NTFS"}] } +testConstraint notWine [expr {$::tcl_platform(platform) ne "windows" || ![info exists ::env(TRAVIS_OS_NAME)] || ![string match linux $::env(TRAVIS_OS_NAME)]}] test winFile-1.1 {TclpGetUserHome} -constraints {win} -body { glob ~nosuchuser @@ -150,7 +151,7 @@ if {[testConstraint win]} { test winFile-4.0 { Enhanced NTFS user/group permissions: test no acccess } -constraints { - win notNTFS + win notNTFS notWine } -setup { set owner [getuser $fname] set user $::env(USERDOMAIN)\\$::env(USERNAME) @@ -165,7 +166,7 @@ test winFile-4.0 { test winFile-4.1 { Enhanced NTFS user/group permissions: test readable only } -constraints { - win notNTFS + win notNTFS notWine } -setup { set user $::env(USERDOMAIN)\\$::env(USERNAME) } -body { @@ -176,7 +177,7 @@ test winFile-4.1 { test winFile-4.2 { Enhanced NTFS user/group permissions: test writable only } -constraints { - win notNTFS + win notNTFS notWine } -setup { set user $::env(USERDOMAIN)\\$::env(USERNAME) } -body { diff --git a/tests/winPipe.test b/tests/winPipe.test index 0263823..919e336 100644 --- a/tests/winPipe.test +++ b/tests/winPipe.test @@ -28,6 +28,9 @@ set org_pwd [pwd] set bindir [file join $org_pwd [file dirname [info nameofexecutable]]] set cat32 [file join $bindir cat32.exe] +testConstraint notWine [expr {$::tcl_platform(platform) ne "windows" || ![info exists ::env(TRAVIS_OS_NAME)] || ![string match linux $::env(TRAVIS_OS_NAME)]}] + + # several test-cases here expect current directory == [temporaryDirectory]: cd [temporaryDirectory] @@ -197,7 +200,7 @@ test winpipe-4.1 {Tcl_WaitPid} {win exec cat32} { vwait x list $result $x [contents $path(stderr)] } "{$big} 1 stderr32" -test winpipe-4.2 {Tcl_WaitPid: return of exception codes, SIGFPE} {win exec testexcept} { +test winpipe-4.2 {Tcl_WaitPid: return of exception codes, SIGFPE} {win exec testexcept notWine} { set f [open "|[list [interpreter]]" w+] set pid [pid $f] puts $f "load $::tcltestlib Tcltest" @@ -205,7 +208,7 @@ test winpipe-4.2 {Tcl_WaitPid: return of exception codes, SIGFPE} {win exec test set status [catch {close $f}] list $status [expr {$pid == [lindex $::errorCode 1]}] [lindex $::errorCode 2] } {1 1 SIGFPE} -test winpipe-4.3 {Tcl_WaitPid: return of exception codes, SIGSEGV} {win exec testexcept} { +test winpipe-4.3 {Tcl_WaitPid: return of exception codes, SIGSEGV} {win exec testexcept notWine} { set f [open "|[list [interpreter]]" w+] set pid [pid $f] puts $f "load $::tcltestlib Tcltest" @@ -213,7 +216,7 @@ test winpipe-4.3 {Tcl_WaitPid: return of exception codes, SIGSEGV} {win exec tes set status [catch {close $f}] list $status [expr {$pid == [lindex $::errorCode 1]}] [lindex $::errorCode 2] } {1 1 SIGSEGV} -test winpipe-4.4 {Tcl_WaitPid: return of exception codes, SIGILL} {win exec testexcept} { +test winpipe-4.4 {Tcl_WaitPid: return of exception codes, SIGILL} {win exec testexcept notWine} { set f [open "|[list [interpreter]]" w+] set pid [pid $f] puts $f "load $::tcltestlib Tcltest" @@ -221,7 +224,7 @@ test winpipe-4.4 {Tcl_WaitPid: return of exception codes, SIGILL} {win exec test set status [catch {close $f}] list $status [expr {$pid == [lindex $::errorCode 1]}] [lindex $::errorCode 2] } {1 1 SIGILL} -test winpipe-4.5 {Tcl_WaitPid: return of exception codes, SIGINT} {win exec testexcept} { +test winpipe-4.5 {Tcl_WaitPid: return of exception codes, SIGINT} {win exec testexcept notWine} { set f [open "|[list [interpreter]]" w+] set pid [pid $f] puts $f "load $::tcltestlib Tcltest" @@ -519,7 +522,7 @@ test winpipe-8.2 {BuildCommandLine/parse_cmdline pass-thru: check injection on s } -result {} test winpipe-8.3 {BuildCommandLine/parse_cmdline pass-thru: check injection on special meta-chars (jointly)} \ --constraints {win exec} -body { +-constraints {win exec notWine} -body { _testExecArgs 0 \ [list START {*}$injectList END] \ [list "START\"" {*}$injectList END] \ @@ -528,7 +531,7 @@ test winpipe-8.3 {BuildCommandLine/parse_cmdline pass-thru: check injection on s } -result {} test winpipe-8.4 {BuildCommandLine/parse_cmdline pass-thru: check injection on special meta-chars (command/jointly args)} \ --constraints {win exec} -body { +-constraints {win exec notWine} -body { _testExecArgs 2 \ [list START {*}$injectList END] \ [list "START\"" {*}$injectList END] \ @@ -537,7 +540,7 @@ test winpipe-8.4 {BuildCommandLine/parse_cmdline pass-thru: check injection on s } -result {} test winpipe-8.5 {BuildCommandLine/parse_cmdline pass-thru: check injection on special meta-chars (random mix)} \ --constraints {win exec} -body { +-constraints {win exec notWine} -body { set lst {} set maps { {\&|^<>!()%} -- cgit v0.12 From 71b64b8e1c447baa06ebd0db32a674d135eaa594 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Fri, 16 Oct 2020 16:21:29 +0000 Subject: Still troubles with GIT on Travis --- .travis.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.travis.yml b/.travis.yml index 2630474..72ecdaa 100644 --- a/.travis.yml +++ b/.travis.yml @@ -190,6 +190,8 @@ jobs: - BUILD_DIR=win - VCDIR="/C/Program Files (x86)/Microsoft Visual Studio/2017/BuildTools/VC/Auxiliary/Build" before_install: &vcpreinst + - rm -rf tests/safe-stock8*.test + - touch generic/tclStubInit.c generic/tclOOStubInit.c - PATH="$PATH:$VCDIR" - cd ${BUILD_DIR} install: [] @@ -286,6 +288,8 @@ jobs: - BUILD_DIR=win - CFGOPT="--enable-64bit" before_install: &makepreinst + - rm -rf tests/safe-stock8*.test + - touch generic/tclStubInit.c generic/tclOOStubInit.c - choco install -y make - cd ${BUILD_DIR} - name: "Windows/GCC/Shared: UTF_MAX=4" -- cgit v0.12 From 8ce6115cf59c570acf00e2ac58a26235288ad90f Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Sun, 18 Oct 2020 16:24:41 +0000 Subject: 3 times -1 -> TCL_INDEX_NONE --- generic/tclCmdIL.c | 2 +- generic/tclCmdMZ.c | 2 +- generic/tclScan.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/generic/tclCmdIL.c b/generic/tclCmdIL.c index 6a81309..da8dc65 100644 --- a/generic/tclCmdIL.c +++ b/generic/tclCmdIL.c @@ -3514,7 +3514,7 @@ Tcl_LsearchObjCmd( if (allMatches || inlineReturn) { Tcl_ResetResult(interp); } else { - TclNewIntObj(itemPtr, -1); + TclNewIntObj(itemPtr, TCL_INDEX_NONE); Tcl_SetObjResult(interp, itemPtr); } goto done; diff --git a/generic/tclCmdMZ.c b/generic/tclCmdMZ.c index 6eb2954..c47490a 100644 --- a/generic/tclCmdMZ.c +++ b/generic/tclCmdMZ.c @@ -3778,7 +3778,7 @@ TclNRSwitchObjCmd( TclNewIntObj(rangeObjAry[0], info.matches[j].start); TclNewIntObj(rangeObjAry[1], info.matches[j].end-1); } else { - TclNewIntObj(rangeObjAry[1], -1); + TclNewIntObj(rangeObjAry[1], TCL_INDEX_NONE); rangeObjAry[0] = rangeObjAry[1]; } diff --git a/generic/tclScan.c b/generic/tclScan.c index ee04165..67fe6f3 100644 --- a/generic/tclScan.c +++ b/generic/tclScan.c @@ -1089,7 +1089,7 @@ Tcl_ScanObjCmd( if (code == TCL_OK) { if (underflow && (nconversions == 0)) { if (numVars) { - TclNewIntObj(objPtr, -1); + TclNewIntObj(objPtr, TCL_INDEX_NONE); } else { if (objPtr) { Tcl_SetListObj(objPtr, 0, NULL); -- cgit v0.12 From 0b669eacf86ed32f444f09285fe816c3c369d923 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Mon, 19 Oct 2020 07:21:45 +0000 Subject: Fix [cb458261c3]: Strip comme il faut (without really doing 'il faut' ....). Update 'install-sh' to latest upstream version, but re-add this commit: [b269db5d3e97b67c] --- unix/install-sh | 410 +++++++++++++++++++++++++++----------------------------- 1 file changed, 200 insertions(+), 210 deletions(-) diff --git a/unix/install-sh b/unix/install-sh index 7c34c3f..dc09dbd 100755 --- a/unix/install-sh +++ b/unix/install-sh @@ -1,7 +1,7 @@ #!/bin/sh # install - install a program, script, or datafile -scriptversion=2011-04-20.01; # UTC +scriptversion=2020-07-26.22; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the @@ -35,25 +35,21 @@ scriptversion=2011-04-20.01; # UTC # FSF changes to this file are in the public domain. # # Calling this script install-sh is preferred over install.sh, to prevent -# `make' implicit rules from creating a file called install from it +# 'make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. +tab=' ' nl=' ' -IFS=" "" $nl" +IFS=" $tab$nl" -# set DOITPROG to echo to test this script +# Set DOITPROG to "echo" to test this script. -# Don't use :- since 4.3BSD and earlier shells don't like it. doit=${DOITPROG-} -if test -z "$doit"; then - doit_exec=exec -else - doit_exec=$doit -fi +doit_exec=${doit:-exec} # Put in absolute file names if you don't have them in your path; # or use environment vars. @@ -68,22 +64,15 @@ mvprog=${MVPROG-mv} rmprog=${RMPROG-rm} stripprog=${STRIPPROG-strip} -posix_glob='?' -initialize_posix_glob=' - test "$posix_glob" != "?" || { - if (set -f) 2>/dev/null; then - posix_glob= - else - posix_glob=: - fi - } -' - posix_mkdir= # Desired mode of installed file. mode=0755 +# Create dirs (including intermediate dirs) using mode 755. +# This is like GNU 'install' as of coreutils 8.32 (2020). +mkdir_umask=22 + chgrpcmd= chmodcmd=$chmodprog chowncmd= @@ -97,7 +86,7 @@ dir_arg= dst_arg= copy_on_change=false -no_target_directory= +is_target_a_directory=possibly usage="\ Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE @@ -138,45 +127,60 @@ while test $# -ne 0; do -d) dir_arg=true;; -g) chgrpcmd="$chgrpprog $2" - shift;; + shift;; --help) echo "$usage"; exit $?;; -m) mode=$2 - case $mode in - *' '* | *' '* | *' -'* | *'*'* | *'?'* | *'['*) - echo "$0: invalid mode: $mode" >&2 - exit 1;; - esac - shift;; + case $mode in + *' '* | *"$tab"* | *"$nl"* | *'*'* | *'?'* | *'['*) + echo "$0: invalid mode: $mode" >&2 + exit 1;; + esac + shift;; -o) chowncmd="$chownprog $2" - shift;; + shift;; -s) stripcmd=$stripprog;; -S) stripcmd="$stripprog $2" - shift;; + shift;; - -t) dst_arg=$2 - shift;; + -t) + is_target_a_directory=always + dst_arg=$2 + # Protect names problematic for 'test' and other utilities. + case $dst_arg in + -* | [=\(\)!]) dst_arg=./$dst_arg;; + esac + shift;; - -T) no_target_directory=true;; + -T) is_target_a_directory=never;; --version) echo "$0 $scriptversion"; exit $?;; - --) shift - break;; + --) shift + break;; - -*) echo "$0: invalid option: $1" >&2 - exit 1;; + -*) echo "$0: invalid option: $1" >&2 + exit 1;; *) break;; esac shift done +# We allow the use of options -d and -T together, by making -d +# take the precedence; this is for compatibility with GNU install. + +if test -n "$dir_arg"; then + if test -n "$dst_arg"; then + echo "$0: target directory not allowed when installing a directory." >&2 + exit 1 + fi +fi + if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then # When -d is used, all remaining arguments are directories to create. # When -t is used, the destination is already specified. @@ -190,6 +194,10 @@ if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then fi shift # arg dst_arg=$arg + # Protect names problematic for 'test' and other utilities. + case $dst_arg in + -* | [=\(\)!]) dst_arg=./$dst_arg;; + esac done fi @@ -198,12 +206,21 @@ if test $# -eq 0; then echo "$0: no input file specified." >&2 exit 1 fi - # It's OK to call `install-sh -d' without argument. + # It's OK to call 'install-sh -d' without argument. # This can happen when creating conditional directories. exit 0 fi if test -z "$dir_arg"; then + if test $# -gt 1 || test "$is_target_a_directory" = always; then + if test ! -d "$dst_arg"; then + echo "$0: $dst_arg: Is not a directory." >&2 + exit 1 + fi + fi +fi + +if test -z "$dir_arg"; then do_exit='(exit $ret); exit $ret' trap "ret=129; $do_exit" 1 trap "ret=130; $do_exit" 2 @@ -219,16 +236,16 @@ if test -z "$dir_arg"; then *[0-7]) if test -z "$stripcmd"; then - u_plus_rw= + u_plus_rw= else - u_plus_rw='% 200' + u_plus_rw='% 200' fi cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; *) if test -z "$stripcmd"; then - u_plus_rw= + u_plus_rw= else - u_plus_rw=,u+rw + u_plus_rw=,u+rw fi cp_umask=$mode$u_plus_rw;; esac @@ -236,9 +253,9 @@ fi for src do - # Protect names starting with `-'. + # Protect names problematic for 'test' and other utilities. case $src in - -*) src=./$src;; + -* | [=\(\)!]) src=./$src;; esac if test -n "$dir_arg"; then @@ -260,185 +277,150 @@ do echo "$0: no destination specified." >&2 exit 1 fi - dst=$dst_arg - # Protect names starting with `-'. - case $dst in - -*) dst=./$dst;; - esac - # If destination is a directory, append the input filename; won't work - # if double slashes aren't ignored. + # If destination is a directory, append the input filename. if test -d "$dst"; then - if test -n "$no_target_directory"; then - echo "$0: $dst_arg: Is a directory" >&2 - exit 1 + if test "$is_target_a_directory" = never; then + echo "$0: $dst_arg: Is a directory" >&2 + exit 1 fi dstdir=$dst - dst=$dstdir/`basename "$src"` + dstbase=`basename "$src"` + case $dst in + */) dst=$dst$dstbase;; + *) dst=$dst/$dstbase;; + esac dstdir_status=0 else - # Prefer dirname, but fall back on a substitute if dirname fails. - dstdir=` - (dirname "$dst") 2>/dev/null || - expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$dst" : 'X\(//\)[^/]' \| \ - X"$dst" : 'X\(//\)$' \| \ - X"$dst" : 'X\(/\)' \| . 2>/dev/null || - echo X"$dst" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q' - ` - + dstdir=`dirname "$dst"` test -d "$dstdir" dstdir_status=$? fi fi + case $dstdir in + */) dstdirslash=$dstdir;; + *) dstdirslash=$dstdir/;; + esac + obsolete_mkdir_used=false if test $dstdir_status != 0; then case $posix_mkdir in '') - # Create intermediate dirs using mode 755 as modified by the umask. - # This is like FreeBSD 'install' as of 1997-10-28. - umask=`umask` - case $stripcmd.$umask in - # Optimize common cases. - *[2367][2367]) mkdir_umask=$umask;; - .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; - - *[0-7]) - mkdir_umask=`expr $umask + 22 \ - - $umask % 100 % 40 + $umask % 20 \ - - $umask % 10 % 4 + $umask % 2 - `;; - *) mkdir_umask=$umask,go-w;; - esac - - # With -d, create the new directory with the user-specified mode. - # Otherwise, rely on $mkdir_umask. - if test -n "$dir_arg"; then - mkdir_mode=-m$mode + # With -d, create the new directory with the user-specified mode. + # Otherwise, rely on $mkdir_umask. + if test -n "$dir_arg"; then + mkdir_mode=-m$mode + else + mkdir_mode= + fi + + posix_mkdir=false + # The $RANDOM variable is not portable (e.g., dash). Use it + # here however when possible just to lower collision chance. + tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ + + trap ' + ret=$? + rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null + exit $ret + ' 0 + + # Because "mkdir -p" follows existing symlinks and we likely work + # directly in world-writeable /tmp, make sure that the '$tmpdir' + # directory is successfully created first before we actually test + # 'mkdir -p'. + if (umask $mkdir_umask && + $mkdirprog $mkdir_mode "$tmpdir" && + exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1 + then + if test -z "$dir_arg" || { + # Check for POSIX incompatibilities with -m. + # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or + # other-writable bit of parent directory when it shouldn't. + # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. + test_tmpdir="$tmpdir/a" + ls_ld_tmpdir=`ls -ld "$test_tmpdir"` + case $ls_ld_tmpdir in + d????-?r-*) different_mode=700;; + d????-?--*) different_mode=755;; + *) false;; + esac && + $mkdirprog -m$different_mode -p -- "$test_tmpdir" && { + ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"` + test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" + } + } + then posix_mkdir=: + fi + rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" else - mkdir_mode= + # Remove any dirs left behind by ancient mkdir implementations. + rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null fi - - posix_mkdir=false - case $umask in - *[123567][0-7][0-7]) - # POSIX mkdir -p sets u+wx bits regardless of umask, which - # is incompatible with FreeBSD 'install' when (umask & 300) != 0. - ;; - *) - tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ - trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 - - if (umask $mkdir_umask && - exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 - then - if test -z "$dir_arg" || { - # Check for POSIX incompatibilities with -m. - # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or - # other-writeable bit of parent directory when it shouldn't. - # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. - ls_ld_tmpdir=`ls -ld "$tmpdir"` - case $ls_ld_tmpdir in - d????-?r-*) different_mode=700;; - d????-?--*) different_mode=755;; - *) false;; - esac && - $mkdirprog -m$different_mode -p -- "$tmpdir" && { - ls_ld_tmpdir_1=`ls -ld "$tmpdir"` - test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" - } - } - then posix_mkdir=: - fi - rmdir "$tmpdir/d" "$tmpdir" - else - # Remove any dirs left behind by ancient mkdir implementations. - rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null - fi - trap '' 0;; - esac;; + trap '' 0;; esac if $posix_mkdir && ( - umask $mkdir_umask && - $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" + umask $mkdir_umask && + $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" ) then : else - # The umask is ridiculous, or mkdir does not conform to POSIX, + # mkdir does not conform to POSIX, # or it failed possibly due to a race condition. Create the # directory the slow way, step by step, checking for races as we go. case $dstdir in - /*) prefix='/';; - -*) prefix='./';; - *) prefix='';; + /*) prefix='/';; + [-=\(\)!]*) prefix='./';; + *) prefix='';; esac - eval "$initialize_posix_glob" - oIFS=$IFS IFS=/ - $posix_glob set -f + set -f set fnord $dstdir shift - $posix_glob set +f + set +f IFS=$oIFS prefixes= for d do - test -z "$d" && continue - - prefix=$prefix$d - if test -d "$prefix"; then - prefixes= - else - if $posix_mkdir; then - (umask=$mkdir_umask && - $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break - # Don't fail if two instances are running concurrently. - test -d "$prefix" || exit 1 - else - case $prefix in - *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; - *) qprefix=$prefix;; - esac - prefixes="$prefixes '$qprefix'" - fi - fi - prefix=$prefix/ + test X"$d" = X && continue + + prefix=$prefix$d + if test -d "$prefix"; then + prefixes= + else + if $posix_mkdir; then + (umask $mkdir_umask && + $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break + # Don't fail if two instances are running concurrently. + test -d "$prefix" || exit 1 + else + case $prefix in + *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; + *) qprefix=$prefix;; + esac + prefixes="$prefixes '$qprefix'" + fi + fi + prefix=$prefix/ done if test -n "$prefixes"; then - # Don't fail if two instances are running concurrently. - (umask $mkdir_umask && - eval "\$doit_exec \$mkdirprog $prefixes") || - test -d "$dstdir" || exit 1 - obsolete_mkdir_used=true + # Don't fail if two instances are running concurrently. + (umask $mkdir_umask && + eval "\$doit_exec \$mkdirprog $prefixes") || + test -d "$dstdir" || exit 1 + obsolete_mkdir_used=true fi fi fi @@ -451,14 +433,25 @@ do else # Make a couple of temp file names in the proper directory. - dsttmp=$dstdir/_inst.$$_ - rmtmp=$dstdir/_rm.$$_ + dsttmp=${dstdirslash}_inst.$$_ + rmtmp=${dstdirslash}_rm.$$_ # Trap to clean up those temp files at exit. trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 # Copy the file name to the temp name. - (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && + (umask $cp_umask && + { test -z "$stripcmd" || { + # Create $dsttmp read-write so that cp doesn't create it read-only, + # which would cause strip to fail. + if test -z "$doit"; then + : >"$dsttmp" # No need to fork-exec 'touch'. + else + $doit touch "$dsttmp" + fi + } + } && + $doit_exec $cpprog "$src" "$dsttmp") && # and set any options; do chmod last to preserve setuid bits. # @@ -473,15 +466,12 @@ do # If -C, don't bother to copy if it wouldn't change the file. if $copy_on_change && - old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && - new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && - - eval "$initialize_posix_glob" && - $posix_glob set -f && + old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && + new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && + set -f && set X $old && old=:$2:$4:$5:$6 && set X $new && new=:$2:$4:$5:$6 && - $posix_glob set +f && - + set +f && test "$old" = "$new" && $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 then @@ -494,24 +484,24 @@ do # to itself, or perhaps because mv is so ancient that it does not # support -f. { - # Now remove or move aside any old file at destination location. - # We try this two ways since rm can't unlink itself on some - # systems and the destination file might be busy for other - # reasons. In this case, the final cleanup might fail but the new - # file should still install successfully. - { - test ! -f "$dst" || - $doit $rmcmd -f "$dst" 2>/dev/null || - { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && - { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } - } || - { echo "$0: cannot unlink or rename $dst" >&2 - (exit 1); exit 1 - } - } && - - # Now rename the file to the real destination. - $doit $mvcmd "$dsttmp" "$dst" + # Now remove or move aside any old file at destination location. + # We try this two ways since rm can't unlink itself on some + # systems and the destination file might be busy for other + # reasons. In this case, the final cleanup might fail but the new + # file should still install successfully. + { + test ! -f "$dst" || + $doit $rmcmd -f "$dst" 2>/dev/null || + { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && + { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } + } || + { echo "$0: cannot unlink or rename $dst" >&2 + (exit 1); exit 1 + } + } && + + # Now rename the file to the real destination. + $doit $mvcmd "$dsttmp" "$dst" } fi || exit 1 @@ -520,9 +510,9 @@ do done # Local variables: -# eval: (add-hook 'write-file-hooks 'time-stamp) +# eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-time-zone: "UTC" +# time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" -# End: +# End: \ No newline at end of file -- cgit v0.12 From 40c3ec35eed68747b5fcde78f05600dc10a58308 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Mon, 19 Oct 2020 07:25:23 +0000 Subject: Improve comment in install-sh, regarding Tcl-specific change --- unix/install-sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/unix/install-sh b/unix/install-sh index dc09dbd..21b733a 100755 --- a/unix/install-sh +++ b/unix/install-sh @@ -109,7 +109,7 @@ Options: -m MODE $chmodprog installed files to MODE. -o USER $chownprog installed files to USER. -s $stripprog installed files. - -S $stripprog installed files. + -S OPTION $stripprog installed files using OPTION. -t DIRECTORY install into DIRECTORY. -T report an error if DSTFILE is a directory. -- cgit v0.12 From ad823f4eb163905d291dadafb08d8e5a69765379 Mon Sep 17 00:00:00 2001 From: culler Date: Mon, 19 Oct 2020 19:22:39 +0000 Subject: Add a make variable to GNUmakefile for building the Tcl.framework for use as a subframework --- macosx/GNUmakefile | 3 +++ macosx/README | 11 +++++++++++ 2 files changed, 14 insertions(+) diff --git a/macosx/GNUmakefile b/macosx/GNUmakefile index 56e5500..e55b661 100644 --- a/macosx/GNUmakefile +++ b/macosx/GNUmakefile @@ -150,6 +150,9 @@ install-${PROJECT}: build-${PROJECT} ifeq (${EMBEDDED_BUILD}_${INSTALL_ROOT},1_) @echo "Cannot install-embedded with empty INSTALL_ROOT !" && false endif +ifeq (${SUBFRAMEWORK}_${DYLIB_INSTALL_DIR},1_) + @echo "Cannot install-subframework with empty DYLIB_INSTALL_DIR !" && false +endif ifeq (${EMBEDDED_BUILD},1) @rm -rf "${INSTALL_ROOT}${LIBDIR}/Tcl.framework" endif diff --git a/macosx/README b/macosx/README index c944c0a..cb36811 100644 --- a/macosx/README +++ b/macosx/README @@ -165,3 +165,14 @@ If you only want to build and install the debug or optimized build, use the For example, to build and install only the optimized versions: make -C tcl${ver}/macosx deploy sudo make -C tcl${ver}/macosx install-deploy + +- To build a Tcl.framework for use as a subframework in another framework, use the +install-embedded target and set SUBFRAMEWORK=1. Set the DYLIB_INSTALL_DIR +variable to the path which should be the install_name path of the Tcl library, set +the DESTDIR variable to the pathname of a staging directory where the framework +will be written . For example, running this command in the Tcl source directory: + make -C macosx install-embedded SUBFRAMEWORK=1 DESTDIR=/tmp/tcl \ + DYLIB_INSTALL_DIR=/Library/Frameworks/Some.framework/Versions/3.9/Frameworks/Tcl +will produce a Tcl.framework intended for installing as a subframework of the +Python.framework. The framework will be found in /tmp/tcl/Library/Frameworks/ + -- cgit v0.12 From 7f986a59bf53e05fac834aed3b3fb663669adadc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Ignacio=20Mar=C3=ADn?= Date: Tue, 20 Oct 2020 20:35:59 +0000 Subject: Update TZ info to tzdata2020c. --- library/tzdata/Pacific/Fiji | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/tzdata/Pacific/Fiji b/library/tzdata/Pacific/Fiji index e316b93..a062913 100644 --- a/library/tzdata/Pacific/Fiji +++ b/library/tzdata/Pacific/Fiji @@ -29,7 +29,7 @@ set TZData(:Pacific/Fiji) { {1547301600 43200 0 +12} {1573308000 46800 1 +12} {1578751200 43200 0 +12} - {1604757600 46800 1 +12} + {1608386400 46800 1 +12} {1610805600 43200 0 +12} {1636812000 46800 1 +12} {1642255200 43200 0 +12} -- cgit v0.12 From fd9662ee1c86d86ba0a92a616b5821fd389551e1 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Wed, 21 Oct 2020 07:48:31 +0000 Subject: Fix [c975939973]: Usage of gnu_printf in latest mingw-w64 --- generic/tcl.h | 2 +- win/tclWinInt.h | 4 ++++ win/tclWinPort.h | 4 ++++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/generic/tcl.h b/generic/tcl.h index 914f62b..a756a33 100644 --- a/generic/tcl.h +++ b/generic/tcl.h @@ -384,7 +384,7 @@ typedef long LONG; */ #if !defined(TCL_WIDE_INT_TYPE)&&!defined(TCL_WIDE_INT_IS_LONG) -# if defined(_WIN32) +# if defined(_WIN32) && (!defined(__USE_MINGW_ANSI_STDIO) || !__USE_MINGW_ANSI_STDIO) # define TCL_WIDE_INT_TYPE __int64 # ifdef __BORLANDC__ # define TCL_LL_MODIFIER "L" diff --git a/win/tclWinInt.h b/win/tclWinInt.h index 5f532bc..a44abd9 100644 --- a/win/tclWinInt.h +++ b/win/tclWinInt.h @@ -54,7 +54,11 @@ MODULE_SCOPE TclWinProcs tclWinProcs; #endif #ifdef _WIN64 +#if defined(__USE_MINGW_ANSI_STDIO) && __USE_MINGW_ANSI_STDIO +# define TCL_I_MODIFIER "ll" +#else # define TCL_I_MODIFIER "I" +#endif #else # define TCL_I_MODIFIER "" #endif diff --git a/win/tclWinPort.h b/win/tclWinPort.h index 8641e5e..6bfbf0c 100644 --- a/win/tclWinPort.h +++ b/win/tclWinPort.h @@ -18,6 +18,10 @@ /* See [Bug 3354324]: file mtime sets wrong time */ # define __MINGW_USE_VC2005_COMPAT #endif +#if !defined(__USE_MINGW_ANSI_STDIO) +/* See [Bug c975939973]: Usage of gnu_printf in latest mingw-w64 */ +# define __USE_MINGW_ANSI_STDIO 0 +#endif /* * We must specify the lower version we intend to support. -- cgit v0.12 From fb10e693b2a8b1d3c30b2de7c9899f0d7a7081a9 Mon Sep 17 00:00:00 2001 From: culler Date: Wed, 21 Oct 2020 18:02:31 +0000 Subject: When building a subframework for macOS use a build directory in the staging directory. --- macosx/GNUmakefile | 15 ++++++++++++--- macosx/README | 7 +++---- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/macosx/GNUmakefile b/macosx/GNUmakefile index e55b661..cdeb099 100644 --- a/macosx/GNUmakefile +++ b/macosx/GNUmakefile @@ -32,6 +32,18 @@ MANDIR ?= ${PREFIX}/man # set to non-empty value to install manpages in addition to html help: INSTALL_MANPAGES ?= +# Checks and overrides for subframework builds +ifeq (${SUBFRAMEWORK},1) +ifeq (${DYLIB_INSTALL_DIR},) + @echo "Cannot install subframework with empty DYLIB_INSTALL_DIR !" && false +endif +ifeq (${DESTDIR},) + @echo "Cannot install subframework with empty DESTDIR !" && false +endif +override BUILD_DIR = ${DESTDIR}/build +override INSTALL_PATH = /Frameworks +endif + #------------------------------------------------------------------------------------------------------- # meta targets @@ -150,9 +162,6 @@ install-${PROJECT}: build-${PROJECT} ifeq (${EMBEDDED_BUILD}_${INSTALL_ROOT},1_) @echo "Cannot install-embedded with empty INSTALL_ROOT !" && false endif -ifeq (${SUBFRAMEWORK}_${DYLIB_INSTALL_DIR},1_) - @echo "Cannot install-subframework with empty DYLIB_INSTALL_DIR !" && false -endif ifeq (${EMBEDDED_BUILD},1) @rm -rf "${INSTALL_ROOT}${LIBDIR}/Tcl.framework" endif diff --git a/macosx/README b/macosx/README index cb36811..c2bcc42 100644 --- a/macosx/README +++ b/macosx/README @@ -172,7 +172,6 @@ variable to the path which should be the install_name path of the Tcl library, s the DESTDIR variable to the pathname of a staging directory where the framework will be written . For example, running this command in the Tcl source directory: make -C macosx install-embedded SUBFRAMEWORK=1 DESTDIR=/tmp/tcl \ - DYLIB_INSTALL_DIR=/Library/Frameworks/Some.framework/Versions/3.9/Frameworks/Tcl -will produce a Tcl.framework intended for installing as a subframework of the -Python.framework. The framework will be found in /tmp/tcl/Library/Frameworks/ - + DYLIB_INSTALL_DIR=/Library/Frameworks/Some.framework/Versions/X.Y/Frameworks/Tcl.framework +will produce a Tcl.framework intended for installing as a subframework of +Some.framework. The framework will be found in /tmp/tcl/Frameworks/ -- cgit v0.12 From c41f6053680bfa7bf4537af890349ddf5b543d33 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Thu, 22 Oct 2020 09:23:49 +0000 Subject: (cherry-pick): Fix [c975939973]: Usage of gnu_printf in latest mingw-w64. Change (internal, windows-only) TCL_I_MODIFIER to TCL_Z_MODIFIER, since that's how it's called in Tcl 8.7 and up --- generic/tcl.h | 2 +- win/tclWin32Dll.c | 2 +- win/tclWinChan.c | 16 ++++++++-------- win/tclWinConsole.c | 2 +- win/tclWinInt.h | 15 +++++++++++---- win/tclWinPipe.c | 10 +++++----- win/tclWinPort.h | 4 ++++ win/tclWinSerial.c | 4 ++-- win/tclWinSock.c | 20 ++++++++++---------- 9 files changed, 43 insertions(+), 32 deletions(-) diff --git a/generic/tcl.h b/generic/tcl.h index d7d064c..3232734 100644 --- a/generic/tcl.h +++ b/generic/tcl.h @@ -354,7 +354,7 @@ typedef long LONG; */ #if !defined(TCL_WIDE_INT_TYPE)&&!defined(TCL_WIDE_INT_IS_LONG) -# if defined(__WIN32__) +# if defined(__WIN32__) && (!defined(__USE_MINGW_ANSI_STDIO) || !__USE_MINGW_ANSI_STDIO) # define TCL_WIDE_INT_TYPE __int64 # ifdef __BORLANDC__ # define TCL_LL_MODIFIER "L" diff --git a/win/tclWin32Dll.c b/win/tclWin32Dll.c index 560b448..33c29f7 100644 --- a/win/tclWin32Dll.c +++ b/win/tclWin32Dll.c @@ -543,7 +543,7 @@ TclpGetCStackParams( if (!tsdPtr->stackBound || ((UINT_PTR)&tsdPtr < (UINT_PTR)tsdPtr->stackBound)) { - /* + /* * Either we haven't determined the stack bound in this thread, * or else we've overflowed the bound that we previously * determined. We need to find a new stack bound from diff --git a/win/tclWinChan.c b/win/tclWinChan.c index a271919..6073e2f 100644 --- a/win/tclWinChan.c +++ b/win/tclWinChan.c @@ -967,7 +967,7 @@ TclpOpenFileChannel( switch (FileGetType(handle)) { case FILE_TYPE_SERIAL: /* - * Natively named serial ports "com1-9", "\\\\.\\comXX" are + * Natively named serial ports "com1-9", "\\\\.\\comXX" are * already done with the code above. * Here we handle all other serial port names. * @@ -1356,7 +1356,7 @@ TclWinOpenFileChannel( infoPtr->flags = appendMode; infoPtr->handle = handle; infoPtr->dirty = 0; - sprintf(channelName, "file%" TCL_I_MODIFIER "x", (size_t)infoPtr); + sprintf(channelName, "file%" TCL_Z_MODIFIER "x", (size_t)infoPtr); infoPtr->channel = Tcl_CreateChannel(&fileChannelType, channelName, (ClientData) infoPtr, permissions); @@ -1518,8 +1518,8 @@ FileGetType( * NativeIsComPort -- * * Determines if a path refers to a Windows serial port. - * A simple and efficient solution is to use a "name hint" to detect - * COM ports by their filename instead of resorting to a syscall + * A simple and efficient solution is to use a "name hint" to detect + * COM ports by their filename instead of resorting to a syscall * to detect serialness after the fact. * The following patterns cover common serial port names: * COM[1-9]:? @@ -1547,7 +1547,7 @@ NativeIsComPort( * 1. Look for com[1-9]:? */ - if ( (len >= 4) && (len <= 5) + if ( (len >= 4) && (len <= 5) && (_wcsnicmp(p, L"com", 3) == 0) ) { /* * The 4th character must be a digit 1..9 optionally followed by a ":" @@ -1566,7 +1566,7 @@ NativeIsComPort( * 2. Look for //./com[0-9]+ or \\.\com[0-9]+ */ - if ( (len >= 8) && ( + if ( (len >= 8) && ( (_wcsnicmp(p, L"//./com", 7) == 0) || (_wcsnicmp(p, L"\\\\.\\com", 7) == 0) ) ) { @@ -1590,7 +1590,7 @@ NativeIsComPort( * 1. Look for com[1-9]:? */ - if ( (len >= 4) && (len <= 5) + if ( (len >= 4) && (len <= 5) && (strnicmp(p, "com", 3) == 0) ) { /* * The 4th character must be a digit 1..9 optionally followed by a ":" @@ -1609,7 +1609,7 @@ NativeIsComPort( * 2. Look for //./com[0-9]+ or \\.\com[0-9]+ */ - if ( (len >= 8) && ( + if ( (len >= 8) && ( (strnicmp(p, "//./com", 7) == 0) || (strnicmp(p, "\\\\.\\com", 7) == 0) ) ) { diff --git a/win/tclWinConsole.c b/win/tclWinConsole.c index 361fb3d..a563748 100644 --- a/win/tclWinConsole.c +++ b/win/tclWinConsole.c @@ -1361,7 +1361,7 @@ TclWinOpenConsoleChannel( * for instance). */ - sprintf(channelName, "file%" TCL_I_MODIFIER "x", (size_t)infoPtr); + sprintf(channelName, "file%" TCL_Z_MODIFIER "x", (size_t)infoPtr); infoPtr->channel = Tcl_CreateChannel(&consoleChannelType, channelName, (ClientData) infoPtr, permissions); diff --git a/win/tclWinInt.h b/win/tclWinInt.h index 39790a0..a84d218 100644 --- a/win/tclWinInt.h +++ b/win/tclWinInt.h @@ -52,11 +52,18 @@ typedef struct TCLEXCEPTION_REGISTRATION { #define VER_PLATFORM_WIN32_CE 3 #endif -#ifdef _WIN64 -# define TCL_I_MODIFIER "I" -#else -# define TCL_I_MODIFIER "" +#ifndef TCL_Z_MODIFIER +# ifdef _WIN64 +# if defined(__USE_MINGW_ANSI_STDIO) && __USE_MINGW_ANSI_STDIO +# define TCL_Z_MODIFIER "ll" +# else +# define TCL_Z_MODIFIER "I" +# endif +# else +# define TCL_Z_MODIFIER "" +# endif #endif +#define TCL_I_MODIFIER TCL_Z_MODIFIER /* * The following structure keeps track of whether we are using the diff --git a/win/tclWinPipe.c b/win/tclWinPipe.c index cdb955f..fd941d7 100644 --- a/win/tclWinPipe.c +++ b/win/tclWinPipe.c @@ -1580,10 +1580,10 @@ QuoteCmdLinePart( QuoteCmdLineBackslash(dsPtr, start, *bspos, NULL); start = *bspos; } - /* - * escape all special chars enclosed in quotes like `"..."`, note that here we + /* + * escape all special chars enclosed in quotes like `"..."`, note that here we * don't must escape `\` (with `\`), because it's outside of the main quotes, - * so `\` remains `\`, but important - not at end of part, because results as + * so `\` remains `\`, but important - not at end of part, because results as * before the quote, so `%\%\` should be escaped as `"%\%"\\`). */ Tcl_DStringAppend(dsPtr, "\"", 1); /* opening escape quote-char */ @@ -1738,7 +1738,7 @@ BuildCommandLine( special++; } /* rest of argument (and escape backslashes before closing main quote) */ - QuoteCmdLineBackslash(&ds, start, special, + QuoteCmdLineBackslash(&ds, start, special, (quote & CL_QUOTE) ? bspos : NULL); } if (quote & CL_QUOTE) { @@ -1836,7 +1836,7 @@ TclpCreateCommandChannel( * unique, in case channels share handles (stdin/stdout). */ - sprintf(channelName, "file%" TCL_I_MODIFIER "x", (size_t)infoPtr); + sprintf(channelName, "file%" TCL_Z_MODIFIER "x", (size_t)infoPtr); infoPtr->channel = Tcl_CreateChannel(&pipeChannelType, channelName, (ClientData) infoPtr, infoPtr->validMask); diff --git a/win/tclWinPort.h b/win/tclWinPort.h index d3dbb1b..358398d 100644 --- a/win/tclWinPort.h +++ b/win/tclWinPort.h @@ -19,6 +19,10 @@ /* See [Bug 3354324]: file mtime sets wrong time */ # define __MINGW_USE_VC2005_COMPAT #endif +#if !defined(__USE_MINGW_ANSI_STDIO) +/* See [Bug c975939973]: Usage of gnu_printf in latest mingw-w64 */ +# define __USE_MINGW_ANSI_STDIO 0 +#endif #define WIN32_LEAN_AND_MEAN #include diff --git a/win/tclWinSerial.c b/win/tclWinSerial.c index 83f1866..7bfada7 100644 --- a/win/tclWinSerial.c +++ b/win/tclWinSerial.c @@ -1415,7 +1415,7 @@ SerialWriterThread( * Opens or Reopens the serial port with the OVERLAPPED FLAG set * * Results: - * Returns the new handle, or INVALID_HANDLE_VALUE. + * Returns the new handle, or INVALID_HANDLE_VALUE. * If an existing channel is specified it is closed and reopened. * * Side effects: @@ -1502,7 +1502,7 @@ TclWinOpenSerialChannel( * are shared between multiple channels (stdin/stdout). */ - sprintf(channelName, "file%" TCL_I_MODIFIER "x", (size_t)infoPtr); + sprintf(channelName, "file%" TCL_Z_MODIFIER "x", (size_t)infoPtr); infoPtr->channel = Tcl_CreateChannel(&serialChannelType, channelName, (ClientData) infoPtr, permissions); diff --git a/win/tclWinSock.c b/win/tclWinSock.c index 11632c4..8a1832a 100644 --- a/win/tclWinSock.c +++ b/win/tclWinSock.c @@ -691,7 +691,7 @@ SocketEventProc( if (infoPtr->lastError) { mask |= TCL_READABLE; - + } else { fd_set readFds; struct timeval timeout; @@ -1005,7 +1005,7 @@ CreateSocket( * Register for interest in events in the select mask. Note that this * automatically places the socket into non-blocking mode. */ - + ioctlsocket(sock, (long) FIONBIO, &flag); SendMessage(tsdPtr->hwnd, SOCKET_SELECT, (WPARAM) SELECT, (LPARAM) infoPtr); @@ -1056,7 +1056,7 @@ CreateSocket( infoPtr->selectEvents |= FD_CONNECT | FD_READ | FD_WRITE | FD_CLOSE; infoPtr->flags |= SOCKET_ASYNC_CONNECT; - + /* * Free list lock */ @@ -1257,7 +1257,7 @@ WaitForSocketEvent( if ( 0 == (events & FD_CONNECT) ) { SendMessage(tsdPtr->hwnd, SOCKET_SELECT, (WPARAM) UNSELECT, (LPARAM) infoPtr); - + SendMessage(tsdPtr->hwnd, SOCKET_SELECT, (WPARAM) SELECT, (LPARAM) infoPtr); } @@ -1329,7 +1329,7 @@ Tcl_OpenTcpClient( return NULL; } - sprintf(channelName, "sock%" TCL_I_MODIFIER "u", (size_t)infoPtr->socket); + sprintf(channelName, "sock%" TCL_Z_MODIFIER "u", (size_t)infoPtr->socket); infoPtr->channel = Tcl_CreateChannel(&tcpChannelType, channelName, (ClientData) infoPtr, (TCL_READABLE | TCL_WRITABLE)); @@ -1394,7 +1394,7 @@ Tcl_MakeTcpClientChannel( SendMessage(tsdPtr->hwnd, SOCKET_SELECT, (WPARAM) SELECT, (LPARAM) infoPtr); - sprintf(channelName, "sock%" TCL_I_MODIFIER "u", (size_t)infoPtr->socket); + sprintf(channelName, "sock%" TCL_Z_MODIFIER "u", (size_t)infoPtr->socket); infoPtr->channel = Tcl_CreateChannel(&tcpChannelType, channelName, (ClientData) infoPtr, (TCL_READABLE | TCL_WRITABLE)); Tcl_SetChannelOption(NULL, infoPtr->channel, "-translation", "auto crlf"); @@ -1447,7 +1447,7 @@ Tcl_OpenTcpServer( infoPtr->acceptProc = acceptProc; infoPtr->acceptProcData = acceptProcData; - sprintf(channelName, "sock%" TCL_I_MODIFIER "u", (size_t)infoPtr->socket); + sprintf(channelName, "sock%" TCL_Z_MODIFIER "u", (size_t)infoPtr->socket); infoPtr->channel = Tcl_CreateChannel(&tcpChannelType, channelName, (ClientData) infoPtr, 0); @@ -1553,7 +1553,7 @@ TcpAccept( SendMessage(tsdPtr->hwnd, SOCKET_SELECT, (WPARAM) SELECT, (LPARAM) newInfoPtr); - sprintf(channelName, "sock%" TCL_I_MODIFIER "u", (size_t)newInfoPtr->socket); + sprintf(channelName, "sock%" TCL_Z_MODIFIER "u", (size_t)newInfoPtr->socket); newInfoPtr->channel = Tcl_CreateChannel(&tcpChannelType, channelName, (ClientData) newInfoPtr, (TCL_READABLE | TCL_WRITABLE)); if (Tcl_SetChannelOption(NULL, newInfoPtr->channel, "-translation", @@ -2619,11 +2619,11 @@ TcpThreadActionProc( WaitForSingleObject(tsdPtr->socketListLock, INFINITE); infoPtr->nextPtr = tsdPtr->socketList; tsdPtr->socketList = infoPtr; - + if (infoPtr == tsdPtr->pendingSocketInfo) { tsdPtr->pendingSocketInfo = NULL; } - + SetEvent(tsdPtr->socketListLock); notifyCmd = SELECT; -- cgit v0.12 From be83197ee590ec252235b5684a13f8d42e35c814 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Thu, 22 Oct 2020 10:52:11 +0000 Subject: TIP #587: One place more where TCL_CFGVAL_ENCODING should fall back to utf-8 --- generic/tclPkgConfig.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/generic/tclPkgConfig.c b/generic/tclPkgConfig.c index 83a00dd..12df68e 100644 --- a/generic/tclPkgConfig.c +++ b/generic/tclPkgConfig.c @@ -36,11 +36,7 @@ #include "tclInt.h" #ifndef TCL_CFGVAL_ENCODING -# ifdef _WIN32 -# define TCL_CFGVAL_ENCODING "cp1252" -# else -# define TCL_CFGVAL_ENCODING "iso8859-1" -# endif +# define TCL_CFGVAL_ENCODING "utf-8" #endif /* -- cgit v0.12