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