diff options
91 files changed, 1323 insertions, 1212 deletions
diff --git a/.gitattributes b/.gitattributes new file mode 100755 index 0000000..82bed50 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,37 @@ +# Set the default behavior, in case people don't have core.autocrlf set. +* text eol=lf + +# Explicitly declare text files you want to always be normalized and converted +# to native line endings on checkout. +*.3 text +*.c text +*.css text +*.enc text +*.h text +*.htm text +*.html text +*.java text +*.js text +*.json text +*.n text +*.svg text +*.ts text +*.tcl text +*.test text + +# Declare files that will always have CRLF line endings on checkout. +*.bat text eol=crlf +*.sln text eol=crlf +*.vc text eol=crlf + +# Denote all files that are truly binary and should not be modified. +*.a binary +*.dll binary +*.exe binary +*.gif binary +*.jpg binary +*.lib binary +*.pdf binary +*.png binary +*.xlsx binary +*.zip binary diff --git a/.gitignore b/.gitignore new file mode 100755 index 0000000..99fd07e --- /dev/null +++ b/.gitignore @@ -0,0 +1,50 @@ +*.a +*.dll +*.dylib +*.exe +*.exp +*.lib +*.o +*.obj +*.pdb +*.res +*.sl +*.so +*/Makefile +*/config.cache +*/config.log +*/config.status +*/tclConfig.sh +*/tclsh* +*/tcltest* +*/versions.vc +*/version.vc +html +libtommath/bn.ilg +libtommath/bn.ind +libtommath/pretty.build +libtommath/tommath.src +libtommath/*.log +libtommath/*.pdf +libtommath/*.pl +libtommath/*.sh +libtommath/doc/* +libtommath/tombc/* +libtommath/pre_gen/* +libtommath/pics/* +libtommath/mtest/* +libtommath/logs/* +libtommath/etc/* +libtommath/demo/* +libtommath/*.out +libtommath/*.tex +unix/autoMkindex.tcl +unix/dltest.marker +unix/tcl.pc +unix/tclIndex +unix/pkgs/* +win/Debug* +win/Release* +win/pkgs/* +win/tcl.hpj +win/nmhlp-out.txt diff --git a/.travis.yml b/.travis.yml index 40f0daa..8356d83 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,51 +3,87 @@ language: c matrix: include: - - os: linux +# Testing on Linux with various compilers + - name: "Linux/Clang/Shared" + os: linux dist: xenial compiler: clang env: - BUILD_DIR=unix - - os: linux + - name: "Linux/Clang/Shared: UTF_MAX=4" + os: linux + dist: xenial + compiler: clang + env: + - BUILD_DIR=unix + - CFGOPT=CFLAGS=-DTCL_UTF_MAX=4 + - name: "Linux/Clang/Shared: NO_DEPRECATED" + os: linux dist: xenial compiler: clang env: - - CFGOPT=--disable-shared - BUILD_DIR=unix - - os: linux + - CFGOPT=CFLAGS=-DTCL_NO_DEPRECATED=1 +# full-debug build disabled, because it is currently failing. +# - name: "Linux/Clang/Shared: full-debug" +# os: linux +# dist: xenial +# compiler: clang +# env: +# - BUILD_DIR=unix +# - CFGOPT=--enable-symbols=all + - name: "Linux/GCC/Shared" + os: linux dist: xenial compiler: gcc env: - BUILD_DIR=unix - - os: linux + - name: "Linux/GCC/Static" + os: linux dist: xenial compiler: gcc env: - CFGOPT=--disable-shared - BUILD_DIR=unix - - os: linux + - name: "Linux/GCC/Shared: UTF_MAX=4" + os: linux dist: xenial - compiler: gcc-4.9 - addons: - apt: - sources: - - ubuntu-toolchain-r-test - packages: - - g++-4.9 + compiler: gcc + env: + - BUILD_DIR=unix + - CFGOPT=CFLAGS=-DTCL_UTF_MAX=4 + - name: "Linux/GCC/Shared: NO_DEPRECATED" + os: linux + dist: xenial + compiler: gcc env: - BUILD_DIR=unix - - os: linux + - CFGOPT=CFLAGS=-DTCL_NO_DEPRECATED=1 +# Debug build. Running test-cases disabled, because it is currently failing. + - name: "Linux/GCC/Debug/no test" + os: linux dist: xenial - compiler: gcc-5 + compiler: gcc + env: + - BUILD_DIR=unix + - CFGOPT=--enable-symbols=all + script: + - make all tcltest +# Older versions of GCC... + - name: "Linux/GCC 7/Shared" + os: linux + dist: xenial + compiler: gcc-7 addons: apt: sources: - ubuntu-toolchain-r-test packages: - - g++-5 + - g++-7 env: - BUILD_DIR=unix - - os: linux + - name: "Linux/GCC 6/Shared" + os: linux dist: xenial compiler: gcc-6 addons: @@ -58,70 +94,98 @@ matrix: - g++-6 env: - BUILD_DIR=unix - - os: linux + - name: "Linux/GCC 5/Shared" + os: linux dist: xenial - compiler: gcc-7 + compiler: gcc-5 addons: apt: sources: - ubuntu-toolchain-r-test packages: - - g++-7 + - g++-5 env: - BUILD_DIR=unix - - os: linux + - name: "Linux/GCC 4.9/Shared" + os: linux dist: xenial - compiler: gcc-7 + compiler: gcc-4.9 addons: apt: sources: - ubuntu-toolchain-r-test packages: - - g++-7 + - g++-4.9 env: - BUILD_DIR=unix - - CFGOPT=CFLAGS=-DTCL_UTF_MAX=4 - - os: linux +# Clang + - name: "Linux/Clang/Shared" + os: linux dist: xenial - compiler: gcc-7 - addons: - apt: - sources: - - ubuntu-toolchain-r-test - packages: - - g++-7 + compiler: clang env: - BUILD_DIR=unix - - CFGOPT=CFLAGS=-DTCL_NO_DEPRECATED=1 - - os: osx - osx_image: xcode8 + - name: "Linux/Clang/Static" + os: linux + dist: xenial + compiler: clang env: + - CFGOPT=--disable-shared - BUILD_DIR=unix - - os: osx - osx_image: xcode8 +# Debug build. Running test-cases disabled, because it is currently failing. + - name: "Linux/Clang/Debug/no test" + os: linux + dist: xenial + compiler: clang + env: + - BUILD_DIR=unix + - CFGOPT=--enable-symbols=all + script: + - make all tcltest +# Testing on Mac, various styles + - name: "macOS/Xcode 11/Shared/Unix-like" + os: osx + osx_image: xcode11 + env: + - BUILD_DIR=unix + - name: "macOS/Xcode 11/Shared" + os: osx + osx_image: xcode11 + env: + - BUILD_DIR=macosx + install: [] + script: &mactest + - make all + # The styles=develop avoids some weird problems on OSX + - make test styles=develop + - name: "macOS/Xcode 10/Shared" + os: osx + osx_image: xcode10.2 env: - BUILD_DIR=macosx - - NO_DIRECT_CONFIGURE=1 - - os: osx + install: [] + script: *mactest + - name: "macOS/Xcode 9/Shared" + os: osx osx_image: xcode9 env: - BUILD_DIR=macosx - - NO_DIRECT_CONFIGURE=1 - - os: osx - osx_image: xcode10.2 + install: [] + script: *mactest + - name: "macOS/Xcode 8/Shared" + os: osx + osx_image: xcode8 env: - BUILD_DIR=macosx - - NO_DIRECT_CONFIGURE=1 -### C builds not currently supported on Windows instances -# - os: windows -# env: -# - BUILD_DIR=win -### ... so proxy with a Mingw cross-compile -# Test with mingw-w64 (32 bit) - - os: linux + install: [] + script: *mactest +# Test with mingw-w64 (32 bit) cross-compile +# Doesn't run tests because wine is only an imperfect Windows emulation + - name: "Linux-cross-Windows-32/GCC/Shared/no test" + os: linux dist: xenial compiler: i686-w64-mingw32-gcc - addons: + addons: &mingw32 apt: packages: - gcc-mingw-w64-base @@ -133,60 +197,54 @@ matrix: env: - BUILD_DIR=win - CFGOPT=--host=i686-w64-mingw32 - - NO_DIRECT_TEST=1 - - os: linux + script: &crosstest + - make all tcltest + # Include a high visibility marker that tests are skipped outright + - > + echo "`tput setaf 3`SKIPPED TEST: CROSS COMPILING`tput sgr0`" + - name: "Linux-cross-Windows-32/GCC/Static/no test" + os: linux dist: xenial compiler: i686-w64-mingw32-gcc - addons: - apt: - packages: - - gcc-mingw-w64-base - - binutils-mingw-w64-i686 - - gcc-mingw-w64-i686 - - gcc-mingw-w64 - - gcc-multilib - - wine + addons: *mingw32 env: - BUILD_DIR=win - CFGOPT="--host=i686-w64-mingw32 --disable-shared" - - NO_DIRECT_TEST=1 - - os: linux + script: *crosstest + - name: "Linux-cross-Windows-32/GCC/Shared/no test: UTF_MAX=4" + os: linux dist: xenial compiler: i686-w64-mingw32-gcc - addons: - apt: - packages: - - gcc-mingw-w64-base - - binutils-mingw-w64-i686 - - gcc-mingw-w64-i686 - - gcc-mingw-w64 - - gcc-multilib - - wine + addons: *mingw32 env: - BUILD_DIR=win - CFGOPT="--host=i686-w64-mingw32 CFLAGS=-DTCL_UTF_MAX=4" - - NO_DIRECT_TEST=1 - - os: linux + script: *crosstest + - name: "Linux-cross-Windows-32/GCC/Shared/no test: NO_DEPRECATED" + os: linux dist: xenial compiler: i686-w64-mingw32-gcc - addons: - apt: - packages: - - gcc-mingw-w64-base - - binutils-mingw-w64-i686 - - gcc-mingw-w64-i686 - - gcc-mingw-w64 - - gcc-multilib - - wine + addons: *mingw32 env: - BUILD_DIR=win - CFGOPT="--host=i686-w64-mingw32 CFLAGS=-DTCL_NO_DEPRECATED=1" - - NO_DIRECT_TEST=1 + script: *crosstest + - name: "Linux-cross-Windows-32/GCC/Debug/no test" + os: linux + dist: xenial + compiler: i686-w64-mingw32-gcc + addons: *mingw32 + env: + - BUILD_DIR=win + - CFGOPT="--host=i686-w64-mingw32 --enable-symbols" + script: *crosstest # Test with mingw-w64 (64 bit) - - os: linux +# Doesn't run tests because wine is only an imperfect Windows emulation + - name: "Linux-cross-Windows-64/GCC/Shared/no test" + os: linux dist: xenial compiler: x86_64-w64-mingw32-gcc - addons: + addons: &mingw64 apt: packages: - gcc-mingw-w64-base @@ -197,58 +255,99 @@ matrix: env: - BUILD_DIR=win - CFGOPT="--host=x86_64-w64-mingw32 --enable-64bit" - - NO_DIRECT_TEST=1 - - os: linux + script: *crosstest + - name: "Linux-cross-Windows-64/GCC/Static/no test" + os: linux dist: xenial compiler: x86_64-w64-mingw32-gcc - addons: - apt: - packages: - - gcc-mingw-w64-base - - binutils-mingw-w64-x86-64 - - gcc-mingw-w64-x86-64 - - gcc-mingw-w64 - - wine + addons: *mingw64 env: - BUILD_DIR=win - CFGOPT="--host=x86_64-w64-mingw32 --enable-64bit --disable-shared" - - NO_DIRECT_TEST=1 - - os: linux + script: *crosstest + - name: "Linux-cross-Windows-64/GCC/Shared/no test: UTF_MAX=4" + os: linux dist: xenial compiler: x86_64-w64-mingw32-gcc - addons: - apt: - packages: - - gcc-mingw-w64-base - - binutils-mingw-w64-x86-64 - - gcc-mingw-w64-x86-64 - - gcc-mingw-w64 - - wine + addons: *mingw64 env: - BUILD_DIR=win - CFGOPT="--host=x86_64-w64-mingw32 --enable-64bit CFLAGS=-DTCL_UTF_MAX=4" - - NO_DIRECT_TEST=1 - - os: linux + script: *crosstest + - name: "Linux-cross-Windows-64/GCC/Shared/no test: NO_DEPRECATED" + os: linux dist: xenial compiler: x86_64-w64-mingw32-gcc - addons: - apt: - packages: - - gcc-mingw-w64-base - - binutils-mingw-w64-x86-64 - - gcc-mingw-w64-x86-64 - - gcc-mingw-w64 - - wine + addons: *mingw64 env: - BUILD_DIR=win - CFGOPT="--host=x86_64-w64-mingw32 --enable-64bit CFLAGS=-DTCL_NO_DEPRECATED=1" - - NO_DIRECT_TEST=1 + script: *crosstest + - name: "Linux-cross-Windows-64/GCC/Debug/no test" + os: linux + dist: xenial + compiler: x86_64-w64-mingw32-gcc + addons: *mingw64 + env: + - BUILD_DIR=win + - CFGOPT="--host=x86_64-w64-mingw32 --enable-64bit --enable-symbols" + script: *crosstest +# Test on Windows with MSVC native + - name: "Windows/MSVC/Shared" + os: windows + compiler: cl + env: &vcenv + - BUILD_DIR=win + - VCDIR="/C/Program Files (x86)/Microsoft Visual Studio/2017/BuildTools/VC/Auxiliary/Build" + before_install: &vcpreinst + - PATH="$PATH:$VCDIR" + - cd ${BUILD_DIR} + install: [] + script: + - cmd.exe /C 'vcvarsall.bat x64 && nmake -f makefile.vc all tcltest' + - cmd.exe /C 'vcvarsall.bat x64 && nmake -f makefile.vc test' + - name: "Windows/MSVC/Shared: NO_DEPRECATED" + os: windows + compiler: cl + env: *vcenv + before_install: *vcpreinst + install: [] + script: + - cmd.exe /C 'vcvarsall.bat x64 && nmake OPTS=nodep -f makefile.vc all tcltest' + - cmd.exe /C 'vcvarsall.bat x64 && nmake OPTS=nodep -f makefile.vc test' + - name: "Windows/MSVC/Shared: UTF_MAX=6" + os: windows + compiler: cl + env: *vcenv + before_install: *vcpreinst + install: [] + script: + - cmd.exe /C 'vcvarsall.bat x64 && nmake OPTS=utfmax -f makefile.vc all tcltest' + - cmd.exe /C 'vcvarsall.bat x64 && nmake OPTS=utfmax -f makefile.vc test' + - name: "Windows/MSVC/Static" + os: windows + compiler: cl + env: *vcenv + before_install: *vcpreinst + install: [] + script: + - cmd.exe /C 'vcvarsall.bat x64 && nmake OPTS=static -f makefile.vc all tcltest' + - cmd.exe /C 'vcvarsall.bat x64 && nmake OPTS=static -f makefile.vc test' + - name: "Windows/MSVC/Debug" + os: windows + compiler: cl + env: *vcenv + before_install: *vcpreinst + install: [] + script: + - cmd.exe /C 'vcvarsall.bat x64 && nmake OPTS=symbols -f makefile.vc all tcltest' + - cmd.exe /C 'vcvarsall.bat x64 && nmake OPTS=symbols -f makefile.vc test' before_install: - - export ERROR_ON_FAILURES=1 - cd ${BUILD_DIR} install: - - test -n "$NO_DIRECT_CONFIGURE" || ./configure ${CFGOPT} + - ./configure ${CFGOPT} --prefix=$HOME +before_script: + - export ERROR_ON_FAILURES=1 script: - - make - # The styles=develop avoids some weird problems on OSX - - test -n "$NO_DIRECT_TEST" || make test styles=develop + - make all tcltest + - make test diff --git a/compat/stdlib.h b/compat/stdlib.h index 6900be3..bb0f133 100644 --- a/compat/stdlib.h +++ b/compat/stdlib.h @@ -5,7 +5,7 @@ * This file isn't complete in the ANSI-C sense; it only declares things * that are needed by Tcl. This file is needed even on many systems with * their own stdlib.h (e.g. SunOS) because not all stdlib.h files declare - * all the procedures needed here (such as strtod). + * all the procedures needed here (such as strtol/strtoul). * * Copyright (c) 1991 The Regents of the University of California. * Copyright (c) 1994-1998 Sun Microsystems, Inc. diff --git a/doc/Class.3 b/doc/Class.3 index 1c3fe08..57203d5 100644 --- a/doc/Class.3 +++ b/doc/Class.3 @@ -79,7 +79,9 @@ The number of elements in the \fIobjv\fR array. The arguments to the command to create the instance of the class. .AP int skip in The number of arguments at the start of the argument array, \fIobjv\fR, that -are not arguments to any constructors. +are not arguments to any constructors. This allows the generation of correct +error messages even when complicated calling patterns are used (e.g., via the +\fBnext\fR command). .AP Tcl_ObjectMetadataType *metaTypePtr in The type of \fImetadata\fR being set with \fBTcl_ClassSetMetadata\fR or retrieved with \fBTcl_ClassGetMetadata\fR. @@ -109,7 +111,9 @@ may be retrieved using the \fBTcl_GetObjectCommand\fR function, the name of the object (and hence the name of the command) with \fBTcl_GetObjectName\fR, and the namespace may be retrieved using the \fBTcl_GetObjectNamespace\fR function. Note that the Tcl_Obj reference returned by \fBTcl_GetObjectName\fR -is a shared reference. +is a shared reference. You can also get whether the object has been marked for +deletion with \fBTcl_ObjectDeleted\fR (it returns true if deletion of the +object has begun); this can be useful during the processing of methods. .PP Instances of classes are created using \fBTcl_NewObjectInstance\fR, which creates an object from any class (and which is internally called by both @@ -121,6 +125,16 @@ created object, or NULL if the creation failed (when an error message will be left in the interpreter result). In addition, objects may be copied by using \fBTcl_CopyObjectInstance\fR which creates a copy of an object without running any constructors. +.PP +Note that the lifetime management of objects is handled internally within +TclOO, and does not use \fBTcl_Preserve\fR. \fIIt is not safe to put a +Tcl_Object handle in a C structure with a lifespan different to the object;\fR +you should use the object's command name (as retrieved with +\fBTcl_GetObjectName\fR) instead. It is safe to use a Tcl_Object handle for +the lifespan of a call of a method on that object; handles do not become +invalid while there is an outstanding call on their object (even if the only +operation guaranteed to be safe on them is \fBTcl_ObjectDeleted\fR; the other +operations are only guaranteed to work on non-deleted objects). .SH "OBJECT AND CLASS METADATA" .PP Every object and every class may have arbitrary amounts of metadata attached diff --git a/doc/Encoding.3 b/doc/Encoding.3 index c801f3c..e91c320 100644 --- a/doc/Encoding.3 +++ b/doc/Encoding.3 @@ -259,13 +259,13 @@ is filled with the corresponding number of bytes that were stored in convenience functions for converting between UTF-8 and Windows strings based on the TCHAR type which is by convention a Unicode character on Windows NT. Those functions are deprecated. You can use -\fBTcl_UtfToUtf16DString\fR resp. \fBTcl_Utf16ToUtfDString\fR as replacement. +\fBTcl_UtfToChar16DString\fR resp. \fBTcl_Char16ToUtfDString\fR as replacement. If you want compatibility with earlier Tcl releases than 8.7, use \fBTcl_UtfToUniCharDString\fR resp. \fBTcl_UniCharToUtfDString\fR as replacement, and make sure you compile your extension with -DTCL_UTF_MAX=3. Beware: Those replacement functions don't initialize their Tcl_DString (you'll have to do that yourself), and \fBTcl_UniCharToUtfDString\fR doesn't accept -1 -as length parameter (but \fBTcl_Utf16ToUtfDString\fR does!). +as length parameter (but \fBTcl_Char16ToUtfDString\fR does!). .PP \fBTcl_GetEncodingName\fR is roughly the inverse of \fBTcl_GetEncoding\fR. Given an \fIencoding\fR, the return value is the \fIname\fR argument that diff --git a/doc/Notifier.3 b/doc/Notifier.3 index 16f9f8d..ec9f910 100644 --- a/doc/Notifier.3 +++ b/doc/Notifier.3 @@ -132,22 +132,17 @@ higher-level software that they have occurred. The procedures and \fBTcl_SetMaxBlockTime\fR, \fBTcl_QueueEvent\fR, and \fBTcl_DeleteEvents\fR are used primarily by event sources. .IP [2] -The event queue: for non-threaded applications, -there is a single queue for the whole application, -containing events that have been detected but not yet serviced. Event -sources place events onto the queue so that they may be processed in -order at appropriate times during the event loop. The event queue -guarantees a fair discipline of event handling, so that no event -source can starve the others. It also allows events to be saved for -servicing at a future time. Threaded applications work in a -similar manner, except that there is a separate event queue for -each thread containing a Tcl interpreter. +The event queue: there is a single queue for each thread containing +a Tcl interpreter, containing events that have been detected but not +yet serviced. Event sources place events onto the queue so that they +may be processed in order at appropriate times during the event loop. +The event queue guarantees a fair discipline of event handling, so that +no event source can starve the others. It also allows events to be +saved for servicing at a future time. \fBTcl_QueueEvent\fR is used (primarily -by event sources) to add events to the event queue and +by event sources) to add events to the current thread's event queue and \fBTcl_DeleteEvents\fR is used to remove events from the queue without -processing them. In a threaded application, \fBTcl_QueueEvent\fR adds -an event to the current thread's queue, and \fBTcl_ThreadQueueEvent\fR -adds an event to a queue in a specific thread. +processing them. .IP [3] The event loop: in order to detect and process events, the application enters a loop that waits for events to occur, places them on the event @@ -403,11 +398,7 @@ the event source (using \fBTcl_Alloc\fR or the Tcl macro \fBckalloc\fR) before calling \fBTcl_QueueEvent\fR, but it will be freed by \fBTcl_ServiceEvent\fR, not by the event source. .PP -Threaded applications work in a -similar manner, except that there is a separate event queue for -each thread containing a Tcl interpreter. -Calling \fBTcl_QueueEvent\fR in a multithreaded application adds -an event to the current thread's queue. +Calling \fBTcl_QueueEvent\fR adds an event to the current thread's queue. To add an event to another thread's queue, use \fBTcl_ThreadQueueEvent\fR. \fBTcl_ThreadQueueEvent\fR accepts as an argument a Tcl_ThreadId argument, which uniquely identifies a thread in a Tcl application. To obtain the @@ -498,8 +489,7 @@ under Unix it happens when \fBTcl_WaitForEvent\fR would have waited forever because there were no active event sources and the timeout was infinite. .PP -\fBTcl_AlertNotifier\fR is used in multithreaded applications to allow -any thread to +\fBTcl_AlertNotifier\fR is used to allow any thread to .QW "wake up" the notifier to alert it to new events on its queue. \fBTcl_AlertNotifier\fR requires as an argument the notifier @@ -8,7 +8,7 @@ .so man.macros .BS .SH NAME -Tcl_UniChar, Tcl_UniCharToUtf, Tcl_UtfToUniChar, Tcl_UtfToUtf16, Tcl_UniCharToUtfDString, Tcl_UtfToUniCharDString, Tcl_Utf16ToUtfDString, Tcl_UtfToUtf16DString, Tcl_UniCharLen, Tcl_UniCharNcmp, Tcl_UniCharNcasecmp, Tcl_UniCharCaseMatch, Tcl_UtfNcmp, Tcl_UtfNcasecmp, Tcl_UtfCharComplete, Tcl_NumUtfChars, Tcl_UtfFindFirst, Tcl_UtfFindLast, Tcl_UtfNext, Tcl_UtfPrev, Tcl_UniCharAtIndex, Tcl_UtfAtIndex, Tcl_UtfBackslash \- routines for manipulating UTF-8 strings +Tcl_UniChar, Tcl_UniCharToUtf, Tcl_UtfToUniChar, Tcl_UtfToChar16, Tcl_UniCharToUtfDString, Tcl_UtfToUniCharDString, Tcl_Char16ToUtfDString, Tcl_UtfToChar16DString, Tcl_UniCharLen, Tcl_UniCharNcmp, Tcl_UniCharNcasecmp, Tcl_UniCharCaseMatch, Tcl_UtfNcmp, Tcl_UtfNcasecmp, Tcl_UtfCharComplete, Tcl_NumUtfChars, Tcl_UtfFindFirst, Tcl_UtfFindLast, Tcl_UtfNext, Tcl_UtfPrev, Tcl_UniCharAtIndex, Tcl_UtfAtIndex, Tcl_UtfBackslash \- routines for manipulating UTF-8 strings .SH SYNOPSIS .nf \fB#include <tcl.h>\fR @@ -22,19 +22,19 @@ int \fBTcl_UtfToUniChar\fR(\fIsrc, chPtr\fR) .sp int -\fBTcl_UtfToUtf16\fR(\fIsrc, utf16Ptr\fR) +\fBTcl_UtfToChar16\fR(\fIsrc, utf16Ptr\fR) .sp char * \fBTcl_UniCharToUtfDString\fR(\fIuniStr, uniLength, dsPtr\fR) .sp char * -\fBTcl_Utf16ToUtfDString\fR(\fIutf16Str, uniLength, dsPtr\fR) +\fBTcl_Char16ToUtfDString\fR(\fIutf16Str, uniLength, dsPtr\fR) .sp Tcl_UniChar * \fBTcl_UtfToUniCharDString\fR(\fIsrc, length, dsPtr\fR) .sp unsigned short * -\fBTcl_UtfToUtf16DString\fR(\fIsrc, length, dsPtr\fR) +\fBTcl_UtfToChar16DString\fR(\fIsrc, length, dsPtr\fR) .sp int \fBTcl_UniCharLen\fR(\fIuniStr\fR) @@ -22,7 +22,7 @@ home directory (as specified in the HOME environment variable) if Returns an empty string. Note that the current working directory is a per-process resource; the \fBcd\fR command changes the working directory for all interpreters -and (in a threaded environment) all threads. +and all threads. .SH EXAMPLES .PP Change to the home directory of the user \fBfred\fR: diff --git a/generic/regcustom.h b/generic/regcustom.h index e4db7cb..a6c19a3 100644 --- a/generic/regcustom.h +++ b/generic/regcustom.h @@ -131,7 +131,7 @@ typedef int celt; /* Type to hold chr, or NOCELT */ #if 1 #define AllocVars(vPtr) \ static Tcl_ThreadDataKey varsKey; \ - register struct vars *vPtr = (struct vars *) \ + struct vars *vPtr = (struct vars *) \ Tcl_GetThreadData(&varsKey, sizeof(struct vars)) #else /* @@ -140,7 +140,7 @@ typedef int celt; /* Type to hold chr, or NOCELT */ * faster in practice (measured!) */ #define AllocVars(vPtr) \ - register struct vars *vPtr = (struct vars *) MALLOC(sizeof(struct vars)) + struct vars *vPtr = (struct vars *) MALLOC(sizeof(struct vars)) #define FreeVars(vPtr) \ FREE(vPtr) #endif diff --git a/generic/regex.h b/generic/regex.h index 8845f72..f3159c6 100644 --- a/generic/regex.h +++ b/generic/regex.h @@ -151,8 +151,8 @@ typedef struct { int re_csize; /* sizeof(character) */ char *re_endp; /* backward compatibility kludge */ /* the rest is opaque pointers to hidden innards */ - char *re_guts; /* `char *' is more portable than `void *' */ - char *re_fns; + void *re_guts; + void *re_fns; } regex_t; /* result reporting (may acquire more fields later) */ diff --git a/generic/regguts.h b/generic/regguts.h index b3dbaa4..da38ef2 100644 --- a/generic/regguts.h +++ b/generic/regguts.h @@ -411,7 +411,7 @@ struct guts { #ifndef AllocVars #define AllocVars(vPtr) \ struct vars var; \ - register struct vars *vPtr = &var + struct vars *vPtr = &var #endif #ifndef FreeVars #define FreeVars(vPtr) ((void) 0) diff --git a/generic/tcl.decls b/generic/tcl.decls index 6ca9de7..6c0b3a8 100644 --- a/generic/tcl.decls +++ b/generic/tcl.decls @@ -1198,7 +1198,7 @@ declare 335 { int Tcl_UtfToTitle(char *src) } declare 336 { - int Tcl_UtfToUtf16(const char *src, unsigned short *chPtr) + int Tcl_UtfToChar16(const char *src, unsigned short *chPtr) } declare 337 { int Tcl_UtfToUpper(char *src) @@ -1253,11 +1253,11 @@ declare 353 {deprecated {Use Tcl_UtfNcmp}} { unsigned long numChars) } declare 354 { - char *Tcl_Utf16ToUtfDString(const unsigned short *uniStr, + char *Tcl_Char16ToUtfDString(const unsigned short *uniStr, int uniLength, Tcl_DString *dsPtr) } declare 355 { - unsigned short *Tcl_UtfToUtf16DString(const char *src, + unsigned short *Tcl_UtfToChar16DString(const char *src, int length, Tcl_DString *dsPtr) } declare 356 { diff --git a/generic/tcl.h b/generic/tcl.h index 257ea42..82b8521 100644 --- a/generic/tcl.h +++ b/generic/tcl.h @@ -406,7 +406,7 @@ typedef unsigned TCL_WIDE_INT_TYPE Tcl_WideUInt; #if defined(_WIN32) # ifdef __BORLANDC__ typedef struct stati64 Tcl_StatBuf; -# elif defined(_WIN64) +# elif defined(_WIN64) || defined(__MINGW_USE_VC2005_COMPAT) || defined(_USE_64BIT_TIME_T) typedef struct __stat64 Tcl_StatBuf; # elif (defined(_MSC_VER) && (_MSC_VER < 1400)) || defined(_USE_32BIT_TIME_T) typedef struct _stati64 Tcl_StatBuf; diff --git a/generic/tclAssembly.c b/generic/tclAssembly.c index c70fb08..e8ca9ca 100644 --- a/generic/tclAssembly.c +++ b/generic/tclAssembly.c @@ -506,7 +506,7 @@ static const TalInstDesc TalInstructionTable[] = { {"variable", ASSEM_LVT4, INST_VARIABLE, 1, 0}, {"verifyDict", ASSEM_1BYTE, INST_DICT_VERIFY, 1, 0}, {"yield", ASSEM_1BYTE, INST_YIELD, 1, 1}, - {NULL, 0, 0, 0, 0} + {NULL, ASSEM_1BYTE, 0, 0, 0} }; /* @@ -1155,9 +1155,9 @@ NewAssemblyEnv( { Tcl_Interp* interp = (Tcl_Interp*) envPtr->iPtr; /* Tcl interpreter */ - AssemblyEnv* assemEnvPtr = TclStackAlloc(interp, sizeof(AssemblyEnv)); + AssemblyEnv* assemEnvPtr = (AssemblyEnv*)TclStackAlloc(interp, sizeof(AssemblyEnv)); /* Assembler environment under construction */ - Tcl_Parse* parsePtr = TclStackAlloc(interp, sizeof(Tcl_Parse)); + Tcl_Parse* parsePtr = (Tcl_Parse*)TclStackAlloc(interp, sizeof(Tcl_Parse)); /* Parse of one line of assembly code */ assemEnvPtr->envPtr = envPtr; @@ -1546,7 +1546,7 @@ AssembleOneLine( goto cleanup; } - jtPtr = ckalloc(sizeof(JumptableInfo)); + jtPtr = (JumptableInfo*)ckalloc(sizeof(JumptableInfo)); Tcl_InitHashTable(&jtPtr->hashTable, TCL_STRING_KEYS); assemEnvPtr->curr_bb->jumpLine = assemEnvPtr->cmdLine; @@ -1945,7 +1945,7 @@ MoveExceptionRangesToBasicBlock( curr_bb->foreignExceptionBase = savedExceptArrayNext; curr_bb->foreignExceptionCount = exceptionCount; curr_bb->foreignExceptions = - ckalloc(exceptionCount * sizeof(ExceptionRange)); + (ExceptionRange*)ckalloc(exceptionCount * sizeof(ExceptionRange)); memcpy(curr_bb->foreignExceptions, envPtr->exceptArrayPtr + savedExceptArrayNext, exceptionCount * sizeof(ExceptionRange)); @@ -2010,7 +2010,7 @@ CreateMirrorJumpTable( * Allocate the jumptable. */ - jtPtr = ckalloc(sizeof(JumptableInfo)); + jtPtr = (JumptableInfo*)ckalloc(sizeof(JumptableInfo)); jtHashPtr = &jtPtr->hashTable; Tcl_InitHashTable(jtHashPtr, TCL_STRING_KEYS); @@ -2070,7 +2070,7 @@ DeleteMirrorJumpTable( for (entry = Tcl_FirstHashEntry(jtHashPtr, &search); entry != NULL; entry = Tcl_NextHashEntry(&search)) { - label = Tcl_GetHashValue(entry); + label = (Tcl_Obj*)Tcl_GetHashValue(entry); Tcl_DecrRefCount(label); Tcl_SetHashValue(entry, NULL); } @@ -2658,7 +2658,7 @@ AllocBB( AssemblyEnv* assemEnvPtr) /* Assembly environment */ { CompileEnv* envPtr = assemEnvPtr->envPtr; - BasicBlock *bb = ckalloc(sizeof(BasicBlock)); + BasicBlock *bb = (BasicBlock*)ckalloc(sizeof(BasicBlock)); bb->originalStartOffset = bb->startOffset = envPtr->codeNext - envPtr->codeStart; @@ -2849,7 +2849,7 @@ CalculateJumpRelocations( * target is out of range. */ - jumpTarget = Tcl_GetHashValue(entry); + jumpTarget = (BasicBlock*)Tcl_GetHashValue(entry); if (bbPtr->flags & BB_JUMP1) { offset = jumpTarget->startOffset - (bbPtr->jumpOffset + motion); @@ -2916,7 +2916,7 @@ CheckJumpTableLabels( for (symEntryPtr = Tcl_FirstHashEntry(symHash, &search); symEntryPtr != NULL; symEntryPtr = Tcl_NextHashEntry(&search)) { - symbolObj = Tcl_GetHashValue(symEntryPtr); + symbolObj = (Tcl_Obj*)Tcl_GetHashValue(symEntryPtr); valEntryPtr = Tcl_FindHashEntry(&assemEnvPtr->labelHash, TclGetString(symbolObj)); DEBUG_PRINT(" %s -> %s (%d)\n", @@ -3045,7 +3045,7 @@ FillInJumpOffsets( if (bbPtr->jumpTarget != NULL) { entry = Tcl_FindHashEntry(&assemEnvPtr->labelHash, TclGetString(bbPtr->jumpTarget)); - jumpTarget = Tcl_GetHashValue(entry); + jumpTarget = (BasicBlock*)Tcl_GetHashValue(entry); fromOffset = bbPtr->jumpOffset; targetOffset = jumpTarget->startOffset; if (bbPtr->flags & BB_JUMP1) { @@ -3104,7 +3104,7 @@ ResolveJumpTableTargets( auxDataIndex = TclGetInt4AtPtr(envPtr->codeStart + bbPtr->jumpOffset + 1); DEBUG_PRINT("bbPtr = %p jumpOffset = %d auxDataIndex = %d\n", bbPtr, bbPtr->jumpOffset, auxDataIndex); - realJumpTablePtr = TclFetchAuxData(envPtr, auxDataIndex); + realJumpTablePtr = (JumptableInfo*)TclFetchAuxData(envPtr, auxDataIndex); realJumpHashPtr = &realJumpTablePtr->hashTable; /* @@ -3115,12 +3115,12 @@ ResolveJumpTableTargets( for (symEntryPtr = Tcl_FirstHashEntry(symHash, &search); symEntryPtr != NULL; symEntryPtr = Tcl_NextHashEntry(&search)) { - symbolObj = Tcl_GetHashValue(symEntryPtr); + symbolObj = (Tcl_Obj*)Tcl_GetHashValue(symEntryPtr); DEBUG_PRINT(" symbol %s\n", TclGetString(symbolObj)); valEntryPtr = Tcl_FindHashEntry(&assemEnvPtr->labelHash, TclGetString(symbolObj)); - jumpTargetBBPtr = Tcl_GetHashValue(valEntryPtr); + jumpTargetBBPtr = (BasicBlock*)Tcl_GetHashValue(valEntryPtr); realJumpEntryPtr = Tcl_CreateHashEntry(realJumpHashPtr, Tcl_GetHashKey(symHash, symEntryPtr), &junk); @@ -3499,7 +3499,7 @@ StackCheckBasicBlock( if (result == TCL_OK && blockPtr->jumpTarget != NULL) { entry = Tcl_FindHashEntry(&assemEnvPtr->labelHash, TclGetString(blockPtr->jumpTarget)); - jumpTarget = Tcl_GetHashValue(entry); + jumpTarget = (BasicBlock*)Tcl_GetHashValue(entry); result = StackCheckBasicBlock(assemEnvPtr, jumpTarget, blockPtr, stackDepth); } @@ -3513,10 +3513,10 @@ StackCheckBasicBlock( &jtSearch); result == TCL_OK && jtEntry != NULL; jtEntry = Tcl_NextHashEntry(&jtSearch)) { - targetLabel = Tcl_GetHashValue(jtEntry); + targetLabel = (Tcl_Obj*)Tcl_GetHashValue(jtEntry); entry = Tcl_FindHashEntry(&assemEnvPtr->labelHash, TclGetString(targetLabel)); - jumpTarget = Tcl_GetHashValue(entry); + jumpTarget = (BasicBlock*)Tcl_GetHashValue(entry); result = StackCheckBasicBlock(assemEnvPtr, jumpTarget, blockPtr, stackDepth); } @@ -3821,7 +3821,7 @@ ProcessCatchesInBasicBlock( if (result == TCL_OK && bbPtr->jumpTarget != NULL) { entry = Tcl_FindHashEntry(&assemEnvPtr->labelHash, TclGetString(bbPtr->jumpTarget)); - jumpTarget = Tcl_GetHashValue(entry); + jumpTarget = (BasicBlock*)Tcl_GetHashValue(entry); result = ProcessCatchesInBasicBlock(assemEnvPtr, jumpTarget, jumpEnclosing, jumpState, catchDepth); } @@ -3834,10 +3834,10 @@ ProcessCatchesInBasicBlock( for (jtEntry = Tcl_FirstHashEntry(&bbPtr->jtPtr->hashTable,&jtSearch); result == TCL_OK && jtEntry != NULL; jtEntry = Tcl_NextHashEntry(&jtSearch)) { - targetLabel = Tcl_GetHashValue(jtEntry); + targetLabel = (Tcl_Obj*)Tcl_GetHashValue(jtEntry); entry = Tcl_FindHashEntry(&assemEnvPtr->labelHash, TclGetString(targetLabel)); - jumpTarget = Tcl_GetHashValue(entry); + jumpTarget = (BasicBlock*)Tcl_GetHashValue(entry); result = ProcessCatchesInBasicBlock(assemEnvPtr, jumpTarget, jumpEnclosing, jumpState, catchDepth); } @@ -3936,8 +3936,8 @@ BuildExceptionRanges( * Allocate memory for a stack of active catches. */ - catches = ckalloc(maxCatchDepth * sizeof(BasicBlock*)); - catchIndices = ckalloc(maxCatchDepth * sizeof(int)); + catches = (BasicBlock**)ckalloc(maxCatchDepth * sizeof(BasicBlock*)); + catchIndices = (int *)ckalloc(maxCatchDepth * sizeof(int)); for (i = 0; i < maxCatchDepth; ++i) { catches[i] = NULL; catchIndices[i] = -1; @@ -4005,7 +4005,7 @@ UnstackExpiredCatches( * corresponding to the catch contexts */ { ExceptionRange* range; /* Exception range for a specific catch */ - BasicBlock* catch; /* Catch block being examined */ + BasicBlock* block; /* Catch block being examined */ BasicBlockCatchState catchState; /* State of the code relative to the catch * block being examined ("in catch" or @@ -4033,18 +4033,18 @@ UnstackExpiredCatches( */ catchState = bbPtr->catchState; - catch = bbPtr->enclosingCatch; + block = bbPtr->enclosingCatch; while (catchDepth > 0) { --catchDepth; if (catches[catchDepth] != NULL) { - if (catches[catchDepth] != catch || catchState >= BBCS_CAUGHT) { + if (catches[catchDepth] != block || catchState >= BBCS_CAUGHT) { range = envPtr->exceptArrayPtr + catchIndices[catchDepth]; range->numCodeBytes = bbPtr->startOffset - range->codeOffset; catches[catchDepth] = NULL; catchIndices[catchDepth] = -1; } - catchState = catch->catchState; - catch = catch->enclosingCatch; + catchState = block->catchState; + block = block->enclosingCatch; } } } @@ -4073,19 +4073,19 @@ LookForFreshCatches( BasicBlockCatchState catchState; /* State ("in catch" or "caught") of the * current catch. */ - BasicBlock* catch; /* Current enclosing catch */ + BasicBlock* block; /* Current enclosing catch */ int catchDepth; /* Nesting depth of the current catch */ catchState = bbPtr->catchState; - catch = bbPtr->enclosingCatch; + block = bbPtr->enclosingCatch; catchDepth = bbPtr->catchDepth; while (catchDepth > 0) { --catchDepth; - if (catches[catchDepth] != catch && catchState < BBCS_CAUGHT) { - catches[catchDepth] = catch; + if (catches[catchDepth] != block && catchState < BBCS_CAUGHT) { + catches[catchDepth] = block; } - catchState = catch->catchState; - catch = catch->enclosingCatch; + catchState = block->catchState; + block = block->enclosingCatch; } } @@ -4113,7 +4113,7 @@ StackFreshCatches( CompileEnv* envPtr = assemEnvPtr->envPtr; /* Compilation environment */ ExceptionRange* range; /* Exception range for a specific catch */ - BasicBlock* catch; /* Catch block being examined */ + BasicBlock* block; /* Catch block being examined */ BasicBlock* errorExit; /* Error exit from the catch block */ Tcl_HashEntry* entryPtr; @@ -4130,7 +4130,7 @@ StackFreshCatches( * Create an exception range for a block that needs one. */ - catch = catches[catchDepth]; + block = catches[catchDepth]; catchIndices[catchDepth] = TclCreateExceptRange(CATCH_EXCEPTION_RANGE, envPtr); range = envPtr->exceptArrayPtr + catchIndices[catchDepth]; @@ -4140,13 +4140,13 @@ StackFreshCatches( range->codeOffset = bbPtr->startOffset; entryPtr = Tcl_FindHashEntry(&assemEnvPtr->labelHash, - TclGetString(catch->jumpTarget)); + TclGetString(block->jumpTarget)); if (entryPtr == NULL) { Tcl_Panic("undefined label in tclAssembly.c:" "BuildExceptionRanges, can't happen"); } - errorExit = Tcl_GetHashValue(entryPtr); + errorExit = (BasicBlock*)Tcl_GetHashValue(entryPtr); range->catchOffset = errorExit->startOffset; } } diff --git a/generic/tclAsync.c b/generic/tclAsync.c index 14804e4..c432e4f 100644 --- a/generic/tclAsync.c +++ b/generic/tclAsync.c @@ -118,7 +118,7 @@ Tcl_AsyncCreate( AsyncHandler *asyncPtr; ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); - asyncPtr = ckalloc(sizeof(AsyncHandler)); + asyncPtr = (AsyncHandler*)ckalloc(sizeof(AsyncHandler)); asyncPtr->ready = 0; asyncPtr->nextPtr = NULL; asyncPtr->proc = proc; diff --git a/generic/tclBasic.c b/generic/tclBasic.c index 9832807..f3a75bb 100644 --- a/generic/tclBasic.c +++ b/generic/tclBasic.c @@ -657,7 +657,15 @@ Tcl_CreateInterp(void) Tcl_Panic("Tcl_CallFrame must not be smaller than CallFrame"); } -#if defined(_WIN32) && !defined(_WIN64) +#if defined(_WIN32) && !defined(_WIN64) && !defined(_USE_64BIT_TIME_T) \ + && !defined(__MINGW_USE_VC2005_COMPAT) + /* If Tcl is compiled on Win32 using -D_USE_64BIT_TIME_T or + * -D__MINGW_USE_VC2005_COMPAT, the result is a binary incompatible + * with the 'standard' build of Tcl: All extensions using Tcl_StatBuf + * or interal functions like TclpGetDate() need to be recompiled in + * the same way. Therefore, this is not officially supported. + * In stead, it is recommended to use Win64 or Tcl 9.0 (not released yet) + */ if (sizeof(time_t) != 4) { /*NOTREACHED*/ Tcl_Panic("<time.h> is not compatible with MSVC"); @@ -2635,7 +2643,7 @@ TclCreateObjCommandInNs( Tcl_Interp *interp, const char *cmdName, /* Name of command, without any namespace * components. */ - Tcl_Namespace *namespace, /* The namespace to create the command in */ + Tcl_Namespace *namesp, /* The namespace to create the command in */ Tcl_ObjCmdProc *proc, /* Object-based function to associate with * name. */ ClientData clientData, /* Arbitrary value to pass to object @@ -2649,7 +2657,7 @@ TclCreateObjCommandInNs( ImportRef *oldRefPtr = NULL; ImportedCmdData *dataPtr; Tcl_HashEntry *hPtr; - Namespace *nsPtr = (Namespace *) namespace; + Namespace *nsPtr = (Namespace *) namesp; /* * If the command name we seek to create already exists, we need to delete @@ -5959,7 +5967,7 @@ TclArgumentEnter( CmdFrame *cfPtr) { Interp *iPtr = (Interp *) interp; - int new, i; + int isNew, i; Tcl_HashEntry *hPtr; CFWord *cfwPtr; @@ -5975,8 +5983,8 @@ TclArgumentEnter( if (cfPtr->line[i] < 0) { continue; } - hPtr = Tcl_CreateHashEntry(iPtr->lineLAPtr, objv[i], &new); - if (new) { + hPtr = Tcl_CreateHashEntry(iPtr->lineLAPtr, objv[i], &isNew); + if (isNew) { /* * The word is not on the stack yet, remember the current location * and initialize references. diff --git a/generic/tclCmdAH.c b/generic/tclCmdAH.c index dd98ef3..dff23a8 100644 --- a/generic/tclCmdAH.c +++ b/generic/tclCmdAH.c @@ -1139,7 +1139,7 @@ FileAttrAccessTimeCmd( } #if defined(_WIN32) /* We use a value of 0 to indicate the access time not available */ - if (buf.st_atime == 0) { + if (Tcl_GetAccessTimeFromStat(&buf) == 0) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "could not get access time for file \"%s\"", TclGetString(objv[1]))); @@ -1160,7 +1160,7 @@ FileAttrAccessTimeCmd( } tval.actime = newTime; - tval.modtime = buf.st_mtime; + tval.modtime = Tcl_GetModificationTimeFromStat(&buf); if (Tcl_FSUtime(objv[1], &tval) != 0) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( @@ -1180,7 +1180,7 @@ FileAttrAccessTimeCmd( } } - Tcl_SetObjResult(interp, Tcl_NewWideIntObj((long) buf.st_atime)); + Tcl_SetObjResult(interp, Tcl_NewWideIntObj(Tcl_GetAccessTimeFromStat(&buf))); return TCL_OK; } @@ -1221,7 +1221,7 @@ FileAttrModifyTimeCmd( } #if defined(_WIN32) /* We use a value of 0 to indicate the modification time not available */ - if (buf.st_mtime == 0) { + if (Tcl_GetModificationTimeFromStat(&buf) == 0) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "could not get modification time for file \"%s\"", TclGetString(objv[1]))); @@ -1240,7 +1240,7 @@ FileAttrModifyTimeCmd( return TCL_ERROR; } - tval.actime = buf.st_atime; + tval.actime = Tcl_GetAccessTimeFromStat(&buf); tval.modtime = newTime; if (Tcl_FSUtime(objv[1], &tval) != 0) { @@ -1260,7 +1260,7 @@ FileAttrModifyTimeCmd( } } - Tcl_SetObjResult(interp, Tcl_NewWideIntObj((long) buf.st_mtime)); + Tcl_SetObjResult(interp, Tcl_NewWideIntObj(Tcl_GetModificationTimeFromStat(&buf))); return TCL_OK; } @@ -2291,9 +2291,9 @@ StoreStatData( #ifdef HAVE_STRUCT_STAT_ST_BLKSIZE STORE_ARY("blksize", Tcl_NewWideIntObj((long)statPtr->st_blksize)); #endif - STORE_ARY("atime", Tcl_NewWideIntObj((long)statPtr->st_atime)); - STORE_ARY("mtime", Tcl_NewWideIntObj((long)statPtr->st_mtime)); - STORE_ARY("ctime", Tcl_NewWideIntObj((long)statPtr->st_ctime)); + STORE_ARY("atime", Tcl_NewWideIntObj(Tcl_GetAccessTimeFromStat(statPtr))); + STORE_ARY("mtime", Tcl_NewWideIntObj(Tcl_GetModificationTimeFromStat(statPtr))); + STORE_ARY("ctime", Tcl_NewWideIntObj(Tcl_GetChangeTimeFromStat(statPtr))); mode = (unsigned short) statPtr->st_mode; STORE_ARY("mode", Tcl_NewWideIntObj(mode)); STORE_ARY("type", Tcl_NewStringObj(GetTypeFromMode(mode), -1)); diff --git a/generic/tclCmdMZ.c b/generic/tclCmdMZ.c index b6b469e..b3ccac3 100644 --- a/generic/tclCmdMZ.c +++ b/generic/tclCmdMZ.c @@ -4188,7 +4188,6 @@ Tcl_TimeRateObjCmd( }; NRE_callback *rootPtr; ByteCode *codePtr = NULL; - int codeOptimized = 0; for (i = 1; i < objc - 1; i++) { int index; @@ -4373,15 +4372,6 @@ Tcl_TimeRateObjCmd( } codePtr = TclCompileObj(interp, objPtr, NULL, 0); TclPreserveByteCode(codePtr); - /* - * Replace last compiled done instruction with continue: it's a part of - * iteration, this way evaluation will be more similar to a cycle (also - * avoids extra overhead to set result to interp, etc.) - */ - if (codePtr->codeStart[codePtr->numCodeBytes-1] == INST_DONE) { - codePtr->codeStart[codePtr->numCodeBytes-1] = INST_CONTINUE; - codeOptimized = 1; - } } /* @@ -4423,6 +4413,12 @@ Tcl_TimeRateObjCmd( count++; if (!direct) { /* precompiled */ rootPtr = TOP_CB(interp); + /* + * Use loop optimized TEBC call (TCL_EVAL_DISCARD_RESULT): it's a part of + * iteration, this way evaluation will be more similar to a cycle (also + * avoids extra overhead to set result to interp, etc.) + */ + ((Interp *)interp)->evalFlags |= TCL_EVAL_DISCARD_RESULT; result = TclNRExecuteByteCode(interp, codePtr); result = TclNRRunCallbacks(interp, result, rootPtr); } else { /* eval */ @@ -4675,11 +4671,6 @@ Tcl_TimeRateObjCmd( done: if (codePtr != NULL) { - if ( codeOptimized - && codePtr->codeStart[codePtr->numCodeBytes-1] == INST_CONTINUE - ) { - codePtr->codeStart[codePtr->numCodeBytes-1] = INST_DONE; - } TclReleaseByteCode(codePtr); } return result; diff --git a/generic/tclCompCmds.c b/generic/tclCompCmds.c index 4844dd8..c015204 100644 --- a/generic/tclCompCmds.c +++ b/generic/tclCompCmds.c @@ -3174,7 +3174,7 @@ TclCompileFormatCmd( DefineLineInformation; /* TIP #280 */ Tcl_Token *tokenPtr = parsePtr->tokenPtr; Tcl_Obj **objv, *formatObj, *tmpObj; - char *bytes, *start; + const char *bytes, *start; int i, j, len; /* @@ -3301,7 +3301,7 @@ TclCompileFormatCmd( if (*++bytes == '%') { Tcl_AppendToObj(tmpObj, "%", 1); } else { - char *b = TclGetStringFromObj(tmpObj, &len); + const char *b = TclGetStringFromObj(tmpObj, &len); /* * If there is a non-empty literal from the format string, diff --git a/generic/tclCompCmdsGR.c b/generic/tclCompCmdsGR.c index a8a85f8..3c8a156 100644 --- a/generic/tclCompCmdsGR.c +++ b/generic/tclCompCmdsGR.c @@ -589,7 +589,7 @@ TclCompileInfoCommandsCmd( DefineLineInformation; /* TIP #280 */ Tcl_Token *tokenPtr; Tcl_Obj *objPtr; - char *bytes; + const char *bytes; /* * We require one compile-time known argument for the case we can compile. diff --git a/generic/tclCompCmdsSZ.c b/generic/tclCompCmdsSZ.c index da45cb3..f0bf5ca 100644 --- a/generic/tclCompCmdsSZ.c +++ b/generic/tclCompCmdsSZ.c @@ -925,7 +925,7 @@ TclCompileStringMapCmd( DefineLineInformation; /* TIP #280 */ Tcl_Token *mapTokenPtr, *stringTokenPtr; Tcl_Obj *mapObj, **objv; - char *bytes; + const char *bytes; int len; /* diff --git a/generic/tclCompile.h b/generic/tclCompile.h index 686b2dd..5e39a21 100644 --- a/generic/tclCompile.h +++ b/generic/tclCompile.h @@ -529,7 +529,7 @@ typedef struct ByteCode { do { \ const Tcl_ObjIntRep *irPtr; \ irPtr = TclFetchIntRep((objPtr), (typePtr)); \ - (codePtr) = irPtr ? irPtr->twoPtrValue.ptr1 : NULL; \ + (codePtr) = irPtr ? (ByteCode*)irPtr->twoPtrValue.ptr1 : NULL; \ } while (0) /* @@ -1217,7 +1217,7 @@ MODULE_SCOPE Tcl_Obj *TclGetInnerContext(Tcl_Interp *interp, const unsigned char *pc, Tcl_Obj **tosPtr); MODULE_SCOPE Tcl_Obj *TclNewInstNameObj(unsigned char inst); MODULE_SCOPE int TclPushProcCallFrame(ClientData clientData, - register Tcl_Interp *interp, int objc, + Tcl_Interp *interp, int objc, Tcl_Obj *const objv[], int isLambda); @@ -1405,7 +1405,7 @@ MODULE_SCOPE int TclPushProcCallFrame(ClientData clientData, #define TclEmitPush(objIndex, envPtr) \ do { \ - register int _objIndexCopy = (objIndex); \ + int _objIndexCopy = (objIndex); \ if (_objIndexCopy <= 255) { \ TclEmitInstInt1(INST_PUSH1, _objIndexCopy, (envPtr)); \ } else { \ diff --git a/generic/tclDTrace.d b/generic/tclDTrace.d index 360bdff..f5493b1 100644 --- a/generic/tclDTrace.d +++ b/generic/tclDTrace.d @@ -10,7 +10,6 @@ */ typedef struct Tcl_Obj Tcl_Obj; -typedef const char* TclDTraceStr; /* * Tcl DTrace probes @@ -25,14 +24,14 @@ provider tcl { * arg1: number of arguments (int) * arg2: array of proc argument objects (Tcl_Obj**) */ - probe proc__entry(TclDTraceStr name, int objc, struct Tcl_Obj **objv); + probe proc__entry(const char *name, int objc, struct Tcl_Obj **objv); /* * tcl*:::proc-return probe * triggered immediately after proc bytecode execution * arg0: proc name (string) * arg1: return code (int) */ - probe proc__return(TclDTraceStr name, int code); + probe proc__return(const char *name, int code); /* * tcl*:::proc-result probe * triggered after proc-return probe and result processing @@ -41,7 +40,7 @@ provider tcl { * arg2: proc result (string) * arg3: proc result object (Tcl_Obj*) */ - probe proc__result(TclDTraceStr name, int code, TclDTraceStr result, + probe proc__result(const char *name, int code, const char *result, struct Tcl_Obj *resultobj); /* * tcl*:::proc-args probe @@ -50,10 +49,10 @@ provider tcl { * arg0: proc name (string) * arg1-arg9: proc arguments or NULL (strings) */ - probe proc__args(TclDTraceStr name, TclDTraceStr arg1, TclDTraceStr arg2, - TclDTraceStr arg3, TclDTraceStr arg4, TclDTraceStr arg5, - TclDTraceStr arg6, TclDTraceStr arg7, TclDTraceStr arg8, - TclDTraceStr arg9); + probe proc__args(const char *name, const char *arg1, const char *arg2, + const char *arg3, const char *arg4, const char *arg5, + const char *arg6, const char *arg7, const char *arg8, + const char *arg9); /* * tcl*:::proc-info probe * triggered before proc-entry probe, gives access to TIP 280 @@ -67,9 +66,9 @@ provider tcl { * arg6: TclOO method (string) * arg7: TclOO class/object (string) */ - probe proc__info(TclDTraceStr cmd, TclDTraceStr type, TclDTraceStr proc, - TclDTraceStr file, int line, int level, TclDTraceStr method, - TclDTraceStr class); + probe proc__info(const char *cmd, const char *type, const char *proc, + const char *file, int line, int level, const char *method, + const char *class); /***************************** cmd probes ******************************/ /* @@ -79,14 +78,14 @@ provider tcl { * arg1: number of arguments (int) * arg2: array of command argument objects (Tcl_Obj**) */ - probe cmd__entry(TclDTraceStr name, int objc, struct Tcl_Obj **objv); + probe cmd__entry(const char *name, int objc, struct Tcl_Obj **objv); /* * tcl*:::cmd-return probe * triggered immediately after commmand execution * arg0: command name (string) * arg1: return code (int) */ - probe cmd__return(TclDTraceStr name, int code); + probe cmd__return(const char *name, int code); /* * tcl*:::cmd-result probe * triggered after cmd-return probe and result processing @@ -95,7 +94,7 @@ provider tcl { * arg2: command result (string) * arg3: command result object (Tcl_Obj*) */ - probe cmd__result(TclDTraceStr name, int code, TclDTraceStr result, + probe cmd__result(const char *name, int code, const char *result, struct Tcl_Obj *resultobj); /* * tcl*:::cmd-args probe @@ -104,10 +103,10 @@ provider tcl { * arg0: command name (string) * arg1-arg9: command arguments or NULL (strings) */ - probe cmd__args(TclDTraceStr name, TclDTraceStr arg1, TclDTraceStr arg2, - TclDTraceStr arg3, TclDTraceStr arg4, TclDTraceStr arg5, - TclDTraceStr arg6, TclDTraceStr arg7, TclDTraceStr arg8, - TclDTraceStr arg9); + probe cmd__args(const char *name, const char *arg1, const char *arg2, + const char *arg3, const char *arg4, const char *arg5, + const char *arg6, const char *arg7, const char *arg8, + const char *arg9); /* * tcl*:::cmd-info probe * triggered before cmd-entry probe, gives access to TIP 280 @@ -121,9 +120,9 @@ provider tcl { * arg6: TclOO method (string) * arg7: TclOO class/object (string) */ - probe cmd__info(TclDTraceStr cmd, TclDTraceStr type, TclDTraceStr proc, - TclDTraceStr file, int line, int level, TclDTraceStr method, - TclDTraceStr class); + probe cmd__info(const char *cmd, const char *type, const char *proc, + const char *file, int line, int level, const char *method, + const char *class); /***************************** inst probes *****************************/ /* @@ -133,7 +132,7 @@ provider tcl { * arg1: depth of stack (int) * arg2: top of stack (Tcl_Obj**) */ - probe inst__start(TclDTraceStr name, int depth, struct Tcl_Obj **stack); + probe inst__start(const char *name, int depth, struct Tcl_Obj **stack); /* * tcl*:::inst-done probe * triggered immediately after execution of a bytecode @@ -141,7 +140,7 @@ provider tcl { * arg1: depth of stack (int) * arg2: top of stack (Tcl_Obj**) */ - probe inst__done(TclDTraceStr name, int depth, struct Tcl_Obj **stack); + probe inst__done(const char *name, int depth, struct Tcl_Obj **stack); /***************************** obj probes ******************************/ /* @@ -163,10 +162,10 @@ provider tcl { * triggered when the ::tcl::dtrace command is called * arg0-arg9: command arguments (strings) */ - probe tcl__probe(TclDTraceStr arg0, TclDTraceStr arg1, TclDTraceStr arg2, - TclDTraceStr arg3, TclDTraceStr arg4, TclDTraceStr arg5, - TclDTraceStr arg6, TclDTraceStr arg7, TclDTraceStr arg8, - TclDTraceStr arg9); + probe tcl__probe(const char *arg0, const char *arg1, const char *arg2, + const char *arg3, const char *arg4, const char *arg5, + const char *arg6, const char *arg7, const char *arg8, + const char *arg9); }; /* @@ -174,7 +173,7 @@ provider tcl { */ typedef struct Tcl_ObjType { - char *name; + const char *name; void *freeIntRepProc; void *dupIntRepProc; void *updateStringProc; @@ -185,7 +184,7 @@ struct Tcl_Obj { int refCount; char *bytes; int length; - Tcl_ObjType *typePtr; + const Tcl_ObjType *typePtr; union { long longValue; double doubleValue; diff --git a/generic/tclDecls.h b/generic/tclDecls.h index 9e7f928..1fa1640 100644 --- a/generic/tclDecls.h +++ b/generic/tclDecls.h @@ -1027,7 +1027,7 @@ EXTERN int Tcl_UtfToLower(char *src); /* 335 */ EXTERN int Tcl_UtfToTitle(char *src); /* 336 */ -EXTERN int Tcl_UtfToUtf16(const char *src, +EXTERN int Tcl_UtfToChar16(const char *src, unsigned short *chPtr); /* 337 */ EXTERN int Tcl_UtfToUpper(char *src); @@ -1071,10 +1071,10 @@ int Tcl_UniCharNcmp(const Tcl_UniChar *ucs, const Tcl_UniChar *uct, unsigned long numChars); /* 354 */ -EXTERN char * Tcl_Utf16ToUtfDString(const unsigned short *uniStr, +EXTERN char * Tcl_Char16ToUtfDString(const unsigned short *uniStr, int uniLength, Tcl_DString *dsPtr); /* 355 */ -EXTERN unsigned short * Tcl_UtfToUtf16DString(const char *src, int length, +EXTERN unsigned short * Tcl_UtfToChar16DString(const char *src, int length, Tcl_DString *dsPtr); /* 356 */ EXTERN Tcl_RegExp Tcl_GetRegExpFromObj(Tcl_Interp *interp, @@ -2298,7 +2298,7 @@ typedef struct TclStubs { char * (*tcl_UtfToExternalDString) (Tcl_Encoding encoding, const char *src, int srcLen, Tcl_DString *dsPtr); /* 333 */ int (*tcl_UtfToLower) (char *src); /* 334 */ int (*tcl_UtfToTitle) (char *src); /* 335 */ - int (*tcl_UtfToUtf16) (const char *src, unsigned short *chPtr); /* 336 */ + int (*tcl_UtfToChar16) (const char *src, unsigned short *chPtr); /* 336 */ int (*tcl_UtfToUpper) (char *src); /* 337 */ int (*tcl_WriteChars) (Tcl_Channel chan, const char *src, int srcLen); /* 338 */ int (*tcl_WriteObj) (Tcl_Channel chan, Tcl_Obj *objPtr); /* 339 */ @@ -2316,8 +2316,8 @@ typedef struct TclStubs { int (*tcl_UniCharIsWordChar) (int ch); /* 351 */ TCL_DEPRECATED_API("Use Tcl_GetCharLength") int (*tcl_UniCharLen) (const unsigned short *uniStr); /* 352 */ TCL_DEPRECATED_API("Use Tcl_UtfNcmp") int (*tcl_UniCharNcmp) (const Tcl_UniChar *ucs, const Tcl_UniChar *uct, unsigned long numChars); /* 353 */ - char * (*tcl_Utf16ToUtfDString) (const unsigned short *uniStr, int uniLength, Tcl_DString *dsPtr); /* 354 */ - unsigned short * (*tcl_UtfToUtf16DString) (const char *src, int length, Tcl_DString *dsPtr); /* 355 */ + char * (*tcl_Char16ToUtfDString) (const unsigned short *uniStr, int uniLength, Tcl_DString *dsPtr); /* 354 */ + unsigned short * (*tcl_UtfToChar16DString) (const char *src, int length, Tcl_DString *dsPtr); /* 355 */ Tcl_RegExp (*tcl_GetRegExpFromObj) (Tcl_Interp *interp, Tcl_Obj *patObj, int flags); /* 356 */ TCL_DEPRECATED_API("Use Tcl_EvalTokensStandard") Tcl_Obj * (*tcl_EvalTokens) (Tcl_Interp *interp, Tcl_Token *tokenPtr, int count); /* 357 */ void (*tcl_FreeParse) (Tcl_Parse *parsePtr); /* 358 */ @@ -3317,8 +3317,8 @@ extern const TclStubs *tclStubsPtr; (tclStubsPtr->tcl_UtfToLower) /* 334 */ #define Tcl_UtfToTitle \ (tclStubsPtr->tcl_UtfToTitle) /* 335 */ -#define Tcl_UtfToUtf16 \ - (tclStubsPtr->tcl_UtfToUtf16) /* 336 */ +#define Tcl_UtfToChar16 \ + (tclStubsPtr->tcl_UtfToChar16) /* 336 */ #define Tcl_UtfToUpper \ (tclStubsPtr->tcl_UtfToUpper) /* 337 */ #define Tcl_WriteChars \ @@ -3353,10 +3353,10 @@ extern const TclStubs *tclStubsPtr; (tclStubsPtr->tcl_UniCharLen) /* 352 */ #define Tcl_UniCharNcmp \ (tclStubsPtr->tcl_UniCharNcmp) /* 353 */ -#define Tcl_Utf16ToUtfDString \ - (tclStubsPtr->tcl_Utf16ToUtfDString) /* 354 */ -#define Tcl_UtfToUtf16DString \ - (tclStubsPtr->tcl_UtfToUtf16DString) /* 355 */ +#define Tcl_Char16ToUtfDString \ + (tclStubsPtr->tcl_Char16ToUtfDString) /* 354 */ +#define Tcl_UtfToChar16DString \ + (tclStubsPtr->tcl_UtfToChar16DString) /* 355 */ #define Tcl_GetRegExpFromObj \ (tclStubsPtr->tcl_GetRegExpFromObj) /* 356 */ #define Tcl_EvalTokens \ @@ -4146,11 +4146,11 @@ extern const TclStubs *tclStubsPtr; # undef TclAppendUnicodeToObj # define TclAppendUnicodeToObj Tcl_AppendUnicodeToObj # undef Tcl_UniCharToUtfDString -# define Tcl_UniCharToUtfDString Tcl_Utf16ToUtfDString +# define Tcl_UniCharToUtfDString Tcl_Char16ToUtfDString # undef Tcl_UtfToUniCharDString -# define Tcl_UtfToUniCharDString Tcl_UtfToUtf16DString +# define Tcl_UtfToUniCharDString Tcl_UtfToChar16DString # undef Tcl_UtfToUniChar -# define Tcl_UtfToUniChar Tcl_UtfToUtf16 +# define Tcl_UtfToUniChar Tcl_UtfToChar16 #endif #if TCL_UTF_MAX > 3 || defined(TCL_NO_DEPRECATED) || TCL_MAJOR_VERSION > 8 diff --git a/generic/tclEnsemble.c b/generic/tclEnsemble.c index e7e5c92..9964250 100644 --- a/generic/tclEnsemble.c +++ b/generic/tclEnsemble.c @@ -2580,7 +2580,7 @@ BuildEnsembleConfig( if (subList) { int subc; Tcl_Obj **subv, *target, *cmdObj, *cmdPrefixObj; - char *name; + const char *name; /* * There is a list of exactly what subcommands go in the table. @@ -2665,7 +2665,7 @@ BuildEnsembleConfig( Tcl_DictObjFirst(NULL, ensemblePtr->subcommandDict, &dictSearch, &keyObj, &valueObj, &done); while (!done) { - char *name = TclGetString(keyObj); + const char *name = TclGetString(keyObj); hPtr = Tcl_CreateHashEntry(hash, name, &isNew); Tcl_SetHashValue(hPtr, valueObj); @@ -3379,7 +3379,7 @@ CompileToInvokedCommand( { Tcl_Token *tokPtr; Tcl_Obj *objPtr, **words; - char *bytes; + const char *bytes; int i, numWords, cmdLit, extraLiteralFlags = LITERAL_CMD_NAME; DefineLineInformation; diff --git a/generic/tclExecute.c b/generic/tclExecute.c index 2b8eaae..9f420b2 100644 --- a/generic/tclExecute.c +++ b/generic/tclExecute.c @@ -1981,7 +1981,14 @@ TclNRExecuteByteCode( */ TclNRAddCallback(interp, TEBCresume, TD, /* pc */ NULL, - /* cleanup */ INT2PTR(0), NULL); + /* cleanup */ INT2PTR(0), INT2PTR(iPtr->evalFlags)); + + /* + * Reset discard result flag - because it is applicable for this call only, + * and should not affect all the nested invocations may return result. + */ + iPtr->evalFlags &= ~TCL_EVAL_DISCARD_RESULT; + return TCL_OK; } @@ -2043,6 +2050,7 @@ TEBCresume( #define auxObjList (TD->auxObjList) #define catchTop (TD->catchTop) #define codePtr (TD->codePtr) +#define curEvalFlags PTR2INT(data[3]) /* calling iPtr->evalFlags */ /* * Globals: variables that store state, must remain valid at all times. @@ -2526,6 +2534,14 @@ TEBCresume( case INST_DONE: if (tosPtr > initTosPtr) { + + if ((curEvalFlags & TCL_EVAL_DISCARD_RESULT) && (result == TCL_OK)) { + /* simulate pop & fast done (like it does continue in loop) */ + TRACE_WITH_OBJ(("=> discarding "), OBJ_AT_TOS); + objPtr = POP_OBJECT(); + TclDecrRefCount(objPtr); + goto abnormalReturn; + } /* * Set the interpreter's object result to point to the topmost * object from the stack, and check for a possible [catch]. The @@ -7695,7 +7711,7 @@ TEBCresume( */ /* - * Abnormal return code. Restore the stack to state it had when + * Done or abnormal return code. Restore the stack to state it had when * starting to execute the ByteCode. Panic if the stack is below the * initial level. */ @@ -8452,7 +8468,7 @@ ExecuteExtendedBinaryMathOp( } Tcl_TakeBignumFromObj(NULL, valuePtr, &big1); mp_init(&bigResult); - mp_expt_d_ex(&big1, w2, &bigResult, 1); + mp_expt_d(&big1, (mp_digit)w2, &bigResult); mp_clear(&big1); BIG_RESULT(&bigResult); } diff --git a/generic/tclHash.c b/generic/tclHash.c index 9b462d9..8bbb0c7 100644 --- a/generic/tclHash.c +++ b/generic/tclHash.c @@ -810,6 +810,7 @@ AllocStringEntry( allocsize = sizeof(hPtr->key); } hPtr = ckalloc(offsetof(Tcl_HashEntry, key) + allocsize); + memset(hPtr, 0, sizeof(Tcl_HashEntry) + allocsize - sizeof(hPtr->key)); memcpy(hPtr->key.string, string, size); hPtr->clientData = 0; return hPtr; diff --git a/generic/tclIOSock.c b/generic/tclIOSock.c index 32ed015..12dc880 100644 --- a/generic/tclIOSock.c +++ b/generic/tclIOSock.c @@ -35,7 +35,7 @@ gai_strerror( tsdPtr->initialized = 1; } Tcl_DStringInit(&tsdPtr->errorMsg); - Tcl_Utf16ToUtfDString(gai_strerrorW(code), -1, &tsdPtr->errorMsg); + Tcl_Char16ToUtfDString(gai_strerrorW(code), -1, &tsdPtr->errorMsg); return Tcl_DStringValue(&tsdPtr->errorMsg); } #endif diff --git a/generic/tclIOUtil.c b/generic/tclIOUtil.c index 4b3eaa5..3773159 100644 --- a/generic/tclIOUtil.c +++ b/generic/tclIOUtil.c @@ -327,9 +327,9 @@ Tcl_Stat( oldStyleBuf->st_uid = buf.st_uid; oldStyleBuf->st_gid = buf.st_gid; oldStyleBuf->st_size = (off_t) buf.st_size; - oldStyleBuf->st_atime = buf.st_atime; - oldStyleBuf->st_mtime = buf.st_mtime; - oldStyleBuf->st_ctime = buf.st_ctime; + oldStyleBuf->st_atime = Tcl_GetAccessTimeFromStat(&buf); + oldStyleBuf->st_mtime = Tcl_GetModificationTimeFromStat(&buf); + oldStyleBuf->st_ctime = Tcl_GetChangeTimeFromStat(&buf); #ifdef HAVE_STRUCT_STAT_ST_BLKSIZE oldStyleBuf->st_blksize = buf.st_blksize; #endif @@ -1392,7 +1392,7 @@ TclFSNormalizeToUniquePath( int i; int isVfsPath = 0; - char *path; + const char *path; /* * Paths starting with a UNC prefix whose final character is a colon @@ -4422,8 +4422,8 @@ TclCrossFilesystemCopy( */ if (Tcl_FSLstat(source, &sourceStatBuf) == 0) { - tval.actime = sourceStatBuf.st_atime; - tval.modtime = sourceStatBuf.st_mtime; + tval.actime = Tcl_GetAccessTimeFromStat(&sourceStatBuf); + tval.modtime = Tcl_GetModificationTimeFromStat(&sourceStatBuf); Tcl_FSUtime(target, &tval); } diff --git a/generic/tclInt.h b/generic/tclInt.h index 689e400..7666292 100644 --- a/generic/tclInt.h +++ b/generic/tclInt.h @@ -1384,7 +1384,7 @@ MODULE_SCOPE void TclThreadDataKeySet(Tcl_ThreadDataKey *keyPtr, */ #define TCL_TSD_INIT(keyPtr) \ - Tcl_GetThreadData((keyPtr), sizeof(ThreadSpecificData)) + (ThreadSpecificData *)Tcl_GetThreadData((keyPtr), sizeof(ThreadSpecificData)) /* *---------------------------------------------------------------- @@ -2259,6 +2259,7 @@ typedef struct Interp { #define TCL_EVAL_FILE 0x02 #define TCL_EVAL_SOURCE_IN_FRAME 0x10 #define TCL_EVAL_NORESOLVE 0x20 +#define TCL_EVAL_DISCARD_RESULT 0x40 /* * Flag bits for Interp structures: @@ -4223,7 +4224,6 @@ MODULE_SCOPE int TclIndexDecode(int encoded, int endValue); #ifdef USE_DTRACE #ifndef _TCLDTRACE_H -typedef const char *TclDTraceStr; #include "tclDTrace.h" #endif #define TCL_DTRACE_OBJ_CREATE(objPtr) TCL_OBJ_CREATE(objPtr) @@ -4524,8 +4524,8 @@ MODULE_SCOPE void TclDbInitNewObj(Tcl_Obj *objPtr, const char *file, #define TclUnpackBignum(objPtr, bignum) \ do { \ - register Tcl_Obj *bignumObj = (objPtr); \ - register int bignumPayload = \ + Tcl_Obj *bignumObj = (objPtr); \ + int bignumPayload = \ PTR2INT(bignumObj->internalRep.twoPtrValue.ptr2); \ if (bignumPayload == -1) { \ (bignum) = *((mp_int *) bignumObj->internalRep.twoPtrValue.ptr1); \ diff --git a/generic/tclLiteral.c b/generic/tclLiteral.c index 2f93200..83eee07 100644 --- a/generic/tclLiteral.c +++ b/generic/tclLiteral.c @@ -209,7 +209,7 @@ TclCreateLiteral( */ int objLength; - char *objBytes = TclGetStringFromObj(objPtr, &objLength); + const char *objBytes = TclGetStringFromObj(objPtr, &objLength); if ((objLength == length) && ((length == 0) || ((objBytes[0] == bytes[0]) @@ -408,7 +408,7 @@ TclRegisterLiteral( Tcl_Obj *objPtr; unsigned hash; unsigned int localHash; - int objIndex, new; + int objIndex, isNew; Namespace *nsPtr; if (length < 0) { @@ -462,7 +462,7 @@ TclRegisterLiteral( */ globalPtr = NULL; - objPtr = TclCreateLiteral(iPtr, bytes, length, hash, &new, nsPtr, flags, + objPtr = TclCreateLiteral(iPtr, bytes, length, hash, &isNew, nsPtr, flags, &globalPtr); objIndex = AddLocalLiteralEntry(envPtr, objPtr, localHash); diff --git a/generic/tclMain.c b/generic/tclMain.c index ad039b6..ce0d6df 100644 --- a/generic/tclMain.c +++ b/generic/tclMain.c @@ -74,7 +74,7 @@ NewNativeObj( length *= sizeof(WCHAR); } Tcl_DStringInit(&ds); - Tcl_Utf16ToUtfDString(string, length, &ds); + Tcl_Char16ToUtfDString(string, length, &ds); #else Tcl_ExternalToUtfDString(NULL, (char *) string, length, &ds); #endif diff --git a/generic/tclOODefineCmds.c b/generic/tclOODefineCmds.c index 6a00018..fb16007 100644 --- a/generic/tclOODefineCmds.c +++ b/generic/tclOODefineCmds.c @@ -1244,7 +1244,7 @@ TclOODefineSelfObjCmd( { Tcl_Namespace *nsPtr; Object *oPtr; - int result, private; + int result, isPrivate; oPtr = (Object *) TclOOGetDefineCmdContext(interp); if (oPtr == NULL) { @@ -1256,7 +1256,7 @@ TclOODefineSelfObjCmd( return TCL_OK; } - private = IsPrivateDefine(interp); + isPrivate = IsPrivateDefine(interp); /* * Make the oo::objdefine namespace the current namespace and evaluate the @@ -1267,7 +1267,7 @@ TclOODefineSelfObjCmd( if (InitDefineContext(interp, nsPtr, oPtr, objc, objv) != TCL_OK) { return TCL_ERROR; } - if (private) { + if (isPrivate) { ((Interp *) interp)->varFramePtr->isProcCallFrame = PRIVATE_FRAME; } diff --git a/generic/tclOOInfo.c b/generic/tclOOInfo.c index fefeb0f..99918ae 100644 --- a/generic/tclOOInfo.c +++ b/generic/tclOOInfo.c @@ -809,7 +809,7 @@ InfoObjectVariablesCmd( { Object *oPtr; Tcl_Obj *resultObj; - int i, private = 0; + int i, isPrivate = 0; if (objc != 2 && objc != 3) { Tcl_WrongNumArgs(interp, 1, objv, "objName ?-private?"); @@ -819,7 +819,7 @@ InfoObjectVariablesCmd( if (strcmp("-private", Tcl_GetString(objv[2])) != 0) { return TCL_ERROR; } - private = 1; + isPrivate = 1; } oPtr = (Object *) Tcl_GetObjectFromObj(interp, objv[1]); if (oPtr == NULL) { @@ -827,7 +827,7 @@ InfoObjectVariablesCmd( } resultObj = Tcl_NewObj(); - if (private) { + if (isPrivate) { PrivateVariableMapping *privatePtr; FOREACH_STRUCT(privatePtr, oPtr->privateVariables) { @@ -1588,7 +1588,7 @@ InfoClassVariablesCmd( { Class *clsPtr; Tcl_Obj *resultObj; - int i, private = 0; + int i, isPrivate = 0; if (objc != 2 && objc != 3) { Tcl_WrongNumArgs(interp, 1, objv, "className ?-private?"); @@ -1598,7 +1598,7 @@ InfoClassVariablesCmd( if (strcmp("-private", Tcl_GetString(objv[2])) != 0) { return TCL_ERROR; } - private = 1; + isPrivate = 1; } clsPtr = GetClassFromObj(interp, objv[1]); if (clsPtr == NULL) { @@ -1606,7 +1606,7 @@ InfoClassVariablesCmd( } resultObj = Tcl_NewObj(); - if (private) { + if (isPrivate) { PrivateVariableMapping *privatePtr; FOREACH_STRUCT(privatePtr, clsPtr->privateVariables) { diff --git a/generic/tclOOInt.h b/generic/tclOOInt.h index c1a9010..1f44ef8 100644 --- a/generic/tclOOInt.h +++ b/generic/tclOOInt.h @@ -671,7 +671,7 @@ MODULE_SCOPE void TclOOSetupVariableResolver(Tcl_Namespace *nsPtr); #undef DUPLICATE /* prevent possible conflict with definition in WINAPI nb30.h */ #define DUPLICATE(target,source,type) \ do { \ - register unsigned len = sizeof(type) * ((target).num=(source).num);\ + unsigned len = sizeof(type) * ((target).num=(source).num);\ if (len != 0) { \ memcpy(((target).list=(type*)ckalloc(len)), (source).list, len); \ } else { \ diff --git a/generic/tclPathObj.c b/generic/tclPathObj.c index 3703aaf..78d87b9 100644 --- a/generic/tclPathObj.c +++ b/generic/tclPathObj.c @@ -2242,7 +2242,7 @@ SetFsPathFromAny( int len; FsPath *fsPathPtr; Tcl_Obj *transPtr; - char *name; + const char *name; if (TclHasIntRep(pathPtr, &fsPathType)) { return TCL_OK; diff --git a/generic/tclPkg.c b/generic/tclPkg.c index ed5c57a..6727715 100644 --- a/generic/tclPkg.c +++ b/generic/tclPkg.c @@ -280,11 +280,11 @@ TclPkgFileSeen( if (pkgFiles && pkgFiles->names) { const char *name = pkgFiles->names->name; Tcl_HashTable *table = &pkgFiles->table; - int new; - Tcl_HashEntry *entry = Tcl_CreateHashEntry(table, name, &new); + int isNew; + Tcl_HashEntry *entry = Tcl_CreateHashEntry(table, name, &isNew); Tcl_Obj *list; - if (new) { + if (isNew) { list = Tcl_NewObj(); Tcl_SetHashValue(entry, list); Tcl_IncrRefCount(list); diff --git a/generic/tclPlatDecls.h b/generic/tclPlatDecls.h index 7988599..3b591e6 100644 --- a/generic/tclPlatDecls.h +++ b/generic/tclPlatDecls.h @@ -123,10 +123,10 @@ extern const TclPlatStubs *tclPlatStubsPtr; #undef Tcl_WinTCharToUtf #ifdef _WIN32 #define Tcl_WinUtfToTChar(string, len, dsPtr) ((Tcl_DStringInit(dsPtr), (string) != NULL) \ - ? (TCHAR *)Tcl_UtfToUtf16DString((string), (len), (dsPtr)) \ + ? (TCHAR *)Tcl_UtfToChar16DString((string), (len), (dsPtr)) \ : ((void)(len), NULL)) #define Tcl_WinTCharToUtf(string, len, dsPtr) ((Tcl_DStringInit(dsPtr), (string) != NULL) \ - ? (char *)Tcl_Utf16ToUtfDString((string), ((int)(len) >> 1), (dsPtr)) \ + ? (char *)Tcl_Char16ToUtfDString((string), ((int)(len) >> 1), (dsPtr)) \ : ((void)(len), NULL)) #endif #endif diff --git a/generic/tclProc.c b/generic/tclProc.c index afa00ee..1ed48ac 100644 --- a/generic/tclProc.c +++ b/generic/tclProc.c @@ -157,7 +157,7 @@ Tcl_ProcObjCmd( int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { - register Interp *iPtr = (Interp *) interp; + Interp *iPtr = (Interp *) interp; Proc *procPtr; const char *procName; const char *simpleName, *procArgs, *procBody; @@ -405,9 +405,9 @@ TclCreateProc( { Interp *iPtr = (Interp *) interp; - register Proc *procPtr = NULL; + Proc *procPtr = NULL; int i, result, numArgs; - register CompiledLocal *localPtr = NULL; + CompiledLocal *localPtr = NULL; Tcl_Obj **argArray; int precompiled = 0; @@ -761,7 +761,7 @@ TclObjGetFrame( CallFrame **framePtrPtr) /* Store pointer to frame here (or NULL if * global frame indicated). */ { - register Interp *iPtr = (Interp *) interp; + Interp *iPtr = (Interp *) interp; int curLevel, level, result; const Tcl_ObjIntRep *irPtr; const char *name = NULL; @@ -898,7 +898,7 @@ TclNRUplevelObjCmd( Tcl_Obj *const objv[]) /* Argument objects. */ { - register Interp *iPtr = (Interp *) interp; + Interp *iPtr = (Interp *) interp; CmdFrame *invoker = NULL; int word = 0; int result; @@ -1038,7 +1038,7 @@ ProcWrongNumArgs( int skip) { CallFrame *framePtr = ((Interp *)interp)->varFramePtr; - register Proc *procPtr = framePtr->procPtr; + Proc *procPtr = framePtr->procPtr; int localCt = procPtr->numCompiledLocals, numArgs, i; Tcl_Obj **desiredObjs; const char *final = NULL; @@ -1063,7 +1063,7 @@ ProcWrongNumArgs( Tcl_IncrRefCount(desiredObjs[0]); if (localCt > 0) { - register Var *defPtr = (Var *) (&framePtr->localCachePtr->varName0 + localCt); + Var *defPtr = (Var *) (&framePtr->localCachePtr->varName0 + localCt); for (i=1 ; i<=numArgs ; i++, defPtr++) { Tcl_Obj *argObj; @@ -1254,7 +1254,7 @@ InitResolvedLocals( resVarInfo = localPtr->resolveInfo; if (resVarInfo && resVarInfo->fetchProc) { - register Var *resolvedVarPtr = (Var *) + Var *resolvedVarPtr = (Var *) resVarInfo->fetchProc(interp, resVarInfo); if (resolvedVarPtr) { @@ -1277,7 +1277,7 @@ TclFreeLocalCache( Tcl_Obj **namePtrPtr = &localCachePtr->varName0; for (i = 0; i < localCachePtr->numVars; i++, namePtrPtr++) { - register Tcl_Obj *objPtr = *namePtrPtr; + Tcl_Obj *objPtr = *namePtrPtr; if (objPtr) { /* TclReleaseLiteral calls Tcl_DecrRefCount for us */ @@ -1300,7 +1300,7 @@ InitLocalCache( Var *varPtr; LocalCache *localCachePtr; CompiledLocal *localPtr; - int new; + int isNew; ByteCodeGetIntRep(procPtr->bodyPtr, &tclByteCodeType, codePtr); @@ -1323,7 +1323,7 @@ InitLocalCache( } else { *namePtr = TclCreateLiteral(iPtr, localPtr->name, localPtr->nameLength, /* hash */ (unsigned int) -1, - &new, /* nsPtr */ NULL, 0, NULL); + &isNew, /* nsPtr */ NULL, 0, NULL); Tcl_IncrRefCount(*namePtr); } @@ -1363,16 +1363,16 @@ InitLocalCache( static int InitArgsAndLocals( - register Tcl_Interp *interp,/* Interpreter in which procedure was + Tcl_Interp *interp,/* Interpreter in which procedure was * invoked. */ Tcl_Obj *procNameObj, /* Procedure name for error reporting. */ int skip) /* Number of initial arguments to be skipped, * i.e., words in the "command name". */ { CallFrame *framePtr = ((Interp *)interp)->varFramePtr; - register Proc *procPtr = framePtr->procPtr; + Proc *procPtr = framePtr->procPtr; ByteCode *codePtr; - register Var *varPtr, *defPtr; + Var *varPtr, *defPtr; int localCt = procPtr->numCompiledLocals, numArgs, argCt, i, imax; Tcl_Obj *const *argObjs; @@ -1530,7 +1530,7 @@ int TclPushProcCallFrame( ClientData clientData, /* Record describing procedure to be * interpreted. */ - register Tcl_Interp *interp,/* Interpreter in which procedure was + Tcl_Interp *interp,/* Interpreter in which procedure was * invoked. */ int objc, /* Count of number of arguments to this * procedure. */ @@ -1622,7 +1622,7 @@ int TclObjInterpProc( ClientData clientData, /* Record describing procedure to be * interpreted. */ - register Tcl_Interp *interp,/* Interpreter in which procedure was + Tcl_Interp *interp,/* Interpreter in which procedure was * invoked. */ int objc, /* Count of number of arguments to this * procedure. */ @@ -1639,7 +1639,7 @@ int TclNRInterpProc( ClientData clientData, /* Record describing procedure to be * interpreted. */ - register Tcl_Interp *interp,/* Interpreter in which procedure was + Tcl_Interp *interp,/* Interpreter in which procedure was * invoked. */ int objc, /* Count of number of arguments to this * procedure. */ @@ -1674,7 +1674,7 @@ TclNRInterpProc( int TclNRInterpProcCore( - register Tcl_Interp *interp,/* Interpreter in which procedure was + Tcl_Interp *interp,/* Interpreter in which procedure was * invoked. */ Tcl_Obj *procNameObj, /* Procedure name for error reporting. */ int skip, /* Number of initial arguments to be skipped, @@ -1683,7 +1683,7 @@ TclNRInterpProcCore( * results of the overall procedure. */ { Interp *iPtr = (Interp *) interp; - register Proc *procPtr = iPtr->varFramePtr->procPtr; + Proc *procPtr = iPtr->varFramePtr->procPtr; int result; CallFrame *freePtr; ByteCode *codePtr; @@ -1700,8 +1700,8 @@ TclNRInterpProcCore( #if defined(TCL_COMPILE_DEBUG) if (tclTraceExec >= 1) { - register CallFrame *framePtr = iPtr->varFramePtr; - register int i; + CallFrame *framePtr = iPtr->varFramePtr; + int i; if (framePtr->isProcCallFrame & FRAME_IS_LAMBDA) { fprintf(stdout, "Calling lambda "); @@ -2119,9 +2119,9 @@ TclProcDeleteProc( void TclProcCleanupProc( - register Proc *procPtr) /* Procedure to be deleted. */ + Proc *procPtr) /* Procedure to be deleted. */ { - register CompiledLocal *localPtr; + CompiledLocal *localPtr; Tcl_Obj *bodyPtr = procPtr->bodyPtr; Tcl_Obj *defPtr; Tcl_ResolvedVarInfo *resVarInfo; @@ -2370,7 +2370,7 @@ ProcBodyFree( static void DupLambdaInternalRep( Tcl_Obj *srcPtr, /* Object with internal rep to copy. */ - register Tcl_Obj *copyPtr) /* Object with internal rep to set. */ + Tcl_Obj *copyPtr) /* Object with internal rep to set. */ { Proc *procPtr; Tcl_Obj *nsObjPtr; @@ -2385,7 +2385,7 @@ DupLambdaInternalRep( static void FreeLambdaInternalRep( - register Tcl_Obj *objPtr) /* CmdName object with internal representation + Tcl_Obj *objPtr) /* CmdName object with internal representation * to free. */ { Proc *procPtr; @@ -2403,7 +2403,7 @@ FreeLambdaInternalRep( static int SetLambdaFromAny( Tcl_Interp *interp, /* Used for error reporting if not NULL. */ - register Tcl_Obj *objPtr) /* The object to convert. */ + Tcl_Obj *objPtr) /* The object to convert. */ { Interp *iPtr = (Interp *) interp; const char *name; diff --git a/generic/tclResult.c b/generic/tclResult.c index 4d14f01..6e9d4a6 100644 --- a/generic/tclResult.c +++ b/generic/tclResult.c @@ -832,19 +832,19 @@ SetupAppendBuffer( totalSpace = newSpace + iPtr->appendUsed; if (totalSpace >= iPtr->appendAvl) { - char *new; + char *newSpace; if (totalSpace < 100) { totalSpace = 200; } else { totalSpace *= 2; } - new = ckalloc(totalSpace); - strcpy(new, iPtr->result); + newSpace = ckalloc(totalSpace); + strcpy(newSpace, iPtr->result); if (iPtr->appendResult != NULL) { ckfree(iPtr->appendResult); } - iPtr->appendResult = new; + iPtr->appendResult = newSpace; iPtr->appendAvl = totalSpace; } else if (iPtr->result != iPtr->appendResult) { strcpy(iPtr->appendResult, iPtr->result); diff --git a/generic/tclStringObj.c b/generic/tclStringObj.c index 5a29477..8652363 100644 --- a/generic/tclStringObj.c +++ b/generic/tclStringObj.c @@ -3563,7 +3563,7 @@ TclStringFirst( } if (TclIsPureByteArray(needle) && TclIsPureByteArray(haystack)) { - unsigned char *end, *try, *bh; + unsigned char *end, *check, *bh; unsigned char *bn = Tcl_GetByteArrayFromObj(needle, &ln); /* Find bytes in bytes */ @@ -3574,25 +3574,25 @@ TclStringFirst( } end = bh + lh; - try = bh + start; - while (try + ln <= end) { + check = bh + start; + while (check + ln <= end) { /* * Look for the leading byte of the needle in the haystack - * starting at try and stopping when there's not enough room + * starting at check and stopping when there's not enough room * for the needle left. */ - try = memchr(try, bn[0], (end + 1 - ln) - try); - if (try == NULL) { + check = memchr(check, bn[0], (end + 1 - ln) - check); + if (check == NULL) { /* Leading byte not found -> needle cannot be found. */ return -1; } /* Leading byte found, check rest of needle. */ - if (0 == memcmp(try+1, bn+1, ln-1)) { + if (0 == memcmp(check+1, bn+1, ln-1)) { /* Checks! Return the successful index. */ - return (try - bh); + return (check - bh); } /* Rest of needle match failed; Iterate to continue search. */ - try++; + check++; } return -1; } @@ -3610,7 +3610,7 @@ TclStringFirst( */ { - Tcl_UniChar *try, *end, *uh; + Tcl_UniChar *check, *end, *uh; Tcl_UniChar *un = TclGetUnicodeFromObj(needle, &ln); uh = TclGetUnicodeFromObj(haystack, &lh); @@ -3620,10 +3620,10 @@ TclStringFirst( } end = uh + lh; - for (try = uh + start; try + ln <= end; try++) { - if ((*try == *un) && (0 == - memcmp(try + 1, un + 1, (ln-1) * sizeof(Tcl_UniChar)))) { - return (try - uh); + for (check = uh + start; check + ln <= end; check++) { + if ((*check == *un) && (0 == + memcmp(check + 1, un + 1, (ln-1) * sizeof(Tcl_UniChar)))) { + return (check - uh); } } return -1; @@ -3667,7 +3667,7 @@ TclStringLast( } if (TclIsPureByteArray(needle) && TclIsPureByteArray(haystack)) { - unsigned char *try, *bh = Tcl_GetByteArrayFromObj(haystack, &lh); + unsigned char *check, *bh = Tcl_GetByteArrayFromObj(haystack, &lh); unsigned char *bn = Tcl_GetByteArrayFromObj(needle, &ln); if (last >= lh) { @@ -3677,20 +3677,20 @@ TclStringLast( /* Don't start the loop if there cannot be a valid answer */ return -1; } - try = bh + last + 1 - ln; + check = bh + last + 1 - ln; - while (try >= bh) { - if ((*try == bn[0]) - && (0 == memcmp(try+1, bn+1, ln-1))) { - return (try - bh); + while (check >= bh) { + if ((*check == bn[0]) + && (0 == memcmp(check+1, bn+1, ln-1))) { + return (check - bh); } - try--; + check--; } return -1; } { - Tcl_UniChar *try, *uh = TclGetUnicodeFromObj(haystack, &lh); + Tcl_UniChar *check, *uh = TclGetUnicodeFromObj(haystack, &lh); Tcl_UniChar *un = TclGetUnicodeFromObj(needle, &ln); if (last >= lh) { @@ -3700,13 +3700,13 @@ TclStringLast( /* Don't start the loop if there cannot be a valid answer */ return -1; } - try = uh + last + 1 - ln; - while (try >= uh) { - if ((*try == un[0]) - && (0 == memcmp(try+1, un+1, (ln-1)*sizeof(Tcl_UniChar)))) { - return (try - uh); + check = uh + last + 1 - ln; + while (check >= uh) { + if ((*check == un[0]) + && (0 == memcmp(check+1, un+1, (ln-1)*sizeof(Tcl_UniChar)))) { + return (check - uh); } - try--; + check--; } return -1; } diff --git a/generic/tclStubInit.c b/generic/tclStubInit.c index 9d9907e..6ef55bd 100644 --- a/generic/tclStubInit.c +++ b/generic/tclStubInit.c @@ -289,10 +289,7 @@ Tcl_WinUtfToTChar( Tcl_DString *dsPtr) { Tcl_DStringInit(dsPtr); - if (!string) { - return NULL; - } - return (char *)Tcl_UtfToUtf16DString(string, len, dsPtr); + return (char *)Tcl_UtfToChar16DString(string, len, dsPtr); } #undef Tcl_WinTCharToUtf char * @@ -302,10 +299,7 @@ Tcl_WinTCharToUtf( Tcl_DString *dsPtr) { Tcl_DStringInit(dsPtr); - if (!string) { - return NULL; - } - return Tcl_Utf16ToUtfDString((const unsigned short *)string, len >> 1, dsPtr); + return Tcl_Char16ToUtfDString((const unsigned short *)string, len >> 1, dsPtr); } #endif /* !defined(TCL_NO_DEPRECATED) */ @@ -1387,7 +1381,7 @@ const TclStubs tclStubs = { Tcl_UtfToExternalDString, /* 333 */ Tcl_UtfToLower, /* 334 */ Tcl_UtfToTitle, /* 335 */ - Tcl_UtfToUtf16, /* 336 */ + Tcl_UtfToChar16, /* 336 */ Tcl_UtfToUpper, /* 337 */ Tcl_WriteChars, /* 338 */ Tcl_WriteObj, /* 339 */ @@ -1405,8 +1399,8 @@ const TclStubs tclStubs = { Tcl_UniCharIsWordChar, /* 351 */ Tcl_UniCharLen, /* 352 */ Tcl_UniCharNcmp, /* 353 */ - Tcl_Utf16ToUtfDString, /* 354 */ - Tcl_UtfToUtf16DString, /* 355 */ + Tcl_Char16ToUtfDString, /* 354 */ + Tcl_UtfToChar16DString, /* 355 */ Tcl_GetRegExpFromObj, /* 356 */ Tcl_EvalTokens, /* 357 */ Tcl_FreeParse, /* 358 */ diff --git a/generic/tclTest.c b/generic/tclTest.c index 4eb8519..9ad8244 100644 --- a/generic/tclTest.c +++ b/generic/tclTest.c @@ -2404,11 +2404,11 @@ ExitProcOdd( void *clientData) /* Integer value to print. */ { char buf[16 + TCL_INTEGER_SPACE]; - size_t len; + int len; - sprintf(buf, "odd %" TCL_Z_MODIFIER "d\n", (size_t)PTR2INT(clientData)); + sprintf(buf, "odd %d\n", (int)PTR2INT(clientData)); len = strlen(buf); - if (len != (size_t) write(1, buf, len)) { + if (len != (int) write(1, buf, len)) { Tcl_Panic("ExitProcOdd: unable to write to stdout"); } } @@ -2418,11 +2418,11 @@ ExitProcEven( void *clientData) /* Integer value to print. */ { char buf[16 + TCL_INTEGER_SPACE]; - size_t len; + int len; - sprintf(buf, "even %" TCL_Z_MODIFIER "d\n", (size_t)PTR2INT(clientData)); + sprintf(buf, "even %d\n", (int)PTR2INT(clientData)); len = strlen(buf); - if (len != (size_t) write(1, buf, len)) { + if (len != (int) write(1, buf, len)) { Tcl_Panic("ExitProcEven: unable to write to stdout"); } } diff --git a/generic/tclTestProcBodyObj.c b/generic/tclTestProcBodyObj.c index 913b253..11e841f 100644 --- a/generic/tclTestProcBodyObj.c +++ b/generic/tclTestProcBodyObj.c @@ -51,7 +51,7 @@ static int ProcBodyTestCheckObjCmd(ClientData dummy, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); static int ProcBodyTestInitInternal(Tcl_Interp *interp, int isSafe); static int RegisterCommand(Tcl_Interp* interp, - const char *namespace, const CmdTable *cmdTablePtr); + const char *namesp, const CmdTable *cmdTablePtr); /* * List of commands to create when the package is loaded; must go after the @@ -139,7 +139,7 @@ static int RegisterCommand( Tcl_Interp* interp, /* the Tcl interpreter for which the operation * is performed */ - const char *namespace, /* the namespace in which the command is + const char *namesp, /* the namespace in which the command is * registered */ const CmdTable *cmdTablePtr)/* the command to register */ { @@ -147,13 +147,13 @@ RegisterCommand( if (cmdTablePtr->exportIt) { sprintf(buf, "namespace eval %s { namespace export %s }", - namespace, cmdTablePtr->cmdName); + namesp, cmdTablePtr->cmdName); if (Tcl_EvalEx(interp, buf, -1, 0) != TCL_OK) { return TCL_ERROR; } } - sprintf(buf, "%s::%s", namespace, cmdTablePtr->cmdName); + sprintf(buf, "%s::%s", namesp, cmdTablePtr->cmdName); Tcl_CreateObjCommand(interp, buf, cmdTablePtr->proc, 0, 0); return TCL_OK; } diff --git a/generic/tclUtf.c b/generic/tclUtf.c index b194c1b..ec9000b 100644 --- a/generic/tclUtf.c +++ b/generic/tclUtf.c @@ -262,7 +262,7 @@ Tcl_UniCharToUtfDString( #endif /* TCL_UTF_MAX > 3 */ char * -Tcl_Utf16ToUtfDString( +Tcl_Char16ToUtfDString( const unsigned short *uniStr, /* Utf-16 string to convert to UTF-8. */ int uniLength, /* Length of Utf-16 string. */ Tcl_DString *dsPtr) /* UTF-8 representation of string is appended @@ -440,7 +440,7 @@ Tcl_UtfToUniChar( #endif /* TCL_UTF_MAX > 3 */ int -Tcl_UtfToUtf16( +Tcl_UtfToChar16( const char *src, /* The UTF-8 string. */ unsigned short *chPtr)/* Filled with the Utf-16 representation of * the UTF-8 string. */ @@ -611,7 +611,7 @@ Tcl_UtfToUniCharDString( #endif /* TCL_UTF_MAX > 3 */ unsigned short * -Tcl_UtfToUtf16DString( +Tcl_UtfToChar16DString( const char *src, /* UTF-8 string to convert to Unicode. */ int length, /* Length of UTF-8 string in bytes, or -1 for * strlen(). */ @@ -642,13 +642,13 @@ Tcl_UtfToUtf16DString( p = src; end = src + length - 4; while (p < end) { - p += Tcl_UtfToUtf16(p, &ch); + p += Tcl_UtfToChar16(p, &ch); *w++ = ch; } end += 4; while (p < end) { if (Tcl_UtfCharComplete(p, end-p)) { - p += Tcl_UtfToUtf16(p, &ch); + p += Tcl_UtfToChar16(p, &ch); } else { ch = UCHAR(*p++); } @@ -708,7 +708,7 @@ Tcl_UtfCharComplete( #if TCL_UTF_MAX == 3 # undef Tcl_UtfToUniChar -# define Tcl_UtfToUniChar Tcl_UtfToUtf16 +# define Tcl_UtfToUniChar Tcl_UtfToChar16 #endif int diff --git a/generic/tclZipfs.c b/generic/tclZipfs.c index 56f0cb9..3cb271b 100644 --- a/generic/tclZipfs.c +++ b/generic/tclZipfs.c @@ -4930,7 +4930,7 @@ TclZipfs_AppHook( Tcl_DString ds; Tcl_DStringInit(&ds); - archive = Tcl_Utf16ToUtfDString((*argvPtr)[1], -1, &ds); + archive = Tcl_Char16ToUtfDString((*argvPtr)[1], -1, &ds); #else /* !_WIN32 */ archive = (*argvPtr)[1]; #endif /* _WIN32 */ diff --git a/library/tzdata/Africa/Casablanca b/library/tzdata/Africa/Casablanca index a280415..99027c9 100644 --- a/library/tzdata/Africa/Casablanca +++ b/library/tzdata/Africa/Casablanca @@ -97,4 +97,106 @@ set TZData(:Africa/Casablanca) { {2111018400 3600 0 +01} {2138234400 0 1 +01} {2141863200 3600 0 +01} + {2169079200 0 1 +01} + {2172103200 3600 0 +01} + {2199924000 0 1 +01} + {2202948000 3600 0 +01} + {2230164000 0 1 +01} + {2233792800 3600 0 +01} + {2261008800 0 1 +01} + {2264032800 3600 0 +01} + {2291248800 0 1 +01} + {2294877600 3600 0 +01} + {2322093600 0 1 +01} + {2325117600 3600 0 +01} + {2352938400 0 1 +01} + {2355962400 3600 0 +01} + {2383178400 0 1 +01} + {2386807200 3600 0 +01} + {2414023200 0 1 +01} + {2417047200 3600 0 +01} + {2444868000 0 1 +01} + {2447892000 3600 0 +01} + {2475108000 0 1 +01} + {2478736800 3600 0 +01} + {2505952800 0 1 +01} + {2508976800 3600 0 +01} + {2536192800 0 1 +01} + {2539821600 3600 0 +01} + {2567037600 0 1 +01} + {2570061600 3600 0 +01} + {2597882400 0 1 +01} + {2600906400 3600 0 +01} + {2628122400 0 1 +01} + {2631751200 3600 0 +01} + {2658967200 0 1 +01} + {2661991200 3600 0 +01} + {2689812000 0 1 +01} + {2692836000 3600 0 +01} + {2720052000 0 1 +01} + {2723680800 3600 0 +01} + {2750896800 0 1 +01} + {2753920800 3600 0 +01} + {2781136800 0 1 +01} + {2784765600 3600 0 +01} + {2811981600 0 1 +01} + {2815005600 3600 0 +01} + {2842826400 0 1 +01} + {2845850400 3600 0 +01} + {2873066400 0 1 +01} + {2876695200 3600 0 +01} + {2903911200 0 1 +01} + {2906935200 3600 0 +01} + {2934756000 0 1 +01} + {2937780000 3600 0 +01} + {2964996000 0 1 +01} + {2968020000 3600 0 +01} + {2995840800 0 1 +01} + {2998864800 3600 0 +01} + {3026080800 0 1 +01} + {3029709600 3600 0 +01} + {3056925600 0 1 +01} + {3059949600 3600 0 +01} + {3087770400 0 1 +01} + {3090794400 3600 0 +01} + {3118010400 0 1 +01} + {3121639200 3600 0 +01} + {3148855200 0 1 +01} + {3151879200 3600 0 +01} + {3179700000 0 1 +01} + {3182724000 3600 0 +01} + {3209940000 0 1 +01} + {3212964000 3600 0 +01} + {3240784800 0 1 +01} + {3243808800 3600 0 +01} + {3271024800 0 1 +01} + {3274653600 3600 0 +01} + {3301869600 0 1 +01} + {3304893600 3600 0 +01} + {3332714400 0 1 +01} + {3335738400 3600 0 +01} + {3362954400 0 1 +01} + {3366583200 3600 0 +01} + {3393799200 0 1 +01} + {3396823200 3600 0 +01} + {3424644000 0 1 +01} + {3427668000 3600 0 +01} + {3454884000 0 1 +01} + {3457908000 3600 0 +01} + {3485728800 0 1 +01} + {3488752800 3600 0 +01} + {3515968800 0 1 +01} + {3519597600 3600 0 +01} + {3546813600 0 1 +01} + {3549837600 3600 0 +01} + {3577658400 0 1 +01} + {3580682400 3600 0 +01} + {3607898400 0 1 +01} + {3611527200 3600 0 +01} + {3638743200 0 1 +01} + {3641767200 3600 0 +01} + {3669588000 0 1 +01} + {3672612000 3600 0 +01} + {3699828000 0 1 +01} + {3702852000 3600 0 +01} } diff --git a/library/tzdata/Africa/El_Aaiun b/library/tzdata/Africa/El_Aaiun index 58a4594..9f021a4 100644 --- a/library/tzdata/Africa/El_Aaiun +++ b/library/tzdata/Africa/El_Aaiun @@ -86,4 +86,106 @@ set TZData(:Africa/El_Aaiun) { {2111018400 3600 0 +01} {2138234400 0 1 +01} {2141863200 3600 0 +01} + {2169079200 0 1 +01} + {2172103200 3600 0 +01} + {2199924000 0 1 +01} + {2202948000 3600 0 +01} + {2230164000 0 1 +01} + {2233792800 3600 0 +01} + {2261008800 0 1 +01} + {2264032800 3600 0 +01} + {2291248800 0 1 +01} + {2294877600 3600 0 +01} + {2322093600 0 1 +01} + {2325117600 3600 0 +01} + {2352938400 0 1 +01} + {2355962400 3600 0 +01} + {2383178400 0 1 +01} + {2386807200 3600 0 +01} + {2414023200 0 1 +01} + {2417047200 3600 0 +01} + {2444868000 0 1 +01} + {2447892000 3600 0 +01} + {2475108000 0 1 +01} + {2478736800 3600 0 +01} + {2505952800 0 1 +01} + {2508976800 3600 0 +01} + {2536192800 0 1 +01} + {2539821600 3600 0 +01} + {2567037600 0 1 +01} + {2570061600 3600 0 +01} + {2597882400 0 1 +01} + {2600906400 3600 0 +01} + {2628122400 0 1 +01} + {2631751200 3600 0 +01} + {2658967200 0 1 +01} + {2661991200 3600 0 +01} + {2689812000 0 1 +01} + {2692836000 3600 0 +01} + {2720052000 0 1 +01} + {2723680800 3600 0 +01} + {2750896800 0 1 +01} + {2753920800 3600 0 +01} + {2781136800 0 1 +01} + {2784765600 3600 0 +01} + {2811981600 0 1 +01} + {2815005600 3600 0 +01} + {2842826400 0 1 +01} + {2845850400 3600 0 +01} + {2873066400 0 1 +01} + {2876695200 3600 0 +01} + {2903911200 0 1 +01} + {2906935200 3600 0 +01} + {2934756000 0 1 +01} + {2937780000 3600 0 +01} + {2964996000 0 1 +01} + {2968020000 3600 0 +01} + {2995840800 0 1 +01} + {2998864800 3600 0 +01} + {3026080800 0 1 +01} + {3029709600 3600 0 +01} + {3056925600 0 1 +01} + {3059949600 3600 0 +01} + {3087770400 0 1 +01} + {3090794400 3600 0 +01} + {3118010400 0 1 +01} + {3121639200 3600 0 +01} + {3148855200 0 1 +01} + {3151879200 3600 0 +01} + {3179700000 0 1 +01} + {3182724000 3600 0 +01} + {3209940000 0 1 +01} + {3212964000 3600 0 +01} + {3240784800 0 1 +01} + {3243808800 3600 0 +01} + {3271024800 0 1 +01} + {3274653600 3600 0 +01} + {3301869600 0 1 +01} + {3304893600 3600 0 +01} + {3332714400 0 1 +01} + {3335738400 3600 0 +01} + {3362954400 0 1 +01} + {3366583200 3600 0 +01} + {3393799200 0 1 +01} + {3396823200 3600 0 +01} + {3424644000 0 1 +01} + {3427668000 3600 0 +01} + {3454884000 0 1 +01} + {3457908000 3600 0 +01} + {3485728800 0 1 +01} + {3488752800 3600 0 +01} + {3515968800 0 1 +01} + {3519597600 3600 0 +01} + {3546813600 0 1 +01} + {3549837600 3600 0 +01} + {3577658400 0 1 +01} + {3580682400 3600 0 +01} + {3607898400 0 1 +01} + {3611527200 3600 0 +01} + {3638743200 0 1 +01} + {3641767200 3600 0 +01} + {3669588000 0 1 +01} + {3672612000 3600 0 +01} + {3699828000 0 1 +01} + {3702852000 3600 0 +01} } diff --git a/library/tzdata/America/Campo_Grande b/library/tzdata/America/Campo_Grande index 5ec7112..904c27d 100644 --- a/library/tzdata/America/Campo_Grande +++ b/library/tzdata/America/Campo_Grande @@ -93,165 +93,4 @@ set TZData(:America/Campo_Grande) { {1518922800 -14400 0 -04} {1541304000 -10800 1 -04} {1550372400 -14400 0 -04} - {1572753600 -10800 1 -04} - {1581822000 -14400 0 -04} - {1604203200 -10800 1 -04} - {1613876400 -14400 0 -04} - {1636257600 -10800 1 -04} - {1645326000 -14400 0 -04} - {1667707200 -10800 1 -04} - {1677380400 -14400 0 -04} - {1699156800 -10800 1 -04} - {1708225200 -14400 0 -04} - {1730606400 -10800 1 -04} - {1739674800 -14400 0 -04} - {1762056000 -10800 1 -04} - {1771729200 -14400 0 -04} - {1793505600 -10800 1 -04} - {1803178800 -14400 0 -04} - {1825560000 -10800 1 -04} - {1834628400 -14400 0 -04} - {1857009600 -10800 1 -04} - {1866078000 -14400 0 -04} - {1888459200 -10800 1 -04} - {1897527600 -14400 0 -04} - {1919908800 -10800 1 -04} - {1928977200 -14400 0 -04} - {1951358400 -10800 1 -04} - {1960426800 -14400 0 -04} - {1983412800 -10800 1 -04} - {1992481200 -14400 0 -04} - {2014862400 -10800 1 -04} - {2024535600 -14400 0 -04} - {2046312000 -10800 1 -04} - {2055380400 -14400 0 -04} - {2077761600 -10800 1 -04} - {2086830000 -14400 0 -04} - {2109211200 -10800 1 -04} - {2118884400 -14400 0 -04} - {2140660800 -10800 1 -04} - {2150334000 -14400 0 -04} - {2172715200 -10800 1 -04} - {2181783600 -14400 0 -04} - {2204164800 -10800 1 -04} - {2213233200 -14400 0 -04} - {2235614400 -10800 1 -04} - {2244682800 -14400 0 -04} - {2267064000 -10800 1 -04} - {2276132400 -14400 0 -04} - {2298513600 -10800 1 -04} - {2307582000 -14400 0 -04} - {2329963200 -10800 1 -04} - {2339636400 -14400 0 -04} - {2362017600 -10800 1 -04} - {2371086000 -14400 0 -04} - {2393467200 -10800 1 -04} - {2402535600 -14400 0 -04} - {2424916800 -10800 1 -04} - {2433985200 -14400 0 -04} - {2456366400 -10800 1 -04} - {2465434800 -14400 0 -04} - {2487816000 -10800 1 -04} - {2497489200 -14400 0 -04} - {2519870400 -10800 1 -04} - {2528938800 -14400 0 -04} - {2551320000 -10800 1 -04} - {2560388400 -14400 0 -04} - {2582769600 -10800 1 -04} - {2591838000 -14400 0 -04} - {2614219200 -10800 1 -04} - {2623287600 -14400 0 -04} - {2645668800 -10800 1 -04} - {2654737200 -14400 0 -04} - {2677118400 -10800 1 -04} - {2686791600 -14400 0 -04} - {2709172800 -10800 1 -04} - {2718241200 -14400 0 -04} - {2740622400 -10800 1 -04} - {2749690800 -14400 0 -04} - {2772072000 -10800 1 -04} - {2781140400 -14400 0 -04} - {2803521600 -10800 1 -04} - {2812590000 -14400 0 -04} - {2834971200 -10800 1 -04} - {2844039600 -14400 0 -04} - {2867025600 -10800 1 -04} - {2876094000 -14400 0 -04} - {2898475200 -10800 1 -04} - {2907543600 -14400 0 -04} - {2929924800 -10800 1 -04} - {2938993200 -14400 0 -04} - {2961374400 -10800 1 -04} - {2970442800 -14400 0 -04} - {2992824000 -10800 1 -04} - {3001892400 -14400 0 -04} - {3024273600 -10800 1 -04} - {3033946800 -14400 0 -04} - {3056328000 -10800 1 -04} - {3065396400 -14400 0 -04} - {3087777600 -10800 1 -04} - {3096846000 -14400 0 -04} - {3119227200 -10800 1 -04} - {3128295600 -14400 0 -04} - {3150676800 -10800 1 -04} - {3159745200 -14400 0 -04} - {3182126400 -10800 1 -04} - {3191194800 -14400 0 -04} - {3213576000 -10800 1 -04} - {3223249200 -14400 0 -04} - {3245630400 -10800 1 -04} - {3254698800 -14400 0 -04} - {3277080000 -10800 1 -04} - {3286148400 -14400 0 -04} - {3308529600 -10800 1 -04} - {3317598000 -14400 0 -04} - {3339979200 -10800 1 -04} - {3349047600 -14400 0 -04} - {3371428800 -10800 1 -04} - {3381102000 -14400 0 -04} - {3403483200 -10800 1 -04} - {3412551600 -14400 0 -04} - {3434932800 -10800 1 -04} - {3444001200 -14400 0 -04} - {3466382400 -10800 1 -04} - {3475450800 -14400 0 -04} - {3497832000 -10800 1 -04} - {3506900400 -14400 0 -04} - {3529281600 -10800 1 -04} - {3538350000 -14400 0 -04} - {3560731200 -10800 1 -04} - {3570404400 -14400 0 -04} - {3592785600 -10800 1 -04} - {3601854000 -14400 0 -04} - {3624235200 -10800 1 -04} - {3633303600 -14400 0 -04} - {3655684800 -10800 1 -04} - {3664753200 -14400 0 -04} - {3687134400 -10800 1 -04} - {3696202800 -14400 0 -04} - {3718584000 -10800 1 -04} - {3727652400 -14400 0 -04} - {3750638400 -10800 1 -04} - {3759706800 -14400 0 -04} - {3782088000 -10800 1 -04} - {3791156400 -14400 0 -04} - {3813537600 -10800 1 -04} - {3822606000 -14400 0 -04} - {3844987200 -10800 1 -04} - {3854055600 -14400 0 -04} - {3876436800 -10800 1 -04} - {3885505200 -14400 0 -04} - {3907886400 -10800 1 -04} - {3917559600 -14400 0 -04} - {3939940800 -10800 1 -04} - {3949009200 -14400 0 -04} - {3971390400 -10800 1 -04} - {3980458800 -14400 0 -04} - {4002840000 -10800 1 -04} - {4011908400 -14400 0 -04} - {4034289600 -10800 1 -04} - {4043358000 -14400 0 -04} - {4065739200 -10800 1 -04} - {4074807600 -14400 0 -04} - {4097188800 -10800 1 -04} } diff --git a/library/tzdata/America/Cuiaba b/library/tzdata/America/Cuiaba index 09f5b1f..fd97289 100644 --- a/library/tzdata/America/Cuiaba +++ b/library/tzdata/America/Cuiaba @@ -93,165 +93,4 @@ set TZData(:America/Cuiaba) { {1518922800 -14400 0 -04} {1541304000 -10800 1 -04} {1550372400 -14400 0 -04} - {1572753600 -10800 1 -04} - {1581822000 -14400 0 -04} - {1604203200 -10800 1 -04} - {1613876400 -14400 0 -04} - {1636257600 -10800 1 -04} - {1645326000 -14400 0 -04} - {1667707200 -10800 1 -04} - {1677380400 -14400 0 -04} - {1699156800 -10800 1 -04} - {1708225200 -14400 0 -04} - {1730606400 -10800 1 -04} - {1739674800 -14400 0 -04} - {1762056000 -10800 1 -04} - {1771729200 -14400 0 -04} - {1793505600 -10800 1 -04} - {1803178800 -14400 0 -04} - {1825560000 -10800 1 -04} - {1834628400 -14400 0 -04} - {1857009600 -10800 1 -04} - {1866078000 -14400 0 -04} - {1888459200 -10800 1 -04} - {1897527600 -14400 0 -04} - {1919908800 -10800 1 -04} - {1928977200 -14400 0 -04} - {1951358400 -10800 1 -04} - {1960426800 -14400 0 -04} - {1983412800 -10800 1 -04} - {1992481200 -14400 0 -04} - {2014862400 -10800 1 -04} - {2024535600 -14400 0 -04} - {2046312000 -10800 1 -04} - {2055380400 -14400 0 -04} - {2077761600 -10800 1 -04} - {2086830000 -14400 0 -04} - {2109211200 -10800 1 -04} - {2118884400 -14400 0 -04} - {2140660800 -10800 1 -04} - {2150334000 -14400 0 -04} - {2172715200 -10800 1 -04} - {2181783600 -14400 0 -04} - {2204164800 -10800 1 -04} - {2213233200 -14400 0 -04} - {2235614400 -10800 1 -04} - {2244682800 -14400 0 -04} - {2267064000 -10800 1 -04} - {2276132400 -14400 0 -04} - {2298513600 -10800 1 -04} - {2307582000 -14400 0 -04} - {2329963200 -10800 1 -04} - {2339636400 -14400 0 -04} - {2362017600 -10800 1 -04} - {2371086000 -14400 0 -04} - {2393467200 -10800 1 -04} - {2402535600 -14400 0 -04} - {2424916800 -10800 1 -04} - {2433985200 -14400 0 -04} - {2456366400 -10800 1 -04} - {2465434800 -14400 0 -04} - {2487816000 -10800 1 -04} - {2497489200 -14400 0 -04} - {2519870400 -10800 1 -04} - {2528938800 -14400 0 -04} - {2551320000 -10800 1 -04} - {2560388400 -14400 0 -04} - {2582769600 -10800 1 -04} - {2591838000 -14400 0 -04} - {2614219200 -10800 1 -04} - {2623287600 -14400 0 -04} - {2645668800 -10800 1 -04} - {2654737200 -14400 0 -04} - {2677118400 -10800 1 -04} - {2686791600 -14400 0 -04} - {2709172800 -10800 1 -04} - {2718241200 -14400 0 -04} - {2740622400 -10800 1 -04} - {2749690800 -14400 0 -04} - {2772072000 -10800 1 -04} - {2781140400 -14400 0 -04} - {2803521600 -10800 1 -04} - {2812590000 -14400 0 -04} - {2834971200 -10800 1 -04} - {2844039600 -14400 0 -04} - {2867025600 -10800 1 -04} - {2876094000 -14400 0 -04} - {2898475200 -10800 1 -04} - {2907543600 -14400 0 -04} - {2929924800 -10800 1 -04} - {2938993200 -14400 0 -04} - {2961374400 -10800 1 -04} - {2970442800 -14400 0 -04} - {2992824000 -10800 1 -04} - {3001892400 -14400 0 -04} - {3024273600 -10800 1 -04} - {3033946800 -14400 0 -04} - {3056328000 -10800 1 -04} - {3065396400 -14400 0 -04} - {3087777600 -10800 1 -04} - {3096846000 -14400 0 -04} - {3119227200 -10800 1 -04} - {3128295600 -14400 0 -04} - {3150676800 -10800 1 -04} - {3159745200 -14400 0 -04} - {3182126400 -10800 1 -04} - {3191194800 -14400 0 -04} - {3213576000 -10800 1 -04} - {3223249200 -14400 0 -04} - {3245630400 -10800 1 -04} - {3254698800 -14400 0 -04} - {3277080000 -10800 1 -04} - {3286148400 -14400 0 -04} - {3308529600 -10800 1 -04} - {3317598000 -14400 0 -04} - {3339979200 -10800 1 -04} - {3349047600 -14400 0 -04} - {3371428800 -10800 1 -04} - {3381102000 -14400 0 -04} - {3403483200 -10800 1 -04} - {3412551600 -14400 0 -04} - {3434932800 -10800 1 -04} - {3444001200 -14400 0 -04} - {3466382400 -10800 1 -04} - {3475450800 -14400 0 -04} - {3497832000 -10800 1 -04} - {3506900400 -14400 0 -04} - {3529281600 -10800 1 -04} - {3538350000 -14400 0 -04} - {3560731200 -10800 1 -04} - {3570404400 -14400 0 -04} - {3592785600 -10800 1 -04} - {3601854000 -14400 0 -04} - {3624235200 -10800 1 -04} - {3633303600 -14400 0 -04} - {3655684800 -10800 1 -04} - {3664753200 -14400 0 -04} - {3687134400 -10800 1 -04} - {3696202800 -14400 0 -04} - {3718584000 -10800 1 -04} - {3727652400 -14400 0 -04} - {3750638400 -10800 1 -04} - {3759706800 -14400 0 -04} - {3782088000 -10800 1 -04} - {3791156400 -14400 0 -04} - {3813537600 -10800 1 -04} - {3822606000 -14400 0 -04} - {3844987200 -10800 1 -04} - {3854055600 -14400 0 -04} - {3876436800 -10800 1 -04} - {3885505200 -14400 0 -04} - {3907886400 -10800 1 -04} - {3917559600 -14400 0 -04} - {3939940800 -10800 1 -04} - {3949009200 -14400 0 -04} - {3971390400 -10800 1 -04} - {3980458800 -14400 0 -04} - {4002840000 -10800 1 -04} - {4011908400 -14400 0 -04} - {4034289600 -10800 1 -04} - {4043358000 -14400 0 -04} - {4065739200 -10800 1 -04} - {4074807600 -14400 0 -04} - {4097188800 -10800 1 -04} } diff --git a/library/tzdata/America/Sao_Paulo b/library/tzdata/America/Sao_Paulo index 235f57a..77d5d8c 100644 --- a/library/tzdata/America/Sao_Paulo +++ b/library/tzdata/America/Sao_Paulo @@ -94,165 +94,4 @@ set TZData(:America/Sao_Paulo) { {1518919200 -10800 0 -03} {1541300400 -7200 1 -03} {1550368800 -10800 0 -03} - {1572750000 -7200 1 -03} - {1581818400 -10800 0 -03} - {1604199600 -7200 1 -03} - {1613872800 -10800 0 -03} - {1636254000 -7200 1 -03} - {1645322400 -10800 0 -03} - {1667703600 -7200 1 -03} - {1677376800 -10800 0 -03} - {1699153200 -7200 1 -03} - {1708221600 -10800 0 -03} - {1730602800 -7200 1 -03} - {1739671200 -10800 0 -03} - {1762052400 -7200 1 -03} - {1771725600 -10800 0 -03} - {1793502000 -7200 1 -03} - {1803175200 -10800 0 -03} - {1825556400 -7200 1 -03} - {1834624800 -10800 0 -03} - {1857006000 -7200 1 -03} - {1866074400 -10800 0 -03} - {1888455600 -7200 1 -03} - {1897524000 -10800 0 -03} - {1919905200 -7200 1 -03} - {1928973600 -10800 0 -03} - {1951354800 -7200 1 -03} - {1960423200 -10800 0 -03} - {1983409200 -7200 1 -03} - {1992477600 -10800 0 -03} - {2014858800 -7200 1 -03} - {2024532000 -10800 0 -03} - {2046308400 -7200 1 -03} - {2055376800 -10800 0 -03} - {2077758000 -7200 1 -03} - {2086826400 -10800 0 -03} - {2109207600 -7200 1 -03} - {2118880800 -10800 0 -03} - {2140657200 -7200 1 -03} - {2150330400 -10800 0 -03} - {2172711600 -7200 1 -03} - {2181780000 -10800 0 -03} - {2204161200 -7200 1 -03} - {2213229600 -10800 0 -03} - {2235610800 -7200 1 -03} - {2244679200 -10800 0 -03} - {2267060400 -7200 1 -03} - {2276128800 -10800 0 -03} - {2298510000 -7200 1 -03} - {2307578400 -10800 0 -03} - {2329959600 -7200 1 -03} - {2339632800 -10800 0 -03} - {2362014000 -7200 1 -03} - {2371082400 -10800 0 -03} - {2393463600 -7200 1 -03} - {2402532000 -10800 0 -03} - {2424913200 -7200 1 -03} - {2433981600 -10800 0 -03} - {2456362800 -7200 1 -03} - {2465431200 -10800 0 -03} - {2487812400 -7200 1 -03} - {2497485600 -10800 0 -03} - {2519866800 -7200 1 -03} - {2528935200 -10800 0 -03} - {2551316400 -7200 1 -03} - {2560384800 -10800 0 -03} - {2582766000 -7200 1 -03} - {2591834400 -10800 0 -03} - {2614215600 -7200 1 -03} - {2623284000 -10800 0 -03} - {2645665200 -7200 1 -03} - {2654733600 -10800 0 -03} - {2677114800 -7200 1 -03} - {2686788000 -10800 0 -03} - {2709169200 -7200 1 -03} - {2718237600 -10800 0 -03} - {2740618800 -7200 1 -03} - {2749687200 -10800 0 -03} - {2772068400 -7200 1 -03} - {2781136800 -10800 0 -03} - {2803518000 -7200 1 -03} - {2812586400 -10800 0 -03} - {2834967600 -7200 1 -03} - {2844036000 -10800 0 -03} - {2867022000 -7200 1 -03} - {2876090400 -10800 0 -03} - {2898471600 -7200 1 -03} - {2907540000 -10800 0 -03} - {2929921200 -7200 1 -03} - {2938989600 -10800 0 -03} - {2961370800 -7200 1 -03} - {2970439200 -10800 0 -03} - {2992820400 -7200 1 -03} - {3001888800 -10800 0 -03} - {3024270000 -7200 1 -03} - {3033943200 -10800 0 -03} - {3056324400 -7200 1 -03} - {3065392800 -10800 0 -03} - {3087774000 -7200 1 -03} - {3096842400 -10800 0 -03} - {3119223600 -7200 1 -03} - {3128292000 -10800 0 -03} - {3150673200 -7200 1 -03} - {3159741600 -10800 0 -03} - {3182122800 -7200 1 -03} - {3191191200 -10800 0 -03} - {3213572400 -7200 1 -03} - {3223245600 -10800 0 -03} - {3245626800 -7200 1 -03} - {3254695200 -10800 0 -03} - {3277076400 -7200 1 -03} - {3286144800 -10800 0 -03} - {3308526000 -7200 1 -03} - {3317594400 -10800 0 -03} - {3339975600 -7200 1 -03} - {3349044000 -10800 0 -03} - {3371425200 -7200 1 -03} - {3381098400 -10800 0 -03} - {3403479600 -7200 1 -03} - {3412548000 -10800 0 -03} - {3434929200 -7200 1 -03} - {3443997600 -10800 0 -03} - {3466378800 -7200 1 -03} - {3475447200 -10800 0 -03} - {3497828400 -7200 1 -03} - {3506896800 -10800 0 -03} - {3529278000 -7200 1 -03} - {3538346400 -10800 0 -03} - {3560727600 -7200 1 -03} - {3570400800 -10800 0 -03} - {3592782000 -7200 1 -03} - {3601850400 -10800 0 -03} - {3624231600 -7200 1 -03} - {3633300000 -10800 0 -03} - {3655681200 -7200 1 -03} - {3664749600 -10800 0 -03} - {3687130800 -7200 1 -03} - {3696199200 -10800 0 -03} - {3718580400 -7200 1 -03} - {3727648800 -10800 0 -03} - {3750634800 -7200 1 -03} - {3759703200 -10800 0 -03} - {3782084400 -7200 1 -03} - {3791152800 -10800 0 -03} - {3813534000 -7200 1 -03} - {3822602400 -10800 0 -03} - {3844983600 -7200 1 -03} - {3854052000 -10800 0 -03} - {3876433200 -7200 1 -03} - {3885501600 -10800 0 -03} - {3907882800 -7200 1 -03} - {3917556000 -10800 0 -03} - {3939937200 -7200 1 -03} - {3949005600 -10800 0 -03} - {3971386800 -7200 1 -03} - {3980455200 -10800 0 -03} - {4002836400 -7200 1 -03} - {4011904800 -10800 0 -03} - {4034286000 -7200 1 -03} - {4043354400 -10800 0 -03} - {4065735600 -7200 1 -03} - {4074804000 -10800 0 -03} - {4097185200 -7200 1 -03} } diff --git a/library/tzdata/Asia/Gaza b/library/tzdata/Asia/Gaza index 6d0f144..9b73dcc 100644 --- a/library/tzdata/Asia/Gaza +++ b/library/tzdata/Asia/Gaza @@ -117,166 +117,166 @@ set TZData(:Asia/Gaza) { {1509141600 7200 0 EET} {1521846000 10800 1 EEST} {1540591200 7200 0 EET} - {1553900400 10800 1 EEST} + {1553810400 10800 1 EEST} {1572040800 7200 0 EET} - {1585350000 10800 1 EEST} + {1585260000 10800 1 EEST} {1604095200 7200 0 EET} - {1616799600 10800 1 EEST} + {1616709600 10800 1 EEST} {1635544800 7200 0 EET} - {1648249200 10800 1 EEST} + {1648159200 10800 1 EEST} {1666994400 7200 0 EET} - {1679698800 10800 1 EEST} + {1680213600 10800 1 EEST} {1698444000 7200 0 EET} - {1711753200 10800 1 EEST} + {1711663200 10800 1 EEST} {1729893600 7200 0 EET} - {1743202800 10800 1 EEST} + {1743112800 10800 1 EEST} {1761343200 7200 0 EET} - {1774652400 10800 1 EEST} + {1774562400 10800 1 EEST} {1793397600 7200 0 EET} - {1806102000 10800 1 EEST} + {1806012000 10800 1 EEST} {1824847200 7200 0 EET} - {1837551600 10800 1 EEST} + {1838066400 10800 1 EEST} {1856296800 7200 0 EET} - {1869001200 10800 1 EEST} + {1869516000 10800 1 EEST} {1887746400 7200 0 EET} - {1901055600 10800 1 EEST} + {1900965600 10800 1 EEST} {1919196000 7200 0 EET} - {1932505200 10800 1 EEST} + {1932415200 10800 1 EEST} {1950645600 7200 0 EET} - {1963954800 10800 1 EEST} + {1963864800 10800 1 EEST} {1982700000 7200 0 EET} - {1995404400 10800 1 EEST} + {1995314400 10800 1 EEST} {2014149600 7200 0 EET} - {2026854000 10800 1 EEST} + {2027368800 10800 1 EEST} {2045599200 7200 0 EET} - {2058303600 10800 1 EEST} + {2058818400 10800 1 EEST} {2077048800 7200 0 EET} - {2090358000 10800 1 EEST} + {2090268000 10800 1 EEST} {2108498400 7200 0 EET} - {2121807600 10800 1 EEST} + {2121717600 10800 1 EEST} {2140552800 7200 0 EET} - {2153257200 10800 1 EEST} + {2153167200 10800 1 EEST} {2172002400 7200 0 EET} - {2184706800 10800 1 EEST} + {2184616800 10800 1 EEST} {2203452000 7200 0 EET} - {2216156400 10800 1 EEST} + {2216671200 10800 1 EEST} {2234901600 7200 0 EET} - {2248210800 10800 1 EEST} + {2248120800 10800 1 EEST} {2266351200 7200 0 EET} - {2279660400 10800 1 EEST} + {2279570400 10800 1 EEST} {2297800800 7200 0 EET} - {2311110000 10800 1 EEST} + {2311020000 10800 1 EEST} {2329855200 7200 0 EET} - {2342559600 10800 1 EEST} + {2342469600 10800 1 EEST} {2361304800 7200 0 EET} - {2374009200 10800 1 EEST} + {2374524000 10800 1 EEST} {2392754400 7200 0 EET} - {2405458800 10800 1 EEST} + {2405973600 10800 1 EEST} {2424204000 7200 0 EET} - {2437513200 10800 1 EEST} + {2437423200 10800 1 EEST} {2455653600 7200 0 EET} - {2468962800 10800 1 EEST} + {2468872800 10800 1 EEST} {2487708000 7200 0 EET} - {2500412400 10800 1 EEST} + {2500322400 10800 1 EEST} {2519157600 7200 0 EET} - {2531862000 10800 1 EEST} + {2531772000 10800 1 EEST} {2550607200 7200 0 EET} - {2563311600 10800 1 EEST} + {2563826400 10800 1 EEST} {2582056800 7200 0 EET} - {2595366000 10800 1 EEST} + {2595276000 10800 1 EEST} {2613506400 7200 0 EET} - {2626815600 10800 1 EEST} + {2626725600 10800 1 EEST} {2644956000 7200 0 EET} - {2658265200 10800 1 EEST} + {2658175200 10800 1 EEST} {2677010400 7200 0 EET} - {2689714800 10800 1 EEST} + {2689624800 10800 1 EEST} {2708460000 7200 0 EET} - {2721164400 10800 1 EEST} + {2721679200 10800 1 EEST} {2739909600 7200 0 EET} - {2752614000 10800 1 EEST} + {2753128800 10800 1 EEST} {2771359200 7200 0 EET} - {2784668400 10800 1 EEST} + {2784578400 10800 1 EEST} {2802808800 7200 0 EET} - {2816118000 10800 1 EEST} + {2816028000 10800 1 EEST} {2834258400 7200 0 EET} - {2847567600 10800 1 EEST} + {2847477600 10800 1 EEST} {2866312800 7200 0 EET} - {2879017200 10800 1 EEST} + {2878927200 10800 1 EEST} {2897762400 7200 0 EET} - {2910466800 10800 1 EEST} + {2910981600 10800 1 EEST} {2929212000 7200 0 EET} - {2941916400 10800 1 EEST} + {2942431200 10800 1 EEST} {2960661600 7200 0 EET} - {2973970800 10800 1 EEST} + {2973880800 10800 1 EEST} {2992111200 7200 0 EET} - {3005420400 10800 1 EEST} + {3005330400 10800 1 EEST} {3024165600 7200 0 EET} - {3036870000 10800 1 EEST} + {3036780000 10800 1 EEST} {3055615200 7200 0 EET} - {3068319600 10800 1 EEST} + {3068229600 10800 1 EEST} {3087064800 7200 0 EET} - {3099769200 10800 1 EEST} + {3100284000 10800 1 EEST} {3118514400 7200 0 EET} - {3131823600 10800 1 EEST} + {3131733600 10800 1 EEST} {3149964000 7200 0 EET} - {3163273200 10800 1 EEST} + {3163183200 10800 1 EEST} {3181413600 7200 0 EET} - {3194722800 10800 1 EEST} + {3194632800 10800 1 EEST} {3213468000 7200 0 EET} - {3226172400 10800 1 EEST} + {3226082400 10800 1 EEST} {3244917600 7200 0 EET} - {3257622000 10800 1 EEST} + {3258136800 10800 1 EEST} {3276367200 7200 0 EET} - {3289071600 10800 1 EEST} + {3289586400 10800 1 EEST} {3307816800 7200 0 EET} - {3321126000 10800 1 EEST} + {3321036000 10800 1 EEST} {3339266400 7200 0 EET} - {3352575600 10800 1 EEST} + {3352485600 10800 1 EEST} {3371320800 7200 0 EET} - {3384025200 10800 1 EEST} + {3383935200 10800 1 EEST} {3402770400 7200 0 EET} - {3415474800 10800 1 EEST} + {3415384800 10800 1 EEST} {3434220000 7200 0 EET} - {3446924400 10800 1 EEST} + {3447439200 10800 1 EEST} {3465669600 7200 0 EET} - {3478978800 10800 1 EEST} + {3478888800 10800 1 EEST} {3497119200 7200 0 EET} - {3510428400 10800 1 EEST} + {3510338400 10800 1 EEST} {3528568800 7200 0 EET} - {3541878000 10800 1 EEST} + {3541788000 10800 1 EEST} {3560623200 7200 0 EET} - {3573327600 10800 1 EEST} + {3573237600 10800 1 EEST} {3592072800 7200 0 EET} - {3604777200 10800 1 EEST} + {3605292000 10800 1 EEST} {3623522400 7200 0 EET} - {3636226800 10800 1 EEST} + {3636741600 10800 1 EEST} {3654972000 7200 0 EET} - {3668281200 10800 1 EEST} + {3668191200 10800 1 EEST} {3686421600 7200 0 EET} - {3699730800 10800 1 EEST} + {3699640800 10800 1 EEST} {3717871200 7200 0 EET} - {3731180400 10800 1 EEST} + {3731090400 10800 1 EEST} {3749925600 7200 0 EET} - {3762630000 10800 1 EEST} + {3762540000 10800 1 EEST} {3781375200 7200 0 EET} - {3794079600 10800 1 EEST} + {3794594400 10800 1 EEST} {3812824800 7200 0 EET} - {3825529200 10800 1 EEST} + {3826044000 10800 1 EEST} {3844274400 7200 0 EET} - {3857583600 10800 1 EEST} + {3857493600 10800 1 EEST} {3875724000 7200 0 EET} - {3889033200 10800 1 EEST} + {3888943200 10800 1 EEST} {3907778400 7200 0 EET} - {3920482800 10800 1 EEST} + {3920392800 10800 1 EEST} {3939228000 7200 0 EET} - {3951932400 10800 1 EEST} + {3951842400 10800 1 EEST} {3970677600 7200 0 EET} - {3983382000 10800 1 EEST} + {3983896800 10800 1 EEST} {4002127200 7200 0 EET} - {4015436400 10800 1 EEST} + {4015346400 10800 1 EEST} {4033576800 7200 0 EET} - {4046886000 10800 1 EEST} + {4046796000 10800 1 EEST} {4065026400 7200 0 EET} - {4078335600 10800 1 EEST} + {4078245600 10800 1 EEST} {4097080800 7200 0 EET} } diff --git a/library/tzdata/Asia/Hebron b/library/tzdata/Asia/Hebron index 9249910..fe8f7e1 100644 --- a/library/tzdata/Asia/Hebron +++ b/library/tzdata/Asia/Hebron @@ -116,166 +116,166 @@ set TZData(:Asia/Hebron) { {1509141600 7200 0 EET} {1521846000 10800 1 EEST} {1540591200 7200 0 EET} - {1553900400 10800 1 EEST} + {1553810400 10800 1 EEST} {1572040800 7200 0 EET} - {1585350000 10800 1 EEST} + {1585260000 10800 1 EEST} {1604095200 7200 0 EET} - {1616799600 10800 1 EEST} + {1616709600 10800 1 EEST} {1635544800 7200 0 EET} - {1648249200 10800 1 EEST} + {1648159200 10800 1 EEST} {1666994400 7200 0 EET} - {1679698800 10800 1 EEST} + {1680213600 10800 1 EEST} {1698444000 7200 0 EET} - {1711753200 10800 1 EEST} + {1711663200 10800 1 EEST} {1729893600 7200 0 EET} - {1743202800 10800 1 EEST} + {1743112800 10800 1 EEST} {1761343200 7200 0 EET} - {1774652400 10800 1 EEST} + {1774562400 10800 1 EEST} {1793397600 7200 0 EET} - {1806102000 10800 1 EEST} + {1806012000 10800 1 EEST} {1824847200 7200 0 EET} - {1837551600 10800 1 EEST} + {1838066400 10800 1 EEST} {1856296800 7200 0 EET} - {1869001200 10800 1 EEST} + {1869516000 10800 1 EEST} {1887746400 7200 0 EET} - {1901055600 10800 1 EEST} + {1900965600 10800 1 EEST} {1919196000 7200 0 EET} - {1932505200 10800 1 EEST} + {1932415200 10800 1 EEST} {1950645600 7200 0 EET} - {1963954800 10800 1 EEST} + {1963864800 10800 1 EEST} {1982700000 7200 0 EET} - {1995404400 10800 1 EEST} + {1995314400 10800 1 EEST} {2014149600 7200 0 EET} - {2026854000 10800 1 EEST} + {2027368800 10800 1 EEST} {2045599200 7200 0 EET} - {2058303600 10800 1 EEST} + {2058818400 10800 1 EEST} {2077048800 7200 0 EET} - {2090358000 10800 1 EEST} + {2090268000 10800 1 EEST} {2108498400 7200 0 EET} - {2121807600 10800 1 EEST} + {2121717600 10800 1 EEST} {2140552800 7200 0 EET} - {2153257200 10800 1 EEST} + {2153167200 10800 1 EEST} {2172002400 7200 0 EET} - {2184706800 10800 1 EEST} + {2184616800 10800 1 EEST} {2203452000 7200 0 EET} - {2216156400 10800 1 EEST} + {2216671200 10800 1 EEST} {2234901600 7200 0 EET} - {2248210800 10800 1 EEST} + {2248120800 10800 1 EEST} {2266351200 7200 0 EET} - {2279660400 10800 1 EEST} + {2279570400 10800 1 EEST} {2297800800 7200 0 EET} - {2311110000 10800 1 EEST} + {2311020000 10800 1 EEST} {2329855200 7200 0 EET} - {2342559600 10800 1 EEST} + {2342469600 10800 1 EEST} {2361304800 7200 0 EET} - {2374009200 10800 1 EEST} + {2374524000 10800 1 EEST} {2392754400 7200 0 EET} - {2405458800 10800 1 EEST} + {2405973600 10800 1 EEST} {2424204000 7200 0 EET} - {2437513200 10800 1 EEST} + {2437423200 10800 1 EEST} {2455653600 7200 0 EET} - {2468962800 10800 1 EEST} + {2468872800 10800 1 EEST} {2487708000 7200 0 EET} - {2500412400 10800 1 EEST} + {2500322400 10800 1 EEST} {2519157600 7200 0 EET} - {2531862000 10800 1 EEST} + {2531772000 10800 1 EEST} {2550607200 7200 0 EET} - {2563311600 10800 1 EEST} + {2563826400 10800 1 EEST} {2582056800 7200 0 EET} - {2595366000 10800 1 EEST} + {2595276000 10800 1 EEST} {2613506400 7200 0 EET} - {2626815600 10800 1 EEST} + {2626725600 10800 1 EEST} {2644956000 7200 0 EET} - {2658265200 10800 1 EEST} + {2658175200 10800 1 EEST} {2677010400 7200 0 EET} - {2689714800 10800 1 EEST} + {2689624800 10800 1 EEST} {2708460000 7200 0 EET} - {2721164400 10800 1 EEST} + {2721679200 10800 1 EEST} {2739909600 7200 0 EET} - {2752614000 10800 1 EEST} + {2753128800 10800 1 EEST} {2771359200 7200 0 EET} - {2784668400 10800 1 EEST} + {2784578400 10800 1 EEST} {2802808800 7200 0 EET} - {2816118000 10800 1 EEST} + {2816028000 10800 1 EEST} {2834258400 7200 0 EET} - {2847567600 10800 1 EEST} + {2847477600 10800 1 EEST} {2866312800 7200 0 EET} - {2879017200 10800 1 EEST} + {2878927200 10800 1 EEST} {2897762400 7200 0 EET} - {2910466800 10800 1 EEST} + {2910981600 10800 1 EEST} {2929212000 7200 0 EET} - {2941916400 10800 1 EEST} + {2942431200 10800 1 EEST} {2960661600 7200 0 EET} - {2973970800 10800 1 EEST} + {2973880800 10800 1 EEST} {2992111200 7200 0 EET} - {3005420400 10800 1 EEST} + {3005330400 10800 1 EEST} {3024165600 7200 0 EET} - {3036870000 10800 1 EEST} + {3036780000 10800 1 EEST} {3055615200 7200 0 EET} - {3068319600 10800 1 EEST} + {3068229600 10800 1 EEST} {3087064800 7200 0 EET} - {3099769200 10800 1 EEST} + {3100284000 10800 1 EEST} {3118514400 7200 0 EET} - {3131823600 10800 1 EEST} + {3131733600 10800 1 EEST} {3149964000 7200 0 EET} - {3163273200 10800 1 EEST} + {3163183200 10800 1 EEST} {3181413600 7200 0 EET} - {3194722800 10800 1 EEST} + {3194632800 10800 1 EEST} {3213468000 7200 0 EET} - {3226172400 10800 1 EEST} + {3226082400 10800 1 EEST} {3244917600 7200 0 EET} - {3257622000 10800 1 EEST} + {3258136800 10800 1 EEST} {3276367200 7200 0 EET} - {3289071600 10800 1 EEST} + {3289586400 10800 1 EEST} {3307816800 7200 0 EET} - {3321126000 10800 1 EEST} + {3321036000 10800 1 EEST} {3339266400 7200 0 EET} - {3352575600 10800 1 EEST} + {3352485600 10800 1 EEST} {3371320800 7200 0 EET} - {3384025200 10800 1 EEST} + {3383935200 10800 1 EEST} {3402770400 7200 0 EET} - {3415474800 10800 1 EEST} + {3415384800 10800 1 EEST} {3434220000 7200 0 EET} - {3446924400 10800 1 EEST} + {3447439200 10800 1 EEST} {3465669600 7200 0 EET} - {3478978800 10800 1 EEST} + {3478888800 10800 1 EEST} {3497119200 7200 0 EET} - {3510428400 10800 1 EEST} + {3510338400 10800 1 EEST} {3528568800 7200 0 EET} - {3541878000 10800 1 EEST} + {3541788000 10800 1 EEST} {3560623200 7200 0 EET} - {3573327600 10800 1 EEST} + {3573237600 10800 1 EEST} {3592072800 7200 0 EET} - {3604777200 10800 1 EEST} + {3605292000 10800 1 EEST} {3623522400 7200 0 EET} - {3636226800 10800 1 EEST} + {3636741600 10800 1 EEST} {3654972000 7200 0 EET} - {3668281200 10800 1 EEST} + {3668191200 10800 1 EEST} {3686421600 7200 0 EET} - {3699730800 10800 1 EEST} + {3699640800 10800 1 EEST} {3717871200 7200 0 EET} - {3731180400 10800 1 EEST} + {3731090400 10800 1 EEST} {3749925600 7200 0 EET} - {3762630000 10800 1 EEST} + {3762540000 10800 1 EEST} {3781375200 7200 0 EET} - {3794079600 10800 1 EEST} + {3794594400 10800 1 EEST} {3812824800 7200 0 EET} - {3825529200 10800 1 EEST} + {3826044000 10800 1 EEST} {3844274400 7200 0 EET} - {3857583600 10800 1 EEST} + {3857493600 10800 1 EEST} {3875724000 7200 0 EET} - {3889033200 10800 1 EEST} + {3888943200 10800 1 EEST} {3907778400 7200 0 EET} - {3920482800 10800 1 EEST} + {3920392800 10800 1 EEST} {3939228000 7200 0 EET} - {3951932400 10800 1 EEST} + {3951842400 10800 1 EEST} {3970677600 7200 0 EET} - {3983382000 10800 1 EEST} + {3983896800 10800 1 EEST} {4002127200 7200 0 EET} - {4015436400 10800 1 EEST} + {4015346400 10800 1 EEST} {4033576800 7200 0 EET} - {4046886000 10800 1 EEST} + {4046796000 10800 1 EEST} {4065026400 7200 0 EET} - {4078335600 10800 1 EEST} + {4078245600 10800 1 EEST} {4097080800 7200 0 EET} } diff --git a/library/tzdata/Asia/Hong_Kong b/library/tzdata/Asia/Hong_Kong index eb79a90..9420142 100644 --- a/library/tzdata/Asia/Hong_Kong +++ b/library/tzdata/Asia/Hong_Kong @@ -3,24 +3,24 @@ set TZData(:Asia/Hong_Kong) { {-9223372036854775808 27402 0 LMT} {-2056690800 28800 0 HKT} - {-900909000 32400 1 HKST} + {-900910800 32400 1 HKST} {-891579600 30600 0 HKT} {-884248200 32400 0 JST} - {-766659600 28800 0 HKT} - {-747981000 32400 1 HKST} - {-728544600 28800 0 HKT} + {-761209200 28800 0 HKT} + {-747907200 32400 1 HKST} + {-728541000 28800 0 HKT} {-717049800 32400 1 HKST} - {-694503000 28800 0 HKT} + {-697091400 28800 0 HKT} {-683785800 32400 1 HKST} - {-668064600 28800 0 HKT} + {-668061000 28800 0 HKT} {-654755400 32400 1 HKST} - {-636615000 28800 0 HKT} + {-636611400 28800 0 HKT} {-623305800 32400 1 HKST} - {-605165400 28800 0 HKT} + {-605161800 28800 0 HKT} {-591856200 32400 1 HKST} - {-573715800 28800 0 HKT} + {-573712200 28800 0 HKT} {-559801800 32400 1 HKST} - {-541661400 28800 0 HKT} + {-541657800 28800 0 HKT} {-528352200 32400 1 HKST} {-510211800 28800 0 HKT} {-498112200 32400 1 HKST} diff --git a/library/tzdata/Europe/Rome b/library/tzdata/Europe/Rome index f53340c..932754f 100644 --- a/library/tzdata/Europe/Rome +++ b/library/tzdata/Europe/Rome @@ -2,7 +2,7 @@ set TZData(:Europe/Rome) { {-9223372036854775808 2996 0 LMT} - {-3259097396 2996 0 RMT} + {-3252098996 2996 0 RMT} {-2403565200 3600 0 CET} {-1690765200 7200 1 CEST} {-1680487200 3600 0 CET} diff --git a/tests-perf/clock.perf.tcl b/tests-perf/clock.perf.tcl index f80746f..c0da0ab 100644 --- a/tests-perf/clock.perf.tcl +++ b/tests-perf/clock.perf.tcl @@ -122,7 +122,7 @@ proc test-format {{reptime 1000}} { } proc test-scan {{reptime 1000}} { - _test_run $reptime { + _test_run -convert-result {clock format $_(r) -locale en} $reptime { # Scan : date (in gmt) {clock scan "25.11.2015" -format "%d.%m.%Y" -base 0 -gmt 1} # Scan : date (system time zone, with base) @@ -198,11 +198,11 @@ proc test-scan {{reptime 1000}} { # {clock scan "25.11.2015" -format [string repeat "[incr i] %d.%m.%Y %d.%m.%Y" 10] -base 0 -gmt 1} # # Scan : again: # {clock scan "25.11.2015" -format [string repeat "[incr i -1] %d.%m.%Y %d.%m.%Y" 10] -base 0 -gmt 1} - } {puts [clock format $_(r) -locale en]} + } } proc test-freescan {{reptime 1000}} { - _test_run $reptime { + _test_run -convert-result {clock format $_(r) -locale en} $reptime { # FreeScan : relative date {clock scan "5 years 18 months 385 days" -base 0 -gmt 1} # FreeScan : relative date with relative weekday @@ -239,7 +239,7 @@ proc test-freescan {{reptime 1000}} { {clock scan "19:18:30 MST" -base 148863600 -gmt 1 clock scan "19:18:30 EST" -base 148863600 } - } {puts [clock format $_(r) -locale en]} + } } proc test-add {{reptime 1000}} { @@ -282,7 +282,7 @@ proc test-add {{reptime 1000}} { if {[catch {clock add 0 3 weekdays -gmt 1}]} { regsub -all {\mweekdays\M} $tests "days" tests } - _test_run $reptime $tests {puts [clock format $_(r) -locale en]} + _test_run -convert-result {clock format $_(r) -locale en} $reptime $tests } proc test-convert {{reptime 1000}} { diff --git a/tests-perf/test-performance.tcl b/tests-perf/test-performance.tcl index 78189e6..a715c8a 100644 --- a/tests-perf/test-performance.tcl +++ b/tests-perf/test-performance.tcl @@ -127,15 +127,23 @@ proc _adjust_maxcount {reptime maxcount} { proc _test_run {args} { upvar _ _ # parse args: - array set _ [set _opts {-no-result 0 -uplevel 0}] + array set _ {-no-result 0 -uplevel 0 -convert-result {}} while {[llength $args] > 2} { - if {[set o [lindex $args 0]] ni $_opts || $_($o)} { + if {![info exists _([set o [lindex $args 0]])]} { break } - set _($o) 1 - set args [lrange $args 1 end] + if {[string is boolean -strict $_($o)]} { + set _($o) [expr {! $_($o)}] + set args [lrange $args 1 end] + } else { + if {[llength $args] <= 2} { + return -code error "value expected for option $o" + } + set _($o) [lindex $args 1] + set args [lrange $args 2 end] + } } - unset -nocomplain _opts o + unset -nocomplain o if {[llength $args] < 2 || [llength $args] > 3} { return -code error "wrong # args: should be \"[lindex [info level [info level]] 0] ?-no-result? reptime lst ?outcmd?\"" } @@ -173,7 +181,8 @@ proc _test_run {args} { # if output result (and not once): if {!$_(-no-result)} { set _(r) [if 1 $_(c)] - if {$_(outcmd) ne {}} {{*}$_(outcmd) $_(r)} + if {$_(-convert-result) ne ""} { set _(r) [if 1 $_(-convert-result)] } + {*}$_(outcmd) $_(r) if {[llength $_(ittime)] > 1} { # decrement max-count lset _(ittime) 1 [expr {[lindex $_(ittime) 1] - 1}] } diff --git a/tests/cmdAH.test b/tests/cmdAH.test index f8ab361..b15c77d 100644 --- a/tests/cmdAH.test +++ b/tests/cmdAH.test @@ -21,11 +21,16 @@ 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 [expr { + $::tcl_platform(pointerSize) >= 8 || + [llength [info command testsize]] && [testsize time_t] >= 8 +}] testConstraint linkDirectory [expr { ![testConstraint win] || ($::tcl_platform(osVersion) >= 5.0 && [lindex [file system [temporaryDirectory]] 1] eq "NTFS") }] +testConstraint knownMsvcBug [expr {![info exists ::env(TRAVIS_OS_NAME)] || ![string match windows $::env(TRAVIS_OS_NAME)]}] global env set cmdAHwd [pwd] @@ -1290,6 +1295,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 @@ -1308,7 +1329,7 @@ test cmdAH-25.2.1 {Tcl_FileObjCmd: owned} -constraints unix -setup { test cmdAH-25.3 {Tcl_FileObjCmd: owned} {unix notRoot} { file owned / } 0 -test cmdAH-25.3.1 {Tcl_FileObjCmd: owned} -constraints win -body { +test cmdAH-25.3.1 {Tcl_FileObjCmd: owned} -constraints {win knownMsvcBug} -body { file owned $env(windir) } -result 0 test cmdAH-25.4 {Tcl_FileObjCmd: owned} -body { diff --git a/tests/cmdMZ.test b/tests/cmdMZ.test index 60b104f..e4db915 100644 --- a/tests/cmdMZ.test +++ b/tests/cmdMZ.test @@ -349,6 +349,24 @@ test cmdMZ-5.7 {Tcl_TimeObjCmd: errors generate right trace} { "error foo" invoked from within "time {error foo}"}} +test cmdMZ-5.7.1 {Tcl_TimeObjCmd: return from time} { + set x 0 + proc r1 {} {upvar x x; time {incr x; return "r1"; incr x} 10} + list [r1] $x +} {r1 1} +test cmdMZ-5.8 {Tcl_TimeObjCmd: done optimization: nested call of self inside time (if compiled)} { + set x [set y 0] + set m1 { + if {[incr x] <= 5} { + # nested call should return result, so covering that: + if {![string is integer -strict [eval $m1]]} {error unexpected} + } + # increase again (no "continue" from nested call): + incr x + } + time {incr y; eval $m1} 5 + list $y $x +} {5 20} test cmdMZ-6.1 {Tcl_TimeRateObjCmd: basic format of command} { list [catch {timerate} msg] $msg @@ -395,6 +413,11 @@ test cmdMZ-6.7 {Tcl_TimeRateObjCmd: errors generate right trace} { "error foo" invoked from within "timerate {error foo} 1"}} +test cmdMZ-6.7.1 {Tcl_TimeRateObjCmd: return from timerate} { + set x 0 + proc r1 {} {upvar x x; timerate {incr x; return "r1"; incr x} 1000 10} + list [r1] $x +} {r1 1} test cmdMZ-6.8 {Tcl_TimeRateObjCmd: allow (conditional) break from timerate} { set m1 [timerate {break}] list \ @@ -406,10 +429,10 @@ test cmdMZ-6.8 {Tcl_TimeRateObjCmd: allow (conditional) break from timerate} { test cmdMZ-6.8.1 {Tcl_TimeRateObjCmd: allow (conditional) continue in timerate} { set m1 [timerate {continue; return -code error "unexpected"} 1000 10] list \ - [expr {[lindex $m1 0] < 1000}] \ - [expr {[lindex $m1 2] == 10}] \ - [expr {[lindex $m1 4] > 1000}] \ - [expr {[lindex $m1 6] < 100}] + [expr {[lindex $m1 0] < 1000}] \ + [expr {[lindex $m1 2] == 10}] \ + [expr {[lindex $m1 4] > 1000}] \ + [expr {[lindex $m1 6] < 100}] } {1 1 1 1} test cmdMZ-6.9 {Tcl_TimeRateObjCmd: max count of iterations} { set m1 [timerate {} 1000 5]; # max-count wins @@ -430,6 +453,18 @@ test cmdMZ-6.11 {Tcl_TimeRateObjCmd: done/continue optimization rollback} { timerate $m1 1000 10 if 1 $m1; # if rollback is missing throws an error: invoked "continue" outside of a loop } ok +test cmdMZ-6.12 {Tcl_TimeRateObjCmd: done optimization: nested call of self inside timerate} { + set x 0 + set m1 { + if {[incr x] <= 5} { + # nested call should return result, so covering that: + if {![string is integer -strict [eval $m1]]} {error unexpected} + } + # increase again (no "continue" from nested call): + incr x + } + list [lindex [timerate $m1 1000 5] 2] $x +} {5 20} test cmdMZ-try-1.0 { diff --git a/tests/expr.test b/tests/expr.test index 59d96a1..bc01c03 100644 --- a/tests/expr.test +++ b/tests/expr.test @@ -729,7 +729,7 @@ test expr-18.1 {expr and conversion of operands to numbers} { catch {expr int($x)} expr {$x} } 11 -test expr-18.2 {whitespace strings should not be == 0 (buggy strtod)} { +test expr-18.2 {whitespace strings should not be == 0 (buggy strtol/strtoul)} { expr {" "} } { } diff --git a/tests/fileSystem.test b/tests/fileSystem.test index 2494cb4..361542d 100644 --- a/tests/fileSystem.test +++ b/tests/fileSystem.test @@ -34,6 +34,7 @@ catch { testConstraint testfilesystem [llength [info commands ::testfilesystem]] testConstraint testsetplatform [llength [info commands ::testsetplatform]] testConstraint testsimplefilesystem [llength [info commands ::testsimplefilesystem]] +testConstraint knownMsvcBug [expr {![info exists ::env(TRAVIS_OS_NAME)] || ![string match windows $::env(TRAVIS_OS_NAME)]}] cd [tcltest::temporaryDirectory] makeFile "test file" gorp.file @@ -312,7 +313,7 @@ test filesystem-1.37 {file normalisation with '/./'} -body { } -match regexp -result {^(?:[^/]|/(?:[^/]|$))+$} test filesystem-1.38 {file normalisation with volume relative} -setup { set dir [pwd] -} -constraints {win moreThanOneDrive} -body { +} -constraints {win moreThanOneDrive knownMsvcBug} -body { set path "[string range [lindex $drives 0] 0 1]foo" cd [lindex $drives 1] file norm $path diff --git a/tests/format.test b/tests/format.test index 1bf46a1..3640376 100644 --- a/tests/format.test +++ b/tests/format.test @@ -20,6 +20,7 @@ testConstraint longIs32bit [expr {$tcl_platform(wordSize) == 4}] testConstraint longIs64bit [expr {$tcl_platform(wordSize) == 8}] testConstraint wideIs64bit [expr {wide(0x8000000000000000) < 0}] testConstraint pointerIs64bit [expr {$tcl_platform(pointerSize) >= 8}] +testConstraint knownMsvcBug [expr {![info exists ::env(TRAVIS_OS_NAME)] || ![string match windows $::env(TRAVIS_OS_NAME)]}] test format-1.1 {integer formatting} { format "%*d %d %d %d" 6 34 16923 -12 -1 @@ -263,13 +264,13 @@ test format-6.1 {floating-point zeroes} {eformat} { test format-6.2 {floating-point zeroes} {eformat} { format "%.4e %.4f %.4g" 0.0 0.0 0.0 0.0 } {0.0000e+00 0.0000 0} -test format-6.3 {floating-point zeroes} {eformat} { +test format-6.3 {floating-point zeroes} {eformat knownMsvcBug} { format "%#.4e %#.4f %#.4g" 0.0 0.0 0.0 0.0 } {0.0000e+00 0.0000 0.000} test format-6.4 {floating-point zeroes} {eformat} { format "%.0e %.0f %.0g" 0.0 0.0 0.0 0.0 } {0e+00 0 0} -test format-6.5 {floating-point zeroes} {eformat} { +test format-6.5 {floating-point zeroes} {eformat knownMsvcBug} { format "%#.0e %#.0f %#.0g" 0.0 0.0 0.0 0.0 } {0.e+00 0. 0.} test format-6.6 {floating-point zeroes} { diff --git a/tests/ioCmd.test b/tests/ioCmd.test index 87ad4af..89afb0a 100644 --- a/tests/ioCmd.test +++ b/tests/ioCmd.test @@ -25,6 +25,7 @@ package require tcltests # Custom constraints used in this file testConstraint testchannel [llength [info commands testchannel]] +testConstraint knownMsvcBug [expr {![info exists ::env(TRAVIS_OS_NAME)] || ![string match windows $::env(TRAVIS_OS_NAME)]}] #---------------------------------------------------------------------- @@ -810,7 +811,7 @@ test iocmd-21.19 {chan create, init failure -> no channel, no finalize} -match g rename foo {} set res } -result {{} {initialize rc* {read write}} 1 {*all required methods*} {}} -test iocmd-21.20 {Bug 88aef05cda} -setup { +test iocmd-21.20 {Bug 88aef05cda} -constraints knownMsvcBug -setup { proc foo {method chan args} { switch -- $method blocking { chan configure $chan -blocking [lindex $args 0] @@ -2015,7 +2016,7 @@ test iocmd-31.6 {chan postevent, posted events do happen} -match glob -body { set c [chan create {r w} foo] set tock {} note [fileevent $c readable {lappend res TOCK; set tock 1}] - set stop [after 10000 {lappend res TIMEOUT; set tock 1}] + set stop [after 15000 {lappend res TIMEOUT; set tock 1}] after 1000 {note [chan postevent $c r]} vwait ::tock catch {after cancel $stop} @@ -2028,7 +2029,7 @@ test iocmd-31.7 {chan postevent, posted events do happen} -match glob -body { proc foo {args} {oninit; onfinal; track; return} set c [chan create {r w} foo] note [fileevent $c writable {lappend res TOCK; set tock 1}] - set stop [after 10000 {lappend res TIMEOUT; set tock 1}] + set stop [after 15000 {lappend res TIMEOUT; set tock 1}] after 1000 {note [chan postevent $c w]} vwait ::tock catch {after cancel $stop} diff --git a/tests/socket.test b/tests/socket.test index b91668e..84320bd 100644 --- a/tests/socket.test +++ b/tests/socket.test @@ -75,6 +75,7 @@ if {[expr {[info exists ::env(TRAVIS_OSX_IMAGE)] && [string match xcode* $::env( # Some tests require the Thread package or exec command testConstraint thread [expr {0 == [catch {package require Thread 2.7-}]}] testConstraint exec [llength [info commands exec]] +testConstraint knownMsvcBug [expr {![info exists ::env(TRAVIS_OS_NAME)] || ![string match windows $::env(TRAVIS_OS_NAME)]}] # Produce a random port number in the Dynamic/Private range # from 49152 through 65535. @@ -2285,7 +2286,7 @@ test socket-14.10.1 {pending [socket -async] and nonblocking [puts], server is I removeFile script } -result {{} ok} test socket-14.11.0 {pending [socket -async] and nonblocking [puts], no listener, no flush} \ - -constraints {socket} \ + -constraints {socket knownMsvcBug} \ -body { set sock [socket -async localhost [randport]] fconfigure $sock -blocking 0 diff --git a/tests/winFCmd.test b/tests/winFCmd.test index 8a5173a..2bce77c 100644 --- a/tests/winFCmd.test +++ b/tests/winFCmd.test @@ -28,6 +28,7 @@ testConstraint testchmod [llength [info commands testchmod]] testConstraint cdrom 0 testConstraint exdev 0 testConstraint longFileNames 0 +testConstraint knownMsvcBug [expr {![info exists ::env(TRAVIS_OS_NAME)] || ![string match windows $::env(TRAVIS_OS_NAME)]}] proc createfile {file {string a}} { set f [open $file w] @@ -393,7 +394,7 @@ proc MakeFiles {dirname} { test winFCmd-1.38 {TclpRenameFile: check rename of conflicting inodes} -setup { cleanup -} -constraints {win winNonZeroInodes} -body { +} -constraints {win winNonZeroInodes knownMsvcBug} -body { file mkdir td1 foreach {a b} [MakeFiles td1] break file rename -force $a $b @@ -638,7 +639,7 @@ test winFCmd-5.1 {TclpCopyDirectory: calls TraverseWinTree} -setup { test winFCmd-6.1 {TclpRemoveDirectory: errno: EACCES} -setup { cleanup -} -constraints {winVista testfile testchmod} -body { +} -constraints {winVista testfile testchmod knownMsvcBug} -body { file mkdir td1 testchmod 0 td1 testfile rmdir td1 @@ -692,7 +693,7 @@ test winFCmd-6.8 {TclpRemoveDirectory: RemoveDirectory fails} -setup { } -result {1 {tf1 ENOTDIR}} test winFCmd-6.9 {TclpRemoveDirectory: errno == EACCES} -setup { cleanup -} -constraints {winVista testfile testchmod} -body { +} -constraints {winVista testfile testchmod knownMsvcBug} -body { file mkdir td1 testchmod 0 td1 testfile rmdir td1 @@ -710,7 +711,7 @@ test winFCmd-6.11 {TclpRemoveDirectory: attr == -1} -setup { } -returnCodes error -match regexp -result {^/ E(ACCES|EXIST)$} test winFCmd-6.13 {TclpRemoveDirectory: write-protected} -setup { cleanup -} -constraints {winVista testfile testchmod} -body { +} -constraints {winVista testfile testchmod knownMsvcBug} -body { file mkdir td1 testchmod 0 td1 testfile rmdir td1 @@ -939,7 +940,7 @@ test winFCmd-9.1 {TraversalDelete: DOTREE_F} -setup { } -result {} test winFCmd-9.3 {TraversalDelete: DOTREE_PRED} -setup { cleanup -} -constraints {winVista testfile testchmod} -body { +} -constraints {winVista testfile testchmod knownMsvcBug} -body { file mkdir td1/td2 testchmod 0 td1 testfile rmdir -force td1 diff --git a/unix/configure b/unix/configure index 2de5b54..bf00034 100755 --- a/unix/configure +++ b/unix/configure @@ -3333,8 +3333,8 @@ esac #-------------------------------------------------------------------- # Supply substitutes for missing POSIX header files. Special notes: -# - stdlib.h doesn't define strtol, strtoul, or -# strtod insome versions of SunOS +# - stdlib.h doesn't define strtol or strtoul in some versions +# of SunOS # - some versions of string.h don't declare procedures such # as strstr # Do this early, otherwise an autoconf bug throws errors on configure @@ -3825,19 +3825,6 @@ else fi rm -f conftest* - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include <stdlib.h> - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "strtod" >/dev/null 2>&1; then : - -else - tcl_ok=0 -fi -rm -f conftest* - if test $tcl_ok = 0; then $as_echo "#define NO_STDLIB_H 1" >>confdefs.h @@ -5660,7 +5647,7 @@ fi fi # The combo of gcc + glibc has a bug related to inlining of - # functions like strtod(). The -fno-builtin flag should address + # functions like strtol()/strtoul(). The -fno-builtin flag should address # this problem but it does not work. The -fno-inline flag is kind # of overkill but it works. Disable inlining only when one of the # files in compat/*.c is being linked in. diff --git a/unix/configure.ac b/unix/configure.ac index 74dbe08..ea4526c 100644 --- a/unix/configure.ac +++ b/unix/configure.ac @@ -89,8 +89,8 @@ AC_C_INLINE #-------------------------------------------------------------------- # Supply substitutes for missing POSIX header files. Special notes: -# - stdlib.h doesn't define strtol, strtoul, or -# strtod insome versions of SunOS +# - stdlib.h doesn't define strtol or strtoul in some versions +# of SunOS # - some versions of string.h don't declare procedures such # as strstr # Do this early, otherwise an autoconf bug throws errors on configure diff --git a/unix/tcl.m4 b/unix/tcl.m4 index a206f26..70303ce 100644 --- a/unix/tcl.m4 +++ b/unix/tcl.m4 @@ -1311,7 +1311,7 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [ ]) # The combo of gcc + glibc has a bug related to inlining of - # functions like strtod(). The -fno-builtin flag should address + # functions like strtol()/strtoul(). The -fno-builtin flag should address # this problem but it does not work. The -fno-inline flag is kind # of overkill but it works. Disable inlining only when one of the # files in compat/*.c is being linked in. @@ -1913,8 +1913,8 @@ dnl # preprocessing tests use only CPPFLAGS. # # Supply substitutes for missing POSIX header files. Special # notes: -# - stdlib.h doesn't define strtol, strtoul, or -# strtod insome versions of SunOS +# - stdlib.h doesn't define strtol or strtoul in some +# versions of SunOS # - some versions of string.h don't declare procedures such # as strstr # @@ -1965,7 +1965,6 @@ closedir(d); AC_CHECK_HEADER(stdlib.h, tcl_ok=1, tcl_ok=0) AC_EGREP_HEADER(strtol, stdlib.h, , tcl_ok=0) AC_EGREP_HEADER(strtoul, stdlib.h, , tcl_ok=0) - AC_EGREP_HEADER(strtod, stdlib.h, , tcl_ok=0) if test $tcl_ok = 0; then AC_DEFINE(NO_STDLIB_H, 1, [Do we have <stdlib.h>?]) fi diff --git a/unix/tclLoadAix.c b/unix/tclLoadAix.c index e5d9729..fea9494 100644 --- a/unix/tclLoadAix.c +++ b/unix/tclLoadAix.c @@ -98,7 +98,7 @@ dlopen( const char *path, int mode) { - register ModulePtr mp; + ModulePtr mp; static void *mainModule; /* @@ -191,7 +191,7 @@ dlopen( */ if (mode & RTLD_GLOBAL) { - register ModulePtr mp1; + ModulePtr mp1; for (mp1 = mp->next; mp1; mp1 = mp1->next) { if (loadbind(0, mp1->entry, mp->entry) == -1) { @@ -243,7 +243,7 @@ static void caterr( char *s) { - register char *p = s; + char *p = s; while (*p >= '0' && *p <= '9') { p++; @@ -282,9 +282,9 @@ dlsym( void *handle, const char *symbol) { - register ModulePtr mp = (ModulePtr)handle; - register ExportPtr ep; - register int i; + ModulePtr mp = (ModulePtr)handle; + ExportPtr ep; + int i; /* * Could speed up the search, but I assume that one assigns the result to @@ -317,9 +317,9 @@ int dlclose( void *handle) { - register ModulePtr mp = (ModulePtr)handle; + ModulePtr mp = (ModulePtr)handle; int result; - register ModulePtr mp1; + ModulePtr mp1; if (--mp->refCnt > 0) { return 0; @@ -343,8 +343,8 @@ dlclose( } if (mp->exports) { - register ExportPtr ep; - register int i; + ExportPtr ep; + int i; for (ep = mp->exports, i = mp->nExports; i; i--, ep++) { if (ep->name) { free(ep->name); diff --git a/unix/tclUnixCompat.c b/unix/tclUnixCompat.c index aa25c6b..e0a826c 100644 --- a/unix/tclUnixCompat.c +++ b/unix/tclUnixCompat.c @@ -685,8 +685,8 @@ CopyGrp( char *buf, int buflen) { - register char *p = buf; - register int copied, len = 0; + char *p = buf; + int copied, len = 0; /* * Copy username. @@ -887,7 +887,7 @@ CopyArray( int buflen) /* Size of buffer. */ { int i, j, len = 0; - char *p, **new; + char *p, **newBuffer; if (src == NULL) { return 0; @@ -903,7 +903,7 @@ CopyArray( return -1; } - new = (char **) buf; + newBuffer = (char **) buf; p = buf + len; for (j = 0; j < i; j++) { @@ -914,10 +914,10 @@ CopyArray( return -1; } memcpy(p, src[j], sz); - new[j] = p; + newBuffer[j] = p; p = buf + len; } - new[j] = NULL; + newBuffer[j] = NULL; return len; } diff --git a/unix/tclUnixFCmd.c b/unix/tclUnixFCmd.c index 3e1a5c2..b214627 100644 --- a/unix/tclUnixFCmd.c +++ b/unix/tclUnixFCmd.c @@ -1315,8 +1315,8 @@ CopyFileAtts( } } - tval.actime = statBufPtr->st_atime; - tval.modtime = statBufPtr->st_mtime; + tval.actime = Tcl_GetAccessTimeFromStat(statBufPtr); + tval.modtime = Tcl_GetModificationTimeFromStat(statBufPtr); if (utime(dst, &tval)) { /* INTL: Native. */ return TCL_ERROR; diff --git a/unix/tclUnixInit.c b/unix/tclUnixInit.c index b6b66da..004fbff 100644 --- a/unix/tclUnixInit.c +++ b/unix/tclUnixInit.c @@ -411,7 +411,7 @@ TclpInitPlatform(void) /* * In case the initial locale is not "C", ensure that the numeric * processing is done in "C" locale regardless. This is needed because Tcl - * relies on routines like strtod, but should not have locale dependent + * relies on routines like strtol/strtoul, but should not have locale dependent * behavior. */ @@ -1001,7 +1001,7 @@ TclpFindVariable( * searches). */ { int i, result = -1; - register const char *env, *p1, *p2; + const char *env, *p1, *p2; Tcl_DString envString; Tcl_DStringInit(&envString); diff --git a/unix/tclUnixThrd.c b/unix/tclUnixThrd.c index 60340b0..35eca8d 100644 --- a/unix/tclUnixThrd.c +++ b/unix/tclUnixThrd.c @@ -844,7 +844,7 @@ Tcl_Mutex * TclpNewAllocMutex(void) { AllocMutex *lockPtr; - register PMutex *plockPtr; + PMutex *plockPtr; lockPtr = malloc(sizeof(AllocMutex)); if (lockPtr == NULL) { @@ -28,14 +28,14 @@ _tmain(void) const char *err; while (1) { - n = read(0, buf, sizeof(buf)); + n = _read(0, buf, sizeof(buf)); if (n <= 0) { break; } - write(1, buf, n); + _write(1, buf, n); } err = (sizeof(int) == 2) ? "stderr16" : "stderr32"; - write(2, err, strlen(err)); + _write(2, err, (unsigned int)strlen(err)); return 0; } diff --git a/win/configure b/win/configure index 982f96a..b0e1d5a 100755 --- a/win/configure +++ b/win/configure @@ -778,6 +778,7 @@ ac_user_opts=' enable_option_checking with_encoding enable_shared +enable_time64bit enable_64bit enable_zipfs enable_symbols @@ -1400,6 +1401,7 @@ Optional Features: --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-shared build and link with shared libraries (default: on) + --enable-time64bit force 64-bit time_t for 32-bit build (default: off) --enable-64bit enable 64bit support (where applicable) --enable-zipfs build with Zipfs support (default: on) --enable-symbols build with debugging symbols (default: off) @@ -3749,6 +3751,25 @@ $as_echo "#define STATIC_BUILD 1" >>confdefs.h #-------------------------------------------------------------------- +# Check whether --enable-time64bit was given. +#-------------------------------------------------------------------- + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking force of 64-bit time_t" >&5 +$as_echo_n "checking force of 64-bit time_t... " >&6; } +# Check whether --enable-time64bit was given. +if test "${enable_time64bit+set}" = set; then : + enableval=$enable_time64bit; tcl_ok=$enableval +else + tcl_ok=no +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: \"$tcl_ok\"" >&5 +$as_echo "\"$tcl_ok\"" >&6; } +if test "$tcl_ok" = "yes"; then + CFLAGS="${CFLAGS} -D_USE_64BIT_TIME_T" +fi + +#-------------------------------------------------------------------- # The statements below define a collection of compile flags. This # macro depends on the value of SHARED_BUILD, and should be called # after SC_ENABLE_SHARED checks the configure switches. diff --git a/win/configure.ac b/win/configure.ac index 7b63c61..82d713a 100644 --- a/win/configure.ac +++ b/win/configure.ac @@ -92,6 +92,20 @@ SC_TCL_CFG_ENCODING SC_ENABLE_SHARED #-------------------------------------------------------------------- +# Check whether --enable-time64bit was given. +#-------------------------------------------------------------------- + +AC_MSG_CHECKING([force of 64-bit time_t]) +AC_ARG_ENABLE(time64bit, + AC_HELP_STRING([--enable-time64bit], + [force 64-bit time_t for 32-bit build (default: off)]), + [tcl_ok=$enableval], [tcl_ok=no]) +AC_MSG_RESULT("$tcl_ok") +if test "$tcl_ok" = "yes"; then + CFLAGS="${CFLAGS} -D_USE_64BIT_TIME_T" +fi + +#-------------------------------------------------------------------- # The statements below define a collection of compile flags. This # macro depends on the value of SHARED_BUILD, and should be called # after SC_ENABLE_SHARED checks the configure switches. diff --git a/win/makefile.vc b/win/makefile.vc index 44af015..c2343a0 100644 --- a/win/makefile.vc +++ b/win/makefile.vc @@ -51,6 +51,71 @@ # vcvars32.bat according to the instructions for it. This can also
# turn on the 64-bit compiler, if your SDK has it.
#
+# Basic macros and options usable on the commandline (see rules.vc for more info):
+# OPTS=msvcrt,static,staticpkg,symbols,profile,unchecked,time64bit,utfmax,none
+# Sets special options for the core. The default is for none.
+# Any combination of the above may be used (comma separated).
+# 'none' will over-ride everything to nothing.
+#
+# msvcrt = Affects the static option only to switch it from
+# using libcmt(d) as the C runtime [by default] to
+# msvcrt(d). This is useful for static embedding
+# support.
+# static = Builds a static library of the core instead of a
+# dll. The shell will be static (and large), as well.
+# staticpkg= Affects the static option only to switch
+# tclshXX.exe to have the dde and reg extension linked
+# inside it.
+# thrdalloc = Use the thread allocator (shared global free pool).
+# symbols = Adds symbols for step debugging.
+# profile = Adds profiling hooks. Map file is assumed.
+# unchecked = Allows a symbols build to not use the debug
+# enabled runtime (msvcrt.dll not msvcrtd.dll
+# or libcmt.lib not libcmtd.lib).
+# time64bit = Forces a build using 64-bit time_t for 32-bit build
+# (CRT library should support this).
+# utfmax = Forces Tcl_UniChar to be a 32-bit quantity in stead
+# of 16-bits
+#
+# STATS=compdbg,memdbg,none
+# Sets optional memory and bytecode compiler debugging code added
+# to the core. The default is for none. Any combination of the
+# above may be used (comma separated). 'none' will over-ride
+# everything to nothing.
+#
+# compdbg = Enables byte compilation logging.
+# memdbg = Enables the debugging memory allocator.
+#
+# CHECKS=64bit,fullwarn,nodep,none
+# Sets special macros for checking compatibility.
+#
+# 64bit = Enable 64bit portability warnings (if available)
+# fullwarn = Builds with full compiler and link warnings enabled.
+# Very verbose.
+# nodep = Turns off compatibility macros to ensure the core
+# isn't being built with deprecated functions.
+#
+# MACHINE=(ALPHA|AMD64|IA64|IX86)
+# Set the machine type used for the compiler, linker, and
+# resource compiler. This hook is needed to tell the tools
+# when alternate platforms are requested. IX86 is the default
+# when not specified. If the CPU environment variable has been
+# set (ie: recent Platform SDK) then MACHINE is set from CPU.
+#
+# TMP_DIR=<path>
+# OUT_DIR=<path>
+# Hooks to allow the intermediate and output directories to be
+# changed. $(OUT_DIR) is assumed to be
+# $(BINROOT)\(Release|Debug) based on if symbols are requested.
+# $(TMP_DIR) will de $(OUT_DIR)\<buildtype> by default.
+#
+# TESTPAT=<file>
+# Reads the tests requested to be run from this file.
+#
+# CFG_ENCODING=encoding
+# name of encoding for configuration information. Defaults
+# to cp1252
+#
# Examples:
# c:\tcl_src\win\>nmake -f makefile.vc release
# c:\tcl_src\win\>nmake -f makefile.vc test
diff --git a/win/rules.vc b/win/rules.vc index 1cd0b68..34ac230 100644 --- a/win/rules.vc +++ b/win/rules.vc @@ -686,6 +686,9 @@ LINKERFLAGS = $(LINKERFLAGS) -ltcg # USE_STUBS - 1 -> compile to use stubs interfaces, 0 -> direct linking
# CONFIG_CHECK - 1 -> check current build configuration against Tcl
# configuration (ignored for Tcl itself)
+# _USE_64BIT_TIME_T - forces a build using 64-bit time_t for 32-bit build
+# (CRT library should support this)
+# TCL_UTF_MAX=4 - forces a build using 32-bit Tcl_UniChar in stead of 16-bit.
# Further, LINKERFLAGS are modified based on above.
# Default values for all the above
@@ -745,6 +748,16 @@ TCL_USE_STATIC_PACKAGES = 1 TCL_USE_STATIC_PACKAGES = 0
!endif
+!if [nmakehlp -f $(OPTS) "time64bit"]
+!message *** Force 64-bit time_t
+_USE_64BIT_TIME_T = 1
+!endif
+
+!if [nmakehlp -f $(OPTS) "utfmax"]
+!message *** Force 32-bit Tcl_UniChar
+TCL_UTF_MAX = 4
+!endif
+
# Yes, it's weird that the "symbols" option controls DEBUG and
# the "pdbs" option controls SYMBOLS. That's historical.
!if [nmakehlp -f $(OPTS) "symbols"]
@@ -1305,6 +1318,13 @@ OPTDEFINES = $(OPTDEFINES) -DTCL_CFG_DO64BIT OPTDEFINES = $(OPTDEFINES) -DNO_STRTOI64
!endif
+!if "$(_USE_64BIT_TIME_T)" == "1"
+OPTDEFINES = $(OPTDEFINES) -D_USE_64BIT_TIME_T
+!endif
+!if "$(TCL_UTF_MAX)" == "4"
+OPTDEFINES = $(OPTDEFINES) -DTCL_UTF_MAX=4
+!endif
+
# _ATL_XP_TARGETING - Newer SDK's need this to build for XP
COMPILERFLAGS = /D_ATL_XP_TARGETING
diff --git a/win/tcl.dsp b/win/tcl.dsp index eae1681..065d598 100644 --- a/win/tcl.dsp +++ b/win/tcl.dsp @@ -148,10 +148,6 @@ SOURCE=..\compat\dlfcn.h # End Source File
# Begin Source File
-SOURCE=..\compat\fixstrtod.c
-# End Source File
-# Begin Source File
-
SOURCE=..\compat\gettod.c
# End Source File
# Begin Source File
@@ -188,10 +184,6 @@ SOURCE=..\compat\strstr.c # End Source File
# Begin Source File
-SOURCE=..\compat\strtod.c
-# End Source File
-# Begin Source File
-
SOURCE=..\compat\strtol.c
# End Source File
# Begin Source File
diff --git a/win/tclWin32Dll.c b/win/tclWin32Dll.c index b173194..b8d325e 100644 --- a/win/tclWin32Dll.c +++ b/win/tclWin32Dll.c @@ -474,10 +474,7 @@ Tcl_WinUtfToTChar( * converted string is stored. */ { Tcl_DStringInit(dsPtr); - if (!string) { - return NULL; - } - return Tcl_UtfToUtf16DString(string, len, dsPtr); + return Tcl_UtfToChar16DString(string, len, dsPtr); } #undef Tcl_WinTCharToUtf char * @@ -489,10 +486,7 @@ Tcl_WinTCharToUtf( * converted string is stored. */ { Tcl_DStringInit(dsPtr); - if (!string) { - return NULL; - } - return Tcl_Utf16ToUtfDString((unsigned short *)string, len >> 1, dsPtr); + return Tcl_Char16ToUtfDString((unsigned short *)string, len >> 1, dsPtr); } #endif /* !defined(TCL_NO_DEPRECATED) */ diff --git a/win/tclWinFCmd.c b/win/tclWinFCmd.c index b3d1ece..9361051 100644 --- a/win/tclWinFCmd.c +++ b/win/tclWinFCmd.c @@ -330,8 +330,8 @@ DoRenameFile( Tcl_DStringInit(&srcString); Tcl_DStringInit(&dstString); - src = Tcl_Utf16ToUtfDString(nativeSrcPath, -1, &srcString); - dst = Tcl_Utf16ToUtfDString(nativeDstPath, -1, &dstString); + src = Tcl_Char16ToUtfDString(nativeSrcPath, -1, &srcString); + dst = Tcl_Char16ToUtfDString(nativeDstPath, -1, &dstString); /* * Check whether the destination path is actually inside the @@ -915,8 +915,8 @@ TclpObjCopyDirectory( Tcl_DStringInit(&srcString); Tcl_DStringInit(&dstString); - Tcl_UtfToUtf16DString(Tcl_GetString(normSrcPtr), -1, &srcString); - Tcl_UtfToUtf16DString(Tcl_GetString(normDestPtr), -1, &dstString); + Tcl_UtfToChar16DString(Tcl_GetString(normSrcPtr), -1, &srcString); + Tcl_UtfToChar16DString(Tcl_GetString(normDestPtr), -1, &dstString); ret = TraverseWinTree(TraversalCopy, &srcString, &dstString, &ds); @@ -989,7 +989,7 @@ TclpObjRemoveDirectory( return TCL_ERROR; } Tcl_DStringInit(&native); - Tcl_UtfToUtf16DString(Tcl_GetString(normPtr), -1, &native); + Tcl_UtfToChar16DString(Tcl_GetString(normPtr), -1, &native); ret = DoRemoveDirectory(&native, recursive, &ds); Tcl_DStringFree(&native); } else { @@ -1117,7 +1117,7 @@ DoRemoveJustDirectory( char *p; Tcl_DStringInit(errorPtr); - p = Tcl_Utf16ToUtfDString(nativePath, -1, errorPtr); + p = Tcl_Char16ToUtfDString(nativePath, -1, errorPtr); for (; *p; ++p) { if (*p == '\\') *p = '/'; } @@ -1332,7 +1332,7 @@ TraverseWinTree( TclWinConvertError(GetLastError()); if (errorPtr != NULL) { Tcl_DStringInit(errorPtr); - Tcl_Utf16ToUtfDString(nativeErrfile, -1, errorPtr); + Tcl_Char16ToUtfDString(nativeErrfile, -1, errorPtr); } result = TCL_ERROR; } @@ -1398,7 +1398,7 @@ TraversalCopy( if (errorPtr != NULL) { Tcl_DStringInit(errorPtr); - Tcl_Utf16ToUtfDString(nativeDst, -1, errorPtr); + Tcl_Char16ToUtfDString(nativeDst, -1, errorPtr); } return TCL_ERROR; } @@ -1454,7 +1454,7 @@ TraversalDelete( if (errorPtr != NULL) { Tcl_DStringInit(errorPtr); - Tcl_Utf16ToUtfDString(nativeSrc, -1, errorPtr); + Tcl_Char16ToUtfDString(nativeSrc, -1, errorPtr); } return TCL_ERROR; } @@ -1663,7 +1663,7 @@ ConvertFileNameFormat( tempString = TclGetStringFromObj(tempPath, &length); Tcl_DStringInit(&ds); - nativeName = Tcl_UtfToUtf16DString(tempString, length, &ds); + nativeName = Tcl_UtfToChar16DString(tempString, length, &ds); Tcl_DecrRefCount(tempPath); handle = FindFirstFile(nativeName, &data); if (handle == INVALID_HANDLE_VALUE) { @@ -1700,7 +1700,7 @@ ConvertFileNameFormat( } /* - * Purify reports a extraneous UMR in Tcl_Utf16ToUtfDString() trying + * Purify reports a extraneous UMR in Tcl_Char16ToUtfDString() trying * to dereference nativeName as a Unicode string. I have proven to * myself that purify is wrong by running the following example * when nativeName == data.w.cAlternateFileName and noting that @@ -1712,7 +1712,7 @@ ConvertFileNameFormat( */ Tcl_DStringInit(&dsTemp); - Tcl_Utf16ToUtfDString(nativeName, -1, &dsTemp); + Tcl_Char16ToUtfDString(nativeName, -1, &dsTemp); Tcl_DStringFree(&ds); /* @@ -2008,9 +2008,9 @@ TclpCreateTemporaryDirectory( goto useSystemTemp; } Tcl_DStringInit(&base); - Tcl_UtfToUtf16DString(Tcl_GetString(dirObj), -1, &base); + Tcl_UtfToChar16DString(Tcl_GetString(dirObj), -1, &base); if (dirObj->bytes[dirObj->length - 1] != '\\') { - Tcl_UtfToUtf16DString("\\", -1, &base); + Tcl_UtfToChar16DString("\\", -1, &base); } } else { useSystemTemp: @@ -2026,11 +2026,11 @@ TclpCreateTemporaryDirectory( #define SUFFIX_LENGTH 8 if (basenameObj) { - Tcl_UtfToUtf16DString(Tcl_GetString(basenameObj), -1, &base); + Tcl_UtfToChar16DString(Tcl_GetString(basenameObj), -1, &base); } else { - Tcl_UtfToUtf16DString(DEFAULT_TEMP_DIR_PREFIX, -1, &base); + Tcl_UtfToChar16DString(DEFAULT_TEMP_DIR_PREFIX, -1, &base); } - Tcl_UtfToUtf16DString("_", -1, &base); + Tcl_UtfToChar16DString("_", -1, &base); /* * Now we keep on trying random suffixes until we get one that works @@ -2057,7 +2057,7 @@ TclpCreateTemporaryDirectory( tempbuf[i] = randChars[(int) (rand() % numRandChars)]; } Tcl_DStringSetLength(&base, baseLen); - Tcl_UtfToUtf16DString(tempbuf, -1, &base); + Tcl_UtfToChar16DString(tempbuf, -1, &base); } while (!CreateDirectoryW((LPCWSTR) Tcl_DStringValue(&base), NULL) && (error = GetLastError()) == ERROR_ALREADY_EXISTS); @@ -2078,7 +2078,7 @@ TclpCreateTemporaryDirectory( */ Tcl_DStringInit(&name); - Tcl_Utf16ToUtfDString((LPCWSTR) Tcl_DStringValue(&base), -1, &name); + Tcl_Char16ToUtfDString((LPCWSTR) Tcl_DStringValue(&base), -1, &name); Tcl_DStringFree(&base); return TclDStringToObj(&name); } diff --git a/win/tclWinFile.c b/win/tclWinFile.c index c3677b9..4e506d4 100644 --- a/win/tclWinFile.c +++ b/win/tclWinFile.c @@ -635,7 +635,7 @@ WinReadLinkDirectory( } Tcl_DStringInit(&ds); - Tcl_Utf16ToUtfDString( + Tcl_Char16ToUtfDString( reparseBuffer->MountPointReparseBuffer.PathBuffer, reparseBuffer->MountPointReparseBuffer .SubstituteNameLength>>1, &ds); @@ -1025,7 +1025,7 @@ TclpMatchInDirectory( } Tcl_DStringInit(&ds); - native = Tcl_UtfToUtf16DString(dirName, -1, &ds); + native = Tcl_UtfToChar16DString(dirName, -1, &ds); if ((types == NULL) || (types->type != TCL_GLOB_TYPE_DIR)) { handle = FindFirstFile(native, &data); } else { @@ -1099,7 +1099,7 @@ TclpMatchInDirectory( native = data.cFileName; attr = data.dwFileAttributes; Tcl_DStringInit(&ds); - utfname = Tcl_Utf16ToUtfDString(native, -1, &ds); + utfname = Tcl_Char16ToUtfDString(native, -1, &ds); if (!matchSpecialDots) { /* @@ -1474,14 +1474,14 @@ TclpGetUserHome( Tcl_DStringFree(&ds); } else { Tcl_DStringInit(&ds); - wName = Tcl_UtfToUtf16DString(domain + 1, -1, &ds); + wName = Tcl_UtfToChar16DString(domain + 1, -1, &ds); rc = NetGetDCName(NULL, wName, (LPBYTE *) &wDomain); Tcl_DStringFree(&ds); nameLen = domain - name; } if (rc == 0) { Tcl_DStringInit(&ds); - wName = Tcl_UtfToUtf16DString(name, nameLen, &ds); + wName = Tcl_UtfToChar16DString(name, nameLen, &ds); while (NetUserGetInfo(wDomain, wName, 1, (LPBYTE *) &uiPtr) != 0) { /* * User does not exist; if domain was not specified, try again @@ -1509,7 +1509,7 @@ TclpGetUserHome( wHomeDir = uiPtr->usri1_home_dir; if ((wHomeDir != NULL) && (wHomeDir[0] != '\0')) { size = lstrlenW(wHomeDir); - Tcl_Utf16ToUtfDString(wHomeDir, size, bufferPtr); + Tcl_Char16ToUtfDString(wHomeDir, size, bufferPtr); } else { /* * User exists but has no home dir. Return @@ -1517,7 +1517,7 @@ TclpGetUserHome( */ GetProfilesDirectoryW(buf, &size); - Tcl_Utf16ToUtfDString(buf, size-1, bufferPtr); + Tcl_Char16ToUtfDString(buf, size-1, bufferPtr); Tcl_DStringAppend(bufferPtr, "/", 1); Tcl_DStringAppend(bufferPtr, name, nameLen); } @@ -1986,7 +1986,7 @@ TclpGetCwd( native += 2; } Tcl_DStringInit(bufferPtr); - Tcl_Utf16ToUtfDString(native, -1, bufferPtr); + Tcl_Char16ToUtfDString(native, -1, bufferPtr); /* * Convert to forward slashes for easier use in scripts. @@ -2195,7 +2195,7 @@ NativeDev( GetFullPathName(nativePath, MAX_PATH, nativeFullPath, &nativePart); Tcl_DStringInit(&ds); - fullPath = Tcl_Utf16ToUtfDString(nativeFullPath, -1, &ds); + fullPath = Tcl_Char16ToUtfDString(nativeFullPath, -1, &ds); if ((fullPath[0] == '\\') && (fullPath[1] == '\\')) { const char *p; @@ -2217,7 +2217,7 @@ NativeDev( p++; } Tcl_DStringInit(&volString); - nativeVol = Tcl_UtfToUtf16DString(fullPath, p - fullPath, &volString); + nativeVol = Tcl_UtfToChar16DString(fullPath, p - fullPath, &volString); dw = (DWORD) -1; GetVolumeInformation(nativeVol, NULL, 0, &dw, NULL, NULL, NULL, 0); @@ -2498,7 +2498,7 @@ TclpFilesystemPathType( Tcl_DString ds; Tcl_DStringInit(&ds); - Tcl_Utf16ToUtfDString(volType, -1, &ds); + Tcl_Char16ToUtfDString(volType, -1, &ds); return TclDStringToObj(&ds); } #undef VOL_BUF_SIZE @@ -2571,7 +2571,7 @@ TclpObjNormalizePath( const WCHAR *nativePath; Tcl_DStringInit(&ds); - nativePath = Tcl_UtfToUtf16DString(path, + nativePath = Tcl_UtfToChar16DString(path, currentPathEndPosition - path, &ds); if (GetFileAttributesEx(nativePath, @@ -2778,7 +2778,7 @@ TclpObjNormalizePath( Tcl_DStringInit(&ds); nativePath = - Tcl_UtfToUtf16DString(path, lastValidPathEnd - path, &ds); + Tcl_UtfToChar16DString(path, lastValidPathEnd - path, &ds); wpathlen = GetLongPathNameProc(nativePath, (WCHAR *) wpath, MAX_PATH); /* @@ -2808,7 +2808,7 @@ TclpObjNormalizePath( */ Tcl_DStringInit(&ds); - Tcl_Utf16ToUtfDString((const WCHAR *) Tcl_DStringValue(&dsNorm), + Tcl_Char16ToUtfDString((const WCHAR *) Tcl_DStringValue(&dsNorm), Tcl_DStringLength(&dsNorm)>>1, &ds); nextCheckpoint = Tcl_DStringLength(&ds); if (*lastValidPathEnd != 0) { @@ -2985,7 +2985,7 @@ TclpNativeToNormalized( char *copy, *p; Tcl_DStringInit(&ds); - Tcl_Utf16ToUtfDString((const WCHAR *) clientData, -1, &ds); + Tcl_Char16ToUtfDString((const WCHAR *) clientData, -1, &ds); copy = Tcl_DStringValue(&ds); len = Tcl_DStringLength(&ds); diff --git a/win/tclWinInit.c b/win/tclWinInit.c index 4219963..1bd962d 100644 --- a/win/tclWinInit.c +++ b/win/tclWinInit.c @@ -477,7 +477,7 @@ TclpGetUserName( } cchUserNameLen--; Tcl_DStringInit(bufferPtr); - Tcl_Utf16ToUtfDString(szUserName, cchUserNameLen, bufferPtr); + Tcl_Char16ToUtfDString(szUserName, cchUserNameLen, bufferPtr); } return Tcl_DStringValue(bufferPtr); } @@ -628,7 +628,7 @@ TclpFindVariable( * searches). */ { int i, length, result = -1; - register const char *env, *p1, *p2; + const char *env, *p1, *p2; char *envUpper, *nameUpper; Tcl_DString envString; diff --git a/win/tclWinLoad.c b/win/tclWinLoad.c index 983cfa3..011ebd7 100644 --- a/win/tclWinLoad.c +++ b/win/tclWinLoad.c @@ -96,7 +96,7 @@ TclpDlopen( ERROR_MOD_NOT_FOUND : GetLastError(); Tcl_DStringInit(&ds); - nativeName = Tcl_UtfToUtf16DString(Tcl_GetString(pathPtr), -1, &ds); + nativeName = Tcl_UtfToChar16DString(Tcl_GetString(pathPtr), -1, &ds); hInstance = LoadLibraryEx(nativeName, NULL, LOAD_WITH_ALTERED_SEARCH_PATH); Tcl_DStringFree(&ds); diff --git a/win/tclWinNotify.c b/win/tclWinNotify.c index 89a1b66..dba7a31 100644 --- a/win/tclWinNotify.c +++ b/win/tclWinNotify.c @@ -83,7 +83,6 @@ Tcl_InitNotifier(void) return tclNotifierHooks.initNotifierProc(); } else { ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); - WNDCLASS class; TclpMasterLock(); if (!initialized) { @@ -99,18 +98,20 @@ Tcl_InitNotifier(void) EnterCriticalSection(¬ifierMutex); if (notifierCount == 0) { - class.style = 0; - class.cbClsExtra = 0; - class.cbWndExtra = 0; - class.hInstance = TclWinGetTclInstance(); - class.hbrBackground = NULL; - class.lpszMenuName = NULL; - class.lpszClassName = className; - class.lpfnWndProc = NotifierProc; - class.hIcon = NULL; - class.hCursor = NULL; - - if (!RegisterClass(&class)) { + WNDCLASS clazz; + + clazz.style = 0; + clazz.cbClsExtra = 0; + clazz.cbWndExtra = 0; + clazz.hInstance = TclWinGetTclInstance(); + clazz.hbrBackground = NULL; + clazz.lpszMenuName = NULL; + clazz.lpszClassName = className; + clazz.lpfnWndProc = NotifierProc; + clazz.hIcon = NULL; + clazz.hCursor = NULL; + + if (!RegisterClass(&clazz)) { Tcl_Panic("Unable to register TclNotifier window class"); } } diff --git a/win/tclWinPipe.c b/win/tclWinPipe.c index c382e23..fafdf49 100644 --- a/win/tclWinPipe.c +++ b/win/tclWinPipe.c @@ -578,7 +578,7 @@ TclpOpenFile( } Tcl_DStringInit(&ds); - nativePath = Tcl_UtfToUtf16DString(path, -1, &ds); + nativePath = Tcl_UtfToChar16DString(path, -1, &ds); /* * If the file is not being created, use the existing file attributes. @@ -1292,7 +1292,7 @@ ApplicationType( Tcl_DStringSetLength(&nameBuf, nameLen); Tcl_DStringAppend(&nameBuf, extensions[i], -1); Tcl_DStringInit(&ds); - nativeName = Tcl_UtfToUtf16DString(Tcl_DStringValue(&nameBuf), + nativeName = Tcl_UtfToChar16DString(Tcl_DStringValue(&nameBuf), Tcl_DStringLength(&nameBuf), &ds); found = SearchPath(NULL, nativeName, NULL, MAX_PATH, nativeFullPath, &rest); @@ -1311,7 +1311,7 @@ ApplicationType( continue; } Tcl_DStringInit(&ds); - strcpy(fullName, Tcl_Utf16ToUtfDString(nativeFullPath, -1, &ds)); + strcpy(fullName, Tcl_Char16ToUtfDString(nativeFullPath, -1, &ds)); Tcl_DStringFree(&ds); ext = strrchr(fullName, '.'); @@ -1403,7 +1403,7 @@ ApplicationType( GetShortPathName(nativeFullPath, nativeFullPath, MAX_PATH); Tcl_DStringInit(&ds); - strcpy(fullName, Tcl_Utf16ToUtfDString(nativeFullPath, -1, &ds)); + strcpy(fullName, Tcl_Char16ToUtfDString(nativeFullPath, -1, &ds)); Tcl_DStringFree(&ds); } return applType; @@ -1732,7 +1732,7 @@ BuildCommandLine( } Tcl_DStringFree(linePtr); Tcl_DStringInit(linePtr); - Tcl_UtfToUtf16DString(Tcl_DStringValue(&ds), Tcl_DStringLength(&ds), linePtr); + Tcl_UtfToChar16DString(Tcl_DStringValue(&ds), Tcl_DStringLength(&ds), linePtr); Tcl_DStringFree(&ds); } @@ -3215,7 +3215,7 @@ TclpOpenTemporaryFile( const char *string = TclGetStringFromObj(basenameObj, &length); Tcl_DStringInit(&buf); - Tcl_UtfToUtf16DString(string, length, &buf); + Tcl_UtfToChar16DString(string, length, &buf); memcpy(namePtr, Tcl_DStringValue(&buf), Tcl_DStringLength(&buf)); namePtr += Tcl_DStringLength(&buf); Tcl_DStringFree(&buf); @@ -3236,7 +3236,7 @@ TclpOpenTemporaryFile( sprintf(number, "%d.TMP", counter); counter = (unsigned short) (counter + 1); Tcl_DStringInit(&buf); - Tcl_UtfToUtf16DString(number, strlen(number), &buf); + Tcl_UtfToChar16DString(number, strlen(number), &buf); Tcl_DStringSetLength(&buf, Tcl_DStringLength(&buf) + 1); memcpy(namePtr, Tcl_DStringValue(&buf), Tcl_DStringLength(&buf) + 1); Tcl_DStringFree(&buf); diff --git a/win/tclWinPort.h b/win/tclWinPort.h index 943f1ca..3f8b546 100644 --- a/win/tclWinPort.h +++ b/win/tclWinPort.h @@ -14,7 +14,12 @@ #ifndef _TCLWINPORT #define _TCLWINPORT -#if !defined(_WIN64) && defined(BUILD_tcl) +/* define _USE_64BIT_TIME_T (or make/configure option time64bit) to force 64-bit time_t */ +#if defined(_USE_64BIT_TIME_T) +#define __MINGW_USE_VC2005_COMPAT +#endif + +#if !defined(_WIN64) && !defined(__MINGW_USE_VC2005_COMPAT) && defined(BUILD_tcl) /* See [Bug 3354324]: file mtime sets wrong time */ # define _USE_32BIT_TIME_T #endif diff --git a/win/tclWinSerial.c b/win/tclWinSerial.c index 41ddbb7..3de91be 100644 --- a/win/tclWinSerial.c +++ b/win/tclWinSerial.c @@ -1670,7 +1670,7 @@ SerialSetOptionProc( goto getStateFailed; } Tcl_DStringInit(&ds); - native = Tcl_UtfToUtf16DString(value, -1, &ds); + native = Tcl_UtfToChar16DString(value, -1, &ds); result = BuildCommDCB(native, &dcb); Tcl_DStringFree(&ds); diff --git a/win/tclWinSock.c b/win/tclWinSock.c index a61328a..88953c0 100644 --- a/win/tclWinSock.c +++ b/win/tclWinSock.c @@ -373,7 +373,7 @@ InitializeHostName( * Convert string from native to UTF then change to lowercase. */ - Tcl_UtfToLower(Tcl_Utf16ToUtfDString(tbuf, -1, &ds)); + Tcl_UtfToLower(Tcl_Char16ToUtfDString(tbuf, -1, &ds)); } else { if (TclpHasSockets(NULL) == TCL_OK) { diff --git a/win/tclWinTest.c b/win/tclWinTest.c index 40be3d5..c06f10a 100644 --- a/win/tclWinTest.c +++ b/win/tclWinTest.c @@ -41,6 +41,8 @@ static int TestwinclockCmd(ClientData dummy, Tcl_Interp* interp, int objc, Tcl_Obj *const objv[]); static int TestwinsleepCmd(ClientData dummy, Tcl_Interp* interp, int objc, Tcl_Obj *const objv[]); +static int TestSizeCmd(ClientData dummy, Tcl_Interp* interp, + int objc, Tcl_Obj *const objv[]); static Tcl_ObjCmdProc TestExceptionCmd; static int TestplatformChmod(const char *nativePath, int pmode); static int TestchmodCmd(ClientData dummy, Tcl_Interp* interp, @@ -78,6 +80,7 @@ TclplatformtestInit( Tcl_CreateObjCommand(interp, "testwinclock", TestwinclockCmd, NULL, NULL); Tcl_CreateObjCommand(interp, "testwinsleep", TestwinsleepCmd, NULL, NULL); Tcl_CreateObjCommand(interp, "testexcept", TestExceptionCmd, NULL, NULL); + Tcl_CreateObjCommand(interp, "testsize", TestSizeCmd, NULL, NULL); return TCL_OK; } @@ -310,6 +313,26 @@ TestwinsleepCmd( return TCL_OK; } +static int +TestSizeCmd( + ClientData clientData, /* Unused */ + Tcl_Interp* interp, /* Tcl interpreter */ + int objc, /* Parameter count */ + Tcl_Obj *const * objv) /* Parameter vector */ +{ + if (objc != 2) { + goto syntax; + } + if (strcmp(Tcl_GetString(objv[1]), "time_t") == 0) { + Tcl_SetObjResult(interp, Tcl_NewWideIntObj(sizeof(time_t))); + return TCL_OK; + } + +syntax: + Tcl_WrongNumArgs(interp, 1, objv, "time_t"); + return TCL_ERROR; +} + /* *---------------------------------------------------------------------- * |