summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.fossil-settings/binary-glob18
-rwxr-xr-x.gitattributes10
-rw-r--r--.travis.yml261
-rw-r--r--compat/fake-rfc2553.c3
-rw-r--r--compat/gettod.c3
-rw-r--r--compat/mkstemp.c13
-rw-r--r--compat/opendir.c12
-rw-r--r--compat/strstr.c4
-rw-r--r--compat/strtol.c2
-rw-r--r--compat/strtoul.c6
-rw-r--r--compat/waitpid.c2
-rw-r--r--compat/zlib/contrib/minizip/crypt.h2
-rw-r--r--doc/InitSubSyst.331
-rw-r--r--doc/OpenFileChnl.32
-rw-r--r--doc/StringObj.32
-rw-r--r--doc/string.n6
-rw-r--r--generic/regc_lex.c4
-rw-r--r--generic/regc_nfa.c6
-rw-r--r--generic/regcomp.c28
-rw-r--r--generic/regerror.c1
-rw-r--r--generic/regex.h4
-rw-r--r--generic/regexec.c11
-rw-r--r--generic/tcl.decls3
-rw-r--r--generic/tcl.h3
-rw-r--r--generic/tclAlloc.c18
-rw-r--r--generic/tclAssembly.c15
-rw-r--r--generic/tclBasic.c62
-rw-r--r--generic/tclBinary.c8
-rw-r--r--generic/tclCkalloc.c132
-rw-r--r--generic/tclClock.c5
-rw-r--r--generic/tclCmdAH.c10
-rw-r--r--generic/tclCmdIL.c28
-rw-r--r--generic/tclCmdMZ.c15
-rw-r--r--generic/tclCompCmds.c30
-rw-r--r--generic/tclCompCmdsSZ.c8
-rw-r--r--generic/tclCompile.c130
-rw-r--r--generic/tclDate.c10
-rw-r--r--generic/tclDictObj.c3
-rw-r--r--generic/tclDisassemble.c6
-rw-r--r--generic/tclEncoding.c18
-rw-r--r--generic/tclEnsemble.c6
-rw-r--r--generic/tclEvent.c6
-rw-r--r--generic/tclExecute.c71
-rw-r--r--generic/tclFileName.c6
-rw-r--r--generic/tclGetDate.y10
-rw-r--r--generic/tclHash.c42
-rw-r--r--generic/tclHistory.c4
-rw-r--r--generic/tclIO.c6
-rw-r--r--generic/tclIORChan.c2
-rw-r--r--generic/tclIORTrans.c2
-rw-r--r--generic/tclIndexObj.c14
-rw-r--r--generic/tclInt.h2
-rw-r--r--generic/tclInterp.c16
-rw-r--r--generic/tclListObj.c22
-rw-r--r--generic/tclLiteral.c44
-rw-r--r--generic/tclNamesp.c70
-rw-r--r--generic/tclOO.c12
-rw-r--r--generic/tclOOBasic.c4
-rw-r--r--generic/tclOOCall.c10
-rw-r--r--generic/tclOODefineCmds.c2
-rw-r--r--generic/tclOOInt.h2
-rw-r--r--generic/tclOOMethod.c24
-rw-r--r--generic/tclObj.c182
-rw-r--r--generic/tclPanic.c2
-rw-r--r--generic/tclParse.c44
-rw-r--r--generic/tclPathObj.c2
-rw-r--r--generic/tclPipe.c6
-rw-r--r--generic/tclPlatDecls.h2
-rw-r--r--generic/tclProc.c22
-rw-r--r--generic/tclRegexp.c4
-rw-r--r--generic/tclResult.c26
-rw-r--r--generic/tclScan.c11
-rw-r--r--generic/tclStringObj.c2
-rw-r--r--generic/tclTest.c109
-rw-r--r--generic/tclTestObj.c5
-rw-r--r--generic/tclThreadAlloc.c24
-rw-r--r--generic/tclTimer.c10
-rw-r--r--generic/tclTrace.c36
-rw-r--r--generic/tclUtf.c26
-rw-r--r--generic/tclUtil.c22
-rw-r--r--generic/tclVar.c54
-rw-r--r--generic/tclZipfs.c6
-rw-r--r--library/dde/pkgIndex.tcl4
-rw-r--r--library/http/effective_tld_names.txt.gzbin39188 -> 70836 bytes
-rw-r--r--library/init.tcl4
-rw-r--r--library/manifest.txt2
-rwxr-xr-xlibrary/reg/pkgIndex.tcl4
-rw-r--r--library/tcltest/pkgIndex.tcl2
-rw-r--r--library/tcltest/tcltest.tcl9
-rw-r--r--library/tm.tcl4
-rw-r--r--library/tzdata/America/Detroit5
-rw-r--r--library/tzdata/America/Edmonton4
-rw-r--r--library/tzdata/America/Indiana/Tell_City16
-rw-r--r--library/tzdata/America/Kentucky/Louisville9
-rw-r--r--library/tzdata/America/Vancouver2
-rw-r--r--library/tzdata/Asia/Hong_Kong2
-rw-r--r--library/tzdata/Asia/Seoul8
-rw-r--r--library/tzdata/Europe/Brussels2
-rw-r--r--library/tzdata/Europe/Istanbul57
-rw-r--r--library/tzdata/Europe/Kaliningrad9
-rw-r--r--library/tzdata/Europe/Vienna2
-rw-r--r--library/tzdata/Pacific/Fiji186
-rw-r--r--library/tzdata/Pacific/Norfolk164
-rw-r--r--macosx/tclMacOSXFCmd.c4
-rw-r--r--tests/all.tcl9
-rw-r--r--tests/basic.test2
-rw-r--r--tests/chanio.test20
-rw-r--r--tests/cmdAH.test37
-rw-r--r--tests/cmdMZ.test6
-rw-r--r--tests/compile.test61
-rw-r--r--tests/execute.test84
-rw-r--r--tests/fCmd.test6
-rw-r--r--tests/fileName.test42
-rw-r--r--tests/interp.test2
-rw-r--r--tests/io.test6
-rw-r--r--tests/ioCmd.test17
-rw-r--r--tests/lrange.test12
-rw-r--r--tests/namespace.test1
-rw-r--r--tests/pid.test2
-rw-r--r--tests/socket.test2
-rw-r--r--tests/tcltest.test108
-rw-r--r--tests/tm.test2
-rw-r--r--tests/uplevel.test10
-rw-r--r--tests/upvar.test13
-rw-r--r--tests/winTime.test5
-rw-r--r--tools/tcltk-man2html-utils.tcl4
-rw-r--r--unix/Makefile.in3
-rwxr-xr-xunix/configure2
-rw-r--r--unix/configure.ac2
-rw-r--r--unix/tclSelectNotfy.c6
-rw-r--r--unix/tclUnixChan.c2
-rw-r--r--unix/tclUnixInit.c2
-rw-r--r--unix/tclUnixTest.c292
-rw-r--r--unix/tclUnixTime.c4
-rw-r--r--win/Makefile.in67
-rw-r--r--win/makefile.vc72
-rw-r--r--win/nmakehlp.c2
-rw-r--r--win/rules.vc131
-rw-r--r--win/tclWin32Dll.c12
-rw-r--r--win/tclWinChan.c4
-rw-r--r--win/tclWinConsole.c10
-rw-r--r--win/tclWinDde.c110
-rw-r--r--win/tclWinFCmd.c124
-rw-r--r--win/tclWinFile.c84
-rw-r--r--win/tclWinInit.c16
-rw-r--r--win/tclWinLoad.c4
-rw-r--r--win/tclWinNotify.c22
-rw-r--r--win/tclWinPipe.c49
-rw-r--r--win/tclWinPort.h8
-rw-r--r--win/tclWinReg.c57
-rw-r--r--win/tclWinSerial.c14
-rw-r--r--win/tclWinSock.c26
-rw-r--r--win/tclWinTest.c11
-rw-r--r--win/tclWinThrd.c2
-rw-r--r--win/tclWinTime.c31
155 files changed, 2297 insertions, 1729 deletions
diff --git a/.fossil-settings/binary-glob b/.fossil-settings/binary-glob
index ec574be..2a205a1 100644
--- a/.fossil-settings/binary-glob
+++ b/.fossil-settings/binary-glob
@@ -1,9 +1,11 @@
-compat/zlib/win32/zdll.lib
-compat/zlib/win32/zlib1.dll
-compat/zlib/win64/zdll.lib
-compat/zlib/win64/zlib1.dll
-compat/zlib/win64/libz.dll.a
-compat/zlib/zlib.3.pdf
-*.bmp
+*.a
+*.dll
+*.exe
*.gif
-*.png \ No newline at end of file
+*.gz
+*.jpg
+*.lib
+*.pdf
+*.png
+*.xlsx
+*.zip
diff --git a/.gitattributes b/.gitattributes
index 82bed50..e9a67c8 100755
--- a/.gitattributes
+++ b/.gitattributes
@@ -1,5 +1,6 @@
# Set the default behavior, in case people don't have core.autocrlf set.
-* text eol=lf
+* eol=lf
+* text=auto
# Explicitly declare text files you want to always be normalized and converted
# to native line endings on checkout.
@@ -20,15 +21,16 @@
*.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
+*.bat eol=crlf
+*.sln eol=crlf
+*.vc eol=crlf
# Denote all files that are truly binary and should not be modified.
*.a binary
*.dll binary
*.exe binary
*.gif binary
+*.gz binary
*.jpg binary
*.lib binary
*.pdf binary
diff --git a/.travis.yml b/.travis.yml
index 538006d..32467d0 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -10,37 +10,34 @@ matrix:
compiler: gcc
env:
- BUILD_DIR=unix
- - name: "Linux/GCC/Static"
+ - name: "Linux/GCC/Shared: UTF_MAX=4"
os: linux
dist: xenial
compiler: gcc
env:
- - CFGOPT=--disable-shared
- BUILD_DIR=unix
- - name: "Linux/GCC/Shared: UTF_MAX=4"
+ - CFGOPT=CFLAGS=-DTCL_UTF_MAX=4
+ - name: "Linux/GCC/Shared: NO_DEPRECATED"
os: linux
dist: xenial
compiler: gcc
env:
- BUILD_DIR=unix
- - CFGOPT=CFLAGS=-DTCL_UTF_MAX=4
- - name: "Linux/GCC/Shared: NO_DEPRECATED"
+ - CFGOPT="CFLAGS=-DTCL_NO_DEPRECATED=1"
+ - name: "Linux/GCC/Static"
os: linux
dist: xenial
compiler: gcc
env:
+ - CFGOPT="--disable-shared"
- BUILD_DIR=unix
- - CFGOPT=CFLAGS=-DTCL_NO_DEPRECATED=1
-# Debug build. Running test-cases disabled, because it is currently failing.
- - name: "Linux/GCC/Debug/no test"
+ - name: "Linux/GCC/Debug"
os: linux
dist: xenial
compiler: gcc
env:
- BUILD_DIR=unix
- - CFGOPT=--enable-symbols=all
- script:
- - make all tcltest
+ - CFGOPT="--enable-symbols"
# Older versions of GCC...
- name: "Linux/GCC 7/Shared"
os: linux
@@ -97,23 +94,34 @@ matrix:
compiler: clang
env:
- BUILD_DIR=unix
+ - 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:
+ - BUILD_DIR=unix
+ - CFGOPT="CFLAGS=-DTCL_NO_DEPRECATED=1"
- name: "Linux/Clang/Static"
os: linux
dist: xenial
compiler: clang
env:
- - CFGOPT=--disable-shared
+ - CFGOPT="--disable-shared"
- BUILD_DIR=unix
-# Debug build. Running test-cases disabled, because it is currently failing.
- - name: "Linux/Clang/Debug/no test"
+ - name: "Linux/Clang/Debug"
os: linux
dist: xenial
compiler: clang
env:
- BUILD_DIR=unix
- - CFGOPT=--enable-symbols=all
- script:
- - make all tcltest
+ - CFGOPT="--enable-symbols"
# Testing on Mac, various styles
- name: "macOS/Xcode 11/Shared/Unix-like"
os: osx
@@ -132,7 +140,7 @@ matrix:
- make test styles=develop
- name: "macOS/Xcode 10/Shared"
os: osx
- osx_image: xcode10.2
+ osx_image: xcode10.3
env:
- BUILD_DIR=macosx
install: []
@@ -151,118 +159,118 @@ matrix:
- BUILD_DIR=macosx
install: []
script: *mactest
-# Test with mingw-w64 (32 bit) cross-compile
+# Test with mingw-w64 cross-compile
# Doesn't run tests because wine is only an imperfect Windows emulation
- - name: "Linux-cross-Windows-32/GCC/Shared/no test"
+ - name: "Linux-cross-Windows/GCC/Shared/no test"
os: linux
dist: xenial
- compiler: i686-w64-mingw32-gcc
- addons: &mingw32
+ compiler: x86_64-w64-mingw32-gcc
+ addons: &mingw64
apt:
packages:
- gcc-mingw-w64-base
- - binutils-mingw-w64-i686
- - gcc-mingw-w64-i686
+ - binutils-mingw-w64-x86-64
+ - gcc-mingw-w64-x86-64
- gcc-mingw-w64
- - gcc-multilib
- wine
env:
- BUILD_DIR=win
- - CFGOPT=--host=i686-w64-mingw32
+ - CFGOPT="--host=x86_64-w64-mingw32 --enable-64bit"
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"
+ - name: "Linux-cross-Windows/GCC/Shared/no test: UTF_MAX=4"
os: linux
dist: xenial
- compiler: i686-w64-mingw32-gcc
- addons: *mingw32
+ compiler: x86_64-w64-mingw32-gcc
+ addons: *mingw64
env:
- BUILD_DIR=win
- - CFGOPT="--host=i686-w64-mingw32 --disable-shared"
+ - CFGOPT="--host=x86_64-w64-mingw32 --enable-64bit CFLAGS=-DTCL_UTF_MAX=4"
script: *crosstest
- - name: "Linux-cross-Windows-32/GCC/Shared/no test: UTF_MAX=4"
+ - name: "Linux-cross-Windows/GCC/Shared/no test: NO_DEPRECATED"
os: linux
dist: xenial
- compiler: i686-w64-mingw32-gcc
- addons: *mingw32
+ compiler: x86_64-w64-mingw32-gcc
+ addons: *mingw64
env:
- BUILD_DIR=win
- - CFGOPT="--host=i686-w64-mingw32 CFLAGS=-DTCL_UTF_MAX=4"
+ - CFGOPT="--host=x86_64-w64-mingw32 --enable-64bit CFLAGS=-DTCL_NO_DEPRECATED=1"
script: *crosstest
- - name: "Linux-cross-Windows-32/GCC/Shared/no test: NO_DEPRECATED"
+ - name: "Linux-cross-Windows/GCC/Static/no test"
os: linux
dist: xenial
- compiler: i686-w64-mingw32-gcc
- addons: *mingw32
+ compiler: x86_64-w64-mingw32-gcc
+ addons: *mingw64
env:
- BUILD_DIR=win
- - CFGOPT="--host=i686-w64-mingw32 CFLAGS=-DTCL_NO_DEPRECATED=1"
+ - CFGOPT="--host=x86_64-w64-mingw32 --enable-64bit --disable-shared"
script: *crosstest
- - name: "Linux-cross-Windows-32/GCC/Debug/no test"
+ - name: "Linux-cross-Windows/GCC/Debug/no test"
os: linux
dist: xenial
- compiler: i686-w64-mingw32-gcc
- addons: *mingw32
+ compiler: x86_64-w64-mingw32-gcc
+ addons: *mingw64
env:
- BUILD_DIR=win
- - CFGOPT="--host=i686-w64-mingw32 --enable-symbols"
+ - CFGOPT="--host=x86_64-w64-mingw32 --enable-64bit --enable-symbols"
script: *crosstest
-# Test with mingw-w64 (64 bit)
+# Test with mingw-w64 (32 bit) cross-compile
# Doesn't run tests because wine is only an imperfect Windows emulation
- - name: "Linux-cross-Windows-64/GCC/Shared/no test"
+ - name: "Linux-cross-Windows-32/GCC/Shared/no test"
os: linux
dist: xenial
- compiler: x86_64-w64-mingw32-gcc
- addons: &mingw64
+ compiler: i686-w64-mingw32-gcc
+ addons: &mingw32
apt:
packages:
- gcc-mingw-w64-base
- - binutils-mingw-w64-x86-64
- - gcc-mingw-w64-x86-64
+ - binutils-mingw-w64-i686
+ - gcc-mingw-w64-i686
- gcc-mingw-w64
+ - gcc-multilib
- wine
env:
- BUILD_DIR=win
- - CFGOPT="--host=x86_64-w64-mingw32 --enable-64bit"
+ - CFGOPT=--host=i686-w64-mingw32
script: *crosstest
- - name: "Linux-cross-Windows-64/GCC/Static/no test"
+ - name: "Linux-cross-Windows-32/GCC/Shared/no test: UTF_MAX=4"
os: linux
dist: xenial
- compiler: x86_64-w64-mingw32-gcc
- addons: *mingw64
+ compiler: i686-w64-mingw32-gcc
+ addons: *mingw32
env:
- BUILD_DIR=win
- - CFGOPT="--host=x86_64-w64-mingw32 --enable-64bit --disable-shared"
+ - CFGOPT="--host=i686-w64-mingw32 CFLAGS=-DTCL_UTF_MAX=4"
script: *crosstest
- - name: "Linux-cross-Windows-64/GCC/Shared/no test: UTF_MAX=4"
+ - name: "Linux-cross-Windows-32/GCC/Shared/no test: NO_DEPRECATED"
os: linux
dist: xenial
- compiler: x86_64-w64-mingw32-gcc
- addons: *mingw64
+ compiler: i686-w64-mingw32-gcc
+ addons: *mingw32
env:
- BUILD_DIR=win
- - CFGOPT="--host=x86_64-w64-mingw32 --enable-64bit CFLAGS=-DTCL_UTF_MAX=4"
+ - CFGOPT="--host=i686-w64-mingw32 CFLAGS=-DTCL_NO_DEPRECATED=1"
script: *crosstest
- - name: "Linux-cross-Windows-64/GCC/Shared/no test: NO_DEPRECATED"
+ - name: "Linux-cross-Windows-32/GCC/Static/no test"
os: linux
dist: xenial
- compiler: x86_64-w64-mingw32-gcc
- addons: *mingw64
+ compiler: i686-w64-mingw32-gcc
+ addons: *mingw32
env:
- BUILD_DIR=win
- - CFGOPT="--host=x86_64-w64-mingw32 --enable-64bit CFLAGS=-DTCL_NO_DEPRECATED=1"
+ - CFGOPT="--host=i686-w64-mingw32 --disable-shared"
script: *crosstest
- - name: "Linux-cross-Windows-64/GCC/Debug/no test"
+ - name: "Linux-cross-Windows-32/GCC/Debug/no test"
os: linux
dist: xenial
- compiler: x86_64-w64-mingw32-gcc
- addons: *mingw64
+ compiler: i686-w64-mingw32-gcc
+ addons: *mingw32
env:
- BUILD_DIR=win
- - CFGOPT="--host=x86_64-w64-mingw32 --enable-64bit --enable-symbols"
+ - CFGOPT="--host=i686-w64-mingw32 --enable-symbols"
script: *crosstest
# Test on Windows with MSVC native
- name: "Windows/MSVC/Shared"
@@ -278,7 +286,7 @@ matrix:
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: UTF_MAX=6"
+ - name: "Windows/MSVC/Shared: UTF_MAX=4"
os: windows
compiler: cl
env: *vcenv
@@ -314,10 +322,129 @@ matrix:
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'
+# Test on Windows with MSVC native (32-bit)
+ - name: "Windows/MSVC-x86/Shared"
+ os: windows
+ compiler: cl
+ env: *vcenv
+ before_install: *vcpreinst
+ install: []
+ script:
+ - cmd.exe /C 'vcvarsall.bat x86 && nmake -f makefile.vc all tcltest'
+ - cmd.exe /C 'vcvarsall.bat x86 && nmake -f makefile.vc test'
+ - name: "Windows/MSVC-x86/Shared: UTF_MAX=4"
+ os: windows
+ compiler: cl
+ env: *vcenv
+ before_install: *vcpreinst
+ install: []
+ script:
+ - cmd.exe /C 'vcvarsall.bat x86 && nmake OPTS=utfmax -f makefile.vc all tcltest'
+ - cmd.exe /C 'vcvarsall.bat x86 && nmake OPTS=utfmax -f makefile.vc test'
+ - name: "Windows/MSVC-x86/Shared: NO_DEPRECATED"
+ os: windows
+ compiler: cl
+ env: *vcenv
+ before_install: *vcpreinst
+ install: []
+ script:
+ - cmd.exe /C 'vcvarsall.bat x86 && nmake OPTS=nodep -f makefile.vc all tcltest'
+ - cmd.exe /C 'vcvarsall.bat x86 && nmake OPTS=nodep -f makefile.vc test'
+ - name: "Windows/MSVC-x86/Static"
+ os: windows
+ compiler: cl
+ env: *vcenv
+ before_install: *vcpreinst
+ install: []
+ script:
+ - cmd.exe /C 'vcvarsall.bat x86 && nmake OPTS=static -f makefile.vc all tcltest'
+ - cmd.exe /C 'vcvarsall.bat x86 && nmake OPTS=static -f makefile.vc test'
+ - name: "Windows/MSVC-x86/Debug"
+ os: windows
+ compiler: cl
+ env: *vcenv
+ before_install: *vcpreinst
+ install: []
+ script:
+ - cmd.exe /C 'vcvarsall.bat x86 && nmake OPTS=symbols -f makefile.vc all tcltest'
+ - cmd.exe /C 'vcvarsall.bat x86 && nmake OPTS=symbols -f makefile.vc test'
+# Test on Windows with GCC native
+ - name: "Windows/GCC/Shared"
+ os: windows
+ compiler: gcc
+ env:
+ - BUILD_DIR=win
+ - CFGOPT="--enable-64bit"
+ before_install: &makepreinst
+ - choco install make
+ - cd ${BUILD_DIR}
+ - name: "Windows/GCC/Shared: UTF_MAX=4"
+ os: windows
+ compiler: gcc
+ env:
+ - BUILD_DIR=win
+ - CFGOPT="--enable-64bit CFLAGS=-DTCL_UTF_MAX=4"
+ before_install: *makepreinst
+ - name: "Windows/GCC/Shared: NO_DEPRECATED"
+ os: windows
+ compiler: gcc
+ env:
+ - BUILD_DIR=win
+ - CFGOPT="--enable-64bit CFLAGS=-DTCL_NO_DEPRECATED=1"
+ before_install: *makepreinst
+ - name: "Windows/GCC/Static"
+ os: windows
+ compiler: gcc
+ env:
+ - BUILD_DIR=win
+ - CFGOPT="--enable-64bit --disable-shared"
+ before_install: *makepreinst
+ - name: "Windows/GCC/Debug"
+ os: windows
+ compiler: gcc
+ env:
+ - BUILD_DIR=win
+ - CFGOPT="--enable-64bit --enable-symbols"
+ before_install: *makepreinst
+# Test on Windows with GCC native (32-bit)
+ - name: "Windows/GCC-x86/Shared"
+ os: windows
+ compiler: gcc
+ env:
+ - BUILD_DIR=win
+ before_install: *makepreinst
+ - name: "Windows/GCC-x86/Shared: UTF_MAX=4"
+ os: windows
+ compiler: gcc
+ env:
+ - BUILD_DIR=win
+ - CFGOPT="CFLAGS=-DTCL_UTF_MAX=4"
+ before_install: *makepreinst
+ - name: "Windows/GCC-x86/Shared: NO_DEPRECATED"
+ os: windows
+ compiler: gcc
+ env:
+ - BUILD_DIR=win
+ - CFGOPT="CFLAGS=-DTCL_NO_DEPRECATED=1"
+ before_install: *makepreinst
+ - name: "Windows/GCC-x86/Static"
+ os: windows
+ compiler: gcc
+ env:
+ - BUILD_DIR=win
+ - CFGOPT="--disable-shared"
+ before_install: *makepreinst
+ - name: "Windows/GCC-x86/Debug"
+ os: windows
+ compiler: gcc
+ env:
+ - BUILD_DIR=win
+ - CFGOPT="--enable-symbols"
+ before_install: *makepreinst
before_install:
- cd ${BUILD_DIR}
install:
- - ./configure ${CFGOPT} --prefix=$HOME
+ - ./configure ${CFGOPT} --prefix=$HOME || (cat config.log && exit 1)
before_script:
- export ERROR_ON_FAILURES=1
script:
diff --git a/compat/fake-rfc2553.c b/compat/fake-rfc2553.c
index c8e69400..29e2b56 100644
--- a/compat/fake-rfc2553.c
+++ b/compat/fake-rfc2553.c
@@ -73,6 +73,7 @@ int fake_getnameinfo(const struct sockaddr *sa, size_t salen, char *host,
struct sockaddr_in *sin = (struct sockaddr_in *)sa;
struct hostent *hp;
char tmpserv[16];
+ (void)salen;
if (sa->sa_family != AF_UNSPEC && sa->sa_family != AF_INET)
return (EAI_FAMILY);
@@ -153,7 +154,7 @@ addrinfo *malloc_ai(int port, u_long addr, const struct addrinfo *hints)
{
struct addrinfo *ai;
- ai = malloc(sizeof(*ai) + sizeof(struct sockaddr_in));
+ ai = (struct addrinfo *)malloc(sizeof(*ai) + sizeof(struct sockaddr_in));
if (ai == NULL)
return (NULL);
diff --git a/compat/gettod.c b/compat/gettod.c
index ca20cf8..f6651d4 100644
--- a/compat/gettod.c
+++ b/compat/gettod.c
@@ -21,10 +21,11 @@ gettimeofday(
struct timezone *tz)
{
struct timeb t;
+ (void)tz;
ftime(&t);
tp->tv_sec = t.time;
- tp->tv_usec = t. millitm * 1000;
+ tp->tv_usec = t.millitm * 1000;
return 0;
}
diff --git a/compat/mkstemp.c b/compat/mkstemp.c
index 1a44dfa..feccfbb 100644
--- a/compat/mkstemp.c
+++ b/compat/mkstemp.c
@@ -13,6 +13,7 @@
#include <fcntl.h>
#include <stdlib.h>
#include <unistd.h>
+#include <string.h>
/*
*----------------------------------------------------------------------
@@ -32,19 +33,19 @@
int
mkstemp(
- char *template) /* Template for filename. */
+ char *tmpl) /* Template for filename. */
{
static const char alphanumerics[] =
"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
- register char *a, *b;
+ char *a, *b;
int fd, count, alphanumericsLen = strlen(alphanumerics); /* == 62 */
- a = template + strlen(template);
- while (a > template && *(a-1) == 'X') {
+ a = tmpl + strlen(tmpl);
+ while (a > tmpl && *(a-1) == 'X') {
a--;
}
- if (a == template) {
+ if (a == tmpl) {
errno = ENOENT;
return -1;
}
@@ -71,7 +72,7 @@ mkstemp(
* Template is now realized; try to open (with correct options).
*/
- fd = open(template, O_RDWR|O_CREAT|O_EXCL, 0600);
+ fd = open(tmpl, O_RDWR|O_CREAT|O_EXCL, 0600);
} while (fd == -1 && errno == EEXIST && --count > 0);
return fd;
diff --git a/compat/opendir.c b/compat/opendir.c
index 7a49566..25a7ada 100644
--- a/compat/opendir.c
+++ b/compat/opendir.c
@@ -20,9 +20,9 @@ DIR *
opendir(
char *name)
{
- register DIR *dirp;
- register int fd;
- char *myname;
+ DIR *dirp;
+ int fd;
+ const char *myname;
myname = ((*name == '\0') ? "." : name);
if ((fd = open(myname, 0, 0)) == -1) {
@@ -65,9 +65,9 @@ struct olddirect {
struct dirent *
readdir(
- register DIR *dirp)
+ DIR *dirp)
{
- register struct olddirect *dp;
+ struct olddirect *dp;
static struct dirent dir;
for (;;) {
@@ -101,7 +101,7 @@ readdir(
void
closedir(
- register DIR *dirp)
+ DIR *dirp)
{
close(dirp->dd_fd);
dirp->dd_fd = -1;
diff --git a/compat/strstr.c b/compat/strstr.c
index e3b9b8d..206dca9 100644
--- a/compat/strstr.c
+++ b/compat/strstr.c
@@ -36,10 +36,10 @@
char *
strstr(
- register char *string, /* String to search. */
+ char *string, /* String to search. */
char *substring) /* Substring to try to find in string. */
{
- register char *a, *b;
+ char *a, *b;
/*
* First scan quickly through the two strings looking for a
diff --git a/compat/strtol.c b/compat/strtol.c
index b7f6919..22cc1eb 100644
--- a/compat/strtol.c
+++ b/compat/strtol.c
@@ -45,7 +45,7 @@ strtol(
* hex, "0" means octal, anything else means
* decimal. */
{
- register const char *p;
+ const char *p;
long result;
/*
diff --git a/compat/strtoul.c b/compat/strtoul.c
index e37eb05..bf16f7a 100644
--- a/compat/strtoul.c
+++ b/compat/strtoul.c
@@ -62,9 +62,9 @@ strtoul(
* hex, "0" means octal, anything else means
* decimal. */
{
- register const char *p;
- register unsigned long int result = 0;
- register unsigned digit;
+ const char *p;
+ unsigned long int result = 0;
+ unsigned digit;
int anyDigits = 0;
int negative=0;
int overflow=0;
diff --git a/compat/waitpid.c b/compat/waitpid.c
index d4473a8..626d210 100644
--- a/compat/waitpid.c
+++ b/compat/waitpid.c
@@ -70,7 +70,7 @@ waitpid(
int options) /* OR'ed combination of WNOHANG and
* WUNTRACED. */
{
- register WaitInfo *waitPtr, *prevPtr;
+ WaitInfo *waitPtr, *prevPtr;
pid_t result;
WAIT_STATUS_TYPE status;
diff --git a/compat/zlib/contrib/minizip/crypt.h b/compat/zlib/contrib/minizip/crypt.h
index c422c26..2c3044b 100644
--- a/compat/zlib/contrib/minizip/crypt.h
+++ b/compat/zlib/contrib/minizip/crypt.h
@@ -57,7 +57,7 @@ static int update_keys(unsigned long* pkeys,const z_crc_t* pcrc_32_tab,int c)
(*(pkeys+1)) += (*(pkeys+0)) & 0xff;
(*(pkeys+1)) = (*(pkeys+1)) * 134775813L + 1;
{
- register int keyshift = (int)((*(pkeys+1)) >> 24);
+ int keyshift = (int)((*(pkeys+1)) >> 24);
(*(pkeys+2)) = CRC32((*(pkeys+2)), keyshift);
}
return c;
diff --git a/doc/InitSubSyst.3 b/doc/InitSubSyst.3
new file mode 100644
index 0000000..eef801f
--- /dev/null
+++ b/doc/InitSubSyst.3
@@ -0,0 +1,31 @@
+'\"
+'\" Copyright (c) 2018 Tcl Core Team
+'\"
+'\" See the file "license.terms" for information on usage and redistribution
+'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+'\"
+.so man.macros
+.TH Tcl_InitSubsystems 3 8.7 Tcl "Tcl Library Procedures"
+.BS
+.SH NAME
+Tcl_InitSubsystems \- initialize the Tcl library.
+.SH SYNOPSIS
+.nf
+\fB#include <tcl.h>\fR
+.sp
+void
+\fBTcl_InitSubsystems\fR(\fIvoid\fR)
+.SH DESCRIPTION
+.PP
+The \fBTcl_InitSubsystems\fR procedure initializes the Tcl
+library. This procedure is typically invoked as the very
+first thing in the application's main program.
+.PP
+\fBTcl_InitSubsystems\fR is very similar in use to
+\fBTcl_FindExecutable\fR. It can be used when Tcl is
+used as utility library, no other encodings than utf8,
+iso8859-1 or unicode are used, and no interest exists in the
+value of \fBinfo nameofexecutable\fR. The system encoding will not
+be extracted from the environment, but falls back to iso8859-1.
+.SH KEYWORDS
+binary, executable file
diff --git a/doc/OpenFileChnl.3 b/doc/OpenFileChnl.3
index 582ff4b..82851da 100644
--- a/doc/OpenFileChnl.3
+++ b/doc/OpenFileChnl.3
@@ -277,7 +277,7 @@ If an error occurs while opening the channel, \fBTcl_OpenCommandChannel\fR
returns NULL and records a POSIX error code that can be retrieved with
\fBTcl_GetErrno\fR.
In addition, \fBTcl_OpenCommandChannel\fR leaves an error message in
-the interpreter's result if \fIinterp\fR is not NULL.
+the interpreter's result. \fIinterp\fR cannot be NULL.
.PP
The newly created channel is not registered in the supplied interpreter; to
register it, use \fBTcl_RegisterChannel\fR, described below.
diff --git a/doc/StringObj.3 b/doc/StringObj.3
index e011c27..12fc413 100644
--- a/doc/StringObj.3
+++ b/doc/StringObj.3
@@ -91,7 +91,7 @@ Points to the first byte of an array of UTF-8-encoded bytes
used to set or append to a string value.
This byte array may contain embedded null characters
unless \fInumChars\fR is negative. (Applications needing null bytes
-should represent them as the two-byte sequence \fI\e700\e600\fR, use
+should represent them as the two-byte sequence \fI\e300\e200\fR, use
\fBTcl_ExternalToUtf\fR to convert, or \fBTcl_NewByteArrayObj\fR if
the string is a collection of uninterpreted bytes.)
.AP int length in
diff --git a/doc/string.n b/doc/string.n
index 72c7913..44d621d 100644
--- a/doc/string.n
+++ b/doc/string.n
@@ -362,21 +362,21 @@ specified using the forms described in \fBSTRING INDICES\fR.
Returns a value equal to \fIstring\fR except that any leading or
trailing characters present in the string given by \fIchars\fR are removed. If
\fIchars\fR is not specified then white space is removed (any character
-for which \fBstring is space\fR returns 1, and "\0").
+for which \fBstring is space\fR returns 1, and "\e0").
.TP
\fBstring trimleft \fIstring\fR ?\fIchars\fR?
.
Returns a value equal to \fIstring\fR except that any leading
characters present in the string given by \fIchars\fR are removed. If
\fIchars\fR is not specified then white space is removed (any character
-for which \fBstring is space\fR returns 1, and "\0").
+for which \fBstring is space\fR returns 1, and "\e0").
.TP
\fBstring trimright \fIstring\fR ?\fIchars\fR?
.
Returns a value equal to \fIstring\fR except that any trailing
characters present in the string given by \fIchars\fR are removed. If
\fIchars\fR is not specified then white space is removed (any character
-for which \fBstring is space\fR returns 1, and "\0").
+for which \fBstring is space\fR returns 1, and "\e0").
.SS "OBSOLETE SUBCOMMANDS"
.PP
These subcommands are currently supported, but are likely to go away in a
diff --git a/generic/regc_lex.c b/generic/regc_lex.c
index 4c8f15f..d299b49 100644
--- a/generic/regc_lex.c
+++ b/generic/regc_lex.c
@@ -905,9 +905,7 @@ lexescape(
v->now = save;
- /*
- * And fall through into octal number.
- */
+ /* FALLTHRU */
case CHR('0'):
NOTE(REG_UUNPORT);
diff --git a/generic/regc_nfa.c b/generic/regc_nfa.c
index 240fcfe..7507137 100644
--- a/generic/regc_nfa.c
+++ b/generic/regc_nfa.c
@@ -2978,6 +2978,9 @@ dumpnfa(
dumpcolors(nfa->cm, f);
}
fflush(f);
+#else
+ (void)nfa;
+ (void)f;
#endif
}
@@ -3157,6 +3160,9 @@ dumpcnfa(
dumpcstate(st, cnfa, f);
}
fflush(f);
+#else
+ (void)cnfa;
+ (void)f;
#endif
}
diff --git a/generic/regcomp.c b/generic/regcomp.c
index 49b024f..e8c4721 100644
--- a/generic/regcomp.c
+++ b/generic/regcomp.c
@@ -59,7 +59,6 @@ static void wordchrs(struct vars *);
static struct subre *subre(struct vars *, int, int, struct state *, struct state *);
static void freesubre(struct vars *, struct subre *);
static void freesrnode(struct vars *, struct subre *);
-static void optst(struct vars *, struct subre *);
static int numst(struct subre *, int);
static void markst(struct subre *);
static void cleanst(struct vars *);
@@ -394,7 +393,6 @@ compile(
dumpnfa(v->nfa, debug);
dumpst(v->tree, debug, 1);
}
- optst(v, v->tree);
v->ntree = numst(v->tree, 1);
markst(v->tree);
cleanst(v);
@@ -512,7 +510,7 @@ freev(
struct vars *v,
int err)
{
- register int ret;
+ int ret;
if (v->re != NULL) {
rfree(v->re);
@@ -922,7 +920,7 @@ parseqatom(
*/
NOTE(REG_UPBOTCH);
- /* fallthrough into case PLAIN */
+ /* FALLTHRU */
case PLAIN:
onechr(v, v->nextvalue, lp, rp);
okcolors(v->nfa, v->cm);
@@ -1811,25 +1809,6 @@ freesrnode(
}
/*
- - optst - optimize a subRE subtree
- ^ static void optst(struct vars *, struct subre *);
- */
-static void
-optst(
- struct vars *v,
- struct subre *t)
-{
- /*
- * DGP (2007-11-13): I assume it was the programmer's intent to eventually
- * come back and add code to optimize subRE trees, but the routine coded
- * just spends effort traversing the tree and doing nothing. We can do
- * nothing with less effort.
- */
-
- return;
-}
-
-/*
- numst - number tree nodes (assigning "id" indexes)
^ static int numst(struct subre *, int);
*/
@@ -2100,6 +2079,9 @@ dump(
}
fprintf(f, "\n");
dumpst(g->tree, f, 0);
+#else
+ (void)re;
+ (void)f;
#endif
}
diff --git a/generic/regerror.c b/generic/regerror.c
index 49d93ed..f783217 100644
--- a/generic/regerror.c
+++ b/generic/regerror.c
@@ -58,7 +58,6 @@ static const struct rerr {
size_t /* Actual space needed (including NUL) */
regerror(
int code, /* Error code, or REG_ATOI or REG_ITOA */
- const regex_t *preg, /* Associated regex_t (unused at present) */
char *errbuf, /* Result buffer (unless errbuf_size==0) */
size_t errbuf_size) /* Available space in errbuf, can be 0 */
{
diff --git a/generic/regex.h b/generic/regex.h
index f3159c6..dba3ab4 100644
--- a/generic/regex.h
+++ b/generic/regex.h
@@ -232,7 +232,7 @@ typedef struct {
* of character is used for error reports is independent of what kind is used
* in matching.
*
- ^ extern size_t regerror(int, const regex_t *, char *, size_t);
+ ^ extern size_t regerror(int, char *, size_t);
*/
#define REG_OKAY 0 /* no errors detected */
#define REG_NOMATCH 1 /* failed to match */
@@ -283,7 +283,7 @@ int regexec(regex_t *, const char *, size_t, regmatch_t [], int);
MODULE_SCOPE int __REG_WIDE_EXEC(regex_t *, const __REG_WIDE_T *, size_t, rm_detail_t *, size_t, regmatch_t [], int);
#endif
MODULE_SCOPE void regfree(regex_t *);
-MODULE_SCOPE size_t regerror(int, const regex_t *, char *, size_t);
+MODULE_SCOPE size_t regerror(int, char *, size_t);
/* automatically gathered by fwd; do not hand-edit */
/* =====^!^===== end forwards =====^!^===== */
diff --git a/generic/regexec.c b/generic/regexec.c
index 1a3e114..b5f161b 100644
--- a/generic/regexec.c
+++ b/generic/regexec.c
@@ -91,7 +91,6 @@ struct smalldfa {
struct sset *outsarea[FEWSTATES*2 * FEWCOLORS];
struct arcp incarea[FEWSTATES*2 * FEWCOLORS];
};
-#define DOMALLOC ((struct smalldfa *)NULL) /* force malloc */
/*
* Internal variables, bundled for easy passing around.
@@ -129,7 +128,7 @@ int exec(regex_t *, const chr *, size_t, rm_detail_t *, size_t, regmatch_t [], i
static struct dfa *getsubdfa(struct vars *, struct subre *);
static int simpleFind(struct vars *const, struct cnfa *const, struct colormap *const);
static int complicatedFind(struct vars *const, struct cnfa *const, struct colormap *const);
-static int complicatedFindLoop(struct vars *const, struct cnfa *const, struct colormap *const, struct dfa *const, struct dfa *const, chr **const);
+static int complicatedFindLoop(struct vars *const, struct dfa *const, struct dfa *const, chr **const);
static void zapallsubs(regmatch_t *const, const size_t);
static void zaptreesubs(struct vars *const, struct subre *const);
static void subset(struct vars *const, struct subre *const, chr *const, chr *const);
@@ -299,7 +298,7 @@ getsubdfa(struct vars * v,
struct subre * t)
{
if (v->subdfas[t->id] == NULL) {
- v->subdfas[t->id] = newDFA(v, &t->cnfa, &v->g->cmap, DOMALLOC);
+ v->subdfas[t->id] = newDFA(v, &t->cnfa, &v->g->cmap, NULL);
if (ISERR())
return NULL;
}
@@ -434,7 +433,7 @@ complicatedFind(
return v->err;
}
- ret = complicatedFindLoop(v, cnfa, cm, d, s, &cold);
+ ret = complicatedFindLoop(v, d, s, &cold);
freeDFA(d);
freeDFA(s);
@@ -453,14 +452,12 @@ complicatedFind(
/*
- complicatedFindLoop - the heart of complicatedFind
- ^ static int complicatedFindLoop(struct vars *, struct cnfa *, struct colormap *,
+ ^ static int complicatedFindLoop(struct vars *,
^ struct dfa *, struct dfa *, chr **);
*/
static int
complicatedFindLoop(
struct vars *const v,
- struct cnfa *const cnfa,
- struct colormap *const cm,
struct dfa *const d,
struct dfa *const s,
chr **const coldp) /* where to put coldstart pointer */
diff --git a/generic/tcl.decls b/generic/tcl.decls
index 68efba2..7beab70 100644
--- a/generic/tcl.decls
+++ b/generic/tcl.decls
@@ -2481,6 +2481,9 @@ export {
export {
void Tcl_GetMemoryInfo(Tcl_DString *dsPtr)
}
+export {
+ void Tcl_InitSubsystems(void)
+}
# Local Variables:
# mode: tcl
diff --git a/generic/tcl.h b/generic/tcl.h
index 1c3115d..7832419 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) || defined(__MINGW_USE_VC2005_COMPAT) || defined(_USE_64BIT_TIME_T)
+# elif defined(_WIN64) || 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;
@@ -2399,6 +2399,7 @@ EXTERN void Tcl_MainEx(int argc, char **argv,
Tcl_AppInitProc *appInitProc, Tcl_Interp *interp);
EXTERN const char * Tcl_PkgInitStubsCheck(Tcl_Interp *interp,
const char *version, int exact);
+EXTERN void Tcl_InitSubsystems(void);
EXTERN void Tcl_GetMemoryInfo(Tcl_DString *dsPtr);
#ifndef _WIN32
EXTERN int TclZipfs_AppHook(int *argc, char ***argv);
diff --git a/generic/tclAlloc.c b/generic/tclAlloc.c
index c02c7e4..0c0ab7b 100644
--- a/generic/tclAlloc.c
+++ b/generic/tclAlloc.c
@@ -253,9 +253,9 @@ char *
TclpAlloc(
unsigned int numBytes) /* Number of bytes to allocate. */
{
- register union overhead *overPtr;
- register size_t bucket;
- register unsigned amount;
+ union overhead *overPtr;
+ size_t bucket;
+ unsigned amount;
struct block *bigBlockPtr = NULL;
if (!allocInit) {
@@ -387,8 +387,8 @@ static void
MoreCore(
size_t bucket) /* What bucket to allocate to. */
{
- register union overhead *overPtr;
- register size_t size; /* size of desired block */
+ union overhead *overPtr;
+ size_t size; /* size of desired block */
size_t amount; /* amount to allocate */
size_t numBlocks; /* how many blocks we get */
struct block *blockPtr;
@@ -448,8 +448,8 @@ void
TclpFree(
char *oldPtr) /* Pointer to memory to free. */
{
- register size_t size;
- register union overhead *overPtr;
+ size_t size;
+ union overhead *overPtr;
struct block *bigBlockPtr;
if (oldPtr == NULL) {
@@ -645,8 +645,8 @@ void
mstats(
char *s) /* Where to write info. */
{
- register unsigned int i, j;
- register union overhead *overPtr;
+ unsigned int i, j;
+ union overhead *overPtr;
size_t totalFree = 0, totalUsed = 0;
Tcl_MutexLock(allocMutexPtr);
diff --git a/generic/tclAssembly.c b/generic/tclAssembly.c
index e8ca9ca..881d99a 100644
--- a/generic/tclAssembly.c
+++ b/generic/tclAssembly.c
@@ -287,8 +287,7 @@ static int GetIntegerOperand(AssemblyEnv*, Tcl_Token**, int*);
static int GetNextOperand(AssemblyEnv*, Tcl_Token**, Tcl_Obj**);
static void LookForFreshCatches(BasicBlock*, BasicBlock**);
static void MoveCodeForJumps(AssemblyEnv*, int);
-static void MoveExceptionRangesToBasicBlock(AssemblyEnv*, int,
- int);
+static void MoveExceptionRangesToBasicBlock(AssemblyEnv*, int);
static AssemblyEnv* NewAssemblyEnv(CompileEnv*, int);
static int ProcessCatches(AssemblyEnv*);
static int ProcessCatchesInBasicBlock(AssemblyEnv*, BasicBlock*,
@@ -797,6 +796,7 @@ TclNRAssembleObjCmd(
Tcl_Obj* backtrace; /* Object where extra error information is
* constructed. */
+ (void)dummy;
if (objc != 2) {
Tcl_WrongNumArgs(interp, 1, objv, "bytecodeList");
return TCL_ERROR;
@@ -853,7 +853,7 @@ CompileAssembleObj(
Interp *iPtr = (Interp *) interp;
/* Internals of the interpreter */
CompileEnv compEnv; /* Compilation environment structure */
- register ByteCode *codePtr = NULL;
+ ByteCode *codePtr = NULL;
/* Bytecode resulting from the assembly */
Namespace* namespacePtr; /* Namespace in which variable and command
* names in the bytecode resolve */
@@ -970,7 +970,7 @@ TclCompileAssembleCmd(
int numCommands = envPtr->numCommands;
int offset = envPtr->codeNext - envPtr->codeStart;
int depth = envPtr->currStackDepth;
-
+ (void)cmdPtr;
/*
* Make sure that the command has a single arg that is a simple word.
*/
@@ -1820,7 +1820,6 @@ CompileEmbeddedScript(
int savedStackDepth = envPtr->currStackDepth;
int savedMaxStackDepth = envPtr->maxStackDepth;
- int savedCodeIndex = envPtr->codeNext - envPtr->codeStart;
int savedExceptArrayNext = envPtr->exceptArrayNext;
envPtr->currStackDepth = 0;
@@ -1853,8 +1852,7 @@ CompileEmbeddedScript(
* need to be fixed up once the stack depth is known.
*/
- MoveExceptionRangesToBasicBlock(assemEnvPtr, savedCodeIndex,
- savedExceptArrayNext);
+ MoveExceptionRangesToBasicBlock(assemEnvPtr, savedExceptArrayNext);
/*
* Flush the current basic block.
@@ -1913,7 +1911,6 @@ SyncStackDepth(
static void
MoveExceptionRangesToBasicBlock(
AssemblyEnv* assemEnvPtr, /* Assembly environment */
- int savedCodeIndex, /* Start of the embedded code */
int savedExceptArrayNext) /* Saved index of the end of the exception
* range array */
{
@@ -4322,6 +4319,8 @@ DupAssembleCodeInternalRep(
Tcl_Obj *srcPtr,
Tcl_Obj *copyPtr)
{
+ (void)srcPtr;
+ (void)copyPtr;
return;
}
diff --git a/generic/tclBasic.c b/generic/tclBasic.c
index f3a75bb..967ec73 100644
--- a/generic/tclBasic.c
+++ b/generic/tclBasic.c
@@ -645,7 +645,7 @@ Tcl_CreateInterp(void)
char mathFuncName[32];
CallFrame *framePtr;
- TclInitSubsystems();
+ Tcl_InitSubsystems();
/*
* Panic if someone updated the CallFrame structure without also updating
@@ -657,19 +657,13 @@ Tcl_CreateInterp(void)
Tcl_Panic("Tcl_CallFrame must not be smaller than CallFrame");
}
-#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
+#if defined(_WIN32) && !defined(_WIN64) && !defined(_USE_64BIT_TIME_T)
+ /* If Tcl is compiled on Win32 using -D_USE_64BIT_TIME_T
+ * the result is a binary incompatible with the 'standard' build of
+ * Tcl: All extensions using Tcl_StatBuf 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");
- }
if ((offsetof(Tcl_StatBuf,st_atime) != 32)
|| (offsetof(Tcl_StatBuf,st_ctime) != 40)) {
/*NOTREACHED*/
@@ -1305,8 +1299,8 @@ int
TclHideUnsafeCommands(
Tcl_Interp *interp) /* Hide commands in this interpreter. */
{
- register const CmdInfo *cmdInfoPtr;
- register const UnsafeEnsembleInfo *unsafePtr;
+ const CmdInfo *cmdInfoPtr;
+ const UnsafeEnsembleInfo *unsafePtr;
if (interp == NULL) {
return TCL_ERROR;
@@ -2832,7 +2826,7 @@ int
TclInvokeStringCommand(
ClientData clientData, /* Points to command's Command structure. */
Tcl_Interp *interp, /* Current interpreter. */
- register int objc, /* Number of arguments. */
+ int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
{
Command *cmdPtr = clientData;
@@ -2881,7 +2875,7 @@ TclInvokeObjectCommand(
ClientData clientData, /* Points to command's Command structure. */
Tcl_Interp *interp, /* Current interpreter. */
int argc, /* Number of arguments. */
- register const char **argv) /* Argument strings. */
+ const char **argv) /* Argument strings. */
{
Command *cmdPtr = clientData;
Tcl_Obj *objPtr;
@@ -3372,7 +3366,7 @@ Tcl_GetCommandFullName(
{
Interp *iPtr = (Interp *) interp;
- register Command *cmdPtr = (Command *) command;
+ Command *cmdPtr = (Command *) command;
char *name;
/*
@@ -3656,7 +3650,7 @@ CallCommandTraces(
* trigger, either TCL_TRACE_DELETE or
* TCL_TRACE_RENAME. */
{
- register CommandTrace *tracePtr;
+ CommandTrace *tracePtr;
ActiveCommandTrace active;
char *result;
Tcl_Obj *oldNamePtr = NULL;
@@ -3846,7 +3840,7 @@ CancelEvalProc(
void
TclCleanupCommand(
- register Command *cmdPtr) /* Points to the Command structure to
+ Command *cmdPtr) /* Points to the Command structure to
* be freed. */
{
if (cmdPtr->refCount-- <= 1) {
@@ -4237,7 +4231,7 @@ int
TclInterpReady(
Tcl_Interp *interp)
{
- register Interp *iPtr = (Interp *) interp;
+ Interp *iPtr = (Interp *) interp;
/*
* Reset both the interpreter's string and object results and clear out
@@ -4309,7 +4303,7 @@ TclResetCancellation(
Tcl_Interp *interp,
int force)
{
- register Interp *iPtr = (Interp *) interp;
+ Interp *iPtr = (Interp *) interp;
if (iPtr == NULL) {
return TCL_ERROR;
@@ -4351,7 +4345,7 @@ Tcl_Canceled(
Tcl_Interp *interp,
int flags)
{
- register Interp *iPtr = (Interp *) interp;
+ Interp *iPtr = (Interp *) interp;
/*
* Has the current script in progress for this interpreter been canceled
@@ -5872,7 +5866,7 @@ TclAdvanceLines(
const char *start,
const char *end)
{
- register const char *p;
+ const char *p;
for (p = start; p < end; p++) {
if (*p == '\n') {
@@ -6398,7 +6392,7 @@ int
Tcl_EvalObjEx(
Tcl_Interp *interp, /* Token for command interpreter (returned by
* a previous call to Tcl_CreateInterp). */
- register Tcl_Obj *objPtr, /* Pointer to object containing commands to
+ Tcl_Obj *objPtr, /* Pointer to object containing commands to
* execute. */
int flags) /* Collection of OR-ed bits that control the
* evaluation of the script. Supported values
@@ -6411,7 +6405,7 @@ int
TclEvalObjEx(
Tcl_Interp *interp, /* Token for command interpreter (returned by
* a previous call to Tcl_CreateInterp). */
- register Tcl_Obj *objPtr, /* Pointer to object containing commands to
+ Tcl_Obj *objPtr, /* Pointer to object containing commands to
* execute. */
int flags, /* Collection of OR-ed bits that control the
* evaluation of the script. Supported values
@@ -6430,7 +6424,7 @@ int
TclNREvalObjEx(
Tcl_Interp *interp, /* Token for command interpreter (returned by
* a previous call to Tcl_CreateInterp). */
- register Tcl_Obj *objPtr, /* Pointer to object containing commands to
+ Tcl_Obj *objPtr, /* Pointer to object containing commands to
* execute. */
int flags, /* Collection of OR-ed bits that control the
* evaluation of the script. Supported values
@@ -6738,7 +6732,7 @@ Tcl_ExprLong(
const char *exprstring, /* Expression to evaluate. */
long *ptr) /* Where to store result. */
{
- register Tcl_Obj *exprPtr;
+ Tcl_Obj *exprPtr;
int result = TCL_OK;
if (*exprstring == '\0') {
/*
@@ -6765,7 +6759,7 @@ Tcl_ExprDouble(
const char *exprstring, /* Expression to evaluate. */
double *ptr) /* Where to store result. */
{
- register Tcl_Obj *exprPtr;
+ Tcl_Obj *exprPtr;
int result = TCL_OK;
if (*exprstring == '\0') {
@@ -6845,7 +6839,7 @@ int
Tcl_ExprLongObj(
Tcl_Interp *interp, /* Context in which to evaluate the
* expression. */
- register Tcl_Obj *objPtr, /* Expression to evaluate. */
+ Tcl_Obj *objPtr, /* Expression to evaluate. */
long *ptr) /* Where to store long result. */
{
Tcl_Obj *resultPtr;
@@ -6872,8 +6866,8 @@ Tcl_ExprLongObj(
return TCL_ERROR;
}
resultPtr = Tcl_NewBignumObj(&big);
- /* FALLTHROUGH */
}
+ /* FALLTHRU */
case TCL_NUMBER_INT:
case TCL_NUMBER_BIG:
result = TclGetLongFromObj(interp, resultPtr, ptr);
@@ -6892,7 +6886,7 @@ int
Tcl_ExprDoubleObj(
Tcl_Interp *interp, /* Context in which to evaluate the
* expression. */
- register Tcl_Obj *objPtr, /* Expression to evaluate. */
+ Tcl_Obj *objPtr, /* Expression to evaluate. */
double *ptr) /* Where to store double result. */
{
Tcl_Obj *resultPtr;
@@ -6928,7 +6922,7 @@ int
Tcl_ExprBooleanObj(
Tcl_Interp *interp, /* Context in which to evaluate the
* expression. */
- register Tcl_Obj *objPtr, /* Expression to evaluate. */
+ Tcl_Obj *objPtr, /* Expression to evaluate. */
int *ptr) /* Where to store 0/1 result. */
{
Tcl_Obj *resultPtr;
@@ -7040,7 +7034,7 @@ TclNRInvoke(
int objc,
Tcl_Obj *const objv[])
{
- register Interp *iPtr = (Interp *) interp;
+ Interp *iPtr = (Interp *) interp;
Tcl_HashTable *hTblPtr; /* Table of hidden commands. */
const char *cmdName; /* Name of the command from objv[0]. */
Tcl_HashEntry *hPtr = NULL;
@@ -7235,7 +7229,7 @@ Tcl_AddObjErrorInfo(
int length) /* The number of bytes in the message. If < 0,
* then append all bytes up to a NULL byte. */
{
- register Interp *iPtr = (Interp *) interp;
+ Interp *iPtr = (Interp *) interp;
/*
* If we are just starting to log an error, errorInfo is initialized from
@@ -7385,7 +7379,7 @@ Tcl_GlobalEval(
* command. */
const char *command) /* Command to evaluate. */
{
- register Interp *iPtr = (Interp *) interp;
+ Interp *iPtr = (Interp *) interp;
int result;
CallFrame *savedVarFramePtr;
diff --git a/generic/tclBinary.c b/generic/tclBinary.c
index d8b9ae9..027c157 100644
--- a/generic/tclBinary.c
+++ b/generic/tclBinary.c
@@ -2288,8 +2288,8 @@ ScanNumber(
if (*numberCachePtrPtr == NULL) {
return Tcl_NewWideIntObj(value);
} else {
- register Tcl_HashTable *tablePtr = *numberCachePtrPtr;
- register Tcl_HashEntry *hPtr;
+ Tcl_HashTable *tablePtr = *numberCachePtrPtr;
+ Tcl_HashEntry *hPtr;
int isNew;
hPtr = Tcl_CreateHashEntry(tablePtr, INT2PTR(value), &isNew);
@@ -2297,7 +2297,7 @@ ScanNumber(
return Tcl_GetHashValue(hPtr);
}
if (tablePtr->numEntries <= BINARY_SCAN_MAX_CACHE) {
- register Tcl_Obj *objPtr = Tcl_NewWideIntObj(value);
+ Tcl_Obj *objPtr = Tcl_NewWideIntObj(value);
Tcl_IncrRefCount(objPtr);
Tcl_SetHashValue(hPtr, objPtr);
@@ -2416,7 +2416,7 @@ DeleteScanNumberCache(
hEntry = Tcl_FirstHashEntry(numberCachePtr, &search);
while (hEntry != NULL) {
- register Tcl_Obj *value = Tcl_GetHashValue(hEntry);
+ Tcl_Obj *value = Tcl_GetHashValue(hEntry);
if (value != NULL) {
Tcl_DecrRefCount(value);
diff --git a/generic/tclCkalloc.c b/generic/tclCkalloc.c
index d60633b..8746241 100644
--- a/generic/tclCkalloc.c
+++ b/generic/tclCkalloc.c
@@ -131,10 +131,12 @@ static int ckallocInit = 0;
* Prototypes for procedures defined in this file:
*/
-static int CheckmemCmd(ClientData clientData, Tcl_Interp *interp,
- int argc, const char *argv[]);
-static int MemoryCmd(ClientData clientData, Tcl_Interp *interp,
- int argc, const char *argv[]);
+static int CheckmemCmd(ClientData clientData,
+ Tcl_Interp *interp, int objc,
+ Tcl_Obj *const objv[]);
+static int MemoryCmd(ClientData clientData,
+ Tcl_Interp *interp, int objc,
+ Tcl_Obj *const objv[]);
static void ValidateMemory(struct mem_header *memHeaderP,
const char *file, int line, int nukeGuards);
@@ -145,7 +147,7 @@ static void ValidateMemory(struct mem_header *memHeaderP,
*
* Initialize the locks used by the allocator. This is only appropriate
* to call in a single threaded environment, such as during
- * TclInitSubsystems.
+ * Tcl_InitSubsystems.
*
*----------------------------------------------------------------------
*/
@@ -811,8 +813,8 @@ static int
MemoryCmd(
ClientData clientData,
Tcl_Interp *interp,
- int argc,
- const char *argv[])
+ int objc, /* Number of arguments. */
+ Tcl_Obj *const objv[]) /* Obj values of arguments. */
{
const char *fileName;
FILE *fileP;
@@ -820,20 +822,17 @@ MemoryCmd(
int result;
size_t len;
- if (argc < 2) {
- Tcl_SetObjResult(interp, Tcl_ObjPrintf(
- "wrong # args: should be \"%s option [args..]\"", argv[0]));
+ if (objc < 2) {
+ Tcl_WrongNumArgs(interp, 1, objv, "option [args..]");
return TCL_ERROR;
}
- if (strcmp(argv[1], "active") == 0 || strcmp(argv[1], "display") == 0) {
- if (argc != 3) {
- Tcl_SetObjResult(interp, Tcl_ObjPrintf(
- "wrong # args: should be \"%s %s file\"",
- argv[0], argv[1]));
+ if (strcmp(TclGetString(objv[1]), "active") == 0 || strcmp(TclGetString(objv[1]), "display") == 0) {
+ if (objc != 3) {
+ Tcl_WrongNumArgs(interp, 2, objv, "file");
return TCL_ERROR;
}
- fileName = Tcl_TranslateFileName(interp, argv[2], &buffer);
+ fileName = Tcl_TranslateFileName(interp, TclGetString(objv[2]), &buffer);
if (fileName == NULL) {
return TCL_ERROR;
}
@@ -841,23 +840,23 @@ MemoryCmd(
Tcl_DStringFree(&buffer);
if (result != TCL_OK) {
Tcl_SetObjResult(interp, Tcl_ObjPrintf("error accessing %s: %s",
- argv[2], Tcl_PosixError(interp)));
+ TclGetString(objv[2]), Tcl_PosixError(interp)));
return TCL_ERROR;
}
return TCL_OK;
}
- if (strcmp(argv[1],"break_on_malloc") == 0) {
+ if (strcmp(TclGetString(objv[1]),"break_on_malloc") == 0) {
int value;
- if (argc != 3) {
+ if (objc != 3) {
goto argError;
}
- if (Tcl_GetInt(interp, argv[2], &value) != TCL_OK) {
+ if (Tcl_GetIntFromObj(interp, objv[2], &value) != TCL_OK) {
return TCL_ERROR;
}
break_on_malloc = (unsigned int) value;
return TCL_OK;
}
- if (strcmp(argv[1],"info") == 0) {
+ if (strcmp(TclGetString(objv[1]),"info") == 0) {
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"%-25s %10u\n%-25s %10u\n%-25s %10u\n%-25s %10" TCL_Z_MODIFIER"u\n%-25s %10u\n%-25s %10" TCL_Z_MODIFIER "u\n",
"total mallocs", total_mallocs, "total frees", total_frees,
@@ -867,20 +866,19 @@ MemoryCmd(
"maximum bytes allocated", maximum_bytes_malloced));
return TCL_OK;
}
- if (strcmp(argv[1], "init") == 0) {
- if (argc != 3) {
+ if (strcmp(TclGetString(objv[1]), "init") == 0) {
+ if (objc != 3) {
goto bad_suboption;
}
- init_malloced_bodies = (strcmp(argv[2],"on") == 0);
+ init_malloced_bodies = (strcmp(TclGetString(objv[2]),"on") == 0);
return TCL_OK;
}
- if (strcmp(argv[1], "objs") == 0) {
- if (argc != 3) {
- Tcl_SetObjResult(interp, Tcl_ObjPrintf(
- "wrong # args: should be \"%s objs file\"", argv[0]));
+ if (strcmp(TclGetString(objv[1]), "objs") == 0) {
+ if (objc != 3) {
+ Tcl_WrongNumArgs(interp, 2, objv, "file");
return TCL_ERROR;
}
- fileName = Tcl_TranslateFileName(interp, argv[2], &buffer);
+ fileName = Tcl_TranslateFileName(interp, TclGetString(objv[2]), &buffer);
if (fileName == NULL) {
return TCL_ERROR;
}
@@ -896,13 +894,12 @@ MemoryCmd(
Tcl_DStringFree(&buffer);
return TCL_OK;
}
- if (strcmp(argv[1],"onexit") == 0) {
- if (argc != 3) {
- Tcl_SetObjResult(interp, Tcl_ObjPrintf(
- "wrong # args: should be \"%s onexit file\"", argv[0]));
+ if (strcmp(TclGetString(objv[1]),"onexit") == 0) {
+ if (objc != 3) {
+ Tcl_WrongNumArgs(interp, 2, objv, "file");
return TCL_ERROR;
}
- fileName = Tcl_TranslateFileName(interp, argv[2], &buffer);
+ fileName = Tcl_TranslateFileName(interp, TclGetString(objv[2]), &buffer);
if (fileName == NULL) {
return TCL_ERROR;
}
@@ -911,62 +908,59 @@ MemoryCmd(
Tcl_DStringFree(&buffer);
return TCL_OK;
}
- if (strcmp(argv[1],"tag") == 0) {
- if (argc != 3) {
- Tcl_SetObjResult(interp, Tcl_ObjPrintf(
- "wrong # args: should be \"%s tag string\"", argv[0]));
+ if (strcmp(TclGetString(objv[1]),"tag") == 0) {
+ if (objc != 3) {
+ Tcl_WrongNumArgs(interp, 2, objv, "file");
return TCL_ERROR;
}
if ((curTagPtr != NULL) && (curTagPtr->refCount == 0)) {
TclpFree((char *) curTagPtr);
}
- len = strlen(argv[2]);
+ len = strlen(TclGetString(objv[2]));
curTagPtr = (MemTag *) TclpAlloc(TAG_SIZE(len));
curTagPtr->refCount = 0;
- memcpy(curTagPtr->string, argv[2], len + 1);
+ memcpy(curTagPtr->string, TclGetString(objv[2]), len + 1);
return TCL_OK;
}
- if (strcmp(argv[1],"trace") == 0) {
- if (argc != 3) {
+ if (strcmp(TclGetString(objv[1]),"trace") == 0) {
+ if (objc != 3) {
goto bad_suboption;
}
- alloc_tracing = (strcmp(argv[2],"on") == 0);
+ alloc_tracing = (strcmp(TclGetString(objv[2]),"on") == 0);
return TCL_OK;
}
- if (strcmp(argv[1],"trace_on_at_malloc") == 0) {
+ if (strcmp(TclGetString(objv[1]),"trace_on_at_malloc") == 0) {
int value;
- if (argc != 3) {
+ if (objc != 3) {
goto argError;
}
- if (Tcl_GetInt(interp, argv[2], &value) != TCL_OK) {
+ if (Tcl_GetIntFromObj(interp, objv[2], &value) != TCL_OK) {
return TCL_ERROR;
}
trace_on_at_malloc = value;
return TCL_OK;
}
- if (strcmp(argv[1],"validate") == 0) {
- if (argc != 3) {
+ if (strcmp(TclGetString(objv[1]),"validate") == 0) {
+ if (objc != 3) {
goto bad_suboption;
}
- validate_memory = (strcmp(argv[2],"on") == 0);
+ validate_memory = (strcmp(TclGetString(objv[2]),"on") == 0);
return TCL_OK;
}
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"bad option \"%s\": should be active, break_on_malloc, info, "
"init, objs, onexit, tag, trace, trace_on_at_malloc, or validate",
- argv[1]));
+ TclGetString(objv[1])));
return TCL_ERROR;
argError:
- Tcl_SetObjResult(interp, Tcl_ObjPrintf(
- "wrong # args: should be \"%s %s count\"", argv[0], argv[1]));
+ Tcl_WrongNumArgs(interp, 2, objv, "count");
return TCL_ERROR;
bad_suboption:
- Tcl_SetObjResult(interp, Tcl_ObjPrintf(
- "wrong # args: should be \"%s %s on|off\"", argv[0], argv[1]));
+ Tcl_WrongNumArgs(interp, 2, objv, "on|off");
return TCL_ERROR;
}
@@ -987,21 +981,23 @@ MemoryCmd(
*
*----------------------------------------------------------------------
*/
+static int CheckmemCmd(ClientData clientData,
+ Tcl_Interp *interp, int objc,
+ Tcl_Obj *const objv[]);
static int
CheckmemCmd(
ClientData clientData, /* Not used. */
Tcl_Interp *interp, /* Interpreter for evaluation. */
- int argc, /* Number of arguments. */
- const char *argv[]) /* String values of arguments. */
+ int objc, /* Number of arguments. */
+ Tcl_Obj *const objv[]) /* Obj values of arguments. */
{
- if (argc != 2) {
- Tcl_SetObjResult(interp, Tcl_ObjPrintf(
- "wrong # args: should be \"%s fileName\"", argv[0]));
+ if (objc != 2) {
+ Tcl_WrongNumArgs(interp, 1, objv, "fileName");
return TCL_ERROR;
}
tclMemDumpFileName = dumpFile;
- strcpy(tclMemDumpFileName, argv[1]);
+ strcpy(tclMemDumpFileName, TclGetString(objv[1]));
return TCL_OK;
}
@@ -1027,8 +1023,8 @@ Tcl_InitMemory(
* added */
{
TclInitDbCkalloc();
- Tcl_CreateCommand(interp, "memory", MemoryCmd, NULL, NULL);
- Tcl_CreateCommand(interp, "checkmem", CheckmemCmd, NULL, NULL);
+ Tcl_CreateObjCommand(interp, "memory", MemoryCmd, NULL, NULL);
+ Tcl_CreateObjCommand(interp, "checkmem", CheckmemCmd, NULL, NULL);
}
@@ -1121,6 +1117,8 @@ Tcl_AttemptDbCkalloc(
int line)
{
char *result;
+ (void)file;
+ (void)line;
result = (char *) TclpAlloc(size);
return result;
@@ -1200,6 +1198,8 @@ Tcl_AttemptDbCkrealloc(
int line)
{
char *result;
+ (void)file;
+ (void)line;
result = (char *) TclpRealloc(ptr, size);
return result;
@@ -1230,6 +1230,8 @@ Tcl_DbCkfree(
const char *file,
int line)
{
+ (void)file;
+ (void)line;
TclpFree(ptr);
}
@@ -1248,12 +1250,14 @@ void
Tcl_InitMemory(
Tcl_Interp *interp)
{
+ (void)interp;
}
int
Tcl_DumpActiveMemory(
const char *fileName)
{
+ (void)fileName;
return TCL_OK;
}
@@ -1262,6 +1266,8 @@ Tcl_ValidateAllMemory(
const char *file,
int line)
{
+ (void)file;
+ (void)line;
}
int
@@ -1269,6 +1275,8 @@ TclDumpMemoryInfo(
ClientData clientData,
int flags)
{
+ (void)clientData;
+ (void)flags;
return 1;
}
diff --git a/generic/tclClock.c b/generic/tclClock.c
index aeff164..2803d45 100644
--- a/generic/tclClock.c
+++ b/generic/tclClock.c
@@ -1652,6 +1652,7 @@ ClockGetenvObjCmd(
{
const char *varName;
const char *varValue;
+ (void)clientData;
if (objc != 2) {
Tcl_WrongNumArgs(interp, 1, objv, "name");
@@ -1744,6 +1745,7 @@ ClockClicksObjCmd(
int index = CLICKS_NATIVE;
Tcl_Time now;
Tcl_WideInt clicks = 0;
+ (void)clientData;
switch (objc) {
case 1:
@@ -1806,6 +1808,7 @@ ClockMillisecondsObjCmd(
Tcl_Obj *const *objv) /* Parameter values */
{
Tcl_Time now;
+ (void)clientData;
if (objc != 1) {
Tcl_WrongNumArgs(interp, 1, objv, NULL);
@@ -1842,6 +1845,7 @@ ClockMicrosecondsObjCmd(
int objc, /* Parameter count */
Tcl_Obj *const *objv) /* Parameter values */
{
+ (void)clientData;
if (objc != 1) {
Tcl_WrongNumArgs(interp, 1, objv, NULL);
return TCL_ERROR;
@@ -1994,6 +1998,7 @@ ClockSecondsObjCmd(
Tcl_Obj *const *objv) /* Parameter values */
{
Tcl_Time now;
+ (void)clientData;
if (objc != 1) {
Tcl_WrongNumArgs(interp, 1, objv, NULL);
diff --git a/generic/tclCmdAH.c b/generic/tclCmdAH.c
index c7ec4f9..c895817 100644
--- a/generic/tclCmdAH.c
+++ b/generic/tclCmdAH.c
@@ -168,7 +168,7 @@ Tcl_CaseObjCmd(
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
{
- register int i;
+ int i;
int body, result, caseObjc;
const char *stringPtr, *arg;
Tcl_Obj *const *caseObjv;
@@ -871,7 +871,7 @@ TclNREvalObjCmd(
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
{
- register Tcl_Obj *objPtr;
+ Tcl_Obj *objPtr;
Interp *iPtr = (Interp *) interp;
CmdFrame *invoker = NULL;
int word = 0;
@@ -2253,7 +2253,7 @@ StoreStatData(
* store in varName. */
{
Tcl_Obj *field, *value;
- register unsigned short mode;
+ unsigned short mode;
/*
* Assume Tcl_ObjSetVar2() does not keep a copy of the field name!
@@ -2630,7 +2630,7 @@ EachloopCmd(
Tcl_Obj *const objv[])
{
int numLists = (objc-2) / 2;
- register struct ForeachState *statePtr;
+ struct ForeachState *statePtr;
int i, j, result;
if (objc < 4 || (objc%2 != 0)) {
@@ -2755,7 +2755,7 @@ ForeachLoopStep(
Tcl_Interp *interp,
int result)
{
- register struct ForeachState *statePtr = data[0];
+ struct ForeachState *statePtr = data[0];
/*
* Process the result code from this run of the [foreach] body. Note that
diff --git a/generic/tclCmdIL.c b/generic/tclCmdIL.c
index cbb40c6..9d4bbf3 100644
--- a/generic/tclCmdIL.c
+++ b/generic/tclCmdIL.c
@@ -475,7 +475,7 @@ InfoArgsCmd(
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
{
- register Interp *iPtr = (Interp *) interp;
+ Interp *iPtr = (Interp *) interp;
const char *name;
Proc *procPtr;
CompiledLocal *localPtr;
@@ -538,7 +538,7 @@ InfoBodyCmd(
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
{
- register Interp *iPtr = (Interp *) interp;
+ Interp *iPtr = (Interp *) interp;
const char *name, *bytes;
Proc *procPtr;
int numBytes;
@@ -643,7 +643,7 @@ InfoCommandsCmd(
{
const char *cmdName, *pattern;
const char *simplePattern;
- register Tcl_HashEntry *entryPtr;
+ Tcl_HashEntry *entryPtr;
Tcl_HashSearch search;
Namespace *nsPtr;
Namespace *globalNsPtr = (Namespace *) Tcl_GetGlobalNamespace(interp);
@@ -1843,7 +1843,7 @@ InfoProcsCmd(
Namespace *currNsPtr = (Namespace *) Tcl_GetCurrentNamespace(interp);
Tcl_Obj *listPtr, *elemObjPtr;
int specificNsInPattern = 0;/* Init. to avoid compiler warning. */
- register Tcl_HashEntry *entryPtr;
+ Tcl_HashEntry *entryPtr;
Tcl_HashSearch search;
Command *cmdPtr, *realCmdPtr;
@@ -2415,7 +2415,7 @@ int
Tcl_LinsertObjCmd(
ClientData dummy, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
- register int objc, /* Number of arguments. */
+ int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
{
Tcl_Obj *listPtr;
@@ -2497,8 +2497,8 @@ int
Tcl_ListObjCmd(
ClientData dummy, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
- register int objc, /* Number of arguments. */
- register Tcl_Obj *const objv[])
+ int objc, /* Number of arguments. */
+ Tcl_Obj *const objv[])
/* The argument objects. */
{
/*
@@ -2534,7 +2534,7 @@ Tcl_LlengthObjCmd(
ClientData dummy, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
- register Tcl_Obj *const objv[])
+ Tcl_Obj *const objv[])
/* Argument objects. */
{
int listLen, result;
@@ -2580,7 +2580,7 @@ Tcl_LpopObjCmd(
ClientData notUsed, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
- register Tcl_Obj *const objv[])
+ Tcl_Obj *const objv[])
/* Argument objects. */
{
int listLen, result;
@@ -2673,7 +2673,7 @@ Tcl_LrangeObjCmd(
ClientData notUsed, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
- register Tcl_Obj *const objv[])
+ Tcl_Obj *const objv[])
/* Argument objects. */
{
int listLen, first, last, result;
@@ -2859,8 +2859,8 @@ int
Tcl_LrepeatObjCmd(
ClientData dummy, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
- register int objc, /* Number of arguments. */
- register Tcl_Obj *const objv[])
+ int objc, /* Number of arguments. */
+ Tcl_Obj *const objv[])
/* The argument objects. */
{
int elementCount, i, totalElems;
@@ -2925,7 +2925,7 @@ Tcl_LrepeatObjCmd(
CLANG_ASSERT(dataArray || totalElems == 0 );
if (objc == 1) {
- register Tcl_Obj *tmpPtr = objv[0];
+ Tcl_Obj *tmpPtr = objv[0];
tmpPtr->refCount += elementCount;
for (i=0 ; i<elementCount ; i++) {
@@ -2971,7 +2971,7 @@ Tcl_LreplaceObjCmd(
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
{
- register Tcl_Obj *listPtr;
+ Tcl_Obj *listPtr;
int first, last, listLen, numToDelete, result;
if (objc < 4) {
diff --git a/generic/tclCmdMZ.c b/generic/tclCmdMZ.c
index 8706fb6..b5d5c89 100644
--- a/generic/tclCmdMZ.c
+++ b/generic/tclCmdMZ.c
@@ -1662,7 +1662,7 @@ StringIsCmd(
const char *elemStart, *nextElem;
int lenRemain, elemSize;
- register const char *p;
+ const char *p;
string1 = TclGetStringFromObj(objPtr, &length1);
end = string1 + length1;
@@ -1842,7 +1842,7 @@ StringIsCmd(
const char *elemStart, *nextElem;
int lenRemain, elemSize;
- register const char *p;
+ const char *p;
string1 = TclGetStringFromObj(objPtr, &length1);
end = string1 + length1;
@@ -4060,9 +4060,9 @@ Tcl_TimeObjCmd(
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
{
- register Tcl_Obj *objPtr;
+ Tcl_Obj *objPtr;
Tcl_Obj *objs[4];
- register int i, result;
+ int i, result;
int count;
double totalMicroSec;
#ifndef TCL_WIDE_CLICKS
@@ -4161,8 +4161,8 @@ Tcl_TimeRateObjCmd(
static double measureOverhead = 0;
/* global measure-overhead */
double overhead = -1; /* given measure-overhead */
- register Tcl_Obj *objPtr;
- register int result, i;
+ Tcl_Obj *objPtr;
+ int result, i;
Tcl_Obj *calibrate = NULL, *direct = NULL;
TclWideMUInt count = 0; /* Holds repetition count */
Tcl_WideInt maxms = WIDE_MIN;
@@ -4176,7 +4176,7 @@ Tcl_TimeRateObjCmd(
* zero (i.e., never < 1) */
unsigned short factor = 50; /* Factor (4..50) limiting threshold to avoid
* growth of execution time. */
- register Tcl_WideInt start, middle, stop;
+ Tcl_WideInt start, middle, stop;
#ifndef TCL_WIDE_CLICKS
Tcl_Time now;
#endif /* !TCL_WIDE_CLICKS */
@@ -4438,6 +4438,7 @@ Tcl_TimeRateObjCmd(
*/
threshold = 1;
maxcnt = 0;
+ /* FALLTHRU */
case TCL_CONTINUE:
result = TCL_OK;
break;
diff --git a/generic/tclCompCmds.c b/generic/tclCompCmds.c
index c015204..8c6050d 100644
--- a/generic/tclCompCmds.c
+++ b/generic/tclCompCmds.c
@@ -2912,9 +2912,9 @@ DupForeachInfo(
ClientData clientData) /* The foreach command's compilation auxiliary
* data to duplicate. */
{
- register ForeachInfo *srcPtr = clientData;
+ ForeachInfo *srcPtr = clientData;
ForeachInfo *dupPtr;
- register ForeachVarList *srcListPtr, *dupListPtr;
+ ForeachVarList *srcListPtr, *dupListPtr;
int numVars, i, j, numLists = srcPtr->numLists;
dupPtr = ckalloc(sizeof(ForeachInfo)
@@ -2961,10 +2961,10 @@ FreeForeachInfo(
ClientData clientData) /* The foreach command's compilation auxiliary
* data to free. */
{
- register ForeachInfo *infoPtr = clientData;
- register ForeachVarList *listPtr;
+ ForeachInfo *infoPtr = clientData;
+ ForeachVarList *listPtr;
int numLists = infoPtr->numLists;
- register int i;
+ int i;
for (i = 0; i < numLists; i++) {
listPtr = infoPtr->varLists[i];
@@ -2997,8 +2997,8 @@ PrintForeachInfo(
ByteCode *codePtr,
unsigned int pcOffset)
{
- register ForeachInfo *infoPtr = clientData;
- register ForeachVarList *varsPtr;
+ ForeachInfo *infoPtr = clientData;
+ ForeachVarList *varsPtr;
int i, j;
Tcl_AppendToObj(appendObj, "data=[", -1);
@@ -3037,8 +3037,8 @@ PrintNewForeachInfo(
ByteCode *codePtr,
unsigned int pcOffset)
{
- register ForeachInfo *infoPtr = clientData;
- register ForeachVarList *varsPtr;
+ ForeachInfo *infoPtr = clientData;
+ ForeachVarList *varsPtr;
int i, j;
Tcl_AppendPrintfToObj(appendObj, "jumpOffset=%+d, vars=",
@@ -3067,8 +3067,8 @@ DisassembleForeachInfo(
ByteCode *codePtr,
unsigned int pcOffset)
{
- register ForeachInfo *infoPtr = clientData;
- register ForeachVarList *varsPtr;
+ ForeachInfo *infoPtr = clientData;
+ ForeachVarList *varsPtr;
int i, j;
Tcl_Obj *objPtr, *innerPtr;
@@ -3114,8 +3114,8 @@ DisassembleNewForeachInfo(
ByteCode *codePtr,
unsigned int pcOffset)
{
- register ForeachInfo *infoPtr = clientData;
- register ForeachVarList *varsPtr;
+ ForeachInfo *infoPtr = clientData;
+ ForeachVarList *varsPtr;
int i, j;
Tcl_Obj *objPtr, *innerPtr;
@@ -3439,9 +3439,9 @@ TclPushVarName(
int *localIndexPtr, /* Must not be NULL. */
int *isScalarPtr) /* Must not be NULL. */
{
- register const char *p;
+ const char *p;
const char *last, *name, *elName;
- register int n;
+ int n;
Tcl_Token *elemTokenPtr = NULL;
int nameLen, elNameLen, simpleVarName, localIndex;
int elemTokenCount = 0, allocedTokens = 0, removedParen = 0;
diff --git a/generic/tclCompCmdsSZ.c b/generic/tclCompCmdsSZ.c
index f0bf5ca..db51890 100644
--- a/generic/tclCompCmdsSZ.c
+++ b/generic/tclCompCmdsSZ.c
@@ -1862,8 +1862,8 @@ TclCompileSwitchCmd(
*/
for (; numWords>=3 ; tokenPtr=TokenAfter(tokenPtr),numWords--) {
- register unsigned size = tokenPtr[1].size;
- register const char *chrs = tokenPtr[1].start;
+ unsigned size = tokenPtr[1].size;
+ const char *chrs = tokenPtr[1].start;
/*
* We only process literal options, and we assume that -e, -g and -n
@@ -2602,7 +2602,7 @@ PrintJumptableInfo(
ByteCode *codePtr,
unsigned int pcOffset)
{
- register JumptableInfo *jtPtr = clientData;
+ JumptableInfo *jtPtr = clientData;
Tcl_HashEntry *hPtr;
Tcl_HashSearch search;
const char *keyPtr;
@@ -2631,7 +2631,7 @@ DisassembleJumptableInfo(
ByteCode *codePtr,
unsigned int pcOffset)
{
- register JumptableInfo *jtPtr = clientData;
+ JumptableInfo *jtPtr = clientData;
Tcl_Obj *mapping = Tcl_NewObj();
Tcl_HashEntry *hPtr;
Tcl_HashSearch search;
diff --git a/generic/tclCompile.c b/generic/tclCompile.c
index c10e3ee..9c887e4 100644
--- a/generic/tclCompile.c
+++ b/generic/tclCompile.c
@@ -990,7 +990,7 @@ DupByteCodeInternalRep(
static void
FreeByteCodeInternalRep(
- register Tcl_Obj *objPtr) /* Object whose internal rep to free. */
+ Tcl_Obj *objPtr) /* Object whose internal rep to free. */
{
ByteCode *codePtr;
@@ -1021,14 +1021,14 @@ FreeByteCodeInternalRep(
void
TclPreserveByteCode(
- register ByteCode *codePtr)
+ ByteCode *codePtr)
{
codePtr->refCount++;
}
void
TclReleaseByteCode(
- register ByteCode *codePtr)
+ ByteCode *codePtr)
{
if (codePtr->refCount-- > 1) {
return;
@@ -1040,14 +1040,14 @@ TclReleaseByteCode(
static void
CleanupByteCode(
- register ByteCode *codePtr) /* Points to the ByteCode to free. */
+ ByteCode *codePtr) /* Points to the ByteCode to free. */
{
Tcl_Interp *interp = (Tcl_Interp *) *codePtr->interpHandle;
Interp *iPtr = (Interp *) interp;
int numLitObjects = codePtr->numLitObjects;
int numAuxDataItems = codePtr->numAuxDataItems;
- register Tcl_Obj **objArrayPtr, *objPtr;
- register const AuxData *auxDataPtr;
+ Tcl_Obj **objArrayPtr, *objPtr;
+ const AuxData *auxDataPtr;
int i;
#ifdef TCL_COMPILE_STATS
@@ -1392,9 +1392,9 @@ CompileSubstObj(
static void
FreeSubstCodeInternalRep(
- register Tcl_Obj *objPtr) /* Object whose internal rep to free. */
+ Tcl_Obj *objPtr) /* Object whose internal rep to free. */
{
- register ByteCode *codePtr;
+ ByteCode *codePtr;
ByteCodeGetIntRep(objPtr, &substCodeType, codePtr);
assert(codePtr != NULL);
@@ -1443,7 +1443,7 @@ void
TclInitCompileEnv(
Tcl_Interp *interp, /* The interpreter for which a CompileEnv
* structure is initialized. */
- register CompileEnv *envPtr,/* Points to the CompileEnv structure to
+ CompileEnv *envPtr,/* Points to the CompileEnv structure to
* initialize. */
const char *stringPtr, /* The source string to be compiled. */
int numBytes, /* Number of bytes in source string. */
@@ -1650,7 +1650,7 @@ TclInitCompileEnv(
void
TclFreeCompileEnv(
- register CompileEnv *envPtr)/* Points to the CompileEnv structure. */
+ CompileEnv *envPtr)/* Points to the CompileEnv structure. */
{
if (envPtr->localLitTable.buckets != envPtr->localLitTable.staticBuckets){
ckfree(envPtr->localLitTable.buckets);
@@ -2159,25 +2159,48 @@ TclCompileScript(
* has not yet generated any bytecode. */
const char *p = script; /* Where we are in our compile. */
int depth = TclGetStackDepth(envPtr);
+ Interp *iPtr = (Interp *) interp;
if (envPtr->iPtr == NULL) {
Tcl_Panic("TclCompileScript() called on uninitialized CompileEnv");
}
+ /*
+ * Check depth to avoid overflow of the C execution stack by too many
+ * nested calls of TclCompileScript (considering interp recursionlimit).
+ * Factor 5/4 (1.25) is used to avoid too mistaken limit recognition
+ * during "mixed" evaluation and compilation process (nested eval+compile)
+ * and is good enough for default recursionlimit (1000).
+ */
+ if (iPtr->numLevels / 5 > iPtr->maxNestingDepth / 4) {
+ Tcl_SetObjResult(interp, Tcl_NewStringObj(
+ "too many nested compilations (infinite loop?)", -1));
+ Tcl_SetErrorCode(interp, "TCL", "LIMIT", "STACK", NULL);
+ TclCompileSyntaxError(interp, envPtr);
+ return;
+ }
/* Each iteration compiles one command from the script. */
- while (numBytes > 0) {
- Tcl_Parse parse;
+ if (numBytes > 0) {
+ /*
+ * Don't use system stack (size of Tcl_Parse is ca. 400 bytes), so
+ * many nested compilations (body enclosed in body) can cause abnormal
+ * program termination with a stack overflow exception, bug [fec0c17d39].
+ */
+ Tcl_Parse *parsePtr = ckalloc(sizeof(Tcl_Parse));
+
+ do {
const char *next;
- if (TCL_OK != Tcl_ParseCommand(interp, p, numBytes, 0, &parse)) {
+ if (TCL_OK != Tcl_ParseCommand(interp, p, numBytes, 0, parsePtr)) {
/*
- * Compile bytecodes to report the parse error at runtime.
+ * Compile bytecodes to report the parsePtr error at runtime.
*/
- Tcl_LogCommandInfo(interp, script, parse.commandStart,
- parse.term + 1 - parse.commandStart);
+ Tcl_LogCommandInfo(interp, script, parsePtr->commandStart,
+ parsePtr->term + 1 - parsePtr->commandStart);
TclCompileSyntaxError(interp, envPtr);
+ ckfree(parsePtr);
return;
}
@@ -2188,9 +2211,9 @@ TclCompileScript(
*/
if ((tclTraceCompile >= 1) && (envPtr->procPtr == NULL)) {
- int commandLength = parse.term - parse.commandStart;
+ int commandLength = parsePtr->term - parsePtr->commandStart;
fprintf(stdout, " Compiling: ");
- TclPrintSource(stdout, parse.commandStart,
+ TclPrintSource(stdout, parsePtr->commandStart,
TclMin(commandLength, 55));
fprintf(stdout, "\n");
}
@@ -2201,48 +2224,59 @@ TclCompileScript(
* (See test info-30.33).
*/
- TclAdvanceLines(&envPtr->line, p, parse.commandStart);
+ TclAdvanceLines(&envPtr->line, p, parsePtr->commandStart);
TclAdvanceContinuations(&envPtr->line, &envPtr->clNext,
- parse.commandStart - envPtr->source);
+ parsePtr->commandStart - envPtr->source);
/*
* Advance parser to the next command in the script.
*/
- next = parse.commandStart + parse.commandSize;
+ next = parsePtr->commandStart + parsePtr->commandSize;
numBytes -= next - p;
p = next;
- if (parse.numWords == 0) {
+ if (parsePtr->numWords == 0) {
/*
* The "command" parsed has no words. In this case we can skip
* the rest of the loop body. With no words, clearly
* CompileCommandTokens() has nothing to do. Since the parser
* aggressively sucks up leading comment and white space,
- * including newlines, parse.commandStart must be pointing at
+ * including newlines, parsePtr->commandStart must be pointing at
* either the end of script, or a command-terminating semi-colon.
* In either case, the TclAdvance*() calls have nothing to do.
* Finally, when no words are parsed, no tokens have been
- * allocated at parse.tokenPtr so there's also nothing for
+ * allocated at parsePtr->tokenPtr so there's also nothing for
* Tcl_FreeParse() to do.
*
* The advantage of this shortcut is that CompileCommandTokens()
- * can be written with an assumption that parse.numWords > 0, with
+ * can be written with an assumption that parsePtr->numWords > 0, with
* the implication the CCT() always generates bytecode.
*/
continue;
}
- lastCmdIdx = CompileCommandTokens(interp, &parse, envPtr);
+ /*
+ * Avoid stack exhaustion by too many nested calls of TclCompileScript
+ * (considering interp recursionlimit).
+ */
+ iPtr->numLevels++;
+
+ lastCmdIdx = CompileCommandTokens(interp, parsePtr, envPtr);
+
+ iPtr->numLevels--;
/*
* TIP #280: Track lines in the just compiled command.
*/
- TclAdvanceLines(&envPtr->line, parse.commandStart, p);
+ TclAdvanceLines(&envPtr->line, parsePtr->commandStart, p);
TclAdvanceContinuations(&envPtr->line, &envPtr->clNext,
p - envPtr->source);
- Tcl_FreeParse(&parse);
+ Tcl_FreeParse(parsePtr);
+ } while (numBytes > 0);
+
+ ckfree(parsePtr);
}
if (lastCmdIdx == -1) {
@@ -2782,13 +2816,13 @@ PreventCycle(
ByteCode *
TclInitByteCode(
- register CompileEnv *envPtr)/* Points to the CompileEnv structure from
+ CompileEnv *envPtr)/* Points to the CompileEnv structure from
* which to create a ByteCode structure. */
{
- register ByteCode *codePtr;
+ ByteCode *codePtr;
size_t codeBytes, objArrayBytes, exceptArrayBytes, cmdLocBytes;
size_t auxDataArrayBytes, structureSize;
- register unsigned char *p;
+ unsigned char *p;
#ifdef TCL_COMPILE_DEBUG
unsigned char *nextPtr;
#endif
@@ -2923,7 +2957,7 @@ TclInitByteCodeObj(
* and whose string rep contains the source
* code. */
const Tcl_ObjType *typePtr,
- register CompileEnv *envPtr)/* Points to the CompileEnv structure from
+ CompileEnv *envPtr)/* Points to the CompileEnv structure from
* which to create a ByteCode structure. */
{
ByteCode *codePtr;
@@ -2968,7 +3002,7 @@ TclInitByteCodeObj(
int
TclFindCompiledLocal(
- register const char *name, /* Points to first character of the name of a
+ const char *name, /* Points to first character of the name of a
* scalar or array variable. If NULL, a
* temporary var should be created. */
int nameBytes, /* Number of bytes in the name. */
@@ -2976,9 +3010,9 @@ TclFindCompiledLocal(
* variable if it is new. */
CompileEnv *envPtr) /* Points to the current compile environment*/
{
- register CompiledLocal *localPtr;
+ CompiledLocal *localPtr;
int localVar = -1;
- register int i;
+ int i;
Proc *procPtr;
/*
@@ -3351,11 +3385,11 @@ EnterCmdWordData(
int
TclCreateExceptRange(
ExceptionRangeType type, /* The kind of ExceptionRange desired. */
- register CompileEnv *envPtr)/* Points to CompileEnv for which to create a
+ CompileEnv *envPtr)/* Points to CompileEnv for which to create a
* new ExceptionRange structure. */
{
- register ExceptionRange *rangePtr;
- register ExceptionAux *auxPtr;
+ ExceptionRange *rangePtr;
+ ExceptionAux *auxPtr;
int index = envPtr->exceptArrayNext;
if (index >= envPtr->exceptArrayEnd) {
@@ -3719,11 +3753,11 @@ TclCreateAuxData(
* the new aux data record. */
const AuxDataType *typePtr, /* Pointer to the type to attach to this
* AuxData */
- register CompileEnv *envPtr)/* Points to the CompileEnv for which a new
+ CompileEnv *envPtr)/* Points to the CompileEnv for which a new
* aux data structure is to be allocated. */
{
int index; /* Index for the new AuxData structure. */
- register AuxData *auxDataPtr;
+ AuxData *auxDataPtr;
/* Points to the new AuxData structure */
index = envPtr->auxDataArrayNext;
@@ -3782,7 +3816,7 @@ TclCreateAuxData(
void
TclInitJumpFixupArray(
- register JumpFixupArray *fixupArrayPtr)
+ JumpFixupArray *fixupArrayPtr)
/* Points to the JumpFixupArray structure to
* initialize. */
{
@@ -3814,7 +3848,7 @@ TclInitJumpFixupArray(
void
TclExpandJumpFixupArray(
- register JumpFixupArray *fixupArrayPtr)
+ JumpFixupArray *fixupArrayPtr)
/* Points to the JumpFixupArray structure to
* enlarge. */
{
@@ -3863,7 +3897,7 @@ TclExpandJumpFixupArray(
void
TclFreeJumpFixupArray(
- register JumpFixupArray *fixupArrayPtr)
+ JumpFixupArray *fixupArrayPtr)
/* Points to the JumpFixupArray structure to
* free. */
{
@@ -4310,7 +4344,7 @@ GetCmdLocEncodingSize(
* containing the CmdLocation structure to
* encode. */
{
- register CmdLocation *mapPtr = envPtr->cmdMapPtr;
+ CmdLocation *mapPtr = envPtr->cmdMapPtr;
int numCmds = envPtr->numCommands;
int codeDelta, codeLen, srcDelta, srcLen;
int codeDeltaNext, codeLengthNext, srcDeltaNext, srcLengthNext;
@@ -4394,11 +4428,11 @@ EncodeCmdLocMap(
* memory block where the location information
* is to be stored. */
{
- register CmdLocation *mapPtr = envPtr->cmdMapPtr;
+ CmdLocation *mapPtr = envPtr->cmdMapPtr;
int numCmds = envPtr->numCommands;
- register unsigned char *p = startPtr;
+ unsigned char *p = startPtr;
int codeDelta, codeLen, srcDelta, srcLen, prevOffset;
- register int i;
+ int i;
/*
* Encode the code offset for each command as a sequence of deltas.
@@ -4512,7 +4546,7 @@ RecordByteCodeStats(
* to add to accumulated statistics. */
{
Interp *iPtr = (Interp *) *codePtr->interpHandle;
- register ByteCodeStats *statsPtr;
+ ByteCodeStats *statsPtr;
if (iPtr == NULL) {
/* Avoid segfaulting in case we're called in a deleted interp */
diff --git a/generic/tclDate.c b/generic/tclDate.c
index bf8a150..fb4f3cf 100644
--- a/generic/tclDate.c
+++ b/generic/tclDate.c
@@ -2549,9 +2549,9 @@ LookupWord(
YYSTYPE* yylvalPtr,
char *buff)
{
- register char *p;
- register char *q;
- register const TABLE *tp;
+ char *p;
+ char *q;
+ const TABLE *tp;
int i, abbrev;
/*
@@ -2674,8 +2674,8 @@ TclDatelex(
YYLTYPE* location,
DateInfo *info)
{
- register char c;
- register char *p;
+ char c;
+ char *p;
char buff[20];
int Count;
diff --git a/generic/tclDictObj.c b/generic/tclDictObj.c
index f3b0981..083af70 100644
--- a/generic/tclDictObj.c
+++ b/generic/tclDictObj.c
@@ -3211,6 +3211,7 @@ DictFilterCmd(
Tcl_ResetResult(interp);
Tcl_DictObjDone(&search);
+ /* FALLTHRU */
case TCL_CONTINUE:
result = TCL_OK;
break;
@@ -3309,7 +3310,7 @@ DictUpdateCmd(
}
if (objPtr == NULL) {
/* ??? */
- Tcl_UnsetVar(interp, Tcl_GetString(objv[i+1]), 0);
+ Tcl_UnsetVar2(interp, Tcl_GetString(objv[i+1]), NULL, 0);
} else if (Tcl_ObjSetVar2(interp, objv[i+1], NULL, objPtr,
TCL_LEAVE_ERR_MSG) == NULL) {
TclDecrRefCount(dictPtr);
diff --git a/generic/tclDisassemble.c b/generic/tclDisassemble.c
index bbe1a97..a7ab8db 100644
--- a/generic/tclDisassemble.c
+++ b/generic/tclDisassemble.c
@@ -542,7 +542,7 @@ FormatInstruction(
{
Proc *procPtr = codePtr->procPtr;
unsigned char opCode = *pc;
- register const InstructionDesc *instDesc = &tclInstructionTable[opCode];
+ const InstructionDesc *instDesc = &tclInstructionTable[opCode];
unsigned char *codeStart = codePtr->codeStart;
unsigned pcOffset = pc - codeStart;
int opnd = 0, i, j, numBytes = 1;
@@ -863,8 +863,8 @@ PrintSourceToObj(
const char *stringPtr, /* The string to print. */
int maxChars) /* Maximum number of chars to print. */
{
- register const char *p;
- register int i = 0, len;
+ const char *p;
+ int i = 0, len;
Tcl_UniChar ch = 0;
if (stringPtr == NULL) {
diff --git a/generic/tclEncoding.c b/generic/tclEncoding.c
index e7cc344..fbff1f5 100644
--- a/generic/tclEncoding.c
+++ b/generic/tclEncoding.c
@@ -1515,7 +1515,7 @@ Tcl_FindExecutable(
const char *argv0) /* The value of the application's argv[0]
* (native). */
{
- TclInitSubsystems();
+ Tcl_InitSubsystems();
TclpSetInitialEncodings();
TclpFindExecutable(argv0);
}
@@ -2485,10 +2485,16 @@ Utf16ToUtfProc(
charLimit = *dstCharsPtr;
}
result = TCL_OK;
- if ((srcLen % sizeof(unsigned short)) != 0) {
+
+ /* check alignment with utf-16 (2 == sizeof(UTF-16)) */
+ if ((srcLen % 2) != 0) {
+ result = TCL_CONVERT_MULTIBYTE;
+ srcLen--;
+ }
+ /* If last code point is a high surrogate, we cannot handle that yet */
+ if ((srcLen >= 2) && ((src[srcLen - (clientData?1:2)] & 0xFC) == 0xD8)) {
result = TCL_CONVERT_MULTIBYTE;
- srcLen /= sizeof(unsigned short);
- srcLen *= sizeof(unsigned short);
+ srcLen-= 2;
}
srcStart = src;
@@ -3123,6 +3129,7 @@ Iso88591FromUtfProc(
const char *srcStart, *srcEnd, *srcClose;
const char *dstStart, *dstEnd;
int result, numChars;
+ Tcl_UniChar ch = 0;
result = TCL_OK;
@@ -3137,7 +3144,6 @@ Iso88591FromUtfProc(
dstEnd = dst + dstLen - 1;
for (numChars = 0; src < srcEnd; numChars++) {
- Tcl_UniChar ch = 0;
int len;
if ((src > srcClose) && (!Tcl_UtfCharComplete(src, srcEnd - src))) {
@@ -3490,6 +3496,7 @@ EscapeFromUtfProc(
const TableEncodingData *tableDataPtr;
const char *tablePrefixBytes;
const unsigned short *const *tableFromUnicode;
+ Tcl_UniChar ch = 0;
result = TCL_OK;
@@ -3530,7 +3537,6 @@ EscapeFromUtfProc(
for (numChars = 0; src < srcEnd; numChars++) {
unsigned len;
int word;
- Tcl_UniChar ch = 0;
if ((src > srcClose) && (!Tcl_UtfCharComplete(src, srcEnd - src))) {
/*
diff --git a/generic/tclEnsemble.c b/generic/tclEnsemble.c
index 9964250..16d8310 100644
--- a/generic/tclEnsemble.c
+++ b/generic/tclEnsemble.c
@@ -119,7 +119,7 @@ static inline Tcl_Obj *
NewNsObj(
Tcl_Namespace *namespacePtr)
{
- register Namespace *nsPtr = (Namespace *) namespacePtr;
+ Namespace *nsPtr = (Namespace *) namespacePtr;
if (namespacePtr == TclGetGlobalNamespace(nsPtr->interp)) {
return Tcl_NewStringObj("::", 2);
@@ -1813,7 +1813,7 @@ NsEnsembleImplementationCmdNR(
subcmdName = TclGetStringFromObj(subObj, &stringLength);
for (i=0 ; i<tableLength ; i++) {
- register int cmp = strncmp(subcmdName,
+ int cmp = strncmp(subcmdName,
ensemblePtr->subcommandArrayPtr[i],
stringLength);
@@ -2404,7 +2404,7 @@ MakeCachedEnsembleCommand(
Tcl_HashEntry *hPtr,
Tcl_Obj *fix)
{
- register EnsembleCmdRep *ensembleCmd;
+ EnsembleCmdRep *ensembleCmd;
ECRGetIntRep(objPtr, ensembleCmd);
if (ensembleCmd) {
diff --git a/generic/tclEvent.c b/generic/tclEvent.c
index 734f114..41aeca4 100644
--- a/generic/tclEvent.c
+++ b/generic/tclEvent.c
@@ -1002,7 +1002,7 @@ Tcl_Exit(
/*
*-------------------------------------------------------------------------
*
- * TclInitSubsystems --
+ * Tcl_InitSubsystems --
*
* Initialize various subsytems in Tcl. This should be called the first
* time an interp is created, or before any of the subsystems are used.
@@ -1025,10 +1025,10 @@ Tcl_Exit(
*/
void
-TclInitSubsystems(void)
+Tcl_InitSubsystems(void)
{
if (inExit != 0) {
- Tcl_Panic("TclInitSubsystems called while exiting");
+ Tcl_Panic("Tcl_InitSubsystems called while exiting");
}
if (subsystemsInitialized == 0) {
diff --git a/generic/tclExecute.c b/generic/tclExecute.c
index faf5865..e844df6 100644
--- a/generic/tclExecute.c
+++ b/generic/tclExecute.c
@@ -1327,7 +1327,7 @@ int
Tcl_ExprObj(
Tcl_Interp *interp, /* Context in which to evaluate the
* expression. */
- register Tcl_Obj *objPtr, /* Points to Tcl object containing expression
+ Tcl_Obj *objPtr, /* Points to Tcl object containing expression
* to evaluate. */
Tcl_Obj **resultPtrPtr) /* Where the Tcl_Obj* that is the expression
* result is stored if no errors occur. */
@@ -1444,7 +1444,7 @@ CompileExprObj(
Interp *iPtr = (Interp *) interp;
CompileEnv compEnv; /* Compilation environment structure allocated
* in frame. */
- register ByteCode *codePtr = NULL;
+ ByteCode *codePtr = NULL;
/* Tcl Internal type of bytecode. Initialized
* to avoid compiler warning. */
@@ -1598,8 +1598,8 @@ TclCompileObj(
const CmdFrame *invoker,
int word)
{
- register Interp *iPtr = (Interp *) interp;
- register ByteCode *codePtr; /* Tcl Internal type of bytecode. */
+ Interp *iPtr = (Interp *) interp;
+ ByteCode *codePtr; /* Tcl Internal type of bytecode. */
Namespace *namespacePtr = iPtr->varFramePtr->nsPtr;
/*
@@ -2069,7 +2069,7 @@ TEBCresume(
int cleanup = PTR2INT(data[2]);
Tcl_Obj *objResultPtr;
- int checkInterp; /* Indicates when a check of interp readyness
+ int checkInterp = 0; /* Indicates when a check of interp readyness
* is necessary. Set by CACHE_STACK_INFO() */
/*
@@ -2079,7 +2079,7 @@ TEBCresume(
*/
Tcl_Obj *objPtr, *valuePtr, *value2Ptr, *part1Ptr, *part2Ptr, *tmpPtr;
- Tcl_Obj **objv;
+ Tcl_Obj **objv = NULL;
int objc = 0;
int opnd, length, pcAdjustment;
Var *varPtr, *arrayPtr;
@@ -2104,7 +2104,6 @@ TEBCresume(
if (!pc) {
/* bytecode is starting from scratch */
- checkInterp = 0;
pc = codePtr->codeStart;
goto cleanup0;
} else {
@@ -2126,8 +2125,9 @@ TEBCresume(
goto abnormalReturn;
}
if (codePtr->flags & TCL_BYTECODE_RECOMPILE) {
- iPtr->flags |= ERR_ALREADY_LOGGED;
codePtr->flags &= ~TCL_BYTECODE_RECOMPILE;
+ checkInterp = 1;
+ iPtr->flags |= ERR_ALREADY_LOGGED;
}
if (result != TCL_OK) {
@@ -2187,10 +2187,12 @@ TEBCresume(
objPtr = POP_OBJECT();
TclDecrRefCount(objPtr);
}
+ /* FALLTHRU */
case 2:
cleanup2_pushObjResultPtr:
objPtr = POP_OBJECT();
TclDecrRefCount(objPtr);
+ /* FALLTHRU */
case 1:
cleanup1_pushObjResultPtr:
objPtr = OBJ_AT_TOS;
@@ -2207,14 +2209,17 @@ TEBCresume(
objPtr = POP_OBJECT();
TclDecrRefCount(objPtr);
}
+ /* FALLTHRU */
case 2:
cleanup2:
objPtr = POP_OBJECT();
TclDecrRefCount(objPtr);
+ /* FALLTHRU */
case 1:
cleanup1:
objPtr = POP_OBJECT();
TclDecrRefCount(objPtr);
+ /* FALLTHRU */
case 0:
/*
* We really want to do nothing now, but this is needed for some
@@ -2302,12 +2307,12 @@ TEBCresume(
iPtr->cmdCount += TclGetUInt4AtPtr(pc+5);
if (checkInterp) {
- checkInterp = 0;
if (((codePtr->compileEpoch != iPtr->compileEpoch) ||
(codePtr->nsEpoch != iPtr->varFramePtr->nsPtr->resolverEpoch)) &&
!(codePtr->flags & TCL_BYTECODE_PRECOMPILED)) {
goto instStartCmdFailed;
}
+ checkInterp = 0;
}
inst = *(pc += 9);
goto peepholeStart;
@@ -2501,7 +2506,7 @@ TEBCresume(
#ifdef TCL_COMPILE_DEBUG
/* FIXME: What is the right thing to trace? */
{
- register int i;
+ int i;
TRACE(("%d [", opnd));
for (i=opnd-1 ; i>=0 ; i--) {
@@ -2741,15 +2746,18 @@ TEBCresume(
* INVOCATION BLOCK
*/
- instEvalStk:
case INST_EVAL_STK:
+ instEvalStk:
bcFramePtr->data.tebc.pc = (char *) pc;
iPtr->cmdFramePtr = bcFramePtr;
cleanup = 1;
pc += 1;
+ /* yield next instruction */
TEBC_YIELD();
- return TclNREvalObjEx(interp, OBJ_AT_TOS, 0, NULL, 0);
+ /* add TEBCResume for object at top of stack */
+ return TclNRExecuteByteCode(interp,
+ TclCompileObj(interp, OBJ_AT_TOS, NULL, 0));
case INST_INVOKE_EXPANDED:
CLANG_ASSERT(auxObjList);
@@ -4411,8 +4419,8 @@ TEBCresume(
NEXT_INST_F(1, 0, 1);
case INST_INFO_LEVEL_ARGS: {
int level;
- register CallFrame *framePtr = iPtr->varFramePtr;
- register CallFrame *rootFramePtr = iPtr->rootFramePtr;
+ CallFrame *framePtr = iPtr->varFramePtr;
+ CallFrame *rootFramePtr = iPtr->rootFramePtr;
TRACE(("\"%.30s\" => ", O2S(OBJ_AT_TOS)));
if (TclGetIntFromObj(interp, OBJ_AT_TOS, &level) != TCL_OK) {
@@ -4709,7 +4717,7 @@ TEBCresume(
}
{
- register Method *const mPtr =
+ Method *const mPtr =
contextPtr->callPtr->chain[newDepth].mPtr;
return mPtr->typePtr->callProc(mPtr->clientData, interp,
@@ -6799,7 +6807,7 @@ TEBCresume(
NEXT_INST_F(1, 1, 0);
case INST_DICT_EXISTS: {
- register int found;
+ int found;
opnd = TclGetUInt4AtPtr(pc+1);
TRACE(("%u => ", opnd));
@@ -7766,19 +7774,22 @@ TEBCresume(
{
const char *bytes;
- checkInterp = 1;
length = 0;
+ if (TclInterpReady(interp) == TCL_ERROR) {
+ goto gotError;
+ }
+
/*
* We used to switch to direct eval; for NRE-awareness we now
* compile and eval the command so that this evaluation does not
- * add a new TEBC instance. [Bug 2910748]
+ * add a new TEBC instance. Bug [2910748], bug [fa6bf38d07]
+ *
+ * TODO: recompile, search this command and eval a code starting from,
+ * so that this evaluation does not add a new TEBC instance without
+ * NRE-trampoline.
*/
- if (TclInterpReady(interp) == TCL_ERROR) {
- goto gotError;
- }
-
codePtr->flags |= TCL_BYTECODE_RECOMPILE;
bytes = GetSrcInfoForPc(pc, codePtr, &length, NULL, NULL);
opnd = TclGetUInt4AtPtr(pc+1);
@@ -8900,7 +8911,7 @@ TclCompareTwoNumbers(
static void
PrintByteCodeInfo(
- register ByteCode *codePtr) /* The bytecode whose summary is printed to
+ ByteCode *codePtr) /* The bytecode whose summary is printed to
* stdout. */
{
Proc *procPtr = codePtr->procPtr;
@@ -8964,7 +8975,7 @@ PrintByteCodeInfo(
#ifdef TCL_COMPILE_DEBUG
static void
ValidatePcAndStackTop(
- register ByteCode *codePtr, /* The bytecode whose summary is printed to
+ ByteCode *codePtr, /* The bytecode whose summary is printed to
* stdout. */
const unsigned char *pc, /* Points to first byte of a bytecode
* instruction. The program counter. */
@@ -9207,7 +9218,7 @@ GetSrcInfoForPc(
* of the command containing the pc should
* be stored. */
{
- register int pcOffset = (pc - codePtr->codeStart);
+ int pcOffset = (pc - codePtr->codeStart);
int numCmds = codePtr->numCommands;
unsigned char *codeDeltaNext, *codeLengthNext;
unsigned char *srcDeltaNext, *srcLengthNext;
@@ -9360,9 +9371,9 @@ GetExceptRangeForPc(
{
ExceptionRange *rangeArrayPtr;
int numRanges = codePtr->numExceptRanges;
- register ExceptionRange *rangePtr;
+ ExceptionRange *rangePtr;
int pcOffset = pc - codePtr->codeStart;
- register int start;
+ int start;
if (numRanges == 0) {
return NULL;
@@ -9494,11 +9505,11 @@ TclExprFloatError(
int
TclLog2(
- register int value) /* The integer for which to compute the log
+ int value) /* The integer for which to compute the log
* base 2. */
{
- register int n = value;
- register int result = 0;
+ int n = value;
+ int result = 0;
while (n > 1) {
n = n >> 1;
diff --git a/generic/tclFileName.c b/generic/tclFileName.c
index 98ee37c..3419d7c 100644
--- a/generic/tclFileName.c
+++ b/generic/tclFileName.c
@@ -1072,7 +1072,7 @@ Tcl_TranslateFileName(
*/
if (tclPlatform == TCL_PLATFORM_WINDOWS) {
- register char *p;
+ char *p;
for (p = Tcl_DStringValue(bufferPtr); *p != '\0'; p++) {
if (*p == '/') {
*p = '\\';
@@ -2077,7 +2077,7 @@ SkipToChar(
int match) /* Character to find. */
{
int quoted, level;
- register char *p;
+ char *p;
quoted = 0;
level = 0;
@@ -2628,7 +2628,7 @@ Tcl_GetBlocksFromStat(
#ifdef HAVE_STRUCT_STAT_ST_BLOCKS
return (Tcl_WideUInt) statPtr->st_blocks;
#else
- register unsigned blksize = Tcl_GetBlockSizeFromStat(statPtr);
+ unsigned blksize = Tcl_GetBlockSizeFromStat(statPtr);
return ((Tcl_WideUInt) statPtr->st_size + blksize - 1) / blksize;
#endif
diff --git a/generic/tclGetDate.y b/generic/tclGetDate.y
index d67c32a..3b6134c 100644
--- a/generic/tclGetDate.y
+++ b/generic/tclGetDate.y
@@ -765,9 +765,9 @@ LookupWord(
YYSTYPE* yylvalPtr,
char *buff)
{
- register char *p;
- register char *q;
- register const TABLE *tp;
+ char *p;
+ char *q;
+ const TABLE *tp;
int i, abbrev;
/*
@@ -890,8 +890,8 @@ TclDatelex(
YYLTYPE* location,
DateInfo *info)
{
- register char c;
- register char *p;
+ char c;
+ char *p;
char buff[20];
int Count;
diff --git a/generic/tclHash.c b/generic/tclHash.c
index 8bbb0c7..9ea8807 100644
--- a/generic/tclHash.c
+++ b/generic/tclHash.c
@@ -113,7 +113,7 @@ const Tcl_HashKeyType tclStringHashKeyType = {
void
Tcl_InitHashTable(
- register Tcl_HashTable *tablePtr,
+ Tcl_HashTable *tablePtr,
/* Pointer to table record, which is supplied
* by the caller. */
int keyType) /* Type of keys to use in table:
@@ -151,7 +151,7 @@ Tcl_InitHashTable(
void
Tcl_InitCustomHashTable(
- register Tcl_HashTable *tablePtr,
+ Tcl_HashTable *tablePtr,
/* Pointer to table record, which is supplied
* by the caller. */
int keyType, /* Type of keys to use in table:
@@ -271,7 +271,7 @@ CreateHashEntry(
int *newPtr) /* Store info here telling whether a new entry
* was created. */
{
- register Tcl_HashEntry *hPtr;
+ Tcl_HashEntry *hPtr;
const Tcl_HashKeyType *typePtr;
unsigned int hash;
int index;
@@ -392,7 +392,7 @@ void
Tcl_DeleteHashEntry(
Tcl_HashEntry *entryPtr)
{
- register Tcl_HashEntry *prevPtr;
+ Tcl_HashEntry *prevPtr;
const Tcl_HashKeyType *typePtr;
Tcl_HashTable *tablePtr;
Tcl_HashEntry **bucketPtr;
@@ -461,9 +461,9 @@ Tcl_DeleteHashEntry(
void
Tcl_DeleteHashTable(
- register Tcl_HashTable *tablePtr) /* Table to delete. */
+ Tcl_HashTable *tablePtr) /* Table to delete. */
{
- register Tcl_HashEntry *hPtr, *nextPtr;
+ Tcl_HashEntry *hPtr, *nextPtr;
const Tcl_HashKeyType *typePtr;
int i;
@@ -569,7 +569,7 @@ Tcl_FirstHashEntry(
Tcl_HashEntry *
Tcl_NextHashEntry(
- register Tcl_HashSearch *searchPtr)
+ Tcl_HashSearch *searchPtr)
/* Place to store information about progress
* through the table. Must have been
* initialized by calling
@@ -616,7 +616,7 @@ Tcl_HashStats(
#define NUM_COUNTERS 10
int count[NUM_COUNTERS], overflow, i, j;
double average, tmp;
- register Tcl_HashEntry *hPtr;
+ Tcl_HashEntry *hPtr;
char *result, *p;
/*
@@ -686,7 +686,7 @@ AllocArrayEntry(
void *keyPtr) /* Key to store in the hash table entry. */
{
int *array = (int *) keyPtr;
- register int *iPtr1, *iPtr2;
+ int *iPtr1, *iPtr2;
Tcl_HashEntry *hPtr;
int count;
unsigned int size;
@@ -730,8 +730,8 @@ CompareArrayKeys(
void *keyPtr, /* New key to compare. */
Tcl_HashEntry *hPtr) /* Existing key to compare. */
{
- register const int *iPtr1 = (const int *) keyPtr;
- register const int *iPtr2 = (const int *) hPtr->key.words;
+ const int *iPtr1 = (const int *) keyPtr;
+ const int *iPtr2 = (const int *) hPtr->key.words;
Tcl_HashTable *tablePtr = hPtr->tablePtr;
int count;
@@ -769,8 +769,8 @@ HashArrayKey(
Tcl_HashTable *tablePtr, /* Hash table. */
void *keyPtr) /* Key from which to compute hash value. */
{
- register const int *array = (const int *) keyPtr;
- register unsigned int result;
+ const int *array = (const int *) keyPtr;
+ unsigned int result;
int count;
for (result = 0, count = tablePtr->keyType; count > 0;
@@ -838,8 +838,8 @@ CompareStringKeys(
void *keyPtr, /* New key to compare. */
Tcl_HashEntry *hPtr) /* Existing key to compare. */
{
- register const char *p1 = (const char *) keyPtr;
- register const char *p2 = (const char *) hPtr->key.string;
+ const char *p1 = (const char *) keyPtr;
+ const char *p2 = (const char *) hPtr->key.string;
return !strcmp(p1, p2);
}
@@ -866,9 +866,9 @@ HashStringKey(
Tcl_HashTable *tablePtr, /* Hash table. */
void *keyPtr) /* Key from which to compute hash value. */
{
- register const char *string = keyPtr;
- register unsigned int result;
- register char c;
+ const char *string = keyPtr;
+ unsigned int result;
+ char c;
/*
* I tried a zillion different hash functions and asked many other people
@@ -987,12 +987,12 @@ BogusCreate(
static void
RebuildTable(
- register Tcl_HashTable *tablePtr) /* Table to enlarge. */
+ Tcl_HashTable *tablePtr) /* Table to enlarge. */
{
int count, index, oldSize = tablePtr->numBuckets;
Tcl_HashEntry **oldBuckets = tablePtr->buckets;
- register Tcl_HashEntry **oldChainPtr, **newChainPtr;
- register Tcl_HashEntry *hPtr;
+ Tcl_HashEntry **oldChainPtr, **newChainPtr;
+ Tcl_HashEntry *hPtr;
const Tcl_HashKeyType *typePtr;
/* Avoid outgrowing capability of the memory allocators */
diff --git a/generic/tclHistory.c b/generic/tclHistory.c
index 47806d4..46e6989 100644
--- a/generic/tclHistory.c
+++ b/generic/tclHistory.c
@@ -61,7 +61,7 @@ Tcl_RecordAndEval(
* TCL_EVAL_GLOBAL means use Tcl_GlobalEval
* instead of Tcl_Eval. */
{
- register Tcl_Obj *cmdPtr;
+ Tcl_Obj *cmdPtr;
int result;
if (cmd[0]) {
@@ -213,7 +213,7 @@ DeleteHistoryObjs(
ClientData clientData,
Tcl_Interp *interp)
{
- register HistoryObjs *histObjsPtr = clientData;
+ HistoryObjs *histObjsPtr = clientData;
TclDecrRefCount(histObjsPtr->historyObj);
TclDecrRefCount(histObjsPtr->addObj);
diff --git a/generic/tclIO.c b/generic/tclIO.c
index 118820a..f50ef4a 100644
--- a/generic/tclIO.c
+++ b/generic/tclIO.c
@@ -7480,7 +7480,7 @@ Tcl_OutputBuffered(
bytesBuffered += BytesLeft(bufPtr);
}
if (statePtr->curOutPtr != NULL) {
- register ChannelBuffer *curOutPtr = statePtr->curOutPtr;
+ ChannelBuffer *curOutPtr = statePtr->curOutPtr;
if (IsBufferReady(curOutPtr)) {
bytesBuffered += BytesLeft(curOutPtr);
@@ -11235,9 +11235,9 @@ Tcl_ChannelTruncateProc(
static void
DupChannelIntRep(
- register Tcl_Obj *srcPtr, /* Object with internal rep to copy. Must have
+ Tcl_Obj *srcPtr, /* Object with internal rep to copy. Must have
* an internal rep of type "Channel". */
- register Tcl_Obj *copyPtr) /* Object with internal rep to set. Must not
+ Tcl_Obj *copyPtr) /* Object with internal rep to set. Must not
* currently have an internal rep.*/
{
ResolvedChanName *resPtr;
diff --git a/generic/tclIORChan.c b/generic/tclIORChan.c
index 23049fb..1d90def 100644
--- a/generic/tclIORChan.c
+++ b/generic/tclIORChan.c
@@ -2125,7 +2125,7 @@ static Tcl_Obj *
DecodeEventMask(
int mask)
{
- register const char *eventStr;
+ const char *eventStr;
Tcl_Obj *evObj;
switch (mask & RANDW) {
diff --git a/generic/tclIORTrans.c b/generic/tclIORTrans.c
index 8e24cf7..8385d88 100644
--- a/generic/tclIORTrans.c
+++ b/generic/tclIORTrans.c
@@ -1706,7 +1706,7 @@ static Tcl_Obj *
DecodeEventMask(
int mask)
{
- register const char *eventStr;
+ const char *eventStr;
Tcl_Obj *evObj;
switch (mask & RANDW) {
diff --git a/generic/tclIndexObj.c b/generic/tclIndexObj.c
index 919db92..e7c3b46 100644
--- a/generic/tclIndexObj.c
+++ b/generic/tclIndexObj.c
@@ -426,7 +426,7 @@ Tcl_GetIndexFromObjStruct(
static int
SetIndexFromAny(
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. */
{
if (interp) {
Tcl_SetObjResult(interp, Tcl_NewStringObj(
@@ -458,7 +458,7 @@ UpdateStringOfIndex(
Tcl_Obj *objPtr)
{
IndexRep *indexRep = TclFetchIntRep(objPtr, &indexType)->twoPtrValue.ptr1;
- register const char *indexStr = EXPAND_OF(indexRep);
+ const char *indexStr = EXPAND_OF(indexRep);
Tcl_InitStringRep(objPtr, indexStr, strlen(indexStr));
}
@@ -967,7 +967,7 @@ Tcl_WrongNumArgs(
const Tcl_ObjIntRep *irPtr;
if ((irPtr = TclFetchIntRep(origObjv[i], &indexType))) {
- register IndexRep *indexRep = irPtr->twoPtrValue.ptr1;
+ IndexRep *indexRep = irPtr->twoPtrValue.ptr1;
elementStr = EXPAND_OF(indexRep);
elemLen = strlen(elementStr);
@@ -1016,7 +1016,7 @@ Tcl_WrongNumArgs(
const Tcl_ObjIntRep *irPtr;
if ((irPtr = TclFetchIntRep(objv[i], &indexType))) {
- register IndexRep *indexRep = irPtr->twoPtrValue.ptr1;
+ IndexRep *indexRep = irPtr->twoPtrValue.ptr1;
Tcl_AppendStringsToObj(objPtr, EXPAND_OF(indexRep), NULL);
} else {
@@ -1107,14 +1107,14 @@ Tcl_ParseArgsObjv(
* successful exit. Will include the name of
* the command. */
int nrem; /* Size of leftovers.*/
- register const Tcl_ArgvInfo *infoPtr;
+ const Tcl_ArgvInfo *infoPtr;
/* Pointer to the current entry in the table
* of argument descriptions. */
const Tcl_ArgvInfo *matchPtr;
/* Descriptor that matches current argument */
Tcl_Obj *curArg; /* Current argument */
const char *str = NULL;
- register char c; /* Second character of current arg (used for
+ char c; /* Second character of current arg (used for
* quick check for matching; use 2nd char.
* because first char. will almost always be
* '-'). */
@@ -1362,7 +1362,7 @@ PrintUsage(
/* Array of command-specific argument
* descriptions. */
{
- register const Tcl_ArgvInfo *infoPtr;
+ const Tcl_ArgvInfo *infoPtr;
int width, numSpaces;
#define NUM_SPACES 20
static const char spaces[] = " ";
diff --git a/generic/tclInt.h b/generic/tclInt.h
index 26f1840..7951eb3 100644
--- a/generic/tclInt.h
+++ b/generic/tclInt.h
@@ -3074,9 +3074,9 @@ MODULE_SCOPE void TclInitLimitSupport(Tcl_Interp *interp);
MODULE_SCOPE void TclInitNamespaceSubsystem(void);
MODULE_SCOPE void TclInitNotifier(void);
MODULE_SCOPE void TclInitObjSubsystem(void);
-MODULE_SCOPE void TclInitSubsystems(void);
MODULE_SCOPE int TclInterpReady(Tcl_Interp *interp);
MODULE_SCOPE int TclIsSpaceProc(int byte);
+MODULE_SCOPE int TclIsDigitProc(int byte);
MODULE_SCOPE int TclIsBareword(int byte);
MODULE_SCOPE Tcl_Obj * TclJoinPath(int elements, Tcl_Obj * const objv[],
int forceRelative);
diff --git a/generic/tclInterp.c b/generic/tclInterp.c
index 92c6159..bd786f3 100644
--- a/generic/tclInterp.c
+++ b/generic/tclInterp.c
@@ -3291,7 +3291,7 @@ Tcl_MakeSafe(
* No env array in a safe slave.
*/
- Tcl_UnsetVar(interp, "env", TCL_GLOBAL_ONLY);
+ Tcl_UnsetVar2(interp, "env", NULL, TCL_GLOBAL_ONLY);
/*
* Remove unsafe parts of tcl_platform
@@ -3307,9 +3307,9 @@ Tcl_MakeSafe(
* nameofexecutable])
*/
- Tcl_UnsetVar(interp, "tclDefaultLibrary", TCL_GLOBAL_ONLY);
- Tcl_UnsetVar(interp, "tcl_library", TCL_GLOBAL_ONLY);
- Tcl_UnsetVar(interp, "tcl_pkgPath", TCL_GLOBAL_ONLY);
+ Tcl_UnsetVar2(interp, "tclDefaultLibrary", NULL, TCL_GLOBAL_ONLY);
+ Tcl_UnsetVar2(interp, "tcl_library", NULL, TCL_GLOBAL_ONLY);
+ Tcl_UnsetVar2(interp, "tcl_pkgPath", NULL, TCL_GLOBAL_ONLY);
/*
* Remove the standard channels from the interpreter; safe interpreters do
@@ -3362,7 +3362,7 @@ int
Tcl_LimitExceeded(
Tcl_Interp *interp)
{
- register Interp *iPtr = (Interp *) interp;
+ Interp *iPtr = (Interp *) interp;
return iPtr->limit.exceeded != 0;
}
@@ -3393,10 +3393,10 @@ int
Tcl_LimitReady(
Tcl_Interp *interp)
{
- register Interp *iPtr = (Interp *) interp;
+ Interp *iPtr = (Interp *) interp;
if (iPtr->limit.active != 0) {
- register int ticker = ++iPtr->limit.granularityTicker;
+ int ticker = ++iPtr->limit.granularityTicker;
if ((iPtr->limit.active & TCL_LIMIT_COMMANDS) &&
((iPtr->limit.cmdGranularity == 1) ||
@@ -3440,7 +3440,7 @@ Tcl_LimitCheck(
Tcl_Interp *interp)
{
Interp *iPtr = (Interp *) interp;
- register int ticker = iPtr->limit.granularityTicker;
+ int ticker = iPtr->limit.granularityTicker;
if (Tcl_InterpDeleted(interp)) {
return TCL_OK;
diff --git a/generic/tclListObj.c b/generic/tclListObj.c
index ad64971..d4dec9b 100644
--- a/generic/tclListObj.c
+++ b/generic/tclListObj.c
@@ -557,14 +557,14 @@ TclListObjRange(
int
Tcl_ListObjGetElements(
Tcl_Interp *interp, /* Used to report errors if not NULL. */
- register Tcl_Obj *listPtr, /* List object for which an element array is
+ Tcl_Obj *listPtr, /* List object for which an element array is
* to be returned. */
int *objcPtr, /* Where to store the count of objects
* referenced by objv. */
Tcl_Obj ***objvPtr) /* Where to store the pointer to an array of
* pointers to the list's objects. */
{
- register List *listRepPtr;
+ List *listRepPtr;
ListGetIntRep(listPtr, listRepPtr);
@@ -614,7 +614,7 @@ Tcl_ListObjGetElements(
int
Tcl_ListObjAppendList(
Tcl_Interp *interp, /* Used to report errors if not NULL. */
- register Tcl_Obj *listPtr, /* List object to append elements to. */
+ Tcl_Obj *listPtr, /* List object to append elements to. */
Tcl_Obj *elemListPtr) /* List obj with elements to append. */
{
int objc;
@@ -673,7 +673,7 @@ Tcl_ListObjAppendElement(
Tcl_Obj *listPtr, /* List object to append objPtr to. */
Tcl_Obj *objPtr) /* Object to append to listPtr's list. */
{
- register List *listRepPtr, *newPtr = NULL;
+ List *listRepPtr, *newPtr = NULL;
int numElems, numRequired, needGrow, isShared, attempt;
if (Tcl_IsShared(listPtr)) {
@@ -844,11 +844,11 @@ Tcl_ListObjAppendElement(
int
Tcl_ListObjIndex(
Tcl_Interp *interp, /* Used to report errors if not NULL. */
- register Tcl_Obj *listPtr, /* List object to index into. */
- register int index, /* Index of element to return. */
+ Tcl_Obj *listPtr, /* List object to index into. */
+ int index, /* Index of element to return. */
Tcl_Obj **objPtrPtr) /* The resulting Tcl_Obj* is stored here. */
{
- register List *listRepPtr;
+ List *listRepPtr;
ListGetIntRep(listPtr, listRepPtr);
if (listRepPtr == NULL) {
@@ -900,10 +900,10 @@ Tcl_ListObjIndex(
int
Tcl_ListObjLength(
Tcl_Interp *interp, /* Used to report errors if not NULL. */
- register Tcl_Obj *listPtr, /* List object whose #elements to return. */
- register int *intPtr) /* The resulting int is stored here. */
+ Tcl_Obj *listPtr, /* List object whose #elements to return. */
+ int *intPtr) /* The resulting int is stored here. */
{
- register List *listRepPtr;
+ List *listRepPtr;
ListGetIntRep(listPtr, listRepPtr);
if (listRepPtr == NULL) {
@@ -974,7 +974,7 @@ Tcl_ListObjReplace(
* insert. */
{
List *listRepPtr;
- register Tcl_Obj **elemPtrs;
+ Tcl_Obj **elemPtrs;
int needGrow, numElems, numRequired, numAfterLast, start, i, j, isShared;
if (Tcl_IsShared(listPtr)) {
diff --git a/generic/tclLiteral.c b/generic/tclLiteral.c
index 83eee07..5982cc8 100644
--- a/generic/tclLiteral.c
+++ b/generic/tclLiteral.c
@@ -58,7 +58,7 @@ static void RebuildLiteralTable(LiteralTable *tablePtr);
void
TclInitLiteralTable(
- register LiteralTable *tablePtr)
+ LiteralTable *tablePtr)
/* Pointer to table structure, which is
* supplied by the caller. */
{
@@ -389,7 +389,7 @@ int
TclRegisterLiteral(
void *ePtr, /* Points to the CompileEnv in whose object
* array an object is found or created. */
- register const char *bytes, /* Points to string for which to find or
+ const char *bytes, /* Points to string for which to find or
* create an object in CompileEnv's object
* array. */
int length, /* Number of bytes in the string. If < 0, the
@@ -499,13 +499,13 @@ static LiteralEntry *
LookupLiteralEntry(
Tcl_Interp *interp, /* Interpreter for which objPtr was created to
* hold a literal. */
- register Tcl_Obj *objPtr) /* Points to a Tcl object holding a literal
+ Tcl_Obj *objPtr) /* Points to a Tcl object holding a literal
* that was previously created by a call to
* TclRegisterLiteral. */
{
Interp *iPtr = (Interp *) interp;
LiteralTable *globalTablePtr = &iPtr->literalTable;
- register LiteralEntry *entryPtr;
+ LiteralEntry *entryPtr;
const char *bytes;
int length, globalHash;
@@ -545,7 +545,7 @@ void
TclHideLiteral(
Tcl_Interp *interp, /* Interpreter for which objPtr was created to
* hold a literal. */
- register CompileEnv *envPtr,/* Points to CompileEnv whose literal array
+ CompileEnv *envPtr,/* Points to CompileEnv whose literal array
* contains the entry being hidden. */
int index) /* The index of the entry in the literal
* array. */
@@ -609,14 +609,14 @@ TclHideLiteral(
int
TclAddLiteralObj(
- register CompileEnv *envPtr,/* Points to CompileEnv in whose literal array
+ CompileEnv *envPtr,/* Points to CompileEnv in whose literal array
* the object is to be inserted. */
Tcl_Obj *objPtr, /* The object to insert into the array. */
LiteralEntry **litPtrPtr) /* The location where the pointer to the new
* literal entry should be stored. May be
* NULL. */
{
- register LiteralEntry *lPtr;
+ LiteralEntry *lPtr;
int objIndex;
if (envPtr->literalArrayNext >= envPtr->literalArrayEnd) {
@@ -658,12 +658,12 @@ TclAddLiteralObj(
static int
AddLocalLiteralEntry(
- register CompileEnv *envPtr,/* Points to CompileEnv in whose literal array
+ CompileEnv *envPtr,/* Points to CompileEnv in whose literal array
* the object is to be inserted. */
Tcl_Obj *objPtr, /* The literal to add to the CompileEnv. */
int localHash) /* Hash value for the literal's string. */
{
- register LiteralTable *localTablePtr = &envPtr->localLitTable;
+ LiteralTable *localTablePtr = &envPtr->localLitTable;
LiteralEntry *localPtr;
int objIndex;
@@ -736,7 +736,7 @@ AddLocalLiteralEntry(
static void
ExpandLocalLiteralArray(
- register CompileEnv *envPtr)/* Points to the CompileEnv whose object array
+ CompileEnv *envPtr)/* Points to the CompileEnv whose object array
* must be enlarged. */
{
/*
@@ -818,13 +818,13 @@ void
TclReleaseLiteral(
Tcl_Interp *interp, /* Interpreter for which objPtr was created to
* hold a literal. */
- register Tcl_Obj *objPtr) /* Points to a literal object that was
+ Tcl_Obj *objPtr) /* Points to a literal object that was
* previously created by a call to
* TclRegisterLiteral. */
{
Interp *iPtr = (Interp *) interp;
LiteralTable *globalTablePtr;
- register LiteralEntry *entryPtr, *prevPtr;
+ LiteralEntry *entryPtr, *prevPtr;
const char *bytes;
int length;
unsigned int index;
@@ -898,10 +898,10 @@ TclReleaseLiteral(
static unsigned
HashString(
- register const char *string, /* String for which to compute hash value. */
+ const char *string, /* String for which to compute hash value. */
int length) /* Number of bytes in the string. */
{
- register unsigned int result = 0;
+ unsigned int result = 0;
/*
* I tried a zillion different hash functions and asked many other people
@@ -962,12 +962,12 @@ HashString(
static void
RebuildLiteralTable(
- register LiteralTable *tablePtr)
+ LiteralTable *tablePtr)
/* Local or global table to enlarge. */
{
LiteralEntry **oldBuckets;
- register LiteralEntry **oldChainPtr, **newChainPtr;
- register LiteralEntry *entryPtr;
+ LiteralEntry **oldChainPtr, **newChainPtr;
+ LiteralEntry *entryPtr;
LiteralEntry **bucketPtr;
const char *bytes;
unsigned int oldSize, index;
@@ -1098,7 +1098,7 @@ TclLiteralStats(
int overflow;
size_t i, j;
double average, tmp;
- register LiteralEntry *entryPtr;
+ LiteralEntry *entryPtr;
char *result, *p;
/*
@@ -1169,8 +1169,8 @@ TclVerifyLocalLiteralTable(
CompileEnv *envPtr) /* Points to CompileEnv whose literal table is
* to be validated. */
{
- register LiteralTable *localTablePtr = &envPtr->localLitTable;
- register LiteralEntry *localPtr;
+ LiteralTable *localTablePtr = &envPtr->localLitTable;
+ LiteralEntry *localPtr;
char *bytes;
size_t i, count;
int length;
@@ -1220,8 +1220,8 @@ TclVerifyGlobalLiteralTable(
Interp *iPtr) /* Points to interpreter whose global literal
* table is to be validated. */
{
- register LiteralTable *globalTablePtr = &iPtr->literalTable;
- register LiteralEntry *globalPtr;
+ LiteralTable *globalTablePtr = &iPtr->literalTable;
+ LiteralEntry *globalPtr;
char *bytes;
size_t i, count;
int length;
diff --git a/generic/tclNamesp.c b/generic/tclNamesp.c
index bbe357d..9f28661 100644
--- a/generic/tclNamesp.c
+++ b/generic/tclNamesp.c
@@ -240,7 +240,7 @@ TclInitNamespaceSubsystem(void)
Tcl_Namespace *
Tcl_GetCurrentNamespace(
- register Tcl_Interp *interp)/* Interpreter whose current namespace is
+ Tcl_Interp *interp)/* Interpreter whose current namespace is
* being queried. */
{
return TclGetCurrentNamespace(interp);
@@ -264,7 +264,7 @@ Tcl_GetCurrentNamespace(
Tcl_Namespace *
Tcl_GetGlobalNamespace(
- register Tcl_Interp *interp)/* Interpreter whose global namespace should
+ Tcl_Interp *interp)/* Interpreter whose global namespace should
* be returned. */
{
return TclGetGlobalNamespace(interp);
@@ -316,8 +316,8 @@ Tcl_PushCallFrame(
* variables. */
{
Interp *iPtr = (Interp *) interp;
- register CallFrame *framePtr = (CallFrame *) callFramePtr;
- register Namespace *nsPtr;
+ CallFrame *framePtr = (CallFrame *) callFramePtr;
+ Namespace *nsPtr;
if (namespacePtr == NULL) {
nsPtr = (Namespace *) TclGetCurrentNamespace(interp);
@@ -393,8 +393,8 @@ void
Tcl_PopCallFrame(
Tcl_Interp *interp) /* Interpreter with call frame to pop. */
{
- register Interp *iPtr = (Interp *) interp;
- register CallFrame *framePtr = iPtr->framePtr;
+ Interp *iPtr = (Interp *) interp;
+ CallFrame *framePtr = iPtr->framePtr;
Namespace *nsPtr;
/*
@@ -679,7 +679,7 @@ Tcl_CreateNamespace(
* function should be called. */
{
Interp *iPtr = (Interp *) interp;
- register Namespace *nsPtr, *ancestorPtr;
+ Namespace *nsPtr, *ancestorPtr;
Namespace *parentPtr, *dummy1Ptr, *dummy2Ptr;
Namespace *globalNsPtr = iPtr->globalNsPtr;
const char *simpleName;
@@ -848,7 +848,7 @@ Tcl_CreateNamespace(
for (ancestorPtr = nsPtr; ancestorPtr != NULL;
ancestorPtr = ancestorPtr->parentPtr) {
if (ancestorPtr != globalNsPtr) {
- register Tcl_DString *tempPtr = namePtr;
+ Tcl_DString *tempPtr = namePtr;
TclDStringAppendLiteral(buffPtr, "::");
Tcl_DStringAppend(buffPtr, ancestorPtr->name, -1);
@@ -922,7 +922,7 @@ void
Tcl_DeleteNamespace(
Tcl_Namespace *namespacePtr)/* Points to the namespace to delete. */
{
- register Namespace *nsPtr = (Namespace *) namespacePtr;
+ Namespace *nsPtr = (Namespace *) namespacePtr;
Interp *iPtr = (Interp *) nsPtr->interp;
Namespace *globalNsPtr = (Namespace *)
TclGetGlobalNamespace((Tcl_Interp *) iPtr);
@@ -1118,11 +1118,11 @@ TclNamespaceDeleted(
void
TclTeardownNamespace(
- register Namespace *nsPtr) /* Points to the namespace to be dismantled
+ Namespace *nsPtr) /* Points to the namespace to be dismantled
* and unlinked from its parent. */
{
Interp *iPtr = (Interp *) nsPtr->interp;
- register Tcl_HashEntry *entryPtr;
+ Tcl_HashEntry *entryPtr;
Tcl_HashSearch search;
int i;
@@ -1311,7 +1311,7 @@ TclTeardownNamespace(
static void
NamespaceFree(
- register Namespace *nsPtr) /* Points to the namespace to free. */
+ Namespace *nsPtr) /* Points to the namespace to free. */
{
/*
* Most of the namespace's contents are freed when the namespace is
@@ -1586,7 +1586,7 @@ Tcl_Import(
{
Namespace *nsPtr, *importNsPtr, *dummyPtr;
const char *simplePattern;
- register Tcl_HashEntry *hPtr;
+ Tcl_HashEntry *hPtr;
Tcl_HashSearch search;
/*
@@ -1865,7 +1865,7 @@ Tcl_ForgetImport(
Namespace *nsPtr, *sourceNsPtr, *dummyPtr;
const char *simplePattern;
char *cmdName;
- register Tcl_HashEntry *hPtr;
+ Tcl_HashEntry *hPtr;
Tcl_HashSearch search;
/*
@@ -1992,7 +1992,7 @@ TclGetOriginalCommand(
Tcl_Command command) /* The imported command for which the original
* command should be returned. */
{
- register Command *cmdPtr = (Command *) command;
+ Command *cmdPtr = (Command *) command;
ImportedCmdData *dataPtr;
if (cmdPtr->deleteProc != DeleteImportedCmd) {
@@ -2081,7 +2081,7 @@ DeleteImportedCmd(
ImportedCmdData *dataPtr = clientData;
Command *realCmdPtr = dataPtr->realCmdPtr;
Command *selfPtr = dataPtr->selfPtr;
- register ImportRef *refPtr, *prevPtr;
+ ImportRef *refPtr, *prevPtr;
prevPtr = NULL;
for (refPtr = realCmdPtr->importRefPtr; refPtr != NULL;
@@ -2501,7 +2501,7 @@ Tcl_FindNamespace(
* points to namespace in which to resolve
* name; if NULL, look up name in the current
* namespace. */
- register int flags) /* Flags controlling namespace lookup: an OR'd
+ int flags) /* Flags controlling namespace lookup: an OR'd
* combination of TCL_GLOBAL_ONLY and
* TCL_LEAVE_ERR_MSG flags. */
{
@@ -2572,8 +2572,8 @@ Tcl_FindCommand(
{
Interp *iPtr = (Interp *) interp;
Namespace *cxtNsPtr;
- register Tcl_HashEntry *entryPtr;
- register Command *cmdPtr;
+ Tcl_HashEntry *entryPtr;
+ Command *cmdPtr;
const char *simpleName;
int result;
@@ -2684,7 +2684,7 @@ Tcl_FindCommand(
}
} else {
Namespace *nsPtr[2];
- register int search;
+ int search;
TclGetNamespaceForQualName(interp, name, cxtNsPtr,
flags, &nsPtr[0], &nsPtr[1], &cxtNsPtr, &simpleName);
@@ -2758,7 +2758,7 @@ TclResetShadowedCmdRefs(
{
char *cmdName;
Tcl_HashEntry *hPtr;
- register Namespace *nsPtr;
+ Namespace *nsPtr;
Namespace *trailNsPtr, *shadowNsPtr;
Namespace *globalNsPtr = (Namespace *) TclGetGlobalNamespace(interp);
int found, i;
@@ -3008,7 +3008,7 @@ NamespaceChildrenCmd(
Namespace *globalNsPtr = (Namespace *) TclGetGlobalNamespace(interp);
const char *pattern = NULL;
Tcl_DString buffer;
- register Tcl_HashEntry *entryPtr;
+ Tcl_HashEntry *entryPtr;
Tcl_HashSearch search;
Tcl_Obj *listPtr, *elemPtr;
@@ -3134,7 +3134,7 @@ NamespaceCodeCmd(
{
Namespace *currNsPtr;
Tcl_Obj *listPtr, *objPtr;
- register const char *arg;
+ const char *arg;
int length;
if (objc != 2) {
@@ -3213,7 +3213,7 @@ NamespaceCurrentCmd(
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
{
- register Namespace *currNsPtr;
+ Namespace *currNsPtr;
if (objc != 1) {
Tcl_WrongNumArgs(interp, 1, objv, NULL);
@@ -3278,7 +3278,7 @@ NamespaceDeleteCmd(
{
Tcl_Namespace *namespacePtr;
const char *name;
- register int i;
+ int i;
if (objc < 1) {
Tcl_WrongNumArgs(interp, 1, objv, "?name name...?");
@@ -3633,7 +3633,7 @@ NamespaceForgetCmd(
Tcl_Obj *const objv[]) /* Argument objects. */
{
const char *pattern;
- register int i, result;
+ int i, result;
if (objc < 1) {
Tcl_WrongNumArgs(interp, 1, objv, "?pattern pattern...?");
@@ -3699,7 +3699,7 @@ NamespaceImportCmd(
{
int allowOverwrite = 0;
const char *string, *pattern;
- register int i, result;
+ int i, result;
int firstArg;
if (objc < 1) {
@@ -3852,7 +3852,7 @@ NRNamespaceInscopeCmd(
cmdObjPtr = objv[2];
} else {
Tcl_Obj *concatObjv[2];
- register Tcl_Obj *listPtr;
+ Tcl_Obj *listPtr;
listPtr = Tcl_NewListObj(0, NULL);
for (i = 3; i < objc; i++) {
@@ -4253,7 +4253,7 @@ NamespaceQualifiersCmd(
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
{
- register const char *name, *p;
+ const char *name, *p;
int length;
if (objc != 2) {
@@ -4508,7 +4508,7 @@ NamespaceTailCmd(
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
{
- register const char *name, *p;
+ const char *name, *p;
if (objc != 2) {
Tcl_WrongNumArgs(interp, 1, objv, "string");
@@ -4711,7 +4711,7 @@ NamespaceWhichCmd(
static void
FreeNsNameInternalRep(
- register Tcl_Obj *objPtr) /* nsName object with internal representation
+ Tcl_Obj *objPtr) /* nsName object with internal representation
* to free. */
{
ResolvedNsName *resNamePtr;
@@ -4758,7 +4758,7 @@ FreeNsNameInternalRep(
static void
DupNsNameInternalRep(
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. */
{
ResolvedNsName *resNamePtr;
@@ -4794,11 +4794,11 @@ SetNsNameFromAny(
Tcl_Interp *interp, /* Points to the namespace in which to resolve
* name. Also used for error reporting if not
* NULL. */
- register Tcl_Obj *objPtr) /* The object to convert. */
+ Tcl_Obj *objPtr) /* The object to convert. */
{
const char *dummy;
Namespace *nsPtr, *dummy1Ptr, *dummy2Ptr;
- register ResolvedNsName *resNamePtr;
+ ResolvedNsName *resNamePtr;
const char *name;
if (interp == NULL) {
@@ -4921,7 +4921,7 @@ TclLogCommandInfo(
Tcl_Obj **tosPtr) /* Current stack of bytecode execution
* context */
{
- register const char *p;
+ const char *p;
Interp *iPtr = (Interp *) interp;
int overflow, limit = 150;
Var *varPtr, *arrayPtr;
diff --git a/generic/tclOO.c b/generic/tclOO.c
index e9cc0f0..1ba262b 100644
--- a/generic/tclOO.c
+++ b/generic/tclOO.c
@@ -789,7 +789,7 @@ MyDeleted(
ClientData clientData) /* Reference to the object whose [my] has been
* squelched. */
{
- register Object *oPtr = clientData;
+ Object *oPtr = clientData;
oPtr->myCommand = NULL;
}
@@ -1652,7 +1652,7 @@ Tcl_NewObjectInstance(
int skip) /* Number of arguments to _not_ pass to the
* constructor. */
{
- register Class *classPtr = (Class *) cls;
+ Class *classPtr = (Class *) cls;
Object *oPtr;
ClientData clientData[4];
@@ -1722,7 +1722,7 @@ TclNRNewObjectInstance(
Tcl_Object *objectPtr) /* Place to write the object reference upon
* successful allocation. */
{
- register Class *classPtr = (Class *) cls;
+ Class *classPtr = (Class *) cls;
CallContext *contextPtr;
Tcl_InterpState state;
Object *oPtr;
@@ -2656,7 +2656,7 @@ TclOOObjectCmdCore(
methodNamePtr = objv[1];
if (oPtr->mapMethodNameProc != NULL) {
- register Class **startClsPtr = &startCls;
+ Class **startClsPtr = &startCls;
Tcl_Obj *mappedMethodName = Tcl_DuplicateObj(methodNamePtr);
result = oPtr->mapMethodNameProc(interp, (Tcl_Object) oPtr,
@@ -2715,7 +2715,7 @@ TclOOObjectCmdCore(
if (startCls != NULL) {
for (; contextPtr->index < contextPtr->callPtr->numChain;
contextPtr->index++) {
- register struct MInvoke *miPtr =
+ struct MInvoke *miPtr =
&contextPtr->callPtr->chain[contextPtr->index];
if (miPtr->isFilter) {
@@ -2853,7 +2853,7 @@ TclNRObjectContextInvokeNext(
Tcl_Obj *const *objv,
int skip)
{
- register CallContext *contextPtr = (CallContext *) context;
+ CallContext *contextPtr = (CallContext *) context;
if (contextPtr->index + 1 >= contextPtr->callPtr->numChain) {
/*
diff --git a/generic/tclOOBasic.c b/generic/tclOOBasic.c
index 13c98f4..6de7513 100644
--- a/generic/tclOOBasic.c
+++ b/generic/tclOOBasic.c
@@ -426,7 +426,7 @@ TclOO_Object_Eval(
{
CallContext *contextPtr = (CallContext *) context;
Tcl_Object object = Tcl_ObjectContextObject(context);
- register const int skip = Tcl_ObjectContextSkippedArgs(context);
+ const int skip = Tcl_ObjectContextSkippedArgs(context);
CallFrame *framePtr, **framePtrPtr = &framePtr;
Tcl_Obj *scriptPtr;
CmdFrame *invoker;
@@ -1122,7 +1122,7 @@ TclOOSelfObjCmd(
Tcl_SetErrorCode(interp, "TCL", "OO", "UNMATCHED_CONTEXT", NULL);
return TCL_ERROR;
} else {
- register struct MInvoke *miPtr = &CurrentlyInvoked(contextPtr);
+ struct MInvoke *miPtr = &CurrentlyInvoked(contextPtr);
Object *oPtr;
const char *type;
diff --git a/generic/tclOOCall.c b/generic/tclOOCall.c
index c0d2e64..f3474b6 100644
--- a/generic/tclOOCall.c
+++ b/generic/tclOOCall.c
@@ -168,7 +168,7 @@ void
TclOODeleteContext(
CallContext *contextPtr)
{
- register Object *oPtr = contextPtr->oPtr;
+ Object *oPtr = contextPtr->oPtr;
TclOODeleteChain(contextPtr->callPtr);
if (oPtr != NULL) {
@@ -314,7 +314,7 @@ TclOOInvokeContext(
int objc, /* The number of arguments. */
Tcl_Obj *const objv[]) /* The arguments as actually seen. */
{
- register CallContext *const contextPtr = clientData;
+ CallContext *const contextPtr = clientData;
Method *const mPtr = contextPtr->callPtr->chain[contextPtr->index].mPtr;
const int isFilter =
contextPtr->callPtr->chain[contextPtr->index].isFilter;
@@ -968,7 +968,7 @@ AddMethodToCallChain(
* looking to add things from a mixin and have
* not passed a mixin. */
{
- register CallChain *callPtr = cbPtr->callChainPtr;
+ CallChain *callPtr = cbPtr->callChainPtr;
int i;
/*
@@ -1656,7 +1656,7 @@ AddPrivatesFromClassChainToCallContext(
(char *) methodName);
if (hPtr != NULL) {
- register Method *mPtr = Tcl_GetHashValue(hPtr);
+ Method *mPtr = Tcl_GetHashValue(hPtr);
if (IS_PRIVATE(mPtr)) {
AddMethodToCallChain(mPtr, cbPtr, doneFilters, filterDecl,
@@ -1740,7 +1740,7 @@ AddSimpleClassChainToCallContext(
privateDanger |= 1;
}
if (hPtr != NULL) {
- register Method *mPtr = Tcl_GetHashValue(hPtr);
+ Method *mPtr = Tcl_GetHashValue(hPtr);
if (!IS_PRIVATE(mPtr)) {
if (!(flags & KNOWN_STATE)) {
diff --git a/generic/tclOODefineCmds.c b/generic/tclOODefineCmds.c
index fb16007..f259954 100644
--- a/generic/tclOODefineCmds.c
+++ b/generic/tclOODefineCmds.c
@@ -779,7 +779,7 @@ FindCommand(
{
int length;
const char *nameStr, *string = TclGetStringFromObj(stringObj, &length);
- register Namespace *const nsPtr = (Namespace *) namespacePtr;
+ Namespace *const nsPtr = (Namespace *) namespacePtr;
FOREACH_HASH_DECLS;
Tcl_Command cmd, cmd2;
diff --git a/generic/tclOOInt.h b/generic/tclOOInt.h
index 1f44ef8..b5b7d6c 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 { \
- unsigned len = sizeof(type) * ((target).num=(source).num);\
+ size_t len = sizeof(type) * ((target).num=(source).num);\
if (len != 0) { \
memcpy(((target).list=(type*)ckalloc(len)), (source).list, len); \
} else { \
diff --git a/generic/tclOOMethod.c b/generic/tclOOMethod.c
index 32dd3c7..78421e1 100644
--- a/generic/tclOOMethod.c
+++ b/generic/tclOOMethod.c
@@ -149,8 +149,8 @@ Tcl_NewInstanceMethod(
void *clientData) /* Some data associated with the particular
* method to be created. */
{
- register Object *oPtr = (Object *) object;
- register Method *mPtr;
+ Object *oPtr = (Object *) object;
+ Method *mPtr;
Tcl_HashEntry *hPtr;
int isNew;
@@ -221,8 +221,8 @@ Tcl_NewMethod(
void *clientData) /* Some data associated with the particular
* method to be created. */
{
- register Class *clsPtr = (Class *) cls;
- register Method *mPtr;
+ Class *clsPtr = (Class *) cls;
+ Method *mPtr;
Tcl_HashEntry *hPtr;
int isNew;
@@ -344,7 +344,7 @@ TclOONewProcInstanceMethod(
* interested. */
{
int argsLen;
- register ProcedureMethod *pmPtr;
+ ProcedureMethod *pmPtr;
Tcl_Method method;
if (Tcl_ListObjLength(interp, argsObj, &argsLen) != TCL_OK) {
@@ -396,7 +396,7 @@ TclOONewProcMethod(
* interested. */
{
int argsLen; /* -1 => delete argsObj before exit */
- register ProcedureMethod *pmPtr;
+ ProcedureMethod *pmPtr;
const char *procName;
Tcl_Method method;
@@ -796,7 +796,7 @@ PushMethodCallFrame(
* frame. */
{
Namespace *nsPtr = (Namespace *) contextPtr->oPtr->namespacePtr;
- register int result;
+ int result;
const char *namePtr;
CallFrame **framePtrPtr = &fdPtr->framePtr;
ByteCode *codePtr;
@@ -829,7 +829,7 @@ PushMethodCallFrame(
*/
if (pmPtr->flags & USE_DECLARER_NS) {
- register Method *mPtr =
+ Method *mPtr =
contextPtr->callPtr->chain[contextPtr->index].mPtr;
if (mPtr->declaringClassPtr != NULL) {
@@ -900,7 +900,7 @@ PushMethodCallFrame(
fdPtr->efi.fields[1].proc = pmPtr->gfivProc;
fdPtr->efi.fields[1].clientData = pmPtr;
} else {
- register Tcl_Method method =
+ Tcl_Method method =
Tcl_ObjectContextMethod((Tcl_ObjectContext) contextPtr);
if (Tcl_MethodDeclarerObject(method) != NULL) {
@@ -1294,7 +1294,7 @@ static void
DeleteProcedureMethod(
void *clientData)
{
- register ProcedureMethod *pmPtr = clientData;
+ ProcedureMethod *pmPtr = clientData;
if (pmPtr->refCount-- <= 1) {
DeleteProcedureMethodRecord(pmPtr);
@@ -1387,7 +1387,7 @@ TclOONewForwardInstanceMethod(
* prefix to forward to. */
{
int prefixLen;
- register ForwardMethod *fmPtr;
+ ForwardMethod *fmPtr;
if (Tcl_ListObjLength(interp, prefixObj, &prefixLen) != TCL_OK) {
return NULL;
@@ -1426,7 +1426,7 @@ TclOONewForwardMethod(
* prefix to forward to. */
{
int prefixLen;
- register ForwardMethod *fmPtr;
+ ForwardMethod *fmPtr;
if (Tcl_ListObjLength(interp, prefixObj, &prefixLen) != TCL_OK) {
return NULL;
diff --git a/generic/tclObj.c b/generic/tclObj.c
index d329aba..5c8217a 100644
--- a/generic/tclObj.c
+++ b/generic/tclObj.c
@@ -811,7 +811,7 @@ TclThreadFinalizeContLines(
*
* Tcl_RegisterObjType --
*
- * This function is called to register a new Tcl object type in the table
+ * This function is called to a new Tcl object type in the table
* of all object types supported by Tcl.
*
* Results:
@@ -870,7 +870,7 @@ Tcl_AppendAllObjTypes(
* name of each registered type is appended as
* a list element. */
{
- register Tcl_HashEntry *hPtr;
+ Tcl_HashEntry *hPtr;
Tcl_HashSearch search;
int numElems;
@@ -918,7 +918,7 @@ const Tcl_ObjType *
Tcl_GetObjType(
const char *typeName) /* Name of Tcl object type to look up. */
{
- register Tcl_HashEntry *hPtr;
+ Tcl_HashEntry *hPtr;
const Tcl_ObjType *typePtr = NULL;
Tcl_MutexLock(&tableMutex);
@@ -1048,10 +1048,10 @@ TclDbDumpActiveObjects(
#ifdef TCL_MEM_DEBUG
void
TclDbInitNewObj(
- register Tcl_Obj *objPtr,
- register const char *file, /* The name of the source file calling this
+ Tcl_Obj *objPtr,
+ const char *file, /* The name of the source file calling this
* function; used for debugging. */
- register int line) /* Line number in the source file; used for
+ int line) /* Line number in the source file; used for
* debugging. */
{
objPtr->refCount = 0;
@@ -1135,7 +1135,7 @@ Tcl_NewObj(void)
Tcl_Obj *
Tcl_NewObj(void)
{
- register Tcl_Obj *objPtr;
+ Tcl_Obj *objPtr;
/*
* Use the macro defined in tclInt.h - it will use the correct allocator.
@@ -1177,12 +1177,12 @@ Tcl_NewObj(void)
Tcl_Obj *
Tcl_DbNewObj(
- register const char *file, /* The name of the source file calling this
+ const char *file, /* The name of the source file calling this
* function; used for debugging. */
- register int line) /* Line number in the source file; used for
+ int line) /* Line number in the source file; used for
* debugging. */
{
- register Tcl_Obj *objPtr;
+ Tcl_Obj *objPtr;
/*
* Use the macro defined in tclInt.h - it will use the correct allocator.
@@ -1232,8 +1232,8 @@ TclAllocateFreeObjects(void)
{
size_t bytesToAlloc = (OBJS_TO_ALLOC_EACH_TIME * sizeof(Tcl_Obj));
char *basePtr;
- register Tcl_Obj *prevPtr, *objPtr;
- register int i;
+ Tcl_Obj *prevPtr, *objPtr;
+ int i;
/*
* This has been noted by Purify to be a potential leak. The problem is
@@ -1284,9 +1284,9 @@ TclAllocateFreeObjects(void)
#ifdef TCL_MEM_DEBUG
void
TclFreeObj(
- register Tcl_Obj *objPtr) /* The object to be freed. */
+ Tcl_Obj *objPtr) /* The object to be freed. */
{
- register const Tcl_ObjType *typePtr = objPtr->typePtr;
+ const Tcl_ObjType *typePtr = objPtr->typePtr;
/*
* This macro declares a variable, so must come here...
@@ -1409,7 +1409,7 @@ TclFreeObj(
void
TclFreeObj(
- register Tcl_Obj *objPtr) /* The object to be freed. */
+ Tcl_Obj *objPtr) /* The object to be freed. */
{
/*
* Invalidate the string rep first so we can use the bytes value for our
@@ -1618,7 +1618,7 @@ TclSetDuplicateObj(
char *
Tcl_GetString(
- register Tcl_Obj *objPtr) /* Object whose string rep byte pointer should
+ Tcl_Obj *objPtr) /* Object whose string rep byte pointer should
* be returned. */
{
if (objPtr->bytes == NULL) {
@@ -1674,9 +1674,9 @@ Tcl_GetString(
char *
Tcl_GetStringFromObj(
- register Tcl_Obj *objPtr, /* Object whose string rep byte pointer should
+ Tcl_Obj *objPtr, /* Object whose string rep byte pointer should
* be returned. */
- register int *lengthPtr) /* If non-NULL, the location where the string
+ int *lengthPtr) /* If non-NULL, the location where the string
* rep's byte array length should * be stored.
* If NULL, no length is stored. */
{
@@ -1816,7 +1816,7 @@ Tcl_InitStringRep(
void
Tcl_InvalidateStringRep(
- register Tcl_Obj *objPtr) /* Object whose string rep byte pointer should
+ Tcl_Obj *objPtr) /* Object whose string rep byte pointer should
* be freed. */
{
TclInvalidateStringRep(objPtr);
@@ -1961,7 +1961,7 @@ Tcl_FreeIntRep(
Tcl_Obj *
Tcl_NewBooleanObj(
- register int boolValue) /* Boolean used to initialize new object. */
+ int boolValue) /* Boolean used to initialize new object. */
{
return Tcl_DbNewWideIntObj(boolValue!=0, "unknown", 0);
}
@@ -1970,9 +1970,9 @@ Tcl_NewBooleanObj(
Tcl_Obj *
Tcl_NewBooleanObj(
- register int boolValue) /* Boolean used to initialize new object. */
+ int boolValue) /* Boolean used to initialize new object. */
{
- register Tcl_Obj *objPtr;
+ Tcl_Obj *objPtr;
TclNewIntObj(objPtr, boolValue!=0);
return objPtr;
@@ -2011,13 +2011,13 @@ Tcl_NewBooleanObj(
Tcl_Obj *
Tcl_DbNewBooleanObj(
- register int boolValue, /* Boolean used to initialize new object. */
+ int boolValue, /* Boolean used to initialize new object. */
const char *file, /* The name of the source file calling this
* function; used for debugging. */
int line) /* Line number in the source file; used for
* debugging. */
{
- register Tcl_Obj *objPtr;
+ Tcl_Obj *objPtr;
TclDbNewObj(objPtr, file, line);
/* Optimized TclInvalidateStringRep() */
@@ -2032,7 +2032,7 @@ Tcl_DbNewBooleanObj(
Tcl_Obj *
Tcl_DbNewBooleanObj(
- register int boolValue, /* Boolean used to initialize new object. */
+ int boolValue, /* Boolean used to initialize new object. */
const char *file, /* The name of the source file calling this
* function; used for debugging. */
int line) /* Line number in the source file; used for
@@ -2063,8 +2063,8 @@ Tcl_DbNewBooleanObj(
#undef Tcl_SetBooleanObj
void
Tcl_SetBooleanObj(
- register Tcl_Obj *objPtr, /* Object whose internal rep to init. */
- register int boolValue) /* Boolean used to set object's value. */
+ Tcl_Obj *objPtr, /* Object whose internal rep to init. */
+ int boolValue) /* Boolean used to set object's value. */
{
if (Tcl_IsShared(objPtr)) {
Tcl_Panic("%s called with shared object", "Tcl_SetBooleanObj");
@@ -2096,8 +2096,8 @@ Tcl_SetBooleanObj(
int
Tcl_GetBooleanFromObj(
Tcl_Interp *interp, /* Used for error reporting if not NULL. */
- register Tcl_Obj *objPtr, /* The object from which to get boolean. */
- register int *boolPtr) /* Place to store resulting boolean. */
+ Tcl_Obj *objPtr, /* The object from which to get boolean. */
+ int *boolPtr) /* Place to store resulting boolean. */
{
do {
if (objPtr->typePtr == &tclIntType) {
@@ -2162,7 +2162,7 @@ Tcl_GetBooleanFromObj(
int
TclSetBooleanFromAny(
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. */
{
/*
* For some "pure" numeric Tcl_ObjTypes (no string rep), we can determine
@@ -2208,7 +2208,7 @@ TclSetBooleanFromAny(
static int
ParseBoolean(
- register Tcl_Obj *objPtr) /* The object to parse/convert. */
+ Tcl_Obj *objPtr) /* The object to parse/convert. */
{
int newBool;
char lowerCase[6];
@@ -2350,7 +2350,7 @@ ParseBoolean(
Tcl_Obj *
Tcl_NewDoubleObj(
- register double dblValue) /* Double used to initialize the object. */
+ double dblValue) /* Double used to initialize the object. */
{
return Tcl_DbNewDoubleObj(dblValue, "unknown", 0);
}
@@ -2359,9 +2359,9 @@ Tcl_NewDoubleObj(
Tcl_Obj *
Tcl_NewDoubleObj(
- register double dblValue) /* Double used to initialize the object. */
+ double dblValue) /* Double used to initialize the object. */
{
- register Tcl_Obj *objPtr;
+ Tcl_Obj *objPtr;
TclNewDoubleObj(objPtr, dblValue);
return objPtr;
@@ -2398,13 +2398,13 @@ Tcl_NewDoubleObj(
Tcl_Obj *
Tcl_DbNewDoubleObj(
- register double dblValue, /* Double used to initialize the object. */
+ double dblValue, /* Double used to initialize the object. */
const char *file, /* The name of the source file calling this
* function; used for debugging. */
int line) /* Line number in the source file; used for
* debugging. */
{
- register Tcl_Obj *objPtr;
+ Tcl_Obj *objPtr;
TclDbNewObj(objPtr, file, line);
/* Optimized TclInvalidateStringRep() */
@@ -2419,7 +2419,7 @@ Tcl_DbNewDoubleObj(
Tcl_Obj *
Tcl_DbNewDoubleObj(
- register double dblValue, /* Double used to initialize the object. */
+ double dblValue, /* Double used to initialize the object. */
const char *file, /* The name of the source file calling this
* function; used for debugging. */
int line) /* Line number in the source file; used for
@@ -2449,8 +2449,8 @@ Tcl_DbNewDoubleObj(
void
Tcl_SetDoubleObj(
- register Tcl_Obj *objPtr, /* Object whose internal rep to init. */
- register double dblValue) /* Double used to set the object's value. */
+ Tcl_Obj *objPtr, /* Object whose internal rep to init. */
+ double dblValue) /* Double used to set the object's value. */
{
if (Tcl_IsShared(objPtr)) {
Tcl_Panic("%s called with shared object", "Tcl_SetDoubleObj");
@@ -2482,8 +2482,8 @@ Tcl_SetDoubleObj(
int
Tcl_GetDoubleFromObj(
Tcl_Interp *interp, /* Used for error reporting if not NULL. */
- register Tcl_Obj *objPtr, /* The object from which to get a double. */
- register double *dblPtr) /* Place to store resulting double. */
+ Tcl_Obj *objPtr, /* The object from which to get a double. */
+ double *dblPtr) /* Place to store resulting double. */
{
do {
if (objPtr->typePtr == &tclDoubleType) {
@@ -2537,7 +2537,7 @@ Tcl_GetDoubleFromObj(
static int
SetDoubleFromAny(
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. */
{
return TclParseNumber(interp, objPtr, "floating-point number", NULL, -1,
NULL, 0);
@@ -2566,7 +2566,7 @@ SetDoubleFromAny(
static void
UpdateStringOfDouble(
- register Tcl_Obj *objPtr) /* Double obj with string rep to update. */
+ Tcl_Obj *objPtr) /* Double obj with string rep to update. */
{
char *dst = Tcl_InitStringRep(objPtr, NULL, TCL_DOUBLE_SPACE);
@@ -2612,7 +2612,7 @@ UpdateStringOfDouble(
Tcl_Obj *
Tcl_NewIntObj(
- register int intValue) /* Int used to initialize the new object. */
+ int intValue) /* Int used to initialize the new object. */
{
return Tcl_DbNewWideIntObj((long)intValue, "unknown", 0);
}
@@ -2621,9 +2621,9 @@ Tcl_NewIntObj(
Tcl_Obj *
Tcl_NewIntObj(
- register int intValue) /* Int used to initialize the new object. */
+ int intValue) /* Int used to initialize the new object. */
{
- register Tcl_Obj *objPtr;
+ Tcl_Obj *objPtr;
TclNewIntObj(objPtr, intValue);
return objPtr;
@@ -2652,8 +2652,8 @@ Tcl_NewIntObj(
#undef Tcl_SetIntObj
void
Tcl_SetIntObj(
- register Tcl_Obj *objPtr, /* Object whose internal rep to init. */
- register int intValue) /* Integer used to set object's value. */
+ Tcl_Obj *objPtr, /* Object whose internal rep to init. */
+ int intValue) /* Integer used to set object's value. */
{
if (Tcl_IsShared(objPtr)) {
Tcl_Panic("%s called with shared object", "Tcl_SetIntObj");
@@ -2692,8 +2692,8 @@ Tcl_SetIntObj(
int
Tcl_GetIntFromObj(
Tcl_Interp *interp, /* Used for error reporting if not NULL. */
- register Tcl_Obj *objPtr, /* The object from which to get a int. */
- register int *intPtr) /* Place to store resulting int. */
+ Tcl_Obj *objPtr, /* The object from which to get a int. */
+ int *intPtr) /* Place to store resulting int. */
{
#if (LONG_MAX == INT_MAX)
return TclGetLongFromObj(interp, objPtr, (long *) intPtr);
@@ -2763,7 +2763,7 @@ SetIntFromAny(
static void
UpdateStringOfInt(
- register Tcl_Obj *objPtr) /* Int object whose string rep to update. */
+ Tcl_Obj *objPtr) /* Int object whose string rep to update. */
{
char *dst = Tcl_InitStringRep( objPtr, NULL, TCL_INTEGER_SPACE);
@@ -2775,7 +2775,7 @@ UpdateStringOfInt(
#if !defined(TCL_NO_DEPRECATED) && TCL_MAJOR_VERSION < 9 && !defined(TCL_WIDE_INT_IS_LONG)
static void
UpdateStringOfOldInt(
- register Tcl_Obj *objPtr) /* Int object whose string rep to update. */
+ Tcl_Obj *objPtr) /* Int object whose string rep to update. */
{
char *dst = Tcl_InitStringRep( objPtr, NULL, TCL_INTEGER_SPACE);
@@ -2821,7 +2821,7 @@ UpdateStringOfOldInt(
Tcl_Obj *
Tcl_NewLongObj(
- register long longValue) /* Long integer used to initialize the
+ long longValue) /* Long integer used to initialize the
* new object. */
{
return Tcl_DbNewWideIntObj(longValue, "unknown", 0);
@@ -2831,10 +2831,10 @@ Tcl_NewLongObj(
Tcl_Obj *
Tcl_NewLongObj(
- register long longValue) /* Long integer used to initialize the
+ long longValue) /* Long integer used to initialize the
* new object. */
{
- register Tcl_Obj *objPtr;
+ Tcl_Obj *objPtr;
TclNewIntObj(objPtr, longValue);
return objPtr;
@@ -2880,14 +2880,14 @@ Tcl_NewLongObj(
Tcl_Obj *
Tcl_DbNewLongObj(
- register long longValue, /* Long integer used to initialize the new
+ long longValue, /* Long integer used to initialize the new
* object. */
const char *file, /* The name of the source file calling this
* function; used for debugging. */
int line) /* Line number in the source file; used for
* debugging. */
{
- register Tcl_Obj *objPtr;
+ Tcl_Obj *objPtr;
TclDbNewObj(objPtr, file, line);
/* Optimized TclInvalidateStringRep */
@@ -2902,7 +2902,7 @@ Tcl_DbNewLongObj(
Tcl_Obj *
Tcl_DbNewLongObj(
- register long longValue, /* Long integer used to initialize the new
+ long longValue, /* Long integer used to initialize the new
* object. */
const char *file, /* The name of the source file calling this
* function; used for debugging. */
@@ -2936,8 +2936,8 @@ Tcl_DbNewLongObj(
#undef Tcl_SetLongObj
void
Tcl_SetLongObj(
- register Tcl_Obj *objPtr, /* Object whose internal rep to init. */
- register long longValue) /* Long integer used to initialize the
+ Tcl_Obj *objPtr, /* Object whose internal rep to init. */
+ long longValue) /* Long integer used to initialize the
* object's value. */
{
if (Tcl_IsShared(objPtr)) {
@@ -2972,8 +2972,8 @@ Tcl_SetLongObj(
int
Tcl_GetLongFromObj(
Tcl_Interp *interp, /* Used for error reporting if not NULL. */
- register Tcl_Obj *objPtr, /* The object from which to get a long. */
- register long *longPtr) /* Place to store resulting long. */
+ Tcl_Obj *objPtr, /* The object from which to get a long. */
+ long *longPtr) /* Place to store resulting long. */
{
do {
#ifdef TCL_WIDE_INT_IS_LONG
@@ -3086,7 +3086,7 @@ Tcl_GetLongFromObj(
Tcl_Obj *
Tcl_NewWideIntObj(
- register Tcl_WideInt wideValue)
+ Tcl_WideInt wideValue)
/* Wide integer used to initialize the new
* object. */
{
@@ -3097,11 +3097,11 @@ Tcl_NewWideIntObj(
Tcl_Obj *
Tcl_NewWideIntObj(
- register Tcl_WideInt wideValue)
+ Tcl_WideInt wideValue)
/* Wide integer used to initialize the new
* object. */
{
- register Tcl_Obj *objPtr;
+ Tcl_Obj *objPtr;
TclNewObj(objPtr);
TclSetIntObj(objPtr, wideValue);
@@ -3145,7 +3145,7 @@ Tcl_NewWideIntObj(
Tcl_Obj *
Tcl_DbNewWideIntObj(
- register Tcl_WideInt wideValue,
+ Tcl_WideInt wideValue,
/* Wide integer used to initialize the new
* object. */
const char *file, /* The name of the source file calling this
@@ -3153,7 +3153,7 @@ Tcl_DbNewWideIntObj(
int line) /* Line number in the source file; used for
* debugging. */
{
- register Tcl_Obj *objPtr;
+ Tcl_Obj *objPtr;
TclDbNewObj(objPtr, file, line);
TclSetIntObj(objPtr, wideValue);
@@ -3164,7 +3164,7 @@ Tcl_DbNewWideIntObj(
Tcl_Obj *
Tcl_DbNewWideIntObj(
- register Tcl_WideInt wideValue,
+ Tcl_WideInt wideValue,
/* Long integer used to initialize the new
* object. */
const char *file, /* The name of the source file calling this
@@ -3196,8 +3196,8 @@ Tcl_DbNewWideIntObj(
void
Tcl_SetWideIntObj(
- register Tcl_Obj *objPtr, /* Object w. internal rep to init. */
- register Tcl_WideInt wideValue)
+ Tcl_Obj *objPtr, /* Object w. internal rep to init. */
+ Tcl_WideInt wideValue)
/* Wide integer used to initialize the
* object's value. */
{
@@ -3232,8 +3232,8 @@ Tcl_SetWideIntObj(
int
Tcl_GetWideIntFromObj(
Tcl_Interp *interp, /* Used for error reporting if not NULL. */
- register Tcl_Obj *objPtr, /* Object from which to get a wide int. */
- register Tcl_WideInt *wideIntPtr)
+ Tcl_Obj *objPtr, /* Object from which to get a wide int. */
+ Tcl_WideInt *wideIntPtr)
/* Place to store resulting long. */
{
do {
@@ -3925,7 +3925,7 @@ Tcl_IsShared(
void
Tcl_DbIncrRefCount(
- register Tcl_Obj *objPtr, /* The object we are registering a reference
+ Tcl_Obj *objPtr, /* The object we are registering a reference
* to. */
const char *file, /* The name of the source file calling this
* function; used for debugging. */
@@ -3988,7 +3988,7 @@ Tcl_DbIncrRefCount(
void
Tcl_DbDecrRefCount(
- register Tcl_Obj *objPtr, /* The object we are releasing a reference
+ Tcl_Obj *objPtr, /* The object we are releasing a reference
* to. */
const char *file, /* The name of the source file calling this
* function; used for debugging. */
@@ -4054,7 +4054,7 @@ Tcl_DbDecrRefCount(
int
Tcl_DbIsShared(
- register Tcl_Obj *objPtr, /* The object to test for being shared. */
+ Tcl_Obj *objPtr, /* The object to test for being shared. */
const char *file, /* The name of the source file calling this
* function; used for debugging. */
int line) /* Line number in the source file; used for
@@ -4126,7 +4126,7 @@ Tcl_DbIsShared(
void
Tcl_InitObjHashTable(
- register Tcl_HashTable *tablePtr)
+ Tcl_HashTable *tablePtr)
/* Pointer to table record, which is supplied
* by the caller. */
{
@@ -4189,8 +4189,8 @@ TclCompareObjKeys(
{
Tcl_Obj *objPtr1 = keyPtr;
Tcl_Obj *objPtr2 = (Tcl_Obj *) hPtr->key.oneWordValue;
- register const char *p1, *p2;
- register size_t l1, l2;
+ const char *p1, *p2;
+ size_t l1, l2;
/*
* If the object pointers are the same then they match.
@@ -4347,13 +4347,13 @@ Tcl_Command
Tcl_GetCommandFromObj(
Tcl_Interp *interp, /* The interpreter in which to resolve the
* command and to report errors. */
- register Tcl_Obj *objPtr) /* The object containing the command's name.
+ Tcl_Obj *objPtr) /* The object containing the command's name.
* If the name starts with "::", will be
* looked up in global namespace. Else, looked
* up first in the current namespace, then in
* global namespace. */
{
- register ResolvedCmdName *resPtr;
+ ResolvedCmdName *resPtr;
/*
* Get the internal representation, converting to a command type if
@@ -4376,12 +4376,12 @@ Tcl_GetCommandFromObj(
resPtr = objPtr->internalRep.twoPtrValue.ptr1;
if (objPtr->typePtr == &tclCmdNameType) {
- register Command *cmdPtr = resPtr->cmdPtr;
+ Command *cmdPtr = resPtr->cmdPtr;
if ((cmdPtr->cmdEpoch == resPtr->cmdEpoch)
&& (interp == cmdPtr->nsPtr->interp)
&& !(cmdPtr->nsPtr->flags & NS_DYING)) {
- register Namespace *refNsPtr = (Namespace *)
+ Namespace *refNsPtr = (Namespace *)
TclGetCurrentNamespace(interp);
if ((resPtr->refNsPtr == NULL)
@@ -4483,12 +4483,12 @@ void
TclSetCmdNameObj(
Tcl_Interp *interp, /* Points to interpreter containing command
* that should be cached in objPtr. */
- register Tcl_Obj *objPtr, /* Points to Tcl object to be changed to a
+ Tcl_Obj *objPtr, /* Points to Tcl object to be changed to a
* CmdName object. */
Command *cmdPtr) /* Points to Command structure that the
* CmdName object should refer to. */
{
- register ResolvedCmdName *resPtr;
+ ResolvedCmdName *resPtr;
if (objPtr->typePtr == &tclCmdNameType) {
resPtr = objPtr->internalRep.twoPtrValue.ptr1;
@@ -4523,10 +4523,10 @@ TclSetCmdNameObj(
static void
FreeCmdNameInternalRep(
- register Tcl_Obj *objPtr) /* CmdName object with internal
+ Tcl_Obj *objPtr) /* CmdName object with internal
* representation to free. */
{
- register ResolvedCmdName *resPtr = objPtr->internalRep.twoPtrValue.ptr1;
+ ResolvedCmdName *resPtr = objPtr->internalRep.twoPtrValue.ptr1;
/*
* Decrement the reference count of the ResolvedCmdName structure. If
@@ -4571,9 +4571,9 @@ FreeCmdNameInternalRep(
static void
DupCmdNameInternalRep(
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. */
{
- register ResolvedCmdName *resPtr = srcPtr->internalRep.twoPtrValue.ptr1;
+ ResolvedCmdName *resPtr = srcPtr->internalRep.twoPtrValue.ptr1;
copyPtr->internalRep.twoPtrValue.ptr1 = resPtr;
copyPtr->internalRep.twoPtrValue.ptr2 = NULL;
@@ -4605,11 +4605,11 @@ DupCmdNameInternalRep(
static int
SetCmdNameFromAny(
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. */
{
const char *name;
- register Command *cmdPtr;
- register ResolvedCmdName *resPtr;
+ Command *cmdPtr;
+ ResolvedCmdName *resPtr;
if (interp == NULL) {
return TCL_ERROR;
diff --git a/generic/tclPanic.c b/generic/tclPanic.c
index e8c1e7f..4fce082 100644
--- a/generic/tclPanic.c
+++ b/generic/tclPanic.c
@@ -58,7 +58,7 @@ Tcl_SetPanicProc(
else
#endif
panicProc = proc;
- TclInitSubsystems();
+ Tcl_InitSubsystems();
}
/*
diff --git a/generic/tclParse.c b/generic/tclParse.c
index 448ce5e..897dbb6 100644
--- a/generic/tclParse.c
+++ b/generic/tclParse.c
@@ -195,19 +195,19 @@ Tcl_ParseCommand(
* NULL, then no error message is provided. */
const char *start, /* First character of string containing one or
* more Tcl commands. */
- register int numBytes, /* Total number of bytes in string. If < 0,
+ int numBytes, /* Total number of bytes in string. If < 0,
* the script consists of all bytes up to the
* first null character. */
int nested, /* Non-zero means this is a nested command:
* close bracket should be considered a
* command terminator. If zero, then close
* bracket has no special meaning. */
- register Tcl_Parse *parsePtr)
+ Tcl_Parse *parsePtr)
/* Structure to fill in with information about
* the parsed command; any previous
* information in the structure is ignored. */
{
- register const char *src; /* Points to current character in the
+ const char *src; /* Points to current character in the
* command. */
char type; /* Result returned by CHAR_TYPE(*src). */
Tcl_Token *tokenPtr; /* Pointer to token being filled in. */
@@ -620,14 +620,14 @@ TclIsBareword(
static int
ParseWhiteSpace(
const char *src, /* First character to parse. */
- register int numBytes, /* Max number of bytes to scan. */
+ int numBytes, /* Max number of bytes to scan. */
int *incompletePtr, /* Set this boolean memory to true if parsing
* indicates an incomplete command. */
char *typePtr) /* Points to location to store character type
* of character that ends run of whitespace */
{
- register char type = TYPE_NORMAL;
- register const char *p = src;
+ char type = TYPE_NORMAL;
+ const char *p = src;
while (1) {
while (numBytes && ((type = CHAR_TYPE(*p)) & TYPE_SPACE)) {
@@ -729,7 +729,7 @@ TclParseHex(
* conversion is to be written. */
{
int result = 0;
- register const char *p = src;
+ const char *p = src;
while (numBytes--) {
unsigned char digit = UCHAR(*p);
@@ -786,7 +786,7 @@ TclParseBackslash(
* encoding of the backslash sequence is to be
* written. At most 4 bytes will be written there. */
{
- register const char *p = src+1;
+ const char *p = src+1;
Tcl_UniChar unichar = 0;
int result;
int count;
@@ -966,12 +966,12 @@ TclParseBackslash(
static int
ParseComment(
const char *src, /* First character to parse. */
- register int numBytes, /* Max number of bytes to scan. */
+ int numBytes, /* Max number of bytes to scan. */
Tcl_Parse *parsePtr) /* Information about parse in progress.
* Updated if parsing indicates an incomplete
* command. */
{
- register const char *p = src;
+ const char *p = src;
int incomplete = parsePtr->incomplete;
while (numBytes) {
@@ -1038,8 +1038,8 @@ ParseComment(
static int
ParseTokens(
- register const char *src, /* First character to parse. */
- register int numBytes, /* Max number of bytes to scan. */
+ const char *src, /* First character to parse. */
+ int numBytes, /* Max number of bytes to scan. */
int mask, /* Specifies when to stop parsing. The parse
* stops at the first unquoted character whose
* CHAR_TYPE contains any of the bits in
@@ -1317,7 +1317,7 @@ Tcl_ParseVarName(
* NULL, then no error message is provided. */
const char *start, /* Start of variable substitution string.
* First character must be "$". */
- register int numBytes, /* Total number of bytes in string. If < 0,
+ int numBytes, /* Total number of bytes in string. If < 0,
* the string consists of all bytes up to the
* first null character. */
Tcl_Parse *parsePtr, /* Structure to fill in with information about
@@ -1328,7 +1328,7 @@ Tcl_ParseVarName(
* reinitialize it. */
{
Tcl_Token *tokenPtr;
- register const char *src;
+ const char *src;
int varIndex;
unsigned array;
@@ -1510,13 +1510,13 @@ Tcl_ParseVarName(
const char *
Tcl_ParseVar(
Tcl_Interp *interp, /* Context for looking up variable. */
- register const char *start, /* Start of variable substitution. First
+ const char *start, /* Start of variable substitution. First
* character must be "$". */
const char **termPtr) /* If non-NULL, points to word to fill in with
* character just after last one in the
* variable specifier. */
{
- register Tcl_Obj *objPtr;
+ Tcl_Obj *objPtr;
int code;
Tcl_Parse *parsePtr = TclStackAlloc(interp, sizeof(Tcl_Parse));
@@ -1595,10 +1595,10 @@ Tcl_ParseBraces(
* NULL, then no error message is provided. */
const char *start, /* Start of string enclosed in braces. The
* first character must be {'. */
- register int numBytes, /* Total number of bytes in string. If < 0,
+ int numBytes, /* Total number of bytes in string. If < 0,
* the string consists of all bytes up to the
* first null character. */
- register Tcl_Parse *parsePtr,
+ Tcl_Parse *parsePtr,
/* Structure to fill in with information about
* the string. */
int append, /* Non-zero means append tokens to existing
@@ -1611,7 +1611,7 @@ Tcl_ParseBraces(
* successful. */
{
Tcl_Token *tokenPtr;
- register const char *src;
+ const char *src;
int startIndex, level, length;
if ((numBytes == 0) || (start == NULL)) {
@@ -1737,7 +1737,7 @@ Tcl_ParseBraces(
*/
{
- register int openBrace = 0;
+ int openBrace = 0;
while (--src > start) {
switch (*src) {
@@ -1797,10 +1797,10 @@ Tcl_ParseQuotedString(
* NULL, then no error message is provided. */
const char *start, /* Start of the quoted string. The first
* character must be '"'. */
- register int numBytes, /* Total number of bytes in string. If < 0,
+ int numBytes, /* Total number of bytes in string. If < 0,
* the string consists of all bytes up to the
* first null character. */
- register Tcl_Parse *parsePtr,
+ Tcl_Parse *parsePtr,
/* Structure to fill in with information about
* the string. */
int append, /* Non-zero means append tokens to existing
diff --git a/generic/tclPathObj.c b/generic/tclPathObj.c
index 78d87b9..2fa93d8 100644
--- a/generic/tclPathObj.c
+++ b/generic/tclPathObj.c
@@ -2501,7 +2501,7 @@ DupFsPathInternalRep(
static void
UpdateStringOfFsPath(
- register Tcl_Obj *pathPtr) /* path obj with string rep to update. */
+ Tcl_Obj *pathPtr) /* path obj with string rep to update. */
{
FsPath *fsPathPtr = PATHOBJ(pathPtr);
int cwdLen;
diff --git a/generic/tclPipe.c b/generic/tclPipe.c
index 63fd2fa..70774e7 100644
--- a/generic/tclPipe.c
+++ b/generic/tclPipe.c
@@ -183,7 +183,7 @@ Tcl_DetachPids(
* array pointed to by pidPtr. */
Tcl_Pid *pidPtr) /* Array of pids to detach. */
{
- register Detached *detPtr;
+ Detached *detPtr;
int i;
Tcl_MutexLock(&pipeMutex);
@@ -219,7 +219,7 @@ Tcl_DetachPids(
void
Tcl_ReapDetachedProcs(void)
{
- register Detached *detPtr;
+ Detached *detPtr;
Detached *nextPtr, *prevPtr;
int status, code;
@@ -413,7 +413,7 @@ TclCreatePipeline(
* at *inPipePtr. NULL means command specified
* its own input source. */
TclFile *outPipePtr, /* If non-NULL, output to the pipeline goes to
- * a pipe, unless overriden by redirection in
+ * a pipe, unless overridden by redirection in
* the command. The file id with which to read
* frome this pipe is stored at *outPipePtr.
* NULL means command specified its own output
diff --git a/generic/tclPlatDecls.h b/generic/tclPlatDecls.h
index 354d752..edf1ba3 100644
--- a/generic/tclPlatDecls.h
+++ b/generic/tclPlatDecls.h
@@ -125,7 +125,7 @@ extern const TclPlatStubs *tclPlatStubsPtr;
#define Tcl_WinUtfToTChar(string, len, dsPtr) (Tcl_DStringInit(dsPtr), \
(TCHAR *)Tcl_UtfToChar16DString((string), (len), (dsPtr)))
#define Tcl_WinTCharToUtf(string, len, dsPtr) (Tcl_DStringInit(dsPtr), \
- (char *)Tcl_Char16ToUtfDString((string), ((((len) + 2) >> 1) - 1), (dsPtr)))
+ (char *)Tcl_Char16ToUtfDString((const unsigned short *)(string), ((((len) + 2) >> 1) - 1), (dsPtr)))
#endif
#endif
diff --git a/generic/tclProc.c b/generic/tclProc.c
index 1ed48ac..85d6531 100644
--- a/generic/tclProc.c
+++ b/generic/tclProc.c
@@ -808,7 +808,7 @@ TclObjGetFrame(
} else {
result = -1;
}
- } else if (TclGetWideBitsFromObj(interp, objPtr, &w) == TCL_OK) {
+ } else if (TclGetWideBitsFromObj(NULL, objPtr, &w) == TCL_OK) {
/*
* If this were an integer, we'd have succeeded already.
* Docs say we have to treat this as a 'bad level' error.
@@ -817,10 +817,16 @@ TclObjGetFrame(
}
}
- if (result == 0) {
- level = curLevel - 1;
- }
if (result != -1) {
+ /* if relative current level */
+ if (result == 0) {
+ if (!curLevel) {
+ /* we are in top-level, so simply generate bad level */
+ name = "1";
+ goto badLevel;
+ }
+ level = curLevel - 1;
+ }
if (level >= 0) {
CallFrame *framePtr;
for (framePtr = iPtr->varFramePtr; framePtr != NULL;
@@ -832,9 +838,9 @@ TclObjGetFrame(
}
}
}
-
+badLevel:
if (name == NULL) {
- name = TclGetString(objPtr);
+ name = objPtr ? TclGetString(objPtr) : "1" ;
}
Tcl_SetObjResult(interp, Tcl_ObjPrintf("bad level \"%s\"", name));
Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "LEVEL", name, NULL);
@@ -1847,9 +1853,7 @@ InterpProcNR2(
Tcl_SetErrorCode(interp, "TCL", "RESULT", "UNEXPECTED", NULL);
result = TCL_ERROR;
- /*
- * Fall through to the TCL_ERROR handling code.
- */
+ /* FALLTHRU */
case TCL_ERROR:
/*
diff --git a/generic/tclRegexp.c b/generic/tclRegexp.c
index d3f7428..b4fd811 100644
--- a/generic/tclRegexp.c
+++ b/generic/tclRegexp.c
@@ -725,12 +725,12 @@ TclRegError(
const char *p;
Tcl_ResetResult(interp);
- n = TclReError(status, NULL, buf, sizeof(buf));
+ n = TclReError(status, buf, sizeof(buf));
p = (n > sizeof(buf)) ? "..." : "";
Tcl_SetObjResult(interp, Tcl_ObjPrintf("%s%s%s", msg, buf, p));
sprintf(cbuf, "%d", status);
- (void) TclReError(REG_ITOA, NULL, cbuf, sizeof(cbuf));
+ (void) TclReError(REG_ITOA, cbuf, sizeof(cbuf));
Tcl_SetErrorCode(interp, "REGEXP", cbuf, buf, NULL);
}
diff --git a/generic/tclResult.c b/generic/tclResult.c
index 6e9d4a6..3c856d3 100644
--- a/generic/tclResult.c
+++ b/generic/tclResult.c
@@ -414,14 +414,14 @@ void
Tcl_SetResult(
Tcl_Interp *interp, /* Interpreter with which to associate the
* return value. */
- register char *result, /* Value to be returned. If NULL, the result
+ char *result, /* Value to be returned. If NULL, the result
* is set to an empty string. */
Tcl_FreeProc *freeProc) /* Gives information about the string:
* TCL_STATIC, TCL_VOLATILE, or the address of
* a Tcl_FreeProc such as free. */
{
Interp *iPtr = (Interp *) interp;
- register Tcl_FreeProc *oldFreeProc = iPtr->freeProc;
+ Tcl_FreeProc *oldFreeProc = iPtr->freeProc;
char *oldResult = iPtr->result;
if (result == NULL) {
@@ -484,7 +484,7 @@ Tcl_SetResult(
const char *
Tcl_GetStringResult(
- register Tcl_Interp *interp)/* Interpreter whose result to return. */
+ Tcl_Interp *interp)/* Interpreter whose result to return. */
{
Interp *iPtr = (Interp *) interp;
/*
@@ -523,11 +523,11 @@ void
Tcl_SetObjResult(
Tcl_Interp *interp, /* Interpreter with which to associate the
* return object value. */
- register Tcl_Obj *objPtr) /* Tcl object to be returned. If NULL, the obj
+ Tcl_Obj *objPtr) /* Tcl object to be returned. If NULL, the obj
* result is made an empty string object. */
{
- register Interp *iPtr = (Interp *) interp;
- register Tcl_Obj *oldObjResult = iPtr->objResultPtr;
+ Interp *iPtr = (Interp *) interp;
+ Tcl_Obj *oldObjResult = iPtr->objResultPtr;
iPtr->objResultPtr = objPtr;
Tcl_IncrRefCount(objPtr); /* since interp result is a reference */
@@ -582,7 +582,7 @@ Tcl_Obj *
Tcl_GetObjResult(
Tcl_Interp *interp) /* Interpreter whose result to return. */
{
- register Interp *iPtr = (Interp *) interp;
+ Interp *iPtr = (Interp *) interp;
#ifndef TCL_NO_DEPRECATED
Tcl_Obj *objResultPtr;
int length;
@@ -879,9 +879,9 @@ SetupAppendBuffer(
void
Tcl_FreeResult(
- register Tcl_Interp *interp)/* Interpreter for which to free result. */
+ Tcl_Interp *interp)/* Interpreter for which to free result. */
{
- register Interp *iPtr = (Interp *) interp;
+ Interp *iPtr = (Interp *) interp;
#ifndef TCL_NO_DEPRECATED
if (iPtr->freeProc != NULL) {
@@ -918,9 +918,9 @@ Tcl_FreeResult(
void
Tcl_ResetResult(
- register Tcl_Interp *interp)/* Interpreter for which to clear result. */
+ Tcl_Interp *interp)/* Interpreter for which to clear result. */
{
- register Interp *iPtr = (Interp *) interp;
+ Interp *iPtr = (Interp *) interp;
ResetObjResult(iPtr);
#ifndef TCL_NO_DEPRECATED
@@ -983,10 +983,10 @@ Tcl_ResetResult(
static void
ResetObjResult(
- register Interp *iPtr) /* Points to the interpreter whose result
+ Interp *iPtr) /* Points to the interpreter whose result
* object should be reset. */
{
- register Tcl_Obj *objResultPtr = iPtr->objResultPtr;
+ Tcl_Obj *objResultPtr = iPtr->objResultPtr;
if (Tcl_IsShared(objResultPtr)) {
TclDecrRefCount(objResultPtr);
diff --git a/generic/tclScan.c b/generic/tclScan.c
index 916809f..a3eb645 100644
--- a/generic/tclScan.c
+++ b/generic/tclScan.c
@@ -363,8 +363,10 @@ ValidateFormat(
format += TclUtfToUniChar(format, &ch);
break;
}
+ /* FALLTHRU */
case 'L':
flags |= SCAN_LONGER;
+ /* FALLTHRU */
case 'h':
format += TclUtfToUniChar(format, &ch);
}
@@ -386,9 +388,7 @@ ValidateFormat(
Tcl_SetErrorCode(interp, "TCL", "FORMAT", "BADWIDTH", NULL);
goto error;
}
- /*
- * Fall through!
- */
+ /* FALLTHRU */
case 'n':
case 's':
if (flags & (SCAN_LONGER|SCAN_BIG)) {
@@ -703,11 +703,10 @@ Tcl_ScanObjCmd(
format += TclUtfToUniChar(format, &ch);
break;
}
+ /* FALLTHRU */
case 'L':
flags |= SCAN_LONGER;
- /*
- * Fall through so we skip to the next character.
- */
+ /* FALLTHRU */
case 'h':
format += TclUtfToUniChar(format, &ch);
}
diff --git a/generic/tclStringObj.c b/generic/tclStringObj.c
index 1b4f225..072b642 100644
--- a/generic/tclStringObj.c
+++ b/generic/tclStringObj.c
@@ -2059,6 +2059,7 @@ Tcl_AppendFormatToObj(
}
case 'u':
+ /* FALLTHRU */
case 'd':
case 'o':
case 'p':
@@ -2718,6 +2719,7 @@ AppendPrintfToObjVA(
break;
case 'h':
size = -1;
+ /* FALLTHRU */
default:
p++;
}
diff --git a/generic/tclTest.c b/generic/tclTest.c
index 63a657c..61c88ba 100644
--- a/generic/tclTest.c
+++ b/generic/tclTest.c
@@ -220,6 +220,9 @@ static void SpecialFree(char *blockPtr);
static int StaticInitProc(Tcl_Interp *interp);
static int TestasyncCmd(void *dummy,
Tcl_Interp *interp, int argc, const char **argv);
+static int TestbumpinterpepochObjCmd(ClientData clientData,
+ Tcl_Interp *interp, int objc,
+ Tcl_Obj *const objv[]);
static int TestbytestringObjCmd(void *clientData,
Tcl_Interp *interp, int objc,
Tcl_Obj *const objv[]);
@@ -384,6 +387,12 @@ static int TestSimpleFilesystemObjCmd(
Tcl_Obj *const objv[]);
static void TestReport(const char *cmd, Tcl_Obj *arg1,
Tcl_Obj *arg2);
+static int TestgetencpathObjCmd(void *dummy,
+ Tcl_Interp *interp, int objc,
+ Tcl_Obj *const objv[]);
+static int TestsetencpathObjCmd(void *dummy,
+ Tcl_Interp *interp, int objc,
+ Tcl_Obj *const objv[]);
static Tcl_Obj * TestReportGetNativePath(Tcl_Obj *pathPtr);
static Tcl_FSStatProc TestReportStat;
static Tcl_FSAccessProc TestReportAccess;
@@ -596,6 +605,8 @@ Tcltest_Init(
Tcl_CreateObjCommand(interp, "testgetindexfromobjstruct",
TestGetIndexFromObjStructObjCmd, NULL, NULL);
Tcl_CreateCommand(interp, "testasync", TestasyncCmd, NULL, NULL);
+ Tcl_CreateObjCommand(interp, "testbumpinterpepoch",
+ TestbumpinterpepochObjCmd, NULL, NULL);
Tcl_CreateCommand(interp, "testchannel", TestChannelCmd,
NULL, NULL);
Tcl_CreateCommand(interp, "testchannelevent", TestChannelEventCmd,
@@ -726,6 +737,10 @@ Tcltest_Init(
NULL, NULL);
Tcl_CreateObjCommand(interp, "testinterpresolver", TestInterpResolverCmd,
NULL, NULL);
+ Tcl_CreateObjCommand(interp, "testgetencpath", TestgetencpathObjCmd,
+ NULL, NULL);
+ Tcl_CreateObjCommand(interp, "testsetencpath", TestsetencpathObjCmd,
+ NULL, NULL);
if (TclObjTest_Init(interp) != TCL_OK) {
return TCL_ERROR;
@@ -1036,6 +1051,22 @@ AsyncThreadProc(
}
#endif
+static int
+TestbumpinterpepochObjCmd(
+ ClientData dummy, /* Not used. */
+ Tcl_Interp *interp, /* Current interpreter. */
+ int objc, /* Number of arguments. */
+ Tcl_Obj *const objv[]) /* Argument objects. */
+{
+ Interp *iPtr = (Interp *)interp;
+ if (objc != 1) {
+ Tcl_WrongNumArgs(interp, 1, objv, "");
+ return TCL_ERROR;
+ }
+ iPtr->compileEpoch++;
+ return TCL_OK;
+}
+
/*
*----------------------------------------------------------------------
*
@@ -5171,7 +5202,7 @@ TestbytestringObjCmd(
static int
TestsetCmd(
void *data, /* Additional flags for Get/SetVar2. */
- register Tcl_Interp *interp,/* Current interpreter. */
+ Tcl_Interp *interp,/* Current interpreter. */
int argc, /* Number of arguments. */
const char **argv) /* Argument strings. */
{
@@ -5203,7 +5234,7 @@ TestsetCmd(
static int
Testset2Cmd(
void *data, /* Additional flags for Get/SetVar2. */
- register Tcl_Interp *interp,/* Current interpreter. */
+ Tcl_Interp *interp,/* Current interpreter. */
int argc, /* Number of arguments. */
const char **argv) /* Argument strings. */
{
@@ -5254,7 +5285,7 @@ Testset2Cmd(
static int
TestsaveresultCmd(
void *dummy, /* Not used. */
- register Tcl_Interp *interp,/* Current interpreter. */
+ Tcl_Interp *interp,/* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* The argument objects. */
{
@@ -5385,7 +5416,7 @@ TestsaveresultFree(
static int
TestmainthreadCmd(
void *dummy, /* Not used. */
- register Tcl_Interp *interp,/* Current interpreter. */
+ Tcl_Interp *interp,/* Current interpreter. */
int argc, /* Number of arguments. */
const char **argv) /* Argument strings. */
{
@@ -5446,7 +5477,7 @@ MainLoop(void)
static int
TestsetmainloopCmd(
void *dummy, /* Not used. */
- register Tcl_Interp *interp,/* Current interpreter. */
+ Tcl_Interp *interp,/* Current interpreter. */
int argc, /* Number of arguments. */
const char **argv) /* Argument strings. */
{
@@ -5475,7 +5506,7 @@ TestsetmainloopCmd(
static int
TestexitmainloopCmd(
void *dummy, /* Not used. */
- register Tcl_Interp *interp,/* Current interpreter. */
+ Tcl_Interp *interp,/* Current interpreter. */
int argc, /* Number of arguments. */
const char **argv) /* Argument strings. */
{
@@ -7520,6 +7551,72 @@ TestconcatobjCmd(
/*
*----------------------------------------------------------------------
*
+ * TestgetencpathObjCmd --
+ *
+ * This function implements the "testgetencpath" command. It is used to
+ * test Tcl_GetEncodingSearchPath().
+ *
+ * Results:
+ * A standard Tcl result.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static int
+TestgetencpathObjCmd(
+ ClientData clientData, /* Not used. */
+ Tcl_Interp *interp, /* Current interpreter. */
+ int objc, /* Number of arguments. */
+ Tcl_Obj *const *objv) /* Argument strings. */
+{
+ if (objc != 1) {
+ Tcl_WrongNumArgs(interp, 1, objv, "");
+ return TCL_ERROR;
+ }
+
+ Tcl_SetObjResult(interp, Tcl_GetEncodingSearchPath());
+ return TCL_OK;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TestsetencpathCmd --
+ *
+ * This function implements the "testsetencpath" command. It is used to
+ * test Tcl_SetDefaultEncodingDir().
+ *
+ * Results:
+ * A standard Tcl result.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static int
+TestsetencpathObjCmd(
+ ClientData clientData, /* Not used. */
+ Tcl_Interp *interp, /* Current interpreter. */
+ int objc, /* Number of arguments. */
+ Tcl_Obj *const *objv) /* Argument strings. */
+{
+ if (objc != 2) {
+ Tcl_WrongNumArgs(interp, 1, objv, "defaultDir");
+ return TCL_ERROR;
+ }
+
+ Tcl_SetEncodingSearchPath(objv[1]);
+ return TCL_OK;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
* TestparseargsCmd --
*
* This procedure implements the "testparseargs" command. It is used to
diff --git a/generic/tclTestObj.c b/generic/tclTestObj.c
index 699c503..28a9b93 100644
--- a/generic/tclTestObj.c
+++ b/generic/tclTestObj.c
@@ -53,7 +53,7 @@ static int TeststringobjCmd(ClientData dummy, Tcl_Interp *interp,
static void VarPtrDeleteProc(ClientData clientData, Tcl_Interp *interp)
{
- register int i;
+ int i;
Tcl_Obj **varPtr = (Tcl_Obj **) clientData;
for (i = 0; i < NUMBER_OF_OBJECT_VARS; i++) {
if (varPtr[i]) Tcl_DecrRefCount(varPtr[i]);
@@ -91,7 +91,7 @@ int
TclObjTest_Init(
Tcl_Interp *interp)
{
- register int i;
+ int i;
/*
* An array of Tcl_Obj pointers used in the commands that operate on or get
* the values of Tcl object-valued variables. varPtr[i] is the i-th variable's
@@ -1170,7 +1170,6 @@ TeststringobjCmd(
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
{
- Tcl_UniChar *unicode;
int varIndex, option, i, length;
#define MAX_STRINGS 11
const char *index, *string, *strings[MAX_STRINGS+1];
diff --git a/generic/tclThreadAlloc.c b/generic/tclThreadAlloc.c
index 3f1abc2..8dfe014 100644
--- a/generic/tclThreadAlloc.c
+++ b/generic/tclThreadAlloc.c
@@ -248,7 +248,7 @@ TclFreeAllocCache(
{
Cache *cachePtr = arg;
Cache **nextPtrPtr;
- register unsigned int bucket;
+ unsigned int bucket;
/*
* Flush blocks.
@@ -305,7 +305,7 @@ TclpAlloc(
{
Cache *cachePtr;
Block *blockPtr;
- register int bucket;
+ int bucket;
size_t size;
#ifndef __LP64__
@@ -537,8 +537,8 @@ TclpRealloc(
Tcl_Obj *
TclThreadAllocObj(void)
{
- register Cache *cachePtr;
- register Tcl_Obj *objPtr;
+ Cache *cachePtr;
+ Tcl_Obj *objPtr;
GETCACHE(cachePtr);
@@ -548,7 +548,7 @@ TclThreadAllocObj(void)
*/
if (cachePtr->numObjects == 0) {
- register int numMove;
+ int numMove;
Tcl_MutexLock(objLockPtr);
numMove = sharedPtr->numObjects;
@@ -709,7 +709,7 @@ MoveObjs(
Cache *toPtr,
int numMove)
{
- register Tcl_Obj *objPtr = fromPtr->firstObjPtr;
+ Tcl_Obj *objPtr = fromPtr->firstObjPtr;
Tcl_Obj *fromFirstObjPtr = objPtr;
toPtr->numObjects += numMove;
@@ -810,7 +810,7 @@ Block2Ptr(
int bucket,
unsigned int reqSize)
{
- register void *ptr;
+ void *ptr;
blockPtr->magicNum1 = blockPtr->magicNum2 = MAGIC;
blockPtr->sourceBucket = bucket;
@@ -826,7 +826,7 @@ static Block *
Ptr2Block(
char *ptr)
{
- register Block *blockPtr;
+ Block *blockPtr;
blockPtr = (((Block *) ptr) - 1);
if (blockPtr->magicNum1 != MAGIC || blockPtr->magicNum2 != MAGIC) {
@@ -960,8 +960,8 @@ GetBlocks(
Cache *cachePtr,
int bucket)
{
- register Block *blockPtr;
- register int n;
+ Block *blockPtr;
+ int n;
/*
* First, atttempt to move blocks from the shared cache. Note the
@@ -1006,7 +1006,7 @@ GetBlocks(
}
if (cachePtr->buckets[bucket].numFree == 0) {
- register size_t size;
+ size_t size;
/*
* If no blocks could be moved from shared, first look for a larger
@@ -1062,7 +1062,7 @@ GetBlocks(
* TclInitThreadAlloc --
*
* Initializes the allocator cache-maintenance structures.
- * It is done early and protected during the TclInitSubsystems().
+ * It is done early and protected during the Tcl_InitSubsystems().
*
* Results:
* None.
diff --git a/generic/tclTimer.c b/generic/tclTimer.c
index ea80320..934b329 100644
--- a/generic/tclTimer.c
+++ b/generic/tclTimer.c
@@ -217,7 +217,7 @@ TimerExitProc(
Tcl_DeleteEventSource(TimerSetupProc, TimerCheckProc, NULL);
if (tsdPtr != NULL) {
- register TimerHandler *timerHandlerPtr;
+ TimerHandler *timerHandlerPtr;
timerHandlerPtr = tsdPtr->firstTimerHandlerPtr;
while (timerHandlerPtr != NULL) {
@@ -294,7 +294,7 @@ TclCreateAbsoluteTimerHandler(
Tcl_TimerProc *proc,
ClientData clientData)
{
- register TimerHandler *timerHandlerPtr, *tPtr2, *prevPtr;
+ TimerHandler *timerHandlerPtr, *tPtr2, *prevPtr;
ThreadSpecificData *tsdPtr = InitTimer();
timerHandlerPtr = ckalloc(sizeof(TimerHandler));
@@ -355,7 +355,7 @@ Tcl_DeleteTimerHandler(
Tcl_TimerToken token) /* Result previously returned by
* Tcl_DeleteTimerHandler. */
{
- register TimerHandler *timerHandlerPtr, *prevPtr;
+ TimerHandler *timerHandlerPtr, *prevPtr;
ThreadSpecificData *tsdPtr = InitTimer();
if (token == NULL) {
@@ -621,7 +621,7 @@ Tcl_DoWhenIdle(
Tcl_IdleProc *proc, /* Function to invoke. */
ClientData clientData) /* Arbitrary value to pass to proc. */
{
- register IdleHandler *idlePtr;
+ IdleHandler *idlePtr;
Tcl_Time blockTime;
ThreadSpecificData *tsdPtr = InitTimer();
@@ -665,7 +665,7 @@ Tcl_CancelIdleCall(
Tcl_IdleProc *proc, /* Function that was previously registered. */
ClientData clientData) /* Arbitrary value to pass to proc. */
{
- register IdleHandler *idlePtr, *prevPtr;
+ IdleHandler *idlePtr, *prevPtr;
IdleHandler *nextPtr;
ThreadSpecificData *tsdPtr = InitTimer();
diff --git a/generic/tclTrace.c b/generic/tclTrace.c
index 1a6d459..cfa86b2 100644
--- a/generic/tclTrace.c
+++ b/generic/tclTrace.c
@@ -136,7 +136,7 @@ static int StringTraceProc(ClientData clientData,
static void StringTraceDeleteProc(ClientData clientData);
static void DisposeTraceResult(int flags, char *result);
static int TraceVarEx(Tcl_Interp *interp, const char *part1,
- const char *part2, register VarTrace *tracePtr);
+ const char *part2, VarTrace *tracePtr);
/*
* The following structure holds the client data for string-based
@@ -1049,7 +1049,7 @@ Tcl_CommandTraceInfo(
* call will return the first trace. */
{
Command *cmdPtr;
- register CommandTrace *tracePtr;
+ CommandTrace *tracePtr;
cmdPtr = (Command *) Tcl_FindCommand(interp, cmdName, NULL,
TCL_LEAVE_ERR_MSG);
@@ -1114,7 +1114,7 @@ Tcl_TraceCommand(
ClientData clientData) /* Arbitrary argument to pass to proc. */
{
Command *cmdPtr;
- register CommandTrace *tracePtr;
+ CommandTrace *tracePtr;
cmdPtr = (Command *) Tcl_FindCommand(interp, cmdName, NULL,
TCL_LEAVE_ERR_MSG);
@@ -1177,7 +1177,7 @@ Tcl_UntraceCommand(
Tcl_CommandTraceProc *proc, /* Function assocated with trace. */
ClientData clientData) /* Arbitrary argument to pass to proc. */
{
- register CommandTrace *tracePtr;
+ CommandTrace *tracePtr;
CommandTrace *prevPtr;
Command *cmdPtr;
Interp *iPtr = (Interp *) interp;
@@ -1672,13 +1672,13 @@ TclCheckInterpTraces(
static int
CallTraceFunction(
Tcl_Interp *interp, /* The current interpreter. */
- register Trace *tracePtr, /* Describes the trace function to call. */
+ Trace *tracePtr, /* Describes the trace function to call. */
Command *cmdPtr, /* Points to command's Command struct. */
const char *command, /* Points to the first character of the
* command's source before substitutions. */
int numChars, /* The number of characters in the command's
* source. */
- register int objc, /* Number of arguments for the command. */
+ int objc, /* Number of arguments for the command. */
Tcl_Obj *const objv[]) /* Pointers to Tcl_Obj of each argument. */
{
Interp *iPtr = (Interp *) interp;
@@ -1920,7 +1920,7 @@ TraceExecutionProc(
if ((flags & TCL_TRACE_ENTER_EXEC) && (tcmdPtr->stepTrace == NULL)
&& (tcmdPtr->flags & (TCL_TRACE_ENTER_DURING_EXEC |
TCL_TRACE_LEAVE_DURING_EXEC))) {
- register unsigned len = strlen(command) + 1;
+ size_t len = strlen(command) + 1;
tcmdPtr->startLevel = level;
tcmdPtr->startCmd = ckalloc(len);
@@ -2065,7 +2065,7 @@ TraceVarProc(
}
}
if (destroy && result != NULL) {
- register Tcl_Obj *errMsgObj = (Tcl_Obj *) result;
+ Tcl_Obj *errMsgObj = (Tcl_Obj *) result;
Tcl_DecrRefCount(errMsgObj);
result = NULL;
@@ -2142,8 +2142,8 @@ Tcl_CreateObjTrace(
Tcl_CmdObjTraceDeleteProc *delProc)
/* Function to call when trace is deleted */
{
- register Trace *tracePtr;
- register Interp *iPtr = (Interp *) interp;
+ Trace *tracePtr;
+ Interp *iPtr = (Interp *) interp;
/*
* Test if this trace allows inline compilation of commands.
@@ -2342,7 +2342,7 @@ Tcl_DeleteTrace(
{
Interp *iPtr = (Interp *) interp;
Trace *prevPtr, *tracePtr = (Trace *) trace;
- register Trace **tracePtr2 = &iPtr->tracePtr;
+ Trace **tracePtr2 = &iPtr->tracePtr;
ActiveInterpTrace *activePtr;
/*
@@ -2534,7 +2534,7 @@ TclCheckArrayTraces(
int
TclObjCallVarTraces(
Interp *iPtr, /* Interpreter containing variable. */
- register Var *arrayPtr, /* Pointer to array variable that contains the
+ Var *arrayPtr, /* Pointer to array variable that contains the
* variable, or NULL if the variable isn't an
* element of an array. */
Var *varPtr, /* Variable whose traces are to be invoked. */
@@ -2568,7 +2568,7 @@ TclObjCallVarTraces(
int
TclCallVarTraces(
Interp *iPtr, /* Interpreter containing variable. */
- register Var *arrayPtr, /* Pointer to array variable that contains the
+ Var *arrayPtr, /* Pointer to array variable that contains the
* variable, or NULL if the variable isn't an
* element of an array. */
Var *varPtr, /* Variable whose traces are to be invoked. */
@@ -2581,7 +2581,7 @@ TclCallVarTraces(
* error, then leave an error message and
* stack trace information in *iPTr. */
{
- register VarTrace *tracePtr;
+ VarTrace *tracePtr;
ActiveVarTrace active;
char *result;
const char *openParen, *p;
@@ -2911,7 +2911,7 @@ Tcl_UntraceVar2(
Tcl_VarTraceProc *proc, /* Function assocated with trace. */
ClientData clientData) /* Arbitrary argument to pass to proc. */
{
- register VarTrace *tracePtr;
+ VarTrace *tracePtr;
VarTrace *prevPtr, *nextPtr;
Var *varPtr, *arrayPtr;
Interp *iPtr = (Interp *) interp;
@@ -3103,7 +3103,7 @@ Tcl_VarTraceInfo2(
hPtr = Tcl_FindHashEntry(&iPtr->varTraces, (char *) varPtr);
if (hPtr) {
- register VarTrace *tracePtr = Tcl_GetHashValue(hPtr);
+ VarTrace *tracePtr = Tcl_GetHashValue(hPtr);
if (prevClientData != NULL) {
for (; tracePtr != NULL; tracePtr = tracePtr->nextPtr) {
@@ -3201,7 +3201,7 @@ Tcl_TraceVar2(
* invoked upon varName. */
ClientData clientData) /* Arbitrary argument to pass to proc. */
{
- register VarTrace *tracePtr;
+ VarTrace *tracePtr;
int result;
tracePtr = ckalloc(sizeof(VarTrace));
@@ -3246,7 +3246,7 @@ TraceVarEx(
const char *part2, /* Name of element within array; NULL means
* trace applies to scalar variable or array
* as-a-whole. */
- register VarTrace *tracePtr)/* Structure containing flags, traceProc and
+ VarTrace *tracePtr)/* Structure containing flags, traceProc and
* clientData fields. Others should be left
* blank. Will be ckfree()d (eventually) if
* this function returns TCL_OK, and up to
diff --git a/generic/tclUtf.c b/generic/tclUtf.c
index 2870c44..b9ad594 100644
--- a/generic/tclUtf.c
+++ b/generic/tclUtf.c
@@ -332,7 +332,7 @@ Tcl_Char16ToUtfDString(
* Tcl_UtfCharComplete() before calling this routine to ensure that
* enough bytes remain in the string.
*
- * Special handling of Surrogate pairs is handled as follows:
+ * If TCL_UTF_MAX <= 4, special handling of Surrogate pairs is done:
* For any UTF-8 string containing a character outside of the BMP, the
* first call to this function will fill *chPtr with the high surrogate
* and generate a return value of 1. Calling Tcl_UtfToUniChar again
@@ -361,8 +361,8 @@ static const unsigned short cp1252[32] = {
#undef Tcl_UtfToUniChar
int
Tcl_UtfToUniChar(
- register const char *src, /* The UTF-8 string. */
- register int *chPtr)/* Filled with the unsigned int represented by
+ const char *src, /* The UTF-8 string. */
+ int *chPtr)/* Filled with the unsigned int represented by
* the UTF-8 string. */
{
int byte;
@@ -718,12 +718,12 @@ Tcl_UtfCharComplete(
int
Tcl_NumUtfChars(
- register const char *src, /* The UTF-8 string to measure. */
+ const char *src, /* The UTF-8 string to measure. */
int length) /* The length of the string in bytes, or -1
* for strlen(string). */
{
Tcl_UniChar ch = 0;
- register int i = 0;
+ int i = 0;
/*
* The separate implementations are faster.
@@ -739,7 +739,7 @@ Tcl_NumUtfChars(
}
if (i < 0) i = INT_MAX; /* Bug [2738427] */
} else {
- register const char *endPtr = src + length - 4;
+ const char *endPtr = src + length - 4;
while (src < endPtr) {
src += TclUtfToUniChar(src, &ch);
@@ -788,7 +788,7 @@ Tcl_UtfFindFirst(
len = TclUtfToUniChar(src, &find);
fullchar = find;
#if TCL_UTF_MAX <= 3
- if ((ch >= 0xD800) && (len < 3)) {
+ if ((fullchar != ch) && (find >= 0xD800) && (len < 3)) {
len += TclUtfToUniChar(src + len, &find);
fullchar = (((fullchar & 0x3ff) << 10) | (find & 0x3ff)) + 0x10000;
}
@@ -836,7 +836,7 @@ Tcl_UtfFindLast(
len = TclUtfToUniChar(src, &find);
fullchar = find;
#if TCL_UTF_MAX <= 3
- if ((ch >= 0xD800) && (len < 3)) {
+ if ((fullchar != ch) && (find >= 0xD800) && (len < 3)) {
len += TclUtfToUniChar(src + len, &find);
fullchar = (((fullchar & 0x3ff) << 10) | (find & 0x3ff)) + 0x10000;
}
@@ -955,8 +955,8 @@ Tcl_UtfPrev(
int
Tcl_UniCharAtIndex(
- register const char *src, /* The UTF-8 string to dereference. */
- register int index) /* The position of the desired character. */
+ const char *src, /* The UTF-8 string to dereference. */
+ int index) /* The position of the desired character. */
{
Tcl_UniChar ch = 0;
int fullchar = 0;
@@ -1003,8 +1003,8 @@ Tcl_UniCharAtIndex(
const char *
Tcl_UtfAtIndex(
- register const char *src, /* The UTF-8 string. */
- register int index) /* The position of the desired character. */
+ const char *src, /* The UTF-8 string. */
+ int index) /* The position of the desired character. */
{
Tcl_UniChar ch = 0;
int len = 0;
@@ -1310,7 +1310,7 @@ TclpUtfNcmp2(
* fine in the strcmp manner.
*/
- register int result = 0;
+ int result = 0;
for ( ; numBytes != 0; numBytes--, cs++, ct++) {
if (*cs != *ct) {
diff --git a/generic/tclUtil.c b/generic/tclUtil.c
index 35e686f..0e4bb18 100644
--- a/generic/tclUtil.c
+++ b/generic/tclUtil.c
@@ -943,8 +943,8 @@ Tcl_SplitList(
int
Tcl_ScanElement(
- register const char *src, /* String to convert to list element. */
- register int *flagPtr) /* Where to store information to guide
+ const char *src, /* String to convert to list element. */
+ int *flagPtr) /* Where to store information to guide
* Tcl_ConvertCountedElement. */
{
return Tcl_ScanCountedElement(src, -1, flagPtr);
@@ -1323,9 +1323,9 @@ TclScanElement(
int
Tcl_ConvertElement(
- register const char *src, /* Source information for list element. */
- register char *dst, /* Place to put list-ified element. */
- register int flags) /* Flags produced by Tcl_ScanElement. */
+ const char *src, /* Source information for list element. */
+ char *dst, /* Place to put list-ified element. */
+ int flags) /* Flags produced by Tcl_ScanElement. */
{
return Tcl_ConvertCountedElement(src, -1, dst, flags);
}
@@ -1353,7 +1353,7 @@ Tcl_ConvertElement(
int
Tcl_ConvertCountedElement(
- register const char *src, /* Source information for list element. */
+ const char *src, /* Source information for list element. */
int length, /* Number of bytes in src, or -1. */
char *dst, /* Place to put list-ified element. */
int flags) /* Flags produced by Tcl_ScanElement. */
@@ -1386,7 +1386,7 @@ Tcl_ConvertCountedElement(
int
TclConvertElement(
- register const char *src, /* Source information for list element. */
+ const char *src, /* Source information for list element. */
int length, /* Number of bytes in src, or -1. */
char *dst, /* Place to put list-ified element. */
int flags) /* Flags produced by Tcl_ScanElement. */
@@ -4192,7 +4192,7 @@ TclCheckBadOctal(
* errors. */
const char *value) /* String to check. */
{
- register const char *p = value;
+ const char *p = value;
/*
* A frequent mistake is invalid octal values due to an unwanted leading
@@ -4399,7 +4399,7 @@ TclSetProcessGlobalValue(
Tcl_IncrRefCount(newValue);
cacheMap = GetThreadHash(&pgvPtr->key);
ClearHash(cacheMap);
- hPtr = Tcl_CreateHashEntry(cacheMap, (void *)(size_t)(pgvPtr->epoch), &dummy);
+ hPtr = Tcl_CreateHashEntry(cacheMap, INT2PTR(pgvPtr->epoch), &dummy);
Tcl_SetHashValue(hPtr, newValue);
Tcl_MutexUnlock(&pgvPtr->mutex);
}
@@ -4459,7 +4459,7 @@ TclGetProcessGlobalValue(
}
}
cacheMap = GetThreadHash(&pgvPtr->key);
- hPtr = Tcl_FindHashEntry(cacheMap, (void *)(size_t)epoch);
+ hPtr = Tcl_FindHashEntry(cacheMap, INT2PTR(epoch));
if (NULL == hPtr) {
int dummy;
@@ -4492,7 +4492,7 @@ TclGetProcessGlobalValue(
value = Tcl_NewStringObj(pgvPtr->value, pgvPtr->numBytes);
hPtr = Tcl_CreateHashEntry(cacheMap,
- (void *)(size_t)(pgvPtr->epoch), &dummy);
+ INT2PTR(pgvPtr->epoch), &dummy);
Tcl_MutexUnlock(&pgvPtr->mutex);
Tcl_SetHashValue(hPtr, value);
Tcl_IncrRefCount(value);
diff --git a/generic/tclVar.c b/generic/tclVar.c
index e8ebd3c..4849839 100644
--- a/generic/tclVar.c
+++ b/generic/tclVar.c
@@ -532,7 +532,7 @@ TclLookupVar(
Var *
TclObjLookupVar(
Tcl_Interp *interp, /* Interpreter to use for lookup. */
- register Tcl_Obj *part1Ptr, /* If part2 isn't NULL, this is the name of an
+ Tcl_Obj *part1Ptr, /* If part2 isn't NULL, this is the name of an
* array. Otherwise, this is a full variable
* name that could include a parenthesized
* array element. */
@@ -605,7 +605,7 @@ TclObjLookupVarEx(
{
Interp *iPtr = (Interp *) interp;
CallFrame *varFramePtr = iPtr->varFramePtr;
- register Var *varPtr; /* Points to the variable's in-frame Var
+ Var *varPtr; /* Points to the variable's in-frame Var
* structure. */
const char *errMsg = NULL;
int index, parsed = 0;
@@ -984,7 +984,7 @@ TclLookupSimpleVar(
int localLen;
for (i=0 ; i<localCt ; i++, objPtrPtr++) {
- register Tcl_Obj *objPtr = *objPtrPtr;
+ Tcl_Obj *objPtr = *objPtrPtr;
if (objPtr) {
localNameStr = TclGetStringFromObj(objPtr, &localLen);
@@ -1325,10 +1325,10 @@ Tcl_Obj *
Tcl_ObjGetVar2(
Tcl_Interp *interp, /* Command interpreter in which variable is to
* be looked up. */
- register Tcl_Obj *part1Ptr, /* Points to an object holding the name of an
+ Tcl_Obj *part1Ptr, /* Points to an object holding the name of an
* array (if part2 is non-NULL) or the name of
* a variable. */
- register Tcl_Obj *part2Ptr, /* If non-null, points to an object holding
+ Tcl_Obj *part2Ptr, /* If non-null, points to an object holding
* the name of an element in the array
* part1Ptr. */
int flags) /* OR-ed combination of TCL_GLOBAL_ONLY and
@@ -1423,7 +1423,7 @@ Tcl_Obj *
TclPtrGetVarIdx(
Tcl_Interp *interp, /* Command interpreter in which variable is to
* be looked up. */
- register Var *varPtr, /* The variable to be read.*/
+ Var *varPtr, /* The variable to be read.*/
Var *arrayPtr, /* NULL for scalar variables, pointer to the
* containing array otherwise. */
Tcl_Obj *part1Ptr, /* Name of an array (if part2 is non-NULL) or
@@ -1529,7 +1529,7 @@ TclPtrGetVarIdx(
int
Tcl_SetObjCmd(
ClientData dummy, /* Not used. */
- register Tcl_Interp *interp,/* Current interpreter. */
+ Tcl_Interp *interp,/* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
{
@@ -1753,10 +1753,10 @@ Tcl_Obj *
Tcl_ObjSetVar2(
Tcl_Interp *interp, /* Command interpreter in which variable is to
* be found. */
- register Tcl_Obj *part1Ptr, /* Points to an object holding the name of an
+ Tcl_Obj *part1Ptr, /* Points to an object holding the name of an
* array (if part2 is non-NULL) or the name of
* a variable. */
- register Tcl_Obj *part2Ptr, /* If non-NULL, points to an object holding
+ Tcl_Obj *part2Ptr, /* If non-NULL, points to an object holding
* the name of an element in the array
* part1Ptr. */
Tcl_Obj *newValuePtr, /* New value for variable. */
@@ -1993,7 +1993,7 @@ Tcl_Obj *
TclPtrSetVarIdx(
Tcl_Interp *interp, /* Command interpreter in which variable is to
* be looked up. */
- register Var *varPtr, /* Reference to the variable to set. */
+ Var *varPtr, /* Reference to the variable to set. */
Var *arrayPtr, /* Reference to the array containing the
* variable, or NULL if the variable is a
* scalar. */
@@ -2313,7 +2313,7 @@ TclPtrIncrObjVarIdx(
* variable, or -1. Only used when part1Ptr is
* NULL. */
{
- register Tcl_Obj *varValuePtr;
+ Tcl_Obj *varValuePtr;
if (TclIsVarInHash(varPtr)) {
VarHashRefCount(varPtr)++;
@@ -2574,7 +2574,7 @@ int
TclPtrUnsetVarIdx(
Tcl_Interp *interp, /* Command interpreter in which varName is to
* be looked up. */
- register Var *varPtr, /* The variable to be unset. */
+ Var *varPtr, /* The variable to be unset. */
Var *arrayPtr, /* NULL for scalar variables, pointer to the
* containing array otherwise. */
Tcl_Obj *part1Ptr, /* Name of an array (if part2 is non-NULL) or
@@ -2828,8 +2828,8 @@ Tcl_UnsetObjCmd(
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
{
- register int i, flags = TCL_LEAVE_ERR_MSG;
- register const char *name;
+ int i, flags = TCL_LEAVE_ERR_MSG;
+ const char *name;
if (objc == 1) {
/*
@@ -2897,7 +2897,7 @@ Tcl_AppendObjCmd(
Tcl_Obj *const objv[]) /* Argument objects. */
{
Var *varPtr, *arrayPtr;
- register Tcl_Obj *varValuePtr = NULL;
+ Tcl_Obj *varValuePtr = NULL;
/* Initialized to avoid compiler warning. */
int i;
@@ -4953,7 +4953,7 @@ Tcl_GetVariableFullName(
* variable's full name is appended. */
{
Interp *iPtr = (Interp *) interp;
- register Var *varPtr = (Var *) variable;
+ Var *varPtr = (Var *) variable;
Tcl_Obj *namePtr;
Namespace *nsPtr;
@@ -5013,9 +5013,9 @@ Tcl_GlobalObjCmd(
Tcl_Obj *const objv[]) /* Argument objects. */
{
Interp *iPtr = (Interp *) interp;
- register Tcl_Obj *objPtr, *tailPtr;
+ Tcl_Obj *objPtr, *tailPtr;
const char *varName;
- register const char *tail;
+ const char *tail;
int result, i;
/*
@@ -5410,7 +5410,7 @@ ParseSearchId(
static void
DeleteSearches(
Interp *iPtr,
- register Var *arrayVarPtr) /* Variable whose searches are to be
+ Var *arrayVarPtr) /* Variable whose searches are to be
* deleted. */
{
ArraySearch *searchPtr, *nextPtr;
@@ -5552,7 +5552,7 @@ TclDeleteVars(
{
Tcl_Interp *interp = (Tcl_Interp *) iPtr;
Tcl_HashSearch search;
- register Var *varPtr;
+ Var *varPtr;
int flags;
Namespace *currNsPtr = (Namespace *) TclGetCurrentNamespace(interp);
@@ -5604,7 +5604,7 @@ TclDeleteCompiledLocalVars(
CallFrame *framePtr) /* Procedure call frame containing compiler-
* assigned local variables to delete. */
{
- register Var *varPtr;
+ Var *varPtr;
int numLocals, i;
Tcl_Obj **namePtrPtr;
@@ -5653,7 +5653,7 @@ DeleteArray(
{
Tcl_HashSearch search;
Tcl_HashEntry *tPtr;
- register Var *elPtr;
+ Var *elPtr;
ActiveVarTrace *activePtr;
Tcl_Obj *objPtr;
VarTrace *tracePtr;
@@ -5842,7 +5842,7 @@ static void
FreeParsedVarName(
Tcl_Obj *objPtr)
{
- register Tcl_Obj *arrayPtr, *elem;
+ Tcl_Obj *arrayPtr, *elem;
int parsed;
ParsedGetIntRep(objPtr, parsed, arrayPtr, elem);
@@ -5859,7 +5859,7 @@ DupParsedVarName(
Tcl_Obj *srcPtr,
Tcl_Obj *dupPtr)
{
- register Tcl_Obj *arrayPtr, *elem;
+ Tcl_Obj *arrayPtr, *elem;
int parsed;
ParsedGetIntRep(srcPtr, parsed, arrayPtr, elem);
@@ -5948,7 +5948,7 @@ ObjFindNamespaceVar(
Namespace *nsPtr[2], *cxtNsPtr;
const char *simpleName;
Var *varPtr;
- register int search;
+ int search;
int result;
Tcl_Var var;
Tcl_Obj *simpleNamePtr;
@@ -6600,8 +6600,8 @@ CompareVarKeys(
{
Tcl_Obj *objPtr1 = keyPtr;
Tcl_Obj *objPtr2 = hPtr->key.objPtr;
- register const char *p1, *p2;
- register int l1, l2;
+ const char *p1, *p2;
+ int l1, l2;
/*
* If the object pointers are the same then they match.
diff --git a/generic/tclZipfs.c b/generic/tclZipfs.c
index 0dca6f1..d59d893 100644
--- a/generic/tclZipfs.c
+++ b/generic/tclZipfs.c
@@ -399,9 +399,7 @@ static int ZipChannelWrite(void *instanceData,
* Define the ZIP filesystem dispatch table.
*/
-MODULE_SCOPE const Tcl_Filesystem zipfsFilesystem;
-
-const Tcl_Filesystem zipfsFilesystem = {
+static const Tcl_Filesystem zipfsFilesystem = {
"zipfs",
sizeof(Tcl_Filesystem),
TCL_FILESYSTEM_VERSION_2,
@@ -4729,7 +4727,7 @@ ZipFSLoadFile(
*-------------------------------------------------------------------------
*/
-MODULE_SCOPE int
+int
TclZipfs_Init(
Tcl_Interp *interp) /* Current interpreter. */
{
diff --git a/library/dde/pkgIndex.tcl b/library/dde/pkgIndex.tcl
index 7aa67fa..2716e43 100644
--- a/library/dde/pkgIndex.tcl
+++ b/library/dde/pkgIndex.tcl
@@ -1,5 +1,5 @@
-if {([info commands ::tcl::pkgconfig] eq "")
- || ([info sharedlibextension] ne ".dll")} return
+if {![package vsatisfies [package provide Tcl] 8.5-]} return
+if {[info sharedlibextension] != ".dll"} return
if {[::tcl::pkgconfig get debug]} {
package ifneeded dde 1.4.1 [list load [file join $dir tcldde14g.dll] dde]
} else {
diff --git a/library/http/effective_tld_names.txt.gz b/library/http/effective_tld_names.txt.gz
index 9ce2b69..13e08bb 100644
--- a/library/http/effective_tld_names.txt.gz
+++ b/library/http/effective_tld_names.txt.gz
Binary files differ
diff --git a/library/init.tcl b/library/init.tcl
index d5b9c03..a26d788 100644
--- a/library/init.tcl
+++ b/library/init.tcl
@@ -616,7 +616,9 @@ proc auto_execok name {
}
set path "[file dirname [info nameof]];.;"
- if {[info exists env(WINDIR)]} {
+ if {[info exists env(SystemRoot)]} {
+ set windir $env(SystemRoot)
+ } elseif {[info exists env(WINDIR)]} {
set windir $env(WINDIR)
}
if {[info exists windir]} {
diff --git a/library/manifest.txt b/library/manifest.txt
index 11a755a..307302f 100644
--- a/library/manifest.txt
+++ b/library/manifest.txt
@@ -10,7 +10,7 @@ apply {{dir} {
1 opt 0.4.7 {opt optparse.tcl}
0 platform 1.0.14 {platform platform.tcl}
0 platform::shell 1.1.4 {platform shell.tcl}
- 1 tcltest 2.5.0 {tcltest tcltest.tcl}
+ 1 tcltest 2.5.1 {tcltest tcltest.tcl}
} {
if {$isafe && !$safe} continue
package ifneeded $package $version [list source [file join $dir {*}$file]]
diff --git a/library/reg/pkgIndex.tcl b/library/reg/pkgIndex.tcl
index ee559b5..650aa21 100755
--- a/library/reg/pkgIndex.tcl
+++ b/library/reg/pkgIndex.tcl
@@ -1,5 +1,5 @@
-if {([info commands ::tcl::pkgconfig] eq "")
- || ([info sharedlibextension] ne ".dll")} return
+if {![package vsatisfies [package provide Tcl] 8.5-]} return
+if {[info sharedlibextension] != ".dll"} return
if {[::tcl::pkgconfig get debug]} {
package ifneeded registry 1.3.3 \
[list load [file join $dir tclreg13g.dll] registry]
diff --git a/library/tcltest/pkgIndex.tcl b/library/tcltest/pkgIndex.tcl
index fde3ffe..ca93725 100644
--- a/library/tcltest/pkgIndex.tcl
+++ b/library/tcltest/pkgIndex.tcl
@@ -9,4 +9,4 @@
# full path name of this file's directory.
if {![package vsatisfies [package provide Tcl] 8.5-]} {return}
-package ifneeded tcltest 2.5.0 [list source [file join $dir tcltest.tcl]]
+package ifneeded tcltest 2.5.1 [list source [file join $dir tcltest.tcl]]
diff --git a/library/tcltest/tcltest.tcl b/library/tcltest/tcltest.tcl
index d67a900..a7a68c7 100644
--- a/library/tcltest/tcltest.tcl
+++ b/library/tcltest/tcltest.tcl
@@ -22,7 +22,7 @@ namespace eval tcltest {
# When the version number changes, be sure to update the pkgIndex.tcl file,
# and the install directory in the Makefiles. When the minor version
# changes (new feature) be sure to update the man page as well.
- variable Version 2.5.0
+ variable Version 2.5.1
# Compatibility support for dumb variables defined in tcltest 1
# Do not use these. Call [package provide Tcl] and [info patchlevel]
@@ -3072,7 +3072,12 @@ proc tcltest::removeFile {name {directory ""}} {
Warn "removeFile removing \"$fullName\":\n not a file"
}
}
- return [file delete -- $fullName]
+ if {[catch {file delete -- $fullName} msg ]} {
+ DebugDo 1 {
+ Warn "removeFile removing \"$fullName\":\n failed: $msg"
+ }
+ }
+ return
}
# tcltest::makeDirectory --
diff --git a/library/tm.tcl b/library/tm.tcl
index 66c56a1..1802bb9 100644
--- a/library/tm.tcl
+++ b/library/tm.tcl
@@ -311,7 +311,7 @@ proc ::tcl::tm::UnknownHandler {original name args} {
proc ::tcl::tm::Defaults {} {
global env tcl_platform
- lassign [split [info tclversion] .] major minor
+ regexp {^(\d+)\.(\d+)} [package provide Tcl] - major minor
set exe [file normalize [info nameofexecutable]]
# Note that we're using [::list], not [list] because [list] means
@@ -354,7 +354,7 @@ proc ::tcl::tm::Defaults {} {
# Calls 'path add' to paths to the list of module search paths.
proc ::tcl::tm::roots {paths} {
- regexp {^(\d+)\.(\d+)} [package present Tcl] - major minor
+ regexp {^(\d+)\.(\d+)} [package provide Tcl] - major minor
foreach pa $paths {
set p [file join $pa tcl$major]
for {set n $minor} {$n >= 0} {incr n -1} {
diff --git a/library/tzdata/America/Detroit b/library/tzdata/America/Detroit
index f725874..2139aa8 100644
--- a/library/tzdata/America/Detroit
+++ b/library/tzdata/America/Detroit
@@ -11,6 +11,11 @@ set TZData(:America/Detroit) {
{-757364400 -18000 0 EST}
{-684349200 -14400 1 EDT}
{-671047200 -18000 0 EST}
+ {-80506740 -14400 0 EDT}
+ {-68666400 -18000 0 EST}
+ {-52938000 -14400 1 EDT}
+ {-37216800 -18000 0 EST}
+ {-31518000 -18000 0 EST}
{94712400 -18000 0 EST}
{104914800 -14400 1 EDT}
{120636000 -18000 0 EST}
diff --git a/library/tzdata/America/Edmonton b/library/tzdata/America/Edmonton
index 1ed38be..234b3af 100644
--- a/library/tzdata/America/Edmonton
+++ b/library/tzdata/America/Edmonton
@@ -20,10 +20,6 @@ set TZData(:America/Edmonton) {
{-765388800 -25200 0 MST}
{-715791600 -21600 1 MDT}
{-702489600 -25200 0 MST}
- {-84380400 -21600 1 MDT}
- {-68659200 -25200 0 MST}
- {-21481200 -21600 1 MDT}
- {-5760000 -25200 0 MST}
{73472400 -21600 1 MDT}
{89193600 -25200 0 MST}
{104922000 -21600 1 MDT}
diff --git a/library/tzdata/America/Indiana/Tell_City b/library/tzdata/America/Indiana/Tell_City
index 9eebcf7..f8014bf 100644
--- a/library/tzdata/America/Indiana/Tell_City
+++ b/library/tzdata/America/Indiana/Tell_City
@@ -11,12 +11,6 @@ set TZData(:America/Indiana/Tell_City) {
{-769395600 -18000 1 CPT}
{-765392400 -21600 0 CST}
{-757360800 -21600 0 CST}
- {-747244800 -18000 1 CDT}
- {-733942800 -21600 0 CST}
- {-526492800 -18000 1 CDT}
- {-513190800 -21600 0 CST}
- {-495043200 -18000 1 CDT}
- {-481741200 -21600 0 CST}
{-462996000 -18000 1 CDT}
{-450291600 -21600 0 CST}
{-431539200 -18000 1 CDT}
@@ -28,16 +22,18 @@ set TZData(:America/Indiana/Tell_City) {
{-337190400 -18000 1 CDT}
{-323888400 -21600 0 CST}
{-305740800 -18000 1 CDT}
- {-289414800 -21600 0 CST}
+ {-292438800 -21600 0 CST}
{-273686400 -18000 1 CDT}
- {-260989200 -21600 0 CST}
+ {-257965200 -21600 0 CST}
{-242236800 -18000 1 CDT}
{-226515600 -21600 0 CST}
{-210787200 -18000 1 CDT}
{-195066000 -21600 0 CST}
{-179337600 -18000 0 EST}
- {-31518000 -18000 0 EST}
- {-21488400 -14400 1 EDT}
+ {-68662800 -21600 0 CST}
+ {-52934400 -18000 1 CDT}
+ {-37213200 -21600 0 CST}
+ {-21484800 -14400 0 EDT}
{-5767200 -18000 0 EST}
{9961200 -14400 1 EDT}
{25682400 -18000 0 EST}
diff --git a/library/tzdata/America/Kentucky/Louisville b/library/tzdata/America/Kentucky/Louisville
index c2aa10c..7efbec9 100644
--- a/library/tzdata/America/Kentucky/Louisville
+++ b/library/tzdata/America/Kentucky/Louisville
@@ -17,12 +17,9 @@ set TZData(:America/Kentucky/Louisville) {
{-769395600 -18000 1 CPT}
{-765392400 -21600 0 CST}
{-757360800 -21600 0 CST}
- {-747244800 -18000 1 CDT}
+ {-747251940 -18000 1 CDT}
{-744224400 -21600 0 CST}
- {-715795200 -18000 1 CDT}
- {-684349200 -18000 1 CDT}
- {-652899600 -18000 1 CDT}
- {-620845200 -18000 1 CDT}
+ {-620841600 -18000 1 CDT}
{-608144400 -21600 0 CST}
{-589392000 -18000 1 CDT}
{-576090000 -21600 0 CST}
@@ -45,7 +42,7 @@ set TZData(:America/Kentucky/Louisville) {
{-305740800 -18000 1 CDT}
{-289414800 -21600 0 CST}
{-273686400 -18000 1 CDT}
- {-266432400 -18000 0 EST}
+ {-266428800 -18000 0 EST}
{-63140400 -18000 0 EST}
{-52938000 -14400 1 EDT}
{-37216800 -18000 0 EST}
diff --git a/library/tzdata/America/Vancouver b/library/tzdata/America/Vancouver
index aef639a..795e9e0 100644
--- a/library/tzdata/America/Vancouver
+++ b/library/tzdata/America/Vancouver
@@ -9,7 +9,7 @@ set TZData(:America/Vancouver) {
{-769395600 -25200 1 PPT}
{-765385200 -28800 0 PST}
{-747237600 -25200 1 PDT}
- {-732726000 -28800 0 PST}
+ {-733935600 -28800 0 PST}
{-715788000 -25200 1 PDT}
{-702486000 -28800 0 PST}
{-684338400 -25200 1 PDT}
diff --git a/library/tzdata/Asia/Hong_Kong b/library/tzdata/Asia/Hong_Kong
index 9420142..8f5ed2c 100644
--- a/library/tzdata/Asia/Hong_Kong
+++ b/library/tzdata/Asia/Hong_Kong
@@ -4,7 +4,7 @@ set TZData(:Asia/Hong_Kong) {
{-9223372036854775808 27402 0 LMT}
{-2056690800 28800 0 HKT}
{-900910800 32400 1 HKST}
- {-891579600 30600 0 HKT}
+ {-891579600 30600 1 HKWT}
{-884248200 32400 0 JST}
{-761209200 28800 0 HKT}
{-747907200 32400 1 HKST}
diff --git a/library/tzdata/Asia/Seoul b/library/tzdata/Asia/Seoul
index b226eb5..2df8adc 100644
--- a/library/tzdata/Asia/Seoul
+++ b/library/tzdata/Asia/Seoul
@@ -5,6 +5,14 @@ set TZData(:Asia/Seoul) {
{-1948782472 30600 0 KST}
{-1830414600 32400 0 JST}
{-767350800 32400 0 KST}
+ {-681210000 36000 1 KDT}
+ {-672228000 32400 0 KST}
+ {-654771600 36000 1 KDT}
+ {-640864800 32400 0 KST}
+ {-623408400 36000 1 KDT}
+ {-609415200 32400 0 KST}
+ {-588848400 36000 1 KDT}
+ {-577965600 32400 0 KST}
{-498128400 30600 0 KST}
{-462702600 34200 1 KDT}
{-451733400 30600 0 KST}
diff --git a/library/tzdata/Europe/Brussels b/library/tzdata/Europe/Brussels
index 3cb9b14..907fff8 100644
--- a/library/tzdata/Europe/Brussels
+++ b/library/tzdata/Europe/Brussels
@@ -3,7 +3,7 @@
set TZData(:Europe/Brussels) {
{-9223372036854775808 1050 0 LMT}
{-2840141850 1050 0 BMT}
- {-2450953050 0 0 WET}
+ {-2450995200 0 0 WET}
{-1740355200 3600 0 CET}
{-1693702800 7200 0 CEST}
{-1680483600 3600 0 CET}
diff --git a/library/tzdata/Europe/Istanbul b/library/tzdata/Europe/Istanbul
index d00533f..a4b9b89 100644
--- a/library/tzdata/Europe/Istanbul
+++ b/library/tzdata/Europe/Istanbul
@@ -16,13 +16,11 @@ set TZData(:Europe/Istanbul) {
{-1428030000 7200 0 EET}
{-1409709600 10800 1 EEST}
{-1396494000 7200 0 EET}
- {-931140000 10800 1 EEST}
- {-922762800 7200 0 EET}
+ {-931053600 10800 1 EEST}
+ {-922676400 7200 0 EET}
{-917834400 10800 1 EEST}
{-892436400 7200 0 EET}
{-875844000 10800 1 EEST}
- {-857358000 7200 0 EET}
- {-781063200 10800 1 EEST}
{-764737200 7200 0 EET}
{-744343200 10800 1 EEST}
{-733806000 7200 0 EET}
@@ -32,45 +30,32 @@ set TZData(:Europe/Istanbul) {
{-670474800 7200 0 EET}
{-654141600 10800 1 EEST}
{-639025200 7200 0 EET}
- {-621828000 10800 1 EEST}
+ {-622087200 10800 1 EEST}
{-606970800 7200 0 EET}
{-590032800 10800 1 EEST}
- {-575434800 7200 0 EET}
+ {-575521200 7200 0 EET}
{-235620000 10800 1 EEST}
- {-228279600 7200 0 EET}
+ {-194842800 7200 0 EET}
{-177732000 10800 1 EEST}
{-165726000 7200 0 EET}
- {10533600 10800 1 EEST}
- {23835600 7200 0 EET}
- {41983200 10800 1 EEST}
- {55285200 7200 0 EET}
- {74037600 10800 1 EEST}
- {87339600 7200 0 EET}
{107910000 10800 1 EEST}
- {121219200 7200 0 EET}
+ {121215600 7200 0 EET}
{133920000 10800 1 EEST}
- {152676000 7200 0 EET}
- {165362400 10800 1 EEST}
- {183502800 7200 0 EET}
- {202428000 10800 1 EEST}
- {215557200 7200 0 EET}
- {228866400 10800 1 EEST}
- {245797200 7200 0 EET}
- {260316000 10800 1 EEST}
- {277246800 14400 0 +04}
- {291769200 14400 1 +04}
- {308779200 10800 0 +03}
- {323827200 14400 1 +04}
- {340228800 10800 0 +03}
- {354672000 14400 1 +04}
- {371678400 10800 0 +03}
- {386121600 14400 1 +04}
- {403128000 10800 0 +03}
- {428446800 14400 1 +04}
- {433886400 10800 0 +03}
- {482792400 7200 0 EET}
- {482796000 10800 1 EEST}
- {496702800 7200 0 EET}
+ {152665200 7200 0 EET}
+ {164678400 10800 1 EEST}
+ {184114800 7200 0 EET}
+ {196214400 10800 1 EEST}
+ {215564400 7200 0 EET}
+ {228873600 10800 1 EEST}
+ {245804400 7200 0 EET}
+ {260323200 10800 1 EEST}
+ {267919200 10800 0 +03}
+ {277254000 10800 0 +03}
+ {428454000 14400 1 +04}
+ {433893600 10800 0 +03}
+ {468111600 7200 0 EET}
+ {482799600 10800 1 EEST}
+ {496710000 7200 0 EET}
{512521200 10800 1 EEST}
{528246000 7200 0 EET}
{543970800 10800 1 EEST}
diff --git a/library/tzdata/Europe/Kaliningrad b/library/tzdata/Europe/Kaliningrad
index e1713ae..2ce7f35 100644
--- a/library/tzdata/Europe/Kaliningrad
+++ b/library/tzdata/Europe/Kaliningrad
@@ -15,10 +15,11 @@ set TZData(:Europe/Kaliningrad) {
{-828226800 3600 0 CET}
{-812502000 7200 1 CEST}
{-796777200 3600 0 CET}
- {-788922000 7200 0 CET}
- {-778730400 10800 1 CEST}
- {-762663600 7200 0 CET}
- {-757389600 10800 0 MSD}
+ {-781052400 7200 1 CEST}
+ {-780368400 7200 0 EET}
+ {-778730400 10800 1 EEST}
+ {-762663600 7200 0 EET}
+ {-749095200 10800 0 MSD}
{354920400 14400 1 MSD}
{370728000 10800 0 MSK}
{386456400 14400 1 MSD}
diff --git a/library/tzdata/Europe/Vienna b/library/tzdata/Europe/Vienna
index 95283eb..3fdad03 100644
--- a/library/tzdata/Europe/Vienna
+++ b/library/tzdata/Europe/Vienna
@@ -22,7 +22,7 @@ set TZData(:Europe/Vienna) {
{-780188400 3600 0 CET}
{-757386000 3600 0 CET}
{-748479600 7200 1 CEST}
- {-733359600 3600 0 CET}
+ {-733273200 3600 0 CET}
{-717634800 7200 1 CEST}
{-701910000 3600 0 CET}
{-684975600 7200 1 CEST}
diff --git a/library/tzdata/Pacific/Fiji b/library/tzdata/Pacific/Fiji
index b05985c..e316b93 100644
--- a/library/tzdata/Pacific/Fiji
+++ b/library/tzdata/Pacific/Fiji
@@ -27,165 +27,165 @@ set TZData(:Pacific/Fiji) {
{1515852000 43200 0 +12}
{1541253600 46800 1 +12}
{1547301600 43200 0 +12}
- {1572703200 46800 1 +12}
- {1579356000 43200 0 +12}
- {1604152800 46800 1 +12}
+ {1573308000 46800 1 +12}
+ {1578751200 43200 0 +12}
+ {1604757600 46800 1 +12}
{1610805600 43200 0 +12}
- {1636207200 46800 1 +12}
+ {1636812000 46800 1 +12}
{1642255200 43200 0 +12}
- {1667656800 46800 1 +12}
+ {1668261600 46800 1 +12}
{1673704800 43200 0 +12}
- {1699106400 46800 1 +12}
+ {1699711200 46800 1 +12}
{1705154400 43200 0 +12}
- {1730556000 46800 1 +12}
- {1737208800 43200 0 +12}
- {1762005600 46800 1 +12}
+ {1731160800 46800 1 +12}
+ {1736604000 43200 0 +12}
+ {1762610400 46800 1 +12}
{1768658400 43200 0 +12}
- {1793455200 46800 1 +12}
+ {1794060000 46800 1 +12}
{1800108000 43200 0 +12}
- {1825509600 46800 1 +12}
+ {1826114400 46800 1 +12}
{1831557600 43200 0 +12}
- {1856959200 46800 1 +12}
+ {1857564000 46800 1 +12}
{1863007200 43200 0 +12}
- {1888408800 46800 1 +12}
+ {1889013600 46800 1 +12}
{1894456800 43200 0 +12}
- {1919858400 46800 1 +12}
- {1926511200 43200 0 +12}
- {1951308000 46800 1 +12}
+ {1920463200 46800 1 +12}
+ {1925906400 43200 0 +12}
+ {1951912800 46800 1 +12}
{1957960800 43200 0 +12}
- {1983362400 46800 1 +12}
+ {1983967200 46800 1 +12}
{1989410400 43200 0 +12}
- {2014812000 46800 1 +12}
+ {2015416800 46800 1 +12}
{2020860000 43200 0 +12}
- {2046261600 46800 1 +12}
+ {2046866400 46800 1 +12}
{2052309600 43200 0 +12}
- {2077711200 46800 1 +12}
+ {2078316000 46800 1 +12}
{2083759200 43200 0 +12}
- {2109160800 46800 1 +12}
+ {2109765600 46800 1 +12}
{2115813600 43200 0 +12}
- {2140610400 46800 1 +12}
+ {2141215200 46800 1 +12}
{2147263200 43200 0 +12}
- {2172664800 46800 1 +12}
+ {2173269600 46800 1 +12}
{2178712800 43200 0 +12}
- {2204114400 46800 1 +12}
+ {2204719200 46800 1 +12}
{2210162400 43200 0 +12}
- {2235564000 46800 1 +12}
+ {2236168800 46800 1 +12}
{2241612000 43200 0 +12}
- {2267013600 46800 1 +12}
- {2273666400 43200 0 +12}
- {2298463200 46800 1 +12}
+ {2267618400 46800 1 +12}
+ {2273061600 43200 0 +12}
+ {2299068000 46800 1 +12}
{2305116000 43200 0 +12}
- {2329912800 46800 1 +12}
+ {2330517600 46800 1 +12}
{2336565600 43200 0 +12}
- {2361967200 46800 1 +12}
+ {2362572000 46800 1 +12}
{2368015200 43200 0 +12}
- {2393416800 46800 1 +12}
+ {2394021600 46800 1 +12}
{2399464800 43200 0 +12}
- {2424866400 46800 1 +12}
+ {2425471200 46800 1 +12}
{2430914400 43200 0 +12}
- {2456316000 46800 1 +12}
- {2462968800 43200 0 +12}
- {2487765600 46800 1 +12}
+ {2456920800 46800 1 +12}
+ {2462364000 43200 0 +12}
+ {2488370400 46800 1 +12}
{2494418400 43200 0 +12}
- {2519820000 46800 1 +12}
+ {2520424800 46800 1 +12}
{2525868000 43200 0 +12}
- {2551269600 46800 1 +12}
+ {2551874400 46800 1 +12}
{2557317600 43200 0 +12}
- {2582719200 46800 1 +12}
+ {2583324000 46800 1 +12}
{2588767200 43200 0 +12}
- {2614168800 46800 1 +12}
- {2620821600 43200 0 +12}
- {2645618400 46800 1 +12}
+ {2614773600 46800 1 +12}
+ {2620216800 43200 0 +12}
+ {2646223200 46800 1 +12}
{2652271200 43200 0 +12}
- {2677068000 46800 1 +12}
+ {2677672800 46800 1 +12}
{2683720800 43200 0 +12}
- {2709122400 46800 1 +12}
+ {2709727200 46800 1 +12}
{2715170400 43200 0 +12}
- {2740572000 46800 1 +12}
+ {2741176800 46800 1 +12}
{2746620000 43200 0 +12}
- {2772021600 46800 1 +12}
+ {2772626400 46800 1 +12}
{2778069600 43200 0 +12}
- {2803471200 46800 1 +12}
- {2810124000 43200 0 +12}
- {2834920800 46800 1 +12}
+ {2804076000 46800 1 +12}
+ {2809519200 43200 0 +12}
+ {2835525600 46800 1 +12}
{2841573600 43200 0 +12}
- {2866975200 46800 1 +12}
+ {2867580000 46800 1 +12}
{2873023200 43200 0 +12}
- {2898424800 46800 1 +12}
+ {2899029600 46800 1 +12}
{2904472800 43200 0 +12}
- {2929874400 46800 1 +12}
+ {2930479200 46800 1 +12}
{2935922400 43200 0 +12}
- {2961324000 46800 1 +12}
+ {2961928800 46800 1 +12}
{2967372000 43200 0 +12}
- {2992773600 46800 1 +12}
+ {2993378400 46800 1 +12}
{2999426400 43200 0 +12}
- {3024223200 46800 1 +12}
+ {3024828000 46800 1 +12}
{3030876000 43200 0 +12}
- {3056277600 46800 1 +12}
+ {3056882400 46800 1 +12}
{3062325600 43200 0 +12}
- {3087727200 46800 1 +12}
+ {3088332000 46800 1 +12}
{3093775200 43200 0 +12}
- {3119176800 46800 1 +12}
+ {3119781600 46800 1 +12}
{3125224800 43200 0 +12}
- {3150626400 46800 1 +12}
- {3157279200 43200 0 +12}
- {3182076000 46800 1 +12}
+ {3151231200 46800 1 +12}
+ {3156674400 43200 0 +12}
+ {3182680800 46800 1 +12}
{3188728800 43200 0 +12}
- {3213525600 46800 1 +12}
+ {3214130400 46800 1 +12}
{3220178400 43200 0 +12}
- {3245580000 46800 1 +12}
+ {3246184800 46800 1 +12}
{3251628000 43200 0 +12}
- {3277029600 46800 1 +12}
+ {3277634400 46800 1 +12}
{3283077600 43200 0 +12}
- {3308479200 46800 1 +12}
+ {3309084000 46800 1 +12}
{3314527200 43200 0 +12}
- {3339928800 46800 1 +12}
- {3346581600 43200 0 +12}
- {3371378400 46800 1 +12}
+ {3340533600 46800 1 +12}
+ {3345976800 43200 0 +12}
+ {3371983200 46800 1 +12}
{3378031200 43200 0 +12}
- {3403432800 46800 1 +12}
+ {3404037600 46800 1 +12}
{3409480800 43200 0 +12}
- {3434882400 46800 1 +12}
+ {3435487200 46800 1 +12}
{3440930400 43200 0 +12}
- {3466332000 46800 1 +12}
+ {3466936800 46800 1 +12}
{3472380000 43200 0 +12}
- {3497781600 46800 1 +12}
- {3504434400 43200 0 +12}
- {3529231200 46800 1 +12}
+ {3498386400 46800 1 +12}
+ {3503829600 43200 0 +12}
+ {3529836000 46800 1 +12}
{3535884000 43200 0 +12}
- {3560680800 46800 1 +12}
+ {3561285600 46800 1 +12}
{3567333600 43200 0 +12}
- {3592735200 46800 1 +12}
+ {3593340000 46800 1 +12}
{3598783200 43200 0 +12}
- {3624184800 46800 1 +12}
+ {3624789600 46800 1 +12}
{3630232800 43200 0 +12}
- {3655634400 46800 1 +12}
+ {3656239200 46800 1 +12}
{3661682400 43200 0 +12}
- {3687084000 46800 1 +12}
- {3693736800 43200 0 +12}
- {3718533600 46800 1 +12}
+ {3687688800 46800 1 +12}
+ {3693132000 43200 0 +12}
+ {3719138400 46800 1 +12}
{3725186400 43200 0 +12}
- {3750588000 46800 1 +12}
+ {3751192800 46800 1 +12}
{3756636000 43200 0 +12}
- {3782037600 46800 1 +12}
+ {3782642400 46800 1 +12}
{3788085600 43200 0 +12}
- {3813487200 46800 1 +12}
+ {3814092000 46800 1 +12}
{3819535200 43200 0 +12}
- {3844936800 46800 1 +12}
+ {3845541600 46800 1 +12}
{3850984800 43200 0 +12}
- {3876386400 46800 1 +12}
+ {3876991200 46800 1 +12}
{3883039200 43200 0 +12}
- {3907836000 46800 1 +12}
+ {3908440800 46800 1 +12}
{3914488800 43200 0 +12}
- {3939890400 46800 1 +12}
+ {3940495200 46800 1 +12}
{3945938400 43200 0 +12}
- {3971340000 46800 1 +12}
+ {3971944800 46800 1 +12}
{3977388000 43200 0 +12}
- {4002789600 46800 1 +12}
+ {4003394400 46800 1 +12}
{4008837600 43200 0 +12}
- {4034239200 46800 1 +12}
- {4040892000 43200 0 +12}
- {4065688800 46800 1 +12}
+ {4034844000 46800 1 +12}
+ {4040287200 43200 0 +12}
+ {4066293600 46800 1 +12}
{4072341600 43200 0 +12}
- {4097138400 46800 1 +12}
+ {4097743200 46800 1 +12}
}
diff --git a/library/tzdata/Pacific/Norfolk b/library/tzdata/Pacific/Norfolk
index f0556ab..f686df5 100644
--- a/library/tzdata/Pacific/Norfolk
+++ b/library/tzdata/Pacific/Norfolk
@@ -5,6 +5,168 @@ set TZData(:Pacific/Norfolk) {
{-2177493112 40320 0 +1112}
{-599656320 41400 0 +1130}
{152029800 45000 1 +1230}
- {162912600 41400 0 +1130}
+ {162916200 41400 0 +1130}
{1443882600 39600 0 +11}
+ {1561899600 39600 0 +12}
+ {1570287600 43200 1 +12}
+ {1586012400 39600 0 +12}
+ {1601737200 43200 1 +12}
+ {1617462000 39600 0 +12}
+ {1633186800 43200 1 +12}
+ {1648911600 39600 0 +12}
+ {1664636400 43200 1 +12}
+ {1680361200 39600 0 +12}
+ {1696086000 43200 1 +12}
+ {1712415600 39600 0 +12}
+ {1728140400 43200 1 +12}
+ {1743865200 39600 0 +12}
+ {1759590000 43200 1 +12}
+ {1775314800 39600 0 +12}
+ {1791039600 43200 1 +12}
+ {1806764400 39600 0 +12}
+ {1822489200 43200 1 +12}
+ {1838214000 39600 0 +12}
+ {1853938800 43200 1 +12}
+ {1869663600 39600 0 +12}
+ {1885993200 43200 1 +12}
+ {1901718000 39600 0 +12}
+ {1917442800 43200 1 +12}
+ {1933167600 39600 0 +12}
+ {1948892400 43200 1 +12}
+ {1964617200 39600 0 +12}
+ {1980342000 43200 1 +12}
+ {1996066800 39600 0 +12}
+ {2011791600 43200 1 +12}
+ {2027516400 39600 0 +12}
+ {2043241200 43200 1 +12}
+ {2058966000 39600 0 +12}
+ {2075295600 43200 1 +12}
+ {2091020400 39600 0 +12}
+ {2106745200 43200 1 +12}
+ {2122470000 39600 0 +12}
+ {2138194800 43200 1 +12}
+ {2153919600 39600 0 +12}
+ {2169644400 43200 1 +12}
+ {2185369200 39600 0 +12}
+ {2201094000 43200 1 +12}
+ {2216818800 39600 0 +12}
+ {2233148400 43200 1 +12}
+ {2248873200 39600 0 +12}
+ {2264598000 43200 1 +12}
+ {2280322800 39600 0 +12}
+ {2296047600 43200 1 +12}
+ {2311772400 39600 0 +12}
+ {2327497200 43200 1 +12}
+ {2343222000 39600 0 +12}
+ {2358946800 43200 1 +12}
+ {2374671600 39600 0 +12}
+ {2390396400 43200 1 +12}
+ {2406121200 39600 0 +12}
+ {2422450800 43200 1 +12}
+ {2438175600 39600 0 +12}
+ {2453900400 43200 1 +12}
+ {2469625200 39600 0 +12}
+ {2485350000 43200 1 +12}
+ {2501074800 39600 0 +12}
+ {2516799600 43200 1 +12}
+ {2532524400 39600 0 +12}
+ {2548249200 43200 1 +12}
+ {2563974000 39600 0 +12}
+ {2579698800 43200 1 +12}
+ {2596028400 39600 0 +12}
+ {2611753200 43200 1 +12}
+ {2627478000 39600 0 +12}
+ {2643202800 43200 1 +12}
+ {2658927600 39600 0 +12}
+ {2674652400 43200 1 +12}
+ {2690377200 39600 0 +12}
+ {2706102000 43200 1 +12}
+ {2721826800 39600 0 +12}
+ {2737551600 43200 1 +12}
+ {2753276400 39600 0 +12}
+ {2769606000 43200 1 +12}
+ {2785330800 39600 0 +12}
+ {2801055600 43200 1 +12}
+ {2816780400 39600 0 +12}
+ {2832505200 43200 1 +12}
+ {2848230000 39600 0 +12}
+ {2863954800 43200 1 +12}
+ {2879679600 39600 0 +12}
+ {2895404400 43200 1 +12}
+ {2911129200 39600 0 +12}
+ {2926854000 43200 1 +12}
+ {2942578800 39600 0 +12}
+ {2958908400 43200 1 +12}
+ {2974633200 39600 0 +12}
+ {2990358000 43200 1 +12}
+ {3006082800 39600 0 +12}
+ {3021807600 43200 1 +12}
+ {3037532400 39600 0 +12}
+ {3053257200 43200 1 +12}
+ {3068982000 39600 0 +12}
+ {3084706800 43200 1 +12}
+ {3100431600 39600 0 +12}
+ {3116761200 43200 1 +12}
+ {3132486000 39600 0 +12}
+ {3148210800 43200 1 +12}
+ {3163935600 39600 0 +12}
+ {3179660400 43200 1 +12}
+ {3195385200 39600 0 +12}
+ {3211110000 43200 1 +12}
+ {3226834800 39600 0 +12}
+ {3242559600 43200 1 +12}
+ {3258284400 39600 0 +12}
+ {3274009200 43200 1 +12}
+ {3289734000 39600 0 +12}
+ {3306063600 43200 1 +12}
+ {3321788400 39600 0 +12}
+ {3337513200 43200 1 +12}
+ {3353238000 39600 0 +12}
+ {3368962800 43200 1 +12}
+ {3384687600 39600 0 +12}
+ {3400412400 43200 1 +12}
+ {3416137200 39600 0 +12}
+ {3431862000 43200 1 +12}
+ {3447586800 39600 0 +12}
+ {3463311600 43200 1 +12}
+ {3479641200 39600 0 +12}
+ {3495366000 43200 1 +12}
+ {3511090800 39600 0 +12}
+ {3526815600 43200 1 +12}
+ {3542540400 39600 0 +12}
+ {3558265200 43200 1 +12}
+ {3573990000 39600 0 +12}
+ {3589714800 43200 1 +12}
+ {3605439600 39600 0 +12}
+ {3621164400 43200 1 +12}
+ {3636889200 39600 0 +12}
+ {3653218800 43200 1 +12}
+ {3668943600 39600 0 +12}
+ {3684668400 43200 1 +12}
+ {3700393200 39600 0 +12}
+ {3716118000 43200 1 +12}
+ {3731842800 39600 0 +12}
+ {3747567600 43200 1 +12}
+ {3763292400 39600 0 +12}
+ {3779017200 43200 1 +12}
+ {3794742000 39600 0 +12}
+ {3810466800 43200 1 +12}
+ {3826191600 39600 0 +12}
+ {3842521200 43200 1 +12}
+ {3858246000 39600 0 +12}
+ {3873970800 43200 1 +12}
+ {3889695600 39600 0 +12}
+ {3905420400 43200 1 +12}
+ {3921145200 39600 0 +12}
+ {3936870000 43200 1 +12}
+ {3952594800 39600 0 +12}
+ {3968319600 43200 1 +12}
+ {3984044400 39600 0 +12}
+ {4000374000 43200 1 +12}
+ {4016098800 39600 0 +12}
+ {4031823600 43200 1 +12}
+ {4047548400 39600 0 +12}
+ {4063273200 43200 1 +12}
+ {4078998000 39600 0 +12}
+ {4094722800 43200 1 +12}
}
diff --git a/macosx/tclMacOSXFCmd.c b/macosx/tclMacOSXFCmd.c
index 7c65088..6ff60aa 100644
--- a/macosx/tclMacOSXFCmd.c
+++ b/macosx/tclMacOSXFCmd.c
@@ -347,7 +347,7 @@ TclMacOSXSetFileAttribute(
Tcl_DStringAppend(&ds, native, -1);
Tcl_DStringAppend(&ds, _PATH_RSRCFORKSPEC, -1);
- result = truncate(Tcl_DStringValue(&ds), (off_t)0);
+ result = truncate(Tcl_DStringValue(&ds), 0);
if (result != 0) {
/*
* truncate() on a valid resource fork path may fail with a
@@ -689,7 +689,7 @@ SetOSTypeFromAny(
static void
UpdateStringOfOSType(
- register Tcl_Obj *objPtr) /* OSType object whose string rep to
+ Tcl_Obj *objPtr) /* OSType object whose string rep to
* update. */
{
const int size = TCL_UTF_MAX * 4;
diff --git a/tests/all.tcl b/tests/all.tcl
index 89a4f1a..52c8763 100644
--- a/tests/all.tcl
+++ b/tests/all.tcl
@@ -12,7 +12,7 @@
package prefer latest
package require Tcl 8.5-
-package require tcltest 2.2
+package require tcltest 2.5
namespace import ::tcltest::*
configure {*}$argv -testdir [file dirname [file dirname [file normalize [
@@ -25,4 +25,9 @@ if {[singleProcess]} {
set ErrorOnFailures [info exists env(ERROR_ON_FAILURES)]
unset -nocomplain env(ERROR_ON_FAILURES)
if {[runAllTests] && $ErrorOnFailures} {exit 1}
-proc exit args {}
+# if calling direct only (avoid rewrite exit if inlined or interactive):
+if { [info exists ::argv0] && [file tail $::argv0] eq [file tail [info script]]
+ && !([info exists ::tcl_interactive] && $::tcl_interactive)
+} {
+ proc exit args {}
+} \ No newline at end of file
diff --git a/tests/basic.test b/tests/basic.test
index 4561667..428fd93 100644
--- a/tests/basic.test
+++ b/tests/basic.test
@@ -964,7 +964,7 @@ test basic-48.24.$noComp {expansion: empty not canonical list, regression test,
run {list [list {*}{ }] [list {*}[format %c 32]] [list {*}[set a { }]]}
} -result [lrepeat 3 {}] -cleanup {unset -nocomplain a}
-test basic-48.25.$noComp {Bug cc191552c: expansion: empty non-canonical list} -setup {
+test basic-48.25.$noComp {Bug cc191552c: expansion: empty non-canonical list} -constraints $constraints -setup {
unset -nocomplain ::CRLF
set ::CRLF "\r\n"
} -body {
diff --git a/tests/chanio.test b/tests/chanio.test
index 4b71fef..c7c07ce 100644
--- a/tests/chanio.test
+++ b/tests/chanio.test
@@ -1881,7 +1881,7 @@ test chan-io-20.3 {Tcl_CreateChannel: initial settings} -constraints {unix} -bod
} -result {{{} {}} {auto lf}}
test chan-io-20.5 {Tcl_CreateChannel: install channel in empty slot} -setup {
set path(stdout) [makeFile {} stdout]
-} -constraints {stdio openpipe} -body {
+} -constraints {stdio openpipe knownMsvcBug} -body {
set f [open $path(script) w]
chan puts -nonewline $f {
chan close stdout
@@ -2025,7 +2025,7 @@ test chan-io-27.4 {FlushChannel, implicit flush when buffer fills} -setup {
test chan-io-27.5 {FlushChannel, implicit flush when buffer fills and on chan close} -setup {
file delete $path(test1)
set l ""
-} -constraints {unixOrPc} -body {
+} -constraints {unixOrWin} -body {
set f [open $path(test1) w]
chan configure $f -translation lf -buffersize 60 -eofchar {}
lappend l [file size $path(test1)]
@@ -2817,7 +2817,7 @@ test chan-io-29.34 {Tcl_Chan Close, async flush on chan close, using sockets} -s
chan close $cs
chan close $ss
vwait [namespace which -variable x]
- return $c
+ set c
} -result 2000
test chan-io-29.35 {Tcl_Chan Close vs chan event vs multiple interpreters} -setup {
catch {interp delete x}
@@ -7033,7 +7033,7 @@ test chan-io-53.8 {CopyData: async callback and error handling, Bug 1932639} -se
vwait ::forever
catch {after cancel $token}
# Report
- return $::RES
+ set ::RES
} -cleanup {
chan close $f
chan close $g
@@ -7233,7 +7233,7 @@ test chan-io-54.1 {Recursive channel events} {socket fileevent} {
for {set i 0} {$i < 10} {incr i} {
if {![catch {
set cs [socket 127.0.0.1 [lindex [chan configure $ss -sockname] 2]]
- }]} then {
+ }]} {
set done 1
break
}
@@ -7305,7 +7305,7 @@ test chan-io-54.2 {Testing for busy-wait in recursive channel events} -setup {
chan close $writer
chan close $s
after cancel $after
- return $counter
+ set counter
} -cleanup {
if {$accept ne {}} {chan close $accept}
} -result 1
@@ -7332,7 +7332,7 @@ test chan-io-55.1 {ChannelEventScriptInvoker: deletion} -constraints {
chan event $f writable [namespace code [list eventScript $f]]
variable x not_done
vwait [namespace which -variable x]
- return $x
+ set x
} -cleanup {
interp bgerror {} $handler
} -result {got_error}
@@ -7377,7 +7377,7 @@ test chan-io-57.1 {buffered data and file events, gets} -setup {
vwait [namespace which -variable result]
lappend result [chan gets $s2]
vwait [namespace which -variable result]
- return $result
+ set result
} -cleanup {
chan close $s
chan close $s2
@@ -7402,14 +7402,14 @@ test chan-io-57.2 {buffered data and file events, read} -setup {
vwait [namespace which -variable result]
lappend result [chan read $s2 9]
vwait [namespace which -variable result]
- return $result
+ set result
} -cleanup {
chan close $s
chan close $s2
chan close $server
} -result {1 readable 234567890 timer}
-test chan-io-58.1 {Tcl_NotifyChannel and error when closing} {stdio unixOrPc openpipe fileevent} {
+test chan-io-58.1 {Tcl_NotifyChannel and error when closing} {stdio unixOrWin openpipe fileevent} {
set out [open $path(script) w]
chan puts $out {
chan puts "normal message from pipe"
diff --git a/tests/cmdAH.test b/tests/cmdAH.test
index b15c77d..992a8f4 100644
--- a/tests/cmdAH.test
+++ b/tests/cmdAH.test
@@ -23,14 +23,13 @@ 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
+ [llength [info command testsize]] && [testsize st_mtime] >= 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]
@@ -893,7 +892,7 @@ test cmdAH-18.3 {Tcl_FileObjCmd: executable} {unix testchmod} {
file exe $gorpfile
} 1
test cmdAH-18.5 {Tcl_FileObjCmd: executable} -constraints {win} -body {
- # On pc, must be a .exe, .com, etc.
+ # On windows, must be a .exe, .com, etc.
set x {}
set gorpexes {}
foreach ext {exe com cmd bat} {
@@ -1315,8 +1314,28 @@ test cmdAH-24.20.2 {Tcl_FileObjCmd: mtime 64-bit time_t, bug [4718b41c56]} -cons
test cmdAH-25.1 {Tcl_FileObjCmd: owned} -returnCodes error -body {
file owned a b
} -result {wrong # args: should be "file owned name"}
-test cmdAH-25.2 {Tcl_FileObjCmd: owned} -constraints win -body {
- file owned $gorpfile
+test cmdAH-25.2 {Tcl_FileObjCmd: owned} -constraints win -setup {
+ set fn $gorpfile
+ # prefer temp file to check owner (try to avoid bug [7de2d722bd]):
+ if {
+ [info exists ::env(TEMP)] && [file isdirectory $::env(TEMP)] &&
+ [file dirname $fn] ne [file normalize $::env(TEMP)]
+ } {
+ set fn [file join $::env(TEMP)/test-owner-from-tcl.txt]
+ set fn [makeFile "data" test-owner-from-tcl.txt $::env(TEMP)]
+ }
+ # be sure we have really owned this file before trying to check that
+ # (avoid dependency on admin with UAC and the setting "System objects:
+ # Default owner for objects created by members of the Administrators group"):
+ catch {
+ exec takeown /F [file nativename $fn]
+ }
+} -body {
+ file owned $fn
+} -cleanup {
+ if {$fn ne $gorpfile} {
+ removeFile $fn
+ }
} -result 1
test cmdAH-25.2.1 {Tcl_FileObjCmd: owned} -constraints unix -setup {
# Avoid problems with AFS
@@ -1329,8 +1348,12 @@ 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 knownMsvcBug} -body {
- file owned $env(windir)
+test cmdAH-25.3.1 {Tcl_FileObjCmd: owned} -constraints win -body {
+ if {[info exists env(SystemRoot)]} {
+ file owned $env(SystemRoot)
+ } else {
+ file owned $env(windir)
+ }
} -result 0
test cmdAH-25.4 {Tcl_FileObjCmd: owned} -body {
file owned nosuchfile
diff --git a/tests/cmdMZ.test b/tests/cmdMZ.test
index 9df6d20..1790f1d 100644
--- a/tests/cmdMZ.test
+++ b/tests/cmdMZ.test
@@ -26,7 +26,7 @@ namespace eval ::tcl::test::cmdMZ {
namespace import ::tcltest::test
testConstraint knownMsvcBug [expr {![info exists ::env(TRAVIS_OS_NAME)] || ![string match windows $::env(TRAVIS_OS_NAME)]}]
-
+
proc ListGlobMatch {expected actual} {
if {[llength $expected] != [llength $actual]} {
return 0
@@ -230,12 +230,12 @@ foreach {testid script} {
# More tests of Tcl_SourceObjCmd are in source.test
test cmdMZ-3.3 {Tcl_SourceObjCmd: error conditions} -constraints {
- unixOrPc
+ unixOrWin
} -returnCodes error -body {
source
} -match glob -result {wrong # args: should be "source*fileName"}
test cmdMZ-3.4 {Tcl_SourceObjCmd: error conditions} -constraints {
- unixOrPc
+ unixOrWin
} -returnCodes error -body {
source a b c d e f
} -match glob -result {wrong # args: should be "source*fileName"}
diff --git a/tests/compile.test b/tests/compile.test
index fb9a87a..4d57549 100644
--- a/tests/compile.test
+++ b/tests/compile.test
@@ -466,6 +466,67 @@ test compile-13.1 {testing underestimate of maxStackSize in list cmd} {exec} {
list [catch {exec [interpreter] << $script} msg] $msg
} {0 OK}
+# Tests of nested compile (body in body compilation), should not generate stack overflow
+# (with abnormal program termination), bug [fec0c17d39]:
+proc _ti_gencode {} {
+ # creates test interpreter on demand with [gencode] generator:
+ if {[interp exists ti]} {
+ return
+ }
+ interp create ti
+ ti eval {proc gencode {nr {cmd eval} {nl 0}} {
+ set code ""
+ set e ""; if {$nl} {set e "\n"}
+ for {set i 0} {$i < $nr} {incr i} {
+ append code "$cmd \{$e"
+ }
+ append code "lappend result 1$e"
+ for {set i 0} {$i < $nr} {incr i} {
+ append code "\}$e"
+ }
+ #puts [format "%% %.40s ... %d bytes" $code [string length $code]]
+ return $code
+ }}
+}
+test compile-13.2 {TclCompileScript: testing expected nested scripts compilation} -setup {
+ _ti_gencode
+ interp recursionlimit ti [expr {10000+50}]
+ ti eval {set result {}}
+} -body {
+ # Test different compilation variants (instructions evalStk, invokeStk, etc),
+ # with 2000 (1000 in debug) nested scripts (bodies). If you get SO/SF exceptions on some low-stack
+ # boxes or systems, please don't decrease it (either provide a constraint)
+ ti eval {foreach cmd {eval "if 1" try catch} {
+ set c [gencode [expr {![::tcl::pkgconfig get debug] ? 2000 : 1000}] $cmd]
+ if 1 $c
+ }}
+ ti eval {set result}
+} -result {1 1 1 1}
+test compile-13.3 {TclCompileScript: testing check of max depth by nested scripts compilation} -setup {
+ _ti_gencode
+ interp recursionlimit ti 100
+ ti eval {set result {}}
+} -body {
+ # Test different compilation variants (instructions evalStk, invokeStk, etc),
+ # with 500 nested scripts (bodies). It must generate "too many nested compilations"
+ # error for any variant we're testing here:
+ ti eval {foreach cmd {eval "if 1" try catch} {
+ set c [gencode [expr {![info exists ::tcl_platform(debug)] ? 2000 : 1000}] $cmd]
+ lappend errors [catch $c e] $e
+ }}
+ #puts $errors
+ # all of nested calls exceed the limit, so must end with "too many nested compilations"
+ # (or evaluations, depending on compile method/instruction and "mixed" compile within
+ # evaliation), so no one succeeds, the result must be empty:
+ ti eval {set result}
+} -result {}
+#
+# clean up:
+if {[interp exists ti]} {
+ interp delete ti
+}
+rename _ti_gencode {}
+
# Tests compile-14.* for [Bug 599788] [Bug 0c043a175a47da8c2342]
test compile-14.1 {testing errors in element name; segfault?} {} {
catch {set a([error])} msg1
diff --git a/tests/execute.test b/tests/execute.test
index 808574b..fbc4f99 100644
--- a/tests/execute.test
+++ b/tests/execute.test
@@ -37,6 +37,11 @@ testConstraint testobj [expr {
testConstraint longIs32bit [expr {$tcl_platform(wordSize) == 4}]
testConstraint testexprlongobj [llength [info commands testexprlongobj]]
+
+if {[namespace which -command testbumpinterpepoch] eq ""} {
+ proc testbumpinterpepoch {} { rename ::set ::dummy; rename ::dummy ::set }
+}
+
# Tests for the omnibus TclExecuteByteCode function:
# INST_DONE not tested
@@ -933,8 +938,7 @@ test execute-8.3 {Stack restoration} -setup {
proc f {args} "f $arglst"
proc run {} {
# bump the interp's epoch
- rename ::set ::dummy
- rename ::dummy ::set
+ testbumpinterpepoch
catch f msg
set msg
}
@@ -948,8 +952,7 @@ test execute-8.4 {Compile epoch bump effect on stack trace} -setup {
}
proc FOO {} {
catch {error bar} m o
- rename ::set ::dummy
- rename ::dummy ::set
+ testbumpinterpepoch
return -options $o $m
}
} -body {
@@ -978,10 +981,80 @@ test execute-8.5 {Bug 2038069} -setup {
invoked from within
"catch \[list error FOO\] m o"} -errorline 2}
+test execute-8.6 {Compile epoch bump in global level (bug [fa6bf38d07])} -setup {
+ interp create slave
+ slave eval {
+ package require tcltest
+ catch [list package require -exact Tcltest [info patchlevel]]
+ ::tcltest::loadTestedCommands
+ if {[namespace which -command testbumpinterpepoch] eq ""} {
+ proc testbumpinterpepoch {} { rename ::set ::dummy; rename ::dummy ::set }
+ }
+ }
+} -body {
+ slave eval {
+ lappend res A; testbumpinterpepoch; lappend res B; return; lappend res C;
+ }
+ slave eval {
+ set i 0; while {[incr i] < 3} {
+ lappend res A; testbumpinterpepoch; lappend res B; return; lappend res C;
+ }
+ }
+ slave eval {
+ set i 0; while {[incr i] < 3} {
+ lappend res A; testbumpinterpepoch; lappend res B; break; lappend res C;
+ }
+ }
+ slave eval {
+ catch {
+ lappend res A; testbumpinterpepoch; lappend res B; error test; lappend res C;
+ }
+ }
+ slave eval {set res}
+} -cleanup {
+ interp delete slave
+} -result [lrepeat 4 A B]
+test execute-8.7 {Compile epoch bump in global level (bug [fa6bf38d07]), exception case} -setup {
+ interp create slave
+ slave eval {
+ package require tcltest
+ catch [list package require -exact Tcltest [info patchlevel]]
+ ::tcltest::loadTestedCommands
+ if {[namespace which -command testbumpinterpepoch] eq ""} {
+ proc testbumpinterpepoch {} { rename ::set ::dummy; rename ::dummy ::set }
+ }
+ }
+} -body {
+ set res {}
+ lappend res [catch {
+ slave eval {
+ lappend res A; testbumpinterpepoch; lappend res B; return -code error test; lappend res C;
+ }
+ } e] $e
+ lappend res [catch {
+ slave eval {
+ lappend res A; testbumpinterpepoch; lappend res B; error test; lappend res C;
+ }
+ } e] $e
+ lappend res [catch {
+ slave eval {
+ lappend res A; testbumpinterpepoch; lappend res B; return -code return test; lappend res C;
+ }
+ } e] $e
+ lappend res [catch {
+ slave eval {
+ lappend res A; testbumpinterpepoch; lappend res B; break; lappend res C;
+ }
+ } e] $e
+ list $res [slave eval {set res}]
+} -cleanup {
+ interp delete slave
+} -result [list {1 test 1 test 2 test 3 {}} [lrepeat 4 A B]]
+
test execute-9.1 {Interp result resetting [Bug 1522803]} {
set c 0
catch {
- catch {set foo}
+ catch {error foo}
expr {1/$c}
}
if {[string match *foo* $::errorInfo]} {
@@ -1016,6 +1089,7 @@ test execute-10.3 {Bug 3072640} -setup {
proc t {args} {
incr ::foo
}
+ set ::foo 0
trace add execution ::generate enterstep ::t
} -body {
coroutine coro generate 5
diff --git a/tests/fCmd.test b/tests/fCmd.test
index a6e90a1..e8ed6f9 100644
--- a/tests/fCmd.test
+++ b/tests/fCmd.test
@@ -276,7 +276,7 @@ test fCmd-3.14 {FileCopyRename: FileBasename fails} -setup {
} -result {user "_totally_bogus_user" doesn't exist}
test fCmd-3.15 {FileCopyRename: source[0] == '\0'} -setup {
cleanup
-} -constraints {notRoot unixOrPc} -returnCodes error -body {
+} -constraints {notRoot unixOrWin} -returnCodes error -body {
file mkdir td1
file rename / td1
} -result {error renaming "/" to "td1": file already exists}
@@ -416,7 +416,7 @@ test fCmd-5.4 {TclFileDeleteCmd: multiple files} -constraints notRoot -setup {
} -cleanup {cleanup} -result {1 1 1 0 0 0}
test fCmd-5.5 {TclFileDeleteCmd: stop at first error} -setup {
cleanup
-} -constraints {notRoot unixOrPc} -body {
+} -constraints {notRoot unixOrWin} -body {
createfile tf1
createfile tf2
file mkdir td1
@@ -1116,7 +1116,7 @@ test fCmd-10.5 {file copy: comprehensive: dir to empty dir} -setup {
} -result [subst {{td1 td2 tdd1 tdd2 tdd3 tdd4 tds1 tds2 tds3 tds4} {1 {error copying "td1" to "[file join td2 td1]": file already exists}} {1 {error copying "tds1" to "[file join tdd1 tds1]": file already exists}} 1 1 1}]
test fCmd-10.6 {file copy: comprehensive: dir to non-empty dir} -setup {
cleanup
-} -constraints {notRoot unixOrPc testchmod} -body {
+} -constraints {notRoot unixOrWin testchmod} -body {
file mkdir tds1
file mkdir tds2
file mkdir [file join tdd1 tds1 xxx]
diff --git a/tests/fileName.test b/tests/fileName.test
index 7b51da1..0e4cb9e 100644
--- a/tests/fileName.test
+++ b/tests/fileName.test
@@ -1089,13 +1089,13 @@ file delete -force $tildeglobname
set globname globTest
unset horribleglobname tildeglobname
-test filename-12.1 {simple globbing} {unixOrPc} {
+test filename-12.1 {simple globbing} {unixOrWin} {
glob {}
} {.}
-test filename-12.1.1 {simple globbing} -constraints {unixOrPc} -body {
+test filename-12.1.1 {simple globbing} -constraints {unixOrWin} -body {
glob -types f {}
} -returnCodes error -result {no files matched glob pattern ""}
-test filename-12.1.2 {simple globbing} {unixOrPc} {
+test filename-12.1.2 {simple globbing} {unixOrWin} {
glob -types d {}
} {.}
test filename-12.1.3 {simple globbing} {unix} {
@@ -1116,7 +1116,7 @@ test filename-12.3 {simple globbing} {
set globPreResult globTest/
set x1 x1.c
set y1 y1.c
-test filename-12.4 {simple globbing} {unixOrPc} {
+test filename-12.4 {simple globbing} {unixOrWin} {
lsort [glob globTest/x1.c globTest/y1.c globTest/foo]
} "$globPreResult$x1 $globPreResult$y1"
test filename-12.5 {simple globbing} {
@@ -1178,32 +1178,32 @@ test filename-13.9 {globbing with brace substitution} {
test filename-13.10 {globbing with brace substitution} {
lsort [glob globTest/\{x,,y\}1.c]
} [list $globPreResult$x1 $globPreResult$y1]
-test filename-13.11 {globbing with brace substitution} {unixOrPc} {
+test filename-13.11 {globbing with brace substitution} {unixOrWin} {
lsort [glob globTest/\{x,x\\,z,z\}1.c]
} [lsort {globTest/x1.c globTest/x,z1.c globTest/z1.c}]
test filename-13.13 {globbing with brace substitution} {
lsort [glob globTest/{a,b,x,y}1.c]
} [list $globPreResult$x1 $globPreResult$y1]
-test filename-13.14 {globbing with brace substitution} {unixOrPc} {
+test filename-13.14 {globbing with brace substitution} {unixOrWin} {
lsort [glob {globTest/{x1,y2,weird name}.c}]
} {{globTest/weird name.c} globTest/x1.c}
-test filename-13.16 {globbing with brace substitution} {unixOrPc} {
+test filename-13.16 {globbing with brace substitution} {unixOrWin} {
lsort [glob globTest/{x1.c,a1/*}]
} {globTest/a1/b1 globTest/a1/b2 globTest/x1.c}
-test filename-13.18 {globbing with brace substitution} {unixOrPc} {
+test filename-13.18 {globbing with brace substitution} {unixOrWin} {
lsort [glob globTest/{x1.c,{a},a1/*}]
} {globTest/a1/b1 globTest/a1/b2 globTest/x1.c}
-test filename-13.20 {globbing with brace substitution} {unixOrPc} {
+test filename-13.20 {globbing with brace substitution} {unixOrWin} {
lsort [glob globTest/{a,x}1/*/{x,y}*]
} {globTest/a1/b1/x2.c globTest/a1/b2/y2.c}
test filename-13.22 {globbing with brace substitution} -body {
glob globTest/\{a,x\}1/*/\{
} -returnCodes error -result {unmatched open-brace in file name}
-test filename-14.1 {asterisks, question marks, and brackets} {unixOrPc} {
+test filename-14.1 {asterisks, question marks, and brackets} {unixOrWin} {
lsort [glob glo*/*.c]
} {{globTest/weird name.c} globTest/x,z1.c globTest/x1.c globTest/y1.c globTest/z1.c}
-test filename-14.3 {asterisks, question marks, and brackets} {unixOrPc} {
+test filename-14.3 {asterisks, question marks, and brackets} {unixOrWin} {
lsort [glob globTest/?1.c]
} {globTest/x1.c globTest/y1.c globTest/z1.c}
test filename-14.5 {asterisks, question marks, and brackets} -setup {
@@ -1213,7 +1213,7 @@ test filename-14.5 {asterisks, question marks, and brackets} -setup {
file rename globTest [file join globTestContext globTest]
set savepwd [pwd]
cd globTestContext
-} -constraints {unixOrPc} -body {
+} -constraints {unixOrWin} -body {
lsort [glob */*/*/*.c]
} -cleanup {
# Reset to where we were
@@ -1227,16 +1227,16 @@ test filename-14.7 {asterisks, question marks, and brackets} {unix} {
test filename-14.7.1 {asterisks, question marks, and brackets} {win} {
lsort [glob globTest/*]
} {globTest/.1 globTest/a1 globTest/a2 globTest/a3 {globTest/weird name.c} globTest/x,z1.c globTest/x1.c globTest/y1.c globTest/z1.c}
-test filename-14.9 {asterisks, question marks, and brackets} {unixOrPc} {
+test filename-14.9 {asterisks, question marks, and brackets} {unixOrWin} {
lsort [glob globTest/.*]
} {globTest/. globTest/.. globTest/.1}
-test filename-14.11 {asterisks, question marks, and brackets} {unixOrPc} {
+test filename-14.11 {asterisks, question marks, and brackets} {unixOrWin} {
lsort [glob globTest/*/*]
} {globTest/a1/b1 globTest/a1/b2 globTest/a2/b3}
-test filename-14.13 {asterisks, question marks, and brackets} {unixOrPc} {
+test filename-14.13 {asterisks, question marks, and brackets} {unixOrWin} {
lsort [glob {globTest/[xyab]1.*}]
} {globTest/x1.c globTest/y1.c}
-test filename-14.15 {asterisks, question marks, and brackets} {unixOrPc} {
+test filename-14.15 {asterisks, question marks, and brackets} {unixOrWin} {
lsort [glob globTest/*/]
} {globTest/a1/ globTest/a2/ globTest/a3/}
test filename-14.17 {asterisks, question marks, and brackets} -setup {
@@ -1248,7 +1248,7 @@ test filename-14.17 {asterisks, question marks, and brackets} -setup {
} -cleanup {
set env(HOME) $temp
} -result [list [file join $env(HOME) globTest z1.c]]
-test filename-14.18 {asterisks, question marks, and brackets} {unixOrPc} {
+test filename-14.18 {asterisks, question marks, and brackets} {unixOrWin} {
lsort [glob globTest/*.c goo/*]
} {{globTest/weird name.c} globTest/x,z1.c globTest/x1.c globTest/y1.c globTest/z1.c}
test filename-14.20 {asterisks, question marks, and brackets} {
@@ -1287,16 +1287,16 @@ test filename-14.25.1 {type specific globbing} {win} {
test filename-14.26 {type specific globbing} {
glob -nocomplain -dir globTest -types {readonly} *
} {}
-test filename-14.27 {Bug 2710920} {unixOrPc} {
+test filename-14.27 {Bug 2710920} {unixOrWin} {
file tail [lindex [lsort [glob globTest/*/]] 0]
} a1
-test filename-14.28 {Bug 2710920} {unixOrPc} {
+test filename-14.28 {Bug 2710920} {unixOrWin} {
file dirname [lindex [lsort [glob globTest/*/]] 0]
} globTest
-test filename-14.29 {Bug 2710920} {unixOrPc} {
+test filename-14.29 {Bug 2710920} {unixOrWin} {
file extension [lindex [lsort [glob globTest/*/]] 0]
} {}
-test filename-14.30 {Bug 2710920} {unixOrPc} {
+test filename-14.30 {Bug 2710920} {unixOrWin} {
file rootname [lindex [lsort [glob globTest/*/]] 0]
} globTest/a1/
diff --git a/tests/interp.test b/tests/interp.test
index 76ac01f..599ac08 100644
--- a/tests/interp.test
+++ b/tests/interp.test
@@ -1836,7 +1836,7 @@ test interp-23.1 {testing hiding vs aliases: unsafe interp} -setup {
test interp-23.2 {testing hiding vs aliases: safe interp} -setup {
catch {interp delete a}
set l ""
-} -constraints {unixOrPc} -body {
+} -constraints {unixOrWin} -body {
interp create a -safe
lappend l [lsort [interp hidden a]]
a alias bar bar
diff --git a/tests/io.test b/tests/io.test
index 6d9e1c3..9bd87ef 100644
--- a/tests/io.test
+++ b/tests/io.test
@@ -2212,7 +2212,7 @@ test io-27.4 {FlushChannel, implicit flush when buffer fills} {
set l
} {0 60 72}
test io-27.5 {FlushChannel, implicit flush when buffer fills and on close} \
- {unixOrPc} {
+ {unixOrWin} {
file delete $path(test1)
set f [open $path(test1) w]
fconfigure $f -translation lf -buffersize 60 -eofchar {}
@@ -8084,7 +8084,7 @@ test io-53.17 {[7c187a3773] MBWrite: proper inQueueTail handling} -setup {
removeFile out
} -result {line 100 line}
-test io-54.1 {Recursive channel events} {socket fileevent} {
+test io-54.1 {Recursive channel events} {socket fileevent knownMsvcBug} {
# This test checks to see if file events are delivered during recursive
# event loops when there is buffered data on the channel.
@@ -8293,7 +8293,7 @@ test io-57.2 {buffered data and file events, read} {fileevent} {
set result
} {1 readable 234567890 timer}
-test io-58.1 {Tcl_NotifyChannel and error when closing} {stdio unixOrPc openpipe fileevent} {
+test io-58.1 {Tcl_NotifyChannel and error when closing} {stdio unixOrWin openpipe fileevent} {
set out [open $path(script) w]
puts $out {
puts "normal message from pipe"
diff --git a/tests/ioCmd.test b/tests/ioCmd.test
index 89afb0a..0e47d2f 100644
--- a/tests/ioCmd.test
+++ b/tests/ioCmd.test
@@ -25,7 +25,6 @@ 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)]}]
#----------------------------------------------------------------------
@@ -295,7 +294,7 @@ removeFile fconfigure.dummy
test iocmd-8.14 {fconfigure command} {
fconfigure stdin -buffers
} 4096
-test iocmd-8.15.1 {fconfigure command / tcp channel} -constraints {socket unixOrPc} -setup {
+test iocmd-8.15.1 {fconfigure command / tcp channel} -constraints {socket unixOrWin} -setup {
set srv [socket -server iocmdSRV -myaddr 127.0.0.1 0]
set port [lindex [fconfigure $srv -sockname] 2]
proc iocmdSRV {sock ip port} {close $sock}
@@ -403,18 +402,18 @@ test iocmd-10.5 {fblocked command} {
set path(test4) [makeFile {} test4]
set path(test5) [makeFile {} test5]
-test iocmd-11.1 {I/O to command pipelines} {unixOrPc unixExecs} {
+test iocmd-11.1 {I/O to command pipelines} {unixOrWin unixExecs} {
set f [open $path(test4) w]
close $f
list [catch {open "| cat < \"$path(test4)\" > \"$path(test5)\"" w} msg] $msg $::errorCode
} {1 {can't write input to command: standard input was redirected} {TCL OPERATION EXEC BADREDIRECT}}
-test iocmd-11.2 {I/O to command pipelines} {unixOrPc unixExecs} {
+test iocmd-11.2 {I/O to command pipelines} {unixOrWin unixExecs} {
list [catch {open "| echo > \"$path(test5)\"" r} msg] $msg $::errorCode
} {1 {can't read output from command: standard output was redirected} {TCL OPERATION EXEC BADREDIRECT}}
-test iocmd-11.3 {I/O to command pipelines} {unixOrPc unixExecs} {
+test iocmd-11.3 {I/O to command pipelines} {unixOrWin unixExecs} {
list [catch {open "| echo > \"$path(test5)\"" r+} msg] $msg $::errorCode
} {1 {can't read output from command: standard output was redirected} {TCL OPERATION EXEC BADREDIRECT}}
-test iocmd-11.4 {I/O to command pipelines} {notValgrind unixOrPc} {
+test iocmd-11.4 {I/O to command pipelines} {notValgrind unixOrWin} {
list [catch {open "| no_such_command_exists" rb} msg] $msg $::errorCode
} {1 {couldn't execute "no_such_command_exists": no such file or directory} {POSIX ENOENT {no such file or directory}}}
@@ -811,7 +810,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} -constraints knownMsvcBug -setup {
+test iocmd-21.20 {Bug 88aef05cda} -setup {
proc foo {method chan args} {
switch -- $method blocking {
chan configure $chan -blocking [lindex $args 0]
@@ -825,11 +824,11 @@ test iocmd-21.20 {Bug 88aef05cda} -constraints knownMsvcBug -setup {
}
set ch [chan create {read write} foo]
} -body {
- list [catch {chan configure $ch -blocking 0} m] $m
+ chan configure $ch -blocking 0
} -cleanup {
close $ch
rename foo {}
-} -match glob -result {1 {*nested eval*}}
+} -match glob -returnCodes 1 -result {*(infinite loop?)*}
test iocmd-21.21 {[close] in [read] segfaults} -setup {
proc foo {method chan args} {
switch -- $method initialize {
diff --git a/tests/lrange.test b/tests/lrange.test
index dcc0eec..4f7c0d3 100644
--- a/tests/lrange.test
+++ b/tests/lrange.test
@@ -133,15 +133,19 @@ test lrange-3.7b.2 {not compiled on empty not list object, 2nd regression test,
list [$cmd {} 0 1] [$cmd [lindex a -1] 0 1] [$cmd [set a {}] 0 1] \
[$cmd {} 0-1 end+1] [$cmd [lindex a -1] 0-1 end+1] [$cmd $a 0-1 end+1]
} [lrepeat 6 {}]
-test lrange-3.7c.2 {compiled on empty pure bytes object, 2nd regression test, bug [cc1e91552c]} {
+test lrange-3.7c.2 {compiled on empty pure bytes object, 2nd regression test, bug [cc1e91552c]} -constraints {
+ testpurebytesobj
+} -body {
list [lrange [testpurebytesobj] 0 1] [lrange [testpurebytesobj { }] 0 1] [lrange [set a [testpurebytesobj {}]] 0 1] \
[lrange [testpurebytesobj] 0-1 end+1] [lrange [testpurebytesobj { }] 0-1 end+1] [lrange $a 0-1 end+1]
-} [lrepeat 6 {}]
-test lrange-3.7d.2 {not compiled on empty pure bytes object, 2nd regression test, bug [cc1e91552c]} {
+} -result [lrepeat 6 {}]
+test lrange-3.7d.2 {not compiled on empty pure bytes object, 2nd regression test, bug [cc1e91552c]} -constraints {
+ testpurebytesobj
+} -body {
set cmd lrange
list [$cmd [testpurebytesobj] 0 1] [$cmd [testpurebytesobj { }] 0 1] [$cmd [set a [testpurebytesobj {}]] 0 1] \
[$cmd [testpurebytesobj] 0-1 end+1] [$cmd [testpurebytesobj { }] 0-1 end+1] [$cmd $a 0-1 end+1]
-} [lrepeat 6 {}]
+} -result [lrepeat 6 {}]
test lrange-4.1 {lrange pure promise} -body {
set ll1 [list $tcl_version 2 3 4]
diff --git a/tests/namespace.test b/tests/namespace.test
index e90c753..0d93092 100644
--- a/tests/namespace.test
+++ b/tests/namespace.test
@@ -2624,6 +2624,7 @@ test namespace-51.6 {name resolution path control} -body {
namespace delete ::test_ns_1
catch {rename ::pathtestB {}}
catch {rename ::pathtestD {}}
+ catch {rename ::pathtestC {}}
}
test namespace-51.7 {name resolution path control} -body {
namespace eval ::test_ns_1 {
diff --git a/tests/pid.test b/tests/pid.test
index d21dbaa..af21f30 100644
--- a/tests/pid.test
+++ b/tests/pid.test
@@ -21,7 +21,7 @@ testConstraint pidDefined [llength [info commands pid]]
test pid-1.1 {pid command} pidDefined {
regexp {(^[0-9]+$)|(^0x[0-9a-fA-F]+$)} [pid]
} 1
-test pid-1.2 {pid command} -constraints {unixOrPc unixExecs pidDefined} -setup {
+test pid-1.2 {pid command} -constraints {unixOrWin unixExecs pidDefined} -setup {
set path(test1) [makeFile {} test1]
file delete $path(test1)
} -body {
diff --git a/tests/socket.test b/tests/socket.test
index 84320bd..20b890d 100644
--- a/tests/socket.test
+++ b/tests/socket.test
@@ -1084,7 +1084,7 @@ test socket_$af-7.4 {testing socket specific options} -constraints [list socket
test socket_$af-7.5 {testing socket specific options} -setup {
set timer [after 10000 "set x timed_out"]
set l ""
-} -constraints [list socket supported_$af unixOrPc] -body {
+} -constraints [list socket supported_$af unixOrWin] -body {
set s [socket -server accept 0]
proc accept {s a p} {
global x
diff --git a/tests/tcltest.test b/tests/tcltest.test
index ca720ee..c856209 100644
--- a/tests/tcltest.test
+++ b/tests/tcltest.test
@@ -98,44 +98,44 @@ proc slave {msgVar args} {
}
return $code
}
-test tcltest-2.0 {tcltest (verbose default - 'b')} {unixOrPc} {
+test tcltest-2.0 {tcltest (verbose default - 'b')} {unixOrWin} {
set result [slave msg test.tcl]
list $result [regexp "Contents of test case" $msg] [regexp a-1.0 $msg] \
[regexp c-1.0 $msg] \
[regexp "Total.+4.+Passed.+1.+Skipped.+1.+Failed.+2" $msg]
} {0 1 0 0 1}
-test tcltest-2.1 {tcltest -verbose 'b'} {unixOrPc} {
+test tcltest-2.1 {tcltest -verbose 'b'} {unixOrWin} {
set result [slave msg test.tcl -verbose 'b']
list $result [regexp "Contents of test case" $msg] [regexp a-1.0 $msg] \
[regexp c-1.0 $msg] \
[regexp "Total.+4.+Passed.+1.+Skipped.+1.+Failed.+2" $msg]
} {0 1 0 0 1}
-test tcltest-2.2 {tcltest -verbose 'p'} {unixOrPc} {
+test tcltest-2.2 {tcltest -verbose 'p'} {unixOrWin} {
set result [slave msg test.tcl -verbose 'p']
list $result [regexp "Contents of test case" $msg] [regexp a-1.0 $msg] \
[regexp c-1.0 $msg] \
[regexp "Total.+4.+Passed.+1.+Skipped.+1.+Failed.+2" $msg]
} {0 0 1 0 1}
-test tcltest-2.3 {tcltest -verbose 's'} {unixOrPc} {
+test tcltest-2.3 {tcltest -verbose 's'} {unixOrWin} {
set result [slave msg test.tcl -verbose 's']
list $result [regexp "Contents of test case" $msg] [regexp a-1.0 $msg] \
[regexp c-1.0 $msg] \
[regexp "Total.+4.+Passed.+1.+Skipped.+1.+Failed.+2" $msg]
} {0 0 0 1 1}
-test tcltest-2.4 {tcltest -verbose 'ps'} {unixOrPc} {
+test tcltest-2.4 {tcltest -verbose 'ps'} {unixOrWin} {
set result [slave msg test.tcl -verbose 'ps']
list $result [regexp "Contents of test case" $msg] [regexp a-1.0 $msg] \
[regexp c-1.0 $msg] \
[regexp "Total.+4.+Passed.+1.+Skipped.+1.+Failed.+2" $msg]
} {0 0 1 1 1}
-test tcltest-2.5 {tcltest -verbose 'psb'} {unixOrPc} {
+test tcltest-2.5 {tcltest -verbose 'psb'} {unixOrWin} {
set result [slave msg test.tcl -verbose 'psb']
list $result [regexp "Contents of test case" $msg] [regexp a-1.0 $msg] \
[regexp c-1.0 $msg] \
[regexp "Total.+4.+Passed.+1.+Skipped.+1.+Failed.+2" $msg]
} {0 1 1 1 1}
-test tcltest-2.5a {tcltest -verbose 'pass skip body'} {unixOrPc} {
+test tcltest-2.5a {tcltest -verbose 'pass skip body'} {unixOrWin} {
set result [slave msg test.tcl -verbose "pass skip body"]
list $result [regexp "Contents of test case" $msg] [regexp a-1.0 $msg] \
[regexp c-1.0 $msg] \
@@ -143,7 +143,7 @@ test tcltest-2.5a {tcltest -verbose 'pass skip body'} {unixOrPc} {
} {0 1 1 1 1}
test tcltest-2.6 {tcltest -verbose 't'} {
- -constraints {unixOrPc}
+ -constraints {unixOrWin}
-body {
set result [slave msg test.tcl -verbose 't']
list $result $msg
@@ -153,7 +153,7 @@ test tcltest-2.6 {tcltest -verbose 't'} {
}
test tcltest-2.6a {tcltest -verbose 'start'} {
- -constraints {unixOrPc}
+ -constraints {unixOrWin}
-body {
set result [slave msg test.tcl -verbose start]
list $result $msg
@@ -176,7 +176,7 @@ test tcltest-2.7 {tcltest::verbose} {
}
test tcltest-2.8 {tcltest -verbose 'error'} {
- -constraints {unixOrPc}
+ -constraints {unixOrWin}
-body {
set result [slave msg test.tcl -verbose error]
list $result $msg
@@ -185,22 +185,22 @@ test tcltest-2.8 {tcltest -verbose 'error'} {
-match regexp
}
# -match, [match]
-test tcltest-3.1 {tcltest -match 'a*'} {unixOrPc} {
+test tcltest-3.1 {tcltest -match 'a*'} {unixOrWin} {
set result [slave msg test.tcl -match a* -verbose 'ps']
list $result [regexp a-1.0 $msg] [regexp b-1.0 $msg] [regexp c-1.0 $msg] \
[regexp "Total.+4.+Passed.+1.+Skipped.+3.+Failed.+0" $msg]
} {0 1 0 0 1}
-test tcltest-3.2 {tcltest -match 'b*'} {unixOrPc} {
+test tcltest-3.2 {tcltest -match 'b*'} {unixOrWin} {
set result [slave msg test.tcl -match b* -verbose 'ps']
list $result [regexp a-1.0 $msg] [regexp b-1.0 $msg] [regexp c-1.0 $msg] \
[regexp "Total.+4.+Passed.+0.+Skipped.+3.+Failed.+1" $msg]
} {0 0 1 0 1}
-test tcltest-3.3 {tcltest -match 'c*'} {unixOrPc} {
+test tcltest-3.3 {tcltest -match 'c*'} {unixOrWin} {
set result [slave msg test.tcl -match c* -verbose 'ps']
list $result [regexp a-1.0 $msg] [regexp b-1.0 $msg] [regexp c-1.0 $msg] \
[regexp "Total.+4.+Passed.+0.+Skipped.+4.+Failed.+0" $msg]
} {0 0 0 1 1}
-test tcltest-3.4 {tcltest -match 'a* b*'} {unixOrPc} {
+test tcltest-3.4 {tcltest -match 'a* b*'} {unixOrWin} {
set result [slave msg test.tcl -match {a* b*} -verbose 'ps']
list $result [regexp a-1.0 $msg] [regexp b-1.0 $msg] [regexp c-1.0 $msg] \
[regexp "Total.+4.+Passed.+1.+Skipped.+2.+Failed.+1" $msg]
@@ -220,27 +220,27 @@ test tcltest-3.5 {tcltest::match} {
}
# -skip, [skip]
-test tcltest-4.1 {tcltest -skip 'a*'} {unixOrPc} {
+test tcltest-4.1 {tcltest -skip 'a*'} {unixOrWin} {
set result [slave msg test.tcl -skip a* -verbose 'ps']
list $result [regexp a-1.0 $msg] [regexp b-1.0 $msg] [regexp c-1.0 $msg] \
[regexp "Total.+4.+Passed.+0.+Skipped.+2.+Failed.+1" $msg]
} {0 0 1 1 1}
-test tcltest-4.2 {tcltest -skip 'b*'} {unixOrPc} {
+test tcltest-4.2 {tcltest -skip 'b*'} {unixOrWin} {
set result [slave msg test.tcl -skip b* -verbose 'ps']
list $result [regexp a-1.0 $msg] [regexp b-1.0 $msg] [regexp c-1.0 $msg] \
[regexp "Total.+4.+Passed.+1.+Skipped.+2.+Failed.+1" $msg]
} {0 1 0 1 1}
-test tcltest-4.3 {tcltest -skip 'c*'} {unixOrPc} {
+test tcltest-4.3 {tcltest -skip 'c*'} {unixOrWin} {
set result [slave msg test.tcl -skip c* -verbose 'ps']
list $result [regexp a-1.0 $msg] [regexp b-1.0 $msg] [regexp c-1.0 $msg] \
[regexp "Total.+4.+Passed.+1.+Skipped.+1.+Failed.+2" $msg]
} {0 1 1 0 1}
-test tcltest-4.4 {tcltest -skip 'a* b*'} {unixOrPc} {
+test tcltest-4.4 {tcltest -skip 'a* b*'} {unixOrWin} {
set result [slave msg test.tcl -skip {a* b*} -verbose 'ps']
list $result [regexp a-1.0 $msg] [regexp b-1.0 $msg] [regexp c-1.0 $msg] \
[regexp "Total.+4.+Passed.+0.+Skipped.+3.+Failed.+1" $msg]
} {0 0 0 1 1}
-test tcltest-4.5 {tcltest -match 'a* b*' -skip 'b*'} {unixOrPc} {
+test tcltest-4.5 {tcltest -match 'a* b*' -skip 'b*'} {unixOrWin} {
set result [slave msg test.tcl -match {a* b*} -skip b* -verbose 'ps']
list $result [regexp a-1.0 $msg] [regexp b-1.0 $msg] [regexp c-1.0 $msg] \
[regexp "Total.+4.+Passed.+1.+Skipped.+3.+Failed.+0" $msg]
@@ -261,12 +261,12 @@ test tcltest-4.6 {tcltest::skip} {
# -constraints, -limitconstraints, [testConstraint],
# $constraintsSpecified, [limitConstraints]
-test tcltest-5.1 {tcltest -constraints 'knownBug'} {unixOrPc} {
+test tcltest-5.1 {tcltest -constraints 'knownBug'} {unixOrWin} {
set result [slave msg test.tcl -constraints knownBug -verbose 'ps']
list $result [regexp a-1.0 $msg] [regexp b-1.0 $msg] [regexp c-1.0 $msg] \
[regexp "Total.+4.+Passed.+2.+Skipped.+0.+Failed.+2" $msg]
} {0 1 1 1 1}
-test tcltest-5.2 {tcltest -constraints 'knownBug' -limitconstraints 1} {unixOrPc} {
+test tcltest-5.2 {tcltest -constraints 'knownBug' -limitconstraints 1} {unixOrWin} {
set result [slave msg test.tcl -constraints knownBug -verbose 'p' -limitconstraints 1]
list $result [regexp a-1.0 $msg] [regexp b-1.0 $msg] [regexp c-1.0 $msg] \
[regexp "Total.+4.+Passed.+1.+Skipped.+3.+Failed.+0" $msg]
@@ -355,7 +355,7 @@ set printerror [makeFile {
} printerror.tcl]
test tcltest-6.1 {tcltest -outfile, -errfile defaults} {
- -constraints unixOrPc
+ -constraints unixOrWin
-body {
slave msg $printerror
return $msg
@@ -363,21 +363,21 @@ test tcltest-6.1 {tcltest -outfile, -errfile defaults} {
-result {a test.*a really}
-match regexp
}
-test tcltest-6.2 {tcltest -outfile a.tmp} {unixOrPc unixExecs} {
+test tcltest-6.2 {tcltest -outfile a.tmp} {unixOrWin unixExecs} {
slave msg $printerror -outfile a.tmp
set result1 [catch {exec grep "a test" a.tmp}]
set result2 [catch {exec grep "a really" a.tmp}]
list [regexp "a test" $msg] [regexp "a really" $msg] \
$result1 $result2 [file exists a.tmp] [file delete a.tmp]
} {0 1 0 1 1 {}}
-test tcltest-6.3 {tcltest -errfile a.tmp} {unixOrPc unixExecs} {
+test tcltest-6.3 {tcltest -errfile a.tmp} {unixOrWin unixExecs} {
slave msg $printerror -errfile a.tmp
set result1 [catch {exec grep "a test" a.tmp}]
set result2 [catch {exec grep "a really" a.tmp}]
list [regexp "a test" $msg] [regexp "a really" $msg] \
$result1 $result2 [file exists a.tmp] [file delete a.tmp]
} {1 0 1 0 1 {}}
-test tcltest-6.4 {tcltest -outfile a.tmp -errfile b.tmp} {unixOrPc unixExecs} {
+test tcltest-6.4 {tcltest -outfile a.tmp -errfile b.tmp} {unixOrWin unixExecs} {
slave msg $printerror -outfile a.tmp -errfile b.tmp
set result1 [catch {exec grep "a test" a.tmp}]
set result2 [catch {exec grep "a really" b.tmp}]
@@ -464,25 +464,25 @@ test tcltest-6.8 {tcltest::outputFile (implicit outputFile)} {
# Must use child processes to test -debug because it always writes
# messages to stdout, and we have no way to capture stdout of a
# slave interp
-test tcltest-7.1 {tcltest test.tcl -debug 0} {unixOrPc} {
+test tcltest-7.1 {tcltest test.tcl -debug 0} {unixOrWin} {
catch {exec [interpreter] test.tcl -debug 0} msg
regexp "Flags passed into tcltest" $msg
} {0}
-test tcltest-7.2 {tcltest test.tcl -debug 1} {unixOrPc} {
+test tcltest-7.2 {tcltest test.tcl -debug 1} {unixOrWin} {
catch {exec [interpreter] test.tcl -debug 1 -skip b*} msg
list [regexp userSpecifiedSkip $msg] \
[regexp "Flags passed into tcltest" $msg]
} {1 0}
-test tcltest-7.3 {tcltest test.tcl -debug 1} {unixOrPc} {
+test tcltest-7.3 {tcltest test.tcl -debug 1} {unixOrWin} {
catch {exec [interpreter] test.tcl -debug 1 -match b*} msg
list [regexp userSpecifiedNonMatch $msg] \
[regexp "Flags passed into tcltest" $msg]
} {1 0}
-test tcltest-7.4 {tcltest test.tcl -debug 2} {unixOrPc} {
+test tcltest-7.4 {tcltest test.tcl -debug 2} {unixOrWin} {
catch {exec [interpreter] test.tcl -debug 2} msg
list [regexp "Flags passed into tcltest" $msg] [regexp "Running" $msg]
} {1 0}
-test tcltest-7.5 {tcltest test.tcl -debug 3} {unixOrPc} {
+test tcltest-7.5 {tcltest test.tcl -debug 3} {unixOrWin} {
catch {exec [interpreter] test.tcl -debug 3} msg
list [regexp "Flags passed into tcltest" $msg] [regexp "Running" $msg]
} {1 1}
@@ -522,7 +522,7 @@ set normaldirectory [makeDirectory normaldirectory]
normalizePath normaldirectory
# -tmpdir, [temporaryDirectory]
-test tcltest-8.1 {tcltest a.tcl -tmpdir a} -constraints unixOrPc -setup {
+test tcltest-8.1 {tcltest a.tcl -tmpdir a} -constraints unixOrWin -setup {
file delete -force thisdirectorydoesnotexist
} -body {
slave msg $a -tmpdir thisdirectorydoesnotexist
@@ -531,7 +531,7 @@ test tcltest-8.1 {tcltest a.tcl -tmpdir a} -constraints unixOrPc -setup {
file delete -force thisdirectorydoesnotexist
} -result 1
test tcltest-8.2 {tcltest a.tcl -tmpdir thisdirectoryisafile} {
- -constraints unixOrPc
+ -constraints unixOrWin
-body {
slave msg $a -tmpdir $tdiaf
return $msg
@@ -572,7 +572,7 @@ testConstraint notFAT [expr {
}]
# FAT/NTFS permissions are fairly hopeless; ignore this test if that FS is used
test tcltest-8.4 {tcltest a.tcl -tmpdir notWriteableDir} {
- -constraints {unixOrPc notRoot notFAT}
+ -constraints {unixOrWin notRoot notFAT}
-body {
slave msg $a -tmpdir $notWriteableDir
return $msg
@@ -581,7 +581,7 @@ test tcltest-8.4 {tcltest a.tcl -tmpdir notWriteableDir} {
-match glob
}
test tcltest-8.5 {tcltest a.tcl -tmpdir normaldirectory} {
- -constraints unixOrPc
+ -constraints unixOrWin
-body {
slave msg $a -tmpdir $normaldirectory
# The join is necessary because the message can be split on multiple
@@ -624,7 +624,7 @@ test tcltest-8.6a {temporaryDirectory - test format 2} -setup {
cd [temporaryDirectory]
# -testdir, [testsDirectory]
test tcltest-8.10 {tcltest a.tcl -testdir thisdirectorydoesnotexist} {
- -constraints unixOrPc
+ -constraints unixOrWin
-setup {
file delete -force thisdirectorydoesnotexist
}
@@ -636,7 +636,7 @@ test tcltest-8.10 {tcltest a.tcl -testdir thisdirectorydoesnotexist} {
-result {*does not exist*}
}
test tcltest-8.11 {tcltest a.tcl -testdir thisdirectoryisafile} {
- -constraints unixOrPc
+ -constraints unixOrWin
-body {
slave msg $a -testdir $tdiaf
return $msg
@@ -654,7 +654,7 @@ test tcltest-8.12 {tcltest a.tcl -testdir notReadableDir} {
-result {*not readable*}
}
test tcltest-8.13 {tcltest a.tcl -testdir normaldirectory} {
- -constraints unixOrPc
+ -constraints unixOrWin
-body {
slave msg $a -testdir $normaldirectory
# The join is necessary because the message can be split on multiple
@@ -731,7 +731,7 @@ removeFile thisdirectoryisafile
removeDirectory normaldirectory
# -file, -notfile, [matchFiles], [skipFiles]
-test tcltest-9.1 {-file d*.tcl} -constraints {unixOrPc} -setup {
+test tcltest-9.1 {-file d*.tcl} -constraints {unixOrWin} -setup {
set old [testsDirectory]
testsDirectory [file dirname [info script]]
} -body {
@@ -741,7 +741,7 @@ test tcltest-9.1 {-file d*.tcl} -constraints {unixOrPc} -setup {
testsDirectory $old
} -match regexp -result {dstring\.test}
-test tcltest-9.2 {-file d*.tcl} -constraints {unixOrPc} -setup {
+test tcltest-9.2 {-file d*.tcl} -constraints {unixOrWin} -setup {
set old [testsDirectory]
testsDirectory [file dirname [info script]]
} -body {
@@ -806,23 +806,23 @@ set mc [makeFile {
} makecore.tcl]
cd [temporaryDirectory]
-test tcltest-10.1 {-preservecore 0} {unixOrPc} {
+test tcltest-10.1 {-preservecore 0} {unixOrWin} {
slave msg $mc -preservecore 0
file delete core
regexp "Core file produced" $msg
} {0}
-test tcltest-10.2 {-preservecore 1} {unixOrPc} {
+test tcltest-10.2 {-preservecore 1} {unixOrWin} {
slave msg $mc -preservecore 1
file delete core
regexp "Core file produced" $msg
} {1}
-test tcltest-10.3 {-preservecore 2} {unixOrPc} {
+test tcltest-10.3 {-preservecore 2} {unixOrWin} {
slave msg $mc -preservecore 2
file delete core
list [regexp "Core file produced" $msg] [regexp "Moving file to" $msg] \
[regexp "core-" $msg] [file delete core-makecore]
} {1 1 1 {}}
-test tcltest-10.4 {-preservecore 3} {unixOrPc} {
+test tcltest-10.4 {-preservecore 3} {unixOrWin} {
slave msg $mc -preservecore 3
file delete core
list [regexp "Core file produced" $msg] [regexp "Moving file to" $msg] \
@@ -853,13 +853,13 @@ set contents {
}
set loadfile [makeFile $contents load.tcl]
-test tcltest-12.1 {-load xxx} {unixOrPc} {
+test tcltest-12.1 {-load xxx} {unixOrWin} {
slave msg $loadfile -load xxx
return $msg
} {xxx}
# Using child process because of -debug usage.
-test tcltest-12.2 {-loadfile load.tcl} {unixOrPc} {
+test tcltest-12.2 {-loadfile load.tcl} {unixOrWin} {
catch {exec [interpreter] $loadfile -debug 2 -loadfile $loadfile} msg
list \
[regexp {tcltest} [join [list $msg] [split $msg \n]]] \
@@ -950,7 +950,7 @@ set allfile [makeFile {
cd [workingDirectory]
test tcltest-14.1 {-singleproc - single process} {
- -constraints {unixOrPc}
+ -constraints {unixOrWin}
-body {
slave msg $allfile -singleproc 0 -tmpdir [temporaryDirectory]
return $msg
@@ -960,7 +960,7 @@ test tcltest-14.1 {-singleproc - single process} {
}
test tcltest-14.2 {-singleproc - multiple process} {
- -constraints {unixOrPc}
+ -constraints {unixOrWin}
-body {
slave msg $allfile -singleproc 1 -tmpdir [temporaryDirectory]
return $msg
@@ -1024,7 +1024,7 @@ makeFile {
} all.tcl $dtd3
test tcltest-15.1 {basic directory walking} {
- -constraints {unixOrPc}
+ -constraints {unixOrWin}
-body {
if {[slave msg \
[file join $dtd all.tcl] \
@@ -1038,7 +1038,7 @@ test tcltest-15.1 {basic directory walking} {
}
test tcltest-15.2 {-asidefromdir} {
- -constraints {unixOrPc}
+ -constraints {unixOrWin}
-body {
if {[slave msg \
[file join $dtd all.tcl] \
@@ -1056,7 +1056,7 @@ Error: No test files remain after applying your match and skip patterns!$}
}
test tcltest-15.3 {-relateddir, non-existent dir} {
- -constraints {unixOrPc}
+ -constraints {unixOrWin}
-body {
if {[slave msg \
[file join $dtd all.tcl] \
@@ -1071,7 +1071,7 @@ test tcltest-15.3 {-relateddir, non-existent dir} {
}
test tcltest-15.4 {-relateddir, subdir} {
- -constraints {unixOrPc}
+ -constraints {unixOrWin}
-body {
if {[slave msg \
[file join $dtd all.tcl] \
@@ -1084,7 +1084,7 @@ test tcltest-15.4 {-relateddir, subdir} {
-result {Tests located in:.*dirtestdir2.[^23]}
}
test tcltest-15.5 {-relateddir, -asidefromdir} {
- -constraints {unixOrPc}
+ -constraints {unixOrWin}
-body {
if {[slave msg \
[file join $dtd all.tcl] \
@@ -1173,7 +1173,7 @@ test tcltest-19.1 {TCLTEST_OPTIONS default} -setup {
cd [temporaryDirectory]
# PrintError
-test tcltest-20.1 {PrintError} {unixOrPc} {
+test tcltest-20.1 {PrintError} {unixOrWin} {
set result [slave msg $printerror]
list $result [regexp "Error: a really short string" $msg] \
[regexp " \"quotes\"" $msg] [regexp " \"Path" $msg] \
@@ -1409,7 +1409,7 @@ makeFile {
# Must use a child process because stdout/stderr parsing can't be
# duplicated in slave interp.
test tcltest-22.1 {runAllTests} {
- -constraints {unixOrPc}
+ -constraints {unixOrWin}
-body {
exec [interpreter] \
[file join $atd all.tcl] \
diff --git a/tests/tm.test b/tests/tm.test
index 567d351..001b73e 100644
--- a/tests/tm.test
+++ b/tests/tm.test
@@ -200,7 +200,7 @@ test tm-3.11 {tm: module path management, remove ignores unknown path} -setup {
proc genpaths {base} {
# Normalizing picks up drive letters on windows [Bug 1053568]
set base [file normalize $base]
- lassign [split [package present Tcl] .] major minor
+ regexp {^(\d+)\.(\d+)} [package provide Tcl] - major minor
set results {}
set base [file join $base tcl$major]
lappend results [file join $base site-tcl]
diff --git a/tests/uplevel.test b/tests/uplevel.test
index be2268a..2cbea1a 100644
--- a/tests/uplevel.test
+++ b/tests/uplevel.test
@@ -83,6 +83,16 @@ test uplevel-3.4 {uplevel to same level} {
a1
} 55
+test uplevel-4.0.1 {error: non-existent level} -body {
+ uplevel #0 { uplevel { set y 222 } }
+} -returnCodes error -result {bad level "1"}
+test uplevel-4.0.2 {error: non-existent level} -setup {
+ interp create i
+} -body {
+ i eval { uplevel { set y 222 } }
+} -returnCodes error -result {bad level "1"} -cleanup {
+ interp delete i
+}
test uplevel-4.1 {error: non-existent level} -returnCodes error -body {
apply {{} {
uplevel #2 {set y 222}
diff --git a/tests/upvar.test b/tests/upvar.test
index 91153a6..a483569 100644
--- a/tests/upvar.test
+++ b/tests/upvar.test
@@ -304,6 +304,17 @@ test upvar-8.3 {errors in upvar command} -returnCodes error -body {
proc p1 {} {upvar a b c}
p1
} -result {bad level "a"}
+test upvar-8.3.1 {bad level for upvar (upvar at top-level, bug [775ee88560])} -body {
+ proc p1 {} { uplevel { upvar b b; lappend b UNEXPECTED } }
+ uplevel #0 { p1 }
+} -returnCodes error -result {bad level "1"}
+test upvar-8.3.2 {bad level for upvar (upvar at top-level, bug [775ee88560])} -setup {
+ interp create i
+} -body {
+ i eval { upvar b b; lappend b UNEXPECTED }
+} -returnCodes error -result {bad level "1"} -cleanup {
+ interp delete i
+}
test upvar-8.4 {errors in upvar command} -returnCodes error -body {
proc p1 {} {upvar 0 b b}
p1
@@ -355,7 +366,7 @@ test upvar-8.11 {upvar will not create a variable that looks like an array} -set
test upvar-9.1 {Tcl_UpVar2 procedure} testupvar {
list [catch {testupvar xyz a {} x global} msg] $msg
-} {1 {bad level "xyz"}}
+} {1 {bad level "1"}}
test upvar-9.1.1 {TclGetFrame, via Tcl_UpVar2} testupvar {
apply {{} {testupvar xyz a {} x local; set x foo}}
set a
diff --git a/tests/winTime.test b/tests/winTime.test
index add8f98..dbaa14c 100644
--- a/tests/winTime.test
+++ b/tests/winTime.test
@@ -19,6 +19,7 @@ if {[lsearch [namespace children] ::tcltest] == -1} {
catch [list package require -exact Tcltest [info patchlevel]]
testConstraint testwinclock [llength [info commands testwinclock]]
+testConstraint knownMsvcBug [expr {![info exists ::env(TRAVIS_OS_NAME)] || ![string match windows $::env(TRAVIS_OS_NAME)]}]
# The next two tests will crash on Windows if the check for negative
# clock values is not done properly.
@@ -40,7 +41,7 @@ test winTime-1.2 {TclpGetDate} {win} {
# with the Windows clock. 30 sec really isn't enough,
# but how much time does a tester have patience for?
-test winTime-2.1 {Synchronization of Tcl and Windows clocks} {testwinclock} {
+test winTime-2.1 {Synchronization of Tcl and Windows clocks} {testwinclock knownMsvcBug} {
# May fail due to OS/hardware discrepancies. See:
# http://support.microsoft.com/default.aspx?scid=kb;en-us;274323
set failed {}
@@ -50,7 +51,7 @@ test winTime-2.1 {Synchronization of Tcl and Windows clocks} {testwinclock} {
foreach { sys_sec sys_usec tcl_sec tcl_usec } [testwinclock] break
set diff [expr { $tcl_sec - $sys_sec
+ 1.0e-6 * ( $tcl_usec - $sys_usec ) }]
- if { abs($diff) > 0.06 } {
+ if { abs($diff) > 0.1 } {
set failed "Tcl clock differs from system clock by $diff sec"
break
} else {
diff --git a/tools/tcltk-man2html-utils.tcl b/tools/tcltk-man2html-utils.tcl
index e851047..b38f0b5 100644
--- a/tools/tcltk-man2html-utils.tcl
+++ b/tools/tcltk-man2html-utils.tcl
@@ -876,7 +876,7 @@ proc insert-cross-references {text} {
[expr {$offset(end-bold)-1}]]
set text [string range $text[set text ""] \
[expr {$offset(end-bold)+4}] end]
- regsub {http://[\w/.]+} $body {<A HREF="&">&</A>} body
+ regsub {http://[\w/.-]+} $body {<A HREF="&">&</A>} body
append result <B> [cross-reference $body] </B>
continue
}
@@ -912,7 +912,7 @@ proc insert-cross-references {text} {
url {
set off [lindex $offsets 0]
append result [string range $text 0 [expr {$off-1}]]
- regexp -indices -start $off {http://[\w/.]+} $text range
+ regexp -indices -start $off {http://[\w/.-]+} $text range
set url [string range $text {*}$range]
append result "<A HREF=\"[string trimright $url .]\">$url</A>"
set text [string range $text[set text ""] \
diff --git a/unix/Makefile.in b/unix/Makefile.in
index 0afd069..46b5ac7 100644
--- a/unix/Makefile.in
+++ b/unix/Makefile.in
@@ -28,6 +28,7 @@ bindir = @bindir@
libdir = @libdir@
includedir = @includedir@
datarootdir = @datarootdir@
+runstatedir = @runstatedir@
mandir = @mandir@
# The following definition can be set to non-null for special systems like AFS
@@ -948,7 +949,7 @@ install-libraries: libraries
"$(MODULE_INSTALL_DIR)"/tcl8/8.7/msgcat-1.7.0.tm
@echo "Installing package tcltest 2.5.0 as a Tcl Module"
@$(INSTALL_DATA) $(TOP_DIR)/library/tcltest/tcltest.tcl \
- "$(MODULE_INSTALL_DIR)"/tcl8/8.5/tcltest-2.5.0.tm
+ "$(MODULE_INSTALL_DIR)"/tcl8/8.5/tcltest-2.5.1.tm
@echo "Installing package platform 1.0.14 as a Tcl Module"
@$(INSTALL_DATA) $(TOP_DIR)/library/platform/platform.tcl \
"$(MODULE_INSTALL_DIR)"/tcl8/8.4/platform-1.0.14.tm
diff --git a/unix/configure b/unix/configure
index bf00034..e0df311 100755
--- a/unix/configure
+++ b/unix/configure
@@ -9823,7 +9823,7 @@ $as_echo "$tcl_ok" >&6; }
#------------------------------------------------------------------------
# Check whether the timezone data is supplied by the OS or has
# to be installed by Tcl. The default is autodetection, but can
-# be overriden on the configure command line either way.
+# be overridden on the configure command line either way.
#------------------------------------------------------------------------
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for timezone data" >&5
diff --git a/unix/configure.ac b/unix/configure.ac
index ea4526c..74ee955 100644
--- a/unix/configure.ac
+++ b/unix/configure.ac
@@ -677,7 +677,7 @@ AC_MSG_RESULT([$tcl_ok])
#------------------------------------------------------------------------
# Check whether the timezone data is supplied by the OS or has
# to be installed by Tcl. The default is autodetection, but can
-# be overriden on the configure command line either way.
+# be overridden on the configure command line either way.
#------------------------------------------------------------------------
AC_MSG_CHECKING([for timezone data])
diff --git a/unix/tclSelectNotfy.c b/unix/tclSelectNotfy.c
index a0dea57..cb8addf 100644
--- a/unix/tclSelectNotfy.c
+++ b/unix/tclSelectNotfy.c
@@ -231,7 +231,7 @@ typedef struct {
void *hbrBackground;
void *lpszMenuName;
const void *lpszClassName;
-} WNDCLASS;
+} WNDCLASSW;
extern void __stdcall CloseHandle(void *);
extern void *__stdcall CreateEventW(void *, unsigned char, unsigned char,
@@ -249,7 +249,7 @@ extern unsigned char __stdcall PeekMessageW(MSG *, void *, int, int, int);
extern unsigned char __stdcall PostMessageW(void *, unsigned int, void *,
void *);
extern void __stdcall PostQuitMessage(int);
-extern void *__stdcall RegisterClassW(const WNDCLASS *);
+extern void *__stdcall RegisterClassW(const WNDCLASSW *);
extern unsigned char __stdcall ResetEvent(void *);
extern unsigned char __stdcall TranslateMessage(const MSG *);
@@ -297,7 +297,7 @@ Tcl_InitNotifier(void)
*/
if (tsdPtr->waitCVinitialized == 0) {
#ifdef __CYGWIN__
- WNDCLASS class;
+ WNDCLASSW class;
class.style = 0;
class.cbClsExtra = 0;
diff --git a/unix/tclUnixChan.c b/unix/tclUnixChan.c
index be49c95..5e757ee 100644
--- a/unix/tclUnixChan.c
+++ b/unix/tclUnixChan.c
@@ -96,7 +96,7 @@ typedef struct {
/*
* The following structure is used to set or get the serial port attributes in
- * a platform-independant manner.
+ * a platform-independent manner.
*/
typedef struct {
diff --git a/unix/tclUnixInit.c b/unix/tclUnixInit.c
index eec0fd9..13a624e 100644
--- a/unix/tclUnixInit.c
+++ b/unix/tclUnixInit.c
@@ -333,7 +333,7 @@ long tclMacOSXDarwinRelease = 0;
*
* TclpInitPlatform --
*
- * Initialize all the platform-dependant things like signals and
+ * Initialize all the platform-dependent things like signals and
* floating-point error handling.
*
* Called at process initialization time.
diff --git a/unix/tclUnixTest.c b/unix/tclUnixTest.c
index e59a0e3..75dccfa 100644
--- a/unix/tclUnixTest.c
+++ b/unix/tclUnixTest.c
@@ -62,16 +62,13 @@ static const char *gotsig = "0";
* Forward declarations of functions defined later in this file:
*/
-static Tcl_CmdProc TestalarmCmd;
+static Tcl_ObjCmdProc TestalarmCmd;
static Tcl_ObjCmdProc TestchmodCmd;
-static Tcl_CmdProc TestfilehandlerCmd;
-static Tcl_CmdProc TestfilewaitCmd;
-static Tcl_CmdProc TestfindexecutableCmd;
-static Tcl_ObjCmdProc TestforkObjCmd;
-static Tcl_ObjCmdProc TestgetencpathObjCmd;
-static Tcl_CmdProc TestgetopenfileCmd;
-static Tcl_CmdProc TestgotsigCmd;
-static Tcl_ObjCmdProc TestsetencpathObjCmd;
+static Tcl_ObjCmdProc TestfilehandlerCmd;
+static Tcl_ObjCmdProc TestfilewaitCmd;
+static Tcl_ObjCmdProc TestfindexecutableCmd;
+static Tcl_ObjCmdProc TestforkCmd;
+static Tcl_ObjCmdProc TestgotsigCmd;
static Tcl_FileProc TestFileHandlerProc;
static void AlarmHandler(int signum);
@@ -98,23 +95,17 @@ TclplatformtestInit(
{
Tcl_CreateObjCommand(interp, "testchmod", TestchmodCmd,
NULL, NULL);
- Tcl_CreateCommand(interp, "testfilehandler", TestfilehandlerCmd,
+ Tcl_CreateObjCommand(interp, "testfilehandler", TestfilehandlerCmd,
NULL, NULL);
- Tcl_CreateCommand(interp, "testfilewait", TestfilewaitCmd,
+ Tcl_CreateObjCommand(interp, "testfilewait", TestfilewaitCmd,
NULL, NULL);
- Tcl_CreateCommand(interp, "testfindexecutable", TestfindexecutableCmd,
+ Tcl_CreateObjCommand(interp, "testfindexecutable", TestfindexecutableCmd,
NULL, NULL);
- Tcl_CreateObjCommand(interp, "testfork", TestforkObjCmd,
+ Tcl_CreateObjCommand(interp, "testfork", TestforkCmd,
NULL, NULL);
- Tcl_CreateCommand(interp, "testgetopenfile", TestgetopenfileCmd,
+ Tcl_CreateObjCommand(interp, "testalarm", TestalarmCmd,
NULL, NULL);
- Tcl_CreateObjCommand(interp, "testgetencpath", TestgetencpathObjCmd,
- NULL, NULL);
- Tcl_CreateObjCommand(interp, "testsetencpath", TestsetencpathObjCmd,
- NULL, NULL);
- Tcl_CreateCommand(interp, "testalarm", TestalarmCmd,
- NULL, NULL);
- Tcl_CreateCommand(interp, "testgotsig", TestgotsigCmd,
+ Tcl_CreateObjCommand(interp, "testgotsig", TestgotsigCmd,
NULL, NULL);
return TCL_OK;
}
@@ -140,8 +131,8 @@ static int
TestfilehandlerCmd(
ClientData clientData, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
- int argc, /* Number of arguments. */
- const char **argv) /* Argument strings. */
+ int objc, /* Number of arguments. */
+ Tcl_Obj *const *objv) /* Argument strings. */
{
Pipe *pipePtr;
int i, mask, timeout;
@@ -161,24 +152,23 @@ TestfilehandlerCmd(
initialized = 1;
}
- if (argc < 2) {
- Tcl_AppendResult(interp, "wrong # arguments: should be \"", argv[0],
- " option ... \"", NULL);
+ if (objc < 2) {
+ Tcl_WrongNumArgs(interp, 1, objv, "option ...");
return TCL_ERROR;
}
pipePtr = NULL;
- if (argc >= 3) {
- if (Tcl_GetInt(interp, argv[2], &i) != TCL_OK) {
+ if (objc >= 3) {
+ if (Tcl_GetIntFromObj(interp, objv[2], &i) != TCL_OK) {
return TCL_ERROR;
}
if (i >= MAX_PIPES) {
- Tcl_AppendResult(interp, "bad index ", argv[2], NULL);
+ Tcl_AppendResult(interp, "bad index ", objv[2], NULL);
return TCL_ERROR;
}
pipePtr = &testPipes[i];
}
- if (strcmp(argv[1], "close") == 0) {
+ if (strcmp(Tcl_GetString(objv[1]), "close") == 0) {
for (i = 0; i < MAX_PIPES; i++) {
if (testPipes[i].readFile != NULL) {
TclpCloseFile(testPipes[i].readFile);
@@ -187,27 +177,24 @@ TestfilehandlerCmd(
testPipes[i].writeFile = NULL;
}
}
- } else if (strcmp(argv[1], "clear") == 0) {
- if (argc != 3) {
- Tcl_AppendResult(interp, "wrong # arguments: should be \"",
- argv[0], " clear index\"", NULL);
+ } else if (strcmp(Tcl_GetString(objv[1]), "clear") == 0) {
+ if (objc != 3) {
+ Tcl_WrongNumArgs(interp, 2, objv, "index");
return TCL_ERROR;
}
pipePtr->readCount = pipePtr->writeCount = 0;
- } else if (strcmp(argv[1], "counts") == 0) {
+ } else if (strcmp(Tcl_GetString(objv[1]), "counts") == 0) {
char buf[TCL_INTEGER_SPACE * 2];
- if (argc != 3) {
- Tcl_AppendResult(interp, "wrong # arguments: should be \"",
- argv[0], " counts index\"", NULL);
+ if (objc != 3) {
+ Tcl_WrongNumArgs(interp, 2, objv, "index");
return TCL_ERROR;
}
sprintf(buf, "%d %d", pipePtr->readCount, pipePtr->writeCount);
Tcl_AppendResult(interp, buf, NULL);
- } else if (strcmp(argv[1], "create") == 0) {
- if (argc != 5) {
- Tcl_AppendResult(interp, "wrong # arguments: should be \"",
- argv[0], " create index readMode writeMode\"", NULL);
+ } else if (strcmp(Tcl_GetString(objv[1]), "create") == 0) {
+ if (objc != 5) {
+ Tcl_WrongNumArgs(interp, 2, objv, "index readMode writeMode");
return TCL_ERROR;
}
if (pipePtr->readFile == NULL) {
@@ -228,83 +215,79 @@ TestfilehandlerCmd(
pipePtr->readCount = 0;
pipePtr->writeCount = 0;
- if (strcmp(argv[3], "readable") == 0) {
+ if (strcmp(Tcl_GetString(objv[3]), "readable") == 0) {
Tcl_CreateFileHandler(GetFd(pipePtr->readFile), TCL_READABLE,
TestFileHandlerProc, pipePtr);
- } else if (strcmp(argv[3], "off") == 0) {
+ } else if (strcmp(Tcl_GetString(objv[3]), "off") == 0) {
Tcl_DeleteFileHandler(GetFd(pipePtr->readFile));
- } else if (strcmp(argv[3], "disabled") == 0) {
+ } else if (strcmp(Tcl_GetString(objv[3]), "disabled") == 0) {
Tcl_CreateFileHandler(GetFd(pipePtr->readFile), 0,
TestFileHandlerProc, pipePtr);
} else {
- Tcl_AppendResult(interp, "bad read mode \"", argv[3], "\"", NULL);
+ Tcl_AppendResult(interp, "bad read mode \"", Tcl_GetString(objv[3]), "\"", NULL);
return TCL_ERROR;
}
- if (strcmp(argv[4], "writable") == 0) {
+ if (strcmp(Tcl_GetString(objv[4]), "writable") == 0) {
Tcl_CreateFileHandler(GetFd(pipePtr->writeFile), TCL_WRITABLE,
TestFileHandlerProc, pipePtr);
- } else if (strcmp(argv[4], "off") == 0) {
+ } else if (strcmp(Tcl_GetString(objv[4]), "off") == 0) {
Tcl_DeleteFileHandler(GetFd(pipePtr->writeFile));
- } else if (strcmp(argv[4], "disabled") == 0) {
+ } else if (strcmp(Tcl_GetString(objv[4]), "disabled") == 0) {
Tcl_CreateFileHandler(GetFd(pipePtr->writeFile), 0,
TestFileHandlerProc, pipePtr);
} else {
- Tcl_AppendResult(interp, "bad read mode \"", argv[4], "\"", NULL);
+ Tcl_AppendResult(interp, "bad read mode \"", Tcl_GetString(objv[4]), "\"", NULL);
return TCL_ERROR;
}
- } else if (strcmp(argv[1], "empty") == 0) {
- if (argc != 3) {
- Tcl_AppendResult(interp, "wrong # arguments: should be \"",
- argv[0], " empty index\"", NULL);
+ } else if (strcmp(Tcl_GetString(objv[1]), "empty") == 0) {
+ if (objc != 3) {
+ Tcl_WrongNumArgs(interp, 2, objv, "index");
return TCL_ERROR;
}
while (read(GetFd(pipePtr->readFile), buffer, 4000) > 0) {
/* Empty loop body. */
}
- } else if (strcmp(argv[1], "fill") == 0) {
- if (argc != 3) {
- Tcl_AppendResult(interp, "wrong # arguments: should be \"",
- argv[0], " fill index\"", NULL);
+ } else if (strcmp(Tcl_GetString(objv[1]), "fill") == 0) {
+ if (objc != 3) {
+ Tcl_WrongNumArgs(interp, 2, objv, "index");
return TCL_ERROR;
}
memset(buffer, 'a', 4000);
- while (write(GetFd(pipePtr->writeFile), buffer, 4000) > 0) {
+ while (write(GetFd(pipePtr->writeFile), buffer, 4000) > 0) {
/* Empty loop body. */
- }
- } else if (strcmp(argv[1], "fillpartial") == 0) {
+ }
+ } else if (strcmp(Tcl_GetString(objv[1]), "fillpartial") == 0) {
char buf[TCL_INTEGER_SPACE];
- if (argc != 3) {
- Tcl_AppendResult(interp, "wrong # arguments: should be \"",
- argv[0], " fillpartial index\"", NULL);
+ if (objc != 3) {
+ Tcl_WrongNumArgs(interp, 2, objv, "index");
return TCL_ERROR;
}
memset(buffer, 'b', 10);
TclFormatInt(buf, write(GetFd(pipePtr->writeFile), buffer, 10));
Tcl_AppendResult(interp, buf, NULL);
- } else if (strcmp(argv[1], "oneevent") == 0) {
+ } else if (strcmp(Tcl_GetString(objv[1]), "oneevent") == 0) {
Tcl_DoOneEvent(TCL_FILE_EVENTS|TCL_DONT_WAIT);
- } else if (strcmp(argv[1], "wait") == 0) {
- if (argc != 5) {
- Tcl_AppendResult(interp, "wrong # arguments: should be \"",
- argv[0], " wait index readable|writable timeout\"", NULL);
+ } else if (strcmp(Tcl_GetString(objv[1]), "wait") == 0) {
+ if (objc != 5) {
+ Tcl_WrongNumArgs(interp, 2, objv, "index readable|writable timeout");
return TCL_ERROR;
}
if (pipePtr->readFile == NULL) {
- Tcl_AppendResult(interp, "pipe ", argv[2], " doesn't exist", NULL);
+ Tcl_AppendResult(interp, "pipe ", Tcl_GetString(objv[2]), " doesn't exist", NULL);
return TCL_ERROR;
}
- if (strcmp(argv[3], "readable") == 0) {
+ if (strcmp(Tcl_GetString(objv[3]), "readable") == 0) {
mask = TCL_READABLE;
file = pipePtr->readFile;
} else {
mask = TCL_WRITABLE;
file = pipePtr->writeFile;
}
- if (Tcl_GetInt(interp, argv[4], &timeout) != TCL_OK) {
+ if (Tcl_GetIntFromObj(interp, objv[4], &timeout) != TCL_OK) {
return TCL_ERROR;
}
i = TclUnixWaitForFile(GetFd(file), mask, timeout);
@@ -314,10 +297,10 @@ TestfilehandlerCmd(
if (i & TCL_WRITABLE) {
Tcl_AppendElement(interp, "writable");
}
- } else if (strcmp(argv[1], "windowevent") == 0) {
+ } else if (strcmp(Tcl_GetString(objv[1]), "windowevent") == 0) {
Tcl_DoOneEvent(TCL_WINDOW_EVENTS|TCL_DONT_WAIT);
} else {
- Tcl_AppendResult(interp, "bad option \"", argv[1],
+ Tcl_AppendResult(interp, "bad option \"", Tcl_GetString(objv[1]),
"\": must be close, clear, counts, create, empty, fill, "
"fillpartial, oneevent, wait, or windowevent", NULL);
return TCL_ERROR;
@@ -362,31 +345,30 @@ static int
TestfilewaitCmd(
ClientData clientData, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
- int argc, /* Number of arguments. */
- const char **argv) /* Argument strings. */
+ int objc, /* Number of arguments. */
+ Tcl_Obj *const *objv) /* Argument strings. */
{
int mask, result, timeout;
Tcl_Channel channel;
int fd;
ClientData data;
- if (argc != 4) {
- Tcl_AppendResult(interp, "wrong # arguments: should be \"", argv[0],
- " file readable|writable|both timeout\"", NULL);
+ if (objc != 4) {
+ Tcl_WrongNumArgs(interp, 2, objv, "file readable|writable|both timeout");
return TCL_ERROR;
}
- channel = Tcl_GetChannel(interp, argv[1], NULL);
+ channel = Tcl_GetChannel(interp, Tcl_GetString(objv[1]), NULL);
if (channel == NULL) {
return TCL_ERROR;
}
- if (strcmp(argv[2], "readable") == 0) {
+ if (strcmp(Tcl_GetString(objv[2]), "readable") == 0) {
mask = TCL_READABLE;
- } else if (strcmp(argv[2], "writable") == 0){
+ } else if (strcmp(Tcl_GetString(objv[2]), "writable") == 0){
mask = TCL_WRITABLE;
- } else if (strcmp(argv[2], "both") == 0){
+ } else if (strcmp(Tcl_GetString(objv[2]), "both") == 0){
mask = TCL_WRITABLE|TCL_READABLE;
} else {
- Tcl_AppendResult(interp, "bad argument \"", argv[2],
+ Tcl_AppendResult(interp, "bad argument \"", Tcl_GetString(objv[2]),
"\": must be readable, writable, or both", NULL);
return TCL_ERROR;
}
@@ -397,7 +379,7 @@ TestfilewaitCmd(
return TCL_ERROR;
}
fd = PTR2INT(data);
- if (Tcl_GetInt(interp, argv[3], &timeout) != TCL_OK) {
+ if (Tcl_GetIntFromObj(interp, objv[3], &timeout) != TCL_OK) {
return TCL_ERROR;
}
result = TclUnixWaitForFile(fd, mask, timeout);
@@ -431,21 +413,20 @@ static int
TestfindexecutableCmd(
ClientData clientData, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
- int argc, /* Number of arguments. */
- const char **argv) /* Argument strings. */
+ int objc, /* Number of arguments. */
+ Tcl_Obj *const *objv) /* Argument strings. */
{
Tcl_Obj *saveName;
- if (argc != 2) {
- Tcl_AppendResult(interp, "wrong # arguments: should be \"", argv[0],
- " argv0\"", NULL);
+ if (objc != 2) {
+ Tcl_WrongNumArgs(interp, 1, objv, "argv0");
return TCL_ERROR;
}
saveName = TclGetObjNameOfExecutable();
Tcl_IncrRefCount(saveName);
- TclpFindExecutable(argv[1]);
+ TclpFindExecutable(Tcl_GetString(objv[1]));
Tcl_SetObjResult(interp, TclGetObjNameOfExecutable());
TclSetObjNameOfExecutable(saveName, NULL);
@@ -456,83 +437,7 @@ TestfindexecutableCmd(
/*
*----------------------------------------------------------------------
*
- * TestgetopenfileCmd --
- *
- * This function implements the "testgetopenfile" command. It is used to
- * get a FILE * value from a registered channel.
- *
- * Results:
- * A standard Tcl result.
- *
- * Side effects:
- * None.
- *
- *----------------------------------------------------------------------
- */
-
-static int
-TestgetopenfileCmd(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp, /* Current interpreter. */
- int argc, /* Number of arguments. */
- const char **argv) /* Argument strings. */
-{
- ClientData filePtr;
-
- if (argc != 3) {
- Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
- " channelName forWriting\"", NULL);
- return TCL_ERROR;
- }
- if (Tcl_GetOpenFile(interp, argv[1], atoi(argv[2]), 1, &filePtr)
- == TCL_ERROR) {
- return TCL_ERROR;
- }
- if (filePtr == NULL) {
- Tcl_AppendResult(interp,
- "Tcl_GetOpenFile succeeded but FILE * NULL!", NULL);
- return TCL_ERROR;
- }
- return TCL_OK;
-}
-
-/*
- *----------------------------------------------------------------------
- *
- * TestsetencpathCmd --
- *
- * This function implements the "testsetencpath" command. It is used to
- * test Tcl_SetDefaultEncodingDir().
- *
- * Results:
- * A standard Tcl result.
- *
- * Side effects:
- * None.
- *
- *----------------------------------------------------------------------
- */
-
-static int
-TestsetencpathObjCmd(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp, /* Current interpreter. */
- int objc, /* Number of arguments. */
- Tcl_Obj *const *objv) /* Argument strings. */
-{
- if (objc != 2) {
- Tcl_WrongNumArgs(interp, 1, objv, "defaultDir");
- return TCL_ERROR;
- }
-
- Tcl_SetEncodingSearchPath(objv[1]);
- return TCL_OK;
-}
-
-/*
- *----------------------------------------------------------------------
- *
- * TestforkObjCmd --
+ * TestforkCmd --
*
* This function implements the "testfork" command. It is used to
* fork the Tcl process for specific test cases.
@@ -547,7 +452,7 @@ TestsetencpathObjCmd(
*/
static int
-TestforkObjCmd(
+TestforkCmd(
ClientData clientData, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
@@ -577,39 +482,6 @@ TestforkObjCmd(
/*
*----------------------------------------------------------------------
*
- * TestgetencpathObjCmd --
- *
- * This function implements the "testgetencpath" command. It is used to
- * test Tcl_GetEncodingSearchPath().
- *
- * Results:
- * A standard Tcl result.
- *
- * Side effects:
- * None.
- *
- *----------------------------------------------------------------------
- */
-
-static int
-TestgetencpathObjCmd(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp, /* Current interpreter. */
- int objc, /* Number of arguments. */
- Tcl_Obj *const *objv) /* Argument strings. */
-{
- if (objc != 1) {
- Tcl_WrongNumArgs(interp, 1, objv, "");
- return TCL_ERROR;
- }
-
- Tcl_SetObjResult(interp, Tcl_GetEncodingSearchPath());
- return TCL_OK;
-}
-
-/*
- *----------------------------------------------------------------------
- *
* TestalarmCmd --
*
* Test that EINTR is handled correctly by generating and handling a
@@ -629,17 +501,15 @@ static int
TestalarmCmd(
ClientData clientData, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
- int argc, /* Number of arguments. */
- const char **argv) /* Argument strings. */
+ int objc, /* Number of arguments. */
+ Tcl_Obj *const *objv) /* Argument strings. */
{
#ifdef SA_RESTART
- unsigned int sec;
+ unsigned int sec = 1;
struct sigaction action;
- if (argc > 1) {
- Tcl_GetInt(interp, argv[1], (int *)&sec);
- } else {
- sec = 1;
+ if (objc > 1) {
+ Tcl_GetIntFromObj(interp, objv[1], (int *)&sec);
}
/*
@@ -708,8 +578,8 @@ static int
TestgotsigCmd(
ClientData clientData, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
- int argc, /* Number of arguments. */
- const char **argv) /* Argument strings. */
+ int objc, /* Number of arguments. */
+ Tcl_Obj *const *objv) /* Argument strings. */
{
Tcl_AppendResult(interp, gotsig, NULL);
gotsig = "0";
diff --git a/unix/tclUnixTime.c b/unix/tclUnixTime.c
index 51d486e..1b90f6e 100644
--- a/unix/tclUnixTime.c
+++ b/unix/tclUnixTime.c
@@ -117,7 +117,7 @@ TclpGetMicroseconds(void)
* This procedure returns a value that represents the highest resolution
* clock available on the system. There are no garantees on what the
* resolution will be. In Tcl we will call this value a "click". The
- * start time is also system dependant.
+ * start time is also system dependent.
*
* Results:
* Number of clicks from some start time.
@@ -166,7 +166,7 @@ TclpGetClicks(void)
* This procedure returns a WideInt value that represents the highest
* resolution clock available on the system. There are no garantees on
* what the resolution will be. In Tcl we will call this value a "click".
- * The start time is also system dependant.
+ * The start time is also system dependent.
*
* Results:
* Number of WideInt clicks from some start time.
diff --git a/win/Makefile.in b/win/Makefile.in
index af2b6e3..e4866cd 100644
--- a/win/Makefile.in
+++ b/win/Makefile.in
@@ -23,6 +23,7 @@ bindir = @bindir@
libdir = @libdir@
includedir = @includedir@
datarootdir = @datarootdir@
+runstatedir = @runstatedir@
mandir = @mandir@
# The following definition can be set to non-null for special systems like AFS
@@ -96,7 +97,7 @@ COMPILE_DEBUG_FLAGS =
SRC_DIR = @srcdir@
ROOT_DIR = @srcdir@/..
-TOP_DIR = $(shell cd @srcdir@/..; pwd -P)
+TOP_DIR = $(shell cd @srcdir@/..; pwd -W 2>/dev/null || pwd -P)
GENERIC_DIR = $(TOP_DIR)/generic
TOMMATH_DIR = $(TOP_DIR)/libtommath
WIN_DIR = $(TOP_DIR)/win
@@ -116,7 +117,7 @@ GENERIC_DIR_NATIVE = $(shell $(CYGPATH) '$(GENERIC_DIR)')
TOMMATH_DIR_NATIVE = $(shell $(CYGPATH) '$(TOMMATH_DIR)')
WIN_DIR_NATIVE = $(shell $(CYGPATH) '$(WIN_DIR)')
ROOT_DIR_NATIVE = $(shell $(CYGPATH) '$(ROOT_DIR)')
-ROOT_DIR_WIN_NATIVE = $(shell cd '$(ROOT_DIR)' ; pwd -W || pwd -P)
+ROOT_DIR_WIN_NATIVE = $(shell cd '$(ROOT_DIR)' ; pwd -W 2>/dev/null || pwd -P)
ZLIB_DIR_NATIVE = $(shell $(CYGPATH) '$(ZLIB_DIR)')
#GENERIC_DIR_NATIVE = $(GENERIC_DIR)
#TOMMATH_DIR_NATIVE = $(TOMMATH_DIR)
@@ -486,7 +487,7 @@ all: binaries libraries doc packages
# or from mingw/msys shell:
# $ ./tcltest -verbose bps -file fileName.test
-tcltest.cmd:
+tcltest.cmd: Makefile
@echo 'Create tcltest.cmd helpers';
@(\
echo '@echo off'; \
@@ -494,8 +495,8 @@ tcltest.cmd:
echo 'set BDP=%~dp0'; \
echo 'set OWD=%CD%'; \
echo 'cd /d %TEMP%'; \
- echo 'rem "%BDP%\$(TCLSH)" "$(ROOT_DIR_WIN_NATIVE)/tests/all.tcl" $(TESTFLAGS) -load "$(TEST_LOAD_FACILITIES)" %*'; \
- echo '"%BDP%\$(TEST_EXE_FILE)" "$(ROOT_DIR_WIN_NATIVE)/tests/all.tcl" $(TESTFLAGS) -load "$(TEST_LOAD_PRMS)" %*'; \
+ echo 'rem "%BDP%\$(TCLSH)" "$(ROOT_DIR_WIN_NATIVE)/tests/all.tcl" %TESTFLAGS% -load "$(TEST_LOAD_FACILITIES)" %*'; \
+ echo '"%BDP%\$(TEST_EXE_FILE)" "$(ROOT_DIR_WIN_NATIVE)/tests/all.tcl" %TESTFLAGS% -load "$(TEST_LOAD_PRMS)" %*'; \
echo 'cd /d %OWD%'; \
) > tcltest.cmd;
@(\
@@ -503,11 +504,13 @@ tcltest.cmd:
echo '#LANG=en_US'; \
echo 'BDP=$$(dirname $$(readlink -f %0))'; \
echo 'cd /tmp'; \
- echo '#"$$BDP/$(TCLSH)" "$(ROOT_DIR_WIN_NATIVE)/tests/all.tcl" $(TESTFLAGS) -load "$(TEST_LOAD_FACILITIES)" "$$@"'; \
- echo '"$$BDP/$(TEST_EXE_FILE)" "$(ROOT_DIR_WIN_NATIVE)/tests/all.tcl" $(TESTFLAGS) -load "$(TEST_LOAD_PRMS)" "$$@"'; \
- ) > tcltest;
+ echo '#"$$BDP/$(TCLSH)" "$(ROOT_DIR_WIN_NATIVE)/tests/all.tcl" $$TESTFLAGS -load "$(TEST_LOAD_FACILITIES)" "$$@"'; \
+ echo '"$$BDP/$(TEST_EXE_FILE)" "$(ROOT_DIR_WIN_NATIVE)/tests/all.tcl" $$TESTFLAGS -load "$(TEST_LOAD_PRMS)" "$$@"'; \
+ ) > tcltest.sh;
-tcltest: $(TCLSH) $(TEST_EXE_FILE) $(TEST_DLL_FILE) tcltest.cmd
+tcltest.sh: tcltest.cmd
+
+tcltest: binaries $(TEST_EXE_FILE) $(TEST_DLL_FILE) $(CAT32) tcltest.cmd
binaries: $(TCL_STUB_LIB_FILE) @LIBRARIES@ winextensions ${TCL_ZIP_FILE} $(TCLSH)
@@ -548,6 +551,7 @@ ${TCL_ZIP_FILE}: ${ZIP_INSTALL_OBJS} ${DDE_DLL_FILE} ${REG_DLL_FILE}
$(TCLSH): $(TCLSH_OBJS) @LIBRARIES@ $(TCL_STUB_LIB_FILE) tclsh.$(RES)
$(CC) $(CFLAGS) $(TCLSH_OBJS) $(TCL_LIB_FILE) $(TCL_STUB_LIB_FILE) $(LIBS) \
tclsh.$(RES) $(CC_EXENAME) $(LDFLAGS_CONSOLE)
+ $(COPY) tclsh.exe.manifest $(TCLSH).manifest
@VC_MANIFEST_EMBED_EXE@
cat32.$(OBJEXT): cat.c
@@ -567,6 +571,7 @@ ${TCL_STUB_LIB_FILE}: ${STUB_OBJS}
${TCL_DLL_FILE}: ${TCL_OBJS} tcl.$(RES) @ZLIB_DLL_FILE@ ${TCL_ZIP_FILE}
@$(RM) ${TCL_DLL_FILE} $(TCL_LIB_FILE)
@MAKE_DLL@ ${TCL_OBJS} tcl.$(RES) $(SHLIB_LD_LIBS)
+ $(COPY) tclsh.exe.manifest ${TCL_DLL_FILE}.manifest
@VC_MANIFEST_EMBED_DLL@
@if test "${ZIPFS_BUILD}" = "1" ; then \
cat ${TCL_ZIP_FILE} >> ${TCL_DLL_FILE}; \
@@ -581,18 +586,22 @@ ${TCL_LIB_FILE}: ${TCL_OBJS} ${DDE_OBJS} ${REG_OBJS}
${DDE_DLL_FILE}: ${TCL_STUB_LIB_FILE} ${DDE_OBJS}
@MAKE_DLL@ ${DDE_OBJS} $(TCL_STUB_LIB_FILE) $(SHLIB_LD_LIBS)
+ $(COPY) tclsh.exe.manifest ${DDE_DLL_FILE}.manifest
${REG_DLL_FILE}: ${TCL_STUB_LIB_FILE} ${REG_OBJS}
@MAKE_DLL@ ${REG_OBJS} $(TCL_STUB_LIB_FILE) $(SHLIB_LD_LIBS)
+ $(COPY) tclsh.exe.manifest ${REG_DLL_FILE}.manifest
${TEST_DLL_FILE}: ${TCL_STUB_LIB_FILE} ${TCLTEST_OBJS}
@$(RM) ${TEST_DLL_FILE} ${TEST_LIB_FILE}
@MAKE_DLL@ ${TCLTEST_OBJS} $(TCL_STUB_LIB_FILE) $(SHLIB_LD_LIBS)
+ $(COPY) tclsh.exe.manifest ${TEST_DLL_FILE}.manifest
${TEST_EXE_FILE}: ${TCL_STUB_LIB_FILE} ${TCLTEST_OBJS} tclTestMain.${OBJEXT}
@$(RM) ${TEST_EXE_FILE}
$(CC) $(CFLAGS) $(TCLTEST_OBJS) tclTestMain.$(OBJEXT) $(TCL_LIB_FILE) $(TCL_STUB_LIB_FILE) $(LIBS) \
tclsh.$(RES) $(CC_EXENAME) $(LDFLAGS_CONSOLE)
+ $(COPY) tclsh.exe.manifest ${TEST_EXE_FILE}.manifest
# use pre-built zlib1.dll
${ZLIB_DLL_FILE}: ${TCL_STUB_LIB_FILE}
@@ -620,6 +629,12 @@ tclWinInit.${OBJEXT}: tclWinInit.c
tclWinPipe.${OBJEXT}: tclWinPipe.c
$(CC) -c $(CC_SWITCHES) -DBUILD_tcl $(EXTFLAGS) @DEPARG@ $(CC_OBJNAME)
+tclWinReg.${OBJEXT}: tclWinReg.c
+ $(CC) -c $(CC_SWITCHES) $(EXTFLAGS) @DEPARG@ $(CC_OBJNAME)
+
+tclWinDde.${OBJEXT}: tclWinDde.c
+ $(CC) -c $(CC_SWITCHES) $(EXTFLAGS) @DEPARG@ $(CC_OBJNAME)
+
testMain.${OBJEXT}: tclAppInit.c
$(CC) -c $(CC_SWITCHES) -DTCL_TEST @DEPARG@ $(CC_OBJNAME)
@@ -647,17 +662,17 @@ tclZipfs.${OBJEXT}: $(GENERIC_DIR)/tclZipfs.c
tclPkgConfig.${OBJEXT}: tclPkgConfig.c
$(CC) -c $(CC_SWITCHES) \
- -DCFG_INSTALL_LIBDIR=\"$(LIB_INSTALL_DIR_NATIVE)\" \
- -DCFG_INSTALL_BINDIR=\"$(BIN_INSTALL_DIR_NATIVE)\" \
- -DCFG_INSTALL_SCRDIR=\"$(SCRIPT_INSTALL_DIR_NATIVE)\" \
- -DCFG_INSTALL_INCDIR=\"$(INCLUDE_INSTALL_DIR_NATIVE)\" \
- -DCFG_INSTALL_DOCDIR=\"$(MAN_INSTALL_DIR)\" \
+ -DCFG_INSTALL_LIBDIR="\"$(LIB_INSTALL_DIR_NATIVE)\"" \
+ -DCFG_INSTALL_BINDIR="\"$(BIN_INSTALL_DIR_NATIVE)\"" \
+ -DCFG_INSTALL_SCRDIR="\"$(SCRIPT_INSTALL_DIR_NATIVE)\"" \
+ -DCFG_INSTALL_INCDIR="\"$(INCLUDE_INSTALL_DIR_NATIVE)\"" \
+ -DCFG_INSTALL_DOCDIR="\"$(MAN_INSTALL_DIR)\"" \
\
- -DCFG_RUNTIME_LIBDIR=\"$(libdir_native)\" \
- -DCFG_RUNTIME_BINDIR=\"$(bindir_native)\" \
- -DCFG_RUNTIME_SCRDIR=\"$(TCL_LIBRARY_NATIVE)\" \
- -DCFG_RUNTIME_INCDIR=\"$(includedir_native)\" \
- -DCFG_RUNTIME_DOCDIR=\"$(mandir_native)\" \
+ -DCFG_RUNTIME_LIBDIR="\"$(libdir_native)\"" \
+ -DCFG_RUNTIME_BINDIR="\"$(bindir_native)\"" \
+ -DCFG_RUNTIME_SCRDIR="\"$(TCL_LIBRARY_NATIVE)\"" \
+ -DCFG_RUNTIME_INCDIR="\"$(includedir_native)\"" \
+ -DCFG_RUNTIME_DOCDIR="\"$(mandir_native)\"" \
-DCFG_RUNTIME_DLLFILE="\"$(TCL_DLL_FILE)\"" \
-DCFG_RUNTIME_ZIPFILE="\"$(TCL_ZIP_FILE)\"" \
-DBUILD_tcl \
@@ -704,7 +719,7 @@ deflate.$(HOST_OBJEXT):
$(HOST_CC) -o $@ -I$(ZLIB_DIR) -c $(ZLIB_DIR)/deflate.c
ioapi.$(HOST_OBJEXT):
- $(HOST_CC) -o $@ -DIOAPI_NO_64 -I$(ZLIB_DIR) -I$(ZLIB_DIR)/contrib/minizip -c $(ZLIB_DIR)/contrib/minizip/ioapi.c
+ $(HOST_CC) -o $@ -I$(ZLIB_DIR) -I$(ZLIB_DIR)/contrib/minizip -c $(ZLIB_DIR)/contrib/minizip/ioapi.c
iowin32.$(HOST_OBJEXT):
$(HOST_CC) -o $@ -I$(ZLIB_DIR) -I$(ZLIB_DIR)/contrib/minizip -c $(ZLIB_DIR)/contrib/minizip/iowin32.c
@@ -734,7 +749,7 @@ zutil.$(HOST_OBJEXT):
$(HOST_CC) -o $@ -I$(ZLIB_DIR) -c $(ZLIB_DIR)/zutil.c
minizip.$(HOST_OBJEXT):
- $(HOST_CC) -o $@ -I$(ZLIB_DIR) -DIOAPI_NO_64 -I$(ZLIB_DIR)/contrib/minizip -c $(ZLIB_DIR)/contrib/minizip/minizip.c
+ $(HOST_CC) -o $@ -I$(ZLIB_DIR) -I$(ZLIB_DIR)/contrib/minizip -c $(ZLIB_DIR)/contrib/minizip/minizip.c
minizip${HOST_EXEEXT}: $(MINIZIP_OBJS)
$(HOST_CC) -o $@ $(MINIZIP_OBJS)
@@ -860,7 +875,7 @@ install-libraries: libraries install-tzdata install-msgs
@echo "Installing package msgcat 1.7.0 as a Tcl Module";
@$(COPY) $(ROOT_DIR)/library/msgcat/msgcat.tcl $(SCRIPT_INSTALL_DIR)/../tcl8/8.7/msgcat-1.7.0.tm;
@echo "Installing package tcltest 2.4.0 as a Tcl Module";
- @$(COPY) $(ROOT_DIR)/library/tcltest/tcltest.tcl $(SCRIPT_INSTALL_DIR)/../tcl8/8.5/tcltest-2.4.0.tm;
+ @$(COPY) $(ROOT_DIR)/library/tcltest/tcltest.tcl $(SCRIPT_INSTALL_DIR)/../tcl8/8.5/tcltest-2.5.1.tm;
@echo "Installing package platform 1.0.14 as a Tcl Module";
@$(COPY) $(ROOT_DIR)/library/platform/platform.tcl $(SCRIPT_INSTALL_DIR)/../tcl8/8.4/platform-1.0.14.tm;
@echo "Installing package platform::shell 1.1.4 as a Tcl Module";
@@ -927,13 +942,13 @@ install-private-headers: libraries
test: test-tcl test-packages
-test-tcl: binaries $(TCLSH) $(CAT32) $(TEST_DLL_FILE)
+test-tcl: tcltest
TCL_LIBRARY="$(LIBRARY_DIR)"; export TCL_LIBRARY; \
$(WINE) ./$(TCLSH) "$(ROOT_DIR_NATIVE)/tests/all.tcl" $(TESTFLAGS) \
- -load "$(TEST_LOAD_FACILITIES)" | $(WINE) ./$(CAT32)
+ -load "$(TEST_LOAD_FACILITIES)"
# Useful target to launch a built tclsh with the proper path,...
-runtest: binaries $(TCLSH) $(TEST_DLL_FILE)
+runtest: tcltest
@TCL_LIBRARY="$(LIBRARY_DIR)"; export TCL_LIBRARY; \
$(WINE) ./$(TCLSH) $(TESTFLAGS) -load "$(TEST_LOAD_FACILITIES)" $(SCRIPT)
@@ -959,7 +974,7 @@ cleanhelp:
clean: cleanhelp clean-packages
$(RM) *.lib *.a *.exp *.dll *.$(RES) *.${OBJEXT} *~ \#* TAGS a.out
- $(RM) $(TCLSH) $(CAT32) $(TEST_EXE_FILE) $(TEST_DLL_FILE) tcltest.cmd tcltest
+ $(RM) $(TCLSH) $(CAT32) $(TEST_EXE_FILE) $(TEST_DLL_FILE) tcltest.cmd tcltest.sh
$(RM) *.pch *.ilk *.pdb
$(RM) minizip${HOST_EXEEXT} *.${HOST_OBJEXT}
$(RM) *.zip
diff --git a/win/makefile.vc b/win/makefile.vc
index c2343a0..5711d23 100644
--- a/win/makefile.vc
+++ b/win/makefile.vc
@@ -427,7 +427,7 @@ PKGSDIR = $(ROOT)\pkgs
# Additional include and C macro definitions for the implicit rules
# defined in rules.vc
PRJ_INCLUDES = -I"$(TOMMATHDIR)"
-PRJ_DEFINES = -DTCL_TOMMATH -DMP_PREC=4 -Dinline=__inline -DHAVE_ZLIB=1 -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE
+PRJ_DEFINES = /DTCL_TOMMATH /DMP_PREC=4 /Dinline=__inline /DHAVE_ZLIB=1 /D_CRT_SECURE_NO_DEPRECATE /D_CRT_NONSTDC_NO_DEPRECATE
# Additional Link libraries needed beyond those in rules.vc
PRJ_LIBS = netapi32.lib user32.lib userenv.lib ws2_32.lib
@@ -657,7 +657,7 @@ CORE_USE_WIDECHAR_API = $(USE_WIDECHAR_API)
tclConfig: $(OUT_DIR)\tclConfig.sh
# TBD - is this tclConfig.sh file ever used? The values are incorrect!
-$(OUT_DIR)\tclConfig.sh: $(WINDIR)\tclConfig.sh.in
+$(OUT_DIR)\tclConfig.sh: $(WIN_DIR)\tclConfig.sh.in
@echo Creating tclConfig.sh
@nmakehlp -s << $** >$@
@TCL_DLL_FILE@ $(TCLLIBNAME)
@@ -732,13 +732,13 @@ gendate:
# Special case object file targets
#---------------------------------------------------------------------
-$(TMP_DIR)\testMain.obj: $(WINDIR)\tclAppInit.c
- $(cc32) $(appcflags) -DTCL_TEST \
- -DTCL_USE_STATIC_PACKAGES=$(TCL_USE_STATIC_PACKAGES) \
+$(TMP_DIR)\testMain.obj: $(WIN_DIR)\tclAppInit.c
+ $(cc32) $(appcflags) /DTCL_TEST \
+ /DTCL_USE_STATIC_PACKAGES=$(TCL_USE_STATIC_PACKAGES) \
-Fo$@ $?
$(TMP_DIR)\tclMain2.obj: $(GENERICDIR)\tclMain.c
- $(cc32) $(pkgcflags) -DTCL_ASCII_MAIN \
+ $(cc32) $(pkgcflags) /DTCL_ASCII_MAIN \
-Fo$@ $?
$(TMP_DIR)\tclTest.obj: $(GENERICDIR)\tclTest.c
@@ -747,7 +747,7 @@ $(TMP_DIR)\tclTest.obj: $(GENERICDIR)\tclTest.c
$(TMP_DIR)\tclTestObj.obj: $(GENERICDIR)\tclTestObj.c
$(cc32) $(appcflags) -Fo$@ $?
-$(TMP_DIR)\tclWinTest.obj: $(WINDIR)\tclWinTest.c
+$(TMP_DIR)\tclWinTest.obj: $(WIN_DIR)\tclWinTest.c
$(CCAPPCMD) $?
$(TMP_DIR)\tclZipfs.obj: $(GENERICDIR)\tclZipfs.c
@@ -758,40 +758,40 @@ $(TMP_DIR)\tclZlib.obj: $(GENERICDIR)\tclZlib.c
$(TMP_DIR)\tclPkgConfig.obj: $(GENERICDIR)\tclPkgConfig.c
$(cc32) $(pkgcflags) \
- -DCFG_INSTALL_LIBDIR="\"$(LIB_INSTALL_DIR:\=\\)\"" \
- -DCFG_INSTALL_BINDIR="\"$(BIN_INSTALL_DIR:\=\\)\"" \
- -DCFG_INSTALL_SCRDIR="\"$(SCRIPT_INSTALL_DIR:\=\\)\"" \
- -DCFG_INSTALL_INCDIR="\"$(INCLUDE_INSTALL_DIR:\=\\)\"" \
- -DCFG_INSTALL_DOCDIR="\"$(DOC_INSTALL_DIR:\=\\)\"" \
- -DCFG_RUNTIME_LIBDIR="\"$(LIB_INSTALL_DIR:\=\\)\"" \
- -DCFG_RUNTIME_BINDIR="\"$(BIN_INSTALL_DIR:\=\\)\"" \
- -DCFG_RUNTIME_SCRDIR="\"$(SCRIPT_INSTALL_DIR:\=\\)\"" \
- -DCFG_RUNTIME_INCDIR="\"$(INCLUDE_INSTALL_DIR:\=\\)\"" \
- -DCFG_RUNTIME_DOCDIR="\"$(DOC_INSTALL_DIR:\=\\)\"" \
- -DCFG_RUNTIME_DLLFILE="\"$(CFG_RUNTIME_DLLFILE:\=\\)\"" \
- -DCFG_RUNTIME_ZIPFILE="\"$(CFG_RUNTIME_ZIPFILE:\=\\)\"" \
+ /DCFG_INSTALL_LIBDIR="\"$(LIB_INSTALL_DIR:\=\\)\"" \
+ /DCFG_INSTALL_BINDIR="\"$(BIN_INSTALL_DIR:\=\\)\"" \
+ /DCFG_INSTALL_SCRDIR="\"$(SCRIPT_INSTALL_DIR:\=\\)\"" \
+ /DCFG_INSTALL_INCDIR="\"$(INCLUDE_INSTALL_DIR:\=\\)\"" \
+ /DCFG_INSTALL_DOCDIR="\"$(DOC_INSTALL_DIR:\=\\)\"" \
+ /DCFG_RUNTIME_LIBDIR="\"$(LIB_INSTALL_DIR:\=\\)\"" \
+ /DCFG_RUNTIME_BINDIR="\"$(BIN_INSTALL_DIR:\=\\)\"" \
+ /DCFG_RUNTIME_SCRDIR="\"$(SCRIPT_INSTALL_DIR:\=\\)\"" \
+ /DCFG_RUNTIME_INCDIR="\"$(INCLUDE_INSTALL_DIR:\=\\)\"" \
+ /DCFG_RUNTIME_DOCDIR="\"$(DOC_INSTALL_DIR:\=\\)\"" \
+ /DCFG_RUNTIME_DLLFILE="\"$(CFG_RUNTIME_DLLFILE:\=\\)\"" \
+ /DCFG_RUNTIME_ZIPFILE="\"$(CFG_RUNTIME_ZIPFILE:\=\\)\"" \
-Fo$@ $?
-$(TMP_DIR)\tclAppInit.obj: $(WINDIR)\tclAppInit.c
+$(TMP_DIR)\tclAppInit.obj: $(WIN_DIR)\tclAppInit.c
$(cc32) $(appcflags) \
- -DTCL_USE_STATIC_PACKAGES=$(TCL_USE_STATIC_PACKAGES) \
+ /DTCL_USE_STATIC_PACKAGES=$(TCL_USE_STATIC_PACKAGES) \
-Fo$@ $?
### The following objects should be built using the stub interfaces
-$(TMP_DIR)\tclWinReg.obj: $(WINDIR)\tclWinReg.c
+$(TMP_DIR)\tclWinReg.obj: $(WIN_DIR)\tclWinReg.c
!if $(STATIC_BUILD)
- $(cc32) $(appcflags) -DSTATIC_BUILD -Fo$@ $?
+ $(cc32) $(appcflags) /DSTATIC_BUILD -Fo$@ $?
!else
- $(cc32) $(appcflags) -DUSE_TCL_STUBS -Fo$@ $?
+ $(cc32) $(appcflags) /DUSE_TCL_STUBS -Fo$@ $?
!endif
-$(TMP_DIR)\tclWinDde.obj: $(WINDIR)\tclWinDde.c
+$(TMP_DIR)\tclWinDde.obj: $(WIN_DIR)\tclWinDde.c
!if $(STATIC_BUILD)
- $(cc32) $(appcflags) -DSTATIC_BUILD -Fo$@ $?
+ $(cc32) $(appcflags) /DSTATIC_BUILD -Fo$@ $?
!else
- $(cc32) $(appcflags) -DUSE_TCL_STUBS -Fo$@ $?
+ $(cc32) $(appcflags) /DUSE_TCL_STUBS -Fo$@ $?
!endif
@@ -808,10 +808,10 @@ $(TMP_DIR)\tclTomMathStubLib.obj: $(GENERICDIR)\tclTomMathStubLib.c
$(TMP_DIR)\tclOOStubLib.obj: $(GENERICDIR)\tclOOStubLib.c
$(cc32) $(stubscflags) -Fo$@ $?
-$(TMP_DIR)\tclWinPanic.obj: $(WINDIR)\tclWinPanic.c
+$(TMP_DIR)\tclWinPanic.obj: $(WIN_DIR)\tclWinPanic.c
$(cc32) $(stubscflags) -Fo$@ $?
-$(TMP_DIR)\tclsh.exe.manifest: $(WINDIR)\tclsh.exe.manifest.in
+$(TMP_DIR)\tclsh.exe.manifest: $(WIN_DIR)\tclsh.exe.manifest.in
@nmakehlp -s << $** >$@
@MACHINE@ $(MACHINE:IX86=X86)
@TCL_WIN_VERSION@ $(DOTVERSION).0.0
@@ -830,8 +830,8 @@ depend:
@echo Build tclsh first!
!else
$(TCLSH) $(TOOLSDIR:\=/)/mkdepend.tcl -vc32 -out:"$(OUT_DIR)\depend.mk" \
- -passthru:"-DBUILD_tcl $(TCL_INCLUDES) $(PRJ_INCLUDES)" $(GENERICDIR),$$(GENERICDIR) \
- $(COMPATDIR),$$(COMPATDIR) $(TOMMATHDIR),$$(TOMMATHDIR) $(WINDIR),$$(WINDIR) @<<
+ -passthru:"/DBUILD_tcl $(TCL_INCLUDES) $(PRJ_INCLUDES)" $(GENERICDIR),$$(GENERICDIR) \
+ $(COMPATDIR),$$(COMPATDIR) $(TOMMATHDIR),$$(TOMMATHDIR) $(WIN_DIR),$$(WIN_DIR) @<<
$(TCLOBJS)
<<
!endif
@@ -868,7 +868,7 @@ $<
$<
<<
-$(TMP_DIR)\tclsh.res: $(TMP_DIR)\tclsh.exe.manifest $(WINDIR)\tclsh.rc
+$(TMP_DIR)\tclsh.res: $(TMP_DIR)\tclsh.exe.manifest $(WIN_DIR)\tclsh.rc
#---------------------------------------------------------------------
@@ -928,10 +928,10 @@ install-libraries: tclConfig tcl-nmake install-msgs install-tzdata
@$(CPY) "$(ROOT)\library\word.tcl" "$(SCRIPT_INSTALL_DIR)\"
@$(CPY) "$(ROOT)\library\auto.tcl" "$(SCRIPT_INSTALL_DIR)\"
@$(CPY) "$(OUT_DIR)\tclConfig.sh" "$(LIB_INSTALL_DIR)\"
- @$(CPY) "$(WINDIR)\tclooConfig.sh" "$(LIB_INSTALL_DIR)\"
- @$(CPY) "$(WINDIR)\rules.vc" "$(LIB_INSTALL_DIR)\nmake\"
- @$(CPY) "$(WINDIR)\targets.vc" "$(LIB_INSTALL_DIR)\nmake\"
- @$(CPY) "$(WINDIR)\nmakehlp.c" "$(LIB_INSTALL_DIR)\nmake\"
+ @$(CPY) "$(WIN_DIR)\tclooConfig.sh" "$(LIB_INSTALL_DIR)\"
+ @$(CPY) "$(WIN_DIR)\rules.vc" "$(LIB_INSTALL_DIR)\nmake\"
+ @$(CPY) "$(WIN_DIR)\targets.vc" "$(LIB_INSTALL_DIR)\nmake\"
+ @$(CPY) "$(WIN_DIR)\nmakehlp.c" "$(LIB_INSTALL_DIR)\nmake\"
@$(CPY) "$(OUT_DIR)\tcl.nmake" "$(LIB_INSTALL_DIR)\nmake\"
@echo Installing library opt0.4 directory
@$(CPY) "$(ROOT)\library\opt\*.tcl" \
diff --git a/win/nmakehlp.c b/win/nmakehlp.c
index c21de63..fac32ee 100644
--- a/win/nmakehlp.c
+++ b/win/nmakehlp.c
@@ -643,7 +643,7 @@ SubstituteFile(
}
/* debug: dump the list */
-#ifdef _DEBUG
+#ifndef NDEBUG
{
int n = 0;
list_item_t *p = NULL;
diff --git a/win/rules.vc b/win/rules.vc
index 34ac230..8d0793c 100644
--- a/win/rules.vc
+++ b/win/rules.vc
@@ -24,7 +24,7 @@ _RULES_VC = 1
# For modifications that are not backward-compatible, you *must* change
# the major version.
RULES_VERSION_MAJOR = 1
-RULES_VERSION_MINOR = 3
+RULES_VERSION_MINOR = 4
# The PROJECT macro must be defined by parent makefile.
!if "$(PROJECT)" == ""
@@ -162,7 +162,7 @@ MKDIR = mkdir
# COMPATDIR - source directory that holds compatibility sources
# DOCDIR - source directory containing documentation files
# GENERICDIR - platform-independent source directory
-# WINDIR - Windows-specific source directory
+# WIN_DIR - Windows-specific source directory
# TESTDIR - directory containing test files
# TOOLSDIR - directory containing build tools
# _TCLDIR - root of the Tcl installation OR the Tcl sources. Not set
@@ -215,17 +215,15 @@ DEMODIR = $(LIBDIR)\demos
DEMODIR = $(ROOT)\demos
!endif
!endif # ifndef DEMODIR
-# Do NOT enclose WINDIR in a !ifndef because Windows always defines
-# WINDIR env var to point to c:\windows!
-# TBD - This is a potentially dangerous conflict, rename WINDIR to
-# something else
-WINDIR = $(ROOT)\win
+# Do NOT use WINDIR because it is Windows internal environment
+# variable to point to c:\windows!
+WIN_DIR = $(ROOT)\win
!ifndef RCDIR
-!if exist("$(WINDIR)\rc")
-RCDIR = $(WINDIR)\rc
+!if exist("$(WIN_DIR)\rc")
+RCDIR = $(WIN_DIR)\rc
!else
-RCDIR = $(WINDIR)
+RCDIR = $(WIN_DIR)
!endif
!endif
RCDIR = $(RCDIR:/=\)
@@ -1084,7 +1082,7 @@ TCLLIB = $(OUT_DIR)\$(TCLLIBNAME)
TCLSTUBLIBNAME = $(STUBPREFIX)$(VERSION).lib
TCLSTUBLIB = $(OUT_DIR)\$(TCLSTUBLIBNAME)
-TCL_INCLUDES = -I"$(WINDIR)" -I"$(GENERICDIR)"
+TCL_INCLUDES = -I"$(WIN_DIR)" -I"$(GENERICDIR)"
!else # ! $(DOING_TCL)
@@ -1159,7 +1157,7 @@ WISH = $(OUT_DIR)\$(WISHNAME)
TKSTUBLIB = $(OUT_DIR)\$(TKSTUBLIBNAME)
TKIMPLIB = $(OUT_DIR)\$(TKIMPLIBNAME)
TKLIB = $(OUT_DIR)\$(TKLIBNAME)
-TK_INCLUDES = -I"$(WINDIR)" -I"$(GENERICDIR)"
+TK_INCLUDES = -I"$(WIN_DIR)" -I"$(GENERICDIR)"
!else # effectively NEED_TK
@@ -1270,59 +1268,59 @@ INCLUDE_INSTALL_DIR = $(_INSTALLDIR)\..\include
# baselibs - minimum Windows libraries required. Parent makefile can
# define PRJ_LIBS before including rules.rc if additional libs are needed
-OPTDEFINES = -DTCL_CFGVAL_ENCODING=$(CFG_ENCODING) -DSTDC_HEADERS
+OPTDEFINES = /DTCL_CFGVAL_ENCODING=$(CFG_ENCODING) /DSTDC_HEADERS
!if $(TCL_MEM_DEBUG)
-OPTDEFINES = $(OPTDEFINES) -DTCL_MEM_DEBUG
+OPTDEFINES = $(OPTDEFINES) /DTCL_MEM_DEBUG
!endif
!if $(TCL_COMPILE_DEBUG)
-OPTDEFINES = $(OPTDEFINES) -DTCL_COMPILE_DEBUG -DTCL_COMPILE_STATS
+OPTDEFINES = $(OPTDEFINES) /DTCL_COMPILE_DEBUG /DTCL_COMPILE_STATS
!endif
-!if $(TCL_THREADS) && $(TCL_VERSION) < 86
-OPTDEFINES = $(OPTDEFINES) -DTCL_THREADS=1
-!if $(USE_THREAD_ALLOC)
-OPTDEFINES = $(OPTDEFINES) -DUSE_THREAD_ALLOC=1
+!if $(TCL_THREADS) && $(TCL_VERSION) < 87
+OPTDEFINES = $(OPTDEFINES) /DTCL_THREADS=1
+!if $(USE_THREAD_ALLOC) && $(TCL_VERSION) < 87
+OPTDEFINES = $(OPTDEFINES) /DUSE_THREAD_ALLOC=1
!endif
!endif
!if $(STATIC_BUILD)
-OPTDEFINES = $(OPTDEFINES) -DSTATIC_BUILD
+OPTDEFINES = $(OPTDEFINES) /DSTATIC_BUILD
!endif
!if $(TCL_NO_DEPRECATED)
-OPTDEFINES = $(OPTDEFINES) -DTCL_NO_DEPRECATED
+OPTDEFINES = $(OPTDEFINES) /DTCL_NO_DEPRECATED
!endif
!if $(USE_STUBS)
# Note we do not define USE_TCL_STUBS even when building tk since some
# test targets in tk do not use stubs
!if ! $(DOING_TCL)
-USE_STUBS_DEFS = -DUSE_TCL_STUBS -DUSE_TCLOO_STUBS
+USE_STUBS_DEFS = /DUSE_TCL_STUBS /DUSE_TCLOO_STUBS
!if $(NEED_TK)
-USE_STUBS_DEFS = $(USE_STUBS_DEFS) -DUSE_TK_STUBS
+USE_STUBS_DEFS = $(USE_STUBS_DEFS) /DUSE_TK_STUBS
!endif
!endif
!endif # USE_STUBS
!if !$(DEBUG)
-OPTDEFINES = $(OPTDEFINES) -DNDEBUG
+OPTDEFINES = $(OPTDEFINES) /DNDEBUG
!if $(OPTIMIZING)
-OPTDEFINES = $(OPTDEFINES) -DTCL_CFG_OPTIMIZED
+OPTDEFINES = $(OPTDEFINES) /DTCL_CFG_OPTIMIZED
!endif
!endif
!if $(PROFILE)
-OPTDEFINES = $(OPTDEFINES) -DTCL_CFG_PROFILED
+OPTDEFINES = $(OPTDEFINES) /DTCL_CFG_PROFILED
!endif
!if "$(MACHINE)" == "AMD64"
-OPTDEFINES = $(OPTDEFINES) -DTCL_CFG_DO64BIT
+OPTDEFINES = $(OPTDEFINES) /DTCL_CFG_DO64BIT
!endif
!if $(VCVERSION) < 1300
-OPTDEFINES = $(OPTDEFINES) -DNO_STRTOI64
+OPTDEFINES = $(OPTDEFINES) /DNO_STRTOI64
!endif
!if "$(_USE_64BIT_TIME_T)" == "1"
-OPTDEFINES = $(OPTDEFINES) -D_USE_64BIT_TIME_T
+OPTDEFINES = $(OPTDEFINES) /D_USE_64BIT_TIME_T
!endif
-!if "$(TCL_UTF_MAX)" == "4"
-OPTDEFINES = $(OPTDEFINES) -DTCL_UTF_MAX=4
+!if "$(TCL_UTF_MAX)" == "6"
+OPTDEFINES = $(OPTDEFINES) /DTCL_UTF_MAX=4
!endif
# _ATL_XP_TARGETING - Newer SDK's need this to build for XP
@@ -1349,10 +1347,10 @@ COMPILERFLAGS = $(COMPILERFLAGS) /DUNICODE /D_UNICODE
# Note: some extensions use PACKAGE_NAME and others use PACKAGE_TCLNAME
# so we pass both
!if !$(DOING_TCL) && !$(DOING_TK)
-PKGNAMEFLAGS = -DPACKAGE_NAME="\"$(PRJ_PACKAGE_TCLNAME)\"" \
- -DPACKAGE_TCLNAME="\"$(PRJ_PACKAGE_TCLNAME)\"" \
- -DPACKAGE_VERSION="\"$(DOTVERSION)\"" \
- -DMODULE_SCOPE=extern
+PKGNAMEFLAGS = /DPACKAGE_NAME="\"$(PRJ_PACKAGE_TCLNAME)\"" \
+ /DPACKAGE_TCLNAME="\"$(PRJ_PACKAGE_TCLNAME)\"" \
+ /DPACKAGE_VERSION="\"$(DOTVERSION)\"" \
+ /DMODULE_SCOPE=extern
!endif
# crt picks the C run time based on selected OPTS
@@ -1399,7 +1397,7 @@ cwarn = $(cwarn) -wd4311 -wd4312
### Common compiler options that are architecture specific
!if "$(MACHINE)" == "ARM"
-carch = -D_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE
+carch = /D_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE
!else
carch =
!endif
@@ -1411,7 +1409,7 @@ cwarn = $(cwarn) -WX
INCLUDES = $(TCL_INCLUDES) $(TK_INCLUDES) $(PRJ_INCLUDES)
!if !$(DOING_TCL) && !$(DOING_TK)
-INCLUDES = $(INCLUDES) -I"$(GENERICDIR)" -I"$(WINDIR)" -I"$(COMPATDIR)"
+INCLUDES = $(INCLUDES) -I"$(GENERICDIR)" -I"$(WIN_DIR)" -I"$(COMPATDIR)"
!endif
# These flags are defined roughly in the order of the pre-reform
@@ -1427,13 +1425,13 @@ cflags = -nologo -c $(COMPILERFLAGS) $(carch) $(cwarn) -Fp$(TMP_DIR)^\ $(cdebug)
# BUILD_$(PROJECT) macro which should be defined only for the shared
# library *implementation* and not for its caller interface
-appcflags = $(cflags) $(crt) $(INCLUDES) $(TCL_DEFINES) $(PRJ_DEFINES) $(OPTDEFINES) $(USE_STUBS_DEFS)
appcflags_nostubs = $(cflags) $(crt) $(INCLUDES) $(TCL_DEFINES) $(PRJ_DEFINES) $(OPTDEFINES)
-pkgcflags = $(appcflags) $(PKGNAMEFLAGS) -DBUILD_$(PROJECT)
-pkgcflags_nostubs = $(appcflags_nostubs) $(PKGNAMEFLAGS) -DBUILD_$(PROJECT)
+appcflags = $(appcflags_nostubs) $(USE_STUBS_DEFS)
+pkgcflags = $(appcflags) $(PKGNAMEFLAGS) /DBUILD_$(PROJECT)
+pkgcflags_nostubs = $(appcflags_nostubs) $(PKGNAMEFLAGS) /DBUILD_$(PROJECT)
# stubscflags contains $(cflags) plus flags used for building a stubs
-# library for the package. Note: -DSTATIC_BUILD is defined in
+# library for the package. Note: /DSTATIC_BUILD is defined in
# $(OPTDEFINES) only if the OPTS configuration indicates a static
# library. However the stubs library is ALWAYS static hence included
# here irrespective of the OPTS setting.
@@ -1443,7 +1441,7 @@ pkgcflags_nostubs = $(appcflags_nostubs) $(PKGNAMEFLAGS) -DBUILD_$(PROJECT)
# so we do not remove it from cflags. -GL may prevent extensions
# compiled with one VC version to fail to link against stubs library
# compiled with another VC version. Check for this and fix accordingly.
-stubscflags = $(cflags) $(PKGNAMEFLAGS) $(PRJ_DEFINES) $(OPTDEFINES) -Zl -DSTATIC_BUILD $(INCLUDES)
+stubscflags = $(cflags) $(PKGNAMEFLAGS) $(PRJ_DEFINES) $(OPTDEFINES) -Zl /DSTATIC_BUILD $(INCLUDES) $(USE_STUBS_DEFS)
# Link flags
@@ -1508,13 +1506,13 @@ CONEXECMD = $(link32) $(conlflags) -out:$@ $(baselibs) $(tcllibs) $(tklibs)
GUIEXECMD = $(link32) $(guilflags) -out:$@ $(baselibs) $(tcllibs) $(tklibs)
RESCMD = $(rc32) -fo $@ -r -i "$(GENERICDIR)" -i "$(TMP_DIR)" \
$(TCL_INCLUDES) \
- -DDEBUG=$(DEBUG) -d UNCHECKED=$(UNCHECKED) \
- -DCOMMAVERSION=$(DOTVERSION:.=,),0 \
- -DDOTVERSION=\"$(DOTVERSION)\" \
- -DVERSION=\"$(VERSION)\" \
- -DSUFX=\"$(SUFX:t=)\" \
- -DPROJECT=\"$(PROJECT)\" \
- -DPRJLIBNAME=\"$(PRJLIBNAME)\"
+ /DDEBUG=$(DEBUG) -d UNCHECKED=$(UNCHECKED) \
+ /DCOMMAVERSION=$(DOTVERSION:.=,),0 \
+ /DDOTVERSION=\"$(DOTVERSION)\" \
+ /DVERSION=\"$(VERSION)\" \
+ /DSUFX=\"$(SUFX:t=)\" \
+ /DPROJECT=\"$(PROJECT)\" \
+ /DPRJLIBNAME=\"$(PRJLIBNAME)\"
!ifndef DEFAULT_BUILD_TARGET
DEFAULT_BUILD_TARGET = $(PROJECT)
@@ -1593,20 +1591,20 @@ default-install-demos:
default-clean:
@echo Cleaning $(TMP_DIR)\* ...
@if exist $(TMP_DIR)\nul $(RMDIR) $(TMP_DIR)
- @echo Cleaning $(WINDIR)\nmakehlp.obj, nmakehlp.exe ...
- @if exist $(WINDIR)\nmakehlp.obj del $(WINDIR)\nmakehlp.obj
- @if exist $(WINDIR)\nmakehlp.exe del $(WINDIR)\nmakehlp.exe
- @if exist $(WINDIR)\nmakehlp.out del $(WINDIR)\nmakehlp.out
- @echo Cleaning $(WINDIR)\nmhlp-out.txt ...
- @if exist $(WINDIR)\nmhlp-out.txt del $(WINDIR)\nmhlp-out.txt
- @echo Cleaning $(WINDIR)\_junk.pch ...
- @if exist $(WINDIR)\_junk.pch del $(WINDIR)\_junk.pch
- @echo Cleaning $(WINDIR)\vercl.x, vercl.i ...
- @if exist $(WINDIR)\vercl.x del $(WINDIR)\vercl.x
- @if exist $(WINDIR)\vercl.i del $(WINDIR)\vercl.i
- @echo Cleaning $(WINDIR)\versions.vc, version.vc ...
- @if exist $(WINDIR)\versions.vc del $(WINDIR)\versions.vc
- @if exist $(WINDIR)\version.vc del $(WINDIR)\version.vc
+ @echo Cleaning $(WIN_DIR)\nmakehlp.obj, nmakehlp.exe ...
+ @if exist $(WIN_DIR)\nmakehlp.obj del $(WIN_DIR)\nmakehlp.obj
+ @if exist $(WIN_DIR)\nmakehlp.exe del $(WIN_DIR)\nmakehlp.exe
+ @if exist $(WIN_DIR)\nmakehlp.out del $(WIN_DIR)\nmakehlp.out
+ @echo Cleaning $(WIN_DIR)\nmhlp-out.txt ...
+ @if exist $(WIN_DIR)\nmhlp-out.txt del $(WIN_DIR)\nmhlp-out.txt
+ @echo Cleaning $(WIN_DIR)\_junk.pch ...
+ @if exist $(WIN_DIR)\_junk.pch del $(WIN_DIR)\_junk.pch
+ @echo Cleaning $(WIN_DIR)\vercl.x, vercl.i ...
+ @if exist $(WIN_DIR)\vercl.x del $(WIN_DIR)\vercl.x
+ @if exist $(WIN_DIR)\vercl.i del $(WIN_DIR)\vercl.i
+ @echo Cleaning $(WIN_DIR)\versions.vc, version.vc ...
+ @if exist $(WIN_DIR)\versions.vc del $(WIN_DIR)\versions.vc
+ @if exist $(WIN_DIR)\version.vc del $(WIN_DIR)\version.vc
default-hose: default-clean
@echo Hosing $(OUT_DIR)\* ...
@@ -1698,7 +1696,7 @@ DISABLE_IMPLICIT_RULES = 0
$<
<<
-{$(WINDIR)}.c{$(TMP_DIR)}.obj::
+{$(WIN_DIR)}.c{$(TMP_DIR)}.obj::
$(CCPKGCMD) @<<
$<
<<
@@ -1716,7 +1714,7 @@ $<
{$(RCDIR)}.rc{$(TMP_DIR)}.res:
$(RESCMD) $<
-{$(WINDIR)}.rc{$(TMP_DIR)}.res:
+{$(WIN_DIR)}.rc{$(TMP_DIR)}.res:
$(RESCMD) $<
{$(TMP_DIR)}.rc{$(TMP_DIR)}.res:
@@ -1751,6 +1749,9 @@ TCLNMAKECONFIG = "$(OUT_DIR)\tcl.nmake"
!if defined(CORE_MACHINE) && "$(CORE_MACHINE)" != "$(MACHINE)"
!error ERROR: Build target ($(MACHINE)) does not match the Tcl library architecture ($(CORE_MACHINE)).
!endif
+!if $(TCL_VERSION) < 87 && defined(CORE_USE_THREAD_ALLOC) && $(CORE_USE_THREAD_ALLOC) != $(USE_THREAD_ALLOC)
+!message WARNING: Value of USE_THREAD_ALLOC ($(USE_THREAD_ALLOC)) does not match its Tcl core value ($(CORE_USE_THREAD_ALLOC)).
+!endif
!if defined(CORE_DEBUG) && $(CORE_DEBUG) != $(DEBUG)
!message WARNING: Value of DEBUG ($(DEBUG)) does not match its Tcl library configuration ($(DEBUG)).
!endif
diff --git a/win/tclWin32Dll.c b/win/tclWin32Dll.c
index 2b05bf3..2fed58b 100644
--- a/win/tclWin32Dll.c
+++ b/win/tclWin32Dll.c
@@ -314,7 +314,7 @@ TclWinDriveLetterForVolMountPoint(
* Try to read the volume mount point and see where it points.
*/
- if (GetVolumeNameForVolumeMountPoint(drive,
+ if (GetVolumeNameForVolumeMountPointW(drive,
Target, 55) != 0) {
if (wcscmp(dlIter->volumeName, Target) == 0) {
/*
@@ -373,7 +373,7 @@ TclWinDriveLetterForVolMountPoint(
* Try to read the volume mount point and see where it points.
*/
- if (GetVolumeNameForVolumeMountPoint(drive,
+ if (GetVolumeNameForVolumeMountPointW(drive,
Target, 55) != 0) {
int alreadyStored = 0;
@@ -465,7 +465,7 @@ TclWinDriveLetterForVolMountPoint(
#if !defined(TCL_NO_DEPRECATED) && TCL_MAJOR_VERSION < 9
#undef Tcl_WinUtfToTChar
-WCHAR *
+TCHAR *
Tcl_WinUtfToTChar(
const char *string, /* Source string in UTF-8. */
int len, /* Source string length in bytes, or -1 for
@@ -474,19 +474,19 @@ Tcl_WinUtfToTChar(
* converted string is stored. */
{
Tcl_DStringInit(dsPtr);
- return Tcl_UtfToWCharDString(string, len, dsPtr);
+ return (TCHAR *)Tcl_UtfToWCharDString(string, len, dsPtr);
}
#undef Tcl_WinTCharToUtf
char *
Tcl_WinTCharToUtf(
- const WCHAR *string, /* Source string in Unicode. */
+ const TCHAR *string, /* Source string in Unicode. */
int len, /* Source string length in bytes, or -1 for
* platform-specific string length. */
Tcl_DString *dsPtr) /* Uninitialized or free DString in which the
* converted string is stored. */
{
Tcl_DStringInit(dsPtr);
- return Tcl_WCharToUtfDString(string, len >> 1, dsPtr);
+ return Tcl_WCharToUtfDString((WCHAR *)string, len >> 1, dsPtr);
}
#endif /* !defined(TCL_NO_DEPRECATED) */
diff --git a/win/tclWinChan.c b/win/tclWinChan.c
index 3b6e4e4..d300269 100644
--- a/win/tclWinChan.c
+++ b/win/tclWinChan.c
@@ -946,7 +946,7 @@ TclpOpenFileChannel(
flags = FILE_ATTRIBUTE_READONLY;
}
} else {
- flags = GetFileAttributes(nativeName);
+ flags = GetFileAttributesW(nativeName);
if (flags == 0xFFFFFFFF) {
flags = 0;
}
@@ -962,7 +962,7 @@ TclpOpenFileChannel(
* Now we get to create the file.
*/
- handle = CreateFile(nativeName, accessMode, shareMode,
+ handle = CreateFileW(nativeName, accessMode, shareMode,
NULL, createMode, flags, (HANDLE) NULL);
if (handle == INVALID_HANDLE_VALUE) {
diff --git a/win/tclWinConsole.c b/win/tclWinConsole.c
index 3668ae3..09262c0 100644
--- a/win/tclWinConsole.c
+++ b/win/tclWinConsole.c
@@ -229,7 +229,7 @@ ReadConsoleBytes(
* will run and take whatever action it deems appropriate.
*/
do {
- result = ReadConsole(hConsole, lpBuffer, nbytes / sizeof(WCHAR), &ntchars,
+ result = ReadConsoleW(hConsole, lpBuffer, nbytes / sizeof(WCHAR), &ntchars,
NULL);
} while (result && ntchars == 0 && GetLastError() == ERROR_OPERATION_ABORTED);
if (nbytesread != NULL) {
@@ -248,7 +248,7 @@ WriteConsoleBytes(
DWORD ntchars;
BOOL result;
- result = WriteConsole(hConsole, lpBuffer, nbytes / sizeof(WCHAR), &ntchars,
+ result = WriteConsoleW(hConsole, lpBuffer, nbytes / sizeof(WCHAR), &ntchars,
NULL);
if (nbyteswritten != NULL) {
*nbyteswritten = ntchars * sizeof(WCHAR);
@@ -1055,7 +1055,7 @@ WaitForRead(
return 1;
}
- if (PeekConsoleInput(handle, &input, 1, &count) == FALSE) {
+ if (PeekConsoleInputW(handle, &input, 1, &count) == FALSE) {
/*
* Check to see if the peek failed because of EOF.
*/
@@ -1357,7 +1357,7 @@ TclWinOpenConsoleChannel(
modes |= ENABLE_LINE_INPUT;
SetConsoleMode(infoPtr->handle, modes);
- infoPtr->reader.readyEvent = CreateEvent(NULL, TRUE, TRUE, NULL);
+ infoPtr->reader.readyEvent = CreateEventW(NULL, TRUE, TRUE, NULL);
infoPtr->reader.thread = CreateThread(NULL, 256, ConsoleReaderThread,
TclPipeThreadCreateTI(&infoPtr->reader.TI, infoPtr,
infoPtr->reader.readyEvent), 0, NULL);
@@ -1366,7 +1366,7 @@ TclWinOpenConsoleChannel(
if (permissions & TCL_WRITABLE) {
- infoPtr->writer.readyEvent = CreateEvent(NULL, TRUE, TRUE, NULL);
+ infoPtr->writer.readyEvent = CreateEventW(NULL, TRUE, TRUE, NULL);
infoPtr->writer.thread = CreateThread(NULL, 256, ConsoleWriterThread,
TclPipeThreadCreateTI(&infoPtr->writer.TI, infoPtr,
infoPtr->writer.readyEvent), 0, NULL);
diff --git a/win/tclWinDde.c b/win/tclWinDde.c
index 44cbbbe..6fa9cc2 100644
--- a/win/tclWinDde.c
+++ b/win/tclWinDde.c
@@ -11,8 +11,6 @@
*/
#undef STATIC_BUILD
-#undef TCL_UTF_MAX
-#define TCL_UTF_MAX 3
#ifndef USE_TCL_STUBS
# define USE_TCL_STUBS
#endif
@@ -83,8 +81,8 @@ static int ddeIsServer = 0;
#define TCL_DDE_VERSION "1.4.1"
#define TCL_DDE_PACKAGE_NAME "dde"
-#define TCL_DDE_SERVICE_NAME TEXT("TclEval")
-#define TCL_DDE_EXECUTE_RESULT TEXT("$TCLEVAL$EXECUTE$RESULT")
+#define TCL_DDE_SERVICE_NAME L"TclEval"
+#define TCL_DDE_EXECUTE_RESULT L"$TCLEVAL$EXECUTE$RESULT"
#define DDE_FLAG_ASYNC 1
#define DDE_FLAG_BINARY 2
@@ -101,7 +99,7 @@ static LRESULT CALLBACK DdeClientWindowProc(HWND hwnd, UINT uMsg,
static int DdeCreateClient(DdeEnumServices *es);
static BOOL CALLBACK DdeEnumWindowsCallback(HWND hwndTarget,
LPARAM lParam);
-static void DdeExitProc(ClientData clientData);
+static void DdeExitProc(void *clientData);
static int DdeGetServicesList(Tcl_Interp *interp,
const WCHAR *serviceName, const WCHAR *topicName);
static HDDEDATA CALLBACK DdeServerProc(UINT uType, UINT uFmt, HCONV hConv,
@@ -109,19 +107,24 @@ static HDDEDATA CALLBACK DdeServerProc(UINT uType, UINT uFmt, HCONV hConv,
DWORD dwData1, DWORD dwData2);
static LRESULT DdeServicesOnAck(HWND hwnd, WPARAM wParam,
LPARAM lParam);
-static void DeleteProc(ClientData clientData);
+static void DeleteProc(void *clientData);
static Tcl_Obj * ExecuteRemoteObject(RegisteredInterp *riPtr,
Tcl_Obj *ddeObjectPtr);
static int MakeDdeConnection(Tcl_Interp *interp,
const WCHAR *name, HCONV *ddeConvPtr);
static void SetDdeError(Tcl_Interp *interp);
-static int DdeObjCmd(ClientData clientData,
+static int DdeObjCmd(void *clientData,
Tcl_Interp *interp, int objc,
Tcl_Obj *const objv[]);
#if (TCL_MAJOR_VERSION < 9) && (TCL_MINOR_VERSION < 7)
+# if TCL_UTF_MAX > 3
+# define Tcl_WCharToUtfDString(a,b,c) Tcl_WinTCharToUtf(a,(b)*sizeof(WCHAR),c)
+# define Tcl_UtfToWCharDString(a,b,c) Tcl_WinUtfToTChar(a,b,c)
+# else
# define Tcl_WCharToUtfDString Tcl_UniCharToUtfDString
# define Tcl_UtfToWCharDString Tcl_UtfToUniCharDString
+# endif
#endif
static unsigned char *
@@ -178,7 +181,7 @@ Dde_Init(
Tcl_CreateObjCommand(interp, "dde", DdeObjCmd, NULL, NULL);
Tcl_CreateExitHandler(DdeExitProc, NULL);
- return Tcl_PkgProvide(interp, TCL_DDE_PACKAGE_NAME, TCL_DDE_VERSION);
+ return Tcl_PkgProvideEx(interp, TCL_DDE_PACKAGE_NAME, TCL_DDE_VERSION, NULL);
}
/*
@@ -248,7 +251,7 @@ Initialize(void)
if (ddeInstance == 0) {
Tcl_MutexLock(&ddeMutex);
if (ddeInstance == 0) {
- if (DdeInitialize(&ddeInstance, (PFNCALLBACK) DdeServerProc,
+ if (DdeInitializeW(&ddeInstance, (PFNCALLBACK) DdeServerProc,
CBF_SKIP_REGISTRATIONS | CBF_SKIP_UNREGISTRATIONS
| CBF_FAIL_POKES, 0) != DMLERR_NO_ERROR) {
ddeInstance = 0;
@@ -261,7 +264,7 @@ Initialize(void)
if ((ddeServiceGlobal == 0) && (nameFound != 0)) {
ddeIsServer = 1;
Tcl_CreateExitHandler(DdeExitProc, NULL);
- ddeServiceGlobal = DdeCreateStringHandle(ddeInstance,
+ ddeServiceGlobal = DdeCreateStringHandleW(ddeInstance,
TCL_DDE_SERVICE_NAME, CP_WINUNICODE);
DdeNameService(ddeInstance, ddeServiceGlobal, 0L, DNS_REGISTER);
} else {
@@ -347,7 +350,7 @@ DdeSetServerName(
* current interp, but it doesn't have a name.
*/
- return TEXT("");
+ return L"";
}
/*
@@ -369,7 +372,7 @@ DdeSetServerName(
}
if (r != TCL_OK) {
Tcl_DStringInit(&dString);
- OutputDebugString(Tcl_UtfToWCharDString(Tcl_GetString(Tcl_GetObjResult(interp)), -1, &dString));
+ OutputDebugStringW(Tcl_UtfToWCharDString(Tcl_GetString(Tcl_GetObjResult(interp)), -1, &dString));
Tcl_DStringFree(&dString);
return NULL;
}
@@ -388,13 +391,13 @@ DdeSetServerName(
if (suffix > 1) {
if (suffix == 2) {
Tcl_DStringAppend(&dString, (char *)name, wcslen(name) * sizeof(WCHAR));
- Tcl_DStringAppend(&dString, (char *)TEXT(" #"), 2 * sizeof(WCHAR));
+ Tcl_DStringAppend(&dString, (char *)L" #", 2 * sizeof(WCHAR));
offset = Tcl_DStringLength(&dString);
Tcl_DStringSetLength(&dString, offset + sizeof(WCHAR) * TCL_INTEGER_SPACE);
actualName = (WCHAR *) Tcl_DStringValue(&dString);
}
_snwprintf((WCHAR *) (Tcl_DStringValue(&dString) + offset),
- TCL_INTEGER_SPACE, TEXT("%d"), suffix);
+ TCL_INTEGER_SPACE, L"%d", suffix);
}
/*
@@ -503,8 +506,7 @@ DdeGetRegistrationPtr(
static void
DeleteProc(
- ClientData clientData) /* The interp we are deleting passed as
- * ClientData. */
+ void *clientData) /* The interp we are deleting. */
{
RegisteredInterp *riPtr = (RegisteredInterp *) clientData;
RegisteredInterp *searchPtr, *prevPtr;
@@ -641,7 +643,7 @@ DdeServerProc(
HSZ ddeTopic, HSZ ddeItem, /* String handles. Transaction-type
* dependent. */
HDDEDATA hData, /* DDE data. Transaction-type dependent. */
- DWORD dwData1, DWORD dwData2)
+ DWORD unused1, DWORD unused2)
/* Transaction-dependent data. */
{
Tcl_DString dString;
@@ -653,6 +655,8 @@ DdeServerProc(
RegisteredInterp *riPtr;
Conversation *convPtr, *prevConvPtr;
ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey);
+ (void)unused1;
+ (void)unused2;
switch(uType) {
case XTYP_CONNECT:
@@ -661,11 +665,11 @@ DdeServerProc(
* sure we have a valid topic.
*/
- len = DdeQueryString(ddeInstance, ddeTopic, NULL, 0, CP_WINUNICODE);
+ len = DdeQueryStringW(ddeInstance, ddeTopic, NULL, 0, CP_WINUNICODE);
Tcl_DStringInit(&dString);
Tcl_DStringSetLength(&dString, (len + 1) * sizeof(WCHAR) - 1);
utilString = (WCHAR *) Tcl_DStringValue(&dString);
- DdeQueryString(ddeInstance, ddeTopic, utilString, (DWORD) len + 1,
+ DdeQueryStringW(ddeInstance, ddeTopic, utilString, (DWORD) len + 1,
CP_WINUNICODE);
for (riPtr = tsdPtr->interpListPtr; riPtr != NULL;
@@ -686,11 +690,11 @@ DdeServerProc(
* result to return in an XTYP_REQUEST.
*/
- len = DdeQueryString(ddeInstance, ddeTopic, NULL, 0, CP_WINUNICODE);
+ len = DdeQueryStringW(ddeInstance, ddeTopic, NULL, 0, CP_WINUNICODE);
Tcl_DStringInit(&dString);
Tcl_DStringSetLength(&dString, (len + 1) * sizeof(WCHAR) - 1);
utilString = (WCHAR *) Tcl_DStringValue(&dString);
- DdeQueryString(ddeInstance, ddeTopic, utilString, (DWORD) len + 1,
+ DdeQueryStringW(ddeInstance, ddeTopic, utilString, (DWORD) len + 1,
CP_WINUNICODE);
for (riPtr = tsdPtr->interpListPtr; riPtr != NULL;
riPtr = riPtr->nextPtr) {
@@ -754,12 +758,12 @@ DdeServerProc(
Tcl_DString dsBuf;
char *returnString;
- len = DdeQueryString(ddeInstance, ddeItem, NULL, 0, CP_WINUNICODE);
+ len = DdeQueryStringW(ddeInstance, ddeItem, NULL, 0, CP_WINUNICODE);
Tcl_DStringInit(&dString);
Tcl_DStringInit(&dsBuf);
Tcl_DStringSetLength(&dString, (len + 1) * sizeof(WCHAR) - 1);
utilString = (WCHAR *) Tcl_DStringValue(&dString);
- DdeQueryString(ddeInstance, ddeItem, utilString, (DWORD) len + 1,
+ DdeQueryStringW(ddeInstance, ddeItem, utilString, (DWORD) len + 1,
CP_WINUNICODE);
if (_wcsicmp(utilString, TCL_DDE_EXECUTE_RESULT) == 0) {
returnString =
@@ -834,10 +838,10 @@ DdeServerProc(
Tcl_DStringInit(&dString);
Tcl_DStringInit(&ds2);
- len = DdeQueryString(ddeInstance, ddeItem, NULL, 0, CP_WINUNICODE);
+ len = DdeQueryStringW(ddeInstance, ddeItem, NULL, 0, CP_WINUNICODE);
Tcl_DStringSetLength(&dString, (len + 1) * sizeof(WCHAR) - 1);
utilString = (WCHAR *) Tcl_DStringValue(&dString);
- DdeQueryString(ddeInstance, ddeItem, utilString, (DWORD) len + 1,
+ DdeQueryStringW(ddeInstance, ddeItem, utilString, (DWORD) len + 1,
CP_WINUNICODE);
Tcl_DStringInit(&ds);
Tcl_WCharToUtfDString(utilString, wcslen(utilString), &ds);
@@ -952,9 +956,9 @@ DdeServerProc(
len = dlen;
for (i = 0, riPtr = tsdPtr->interpListPtr; i < numItems;
i++, riPtr = riPtr->nextPtr) {
- returnPtr[i].hszSvc = DdeCreateStringHandle(ddeInstance,
+ returnPtr[i].hszSvc = DdeCreateStringHandleW(ddeInstance,
TCL_DDE_SERVICE_NAME, CP_WINUNICODE);
- returnPtr[i].hszTopic = DdeCreateStringHandle(ddeInstance,
+ returnPtr[i].hszTopic = DdeCreateStringHandleW(ddeInstance,
riPtr->name, CP_WINUNICODE);
}
returnPtr[i].hszSvc = NULL;
@@ -986,8 +990,9 @@ DdeServerProc(
static void
DdeExitProc(
- ClientData clientData) /* Not used in this handler. */
+ void *dummy) /* Not used. */
{
+ (void)dummy;
DdeNameService(ddeInstance, NULL, 0, DNS_UNREGISTER);
DdeUninitialize(ddeInstance);
ddeInstance = 0;
@@ -1019,8 +1024,8 @@ MakeDdeConnection(
HSZ ddeTopic, ddeService;
HCONV ddeConv;
- ddeService = DdeCreateStringHandle(ddeInstance, TCL_DDE_SERVICE_NAME, CP_WINUNICODE);
- ddeTopic = DdeCreateStringHandle(ddeInstance, name, CP_WINUNICODE);
+ ddeService = DdeCreateStringHandleW(ddeInstance, TCL_DDE_SERVICE_NAME, CP_WINUNICODE);
+ ddeTopic = DdeCreateStringHandleW(ddeInstance, name, CP_WINUNICODE);
ddeConv = DdeConnect(ddeInstance, ddeService, ddeTopic, NULL);
DdeFreeStringHandle(ddeInstance, ddeService);
@@ -1068,9 +1073,9 @@ static int
DdeCreateClient(
DdeEnumServices *es)
{
- WNDCLASSEX wc;
- static const WCHAR *szDdeClientClassName = TEXT("TclEval client class");
- static const WCHAR *szDdeClientWindowName = TEXT("TclEval client window");
+ WNDCLASSEXW wc;
+ static const WCHAR *szDdeClientClassName = L"TclEval client class";
+ static const WCHAR *szDdeClientWindowName = L"TclEval client window";
memset(&wc, 0, sizeof(wc));
wc.cbSize = sizeof(wc);
@@ -1082,8 +1087,8 @@ DdeCreateClient(
* Register and create the callback window.
*/
- RegisterClassEx(&wc);
- es->hwnd = CreateWindowEx(0, szDdeClientClassName, szDdeClientWindowName,
+ RegisterClassExW(&wc);
+ es->hwnd = CreateWindowExW(0, szDdeClientClassName, szDdeClientWindowName,
WS_POPUP, 0, 0, 0, 0, NULL, NULL, NULL, (LPVOID)es);
return TCL_OK;
}
@@ -1102,16 +1107,16 @@ DdeClientWindowProc(
(DdeEnumServices *) lpcs->lpCreateParams;
#ifdef _WIN64
- SetWindowLongPtr(hwnd, GWLP_USERDATA, (LONG_PTR) es);
+ SetWindowLongPtrW(hwnd, GWLP_USERDATA, (LONG_PTR) es);
#else
- SetWindowLong(hwnd, GWL_USERDATA, (LONG) es);
+ SetWindowLongW(hwnd, GWL_USERDATA, (LONG) es);
#endif
return (LRESULT) 0L;
}
case WM_DDE_ACK:
return DdeServicesOnAck(hwnd, wParam, lParam);
default:
- return DefWindowProc(hwnd, uMsg, wParam, lParam);
+ return DefWindowProcW(hwnd, uMsg, wParam, lParam);
}
}
@@ -1129,9 +1134,9 @@ DdeServicesOnAck(
Tcl_DString dString;
#ifdef _WIN64
- es = (DdeEnumServices *) GetWindowLongPtr(hwnd, GWLP_USERDATA);
+ es = (DdeEnumServices *) GetWindowLongPtrW(hwnd, GWLP_USERDATA);
#else
- es = (DdeEnumServices *) GetWindowLong(hwnd, GWL_USERDATA);
+ es = (DdeEnumServices *) GetWindowLongW(hwnd, GWL_USERDATA);
#endif
if (((es->service == (ATOM)0) || (es->service == service))
@@ -1139,12 +1144,12 @@ DdeServicesOnAck(
Tcl_Obj *matchPtr = Tcl_NewListObj(0, NULL);
Tcl_Obj *resultPtr = Tcl_GetObjResult(es->interp);
- GlobalGetAtomName(service, sz, 255);
+ GlobalGetAtomNameW(service, sz, 255);
Tcl_DStringInit(&dString);
Tcl_WCharToUtfDString(sz, wcslen(sz), &dString);
Tcl_ListObjAppendElement(NULL, matchPtr, Tcl_NewStringObj(Tcl_DStringValue(&dString), -1));
Tcl_DStringFree(&dString);
- GlobalGetAtomName(topic, sz, 255);
+ GlobalGetAtomNameW(topic, sz, 255);
Tcl_DStringInit(&dString);
Tcl_WCharToUtfDString(sz, wcslen(sz), &dString);
Tcl_ListObjAppendElement(NULL, matchPtr, Tcl_NewStringObj(Tcl_DStringValue(&dString), -1));
@@ -1174,7 +1179,7 @@ DdeServicesOnAck(
* Tell the server we are no longer interested.
*/
- PostMessage(hwndRemote, WM_DDE_TERMINATE, (WPARAM)hwnd, 0L);
+ PostMessageW(hwndRemote, WM_DDE_TERMINATE, (WPARAM)hwnd, 0L);
return 0L;
}
@@ -1186,7 +1191,7 @@ DdeEnumWindowsCallback(
DWORD_PTR dwResult = 0;
DdeEnumServices *es = (DdeEnumServices *) lParam;
- SendMessageTimeout(hwndTarget, WM_DDE_INITIATE, (WPARAM)es->hwnd,
+ SendMessageTimeoutW(hwndTarget, WM_DDE_INITIATE, (WPARAM)es->hwnd,
MAKELONG(es->service, es->topic), SMTO_ABORTIFHUNG, 1000,
&dwResult);
return TRUE;
@@ -1203,8 +1208,8 @@ DdeGetServicesList(
es.interp = interp;
es.result = TCL_OK;
es.service = (serviceName == NULL)
- ? (ATOM)0 : GlobalAddAtom(serviceName);
- es.topic = (topicName == NULL) ? (ATOM)0 : GlobalAddAtom(topicName);
+ ? (ATOM)0 : GlobalAddAtomW(serviceName);
+ es.topic = (topicName == NULL) ? (ATOM)0 : GlobalAddAtomW(topicName);
Tcl_ResetResult(interp); /* our list is to be appended to result. */
DdeCreateClient(&es);
@@ -1288,7 +1293,7 @@ SetDdeError(
static int
DdeObjCmd(
- ClientData clientData, /* Used only for deletion */
+ void *dummy, /* Not used. */
Tcl_Interp *interp, /* The interp we are sending from */
int objc, /* Number of arguments */
Tcl_Obj *const *objv) /* The arguments */
@@ -1330,6 +1335,7 @@ DdeObjCmd(
DWORD ddeResult;
Tcl_Obj *objPtr, *handlerPtr = NULL;
Tcl_DString serviceBuf, topicBuf, itemBuf;
+ (void)dummy;
/*
* Initialize DDE server/client
@@ -1496,7 +1502,7 @@ DdeObjCmd(
if (length == 0) {
serviceName = NULL;
} else if ((index != DDE_SERVERNAME) && (index != DDE_EVAL)) {
- ddeService = DdeCreateStringHandle(ddeInstance, serviceName,
+ ddeService = DdeCreateStringHandleW(ddeInstance, serviceName,
CP_WINUNICODE);
}
@@ -1510,7 +1516,7 @@ DdeObjCmd(
if (length == 0) {
topicName = NULL;
} else {
- ddeTopic = DdeCreateStringHandle(ddeInstance, topicName,
+ ddeTopic = DdeCreateStringHandleW(ddeInstance, topicName,
CP_WINUNICODE);
}
}
@@ -1620,7 +1626,7 @@ DdeObjCmd(
result = TCL_ERROR;
} else {
Tcl_Obj *returnObjPtr;
- ddeItem = DdeCreateStringHandle(ddeInstance, itemString,
+ ddeItem = DdeCreateStringHandleW(ddeInstance, itemString,
CP_WINUNICODE);
if (ddeItem != NULL) {
ddeData = DdeClientTransaction(NULL, 0, hConv, ddeItem,
@@ -1700,7 +1706,7 @@ DdeObjCmd(
SetDdeError(interp);
result = TCL_ERROR;
} else {
- ddeItem = DdeCreateStringHandle(ddeInstance, itemString,
+ ddeItem = DdeCreateStringHandleW(ddeInstance, itemString,
CP_WINUNICODE);
if (ddeItem != NULL) {
ddeData = DdeClientTransaction(dataString, (DWORD) length,
@@ -1869,7 +1875,7 @@ DdeObjCmd(
0xFFFFFFFF, hConv, 0,
CF_UNICODETEXT, XTYP_EXECUTE, 30000, NULL);
if (ddeData != 0) {
- ddeCookie = DdeCreateStringHandle(ddeInstance,
+ ddeCookie = DdeCreateStringHandleW(ddeInstance,
TCL_DDE_EXECUTE_RESULT, CP_WINUNICODE);
ddeData = DdeClientTransaction(NULL, 0, hConv, ddeCookie,
CF_UNICODETEXT, XTYP_REQUEST, 30000, NULL);
diff --git a/win/tclWinFCmd.c b/win/tclWinFCmd.c
index f8fa463..8885e33 100644
--- a/win/tclWinFCmd.c
+++ b/win/tclWinFCmd.c
@@ -214,12 +214,12 @@ DoRenameFile(
"movl %%edx, %%fs:0" "\n\t"
/*
- * Call MoveFile(nativeSrc, nativeDst)
+ * Call MoveFileW(nativeSrc, nativeDst)
*/
"pushl %%ebx" "\n\t"
"pushl %%ecx" "\n\t"
- "movl %[moveFile], %%eax" "\n\t"
+ "movl %[moveFileW], %%eax" "\n\t"
"call *%%eax" "\n\t"
/*
@@ -256,7 +256,7 @@ DoRenameFile(
[registration] "m" (registration),
[nativeDst] "m" (nativeDst),
[nativeSrc] "m" (nativeSrc),
- [moveFile] "r" (MoveFile)
+ [moveFileW] "r" (MoveFileW)
:
"%eax", "%ebx", "%ecx", "%edx", "memory"
);
@@ -267,7 +267,7 @@ DoRenameFile(
#ifndef HAVE_NO_SEH
__try {
#endif
- if ((*MoveFile)(nativeSrc, nativeDst) != FALSE) {
+ if ((*MoveFileW)(nativeSrc, nativeDst) != FALSE) {
retval = TCL_OK;
}
#ifndef HAVE_NO_SEH
@@ -281,10 +281,10 @@ DoRenameFile(
TclWinConvertError(GetLastError());
- srcAttr = GetFileAttributes(nativeSrc);
- dstAttr = GetFileAttributes(nativeDst);
+ srcAttr = GetFileAttributesW(nativeSrc);
+ dstAttr = GetFileAttributesW(nativeDst);
if (srcAttr == 0xffffffff) {
- if (GetFullPathName(nativeSrc, 0, NULL,
+ if (GetFullPathNameW(nativeSrc, 0, NULL,
NULL) >= MAX_PATH) {
errno = ENAMETOOLONG;
return TCL_ERROR;
@@ -292,7 +292,7 @@ DoRenameFile(
srcAttr = 0;
}
if (dstAttr == 0xffffffff) {
- if (GetFullPathName(nativeDst, 0, NULL,
+ if (GetFullPathNameW(nativeDst, 0, NULL,
NULL) >= MAX_PATH) {
errno = ENAMETOOLONG;
return TCL_ERROR;
@@ -315,18 +315,18 @@ DoRenameFile(
Tcl_DString srcString, dstString;
const char *src, *dst;
- size = GetFullPathName(nativeSrc, MAX_PATH,
+ size = GetFullPathNameW(nativeSrc, MAX_PATH,
nativeSrcPath, &nativeSrcRest);
if ((size == 0) || (size > MAX_PATH)) {
return TCL_ERROR;
}
- size = GetFullPathName(nativeDst, MAX_PATH,
+ size = GetFullPathNameW(nativeDst, MAX_PATH,
nativeDstPath, &nativeDstRest);
if ((size == 0) || (size > MAX_PATH)) {
return TCL_ERROR;
}
- CharLower(nativeSrcPath);
- CharLower(nativeDstPath);
+ CharLowerW(nativeSrcPath);
+ CharLowerW(nativeDstPath);
Tcl_DStringInit(&srcString);
Tcl_DStringInit(&dstString);
@@ -410,7 +410,7 @@ DoRenameFile(
* directory back, for completeness.
*/
- if (MoveFile(nativeSrc,
+ if (MoveFileW(nativeSrc,
nativeDst) != FALSE) {
return TCL_OK;
}
@@ -421,8 +421,8 @@ DoRenameFile(
*/
TclWinConvertError(GetLastError());
- CreateDirectory(nativeDst, NULL);
- SetFileAttributes(nativeDst, dstAttr);
+ CreateDirectoryW(nativeDst, NULL);
+ SetFileAttributesW(nativeDst, dstAttr);
if (Tcl_GetErrno() == EACCES) {
/*
* Decode the EACCES to a more meaningful error.
@@ -451,7 +451,7 @@ DoRenameFile(
int result, size;
WCHAR tempBuf[MAX_PATH];
- size = GetFullPathName(nativeDst, MAX_PATH,
+ size = GetFullPathNameW(nativeDst, MAX_PATH,
tempBuf, &nativeRest);
if ((size == 0) || (size > MAX_PATH) || (nativeRest == NULL)) {
return TCL_ERROR;
@@ -460,8 +460,8 @@ DoRenameFile(
nativeRest[0] = '\0';
result = TCL_ERROR;
- nativePrefix = (WCHAR *) L"tclr";
- if (GetTempFileName(nativeTmp, nativePrefix,
+ nativePrefix = (WCHAR *)L"tclr";
+ if (GetTempFileNameW(nativeTmp, nativePrefix,
0, tempBuf) != 0) {
/*
* Strictly speaking, need the following DeleteFile and
@@ -471,15 +471,15 @@ DoRenameFile(
*/
nativeTmp = tempBuf;
- DeleteFile(nativeTmp);
- if (MoveFile(nativeDst, nativeTmp) != FALSE) {
- if (MoveFile(nativeSrc, nativeDst) != FALSE) {
- SetFileAttributes(nativeTmp, FILE_ATTRIBUTE_NORMAL);
- DeleteFile(nativeTmp);
+ DeleteFileW(nativeTmp);
+ if (MoveFileW(nativeDst, nativeTmp) != FALSE) {
+ if (MoveFileW(nativeSrc, nativeDst) != FALSE) {
+ SetFileAttributesW(nativeTmp, FILE_ATTRIBUTE_NORMAL);
+ DeleteFileW(nativeTmp);
return TCL_OK;
} else {
- DeleteFile(nativeDst);
- MoveFile(nativeTmp, nativeDst);
+ DeleteFileW(nativeDst);
+ MoveFileW(nativeTmp, nativeDst);
}
}
@@ -603,10 +603,10 @@ DoCopyFile(
"movl %%edx, %%fs:0" "\n\t"
/*
- * Call CopyFile(nativeSrc, nativeDst, 0)
+ * Call CopyFileW(nativeSrc, nativeDst, 0)
*/
- "movl %[copyFile], %%eax" "\n\t"
+ "movl %[copyFileW], %%eax" "\n\t"
"pushl $0" "\n\t"
"pushl %%ebx" "\n\t"
"pushl %%ecx" "\n\t"
@@ -646,7 +646,7 @@ DoCopyFile(
[registration] "m" (registration),
[nativeDst] "m" (nativeDst),
[nativeSrc] "m" (nativeSrc),
- [copyFile] "r" (CopyFile)
+ [copyFileW] "r" (CopyFileW)
:
"%eax", "%ebx", "%ecx", "%edx", "memory"
);
@@ -657,7 +657,7 @@ DoCopyFile(
#ifndef HAVE_NO_SEH
__try {
#endif
- if (CopyFile(nativeSrc, nativeDst, 0) != FALSE) {
+ if (CopyFileW(nativeSrc, nativeDst, 0) != FALSE) {
retval = TCL_OK;
}
#ifndef HAVE_NO_SEH
@@ -677,8 +677,8 @@ DoCopyFile(
if (Tcl_GetErrno() == EACCES) {
DWORD srcAttr, dstAttr;
- srcAttr = GetFileAttributes(nativeSrc);
- dstAttr = GetFileAttributes(nativeDst);
+ srcAttr = GetFileAttributesW(nativeSrc);
+ dstAttr = GetFileAttributesW(nativeDst);
if (srcAttr != 0xffffffff) {
if (dstAttr == 0xffffffff) {
dstAttr = 0;
@@ -694,9 +694,9 @@ DoCopyFile(
Tcl_SetErrno(EISDIR);
}
if (dstAttr & FILE_ATTRIBUTE_READONLY) {
- SetFileAttributes(nativeDst,
+ SetFileAttributesW(nativeDst,
dstAttr & ~((DWORD)FILE_ATTRIBUTE_READONLY));
- if (CopyFile(nativeSrc, nativeDst,
+ if (CopyFileW(nativeSrc, nativeDst,
0) != FALSE) {
return TCL_OK;
}
@@ -707,7 +707,7 @@ DoCopyFile(
*/
TclWinConvertError(GetLastError());
- SetFileAttributes(nativeDst, dstAttr);
+ SetFileAttributesW(nativeDst, dstAttr);
}
}
}
@@ -763,13 +763,13 @@ TclpDeleteFile(
return TCL_ERROR;
}
- if (DeleteFile(path) != FALSE) {
+ if (DeleteFileW(path) != FALSE) {
return TCL_OK;
}
TclWinConvertError(GetLastError());
if (Tcl_GetErrno() == EACCES) {
- attr = GetFileAttributes(path);
+ attr = GetFileAttributesW(path);
if (attr != 0xffffffff) {
if (attr & FILE_ATTRIBUTE_DIRECTORY) {
if (attr & FILE_ATTRIBUTE_REPARSE_POINT) {
@@ -790,21 +790,21 @@ TclpDeleteFile(
Tcl_SetErrno(EISDIR);
} else if (attr & FILE_ATTRIBUTE_READONLY) {
- int res = SetFileAttributes(path,
+ int res = SetFileAttributesW(path,
attr & ~((DWORD) FILE_ATTRIBUTE_READONLY));
if ((res != 0) &&
- (DeleteFile(path) != FALSE)) {
+ (DeleteFileW(path) != FALSE)) {
return TCL_OK;
}
TclWinConvertError(GetLastError());
if (res != 0) {
- SetFileAttributes(path, attr);
+ SetFileAttributesW(path, attr);
}
}
}
} else if (Tcl_GetErrno() == ENOENT) {
- attr = GetFileAttributes(path);
+ attr = GetFileAttributesW(path);
if (attr != 0xffffffff) {
if (attr & FILE_ATTRIBUTE_DIRECTORY) {
/*
@@ -863,7 +863,7 @@ static int
DoCreateDirectory(
const WCHAR *nativePath) /* Pathname of directory to create (native). */
{
- if (CreateDirectory(nativePath, NULL) == 0) {
+ if (CreateDirectoryW(nativePath, NULL) == 0) {
DWORD error = GetLastError();
TclWinConvertError(error);
@@ -1035,7 +1035,7 @@ DoRemoveJustDirectory(
return TCL_ERROR;
}
- attr = GetFileAttributes(nativePath);
+ attr = GetFileAttributesW(nativePath);
if (attr & FILE_ATTRIBUTE_REPARSE_POINT) {
/*
@@ -1049,7 +1049,7 @@ DoRemoveJustDirectory(
* Ordinary directory.
*/
- if (RemoveDirectory(nativePath) != FALSE) {
+ if (RemoveDirectoryW(nativePath) != FALSE) {
return TCL_OK;
}
}
@@ -1057,7 +1057,7 @@ DoRemoveJustDirectory(
TclWinConvertError(GetLastError());
if (Tcl_GetErrno() == EACCES) {
- attr = GetFileAttributes(nativePath);
+ attr = GetFileAttributesW(nativePath);
if (attr != 0xffffffff) {
if ((attr & FILE_ATTRIBUTE_DIRECTORY) == 0) {
/*
@@ -1081,15 +1081,15 @@ DoRemoveJustDirectory(
if (attr & FILE_ATTRIBUTE_READONLY) {
attr &= ~FILE_ATTRIBUTE_READONLY;
- if (SetFileAttributes(nativePath,
+ if (SetFileAttributesW(nativePath,
attr) == FALSE) {
goto end;
}
- if (RemoveDirectory(nativePath) != FALSE) {
+ if (RemoveDirectoryW(nativePath) != FALSE) {
return TCL_OK;
}
TclWinConvertError(GetLastError());
- SetFileAttributes(nativePath,
+ SetFileAttributesW(nativePath,
attr | FILE_ATTRIBUTE_READONLY);
}
}
@@ -1191,7 +1191,7 @@ TraverseWinTree(
WCHAR *nativeSource, *nativeTarget, *nativeErrfile;
int result, found, sourceLen, targetLen = 0, oldSourceLen, oldTargetLen;
HANDLE handle;
- WIN32_FIND_DATA data;
+ WIN32_FIND_DATAW data;
nativeErrfile = NULL;
result = TCL_OK;
@@ -1202,7 +1202,7 @@ TraverseWinTree(
(targetPtr == NULL ? NULL : Tcl_DStringValue(targetPtr));
oldSourceLen = Tcl_DStringLength(sourcePtr);
- sourceAttr = GetFileAttributes(nativeSource);
+ sourceAttr = GetFileAttributesW(nativeSource);
if (sourceAttr == 0xffffffff) {
nativeErrfile = nativeSource;
goto end;
@@ -1229,7 +1229,7 @@ TraverseWinTree(
Tcl_DStringSetLength(sourcePtr, Tcl_DStringLength(sourcePtr) - 1);
nativeSource = (WCHAR *) Tcl_DStringValue(sourcePtr);
- handle = FindFirstFile(nativeSource, &data);
+ handle = FindFirstFileW(nativeSource, &data);
if (handle == INVALID_HANDLE_VALUE) {
/*
* Can't read directory.
@@ -1262,7 +1262,7 @@ TraverseWinTree(
}
found = 1;
- for (; found; found = FindNextFile(handle, &data)) {
+ for (; found; found = FindNextFileW(handle, &data)) {
WCHAR *nativeName;
int len;
@@ -1378,9 +1378,9 @@ TraversalCopy(
break;
case DOTREE_PRED:
if (DoCreateDirectory(nativeDst) == TCL_OK) {
- DWORD attr = GetFileAttributes(nativeSrc);
+ DWORD attr = GetFileAttributesW(nativeSrc);
- if (SetFileAttributes(nativeDst,
+ if (SetFileAttributesW(nativeDst,
attr) != FALSE) {
return TCL_OK;
}
@@ -1518,7 +1518,7 @@ GetWinFileAttributes(
int attr;
nativeName = Tcl_FSGetNativePath(fileName);
- result = GetFileAttributes(nativeName);
+ result = GetFileAttributesW(nativeName);
if (result == 0xffffffff) {
StatError(interp, fileName);
@@ -1649,7 +1649,7 @@ ConvertFileNameFormat(
Tcl_DString dsTemp;
const WCHAR *nativeName;
const char *tempString;
- WIN32_FIND_DATA data;
+ WIN32_FIND_DATAW data;
HANDLE handle;
DWORD attr;
@@ -1665,16 +1665,16 @@ ConvertFileNameFormat(
Tcl_DStringInit(&ds);
nativeName = Tcl_UtfToWCharDString(tempString, length, &ds);
Tcl_DecrRefCount(tempPath);
- handle = FindFirstFile(nativeName, &data);
+ handle = FindFirstFileW(nativeName, &data);
if (handle == INVALID_HANDLE_VALUE) {
/*
- * FindFirstFile() doesn't like root directories. We would
+ * FindFirstFileW() doesn't like root directories. We would
* only get a root directory here if the caller specified "c:"
* or "c:." and the current directory on the drive was the
* root directory
*/
- attr = GetFileAttributes(nativeName);
+ attr = GetFileAttributesW(nativeName);
if ((attr!=0xFFFFFFFF) && (attr & FILE_ATTRIBUTE_DIRECTORY)) {
Tcl_DStringFree(&ds);
goto simple;
@@ -1844,7 +1844,7 @@ SetWinFileAttributes(
const WCHAR *nativeName;
nativeName = Tcl_FSGetNativePath(fileName);
- fileAttributes = old = GetFileAttributes(nativeName);
+ fileAttributes = old = GetFileAttributesW(nativeName);
if (fileAttributes == 0xffffffff) {
StatError(interp, fileName);
@@ -1863,7 +1863,7 @@ SetWinFileAttributes(
}
if ((fileAttributes != old)
- && !SetFileAttributes(nativeName, fileAttributes)) {
+ && !SetFileAttributesW(nativeName, fileAttributes)) {
StatError(interp, fileName);
return TCL_ERROR;
}
@@ -1936,10 +1936,10 @@ TclpObjListVolumes(void)
if (GetLogicalDriveStringsA(sizeof(buf), buf) == 0) {
/*
- * GetVolumeInformation() will detects all drives, but causes
+ * GetVolumeInformationW() will detects all drives, but causes
* chattering on empty floppy drives. We only do this if
* GetLogicalDriveStrings() didn't work. It has also been reported
- * that on some laptops it takes a while for GetVolumeInformation() to
+ * that on some laptops it takes a while for GetVolumeInformationW() to
* return when pinging an empty floppy drive, another reason to try to
* avoid calling it.
*/
diff --git a/win/tclWinFile.c b/win/tclWinFile.c
index f3c45ef..880adc0 100644
--- a/win/tclWinFile.c
+++ b/win/tclWinFile.c
@@ -203,7 +203,7 @@ WinLink(
* Get the full path referenced by the target.
*/
- if (!GetFullPathName(linkTargetPath, MAX_PATH, tempFileName,
+ if (!GetFullPathNameW(linkTargetPath, MAX_PATH, tempFileName,
&tempFilePart)) {
/*
* Invalid file.
@@ -217,7 +217,7 @@ WinLink(
* Make sure source file doesn't exist.
*/
- attr = GetFileAttributes(linkSourcePath);
+ attr = GetFileAttributesW(linkSourcePath);
if (attr != INVALID_FILE_ATTRIBUTES) {
Tcl_SetErrno(EEXIST);
return -1;
@@ -227,7 +227,7 @@ WinLink(
* Get the full path referenced by the source file/directory.
*/
- if (!GetFullPathName(linkSourcePath, MAX_PATH, tempFileName,
+ if (!GetFullPathNameW(linkSourcePath, MAX_PATH, tempFileName,
&tempFilePart)) {
/*
* Invalid file.
@@ -241,7 +241,7 @@ WinLink(
* Check the target.
*/
- attr = GetFileAttributes(linkTargetPath);
+ attr = GetFileAttributesW(linkTargetPath);
if (attr == INVALID_FILE_ATTRIBUTES) {
/*
* The target doesn't exist.
@@ -254,7 +254,7 @@ WinLink(
*/
if (linkAction & TCL_CREATE_HARD_LINK) {
- if (CreateHardLink(linkSourcePath, linkTargetPath, NULL)) {
+ if (CreateHardLinkW(linkSourcePath, linkTargetPath, NULL)) {
/*
* Success!
*/
@@ -316,7 +316,7 @@ WinReadLink(
* Get the full path referenced by the target.
*/
- if (!GetFullPathName(linkSourcePath, MAX_PATH, tempFileName,
+ if (!GetFullPathNameW(linkSourcePath, MAX_PATH, tempFileName,
&tempFilePart)) {
/*
* Invalid file.
@@ -330,7 +330,7 @@ WinReadLink(
* Make sure source file does exist.
*/
- attr = GetFileAttributes(linkSourcePath);
+ attr = GetFileAttributesW(linkSourcePath);
if (attr == INVALID_FILE_ATTRIBUTES) {
/*
* The source doesn't exist.
@@ -487,7 +487,7 @@ TclWinSymLinkDelete(
memset(reparseBuffer, 0, sizeof(DUMMY_REPARSE_BUFFER));
reparseBuffer->ReparseTag = IO_REPARSE_TAG_MOUNT_POINT;
- hFile = CreateFile(linkOrigPath, GENERIC_WRITE, 0, NULL, OPEN_EXISTING,
+ hFile = CreateFileW(linkOrigPath, GENERIC_WRITE, 0, NULL, OPEN_EXISTING,
FILE_FLAG_OPEN_REPARSE_POINT | FILE_FLAG_BACKUP_SEMANTICS, NULL);
if (hFile != INVALID_HANDLE_VALUE) {
@@ -502,7 +502,7 @@ TclWinSymLinkDelete(
} else {
CloseHandle(hFile);
if (!linkOnly) {
- RemoveDirectory(linkOrigPath);
+ RemoveDirectoryW(linkOrigPath);
}
return 0;
}
@@ -547,7 +547,7 @@ WinReadLinkDirectory(
Tcl_DString ds;
const char *copy;
- attr = GetFileAttributes(linkDirPath);
+ attr = GetFileAttributesW(linkDirPath);
if (!(attr & FILE_ATTRIBUTE_REPARSE_POINT)) {
goto invalidError;
}
@@ -681,7 +681,7 @@ NativeReadReparse(
HANDLE hFile;
DWORD returnedLength;
- hFile = CreateFile(linkDirPath, desiredAccess, FILE_SHARE_READ, NULL,
+ hFile = CreateFileW(linkDirPath, desiredAccess, FILE_SHARE_READ, NULL,
OPEN_EXISTING,
FILE_FLAG_OPEN_REPARSE_POINT | FILE_FLAG_BACKUP_SEMANTICS, NULL);
@@ -741,7 +741,7 @@ NativeWriteReparse(
* Create the directory - it must not already exist.
*/
- if (CreateDirectory(linkDirPath, NULL) == 0) {
+ if (CreateDirectoryW(linkDirPath, NULL) == 0) {
/*
* Error creating directory.
*/
@@ -749,7 +749,7 @@ NativeWriteReparse(
TclWinConvertError(GetLastError());
return -1;
}
- hFile = CreateFile(linkDirPath, GENERIC_WRITE, 0, NULL,
+ hFile = CreateFileW(linkDirPath, GENERIC_WRITE, 0, NULL,
OPEN_EXISTING, FILE_FLAG_OPEN_REPARSE_POINT
| FILE_FLAG_BACKUP_SEMANTICS, NULL);
if (hFile == INVALID_HANDLE_VALUE) {
@@ -774,7 +774,7 @@ NativeWriteReparse(
TclWinConvertError(GetLastError());
CloseHandle(hFile);
- RemoveDirectory(linkDirPath);
+ RemoveDirectoryW(linkDirPath);
return -1;
}
CloseHandle(hFile);
@@ -940,7 +940,7 @@ TclpMatchInDirectory(
native = Tcl_FSGetNativePath(pathPtr);
- if (GetFileAttributesEx(native,
+ if (GetFileAttributesExW(native,
GetFileExInfoStandard, &data) != TRUE) {
return TCL_OK;
}
@@ -954,7 +954,7 @@ TclpMatchInDirectory(
} else {
DWORD attr;
HANDLE handle;
- WIN32_FIND_DATA data;
+ WIN32_FIND_DATAW data;
const char *dirName; /* UTF-8 dir name, later with pattern
* appended. */
int dirLength;
@@ -983,7 +983,7 @@ TclpMatchInDirectory(
if (native == NULL) {
return TCL_OK;
}
- attr = GetFileAttributes(native);
+ attr = GetFileAttributesW(native);
if ((attr == INVALID_FILE_ATTRIBUTES)
|| ((attr & FILE_ATTRIBUTE_DIRECTORY) == 0)) {
@@ -1027,13 +1027,13 @@ TclpMatchInDirectory(
Tcl_DStringInit(&ds);
native = Tcl_UtfToWCharDString(dirName, -1, &ds);
if ((types == NULL) || (types->type != TCL_GLOB_TYPE_DIR)) {
- handle = FindFirstFile(native, &data);
+ handle = FindFirstFileW(native, &data);
} else {
/*
* We can be more efficient, for pure directory requests.
*/
- handle = FindFirstFileEx(native,
+ handle = FindFirstFileExW(native,
FindExInfoStandard, &data,
FindExSearchLimitToDirectories, NULL, 0);
}
@@ -1159,7 +1159,7 @@ TclpMatchInDirectory(
*/
Tcl_DStringFree(&ds);
- } while (FindNextFile(handle, &data) == TRUE);
+ } while (FindNextFileW(handle, &data) == TRUE);
FindClose(handle);
Tcl_DStringFree(&dsOrig);
@@ -1593,7 +1593,7 @@ NativeAccess(
{
DWORD attr;
- attr = GetFileAttributes(nativePath);
+ attr = GetFileAttributesW(nativePath);
if (attr == INVALID_FILE_ATTRIBUTES) {
/*
@@ -1662,7 +1662,7 @@ NativeAccess(
mask |= GENERIC_EXECUTE;
}
- hFile = CreateFile(nativePath, mask,
+ hFile = CreateFileW(nativePath, mask,
FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE,
NULL, OPEN_EXISTING, FILE_FLAG_NO_BUFFERING, NULL);
if (hFile != INVALID_HANDLE_VALUE) {
@@ -1712,7 +1712,7 @@ NativeAccess(
*/
size = 0;
- GetFileSecurity(nativePath,
+ GetFileSecurityW(nativePath,
OWNER_SECURITY_INFORMATION | GROUP_SECURITY_INFORMATION
| DACL_SECURITY_INFORMATION | LABEL_SECURITY_INFORMATION,
0, 0, &size);
@@ -1743,10 +1743,10 @@ NativeAccess(
}
/*
- * Call GetFileSecurity() for real.
+ * Call GetFileSecurityW() for real.
*/
- if (!GetFileSecurity(nativePath,
+ if (!GetFileSecurityW(nativePath,
OWNER_SECURITY_INFORMATION | GROUP_SECURITY_INFORMATION
| DACL_SECURITY_INFORMATION | LABEL_SECURITY_INFORMATION,
sdPtr, size, &size)) {
@@ -1925,7 +1925,7 @@ TclpObjChdir(
if (!nativePath) {
return -1;
}
- result = SetCurrentDirectory(nativePath);
+ result = SetCurrentDirectoryW(nativePath);
if (result == 0) {
TclWinConvertError(GetLastError());
@@ -1966,7 +1966,7 @@ TclpGetCwd(
char *p;
WCHAR *native;
- if (GetCurrentDirectory(MAX_PATH, buffer) == 0) {
+ if (GetCurrentDirectoryW(MAX_PATH, buffer) == 0) {
TclWinConvertError(GetLastError());
if (interp != NULL) {
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
@@ -2067,7 +2067,7 @@ NativeStat(
* and if successful, mock up a BY_HANDLE_FILE_INFORMATION structure.
*/
- fileHandle = CreateFile(nativePath, GENERIC_READ,
+ fileHandle = CreateFileW(nativePath, GENERIC_READ,
FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE,
NULL, OPEN_EXISTING,
FILE_FLAG_BACKUP_SEMANTICS | FILE_FLAG_OPEN_REPARSE_POINT, NULL);
@@ -2125,17 +2125,17 @@ NativeStat(
WIN32_FILE_ATTRIBUTE_DATA data;
- if (GetFileAttributesEx(nativePath,
+ if (GetFileAttributesExW(nativePath,
GetFileExInfoStandard, &data) != TRUE) {
HANDLE hFind;
- WIN32_FIND_DATA ffd;
+ WIN32_FIND_DATAW ffd;
DWORD lasterror = GetLastError();
if (lasterror != ERROR_SHARING_VIOLATION) {
TclWinConvertError(lasterror);
return -1;
}
- hFind = FindFirstFile(nativePath, &ffd);
+ hFind = FindFirstFileW(nativePath, &ffd);
if (hFind == INVALID_HANDLE_VALUE) {
TclWinConvertError(GetLastError());
return -1;
@@ -2193,7 +2193,7 @@ NativeDev(
WCHAR *nativePart;
const char *fullPath;
- GetFullPathName(nativePath, MAX_PATH, nativeFullPath, &nativePart);
+ GetFullPathNameW(nativePath, MAX_PATH, nativeFullPath, &nativePart);
Tcl_DStringInit(&ds);
fullPath = Tcl_WCharToUtfDString(nativeFullPath, -1, &ds);
@@ -2219,11 +2219,11 @@ NativeDev(
Tcl_DStringInit(&volString);
nativeVol = Tcl_UtfToWCharDString(fullPath, p - fullPath, &volString);
dw = (DWORD) -1;
- GetVolumeInformation(nativeVol, NULL, 0, &dw, NULL, NULL, NULL, 0);
+ GetVolumeInformationW(nativeVol, NULL, 0, &dw, NULL, NULL, NULL, 0);
/*
- * GetFullPathName() turns special devices like "NUL" into "\\.\NUL",
- * but GetVolumeInformation() returns failure for "\\.\NUL". This will
+ * GetFullPathNameW() turns special devices like "NUL" into "\\.\NUL",
+ * but GetVolumeInformationW() returns failure for "\\.\NUL". This will
* cause "NUL" to get a drive number of -1, which makes about as much
* sense as anything since the special devices don't live on any
* drive.
@@ -2365,7 +2365,7 @@ TclpGetNativeCwd(
{
WCHAR buffer[MAX_PATH];
- if (GetCurrentDirectory(MAX_PATH, buffer) == 0) {
+ if (GetCurrentDirectoryW(MAX_PATH, buffer) == 0) {
TclWinConvertError(GetLastError());
return NULL;
}
@@ -2481,13 +2481,13 @@ TclpFilesystemPathType(
firstSeparator = strchr(path, '/');
if (firstSeparator == NULL) {
- found = GetVolumeInformation(Tcl_FSGetNativePath(pathPtr),
+ found = GetVolumeInformationW(Tcl_FSGetNativePath(pathPtr),
NULL, 0, NULL, NULL, NULL, volType, VOL_BUF_SIZE);
} else {
Tcl_Obj *driveName = Tcl_NewStringObj(path, firstSeparator - path+1);
Tcl_IncrRefCount(driveName);
- found = GetVolumeInformation(Tcl_FSGetNativePath(driveName),
+ found = GetVolumeInformationW(Tcl_FSGetNativePath(driveName),
NULL, 0, NULL, NULL, NULL, volType, VOL_BUF_SIZE);
Tcl_DecrRefCount(driveName);
}
@@ -2574,7 +2574,7 @@ TclpObjNormalizePath(
nativePath = Tcl_UtfToWCharDString(path,
currentPathEndPosition - path, &ds);
- if (GetFileAttributesEx(nativePath,
+ if (GetFileAttributesExW(nativePath,
GetFileExInfoStandard, &data) != TRUE) {
/*
* File doesn't exist.
@@ -3249,7 +3249,7 @@ TclpUtime(
native = Tcl_FSGetNativePath(pathPtr);
- attr = GetFileAttributes(native);
+ attr = GetFileAttributesW(native);
if (attr != INVALID_FILE_ATTRIBUTES && attr & FILE_ATTRIBUTE_DIRECTORY) {
flags = FILE_FLAG_BACKUP_SEMANTICS;
@@ -3260,7 +3260,7 @@ TclpUtime(
* savings complications that utime gets wrong.
*/
- fileHandle = CreateFile(native, FILE_WRITE_ATTRIBUTES, 0, NULL,
+ fileHandle = CreateFileW(native, FILE_WRITE_ATTRIBUTES, 0, NULL,
OPEN_EXISTING, flags, NULL);
if (fileHandle == INVALID_HANDLE_VALUE ||
@@ -3300,7 +3300,7 @@ TclWinFileOwned(
native = Tcl_FSGetNativePath(pathPtr);
- if (GetNamedSecurityInfo((LPTSTR) native, SE_FILE_OBJECT,
+ if (GetNamedSecurityInfoW((LPWSTR) native, SE_FILE_OBJECT,
OWNER_SECURITY_INFORMATION, &ownerSid, NULL, NULL, NULL,
&secd) != ERROR_SUCCESS) {
/*
diff --git a/win/tclWinInit.c b/win/tclWinInit.c
index 29ace66..0d37d1a 100644
--- a/win/tclWinInit.c
+++ b/win/tclWinInit.c
@@ -17,7 +17,7 @@
#include <lmcons.h>
/*
- * GetUserName() is found in advapi32.dll
+ * GetUserNameW() is found in advapi32.dll
*/
#ifdef _MSC_VER
# pragma comment(lib, "advapi32.lib")
@@ -113,7 +113,7 @@ static void AppendEnvironment(Tcl_Obj *listPtr, const char *lib);
*
* TclpInitPlatform --
*
- * Initialize all the platform-dependant things like signals,
+ * Initialize all the platform-dependent things like signals,
* floating-point error handling and sockets.
*
* Called at process initialization time.
@@ -149,13 +149,13 @@ TclpInitPlatform(void)
* invoked.
*/
- TclWinInit(GetModuleHandle(NULL));
+ TclWinInit(GetModuleHandleW(NULL));
#endif
/*
* Fill available functions depending on windows version
*/
- handle = GetModuleHandle(L"KERNEL32");
+ handle = GetModuleHandleW(L"KERNEL32");
tclWinProcs.cancelSynchronousIo =
(BOOL (WINAPI *)(HANDLE)) GetProcAddress(handle,
"CancelSynchronousIo");
@@ -297,7 +297,7 @@ AppendEnvironment(
Tcl_SplitPath(buf, &pathc, &pathv);
/*
- * The lstrcmpi() will work even if pathv[pathc-1] is random UTF-8
+ * The lstrcmpiA() will work even if pathv[pathc-1] is random UTF-8
* chars because I know shortlib is ascii.
*/
@@ -472,7 +472,7 @@ TclpGetUserName(
WCHAR szUserName[UNLEN+1];
DWORD cchUserNameLen = UNLEN;
- if (!GetUserName(szUserName, &cchUserNameLen)) {
+ if (!GetUserNameW(szUserName, &cchUserNameLen)) {
return NULL;
}
cchUserNameLen--;
@@ -517,7 +517,7 @@ TclpSetVariables(
TclGetProcessGlobalValue(&defaultLibraryDir), TCL_GLOBAL_ONLY);
if (!osInfoInitialized) {
- HMODULE handle = GetModuleHandle(L"NTDLL");
+ HMODULE handle = GetModuleHandleW(L"NTDLL");
int(__stdcall *getversion)(void *) =
(int(__stdcall *)(void *)) GetProcAddress(handle, "RtlGetVersion");
osInfo.dwOSVersionInfoSize = sizeof(OSVERSIONINFOW);
@@ -543,7 +543,7 @@ TclpSetVariables(
TCL_GLOBAL_ONLY);
}
-#ifdef _DEBUG
+#ifndef NDEBUG
/*
* The existence of the "debug" element of the tcl_platform array
* indicates that this particular Tcl shell has been compiled with debug
diff --git a/win/tclWinLoad.c b/win/tclWinLoad.c
index ae68956..b79a4ca 100644
--- a/win/tclWinLoad.c
+++ b/win/tclWinLoad.c
@@ -76,7 +76,7 @@ TclpDlopen(
nativeName = Tcl_FSGetNativePath(pathPtr);
if (nativeName != NULL) {
- hInstance = LoadLibraryEx(nativeName, NULL,
+ hInstance = LoadLibraryExW(nativeName, NULL,
LOAD_WITH_ALTERED_SEARCH_PATH);
}
if (hInstance == NULL) {
@@ -97,7 +97,7 @@ TclpDlopen(
Tcl_DStringInit(&ds);
nativeName = Tcl_UtfToWCharDString(Tcl_GetString(pathPtr), -1, &ds);
- hInstance = LoadLibraryEx(nativeName, NULL,
+ hInstance = LoadLibraryExW(nativeName, NULL,
LOAD_WITH_ALTERED_SEARCH_PATH);
Tcl_DStringFree(&ds);
}
diff --git a/win/tclWinNotify.c b/win/tclWinNotify.c
index dba7a31..2ab4efa 100644
--- a/win/tclWinNotify.c
+++ b/win/tclWinNotify.c
@@ -98,7 +98,7 @@ Tcl_InitNotifier(void)
EnterCriticalSection(&notifierMutex);
if (notifierCount == 0) {
- WNDCLASS clazz;
+ WNDCLASSW clazz;
clazz.style = 0;
clazz.cbClsExtra = 0;
@@ -111,7 +111,7 @@ Tcl_InitNotifier(void)
clazz.hIcon = NULL;
clazz.hCursor = NULL;
- if (!RegisterClass(&clazz)) {
+ if (!RegisterClassW(&clazz)) {
Tcl_Panic("Unable to register TclNotifier window class");
}
}
@@ -125,7 +125,7 @@ Tcl_InitNotifier(void)
tsdPtr->hwnd = NULL;
tsdPtr->thread = GetCurrentThreadId();
- tsdPtr->event = CreateEvent(NULL, TRUE /* manual */,
+ tsdPtr->event = CreateEventW(NULL, TRUE /* manual */,
FALSE /* !signaled */, NULL);
return tsdPtr;
@@ -195,7 +195,7 @@ Tcl_FinalizeNotifier(
if (notifierCount) {
notifierCount--;
if (notifierCount == 0) {
- UnregisterClass(className, TclWinGetTclInstance());
+ UnregisterClassW(className, TclWinGetTclInstance());
}
}
LeaveCriticalSection(&notifierMutex);
@@ -247,7 +247,7 @@ Tcl_AlertNotifier(
EnterCriticalSection(&tsdPtr->crit);
if (!tsdPtr->pending) {
- PostMessage(tsdPtr->hwnd, WM_WAKEUP, 0, 0);
+ PostMessageW(tsdPtr->hwnd, WM_WAKEUP, 0, 0);
}
tsdPtr->pending = 1;
LeaveCriticalSection(&tsdPtr->crit);
@@ -359,7 +359,7 @@ Tcl_ServiceModeHook(
*/
if (mode == TCL_SERVICE_ALL && !tsdPtr->hwnd) {
- tsdPtr->hwnd = CreateWindow(className, className,
+ tsdPtr->hwnd = CreateWindowW(className, className,
WS_TILED, 0, 0, 0, 0, NULL, NULL, TclWinGetTclInstance(),
NULL);
@@ -407,7 +407,7 @@ NotifierProc(
tsdPtr->pending = 0;
LeaveCriticalSection(&tsdPtr->crit);
} else if (message != WM_TIMER) {
- return DefWindowProc(hwnd, message, wParam, lParam);
+ return DefWindowProcW(hwnd, message, wParam, lParam);
}
/*
@@ -479,7 +479,7 @@ Tcl_WaitForEvent(
* events currently sitting in the queue.
*/
- if (!PeekMessage(&msg, NULL, 0, 0, PM_NOREMOVE)) {
+ if (!PeekMessageW(&msg, NULL, 0, 0, PM_NOREMOVE)) {
/*
* Wait for something to happen (a signal from another thread, a
* message, or timeout) or loop servicing asynchronous procedure
@@ -501,12 +501,12 @@ Tcl_WaitForEvent(
* Check to see if there are any messages to process.
*/
- if (PeekMessage(&msg, NULL, 0, 0, PM_NOREMOVE)) {
+ if (PeekMessageW(&msg, NULL, 0, 0, PM_NOREMOVE)) {
/*
* Retrieve and dispatch the first message.
*/
- result = GetMessage(&msg, NULL, 0, 0);
+ result = GetMessageW(&msg, NULL, 0, 0);
if (result == 0) {
/*
* We received a request to exit this thread (WM_QUIT), so
@@ -524,7 +524,7 @@ Tcl_WaitForEvent(
status = -1;
} else {
TranslateMessage(&msg);
- DispatchMessage(&msg);
+ DispatchMessageW(&msg);
status = 1;
}
} else {
diff --git a/win/tclWinPipe.c b/win/tclWinPipe.c
index 902e01c..23ede6e 100644
--- a/win/tclWinPipe.c
+++ b/win/tclWinPipe.c
@@ -466,14 +466,14 @@ TempFileName(
* gets stored. */
{
const WCHAR *prefix = L"TCL";
- if (GetTempPath(MAX_PATH, name) != 0) {
- if (GetTempFileName(name, prefix, 0, name) != 0) {
+ if (GetTempPathW(MAX_PATH, name) != 0) {
+ if (GetTempFileNameW(name, prefix, 0, name) != 0) {
return 1;
}
}
name[0] = '.';
name[1] = '\0';
- return GetTempFileName(name, prefix, 0, name);
+ return GetTempFileNameW(name, prefix, 0, name);
}
/*
@@ -586,7 +586,7 @@ TclpOpenFile(
flags = 0;
if (!(mode & O_CREAT)) {
- flags = GetFileAttributes(nativePath);
+ flags = GetFileAttributesW(nativePath);
if (flags == 0xFFFFFFFF) {
flags = 0;
}
@@ -602,7 +602,7 @@ TclpOpenFile(
* Now we get to create the file.
*/
- handle = CreateFile(nativePath, accessMode, shareMode,
+ handle = CreateFileW(nativePath, accessMode, shareMode,
NULL, createMode, flags, NULL);
Tcl_DStringFree(&ds);
@@ -659,7 +659,7 @@ TclpCreateTempFile(
return NULL;
}
- handle = CreateFile(name,
+ handle = CreateFileW(name,
GENERIC_READ | GENERIC_WRITE, 0, NULL, CREATE_ALWAYS,
FILE_ATTRIBUTE_TEMPORARY|FILE_FLAG_DELETE_ON_CLOSE, NULL);
if (handle == INVALID_HANDLE_VALUE) {
@@ -721,7 +721,7 @@ TclpCreateTempFile(
TclWinConvertError(GetLastError());
CloseHandle(handle);
- DeleteFile(name);
+ DeleteFileW(name);
return NULL;
}
@@ -937,7 +937,7 @@ TclpCreateProcess(
{
int result, applType, createFlags;
Tcl_DString cmdLine; /* Complete command line (WCHAR). */
- STARTUPINFO startInfo;
+ STARTUPINFOW startInfo;
PROCESS_INFORMATION procInfo;
SECURITY_ATTRIBUTES secAtts;
HANDLE hProcess, h, inputHandle, outputHandle, errorHandle;
@@ -1048,7 +1048,7 @@ TclpCreateProcess(
* sink.
*/
- startInfo.hStdOutput = CreateFile(L"NUL:", GENERIC_WRITE, 0,
+ startInfo.hStdOutput = CreateFileW(L"NUL:", GENERIC_WRITE, 0,
&secAtts, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
} else {
DuplicateHandle(hProcess, outputHandle, hProcess,
@@ -1068,7 +1068,7 @@ TclpCreateProcess(
* sink.
*/
- startInfo.hStdError = CreateFile(L"NUL:", GENERIC_WRITE, 0,
+ startInfo.hStdError = CreateFileW(L"NUL:", GENERIC_WRITE, 0,
&secAtts, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
} else {
DuplicateHandle(hProcess, errorHandle, hProcess, &startInfo.hStdError,
@@ -1134,7 +1134,7 @@ TclpCreateProcess(
BuildCommandLine(execPath, argc, argv, &cmdLine);
- if (CreateProcess(NULL, (WCHAR *) Tcl_DStringValue(&cmdLine),
+ if (CreateProcessW(NULL, (WCHAR *) Tcl_DStringValue(&cmdLine),
NULL, NULL, TRUE, (DWORD) createFlags, NULL, NULL, &startInfo,
&procInfo) == 0) {
TclWinConvertError(GetLastError());
@@ -1156,7 +1156,7 @@ TclpCreateProcess(
* will be created for each process but the previous instances may not be
* cleaned up. This results in a significant virtual memory loss each time
* the process is spawned. If there is a WaitForInputIdle() call between
- * CreateProcess() and CloseHandle(), the problem does not occur." PSS ID
+ * CreateProcessW() and CloseHandle(), the problem does not occur." PSS ID
* Number: Q124121
*/
@@ -1205,7 +1205,7 @@ HasConsole(void)
{
HANDLE handle;
- handle = CreateFileA("CONOUT$", GENERIC_WRITE, FILE_SHARE_WRITE,
+ handle = CreateFileW(L"CONOUT$", GENERIC_WRITE, FILE_SHARE_WRITE,
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
if (handle != INVALID_HANDLE_VALUE) {
@@ -1275,7 +1275,7 @@ ApplicationType(
* is, then try adding .com, .exe, .bat and .cmd, in that order, to the name,
* looking for an executable.
*
- * Using the raw SearchPath() function doesn't do quite what is necessary.
+ * Using the raw SearchPathW() function doesn't do quite what is necessary.
* If the name of the executable already contains a '.' character, it will
* not try appending the specified extension when searching (in other
* words, SearchPath will not find the program "a.b.exe" if the arguments
@@ -1294,7 +1294,7 @@ ApplicationType(
Tcl_DStringInit(&ds);
nativeName = Tcl_UtfToWCharDString(Tcl_DStringValue(&nameBuf),
Tcl_DStringLength(&nameBuf), &ds);
- found = SearchPath(NULL, nativeName, NULL, MAX_PATH,
+ found = SearchPathW(NULL, nativeName, NULL, MAX_PATH,
nativeFullPath, &rest);
Tcl_DStringFree(&ds);
if (found == 0) {
@@ -1306,7 +1306,7 @@ ApplicationType(
* known type.
*/
- attr = GetFileAttributes(nativeFullPath);
+ attr = GetFileAttributesW(nativeFullPath);
if ((attr == 0xffffffff) || (attr & FILE_ATTRIBUTE_DIRECTORY)) {
continue;
}
@@ -1321,7 +1321,7 @@ ApplicationType(
break;
}
- hFile = CreateFile(nativeFullPath,
+ hFile = CreateFileW(nativeFullPath,
GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING,
FILE_ATTRIBUTE_NORMAL, NULL);
if (hFile == INVALID_HANDLE_VALUE) {
@@ -1401,7 +1401,7 @@ ApplicationType(
* application name from the arguments.
*/
- GetShortPathName(nativeFullPath, nativeFullPath, MAX_PATH);
+ GetShortPathNameW(nativeFullPath, nativeFullPath, MAX_PATH);
Tcl_DStringInit(&ds);
strcpy(fullName, Tcl_WCharToUtfDString(nativeFullPath, -1, &ds));
Tcl_DStringFree(&ds);
@@ -1415,7 +1415,7 @@ ApplicationType(
* BuildCommandLine --
*
* The command line arguments are stored in linePtr separated by spaces,
- * in a form that CreateProcess() understands. Special characters in
+ * in a form that CreateProcessW() understands. Special characters in
* individual arguments from argv[] must be quoted when being stored in
* cmdLine.
*
@@ -1789,7 +1789,7 @@ TclpCreateCommandChannel(
* Start the background reader thread.
*/
- infoPtr->readable = CreateEvent(NULL, TRUE, TRUE, NULL);
+ infoPtr->readable = CreateEventW(NULL, TRUE, TRUE, NULL);
infoPtr->readThread = CreateThread(NULL, 256, PipeReaderThread,
TclPipeThreadCreateTI(&infoPtr->readTI, infoPtr, infoPtr->readable),
0, NULL);
@@ -1804,7 +1804,7 @@ TclpCreateCommandChannel(
* Start the background writer thread.
*/
- infoPtr->writable = CreateEvent(NULL, TRUE, TRUE, NULL);
+ infoPtr->writable = CreateEventW(NULL, TRUE, TRUE, NULL);
infoPtr->writeThread = CreateThread(NULL, 256, PipeWriterThread,
TclPipeThreadCreateTI(&infoPtr->writeTI, infoPtr, infoPtr->writable),
0, NULL);
@@ -3206,7 +3206,7 @@ TclpOpenTemporaryFile(
}
namePtr = (char *) name;
- length = GetTempPath(MAX_PATH, name);
+ length = GetTempPathW(MAX_PATH, name);
if (length == 0) {
goto gotError;
}
@@ -3241,7 +3241,7 @@ TclpOpenTemporaryFile(
memcpy(namePtr, Tcl_DStringValue(&buf), Tcl_DStringLength(&buf) + 1);
Tcl_DStringFree(&buf);
- handle = CreateFile(name,
+ handle = CreateFileW(name,
GENERIC_READ|GENERIC_WRITE, 0, NULL, CREATE_NEW, flags, NULL);
} while (handle == INVALID_HANDLE_VALUE
&& --counter2 > 0
@@ -3290,7 +3290,7 @@ TclPipeThreadCreateTI(
#else
pipeTI = ckalloc(sizeof(TclPipeThreadInfo));
#endif /* !_PTI_USE_CKALLOC */
- pipeTI->evControl = CreateEvent(NULL, FALSE, FALSE, NULL);
+ pipeTI->evControl = CreateEventW(NULL, FALSE, FALSE, NULL);
pipeTI->state = PTI_STATE_IDLE;
pipeTI->clientData = clientData;
pipeTI->evWakeUp = wakeEvent;
@@ -3437,6 +3437,7 @@ TclPipeThreadStopSignal(
SetEvent(evControl);
*pipeTIPtr = NULL;
+ /* FALLTHRU */
case PTI_STATE_DOWN:
return 1;
diff --git a/win/tclWinPort.h b/win/tclWinPort.h
index 3f8b546..35f183c 100644
--- a/win/tclWinPort.h
+++ b/win/tclWinPort.h
@@ -14,14 +14,10 @@
#ifndef _TCLWINPORT
#define _TCLWINPORT
-/* 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)
+#if !defined(_WIN64) && !defined(__MINGW_USE_VC2005_COMPAT)
/* See [Bug 3354324]: file mtime sets wrong time */
-# define _USE_32BIT_TIME_T
+# define __MINGW_USE_VC2005_COMPAT
#endif
/*
diff --git a/win/tclWinReg.c b/win/tclWinReg.c
index 73208b9..068e5d7 100644
--- a/win/tclWinReg.c
+++ b/win/tclWinReg.c
@@ -13,8 +13,6 @@
*/
#undef STATIC_BUILD
-#undef TCL_UTF_MAX
-#define TCL_UTF_MAX 3
#ifndef USE_TCL_STUBS
# define USE_TCL_STUBS
#endif
@@ -96,7 +94,7 @@ static void AppendSystemError(Tcl_Interp *interp, DWORD error);
static int BroadcastValue(Tcl_Interp *interp, int objc,
Tcl_Obj *const objv[]);
static DWORD ConvertDWORD(DWORD type, DWORD value);
-static void DeleteCmd(ClientData clientData);
+static void DeleteCmd(void *clientData);
static int DeleteKey(Tcl_Interp *interp, Tcl_Obj *keyNameObj,
REGSAM mode);
static int DeleteValue(Tcl_Interp *interp, Tcl_Obj *keyNameObj,
@@ -119,7 +117,7 @@ static int ParseKeyName(Tcl_Interp *interp, char *name,
char **keyNamePtr);
static DWORD RecursiveDeleteKey(HKEY hStartKey,
const WCHAR * pKeyName, REGSAM mode);
-static int RegistryObjCmd(ClientData clientData,
+static int RegistryObjCmd(void *clientData,
Tcl_Interp *interp, int objc,
Tcl_Obj *const objv[]);
static int SetValue(Tcl_Interp *interp, Tcl_Obj *keyNameObj,
@@ -127,8 +125,13 @@ static int SetValue(Tcl_Interp *interp, Tcl_Obj *keyNameObj,
Tcl_Obj *typeObj, REGSAM mode);
#if (TCL_MAJOR_VERSION < 9) && (TCL_MINOR_VERSION < 7)
+# if TCL_UTF_MAX > 3
+# define Tcl_WCharToUtfDString(a,b,c) Tcl_WinTCharToUtf(a,(b)*sizeof(WCHAR),c)
+# define Tcl_UtfToWCharDString(a,b,c) Tcl_WinUtfToTChar(a,b,c)
+# else
# define Tcl_WCharToUtfDString Tcl_UniCharToUtfDString
# define Tcl_UtfToWCharDString Tcl_UtfToUniCharDString
+# endif
#endif
static unsigned char *
@@ -188,7 +191,7 @@ Registry_Init(
cmd = Tcl_CreateObjCommand(interp, "registry", RegistryObjCmd,
interp, DeleteCmd);
Tcl_SetAssocData(interp, REGISTRY_ASSOC_KEY, NULL, cmd);
- return Tcl_PkgProvide(interp, "registry", "1.3.3");
+ return Tcl_PkgProvideEx(interp, "registry", "1.3.3", NULL);
}
/*
@@ -214,6 +217,7 @@ Registry_Unload(
{
Tcl_Command cmd;
Tcl_Obj *objv[3];
+ (void)flags;
/*
* Unregister the registry package. There is no Tcl_PkgForget()
@@ -255,7 +259,7 @@ Registry_Unload(
static void
DeleteCmd(
- ClientData clientData)
+ void *clientData)
{
Tcl_Interp *interp = (Tcl_Interp *)clientData;
@@ -280,7 +284,7 @@ DeleteCmd(
static int
RegistryObjCmd(
- ClientData clientData, /* Not used. */
+ void *dummy, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument values. */
@@ -299,6 +303,7 @@ RegistryObjCmd(
static const char *const modes[] = {
"-32bit", "-64bit", NULL
};
+ (void)dummy;
if (objc < 2) {
wrongArgs:
@@ -540,7 +545,7 @@ DeleteValue(
valueName = Tcl_GetString(valueNameObj);
Tcl_DStringInit(&ds);
Tcl_UtfToWCharDString(valueName, valueNameObj->length, &ds);
- result = RegDeleteValue(key, (const WCHAR *)Tcl_DStringValue(&ds));
+ result = RegDeleteValueW(key, (const WCHAR *)Tcl_DStringValue(&ds));
Tcl_DStringFree(&ds);
if (result != ERROR_SUCCESS) {
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
@@ -614,7 +619,7 @@ GetKeyNames(
resultPtr = Tcl_NewObj();
for (index = 0;; ++index) {
bufSize = MAX_KEY_LENGTH;
- result = RegEnumKeyEx(key, index, buffer, &bufSize,
+ result = RegEnumKeyExW(key, index, buffer, &bufSize,
NULL, NULL, NULL, NULL);
if (result != ERROR_SUCCESS) {
if (result == ERROR_NO_MORE_ITEMS) {
@@ -697,7 +702,7 @@ GetType(
valueName = Tcl_GetString(valueNameObj);
Tcl_DStringInit(&ds);
nativeValue = Tcl_UtfToWCharDString(valueName, valueNameObj->length, &ds);
- result = RegQueryValueEx(key, nativeValue, NULL, &type,
+ result = RegQueryValueExW(key, nativeValue, NULL, &type,
NULL, NULL);
Tcl_DStringFree(&ds);
RegCloseKey(key);
@@ -780,7 +785,7 @@ GetValue(
Tcl_DStringInit(&buf);
nativeValue = Tcl_UtfToWCharDString(valueName, valueNameObj->length, &buf);
- result = RegQueryValueEx(key, nativeValue, NULL, &type,
+ result = RegQueryValueExW(key, nativeValue, NULL, &type,
(BYTE *) Tcl_DStringValue(&data), &length);
while (result == ERROR_MORE_DATA) {
/*
@@ -791,7 +796,7 @@ GetValue(
length = Tcl_DStringLength(&data) * (2 / sizeof(WCHAR));
Tcl_DStringSetLength(&data, (int) length * sizeof(WCHAR));
- result = RegQueryValueEx(key, nativeValue,
+ result = RegQueryValueExW(key, nativeValue,
NULL, &type, (BYTE *) Tcl_DStringValue(&data), &length);
}
Tcl_DStringFree(&buf);
@@ -917,7 +922,7 @@ GetValueNames(
*/
size = MAX_KEY_LENGTH;
- while (RegEnumValue(key,index, (WCHAR *)Tcl_DStringValue(&buffer),
+ while (RegEnumValueW(key,index, (WCHAR *)Tcl_DStringValue(&buffer),
&size, NULL, NULL, NULL, NULL) == ERROR_SUCCESS) {
Tcl_DStringInit(&ds);
@@ -1029,7 +1034,7 @@ OpenSubKey(
if (hostName) {
Tcl_DStringInit(&buf);
hostName = (char *) Tcl_UtfToWCharDString(hostName, -1, &buf);
- result = RegConnectRegistry((WCHAR *)hostName, rootKey,
+ result = RegConnectRegistryW((WCHAR *)hostName, rootKey,
&rootKey);
Tcl_DStringFree(&buf);
if (result != ERROR_SUCCESS) {
@@ -1049,7 +1054,7 @@ OpenSubKey(
if (flags & REG_CREATE) {
DWORD create;
- result = RegCreateKeyEx(rootKey, (WCHAR *)keyName, 0, NULL,
+ result = RegCreateKeyExW(rootKey, (WCHAR *)keyName, 0, NULL,
REG_OPTION_NON_VOLATILE, mode, NULL, keyPtr, &create);
} else if (rootKey == HKEY_PERFORMANCE_DATA) {
/*
@@ -1060,7 +1065,7 @@ OpenSubKey(
*keyPtr = HKEY_PERFORMANCE_DATA;
result = ERROR_SUCCESS;
} else {
- result = RegOpenKeyEx(rootKey, (WCHAR *)keyName, 0, mode,
+ result = RegOpenKeyExW(rootKey, (WCHAR *)keyName, 0, mode,
keyPtr);
}
if (keyName) {
@@ -1200,7 +1205,7 @@ RecursiveDeleteKey(
}
mode |= KEY_ENUMERATE_SUB_KEYS | DELETE | KEY_QUERY_VALUE;
- result = RegOpenKeyEx(startKey, keyName, 0, mode, &hKey);
+ result = RegOpenKeyExW(startKey, keyName, 0, mode, &hKey);
if (result != ERROR_SUCCESS) {
return result;
}
@@ -1215,7 +1220,7 @@ RecursiveDeleteKey(
*/
size = MAX_KEY_LENGTH;
- result = RegEnumKeyEx(hKey, 0, (WCHAR *)Tcl_DStringValue(&subkey),
+ result = RegEnumKeyExW(hKey, 0, (WCHAR *)Tcl_DStringValue(&subkey),
&size, NULL, NULL, NULL, NULL);
if (result == ERROR_NO_MORE_ITEMS) {
/*
@@ -1228,14 +1233,14 @@ RecursiveDeleteKey(
HMODULE handle;
checkExProc = 1;
- handle = GetModuleHandle(TEXT("ADVAPI32"));
+ handle = GetModuleHandleW(L"ADVAPI32");
regDeleteKeyExProc = (LSTATUS (*) (HKEY, LPCWSTR, REGSAM, DWORD))
GetProcAddress(handle, "RegDeleteKeyExW");
}
if (mode && regDeleteKeyExProc) {
result = regDeleteKeyExProc(startKey, keyName, mode, 0);
} else {
- result = RegDeleteKey(startKey, keyName);
+ result = RegDeleteKeyW(startKey, keyName);
}
break;
} else if (result == ERROR_SUCCESS) {
@@ -1309,7 +1314,7 @@ SetValue(
}
value = ConvertDWORD((DWORD) type, (DWORD) value);
- result = RegSetValueEx(key, (WCHAR *) valueName, 0,
+ result = RegSetValueExW(key, (WCHAR *) valueName, 0,
(DWORD) type, (BYTE *) &value, sizeof(DWORD));
} else if (type == REG_MULTI_SZ) {
Tcl_DString data, buf;
@@ -1344,7 +1349,7 @@ SetValue(
Tcl_DStringInit(&buf);
Tcl_UtfToWCharDString(Tcl_DStringValue(&data), Tcl_DStringLength(&data)+1,
&buf);
- result = RegSetValueEx(key, (WCHAR *) valueName, 0,
+ result = RegSetValueExW(key, (WCHAR *) valueName, 0,
(DWORD) type, (BYTE *) Tcl_DStringValue(&buf),
(DWORD) Tcl_DStringLength(&buf));
Tcl_DStringFree(&data);
@@ -1362,7 +1367,7 @@ SetValue(
Tcl_DStringSetLength(&buf, Tcl_DStringLength(&buf)+1);
- result = RegSetValueEx(key, (WCHAR *) valueName, 0,
+ result = RegSetValueExW(key, (WCHAR *) valueName, 0,
(DWORD) type, (BYTE *) data, (DWORD) Tcl_DStringLength(&buf) + 1);
Tcl_DStringFree(&buf);
} else {
@@ -1374,7 +1379,7 @@ SetValue(
*/
data = (BYTE *) getByteArrayFromObj(dataObj, &bytelength);
- result = RegSetValueEx(key, (WCHAR *) valueName, 0,
+ result = RegSetValueExW(key, (WCHAR *) valueName, 0,
(DWORD) type, data, (DWORD) bytelength);
}
@@ -1444,7 +1449,7 @@ BroadcastValue(
* Use the ignore the result.
*/
- result = SendMessageTimeout(HWND_BROADCAST, WM_SETTINGCHANGE,
+ result = SendMessageTimeoutW(HWND_BROADCAST, WM_SETTINGCHANGE,
(WPARAM) 0, (LPARAM) wstr, SMTO_ABORTIFHUNG, (UINT) timeout, &sendResult);
Tcl_DStringFree(&ds);
@@ -1488,7 +1493,7 @@ AppendSystemError(
if (Tcl_IsShared(resultPtr)) {
resultPtr = Tcl_DuplicateObj(resultPtr);
}
- length = FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM
+ length = FormatMessageW(FORMAT_MESSAGE_FROM_SYSTEM
| FORMAT_MESSAGE_ALLOCATE_BUFFER, NULL, error,
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (WCHAR *) tMsgPtrPtr,
0, NULL);
diff --git a/win/tclWinSerial.c b/win/tclWinSerial.c
index d6fa567..65af10f 100644
--- a/win/tclWinSerial.c
+++ b/win/tclWinSerial.c
@@ -1291,7 +1291,7 @@ SerialWriterThread(
buf = infoPtr->writeBuf;
toWrite = infoPtr->toWrite;
- myWrite.hEvent = CreateEvent(NULL, TRUE, FALSE, NULL);
+ myWrite.hEvent = CreateEventW(NULL, TRUE, FALSE, NULL);
/*
* Loop until all of the bytes are written or an error occurs.
@@ -1403,7 +1403,7 @@ TclWinSerialOpen(
* If an open channel is specified, close it
*/
- if ( handle != INVALID_HANDLE_VALUE && CloseHandle(handle) == FALSE) {
+ if (handle != INVALID_HANDLE_VALUE && CloseHandle(handle) == FALSE) {
return INVALID_HANDLE_VALUE;
}
@@ -1413,7 +1413,7 @@ TclWinSerialOpen(
* finished
*/
- handle = CreateFile(name, access, 0, 0, OPEN_EXISTING,
+ handle = CreateFileW(name, access, 0, 0, OPEN_EXISTING,
FILE_FLAG_OVERLAPPED, 0);
return handle;
@@ -1486,15 +1486,15 @@ TclWinOpenSerialChannel(
InitializeCriticalSection(&infoPtr->csWrite);
if (permissions & TCL_READABLE) {
- infoPtr->osRead.hEvent = CreateEvent(NULL, TRUE, FALSE, NULL);
+ infoPtr->osRead.hEvent = CreateEventW(NULL, TRUE, FALSE, NULL);
}
if (permissions & TCL_WRITABLE) {
/*
* Initially the channel is writable and the writeThread is idle.
*/
- infoPtr->osWrite.hEvent = CreateEvent(NULL, TRUE, FALSE, NULL);
- infoPtr->evWritable = CreateEvent(NULL, TRUE, TRUE, NULL);
+ infoPtr->osWrite.hEvent = CreateEventW(NULL, TRUE, FALSE, NULL);
+ infoPtr->evWritable = CreateEventW(NULL, TRUE, TRUE, NULL);
infoPtr->writeThread = CreateThread(NULL, 256, SerialWriterThread,
TclPipeThreadCreateTI(&infoPtr->writeTI, infoPtr,
infoPtr->evWritable), 0, NULL);
@@ -1671,7 +1671,7 @@ SerialSetOptionProc(
}
Tcl_DStringInit(&ds);
native = Tcl_UtfToWCharDString(value, -1, &ds);
- result = BuildCommDCB(native, &dcb);
+ result = BuildCommDCBW(native, &dcb);
Tcl_DStringFree(&ds);
if (result == FALSE) {
diff --git a/win/tclWinSock.c b/win/tclWinSock.c
index e483eb4..61af337 100644
--- a/win/tclWinSock.c
+++ b/win/tclWinSock.c
@@ -235,7 +235,7 @@ typedef struct {
} ThreadSpecificData;
static Tcl_ThreadDataKey dataKey;
-static WNDCLASS windowClass;
+static WNDCLASSW windowClass;
/*
* Static routines for this file:
@@ -363,17 +363,17 @@ InitializeHostName(
unsigned int *lengthPtr,
Tcl_Encoding *encodingPtr)
{
- WCHAR tbuf[MAX_COMPUTERNAME_LENGTH + 1];
+ WCHAR wbuf[MAX_COMPUTERNAME_LENGTH + 1];
DWORD length = MAX_COMPUTERNAME_LENGTH + 1;
Tcl_DString ds;
Tcl_DStringInit(&ds);
- if (GetComputerName(tbuf, &length) != 0) {
+ if (GetComputerNameW(wbuf, &length) != 0) {
/*
* Convert string from native to UTF then change to lowercase.
*/
- Tcl_UtfToLower(Tcl_WCharToUtfDString(tbuf, -1, &ds));
+ Tcl_UtfToLower(Tcl_WCharToUtfDString(wbuf, -1, &ds));
} else {
if (TclpHasSockets(NULL) == TCL_OK) {
@@ -2504,7 +2504,7 @@ InitSockets(void)
windowClass.hIcon = NULL;
windowClass.hCursor = NULL;
- if (!RegisterClass(&windowClass)) {
+ if (!RegisterClassW(&windowClass)) {
TclWinConvertError(GetLastError());
goto initFailure;
}
@@ -2629,7 +2629,7 @@ SocketExitHandler(
*/
TclpFinalizeSockets();
- UnregisterClass(className, TclWinGetTclInstance());
+ UnregisterClassW(className, TclWinGetTclInstance());
initialized = 0;
Tcl_MutexUnlock(&socketMutex);
}
@@ -3176,7 +3176,7 @@ SocketThread(
* Create a dummy window receiving socket events.
*/
- tsdPtr->hwnd = CreateWindow(className, className, WS_TILED, 0, 0, 0, 0,
+ tsdPtr->hwnd = CreateWindowW(className, className, WS_TILED, 0, 0, 0, 0,
NULL, NULL, windowClass.hInstance, arg);
/*
@@ -3199,8 +3199,8 @@ SocketThread(
* PostMessage(SOCKET_TERMINATE) in TclpFinalizeSockets().
*/
- while (GetMessage(&msg, NULL, 0, 0) > 0) {
- DispatchMessage(&msg);
+ while (GetMessageW(&msg, NULL, 0, 0) > 0) {
+ DispatchMessageW(&msg);
}
/*
@@ -3245,14 +3245,14 @@ SocketProc(
TcpFdList *fds = NULL;
ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
#ifdef _WIN64
- GetWindowLongPtr(hwnd, GWLP_USERDATA);
+ GetWindowLongPtrW(hwnd, GWLP_USERDATA);
#else
- GetWindowLong(hwnd, GWL_USERDATA);
+ GetWindowLongW(hwnd, GWL_USERDATA);
#endif
switch (message) {
default:
- return DefWindowProc(hwnd, message, wParam, lParam);
+ return DefWindowProcW(hwnd, message, wParam, lParam);
break;
case WM_CREATE:
@@ -3265,7 +3265,7 @@ SocketProc(
SetWindowLongPtr(hwnd, GWLP_USERDATA,
(LONG_PTR) ((LPCREATESTRUCT)lParam)->lpCreateParams);
#else
- SetWindowLong(hwnd, GWL_USERDATA,
+ SetWindowLongW(hwnd, GWL_USERDATA,
(LONG) ((LPCREATESTRUCT)lParam)->lpCreateParams);
#endif
break;
diff --git a/win/tclWinTest.c b/win/tclWinTest.c
index c06f10a..cd0e07f 100644
--- a/win/tclWinTest.c
+++ b/win/tclWinTest.c
@@ -139,7 +139,7 @@ TesteventloopCmd(
while (!done) {
MSG msg;
- if (!GetMessage(&msg, NULL, 0, 0)) {
+ if (!GetMessageW(&msg, NULL, 0, 0)) {
/*
* The application is exiting, so repost the quit message and
* start unwinding.
@@ -149,7 +149,7 @@ TesteventloopCmd(
break;
}
TranslateMessage(&msg);
- DispatchMessage(&msg);
+ DispatchMessageW(&msg);
}
(void) Tcl_SetServiceMode(oldMode);
framePtr = oldFramePtr;
@@ -327,9 +327,14 @@ TestSizeCmd(
Tcl_SetObjResult(interp, Tcl_NewWideIntObj(sizeof(time_t)));
return TCL_OK;
}
+ if (strcmp(Tcl_GetString(objv[1]), "st_mtime") == 0) {
+ Tcl_StatBuf *statPtr;
+ Tcl_SetObjResult(interp, Tcl_NewWideIntObj(sizeof(statPtr->st_mtime)));
+ return TCL_OK;
+ }
syntax:
- Tcl_WrongNumArgs(interp, 1, objv, "time_t");
+ Tcl_WrongNumArgs(interp, 1, objv, "time_t|st_mtime");
return TCL_ERROR;
}
diff --git a/win/tclWinThrd.c b/win/tclWinThrd.c
index d169ebb..d649310 100644
--- a/win/tclWinThrd.c
+++ b/win/tclWinThrd.c
@@ -682,7 +682,7 @@ Tcl_ConditionWait(
*/
if (tsdPtr->flags == WIN_THREAD_UNINIT) {
- tsdPtr->condEvent = CreateEvent(NULL, TRUE /* manual reset */,
+ tsdPtr->condEvent = CreateEventW(NULL, TRUE /* manual reset */,
FALSE /* non signaled */, NULL);
tsdPtr->nextPtr = NULL;
tsdPtr->prevPtr = NULL;
diff --git a/win/tclWinTime.c b/win/tclWinTime.c
index f103a4f..f18d63e 100644
--- a/win/tclWinTime.c
+++ b/win/tclWinTime.c
@@ -198,7 +198,7 @@ TclpGetSeconds(void)
* This procedure returns a value that represents the highest resolution
* clock available on the system. There are no guarantees on what the
* resolution will be. In Tcl we will call this value a "click". The
- * start time is also system dependant.
+ * start time is also system dependent.
*
* Results:
* Number of clicks from some start time.
@@ -548,8 +548,8 @@ NativeGetMicroseconds(void)
DWORD id;
InitializeCriticalSection(&timeInfo.cs);
- timeInfo.readyEvent = CreateEvent(NULL, FALSE, FALSE, NULL);
- timeInfo.exitEvent = CreateEvent(NULL, FALSE, FALSE, NULL);
+ timeInfo.readyEvent = CreateEventW(NULL, FALSE, FALSE, NULL);
+ timeInfo.exitEvent = CreateEventW(NULL, FALSE, FALSE, NULL);
timeInfo.calibrationThread = CreateThread(NULL, 256,
CalibrationThread, (LPVOID) NULL, 0, &id);
SetThreadPriority(timeInfo.calibrationThread,
@@ -734,6 +734,11 @@ TclpGetDate(
{
struct tm *tmPtr;
time_t time;
+#if defined(_WIN64) || (defined(_USE_64BIT_TIME_T) || (defined(_MSC_VER) && _MSC_VER < 1400))
+# define t2 *t /* no need to cripple time to 32-bit */
+#else
+ time_t t2 = *(__time32_t *)t;
+#endif
if (!useGMT) {
#if defined(_MSC_VER) && (_MSC_VER >= 1900)
@@ -766,15 +771,15 @@ TclpGetDate(
#define LOCALTIME_VALIDITY_BOUNDARY 0
#endif
- if (*t >= LOCALTIME_VALIDITY_BOUNDARY) {
- return TclpLocaltime(t);
+ if (t2 >= LOCALTIME_VALIDITY_BOUNDARY) {
+ return TclpLocaltime(&t2);
}
#if defined(_MSC_VER) && (_MSC_VER >= 1900)
_get_timezone(&timezone);
#endif
- time = *t - timezone;
+ time = t2 - timezone;
/*
* If we aren't near to overflowing the long, just add the bias and
@@ -782,10 +787,10 @@ TclpGetDate(
* result at the end.
*/
- if (*t < (LONG_MAX - 2*SECSPERDAY) && *t > (LONG_MIN + 2*SECSPERDAY)) {
+ if (t2 < (LONG_MAX - 2*SECSPERDAY) && t2 > (LONG_MIN + 2*SECSPERDAY)) {
tmPtr = ComputeGMT(&time);
} else {
- tmPtr = ComputeGMT(t);
+ tmPtr = ComputeGMT(&t2);
tzset();
@@ -821,7 +826,7 @@ TclpGetDate(
tmPtr->tm_wday = (tmPtr->tm_wday + (int)time) % 7;
}
} else {
- tmPtr = ComputeGMT(t);
+ tmPtr = ComputeGMT(&t2);
}
return tmPtr;
}
@@ -1357,7 +1362,11 @@ TclpGmtime(
* Posix gmtime_r function.
*/
+#if defined(_WIN64) || defined(_USE_64BIT_TIME_T) || (defined(_MSC_VER) && _MSC_VER < 1400)
return gmtime(timePtr);
+#else
+ return _gmtime32((CONST __time32_t *)timePtr);
+#endif
}
/*
@@ -1388,7 +1397,11 @@ TclpLocaltime(
* provide a Posix localtime_r function.
*/
+#if defined(_WIN64) || defined(_USE_64BIT_TIME_T) || (defined(_MSC_VER) && _MSC_VER < 1400)
return localtime(timePtr);
+#else
+ return _localtime32((CONST __time32_t *)timePtr);
+#endif
}
#endif /* TCL_NO_DEPRECATED */