summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2021-12-08 12:11:53 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2021-12-08 12:11:53 (GMT)
commit09eba46041d7f007059b0defea8622a9dba1651b (patch)
treecd4efe19efd8e7dbcf0ebd204410eef80a836725
parent00fc9b5939930c7993d830310e41b3fee2d930ca (diff)
parentdc62ebb08b7bee1ff2cac7fdf8d35237bed15e7b (diff)
downloadtcl-09eba46041d7f007059b0defea8622a9dba1651b.zip
tcl-09eba46041d7f007059b0defea8622a9dba1651b.tar.gz
tcl-09eba46041d7f007059b0defea8622a9dba1651b.tar.bz2
Merge 8.7
-rw-r--r--.github/workflows/win-build.yml2
-rw-r--r--changes307
-rw-r--r--doc/ByteArrObj.3201
-rw-r--r--doc/Class.315
-rw-r--r--doc/FindExec.35
-rw-r--r--doc/InitSubSyst.37
-rw-r--r--doc/Panic.35
-rw-r--r--doc/binary.n2
-rw-r--r--doc/msgcat.n4
-rw-r--r--doc/zipfs.312
-rw-r--r--generic/tcl.decls42
-rw-r--r--generic/tcl.h18
-rw-r--r--generic/tclAssembly.c10
-rw-r--r--generic/tclBasic.c129
-rw-r--r--generic/tclBinary.c339
-rw-r--r--generic/tclCkalloc.c2
-rw-r--r--generic/tclClock.c2
-rw-r--r--generic/tclCmdMZ.c20
-rw-r--r--generic/tclCompCmds.c6
-rw-r--r--generic/tclCompExpr.c10
-rw-r--r--generic/tclCompile.c381
-rw-r--r--generic/tclCompile.h36
-rw-r--r--generic/tclDecls.h110
-rw-r--r--generic/tclDictObj.c59
-rw-r--r--generic/tclDisassemble.c32
-rw-r--r--generic/tclEncoding.c323
-rw-r--r--generic/tclEnsemble.c24
-rw-r--r--generic/tclEvent.c88
-rw-r--r--generic/tclExecute.c52
-rw-r--r--generic/tclGet.c4
-rw-r--r--generic/tclIO.c54
-rw-r--r--generic/tclIndexObj.c32
-rw-r--r--generic/tclInt.decls5
-rw-r--r--generic/tclInt.h43
-rw-r--r--generic/tclIntDecls.h10
-rw-r--r--generic/tclLink.c6
-rw-r--r--generic/tclListObj.c140
-rw-r--r--generic/tclLiteral.c6
-rw-r--r--generic/tclNamesp.c30
-rw-r--r--generic/tclOO.c20
-rw-r--r--generic/tclOO.decls5
-rw-r--r--generic/tclOOCall.c14
-rw-r--r--generic/tclOODecls.h19
-rw-r--r--generic/tclOOMethod.c4
-rw-r--r--generic/tclOOStubInit.c6
-rw-r--r--generic/tclObj.c107
-rw-r--r--generic/tclPanic.c5
-rw-r--r--generic/tclPathObj.c38
-rw-r--r--generic/tclPkg.c6
-rw-r--r--generic/tclPkgConfig.c2
-rw-r--r--generic/tclProc.c74
-rw-r--r--generic/tclRegexp.c22
-rw-r--r--generic/tclResult.c4
-rw-r--r--generic/tclScan.c4
-rw-r--r--generic/tclStrToD.c95
-rw-r--r--generic/tclStringObj.c28
-rw-r--r--generic/tclStubInit.c13
-rw-r--r--generic/tclTest.c82
-rw-r--r--generic/tclUtil.c22
-rw-r--r--generic/tclVar.c58
-rw-r--r--generic/tclZipfs.c58
-rw-r--r--generic/tclZlib.c2
-rw-r--r--library/manifest.txt2
-rw-r--r--library/platform/pkgIndex.tcl2
-rw-r--r--library/platform/platform.tcl13
-rw-r--r--library/tzdata/Africa/Accra67
-rw-r--r--library/tzdata/America/Anguilla6
-rw-r--r--library/tzdata/America/Antigua6
-rw-r--r--library/tzdata/America/Aruba6
-rw-r--r--library/tzdata/America/Atikokan13
-rw-r--r--library/tzdata/America/Barbados11
-rw-r--r--library/tzdata/America/Blanc-Sablon13
-rw-r--r--library/tzdata/America/Coral_Harbour6
-rw-r--r--library/tzdata/America/Creston9
-rw-r--r--library/tzdata/America/Curacao8
-rw-r--r--library/tzdata/America/Dominica6
-rw-r--r--library/tzdata/America/Grenada6
-rw-r--r--library/tzdata/America/Guadeloupe6
-rw-r--r--library/tzdata/America/Guyana9
-rw-r--r--library/tzdata/America/Kralendijk6
-rw-r--r--library/tzdata/America/Lower_Princes6
-rw-r--r--library/tzdata/America/Marigot6
-rw-r--r--library/tzdata/America/Montserrat6
-rw-r--r--library/tzdata/America/Nassau285
-rw-r--r--library/tzdata/America/Port_of_Spain7
-rw-r--r--library/tzdata/America/St_Barthelemy6
-rw-r--r--library/tzdata/America/St_Kitts6
-rw-r--r--library/tzdata/America/St_Lucia6
-rw-r--r--library/tzdata/America/St_Thomas6
-rw-r--r--library/tzdata/America/St_Vincent6
-rw-r--r--library/tzdata/America/Tortola6
-rw-r--r--library/tzdata/America/Virgin6
-rw-r--r--library/tzdata/Antarctica/DumontDUrville9
-rw-r--r--library/tzdata/Antarctica/Syowa7
-rw-r--r--library/tzdata/Asia/Amman156
-rw-r--r--library/tzdata/Asia/Gaza158
-rw-r--r--library/tzdata/Asia/Hebron158
-rw-r--r--library/tzdata/Atlantic/Azores2
-rw-r--r--library/tzdata/Atlantic/Madeira2
-rw-r--r--library/tzdata/Europe/Lisbon2
-rw-r--r--library/tzdata/Pacific/Apia157
-rw-r--r--library/tzdata/Pacific/Enderbury9
-rw-r--r--library/tzdata/Pacific/Fiji2
-rw-r--r--library/tzdata/Pacific/Kanton8
-rw-r--r--library/tzdata/Pacific/Niue5
-rw-r--r--library/tzdata/Pacific/Rarotonga5
-rw-r--r--library/tzdata/Pacific/Tongatapu6
-rw-r--r--macosx/tclMacOSXFCmd.c4
-rw-r--r--tests/async.test2
-rw-r--r--tests/cmdIL.test2
-rw-r--r--tests/compile.test2
-rw-r--r--tests/config.test2
-rw-r--r--tests/encoding.test24
-rw-r--r--tests/fCmd.test10
-rw-r--r--tests/format.test8
-rw-r--r--tests/info.test2
-rw-r--r--tests/io.test2
-rw-r--r--tests/lset.test2
-rw-r--r--tests/proc.test9
-rw-r--r--tests/regexp.test3
-rw-r--r--tests/regexpComp.test2
-rw-r--r--tests/socket.test1
-rw-r--r--tests/string.test2
-rw-r--r--tests/stringObj.test2
-rw-r--r--tests/tcltest.test4
-rw-r--r--tests/tcltests.tcl26
-rw-r--r--tests/var.test2
-rw-r--r--tests/winDde.test2
-rw-r--r--tests/winFCmd.test2
-rw-r--r--unix/Makefile.in29
-rwxr-xr-xunix/configure50
-rw-r--r--unix/configure.ac1
-rw-r--r--unix/tcl.m456
-rw-r--r--unix/tclConfig.h.in6
-rw-r--r--win/Makefile.in30
-rw-r--r--win/README6
-rwxr-xr-xwin/configure35
-rw-r--r--win/gitmanifest.in1
-rw-r--r--win/makefile.vc15
-rw-r--r--win/svnmanifest.in1
-rw-r--r--win/tcl.m413
-rw-r--r--win/tclUuid.h.in1
-rw-r--r--win/tclWinInit.c3
-rw-r--r--win/tclsh.exe.manifest.in4
144 files changed, 2540 insertions, 2320 deletions
diff --git a/.github/workflows/win-build.yml b/.github/workflows/win-build.yml
index f8a0a6c..5c787f5 100644
--- a/.github/workflows/win-build.yml
+++ b/.github/workflows/win-build.yml
@@ -42,8 +42,6 @@ jobs:
if ($lastexitcode -ne 0) {
throw "nmake exit code: $lastexitcode"
}
- env:
- CI_BUILD_WITH_MSVC: 1
gcc:
runs-on: windows-latest
defaults:
diff --git a/changes b/changes
index 96350a1..52e6f81 100644
--- a/changes
+++ b/changes
@@ -8990,136 +8990,10 @@ in this changeset (new minor version) rather than bug fixes:
2019-11-15 (bug)[135804] segfault in [next] after destroy (coulter,sebres)
-- Released 8.6.10, Nov 21, 2019 - details at https://core.tcl-lang.org/tcl/ -
-
-2019-12-03 (bug)[3cd9be] Corner case in surrogate handling (nijtmans)
-
-2019-12-09 (new) Add tcltest::(Setup|Eval|Cleanup|)Test (coulter,sebres)
-=> tcltest 2.5.2
-
-2019-12-12 (new) Add 3 libtommath functions to stub table (nijtmans)
-
-2019-12-23 (bug)[ce3b9f] compilation errors with clang, windows msys2 (nijtmans)
-
-2019-12-27 (bug)[1de6b0] [expr 1e2147483648] => 0.0 (kbk)
-
-2020-01-04 (bug)[912886] tis-620 encoding fails to load (coulter)
-
-2020-01-13 (bug)[0b9332] Win: support system encoding init to utf-8 (jedlička)
-
-2020-01-17 (bug)[8cd2fe] [unload] corrupted list of loaded packages (berc)
-
-2020-01-17 (bug)[5d989f] segfault in lsort for large list length (sebres)
-
-2020-01-30 (bug) Reset WSAGetLastError()/errno in channel close (nijtmans)
-
-2020-02-17 (bug) Win: avoid create of legacy error-vars on init phase (sebres)
-
-2020-02-25 (bug) release refs when setting class's superclasses fails (dkf)
-
-2020-02-26 (bug) C++ compiler compatibility for registry and dde (nijtmans)
-=> registry 1.3.5
-=> dde 1.4.3
-
-2020-03-05 (new) Update to Unicode-13 (nijtmans)
-
-2020-03-16 (bug)[8f89e2] Win: env var encoding, env-2.5 (sebres, nijtmans)
-
-2020-03-27 (bug)[767e07] Tcl_Get(Range|UniChar) validate index inputs (nijtmans)
-
-2020-03-28 (bug)[8edfce] [binary encode base64] & multi-byte wrapchars (dgp)
-
-2020-03-28 (bug)[ffeb20] [binary decode base64] ignore invalid chars (dgp)
-See RFC 2045
- *** POTENTIAL INCOMPATIBILITY ***
-
-2020-03-31 (bug)[b8e82d] some -maxlen values break uuencode round trip (dgp)
- *** POTENTIAL INCOMPATIBILITY ***
-
-2020-04-01 (bug)[f58371] Fileevent run in proper thread (bron,sebres)
-
-2020-04-13 (bug)[afa4b2] TclNeedSpace bug; tests util-8.5 .. util-8.11 (dgp)
-
-2020-04-13 (bug)[085913] Tcl_DStringAppendElement # quoting precision (dgp)
- *** POTENTIAL INCOMPATIBILITY ***
-
-2020-04-13 (bug)[a7f685] test util-5.52 (dgp)
-
-2020-04-13 (bug)[c61818] Tcl_UtfPrev regression (dgp)
-
-2020-04-15 (bug)[8af92d] zlib transform issue, bad inflate (sebres)
-
-2020-04-16 (bug)[5e6346] Tcl_UtfPrev handling of overlong sequences (dgp)
-
-2020-04-27 (bug)[45ca23] [string tolower] inconsistency (dgp)
-
-2020-04-30 (bug)[da2352] init [info hostname] with DNS, not NetBIOS (nadkarni)
-
-2020-05-11 (bug)[d402ff] Win32 potential crash when using main() (werner)
-
-2020-05-13 (bug)[81242a] revised documentation for Tcl_UtfAtIndex() (nijtmans)
- *** POTENTIAL INCOMPATIBILITY ***
-
-2020-05-13 (bug)[ed2980] Tcl_UtfToUniChar reads > TCL_UTF_MAX bytes (nijtmans)
- *** POTENTIAL INCOMPATIBILITY ***
-
-2020-06-02 (bug) prevent segfault in parser (sebres)
-
-2020-06-21 (bug)[f81bec] http POST a binary file (alakendu,nash)
-=> http 2.9.2
-
-2020-06-23 (bug)[41c985] auto_path nonsense in Safe Base (nash)
-
-2020-06-24 (bug)[f70ce1] zlib multi-stream inflate acts only on first (sebres)
-
-2020-07-09 (bug)[a1bd37] [clock scan] new ISO format (clock-34.(19-24)) (sebres)
- *** POTENTIAL INCOMPATIBILITY ***
-
-2020-07-10 (bug)[501974] [clock scan] +time zone (clock-34.(53-68)) (sebres)
- *** POTENTIAL INCOMPATIBILITY ***
-
-2020-07-15 (bug)[3c6e47] compiled [lappend] performance, avoid copy (sebres)
-
-2020-07-16 (bug)[5bbd04] Fix index underflow (schwab)
-
-2020-07-27 (bug)[cb0373] http::geturl -keepalive fixes (nash)
-=> http 2.9.3
-
-2020-08-10 (bug)[29e884] cmd resolution cycle (namespace-57.0) (coulter,sebres)
-
-2020-08-12 (bug)[e87000] Tcl_BadChannelOption tolerate NULL (werner,nijtmans)
-
-2020-08-31 (TIP #581) disfavor Master/Slave terminology (nijtmans)
-=> opt 0.4.8
-
-2020-09-11 (bug)[3bc0f4] UBSan complains about body.chars[] usage (nijtmans)
-
-2020-09-17 (bug)[835c93] Support TIP 525 exit code for -singleproc 1 (nijtmans)
-=> tcltest 2.5.3
-
-2020-09-25 (new) force -eofchar \032 when evaluating library scripts (nijtmans)
- *** POTENTIAL INCOMPATIBILITY ***
-
-2020-09-29 (bug)[0063cb] http::geturl -headers must be dict (oehlmann,nijtmans)
-
-2020-10-19 (bug)[cb4582] Update install-sh script (stu,nijtmans)
-
-2020-10-22 (bug)[c97593] Usage of gnu_printf in latest mingw-w64 (nijtmans)
-
-2020-10-26 (new)[48898a] improve error message consistency (stu)
- *** POTENTIAL INCOMPATIBILITY ***
-
-2020-11-06 (new) revised case of module names (nijtmans)
- *** POTENTIAL INCOMPATIBILITY ***
-
-2020-12-10 (bug)[ed5be7] Win: recognize "comx:" as serial port (oehlmann)
+2019-11-18 (bug)[13657a] application/json us text, not binary (noe,nijtmans)
+=> http 2.9.1
-2020-12-11 (new) support for msys2, Big Sur (nijtmans)
-=> platform 1.0.15
-
-2020-12-23 tzdata updated to Olson's tzdata2020e (jima)
-
-- Released 8.6.11, Dec 31, 2020 - details at https://core.tcl-lang.org/tcl/ -
+- Released 8.6.10, Nov 21, 2019 - details at https://core.tcl-lang.org/tcl/ -
Changes to 8.7a3 include all changes to the 8.6 line through 8.6.10,
plus the following, which focuses on the high-level feature changes
@@ -9251,7 +9125,136 @@ in this changeset (new minor version) rather than bug fixes:
2019-09-14 [TIP 548] wchar_t conversion functions
-- Released 8.7a3, Nov 21, 2019 --- http://core.tcl-lang.org/tcl/ for details -
+- Released 8.7a3, Nov 21, 2019 --- https://core.tcl-lang.org/tcl/ for details -
+
+2019-12-03 (bug)[3cd9be] Corner case in surrogate handling (nijtmans)
+
+2019-12-09 (new) Add tcltest::(Setup|Eval|Cleanup|)Test (coulter,sebres)
+=> tcltest 2.5.2
+
+2019-12-12 (new) Add 3 libtommath functions to stub table (nijtmans)
+
+2019-12-23 (bug)[ce3b9f] compilation errors with clang, windows msys2 (nijtmans)
+
+2019-12-27 (bug)[1de6b0] [expr 1e2147483648] => 0.0 (kbk)
+
+2020-01-04 (bug)[912886] tis-620 encoding fails to load (coulter)
+
+2020-01-13 (bug)[0b9332] Win: support system encoding init to utf-8 (jedlička)
+
+2020-01-17 (bug)[8cd2fe] [unload] corrupted list of loaded packages (berc)
+
+2020-01-17 (bug)[5d989f] segfault in lsort for large list length (sebres)
+
+2020-01-30 (bug) Reset WSAGetLastError()/errno in channel close (nijtmans)
+
+2020-02-17 (bug) Win: avoid create of legacy error-vars on init phase (sebres)
+
+2020-02-25 (bug) release refs when setting class's superclasses fails (dkf)
+
+2020-02-26 (bug) C++ compiler compatibility for registry and dde (nijtmans)
+=> registry 1.3.5
+=> dde 1.4.3
+
+2020-03-05 (new) Update to Unicode-13 (nijtmans)
+
+2020-03-16 (bug)[8f89e2] Win: env var encoding, env-2.5 (sebres, nijtmans)
+
+2020-03-27 (bug)[767e07] Tcl_Get(Range|UniChar) validate index inputs (nijtmans)
+
+2020-03-28 (bug)[8edfce] [binary encode base64] & multi-byte wrapchars (dgp)
+
+2020-03-28 (bug)[ffeb20] [binary decode base64] ignore invalid chars (dgp)
+See RFC 2045
+ *** POTENTIAL INCOMPATIBILITY ***
+
+2020-03-31 (bug)[b8e82d] some -maxlen values break uuencode round trip (dgp)
+ *** POTENTIAL INCOMPATIBILITY ***
+
+2020-04-01 (bug)[f58371] Fileevent run in proper thread (bron,sebres)
+
+2020-04-13 (bug)[afa4b2] TclNeedSpace bug; tests util-8.5 .. util-8.11 (dgp)
+
+2020-04-13 (bug)[085913] Tcl_DStringAppendElement # quoting precision (dgp)
+ *** POTENTIAL INCOMPATIBILITY ***
+
+2020-04-13 (bug)[a7f685] test util-5.52 (dgp)
+
+2020-04-13 (bug)[c61818] Tcl_UtfPrev regression (dgp)
+
+2020-04-15 (bug)[8af92d] zlib transform issue, bad inflate (sebres)
+
+2020-04-16 (bug)[5e6346] Tcl_UtfPrev handling of overlong sequences (dgp)
+
+2020-04-27 (bug)[45ca23] [string tolower] inconsistency (dgp)
+
+2020-04-30 (bug)[da2352] init [info hostname] with DNS, not NetBIOS (nadkarni)
+
+2020-05-11 (bug)[d402ff] Win32 potential crash when using main() (werner)
+
+2020-05-13 (bug)[81242a] revised documentation for Tcl_UtfAtIndex() (nijtmans)
+ *** POTENTIAL INCOMPATIBILITY ***
+
+2020-05-13 (bug)[ed2980] Tcl_UtfToUniChar reads > TCL_UTF_MAX bytes (nijtmans)
+ *** POTENTIAL INCOMPATIBILITY ***
+
+2020-06-02 (bug) prevent segfault in parser (sebres)
+
+2020-06-21 (bug)[f81bec] http POST a binary file (alakendu,nash)
+=> http 2.9.2
+
+2020-06-23 (bug)[41c985] auto_path nonsense in Safe Base (nash)
+
+2020-06-24 (bug)[f70ce1] zlib multi-stream inflate acts only on first (sebres)
+
+2020-07-09 (bug)[a1bd37] [clock scan] new ISO format (clock-34.(19-24)) (sebres)
+ *** POTENTIAL INCOMPATIBILITY ***
+
+2020-07-10 (bug)[501974] [clock scan] +time zone (clock-34.(53-68)) (sebres)
+ *** POTENTIAL INCOMPATIBILITY ***
+
+2020-07-15 (bug)[3c6e47] compiled [lappend] performance, avoid copy (sebres)
+
+2020-07-16 (bug)[5bbd04] Fix index underflow (schwab)
+
+2020-07-27 (bug)[cb0373] http::geturl -keepalive fixes (nash)
+=> http 2.9.3
+
+2020-08-10 (bug)[29e884] cmd resolution cycle (namespace-57.0) (coulter,sebres)
+
+2020-08-12 (bug)[e87000] Tcl_BadChannelOption tolerate NULL (werner,nijtmans)
+
+2020-08-31 (TIP #581) disfavor Master/Slave terminology (nijtmans)
+=> opt 0.4.8
+
+2020-09-11 (bug)[3bc0f4] UBSan complains about body.chars[] usage (nijtmans)
+
+2020-09-17 (bug)[835c93] Support TIP 525 exit code for -singleproc 1 (nijtmans)
+=> tcltest 2.5.3
+
+2020-09-25 (new) force -eofchar \032 when evaluating library scripts (nijtmans)
+ *** POTENTIAL INCOMPATIBILITY ***
+
+2020-09-29 (bug)[0063cb] http::geturl -headers must be dict (oehlmann,nijtmans)
+
+2020-10-19 (bug)[cb4582] Update install-sh script (stu,nijtmans)
+
+2020-10-22 (bug)[c97593] Usage of gnu_printf in latest mingw-w64 (nijtmans)
+
+2020-10-26 (new)[48898a] improve error message consistency (stu)
+ *** POTENTIAL INCOMPATIBILITY ***
+
+2020-11-06 (new) revised case of module names (nijtmans)
+ *** POTENTIAL INCOMPATIBILITY ***
+
+2020-12-10 (bug)[ed5be7] Win: recognize "comx:" as serial port (oehlmann)
+
+2020-12-11 (new) support for msys2, Big Sur (nijtmans)
+=> platform 1.0.15
+
+2020-12-23 tzdata updated to Olson's tzdata2020e (jima)
+
+- Released 8.6.11, Dec 31, 2020 - details at https://core.tcl-lang.org/tcl/ -
Changes to 8.7a5 include all changes to the 8.6 line through 8.6.11,
plus the following, which focuses on the high-level feature changes
@@ -9329,4 +9332,46 @@ in this changeset (new minor version) rather than bug fixes:
2021-05-18 (bug)[688fcc,28027d] namespace teardown reform (coulter)
-- Released 8.7a5, Jun 18, 2021 --- http://core.tcl-lang.org/tcl/ for details -
+- Released 8.7a5, Jun 18, 2021 --- https://core.tcl-lang.org/tcl/ for details -
+
+2021-02-02 (new) support for MacOS Big Sur updates (nijtmans)
+=> platform 1.0.17
+
+2021-02-15 (bug)[d43f96] [string trim*] broken for Emoji (werner)
+
+2021-02-16 (bug)[22324b] [string reverse] broken for Emoji (werner)
+
+2021-02-19 (bug)[1dab71,7c64aa] BRE broken by uninitialized value use (lane)
+
+2021-03-09 (bug)[8419c5] Unix tty channels tolerate EINTR (nijtmans)
+ *** POTENTIAL INCOMPATIBILITY ***
+
+2021-03-10 (bug)[4c591f] [string compare] EIAS violation (nijtmans)
+
+2021-04-08 (new) dde package installation compatible with Tcl 9 (nijtmans)
+=> dde 1.4.4
+
+2021-04-14 (bug)[266494] [concat foo [list #]] EIAS violation (porter)
+
+2021-05-03 (bug)[24b918] Save IO buffers from modern optimizers (rupprecht)
+
+2021-05-06 (new) support for POSIX error EILSEQ (nijtmans)
+
+2021-05-17 (bug)[688fcc] segfault during traced delete of alias (coulter)
+
+2021-06-22 (bug)[bad6cc] More secure build tool. CVE-2021-35331 (nijtmans)
+
+2021-07-17 (bug)[592a25] Win: segfault in Tcl_PutEnv() (danckaert,nijtmans)
+
+2021-09-02 (bug)[ccc448] segfault in ensemble rewrite machinery (coulter)
+
+2021-09-14 (new) Update to Unicode-14 (nijtmans)
+
+2021-10-08 (bug)[a8579d] failed proc argument spec processing (russell,coulter)
+
+2021-10-27 (new) support for MacOS Monterey (nijtmans)
+=> platform 1.0.18
+
+2021-10-27 tzdata updated to Olson's tzdata2021e (nijtmans)
+
+- Released 8.6.12, Nov 5, 2021 - details at https://core.tcl-lang.org/tcl/ -
diff --git a/doc/ByteArrObj.3 b/doc/ByteArrObj.3
index 2a7d7a3..fd7f245 100644
--- a/doc/ByteArrObj.3
+++ b/doc/ByteArrObj.3
@@ -8,83 +8,170 @@
.so man.macros
.BS
.SH NAME
-Tcl_NewByteArrayObj, Tcl_SetByteArrayObj, Tcl_GetByteArrayFromObj, Tcl_SetByteArrayLength \- manipulate Tcl values as a arrays of bytes
+Tcl_NewByteArrayObj, Tcl_SetByteArrayObj, Tcl_GetBytesFromObj, Tcl_GetByteArrayFromObj, Tcl_SetByteArrayLength \- manipulate a Tcl value as an array of bytes
.SH SYNOPSIS
.nf
\fB#include <tcl.h>\fR
.sp
Tcl_Obj *
-\fBTcl_NewByteArrayObj\fR(\fIbytes, length\fR)
+\fBTcl_NewByteArrayObj\fR(\fIbytes, numBytes\fR)
.sp
void
-\fBTcl_SetByteArrayObj\fR(\fIobjPtr, bytes, length\fR)
+\fBTcl_SetByteArrayObj\fR(\fIobjPtr, bytes, numBytes\fR)
.sp
+.VS TIP568
unsigned char *
-\fBTcl_GetByteArrayFromObj\fR(\fIobjPtr, lengthPtr\fR)
+\fBTcl_GetBytesFromObj\fR(\fIinterp, objPtr, numBytesPtr\fR)
+.VE TIP568
.sp
unsigned char *
-\fBTcl_SetByteArrayLength\fR(\fIobjPtr, length\fR)
+\fBTcl_GetByteArrayFromObj\fR(\fIobjPtr, numBytesPtr\fR)
+.sp
+unsigned char *
+\fBTcl_SetByteArrayLength\fR(\fIobjPtr, numBytes\fR)
.SH ARGUMENTS
-.AS "const unsigned char" *lengthPtr in/out
+.AS "const unsigned char" *numBytesPtr in/out
.AP "const unsigned char" *bytes in
The array of bytes used to initialize or set a byte-array value. May be NULL
-even if \fIlength\fR is non-zero.
-.AP int length in
-The length of the array of bytes. It must be >= 0.
+even if \fInumBytes\fR is non-zero.
+.AP int numBytes in
+The number of bytes in the array. It must be >= 0.
.AP Tcl_Obj *objPtr in/out
-For \fBTcl_SetByteArrayObj\fR, this points to the value to be converted to
-byte-array type. For \fBTcl_GetByteArrayFromObj\fR and
-\fBTcl_SetByteArrayLength\fR, this points to the value from which to get
-the byte-array value; if \fIobjPtr\fR does not already point to a byte-array
-value, it will be converted to one.
-.AP size_t | int *lengthPtr out
-Filled with the length of the array of bytes in the value.
-May be (int *)NULL when not used.
+For \fBTcl_SetByteArrayObj\fR, this points to an unshared value to be
+overwritten by a byte-array value. For \fBTcl_GetBytesFromObj\fR,
+\fBTcl_GetByteArrayFromObj\fR and \fBTcl_SetByteArrayLength\fR, this points
+to the value from which to extract an array of bytes.
+.AP Tcl_Interp *interp in
+Interpreter to use for error reporting.
+.AP "size_t | int" *numBytesPtr out
+Points to space where the number of bytes in the array may be written.
+Caller may pass NULL when it does not need this information.
.BE
.SH DESCRIPTION
.PP
-These procedures are used to create, modify, and read Tcl byte-array values
-from C code. Byte-array values are typically used to hold the
-results of binary IO operations or data structures created with the
-\fBbinary\fR command. In Tcl, an array of bytes is not equivalent to a
-string. Conceptually, a string is an array of Unicode characters, while a
-byte-array is an array of 8-bit quantities with no implicit meaning.
-Accessor functions are provided to get the string representation of a
-byte-array or to convert an arbitrary value to a byte-array. Obtaining the
+These routines are used to create, modify, store, transfer, and retrieve
+arbitrary binary data in Tcl values. Specifically, data that can be
+represented as a sequence of arbitrary byte values is supported.
+This includes data read from binary channels, values created by the
+\fBbinary\fR command, encrypted data, or other information representable as
+a finite byte sequence.
+.PP
+A byte is an 8-bit quantity with no inherent meaning. When the 8 bits are
+interpreted as an integer value, the range of possible values is (0-255).
+The C type best suited to store a byte is the \fBunsigned char\fR.
+An \fBunsigned char\fR array of size \fIN\fR stores an aribtrary binary
+value of size \fIN\fR bytes. We call this representation a byte-array.
+Here we document the routines that allow us to operate on Tcl values as
+byte-arrays.
+.PP
+All Tcl values must correspond to a string representation.
+When a byte-array value must be processed as a string, the sequence
+of \fIN\fR bytes is transformed into the corresponding sequence
+of \fIN\fR characters, where each byte value transforms to the same
+character codepoint value in the range (U+0000 - U+00FF). Obtaining the
string representation of a byte-array value (by calling
-\fBTcl_GetStringFromObj\fR) produces a properly formed UTF-8 sequence with a
-one-to-one mapping between the bytes in the internal representation and the
-UTF-8 characters in the string representation.
+\fBTcl_GetStringFromObj\fR) produces this string in Tcl's usual
+Modified UTF-8 encoding.
.PP
-\fBTcl_NewByteArrayObj\fR and \fBTcl_SetByteArrayObj\fR will
-create a new value of byte-array type or modify an existing value to have a
-byte-array type. Both of these procedures set the value's type to be
-byte-array and set the value's internal representation to a copy of the
-array of bytes given by \fIbytes\fR. \fBTcl_NewByteArrayObj\fR returns a
-pointer to a newly allocated value with a reference count of zero.
-\fBTcl_SetByteArrayObj\fR invalidates any old string representation and, if
-the value is not already a byte-array value, frees any old internal
-representation. If \fIbytes\fR is NULL then the new byte array contains
-arbitrary values.
+\fBTcl_NewByteArrayObj\fR and \fBTcl_SetByteArrayObj\fR
+create a new value or overwrite an existing unshared value, respectively,
+to hold a byte-array value of \fInumBytes\fR bytes. When a caller
+passes a non-NULL value of \fIbytes\fR, it must point to memory from
+which \fInumBytes\fR bytes can be read. These routines
+allocate \fInumBytes\fR bytes of memory, copy \fInumBytes\fR
+bytes from \fIbytes\fR into it, and keep the result in the internal
+representation of the new or overwritten value.
+When the caller passes a NULL value of \fIbytes\fR, the data copying
+step is skipped, and the bytes stored in the value are undefined.
+A \fIbytes\fR value of NULL is useful only when the caller will arrange
+to write known contents into the byte-array through a pointer retrieved
+by a call to one of the routines explained below. \fBTcl_NewByteArrayObj\fR
+returns a pointer to the created value with a reference count of zero.
+\fBTcl_SetByteArrayObj\fR overwrites and invalidates any old contents
+of the unshared \fIobjPtr\fR as appropriate, and keeps its reference
+count (0 or 1) unchanged. The value produced by these routines has no
+string representation. Any memory allocation failure may cause a panic.
+Note that the type of the \fInumBytes\fR argument is \fBint\fR; consequently
+the largest byte-array value that can be produced by these routines is one
+holding \fBINT_MAX\fR bytes. Note also that the string representation of
+any Tcl value is limited to \fBINT_MAX\fR bytes, so caution should be
+taken with any byte-array of more than \fBINT_MAX / 2\fR bytes.
.PP
-\fBTcl_GetByteArrayFromObj\fR converts a Tcl value to byte-array type and
-returns a pointer to the value's new internal representation as an array of
-bytes. The length of this array is stored in \fIlengthPtr\fR if
-\fIlengthPtr\fR is non-NULL. The storage for the array of bytes is owned by
-the value and should not be freed. The contents of the array may be
-modified by the caller only if the value is not shared and the caller
-invalidates the string representation.
+\fBTcl_GetBytesFromObj\fR performs the opposite function of
+\fBTcl_SetByteArrayObj\fR, providing access to read a byte-array from
+a Tcl value that was previously written into it. When \fIobjPtr\fR
+is a value previously produced by \fBTcl_NewByteArrayObj\fR or
+\fBTcl_SetByteArrayObj\fR, then \fBTcl_GetBytesFromObj\fR returns
+a pointer to the byte-array kept in the value's internal representation.
+If the caller provides a non-NULL value for \fInumBytesPtr\fR, it must
+point to memory where \fBTcl_GetBytesFromObj\fR can write the number
+of bytes in the value's internal byte-array. With both pieces of
+information, the caller is able to retrieve any information about the
+contents of that byte-array that it seeks. When \fIobjPtr\fR does
+not already contain an internal byte-array, \fBTcl_GetBytesFromObj\fR
+will try to create one from the value's string representation. Any
+string value that does not include any character codepoints outside
+the range (U+0000 - U+00FF) will successfully translate to a unique
+byte-array value. With the created byte-array, the routine returns
+as before. For any string representation which does contain
+a forbidden character codepoint, the conversion fails, and
+\fBTcl_GetBytesFromObj\fR returns NULL to signal that failure. On
+failure, nothing will be written to \fInumBytesPtr\fR, and if
+the \fIinterp\fR argument is non-NULL, then error messages and
+codes are left in it recording the error.
.PP
-\fBTcl_SetByteArrayLength\fR converts the Tcl value to byte-array type
-and changes the length of the value's internal representation as an
-array of bytes. If \fIlength\fR is greater than the space currently
-allocated for the array, the array is reallocated to the new length; the
-newly allocated bytes at the end of the array have arbitrary values. If
-\fIlength\fR is less than the space currently allocated for the array,
-the length of array is reduced to the new length. The return value is a
-pointer to the value's new array of bytes.
-
+\fBTcl_GetByteArrayFromObj\fR performs nearly the same function as
+\fBTcl_GetBytesFromObj\fR. They differ only in the circumstance when
+a byte-array internal value must be created by transformation of
+a string representation, and that string representation contains a
+character with codepoint greater than U+00FF. Instead of failing
+the conversion, \fBTcl_GetByteArrayFromObj\fR will use the 8 least
+significant bits of each codepoint to produce a valid byte value
+from any character codepoint value. In any other circumstance,
+\fBTcl_GetByteArrayFromObj\fR performs just as \fBTcl_GetBytesFromObj\fR
+does. Since the conversion cannot fail, \fBTcl_GetByteArrayFromObj\fR
+has no need for an \fIinterp\fR argument to record any errors and
+the caller can assume \fBTcl_GetByteArrayFromObj\fR does not return NULL.
+.PP
+\fBTcl_GetByteArrayFromObj\fR must be used with caution. Because of the
+truncation on conversion, the byte-array made available to the caller
+cannot reliably complete a round-trip back to the original string
+representation. This creates opportunities for bugs due to blindness
+to differences in values. This routine exists in this form primarily
+for compatibility with codebases written for earlier releases of Tcl.
+It is expected this routine will incompatibly change in Tcl 9 so that
+it also signals failed conversions with a NULL return.
+.PP
+On success, both \fBTcl_GetBytesFromObj\fR and \fBTcl_GetByteArrayFromObj\fR
+return a pointer into the internal representation of a \fBTcl_Obj\fR.
+That pointer must not be freed by the caller, and should not be retained
+for use beyond the known time the internal representation of the value
+has not been disturbed. The pointer may be used to overwrite the byte
+contents of the internal representation, so long as the value is unshared
+and any string representation is invalidated.
+.PP
+On success, both \fBTcl_GetBytesFromObj\fR and \fBTcl_GetByteArrayFromObj\fR
+write the number of bytes in the byte-array value of \fIobjPtr\fR
+to the space pointed to by \fInumBytesPtr\fR. This space may be of type
+\fBsize_t\fR or of type \fBint\fR. In Tcl 8, the largest number of
+bytes possible is \fBINT_MAX\fR, so either type can receive the value.
+In codebases meant to migrate to Tcl 9, the option to write to a space
+of type \fBsize_t\fR may aid in the migration.
+.PP
+\fBTcl_SetByteArrayLength\fR enables a caller to change the size of a
+byte-array in the internal representation of an unshared \fIobjPtr\fR to
+become \fInumBytes\fR bytes. This is most often useful after the
+bytes of the internal byte-array have been directly overwritten and it
+has been discovered that the required size differs from the first
+estimate used in the allocation. \fBTcl_SetByteArrayLength\fR returns
+a pointer to the resized byte-array. Because resizing the byte-array
+changes the internal representation, \fBTcl_SetByteArrayLength\fR
+also invalidates any string representation in \fIobjPtr\fR. If resizing
+grows the byte-array, the new byte values are undefined. If \fIobjPtr\fR
+does not already possess an internal byte-array, one is produced in the
+same way that \fBTcl_GetByteArrayFromObj\fR does, with all the cautions
+that go along with that.
.SH "REFERENCE COUNT MANAGEMENT"
.PP
\fBTcl_NewByteArrayObj\fR always returns a zero-reference object, much
@@ -94,11 +181,11 @@ like \fBTcl_NewObj\fR.
reference count of their \fIobjPtr\fR arguments, but do require that the
object be unshared.
.PP
-\fBTcl_GetByteArrayFromObj\fR does not modify the reference count of its
-\fIobjPtr\fR argument; it only reads.
+\fBTcl_GetBytesFromObj\fR and \fBTcl_GetByteArrayFromObj\fR do not modify
+the reference count of \fIobjPtr\fR; they only read.
.SH "SEE ALSO"
Tcl_GetStringFromObj, Tcl_NewObj, Tcl_IncrRefCount, Tcl_DecrRefCount
.SH KEYWORDS
-value, binary data, byte array, utf, unicode, internationalization
+value, binary data, byte array, utf, unicode
diff --git a/doc/Class.3 b/doc/Class.3
index 5f8e061..c89c5f4 100644
--- a/doc/Class.3
+++ b/doc/Class.3
@@ -55,6 +55,14 @@ Tcl_ObjectMapMethodNameProc
\fBTcl_ObjectGetMethodNameMapper\fR(\fIobject\fR)
.sp
\fBTcl_ObjectSetMethodNameMapper\fR(\fIobject\fR, \fImethodNameMapper\fR)
+.sp
+.VS "TIP 605"
+Tcl_Class
+\fBTcl_GetClassOfObject\fR(\fIobject\fR)
+.sp
+Tcl_Obj *
+\fBTcl_GetObjectClassName\fR(\fIinterp\fR, \fIobject\fR)
+.VE "TIP 605"
.SH ARGUMENTS
.AS ClientData metadata in/out
.AP Tcl_Interp *interp in/out
@@ -114,6 +122,13 @@ function. Note that the Tcl_Obj reference returned by \fBTcl_GetObjectName\fR
is a shared reference. You can also get whether the object has been marked for
deletion with \fBTcl_ObjectDeleted\fR (it returns true if deletion of the
object has begun); this can be useful during the processing of methods.
+.VS "TIP 605"
+The class of an object can be retrieved with \fBTcl_GetClassOfObject\fR, and
+the name of the class of an object with \fBTcl_GetObjectClassName\fR; note
+that these two \fImay\fR return NULL during deletion of an object (this is
+transient, and only occurs when the object is a long way through being
+deleted).
+.VE "TIP 605"
.PP
Instances of classes are created using \fBTcl_NewObjectInstance\fR, which
creates an object from any class (and which is internally called by both
diff --git a/doc/FindExec.3 b/doc/FindExec.3
index 149ef8a..7f8c8a4 100644
--- a/doc/FindExec.3
+++ b/doc/FindExec.3
@@ -13,7 +13,7 @@ Tcl_FindExecutable, Tcl_GetNameOfExecutable \- identify or return the name of th
.nf
\fB#include <tcl.h>\fR
.sp
-void
+const char *
\fBTcl_FindExecutable\fR(\fIargv0\fR)
.sp
const char *
@@ -35,6 +35,9 @@ Tcl. For example, it is needed on some platforms in the
implementation of the \fBload\fR command.
It is also returned by the \fBinfo nameofexecutable\fR command.
.PP
+The result of \fBTcl_FindExecutable\fR is the full Tcl version (e.g.,
+\fB8.7.0+abcdef...abcdef.gcc-1002.utf16\fR).
+.PP
On UNIX platforms this procedure is typically invoked as the very
first thing in the application's main program; it must be passed
\fIargv[0]\fR as its argument. It is important not to change the
diff --git a/doc/InitSubSyst.3 b/doc/InitSubSyst.3
index 3c138a4..89f2b88 100644
--- a/doc/InitSubSyst.3
+++ b/doc/InitSubSyst.3
@@ -13,7 +13,7 @@ Tcl_InitSubsystems \- initialize the Tcl library.
.nf
\fB#include <tcl.h>\fR
.sp
-void
+const char *
\fBTcl_InitSubsystems\fR(\fIvoid\fR)
.SH DESCRIPTION
.PP
@@ -21,10 +21,13 @@ 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
+The result of \fBTcl_InitSubsystems\fR is the full Tcl version (e.g.,
+\fB8.7.0+abcdef...abcdef.gcc-1002.utf16\fR).
+.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
+iso8859-1 or utf-16 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
diff --git a/doc/Panic.3 b/doc/Panic.3
index 53b84da..bd019db 100644
--- a/doc/Panic.3
+++ b/doc/Panic.3
@@ -18,7 +18,7 @@ void
void
\fBTcl_PanicVA\fR(\fIformat\fR, \fIargList\fR)
.sp
-void
+const char *
\fBTcl_SetPanicProc\fR(\fIpanicProc\fR)
.sp
void
@@ -82,6 +82,9 @@ making calls into the Tcl library, or into other libraries that may
call the Tcl library, since the original call to \fBTcl_Panic\fR
indicates the Tcl library is not in a state of reliable operation.
.PP
+The result of \fBTcl_SetPanicProc\fR is the full Tcl version (e.g.,
+\fB8.7.0+abcdef...abcdef.gcc-1002.utf16\fR).
+.PP
The typical use of \fBTcl_SetPanicProc\fR arranges for the error message
to be displayed or reported in a manner more suitable for the
application or the platform.
diff --git a/doc/binary.n b/doc/binary.n
index 4a5d6c8..9ab694e 100644
--- a/doc/binary.n
+++ b/doc/binary.n
@@ -81,7 +81,7 @@ RFC 2045 calls for base64 decoders to be non-strict.
\fBhex\fR
.
The \fBhex\fR binary encoding converts each byte to a pair of hexadecimal
-digits in big-endian form.
+digits that represent the byte value as a hexadecimal integer.
.RS
.PP
No options are supported during encoding. During decoding, the following
diff --git a/doc/msgcat.n b/doc/msgcat.n
index 1384fa8..ac6dde7 100644
--- a/doc/msgcat.n
+++ b/doc/msgcat.n
@@ -735,7 +735,7 @@ To register to a callback, use:
namespace eval gui {
msgcat::mcpackageconfig changecmd updateGUI
- proc updateGui args {
+ proc updateGUI args {
puts "New locale is '[lindex $args 0]'."
}
}
@@ -769,7 +769,7 @@ msgcat::mcpackageconfig unknowncmd ""
.CE
As an example, the user requires the week day in a certain locale as follows:
.CS
-clock format clock seconds -format %A -locale fr
+clock format [clock seconds] -format %A -locale fr
.CE
\fBclock\fR sets the package locale to \fBfr\fR and looks for the day name as follows:
.CS
diff --git a/doc/zipfs.3 b/doc/zipfs.3
index 348557f..3b13cd9 100644
--- a/doc/zipfs.3
+++ b/doc/zipfs.3
@@ -13,7 +13,7 @@
TclZipfs_AppHook, Tclzipfs_Mount, TclZipfs_MountBuffer, Tclzipfs_Unmount \- handle ZIP files as Tcl virtual filesystems
.SH SYNOPSIS
.nf
-int
+const char *
\fBTclZipfs_AppHook(\fIargcPtr, argvPtr\fR)
.sp
int
@@ -87,11 +87,11 @@ it uses WCHAR instead of char. As a result, it requires your application to
be compiled with the UNICODE preprocessor symbol defined (e.g., via the
\fB-DUNICODE\fR compiler flag).
.PP
-The result of \fBTclZipfs_AppHook\fR is a Tcl result code (e.g., \fBTCL_OK\fR
-when the function is successful). The function \fImay\fR modify the variables
-pointed to by \fIargcPtr\fR and \fIargvPtr\fR to remove arguments; the
-current implementation does not do so, but callers \fIshould not\fR assume
-that this will be true in the future.
+The result of \fBTclZipfs_AppHook\fR is the full Tcl version (e.g.,
+\fB8.7.0+abcdef...abcdef.gcc-1002.utf16\fR).
+The function \fImay\fR modify the variables pointed to by \fIargcPtr\fR and
+\fIargvPtr\fR to remove arguments; the current implementation does not do so,
+but callers \fIshould not\fR assume that this will be true in the future.
.PP
\fBTclzipfs_Mount\fR mounts the ZIP archive \fIzipname\fR on the mount point
given in \fImountpoint\fR using the optional ZIP password \fIpassword\fR.
diff --git a/generic/tcl.decls b/generic/tcl.decls
index 5d2fc62..bd9800a 100644
--- a/generic/tcl.decls
+++ b/generic/tcl.decls
@@ -108,7 +108,7 @@ declare 22 {deprecated {No longer in use, changed to macro}} {
Tcl_Obj *Tcl_DbNewBooleanObj(int boolValue, const char *file, int line)
}
declare 23 {
- Tcl_Obj *Tcl_DbNewByteArrayObj(const unsigned char *bytes, int length,
+ Tcl_Obj *Tcl_DbNewByteArrayObj(const unsigned char *bytes, int numBytes,
const char *file, int line)
}
declare 24 {
@@ -143,7 +143,7 @@ declare 32 {
int *boolPtr)
}
declare 33 {
- unsigned char *Tcl_GetByteArrayFromObj(Tcl_Obj *objPtr, int *lengthPtr)
+ unsigned char *Tcl_GetByteArrayFromObj(Tcl_Obj *objPtr, int *numBytesPtr)
}
declare 34 {
int Tcl_GetDouble(Tcl_Interp *interp, const char *src, double *doublePtr)
@@ -202,7 +202,7 @@ declare 49 {deprecated {No longer in use, changed to macro}} {
Tcl_Obj *Tcl_NewBooleanObj(int boolValue)
}
declare 50 {
- Tcl_Obj *Tcl_NewByteArrayObj(const unsigned char *bytes, int length)
+ Tcl_Obj *Tcl_NewByteArrayObj(const unsigned char *bytes, int numBytes)
}
declare 51 {
Tcl_Obj *Tcl_NewDoubleObj(double doubleValue)
@@ -226,11 +226,11 @@ declare 57 {deprecated {No longer in use, changed to macro}} {
void Tcl_SetBooleanObj(Tcl_Obj *objPtr, int boolValue)
}
declare 58 {
- unsigned char *Tcl_SetByteArrayLength(Tcl_Obj *objPtr, int length)
+ unsigned char *Tcl_SetByteArrayLength(Tcl_Obj *objPtr, int numBytes)
}
declare 59 {
void Tcl_SetByteArrayObj(Tcl_Obj *objPtr, const unsigned char *bytes,
- int length)
+ int numBytes)
}
declare 60 {
void Tcl_SetDoubleObj(Tcl_Obj *objPtr, double doubleValue)
@@ -514,7 +514,7 @@ declare 143 {
void Tcl_Finalize(void)
}
declare 144 {nostub {Don't use this function in a stub-enabled extension}} {
- void Tcl_FindExecutable(const char *argv0)
+ const char *Tcl_FindExecutable(const char *argv0)
}
declare 145 {
Tcl_HashEntry *Tcl_FirstHashEntry(Tcl_HashTable *tablePtr,
@@ -813,7 +813,7 @@ declare 229 {
void Tcl_SetMaxBlockTime(const Tcl_Time *timePtr)
}
declare 230 {nostub {Don't use this function in a stub-enabled extension}} {
- void Tcl_SetPanicProc(TCL_NORETURN1 Tcl_PanicProc *panicProc)
+ const char *Tcl_SetPanicProc(TCL_NORETURN1 Tcl_PanicProc *panicProc)
}
declare 231 {
int Tcl_SetRecursionLimit(Tcl_Interp *interp, int depth)
@@ -2348,18 +2348,18 @@ declare 635 {
# TIP #445
declare 636 {
- void Tcl_FreeIntRep(Tcl_Obj *objPtr)
+ void Tcl_FreeInternalRep(Tcl_Obj *objPtr)
}
declare 637 {
char *Tcl_InitStringRep(Tcl_Obj *objPtr, const char *bytes,
unsigned int numBytes)
}
declare 638 {
- Tcl_ObjIntRep *Tcl_FetchIntRep(Tcl_Obj *objPtr, const Tcl_ObjType *typePtr)
+ Tcl_ObjInternalRep *Tcl_FetchInternalRep(Tcl_Obj *objPtr, const Tcl_ObjType *typePtr)
}
declare 639 {
- void Tcl_StoreIntRep(Tcl_Obj *objPtr, const Tcl_ObjType *typePtr,
- const Tcl_ObjIntRep *irPtr)
+ void Tcl_StoreInternalRep(Tcl_Obj *objPtr, const Tcl_ObjType *typePtr,
+ const Tcl_ObjInternalRep *irPtr)
}
declare 640 {
int Tcl_HasStringRep(Tcl_Obj *objPtr)
@@ -2402,6 +2402,16 @@ declare 648 {
int length, Tcl_DString *dsPtr)
}
+# TIP #568
+declare 649 {
+ unsigned char *TclGetBytesFromObj(Tcl_Interp *interp, Tcl_Obj *objPtr,
+ int *numBytesPtr)
+}
+declare 650 {
+ unsigned char *Tcl_GetBytesFromObj(Tcl_Interp *interp, Tcl_Obj *objPtr,
+ size_t *numBytesPtr)
+}
+
# TIP #481
declare 651 {
char *TclGetStringFromObj(Tcl_Obj *objPtr, size_t *lengthPtr)
@@ -2410,7 +2420,7 @@ declare 652 {
Tcl_UniChar *TclGetUnicodeFromObj(Tcl_Obj *objPtr, size_t *lengthPtr)
}
declare 653 {
- unsigned char *TclGetByteArrayFromObj(Tcl_Obj *objPtr, size_t *lengthPtr)
+ unsigned char *TclGetByteArrayFromObj(Tcl_Obj *objPtr, size_t *numBytesPtr)
}
# TIP #575
@@ -2493,13 +2503,13 @@ export {
Tcl_LibraryInitProc *initProc, Tcl_LibraryInitProc *safeInitProc)
}
export {
- void Tcl_SetPanicProc(TCL_NORETURN1 Tcl_PanicProc *panicProc)
+ const char *Tcl_SetPanicProc(TCL_NORETURN1 Tcl_PanicProc *panicProc)
}
export {
Tcl_ExitProc *Tcl_SetExitProc(TCL_NORETURN1 Tcl_ExitProc *proc)
}
export {
- void Tcl_FindExecutable(const char *argv0)
+ const char *Tcl_FindExecutable(const char *argv0)
}
export {
const char *Tcl_InitStubs(Tcl_Interp *interp, const char *version,
@@ -2517,10 +2527,10 @@ export {
void Tcl_GetMemoryInfo(Tcl_DString *dsPtr)
}
export {
- void Tcl_InitSubsystems(void)
+ const char *Tcl_InitSubsystems(void)
}
export {
- int TclZipfs_AppHook(int *argc, char ***argv)
+ const char *TclZipfs_AppHook(int *argc, char ***argv)
}
# Local Variables:
diff --git a/generic/tcl.h b/generic/tcl.h
index 2d529b7..346b79c 100644
--- a/generic/tcl.h
+++ b/generic/tcl.h
@@ -749,13 +749,13 @@ typedef struct Tcl_ObjType {
} Tcl_ObjType;
/*
- * The following structure stores an internal representation (intrep) for
- * a Tcl value. An intrep is associated with an Tcl_ObjType when both
+ * The following structure stores an internal representation (internalrep) for
+ * a Tcl value. An internalrep is associated with an Tcl_ObjType when both
* are stored in the same Tcl_Obj. The routines of the Tcl_ObjType govern
- * the handling of the intrep.
+ * the handling of the internalrep.
*/
-typedef union Tcl_ObjIntRep { /* The internal representation: */
+typedef union Tcl_ObjInternalRep { /* The internal representation: */
long longValue; /* - an long integer value. */
double doubleValue; /* - a double-precision floating value. */
void *otherValuePtr; /* - another, type-specific value, */
@@ -769,7 +769,7 @@ typedef union Tcl_ObjIntRep { /* The internal representation: */
void *ptr; /* not used internally any more. */
unsigned long value;
} ptrAndLongRep;
-} Tcl_ObjIntRep;
+} Tcl_ObjInternalRep;
/*
* One of the following structures exists for each object in the Tcl system.
@@ -796,7 +796,7 @@ typedef struct Tcl_Obj {
* corresponds to the type of the object's
* internal rep. NULL indicates the object has
* no internal rep (has no type). */
- Tcl_ObjIntRep internalRep; /* The internal representation: */
+ Tcl_ObjInternalRep internalRep; /* The internal representation: */
} Tcl_Obj;
@@ -2383,16 +2383,16 @@ 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 const char * Tcl_InitSubsystems(void);
EXTERN void Tcl_GetMemoryInfo(Tcl_DString *dsPtr);
EXTERN const char * Tcl_SetPreInitScript(const char *string);
#ifndef TCL_NO_DEPRECATED
# define Tcl_StaticPackage Tcl_StaticLibrary
#endif
#ifdef _WIN32
-EXTERN int TclZipfs_AppHook(int *argc, wchar_t ***argv);
+EXTERN const char *TclZipfs_AppHook(int *argc, wchar_t ***argv);
#else
-EXTERN int TclZipfs_AppHook(int *argc, char ***argv);
+EXTERN const char *TclZipfs_AppHook(int *argc, char ***argv);
#endif
/*
diff --git a/generic/tclAssembly.c b/generic/tclAssembly.c
index a20cd1a..b429113 100644
--- a/generic/tclAssembly.c
+++ b/generic/tclAssembly.c
@@ -865,7 +865,7 @@ CompileAssembleObj(
* is valid in the current context.
*/
- ByteCodeGetIntRep(objPtr, &assembleCodeType, codePtr);
+ ByteCodeGetInternalRep(objPtr, &assembleCodeType, codePtr);
if (codePtr) {
namespacePtr = iPtr->varFramePtr->nsPtr;
@@ -882,7 +882,7 @@ CompileAssembleObj(
* Not valid, so free it and regenerate.
*/
- Tcl_StoreIntRep(objPtr, &assembleCodeType, NULL);
+ Tcl_StoreInternalRep(objPtr, &assembleCodeType, NULL);
}
/*
@@ -4289,7 +4289,7 @@ AddBasicBlockRangeToErrorInfo(
* DupAssembleCodeInternalRep --
*
* Part of the Tcl object type implementation for Tcl assembly language
- * bytecode. We do not copy the bytecode intrep. Instead, we return
+ * bytecode. We do not copy the bytecode internalrep. Instead, we return
* without setting copyPtr->typePtr, so the copy is a plain string copy
* of the assembly source, and if it is to be used as a compiled
* expression, it will need to be reprocessed.
@@ -4298,7 +4298,7 @@ AddBasicBlockRangeToErrorInfo(
* usual (only?) time Tcl_DuplicateObj() will be called is when the copy
* is about to be modified, which would invalidate any copied bytecode
* anyway. The only reason it might make sense to copy the bytecode is if
- * we had some modifying routines that operated directly on the intrep,
+ * we had some modifying routines that operated directly on the internalrep,
* as we do for lists and dicts.
*
* Results:
@@ -4342,7 +4342,7 @@ FreeAssembleCodeInternalRep(
{
ByteCode *codePtr;
- ByteCodeGetIntRep(objPtr, &assembleCodeType, codePtr);
+ ByteCodeGetInternalRep(objPtr, &assembleCodeType, codePtr);
assert(codePtr != NULL);
TclReleaseByteCode(codePtr);
diff --git a/generic/tclBasic.c b/generic/tclBasic.c
index 69194f8..29392d2 100644
--- a/generic/tclBasic.c
+++ b/generic/tclBasic.c
@@ -607,6 +607,108 @@ TclFinalizeEvaluation(void)
/*
*----------------------------------------------------------------------
*
+ * buildInfoObjCmd --
+ *
+ * Implements tcl::build-info command.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static int
+buildInfoObjCmd(
+ void *clientData,
+ Tcl_Interp *interp, /* Current interpreter. */
+ int objc, /* Number of arguments. */
+ Tcl_Obj *const objv[]) /* Argument objects. */
+{
+ if (objc > 2) {
+ Tcl_WrongNumArgs(interp, 1, objv, "?option?");
+ return TCL_ERROR;
+ }
+ if (objc == 2) {
+ int len;
+ const char *arg = TclGetStringFromObj(objv[1], &len);
+ if (len == 7 && !strcmp(arg, "version")) {
+ char buf[80];
+ const char *p = strchr((char *)clientData, '.');
+ if (p) {
+ const char *q = strchr(p+1, '.');
+ const char *r = strchr(p+1, '+');
+ p = (q < r) ? q : r;
+ }
+ if (p) {
+ memcpy(buf, (char *)clientData, p - (char *)clientData);
+ buf[p - (char *)clientData] = '\0';
+ Tcl_AppendResult(interp, buf, NULL);
+ }
+ return TCL_OK;
+ } else if (len == 10 && !strcmp(arg, "patchlevel")) {
+ char buf[80];
+ const char *p = strchr((char *)clientData, '+');
+ if (p) {
+ memcpy(buf, (char *)clientData, p - (char *)clientData);
+ buf[p - (char *)clientData] = '\0';
+ Tcl_AppendResult(interp, buf, NULL);
+ }
+ return TCL_OK;
+ } else if (len == 6 && !strcmp(arg, "commit")) {
+ const char *q, *p = strchr((char *)clientData, '+');
+ if (p) {
+ if ((q = strchr(p, '.'))) {
+ char buf[80];
+ memcpy(buf, p+1, q - p - 1);
+ buf[q - p - 1] = '\0';
+ Tcl_AppendResult(interp, buf, NULL);
+ } else {
+ Tcl_AppendResult(interp, p+1, NULL);
+ }
+ }
+ return TCL_OK;
+ } else if (len == 8 && !strcmp(arg, "compiler")) {
+ const char *p = strchr((char *)clientData, '.');
+ while (p) {
+ if (!strncmp(p+1, "clang-", 6) || !strncmp(p+1, "gcc-", 4)
+ || !strncmp(p+1, "icc-", 4) || !strncmp(p+1, "msvc-", 5)) {
+ const char *q = strchr(p+1, '.');
+ if (q) {
+ char buf[16];
+ memcpy(buf, p+1, q - p - 1);
+ buf[q - p - 1] = '\0';
+ Tcl_AppendResult(interp, buf, NULL);
+ } else {
+ Tcl_AppendResult(interp, p+1, NULL);
+ }
+ return TCL_OK;
+ }
+ p = strchr(p+1, '.');
+ }
+ Tcl_AppendResult(interp, "0", NULL);
+ return TCL_OK;
+ }
+ const char *p = strchr((char *)clientData, '.');
+ while (p) {
+ if (!strncmp(p+1, arg, len) && ((p[len+1] == '.') || (p[len+1] == '\0'))) {
+ Tcl_AppendResult(interp, "1", NULL);
+ return TCL_OK;
+ }
+ p = strchr(p+1, '.');
+ }
+ Tcl_AppendResult(interp, "0", NULL);
+ return TCL_OK;
+ }
+ Tcl_AppendResult(interp, (char *)clientData, NULL);
+ return TCL_OK;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
* Tcl_CreateInterp --
*
* Create a new TCL command interpreter.
@@ -644,8 +746,7 @@ Tcl_CreateInterp(void)
#endif /* TCL_COMPILE_STATS */
char mathFuncName[32];
CallFrame *framePtr;
-
- Tcl_InitSubsystems();
+ const char *version = Tcl_InitSubsystems();
/*
* Panic if someone updated the CallFrame structure without also updating
@@ -1162,7 +1263,7 @@ Tcl_CreateInterp(void)
#endif /* !TCL_NO_DEPRECATED */
TclpSetVariables(interp);
-#if TCL_THREADS
+#if TCL_THREADS && !defined(TCL_NO_DEPRECATED) && TCL_MAJOR_VERSION < 9
/*
* The existence of the "threaded" element of the tcl_platform array
* indicates that this particular Tcl shell has been compiled with threads
@@ -1176,10 +1277,14 @@ Tcl_CreateInterp(void)
/*
* Register Tcl's version number.
* TIP #268: Full patchlevel instead of just major.minor
+ * TIP #599: Extended build information "+<UUID>.<tag1>.<tag2>...."
*/
Tcl_PkgProvideEx(interp, "Tcl", TCL_PATCH_LEVEL, &tclStubs);
Tcl_PkgProvideEx(interp, "tcl", TCL_PATCH_LEVEL, &tclStubs);
+ Tcl_CreateObjCommand(interp, "::tcl::build-info",
+ buildInfoObjCmd, (void *)version, NULL);
+
if (TclTommath_Init(interp) != TCL_OK) {
Tcl_Panic("%s", TclGetString(Tcl_GetObjResult(interp)));
@@ -3959,8 +4064,8 @@ OldMathFuncProc(
result = Tcl_GetDoubleFromObj(NULL, valuePtr, &d);
#ifdef ACCEPT_NAN
if (result != TCL_OK) {
- const Tcl_ObjIntRep *irPtr
- = TclFetchIntRep(valuePtr, &tclDoubleType);
+ const Tcl_ObjInternalRep *irPtr
+ = TclFetchInternalRep(valuePtr, &tclDoubleType);
if (irPtr) {
d = irPtr->doubleValue;
@@ -7537,7 +7642,7 @@ ExprCeilFunc(
code = Tcl_GetDoubleFromObj(interp, objv[1], &d);
#ifdef ACCEPT_NAN
if (code != TCL_OK) {
- const Tcl_ObjIntRep *irPtr = TclFetchIntRep(objv[1], &tclDoubleType);
+ const Tcl_ObjInternalRep *irPtr = TclFetchInternalRep(objv[1], &tclDoubleType);
if (irPtr) {
Tcl_SetObjResult(interp, objv[1]);
@@ -7577,7 +7682,7 @@ ExprFloorFunc(
code = Tcl_GetDoubleFromObj(interp, objv[1], &d);
#ifdef ACCEPT_NAN
if (code != TCL_OK) {
- const Tcl_ObjIntRep *irPtr = TclFetchIntRep(objv[1], &tclDoubleType);
+ const Tcl_ObjInternalRep *irPtr = TclFetchInternalRep(objv[1], &tclDoubleType);
if (irPtr) {
Tcl_SetObjResult(interp, objv[1]);
@@ -7723,7 +7828,7 @@ ExprSqrtFunc(
code = Tcl_GetDoubleFromObj(interp, objv[1], &d);
#ifdef ACCEPT_NAN
if (code != TCL_OK) {
- const Tcl_ObjIntRep *irPtr = TclFetchIntRep(objv[1], &tclDoubleType);
+ const Tcl_ObjInternalRep *irPtr = TclFetchInternalRep(objv[1], &tclDoubleType);
if (irPtr) {
Tcl_SetObjResult(interp, objv[1]);
@@ -7777,7 +7882,7 @@ ExprUnaryFunc(
code = Tcl_GetDoubleFromObj(interp, objv[1], &d);
#ifdef ACCEPT_NAN
if (code != TCL_OK) {
- const Tcl_ObjIntRep *irPtr = TclFetchIntRep(objv[1], &tclDoubleType);
+ const Tcl_ObjInternalRep *irPtr = TclFetchInternalRep(objv[1], &tclDoubleType);
if (irPtr) {
d = irPtr->doubleValue;
@@ -7841,7 +7946,7 @@ ExprBinaryFunc(
code = Tcl_GetDoubleFromObj(interp, objv[1], &d1);
#ifdef ACCEPT_NAN
if (code != TCL_OK) {
- const Tcl_ObjIntRep *irPtr = TclFetchIntRep(objv[1], &tclDoubleType);
+ const Tcl_ObjInternalRep *irPtr = TclFetchInternalRep(objv[1], &tclDoubleType);
if (irPtr) {
d1 = irPtr->doubleValue;
@@ -7856,7 +7961,7 @@ ExprBinaryFunc(
code = Tcl_GetDoubleFromObj(interp, objv[2], &d2);
#ifdef ACCEPT_NAN
if (code != TCL_OK) {
- const Tcl_ObjIntRep *irPtr = TclFetchIntRep(objv[1], &tclDoubleType);
+ const Tcl_ObjInternalRep *irPtr = TclFetchInternalRep(objv[1], &tclDoubleType);
if (irPtr) {
d2 = irPtr->doubleValue;
@@ -8017,7 +8122,7 @@ ExprDoubleFunc(
}
if (Tcl_GetDoubleFromObj(interp, objv[1], &dResult) != TCL_OK) {
#ifdef ACCEPT_NAN
- if (TclHasIntRep(objv[1], &tclDoubleType)) {
+ if (TclHasInternalRep(objv[1], &tclDoubleType)) {
Tcl_SetObjResult(interp, objv[1]);
return TCL_OK;
}
diff --git a/generic/tclBinary.c b/generic/tclBinary.c
index 396beec..a586f18 100644
--- a/generic/tclBinary.c
+++ b/generic/tclBinary.c
@@ -2,7 +2,7 @@
* tclBinary.c --
*
* This file contains the implementation of the "binary" Tcl built-in
- * command and the Tcl binary data object.
+ * command and the Tcl value internal representation for binary data.
*
* Copyright © 1997 Sun Microsystems, Inc.
* Copyright © 1998-1999 Scriptics Corporation.
@@ -75,31 +75,15 @@ static int NeedReversing(int format);
static void CopyNumber(const void *from, void *to,
unsigned length, int type);
/* Binary ensemble commands */
-static int BinaryFormatCmd(ClientData clientData,
- Tcl_Interp *interp,
- int objc, Tcl_Obj *const objv[]);
-static int BinaryScanCmd(ClientData clientData,
- Tcl_Interp *interp,
- int objc, Tcl_Obj *const objv[]);
+static Tcl_ObjCmdProc BinaryFormatCmd;
+static Tcl_ObjCmdProc BinaryScanCmd;
/* Binary encoding sub-ensemble commands */
-static int BinaryEncodeHex(ClientData clientData,
- Tcl_Interp *interp,
- int objc, Tcl_Obj *const objv[]);
-static int BinaryDecodeHex(ClientData clientData,
- Tcl_Interp *interp,
- int objc, Tcl_Obj *const objv[]);
-static int BinaryEncode64(ClientData clientData,
- Tcl_Interp *interp,
- int objc, Tcl_Obj *const objv[]);
-static int BinaryDecode64(ClientData clientData,
- Tcl_Interp *interp,
- int objc, Tcl_Obj *const objv[]);
-static int BinaryEncodeUu(ClientData clientData,
- Tcl_Interp *interp, int objc,
- Tcl_Obj *const objv[]);
-static int BinaryDecodeUu(ClientData clientData,
- Tcl_Interp *interp,
- int objc, Tcl_Obj *const objv[]);
+static Tcl_ObjCmdProc BinaryEncodeHex;
+static Tcl_ObjCmdProc BinaryDecodeHex;
+static Tcl_ObjCmdProc BinaryEncode64;
+static Tcl_ObjCmdProc BinaryDecode64;
+static Tcl_ObjCmdProc BinaryEncodeUu;
+static Tcl_ObjCmdProc BinaryDecodeUu;
/*
* The following tables are used by the binary encoders
@@ -165,12 +149,11 @@ static const EnsembleImplMap decodeMap[] = {
* images to name just two.
*
* It's strange to have two Tcl_ObjTypes in place for this task when one would
- * do, so a bit of detail and history how we got to this point and where we
- * might go from here.
+ * do, so a bit of detail and history will aid understanding.
*
* A bytearray is an ordered sequence of bytes. Each byte is an integer value
* in the range [0-255]. To be a Tcl value type, we need a way to encode each
- * value in the value set as a Tcl string. The simplest encoding is to
+ * value in the value set as a Tcl string. A simple encoding is to
* represent each byte value as the same codepoint value. A bytearray of N
* bytes is encoded into a Tcl string of N characters where the codepoint of
* each character is the value of corresponding byte. This approach creates a
@@ -181,9 +164,7 @@ static const EnsembleImplMap decodeMap[] = {
* question arises what to do with strings outside that subset? That is,
* those Tcl strings containing at least one codepoint greater than 255? The
* obviously correct answer is to raise an error! That string value does not
- * represent any valid bytearray value. Full Stop. The setFromAnyProc
- * signature has a completion code return value for just this reason, to
- * reject invalid inputs.
+ * represent any valid bytearray value.
*
* Unfortunately this was not the path taken by the authors of the original
* tclByteArrayType. They chose to accept all Tcl string values as acceptable
@@ -191,33 +172,10 @@ static const EnsembleImplMap decodeMap[] = {
* high bits of any codepoint value at all. This meant that every bytearray
* value had multiple accepted string representations.
*
- * The implications of this choice are truly ugly. When a Tcl value has a
- * string representation, we are required to accept that as the true value.
- * Bytearray values that possess a string representation cannot be processed
- * as bytearrays because we cannot know which true value that bytearray
- * represents. The consequence is that we drag around an internal rep that we
- * cannot make any use of. This painful price is extracted at any point after
- * a string rep happens to be generated for the value. This happens even when
- * the troublesome codepoints outside the byte range never show up. This
- * happens rather routinely in normal Tcl operations unless we burden the
- * script writer with the cognitive burden of avoiding it. The price is also
- * paid by callers of the C interface. The routine
- *
- * unsigned char *Tcl_GetByteArrayFromObj(objPtr, lenPtr)
- *
- * has a guarantee to always return a non-NULL value, but that value points to
- * a byte sequence that cannot be used by the caller to process the Tcl value
- * absent some sideband testing that objPtr is "pure". Tcl offers no public
- * interface to perform this test, so callers either break encapsulation or
- * are unavoidably buggy. Tcl has defined a public interface that cannot be
- * used correctly. The Tcl source code itself suffers the same problem, and
- * has been buggy, but progressively less so as more and more portions of the
- * code have been retrofitted with the required "purity testing". The set of
- * values able to pass the purity test can be increased via the introduction
- * of a "canonical" flag marker, but the only way the broken interface itself
- * can be discarded is to start over and define the Tcl_ObjType properly.
- * Bytearrays should simply be usable as bytearrays without a kabuki dance of
- * testing.
+ * The implications of this choice are truly ugly, and motivated the proposal
+ * of TIP 568 to migrate away from it and to the more sensible design where
+ * each bytearray value has only one string representation. Full details are
+ * recorded in that TIP for those who seek them.
*
* The Tcl_ObjType "properByteArrayType" is (nearly) a correct implementation
* of bytearrays. Any Tcl value with the type properByteArrayType can have
@@ -226,21 +184,24 @@ static const EnsembleImplMap decodeMap[] = {
* implies a side testing burden -- past mistakes will not let us avoid that
* immediately, but it is at least a conventional test of type, and can be
* implemented entirely by examining the objPtr fields, with no need to query
- * the intrep, as a canonical flag would require.
- *
- * Until Tcl_GetByteArrayFromObj() and Tcl_SetByteArrayLength() can be revised
- * to admit the possibility of returning NULL when the true value is not a
- * valid bytearray, we need a mechanism to retain compatibility with the
- * deployed callers of the broken interface. That's what the retained
- * "tclByteArrayType" provides. In those unusual circumstances where we
- * convert an invalid bytearray value to a bytearray type, it is to this
- * legacy type. Essentially any time this legacy type gets used, it's a
- * signal of a bug being ignored. A TIP should be drafted to remove this
- * connection to the broken past so that Tcl 9 will no longer have any trace
- * of it. Prescribing a migration path will be the key element of that work.
- * The internal changes now in place are the limit of what can be done short
- * of interface repair. They provide a great expansion of the histories over
- * which bytearray values can be useful in the meanwhile.
+ * the internalrep, as a canonical flag would require. This benefit is made
+ * available to extensions through the public routine Tcl_GetBytesFromObj(),
+ * first available in Tcl 8.7.
+ *
+ * The public routines Tcl_GetByteArrayFromObj() and Tcl_SetByteArrayLength()
+ * must continue to follow their documented behavior through the 8.* series of
+ * releases. To support that legacy operation, we need a mechanism to retain
+ * compatibility with the deployed callers of the broken interface. That's
+ * what the retained "tclByteArrayType" provides. In those unusual
+ * circumstances where we convert an invalid bytearray value to a bytearray
+ * type, it is to this legacy type. Essentially any time this legacy type
+ * shows up, it's a signal of a bug being ignored.
+ *
+ * In Tcl 9, the incompatibility in the behavior of these public routines
+ * has been approved, and the legacy internal rep is no longer retained.
+ * The internal changes seen below are the limit of what can be done
+ * in a Tcl 8.* release. They provide a great expansion of the histories
+ * over which bytearray values can be useful.
*/
static const Tcl_ObjType properByteArrayType = {
@@ -267,15 +228,16 @@ const Tcl_ObjType tclByteArrayType = {
*/
typedef struct ByteArray {
- unsigned int bad; /* Index of the character that is a nonbyte.
- * If all characters are bytes, bad = used,
- * though then we should never read it. */
+ unsigned int bad; /* Index of first character that is a nonbyte.
+ * If all characters are bytes, bad = used. */
unsigned int used; /* The number of bytes used in the byte
- * array. */
- unsigned int allocated; /* The amount of space actually allocated
- * minus 1 byte. */
- unsigned char bytes[TCLFLEXARRAY]; /* The array of bytes. The actual size of this
- * field depends on the 'allocated' field
+ * array. Must be <= allocated. The bytes
+ * used to store the value are indexed from
+ * 0 to used-1. */
+ unsigned int allocated; /* The number of bytes of space allocated. */
+ unsigned char bytes[TCLFLEXARRAY];
+ /* The array of bytes. The actual size of this
+ * field is stored in the 'allocated' field
* above. */
} ByteArray;
@@ -289,7 +251,7 @@ int
TclIsPureByteArray(
Tcl_Obj * objPtr)
{
- return TclHasIntRep(objPtr, &properByteArrayType);
+ return TclHasInternalRep(objPtr, &properByteArrayType);
}
/*
@@ -301,7 +263,7 @@ TclIsPureByteArray(
* from the given array of bytes.
*
* Results:
- * The newly create object is returned. This object will have no initial
+ * The newly created object is returned. This object has no initial
* string representation. The returned object has a ref count of 0.
*
* Side effects:
@@ -316,16 +278,16 @@ Tcl_Obj *
Tcl_NewByteArrayObj(
const unsigned char *bytes, /* The array of bytes used to initialize the
* new object. */
- int length) /* Length of the array of bytes, which must be
- * >= 0. */
+ int numBytes) /* Number of bytes in the array,
+ * must be >= 0. */
{
#ifdef TCL_MEM_DEBUG
- return Tcl_DbNewByteArrayObj(bytes, length, "unknown", 0);
+ return Tcl_DbNewByteArrayObj(bytes, numBytes, "unknown", 0);
#else /* if not TCL_MEM_DEBUG */
Tcl_Obj *objPtr;
TclNewObj(objPtr);
- Tcl_SetByteArrayObj(objPtr, bytes, length);
+ Tcl_SetByteArrayObj(objPtr, bytes, numBytes);
return objPtr;
#endif /* TCL_MEM_DEBUG */
}
@@ -346,7 +308,7 @@ Tcl_NewByteArrayObj(
* result of calling Tcl_NewByteArrayObj.
*
* Results:
- * The newly create object is returned. This object will have no initial
+ * The newly created object is returned. This object has no initial
* string representation. The returned object has a ref count of 0.
*
* Side effects:
@@ -360,8 +322,8 @@ Tcl_Obj *
Tcl_DbNewByteArrayObj(
const unsigned char *bytes, /* The array of bytes used to initialize the
* new object. */
- int length, /* Length of the array of bytes, which must be
- * >= 0. */
+ int numBytes, /* Number of bytes in the array,
+ * must be >= 0. */
const char *file, /* The name of the source file calling this
* procedure; used for debugging. */
int line) /* Line number in the source file; used for
@@ -370,7 +332,7 @@ Tcl_DbNewByteArrayObj(
Tcl_Obj *objPtr;
TclDbNewObj(objPtr, file, line);
- Tcl_SetByteArrayObj(objPtr, bytes, length);
+ Tcl_SetByteArrayObj(objPtr, bytes, numBytes);
return objPtr;
}
#else /* if not TCL_MEM_DEBUG */
@@ -378,12 +340,12 @@ Tcl_Obj *
Tcl_DbNewByteArrayObj(
const unsigned char *bytes, /* The array of bytes used to initialize the
* new object. */
- int length, /* Length of the array of bytes, which must be
- * >= 0. */
+ int numBytes, /* Number of bytes in the array,
+ * must be >= 0. */
TCL_UNUSED(const char *) /*file*/,
TCL_UNUSED(int) /*line*/)
{
- return Tcl_NewByteArrayObj(bytes, length);
+ return Tcl_NewByteArrayObj(bytes, numBytes);
}
#endif /* TCL_MEM_DEBUG */
@@ -409,47 +371,45 @@ void
Tcl_SetByteArrayObj(
Tcl_Obj *objPtr, /* Object to initialize as a ByteArray. */
const unsigned char *bytes, /* The array of bytes to use as the new value.
- * May be NULL even if length > 0. */
- int length) /* Length of the array of bytes, which must
- * be >= 0. */
+ * May be NULL even if numBytes > 0. */
+ int numBytes) /* Number of bytes in the array,
+ * must be >= 0. */
{
ByteArray *byteArrayPtr;
- Tcl_ObjIntRep ir;
+ Tcl_ObjInternalRep ir;
if (Tcl_IsShared(objPtr)) {
Tcl_Panic("%s called with shared object", "Tcl_SetByteArrayObj");
}
TclInvalidateStringRep(objPtr);
- if (length < 0) {
- length = 0;
- }
- byteArrayPtr = (ByteArray *)ckalloc(BYTEARRAY_SIZE(length));
- byteArrayPtr->bad = length;
- byteArrayPtr->used = length;
- byteArrayPtr->allocated = length;
+ assert(numBytes >= 0);
+ byteArrayPtr = (ByteArray *)ckalloc(BYTEARRAY_SIZE(numBytes));
+ byteArrayPtr->bad = numBytes;
+ byteArrayPtr->used = numBytes;
+ byteArrayPtr->allocated = numBytes;
- if ((bytes != NULL) && (length > 0)) {
- memcpy(byteArrayPtr->bytes, bytes, length);
+ if ((bytes != NULL) && (numBytes > 0)) {
+ memcpy(byteArrayPtr->bytes, bytes, numBytes);
}
SET_BYTEARRAY(&ir, byteArrayPtr);
- Tcl_StoreIntRep(objPtr, &properByteArrayType, &ir);
+ Tcl_StoreInternalRep(objPtr, &properByteArrayType, &ir);
}
/*
*----------------------------------------------------------------------
*
- * TclGetBytesFromObj --
+ * Tcl_GetBytesFromObj/TclGetBytesFromObj --
*
* Attempt to extract the value from objPtr in the representation
* of a byte sequence. On success return the extracted byte sequence.
- * On failures, return NULL and record error message and code in
+ * On failure, return NULL and record error message and code in
* interp (if not NULL).
*
* Results:
- * Pointer to array of bytes, or NULL. representing the ByteArray object.
- * Writes number of bytes in array to *lengthPtr.
+ * NULL or pointer to array of bytes representing the ByteArray object.
+ * Writes number of bytes in array to *numBytesPtr.
*
*----------------------------------------------------------------------
*/
@@ -458,21 +418,21 @@ unsigned char *
TclGetBytesFromObj(
Tcl_Interp *interp, /* For error reporting */
Tcl_Obj *objPtr, /* Value to extract from */
- int *lengthPtr) /* If non-NULL, filled with length of the
- * array of bytes in the ByteArray object. */
+ int *numBytesPtr) /* If non-NULL, write the number of bytes
+ * in the array here */
{
ByteArray *baPtr;
- const Tcl_ObjIntRep *irPtr = TclFetchIntRep(objPtr, &properByteArrayType);
+ const Tcl_ObjInternalRep *irPtr = TclFetchInternalRep(objPtr, &properByteArrayType);
if (irPtr == NULL) {
SetByteArrayFromAny(NULL, objPtr);
- irPtr = TclFetchIntRep(objPtr, &properByteArrayType);
+ irPtr = TclFetchInternalRep(objPtr, &properByteArrayType);
if (irPtr == NULL) {
if (interp) {
const char *nonbyte;
int ucs4;
- irPtr = TclFetchIntRep(objPtr, &tclByteArrayType);
+ irPtr = TclFetchInternalRep(objPtr, &tclByteArrayType);
baPtr = GET_BYTEARRAY(irPtr);
nonbyte = Tcl_UtfAtIndex(Tcl_GetString(objPtr), baPtr->bad);
TclUtfToUCS4(nonbyte, &ucs4);
@@ -487,8 +447,47 @@ TclGetBytesFromObj(
}
baPtr = GET_BYTEARRAY(irPtr);
- if (lengthPtr != NULL) {
- *lengthPtr = baPtr->used;
+ if (numBytesPtr != NULL) {
+ *numBytesPtr = baPtr->used;
+ }
+ return baPtr->bytes;
+}
+#undef Tcl_GetBytesFromObj
+unsigned char *
+Tcl_GetBytesFromObj(
+ Tcl_Interp *interp, /* For error reporting */
+ Tcl_Obj *objPtr, /* Value to extract from */
+ size_t *numBytesPtr) /* If non-NULL, write the number of bytes
+ * in the array here */
+{
+ ByteArray *baPtr;
+ const Tcl_ObjInternalRep *irPtr = TclFetchInternalRep(objPtr, &properByteArrayType);
+
+ if (irPtr == NULL) {
+ SetByteArrayFromAny(NULL, objPtr);
+ irPtr = TclFetchInternalRep(objPtr, &properByteArrayType);
+ if (irPtr == NULL) {
+ if (interp) {
+ const char *nonbyte;
+ int ucs4;
+
+ irPtr = TclFetchInternalRep(objPtr, &tclByteArrayType);
+ baPtr = GET_BYTEARRAY(irPtr);
+ nonbyte = Tcl_UtfAtIndex(Tcl_GetString(objPtr), baPtr->bad);
+ TclUtfToUCS4(nonbyte, &ucs4);
+
+ Tcl_SetObjResult(interp, Tcl_ObjPrintf(
+ "expected byte sequence but character %d "
+ "was '%1s' (U+%06X)", baPtr->bad, nonbyte, ucs4));
+ Tcl_SetErrorCode(interp, "TCL", "VALUE", "BYTES", NULL);
+ }
+ return NULL;
+ }
+ }
+ baPtr = GET_BYTEARRAY(irPtr);
+
+ if (numBytesPtr != NULL) {
+ *numBytesPtr = baPtr->used;
}
return baPtr->bytes;
}
@@ -515,24 +514,24 @@ TclGetBytesFromObj(
unsigned char *
Tcl_GetByteArrayFromObj(
Tcl_Obj *objPtr, /* The ByteArray object. */
- int *lengthPtr) /* If non-NULL, filled with length of the
- * array of bytes in the ByteArray object. */
+ int *numBytesPtr) /* If non-NULL, write the number of bytes
+ * in the array here */
{
ByteArray *baPtr;
- const Tcl_ObjIntRep *irPtr;
- unsigned char *result = TclGetBytesFromObj(NULL, objPtr, lengthPtr);
+ const Tcl_ObjInternalRep *irPtr;
+ unsigned char *result = TclGetBytesFromObj(NULL, objPtr, numBytesPtr);
if (result) {
return result;
}
- irPtr = TclFetchIntRep(objPtr, &tclByteArrayType);
+ irPtr = TclFetchInternalRep(objPtr, &tclByteArrayType);
assert(irPtr != NULL);
baPtr = GET_BYTEARRAY(irPtr);
- if (lengthPtr != NULL) {
- *lengthPtr = baPtr->used;
+ if (numBytesPtr != NULL) {
+ *numBytesPtr = baPtr->used;
}
return (unsigned char *) baPtr->bytes;
}
@@ -540,27 +539,28 @@ Tcl_GetByteArrayFromObj(
unsigned char *
TclGetByteArrayFromObj(
Tcl_Obj *objPtr, /* The ByteArray object. */
- size_t *lengthPtr) /* If non-NULL, filled with length of the
- * array of bytes in the ByteArray object. */
+ size_t *numBytesPtr) /* If non-NULL, write the number of bytes
+ * in the array here */
{
ByteArray *baPtr;
- const Tcl_ObjIntRep *irPtr;
- unsigned char *result = TclGetBytesFromObj(NULL, objPtr, (int *)NULL);
+ const Tcl_ObjInternalRep *irPtr;
+ unsigned char *result = Tcl_GetBytesFromObj(NULL, objPtr, numBytesPtr);
if (result) {
return result;
}
- irPtr = TclFetchIntRep(objPtr, &tclByteArrayType);
+ irPtr = TclFetchInternalRep(objPtr, &tclByteArrayType);
assert(irPtr != NULL);
baPtr = GET_BYTEARRAY(irPtr);
- if (lengthPtr != NULL) {
+ if (numBytesPtr != NULL) {
#if TCL_MAJOR_VERSION > 8
- *lengthPtr = baPtr->used;
+ *numBytesPtr = baPtr->used;
#else
- *lengthPtr = ((size_t)(unsigned)(baPtr->used + 1)) - 1;
+ /* TODO: What's going on here? Document or eliminate. */
+ *numBytesPtr = ((size_t)(unsigned)(baPtr->used + 1)) - 1;
#endif
}
return baPtr->bytes;
@@ -591,31 +591,34 @@ TclGetByteArrayFromObj(
unsigned char *
Tcl_SetByteArrayLength(
Tcl_Obj *objPtr, /* The ByteArray object. */
- int length) /* New length for internal byte array. */
+ int numBytes) /* Number of bytes in resized array */
{
ByteArray *byteArrayPtr;
unsigned newLength;
- Tcl_ObjIntRep *irPtr;
+ Tcl_ObjInternalRep *irPtr;
- assert(length >= 0);
- newLength = (unsigned int)length;
+ assert(numBytes >= 0);
+ newLength = (unsigned int)numBytes;
if (Tcl_IsShared(objPtr)) {
Tcl_Panic("%s called with shared object", "Tcl_SetByteArrayLength");
}
- irPtr = TclFetchIntRep(objPtr, &properByteArrayType);
+ irPtr = TclFetchInternalRep(objPtr, &properByteArrayType);
if (irPtr == NULL) {
- irPtr = TclFetchIntRep(objPtr, &tclByteArrayType);
+ irPtr = TclFetchInternalRep(objPtr, &tclByteArrayType);
if (irPtr == NULL) {
SetByteArrayFromAny(NULL, objPtr);
- irPtr = TclFetchIntRep(objPtr, &properByteArrayType);
+ irPtr = TclFetchInternalRep(objPtr, &properByteArrayType);
if (irPtr == NULL) {
- irPtr = TclFetchIntRep(objPtr, &tclByteArrayType);
+ irPtr = TclFetchInternalRep(objPtr, &tclByteArrayType);
}
}
}
+ /* Note that during truncation, the implementation does not free
+ * memory that is no longer needed. */
+
byteArrayPtr = GET_BYTEARRAY(irPtr);
if (newLength > byteArrayPtr->allocated) {
byteArrayPtr = (ByteArray *)ckrealloc(byteArrayPtr, BYTEARRAY_SIZE(newLength));
@@ -655,12 +658,12 @@ SetByteArrayFromAny(
unsigned char *dst;
Tcl_UniChar ch = 0;
ByteArray *byteArrayPtr;
- Tcl_ObjIntRep ir;
+ Tcl_ObjInternalRep ir;
- if (TclHasIntRep(objPtr, &properByteArrayType)) {
+ if (TclHasInternalRep(objPtr, &properByteArrayType)) {
return TCL_OK;
}
- if (TclHasIntRep(objPtr, &tclByteArrayType)) {
+ if (TclHasInternalRep(objPtr, &tclByteArrayType)) {
return TCL_OK;
}
@@ -668,6 +671,9 @@ SetByteArrayFromAny(
length = bad = objPtr->length;
srcEnd = src + length;
+ /* Note the allocation is over-sized, possibly by a factor of four,
+ * or even a factor of two with a proper byte array value. */
+
byteArrayPtr = (ByteArray *)ckalloc(BYTEARRAY_SIZE(length));
for (dst = byteArrayPtr->bytes; src < srcEnd; ) {
src += TclUtfToUniChar(src, &ch);
@@ -683,10 +689,10 @@ SetByteArrayFromAny(
if (bad == length) {
byteArrayPtr->bad = byteArrayPtr->used;
- Tcl_StoreIntRep(objPtr, &properByteArrayType, &ir);
+ Tcl_StoreInternalRep(objPtr, &properByteArrayType, &ir);
} else {
byteArrayPtr->bad = bad;
- Tcl_StoreIntRep(objPtr, &tclByteArrayType, &ir);
+ Tcl_StoreInternalRep(objPtr, &tclByteArrayType, &ir);
}
return TCL_OK;
@@ -713,14 +719,14 @@ static void
FreeByteArrayInternalRep(
Tcl_Obj *objPtr) /* Object with internal rep to free. */
{
- ckfree(GET_BYTEARRAY(TclFetchIntRep(objPtr, &tclByteArrayType)));
+ ckfree(GET_BYTEARRAY(TclFetchInternalRep(objPtr, &tclByteArrayType)));
}
static void
FreeProperByteArrayInternalRep(
Tcl_Obj *objPtr) /* Object with internal rep to free. */
{
- ckfree(GET_BYTEARRAY(TclFetchIntRep(objPtr, &properByteArrayType)));
+ ckfree(GET_BYTEARRAY(TclFetchInternalRep(objPtr, &properByteArrayType)));
}
/*
@@ -747,9 +753,9 @@ DupByteArrayInternalRep(
{
unsigned int length;
ByteArray *srcArrayPtr, *copyArrayPtr;
- Tcl_ObjIntRep ir;
+ Tcl_ObjInternalRep ir;
- srcArrayPtr = GET_BYTEARRAY(TclFetchIntRep(srcPtr, &tclByteArrayType));
+ srcArrayPtr = GET_BYTEARRAY(TclFetchInternalRep(srcPtr, &tclByteArrayType));
length = srcArrayPtr->used;
copyArrayPtr = (ByteArray *)ckalloc(BYTEARRAY_SIZE(length));
@@ -759,7 +765,7 @@ DupByteArrayInternalRep(
memcpy(copyArrayPtr->bytes, srcArrayPtr->bytes, length);
SET_BYTEARRAY(&ir, copyArrayPtr);
- Tcl_StoreIntRep(copyPtr, &tclByteArrayType, &ir);
+ Tcl_StoreInternalRep(copyPtr, &tclByteArrayType, &ir);
}
static void
@@ -769,9 +775,9 @@ DupProperByteArrayInternalRep(
{
unsigned int length;
ByteArray *srcArrayPtr, *copyArrayPtr;
- Tcl_ObjIntRep ir;
+ Tcl_ObjInternalRep ir;
- srcArrayPtr = GET_BYTEARRAY(TclFetchIntRep(srcPtr, &properByteArrayType));
+ srcArrayPtr = GET_BYTEARRAY(TclFetchInternalRep(srcPtr, &properByteArrayType));
length = srcArrayPtr->used;
copyArrayPtr = (ByteArray *)ckalloc(BYTEARRAY_SIZE(length));
@@ -781,7 +787,7 @@ DupProperByteArrayInternalRep(
memcpy(copyArrayPtr->bytes, srcArrayPtr->bytes, length);
SET_BYTEARRAY(&ir, copyArrayPtr);
- Tcl_StoreIntRep(copyPtr, &properByteArrayType, &ir);
+ Tcl_StoreInternalRep(copyPtr, &properByteArrayType, &ir);
}
/*
@@ -806,7 +812,7 @@ UpdateStringOfByteArray(
Tcl_Obj *objPtr) /* ByteArray object whose string rep to
* update. */
{
- const Tcl_ObjIntRep *irPtr = TclFetchIntRep(objPtr, &properByteArrayType);
+ const Tcl_ObjInternalRep *irPtr = TclFetchInternalRep(objPtr, &properByteArrayType);
ByteArray *byteArrayPtr = GET_BYTEARRAY(irPtr);
unsigned char *src = byteArrayPtr->bytes;
unsigned int i, length = byteArrayPtr->used;
@@ -836,7 +842,6 @@ UpdateStringOfByteArray(
for (i = 0; i < length; i++) {
dst += Tcl_UniCharToUtf(src[i], dst);
}
- (void) Tcl_InitStringRep(objPtr, NULL, size);
}
}
@@ -867,7 +872,7 @@ TclAppendBytesToByteArray(
{
ByteArray *byteArrayPtr;
unsigned int length, needed;
- Tcl_ObjIntRep *irPtr;
+ Tcl_ObjInternalRep *irPtr;
if (Tcl_IsShared(objPtr)) {
Tcl_Panic("%s called with shared object","TclAppendBytesToByteArray");
@@ -886,14 +891,14 @@ TclAppendBytesToByteArray(
length = (unsigned int) len;
- irPtr = TclFetchIntRep(objPtr, &properByteArrayType);
+ irPtr = TclFetchInternalRep(objPtr, &properByteArrayType);
if (irPtr == NULL) {
- irPtr = TclFetchIntRep(objPtr, &tclByteArrayType);
+ irPtr = TclFetchInternalRep(objPtr, &tclByteArrayType);
if (irPtr == NULL) {
SetByteArrayFromAny(NULL, objPtr);
- irPtr = TclFetchIntRep(objPtr, &properByteArrayType);
+ irPtr = TclFetchInternalRep(objPtr, &properByteArrayType);
if (irPtr == NULL) {
- irPtr = TclFetchIntRep(objPtr, &tclByteArrayType);
+ irPtr = TclFetchInternalRep(objPtr, &tclByteArrayType);
}
}
}
@@ -1503,7 +1508,7 @@ BinaryFormatCmd(
*----------------------------------------------------------------------
*/
-int
+static int
BinaryScanCmd(
TCL_UNUSED(ClientData),
Tcl_Interp *interp, /* Current interpreter. */
@@ -2123,7 +2128,7 @@ CopyNumber(
*
* FormatNumber --
*
- * This routine is called by Tcl_BinaryObjCmd to format a number into a
+ * This routine is called by BinaryFormatCmd to format a number into a
* location pointed at by cursor.
*
* Results:
@@ -2158,7 +2163,7 @@ FormatNumber(
*/
if (Tcl_GetDoubleFromObj(interp, src, &dvalue) != TCL_OK) {
- const Tcl_ObjIntRep *irPtr = TclFetchIntRep(src, &tclDoubleType);
+ const Tcl_ObjInternalRep *irPtr = TclFetchInternalRep(src, &tclDoubleType);
if (irPtr == NULL) {
return TCL_ERROR;
}
@@ -2178,7 +2183,7 @@ FormatNumber(
*/
if (Tcl_GetDoubleFromObj(interp, src, &dvalue) != TCL_OK) {
- const Tcl_ObjIntRep *irPtr = TclFetchIntRep(src, &tclDoubleType);
+ const Tcl_ObjInternalRep *irPtr = TclFetchInternalRep(src, &tclDoubleType);
if (irPtr == NULL) {
return TCL_ERROR;
@@ -2292,7 +2297,7 @@ FormatNumber(
*
* ScanNumber --
*
- * This routine is called by Tcl_BinaryObjCmd to scan a number out of a
+ * This routine is called by BinaryScanCmd to scan a number out of a
* buffer.
*
* Results:
diff --git a/generic/tclCkalloc.c b/generic/tclCkalloc.c
index 6cf3c4c..f2394b1 100644
--- a/generic/tclCkalloc.c
+++ b/generic/tclCkalloc.c
@@ -381,7 +381,7 @@ Tcl_DumpActiveMemory(
* Tcl_DbCkalloc - debugging ckalloc
*
* Allocate the requested amount of space plus some extra for guard bands
- * at both ends of the request, plus a size, panicing if there isn't
+ * at both ends of the request, plus a size, panicking if there isn't
* enough space, then write in the guard bands and return the address of
* the space in the middle that the user asked for.
*
diff --git a/generic/tclClock.c b/generic/tclClock.c
index 95cccf8..ccb7f4b 100644
--- a/generic/tclClock.c
+++ b/generic/tclClock.c
@@ -1542,7 +1542,7 @@ ClockGetdatefieldsObjCmd(
* that it isn't.
*/
- if (objv[1]->typePtr == &tclBignumType) {
+ if (TclHasInternalRep(objv[1], &tclBignumType)) {
Tcl_SetObjResult(interp, lit[LIT_INTEGER_VALUE_TOO_LARGE]);
return TCL_ERROR;
}
diff --git a/generic/tclCmdMZ.c b/generic/tclCmdMZ.c
index d37f5bf..f8f0004 100644
--- a/generic/tclCmdMZ.c
+++ b/generic/tclCmdMZ.c
@@ -1611,7 +1611,7 @@ StringIsCmd(
case STR_IS_BOOL:
case STR_IS_TRUE:
case STR_IS_FALSE:
- if (!TclHasIntRep(objPtr, &tclBooleanType)
+ if (!TclHasInternalRep(objPtr, &tclBooleanType)
&& (TCL_OK != TclSetBooleanFromAny(NULL, objPtr))) {
if (strict) {
result = 0;
@@ -1681,9 +1681,9 @@ StringIsCmd(
chcomp = Tcl_UniCharIsDigit;
break;
case STR_IS_DOUBLE: {
- if (TclHasIntRep(objPtr, &tclDoubleType) ||
- TclHasIntRep(objPtr, &tclIntType) ||
- TclHasIntRep(objPtr, &tclBignumType)) {
+ if (TclHasInternalRep(objPtr, &tclDoubleType) ||
+ TclHasInternalRep(objPtr, &tclIntType) ||
+ TclHasInternalRep(objPtr, &tclBignumType)) {
break;
}
string1 = TclGetStringFromObj(objPtr, &length1);
@@ -1702,7 +1702,7 @@ StringIsCmd(
failat = stop - string1;
if (stop < end) {
result = 0;
- TclFreeIntRep(objPtr);
+ TclFreeInternalRep(objPtr);
}
}
break;
@@ -1712,8 +1712,8 @@ StringIsCmd(
break;
case STR_IS_INT:
case STR_IS_ENTIER:
- if (TclHasIntRep(objPtr, &tclIntType) ||
- TclHasIntRep(objPtr, &tclBignumType)) {
+ if (TclHasInternalRep(objPtr, &tclIntType) ||
+ TclHasInternalRep(objPtr, &tclBignumType)) {
break;
}
string1 = TclGetStringFromObj(objPtr, &length1);
@@ -1742,7 +1742,7 @@ StringIsCmd(
result = 0;
failat = stop - string1;
- TclFreeIntRep(objPtr);
+ TclFreeInternalRep(objPtr);
}
} else {
/*
@@ -1795,7 +1795,7 @@ StringIsCmd(
*/
failat = stop - string1;
- TclFreeIntRep(objPtr);
+ TclFreeInternalRep(objPtr);
}
} else {
/*
@@ -1990,7 +1990,7 @@ StringMapCmd(
*/
if (!TclHasStringRep(objv[objc-2])
- && TclHasIntRep(objv[objc-2], &tclDictType)) {
+ && TclHasInternalRep(objv[objc-2], &tclDictType)) {
int i, done;
Tcl_DictSearch search;
diff --git a/generic/tclCompCmds.c b/generic/tclCompCmds.c
index 13589b2..a2e11c0 100644
--- a/generic/tclCompCmds.c
+++ b/generic/tclCompCmds.c
@@ -2641,8 +2641,8 @@ TclCompileLmapCmd(
Tcl_Interp *interp, /* Used for error reporting. */
Tcl_Parse *parsePtr, /* Points to a parse structure for the command
* created by Tcl_ParseCommand. */
- Command *cmdPtr, /* Points to defintion of command being
- * compiled. */
+ Command *cmdPtr, /* Points to the definition of the command
+ * being compiled. */
CompileEnv *envPtr) /* Holds resulting instructions. */
{
return CompileEachloopCmd(interp, parsePtr, cmdPtr, envPtr,
@@ -2703,7 +2703,7 @@ CompileEachloopCmd(
}
/*
- * Bail out if the body requires substitutions in order to insure correct
+ * Bail out if the body requires substitutions in order to ensure correct
* behaviour. [Bug 219166]
*/
diff --git a/generic/tclCompExpr.c b/generic/tclCompExpr.c
index 03aebe3..23d8711 100644
--- a/generic/tclCompExpr.c
+++ b/generic/tclCompExpr.c
@@ -2109,7 +2109,7 @@ ParseLexeme(
* Example: Inf + luence + () becomes a valid function call.
* [Bug 3401704]
*/
- if (TclHasIntRep(literal, &tclDoubleType)) {
+ if (TclHasInternalRep(literal, &tclDoubleType)) {
const char *p = start;
while (p < end) {
@@ -2520,7 +2520,7 @@ CompileExprTree(
* However, the design of the "global" and "local"
* LiteralTable does not permit the value of lePtr->objPtr
* to change. So rather than replace lePtr->objPtr, we do
- * surgery to transfer our desired intrep into it.
+ * surgery to transfer our desired internalrep into it.
*/
objPtr->typePtr = literal->typePtr;
@@ -2533,9 +2533,9 @@ CompileExprTree(
* When optimize==0, we know the expression is a one-off and
* there's nothing to be gained from sharing literals when
* they won't live long, and the copies we have already have
- * an appropriate intrep. In this case, skip literal
+ * an appropriate internalrep. In this case, skip literal
* registration that would enable sharing, and use the routine
- * that preserves intreps.
+ * that preserves internalreps.
*/
TclEmitPush(TclAddLiteralObj(envPtr, literal, NULL), envPtr);
@@ -2572,7 +2572,7 @@ CompileExprTree(
if ((tableValue->typePtr == NULL) &&
(objPtr->typePtr != NULL)) {
/*
- * Same intrep surgery as for OT_LITERAL.
+ * Same internalrep surgery as for OT_LITERAL.
*/
tableValue->typePtr = objPtr->typePtr;
diff --git a/generic/tclCompile.c b/generic/tclCompile.c
index 6ffb3dd..c89fedb 100644
--- a/generic/tclCompile.c
+++ b/generic/tclCompile.c
@@ -717,8 +717,8 @@ static void EnterCmdWordData(ExtCmdLoc *eclPtr, int srcOffset,
static void ReleaseCmdWordData(ExtCmdLoc *eclPtr);
/*
- * The structure below defines the bytecode Tcl object type by means of
- * procedures that can be invoked by generic object code.
+ * tclByteCodeType provides the standard type management procedures for the
+ * bytecode type.
*/
const Tcl_ObjType tclByteCodeType = {
@@ -730,8 +730,8 @@ const Tcl_ObjType tclByteCodeType = {
};
/*
- * The structure below defines a bytecode Tcl object type to hold the
- * compiled bytecode for the [subst]itution of Tcl values.
+ * subtCodeType provides the standard type managemnt procedures for the
+ * substcode type, which represents substiution within a Tcl value.
*/
static const Tcl_ObjType substCodeType = {
@@ -756,16 +756,14 @@ static const Tcl_ObjType substCodeType = {
* TclSetByteCodeFromAny --
*
* Part of the bytecode Tcl object type implementation. Attempts to
- * generate an byte code internal form for the Tcl object "objPtr" by
- * compiling its string representation. This function also takes a hook
- * procedure that will be invoked to perform any needed post processing
- * on the compilation results before generating byte codes. interp is
+ * compile the string representation of the objPtr into bytecode. Accepts
+ * a hook routine that is invoked to perform any needed post-processing on
+ * the compilation results before generating byte codes. interp is the
* compilation context and may not be NULL.
*
* Results:
- * The return value is a standard Tcl object result. If an error occurs
- * during compilation, an error message is left in the interpreter's
- * result.
+ * A standard Tcl object result. If an error occurs during compilation, an
+ * error message is left in the interpreter's result.
*
* Side effects:
* Frees the old internal representation. If no error occurs, then the
@@ -807,7 +805,7 @@ TclSetByteCodeFromAny(
length = objPtr->length;
/*
- * TIP #280: Pick up the CmdFrame in which the BC compiler was invoked and
+ * TIP #280: Pick up the CmdFrame in which the BC compiler was invoked, and
* use to initialize the tracking in the compiler. This information was
* stored by TclCompEvalObj and ProcCompileProc.
*/
@@ -816,15 +814,14 @@ TclSetByteCodeFromAny(
iPtr->invokeCmdFramePtr, iPtr->invokeWord);
/*
- * Now we check if we have data about invisible continuation lines for the
- * script, and make it available to the compile environment, if so.
+ * Make available to the compilation environment any data about invisible
+ * continuation lines for the script.
*
* It is not clear if the script Tcl_Obj* can be free'd while the compiler
* is using it, leading to the release of the associated ContLineLoc
- * structure as well. To ensure that the latter doesn't happen we set a
- * lock on it. We release this lock in the function TclFreeCompileEnv(),
- * found in this file. The "lineCLPtr" hashtable is managed in the file
- * "tclObj.c".
+ * structure as well. To ensure that the latter doesn't happen set a lock
+ * on it, which is released in TclFreeCompileEnv(). The "lineCLPtr"
+ * hashtable tclObj.c.
*/
clLocPtr = TclContinuationsGet(objPtr);
@@ -835,7 +832,7 @@ TclSetByteCodeFromAny(
TclCompileScript(interp, stringPtr, length, &compEnv);
/*
- * Successful compilation. Add a "done" instruction at the end.
+ * Compilation succeeded. Add a "done" instruction at the end.
*/
TclEmitOpcode(INST_DONE, &compEnv);
@@ -843,9 +840,9 @@ TclSetByteCodeFromAny(
/*
* Check for optimizations!
*
- * Test if the generated code is free of most hazards; if so, recompile
- * but with generation of INST_START_CMD disabled. This produces somewhat
- * faster code in some cases, and more compact code in more.
+ * If the generated code is free of most hazards, recompile with generation
+ * of INST_START_CMD disabled to produce code that more compact in many
+ * cases, and also sometimes more performant.
*/
if (Tcl_GetParent(interp) == NULL &&
@@ -875,7 +872,7 @@ TclSetByteCodeFromAny(
}
/*
- * Invoke the compilation hook procedure if one exists.
+ * Invoke the compilation hook procedure if there is one.
*/
if (hookProc) {
@@ -884,7 +881,7 @@ TclSetByteCodeFromAny(
/*
* Change the object into a ByteCode object. Ownership of the literal
- * objects and aux data items is given to the ByteCode object.
+ * objects and aux data items passes to the ByteCode object.
*/
#ifdef TCL_COMPILE_DEBUG
@@ -915,12 +912,12 @@ TclSetByteCodeFromAny(
* compiling its string representation.
*
* Results:
- * The return value is a standard Tcl object result. If an error occurs
- * during compilation, an error message is left in the interpreter's
- * result unless "interp" is NULL.
+ * A standard Tcl object result. If an error occurs during compilation and
+ * "interp" is not null, an error message is left in the interpreter's
+ * result.
*
* Side effects:
- * Frees the old internal representation. If no error occurs, then the
+ * Frees the old internal representation. If no error occurs then the
* compiled code is stored as "objPtr"s bytecode representation. Also, if
* debugging, initializes the "tcl_traceCompile" Tcl variable used to
* trace compilations.
@@ -932,7 +929,7 @@ static int
SetByteCodeFromAny(
Tcl_Interp *interp, /* The interpreter for which the code is being
* compiled. Must not be NULL. */
- Tcl_Obj *objPtr) /* The object to make a ByteCode object. */
+ Tcl_Obj *objPtr) /* The object to compile to bytecode */
{
if (interp == NULL) {
return TCL_ERROR;
@@ -946,9 +943,9 @@ SetByteCodeFromAny(
* DupByteCodeInternalRep --
*
* Part of the bytecode Tcl object type implementation. However, it does
- * not copy the internal representation of a bytecode Tcl_Obj, but
- * instead leaves the new object untyped (with a NULL type pointer).
- * Code will be compiled for the new object only if necessary.
+ * not copy the internal representation of a bytecode Tcl_Obj, instead
+ * assigning NULL to the type pointer of the new object. Code is compiled
+ * for the new object only if necessary.
*
* Results:
* None.
@@ -980,9 +977,9 @@ DupByteCodeInternalRep(
* None.
*
* Side effects:
- * The bytecode object's internal rep is marked invalid and its code gets
- * freed unless the code is actively being executed. In that case the
- * cleanup is delayed until the last execution of the code completes.
+ * The bytecode object's internal rep is invalidated and its code is freed
+ * unless the code is actively being executed, in which case cleanup is
+ * delayed until the last execution of the code completes.
*
*----------------------------------------------------------------------
*/
@@ -993,7 +990,7 @@ FreeByteCodeInternalRep(
{
ByteCode *codePtr;
- ByteCodeGetIntRep(objPtr, &tclByteCodeType, codePtr);
+ ByteCodeGetInternalRep(objPtr, &tclByteCodeType, codePtr);
assert(codePtr != NULL);
TclReleaseByteCode(codePtr);
@@ -1004,16 +1001,16 @@ FreeByteCodeInternalRep(
*
* TclReleaseByteCode --
*
- * This procedure does all the real work of freeing up a bytecode
- * object's ByteCode structure. It's called only when the structure's
- * reference count becomes zero.
+ * Does all the real work of freeing up a bytecode object's ByteCode
+ * structure. Called only when the structure's reference count
+ * is zero.
*
* Results:
* None.
*
* Side effects:
- * Frees objPtr's bytecode internal representation and sets its type NULL
- * Also releases its literals and frees its auxiliary data items.
+ * Frees objPtr's bytecode internal representation and sets its type to
+ * NULL. Also releases its literals and frees its auxiliary data items.
*
*----------------------------------------------------------------------
*/
@@ -1089,8 +1086,8 @@ CleanupByteCode(
/*
* A single heap object holds the ByteCode structure and its code, object,
* command location, and auxiliary data arrays. This means we only need to
- * 1) decrement the ref counts of the LiteralEntry's in its literal array,
- * 2) call the free procs for the auxiliary data items, 3) free the
+ * 1) decrement the ref counts of each LiteralEntry in the literal array,
+ * 2) call the free procedures for the auxiliary data items, 3) free the
* localCache if it is unused, and finally 4) free the ByteCode
* structure's heap object.
*
@@ -1099,11 +1096,11 @@ CleanupByteCode(
* the global literal table. They instead maintain private references to
* their literals which must be decremented.
*
- * In order to insure a proper and efficient cleanup of the literal array
- * when it contains non-shared literals [Bug 983660], we also distinguish
- * the case of an interpreter being deleted (signaled by interp == NULL).
+ * In order to ensure proper and efficient cleanup of the literal array
+ * when it contains non-shared literals [Bug 983660], distinguish the case
+ * of an interpreter being deleted, which is signaled by interp == NULL.
* Also, as the interp deletion will remove the global literal table
- * anyway, we avoid the extra cost of updating it for each literal being
+ * anyway, avoid the extra cost of updating it for each literal being
* released.
*/
@@ -1135,9 +1132,9 @@ CleanupByteCode(
}
/*
- * TIP #280. Release the location data associated with this byte code
- * structure, if any. NOTE: The interp we belong to may be gone already,
- * and the data with it.
+ * TIP #280. Release the location data associated with this bytecode
+ * structure, if any. The associated interp may be gone already, and the
+ * data with it.
*
* See also tclBasic.c, DeleteInterpProc
*/
@@ -1165,8 +1162,8 @@ CleanupByteCode(
*
* IsCompactibleCompileEnv --
*
- * Checks to see if we may apply some basic compaction optimizations to a
- * piece of bytecode. Idempotent.
+ * Determines whether some basic compaction optimizations may be applied
+ * to a piece of bytecode. Idempotent.
*
* ---------------------------------------------------------------------
*/
@@ -1180,7 +1177,7 @@ IsCompactibleCompileEnv(
/*
* Special: procedures in the '::tcl' namespace (or its children) are
- * considered to be well-behaved and so can have compaction applied even
+ * considered to be well-behaved, so compaction can be applied to them even
* if it would otherwise be invalid.
*/
@@ -1196,10 +1193,10 @@ IsCompactibleCompileEnv(
/*
* Go through and ensure that no operation involved can cause a desired
- * change of bytecode sequence during running. This comes down to ensuring
- * that there are no mapped variables (due to traces) or calls to external
- * commands (traces, [uplevel] trickery). This is actually a very
- * conservative check; it turns down a lot of code that is OK in practice.
+ * change of bytecode sequence during its execution. This comes down to
+ * ensuring that there are no mapped variables (due to traces) or calls to
+ * external commands (traces, [uplevel] trickery). This is actually a very
+ * conservative check. It turns down a lot of code that is OK in practice.
*/
for (pc = envPtr->codeStart ; pc < envPtr->codeNext ; pc += size) {
@@ -1235,8 +1232,8 @@ IsCompactibleCompileEnv(
*
* Tcl_SubstObj --
*
- * This function performs the substitutions specified on the given string
- * as described in the user documentation for the "subst" Tcl command.
+ * Performs substitutions on the given string as described in the user
+ * documentation for "subst".
*
* Results:
* A Tcl_Obj* containing the substituted string, or NULL to indicate that
@@ -1268,14 +1265,14 @@ Tcl_SubstObj(
*
* Tcl_NRSubstObj --
*
- * Request substitution of a Tcl value by the NR stack.
+ * Adds substitution within the value of objPtr to the NR execution stack.
*
* Results:
- * Returns TCL_OK.
+ * TCL_OK.
*
* Side effects:
* Compiles objPtr into bytecode that performs the substitutions as
- * governed by flags and places callbacks on the NR stack to execute
+ * governed by flags, adds a callback to the NR execution stack to execute
* the bytecode and store the result in the interp.
*
*----------------------------------------------------------------------
@@ -1299,11 +1296,11 @@ Tcl_NRSubstObj(
*
* CompileSubstObj --
*
- * Compile a Tcl value into ByteCode implementing its substitution, as
- * governed by flags.
+ * Compiles a value into bytecode that performs substitution within the
+ * value, as governed by flags.
*
* Results:
- * A (ByteCode *) is returned pointing to the resulting ByteCode.
+ * A (ByteCode *) is pointing to the resulting ByteCode.
*
* Side effects:
* The Tcl_ObjType of objPtr is changed to the "substcode" type, and the
@@ -1323,7 +1320,7 @@ CompileSubstObj(
Interp *iPtr = (Interp *) interp;
ByteCode *codePtr = NULL;
- ByteCodeGetIntRep(objPtr, &substCodeType, codePtr);
+ ByteCodeGetInternalRep(objPtr, &substCodeType, codePtr);
if (codePtr != NULL) {
Namespace *nsPtr = iPtr->varFramePtr->nsPtr;
@@ -1335,7 +1332,7 @@ CompileSubstObj(
|| (codePtr->nsEpoch != nsPtr->resolverEpoch)
|| (codePtr->localCachePtr !=
iPtr->varFramePtr->localCachePtr)) {
- Tcl_StoreIntRep(objPtr, &substCodeType, NULL);
+ Tcl_StoreInternalRep(objPtr, &substCodeType, NULL);
codePtr = NULL;
}
}
@@ -1373,9 +1370,9 @@ CompileSubstObj(
*
* FreeSubstCodeInternalRep --
*
- * Part of the substcode Tcl object type implementation. Frees the
- * storage associated with a substcode object's internal representation
- * unless its code is actively being executed.
+ * Part of the "substcode" Tcl object type implementation. Frees the
+ * storage associated with the substcode internal representation of a
+ * Tcl_Obj unless its code is actively being executed.
*
* Results:
* None.
@@ -1394,7 +1391,7 @@ FreeSubstCodeInternalRep(
{
ByteCode *codePtr;
- ByteCodeGetIntRep(objPtr, &substCodeType, codePtr);
+ ByteCodeGetInternalRep(objPtr, &substCodeType, codePtr);
assert(codePtr != NULL);
TclReleaseByteCode(codePtr);
@@ -1629,14 +1626,14 @@ TclInitCompileEnv(
*
* TclFreeCompileEnv --
*
- * Free the storage allocated in a CompileEnv compilation environment
+ * Frees the storage allocated in a CompileEnv compilation environment
* structure.
*
* Results:
* None.
*
* Side effects:
- * Allocated storage in the CompileEnv structure is freed. Note that its
+ * Allocated storage in the CompileEnv structure is freed, although its
* local literal table is not deleted and its literal objects are not
* released. In addition, storage referenced by its auxiliary data items
* is not freed. This is done so that, when compilation is successful,
@@ -1707,10 +1704,11 @@ TclFreeCompileEnv(
*
* TclWordKnownAtCompileTime --
*
- * Test whether the value of a token is completely known at compile time.
+ * Determines whether the value of a token is completely known at compile
+ * time.
*
* Results:
- * Returns true if the tokenPtr argument points to a word value that is
+ * True if the tokenPtr argument points to a word value that is
* completely known at compile time. Generally, values that are known at
* compile time can be compiled to their values, while values that cannot
* be known until substitution at runtime must be compiled to bytecode
@@ -1787,12 +1785,12 @@ TclWordKnownAtCompileTime(
*
* TclCompileScript --
*
- * Compile a Tcl script in a string.
+ * Compiles a Tcl script in a string.
*
* Results:
- * The return value is TCL_OK on a successful compilation and TCL_ERROR
- * on failure. If TCL_ERROR is returned, then the interpreter's result
- * contains an error message.
+ *
+ * A standard Tcl result. If an error occurs, an
+ * error message is left in the interpreter's result.
*
* Side effects:
* Adds instructions to envPtr to evaluate the script at runtime.
@@ -1929,14 +1927,14 @@ CompileExpanded(
/*
* The stack depth during argument expansion can only be managed at
* runtime, as the number of elements in the expanded lists is not known
- * at compile time. We adjust here the stack depth estimate so that it is
+ * at compile time. Adjust the stack depth estimate here so that it is
* correct after the command with expanded arguments returns.
*
* The end effect of this command's invocation is that all the words of
- * the command are popped from the stack, and the result is pushed: the
+ * the command are popped from the stack and the result is pushed: The
* stack top changes by (1-wordIdx).
*
- * Note that the estimates are not correct while the command is being
+ * The estimates are not correct while the command is being
* prepared and run, INST_EXPAND_STKTOP is not stack-neutral in general.
*/
@@ -1956,16 +1954,16 @@ CompileCmdCompileProc(
int depth = TclGetStackDepth(envPtr);
/*
- * Emit of the INST_START_CMD instruction is controlled by the value of
+ * Emission of the INST_START_CMD instruction is controlled by the value of
* envPtr->atCmdStart:
*
- * atCmdStart == 2 : We are not using the INST_START_CMD instruction.
- * atCmdStart == 1 : INST_START_CMD was the last instruction emitted.
- * : We do not need to emit another. Instead we
- * : increment the number of cmds started at it (except
- * : for the special case at the start of a script.)
- * atCmdStart == 0 : The last instruction was something else. We need
- * : to emit INST_START_CMD here.
+ * atCmdStart == 2 : Don't use the INST_START_CMD instruction.
+ * atCmdStart == 1 : INST_START_CMD was the last instruction emitted,
+ * : so no need to emit another. Instead
+ * : increment the number of cmds started at it, except
+ * : for the special case at the start of a script.
+ * atCmdStart == 0 : The last instruction was something else.
+ * : Emit INST_START_CMD here.
*/
switch (envPtr->atCmdStart) {
@@ -1988,7 +1986,7 @@ CompileCmdCompileProc(
if (TCL_OK == TclAttemptCompileProc(interp, parsePtr, 1, cmdPtr, envPtr)) {
if (incrOffset >= 0) {
/*
- * We successfully compiled a command. Increment the number of
+ * Command compiled succesfully. Increment the number of
* commands that start at the currently active INST_START_CMD.
*/
@@ -2057,7 +2055,7 @@ CompileCommandTokens(
/*
* TIP #280. Scan the words and compute the extended location information.
- * The map first contain full per-word line information for use by the
+ * At first the map first contains full per-word line information for use by the
* compiler. This is later replaced by a reduced form which signals
* non-literal words, stored in 'wlines'.
*/
@@ -2099,7 +2097,7 @@ CompileCommandTokens(
}
}
- /* If cmdPtr != NULL, we will try to call cmdPtr->compileProc */
+ /* If cmdPtr != NULL, try to call cmdPtr->compileProc */
if (cmdPtr) {
code = CompileCmdCompileProc(interp, parsePtr, cmdPtr, envPtr);
}
@@ -2126,8 +2124,8 @@ CompileCommandTokens(
(envPtr->codeNext-envPtr->codeStart) - startCodeOffset);
/*
- * TIP #280: Free full form of per-word line data and insert the reduced
- * form now
+ * TIP #280: Free the full form of per-word line data and insert the
+ * reduced form now.
*/
envPtr->line = cmdLine;
@@ -2165,10 +2163,10 @@ TclCompileScript(
}
/*
* 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).
+ * nested calls of TclCompileScript, considering interp recursionlimit.
+ * Use factor 5/4 (1.25) to avoid being too mistaken when recognizing the
+ * limit 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(
@@ -2311,8 +2309,8 @@ TclCompileScript(
*
* TclCompileTokens --
*
- * Given an array of tokens parsed from a Tcl command (e.g., the tokens
- * that make up a word) this procedure emits instructions to evaluate the
+ * Given an array of tokens parsed from a Tcl command, e.g. the tokens
+ * that make up a word, emits instructions to evaluate the
* tokens and concatenate their values to form a single result value on
* the interpreter's runtime evaluation stack.
*
@@ -2417,18 +2415,16 @@ TclCompileTokens(
int depth = TclGetStackDepth(envPtr);
/*
- * For the handling of continuation lines in literals we first check if
- * this is actually a literal. For if not we can forego the additional
- * processing. Otherwise we pre-allocate a small table to store the
- * locations of all continuation lines we find in this literal, if any.
- * The table is extended if needed.
+ * if this is actually a literal, handle continuation lines by
+ * preallocating a small table to store the locations of any continuation
+ * lines we find in this literal. The table is extended if needed.
*
- * Note: Different to the equivalent code in function 'TclSubstTokens()'
- * (see file "tclParse.c") we do not seem to need the 'adjust' variable.
- * We also do not seem to need code which merges continuation line
- * information of multiple words which concat'd at runtime. Either that or
- * I have not managed to find a test case for these two possibilities yet.
- * It might be a difference between compile- versus run-time processing.
+ * Note: In contrast with the analagous code in 'TclSubstTokens()' the
+ * 'adjust' variable seems unneeded here. The code which merges
+ * continuation line information of multiple words which concat'd at
+ * runtime also seems unneeded. Either that or I have not managed to find a
+ * test case for these two possibilities yet. It might be a difference
+ * between compile- versus run-time processing.
*/
numCL = 0;
@@ -2464,18 +2460,17 @@ TclCompileTokens(
Tcl_DStringAppend(&textBuffer, buffer, length);
/*
- * If the backslash sequence we found is in a literal, and
- * represented a continuation line, we compute and store its
+ * If the identified backslash sequence is in a literal and
+ * represented a continuation line, compute and store its
* location (as char offset to the beginning of the _result_
* script). We may have to extend the table of locations.
*
- * Note that the continuation line information is relevant even if
- * the word we are processing is not a literal, as it can affect
- * nested commands. See the branch for TCL_TOKEN_COMMAND below,
- * where the adjustment we are tracking here is taken into
- * account. The good thing is that we do not need a table of
- * everything, just the number of lines we have to add as
- * correction.
+ * The continuation line information is relevant even if the word
+ * being processed is not a literal, as it can affect nested
+ * commands. See the branch below for TCL_TOKEN_COMMAND, where the
+ * adjustment being tracked here is taken into account. The good
+ * thing is a table of everything is not needed, just the number of
+ * lines to to add as correction.
*/
if ((length == 1) && (buffer[0] == ' ') &&
@@ -2601,13 +2596,13 @@ TclCompileTokens(
* TclCompileCmdWord --
*
* Given an array of parse tokens for a word containing one or more Tcl
- * commands, emit inline instructions to execute them. This procedure
- * differs from TclCompileTokens in that a simple word such as a loop
- * body enclosed in braces is not just pushed as a string, but is itself
- * parsed into tokens and compiled.
+ * commands, emits inline instructions to execute them. In contrast with
+ * TclCompileTokens, a simple word such as a loop body enclosed in braces
+ * is not just pushed as a string, but is itself parsed into tokens and
+ * compiled.
*
* Results:
- * The return value is a standard Tcl result. If an error occurs, an
+ * A standard Tcl result. If an error occurs, an
* error message is left in the interpreter's result.
*
* Side effects:
@@ -2627,16 +2622,16 @@ TclCompileCmdWord(
{
if ((count == 1) && (tokenPtr->type == TCL_TOKEN_TEXT)) {
/*
- * Handle the common case: if there is a single text token, compile it
+ * The common case that there is a single text token. Compile it
* into an inline sequence of instructions.
*/
TclCompileScript(interp, tokenPtr->start, tokenPtr->size, envPtr);
} else {
/*
- * Multiple tokens or the single token involves substitutions. Emit
- * instructions to invoke the eval command procedure at runtime on the
- * result of evaluating the tokens.
+ * Either there are multiple tokens, or the single token involves
+ * substitutions. Emit instructions to invoke the eval command
+ * procedure at runtime on the result of evaluating the tokens.
*/
TclCompileTokens(interp, tokenPtr, count, envPtr);
@@ -2650,13 +2645,12 @@ TclCompileCmdWord(
* TclCompileExprWords --
*
* Given an array of parse tokens representing one or more words that
- * contain a Tcl expression, emit inline instructions to execute the
- * expression. This procedure differs from TclCompileExpr in that it
- * supports Tcl's two-level substitution semantics for expressions that
- * appear as command words.
+ * contain a Tcl expression, emits inline instructions to execute the
+ * expression. In contrast with TclCompileExpr, supports Tcl's two-level
+ * substitution semantics for an expression that appears as command words.
*
* Results:
- * The return value is a standard Tcl result. If an error occurs, an
+ * A standard Tcl result. If an error occurs, an
* error message is left in the interpreter's result.
*
* Side effects:
@@ -2718,10 +2712,10 @@ TclCompileExprWords(
*
* TclCompileNoOp --
*
- * Function called to compile no-op's
+ * Compiles no-op's
*
* Results:
- * The return value is TCL_OK, indicating successful compilation.
+ * TCL_OK if completion was successful.
*
* Side effects:
* Instructions are added to envPtr to execute a no-op at runtime. No
@@ -2760,14 +2754,14 @@ TclCompileNoOp(
*
* TclInitByteCodeObj --
*
- * Create a ByteCode structure and initialize it from a CompileEnv
+ * Creates a ByteCode structure and initializes it from a CompileEnv
* compilation environment structure. The ByteCode structure is smaller
* and contains just that information needed to execute the bytecode
* instructions resulting from compiling a Tcl script. The resulting
* structure is placed in the specified object.
*
* Results:
- * A newly constructed ByteCode object is stored in the internal
+ * A newly-constructed ByteCode object is stored in the internal
* representation of the objPtr.
*
* Side effects:
@@ -2790,7 +2784,7 @@ PreventCycle(
for (i = 0; i < envPtr->literalArrayNext; i++) {
if (objPtr == TclFetchLiteral(envPtr, i)) {
/*
- * Prevent circular reference where the bytecode intrep of
+ * Prevent circular reference where the bytecode internalrep of
* a value contains a literal which is that same value.
* If this is allowed to happen, refcount decrements may not
* reach zero, and memory may leak. Bugs 467523, 3357771
@@ -2798,7 +2792,7 @@ PreventCycle(
* NOTE: [Bugs 3392070, 3389764] We make a copy based completely
* on the string value, and do not call Tcl_DuplicateObj() so we
* can be sure we do not have any lingering cycles hiding in
- * the intrep.
+ * the internalrep.
*/
int numBytes;
const char *bytes = TclGetStringFromObj(objPtr, &numBytes);
@@ -2969,7 +2963,7 @@ TclInitByteCodeObj(
* by making its internal rep point to the just compiled ByteCode.
*/
- ByteCodeSetIntRep(objPtr, typePtr, codePtr);
+ ByteCodeSetInternalRep(objPtr, typePtr, codePtr);
return codePtr;
}
@@ -3102,16 +3096,15 @@ TclFindCompiledLocal(
*
* TclExpandCodeArray --
*
- * Procedure that uses malloc to allocate more storage for a CompileEnv's
- * code array.
+ * Uses malloc to allocate more storage for a CompileEnv's code array.
*
* Results:
* None.
*
* Side effects:
- * The byte code array in *envPtr is reallocated to a new array of double
- * the size, and if envPtr->mallocedCodeArray is non-zero the old array
- * is freed. Byte codes are copied from the old array to the new one.
+ * The size of the bytecode array is doubled. If envPtr->mallocedCodeArray
+ * is non-zero the old array is freed. Byte codes are copied from the old
+ * array to the new one.
*
*----------------------------------------------------------------------
*/
@@ -3138,8 +3131,8 @@ TclExpandCodeArray(
envPtr->codeStart = (unsigned char *)ckrealloc(envPtr->codeStart, newBytes);
} else {
/*
- * envPtr->codeStart isn't a ckalloc'd pointer, so we must code a
- * ckrealloc equivalent for ourselves.
+ * envPtr->exceptArrayPtr isn't a Tcl_Alloc'd pointer, so
+ * perform the equivalent of Tcl_Realloc directly.
*/
unsigned char *newPtr = (unsigned char *)ckalloc(newBytes);
@@ -3455,7 +3448,7 @@ TclCreateExceptRange(
* TclGetInnermostExceptionRange --
*
* Returns the innermost exception range that covers the current code
- * creation point, and (optionally) the stack depth that is expected at
+ * creation point, and optionally the stack depth that is expected at
* that point. Relies on the fact that the range has a numCodeBytes = -1
* when it is being populated and that inner ranges come after outer
* ranges.
@@ -3497,7 +3490,7 @@ TclGetInnermostExceptionRange(
*
* Adds a place that wants to break/continue to the loop exception range
* tracking that will be fixed up once the loop can be finalized. These
- * functions will generate an INST_JUMP4 that will be fixed up during the
+ * functions generate an INST_JUMP4 that is fixed up during the
* loop finalization.
*
* ---------------------------------------------------------------------
@@ -3561,8 +3554,8 @@ TclAddLoopContinueFixup(
*
* TclCleanupStackForBreakContinue --
*
- * Ditch the extra elements from the auxiliary stack and the main stack.
- * How to do this exactly depends on whether there are any elements on
+ * Removes the extra elements from the auxiliary stack and the main stack.
+ * How this is done depends on whether there are any elements on
* the auxiliary stack to pop.
*
* ---------------------------------------------------------------------
@@ -3632,7 +3625,7 @@ StartExpanding(
}
/*
- * Adequate condition: further out loops and further in exceptions
+ * Adequate condition: loops further out and exceptions further in
* don't actually need this information.
*/
@@ -3642,7 +3635,7 @@ StartExpanding(
}
/*
- * There's now one more expansion being processed on the auxiliary stack.
+ * One more expansion is now being processed on the auxiliary stack.
*/
envPtr->expandCount++;
@@ -3655,7 +3648,7 @@ StartExpanding(
*
* Finalizes a loop exception range, binding the registered [break] and
* [continue] implementations so that they jump to the correct place.
- * Note that this must only be called after *all* the exception range
+ * This must be called only after *all* the exception range
* target offsets have been set.
*
* ---------------------------------------------------------------------
@@ -3726,21 +3719,17 @@ TclFinalizeLoopExceptionRange(
*
* TclCreateAuxData --
*
- * Procedure that allocates and initializes a new AuxData structure in a
+ * Allocates and initializes a new AuxData structure in a
* CompileEnv's array of compilation auxiliary data records. These
* AuxData records hold information created during compilation by
* CompileProcs and used by instructions during execution.
*
* Results:
- * Returns the index for the newly created AuxData structure.
+ * The index of the newly-created AuxData structure in the array.
*
* Side effects:
- * If there is not enough room in the CompileEnv's AuxData array, the
- * AuxData array in expanded: a new array of double the size is
- * allocated, if envPtr->mallocedAuxDataArray is non-zero the old array
- * is freed, and AuxData entries are copied from the old array to the new
- * one.
- *
+ * If there is not enough room in the CompileEnv's AuxData array, its size
+ * is doubled.
*----------------------------------------------------------------------
*/
@@ -3828,8 +3817,7 @@ TclInitJumpFixupArray(
*
* TclExpandJumpFixupArray --
*
- * Procedure that uses malloc to allocate more storage for a jump fixup
- * array.
+ * Uses malloc to allocate more storage for a jump fixup array.
*
* Results:
* None.
@@ -3908,10 +3896,11 @@ TclFreeJumpFixupArray(
*
* TclEmitForwardJump --
*
- * Procedure to emit a two-byte forward jump of kind "jumpType". Since
- * the jump may later have to be grown to five bytes if the jump target
- * is more than, say, 127 bytes away, this procedure also initializes a
- * JumpFixup record with information about the jump.
+ * Emits a two-byte forward jump of kind "jumpType". Also initializes a
+ * JumpFixup record with information about the jump. Since may later be
+ * necessary to increase the size of the jump instruction to five bytes if
+ * the jump target is more than, say, 127 bytes away.
+ *
*
* Results:
* None.
@@ -3966,16 +3955,17 @@ TclEmitForwardJump(
*
* TclFixupForwardJump --
*
- * Procedure that updates a previously-emitted forward jump to jump a
- * specified number of bytes, "jumpDist". If necessary, the jump is grown
- * from two to five bytes; this is done if the jump distance is greater
- * than "distThreshold" (normally 127 bytes). The jump is described by a
- * JumpFixup record previously initialized by TclEmitForwardJump.
+ * Modifies a previously-emitted forward jump to jump a specified number
+ * of bytes, "jumpDist". If necessary, the size of the jump instruction is
+ * increased from two to five bytes. This is done if the jump distance is
+ * greater than "distThreshold" (normally 127 bytes). The jump is
+ * described by a JumpFixup record previously initialized by
+ * TclEmitForwardJump.
*
* Results:
- * 1 if the jump was grown and subsequent instructions had to be moved;
- * otherwise 0. This result is returned to allow callers to update any
- * additional code offsets they may hold.
+ * 1 if the jump was grown and subsequent instructions had to be moved, or
+ * 0 otherwsie. This allows callers to update any additional code offsets
+ * they may hold.
*
* Side effects:
* The jump may be grown and subsequent instructions moved. If this
@@ -4018,10 +4008,10 @@ TclFixupForwardJump(
}
/*
- * We must grow the jump then move subsequent instructions down. Note that
- * if we expand the space for generated instructions, code addresses might
- * change; be careful about updating any of these addresses held in
- * variables.
+ * Increase the size of the jump instruction, and then move subsequent
+ * instructions down. Expanding the space for generated instructions means
+ * that code addresses might change. Be careful about updating any of
+ * these addresses held in variables.
*/
if ((envPtr->codeNext + 3) > envPtr->codeEnd) {
@@ -4105,7 +4095,7 @@ TclFixupForwardJump(
*
* TclEmitInvoke --
*
- * Emit one of the invoke-related instructions, wrapping it if necessary
+ * Emits one of the invoke-related instructions, wrapping it if necessary
* in code that ensures that any break or continue operation passing
* through it gets the stack unwinding correct, converting it into an
* internal jump if in an appropriate context.
@@ -4115,7 +4105,7 @@ TclFixupForwardJump(
*
* Side effects:
* Issues the jump with all correct stack management. May create another
- * loop exception range; pointers to ExceptionRange and ExceptionAux
+ * loop exception range. Pointers to ExceptionRange and ExceptionAux
* structures should not be held across this call.
*
*----------------------------------------------------------------------
@@ -4173,12 +4163,11 @@ TclEmitInvoke(
va_end(argList);
/*
- * Determine if we need to handle break and continue exceptions with a
- * special handling exception range (so that we can correctly unwind the
- * stack).
+ * If the exceptions is for break or continue handle it with special
+ * handling exception range so the stack may be correctly unwound.
*
- * These must be done separately; they can be different (especially for
- * calls from inside a [for] increment clause).
+ * These must be done separately since they can be different, especially
+ * for calls from inside a [for] increment clause.
*/
rangePtr = TclGetInnermostExceptionRange(envPtr, TCL_CONTINUE,
@@ -4398,16 +4387,16 @@ GetCmdLocEncodingSize(
*
* EncodeCmdLocMap --
*
- * Encode the command location information for some compiled code into a
+ * Encodes the command location information for some compiled code into a
* ByteCode structure. The encoded command location map is stored as
- * three adjacent byte sequences.
+ * three-adjacent-byte sequences.
*
* Results:
- * Pointer to the first byte after the encoded command location
+ * A pointer to the first byte after the encoded command location
* information.
*
* Side effects:
- * The encoded information is stored into the block of memory headed by
+ * Stores encoded information into the block of memory headed by
* codePtr. Also records pointers to the start of the four byte sequences
* in fields in codePtr's ByteCode header structure.
*
@@ -4522,9 +4511,9 @@ EncodeCmdLocMap(
*
* RecordByteCodeStats --
*
- * Accumulates various compilation-related statistics for each newly
- * compiled ByteCode. Called by the TclInitByteCodeObj when Tcl is
- * compiled with the -DTCL_COMPILE_STATS flag
+ * Accumulates compilation-related statistics for each newly-compiled
+ * ByteCode. Called by the TclInitByteCodeObj when Tcl is compiled with
+ * the -DTCL_COMPILE_STATS flag
*
* Results:
* None.
diff --git a/generic/tclCompile.h b/generic/tclCompile.h
index 6a5faaf..96a3541 100644
--- a/generic/tclCompile.h
+++ b/generic/tclCompile.h
@@ -217,9 +217,9 @@ typedef struct ExtCmdLoc {
* the AuxData structure.
*/
-typedef ClientData (AuxDataDupProc) (ClientData clientData);
-typedef void (AuxDataFreeProc) (ClientData clientData);
-typedef void (AuxDataPrintProc)(ClientData clientData,
+typedef void *(AuxDataDupProc) (void *clientData);
+typedef void (AuxDataFreeProc) (void *clientData);
+typedef void (AuxDataPrintProc)(void *clientData,
Tcl_Obj *appendObj, struct ByteCode *codePtr,
unsigned int pcOffset);
@@ -515,20 +515,20 @@ typedef struct ByteCode {
#endif /* TCL_COMPILE_STATS */
} ByteCode;
-#define ByteCodeSetIntRep(objPtr, typePtr, codePtr) \
+#define ByteCodeSetInternalRep(objPtr, typePtr, codePtr) \
do { \
- Tcl_ObjIntRep ir; \
+ Tcl_ObjInternalRep ir; \
ir.twoPtrValue.ptr1 = (codePtr); \
ir.twoPtrValue.ptr2 = NULL; \
- Tcl_StoreIntRep((objPtr), (typePtr), &ir); \
+ Tcl_StoreInternalRep((objPtr), (typePtr), &ir); \
} while (0)
-#define ByteCodeGetIntRep(objPtr, typePtr, codePtr) \
+#define ByteCodeGetInternalRep(objPtr, typePtr, codePtr) \
do { \
- const Tcl_ObjIntRep *irPtr; \
- irPtr = TclFetchIntRep((objPtr), (typePtr)); \
+ const Tcl_ObjInternalRep *irPtr; \
+ irPtr = TclFetchInternalRep((objPtr), (typePtr)); \
(codePtr) = irPtr ? (ByteCode*)irPtr->twoPtrValue.ptr1 : NULL; \
} while (0)
@@ -1118,7 +1118,7 @@ MODULE_SCOPE void TclCompileTokens(Tcl_Interp *interp,
CompileEnv *envPtr);
MODULE_SCOPE void TclCompileVarSubst(Tcl_Interp *interp,
Tcl_Token *tokenPtr, CompileEnv *envPtr);
-MODULE_SCOPE int TclCreateAuxData(ClientData clientData,
+MODULE_SCOPE int TclCreateAuxData(void *clientData,
const AuxDataType *typePtr, CompileEnv *envPtr);
MODULE_SCOPE int TclCreateExceptRange(ExceptionRangeType type,
CompileEnv *envPtr);
@@ -1192,16 +1192,16 @@ MODULE_SCOPE void TclReleaseByteCode(ByteCode *codePtr);
MODULE_SCOPE void TclReleaseLiteral(Tcl_Interp *interp, Tcl_Obj *objPtr);
MODULE_SCOPE void TclInvalidateCmdLiteral(Tcl_Interp *interp,
const char *name, Namespace *nsPtr);
-MODULE_SCOPE int TclSingleOpCmd(ClientData clientData,
+MODULE_SCOPE int TclSingleOpCmd(void *clientData,
Tcl_Interp *interp, int objc,
Tcl_Obj *const objv[]);
-MODULE_SCOPE int TclSortingOpCmd(ClientData clientData,
+MODULE_SCOPE int TclSortingOpCmd(void *clientData,
Tcl_Interp *interp, int objc,
Tcl_Obj *const objv[]);
-MODULE_SCOPE int TclVariadicOpCmd(ClientData clientData,
+MODULE_SCOPE int TclVariadicOpCmd(void *clientData,
Tcl_Interp *interp, int objc,
Tcl_Obj *const objv[]);
-MODULE_SCOPE int TclNoIdentOpCmd(ClientData clientData,
+MODULE_SCOPE int TclNoIdentOpCmd(void *clientData,
Tcl_Interp *interp, int objc,
Tcl_Obj *const objv[]);
#ifdef TCL_COMPILE_DEBUG
@@ -1217,7 +1217,7 @@ MODULE_SCOPE void TclLogCommandInfo(Tcl_Interp *interp,
MODULE_SCOPE Tcl_Obj *TclGetInnerContext(Tcl_Interp *interp,
const unsigned char *pc, Tcl_Obj **tosPtr);
MODULE_SCOPE Tcl_Obj *TclNewInstNameObj(unsigned char inst);
-MODULE_SCOPE int TclPushProcCallFrame(ClientData clientData,
+MODULE_SCOPE int TclPushProcCallFrame(void *clientData,
Tcl_Interp *interp, int objc,
Tcl_Obj *const objv[], int isLambda);
@@ -1232,7 +1232,7 @@ MODULE_SCOPE int TclPushProcCallFrame(ClientData clientData,
/*
* Simplified form to access AuxData.
*
- * ClientData TclFetchAuxData(CompileEng *envPtr, int index);
+ * void *TclFetchAuxData(CompileEng *envPtr, int index);
*/
#define TclFetchAuxData(envPtr, index) \
@@ -1557,9 +1557,9 @@ MODULE_SCOPE int TclPushProcCallFrame(ClientData clientData,
*/
#define PushLiteral(envPtr, string, length) \
- TclEmitPush(TclRegisterLiteral(envPtr, string, length, 0), (envPtr))
+ TclEmitPush(TclRegisterLiteral((envPtr), (string), (length), 0), (envPtr))
#define PushStringLiteral(envPtr, string) \
- PushLiteral(envPtr, string, (int) (sizeof(string "") - 1))
+ PushLiteral((envPtr), (string), (int) (sizeof(string "") - 1))
/*
* Macro to advance to the next token; it is more mnemonic than the address
diff --git a/generic/tclDecls.h b/generic/tclDecls.h
index 7d2e202..6ca7633 100644
--- a/generic/tclDecls.h
+++ b/generic/tclDecls.h
@@ -124,7 +124,7 @@ Tcl_Obj * Tcl_DbNewBooleanObj(int boolValue, const char *file,
int line);
/* 23 */
EXTERN Tcl_Obj * Tcl_DbNewByteArrayObj(const unsigned char *bytes,
- int length, const char *file, int line);
+ int numBytes, const char *file, int line);
/* 24 */
EXTERN Tcl_Obj * Tcl_DbNewDoubleObj(double doubleValue,
const char *file, int line);
@@ -152,7 +152,7 @@ EXTERN int Tcl_GetBooleanFromObj(Tcl_Interp *interp,
Tcl_Obj *objPtr, int *boolPtr);
/* 33 */
EXTERN unsigned char * Tcl_GetByteArrayFromObj(Tcl_Obj *objPtr,
- int *lengthPtr);
+ int *numBytesPtr);
/* 34 */
EXTERN int Tcl_GetDouble(Tcl_Interp *interp, const char *src,
double *doublePtr);
@@ -205,7 +205,7 @@ TCL_DEPRECATED("No longer in use, changed to macro")
Tcl_Obj * Tcl_NewBooleanObj(int boolValue);
/* 50 */
EXTERN Tcl_Obj * Tcl_NewByteArrayObj(const unsigned char *bytes,
- int length);
+ int numBytes);
/* 51 */
EXTERN Tcl_Obj * Tcl_NewDoubleObj(double doubleValue);
/* 52 */
@@ -224,10 +224,10 @@ EXTERN Tcl_Obj * Tcl_NewStringObj(const char *bytes, int length);
TCL_DEPRECATED("No longer in use, changed to macro")
void Tcl_SetBooleanObj(Tcl_Obj *objPtr, int boolValue);
/* 58 */
-EXTERN unsigned char * Tcl_SetByteArrayLength(Tcl_Obj *objPtr, int length);
+EXTERN unsigned char * Tcl_SetByteArrayLength(Tcl_Obj *objPtr, int numBytes);
/* 59 */
EXTERN void Tcl_SetByteArrayObj(Tcl_Obj *objPtr,
- const unsigned char *bytes, int length);
+ const unsigned char *bytes, int numBytes);
/* 60 */
EXTERN void Tcl_SetDoubleObj(Tcl_Obj *objPtr, double doubleValue);
/* 61 */
@@ -471,7 +471,7 @@ EXTERN int Tcl_ExprString(Tcl_Interp *interp, const char *expr);
/* 143 */
EXTERN void Tcl_Finalize(void);
/* 144 */
-EXTERN void Tcl_FindExecutable(const char *argv0);
+EXTERN const char * Tcl_FindExecutable(const char *argv0);
/* 145 */
EXTERN Tcl_HashEntry * Tcl_FirstHashEntry(Tcl_HashTable *tablePtr,
Tcl_HashSearch *searchPtr);
@@ -710,7 +710,7 @@ EXTERN void Tcl_SetErrorCode(Tcl_Interp *interp, ...);
/* 229 */
EXTERN void Tcl_SetMaxBlockTime(const Tcl_Time *timePtr);
/* 230 */
-EXTERN void Tcl_SetPanicProc(
+EXTERN const char * Tcl_SetPanicProc(
TCL_NORETURN1 Tcl_PanicProc *panicProc);
/* 231 */
EXTERN int Tcl_SetRecursionLimit(Tcl_Interp *interp, int depth);
@@ -1886,17 +1886,17 @@ EXTERN int TclZipfs_MountBuffer(Tcl_Interp *interp,
const char *mountPoint, unsigned char *data,
size_t datalen, int copy);
/* 636 */
-EXTERN void Tcl_FreeIntRep(Tcl_Obj *objPtr);
+EXTERN void Tcl_FreeInternalRep(Tcl_Obj *objPtr);
/* 637 */
EXTERN char * Tcl_InitStringRep(Tcl_Obj *objPtr, const char *bytes,
unsigned int numBytes);
/* 638 */
-EXTERN Tcl_ObjIntRep * Tcl_FetchIntRep(Tcl_Obj *objPtr,
+EXTERN Tcl_ObjInternalRep * Tcl_FetchInternalRep(Tcl_Obj *objPtr,
const Tcl_ObjType *typePtr);
/* 639 */
-EXTERN void Tcl_StoreIntRep(Tcl_Obj *objPtr,
+EXTERN void Tcl_StoreInternalRep(Tcl_Obj *objPtr,
const Tcl_ObjType *typePtr,
- const Tcl_ObjIntRep *irPtr);
+ const Tcl_ObjInternalRep *irPtr);
/* 640 */
EXTERN int Tcl_HasStringRep(Tcl_Obj *objPtr);
/* 641 */
@@ -1920,8 +1920,12 @@ EXTERN char * Tcl_UniCharToUtfDString(const int *uniStr,
/* 648 */
EXTERN int * Tcl_UtfToUniCharDString(const char *src, int length,
Tcl_DString *dsPtr);
-/* Slot 649 is reserved */
-/* Slot 650 is reserved */
+/* 649 */
+EXTERN unsigned char * TclGetBytesFromObj(Tcl_Interp *interp,
+ Tcl_Obj *objPtr, int *numBytesPtr);
+/* 650 */
+EXTERN unsigned char * Tcl_GetBytesFromObj(Tcl_Interp *interp,
+ Tcl_Obj *objPtr, size_t *numBytesPtr);
/* 651 */
EXTERN char * TclGetStringFromObj(Tcl_Obj *objPtr,
size_t *lengthPtr);
@@ -1930,7 +1934,7 @@ EXTERN Tcl_UniChar * TclGetUnicodeFromObj(Tcl_Obj *objPtr,
size_t *lengthPtr);
/* 653 */
EXTERN unsigned char * TclGetByteArrayFromObj(Tcl_Obj *objPtr,
- size_t *lengthPtr);
+ size_t *numBytesPtr);
/* 654 */
EXTERN int Tcl_UtfCharComplete(const char *src, int length);
/* 655 */
@@ -1994,7 +1998,7 @@ typedef struct TclStubs {
void (*tcl_DbIncrRefCount) (Tcl_Obj *objPtr, const char *file, int line); /* 20 */
int (*tcl_DbIsShared) (Tcl_Obj *objPtr, const char *file, int line); /* 21 */
TCL_DEPRECATED_API("No longer in use, changed to macro") Tcl_Obj * (*tcl_DbNewBooleanObj) (int boolValue, const char *file, int line); /* 22 */
- Tcl_Obj * (*tcl_DbNewByteArrayObj) (const unsigned char *bytes, int length, const char *file, int line); /* 23 */
+ Tcl_Obj * (*tcl_DbNewByteArrayObj) (const unsigned char *bytes, int numBytes, const char *file, int line); /* 23 */
Tcl_Obj * (*tcl_DbNewDoubleObj) (double doubleValue, const char *file, int line); /* 24 */
Tcl_Obj * (*tcl_DbNewListObj) (int objc, Tcl_Obj *const *objv, const char *file, int line); /* 25 */
TCL_DEPRECATED_API("No longer in use, changed to macro") Tcl_Obj * (*tcl_DbNewLongObj) (long longValue, const char *file, int line); /* 26 */
@@ -2004,7 +2008,7 @@ typedef struct TclStubs {
void (*tclFreeObj) (Tcl_Obj *objPtr); /* 30 */
int (*tcl_GetBoolean) (Tcl_Interp *interp, const char *src, int *boolPtr); /* 31 */
int (*tcl_GetBooleanFromObj) (Tcl_Interp *interp, Tcl_Obj *objPtr, int *boolPtr); /* 32 */
- unsigned char * (*tcl_GetByteArrayFromObj) (Tcl_Obj *objPtr, int *lengthPtr); /* 33 */
+ unsigned char * (*tcl_GetByteArrayFromObj) (Tcl_Obj *objPtr, int *numBytesPtr); /* 33 */
int (*tcl_GetDouble) (Tcl_Interp *interp, const char *src, double *doublePtr); /* 34 */
int (*tcl_GetDoubleFromObj) (Tcl_Interp *interp, Tcl_Obj *objPtr, double *doublePtr); /* 35 */
TCL_DEPRECATED_API("No longer in use, changed to macro") int (*tcl_GetIndexFromObj) (Tcl_Interp *interp, Tcl_Obj *objPtr, const char *const *tablePtr, const char *msg, int flags, int *indexPtr); /* 36 */
@@ -2021,7 +2025,7 @@ typedef struct TclStubs {
int (*tcl_ListObjLength) (Tcl_Interp *interp, Tcl_Obj *listPtr, int *lengthPtr); /* 47 */
int (*tcl_ListObjReplace) (Tcl_Interp *interp, Tcl_Obj *listPtr, int first, int count, int objc, Tcl_Obj *const objv[]); /* 48 */
TCL_DEPRECATED_API("No longer in use, changed to macro") Tcl_Obj * (*tcl_NewBooleanObj) (int boolValue); /* 49 */
- Tcl_Obj * (*tcl_NewByteArrayObj) (const unsigned char *bytes, int length); /* 50 */
+ Tcl_Obj * (*tcl_NewByteArrayObj) (const unsigned char *bytes, int numBytes); /* 50 */
Tcl_Obj * (*tcl_NewDoubleObj) (double doubleValue); /* 51 */
TCL_DEPRECATED_API("No longer in use, changed to macro") Tcl_Obj * (*tcl_NewIntObj) (int intValue); /* 52 */
Tcl_Obj * (*tcl_NewListObj) (int objc, Tcl_Obj *const objv[]); /* 53 */
@@ -2029,8 +2033,8 @@ typedef struct TclStubs {
Tcl_Obj * (*tcl_NewObj) (void); /* 55 */
Tcl_Obj * (*tcl_NewStringObj) (const char *bytes, int length); /* 56 */
TCL_DEPRECATED_API("No longer in use, changed to macro") void (*tcl_SetBooleanObj) (Tcl_Obj *objPtr, int boolValue); /* 57 */
- unsigned char * (*tcl_SetByteArrayLength) (Tcl_Obj *objPtr, int length); /* 58 */
- void (*tcl_SetByteArrayObj) (Tcl_Obj *objPtr, const unsigned char *bytes, int length); /* 59 */
+ unsigned char * (*tcl_SetByteArrayLength) (Tcl_Obj *objPtr, int numBytes); /* 58 */
+ void (*tcl_SetByteArrayObj) (Tcl_Obj *objPtr, const unsigned char *bytes, int numBytes); /* 59 */
void (*tcl_SetDoubleObj) (Tcl_Obj *objPtr, double doubleValue); /* 60 */
TCL_DEPRECATED_API("No longer in use, changed to macro") void (*tcl_SetIntObj) (Tcl_Obj *objPtr, int intValue); /* 61 */
void (*tcl_SetListObj) (Tcl_Obj *objPtr, int objc, Tcl_Obj *const objv[]); /* 62 */
@@ -2115,7 +2119,7 @@ typedef struct TclStubs {
int (*tcl_ExprObj) (Tcl_Interp *interp, Tcl_Obj *objPtr, Tcl_Obj **resultPtrPtr); /* 141 */
int (*tcl_ExprString) (Tcl_Interp *interp, const char *expr); /* 142 */
void (*tcl_Finalize) (void); /* 143 */
- TCL_DEPRECATED_API("Don't use this function in a stub-enabled extension") void (*tcl_FindExecutable) (const char *argv0); /* 144 */
+ TCL_DEPRECATED_API("Don't use this function in a stub-enabled extension") const char * (*tcl_FindExecutable) (const char *argv0); /* 144 */
Tcl_HashEntry * (*tcl_FirstHashEntry) (Tcl_HashTable *tablePtr, Tcl_HashSearch *searchPtr); /* 145 */
int (*tcl_Flush) (Tcl_Channel chan); /* 146 */
TCL_DEPRECATED_API("see TIP #559. Use Tcl_ResetResult") void (*tcl_FreeResult) (Tcl_Interp *interp); /* 147 */
@@ -2209,7 +2213,7 @@ typedef struct TclStubs {
void (*tcl_SetErrno) (int err); /* 227 */
void (*tcl_SetErrorCode) (Tcl_Interp *interp, ...); /* 228 */
void (*tcl_SetMaxBlockTime) (const Tcl_Time *timePtr); /* 229 */
- TCL_DEPRECATED_API("Don't use this function in a stub-enabled extension") void (*tcl_SetPanicProc) (TCL_NORETURN1 Tcl_PanicProc *panicProc); /* 230 */
+ TCL_DEPRECATED_API("Don't use this function in a stub-enabled extension") const char * (*tcl_SetPanicProc) (TCL_NORETURN1 Tcl_PanicProc *panicProc); /* 230 */
int (*tcl_SetRecursionLimit) (Tcl_Interp *interp, int depth); /* 231 */
void (*tcl_SetResult) (Tcl_Interp *interp, char *result, Tcl_FreeProc *freeProc); /* 232 */
int (*tcl_SetServiceMode) (int mode); /* 233 */
@@ -2615,10 +2619,10 @@ typedef struct TclStubs {
int (*tclZipfs_Unmount) (Tcl_Interp *interp, const char *mountPoint); /* 633 */
Tcl_Obj * (*tclZipfs_TclLibrary) (void); /* 634 */
int (*tclZipfs_MountBuffer) (Tcl_Interp *interp, const char *mountPoint, unsigned char *data, size_t datalen, int copy); /* 635 */
- void (*tcl_FreeIntRep) (Tcl_Obj *objPtr); /* 636 */
+ void (*tcl_FreeInternalRep) (Tcl_Obj *objPtr); /* 636 */
char * (*tcl_InitStringRep) (Tcl_Obj *objPtr, const char *bytes, unsigned int numBytes); /* 637 */
- Tcl_ObjIntRep * (*tcl_FetchIntRep) (Tcl_Obj *objPtr, const Tcl_ObjType *typePtr); /* 638 */
- void (*tcl_StoreIntRep) (Tcl_Obj *objPtr, const Tcl_ObjType *typePtr, const Tcl_ObjIntRep *irPtr); /* 639 */
+ Tcl_ObjInternalRep * (*tcl_FetchInternalRep) (Tcl_Obj *objPtr, const Tcl_ObjType *typePtr); /* 638 */
+ void (*tcl_StoreInternalRep) (Tcl_Obj *objPtr, const Tcl_ObjType *typePtr, const Tcl_ObjInternalRep *irPtr); /* 639 */
int (*tcl_HasStringRep) (Tcl_Obj *objPtr); /* 640 */
void (*tcl_IncrRefCount) (Tcl_Obj *objPtr); /* 641 */
void (*tcl_DecrRefCount) (Tcl_Obj *objPtr); /* 642 */
@@ -2628,11 +2632,11 @@ typedef struct TclStubs {
int (*tcl_UtfToUniChar) (const char *src, int *chPtr); /* 646 */
char * (*tcl_UniCharToUtfDString) (const int *uniStr, int uniLength, Tcl_DString *dsPtr); /* 647 */
int * (*tcl_UtfToUniCharDString) (const char *src, int length, Tcl_DString *dsPtr); /* 648 */
- void (*reserved649)(void);
- void (*reserved650)(void);
+ unsigned char * (*tclGetBytesFromObj) (Tcl_Interp *interp, Tcl_Obj *objPtr, int *numBytesPtr); /* 649 */
+ unsigned char * (*tcl_GetBytesFromObj) (Tcl_Interp *interp, Tcl_Obj *objPtr, size_t *numBytesPtr); /* 650 */
char * (*tclGetStringFromObj) (Tcl_Obj *objPtr, size_t *lengthPtr); /* 651 */
Tcl_UniChar * (*tclGetUnicodeFromObj) (Tcl_Obj *objPtr, size_t *lengthPtr); /* 652 */
- unsigned char * (*tclGetByteArrayFromObj) (Tcl_Obj *objPtr, size_t *lengthPtr); /* 653 */
+ unsigned char * (*tclGetByteArrayFromObj) (Tcl_Obj *objPtr, size_t *numBytesPtr); /* 653 */
int (*tcl_UtfCharComplete) (const char *src, int length); /* 654 */
const char * (*tcl_UtfNext) (const char *src); /* 655 */
const char * (*tcl_UtfPrev) (const char *src, const char *start); /* 656 */
@@ -3942,14 +3946,14 @@ extern const TclStubs *tclStubsPtr;
(tclStubsPtr->tclZipfs_TclLibrary) /* 634 */
#define TclZipfs_MountBuffer \
(tclStubsPtr->tclZipfs_MountBuffer) /* 635 */
-#define Tcl_FreeIntRep \
- (tclStubsPtr->tcl_FreeIntRep) /* 636 */
+#define Tcl_FreeInternalRep \
+ (tclStubsPtr->tcl_FreeInternalRep) /* 636 */
#define Tcl_InitStringRep \
(tclStubsPtr->tcl_InitStringRep) /* 637 */
-#define Tcl_FetchIntRep \
- (tclStubsPtr->tcl_FetchIntRep) /* 638 */
-#define Tcl_StoreIntRep \
- (tclStubsPtr->tcl_StoreIntRep) /* 639 */
+#define Tcl_FetchInternalRep \
+ (tclStubsPtr->tcl_FetchInternalRep) /* 638 */
+#define Tcl_StoreInternalRep \
+ (tclStubsPtr->tcl_StoreInternalRep) /* 639 */
#define Tcl_HasStringRep \
(tclStubsPtr->tcl_HasStringRep) /* 640 */
#define Tcl_IncrRefCount \
@@ -3968,8 +3972,10 @@ extern const TclStubs *tclStubsPtr;
(tclStubsPtr->tcl_UniCharToUtfDString) /* 647 */
#define Tcl_UtfToUniCharDString \
(tclStubsPtr->tcl_UtfToUniCharDString) /* 648 */
-/* Slot 649 is reserved */
-/* Slot 650 is reserved */
+#define TclGetBytesFromObj \
+ (tclStubsPtr->tclGetBytesFromObj) /* 649 */
+#define Tcl_GetBytesFromObj \
+ (tclStubsPtr->tcl_GetBytesFromObj) /* 650 */
#define TclGetStringFromObj \
(tclStubsPtr->tclGetStringFromObj) /* 651 */
#define TclGetUnicodeFromObj \
@@ -4011,10 +4017,18 @@ extern const TclStubs *tclStubsPtr;
#endif
#if defined(_WIN32) && defined(UNICODE)
-# define Tcl_FindExecutable(arg) ((Tcl_FindExecutable)((const char *)(arg)))
+# if defined(TCL_NO_DEPRECATED)
+# define Tcl_FindExecutable(arg) ((Tcl_FindExecutable)((const char *)(arg)))
+# else
+# define Tcl_FindExecutable(arg) ((void)((Tcl_FindExecutable)((const char *)(arg))))
+# define Tcl_SetPanicProc(arg) ((void)((Tcl_SetPanicProc)(arg)))
+# endif
# define Tcl_MainEx Tcl_MainExW
EXTERN void Tcl_MainExW(int argc, wchar_t **argv,
Tcl_AppInitProc *appInitProc, Tcl_Interp *interp);
+#elif !defined(TCL_NO_DEPRECATED)
+# define Tcl_FindExecutable(arg) ((void)((Tcl_FindExecutable)(arg)))
+# define Tcl_SetPanicProc(arg) ((void)((Tcl_SetPanicProc)(arg)))
#endif
#undef TCL_STORAGE_CLASS
@@ -4129,7 +4143,24 @@ extern const TclStubs *tclStubsPtr;
} while(0)
#endif /* TCL_NO_DEPRECATED */
-#if defined(USE_TCL_STUBS) && !defined(USE_TCL_STUB_PROCS)
+#if defined(USE_TCL_STUBS)
+# if defined(_WIN32) && defined(_WIN64)
+# undef Tcl_GetTime
+/* Handle Win64 tk.dll being loaded in Cygwin64. */
+# define Tcl_GetTime(t) \
+ do { \
+ union { \
+ Tcl_Time now; \
+ long long reserved; \
+ } _t; \
+ _t.reserved = -1; \
+ tclStubsPtr->tcl_GetTime((&_t.now)); \
+ if (_t.reserved != -1) { \
+ _t.now.usec = _t.reserved; \
+ } \
+ *(t) = _t.now; \
+ } while (0)
+# endif
# if defined(__CYGWIN__) && defined(TCL_WIDE_INT_IS_LONG)
/* On Cygwin64, long is 64-bit while on Win64 long is 32-bit. Therefore
* we have to make sure that all stub entries on Cygwin64 follow the
@@ -4177,12 +4208,15 @@ extern const TclStubs *tclStubsPtr;
Tcl_GetStringFromObj(objPtr, (int *)NULL)
#define Tcl_GetUnicode(objPtr) \
Tcl_GetUnicodeFromObj(objPtr, (int *)NULL)
+#undef Tcl_GetBytesFromObj
#ifdef TCL_NO_DEPRECATED
#undef Tcl_GetStringFromObj
#undef Tcl_GetUnicodeFromObj
#undef Tcl_GetByteArrayFromObj
#endif
#if defined(USE_TCL_STUBS)
+#define Tcl_GetBytesFromObj(interp, objPtr, sizePtr) \
+ (sizeof(*sizePtr) <= sizeof(int) ? tclStubsPtr->tclGetBytesFromObj(interp, objPtr, (int *)sizePtr) : tclStubsPtr->tcl_GetBytesFromObj(interp, objPtr, (size_t *)sizePtr))
#ifdef TCL_NO_DEPRECATED
#define Tcl_GetStringFromObj(objPtr, sizePtr) \
(sizeof(*sizePtr) <= sizeof(int) ? tclStubsPtr->tcl_GetStringFromObj(objPtr, (int *)sizePtr) : tclStubsPtr->tclGetStringFromObj(objPtr, (size_t *)sizePtr))
@@ -4192,6 +4226,8 @@ extern const TclStubs *tclStubsPtr;
(sizeof(*sizePtr) <= sizeof(int) ? tclStubsPtr->tcl_GetUnicodeFromObj(objPtr, (int *)sizePtr) : tclStubsPtr->tclGetUnicodeFromObj(objPtr, (size_t *)sizePtr))
#endif
#else
+#define Tcl_GetBytesFromObj(interp, objPtr, sizePtr) \
+ (sizeof(*sizePtr) <= sizeof(int) ? (TclGetBytesFromObj)(interp, objPtr, (int *)sizePtr) : (Tcl_GetBytesFromObj)(interp, objPtr, (size_t *)sizePtr))
#ifdef TCL_NO_DEPRECATED
#define Tcl_GetStringFromObj(objPtr, sizePtr) \
(sizeof(*sizePtr) <= sizeof(int) ? (Tcl_GetStringFromObj)(objPtr, (int *)sizePtr) : (TclGetStringFromObj)(objPtr, (size_t *)sizePtr))
diff --git a/generic/tclDictObj.c b/generic/tclDictObj.c
index ae35d6b..8bf8373 100644
--- a/generic/tclDictObj.c
+++ b/generic/tclDictObj.c
@@ -149,18 +149,18 @@ const Tcl_ObjType tclDictType = {
SetDictFromAny /* setFromAnyProc */
};
-#define DictSetIntRep(objPtr, dictRepPtr) \
+#define DictSetInternalRep(objPtr, dictRepPtr) \
do { \
- Tcl_ObjIntRep ir; \
+ Tcl_ObjInternalRep ir; \
ir.twoPtrValue.ptr1 = (dictRepPtr); \
ir.twoPtrValue.ptr2 = NULL; \
- Tcl_StoreIntRep((objPtr), &tclDictType, &ir); \
+ Tcl_StoreInternalRep((objPtr), &tclDictType, &ir); \
} while (0)
-#define DictGetIntRep(objPtr, dictRepPtr) \
+#define DictGetInternalRep(objPtr, dictRepPtr) \
do { \
- const Tcl_ObjIntRep *irPtr; \
- irPtr = TclFetchIntRep((objPtr), &tclDictType); \
+ const Tcl_ObjInternalRep *irPtr; \
+ irPtr = TclFetchInternalRep((objPtr), &tclDictType); \
(dictRepPtr) = irPtr ? (Dict *)irPtr->twoPtrValue.ptr1 : NULL; \
} while (0)
@@ -362,7 +362,7 @@ DupDictInternalRep(
Dict *oldDict, *newDict = (Dict *)ckalloc(sizeof(Dict));
ChainEntry *cPtr;
- DictGetIntRep(srcPtr, oldDict);
+ DictGetInternalRep(srcPtr, oldDict);
/*
* Copy values across from the old hash table.
@@ -395,7 +395,7 @@ DupDictInternalRep(
* Store in the object.
*/
- DictSetIntRep(copyPtr, newDict);
+ DictSetInternalRep(copyPtr, newDict);
}
/*
@@ -422,7 +422,7 @@ FreeDictInternalRep(
{
Dict *dict;
- DictGetIntRep(dictPtr, dict);
+ DictGetInternalRep(dictPtr, dict);
if (dict->refCount-- <= 1) {
DeleteDict(dict);
@@ -499,7 +499,7 @@ UpdateStringOfDict(
int numElems;
- DictGetIntRep(dictPtr, dict);
+ DictGetInternalRep(dictPtr, dict);
assert (dict != NULL);
@@ -566,6 +566,7 @@ UpdateStringOfDict(
dst += TclConvertElement(elem, length, dst, flagPtr[i+1]);
*dst++ = ' ';
}
+ /* Last space overwrote the terminating NUL; cal T_ISR again to restore */
(void)Tcl_InitStringRep(dictPtr, NULL, bytesNeeded - 1);
if (flagPtr != localFlags) {
@@ -610,7 +611,7 @@ SetDictFromAny(
* the conversion from lists to dictionaries.
*/
- if (TclHasIntRep(objPtr, &tclListType)) {
+ if (TclHasInternalRep(objPtr, &tclListType)) {
int objc, i;
Tcl_Obj **objv;
@@ -717,7 +718,7 @@ SetDictFromAny(
dict->epoch = 1;
dict->chain = NULL;
dict->refCount = 1;
- DictSetIntRep(objPtr, dict);
+ DictSetInternalRep(objPtr, dict);
return TCL_OK;
missingValue:
@@ -739,12 +740,12 @@ GetDictFromObj(
{
Dict *dict;
- DictGetIntRep(dictPtr, dict);
+ DictGetInternalRep(dictPtr, dict);
if (dict == NULL) {
if (SetDictFromAny(interp, dictPtr) != TCL_OK) {
return NULL;
}
- DictGetIntRep(dictPtr, dict);
+ DictGetInternalRep(dictPtr, dict);
}
return dict;
}
@@ -792,12 +793,12 @@ TclTraceDictPath(
Dict *dict, *newDict;
int i;
- DictGetIntRep(dictPtr, dict);
+ DictGetInternalRep(dictPtr, dict);
if (dict == NULL) {
if (SetDictFromAny(interp, dictPtr) != TCL_OK) {
return NULL;
}
- DictGetIntRep(dictPtr, dict);
+ DictGetInternalRep(dictPtr, dict);
}
if (flags & DICT_PATH_UPDATE) {
dict->chain = NULL;
@@ -835,7 +836,7 @@ TclTraceDictPath(
} else {
tmpObj = (Tcl_Obj *)Tcl_GetHashValue(hPtr);
- DictGetIntRep(tmpObj, newDict);
+ DictGetInternalRep(tmpObj, newDict);
if (newDict == NULL) {
if (SetDictFromAny(interp, tmpObj) != TCL_OK) {
@@ -844,7 +845,7 @@ TclTraceDictPath(
}
}
- DictGetIntRep(tmpObj, newDict);
+ DictGetInternalRep(tmpObj, newDict);
if (flags & DICT_PATH_UPDATE) {
if (Tcl_IsShared(tmpObj)) {
TclDecrRefCount(tmpObj);
@@ -852,7 +853,7 @@ TclTraceDictPath(
Tcl_IncrRefCount(tmpObj);
Tcl_SetHashValue(hPtr, tmpObj);
dict->epoch++;
- DictGetIntRep(tmpObj, newDict);
+ DictGetInternalRep(tmpObj, newDict);
}
newDict->chain = dictPtr;
@@ -889,14 +890,14 @@ InvalidateDictChain(
{
Dict *dict;
- DictGetIntRep(dictObj, dict);
+ DictGetInternalRep(dictObj, dict);
assert( dict != NULL);
do {
dict->refCount++;
TclInvalidateStringRep(dictObj);
- TclFreeIntRep(dictObj);
- DictSetIntRep(dictObj, dict);
+ TclFreeInternalRep(dictObj);
+ DictSetInternalRep(dictObj, dict);
dict->epoch++;
dictObj = dict->chain;
@@ -904,7 +905,7 @@ InvalidateDictChain(
break;
}
dict->chain = NULL;
- DictGetIntRep(dictObj, dict);
+ DictGetInternalRep(dictObj, dict);
} while (dict != NULL);
}
@@ -950,8 +951,8 @@ Tcl_DictObjPut(
TclInvalidateStringRep(dictPtr);
hPtr = CreateChainEntry(dict, keyPtr, &isNew);
dict->refCount++;
- TclFreeIntRep(dictPtr)
- DictSetIntRep(dictPtr, dict);
+ TclFreeInternalRep(dictPtr)
+ DictSetInternalRep(dictPtr, dict);
Tcl_IncrRefCount(valuePtr);
if (!isNew) {
Tcl_Obj *oldValuePtr = (Tcl_Obj *)Tcl_GetHashValue(hPtr);
@@ -1306,7 +1307,7 @@ Tcl_DictObjPutKeyList(
return TCL_ERROR;
}
- DictGetIntRep(dictPtr, dict);
+ DictGetInternalRep(dictPtr, dict);
assert(dict != NULL);
hPtr = CreateChainEntry(dict, keyv[keyc-1], &isNew);
Tcl_IncrRefCount(valuePtr);
@@ -1364,7 +1365,7 @@ Tcl_DictObjRemoveKeyList(
return TCL_ERROR;
}
- DictGetIntRep(dictPtr, dict);
+ DictGetInternalRep(dictPtr, dict);
assert(dict != NULL);
DeleteChainEntry(dict, keyv[keyc-1]);
InvalidateDictChain(dictPtr);
@@ -1411,7 +1412,7 @@ Tcl_NewDictObj(void)
dict->epoch = 1;
dict->chain = NULL;
dict->refCount = 1;
- DictSetIntRep(dictPtr, dict);
+ DictSetInternalRep(dictPtr, dict);
return dictPtr;
#endif
}
@@ -1459,7 +1460,7 @@ Tcl_DbNewDictObj(
dict->epoch = 1;
dict->chain = NULL;
dict->refCount = 1;
- DictSetIntRep(dictPtr, dict);
+ DictSetInternalRep(dictPtr, dict);
return dictPtr;
}
#else /* !TCL_MEM_DEBUG */
diff --git a/generic/tclDisassemble.c b/generic/tclDisassemble.c
index f5cc8b7..7bc1c97 100644
--- a/generic/tclDisassemble.c
+++ b/generic/tclDisassemble.c
@@ -44,17 +44,17 @@ static const Tcl_ObjType instNameType = {
NULL, /* setFromAnyProc */
};
-#define InstNameSetIntRep(objPtr, inst) \
+#define InstNameSetInternalRep(objPtr, inst) \
do { \
- Tcl_ObjIntRep ir; \
+ Tcl_ObjInternalRep ir; \
ir.wideValue = (inst); \
- Tcl_StoreIntRep((objPtr), &instNameType, &ir); \
+ Tcl_StoreInternalRep((objPtr), &instNameType, &ir); \
} while (0)
-#define InstNameGetIntRep(objPtr, inst) \
+#define InstNameGetInternalRep(objPtr, inst) \
do { \
- const Tcl_ObjIntRep *irPtr; \
- irPtr = TclFetchIntRep((objPtr), &instNameType); \
+ const Tcl_ObjInternalRep *irPtr; \
+ irPtr = TclFetchInternalRep((objPtr), &instNameType); \
assert(irPtr != NULL); \
(inst) = (size_t)irPtr->wideValue; \
} while (0)
@@ -259,7 +259,7 @@ DisassembleByteCodeObj(
Interp *iPtr;
Tcl_Obj *bufferObj, *fileObj;
- ByteCodeGetIntRep(objPtr, &tclByteCodeType, codePtr);
+ ByteCodeGetInternalRep(objPtr, &tclByteCodeType, codePtr);
iPtr = (Interp *) *codePtr->interpHandle;
@@ -761,7 +761,7 @@ TclGetInnerContext(
int len;
/*
- * Reset while keeping the list intrep as much as possible.
+ * Reset while keeping the list internalrep as much as possible.
*/
Tcl_ListObjLength(interp, result, &len);
@@ -808,7 +808,7 @@ TclNewInstNameObj(
TclNewObj(objPtr);
TclInvalidateStringRep(objPtr);
- InstNameSetIntRep(objPtr, (long) inst);
+ InstNameSetInternalRep(objPtr, (long) inst);
return objPtr;
}
@@ -830,7 +830,7 @@ UpdateStringOfInstName(
size_t inst; /* NOTE: We know this is really an unsigned char */
char *dst;
- InstNameGetIntRep(objPtr, inst);
+ InstNameGetInternalRep(objPtr, inst);
if (inst > LAST_INST_OPCODE) {
dst = Tcl_InitStringRep(objPtr, NULL, TCL_INTEGER_SPACE + 5);
@@ -945,7 +945,7 @@ DisassembleByteCodeAsDicts(
int codeOffset, codeLength, sourceOffset, sourceLength;
int i, val, line;
- ByteCodeGetIntRep(objPtr, &tclByteCodeType, codePtr);
+ ByteCodeGetInternalRep(objPtr, &tclByteCodeType, codePtr);
/*
* Get the literals from the bytecode.
@@ -1368,7 +1368,7 @@ Tcl_DisassembleObjCmd(
return TCL_ERROR;
}
- if (!TclHasIntRep(objv[2], &tclByteCodeType) && (TCL_OK
+ if (!TclHasInternalRep(objv[2], &tclByteCodeType) && (TCL_OK
!= TclSetByteCodeFromAny(interp, objv[2], NULL, NULL))) {
return TCL_ERROR;
}
@@ -1419,7 +1419,7 @@ Tcl_DisassembleObjCmd(
* Compile if necessary.
*/
- if (!TclHasIntRep(procPtr->bodyPtr, &tclByteCodeType)) {
+ if (!TclHasInternalRep(procPtr->bodyPtr, &tclByteCodeType)) {
Command cmd;
/*
@@ -1484,7 +1484,7 @@ Tcl_DisassembleObjCmd(
* Compile if necessary.
*/
- if (!TclHasIntRep(procPtr->bodyPtr, &tclByteCodeType)) {
+ if (!TclHasInternalRep(procPtr->bodyPtr, &tclByteCodeType)) {
Command cmd;
/*
@@ -1569,7 +1569,7 @@ Tcl_DisassembleObjCmd(
"METHODTYPE", NULL);
return TCL_ERROR;
}
- if (!TclHasIntRep(procPtr->bodyPtr, &tclByteCodeType)) {
+ if (!TclHasInternalRep(procPtr->bodyPtr, &tclByteCodeType)) {
Command cmd;
/*
@@ -1597,7 +1597,7 @@ Tcl_DisassembleObjCmd(
* Do the actual disassembly.
*/
- ByteCodeGetIntRep(codeObjPtr, &tclByteCodeType, codePtr);
+ ByteCodeGetInternalRep(codeObjPtr, &tclByteCodeType, codePtr);
if (codePtr->flags & TCL_BYTECODE_PRECOMPILED) {
Tcl_SetObjResult(interp, Tcl_NewStringObj(
diff --git a/generic/tclEncoding.c b/generic/tclEncoding.c
index 9367863..57c6148 100644
--- a/generic/tclEncoding.c
+++ b/generic/tclEncoding.c
@@ -37,7 +37,7 @@ typedef struct {
* end-of-string in this encoding. This number
* is used to determine the source string
* length when the srcLen argument is
- * negative. This number can be 1 or 2. */
+ * negative. This number can be 1, 2, or 4. */
ClientData clientData; /* Arbitrary value associated with encoding
* type. Passed to conversion functions. */
LengthProc *lengthProc; /* Function to compute length of
@@ -45,7 +45,9 @@ typedef struct {
* If nullSize is 1, this is strlen; if
* nullSize is 2, this is a function that
* returns the number of bytes in a 0x0000
- * terminated string. */
+ * terminated string; if nullSize is 4, this
+ * is a function that returns the number of
+ * bytes in a 0x00000000 terminated string. */
size_t refCount; /* Number of uses of this structure. */
Tcl_HashEntry *hPtr; /* Hash table entry that owns this encoding. */
} Encoding;
@@ -196,13 +198,13 @@ static unsigned short emptyPage[256];
*/
static Tcl_EncodingConvertProc BinaryProc;
-static Tcl_DupInternalRepProc DupEncodingIntRep;
+static Tcl_DupInternalRepProc DupEncodingInternalRep;
static Tcl_EncodingFreeProc EscapeFreeProc;
static Tcl_EncodingConvertProc EscapeFromUtfProc;
static Tcl_EncodingConvertProc EscapeToUtfProc;
static void FillEncodingFileMap(void);
static void FreeEncoding(Tcl_Encoding encoding);
-static Tcl_FreeInternalRepProc FreeEncodingIntRep;
+static Tcl_FreeInternalRepProc FreeEncodingInternalRep;
static Encoding * GetTableEncoding(EscapeEncodingData *dataPtr,
int state);
static Tcl_Encoding LoadEncodingFile(Tcl_Interp *interp,
@@ -216,7 +218,10 @@ static Tcl_Channel OpenEncodingFileChannel(Tcl_Interp *interp,
static Tcl_EncodingFreeProc TableFreeProc;
static Tcl_EncodingConvertProc TableFromUtfProc;
static Tcl_EncodingConvertProc TableToUtfProc;
-static size_t unilen(const char *src);
+static size_t unilen(const char *src);
+static size_t unilen4(const char *src);
+static Tcl_EncodingConvertProc Utf32ToUtfProc;
+static Tcl_EncodingConvertProc UtfToUtf32Proc;
static Tcl_EncodingConvertProc Utf16ToUtfProc;
static Tcl_EncodingConvertProc UtfToUtf16Proc;
static Tcl_EncodingConvertProc UtfToUcs2Proc;
@@ -226,25 +231,25 @@ static Tcl_EncodingConvertProc Iso88591ToUtfProc;
/*
* A Tcl_ObjType for holding a cached Tcl_Encoding in the twoPtrValue.ptr1 field
- * of the intrep. This should help the lifetime of encodings be more useful.
+ * of the internalrep. This should help the lifetime of encodings be more useful.
* See concerns raised in [Bug 1077262].
*/
static const Tcl_ObjType encodingType = {
- "encoding", FreeEncodingIntRep, DupEncodingIntRep, NULL, NULL
+ "encoding", FreeEncodingInternalRep, DupEncodingInternalRep, NULL, NULL
};
-#define EncodingSetIntRep(objPtr, encoding) \
+#define EncodingSetInternalRep(objPtr, encoding) \
do { \
- Tcl_ObjIntRep ir; \
+ Tcl_ObjInternalRep ir; \
ir.twoPtrValue.ptr1 = (encoding); \
ir.twoPtrValue.ptr2 = NULL; \
- Tcl_StoreIntRep((objPtr), &encodingType, &ir); \
+ Tcl_StoreInternalRep((objPtr), &encodingType, &ir); \
} while (0)
-#define EncodingGetIntRep(objPtr, encoding) \
+#define EncodingGetInternalRep(objPtr, encoding) \
do { \
- const Tcl_ObjIntRep *irPtr; \
- irPtr = TclFetchIntRep ((objPtr), &encodingType); \
+ const Tcl_ObjInternalRep *irPtr; \
+ irPtr = TclFetchInternalRep ((objPtr), &encodingType); \
(encoding) = irPtr ? (Tcl_Encoding)irPtr->twoPtrValue.ptr1 : NULL; \
} while (0)
@@ -277,13 +282,13 @@ Tcl_GetEncodingFromObj(
Tcl_Encoding encoding;
const char *name = TclGetString(objPtr);
- EncodingGetIntRep(objPtr, encoding);
+ EncodingGetInternalRep(objPtr, encoding);
if (encoding == NULL) {
encoding = Tcl_GetEncoding(interp, name);
if (encoding == NULL) {
return TCL_ERROR;
}
- EncodingSetIntRep(objPtr, encoding);
+ EncodingSetInternalRep(objPtr, encoding);
}
*encodingPtr = Tcl_GetEncoding(NULL, name);
return TCL_OK;
@@ -292,7 +297,7 @@ Tcl_GetEncodingFromObj(
/*
*----------------------------------------------------------------------
*
- * FreeEncodingIntRep --
+ * FreeEncodingInternalRep --
*
* The Tcl_FreeInternalRepProc for the "encoding" Tcl_ObjType.
*
@@ -300,19 +305,19 @@ Tcl_GetEncodingFromObj(
*/
static void
-FreeEncodingIntRep(
+FreeEncodingInternalRep(
Tcl_Obj *objPtr)
{
Tcl_Encoding encoding;
- EncodingGetIntRep(objPtr, encoding);
+ EncodingGetInternalRep(objPtr, encoding);
Tcl_FreeEncoding(encoding);
}
/*
*----------------------------------------------------------------------
*
- * DupEncodingIntRep --
+ * DupEncodingInternalRep --
*
* The Tcl_DupInternalRepProc for the "encoding" Tcl_ObjType.
*
@@ -320,12 +325,12 @@ FreeEncodingIntRep(
*/
static void
-DupEncodingIntRep(
+DupEncodingInternalRep(
Tcl_Obj *srcPtr,
Tcl_Obj *dupPtr)
{
Tcl_Encoding encoding = Tcl_GetEncoding(NULL, TclGetString(srcPtr));
- EncodingSetIntRep(dupPtr, encoding);
+ EncodingSetInternalRep(dupPtr, encoding);
}
/*
@@ -512,7 +517,7 @@ FillEncodingFileMap(void)
/* Those flags must not conflict with other TCL_ENCODING_* flags in tcl.h */
/* Since TCL_ENCODING_MODIFIED is only used for utf-8/cesu-8 and
- * TCL_ENCODING_LE is only used for utf-16/ucs-2. re-use the same value */
+ * TCL_ENCODING_LE is only used for utf-16/utf-32/ucs-2. re-use the same value */
#define TCL_ENCODING_MODIFIED 0x20 /* Converting NULL bytes to 0xC0 0x80 */
#define TCL_ENCODING_LE TCL_ENCODING_MODIFIED /* Little-endian encoding */
#define TCL_ENCODING_UTF 0x200 /* For UTF-8 encoding, allow 4-byte output sequences */
@@ -577,6 +582,20 @@ TclInitEncodingSubsystem(void)
type.clientData = INT2PTR(isLe.c);
Tcl_CreateEncoding(&type);
+ type.toUtfProc = Utf32ToUtfProc;
+ type.fromUtfProc = UtfToUtf32Proc;
+ type.freeProc = NULL;
+ type.nullSize = 4;
+ type.encodingName = "utf-32le";
+ type.clientData = INT2PTR(TCL_ENCODING_LE);
+ Tcl_CreateEncoding(&type);
+ type.encodingName = "utf-32be";
+ type.clientData = INT2PTR(0);
+ Tcl_CreateEncoding(&type);
+ type.encodingName = "utf-32";
+ type.clientData = INT2PTR(isLe.c);
+ Tcl_CreateEncoding(&type);
+
type.toUtfProc = Utf16ToUtfProc;
type.fromUtfProc = UtfToUtf16Proc;
type.freeProc = NULL;
@@ -1057,10 +1076,12 @@ Tcl_CreateEncoding(
encodingPtr->freeProc = typePtr->freeProc;
encodingPtr->nullSize = typePtr->nullSize;
encodingPtr->clientData = typePtr->clientData;
- if (typePtr->nullSize == 1) {
- encodingPtr->lengthProc = (LengthProc *) strlen;
- } else {
+ if (typePtr->nullSize == 2) {
encodingPtr->lengthProc = (LengthProc *) unilen;
+ } else if (typePtr->nullSize == 4) {
+ encodingPtr->lengthProc = (LengthProc *) unilen4;
+ } else {
+ encodingPtr->lengthProc = (LengthProc *) strlen;
}
encodingPtr->refCount = 1;
encodingPtr->hPtr = NULL;
@@ -1343,10 +1364,10 @@ Tcl_UtfToExternalDString(
src += srcRead;
if (result != TCL_CONVERT_NOSPACE) {
- if (encodingPtr->nullSize == 2) {
- Tcl_DStringSetLength(dstPtr, soFar + 1);
+ int i = soFar + encodingPtr->nullSize - 1;
+ while (i >= soFar) {
+ Tcl_DStringSetLength(dstPtr, i--);
}
- Tcl_DStringSetLength(dstPtr, soFar);
return Tcl_DStringValue(dstPtr);
}
@@ -1441,10 +1462,7 @@ Tcl_UtfToExternal(
result = encodingPtr->fromUtfProc(encodingPtr->clientData, src, srcLen,
flags, statePtr, dst, dstLen, srcReadPtr,
dstWrotePtr, dstCharsPtr);
- if (encodingPtr->nullSize == 2) {
- dst[*dstWrotePtr + 1] = '\0';
- }
- dst[*dstWrotePtr] = '\0';
+ memset(&dst[*dstWrotePtr], '\0', encodingPtr->nullSize);
return result;
}
@@ -1467,14 +1485,15 @@ Tcl_UtfToExternal(
*---------------------------------------------------------------------------
*/
#undef Tcl_FindExecutable
-void
+const char *
Tcl_FindExecutable(
const char *argv0) /* The value of the application's argv[0]
* (native). */
{
- Tcl_InitSubsystems();
+ const char *version = Tcl_InitSubsystems();
TclpSetInitialEncodings();
TclpFindExecutable(argv0);
+ return version;
}
/*
@@ -2235,15 +2254,15 @@ UtfToUtfProc(
result = TCL_CONVERT_NOSPACE;
break;
}
- if (UCHAR(*src) < 0x80 && !(UCHAR(*src) == 0 && (flags & TCL_ENCODING_MODIFIED))) {
+ if (UCHAR(*src) < 0x80 && !((UCHAR(*src) == 0) && (flags & TCL_ENCODING_MODIFIED))) {
/*
* Copy 7bit characters, but skip null-bytes when we are in input
* mode, so that they get converted to 0xC080.
*/
*dst++ = *src++;
- } else if (UCHAR(*src) == 0xC0 && (src + 1 < srcEnd)
- && UCHAR(src[1]) == 0x80 && !(flags & TCL_ENCODING_MODIFIED)) {
+ } else if ((UCHAR(*src) == 0xC0) && (src + 1 < srcEnd)
+ && (UCHAR(src[1]) == 0x80) && !(flags & TCL_ENCODING_MODIFIED)) {
/*
* Convert 0xC080 to real nulls when we are in output mode.
*/
@@ -2339,6 +2358,199 @@ UtfToUtfProc(
/*
*-------------------------------------------------------------------------
*
+ * Utf32ToUtfProc --
+ *
+ * Convert from UTF-32 to UTF-8.
+ *
+ * Results:
+ * Returns TCL_OK if conversion was successful.
+ *
+ * Side effects:
+ * None.
+ *
+ *-------------------------------------------------------------------------
+ */
+
+static int
+Utf32ToUtfProc(
+ ClientData clientData, /* additional flags, e.g. TCL_ENCODING_LE */
+ const char *src, /* Source string in Unicode. */
+ int srcLen, /* Source string length in bytes. */
+ int flags, /* Conversion control flags. */
+ TCL_UNUSED(Tcl_EncodingState *),
+ char *dst, /* Output buffer in which converted string is
+ * stored. */
+ int dstLen, /* The maximum length of output buffer in
+ * bytes. */
+ int *srcReadPtr, /* Filled with the number of bytes from the
+ * source string that were converted. This may
+ * be less than the original source length if
+ * there was a problem converting some source
+ * characters. */
+ int *dstWrotePtr, /* Filled with the number of bytes that were
+ * stored in the output buffer as a result of
+ * the conversion. */
+ int *dstCharsPtr) /* Filled with the number of characters that
+ * correspond to the bytes stored in the
+ * output buffer. */
+{
+ const char *srcStart, *srcEnd;
+ const char *dstEnd, *dstStart;
+ int result, numChars, charLimit = INT_MAX;
+ int ch;
+
+ flags |= PTR2INT(clientData);
+ if (flags & TCL_ENCODING_CHAR_LIMIT) {
+ charLimit = *dstCharsPtr;
+ }
+ result = TCL_OK;
+
+ /*
+ * Check alignment with utf-32 (4 == sizeof(UTF-32))
+ */
+
+ if ((srcLen % 4) != 0) {
+ result = TCL_CONVERT_MULTIBYTE;
+ srcLen &= -4;
+ }
+
+ srcStart = src;
+ srcEnd = src + srcLen;
+
+ dstStart = dst;
+ dstEnd = dst + dstLen - TCL_UTF_MAX;
+
+ for (numChars = 0; src < srcEnd && numChars <= charLimit; numChars++) {
+ if (dst > dstEnd) {
+ result = TCL_CONVERT_NOSPACE;
+ break;
+ }
+
+ if (flags & TCL_ENCODING_LE) {
+ ch = (src[3] & 0xFF) << 24 | (src[2] & 0xFF) << 16 | (src[1] & 0xFF) << 8 | (src[0] & 0xFF);
+ } else {
+ ch = (src[0] & 0xFF) << 24 | (src[1] & 0xFF) << 16 | (src[2] & 0xFF) << 8 | (src[3] & 0xFF);
+ }
+
+ /*
+ * Special case for 1-byte utf chars for speed. Make sure we work with
+ * unsigned short-size data.
+ */
+
+ if ((ch > 0) && (ch < 0x80)) {
+ *dst++ = (ch & 0xFF);
+ } else {
+ dst += Tcl_UniCharToUtf(ch, dst);
+ }
+ src += sizeof(unsigned int);
+ }
+
+ *srcReadPtr = src - srcStart;
+ *dstWrotePtr = dst - dstStart;
+ *dstCharsPtr = numChars;
+ return result;
+}
+
+/*
+ *-------------------------------------------------------------------------
+ *
+ * UtfToUtf32Proc --
+ *
+ * Convert from UTF-8 to UTF-32.
+ *
+ * Results:
+ * Returns TCL_OK if conversion was successful.
+ *
+ * Side effects:
+ * None.
+ *
+ *-------------------------------------------------------------------------
+ */
+
+static int
+UtfToUtf32Proc(
+ ClientData clientData, /* additional flags, e.g. TCL_ENCODING_LE */
+ const char *src, /* Source string in UTF-8. */
+ int srcLen, /* Source string length in bytes. */
+ int flags, /* Conversion control flags. */
+ TCL_UNUSED(Tcl_EncodingState *),
+ char *dst, /* Output buffer in which converted string is
+ * stored. */
+ int dstLen, /* The maximum length of output buffer in
+ * bytes. */
+ int *srcReadPtr, /* Filled with the number of bytes from the
+ * source string that were converted. This may
+ * be less than the original source length if
+ * there was a problem converting some source
+ * characters. */
+ int *dstWrotePtr, /* Filled with the number of bytes that were
+ * stored in the output buffer as a result of
+ * the conversion. */
+ int *dstCharsPtr) /* Filled with the number of characters that
+ * correspond to the bytes stored in the
+ * output buffer. */
+{
+ const char *srcStart, *srcEnd, *srcClose, *dstStart, *dstEnd;
+ int result, numChars;
+ int ch, len;
+
+ srcStart = src;
+ srcEnd = src + srcLen;
+ srcClose = srcEnd;
+ if ((flags & TCL_ENCODING_END) == 0) {
+ srcClose -= TCL_UTF_MAX;
+ }
+
+ dstStart = dst;
+ dstEnd = dst + dstLen - sizeof(Tcl_UniChar);
+ flags |= PTR2INT(clientData);
+
+ result = TCL_OK;
+ for (numChars = 0; src < srcEnd; numChars++) {
+ if ((src > srcClose) && (!Tcl_UtfCharComplete(src, srcEnd - src))) {
+ /*
+ * If there is more string to follow, this will ensure that the
+ * last UTF-8 character in the source buffer hasn't been cut off.
+ */
+
+ result = TCL_CONVERT_MULTIBYTE;
+ break;
+ }
+ if (dst > dstEnd) {
+ result = TCL_CONVERT_NOSPACE;
+ break;
+ }
+ len = TclUtfToUCS4(src, &ch);
+ if (!Tcl_UniCharIsUnicode(ch)) {
+ if (flags & TCL_ENCODING_STOPONERROR) {
+ result = TCL_CONVERT_UNKNOWN;
+ break;
+ }
+ ch = 0xFFFD;
+ }
+ src += len;
+ if (flags & TCL_ENCODING_LE) {
+ *dst++ = (ch & 0xFF);
+ *dst++ = ((ch >> 8) & 0xFF);
+ *dst++ = ((ch >> 16) & 0xFF);
+ *dst++ = ((ch >> 24) & 0xFF);
+ } else {
+ *dst++ = ((ch >> 24) & 0xFF);
+ *dst++ = ((ch >> 16) & 0xFF);
+ *dst++ = ((ch >> 8) & 0xFF);
+ *dst++ = (ch & 0xFF);
+ }
+ }
+
+ *srcReadPtr = src - srcStart;
+ *dstWrotePtr = dst - dstStart;
+ *dstCharsPtr = numChars;
+ return result;
+}
+
+/*
+ *-------------------------------------------------------------------------
+ *
* Utf16ToUtfProc --
*
* Convert from UTF-16 to UTF-8.
@@ -2651,7 +2863,7 @@ UtfToUcs2Proc(
*dstCharsPtr = numChars;
return result;
}
-
+
/*
*-------------------------------------------------------------------------
*
@@ -2837,11 +3049,7 @@ TableFromUtfProc(
len = TclUtfToUniChar(src, &ch);
#if TCL_UTF_MAX > 3
- /*
- * This prevents a crash condition. More evaluation is required for
- * full support of int Tcl_UniChar. [Bug 1004065]
- */
-
+ /* Unicode chars > +U0FFFF cannot be represented in any table encoding */
if (ch & 0xFFFF0000) {
word = 0;
} else
@@ -3093,7 +3301,7 @@ TableFreeProc(
ClientData clientData) /* TableEncodingData that specifies
* encoding. */
{
- TableEncodingData *dataPtr = (TableEncodingData *) clientData;
+ TableEncodingData *dataPtr = (TableEncodingData *)clientData;
/*
* Make sure we aren't freeing twice on shutdown. [Bug 219314]
@@ -3151,7 +3359,7 @@ EscapeToUtfProc(
* correspond to the bytes stored in the
* output buffer. */
{
- EscapeEncodingData *dataPtr = (EscapeEncodingData *) clientData;
+ EscapeEncodingData *dataPtr = (EscapeEncodingData *)clientData;
const char *prefixBytes, *tablePrefixBytes, *srcStart, *srcEnd;
const unsigned short *const *tableToUnicode;
const Encoding *encodingPtr;
@@ -3628,7 +3836,7 @@ GetTableEncoding(
/*
*---------------------------------------------------------------------------
*
- * unilen --
+ * unilen, unilen4 --
*
* A helper function for the Tcl_ExternalToUtf functions. This function
* is similar to strlen for double-byte characters: it returns the number
@@ -3655,6 +3863,19 @@ unilen(
}
return (char *) p - src;
}
+
+static size_t
+unilen4(
+ const char *src)
+{
+ unsigned int *p;
+
+ p = (unsigned int *) src;
+ while (*p != 0x00000000) {
+ p++;
+ }
+ return (char *) p - src;
+}
/*
*-------------------------------------------------------------------------
@@ -3686,7 +3907,7 @@ InitializeEncodingSearchPath(
Tcl_Encoding *encodingPtr)
{
const char *bytes;
- int i, numDirs;
+ int i, numDirs, numBytes;
Tcl_Obj *libPathObj, *encodingObj, *searchPathObj;
TclNewLiteralStringObj(encodingObj, "encoding");
@@ -3716,11 +3937,11 @@ InitializeEncodingSearchPath(
if (*encodingPtr) {
((Encoding *)(*encodingPtr))->refCount++;
}
- bytes = TclGetString(searchPathObj);
+ bytes = Tcl_GetStringFromObj(searchPathObj, &numBytes);
- *lengthPtr = searchPathObj->length;
- *valuePtr = (char *)ckalloc(*lengthPtr + 1);
- memcpy(*valuePtr, bytes, *lengthPtr + 1);
+ *lengthPtr = numBytes;
+ *valuePtr = (char *)ckalloc(numBytes + 1);
+ memcpy(*valuePtr, bytes, numBytes + 1);
Tcl_DecrRefCount(searchPathObj);
}
diff --git a/generic/tclEnsemble.c b/generic/tclEnsemble.c
index 8b94956..ec5db9b 100644
--- a/generic/tclEnsemble.c
+++ b/generic/tclEnsemble.c
@@ -84,18 +84,18 @@ static const Tcl_ObjType ensembleCmdType = {
NULL /* setFromAnyProc */
};
-#define ECRSetIntRep(objPtr, ecRepPtr) \
+#define ECRSetInternalRep(objPtr, ecRepPtr) \
do { \
- Tcl_ObjIntRep ir; \
+ Tcl_ObjInternalRep ir; \
ir.twoPtrValue.ptr1 = (ecRepPtr); \
ir.twoPtrValue.ptr2 = NULL; \
- Tcl_StoreIntRep((objPtr), &ensembleCmdType, &ir); \
+ Tcl_StoreInternalRep((objPtr), &ensembleCmdType, &ir); \
} while (0)
-#define ECRGetIntRep(objPtr, ecRepPtr) \
+#define ECRGetInternalRep(objPtr, ecRepPtr) \
do { \
- const Tcl_ObjIntRep *irPtr; \
- irPtr = TclFetchIntRep((objPtr), &ensembleCmdType); \
+ const Tcl_ObjInternalRep *irPtr; \
+ irPtr = TclFetchInternalRep((objPtr), &ensembleCmdType); \
(ecRepPtr) = irPtr ? (EnsembleCmdRep *)irPtr->twoPtrValue.ptr1 : NULL; \
} while (0)
@@ -1767,7 +1767,7 @@ NsEnsembleImplementationCmdNR(
*/
EnsembleCmdRep *ensembleCmd;
- ECRGetIntRep(subObj, ensembleCmd);
+ ECRGetInternalRep(subObj, ensembleCmd);
if (ensembleCmd) {
if (ensembleCmd->epoch == ensemblePtr->epoch &&
ensembleCmd->token == (Command *)ensemblePtr->token) {
@@ -2432,7 +2432,7 @@ MakeCachedEnsembleCommand(
{
EnsembleCmdRep *ensembleCmd;
- ECRGetIntRep(objPtr, ensembleCmd);
+ ECRGetInternalRep(objPtr, ensembleCmd);
if (ensembleCmd) {
TclCleanupCommandMacro(ensembleCmd->token);
if (ensembleCmd->fix) {
@@ -2445,7 +2445,7 @@ MakeCachedEnsembleCommand(
*/
ensembleCmd = (EnsembleCmdRep *)ckalloc(sizeof(EnsembleCmdRep));
- ECRSetIntRep(objPtr, ensembleCmd);
+ ECRSetInternalRep(objPtr, ensembleCmd);
}
/*
@@ -2855,7 +2855,7 @@ FreeEnsembleCmdRep(
{
EnsembleCmdRep *ensembleCmd;
- ECRGetIntRep(objPtr, ensembleCmd);
+ ECRGetInternalRep(objPtr, ensembleCmd);
TclCleanupCommandMacro(ensembleCmd->token);
if (ensembleCmd->fix) {
Tcl_DecrRefCount(ensembleCmd->fix);
@@ -2889,8 +2889,8 @@ DupEnsembleCmdRep(
EnsembleCmdRep *ensembleCmd;
EnsembleCmdRep *ensembleCopy = (EnsembleCmdRep *)ckalloc(sizeof(EnsembleCmdRep));
- ECRGetIntRep(objPtr, ensembleCmd);
- ECRSetIntRep(copyPtr, ensembleCopy);
+ ECRGetInternalRep(objPtr, ensembleCmd);
+ ECRSetInternalRep(copyPtr, ensembleCopy);
ensembleCopy->epoch = ensembleCmd->epoch;
ensembleCopy->token = ensembleCmd->token;
diff --git a/generic/tclEvent.c b/generic/tclEvent.c
index cb2e529..22b6a77 100644
--- a/generic/tclEvent.c
+++ b/generic/tclEvent.c
@@ -14,6 +14,7 @@
*/
#include "tclInt.h"
+#include "tclUuid.h"
/*
* The data structure below is used to report background errors. One such
@@ -1016,7 +1017,7 @@ Tcl_Exit(
* down another.
*
* Results:
- * None.
+ * The full Tcl version with build information.
*
* Side effects:
* Varied, see the respective initialization routines.
@@ -1024,7 +1025,89 @@ Tcl_Exit(
*-------------------------------------------------------------------------
*/
-void
+MODULE_SCOPE const TclStubs tclStubs;
+
+#ifndef STRINGIFY
+# define STRINGIFY(x) STRINGIFY1(x)
+# define STRINGIFY1(x) #x
+#endif
+
+static const struct {
+ const TclStubs *stubs;
+ const char version[256];
+} stubInfo = {
+ &tclStubs, {TCL_PATCH_LEVEL "+" STRINGIFY(TCL_VERSION_UUID)
+#if defined(__clang__) && defined(__clang_major__)
+ ".clang-" STRINGIFY(__clang_major__)
+#if __clang_minor__ < 10
+ "0"
+#endif
+ STRINGIFY(__clang_minor__)
+#endif
+#ifdef TCL_COMPILE_DEBUG
+ ".compiledebug"
+#endif
+#ifdef TCL_COMPILE_STATS
+ ".compilestats"
+#endif
+#if defined(__cplusplus) && !defined(__OBJC__)
+ ".cplusplus"
+#endif
+#ifndef NDEBUG
+ ".debug"
+#endif
+#if !defined(__clang__) && !defined(__INTEL_COMPILER) && defined(__GNUC__)
+ ".gcc-" STRINGIFY(__GNUC__)
+#if __GNUC_MINOR__ < 10
+ "0"
+#endif
+ STRINGIFY(__GNUC_MINOR__)
+#endif
+#ifdef __INTEL_COMPILER
+ ".icc-" STRINGIFY(__INTEL_COMPILER)
+#endif
+#if (defined(_WIN32) && !defined(_WIN64)) || (ULONG_MAX == 0xffffffffUL)
+ ".ilp32"
+#endif
+#ifdef TCL_MEM_DEBUG
+ ".memdebug"
+#endif
+#if defined(_MSC_VER)
+ ".msvc-" STRINGIFY(_MSC_VER)
+#endif
+#ifdef USE_NMAKE
+ ".nmake"
+#endif
+#ifdef TCL_NO_DEPRECATED
+ ".no-deprecate"
+#endif
+#if !TCL_THREADS
+ ".no-thread"
+#endif
+#ifndef TCL_CFG_OPTIMIZED
+ ".no-optimize"
+#endif
+#ifdef __OBJC__
+ ".objective-c"
+#if defined(__cplusplus)
+ "plusplus"
+#endif
+#endif
+#ifdef TCL_CFG_PROFILED
+ ".profile"
+#endif
+#ifdef PURIFY
+ ".purify"
+#endif
+#ifdef STATIC_BUILD
+ ".static"
+#endif
+#if TCL_UTF_MAX < 4
+ ".utf-16"
+#endif
+}};
+
+const char *
Tcl_InitSubsystems(void)
{
if (inExit != 0) {
@@ -1071,6 +1154,7 @@ Tcl_InitSubsystems(void)
TclpInitUnlock();
}
TclInitNotifier();
+ return stubInfo.version;
}
/*
diff --git a/generic/tclExecute.c b/generic/tclExecute.c
index 7e51c0d..73bd0e9 100644
--- a/generic/tclExecute.c
+++ b/generic/tclExecute.c
@@ -509,11 +509,11 @@ VarHashCreateVar(
*/
#define GetNumberFromObj(interp, objPtr, ptrPtr, tPtr) \
- ((TclHasIntRep((objPtr), &tclIntType)) \
+ ((TclHasInternalRep((objPtr), &tclIntType)) \
? (*(tPtr) = TCL_NUMBER_INT, \
*(ptrPtr) = (ClientData) \
(&((objPtr)->internalRep.wideValue)), TCL_OK) : \
- TclHasIntRep((objPtr), &tclDoubleType) \
+ TclHasInternalRep((objPtr), &tclDoubleType) \
? (((TclIsNaN((objPtr)->internalRep.doubleValue)) \
? (*(tPtr) = TCL_NUMBER_NAN) \
: (*(tPtr) = TCL_NUMBER_DOUBLE)), \
@@ -759,9 +759,9 @@ ReleaseDictIterator(
{
Tcl_DictSearch *searchPtr;
Tcl_Obj *dictPtr;
- const Tcl_ObjIntRep *irPtr;
+ const Tcl_ObjInternalRep *irPtr;
- irPtr = TclFetchIntRep(objPtr, &dictIteratorType);
+ irPtr = TclFetchInternalRep(objPtr, &dictIteratorType);
assert(irPtr != NULL);
/*
@@ -1474,7 +1474,7 @@ CompileExprObj(
* is valid in the current context.
*/
- ByteCodeGetIntRep(objPtr, &exprCodeType, codePtr);
+ ByteCodeGetInternalRep(objPtr, &exprCodeType, codePtr);
if (codePtr != NULL) {
Namespace *namespacePtr = iPtr->varFramePtr->nsPtr;
@@ -1484,7 +1484,7 @@ CompileExprObj(
|| (codePtr->nsPtr != namespacePtr)
|| (codePtr->nsEpoch != namespacePtr->resolverEpoch)
|| (codePtr->localCachePtr != iPtr->varFramePtr->localCachePtr)) {
- Tcl_StoreIntRep(objPtr, &exprCodeType, NULL);
+ Tcl_StoreInternalRep(objPtr, &exprCodeType, NULL);
codePtr = NULL;
}
}
@@ -1538,7 +1538,7 @@ CompileExprObj(
* DupExprCodeInternalRep --
*
* Part of the Tcl object type implementation for Tcl expression
- * bytecode. We do not copy the bytecode intrep. Instead, we return
+ * bytecode. We do not copy the bytecode internalrep. Instead, we return
* without setting copyPtr->typePtr, so the copy is a plain string copy
* of the expression value, and if it is to be used as a compiled
* expression, it will just need a recompile.
@@ -1547,7 +1547,7 @@ CompileExprObj(
* usual (only?) time Tcl_DuplicateObj() will be called is when the copy
* is about to be modified, which would invalidate any copied bytecode
* anyway. The only reason it might make sense to copy the bytecode is if
- * we had some modifying routines that operated directly on the intrep,
+ * we had some modifying routines that operated directly on the internalrep,
* like we do for lists and dicts.
*
* Results:
@@ -1590,7 +1590,7 @@ FreeExprCodeInternalRep(
Tcl_Obj *objPtr)
{
ByteCode *codePtr;
- ByteCodeGetIntRep(objPtr, &exprCodeType, codePtr);
+ ByteCodeGetInternalRep(objPtr, &exprCodeType, codePtr);
assert(codePtr != NULL);
TclReleaseByteCode(codePtr);
@@ -1629,7 +1629,7 @@ TclCompileObj(
* compilation). Otherwise, check that it is "fresh" enough.
*/
- ByteCodeGetIntRep(objPtr, &tclByteCodeType, codePtr);
+ ByteCodeGetInternalRep(objPtr, &tclByteCodeType, codePtr);
if (codePtr != NULL) {
/*
* Make sure the Bytecode hasn't been invalidated by, e.g., someone
@@ -1775,7 +1775,7 @@ TclCompileObj(
iPtr->invokeWord = word;
TclSetByteCodeFromAny(interp, objPtr, NULL, NULL);
iPtr->invokeCmdFramePtr = NULL;
- ByteCodeGetIntRep(objPtr, &tclByteCodeType, codePtr);
+ ByteCodeGetInternalRep(objPtr, &tclByteCodeType, codePtr);
if (iPtr->varFramePtr->localCachePtr) {
codePtr->localCachePtr = iPtr->varFramePtr->localCachePtr;
codePtr->localCachePtr->refCount++;
@@ -4864,7 +4864,7 @@ TEBCresume(
*/
if ((TclListObjGetElements(interp, valuePtr, &objc, &objv) == TCL_OK)
- && !TclHasIntRep(value2Ptr, &tclListType)) {
+ && !TclHasInternalRep(value2Ptr, &tclListType)) {
int code;
DECACHE_STACK_INFO();
@@ -5262,7 +5262,7 @@ TEBCresume(
} else {
length = Tcl_UtfToUpper(TclGetString(valuePtr));
Tcl_SetObjLength(valuePtr, length);
- TclFreeIntRep(valuePtr);
+ TclFreeInternalRep(valuePtr);
TRACE_APPEND(("\"%.20s\"\n", O2S(valuePtr)));
NEXT_INST_F(1, 0, 0);
}
@@ -5279,7 +5279,7 @@ TEBCresume(
} else {
length = Tcl_UtfToLower(TclGetString(valuePtr));
Tcl_SetObjLength(valuePtr, length);
- TclFreeIntRep(valuePtr);
+ TclFreeInternalRep(valuePtr);
TRACE_APPEND(("\"%.20s\"\n", O2S(valuePtr)));
NEXT_INST_F(1, 0, 0);
}
@@ -5296,7 +5296,7 @@ TEBCresume(
} else {
length = Tcl_UtfToTitle(TclGetString(valuePtr));
Tcl_SetObjLength(valuePtr, length);
- TclFreeIntRep(valuePtr);
+ TclFreeInternalRep(valuePtr);
TRACE_APPEND(("\"%.20s\"\n", O2S(valuePtr)));
NEXT_INST_F(1, 0, 0);
}
@@ -5610,8 +5610,8 @@ TEBCresume(
* both.
*/
- if (TclHasIntRep(valuePtr, &tclStringType)
- || TclHasIntRep(value2Ptr, &tclStringType)) {
+ if (TclHasInternalRep(valuePtr, &tclStringType)
+ || TclHasInternalRep(value2Ptr, &tclStringType)) {
Tcl_UniChar *ustring1, *ustring2;
ustring1 = Tcl_GetUnicodeFromObj(valuePtr, &length);
@@ -6400,7 +6400,7 @@ TEBCresume(
if (Tcl_IsShared(valuePtr)) {
/*
* Here we do some surgery within the Tcl_Obj internals. We want
- * to copy the intrep, but not the string, so we temporarily hide
+ * to copy the internalrep, but not the string, so we temporarily hide
* the string so we do not copy it.
*/
@@ -6425,7 +6425,7 @@ TEBCresume(
case INST_TRY_CVT_TO_BOOLEAN:
valuePtr = OBJ_AT_TOS;
- if (TclHasIntRep(valuePtr, &tclBooleanType)) {
+ if (TclHasInternalRep(valuePtr, &tclBooleanType)) {
objResultPtr = TCONST(1);
} else {
int res = (TclSetBooleanFromAny(NULL, valuePtr) == TCL_OK);
@@ -7260,7 +7260,7 @@ TEBCresume(
/*
* dictPtr is no longer on the stack, and we're not
- * moving it into the intrep of an iterator. We need
+ * moving it into the internalrep of an iterator. We need
* to drop the refcount [Tcl Bug 9b352768e6].
*/
@@ -7270,15 +7270,15 @@ TEBCresume(
goto gotError;
}
{
- Tcl_ObjIntRep ir;
+ Tcl_ObjInternalRep ir;
TclNewObj(statePtr);
ir.twoPtrValue.ptr1 = searchPtr;
ir.twoPtrValue.ptr2 = dictPtr;
- Tcl_StoreIntRep(statePtr, &dictIteratorType, &ir);
+ Tcl_StoreInternalRep(statePtr, &dictIteratorType, &ir);
}
varPtr = LOCAL(opnd);
if (varPtr->value.objPtr) {
- if (TclHasIntRep(varPtr->value.objPtr, &dictIteratorType)) {
+ if (TclHasInternalRep(varPtr->value.objPtr, &dictIteratorType)) {
Tcl_Panic("mis-issued dictFirst!");
}
TclDecrRefCount(varPtr->value.objPtr);
@@ -7292,10 +7292,10 @@ TEBCresume(
TRACE(("%u => ", opnd));
statePtr = (*LOCAL(opnd)).value.objPtr;
{
- const Tcl_ObjIntRep *irPtr;
+ const Tcl_ObjInternalRep *irPtr;
if (statePtr &&
- (irPtr = TclFetchIntRep(statePtr, &dictIteratorType))) {
+ (irPtr = TclFetchInternalRep(statePtr, &dictIteratorType))) {
searchPtr = (Tcl_DictSearch *)irPtr->twoPtrValue.ptr1;
Tcl_DictObjNext(searchPtr, &keyPtr, &valuePtr, &done);
} else {
@@ -9852,7 +9852,7 @@ EvalStatsCmd(
for (i = 0; i < globalTablePtr->numBuckets; i++) {
for (entryPtr = globalTablePtr->buckets[i]; entryPtr != NULL;
entryPtr = entryPtr->nextPtr) {
- if (TclHasIntRep(entryPtr->objPtr, &tclByteCodeType)) {
+ if (TclHasInternalRep(entryPtr->objPtr, &tclByteCodeType)) {
numByteCodeLits++;
}
(void) TclGetStringFromObj(entryPtr->objPtr, &length);
diff --git a/generic/tclGet.c b/generic/tclGet.c
index 3dbc545..970e093 100644
--- a/generic/tclGet.c
+++ b/generic/tclGet.c
@@ -53,7 +53,7 @@ Tcl_GetInt(
if (obj.refCount > 1) {
Tcl_Panic("invalid sharing of Tcl_Obj on C stack");
}
- TclFreeIntRep(&obj);
+ TclFreeInternalRep(&obj);
return code;
}
@@ -97,7 +97,7 @@ Tcl_GetDouble(
if (obj.refCount > 1) {
Tcl_Panic("invalid sharing of Tcl_Obj on C stack");
}
- TclFreeIntRep(&obj);
+ TclFreeInternalRep(&obj);
return code;
}
diff --git a/generic/tclIO.c b/generic/tclIO.c
index d704d29..2d2f2fc 100644
--- a/generic/tclIO.c
+++ b/generic/tclIO.c
@@ -324,30 +324,30 @@ typedef struct ResolvedChanName {
size_t refCount; /* Share this struct among many Tcl_Obj. */
} ResolvedChanName;
-static void DupChannelIntRep(Tcl_Obj *objPtr, Tcl_Obj *copyPtr);
-static void FreeChannelIntRep(Tcl_Obj *objPtr);
+static void DupChannelInternalRep(Tcl_Obj *objPtr, Tcl_Obj *copyPtr);
+static void FreeChannelInternalRep(Tcl_Obj *objPtr);
static const Tcl_ObjType chanObjType = {
"channel", /* name for this type */
- FreeChannelIntRep, /* freeIntRepProc */
- DupChannelIntRep, /* dupIntRepProc */
+ FreeChannelInternalRep, /* freeIntRepProc */
+ DupChannelInternalRep, /* dupIntRepProc */
NULL, /* updateStringProc */
NULL /* setFromAnyProc */
};
-#define ChanSetIntRep(objPtr, resPtr) \
+#define ChanSetInternalRep(objPtr, resPtr) \
do { \
- Tcl_ObjIntRep ir; \
+ Tcl_ObjInternalRep ir; \
(resPtr)->refCount++; \
ir.twoPtrValue.ptr1 = (resPtr); \
ir.twoPtrValue.ptr2 = NULL; \
- Tcl_StoreIntRep((objPtr), &chanObjType, &ir); \
+ Tcl_StoreInternalRep((objPtr), &chanObjType, &ir); \
} while (0)
-#define ChanGetIntRep(objPtr, resPtr) \
+#define ChanGetInternalRep(objPtr, resPtr) \
do { \
- const Tcl_ObjIntRep *irPtr; \
- irPtr = TclFetchIntRep((objPtr), &chanObjType); \
+ const Tcl_ObjInternalRep *irPtr; \
+ irPtr = TclFetchInternalRep((objPtr), &chanObjType); \
(resPtr) = irPtr ? (ResolvedChanName *)irPtr->twoPtrValue.ptr1 : NULL; \
} while (0)
@@ -1524,7 +1524,7 @@ TclGetChannelFromObj(
return TCL_ERROR;
}
- ChanGetIntRep(objPtr, resPtr);
+ ChanGetInternalRep(objPtr, resPtr);
if (resPtr) {
/*
* Confirm validity of saved lookup results.
@@ -1546,7 +1546,7 @@ TclGetChannelFromObj(
if (chan == NULL) {
if (resPtr) {
- Tcl_StoreIntRep(objPtr, &chanObjType, NULL);
+ Tcl_StoreInternalRep(objPtr, &chanObjType, NULL);
}
return TCL_ERROR;
}
@@ -1560,7 +1560,7 @@ TclGetChannelFromObj(
} else {
resPtr = (ResolvedChanName *) ckalloc(sizeof(ResolvedChanName));
resPtr->refCount = 0;
- ChanSetIntRep(objPtr, resPtr); /* Overwrites, if needed */
+ ChanSetInternalRep(objPtr, resPtr); /* Overwrites, if needed */
}
statePtr = ((Channel *)chan)->state;
resPtr->statePtr = statePtr;
@@ -9436,13 +9436,13 @@ MBWrite(
if (bufPtr) {
/* Split the overflowing buffer in two */
int extra = (int) (inBytes - csPtr->toRead);
- /* Note that going with int for extra assumes that inBytes is not too
- * much over toRead to require a wide itself. If that gets violated
- * then the calculations involving extra must be made wide too.
- *
- * Noted with Win32/MSVC debug build treating the warning (possible of
- * data in __int64 to int conversion) as error.
- */
+ /* Note that going with int for extra assumes that inBytes is not too
+ * much over toRead to require a wide itself. If that gets violated
+ * then the calculations involving extra must be made wide too.
+ *
+ * Noted with Win32/MSVC debug build treating the warning (possible of
+ * data in long long to int conversion) as error.
+ */
bufPtr = AllocChannelBuffer(extra);
@@ -11274,7 +11274,7 @@ Tcl_ChannelTruncateProc(
/*
*----------------------------------------------------------------------
*
- * DupChannelIntRep --
+ * DupChannelInternalRep --
*
* Initialize the internal representation of a new Tcl_Obj to a copy of
* the internal representation of an existing string object.
@@ -11290,7 +11290,7 @@ Tcl_ChannelTruncateProc(
*/
static void
-DupChannelIntRep(
+DupChannelInternalRep(
Tcl_Obj *srcPtr, /* Object with internal rep to copy. Must have
* an internal rep of type "Channel". */
Tcl_Obj *copyPtr) /* Object with internal rep to set. Must not
@@ -11298,15 +11298,15 @@ DupChannelIntRep(
{
ResolvedChanName *resPtr;
- ChanGetIntRep(srcPtr, resPtr);
+ ChanGetInternalRep(srcPtr, resPtr);
assert(resPtr);
- ChanSetIntRep(copyPtr, resPtr);
+ ChanSetInternalRep(copyPtr, resPtr);
}
/*
*----------------------------------------------------------------------
*
- * FreeChannelIntRep --
+ * FreeChannelInternalRep --
*
* Release statePtr storage.
*
@@ -11320,12 +11320,12 @@ DupChannelIntRep(
*/
static void
-FreeChannelIntRep(
+FreeChannelInternalRep(
Tcl_Obj *objPtr) /* Object with internal rep to free. */
{
ResolvedChanName *resPtr;
- ChanGetIntRep(objPtr, resPtr);
+ ChanGetInternalRep(objPtr, resPtr);
assert(resPtr);
if (resPtr->refCount-- > 1) {
return;
diff --git a/generic/tclIndexObj.c b/generic/tclIndexObj.c
index c33caf8..c2812ea 100644
--- a/generic/tclIndexObj.c
+++ b/generic/tclIndexObj.c
@@ -122,7 +122,7 @@ Tcl_GetIndexFromObj(
* the common case where the result is cached).
*/
- const Tcl_ObjIntRep *irPtr = TclFetchIntRep(objPtr, &indexType);
+ const Tcl_ObjInternalRep *irPtr = TclFetchInternalRep(objPtr, &indexType);
if (irPtr) {
IndexRep *indexRep = (IndexRep *)irPtr->twoPtrValue.ptr1;
@@ -270,7 +270,7 @@ Tcl_GetIndexFromObjStruct(
const char *const *entryPtr;
Tcl_Obj *resultPtr;
IndexRep *indexRep;
- const Tcl_ObjIntRep *irPtr;
+ const Tcl_ObjInternalRep *irPtr;
/* Protect against invalid values, like -1 or 0. */
if (offset < (int)sizeof(char *)) {
@@ -281,7 +281,7 @@ Tcl_GetIndexFromObjStruct(
*/
if (!(flags & TCL_INDEX_TEMP_TABLE)) {
- irPtr = TclFetchIntRep(objPtr, &indexType);
+ irPtr = TclFetchInternalRep(objPtr, &indexType);
if (irPtr) {
indexRep = (IndexRep *)irPtr->twoPtrValue.ptr1;
if (indexRep->tablePtr==tablePtr && indexRep->offset==offset) {
@@ -345,15 +345,15 @@ Tcl_GetIndexFromObjStruct(
*/
if (!(flags & TCL_INDEX_TEMP_TABLE)) {
- irPtr = TclFetchIntRep(objPtr, &indexType);
+ irPtr = TclFetchInternalRep(objPtr, &indexType);
if (irPtr) {
indexRep = (IndexRep *)irPtr->twoPtrValue.ptr1;
} else {
- Tcl_ObjIntRep ir;
+ Tcl_ObjInternalRep ir;
indexRep = (IndexRep*)ckalloc(sizeof(IndexRep));
ir.twoPtrValue.ptr1 = indexRep;
- Tcl_StoreIntRep(objPtr, &indexType, &ir);
+ Tcl_StoreInternalRep(objPtr, &indexType, &ir);
}
indexRep->tablePtr = (void *) tablePtr;
indexRep->offset = offset;
@@ -423,7 +423,7 @@ static void
UpdateStringOfIndex(
Tcl_Obj *objPtr)
{
- IndexRep *indexRep = (IndexRep *)TclFetchIntRep(objPtr, &indexType)->twoPtrValue.ptr1;
+ IndexRep *indexRep = (IndexRep *)TclFetchInternalRep(objPtr, &indexType)->twoPtrValue.ptr1;
const char *indexStr = EXPAND_OF(indexRep);
Tcl_InitStringRep(objPtr, indexStr, strlen(indexStr));
@@ -452,14 +452,14 @@ DupIndex(
Tcl_Obj *srcPtr,
Tcl_Obj *dupPtr)
{
- Tcl_ObjIntRep ir;
+ Tcl_ObjInternalRep ir;
IndexRep *dupIndexRep = (IndexRep *)ckalloc(sizeof(IndexRep));
- memcpy(dupIndexRep, TclFetchIntRep(srcPtr, &indexType)->twoPtrValue.ptr1,
+ memcpy(dupIndexRep, TclFetchInternalRep(srcPtr, &indexType)->twoPtrValue.ptr1,
sizeof(IndexRep));
ir.twoPtrValue.ptr1 = dupIndexRep;
- Tcl_StoreIntRep(dupPtr, &indexType, &ir);
+ Tcl_StoreInternalRep(dupPtr, &indexType, &ir);
}
/*
@@ -483,7 +483,7 @@ static void
FreeIndex(
Tcl_Obj *objPtr)
{
- ckfree(TclFetchIntRep(objPtr, &indexType)->twoPtrValue.ptr1);
+ ckfree(TclFetchInternalRep(objPtr, &indexType)->twoPtrValue.ptr1);
objPtr->typePtr = NULL;
}
@@ -922,9 +922,9 @@ Tcl_WrongNumArgs(
/*
* Add the element, quoting it if necessary.
*/
- const Tcl_ObjIntRep *irPtr;
+ const Tcl_ObjInternalRep *irPtr;
- if ((irPtr = TclFetchIntRep(origObjv[i], &indexType))) {
+ if ((irPtr = TclFetchInternalRep(origObjv[i], &indexType))) {
IndexRep *indexRep = (IndexRep *)irPtr->twoPtrValue.ptr1;
elementStr = EXPAND_OF(indexRep);
@@ -971,9 +971,9 @@ Tcl_WrongNumArgs(
* the correct error message even if the subcommand was abbreviated.
* Otherwise, just use the string rep.
*/
- const Tcl_ObjIntRep *irPtr;
+ const Tcl_ObjInternalRep *irPtr;
- if ((irPtr = TclFetchIntRep(objv[i], &indexType))) {
+ if ((irPtr = TclFetchInternalRep(objv[i], &indexType))) {
IndexRep *indexRep = (IndexRep *)irPtr->twoPtrValue.ptr1;
Tcl_AppendStringsToObj(objPtr, EXPAND_OF(indexRep), NULL);
@@ -1418,7 +1418,7 @@ TclGetCompletionCodeFromObj(
"ok", "error", "return", "break", "continue", NULL
};
- if (!TclHasIntRep(value, &indexType)
+ if (!TclHasInternalRep(value, &indexType)
&& TclGetIntFromObj(NULL, value, codePtr) == TCL_OK) {
return TCL_OK;
}
diff --git a/generic/tclInt.decls b/generic/tclInt.decls
index aad7db3..0b3ea9e 100644
--- a/generic/tclInt.decls
+++ b/generic/tclInt.decls
@@ -1037,11 +1037,6 @@ declare 258 {
}
declare 259 {
- unsigned char *TclGetBytesFromObj(Tcl_Interp *interp, Tcl_Obj *objPtr,
- int *lengthPtr)
-}
-
-declare 260 {
void TclUnusedStubEntry(void)
}
diff --git a/generic/tclInt.h b/generic/tclInt.h
index 66b9375..140abb8 100644
--- a/generic/tclInt.h
+++ b/generic/tclInt.h
@@ -3220,7 +3220,7 @@ MODULE_SCOPE int TclScanElement(const char *string, int length,
char *flagPtr);
MODULE_SCOPE void TclSetBgErrorHandler(Tcl_Interp *interp,
Tcl_Obj *cmdPrefix);
-MODULE_SCOPE void TclSetBignumIntRep(Tcl_Obj *objPtr,
+MODULE_SCOPE void TclSetBignumInternalRep(Tcl_Obj *objPtr,
void *bignumValue);
MODULE_SCOPE int TclSetBooleanFromAny(Tcl_Interp *interp,
Tcl_Obj *objPtr);
@@ -4487,15 +4487,22 @@ MODULE_SCOPE void TclDbInitNewObj(Tcl_Obj *objPtr, const char *file,
/*
*----------------------------------------------------------------
* Macro used by the Tcl core to set a Tcl_Obj's string representation to a
- * copy of the "len" bytes starting at "bytePtr". This code works even if the
- * byte array contains NULLs as long as the length is correct. Because "len"
- * is referenced multiple times, it should be as simple an expression as
- * possible. The ANSI C "prototype" for this macro is:
+ * copy of the "len" bytes starting at "bytePtr". The value of "len" must
+ * not be negative. When "len" is 0, then it is acceptable to pass
+ * "bytePtr" = NULL. When "len" > 0, "bytePtr" must not be NULL, and it
+ * must point to a location from which "len" bytes may be read. These
+ * constraints are not checked here. The validity of the bytes copied
+ * as a value string representation is also not verififed. This macro
+ * must not be called while "objPtr" is being freed or when "objPtr"
+ * already has a string representation. The caller must use
+ * this macro properly. Improper use can lead to dangerous results.
+ * Because "len" is referenced multiple times, take care that it is an
+ * expression with the same value each use.
+ *
+ * The ANSI C "prototype" for this macro is:
*
* MODULE_SCOPE void TclInitStringRep(Tcl_Obj *objPtr, char *bytePtr, int len);
*
- * This macro should only be called on an unshared objPtr where
- * objPtr->typePtr->freeIntRepProc == NULL
*----------------------------------------------------------------
*/
@@ -4537,11 +4544,11 @@ MODULE_SCOPE void TclDbInitNewObj(Tcl_Obj *objPtr, const char *file,
* representation. Does not actually reset the rep's bytes. The ANSI C
* "prototype" for this macro is:
*
- * MODULE_SCOPE void TclFreeIntRep(Tcl_Obj *objPtr);
+ * MODULE_SCOPE void TclFreeInternalRep(Tcl_Obj *objPtr);
*----------------------------------------------------------------
*/
-#define TclFreeIntRep(objPtr) \
+#define TclFreeInternalRep(objPtr) \
if ((objPtr)->typePtr != NULL) { \
if ((objPtr)->typePtr->freeIntRepProc != NULL) { \
(objPtr)->typePtr->freeIntRepProc(objPtr); \
@@ -4549,6 +4556,10 @@ MODULE_SCOPE void TclDbInitNewObj(Tcl_Obj *objPtr, const char *file,
(objPtr)->typePtr = NULL; \
}
+#if !defined(TCL_NO_DEPRECATED) && TCL_MAJOR_VERSION < 8
+# define TclFreeIntRep(objPtr) TclFreeInternalRep(objPtr)
+#endif
+
/*
*----------------------------------------------------------------
* Macro used by the Tcl core to clean out an object's string representation.
@@ -4759,10 +4770,10 @@ MODULE_SCOPE const TclFileAttrProcs tclpFileAttrProcs[];
MODULE_SCOPE int TclIsPureByteArray(Tcl_Obj *objPtr);
#define TclIsPureDict(objPtr) \
(((objPtr)->bytes==NULL) && ((objPtr)->typePtr==&tclDictType))
-#define TclHasIntRep(objPtr, type) \
+#define TclHasInternalRep(objPtr, type) \
((objPtr)->typePtr == (type))
-#define TclFetchIntRep(objPtr, type) \
- (TclHasIntRep((objPtr), (type)) ? &((objPtr)->internalRep) : NULL)
+#define TclFetchInternalRep(objPtr, type) \
+ (TclHasInternalRep((objPtr), (type)) ? &((objPtr)->internalRep) : NULL)
/*
@@ -4852,18 +4863,18 @@ MODULE_SCOPE Tcl_LibraryInitProc Procbodytest_SafeInit;
#define TclSetIntObj(objPtr, i) \
do { \
- Tcl_ObjIntRep ir; \
+ Tcl_ObjInternalRep ir; \
ir.wideValue = (Tcl_WideInt) i; \
TclInvalidateStringRep(objPtr); \
- Tcl_StoreIntRep(objPtr, &tclIntType, &ir); \
+ Tcl_StoreInternalRep(objPtr, &tclIntType, &ir); \
} while (0)
#define TclSetDoubleObj(objPtr, d) \
do { \
- Tcl_ObjIntRep ir; \
+ Tcl_ObjInternalRep ir; \
ir.doubleValue = (double) d; \
TclInvalidateStringRep(objPtr); \
- Tcl_StoreIntRep(objPtr, &tclDoubleType, &ir); \
+ Tcl_StoreInternalRep(objPtr, &tclDoubleType, &ir); \
} while (0)
/*
diff --git a/generic/tclIntDecls.h b/generic/tclIntDecls.h
index 5ae92e4..75f4a68 100644
--- a/generic/tclIntDecls.h
+++ b/generic/tclIntDecls.h
@@ -659,9 +659,6 @@ EXTERN void TclStaticLibrary(Tcl_Interp *interp,
EXTERN Tcl_Obj * TclpCreateTemporaryDirectory(Tcl_Obj *dirObj,
Tcl_Obj *basenameObj);
/* 259 */
-EXTERN unsigned char * TclGetBytesFromObj(Tcl_Interp *interp,
- Tcl_Obj *objPtr, int *lengthPtr);
-/* 260 */
EXTERN void TclUnusedStubEntry(void);
typedef struct TclIntStubs {
@@ -927,8 +924,7 @@ typedef struct TclIntStubs {
int (*tclPtrUnsetVar) (Tcl_Interp *interp, Tcl_Var varPtr, Tcl_Var arrayPtr, Tcl_Obj *part1Ptr, Tcl_Obj *part2Ptr, const int flags); /* 256 */
void (*tclStaticLibrary) (Tcl_Interp *interp, const char *prefix, Tcl_LibraryInitProc *initProc, Tcl_LibraryInitProc *safeInitProc); /* 257 */
Tcl_Obj * (*tclpCreateTemporaryDirectory) (Tcl_Obj *dirObj, Tcl_Obj *basenameObj); /* 258 */
- unsigned char * (*tclGetBytesFromObj) (Tcl_Interp *interp, Tcl_Obj *objPtr, int *lengthPtr); /* 259 */
- void (*tclUnusedStubEntry) (void); /* 260 */
+ void (*tclUnusedStubEntry) (void); /* 259 */
} TclIntStubs;
extern const TclIntStubs *tclIntStubsPtr;
@@ -1374,10 +1370,8 @@ extern const TclIntStubs *tclIntStubsPtr;
(tclIntStubsPtr->tclStaticLibrary) /* 257 */
#define TclpCreateTemporaryDirectory \
(tclIntStubsPtr->tclpCreateTemporaryDirectory) /* 258 */
-#define TclGetBytesFromObj \
- (tclIntStubsPtr->tclGetBytesFromObj) /* 259 */
#define TclUnusedStubEntry \
- (tclIntStubsPtr->tclUnusedStubEntry) /* 260 */
+ (tclIntStubsPtr->tclUnusedStubEntry) /* 259 */
#endif /* defined(USE_TCL_STUBS) */
diff --git a/generic/tclLink.c b/generic/tclLink.c
index 02b19aa..34ad67b 100644
--- a/generic/tclLink.c
+++ b/generic/tclLink.c
@@ -588,7 +588,7 @@ GetDouble(
return 0;
} else {
#ifdef ACCEPT_NAN
- Tcl_ObjIntRep *irPtr = TclFetchIntRep(objPtr, &tclDoubleType);
+ Tcl_ObjInternalRep *irPtr = TclFetchInternalRep(objPtr, &tclDoubleType);
if (irPtr != NULL) {
*dblPtr = irPtr->doubleValue;
@@ -656,7 +656,7 @@ SetInvalidRealFromAny(
double doubleValue = 0.0;
Tcl_GetDoubleFromObj(NULL, objPtr, &doubleValue);
- TclFreeIntRep(objPtr);
+ TclFreeInternalRep(objPtr);
objPtr->typePtr = &invalidRealType;
objPtr->internalRep.doubleValue = doubleValue;
return TCL_OK;
@@ -705,7 +705,7 @@ GetInvalidDoubleFromObj(
{
int intValue;
- if (TclHasIntRep(objPtr, &invalidRealType)) {
+ if (TclHasInternalRep(objPtr, &invalidRealType)) {
goto gotdouble;
}
if (GetInvalidIntFromObj(objPtr, &intValue) == TCL_OK) {
diff --git a/generic/tclListObj.c b/generic/tclListObj.c
index 0cc1c11..c66fd1e 100644
--- a/generic/tclListObj.c
+++ b/generic/tclListObj.c
@@ -20,7 +20,7 @@
static List * AttemptNewList(Tcl_Interp *interp, int objc,
Tcl_Obj *const objv[]);
-static List * NewListIntRep(int objc, Tcl_Obj *const objv[], int p);
+static List * NewListInternalRep(int objc, Tcl_Obj *const objv[], int p);
static void DupListInternalRep(Tcl_Obj *srcPtr, Tcl_Obj *copyPtr);
static void FreeListInternalRep(Tcl_Obj *listPtr);
static int SetListFromAny(Tcl_Interp *interp, Tcl_Obj *objPtr);
@@ -49,24 +49,24 @@ const Tcl_ObjType tclListType = {
/* Macros to manipulate the List internal rep */
-#define ListSetIntRep(objPtr, listRepPtr) \
+#define ListSetInternalRep(objPtr, listRepPtr) \
do { \
- Tcl_ObjIntRep ir; \
+ Tcl_ObjInternalRep ir; \
ir.twoPtrValue.ptr1 = (listRepPtr); \
ir.twoPtrValue.ptr2 = NULL; \
(listRepPtr)->refCount++; \
- Tcl_StoreIntRep((objPtr), &tclListType, &ir); \
+ Tcl_StoreInternalRep((objPtr), &tclListType, &ir); \
} while (0)
-#define ListGetIntRep(objPtr, listRepPtr) \
+#define ListGetInternalRep(objPtr, listRepPtr) \
do { \
- const Tcl_ObjIntRep *irPtr; \
- irPtr = TclFetchIntRep((objPtr), &tclListType); \
+ const Tcl_ObjInternalRep *irPtr; \
+ irPtr = TclFetchInternalRep((objPtr), &tclListType); \
(listRepPtr) = irPtr ? (List *)irPtr->twoPtrValue.ptr1 : NULL; \
} while (0)
-#define ListResetIntRep(objPtr, listRepPtr) \
- TclFetchIntRep((objPtr), &tclListType)->twoPtrValue.ptr1 = (listRepPtr)
+#define ListResetInternalRep(objPtr, listRepPtr) \
+ TclFetchInternalRep((objPtr), &tclListType)->twoPtrValue.ptr1 = (listRepPtr)
#ifndef TCL_MIN_ELEMENT_GROWTH
#define TCL_MIN_ELEMENT_GROWTH TCL_MIN_GROWTH/sizeof(Tcl_Obj *)
@@ -75,7 +75,7 @@ const Tcl_ObjType tclListType = {
/*
*----------------------------------------------------------------------
*
- * NewListIntRep --
+ * NewListInternalRep --
*
* Creates a list internal rep with space for objc elements. objc
* must be > 0. If objv!=NULL, initializes with the first objc values
@@ -96,7 +96,7 @@ const Tcl_ObjType tclListType = {
*/
static List *
-NewListIntRep(
+NewListInternalRep(
int objc,
Tcl_Obj *const objv[],
int p)
@@ -104,7 +104,7 @@ NewListIntRep(
List *listRepPtr;
if (objc <= 0) {
- Tcl_Panic("NewListIntRep: expects postive element count");
+ Tcl_Panic("NewListInternalRep: expects postive element count");
}
/*
@@ -179,7 +179,7 @@ AttemptNewList(
int objc,
Tcl_Obj *const objv[])
{
- List *listRepPtr = NewListIntRep(objc, objv, 0);
+ List *listRepPtr = NewListInternalRep(objc, objv, 0);
if (interp != NULL && listRepPtr == NULL) {
if (objc > LIST_MAX) {
@@ -253,14 +253,14 @@ Tcl_NewListObj(
* Create the internal rep.
*/
- listRepPtr = NewListIntRep(objc, objv, 1);
+ listRepPtr = NewListInternalRep(objc, objv, 1);
/*
* Now create the object.
*/
TclInvalidateStringRep(listPtr);
- ListSetIntRep(listPtr, listRepPtr);
+ ListSetInternalRep(listPtr, listRepPtr);
return listPtr;
}
#endif /* if TCL_MEM_DEBUG */
@@ -318,14 +318,14 @@ Tcl_DbNewListObj(
* Create the internal rep.
*/
- listRepPtr = NewListIntRep(objc, objv, 1);
+ listRepPtr = NewListInternalRep(objc, objv, 1);
/*
* Now create the object.
*/
TclInvalidateStringRep(listPtr);
- ListSetIntRep(listPtr, listRepPtr);
+ ListSetInternalRep(listPtr, listRepPtr);
return listPtr;
}
@@ -381,7 +381,7 @@ Tcl_SetListObj(
* Free any old string rep and any internal rep for the old type.
*/
- TclFreeIntRep(objPtr);
+ TclFreeInternalRep(objPtr);
TclInvalidateStringRep(objPtr);
/*
@@ -391,8 +391,8 @@ Tcl_SetListObj(
*/
if (objc > 0) {
- listRepPtr = NewListIntRep(objc, objv, 1);
- ListSetIntRep(objPtr, listRepPtr);
+ listRepPtr = NewListInternalRep(objc, objv, 1);
+ ListSetInternalRep(objPtr, listRepPtr);
} else {
Tcl_InitStringRep(objPtr, NULL, 0);
}
@@ -428,7 +428,7 @@ TclListObjCopy(
Tcl_Obj *copyPtr;
List *listRepPtr;
- ListGetIntRep(listPtr, listRepPtr);
+ ListGetInternalRep(listPtr, listRepPtr);
if (NULL == listRepPtr) {
if (SetListFromAny(interp, listPtr) != TCL_OK) {
return NULL;
@@ -566,7 +566,7 @@ Tcl_ListObjGetElements(
{
List *listRepPtr;
- ListGetIntRep(listPtr, listRepPtr);
+ ListGetInternalRep(listPtr, listRepPtr);
if (listRepPtr == NULL) {
int result, length;
@@ -581,7 +581,7 @@ Tcl_ListObjGetElements(
if (result != TCL_OK) {
return result;
}
- ListGetIntRep(listPtr, listRepPtr);
+ ListGetInternalRep(listPtr, listRepPtr);
}
*objcPtr = listRepPtr->elemCount;
*objvPtr = &listRepPtr->elements;
@@ -680,7 +680,7 @@ Tcl_ListObjAppendElement(
Tcl_Panic("%s called with shared object", "Tcl_ListObjAppendElement");
}
- ListGetIntRep(listPtr, listRepPtr);
+ ListGetInternalRep(listPtr, listRepPtr);
if (listRepPtr == NULL) {
int result, length;
@@ -693,7 +693,7 @@ Tcl_ListObjAppendElement(
if (result != TCL_OK) {
return result;
}
- ListGetIntRep(listPtr, listRepPtr);
+ ListGetInternalRep(listPtr, listRepPtr);
}
numElems = listRepPtr->elemCount;
@@ -713,7 +713,7 @@ Tcl_ListObjAppendElement(
if (needGrow && !isShared) {
/*
- * Need to grow + unshared intrep => try to realloc
+ * Need to grow + unshared internalrep => try to realloc
*/
attempt = 2 * numRequired;
@@ -741,8 +741,8 @@ Tcl_ListObjAppendElement(
Tcl_Obj **dst, **src = &listRepPtr->elements;
/*
- * Either we have a shared intrep and we must copy to write, or we
- * need to grow and realloc attempts failed. Attempt intrep copy.
+ * Either we have a shared internalrep and we must copy to write, or we
+ * need to grow and realloc attempts failed. Attempt internalrep copy.
*/
attempt = 2 * numRequired;
@@ -773,7 +773,7 @@ Tcl_ListObjAppendElement(
if (isShared) {
/*
- * The original intrep must remain undisturbed. Copy into the new
+ * The original internalrep must remain undisturbed. Copy into the new
* one and bump refcounts
*/
while (numElems--) {
@@ -783,7 +783,7 @@ Tcl_ListObjAppendElement(
listRepPtr->refCount--;
} else {
/*
- * Old intrep to be freed, re-use refCounts.
+ * Old internalrep to be freed, re-use refCounts.
*/
memcpy(dst, src, numElems * sizeof(Tcl_Obj *));
@@ -791,10 +791,10 @@ Tcl_ListObjAppendElement(
}
listRepPtr = newPtr;
}
- ListResetIntRep(listPtr, listRepPtr);
+ ListResetInternalRep(listPtr, listRepPtr);
listRepPtr->refCount++;
- TclFreeIntRep(listPtr);
- ListSetIntRep(listPtr, listRepPtr);
+ TclFreeInternalRep(listPtr);
+ ListSetInternalRep(listPtr, listRepPtr);
listRepPtr->refCount--;
/*
@@ -850,7 +850,7 @@ Tcl_ListObjIndex(
{
List *listRepPtr;
- ListGetIntRep(listPtr, listRepPtr);
+ ListGetInternalRep(listPtr, listRepPtr);
if (listRepPtr == NULL) {
int result, length;
@@ -863,7 +863,7 @@ Tcl_ListObjIndex(
if (result != TCL_OK) {
return result;
}
- ListGetIntRep(listPtr, listRepPtr);
+ ListGetInternalRep(listPtr, listRepPtr);
}
if ((index < 0) || (index >= listRepPtr->elemCount)) {
@@ -905,7 +905,7 @@ Tcl_ListObjLength(
{
List *listRepPtr;
- ListGetIntRep(listPtr, listRepPtr);
+ ListGetInternalRep(listPtr, listRepPtr);
if (listRepPtr == NULL) {
int result, length;
@@ -918,7 +918,7 @@ Tcl_ListObjLength(
if (result != TCL_OK) {
return result;
}
- ListGetIntRep(listPtr, listRepPtr);
+ ListGetInternalRep(listPtr, listRepPtr);
}
*intPtr = listRepPtr->elemCount;
@@ -981,7 +981,7 @@ Tcl_ListObjReplace(
Tcl_Panic("%s called with shared object", "Tcl_ListObjReplace");
}
- ListGetIntRep(listPtr, listRepPtr);
+ ListGetInternalRep(listPtr, listRepPtr);
if (listRepPtr == NULL) {
int length;
@@ -998,7 +998,7 @@ Tcl_ListObjReplace(
return result;
}
}
- ListGetIntRep(listPtr, listRepPtr);
+ ListGetInternalRep(listPtr, listRepPtr);
}
/*
@@ -1062,7 +1062,7 @@ Tcl_ListObjReplace(
}
if (newPtr) {
listRepPtr = newPtr;
- ListResetIntRep(listPtr, listRepPtr);
+ ListResetInternalRep(listPtr, listRepPtr);
elemPtrs = &listRepPtr->elements;
listRepPtr->maxElemCount = attempt;
needGrow = numRequired > listRepPtr->maxElemCount;
@@ -1135,7 +1135,7 @@ Tcl_ListObjReplace(
}
}
- ListResetIntRep(listPtr, listRepPtr);
+ ListResetInternalRep(listPtr, listRepPtr);
listRepPtr->refCount++;
elemPtrs = &listRepPtr->elements;
@@ -1213,8 +1213,8 @@ Tcl_ListObjReplace(
*/
listRepPtr->refCount++;
- TclFreeIntRep(listPtr);
- ListSetIntRep(listPtr, listRepPtr);
+ TclFreeInternalRep(listPtr);
+ ListSetInternalRep(listPtr, listRepPtr);
listRepPtr->refCount--;
TclInvalidateStringRep(listPtr);
@@ -1240,7 +1240,7 @@ Tcl_ListObjReplace(
* This procedure is implemented entirely as a wrapper around
* TclLindexFlat. All it does is reconfigure the argument format into the
* form required by TclLindexFlat, while taking care to manage shimmering
- * in such a way that we tend to keep the most useful intreps and/or
+ * in such a way that we tend to keep the most useful internalreps and/or
* avoid the most expensive conversions.
*
*----------------------------------------------------------------------
@@ -1263,7 +1263,7 @@ TclLindexList(
* shimmering; see TIP#22 and TIP#33 for the details.
*/
- ListGetIntRep(argPtr, listRepPtr);
+ ListGetInternalRep(argPtr, listRepPtr);
if ((listRepPtr == NULL)
&& TclGetIntForIndexM(NULL , argPtr, INT_MAX - 1, &index) == TCL_OK) {
/*
@@ -1295,7 +1295,7 @@ TclLindexList(
return TclLindexFlat(interp, listPtr, 1, &argPtr);
}
- ListGetIntRep(indexListCopy, listRepPtr);
+ ListGetInternalRep(indexListCopy, listRepPtr);
assert(listRepPtr != NULL);
@@ -1418,7 +1418,7 @@ TclLindexFlat(
* This procedure is implemented entirely as a wrapper around
* TclLsetFlat. All it does is reconfigure the argument format into the
* form required by TclLsetFlat, while taking care to manage shimmering
- * in such a way that we tend to keep the most useful intreps and/or
+ * in such a way that we tend to keep the most useful internalreps and/or
* avoid the most expensive conversions.
*
*----------------------------------------------------------------------
@@ -1444,7 +1444,7 @@ TclLsetList(
* shimmering; see TIP #22 and #23 for details.
*/
- ListGetIntRep(indexArgPtr, listRepPtr);
+ ListGetInternalRep(indexArgPtr, listRepPtr);
if (listRepPtr == NULL
&& TclGetIntForIndexM(NULL, indexArgPtr, INT_MAX - 1, &index) == TCL_OK) {
/*
@@ -1531,7 +1531,7 @@ TclLsetFlat(
{
int index, result, len;
Tcl_Obj *subListPtr, *retValuePtr, *chainPtr;
- Tcl_ObjIntRep *irPtr;
+ Tcl_ObjInternalRep *irPtr;
/*
* If there are no indices, simply return the new value. (Without
@@ -1636,8 +1636,8 @@ TclLsetFlat(
/*
* Replace the original elemPtr[index] in parentList with a copy
* we know to be unshared. This call will also deal with the
- * situation where parentList shares its intrep with other
- * Tcl_Obj's. Dealing with the shared intrep case can cause
+ * situation where parentList shares its internalrep with other
+ * Tcl_Obj's. Dealing with the shared internalrep case can cause
* subListPtr to become shared again, so detect that case and make
* and store another copy.
*/
@@ -1662,11 +1662,11 @@ TclLsetFlat(
* variable. Later on, when we set valuePtr in its proper place,
* then all containing lists will have their values changed, and
* will need their string reps spoiled. We maintain a list of all
- * those Tcl_Obj's (via a little intrep surgery) so we can spoil
+ * those Tcl_Obj's (via a little internalrep surgery) so we can spoil
* them at that time.
*/
- irPtr = TclFetchIntRep(parentList, &tclListType);
+ irPtr = TclFetchInternalRep(parentList, &tclListType);
irPtr->twoPtrValue.ptr2 = chainPtr;
chainPtr = parentList;
}
@@ -1684,10 +1684,10 @@ TclLsetFlat(
List *listRepPtr;
/*
- * Clear away our intrep surgery mess.
+ * Clear away our internalrep surgery mess.
*/
- irPtr = TclFetchIntRep(objPtr, &tclListType);
+ irPtr = TclFetchInternalRep(objPtr, &tclListType);
listRepPtr = (List *)irPtr->twoPtrValue.ptr1;
chainPtr = (Tcl_Obj *)irPtr->twoPtrValue.ptr2;
@@ -1699,8 +1699,8 @@ TclLsetFlat(
*/
listRepPtr->refCount++;
- TclFreeIntRep(objPtr);
- ListSetIntRep(objPtr, listRepPtr);
+ TclFreeInternalRep(objPtr);
+ ListSetInternalRep(objPtr, listRepPtr);
listRepPtr->refCount--;
TclInvalidateStringRep(objPtr);
@@ -1793,7 +1793,7 @@ TclListObjSetElement(
Tcl_Panic("%s called with shared object", "TclListObjSetElement");
}
- ListGetIntRep(listPtr, listRepPtr);
+ ListGetInternalRep(listPtr, listRepPtr);
if (listRepPtr == NULL) {
int result, length;
@@ -1811,7 +1811,7 @@ TclListObjSetElement(
if (result != TCL_OK) {
return result;
}
- ListGetIntRep(listPtr, listRepPtr);
+ ListGetInternalRep(listPtr, listRepPtr);
}
elemCount = listRepPtr->elemCount;
@@ -1857,7 +1857,7 @@ TclListObjSetElement(
listRepPtr->refCount--;
listRepPtr = newPtr;
- ListResetIntRep(listPtr, listRepPtr);
+ ListResetInternalRep(listPtr, listRepPtr);
}
elemPtrs = &listRepPtr->elements;
@@ -1880,13 +1880,13 @@ TclListObjSetElement(
elemPtrs[index] = valuePtr;
/*
- * Invalidate outdated intreps.
+ * Invalidate outdated internalreps.
*/
- ListGetIntRep(listPtr, listRepPtr);
+ ListGetInternalRep(listPtr, listRepPtr);
listRepPtr->refCount++;
- TclFreeIntRep(listPtr);
- ListSetIntRep(listPtr, listRepPtr);
+ TclFreeInternalRep(listPtr);
+ ListSetInternalRep(listPtr, listRepPtr);
listRepPtr->refCount--;
TclInvalidateStringRep(listPtr);
@@ -1918,7 +1918,7 @@ FreeListInternalRep(
{
List *listRepPtr;
- ListGetIntRep(listPtr, listRepPtr);
+ ListGetInternalRep(listPtr, listRepPtr);
assert(listRepPtr != NULL);
if (listRepPtr->refCount-- <= 1) {
@@ -1956,9 +1956,9 @@ DupListInternalRep(
{
List *listRepPtr;
- ListGetIntRep(srcPtr, listRepPtr);
+ ListGetInternalRep(srcPtr, listRepPtr);
assert(listRepPtr != NULL);
- ListSetIntRep(copyPtr, listRepPtr);
+ ListSetInternalRep(copyPtr, listRepPtr);
}
/*
@@ -1996,7 +1996,7 @@ SetListFromAny(
* describe duplicate keys).
*/
- if (!TclHasStringRep(objPtr) && TclHasIntRep(objPtr, &tclDictType)) {
+ if (!TclHasStringRep(objPtr) && TclHasInternalRep(objPtr, &tclDictType)) {
Tcl_Obj *keyPtr, *valuePtr;
Tcl_DictSearch search;
int done, size;
@@ -2099,7 +2099,7 @@ SetListFromAny(
* Tcl_GetStringFromObj, to use the old internalRep.
*/
- ListSetIntRep(objPtr, listRepPtr);
+ ListSetInternalRep(objPtr, listRepPtr);
return TCL_OK;
}
@@ -2136,7 +2136,7 @@ UpdateStringOfList(
Tcl_Obj **elemPtrs;
List *listRepPtr;
- ListGetIntRep(listPtr, listRepPtr);
+ ListGetInternalRep(listPtr, listRepPtr);
assert(listRepPtr != NULL);
diff --git a/generic/tclLiteral.c b/generic/tclLiteral.c
index fe1b00d..e1943a1 100644
--- a/generic/tclLiteral.c
+++ b/generic/tclLiteral.c
@@ -1045,7 +1045,7 @@ RebuildLiteralTable(
*
* Side effects:
* Resets the internal representation of the CmdName Tcl_Obj
- * using TclFreeIntRep().
+ * using TclFreeInternalRep().
*
*----------------------------------------------------------------------
*/
@@ -1064,8 +1064,8 @@ TclInvalidateCmdLiteral(
strlen(name), -1, NULL, nsPtr, 0, NULL);
if (literalObjPtr != NULL) {
- if (TclHasIntRep(literalObjPtr, &tclCmdNameType)) {
- TclFreeIntRep(literalObjPtr);
+ if (TclHasInternalRep(literalObjPtr, &tclCmdNameType)) {
+ TclFreeInternalRep(literalObjPtr);
}
/* Balance the refcount effects of TclCreateLiteral() above */
Tcl_IncrRefCount(literalObjPtr);
diff --git a/generic/tclNamesp.c b/generic/tclNamesp.c
index 2aed628..639dff2 100644
--- a/generic/tclNamesp.c
+++ b/generic/tclNamesp.c
@@ -133,19 +133,19 @@ static const Tcl_ObjType nsNameType = {
SetNsNameFromAny /* setFromAnyProc */
};
-#define NsNameSetIntRep(objPtr, nnPtr) \
+#define NsNameSetInternalRep(objPtr, nnPtr) \
do { \
- Tcl_ObjIntRep ir; \
+ Tcl_ObjInternalRep ir; \
(nnPtr)->refCount++; \
ir.twoPtrValue.ptr1 = (nnPtr); \
ir.twoPtrValue.ptr2 = NULL; \
- Tcl_StoreIntRep((objPtr), &nsNameType, &ir); \
+ Tcl_StoreInternalRep((objPtr), &nsNameType, &ir); \
} while (0)
-#define NsNameGetIntRep(objPtr, nnPtr) \
+#define NsNameGetInternalRep(objPtr, nnPtr) \
do { \
- const Tcl_ObjIntRep *irPtr; \
- irPtr = TclFetchIntRep((objPtr), &nsNameType); \
+ const Tcl_ObjInternalRep *irPtr; \
+ irPtr = TclFetchInternalRep((objPtr), &nsNameType); \
(nnPtr) = irPtr ? (ResolvedNsName *)irPtr->twoPtrValue.ptr1 : NULL; \
} while (0)
@@ -2928,7 +2928,7 @@ GetNamespaceFromObj(
{
ResolvedNsName *resNamePtr;
- NsNameGetIntRep(objPtr, resNamePtr);
+ NsNameGetInternalRep(objPtr, resNamePtr);
if (resNamePtr) {
Namespace *nsPtr, *refNsPtr;
@@ -2945,10 +2945,10 @@ GetNamespaceFromObj(
*nsPtrPtr = (Tcl_Namespace *) nsPtr;
return TCL_OK;
}
- Tcl_StoreIntRep(objPtr, &nsNameType, NULL);
+ Tcl_StoreInternalRep(objPtr, &nsNameType, NULL);
}
if (SetNsNameFromAny(interp, objPtr) == TCL_OK) {
- NsNameGetIntRep(objPtr, resNamePtr);
+ NsNameGetInternalRep(objPtr, resNamePtr);
assert(resNamePtr != NULL);
*nsPtrPtr = (Tcl_Namespace *) resNamePtr->nsPtr;
return TCL_OK;
@@ -4722,7 +4722,7 @@ FreeNsNameInternalRep(
{
ResolvedNsName *resNamePtr;
- NsNameGetIntRep(objPtr, resNamePtr);
+ NsNameGetInternalRep(objPtr, resNamePtr);
assert(resNamePtr != NULL);
/*
@@ -4768,9 +4768,9 @@ DupNsNameInternalRep(
{
ResolvedNsName *resNamePtr;
- NsNameGetIntRep(srcPtr, resNamePtr);
+ NsNameGetInternalRep(srcPtr, resNamePtr);
assert(resNamePtr != NULL);
- NsNameSetIntRep(copyPtr, resNamePtr);
+ NsNameSetInternalRep(copyPtr, resNamePtr);
}
/*
@@ -4833,7 +4833,7 @@ SetNsNameFromAny(
resNamePtr->refNsPtr = (Namespace *) TclGetCurrentNamespace(interp);
}
resNamePtr->refCount = 0;
- NsNameSetIntRep(objPtr, resNamePtr);
+ NsNameSetInternalRep(objPtr, resNamePtr);
return TCL_OK;
}
@@ -5013,7 +5013,7 @@ TclLogCommandInfo(
Tcl_ListObjLength(interp, iPtr->errorStack, &len);
/*
- * Reset while keeping the list intrep as much as possible.
+ * Reset while keeping the list internalrep as much as possible.
*/
Tcl_ListObjReplace(interp, iPtr->errorStack, 0, len, 0, NULL);
@@ -5098,7 +5098,7 @@ TclErrorStackResetIf(
Tcl_ListObjLength(interp, iPtr->errorStack, &len);
/*
- * Reset while keeping the list intrep as much as possible.
+ * Reset while keeping the list internalrep as much as possible.
*/
Tcl_ListObjReplace(interp, iPtr->errorStack, 0, len, 0, NULL);
diff --git a/generic/tclOO.c b/generic/tclOO.c
index 405d5d0..bdceec4 100644
--- a/generic/tclOO.c
+++ b/generic/tclOO.c
@@ -3144,6 +3144,26 @@ Tcl_ObjectSetMethodNameMapper(
{
((Object *) object)->mapMethodNameProc = mapMethodNameProc;
}
+
+Tcl_Class
+Tcl_GetClassOfObject(
+ Tcl_Object object)
+{
+ return (Tcl_Class) ((Object *) object)->selfCls;
+}
+
+Tcl_Obj *
+Tcl_GetObjectClassName(
+ Tcl_Interp *interp,
+ Tcl_Object object)
+{
+ Tcl_Object classObj = (Tcl_Object) (((Object *) object)->selfCls)->thisPtr;
+
+ if (classObj == NULL) {
+ return NULL;
+ }
+ return Tcl_GetObjectName(interp, classObj);
+}
/*
* Local Variables:
diff --git a/generic/tclOO.decls b/generic/tclOO.decls
index 64892a8..e4063c7 100644
--- a/generic/tclOO.decls
+++ b/generic/tclOO.decls
@@ -129,8 +129,11 @@ declare 28 {
declare 29 {
int Tcl_MethodIsPrivate(Tcl_Method method)
}
+declare 30 {
+ Tcl_Class Tcl_GetClassOfObject(Tcl_Object object)
+}
declare 31 {
- void TclOOUnusedStubEntry(void)
+ Tcl_Obj *Tcl_GetObjectClassName(Tcl_Interp *interp, Tcl_Object object)
}
######################################################################
diff --git a/generic/tclOOCall.c b/generic/tclOOCall.c
index b7df93e..71db6c1 100644
--- a/generic/tclOOCall.c
+++ b/generic/tclOOCall.c
@@ -247,12 +247,12 @@ StashCallChain(
Tcl_Obj *objPtr,
CallChain *callPtr)
{
- Tcl_ObjIntRep ir;
+ Tcl_ObjInternalRep ir;
callPtr->refCount++;
TclGetString(objPtr);
ir.twoPtrValue.ptr1 = callPtr;
- Tcl_StoreIntRep(objPtr, &methodNameType, &ir);
+ Tcl_StoreInternalRep(objPtr, &methodNameType, &ir);
}
void
@@ -280,7 +280,7 @@ DupMethodNameRep(
Tcl_Obj *dstPtr)
{
StashCallChain(dstPtr,
- (CallChain *)TclFetchIntRep(srcPtr, &methodNameType)->twoPtrValue.ptr1);
+ (CallChain *)TclFetchInternalRep(srcPtr, &methodNameType)->twoPtrValue.ptr1);
}
static void
@@ -288,7 +288,7 @@ FreeMethodNameRep(
Tcl_Obj *objPtr)
{
TclOODeleteChain(
- (CallChain *)TclFetchIntRep(objPtr, &methodNameType)->twoPtrValue.ptr1);
+ (CallChain *)TclFetchInternalRep(objPtr, &methodNameType)->twoPtrValue.ptr1);
}
/*
@@ -1189,16 +1189,16 @@ TclOOGetCallContext(
* the object, and in the class).
*/
- const Tcl_ObjIntRep *irPtr;
+ const Tcl_ObjInternalRep *irPtr;
const int reuseMask = (WANT_PUBLIC(flags) ? ~0 : ~PUBLIC_METHOD);
- if ((irPtr = TclFetchIntRep(cacheInThisObj, &methodNameType))) {
+ if ((irPtr = TclFetchInternalRep(cacheInThisObj, &methodNameType))) {
callPtr = (CallChain *)irPtr->twoPtrValue.ptr1;
if (IsStillValid(callPtr, oPtr, flags, reuseMask)) {
callPtr->refCount++;
goto returnContext;
}
- Tcl_StoreIntRep(cacheInThisObj, &methodNameType, NULL);
+ Tcl_StoreInternalRep(cacheInThisObj, &methodNameType, NULL);
}
if (oPtr->flags & USE_CLASS_CACHE) {
diff --git a/generic/tclOODecls.h b/generic/tclOODecls.h
index 4263bf0..3be1e3d 100644
--- a/generic/tclOODecls.h
+++ b/generic/tclOODecls.h
@@ -118,9 +118,11 @@ TCLAPI Tcl_Obj * Tcl_GetObjectName(Tcl_Interp *interp,
Tcl_Object object);
/* 29 */
TCLAPI int Tcl_MethodIsPrivate(Tcl_Method method);
-/* Slot 30 is reserved */
+/* 30 */
+TCLAPI Tcl_Class Tcl_GetClassOfObject(Tcl_Object object);
/* 31 */
-TCLAPI void TclOOUnusedStubEntry(void);
+TCLAPI Tcl_Obj * Tcl_GetObjectClassName(Tcl_Interp *interp,
+ Tcl_Object object);
typedef struct {
const struct TclOOIntStubs *tclOOIntStubs;
@@ -160,8 +162,8 @@ typedef struct TclOOStubs {
void (*tcl_ClassSetDestructor) (Tcl_Interp *interp, Tcl_Class clazz, Tcl_Method method); /* 27 */
Tcl_Obj * (*tcl_GetObjectName) (Tcl_Interp *interp, Tcl_Object object); /* 28 */
int (*tcl_MethodIsPrivate) (Tcl_Method method); /* 29 */
- void (*reserved30)(void);
- void (*tclOOUnusedStubEntry) (void); /* 31 */
+ Tcl_Class (*tcl_GetClassOfObject) (Tcl_Object object); /* 30 */
+ Tcl_Obj * (*tcl_GetObjectClassName) (Tcl_Interp *interp, Tcl_Object object); /* 31 */
} TclOOStubs;
extern const TclOOStubs *tclOOStubsPtr;
@@ -236,14 +238,13 @@ extern const TclOOStubs *tclOOStubsPtr;
(tclOOStubsPtr->tcl_GetObjectName) /* 28 */
#define Tcl_MethodIsPrivate \
(tclOOStubsPtr->tcl_MethodIsPrivate) /* 29 */
-/* Slot 30 is reserved */
-#define TclOOUnusedStubEntry \
- (tclOOStubsPtr->tclOOUnusedStubEntry) /* 31 */
+#define Tcl_GetClassOfObject \
+ (tclOOStubsPtr->tcl_GetClassOfObject) /* 30 */
+#define Tcl_GetObjectClassName \
+ (tclOOStubsPtr->tcl_GetObjectClassName) /* 31 */
#endif /* defined(USE_TCLOO_STUBS) */
/* !END!: Do not edit above this line. */
-#undef TclOOUnusedStubEntry
-
#endif /* _TCLOODECLS */
diff --git a/generic/tclOOMethod.c b/generic/tclOOMethod.c
index f111461..1903bb9 100644
--- a/generic/tclOOMethod.c
+++ b/generic/tclOOMethod.c
@@ -859,7 +859,7 @@ PushMethodCallFrame(
* alternative is *so* slow...
*/
- ByteCodeGetIntRep(pmPtr->procPtr->bodyPtr, &tclByteCodeType, codePtr);
+ ByteCodeGetInternalRep(pmPtr->procPtr->bodyPtr, &tclByteCodeType, codePtr);
if (codePtr) {
codePtr->nsPtr = nsPtr;
}
@@ -1338,7 +1338,7 @@ CloneProcedureMethod(
bodyObj = Tcl_DuplicateObj(pmPtr->procPtr->bodyPtr);
Tcl_GetString(bodyObj);
- Tcl_StoreIntRep(pmPtr->procPtr->bodyPtr, &tclByteCodeType, NULL);
+ Tcl_StoreInternalRep(pmPtr->procPtr->bodyPtr, &tclByteCodeType, NULL);
/*
* Create the actual copy of the method record, manufacturing a new proc
diff --git a/generic/tclOOStubInit.c b/generic/tclOOStubInit.c
index 4b6559a..b9034f0 100644
--- a/generic/tclOOStubInit.c
+++ b/generic/tclOOStubInit.c
@@ -14,8 +14,6 @@ MODULE_SCOPE const TclOOStubs tclOOStubs;
#pragma GCC dependency "tclOO.decls"
#endif
-#define TclOOUnusedStubEntry 0
-
/* !BEGIN!: Do not edit below this line. */
static const TclOOIntStubs tclOOIntStubs = {
@@ -76,8 +74,8 @@ const TclOOStubs tclOOStubs = {
Tcl_ClassSetDestructor, /* 27 */
Tcl_GetObjectName, /* 28 */
Tcl_MethodIsPrivate, /* 29 */
- 0, /* 30 */
- TclOOUnusedStubEntry, /* 31 */
+ Tcl_GetClassOfObject, /* 30 */
+ Tcl_GetObjectClassName, /* 31 */
};
/* !END!: Do not edit above this line. */
diff --git a/generic/tclObj.c b/generic/tclObj.c
index 421c1da..92c6655 100644
--- a/generic/tclObj.c
+++ b/generic/tclObj.c
@@ -1373,7 +1373,7 @@ TclFreeObj(
PopObjToDelete(context, objToFree);
TCL_DTRACE_OBJ_FREE(objToFree);
- TclFreeIntRep(objToFree);
+ TclFreeInternalRep(objToFree);
Tcl_MutexLock(&tclObjMutex);
ckfree(objToFree);
@@ -1592,7 +1592,7 @@ TclSetDuplicateObj(
Tcl_Panic("%s called with shared object", "TclSetDuplicateObj");
}
TclInvalidateStringRep(dupPtr);
- TclFreeIntRep(dupPtr);
+ TclFreeInternalRep(dupPtr);
SetDuplicateObj(dupPtr, objPtr);
}
@@ -1815,32 +1815,48 @@ Tcl_InitStringRep(
Tcl_Panic("max size for a Tcl value (%d bytes) exceeded", INT_MAX);
}
- /* Allocate */
if (objPtr->bytes == NULL) {
- /* Allocate only as empty - extend later if bytes copied */
- objPtr->length = 0;
- if (numBytes) {
+ /* Start with no string rep */
+ if (numBytes == 0) {
+ TclInitStringRep(objPtr, NULL, 0);
+ return objPtr->bytes;
+ } else {
objPtr->bytes = (char *)attemptckalloc(numBytes + 1);
- if (objPtr->bytes == NULL) {
- return NULL;
- }
- if (bytes) {
- /* Copy */
- memcpy(objPtr->bytes, bytes, numBytes);
+ if (objPtr->bytes) {
objPtr->length = (int) numBytes;
+ if (bytes) {
+ memcpy(objPtr->bytes, bytes, numBytes);
+ }
+ objPtr->bytes[objPtr->length] = '\0';
}
+ }
+ } else if (objPtr->bytes == &tclEmptyString) {
+ /* Start with empty string rep (not allocated) */
+ if (numBytes == 0) {
+ return objPtr->bytes;
} else {
- TclInitStringRep(objPtr, NULL, 0);
+ objPtr->bytes = (char *)attemptckalloc(numBytes + 1);
+ if (objPtr->bytes) {
+ objPtr->length = (int) numBytes;
+ objPtr->bytes[objPtr->length] = '\0';
+ }
}
} else {
- /* objPtr->bytes != NULL bytes == NULL - Truncate */
- objPtr->bytes = (char *)ckrealloc(objPtr->bytes, numBytes + 1);
- objPtr->length = (int)numBytes;
+ /* Start with non-empty string rep (allocated) */
+ if (numBytes == 0) {
+ ckfree(objPtr->bytes);
+ TclInitStringRep(objPtr, NULL, 0);
+ return objPtr->bytes;
+ } else {
+ objPtr->bytes = (char *)attemptckrealloc(objPtr->bytes,
+ numBytes + 1);
+ if (objPtr->bytes) {
+ objPtr->length = (int) numBytes;
+ objPtr->bytes[objPtr->length] = '\0';
+ }
+ }
}
- /* Terminate */
- objPtr->bytes[objPtr->length] = '\0';
-
return objPtr->bytes;
}
@@ -1892,13 +1908,13 @@ Tcl_HasStringRep(
/*
*----------------------------------------------------------------------
*
- * Tcl_StoreIntRep --
+ * Tcl_StoreInternalRep --
*
* This function is called to set the object's internal
* representation to match a particular type.
*
* It is the caller's responsibility to guarantee that
- * the value of the submitted IntRep is in agreement with
+ * the value of the submitted internalrep is in agreement with
* the value of any existing string rep.
*
* Results:
@@ -1912,17 +1928,17 @@ Tcl_HasStringRep(
*/
void
-Tcl_StoreIntRep(
+Tcl_StoreInternalRep(
Tcl_Obj *objPtr, /* Object whose internal rep should be set. */
const Tcl_ObjType *typePtr, /* New type for the object */
- const Tcl_ObjIntRep *irPtr) /* New IntRep for the object */
+ const Tcl_ObjInternalRep *irPtr) /* New internalrep for the object */
{
- /* Clear out any existing IntRep ( "shimmer" ) */
- TclFreeIntRep(objPtr);
+ /* Clear out any existing internalrep ( "shimmer" ) */
+ TclFreeInternalRep(objPtr);
- /* When irPtr == NULL, just leave objPtr with no IntRep for typePtr */
+ /* When irPtr == NULL, just leave objPtr with no internalrep for typePtr */
if (irPtr) {
- /* Copy the new IntRep into place */
+ /* Copy the new internalrep into place */
objPtr->internalRep = *irPtr;
/* Set the type to match */
@@ -1933,13 +1949,13 @@ Tcl_StoreIntRep(
/*
*----------------------------------------------------------------------
*
- * Tcl_FetchIntRep --
+ * Tcl_FetchInternalRep --
*
* This function is called to retrieve the object's internal
* representation matching a requested type, if any.
*
* Results:
- * A read-only pointer to the associated Tcl_ObjIntRep, or
+ * A read-only pointer to the associated Tcl_ObjInternalRep, or
* NULL if no such internal representation exists.
*
* Side effects:
@@ -1949,18 +1965,18 @@ Tcl_StoreIntRep(
*----------------------------------------------------------------------
*/
-Tcl_ObjIntRep *
-Tcl_FetchIntRep(
+Tcl_ObjInternalRep *
+Tcl_FetchInternalRep(
Tcl_Obj *objPtr, /* Object to fetch from. */
const Tcl_ObjType *typePtr) /* Requested type */
{
- return TclFetchIntRep(objPtr, typePtr);
+ return TclFetchInternalRep(objPtr, typePtr);
}
/*
*----------------------------------------------------------------------
*
- * Tcl_FreeIntRep --
+ * Tcl_FreeInternalRep --
*
* This function is called to free an object's internal representation.
*
@@ -1975,10 +1991,10 @@ Tcl_FetchIntRep(
*/
void
-Tcl_FreeIntRep(
+Tcl_FreeInternalRep(
Tcl_Obj *objPtr) /* Object whose internal rep should be freed. */
{
- TclFreeIntRep(objPtr);
+ TclFreeInternalRep(objPtr);
}
/*
@@ -2134,7 +2150,7 @@ Tcl_SetBooleanObj(
* result unless "interp" is NULL.
*
* Side effects:
- * The intrep of *objPtr may be changed.
+ * The internalrep of *objPtr may be changed.
*
*----------------------------------------------------------------------
*/
@@ -2157,7 +2173,7 @@ Tcl_GetBooleanFromObj(
if (objPtr->typePtr == &tclDoubleType) {
/*
* Caution: Don't be tempted to check directly for the "double"
- * Tcl_ObjType and then compare the intrep to 0.0. This isn't
+ * Tcl_ObjType and then compare the internalrep to 0.0. This isn't
* reliable because a "double" Tcl_ObjType can hold the NaN value.
* Use the API Tcl_GetDoubleFromObj, which does the checking and
* sets the proper error message for us.
@@ -2357,13 +2373,13 @@ ParseBoolean(
*/
goodBoolean:
- TclFreeIntRep(objPtr);
+ TclFreeInternalRep(objPtr);
objPtr->internalRep.longValue = newBool;
objPtr->typePtr = &tclBooleanType;
return TCL_OK;
numericBoolean:
- TclFreeIntRep(objPtr);
+ TclFreeInternalRep(objPtr);
objPtr->internalRep.wideValue = newBool;
objPtr->typePtr = &tclIntType;
return TCL_OK;
@@ -3517,7 +3533,6 @@ UpdateStringOfBignum(
if (MP_OKAY != mp_to_radix(&bignumVal, stringVal, size, NULL, 10)) {
Tcl_Panic("conversion failure in UpdateStringOfBignum");
}
- (void) Tcl_InitStringRep(objPtr, NULL, size - 1);
}
/*
@@ -3639,7 +3654,7 @@ GetBignumFromObj(
}
} else {
TclUnpackBignum(objPtr, *bignumValue);
- /* Optimized TclFreeIntRep */
+ /* Optimized TclFreeInternalRep */
objPtr->internalRep.twoPtrValue.ptr1 = NULL;
objPtr->internalRep.twoPtrValue.ptr2 = NULL;
objPtr->typePtr = NULL;
@@ -3793,14 +3808,14 @@ Tcl_SetBignumObj(
return;
tooLargeForWide:
TclInvalidateStringRep(objPtr);
- TclFreeIntRep(objPtr);
- TclSetBignumIntRep(objPtr, bignumValue);
+ TclFreeInternalRep(objPtr);
+ TclSetBignumInternalRep(objPtr, bignumValue);
}
/*
*----------------------------------------------------------------------
*
- * TclSetBignumIntRep --
+ * TclSetBignumInternalRep --
*
* Install a bignum into the internal representation of an object.
*
@@ -3816,7 +3831,7 @@ Tcl_SetBignumObj(
*/
void
-TclSetBignumIntRep(
+TclSetBignumInternalRep(
Tcl_Obj *objPtr,
void *big)
{
@@ -4554,7 +4569,7 @@ SetCmdNameObj(
}
if (resPtr == NULL) {
- TclFreeIntRep(objPtr);
+ TclFreeInternalRep(objPtr);
objPtr->internalRep.twoPtrValue.ptr1 = fillPtr;
objPtr->internalRep.twoPtrValue.ptr2 = NULL;
diff --git a/generic/tclPanic.c b/generic/tclPanic.c
index 394661f..ba7e801 100644
--- a/generic/tclPanic.c
+++ b/generic/tclPanic.c
@@ -45,7 +45,8 @@ static TCL_NORETURN1 Tcl_PanicProc *panicProc = NULL;
*----------------------------------------------------------------------
*/
-void
+#undef Tcl_SetPanicProc
+const char *
Tcl_SetPanicProc(
TCL_NORETURN1 Tcl_PanicProc *proc)
{
@@ -58,7 +59,7 @@ Tcl_SetPanicProc(
else
#endif
panicProc = proc;
- Tcl_InitSubsystems();
+ return Tcl_InitSubsystems();
}
/*
diff --git a/generic/tclPathObj.c b/generic/tclPathObj.c
index e4826ad..b5207a1 100644
--- a/generic/tclPathObj.c
+++ b/generic/tclPathObj.c
@@ -85,13 +85,13 @@ typedef struct FsPath {
* fields.
*/
-#define PATHOBJ(pathPtr) ((FsPath *) (TclFetchIntRep((pathPtr), &fsPathType)->twoPtrValue.ptr1))
+#define PATHOBJ(pathPtr) ((FsPath *) (TclFetchInternalRep((pathPtr), &fsPathType)->twoPtrValue.ptr1))
#define SETPATHOBJ(pathPtr,fsPathPtr) \
do { \
- Tcl_ObjIntRep ir; \
+ Tcl_ObjInternalRep ir; \
ir.twoPtrValue.ptr1 = (void *) (fsPathPtr); \
ir.twoPtrValue.ptr2 = NULL; \
- Tcl_StoreIntRep((pathPtr), &fsPathType, &ir); \
+ Tcl_StoreInternalRep((pathPtr), &fsPathType, &ir); \
} while (0)
#define PATHFLAGS(pathPtr) (PATHOBJ(pathPtr)->flags)
@@ -544,7 +544,7 @@ TclPathPart(
Tcl_Obj *pathPtr, /* Path to take dirname of */
Tcl_PathPart portion) /* Requested portion of name */
{
- if (TclHasIntRep(pathPtr, &fsPathType)) {
+ if (TclHasInternalRep(pathPtr, &fsPathType)) {
FsPath *fsPathPtr = PATHOBJ(pathPtr);
if (PATHFLAGS(pathPtr) != 0) {
@@ -843,7 +843,7 @@ TclJoinPath(
if (elements == 2) {
Tcl_Obj *elt = objv[0];
- Tcl_ObjIntRep *eltIr = TclFetchIntRep(elt, &fsPathType);
+ Tcl_ObjInternalRep *eltIr = TclFetchInternalRep(elt, &fsPathType);
/*
* This is a special case where we can be much more efficient, where
@@ -1149,13 +1149,13 @@ Tcl_FSConvertToPathType(
* path.
*/
- if (TclHasIntRep(pathPtr, &fsPathType)) {
+ if (TclHasInternalRep(pathPtr, &fsPathType)) {
if (TclFSEpochOk(PATHOBJ(pathPtr)->filesystemEpoch)) {
return TCL_OK;
}
TclGetString(pathPtr);
- Tcl_StoreIntRep(pathPtr, &fsPathType, NULL);
+ Tcl_StoreInternalRep(pathPtr, &fsPathType, NULL);
}
return SetFsPathFromAny(interp, pathPtr);
@@ -1349,7 +1349,7 @@ AppendPath(
* that use some character other than "/" as a path separator. I know
* of no evidence that such a foolish thing exists. This solution was
* chosen so that "JoinPath" operations that pass through either path
- * intrep produce the same results; that is, bugward compatibility. If
+ * internalrep produce the same results; that is, bugward compatibility. If
* we need to fix that bug here, it needs fixing in TclJoinPath() too.
*/
bytes = TclGetStringFromObj(tail, &numBytes);
@@ -1391,7 +1391,7 @@ TclFSMakePathRelative(
{
int cwdLen, len;
const char *tempStr;
- Tcl_ObjIntRep *irPtr = TclFetchIntRep(pathPtr, &fsPathType);
+ Tcl_ObjInternalRep *irPtr = TclFetchInternalRep(pathPtr, &fsPathType);
if (irPtr) {
FsPath *fsPathPtr = PATHOBJ(pathPtr);
@@ -1461,7 +1461,7 @@ MakePathFromNormalized(
{
FsPath *fsPathPtr;
- if (TclHasIntRep(pathPtr, &fsPathType)) {
+ if (TclHasInternalRep(pathPtr, &fsPathType)) {
return TCL_OK;
}
@@ -1532,7 +1532,7 @@ Tcl_FSNewNativePath(
* safe.
*/
- Tcl_StoreIntRep(pathPtr, &fsPathType, NULL);
+ Tcl_StoreInternalRep(pathPtr, &fsPathType, NULL);
fsPathPtr = (FsPath *)ckalloc(sizeof(FsPath));
fsPathPtr->translatedPathPtr = NULL;
@@ -1598,7 +1598,7 @@ Tcl_FSGetTranslatedPath(
Tcl_Obj *translatedCwdPtr = Tcl_FSGetTranslatedPath(interp,
srcFsPathPtr->cwdPtr);
- Tcl_ObjIntRep *translatedCwdIrPtr;
+ Tcl_ObjInternalRep *translatedCwdIrPtr;
if (translatedCwdPtr == NULL) {
return NULL;
@@ -1607,7 +1607,7 @@ Tcl_FSGetTranslatedPath(
retObj = Tcl_FSJoinToPath(translatedCwdPtr, 1,
&srcFsPathPtr->normPathPtr);
Tcl_IncrRefCount(srcFsPathPtr->translatedPathPtr = retObj);
- translatedCwdIrPtr = TclFetchIntRep(translatedCwdPtr, &fsPathType);
+ translatedCwdIrPtr = TclFetchInternalRep(translatedCwdPtr, &fsPathType);
if (translatedCwdIrPtr) {
srcFsPathPtr->filesystemEpoch
= PATHOBJ(translatedCwdPtr)->filesystemEpoch;
@@ -1802,7 +1802,7 @@ Tcl_FSGetNormalizedPath(
if (fsPathPtr->cwdPtr != NULL) {
if (!TclFSCwdPointerEquals(&fsPathPtr->cwdPtr)) {
TclGetString(pathPtr);
- Tcl_StoreIntRep(pathPtr, &fsPathType, NULL);
+ Tcl_StoreInternalRep(pathPtr, &fsPathType, NULL);
if (SetFsPathFromAny(interp, pathPtr) != TCL_OK) {
return NULL;
}
@@ -2048,7 +2048,7 @@ TclFSEnsureEpochOk(
{
FsPath *srcFsPathPtr;
- if (!TclHasIntRep(pathPtr, &fsPathType)) {
+ if (!TclHasInternalRep(pathPtr, &fsPathType)) {
return TCL_OK;
}
@@ -2062,7 +2062,7 @@ TclFSEnsureEpochOk(
*/
TclGetString(pathPtr);
- Tcl_StoreIntRep(pathPtr, &fsPathType, NULL);
+ Tcl_StoreInternalRep(pathPtr, &fsPathType, NULL);
if (SetFsPathFromAny(NULL, pathPtr) != TCL_OK) {
return TCL_ERROR;
}
@@ -2106,7 +2106,7 @@ TclFSSetPathDetails(
* Make sure pathPtr is of the correct type.
*/
- if (!TclHasIntRep(pathPtr, &fsPathType)) {
+ if (!TclHasInternalRep(pathPtr, &fsPathType)) {
if (SetFsPathFromAny(NULL, pathPtr) != TCL_OK) {
return;
}
@@ -2206,7 +2206,7 @@ SetFsPathFromAny(
Tcl_Obj *transPtr;
const char *name;
- if (TclHasIntRep(pathPtr, &fsPathType)) {
+ if (TclHasInternalRep(pathPtr, &fsPathType)) {
return TCL_OK;
}
@@ -2519,7 +2519,7 @@ TclNativePathInFilesystem(
* semantics of Tcl (at present anyway), so we have to abide by them here.
*/
- if (TclHasIntRep(pathPtr, &fsPathType)) {
+ if (TclHasInternalRep(pathPtr, &fsPathType)) {
if (pathPtr->bytes != NULL && pathPtr->bytes[0] == '\0') {
/*
* We reject the empty path "".
diff --git a/generic/tclPkg.c b/generic/tclPkg.c
index c3f2f17..3311f6a 100644
--- a/generic/tclPkg.c
+++ b/generic/tclPkg.c
@@ -1696,7 +1696,7 @@ CheckVersionAndConvert(
*ip++ = *p;
- for (prevChar = *p, p++; *p != 0; p++) {
+ for (prevChar = *p, p++; (*p != 0) && (*p != '+'); p++) {
if (!isdigit(UCHAR(*p)) && /* INTL: digit */
((*p!='.' && *p!='a' && *p!='b') ||
((hasunstable && (*p=='a' || *p=='b')) ||
@@ -2000,10 +2000,10 @@ CheckRequirement(
char *dash = NULL, *buf;
- dash = (char *)strchr(string, '-');
+ dash = strchr(string, '+') ? NULL : (char *)strchr(string, '-');
if (dash == NULL) {
/*
- * No dash found, has to be a simple version.
+ * '+' found or no dash found: has to be a simple version.
*/
return CheckVersionAndConvert(interp, string, NULL, NULL);
diff --git a/generic/tclPkgConfig.c b/generic/tclPkgConfig.c
index d84472c..a0dae51 100644
--- a/generic/tclPkgConfig.c
+++ b/generic/tclPkgConfig.c
@@ -93,6 +93,7 @@
#endif
static Tcl_Config const cfg[] = {
+#if !defined(TCL_NO_DEPRECATED) && TCL_MAJOR_VERSION < 9
{"debug", CFG_DEBUG},
{"threaded", CFG_THREADED},
{"profiled", CFG_PROFILED},
@@ -101,6 +102,7 @@ static Tcl_Config const cfg[] = {
{"mem_debug", CFG_MEMDEBUG},
{"compile_debug", CFG_COMPILE_DEBUG},
{"compile_stats", CFG_COMPILE_STATS},
+#endif
/* Runtime paths to various stuff */
diff --git a/generic/tclProc.c b/generic/tclProc.c
index b3de29a..306f04c 100644
--- a/generic/tclProc.c
+++ b/generic/tclProc.c
@@ -67,19 +67,19 @@ const Tcl_ObjType tclProcBodyType = {
* should panic instead. */
};
-#define ProcSetIntRep(objPtr, procPtr) \
+#define ProcSetInternalRep(objPtr, procPtr) \
do { \
- Tcl_ObjIntRep ir; \
+ Tcl_ObjInternalRep ir; \
(procPtr)->refCount++; \
ir.twoPtrValue.ptr1 = (procPtr); \
ir.twoPtrValue.ptr2 = NULL; \
- Tcl_StoreIntRep((objPtr), &tclProcBodyType, &ir); \
+ Tcl_StoreInternalRep((objPtr), &tclProcBodyType, &ir); \
} while (0)
-#define ProcGetIntRep(objPtr, procPtr) \
+#define ProcGetInternalRep(objPtr, procPtr) \
do { \
- const Tcl_ObjIntRep *irPtr; \
- irPtr = TclFetchIntRep((objPtr), &tclProcBodyType); \
+ const Tcl_ObjInternalRep *irPtr; \
+ irPtr = TclFetchInternalRep((objPtr), &tclProcBodyType); \
(procPtr) = irPtr ? (Proc *)irPtr->twoPtrValue.ptr1 : NULL; \
} while (0)
@@ -113,19 +113,19 @@ static const Tcl_ObjType lambdaType = {
SetLambdaFromAny /* setFromAnyProc */
};
-#define LambdaSetIntRep(objPtr, procPtr, nsObjPtr) \
+#define LambdaSetInternalRep(objPtr, procPtr, nsObjPtr) \
do { \
- Tcl_ObjIntRep ir; \
+ Tcl_ObjInternalRep ir; \
ir.twoPtrValue.ptr1 = (procPtr); \
ir.twoPtrValue.ptr2 = (nsObjPtr); \
Tcl_IncrRefCount((nsObjPtr)); \
- Tcl_StoreIntRep((objPtr), &lambdaType, &ir); \
+ Tcl_StoreInternalRep((objPtr), &lambdaType, &ir); \
} while (0)
-#define LambdaGetIntRep(objPtr, procPtr, nsObjPtr) \
+#define LambdaGetInternalRep(objPtr, procPtr, nsObjPtr) \
do { \
- const Tcl_ObjIntRep *irPtr; \
- irPtr = TclFetchIntRep((objPtr), &lambdaType); \
+ const Tcl_ObjInternalRep *irPtr; \
+ irPtr = TclFetchInternalRep((objPtr), &lambdaType); \
(procPtr) = irPtr ? (Proc *)irPtr->twoPtrValue.ptr1 : NULL; \
(nsObjPtr) = irPtr ? (Tcl_Obj *)irPtr->twoPtrValue.ptr2 : NULL; \
} while (0)
@@ -327,7 +327,7 @@ Tcl_ProcObjCmd(
* of all procs whose argument list is just _args_
*/
- if (TclHasIntRep(objv[3], &tclProcBodyType)) {
+ if (TclHasInternalRep(objv[3], &tclProcBodyType)) {
goto done;
}
@@ -409,7 +409,7 @@ TclCreateProc(
Tcl_Obj **argArray;
int precompiled = 0;
- ProcGetIntRep(bodyPtr, procPtr);
+ ProcGetInternalRep(bodyPtr, procPtr);
if (procPtr != NULL) {
/*
* Because the body is a TclProProcBody, the actual body is already
@@ -529,7 +529,7 @@ TclCreateProc(
"FORMALARGUMENTFORMAT", NULL);
goto procError;
}
- if ((fieldCount == 0) || (fieldValues[0]->length == 0)) {
+ if ((fieldCount == 0) || (Tcl_GetCharLength(fieldValues[0]) == 0)) {
Tcl_SetObjResult(interp, Tcl_NewStringObj(
"argument with no name", -1));
Tcl_SetErrorCode(interp, "TCL", "OPERATION", "PROC",
@@ -724,7 +724,7 @@ TclGetFrame(
obj.length = strlen(name);
obj.typePtr = NULL;
result = TclObjGetFrame(interp, &obj, framePtrPtr);
- TclFreeIntRep(&obj);
+ TclFreeInternalRep(&obj);
return result;
}
@@ -762,7 +762,7 @@ TclObjGetFrame(
{
Interp *iPtr = (Interp *) interp;
int curLevel, level, result;
- const Tcl_ObjIntRep *irPtr;
+ const Tcl_ObjInternalRep *irPtr;
const char *name = NULL;
Tcl_WideInt w;
@@ -788,7 +788,7 @@ TclObjGetFrame(
level = curLevel - level;
result = 1;
}
- } else if ((irPtr = TclFetchIntRep(objPtr, &levelReferenceType))) {
+ } else if ((irPtr = TclFetchInternalRep(objPtr, &levelReferenceType))) {
level = irPtr->wideValue;
result = 1;
} else {
@@ -798,10 +798,10 @@ TclObjGetFrame(
if (level < 0 || (level > 0 && name[1] == '-')) {
result = -1;
} else {
- Tcl_ObjIntRep ir;
+ Tcl_ObjInternalRep ir;
ir.wideValue = level;
- Tcl_StoreIntRep(objPtr, &levelReferenceType, &ir);
+ Tcl_StoreInternalRep(objPtr, &levelReferenceType, &ir);
result = 1;
}
} else {
@@ -1151,7 +1151,7 @@ TclInitCompiledLocals(
ByteCode *codePtr;
bodyPtr = framePtr->procPtr->bodyPtr;
- ByteCodeGetIntRep(bodyPtr, &tclByteCodeType, codePtr);
+ ByteCodeGetInternalRep(bodyPtr, &tclByteCodeType, codePtr);
if (codePtr == NULL) {
Tcl_Panic("body object for proc attached to frame is not a byte code type");
}
@@ -1327,7 +1327,7 @@ InitLocalCache(
CompiledLocal *localPtr;
int isNew;
- ByteCodeGetIntRep(procPtr->bodyPtr, &tclByteCodeType, codePtr);
+ ByteCodeGetInternalRep(procPtr->bodyPtr, &tclByteCodeType, codePtr);
/*
* Cache the names and initial values of local variables; store the
@@ -1400,7 +1400,7 @@ InitArgsAndLocals(
int localCt = procPtr->numCompiledLocals, numArgs, argCt, i, imax;
Tcl_Obj *const *argObjs;
- ByteCodeGetIntRep(procPtr->bodyPtr, &tclByteCodeType, codePtr);
+ ByteCodeGetInternalRep(procPtr->bodyPtr, &tclByteCodeType, codePtr);
/*
* Make sure that the local cache of variable names and initial values has
@@ -1576,7 +1576,7 @@ TclPushProcCallFrame(
* local variables are found while compiling.
*/
- ByteCodeGetIntRep(procPtr->bodyPtr, &tclByteCodeType, codePtr);
+ ByteCodeGetInternalRep(procPtr->bodyPtr, &tclByteCodeType, codePtr);
if (codePtr != NULL) {
Interp *iPtr = (Interp *) interp;
@@ -1786,7 +1786,7 @@ TclNRInterpProcCore(
*/
procPtr->refCount++;
- ByteCodeGetIntRep(procPtr->bodyPtr, &tclByteCodeType, codePtr);
+ ByteCodeGetInternalRep(procPtr->bodyPtr, &tclByteCodeType, codePtr);
TclNRAddCallback(interp, InterpProcNR2, procNameObj, errorProc,
NULL, NULL);
@@ -1920,7 +1920,7 @@ TclProcCompileProc(
Tcl_CallFrame *framePtr;
ByteCode *codePtr;
- ByteCodeGetIntRep(bodyPtr, &tclByteCodeType, codePtr);
+ ByteCodeGetInternalRep(bodyPtr, &tclByteCodeType, codePtr);
/*
* If necessary, compile the procedure's body. The compiler will allocate
@@ -1955,7 +1955,7 @@ TclProcCompileProc(
codePtr->compileEpoch = iPtr->compileEpoch;
codePtr->nsPtr = nsPtr;
} else {
- Tcl_StoreIntRep(bodyPtr, &tclByteCodeType, NULL);
+ Tcl_StoreInternalRep(bodyPtr, &tclByteCodeType, NULL);
codePtr = NULL;
}
}
@@ -2312,7 +2312,7 @@ TclNewProcBodyObj(
TclNewObj(objPtr);
if (objPtr) {
- ProcSetIntRep(objPtr, procPtr);
+ ProcSetInternalRep(objPtr, procPtr);
}
return objPtr;
@@ -2341,9 +2341,9 @@ ProcBodyDup(
Tcl_Obj *dupPtr) /* Target object for the duplication. */
{
Proc *procPtr;
- ProcGetIntRep(srcPtr, procPtr);
+ ProcGetInternalRep(srcPtr, procPtr);
- ProcSetIntRep(dupPtr, procPtr);
+ ProcSetInternalRep(dupPtr, procPtr);
}
/*
@@ -2371,7 +2371,7 @@ ProcBodyFree(
{
Proc *procPtr;
- ProcGetIntRep(objPtr, procPtr);
+ ProcGetInternalRep(objPtr, procPtr);
if (procPtr->refCount-- <= 1) {
TclProcCleanupProc(procPtr);
@@ -2400,12 +2400,12 @@ DupLambdaInternalRep(
Proc *procPtr;
Tcl_Obj *nsObjPtr;
- LambdaGetIntRep(srcPtr, procPtr, nsObjPtr);
+ LambdaGetInternalRep(srcPtr, procPtr, nsObjPtr);
assert(procPtr != NULL);
procPtr->refCount++;
- LambdaSetIntRep(copyPtr, procPtr, nsObjPtr);
+ LambdaSetInternalRep(copyPtr, procPtr, nsObjPtr);
}
static void
@@ -2416,7 +2416,7 @@ FreeLambdaInternalRep(
Proc *procPtr;
Tcl_Obj *nsObjPtr;
- LambdaGetIntRep(objPtr, procPtr, nsObjPtr);
+ LambdaGetInternalRep(objPtr, procPtr, nsObjPtr);
assert(procPtr != NULL);
if (procPtr->refCount-- <= 1) {
@@ -2590,7 +2590,7 @@ SetLambdaFromAny(
* conversion to lambdaType.
*/
- LambdaSetIntRep(objPtr, procPtr, nsObjPtr);
+ LambdaSetInternalRep(objPtr, procPtr, nsObjPtr);
return TCL_OK;
}
@@ -2603,13 +2603,13 @@ TclGetLambdaFromObj(
Proc *procPtr;
Tcl_Obj *nsObjPtr;
- LambdaGetIntRep(objPtr, procPtr, nsObjPtr);
+ LambdaGetInternalRep(objPtr, procPtr, nsObjPtr);
if (procPtr == NULL) {
if (SetLambdaFromAny(interp, objPtr) != TCL_OK) {
return NULL;
}
- LambdaGetIntRep(objPtr, procPtr, nsObjPtr);
+ LambdaGetInternalRep(objPtr, procPtr, nsObjPtr);
}
assert(procPtr != NULL);
diff --git a/generic/tclRegexp.c b/generic/tclRegexp.c
index f161782..b7fbb81 100644
--- a/generic/tclRegexp.c
+++ b/generic/tclRegexp.c
@@ -109,19 +109,19 @@ const Tcl_ObjType tclRegexpType = {
SetRegexpFromAny /* setFromAnyProc */
};
-#define RegexpSetIntRep(objPtr, rePtr) \
+#define RegexpSetInternalRep(objPtr, rePtr) \
do { \
- Tcl_ObjIntRep ir; \
+ Tcl_ObjInternalRep ir; \
(rePtr)->refCount++; \
ir.twoPtrValue.ptr1 = (rePtr); \
ir.twoPtrValue.ptr2 = NULL; \
- Tcl_StoreIntRep((objPtr), &tclRegexpType, &ir); \
+ Tcl_StoreInternalRep((objPtr), &tclRegexpType, &ir); \
} while (0)
-#define RegexpGetIntRep(objPtr, rePtr) \
+#define RegexpGetInternalRep(objPtr, rePtr) \
do { \
- const Tcl_ObjIntRep *irPtr; \
- irPtr = TclFetchIntRep((objPtr), &tclRegexpType); \
+ const Tcl_ObjInternalRep *irPtr; \
+ irPtr = TclFetchInternalRep((objPtr), &tclRegexpType); \
(rePtr) = irPtr ? (TclRegexp *)irPtr->twoPtrValue.ptr1 : NULL; \
} while (0)
@@ -598,7 +598,7 @@ Tcl_GetRegExpFromObj(
TclRegexp *regexpPtr;
const char *pattern;
- RegexpGetIntRep(objPtr, regexpPtr);
+ RegexpGetInternalRep(objPtr, regexpPtr);
if ((regexpPtr == NULL) || (regexpPtr->flags != flags)) {
pattern = TclGetStringFromObj(objPtr, &length);
@@ -608,7 +608,7 @@ Tcl_GetRegExpFromObj(
return NULL;
}
- RegexpSetIntRep(objPtr, regexpPtr);
+ RegexpSetInternalRep(objPtr, regexpPtr);
}
return (Tcl_RegExp) regexpPtr;
}
@@ -757,7 +757,7 @@ FreeRegexpInternalRep(
{
TclRegexp *regexpRepPtr;
- RegexpGetIntRep(objPtr, regexpRepPtr);
+ RegexpGetInternalRep(objPtr, regexpRepPtr);
assert(regexpRepPtr != NULL);
@@ -794,11 +794,11 @@ DupRegexpInternalRep(
{
TclRegexp *regexpPtr;
- RegexpGetIntRep(srcPtr, regexpPtr);
+ RegexpGetInternalRep(srcPtr, regexpPtr);
assert(regexpPtr != NULL);
- RegexpSetIntRep(copyPtr, regexpPtr);
+ RegexpSetInternalRep(copyPtr, regexpPtr);
}
/*
diff --git a/generic/tclResult.c b/generic/tclResult.c
index 5b7a8e5..dba57c1 100644
--- a/generic/tclResult.c
+++ b/generic/tclResult.c
@@ -1013,7 +1013,7 @@ ResetObjResult(
objResultPtr->bytes = &tclEmptyString;
objResultPtr->length = 0;
}
- TclFreeIntRep(objResultPtr);
+ TclFreeInternalRep(objResultPtr);
}
}
@@ -1336,7 +1336,7 @@ TclProcessReturn(
Tcl_ListObjLength(interp, iPtr->errorStack, &len);
/*
- * Reset while keeping the list intrep as much as possible.
+ * Reset while keeping the list internalrep as much as possible.
*/
Tcl_ListObjReplace(interp, iPtr->errorStack, 0, len, valueObjc,
diff --git a/generic/tclScan.c b/generic/tclScan.c
index f35b376..5568529 100644
--- a/generic/tclScan.c
+++ b/generic/tclScan.c
@@ -1017,8 +1017,8 @@ Tcl_ScanObjCmd(
double dvalue;
if (Tcl_GetDoubleFromObj(NULL, objPtr, &dvalue) != TCL_OK) {
#ifdef ACCEPT_NAN
- const Tcl_ObjIntRep *irPtr
- = TclFetchIntRep(objPtr, &tclDoubleType);
+ const Tcl_ObjInternalRep *irPtr
+ = TclFetchInternalRep(objPtr, &tclDoubleType);
if (irPtr) {
dvalue = irPtr->doubleValue;
} else
diff --git a/generic/tclStrToD.c b/generic/tclStrToD.c
index b213bed..e87f714 100644
--- a/generic/tclStrToD.c
+++ b/generic/tclStrToD.c
@@ -553,11 +553,11 @@ TclParseNumber(
if (bytes == NULL) {
if (interp == NULL && endPtrPtr == NULL) {
- if (TclHasIntRep(objPtr, &tclDictType)) {
+ if (TclHasInternalRep(objPtr, &tclDictType)) {
/* A dict can never be a (single) number */
return TCL_ERROR;
}
- if (TclHasIntRep(objPtr, &tclListType)) {
+ if (TclHasInternalRep(objPtr, &tclListType)) {
int length;
/* A list can only be a (single) number if its length == 1 */
TclListObjLength(NULL, objPtr, &length);
@@ -721,9 +721,9 @@ TclParseNumber(
if (!octalSignificandOverflow) {
/*
- * Shifting by more bits than are in the value being
- * shifted is at least de facto nonportable. Check for
- * too large shifts first.
+ * Shifting by as many or more bits than are in the
+ * value being shifted is undefined behavior. Check
+ * for too large shifts first.
*/
if ((octalSignificandWide != 0)
@@ -737,8 +737,17 @@ TclParseNumber(
}
}
if (!octalSignificandOverflow) {
- octalSignificandWide =
- (octalSignificandWide << shift) + (c - '0');
+ /*
+ * When the significand is 0, it is possible for the
+ * amount to be shifted to equal or exceed the width
+ * of the significand. Do not shift when the
+ * significand is 0 to avoid undefined behavior.
+ */
+
+ if (octalSignificandWide != 0) {
+ octalSignificandWide <<= shift;
+ }
+ octalSignificandWide += c - '0';
} else {
if (err == MP_OKAY) {
err = mp_mul_2d(&octalSignificandBig, shift,
@@ -863,9 +872,9 @@ TclParseNumber(
shift = 4 * (numTrailZeros + 1);
if (!significandOverflow) {
/*
- * Shifting by more bits than are in the value being
- * shifted is at least de facto nonportable. Check for too
- * large shifts first.
+ * Shifting by as many or more bits than are in the
+ * value being shifted is undefined behavior. Check
+ * for too large shifts first.
*/
if (significandWide != 0 &&
@@ -877,7 +886,17 @@ TclParseNumber(
}
}
if (!significandOverflow) {
- significandWide = (significandWide << shift) + d;
+ /*
+ * When the significand is 0, it is possible for the
+ * amount to be shifted to equal or exceed the width
+ * of the significand. Do not shift when the
+ * significand is 0 to avoid undefined behavior.
+ */
+
+ if (significandWide != 0) {
+ significandWide <<= shift;
+ }
+ significandWide += d;
} else if (err == MP_OKAY) {
err = mp_mul_2d(&significandBig, shift, &significandBig);
if (err == MP_OKAY) {
@@ -917,9 +936,9 @@ TclParseNumber(
shift = numTrailZeros + 1;
if (!significandOverflow) {
/*
- * Shifting by more bits than are in the value being
- * shifted is at least de facto nonportable. Check for too
- * large shifts first.
+ * Shifting by as many or more bits than are in the
+ * value being shifted is undefined behavior. Check
+ * for too large shifts first.
*/
if (significandWide != 0 &&
@@ -931,7 +950,17 @@ TclParseNumber(
}
}
if (!significandOverflow) {
- significandWide = (significandWide << shift) + 1;
+ /*
+ * When the significand is 0, it is possible for the
+ * amount to be shifted to equal or exceed the width
+ * of the significand. Do not shift when the
+ * significand is 0 to avoid undefined behavior.
+ */
+
+ if (significandWide != 0) {
+ significandWide <<= shift;
+ }
+ significandWide += 1;
} else if (err == MP_OKAY) {
err = mp_mul_2d(&significandBig, shift, &significandBig);
if (err == MP_OKAY) {
@@ -1295,7 +1324,7 @@ TclParseNumber(
*/
if (status == TCL_OK && objPtr != NULL) {
- TclFreeIntRep(objPtr);
+ TclFreeInternalRep(objPtr);
switch (acceptState) {
case SIGNUM:
case BAD_OCTAL:
@@ -1330,7 +1359,15 @@ TclParseNumber(
}
if (shift) {
if (!significandOverflow) {
- significandWide <<= shift;
+ /*
+ * When the significand is 0, it is possible for the
+ * amount to be shifted to equal or exceed the width
+ * of the significand. Do not shift when the
+ * significand is 0 to avoid undefined behavior.
+ */
+ if (significandWide != 0) {
+ significandWide <<= shift;
+ }
} else if (err == MP_OKAY) {
err = mp_mul_2d(&significandBig, shift, &significandBig);
}
@@ -1354,7 +1391,15 @@ TclParseNumber(
}
if (shift) {
if (!significandOverflow) {
- significandWide <<= shift;
+ /*
+ * When the significand is 0, it is possible for the
+ * amount to be shifted to equal or exceed the width
+ * of the significand. Do not shift when the
+ * significand is 0 to avoid undefined behavior.
+ */
+ if (significandWide != 0) {
+ significandWide <<= shift;
+ }
} else if (err == MP_OKAY) {
err = mp_mul_2d(&significandBig, shift, &significandBig);
}
@@ -1379,7 +1424,15 @@ TclParseNumber(
}
if (shift) {
if (!octalSignificandOverflow) {
- octalSignificandWide <<= shift;
+ /*
+ * When the significand is 0, it is possible for the
+ * amount to be shifted to equal or exceed the width
+ * of the significand. Do not shift when the
+ * significand is 0 to avoid undefined behavior.
+ */
+ if (octalSignificandWide != 0) {
+ octalSignificandWide <<= shift;
+ }
} else if (err == MP_OKAY) {
err = mp_mul_2d(&octalSignificandBig, shift,
&octalSignificandBig);
@@ -1405,7 +1458,7 @@ TclParseNumber(
if (signum) {
err = mp_neg(&octalSignificandBig, &octalSignificandBig);
}
- TclSetBignumIntRep(objPtr, &octalSignificandBig);
+ TclSetBignumInternalRep(objPtr, &octalSignificandBig);
}
if (err != MP_OKAY) {
return TCL_ERROR;
@@ -1441,7 +1494,7 @@ TclParseNumber(
if (signum) {
err = mp_neg(&significandBig, &significandBig);
}
- TclSetBignumIntRep(objPtr, &significandBig);
+ TclSetBignumInternalRep(objPtr, &significandBig);
}
if (err != MP_OKAY) {
return TCL_ERROR;
diff --git a/generic/tclStringObj.c b/generic/tclStringObj.c
index 508b280..91b632a 100644
--- a/generic/tclStringObj.c
+++ b/generic/tclStringObj.c
@@ -836,7 +836,7 @@ Tcl_SetStringObj(
* Set the type to NULL and free any internal rep for the old type.
*/
- TclFreeIntRep(objPtr);
+ TclFreeInternalRep(objPtr);
/*
* Free any old string rep, then set the string rep to a copy of the
@@ -1098,7 +1098,7 @@ Tcl_SetUnicodeObj(
if (Tcl_IsShared(objPtr)) {
Tcl_Panic("%s called with shared object", "Tcl_SetUnicodeObj");
}
- TclFreeIntRep(objPtr);
+ TclFreeInternalRep(objPtr);
SetUnicodeObj(objPtr, unicode, numChars);
}
@@ -1443,7 +1443,7 @@ Tcl_AppendObjToObj(
* If appendObjPtr is not of the "String" type, don't convert it.
*/
- if (TclHasIntRep(appendObjPtr, &tclStringType)) {
+ if (TclHasInternalRep(appendObjPtr, &tclStringType)) {
Tcl_UniChar *unicode =
Tcl_GetUnicodeFromObj(appendObjPtr, &numChars);
@@ -1464,7 +1464,7 @@ Tcl_AppendObjToObj(
bytes = TclGetStringFromObj(appendObjPtr, &length);
numChars = stringPtr->numChars;
- if ((numChars >= 0) && TclHasIntRep(appendObjPtr, &tclStringType)) {
+ if ((numChars >= 0) && TclHasInternalRep(appendObjPtr, &tclStringType)) {
String *appendStringPtr = GET_STRING(appendObjPtr);
appendNumChars = appendStringPtr->numChars;
@@ -2869,7 +2869,7 @@ TclGetStringStorage(
{
String *stringPtr;
- if (!TclHasIntRep(objPtr, &tclStringType) || objPtr->bytes == NULL) {
+ if (!TclHasInternalRep(objPtr, &tclStringType) || objPtr->bytes == NULL) {
return TclGetStringFromObj(objPtr, (int *)sizePtr);
}
@@ -2917,7 +2917,7 @@ TclStringRepeat(
*/
if (!binary) {
- if (TclHasIntRep(objPtr, &tclStringType)) {
+ if (TclHasInternalRep(objPtr, &tclStringType)) {
String *stringPtr = GET_STRING(objPtr);
if (stringPtr->hasUnicode) {
unichar = 1;
@@ -3001,7 +3001,7 @@ TclStringRepeat(
if (!inPlace || Tcl_IsShared(objPtr)) {
objResultPtr = Tcl_NewStringObj(Tcl_GetString(objPtr), length);
} else {
- TclFreeIntRep(objPtr);
+ TclFreeInternalRep(objPtr);
objResultPtr = objPtr;
}
if (0 == Tcl_AttemptSetObjLength(objResultPtr, count*length)) {
@@ -3096,7 +3096,7 @@ TclStringCat(
} else {
/* assert (objPtr->typePtr != NULL) -- stork! */
binary = 0;
- if (TclHasIntRep(objPtr, &tclStringType)) {
+ if (TclHasInternalRep(objPtr, &tclStringType)) {
/* Have a pure Unicode value; ask to preserve it */
requestUniChar = 1;
} else {
@@ -3363,7 +3363,7 @@ TclStringCat(
dst = Tcl_GetString(objResultPtr) + start;
/* assert ( length > start ) */
- TclFreeIntRep(objResultPtr);
+ TclFreeInternalRep(objResultPtr);
} else {
TclNewObj(objResultPtr); /* PANIC? */
if (0 == Tcl_AttemptSetObjLength(objResultPtr, length)) {
@@ -3449,8 +3449,8 @@ TclStringCmp(
s1 = (char *) Tcl_GetByteArrayFromObj(value1Ptr, &s1len);
s2 = (char *) Tcl_GetByteArrayFromObj(value2Ptr, &s2len);
memCmpFn = memcmp;
- } else if (TclHasIntRep(value1Ptr, &tclStringType)
- && TclHasIntRep(value2Ptr, &tclStringType)) {
+ } else if (TclHasInternalRep(value1Ptr, &tclStringType)
+ && TclHasInternalRep(value2Ptr, &tclStringType)) {
/*
* Do a unicode-specific comparison if both of the args are of
* String type. If the char length == byte length, we can do a
@@ -4284,7 +4284,7 @@ SetStringFromAny(
TCL_UNUSED(Tcl_Interp *),
Tcl_Obj *objPtr) /* The object to convert. */
{
- if (!TclHasIntRep(objPtr, &tclStringType)) {
+ if (!TclHasInternalRep(objPtr, &tclStringType)) {
String *stringPtr = stringAlloc(0);
/*
@@ -4292,10 +4292,10 @@ SetStringFromAny(
*/
(void) TclGetString(objPtr);
- TclFreeIntRep(objPtr);
+ TclFreeInternalRep(objPtr);
/*
- * Create a basic String intrep that just points to the UTF-8 string
+ * Create a basic String internalrep that just points to the UTF-8 string
* already in place at objPtr->bytes.
*/
diff --git a/generic/tclStubInit.c b/generic/tclStubInit.c
index 137aea0..a1878c1 100644
--- a/generic/tclStubInit.c
+++ b/generic/tclStubInit.c
@@ -1041,8 +1041,7 @@ static const TclIntStubs tclIntStubs = {
TclPtrUnsetVar, /* 256 */
TclStaticLibrary, /* 257 */
TclpCreateTemporaryDirectory, /* 258 */
- TclGetBytesFromObj, /* 259 */
- TclUnusedStubEntry, /* 260 */
+ TclUnusedStubEntry, /* 259 */
};
static const TclIntPlatStubs tclIntPlatStubs = {
@@ -1920,10 +1919,10 @@ const TclStubs tclStubs = {
TclZipfs_Unmount, /* 633 */
TclZipfs_TclLibrary, /* 634 */
TclZipfs_MountBuffer, /* 635 */
- Tcl_FreeIntRep, /* 636 */
+ Tcl_FreeInternalRep, /* 636 */
Tcl_InitStringRep, /* 637 */
- Tcl_FetchIntRep, /* 638 */
- Tcl_StoreIntRep, /* 639 */
+ Tcl_FetchInternalRep, /* 638 */
+ Tcl_StoreInternalRep, /* 639 */
Tcl_HasStringRep, /* 640 */
Tcl_IncrRefCount, /* 641 */
Tcl_DecrRefCount, /* 642 */
@@ -1933,8 +1932,8 @@ const TclStubs tclStubs = {
Tcl_UtfToUniChar, /* 646 */
Tcl_UniCharToUtfDString, /* 647 */
Tcl_UtfToUniCharDString, /* 648 */
- 0, /* 649 */
- 0, /* 650 */
+ TclGetBytesFromObj, /* 649 */
+ Tcl_GetBytesFromObj, /* 650 */
TclGetStringFromObj, /* 651 */
TclGetUnicodeFromObj, /* 652 */
TclGetByteArrayFromObj, /* 653 */
diff --git a/generic/tclTest.c b/generic/tclTest.c
index 5c08aa0..46a1459 100644
--- a/generic/tclTest.c
+++ b/generic/tclTest.c
@@ -225,7 +225,6 @@ static Tcl_CmdProc TestcreatecommandCmd;
static Tcl_CmdProc TestdcallCmd;
static Tcl_CmdProc TestdelCmd;
static Tcl_CmdProc TestdelassocdataCmd;
-static Tcl_ObjCmdProc TestdebugObjCmd;
static Tcl_ObjCmdProc TestdoubledigitsObjCmd;
static Tcl_CmdProc TestdstringCmd;
static Tcl_ObjCmdProc TestencodingObjCmd;
@@ -264,7 +263,6 @@ static Tcl_ObjCmdProc TestparsevarObjCmd;
static Tcl_ObjCmdProc TestparsevarnameObjCmd;
static Tcl_ObjCmdProc TestpreferstableObjCmd;
static Tcl_ObjCmdProc TestprintObjCmd;
-static Tcl_ObjCmdProc TestpurifyObjCmd;
static Tcl_ObjCmdProc TestregexpObjCmd;
static Tcl_ObjCmdProc TestreturnObjCmd;
static void TestregexpXflags(const char *string,
@@ -504,8 +502,6 @@ Tcltest_Init(
Tcl_CreateCommand(interp, "testcreatecommand", TestcreatecommandCmd,
NULL, NULL);
Tcl_CreateCommand(interp, "testdcall", TestdcallCmd, NULL, NULL);
- Tcl_CreateObjCommand(interp, "testdebug", TestdebugObjCmd,
- NULL, NULL);
Tcl_CreateCommand(interp, "testdel", TestdelCmd, NULL, NULL);
Tcl_CreateCommand(interp, "testdelassocdata", TestdelassocdataCmd,
NULL, NULL);
@@ -570,8 +566,6 @@ Tcltest_Init(
NULL, NULL);
Tcl_CreateObjCommand(interp, "testpreferstable", TestpreferstableObjCmd,
NULL, NULL);
- Tcl_CreateObjCommand(interp, "testpurify", TestpurifyObjCmd,
- NULL, NULL);
Tcl_CreateObjCommand(interp, "testprint", TestprintObjCmd,
NULL, NULL);
Tcl_CreateObjCommand(interp, "testregexp", TestregexpObjCmd,
@@ -1654,7 +1648,7 @@ TestdoubledigitsObjCmd(
status = Tcl_GetDoubleFromObj(interp, objv[1], &d);
if (status != TCL_OK) {
doubleType = Tcl_GetObjType("double");
- if (Tcl_FetchIntRep(objv[1], doubleType)
+ if (Tcl_FetchInternalRep(objv[1], doubleType)
&& TclIsNaN(objv[1]->internalRep.doubleValue)) {
status = TCL_OK;
memcpy(&d, &(objv[1]->internalRep.doubleValue), sizeof(double));
@@ -1891,7 +1885,7 @@ TestencodingObjCmd(
}
Tcl_FreeEncoding(encoding); /* Free returned reference */
Tcl_FreeEncoding(encoding); /* Free to match CREATE */
- TclFreeIntRep(objv[2]); /* Free the cached ref */
+ TclFreeInternalRep(objv[2]); /* Free the cached ref */
break;
}
return TCL_OK;
@@ -3359,40 +3353,6 @@ TestlocaleCmd(
/*
*----------------------------------------------------------------------
*
- * TestdebugObjCmd --
- *
- * Implements the "testdebug" command, to detect whether Tcl was built with
- * --enabble-symbols.
- *
- * Results:
- * A standard Tcl result.
- *
- * Side effects:
- * None.
- *
- *----------------------------------------------------------------------
- */
-
-static int
-TestdebugObjCmd(
- TCL_UNUSED(void *),
- Tcl_Interp *interp, /* Current interpreter. */
- TCL_UNUSED(int) /*objc*/,
- TCL_UNUSED(Tcl_Obj *const *) /*objv*/)
-{
-
-#if defined(NDEBUG) && NDEBUG == 1
- Tcl_SetObjResult(interp, Tcl_NewBooleanObj(0));
-#else
- Tcl_SetObjResult(interp, Tcl_NewBooleanObj(1));
-#endif
-
- return TCL_OK;
-}
-
-/*
- *----------------------------------------------------------------------
- *
* CleanupTestSetassocdataTests --
*
* This function is called when an interpreter is deleted to clean
@@ -3794,40 +3754,6 @@ TestprintObjCmd(
/*
*----------------------------------------------------------------------
*
- * TestpurifyObjCmd --
- *
- * Implements the "testpurify" command, to detect whether Tcl was built with
- * -DPURIFY.
- *
- * Results:
- * A standard Tcl result.
- *
- * Side effects:
- * None.
- *
- *----------------------------------------------------------------------
- */
-
-static int
-TestpurifyObjCmd(
- TCL_UNUSED(void *),
- Tcl_Interp *interp, /* Current interpreter. */
- TCL_UNUSED(int) /*objc*/,
- TCL_UNUSED(Tcl_Obj *const *) /*objv*/)
-{
-
-#ifdef PURIFY
- Tcl_SetObjResult(interp, Tcl_NewBooleanObj(1));
-#else
- Tcl_SetObjResult(interp, Tcl_NewBooleanObj(0));
-#endif
-
- return TCL_OK;
-}
-
-/*
- *----------------------------------------------------------------------
- *
* TestregexpObjCmd --
*
* This procedure implements the "testregexp" command. It is used to give
@@ -5135,7 +5061,7 @@ TestbytestringObjCmd(
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* The argument objects. */
{
- int n = 0;
+ size_t n = 0;
const char *p;
if (objc != 2) {
@@ -5143,7 +5069,7 @@ TestbytestringObjCmd(
return TCL_ERROR;
}
- p = (const char *)TclGetBytesFromObj(interp, objv[1], &n);
+ p = (const char *)Tcl_GetBytesFromObj(interp, objv[1], &n);
if (p == NULL) {
return TCL_ERROR;
}
diff --git a/generic/tclUtil.c b/generic/tclUtil.c
index bbacbe2..32721f6 100644
--- a/generic/tclUtil.c
+++ b/generic/tclUtil.c
@@ -123,7 +123,7 @@ static int FindElement(Tcl_Interp *interp, const char *string,
* represents a list index in the form, "end-offset". It is used as a
* performance optimization in Tcl_GetIntForIndex. The internal rep is
* stored directly in the wideValue, so no memory management is required
- * for it. This is a caching intrep, keeping the result of a parse
+ * for it. This is a caching internalrep, keeping the result of a parse
* around. This type is only created from a pre-existing string, so an
* updateStringProc will never be called and need not exist. The type
* is unregistered, so has no need of a setFromAnyProc either.
@@ -2589,7 +2589,7 @@ TclStringMatchObj(
trivial = nocase ? 0 : TclMatchIsTrivial(TclGetString(ptnObj));
*/
- if (TclHasIntRep(strObj, &tclStringType) || (strObj->typePtr == NULL)) {
+ if (TclHasInternalRep(strObj, &tclStringType) || (strObj->typePtr == NULL)) {
Tcl_UniChar *udata, *uptn;
udata = Tcl_GetUnicodeFromObj(strObj, &length);
@@ -3035,7 +3035,7 @@ Tcl_DStringGetResult(
dsPtr->string = TclGetString(iPtr->objResultPtr);
dsPtr->length = iPtr->objResultPtr->length;
dsPtr->spaceAvl = dsPtr->length + 1;
- TclFreeIntRep(iPtr->objResultPtr);
+ TclFreeInternalRep(iPtr->objResultPtr);
iPtr->objResultPtr->bytes = &tclEmptyString;
iPtr->objResultPtr->length = 0;
}
@@ -3752,12 +3752,12 @@ GetEndOffsetFromObj(
Tcl_WideInt *widePtr) /* Location filled in with an integer
* representing an index. */
{
- Tcl_ObjIntRep *irPtr;
+ Tcl_ObjInternalRep *irPtr;
Tcl_WideInt offset = -1; /* Offset in the "end-offset" expression - 1 */
ClientData cd;
- while ((irPtr = TclFetchIntRep(objPtr, &endOffsetType)) == NULL) {
- Tcl_ObjIntRep ir;
+ while ((irPtr = TclFetchInternalRep(objPtr, &endOffsetType)) == NULL) {
+ Tcl_ObjInternalRep ir;
int length;
const char *bytes = TclGetStringFromObj(objPtr, &length);
@@ -3816,8 +3816,8 @@ GetEndOffsetFromObj(
}
}
}
- /* Clear invalid intreps left by TclParseNumber */
- TclFreeIntRep(objPtr);
+ /* Clear invalid internalreps left by TclParseNumber */
+ TclFreeInternalRep(objPtr);
if (t1 && t2) {
/* We have both integer values */
@@ -3942,7 +3942,7 @@ GetEndOffsetFromObj(
parseOK:
/* Success. Store the new internal rep. */
ir.wideValue = offset;
- Tcl_StoreIntRep(objPtr, &endOffsetType, &ir);
+ Tcl_StoreInternalRep(objPtr, &endOffsetType, &ir);
}
offset = irPtr->wideValue;
@@ -4047,7 +4047,7 @@ TclIndexEncode(
int idx;
if (TCL_OK == GetWideForIndex(interp, objPtr, (unsigned)TCL_INDEX_END , &wide)) {
- const Tcl_ObjIntRep *irPtr = TclFetchIntRep(objPtr, &endOffsetType);
+ const Tcl_ObjInternalRep *irPtr = TclFetchInternalRep(objPtr, &endOffsetType);
if (irPtr && irPtr->wideValue >= 0) {
/* "int[+-]int" syntax, works the same here as "int" */
irPtr = NULL;
@@ -4330,7 +4330,7 @@ TclSetProcessGlobalValue(
/*
* Fill the local thread copy directly with the Tcl_Obj value to avoid
- * loss of the intrep. Increment newValue refCount early to handle case
+ * loss of the internalrep. Increment newValue refCount early to handle case
* where we set a PGV to itself.
*/
diff --git a/generic/tclVar.c b/generic/tclVar.c
index 51c51f8..d2b8227 100644
--- a/generic/tclVar.c
+++ b/generic/tclVar.c
@@ -253,20 +253,20 @@ static const Tcl_ObjType localVarNameType = {
FreeLocalVarName, DupLocalVarName, NULL, NULL
};
-#define LocalSetIntRep(objPtr, index, namePtr) \
+#define LocalSetInternalRep(objPtr, index, namePtr) \
do { \
- Tcl_ObjIntRep ir; \
+ Tcl_ObjInternalRep ir; \
Tcl_Obj *ptr = (namePtr); \
if (ptr) {Tcl_IncrRefCount(ptr);} \
ir.twoPtrValue.ptr1 = ptr; \
ir.twoPtrValue.ptr2 = INT2PTR(index); \
- Tcl_StoreIntRep((objPtr), &localVarNameType, &ir); \
+ Tcl_StoreInternalRep((objPtr), &localVarNameType, &ir); \
} while (0)
-#define LocalGetIntRep(objPtr, index, name) \
+#define LocalGetInternalRep(objPtr, index, name) \
do { \
- const Tcl_ObjIntRep *irPtr; \
- irPtr = TclFetchIntRep((objPtr), &localVarNameType); \
+ const Tcl_ObjInternalRep *irPtr; \
+ irPtr = TclFetchInternalRep((objPtr), &localVarNameType); \
(name) = irPtr ? (Tcl_Obj *)irPtr->twoPtrValue.ptr1 : NULL; \
(index) = irPtr ? PTR2INT(irPtr->twoPtrValue.ptr2) : -1; \
} while (0)
@@ -276,22 +276,22 @@ static const Tcl_ObjType parsedVarNameType = {
FreeParsedVarName, DupParsedVarName, NULL, NULL
};
-#define ParsedSetIntRep(objPtr, arrayPtr, elem) \
+#define ParsedSetInternalRep(objPtr, arrayPtr, elem) \
do { \
- Tcl_ObjIntRep ir; \
+ Tcl_ObjInternalRep ir; \
Tcl_Obj *ptr1 = (arrayPtr); \
Tcl_Obj *ptr2 = (elem); \
if (ptr1) {Tcl_IncrRefCount(ptr1);} \
if (ptr2) {Tcl_IncrRefCount(ptr2);} \
ir.twoPtrValue.ptr1 = ptr1; \
ir.twoPtrValue.ptr2 = ptr2; \
- Tcl_StoreIntRep((objPtr), &parsedVarNameType, &ir); \
+ Tcl_StoreInternalRep((objPtr), &parsedVarNameType, &ir); \
} while (0)
-#define ParsedGetIntRep(objPtr, parsed, array, elem) \
+#define ParsedGetInternalRep(objPtr, parsed, array, elem) \
do { \
- const Tcl_ObjIntRep *irPtr; \
- irPtr = TclFetchIntRep((objPtr), &parsedVarNameType); \
+ const Tcl_ObjInternalRep *irPtr; \
+ irPtr = TclFetchInternalRep((objPtr), &parsedVarNameType); \
(parsed) = (irPtr != NULL); \
(array) = irPtr ? (Tcl_Obj *)irPtr->twoPtrValue.ptr1 : NULL; \
(elem) = irPtr ? (Tcl_Obj *)irPtr->twoPtrValue.ptr2 : NULL; \
@@ -615,7 +615,7 @@ TclObjLookupVarEx(
*arrayPtrPtr = NULL;
restart:
- LocalGetIntRep(part1Ptr, localIndex, namePtr);
+ LocalGetInternalRep(part1Ptr, localIndex, namePtr);
if (localIndex >= 0) {
if (HasLocalVars(varFramePtr)
&& !(flags & (TCL_GLOBAL_ONLY | TCL_NAMESPACE_ONLY))
@@ -639,7 +639,7 @@ TclObjLookupVarEx(
* If part1Ptr is a parsedVarNameType, retrieve the pre-parsed parts.
*/
- ParsedGetIntRep(part1Ptr, parsed, arrayPtr, elem);
+ ParsedGetInternalRep(part1Ptr, parsed, arrayPtr, elem);
if (parsed && arrayPtr) {
if (part2Ptr != NULL) {
/*
@@ -685,7 +685,7 @@ TclObjLookupVarEx(
part2Ptr = Tcl_NewStringObj(part2 + 1,
len - (part2 - part1) - 2);
- ParsedSetIntRep(part1Ptr, arrayPtr, part2Ptr);
+ ParsedSetInternalRep(part1Ptr, arrayPtr, part2Ptr);
part1Ptr = arrayPtr;
}
@@ -721,16 +721,16 @@ TclObjLookupVarEx(
Tcl_Obj *cachedNamePtr = localName(varFramePtr, index);
if (part1Ptr == cachedNamePtr) {
- LocalSetIntRep(part1Ptr, index, NULL);
+ LocalSetInternalRep(part1Ptr, index, NULL);
} else {
/*
* [80304238ac] Trickiness here. We will store and incr the
* refcount on cachedNamePtr. Trouble is that it's possible
- * (see test var-22.1) for cachedNamePtr to have an intrep
+ * (see test var-22.1) for cachedNamePtr to have an internalrep
* that contains a stored and refcounted part1Ptr. This
* would be a reference cycle which leads to a memory leak.
*
- * The solution here is to wipe away all intrep(s) in
+ * The solution here is to wipe away all internalrep(s) in
* cachedNamePtr and leave it as string only. This is
* radical and destructive, so a better idea would be welcome.
*/
@@ -739,24 +739,24 @@ TclObjLookupVarEx(
* Firstly set cached local var reference (avoid free before set,
* see [45b9faf103f2])
*/
- LocalSetIntRep(part1Ptr, index, cachedNamePtr);
+ LocalSetInternalRep(part1Ptr, index, cachedNamePtr);
/* Then wipe it */
- TclFreeIntRep(cachedNamePtr);
+ TclFreeInternalRep(cachedNamePtr);
/*
* Now go ahead and convert it the the "localVarName" type,
* since we suspect at least some use of the value as a
* varname and we want to resolve it quickly.
*/
- LocalSetIntRep(cachedNamePtr, index, NULL);
+ LocalSetInternalRep(cachedNamePtr, index, NULL);
}
} else {
/*
* At least mark part1Ptr as already parsed.
*/
- ParsedSetIntRep(part1Ptr, NULL, NULL);
+ ParsedSetInternalRep(part1Ptr, NULL, NULL);
}
donePart1:
@@ -4115,7 +4115,7 @@ ArraySetCmd(
*/
arrayElemObj = objv[2];
- if (TclHasIntRep(arrayElemObj, &tclDictType) && arrayElemObj->bytes == NULL) {
+ if (TclHasInternalRep(arrayElemObj, &tclDictType) && arrayElemObj->bytes == NULL) {
Tcl_Obj *keyPtr, *valuePtr;
Tcl_DictSearch search;
int done;
@@ -5788,7 +5788,7 @@ FreeLocalVarName(
int index;
Tcl_Obj *namePtr;
- LocalGetIntRep(objPtr, index, namePtr);
+ LocalGetInternalRep(objPtr, index, namePtr);
index++; /* Compiler warning bait. */
if (namePtr) {
@@ -5804,11 +5804,11 @@ DupLocalVarName(
int index;
Tcl_Obj *namePtr;
- LocalGetIntRep(srcPtr, index, namePtr);
+ LocalGetInternalRep(srcPtr, index, namePtr);
if (!namePtr) {
namePtr = srcPtr;
}
- LocalSetIntRep(dupPtr, index, namePtr);
+ LocalSetInternalRep(dupPtr, index, namePtr);
}
/*
@@ -5827,7 +5827,7 @@ FreeParsedVarName(
Tcl_Obj *arrayPtr, *elem;
int parsed;
- ParsedGetIntRep(objPtr, parsed, arrayPtr, elem);
+ ParsedGetInternalRep(objPtr, parsed, arrayPtr, elem);
parsed++; /* Silence compiler. */
if (arrayPtr != NULL) {
@@ -5844,10 +5844,10 @@ DupParsedVarName(
Tcl_Obj *arrayPtr, *elem;
int parsed;
- ParsedGetIntRep(srcPtr, parsed, arrayPtr, elem);
+ ParsedGetInternalRep(srcPtr, parsed, arrayPtr, elem);
parsed++; /* Silence compiler. */
- ParsedSetIntRep(dupPtr, arrayPtr, elem);
+ ParsedSetInternalRep(dupPtr, arrayPtr, elem);
}
/*
diff --git a/generic/tclZipfs.c b/generic/tclZipfs.c
index c77e8db..98a2820 100644
--- a/generic/tclZipfs.c
+++ b/generic/tclZipfs.c
@@ -308,13 +308,11 @@ static inline int ListMountPoints(Tcl_Interp *interp);
static void SerializeCentralDirectoryEntry(
const unsigned char *start,
const unsigned char *end, unsigned char *buf,
- ZipEntry *z, size_t nameLength,
- long long dataStartOffset);
+ ZipEntry *z, size_t nameLength);
static void SerializeCentralDirectorySuffix(
const unsigned char *start,
const unsigned char *end, unsigned char *buf,
- int entryCount, long long dataStartOffset,
- long long directoryStartOffset,
+ int entryCount, long long directoryStartOffset,
long long suffixStartOffset);
static void SerializeLocalEntryHeader(
const unsigned char *start,
@@ -1187,7 +1185,7 @@ ZipFSFindTOC(
int needZip,
ZipFile *zf)
{
- size_t i;
+ size_t i, minoff;
const unsigned char *p, *q;
const unsigned char *start = zf->data;
const unsigned char *end = zf->data + zf->length;
@@ -1245,6 +1243,8 @@ ZipFSFindTOC(
q = zf->data + ZipReadInt(start, end, p + ZIP_CENTRAL_DIRSTART_OFFS);
p -= ZipReadInt(start, end, p + ZIP_CENTRAL_DIRSIZE_OFFS);
+ zf->baseOffset = zf->passOffset = (p>q) ? p - q : 0;
+ zf->directoryOffset = q - zf->data + zf->baseOffset;
if ((p < q) || (p < zf->data) || (p > zf->data + zf->length)
|| (q < zf->data) || (q > zf->data + zf->length)) {
if (!needZip) {
@@ -1260,11 +1260,11 @@ ZipFSFindTOC(
* Read the central directory.
*/
- zf->baseOffset = zf->passOffset = p - q;
- zf->directoryOffset = p - zf->data;
q = p;
+ minoff = zf->length;
for (i = 0; i < zf->numFiles; i++) {
int pathlen, comlen, extra;
+ size_t localhdr_off = zf->length;
if (q + ZIP_CENTRAL_HEADER_LEN > end) {
ZIPFS_ERROR(interp, "wrong header length");
@@ -1279,16 +1279,27 @@ ZipFSFindTOC(
pathlen = ZipReadShort(start, end, q + ZIP_CENTRAL_PATHLEN_OFFS);
comlen = ZipReadShort(start, end, q + ZIP_CENTRAL_FCOMMENTLEN_OFFS);
extra = ZipReadShort(start, end, q + ZIP_CENTRAL_EXTRALEN_OFFS);
+ localhdr_off = ZipReadInt(start, end, q + ZIP_CENTRAL_LOCALHDR_OFFS);
+ if (ZipReadInt(start, end, zf->data + zf->baseOffset + localhdr_off) != ZIP_LOCAL_HEADER_SIG) {
+ ZIPFS_ERROR(interp, "Failed to find local header");
+ ZIPFS_ERROR_CODE(interp, "LCL_HDR");
+ goto error;
+ }
+ if (localhdr_off < minoff) {
+ minoff = localhdr_off;
+ }
q += pathlen + comlen + extra + ZIP_CENTRAL_HEADER_LEN;
}
+ zf->passOffset = minoff + zf->baseOffset;
+
/*
* If there's also an encoded password, extract that too (but don't decode
* yet).
*/
- q = zf->data + zf->baseOffset;
- if ((zf->baseOffset >= 6) &&
+ q = zf->data + zf->passOffset;
+ if ((zf->passOffset >= 6) && (start < q-4) &&
(ZipReadInt(start, end, q - 4) == ZIP_PASSWORD_END_SIG)) {
const unsigned char *passPtr;
@@ -1300,6 +1311,7 @@ ZipFSFindTOC(
zf->passOffset -= i ? (5 + i) : 0;
}
}
+
return TCL_OK;
error:
@@ -2991,8 +3003,6 @@ ZipFSMkZipOrImg(
Tcl_Channel out;
int pwlen = 0, slen = 0, count, ret = TCL_ERROR, lobjc;
size_t len, i = 0;
- long long dataStartOffset; /* The overall file offset of the start of the
- * data section of the file. */
long long directoryStartOffset;
/* The overall file offset of the start of the
* central directory. */
@@ -3169,7 +3179,6 @@ ZipFSMkZipOrImg(
*/
Tcl_InitHashTable(&fileHash, TCL_STRING_KEYS);
- dataStartOffset = Tcl_Tell(out);
if (mappingList == NULL && stripPrefix != NULL) {
strip = Tcl_GetStringFromObj(stripPrefix, &slen);
if (!slen) {
@@ -3210,7 +3219,7 @@ ZipFSMkZipOrImg(
name = Tcl_UtfToExternalDString(ZipFS.utf8, z->name, -1, &ds);
len = Tcl_DStringLength(&ds);
SerializeCentralDirectoryEntry(start, end, (unsigned char *) buf,
- z, len, dataStartOffset);
+ z, len);
if ((Tcl_Write(out, buf, ZIP_CENTRAL_HEADER_LEN)
!= ZIP_CENTRAL_HEADER_LEN)
|| ((size_t) Tcl_Write(out, name, len) != len)) {
@@ -3230,7 +3239,7 @@ ZipFSMkZipOrImg(
Tcl_Flush(out);
suffixStartOffset = Tcl_Tell(out);
SerializeCentralDirectorySuffix(start, end, (unsigned char *) buf,
- count, dataStartOffset, directoryStartOffset, suffixStartOffset);
+ count, directoryStartOffset, suffixStartOffset);
if (Tcl_Write(out, buf, ZIP_CENTRAL_END_LEN) != ZIP_CENTRAL_END_LEN) {
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"write error: %s", Tcl_PosixError(interp)));
@@ -3387,9 +3396,7 @@ SerializeCentralDirectoryEntry(
const unsigned char *end, /* The end of writable memory. */
unsigned char *buf, /* Where to serialize to */
ZipEntry *z, /* The description of what to serialize. */
- size_t nameLength, /* The length of the name. */
- long long dataStartOffset) /* The overall file offset of the start of the
- * data section of the file. */
+ size_t nameLength) /* The length of the name. */
{
ZipWriteInt(start, end, buf + ZIP_CENTRAL_SIG_OFFS,
ZIP_CENTRAL_HEADER_SIG);
@@ -3414,7 +3421,7 @@ SerializeCentralDirectoryEntry(
ZipWriteShort(start, end, buf + ZIP_CENTRAL_IATTR_OFFS, 0);
ZipWriteInt(start, end, buf + ZIP_CENTRAL_EATTR_OFFS, 0);
ZipWriteInt(start, end, buf + ZIP_CENTRAL_LOCALHDR_OFFS,
- z->offset - dataStartOffset);
+ z->offset);
}
static void
@@ -3423,8 +3430,6 @@ SerializeCentralDirectorySuffix(
const unsigned char *end, /* The end of writable memory. */
unsigned char *buf, /* Where to serialize to */
int entryCount, /* The number of entries in the directory */
- long long dataStartOffset, /* The overall file offset of the start of the
- * data section of the file. */
long long directoryStartOffset,
/* The overall file offset of the start of the
* central directory. */
@@ -3441,7 +3446,7 @@ SerializeCentralDirectorySuffix(
ZipWriteInt(start, end, buf + ZIP_CENTRAL_DIRSIZE_OFFS,
suffixStartOffset - directoryStartOffset);
ZipWriteInt(start, end, buf + ZIP_CENTRAL_DIRSTART_OFFS,
- directoryStartOffset - dataStartOffset);
+ directoryStartOffset);
ZipWriteShort(start, end, buf + ZIP_CENTRAL_COMMENTLEN_OFFS, 0);
}
@@ -5797,7 +5802,7 @@ ZipfsMountExitHandler(
*-------------------------------------------------------------------------
*/
-int
+const char *
TclZipfs_AppHook(
#ifdef SUPPORT_BUILTIN_ZIP_INSTALL
int *argcPtr, /* Pointer to argc */
@@ -5811,6 +5816,7 @@ TclZipfs_AppHook(
#endif /* _WIN32 */
{
const char *archive;
+ const char *version = Tcl_InitSubsystems();
#ifdef _WIN32
Tcl_FindExecutable(NULL);
@@ -5853,7 +5859,7 @@ TclZipfs_AppHook(
Tcl_DecrRefCount(vfsInitScript);
if (found == TCL_OK) {
zipfs_literal_tcl_library = ZIPFS_APP_MOUNT "/tcl_library";
- return TCL_OK;
+ return version;
}
}
#ifdef SUPPORT_BUILTIN_ZIP_INSTALL
@@ -5886,7 +5892,7 @@ TclZipfs_AppHook(
if (Tcl_FSAccess(vfsInitScript, F_OK) == 0) {
Tcl_SetStartupScript(vfsInitScript, NULL);
}
- return TCL_OK;
+ return version;
} else if (!TclZipfs_Mount(NULL, ZIPFS_APP_MOUNT, archive, NULL)) {
int found;
Tcl_Obj *vfsInitScript;
@@ -5910,7 +5916,7 @@ TclZipfs_AppHook(
Tcl_DecrRefCount(vfsInitScript);
if (found == TCL_OK) {
zipfs_literal_tcl_library = ZIPFS_APP_MOUNT "/tcl_library";
- return TCL_OK;
+ return version;
}
}
#ifdef _WIN32
@@ -5918,7 +5924,7 @@ TclZipfs_AppHook(
#endif /* _WIN32 */
#endif /* SUPPORT_BUILTIN_ZIP_INSTALL */
}
- return TCL_OK;
+ return version;
}
#ifndef HAVE_ZLIB
diff --git a/generic/tclZlib.c b/generic/tclZlib.c
index 440bb9a..c9bc77f 100644
--- a/generic/tclZlib.c
+++ b/generic/tclZlib.c
@@ -1154,7 +1154,7 @@ Tcl_ZlibStreamSetCompressionDictionary(
ZlibStreamHandle *zshPtr = (ZlibStreamHandle *) zshandle;
if (compressionDictionaryObj && (NULL == TclGetBytesFromObj(NULL,
- compressionDictionaryObj, NULL))) {
+ compressionDictionaryObj, (int *)NULL))) {
/* Missing or invalid compression dictionary */
compressionDictionaryObj = NULL;
}
diff --git a/library/manifest.txt b/library/manifest.txt
index afd44cf..fdae645 100644
--- a/library/manifest.txt
+++ b/library/manifest.txt
@@ -10,7 +10,7 @@ apply {{dir} {
1 opt 0.4.8 {opt optparse.tcl}
0 cookiejar 0.2.0 {cookiejar cookiejar.tcl}
0 tcl::idna 1.0.1 {cookiejar idna.tcl}
- 0 platform 1.0.17 {platform platform.tcl}
+ 0 platform 1.0.18 {platform platform.tcl}
0 platform::shell 1.1.4 {platform shell.tcl}
1 tcltest 2.5.4 {tcltest tcltest.tcl}
} {
diff --git a/library/platform/pkgIndex.tcl b/library/platform/pkgIndex.tcl
index 7983831..de28fd1 100644
--- a/library/platform/pkgIndex.tcl
+++ b/library/platform/pkgIndex.tcl
@@ -1,3 +1,3 @@
-package ifneeded platform 1.0.17 [list source [file join $dir platform.tcl]]
+package ifneeded platform 1.0.18 [list source [file join $dir platform.tcl]]
package ifneeded platform::shell 1.1.4 [list source [file join $dir shell.tcl]]
diff --git a/library/platform/platform.tcl b/library/platform/platform.tcl
index e01334e..752f069 100644
--- a/library/platform/platform.tcl
+++ b/library/platform/platform.tcl
@@ -364,6 +364,17 @@ proc ::platform::patterns {id} {
foreach {major minor} [split $v .] break
set res {}
+ if {$major eq 12} {
+ # Add 12.0 to 12.minor to patterns.
+ for {set j $minor} {$j >= 0} {incr j -1} {
+ lappend res macosx${major}.${j}-${cpu}
+ foreach a $alt {
+ lappend res macosx${major}.${j}-$a
+ }
+ }
+ set major 11
+ set minor 5
+ }
if {$major eq 11} {
# Add 11.0 to 11.minor to patterns.
for {set j $minor} {$j >= 0} {incr j -1} {
@@ -409,7 +420,7 @@ proc ::platform::patterns {id} {
# ### ### ### ######### ######### #########
## Ready
-package provide platform 1.0.17
+package provide platform 1.0.18
# ### ### ### ######### ######### #########
## Demo application
diff --git a/library/tzdata/Africa/Accra b/library/tzdata/Africa/Accra
index 3f755f6..2c94214 100644
--- a/library/tzdata/Africa/Accra
+++ b/library/tzdata/Africa/Accra
@@ -1,66 +1,5 @@
# created by tools/tclZIC.tcl - do not edit
-
-set TZData(:Africa/Accra) {
- {-9223372036854775808 -52 0 LMT}
- {-1709337548 0 0 GMT}
- {-1581206400 1200 1 +0020}
- {-1577917200 0 0 GMT}
- {-1556834400 1200 1 +0020}
- {-1546294800 0 0 GMT}
- {-1525298400 1200 1 +0020}
- {-1514758800 0 0 GMT}
- {-1493762400 1200 1 +0020}
- {-1483222800 0 0 GMT}
- {-1462226400 1200 1 +0020}
- {-1451686800 0 0 GMT}
- {-1430604000 1200 1 +0020}
- {-1420064400 0 0 GMT}
- {-1399068000 1200 1 +0020}
- {-1388528400 0 0 GMT}
- {-1367532000 1200 1 +0020}
- {-1356992400 0 0 GMT}
- {-1335996000 1200 1 +0020}
- {-1325456400 0 0 GMT}
- {-1304373600 1200 1 +0020}
- {-1293834000 0 0 GMT}
- {-1272837600 1200 1 +0020}
- {-1262298000 0 0 GMT}
- {-1241301600 1200 1 +0020}
- {-1230762000 0 0 GMT}
- {-1209765600 1200 1 +0020}
- {-1199226000 0 0 GMT}
- {-1178143200 1200 1 +0020}
- {-1167603600 0 0 GMT}
- {-1146607200 1200 1 +0020}
- {-1136067600 0 0 GMT}
- {-1115071200 1200 1 +0020}
- {-1104531600 0 0 GMT}
- {-1083535200 1200 1 +0020}
- {-1072995600 0 0 GMT}
- {-1051912800 1200 1 +0020}
- {-1041373200 0 0 GMT}
- {-1020376800 1200 1 +0020}
- {-1009837200 0 0 GMT}
- {-988840800 1200 1 +0020}
- {-978301200 0 0 GMT}
- {-957304800 1200 1 +0020}
- {-946765200 0 0 GMT}
- {-936309600 1200 1 +0020}
- {-915142800 0 0 GMT}
- {-904773600 1200 1 +0020}
- {-883606800 0 0 GMT}
- {-880329600 1800 0 +0030}
- {-756952200 0 0 GMT}
- {-610149600 1800 1 +0030}
- {-599610600 0 0 GMT}
- {-578613600 1800 1 +0030}
- {-568074600 0 0 GMT}
- {-546991200 1800 1 +0030}
- {-536452200 0 0 GMT}
- {-515455200 1800 1 +0030}
- {-504916200 0 0 GMT}
- {-483919200 1800 1 +0030}
- {-473380200 0 0 GMT}
- {-452383200 1800 1 +0030}
- {-441844200 0 0 GMT}
+if {![info exists TZData(Africa/Abidjan)]} {
+ LoadTimeZoneFile Africa/Abidjan
}
+set TZData(:Africa/Accra) $TZData(:Africa/Abidjan)
diff --git a/library/tzdata/America/Anguilla b/library/tzdata/America/Anguilla
index 39a0d18..7d9c3a4 100644
--- a/library/tzdata/America/Anguilla
+++ b/library/tzdata/America/Anguilla
@@ -1,5 +1,5 @@
# created by tools/tclZIC.tcl - do not edit
-if {![info exists TZData(America/Port_of_Spain)]} {
- LoadTimeZoneFile America/Port_of_Spain
+if {![info exists TZData(America/Puerto_Rico)]} {
+ LoadTimeZoneFile America/Puerto_Rico
}
-set TZData(:America/Anguilla) $TZData(:America/Port_of_Spain)
+set TZData(:America/Anguilla) $TZData(:America/Puerto_Rico)
diff --git a/library/tzdata/America/Antigua b/library/tzdata/America/Antigua
index be0c88e..ec55c4c 100644
--- a/library/tzdata/America/Antigua
+++ b/library/tzdata/America/Antigua
@@ -1,5 +1,5 @@
# created by tools/tclZIC.tcl - do not edit
-if {![info exists TZData(America/Port_of_Spain)]} {
- LoadTimeZoneFile America/Port_of_Spain
+if {![info exists TZData(America/Puerto_Rico)]} {
+ LoadTimeZoneFile America/Puerto_Rico
}
-set TZData(:America/Antigua) $TZData(:America/Port_of_Spain)
+set TZData(:America/Antigua) $TZData(:America/Puerto_Rico)
diff --git a/library/tzdata/America/Aruba b/library/tzdata/America/Aruba
index e02d5fc..800032f 100644
--- a/library/tzdata/America/Aruba
+++ b/library/tzdata/America/Aruba
@@ -1,5 +1,5 @@
# created by tools/tclZIC.tcl - do not edit
-if {![info exists TZData(America/Curacao)]} {
- LoadTimeZoneFile America/Curacao
+if {![info exists TZData(America/Puerto_Rico)]} {
+ LoadTimeZoneFile America/Puerto_Rico
}
-set TZData(:America/Aruba) $TZData(:America/Curacao)
+set TZData(:America/Aruba) $TZData(:America/Puerto_Rico)
diff --git a/library/tzdata/America/Atikokan b/library/tzdata/America/Atikokan
index e72b04f..0f7e4dd 100644
--- a/library/tzdata/America/Atikokan
+++ b/library/tzdata/America/Atikokan
@@ -1,12 +1,5 @@
# created by tools/tclZIC.tcl - do not edit
-
-set TZData(:America/Atikokan) {
- {-9223372036854775808 -21988 0 LMT}
- {-2366733212 -21600 0 CST}
- {-1632067200 -18000 1 CDT}
- {-1615136400 -21600 0 CST}
- {-923248800 -18000 1 CDT}
- {-880214400 -18000 0 CWT}
- {-769395600 -18000 1 CPT}
- {-765388800 -18000 0 EST}
+if {![info exists TZData(America/Panama)]} {
+ LoadTimeZoneFile America/Panama
}
+set TZData(:America/Atikokan) $TZData(:America/Panama)
diff --git a/library/tzdata/America/Barbados b/library/tzdata/America/Barbados
index ea17073..f074683 100644
--- a/library/tzdata/America/Barbados
+++ b/library/tzdata/America/Barbados
@@ -2,8 +2,15 @@
set TZData(:America/Barbados) {
{-9223372036854775808 -14309 0 LMT}
- {-1451678491 -14309 0 BMT}
- {-1199217691 -14400 0 AST}
+ {-1841256091 -14400 0 AST}
+ {-874263600 -10800 1 ADT}
+ {-862682400 -14400 0 AST}
+ {-841604400 -10800 1 ADT}
+ {-830714400 -14400 0 AST}
+ {-820526400 -14400 0 -0330}
+ {-811882800 -12600 1 AST}
+ {-798660000 -14400 0 -0330}
+ {-788904000 -14400 0 AST}
{234943200 -10800 1 ADT}
{244616400 -14400 0 AST}
{261554400 -10800 1 ADT}
diff --git a/library/tzdata/America/Blanc-Sablon b/library/tzdata/America/Blanc-Sablon
index d5485e8..55db591 100644
--- a/library/tzdata/America/Blanc-Sablon
+++ b/library/tzdata/America/Blanc-Sablon
@@ -1,12 +1,5 @@
# created by tools/tclZIC.tcl - do not edit
-
-set TZData(:America/Blanc-Sablon) {
- {-9223372036854775808 -13708 0 LMT}
- {-2713896692 -14400 0 AST}
- {-1632074400 -10800 1 ADT}
- {-1615143600 -14400 0 AST}
- {-880221600 -10800 1 AWT}
- {-769395600 -10800 1 APT}
- {-765399600 -14400 0 AST}
- {14400 -14400 0 AST}
+if {![info exists TZData(America/Puerto_Rico)]} {
+ LoadTimeZoneFile America/Puerto_Rico
}
+set TZData(:America/Blanc-Sablon) $TZData(:America/Puerto_Rico)
diff --git a/library/tzdata/America/Coral_Harbour b/library/tzdata/America/Coral_Harbour
index a27dc03..c2406a7 100644
--- a/library/tzdata/America/Coral_Harbour
+++ b/library/tzdata/America/Coral_Harbour
@@ -1,5 +1,5 @@
# created by tools/tclZIC.tcl - do not edit
-if {![info exists TZData(America/Atikokan)]} {
- LoadTimeZoneFile America/Atikokan
+if {![info exists TZData(America/Panama)]} {
+ LoadTimeZoneFile America/Panama
}
-set TZData(:America/Coral_Harbour) $TZData(:America/Atikokan)
+set TZData(:America/Coral_Harbour) $TZData(:America/Panama)
diff --git a/library/tzdata/America/Creston b/library/tzdata/America/Creston
index 30369a9..14db678 100644
--- a/library/tzdata/America/Creston
+++ b/library/tzdata/America/Creston
@@ -1,8 +1,5 @@
# created by tools/tclZIC.tcl - do not edit
-
-set TZData(:America/Creston) {
- {-9223372036854775808 -27964 0 LMT}
- {-2713882436 -25200 0 MST}
- {-1680454800 -28800 0 PST}
- {-1627833600 -25200 0 MST}
+if {![info exists TZData(America/Phoenix)]} {
+ LoadTimeZoneFile America/Phoenix
}
+set TZData(:America/Creston) $TZData(:America/Phoenix)
diff --git a/library/tzdata/America/Curacao b/library/tzdata/America/Curacao
index 0a19090..ae31d2f 100644
--- a/library/tzdata/America/Curacao
+++ b/library/tzdata/America/Curacao
@@ -1,7 +1,5 @@
# created by tools/tclZIC.tcl - do not edit
-
-set TZData(:America/Curacao) {
- {-9223372036854775808 -16547 0 LMT}
- {-1826738653 -16200 0 -0430}
- {-157750200 -14400 0 AST}
+if {![info exists TZData(America/Puerto_Rico)]} {
+ LoadTimeZoneFile America/Puerto_Rico
}
+set TZData(:America/Curacao) $TZData(:America/Puerto_Rico)
diff --git a/library/tzdata/America/Dominica b/library/tzdata/America/Dominica
index b97cb0e..4589180 100644
--- a/library/tzdata/America/Dominica
+++ b/library/tzdata/America/Dominica
@@ -1,5 +1,5 @@
# created by tools/tclZIC.tcl - do not edit
-if {![info exists TZData(America/Port_of_Spain)]} {
- LoadTimeZoneFile America/Port_of_Spain
+if {![info exists TZData(America/Puerto_Rico)]} {
+ LoadTimeZoneFile America/Puerto_Rico
}
-set TZData(:America/Dominica) $TZData(:America/Port_of_Spain)
+set TZData(:America/Dominica) $TZData(:America/Puerto_Rico)
diff --git a/library/tzdata/America/Grenada b/library/tzdata/America/Grenada
index 92300c3..5aa98fd 100644
--- a/library/tzdata/America/Grenada
+++ b/library/tzdata/America/Grenada
@@ -1,5 +1,5 @@
# created by tools/tclZIC.tcl - do not edit
-if {![info exists TZData(America/Port_of_Spain)]} {
- LoadTimeZoneFile America/Port_of_Spain
+if {![info exists TZData(America/Puerto_Rico)]} {
+ LoadTimeZoneFile America/Puerto_Rico
}
-set TZData(:America/Grenada) $TZData(:America/Port_of_Spain)
+set TZData(:America/Grenada) $TZData(:America/Puerto_Rico)
diff --git a/library/tzdata/America/Guadeloupe b/library/tzdata/America/Guadeloupe
index aba6bd7..ac85e5a 100644
--- a/library/tzdata/America/Guadeloupe
+++ b/library/tzdata/America/Guadeloupe
@@ -1,5 +1,5 @@
# created by tools/tclZIC.tcl - do not edit
-if {![info exists TZData(America/Port_of_Spain)]} {
- LoadTimeZoneFile America/Port_of_Spain
+if {![info exists TZData(America/Puerto_Rico)]} {
+ LoadTimeZoneFile America/Puerto_Rico
}
-set TZData(:America/Guadeloupe) $TZData(:America/Port_of_Spain)
+set TZData(:America/Guadeloupe) $TZData(:America/Puerto_Rico)
diff --git a/library/tzdata/America/Guyana b/library/tzdata/America/Guyana
index fab7855..4e2b5f4 100644
--- a/library/tzdata/America/Guyana
+++ b/library/tzdata/America/Guyana
@@ -1,8 +1,9 @@
# created by tools/tclZIC.tcl - do not edit
set TZData(:America/Guyana) {
- {-9223372036854775808 -13960 0 LMT}
- {-1730578040 -13500 0 -0345}
- {176010300 -10800 0 -03}
- {662698800 -14400 0 -04}
+ {-9223372036854775808 -13959 0 LMT}
+ {-1843589241 -14400 0 -04}
+ {-1730577600 -13500 0 -0345}
+ {176096700 -10800 0 -03}
+ {701841600 -14400 0 -04}
}
diff --git a/library/tzdata/America/Kralendijk b/library/tzdata/America/Kralendijk
index 8b6db86..548dbd5 100644
--- a/library/tzdata/America/Kralendijk
+++ b/library/tzdata/America/Kralendijk
@@ -1,5 +1,5 @@
# created by tools/tclZIC.tcl - do not edit
-if {![info exists TZData(America/Curacao)]} {
- LoadTimeZoneFile America/Curacao
+if {![info exists TZData(America/Puerto_Rico)]} {
+ LoadTimeZoneFile America/Puerto_Rico
}
-set TZData(:America/Kralendijk) $TZData(:America/Curacao)
+set TZData(:America/Kralendijk) $TZData(:America/Puerto_Rico)
diff --git a/library/tzdata/America/Lower_Princes b/library/tzdata/America/Lower_Princes
index 94c9197..655da0e 100644
--- a/library/tzdata/America/Lower_Princes
+++ b/library/tzdata/America/Lower_Princes
@@ -1,5 +1,5 @@
# created by tools/tclZIC.tcl - do not edit
-if {![info exists TZData(America/Curacao)]} {
- LoadTimeZoneFile America/Curacao
+if {![info exists TZData(America/Puerto_Rico)]} {
+ LoadTimeZoneFile America/Puerto_Rico
}
-set TZData(:America/Lower_Princes) $TZData(:America/Curacao)
+set TZData(:America/Lower_Princes) $TZData(:America/Puerto_Rico)
diff --git a/library/tzdata/America/Marigot b/library/tzdata/America/Marigot
index c2b3873..9c77522 100644
--- a/library/tzdata/America/Marigot
+++ b/library/tzdata/America/Marigot
@@ -1,5 +1,5 @@
# created by tools/tclZIC.tcl - do not edit
-if {![info exists TZData(America/Port_of_Spain)]} {
- LoadTimeZoneFile America/Port_of_Spain
+if {![info exists TZData(America/Puerto_Rico)]} {
+ LoadTimeZoneFile America/Puerto_Rico
}
-set TZData(:America/Marigot) $TZData(:America/Port_of_Spain)
+set TZData(:America/Marigot) $TZData(:America/Puerto_Rico)
diff --git a/library/tzdata/America/Montserrat b/library/tzdata/America/Montserrat
index 0a656d3..9b76b44 100644
--- a/library/tzdata/America/Montserrat
+++ b/library/tzdata/America/Montserrat
@@ -1,5 +1,5 @@
# created by tools/tclZIC.tcl - do not edit
-if {![info exists TZData(America/Port_of_Spain)]} {
- LoadTimeZoneFile America/Port_of_Spain
+if {![info exists TZData(America/Puerto_Rico)]} {
+ LoadTimeZoneFile America/Puerto_Rico
}
-set TZData(:America/Montserrat) $TZData(:America/Port_of_Spain)
+set TZData(:America/Montserrat) $TZData(:America/Puerto_Rico)
diff --git a/library/tzdata/America/Nassau b/library/tzdata/America/Nassau
index 292c56d..ba49bd1 100644
--- a/library/tzdata/America/Nassau
+++ b/library/tzdata/America/Nassau
@@ -1,284 +1,5 @@
# created by tools/tclZIC.tcl - do not edit
-
-set TZData(:America/Nassau) {
- {-9223372036854775808 -18570 0 LMT}
- {-1825095030 -18000 0 EST}
- {-873140400 -14400 1 EWT}
- {-788904000 -18000 0 EST}
- {-786222000 -14400 1 EWT}
- {-769395600 -14400 1 EPT}
- {-763848000 -18000 0 EST}
- {-179341200 -14400 1 EDT}
- {-163620000 -18000 0 EST}
- {-147891600 -14400 1 EDT}
- {-131565600 -18000 0 EST}
- {-116442000 -14400 1 EDT}
- {-100116000 -18000 0 EST}
- {-84387600 -14400 1 EDT}
- {-68666400 -18000 0 EST}
- {-52938000 -14400 1 EDT}
- {-37216800 -18000 0 EST}
- {-21488400 -14400 1 EDT}
- {-5767200 -18000 0 EST}
- {9961200 -14400 1 EDT}
- {25682400 -18000 0 EST}
- {41410800 -14400 1 EDT}
- {57736800 -18000 0 EST}
- {73465200 -14400 1 EDT}
- {89186400 -18000 0 EST}
- {104914800 -14400 1 EDT}
- {120636000 -18000 0 EST}
- {136364400 -14400 1 EDT}
- {152085600 -18000 0 EST}
- {167814000 -14400 1 EDT}
- {183535200 -18000 0 EST}
- {189320400 -18000 0 EST}
- {199263600 -14400 1 EDT}
- {215589600 -18000 0 EST}
- {230713200 -14400 1 EDT}
- {247039200 -18000 0 EST}
- {262767600 -14400 1 EDT}
- {278488800 -18000 0 EST}
- {294217200 -14400 1 EDT}
- {309938400 -18000 0 EST}
- {325666800 -14400 1 EDT}
- {341388000 -18000 0 EST}
- {357116400 -14400 1 EDT}
- {372837600 -18000 0 EST}
- {388566000 -14400 1 EDT}
- {404892000 -18000 0 EST}
- {420015600 -14400 1 EDT}
- {436341600 -18000 0 EST}
- {452070000 -14400 1 EDT}
- {467791200 -18000 0 EST}
- {483519600 -14400 1 EDT}
- {499240800 -18000 0 EST}
- {514969200 -14400 1 EDT}
- {530690400 -18000 0 EST}
- {544604400 -14400 1 EDT}
- {562140000 -18000 0 EST}
- {576054000 -14400 1 EDT}
- {594194400 -18000 0 EST}
- {607503600 -14400 1 EDT}
- {625644000 -18000 0 EST}
- {638953200 -14400 1 EDT}
- {657093600 -18000 0 EST}
- {671007600 -14400 1 EDT}
- {688543200 -18000 0 EST}
- {702457200 -14400 1 EDT}
- {719992800 -18000 0 EST}
- {733906800 -14400 1 EDT}
- {752047200 -18000 0 EST}
- {765356400 -14400 1 EDT}
- {783496800 -18000 0 EST}
- {796806000 -14400 1 EDT}
- {814946400 -18000 0 EST}
- {828860400 -14400 1 EDT}
- {846396000 -18000 0 EST}
- {860310000 -14400 1 EDT}
- {877845600 -18000 0 EST}
- {891759600 -14400 1 EDT}
- {909295200 -18000 0 EST}
- {923209200 -14400 1 EDT}
- {941349600 -18000 0 EST}
- {954658800 -14400 1 EDT}
- {972799200 -18000 0 EST}
- {986108400 -14400 1 EDT}
- {1004248800 -18000 0 EST}
- {1018162800 -14400 1 EDT}
- {1035698400 -18000 0 EST}
- {1049612400 -14400 1 EDT}
- {1067148000 -18000 0 EST}
- {1081062000 -14400 1 EDT}
- {1099202400 -18000 0 EST}
- {1112511600 -14400 1 EDT}
- {1130652000 -18000 0 EST}
- {1143961200 -14400 1 EDT}
- {1162101600 -18000 0 EST}
- {1173596400 -14400 1 EDT}
- {1194156000 -18000 0 EST}
- {1205046000 -14400 1 EDT}
- {1225605600 -18000 0 EST}
- {1236495600 -14400 1 EDT}
- {1257055200 -18000 0 EST}
- {1268550000 -14400 1 EDT}
- {1289109600 -18000 0 EST}
- {1299999600 -14400 1 EDT}
- {1320559200 -18000 0 EST}
- {1331449200 -14400 1 EDT}
- {1352008800 -18000 0 EST}
- {1362898800 -14400 1 EDT}
- {1383458400 -18000 0 EST}
- {1394348400 -14400 1 EDT}
- {1414908000 -18000 0 EST}
- {1425798000 -14400 1 EDT}
- {1446357600 -18000 0 EST}
- {1457852400 -14400 1 EDT}
- {1478412000 -18000 0 EST}
- {1489302000 -14400 1 EDT}
- {1509861600 -18000 0 EST}
- {1520751600 -14400 1 EDT}
- {1541311200 -18000 0 EST}
- {1552201200 -14400 1 EDT}
- {1572760800 -18000 0 EST}
- {1583650800 -14400 1 EDT}
- {1604210400 -18000 0 EST}
- {1615705200 -14400 1 EDT}
- {1636264800 -18000 0 EST}
- {1647154800 -14400 1 EDT}
- {1667714400 -18000 0 EST}
- {1678604400 -14400 1 EDT}
- {1699164000 -18000 0 EST}
- {1710054000 -14400 1 EDT}
- {1730613600 -18000 0 EST}
- {1741503600 -14400 1 EDT}
- {1762063200 -18000 0 EST}
- {1772953200 -14400 1 EDT}
- {1793512800 -18000 0 EST}
- {1805007600 -14400 1 EDT}
- {1825567200 -18000 0 EST}
- {1836457200 -14400 1 EDT}
- {1857016800 -18000 0 EST}
- {1867906800 -14400 1 EDT}
- {1888466400 -18000 0 EST}
- {1899356400 -14400 1 EDT}
- {1919916000 -18000 0 EST}
- {1930806000 -14400 1 EDT}
- {1951365600 -18000 0 EST}
- {1962860400 -14400 1 EDT}
- {1983420000 -18000 0 EST}
- {1994310000 -14400 1 EDT}
- {2014869600 -18000 0 EST}
- {2025759600 -14400 1 EDT}
- {2046319200 -18000 0 EST}
- {2057209200 -14400 1 EDT}
- {2077768800 -18000 0 EST}
- {2088658800 -14400 1 EDT}
- {2109218400 -18000 0 EST}
- {2120108400 -14400 1 EDT}
- {2140668000 -18000 0 EST}
- {2152162800 -14400 1 EDT}
- {2172722400 -18000 0 EST}
- {2183612400 -14400 1 EDT}
- {2204172000 -18000 0 EST}
- {2215062000 -14400 1 EDT}
- {2235621600 -18000 0 EST}
- {2246511600 -14400 1 EDT}
- {2267071200 -18000 0 EST}
- {2277961200 -14400 1 EDT}
- {2298520800 -18000 0 EST}
- {2309410800 -14400 1 EDT}
- {2329970400 -18000 0 EST}
- {2341465200 -14400 1 EDT}
- {2362024800 -18000 0 EST}
- {2372914800 -14400 1 EDT}
- {2393474400 -18000 0 EST}
- {2404364400 -14400 1 EDT}
- {2424924000 -18000 0 EST}
- {2435814000 -14400 1 EDT}
- {2456373600 -18000 0 EST}
- {2467263600 -14400 1 EDT}
- {2487823200 -18000 0 EST}
- {2499318000 -14400 1 EDT}
- {2519877600 -18000 0 EST}
- {2530767600 -14400 1 EDT}
- {2551327200 -18000 0 EST}
- {2562217200 -14400 1 EDT}
- {2582776800 -18000 0 EST}
- {2593666800 -14400 1 EDT}
- {2614226400 -18000 0 EST}
- {2625116400 -14400 1 EDT}
- {2645676000 -18000 0 EST}
- {2656566000 -14400 1 EDT}
- {2677125600 -18000 0 EST}
- {2688620400 -14400 1 EDT}
- {2709180000 -18000 0 EST}
- {2720070000 -14400 1 EDT}
- {2740629600 -18000 0 EST}
- {2751519600 -14400 1 EDT}
- {2772079200 -18000 0 EST}
- {2782969200 -14400 1 EDT}
- {2803528800 -18000 0 EST}
- {2814418800 -14400 1 EDT}
- {2834978400 -18000 0 EST}
- {2846473200 -14400 1 EDT}
- {2867032800 -18000 0 EST}
- {2877922800 -14400 1 EDT}
- {2898482400 -18000 0 EST}
- {2909372400 -14400 1 EDT}
- {2929932000 -18000 0 EST}
- {2940822000 -14400 1 EDT}
- {2961381600 -18000 0 EST}
- {2972271600 -14400 1 EDT}
- {2992831200 -18000 0 EST}
- {3003721200 -14400 1 EDT}
- {3024280800 -18000 0 EST}
- {3035775600 -14400 1 EDT}
- {3056335200 -18000 0 EST}
- {3067225200 -14400 1 EDT}
- {3087784800 -18000 0 EST}
- {3098674800 -14400 1 EDT}
- {3119234400 -18000 0 EST}
- {3130124400 -14400 1 EDT}
- {3150684000 -18000 0 EST}
- {3161574000 -14400 1 EDT}
- {3182133600 -18000 0 EST}
- {3193023600 -14400 1 EDT}
- {3213583200 -18000 0 EST}
- {3225078000 -14400 1 EDT}
- {3245637600 -18000 0 EST}
- {3256527600 -14400 1 EDT}
- {3277087200 -18000 0 EST}
- {3287977200 -14400 1 EDT}
- {3308536800 -18000 0 EST}
- {3319426800 -14400 1 EDT}
- {3339986400 -18000 0 EST}
- {3350876400 -14400 1 EDT}
- {3371436000 -18000 0 EST}
- {3382930800 -14400 1 EDT}
- {3403490400 -18000 0 EST}
- {3414380400 -14400 1 EDT}
- {3434940000 -18000 0 EST}
- {3445830000 -14400 1 EDT}
- {3466389600 -18000 0 EST}
- {3477279600 -14400 1 EDT}
- {3497839200 -18000 0 EST}
- {3508729200 -14400 1 EDT}
- {3529288800 -18000 0 EST}
- {3540178800 -14400 1 EDT}
- {3560738400 -18000 0 EST}
- {3572233200 -14400 1 EDT}
- {3592792800 -18000 0 EST}
- {3603682800 -14400 1 EDT}
- {3624242400 -18000 0 EST}
- {3635132400 -14400 1 EDT}
- {3655692000 -18000 0 EST}
- {3666582000 -14400 1 EDT}
- {3687141600 -18000 0 EST}
- {3698031600 -14400 1 EDT}
- {3718591200 -18000 0 EST}
- {3730086000 -14400 1 EDT}
- {3750645600 -18000 0 EST}
- {3761535600 -14400 1 EDT}
- {3782095200 -18000 0 EST}
- {3792985200 -14400 1 EDT}
- {3813544800 -18000 0 EST}
- {3824434800 -14400 1 EDT}
- {3844994400 -18000 0 EST}
- {3855884400 -14400 1 EDT}
- {3876444000 -18000 0 EST}
- {3887334000 -14400 1 EDT}
- {3907893600 -18000 0 EST}
- {3919388400 -14400 1 EDT}
- {3939948000 -18000 0 EST}
- {3950838000 -14400 1 EDT}
- {3971397600 -18000 0 EST}
- {3982287600 -14400 1 EDT}
- {4002847200 -18000 0 EST}
- {4013737200 -14400 1 EDT}
- {4034296800 -18000 0 EST}
- {4045186800 -14400 1 EDT}
- {4065746400 -18000 0 EST}
- {4076636400 -14400 1 EDT}
- {4097196000 -18000 0 EST}
+if {![info exists TZData(America/Toronto)]} {
+ LoadTimeZoneFile America/Toronto
}
+set TZData(:America/Nassau) $TZData(:America/Toronto)
diff --git a/library/tzdata/America/Port_of_Spain b/library/tzdata/America/Port_of_Spain
index c360c87..5b41296 100644
--- a/library/tzdata/America/Port_of_Spain
+++ b/library/tzdata/America/Port_of_Spain
@@ -1,6 +1,5 @@
# created by tools/tclZIC.tcl - do not edit
-
-set TZData(:America/Port_of_Spain) {
- {-9223372036854775808 -14764 0 LMT}
- {-1825098836 -14400 0 AST}
+if {![info exists TZData(America/Puerto_Rico)]} {
+ LoadTimeZoneFile America/Puerto_Rico
}
+set TZData(:America/Port_of_Spain) $TZData(:America/Puerto_Rico)
diff --git a/library/tzdata/America/St_Barthelemy b/library/tzdata/America/St_Barthelemy
index 46bc287..1640d82 100644
--- a/library/tzdata/America/St_Barthelemy
+++ b/library/tzdata/America/St_Barthelemy
@@ -1,5 +1,5 @@
# created by tools/tclZIC.tcl - do not edit
-if {![info exists TZData(America/Port_of_Spain)]} {
- LoadTimeZoneFile America/Port_of_Spain
+if {![info exists TZData(America/Puerto_Rico)]} {
+ LoadTimeZoneFile America/Puerto_Rico
}
-set TZData(:America/St_Barthelemy) $TZData(:America/Port_of_Spain)
+set TZData(:America/St_Barthelemy) $TZData(:America/Puerto_Rico)
diff --git a/library/tzdata/America/St_Kitts b/library/tzdata/America/St_Kitts
index 6ad7f04..be7f15a 100644
--- a/library/tzdata/America/St_Kitts
+++ b/library/tzdata/America/St_Kitts
@@ -1,5 +1,5 @@
# created by tools/tclZIC.tcl - do not edit
-if {![info exists TZData(America/Port_of_Spain)]} {
- LoadTimeZoneFile America/Port_of_Spain
+if {![info exists TZData(America/Puerto_Rico)]} {
+ LoadTimeZoneFile America/Puerto_Rico
}
-set TZData(:America/St_Kitts) $TZData(:America/Port_of_Spain)
+set TZData(:America/St_Kitts) $TZData(:America/Puerto_Rico)
diff --git a/library/tzdata/America/St_Lucia b/library/tzdata/America/St_Lucia
index e479b31..ef43772 100644
--- a/library/tzdata/America/St_Lucia
+++ b/library/tzdata/America/St_Lucia
@@ -1,5 +1,5 @@
# created by tools/tclZIC.tcl - do not edit
-if {![info exists TZData(America/Port_of_Spain)]} {
- LoadTimeZoneFile America/Port_of_Spain
+if {![info exists TZData(America/Puerto_Rico)]} {
+ LoadTimeZoneFile America/Puerto_Rico
}
-set TZData(:America/St_Lucia) $TZData(:America/Port_of_Spain)
+set TZData(:America/St_Lucia) $TZData(:America/Puerto_Rico)
diff --git a/library/tzdata/America/St_Thomas b/library/tzdata/America/St_Thomas
index 24698b8..f705397 100644
--- a/library/tzdata/America/St_Thomas
+++ b/library/tzdata/America/St_Thomas
@@ -1,5 +1,5 @@
# created by tools/tclZIC.tcl - do not edit
-if {![info exists TZData(America/Port_of_Spain)]} {
- LoadTimeZoneFile America/Port_of_Spain
+if {![info exists TZData(America/Puerto_Rico)]} {
+ LoadTimeZoneFile America/Puerto_Rico
}
-set TZData(:America/St_Thomas) $TZData(:America/Port_of_Spain)
+set TZData(:America/St_Thomas) $TZData(:America/Puerto_Rico)
diff --git a/library/tzdata/America/St_Vincent b/library/tzdata/America/St_Vincent
index e3b32fb..289e483 100644
--- a/library/tzdata/America/St_Vincent
+++ b/library/tzdata/America/St_Vincent
@@ -1,5 +1,5 @@
# created by tools/tclZIC.tcl - do not edit
-if {![info exists TZData(America/Port_of_Spain)]} {
- LoadTimeZoneFile America/Port_of_Spain
+if {![info exists TZData(America/Puerto_Rico)]} {
+ LoadTimeZoneFile America/Puerto_Rico
}
-set TZData(:America/St_Vincent) $TZData(:America/Port_of_Spain)
+set TZData(:America/St_Vincent) $TZData(:America/Puerto_Rico)
diff --git a/library/tzdata/America/Tortola b/library/tzdata/America/Tortola
index aa6f655..71f75e2 100644
--- a/library/tzdata/America/Tortola
+++ b/library/tzdata/America/Tortola
@@ -1,5 +1,5 @@
# created by tools/tclZIC.tcl - do not edit
-if {![info exists TZData(America/Port_of_Spain)]} {
- LoadTimeZoneFile America/Port_of_Spain
+if {![info exists TZData(America/Puerto_Rico)]} {
+ LoadTimeZoneFile America/Puerto_Rico
}
-set TZData(:America/Tortola) $TZData(:America/Port_of_Spain)
+set TZData(:America/Tortola) $TZData(:America/Puerto_Rico)
diff --git a/library/tzdata/America/Virgin b/library/tzdata/America/Virgin
index c267e5b..a34eb12 100644
--- a/library/tzdata/America/Virgin
+++ b/library/tzdata/America/Virgin
@@ -1,5 +1,5 @@
# created by tools/tclZIC.tcl - do not edit
-if {![info exists TZData(America/Port_of_Spain)]} {
- LoadTimeZoneFile America/Port_of_Spain
+if {![info exists TZData(America/Puerto_Rico)]} {
+ LoadTimeZoneFile America/Puerto_Rico
}
-set TZData(:America/Virgin) $TZData(:America/Port_of_Spain)
+set TZData(:America/Virgin) $TZData(:America/Puerto_Rico)
diff --git a/library/tzdata/Antarctica/DumontDUrville b/library/tzdata/Antarctica/DumontDUrville
index f734aed..43c1263 100644
--- a/library/tzdata/Antarctica/DumontDUrville
+++ b/library/tzdata/Antarctica/DumontDUrville
@@ -1,8 +1,5 @@
# created by tools/tclZIC.tcl - do not edit
-
-set TZData(:Antarctica/DumontDUrville) {
- {-9223372036854775808 0 0 -00}
- {-725846400 36000 0 +10}
- {-566992800 0 0 -00}
- {-415497600 36000 0 +10}
+if {![info exists TZData(Pacific/Port_Moresby)]} {
+ LoadTimeZoneFile Pacific/Port_Moresby
}
+set TZData(:Antarctica/DumontDUrville) $TZData(:Pacific/Port_Moresby)
diff --git a/library/tzdata/Antarctica/Syowa b/library/tzdata/Antarctica/Syowa
index a44dd5c..87ffb62 100644
--- a/library/tzdata/Antarctica/Syowa
+++ b/library/tzdata/Antarctica/Syowa
@@ -1,6 +1,5 @@
# created by tools/tclZIC.tcl - do not edit
-
-set TZData(:Antarctica/Syowa) {
- {-9223372036854775808 0 0 -00}
- {-407808000 10800 0 +03}
+if {![info exists TZData(Asia/Riyadh)]} {
+ LoadTimeZoneFile Asia/Riyadh
}
+set TZData(:Antarctica/Syowa) $TZData(:Asia/Riyadh)
diff --git a/library/tzdata/Asia/Amman b/library/tzdata/Asia/Amman
index c2f6904..242a0c5 100644
--- a/library/tzdata/Asia/Amman
+++ b/library/tzdata/Asia/Amman
@@ -87,160 +87,160 @@ set TZData(:Asia/Amman) {
{1604008800 7200 0 EET}
{1616709600 10800 1 EEST}
{1635458400 7200 0 EET}
- {1648764000 10800 1 EEST}
+ {1645740000 10800 1 EEST}
{1666908000 7200 0 EET}
- {1680213600 10800 1 EEST}
+ {1677189600 10800 1 EEST}
{1698357600 7200 0 EET}
- {1711663200 10800 1 EEST}
+ {1709244000 10800 1 EEST}
{1729807200 7200 0 EET}
- {1743112800 10800 1 EEST}
+ {1740693600 10800 1 EEST}
{1761861600 7200 0 EET}
- {1774562400 10800 1 EEST}
+ {1772143200 10800 1 EEST}
{1793311200 7200 0 EET}
- {1806012000 10800 1 EEST}
+ {1803592800 10800 1 EEST}
{1824760800 7200 0 EET}
- {1838066400 10800 1 EEST}
+ {1835042400 10800 1 EEST}
{1856210400 7200 0 EET}
- {1869516000 10800 1 EEST}
+ {1866492000 10800 1 EEST}
{1887660000 7200 0 EET}
- {1900965600 10800 1 EEST}
+ {1898546400 10800 1 EEST}
{1919109600 7200 0 EET}
- {1932415200 10800 1 EEST}
+ {1929996000 10800 1 EEST}
{1951164000 7200 0 EET}
- {1963864800 10800 1 EEST}
+ {1961445600 10800 1 EEST}
{1982613600 7200 0 EET}
- {1995919200 10800 1 EEST}
+ {1992895200 10800 1 EEST}
{2014063200 7200 0 EET}
- {2027368800 10800 1 EEST}
+ {2024344800 10800 1 EEST}
{2045512800 7200 0 EET}
- {2058818400 10800 1 EEST}
+ {2055794400 10800 1 EEST}
{2076962400 7200 0 EET}
- {2090268000 10800 1 EEST}
+ {2087848800 10800 1 EEST}
{2109016800 7200 0 EET}
- {2121717600 10800 1 EEST}
+ {2119298400 10800 1 EEST}
{2140466400 7200 0 EET}
- {2153167200 10800 1 EEST}
+ {2150748000 10800 1 EEST}
{2171916000 7200 0 EET}
- {2185221600 10800 1 EEST}
+ {2182197600 10800 1 EEST}
{2203365600 7200 0 EET}
- {2216671200 10800 1 EEST}
+ {2213647200 10800 1 EEST}
{2234815200 7200 0 EET}
- {2248120800 10800 1 EEST}
+ {2245701600 10800 1 EEST}
{2266264800 7200 0 EET}
- {2279570400 10800 1 EEST}
+ {2277151200 10800 1 EEST}
{2298319200 7200 0 EET}
- {2311020000 10800 1 EEST}
+ {2308600800 10800 1 EEST}
{2329768800 7200 0 EET}
- {2343074400 10800 1 EEST}
+ {2340050400 10800 1 EEST}
{2361218400 7200 0 EET}
- {2374524000 10800 1 EEST}
+ {2371500000 10800 1 EEST}
{2392668000 7200 0 EET}
- {2405973600 10800 1 EEST}
+ {2402949600 10800 1 EEST}
{2424117600 7200 0 EET}
- {2437423200 10800 1 EEST}
+ {2435004000 10800 1 EEST}
{2455567200 7200 0 EET}
- {2468872800 10800 1 EEST}
+ {2466453600 10800 1 EEST}
{2487621600 7200 0 EET}
- {2500322400 10800 1 EEST}
+ {2497903200 10800 1 EEST}
{2519071200 7200 0 EET}
- {2532376800 10800 1 EEST}
+ {2529352800 10800 1 EEST}
{2550520800 7200 0 EET}
- {2563826400 10800 1 EEST}
+ {2560802400 10800 1 EEST}
{2581970400 7200 0 EET}
- {2595276000 10800 1 EEST}
+ {2592856800 10800 1 EEST}
{2613420000 7200 0 EET}
- {2626725600 10800 1 EEST}
+ {2624306400 10800 1 EEST}
{2645474400 7200 0 EET}
- {2658175200 10800 1 EEST}
+ {2655756000 10800 1 EEST}
{2676924000 7200 0 EET}
- {2689624800 10800 1 EEST}
+ {2687205600 10800 1 EEST}
{2708373600 7200 0 EET}
- {2721679200 10800 1 EEST}
+ {2718655200 10800 1 EEST}
{2739823200 7200 0 EET}
- {2753128800 10800 1 EEST}
+ {2750104800 10800 1 EEST}
{2771272800 7200 0 EET}
- {2784578400 10800 1 EEST}
+ {2782159200 10800 1 EEST}
{2802722400 7200 0 EET}
- {2816028000 10800 1 EEST}
+ {2813608800 10800 1 EEST}
{2834776800 7200 0 EET}
- {2847477600 10800 1 EEST}
+ {2845058400 10800 1 EEST}
{2866226400 7200 0 EET}
- {2879532000 10800 1 EEST}
+ {2876508000 10800 1 EEST}
{2897676000 7200 0 EET}
- {2910981600 10800 1 EEST}
+ {2907957600 10800 1 EEST}
{2929125600 7200 0 EET}
- {2942431200 10800 1 EEST}
+ {2939407200 10800 1 EEST}
{2960575200 7200 0 EET}
- {2973880800 10800 1 EEST}
+ {2971461600 10800 1 EEST}
{2992629600 7200 0 EET}
- {3005330400 10800 1 EEST}
+ {3002911200 10800 1 EEST}
{3024079200 7200 0 EET}
- {3036780000 10800 1 EEST}
+ {3034360800 10800 1 EEST}
{3055528800 7200 0 EET}
- {3068834400 10800 1 EEST}
+ {3065810400 10800 1 EEST}
{3086978400 7200 0 EET}
- {3100284000 10800 1 EEST}
+ {3097260000 10800 1 EEST}
{3118428000 7200 0 EET}
- {3131733600 10800 1 EEST}
+ {3129314400 10800 1 EEST}
{3149877600 7200 0 EET}
- {3163183200 10800 1 EEST}
+ {3160764000 10800 1 EEST}
{3181932000 7200 0 EET}
- {3194632800 10800 1 EEST}
+ {3192213600 10800 1 EEST}
{3213381600 7200 0 EET}
- {3226687200 10800 1 EEST}
+ {3223663200 10800 1 EEST}
{3244831200 7200 0 EET}
- {3258136800 10800 1 EEST}
+ {3255112800 10800 1 EEST}
{3276280800 7200 0 EET}
- {3289586400 10800 1 EEST}
+ {3286562400 10800 1 EEST}
{3307730400 7200 0 EET}
- {3321036000 10800 1 EEST}
+ {3318616800 10800 1 EEST}
{3339180000 7200 0 EET}
- {3352485600 10800 1 EEST}
+ {3350066400 10800 1 EEST}
{3371234400 7200 0 EET}
- {3383935200 10800 1 EEST}
+ {3381516000 10800 1 EEST}
{3402684000 7200 0 EET}
- {3415989600 10800 1 EEST}
+ {3412965600 10800 1 EEST}
{3434133600 7200 0 EET}
- {3447439200 10800 1 EEST}
+ {3444415200 10800 1 EEST}
{3465583200 7200 0 EET}
- {3478888800 10800 1 EEST}
+ {3476469600 10800 1 EEST}
{3497032800 7200 0 EET}
- {3510338400 10800 1 EEST}
+ {3507919200 10800 1 EEST}
{3529087200 7200 0 EET}
- {3541788000 10800 1 EEST}
+ {3539368800 10800 1 EEST}
{3560536800 7200 0 EET}
- {3573237600 10800 1 EEST}
+ {3570818400 10800 1 EEST}
{3591986400 7200 0 EET}
- {3605292000 10800 1 EEST}
+ {3602268000 10800 1 EEST}
{3623436000 7200 0 EET}
- {3636741600 10800 1 EEST}
+ {3633717600 10800 1 EEST}
{3654885600 7200 0 EET}
- {3668191200 10800 1 EEST}
+ {3665772000 10800 1 EEST}
{3686335200 7200 0 EET}
- {3699640800 10800 1 EEST}
+ {3697221600 10800 1 EEST}
{3718389600 7200 0 EET}
- {3731090400 10800 1 EEST}
+ {3728671200 10800 1 EEST}
{3749839200 7200 0 EET}
- {3763144800 10800 1 EEST}
+ {3760120800 10800 1 EEST}
{3781288800 7200 0 EET}
- {3794594400 10800 1 EEST}
+ {3791570400 10800 1 EEST}
{3812738400 7200 0 EET}
- {3826044000 10800 1 EEST}
+ {3823020000 10800 1 EEST}
{3844188000 7200 0 EET}
- {3857493600 10800 1 EEST}
+ {3855074400 10800 1 EEST}
{3876242400 7200 0 EET}
- {3888943200 10800 1 EEST}
+ {3886524000 10800 1 EEST}
{3907692000 7200 0 EET}
- {3920392800 10800 1 EEST}
+ {3917973600 10800 1 EEST}
{3939141600 7200 0 EET}
- {3952447200 10800 1 EEST}
+ {3949423200 10800 1 EEST}
{3970591200 7200 0 EET}
- {3983896800 10800 1 EEST}
+ {3980872800 10800 1 EEST}
{4002040800 7200 0 EET}
- {4015346400 10800 1 EEST}
+ {4012927200 10800 1 EEST}
{4033490400 7200 0 EET}
- {4046796000 10800 1 EEST}
+ {4044376800 10800 1 EEST}
{4065544800 7200 0 EET}
- {4078245600 10800 1 EEST}
+ {4075826400 10800 1 EEST}
{4096994400 7200 0 EET}
}
diff --git a/library/tzdata/Asia/Gaza b/library/tzdata/Asia/Gaza
index 95523c9..86282fa 100644
--- a/library/tzdata/Asia/Gaza
+++ b/library/tzdata/Asia/Gaza
@@ -124,161 +124,161 @@ set TZData(:Asia/Gaza) {
{1585346400 10800 1 EEST}
{1603490400 7200 0 EET}
{1616796000 10800 1 EEST}
- {1635544800 7200 0 EET}
+ {1635458400 7200 0 EET}
{1648245600 10800 1 EEST}
- {1666994400 7200 0 EET}
+ {1666908000 7200 0 EET}
{1679695200 10800 1 EEST}
- {1698444000 7200 0 EET}
+ {1698357600 7200 0 EET}
{1711749600 10800 1 EEST}
- {1729893600 7200 0 EET}
+ {1729807200 7200 0 EET}
{1743199200 10800 1 EEST}
- {1761343200 7200 0 EET}
+ {1761861600 7200 0 EET}
{1774648800 10800 1 EEST}
- {1792792800 7200 0 EET}
+ {1793311200 7200 0 EET}
{1806098400 10800 1 EEST}
- {1824847200 7200 0 EET}
+ {1824760800 7200 0 EET}
{1837548000 10800 1 EEST}
- {1856296800 7200 0 EET}
+ {1856210400 7200 0 EET}
{1868997600 10800 1 EEST}
- {1887746400 7200 0 EET}
+ {1887660000 7200 0 EET}
{1901052000 10800 1 EEST}
- {1919196000 7200 0 EET}
+ {1919109600 7200 0 EET}
{1932501600 10800 1 EEST}
- {1950645600 7200 0 EET}
+ {1951164000 7200 0 EET}
{1963951200 10800 1 EEST}
- {1982700000 7200 0 EET}
+ {1982613600 7200 0 EET}
{1995400800 10800 1 EEST}
- {2014149600 7200 0 EET}
+ {2014063200 7200 0 EET}
{2026850400 10800 1 EEST}
- {2045599200 7200 0 EET}
+ {2045512800 7200 0 EET}
{2058300000 10800 1 EEST}
- {2077048800 7200 0 EET}
+ {2076962400 7200 0 EET}
{2090354400 10800 1 EEST}
- {2108498400 7200 0 EET}
+ {2109016800 7200 0 EET}
{2121804000 10800 1 EEST}
- {2139948000 7200 0 EET}
+ {2140466400 7200 0 EET}
{2153253600 10800 1 EEST}
- {2172002400 7200 0 EET}
+ {2171916000 7200 0 EET}
{2184703200 10800 1 EEST}
- {2203452000 7200 0 EET}
+ {2203365600 7200 0 EET}
{2216152800 10800 1 EEST}
- {2234901600 7200 0 EET}
+ {2234815200 7200 0 EET}
{2248207200 10800 1 EEST}
- {2266351200 7200 0 EET}
+ {2266264800 7200 0 EET}
{2279656800 10800 1 EEST}
- {2297800800 7200 0 EET}
+ {2298319200 7200 0 EET}
{2311106400 10800 1 EEST}
- {2329250400 7200 0 EET}
+ {2329768800 7200 0 EET}
{2342556000 10800 1 EEST}
- {2361304800 7200 0 EET}
+ {2361218400 7200 0 EET}
{2374005600 10800 1 EEST}
- {2392754400 7200 0 EET}
+ {2392668000 7200 0 EET}
{2405455200 10800 1 EEST}
- {2424204000 7200 0 EET}
+ {2424117600 7200 0 EET}
{2437509600 10800 1 EEST}
- {2455653600 7200 0 EET}
+ {2455567200 7200 0 EET}
{2468959200 10800 1 EEST}
- {2487103200 7200 0 EET}
+ {2487621600 7200 0 EET}
{2500408800 10800 1 EEST}
- {2519157600 7200 0 EET}
+ {2519071200 7200 0 EET}
{2531858400 10800 1 EEST}
- {2550607200 7200 0 EET}
+ {2550520800 7200 0 EET}
{2563308000 10800 1 EEST}
- {2582056800 7200 0 EET}
+ {2581970400 7200 0 EET}
{2595362400 10800 1 EEST}
- {2613506400 7200 0 EET}
+ {2613420000 7200 0 EET}
{2626812000 10800 1 EEST}
- {2644956000 7200 0 EET}
+ {2645474400 7200 0 EET}
{2658261600 10800 1 EEST}
- {2676405600 7200 0 EET}
+ {2676924000 7200 0 EET}
{2689711200 10800 1 EEST}
- {2708460000 7200 0 EET}
+ {2708373600 7200 0 EET}
{2721160800 10800 1 EEST}
- {2739909600 7200 0 EET}
+ {2739823200 7200 0 EET}
{2752610400 10800 1 EEST}
- {2771359200 7200 0 EET}
+ {2771272800 7200 0 EET}
{2784664800 10800 1 EEST}
- {2802808800 7200 0 EET}
+ {2802722400 7200 0 EET}
{2816114400 10800 1 EEST}
- {2834258400 7200 0 EET}
+ {2834776800 7200 0 EET}
{2847564000 10800 1 EEST}
- {2866312800 7200 0 EET}
+ {2866226400 7200 0 EET}
{2879013600 10800 1 EEST}
- {2897762400 7200 0 EET}
+ {2897676000 7200 0 EET}
{2910463200 10800 1 EEST}
- {2929212000 7200 0 EET}
+ {2929125600 7200 0 EET}
{2941912800 10800 1 EEST}
- {2960661600 7200 0 EET}
+ {2960575200 7200 0 EET}
{2973967200 10800 1 EEST}
- {2992111200 7200 0 EET}
+ {2992629600 7200 0 EET}
{3005416800 10800 1 EEST}
- {3023560800 7200 0 EET}
+ {3024079200 7200 0 EET}
{3036866400 10800 1 EEST}
- {3055615200 7200 0 EET}
+ {3055528800 7200 0 EET}
{3068316000 10800 1 EEST}
- {3087064800 7200 0 EET}
+ {3086978400 7200 0 EET}
{3099765600 10800 1 EEST}
- {3118514400 7200 0 EET}
+ {3118428000 7200 0 EET}
{3131820000 10800 1 EEST}
- {3149964000 7200 0 EET}
+ {3149877600 7200 0 EET}
{3163269600 10800 1 EEST}
- {3181413600 7200 0 EET}
+ {3181932000 7200 0 EET}
{3194719200 10800 1 EEST}
- {3212863200 7200 0 EET}
+ {3213381600 7200 0 EET}
{3226168800 10800 1 EEST}
- {3244917600 7200 0 EET}
+ {3244831200 7200 0 EET}
{3257618400 10800 1 EEST}
- {3276367200 7200 0 EET}
+ {3276280800 7200 0 EET}
{3289068000 10800 1 EEST}
- {3307816800 7200 0 EET}
+ {3307730400 7200 0 EET}
{3321122400 10800 1 EEST}
- {3339266400 7200 0 EET}
+ {3339180000 7200 0 EET}
{3352572000 10800 1 EEST}
- {3370716000 7200 0 EET}
+ {3371234400 7200 0 EET}
{3384021600 10800 1 EEST}
- {3402770400 7200 0 EET}
+ {3402684000 7200 0 EET}
{3415471200 10800 1 EEST}
- {3434220000 7200 0 EET}
+ {3434133600 7200 0 EET}
{3446920800 10800 1 EEST}
- {3465669600 7200 0 EET}
+ {3465583200 7200 0 EET}
{3478975200 10800 1 EEST}
- {3497119200 7200 0 EET}
+ {3497032800 7200 0 EET}
{3510424800 10800 1 EEST}
- {3528568800 7200 0 EET}
+ {3529087200 7200 0 EET}
{3541874400 10800 1 EEST}
- {3560018400 7200 0 EET}
+ {3560536800 7200 0 EET}
{3573324000 10800 1 EEST}
- {3592072800 7200 0 EET}
+ {3591986400 7200 0 EET}
{3604773600 10800 1 EEST}
- {3623522400 7200 0 EET}
+ {3623436000 7200 0 EET}
{3636223200 10800 1 EEST}
- {3654972000 7200 0 EET}
+ {3654885600 7200 0 EET}
{3668277600 10800 1 EEST}
- {3686421600 7200 0 EET}
+ {3686335200 7200 0 EET}
{3699727200 10800 1 EEST}
- {3717871200 7200 0 EET}
+ {3718389600 7200 0 EET}
{3731176800 10800 1 EEST}
- {3749925600 7200 0 EET}
+ {3749839200 7200 0 EET}
{3762626400 10800 1 EEST}
- {3781375200 7200 0 EET}
+ {3781288800 7200 0 EET}
{3794076000 10800 1 EEST}
- {3812824800 7200 0 EET}
+ {3812738400 7200 0 EET}
{3825525600 10800 1 EEST}
- {3844274400 7200 0 EET}
+ {3844188000 7200 0 EET}
{3857580000 10800 1 EEST}
- {3875724000 7200 0 EET}
+ {3876242400 7200 0 EET}
{3889029600 10800 1 EEST}
- {3907173600 7200 0 EET}
+ {3907692000 7200 0 EET}
{3920479200 10800 1 EEST}
- {3939228000 7200 0 EET}
+ {3939141600 7200 0 EET}
{3951928800 10800 1 EEST}
- {3970677600 7200 0 EET}
+ {3970591200 7200 0 EET}
{3983378400 10800 1 EEST}
- {4002127200 7200 0 EET}
+ {4002040800 7200 0 EET}
{4015432800 10800 1 EEST}
- {4033576800 7200 0 EET}
+ {4033490400 7200 0 EET}
{4046882400 10800 1 EEST}
- {4065026400 7200 0 EET}
+ {4065544800 7200 0 EET}
{4078332000 10800 1 EEST}
- {4096476000 7200 0 EET}
+ {4096994400 7200 0 EET}
}
diff --git a/library/tzdata/Asia/Hebron b/library/tzdata/Asia/Hebron
index 3fdcd65..7559347 100644
--- a/library/tzdata/Asia/Hebron
+++ b/library/tzdata/Asia/Hebron
@@ -123,161 +123,161 @@ set TZData(:Asia/Hebron) {
{1585346400 10800 1 EEST}
{1603490400 7200 0 EET}
{1616796000 10800 1 EEST}
- {1635544800 7200 0 EET}
+ {1635458400 7200 0 EET}
{1648245600 10800 1 EEST}
- {1666994400 7200 0 EET}
+ {1666908000 7200 0 EET}
{1679695200 10800 1 EEST}
- {1698444000 7200 0 EET}
+ {1698357600 7200 0 EET}
{1711749600 10800 1 EEST}
- {1729893600 7200 0 EET}
+ {1729807200 7200 0 EET}
{1743199200 10800 1 EEST}
- {1761343200 7200 0 EET}
+ {1761861600 7200 0 EET}
{1774648800 10800 1 EEST}
- {1792792800 7200 0 EET}
+ {1793311200 7200 0 EET}
{1806098400 10800 1 EEST}
- {1824847200 7200 0 EET}
+ {1824760800 7200 0 EET}
{1837548000 10800 1 EEST}
- {1856296800 7200 0 EET}
+ {1856210400 7200 0 EET}
{1868997600 10800 1 EEST}
- {1887746400 7200 0 EET}
+ {1887660000 7200 0 EET}
{1901052000 10800 1 EEST}
- {1919196000 7200 0 EET}
+ {1919109600 7200 0 EET}
{1932501600 10800 1 EEST}
- {1950645600 7200 0 EET}
+ {1951164000 7200 0 EET}
{1963951200 10800 1 EEST}
- {1982700000 7200 0 EET}
+ {1982613600 7200 0 EET}
{1995400800 10800 1 EEST}
- {2014149600 7200 0 EET}
+ {2014063200 7200 0 EET}
{2026850400 10800 1 EEST}
- {2045599200 7200 0 EET}
+ {2045512800 7200 0 EET}
{2058300000 10800 1 EEST}
- {2077048800 7200 0 EET}
+ {2076962400 7200 0 EET}
{2090354400 10800 1 EEST}
- {2108498400 7200 0 EET}
+ {2109016800 7200 0 EET}
{2121804000 10800 1 EEST}
- {2139948000 7200 0 EET}
+ {2140466400 7200 0 EET}
{2153253600 10800 1 EEST}
- {2172002400 7200 0 EET}
+ {2171916000 7200 0 EET}
{2184703200 10800 1 EEST}
- {2203452000 7200 0 EET}
+ {2203365600 7200 0 EET}
{2216152800 10800 1 EEST}
- {2234901600 7200 0 EET}
+ {2234815200 7200 0 EET}
{2248207200 10800 1 EEST}
- {2266351200 7200 0 EET}
+ {2266264800 7200 0 EET}
{2279656800 10800 1 EEST}
- {2297800800 7200 0 EET}
+ {2298319200 7200 0 EET}
{2311106400 10800 1 EEST}
- {2329250400 7200 0 EET}
+ {2329768800 7200 0 EET}
{2342556000 10800 1 EEST}
- {2361304800 7200 0 EET}
+ {2361218400 7200 0 EET}
{2374005600 10800 1 EEST}
- {2392754400 7200 0 EET}
+ {2392668000 7200 0 EET}
{2405455200 10800 1 EEST}
- {2424204000 7200 0 EET}
+ {2424117600 7200 0 EET}
{2437509600 10800 1 EEST}
- {2455653600 7200 0 EET}
+ {2455567200 7200 0 EET}
{2468959200 10800 1 EEST}
- {2487103200 7200 0 EET}
+ {2487621600 7200 0 EET}
{2500408800 10800 1 EEST}
- {2519157600 7200 0 EET}
+ {2519071200 7200 0 EET}
{2531858400 10800 1 EEST}
- {2550607200 7200 0 EET}
+ {2550520800 7200 0 EET}
{2563308000 10800 1 EEST}
- {2582056800 7200 0 EET}
+ {2581970400 7200 0 EET}
{2595362400 10800 1 EEST}
- {2613506400 7200 0 EET}
+ {2613420000 7200 0 EET}
{2626812000 10800 1 EEST}
- {2644956000 7200 0 EET}
+ {2645474400 7200 0 EET}
{2658261600 10800 1 EEST}
- {2676405600 7200 0 EET}
+ {2676924000 7200 0 EET}
{2689711200 10800 1 EEST}
- {2708460000 7200 0 EET}
+ {2708373600 7200 0 EET}
{2721160800 10800 1 EEST}
- {2739909600 7200 0 EET}
+ {2739823200 7200 0 EET}
{2752610400 10800 1 EEST}
- {2771359200 7200 0 EET}
+ {2771272800 7200 0 EET}
{2784664800 10800 1 EEST}
- {2802808800 7200 0 EET}
+ {2802722400 7200 0 EET}
{2816114400 10800 1 EEST}
- {2834258400 7200 0 EET}
+ {2834776800 7200 0 EET}
{2847564000 10800 1 EEST}
- {2866312800 7200 0 EET}
+ {2866226400 7200 0 EET}
{2879013600 10800 1 EEST}
- {2897762400 7200 0 EET}
+ {2897676000 7200 0 EET}
{2910463200 10800 1 EEST}
- {2929212000 7200 0 EET}
+ {2929125600 7200 0 EET}
{2941912800 10800 1 EEST}
- {2960661600 7200 0 EET}
+ {2960575200 7200 0 EET}
{2973967200 10800 1 EEST}
- {2992111200 7200 0 EET}
+ {2992629600 7200 0 EET}
{3005416800 10800 1 EEST}
- {3023560800 7200 0 EET}
+ {3024079200 7200 0 EET}
{3036866400 10800 1 EEST}
- {3055615200 7200 0 EET}
+ {3055528800 7200 0 EET}
{3068316000 10800 1 EEST}
- {3087064800 7200 0 EET}
+ {3086978400 7200 0 EET}
{3099765600 10800 1 EEST}
- {3118514400 7200 0 EET}
+ {3118428000 7200 0 EET}
{3131820000 10800 1 EEST}
- {3149964000 7200 0 EET}
+ {3149877600 7200 0 EET}
{3163269600 10800 1 EEST}
- {3181413600 7200 0 EET}
+ {3181932000 7200 0 EET}
{3194719200 10800 1 EEST}
- {3212863200 7200 0 EET}
+ {3213381600 7200 0 EET}
{3226168800 10800 1 EEST}
- {3244917600 7200 0 EET}
+ {3244831200 7200 0 EET}
{3257618400 10800 1 EEST}
- {3276367200 7200 0 EET}
+ {3276280800 7200 0 EET}
{3289068000 10800 1 EEST}
- {3307816800 7200 0 EET}
+ {3307730400 7200 0 EET}
{3321122400 10800 1 EEST}
- {3339266400 7200 0 EET}
+ {3339180000 7200 0 EET}
{3352572000 10800 1 EEST}
- {3370716000 7200 0 EET}
+ {3371234400 7200 0 EET}
{3384021600 10800 1 EEST}
- {3402770400 7200 0 EET}
+ {3402684000 7200 0 EET}
{3415471200 10800 1 EEST}
- {3434220000 7200 0 EET}
+ {3434133600 7200 0 EET}
{3446920800 10800 1 EEST}
- {3465669600 7200 0 EET}
+ {3465583200 7200 0 EET}
{3478975200 10800 1 EEST}
- {3497119200 7200 0 EET}
+ {3497032800 7200 0 EET}
{3510424800 10800 1 EEST}
- {3528568800 7200 0 EET}
+ {3529087200 7200 0 EET}
{3541874400 10800 1 EEST}
- {3560018400 7200 0 EET}
+ {3560536800 7200 0 EET}
{3573324000 10800 1 EEST}
- {3592072800 7200 0 EET}
+ {3591986400 7200 0 EET}
{3604773600 10800 1 EEST}
- {3623522400 7200 0 EET}
+ {3623436000 7200 0 EET}
{3636223200 10800 1 EEST}
- {3654972000 7200 0 EET}
+ {3654885600 7200 0 EET}
{3668277600 10800 1 EEST}
- {3686421600 7200 0 EET}
+ {3686335200 7200 0 EET}
{3699727200 10800 1 EEST}
- {3717871200 7200 0 EET}
+ {3718389600 7200 0 EET}
{3731176800 10800 1 EEST}
- {3749925600 7200 0 EET}
+ {3749839200 7200 0 EET}
{3762626400 10800 1 EEST}
- {3781375200 7200 0 EET}
+ {3781288800 7200 0 EET}
{3794076000 10800 1 EEST}
- {3812824800 7200 0 EET}
+ {3812738400 7200 0 EET}
{3825525600 10800 1 EEST}
- {3844274400 7200 0 EET}
+ {3844188000 7200 0 EET}
{3857580000 10800 1 EEST}
- {3875724000 7200 0 EET}
+ {3876242400 7200 0 EET}
{3889029600 10800 1 EEST}
- {3907173600 7200 0 EET}
+ {3907692000 7200 0 EET}
{3920479200 10800 1 EEST}
- {3939228000 7200 0 EET}
+ {3939141600 7200 0 EET}
{3951928800 10800 1 EEST}
- {3970677600 7200 0 EET}
+ {3970591200 7200 0 EET}
{3983378400 10800 1 EEST}
- {4002127200 7200 0 EET}
+ {4002040800 7200 0 EET}
{4015432800 10800 1 EEST}
- {4033576800 7200 0 EET}
+ {4033490400 7200 0 EET}
{4046882400 10800 1 EEST}
- {4065026400 7200 0 EET}
+ {4065544800 7200 0 EET}
{4078332000 10800 1 EEST}
- {4096476000 7200 0 EET}
+ {4096994400 7200 0 EET}
}
diff --git a/library/tzdata/Atlantic/Azores b/library/tzdata/Atlantic/Azores
index 088dd9a..0b7f615 100644
--- a/library/tzdata/Atlantic/Azores
+++ b/library/tzdata/Atlantic/Azores
@@ -66,6 +66,8 @@ set TZData(:Atlantic/Azores) {
{-670449600 -7200 0 -02}
{-654724800 -3600 1 -01}
{-639000000 -7200 0 -02}
+ {-623275200 -3600 1 -01}
+ {-607550400 -7200 0 -02}
{-591825600 -3600 1 -01}
{-575496000 -7200 0 -02}
{-559771200 -3600 1 -01}
diff --git a/library/tzdata/Atlantic/Madeira b/library/tzdata/Atlantic/Madeira
index fed9c19..8a3b7e8 100644
--- a/library/tzdata/Atlantic/Madeira
+++ b/library/tzdata/Atlantic/Madeira
@@ -66,6 +66,8 @@ set TZData(:Atlantic/Madeira) {
{-670453200 -3600 0 -01}
{-654728400 0 1 +00}
{-639003600 -3600 0 -01}
+ {-623278800 0 1 +00}
+ {-607554000 -3600 0 -01}
{-591829200 0 1 +00}
{-575499600 -3600 0 -01}
{-559774800 0 1 +00}
diff --git a/library/tzdata/Europe/Lisbon b/library/tzdata/Europe/Lisbon
index b566b51..b6a069e 100644
--- a/library/tzdata/Europe/Lisbon
+++ b/library/tzdata/Europe/Lisbon
@@ -70,6 +70,8 @@ set TZData(:Europe/Lisbon) {
{-670456800 0 0 WET}
{-654732000 3600 1 WEST}
{-639007200 0 0 WET}
+ {-623282400 3600 1 WEST}
+ {-607557600 0 0 WET}
{-591832800 3600 1 WEST}
{-575503200 0 0 WET}
{-559778400 3600 1 WEST}
diff --git a/library/tzdata/Pacific/Apia b/library/tzdata/Pacific/Apia
index 4fc91f4..783a71b 100644
--- a/library/tzdata/Pacific/Apia
+++ b/library/tzdata/Pacific/Apia
@@ -28,161 +28,4 @@ set TZData(:Pacific/Apia) {
{1586008800 46800 0 +13}
{1601128800 50400 1 +13}
{1617458400 46800 0 +13}
- {1632578400 50400 1 +13}
- {1648908000 46800 0 +13}
- {1664028000 50400 1 +13}
- {1680357600 46800 0 +13}
- {1695477600 50400 1 +13}
- {1712412000 46800 0 +13}
- {1727532000 50400 1 +13}
- {1743861600 46800 0 +13}
- {1758981600 50400 1 +13}
- {1775311200 46800 0 +13}
- {1790431200 50400 1 +13}
- {1806760800 46800 0 +13}
- {1821880800 50400 1 +13}
- {1838210400 46800 0 +13}
- {1853330400 50400 1 +13}
- {1869660000 46800 0 +13}
- {1885384800 50400 1 +13}
- {1901714400 46800 0 +13}
- {1916834400 50400 1 +13}
- {1933164000 46800 0 +13}
- {1948284000 50400 1 +13}
- {1964613600 46800 0 +13}
- {1979733600 50400 1 +13}
- {1996063200 46800 0 +13}
- {2011183200 50400 1 +13}
- {2027512800 46800 0 +13}
- {2042632800 50400 1 +13}
- {2058962400 46800 0 +13}
- {2074687200 50400 1 +13}
- {2091016800 46800 0 +13}
- {2106136800 50400 1 +13}
- {2122466400 46800 0 +13}
- {2137586400 50400 1 +13}
- {2153916000 46800 0 +13}
- {2169036000 50400 1 +13}
- {2185365600 46800 0 +13}
- {2200485600 50400 1 +13}
- {2216815200 46800 0 +13}
- {2232540000 50400 1 +13}
- {2248869600 46800 0 +13}
- {2263989600 50400 1 +13}
- {2280319200 46800 0 +13}
- {2295439200 50400 1 +13}
- {2311768800 46800 0 +13}
- {2326888800 50400 1 +13}
- {2343218400 46800 0 +13}
- {2358338400 50400 1 +13}
- {2374668000 46800 0 +13}
- {2389788000 50400 1 +13}
- {2406117600 46800 0 +13}
- {2421842400 50400 1 +13}
- {2438172000 46800 0 +13}
- {2453292000 50400 1 +13}
- {2469621600 46800 0 +13}
- {2484741600 50400 1 +13}
- {2501071200 46800 0 +13}
- {2516191200 50400 1 +13}
- {2532520800 46800 0 +13}
- {2547640800 50400 1 +13}
- {2563970400 46800 0 +13}
- {2579090400 50400 1 +13}
- {2596024800 46800 0 +13}
- {2611144800 50400 1 +13}
- {2627474400 46800 0 +13}
- {2642594400 50400 1 +13}
- {2658924000 46800 0 +13}
- {2674044000 50400 1 +13}
- {2690373600 46800 0 +13}
- {2705493600 50400 1 +13}
- {2721823200 46800 0 +13}
- {2736943200 50400 1 +13}
- {2753272800 46800 0 +13}
- {2768997600 50400 1 +13}
- {2785327200 46800 0 +13}
- {2800447200 50400 1 +13}
- {2816776800 46800 0 +13}
- {2831896800 50400 1 +13}
- {2848226400 46800 0 +13}
- {2863346400 50400 1 +13}
- {2879676000 46800 0 +13}
- {2894796000 50400 1 +13}
- {2911125600 46800 0 +13}
- {2926245600 50400 1 +13}
- {2942575200 46800 0 +13}
- {2958300000 50400 1 +13}
- {2974629600 46800 0 +13}
- {2989749600 50400 1 +13}
- {3006079200 46800 0 +13}
- {3021199200 50400 1 +13}
- {3037528800 46800 0 +13}
- {3052648800 50400 1 +13}
- {3068978400 46800 0 +13}
- {3084098400 50400 1 +13}
- {3100428000 46800 0 +13}
- {3116152800 50400 1 +13}
- {3132482400 46800 0 +13}
- {3147602400 50400 1 +13}
- {3163932000 46800 0 +13}
- {3179052000 50400 1 +13}
- {3195381600 46800 0 +13}
- {3210501600 50400 1 +13}
- {3226831200 46800 0 +13}
- {3241951200 50400 1 +13}
- {3258280800 46800 0 +13}
- {3273400800 50400 1 +13}
- {3289730400 46800 0 +13}
- {3305455200 50400 1 +13}
- {3321784800 46800 0 +13}
- {3336904800 50400 1 +13}
- {3353234400 46800 0 +13}
- {3368354400 50400 1 +13}
- {3384684000 46800 0 +13}
- {3399804000 50400 1 +13}
- {3416133600 46800 0 +13}
- {3431253600 50400 1 +13}
- {3447583200 46800 0 +13}
- {3462703200 50400 1 +13}
- {3479637600 46800 0 +13}
- {3494757600 50400 1 +13}
- {3511087200 46800 0 +13}
- {3526207200 50400 1 +13}
- {3542536800 46800 0 +13}
- {3557656800 50400 1 +13}
- {3573986400 46800 0 +13}
- {3589106400 50400 1 +13}
- {3605436000 46800 0 +13}
- {3620556000 50400 1 +13}
- {3636885600 46800 0 +13}
- {3652610400 50400 1 +13}
- {3668940000 46800 0 +13}
- {3684060000 50400 1 +13}
- {3700389600 46800 0 +13}
- {3715509600 50400 1 +13}
- {3731839200 46800 0 +13}
- {3746959200 50400 1 +13}
- {3763288800 46800 0 +13}
- {3778408800 50400 1 +13}
- {3794738400 46800 0 +13}
- {3809858400 50400 1 +13}
- {3826188000 46800 0 +13}
- {3841912800 50400 1 +13}
- {3858242400 46800 0 +13}
- {3873362400 50400 1 +13}
- {3889692000 46800 0 +13}
- {3904812000 50400 1 +13}
- {3921141600 46800 0 +13}
- {3936261600 50400 1 +13}
- {3952591200 46800 0 +13}
- {3967711200 50400 1 +13}
- {3984040800 46800 0 +13}
- {3999765600 50400 1 +13}
- {4016095200 46800 0 +13}
- {4031215200 50400 1 +13}
- {4047544800 46800 0 +13}
- {4062664800 50400 1 +13}
- {4078994400 46800 0 +13}
- {4094114400 50400 1 +13}
}
diff --git a/library/tzdata/Pacific/Enderbury b/library/tzdata/Pacific/Enderbury
index 48eaafe..5c4c6d7 100644
--- a/library/tzdata/Pacific/Enderbury
+++ b/library/tzdata/Pacific/Enderbury
@@ -1,8 +1,5 @@
# created by tools/tclZIC.tcl - do not edit
-
-set TZData(:Pacific/Enderbury) {
- {-9223372036854775808 -41060 0 LMT}
- {-2177411740 -43200 0 -12}
- {307627200 -39600 0 -11}
- {788871600 46800 0 +13}
+if {![info exists TZData(Pacific/Kanton)]} {
+ LoadTimeZoneFile Pacific/Kanton
}
+set TZData(:Pacific/Enderbury) $TZData(:Pacific/Kanton)
diff --git a/library/tzdata/Pacific/Fiji b/library/tzdata/Pacific/Fiji
index a062913..67a1f00 100644
--- a/library/tzdata/Pacific/Fiji
+++ b/library/tzdata/Pacific/Fiji
@@ -31,8 +31,6 @@ set TZData(:Pacific/Fiji) {
{1578751200 43200 0 +12}
{1608386400 46800 1 +12}
{1610805600 43200 0 +12}
- {1636812000 46800 1 +12}
- {1642255200 43200 0 +12}
{1668261600 46800 1 +12}
{1673704800 43200 0 +12}
{1699711200 46800 1 +12}
diff --git a/library/tzdata/Pacific/Kanton b/library/tzdata/Pacific/Kanton
new file mode 100644
index 0000000..061c2b5
--- /dev/null
+++ b/library/tzdata/Pacific/Kanton
@@ -0,0 +1,8 @@
+# created by tools/tclZIC.tcl - do not edit
+
+set TZData(:Pacific/Kanton) {
+ {-9223372036854775808 0 0 -00}
+ {-1020470400 -43200 0 -12}
+ {307627200 -39600 0 -11}
+ {788871600 46800 0 +13}
+}
diff --git a/library/tzdata/Pacific/Niue b/library/tzdata/Pacific/Niue
index fe19c59..752f5b7 100644
--- a/library/tzdata/Pacific/Niue
+++ b/library/tzdata/Pacific/Niue
@@ -2,7 +2,6 @@
set TZData(:Pacific/Niue) {
{-9223372036854775808 -40780 0 LMT}
- {-2177412020 -40800 0 -1120}
- {-599575200 -41400 0 -1130}
- {276089400 -39600 0 -11}
+ {-543069620 -40800 0 -1120}
+ {-173623200 -39600 0 -11}
}
diff --git a/library/tzdata/Pacific/Rarotonga b/library/tzdata/Pacific/Rarotonga
index 2913d68..f8e7954 100644
--- a/library/tzdata/Pacific/Rarotonga
+++ b/library/tzdata/Pacific/Rarotonga
@@ -1,8 +1,9 @@
# created by tools/tclZIC.tcl - do not edit
set TZData(:Pacific/Rarotonga) {
- {-9223372036854775808 -38344 0 LMT}
- {-2177414456 -37800 0 -1030}
+ {-9223372036854775808 48056 0 LMT}
+ {-2209555256 -38344 0 LMT}
+ {-543072056 -37800 0 -1030}
{279714600 -34200 0 -10}
{289387800 -36000 0 -10}
{309952800 -34200 1 -10}
diff --git a/library/tzdata/Pacific/Tongatapu b/library/tzdata/Pacific/Tongatapu
index 104888a..f4bb685 100644
--- a/library/tzdata/Pacific/Tongatapu
+++ b/library/tzdata/Pacific/Tongatapu
@@ -1,9 +1,9 @@
# created by tools/tclZIC.tcl - do not edit
set TZData(:Pacific/Tongatapu) {
- {-9223372036854775808 44360 0 LMT}
- {-2177497160 44400 0 +1220}
- {-915193200 46800 0 +13}
+ {-9223372036854775808 44352 0 LMT}
+ {-767189952 44400 0 +1220}
+ {-284041200 46800 0 +13}
{915102000 46800 0 +13}
{939214800 50400 1 +13}
{953384400 46800 0 +13}
diff --git a/macosx/tclMacOSXFCmd.c b/macosx/tclMacOSXFCmd.c
index a70a789..1717c3c 100644
--- a/macosx/tclMacOSXFCmd.c
+++ b/macosx/tclMacOSXFCmd.c
@@ -577,7 +577,7 @@ GetOSTypeFromObj(
{
int result = TCL_OK;
- if (!TclHasIntRep(objPtr, &tclOSTypeType)) {
+ if (!TclHasInternalRep(objPtr, &tclOSTypeType)) {
result = SetOSTypeFromAny(interp, objPtr);
}
*osTypePtr = (OSType) objPtr->internalRep.wideValue;
@@ -659,7 +659,7 @@ SetOSTypeFromAny(
(OSType) bytes[1] << 16 |
(OSType) bytes[2] << 8 |
(OSType) bytes[3];
- TclFreeIntRep(objPtr);
+ TclFreeInternalRep(objPtr);
objPtr->internalRep.wideValue = (Tcl_WideInt) osType;
objPtr->typePtr = &tclOSTypeType;
}
diff --git a/tests/async.test b/tests/async.test
index 2d8f678..49a00ff 100644
--- a/tests/async.test
+++ b/tests/async.test
@@ -21,7 +21,7 @@ catch [list package require -exact tcl::test [info patchlevel]]
testConstraint thread [expr {0 == [catch {package require Thread 2.7-}]}]
testConstraint testasync [llength [info commands testasync]]
-testConstraint knownMsvcBug [expr {![info exists ::env(CI_BUILD_WITH_MSVC)]}]
+testConstraint knownMsvcBug [string match msvc-* [tcl::build-info compiler]]
proc async1 {result code} {
global aresult acode
diff --git a/tests/cmdIL.test b/tests/cmdIL.test
index 063750c..5a68925 100644
--- a/tests/cmdIL.test
+++ b/tests/cmdIL.test
@@ -776,7 +776,7 @@ test cmdIL-7.6 {lreverse command - unshared object [Bug 1672585]} {
test cmdIL-7.7 {lreverse command - empty object [Bug 1876793]} {
lreverse [list]
} {}
-test cmdIL-7.8 {lreverse command - shared intrep [Bug 1675044]} -setup {
+test cmdIL-7.8 {lreverse command - shared internalrep [Bug 1675044]} -setup {
teststringobj set 1 {1 2 3}
testobj convert 1 list
testobj duplicate 1 2
diff --git a/tests/compile.test b/tests/compile.test
index 31af2e2..9959da4 100644
--- a/tests/compile.test
+++ b/tests/compile.test
@@ -500,7 +500,7 @@ test compile-13.2 {TclCompileScript: testing expected nested scripts compilation
# with 1500 (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] ? 1500 : 1000}] $cmd]
+ set c [gencode [expr {[tcl::build-info debug] ? 1500 : 1000}] $cmd]
if 1 $c
}}
ti eval {set result}
diff --git a/tests/config.test b/tests/config.test
index 2d8b593..50f03ce 100644
--- a/tests/config.test
+++ b/tests/config.test
@@ -19,7 +19,7 @@ if {"::tcltest" ni [namespace children]} {
test pkgconfig-1.1 {query keys} -body {
lsort [::tcl::pkgconfig list]
-} -match glob -result {64bit bindir,install bindir,runtime compile_debug compile_stats debug*docdir,install docdir,runtime includedir,install includedir,runtime libdir,install libdir,runtime mem_debug optimized profiled scriptdir,install scriptdir,runtime threaded}
+} -match glob -result {*bindir,install bindir,runtime*docdir,install docdir,runtime includedir,install includedir,runtime libdir,install libdir,runtime*scriptdir,install scriptdir,runtime*}
test pkgconfig-1.2 {query keys multiple times} {
string compare [::tcl::pkgconfig list] [::tcl::pkgconfig list]
} 0
diff --git a/tests/encoding.test b/tests/encoding.test
index 25d0827..c6f4e02 100644
--- a/tests/encoding.test
+++ b/tests/encoding.test
@@ -287,6 +287,12 @@ test encoding-11.8 {encoding: extended Unicode UTF-16} {
test encoding-11.9 {encoding: extended Unicode UTF-16} {
viewable [encoding convertto utf-16be 😹]
} {Ø=Þ9 (\u00D8=\u00DE9)}
+test encoding-11.10 {encoding: extended Unicode UTF-32} {
+ viewable [encoding convertto utf-32le 😹]
+} "9\xF6\x01\x00 (9\\u00F6\\u0001\\u0000)"
+test encoding-11.11 {encoding: extended Unicode UTF-32} {
+ viewable [encoding convertto utf-32be 😹]
+} "\x00\x01\xF69 (\\u0000\\u0001\\u00F69)"
# OpenEncodingFile is fully tested by the rest of the tests in this file.
test encoding-12.1 {LoadTableEncoding: normal encoding} {
@@ -461,10 +467,18 @@ test encoding-16.4 {Ucs2ToUtfProc} -body {
set val [encoding convertfrom ucs-2 NN]
list $val [format %x [scan $val %c]]
} -result "乎 4e4e"
-test encoding-16.4 {Ucs2ToUtfProc} -body {
+test encoding-16.5 {Ucs2ToUtfProc} -body {
set val [encoding convertfrom ucs-2 "\xD8\xD8\xDC\xDC"]
list $val [format %x [scan $val %c]]
} -result "\U460DC 460dc"
+test encoding-16.6 {Utf32ToUtfProc} -body {
+ set val [encoding convertfrom utf-32le NN\0\0]
+ list $val [format %x [scan $val %c]]
+} -result "乎 4e4e"
+test encoding-16.7 {Utf32ToUtfProc} -body {
+ set val [encoding convertfrom utf-32be \0\0NN]
+ list $val [format %x [scan $val %c]]
+} -result "乎 4e4e"
test encoding-17.1 {UtfToUtf16Proc} -body {
encoding convertto utf-16 "\U460DC"
@@ -478,6 +492,12 @@ test encoding-17.3 {UtfToUtf16Proc} -body {
test encoding-17.4 {UtfToUtf16Proc} -body {
encoding convertto utf-16le "\uD8D8"
} -result "\xFD\xFF"
+test encoding-17.5 {UtfToUtf16Proc} -body {
+ encoding convertto utf-32le "\U460DC"
+} -result "\xDC\x60\x04\x00"
+test encoding-17.6 {UtfToUtf16Proc} -body {
+ encoding convertto utf-32be "\U460DC"
+} -result "\x00\x04\x60\xDC"
test encoding-18.1 {TableToUtfProc} {
} {}
@@ -777,7 +797,7 @@ test encoding-28.0 {all encodings load} -body {
llength $name
}
return $count
-} -result [expr {[info exists ::tcl_precision] ? 89 : 88}]
+} -result [expr {[info exists ::tcl_precision] ? 92 : 91}]
runtests
diff --git a/tests/fCmd.test b/tests/fCmd.test
index d1d1930..13f3720 100644
--- a/tests/fCmd.test
+++ b/tests/fCmd.test
@@ -374,7 +374,7 @@ test fCmd-4.14 {TclFileMakeDirsCmd: TclpCreateDirectory fails} -setup {
file delete -force foo
} -constraints {unix notRoot} -body {
file mkdir foo
- file attr foo -perm 040000
+ file attr foo -perm 0o40000
file mkdir foo/tf1
} -returnCodes error -cleanup {
file delete -force foo
@@ -687,11 +687,11 @@ test fCmd-6.30 {CopyRenameOneFile: TclpRemoveDirectory failed} -setup {
cleanup $tmpspace
} -constraints {unix notRoot} -body {
file mkdir foo/bar
- file attr foo -perm 040555
+ file attr foo -perm 0o40555
file rename foo/bar $tmpspace
} -returnCodes error -cleanup {
catch {file delete [file join $tmpspace bar]}
- catch {file attr foo -perm 040777}
+ catch {file attr foo -perm 0o40777}
catch {file delete -force foo}
} -match glob -result {*: permission denied}
test fCmd-6.31 {CopyRenameOneFile: TclpDeleteFile passed} -setup {
@@ -744,7 +744,7 @@ test fCmd-8.1 {FileBasename: basename of ~user: argc == 1 && *path == ~} \
-constraints {unix notRoot knownBug} -body {
# Labelled knownBug because it is dangerous [Bug: 3881]
file mkdir td1
- file attr td1 -perm 040000
+ file attr td1 -perm 0o40000
file rename ~$user td1
} -returnCodes error -cleanup {
file delete -force td1
@@ -763,7 +763,7 @@ test fCmd-9.1 {file rename: comprehensive: EACCES} -setup {
} -constraints {unix notRoot} -body {
file mkdir td1
file mkdir td2
- file attr td2 -perm 040000
+ file attr td2 -perm 0o40000
file rename td1 td2/
} -returnCodes error -cleanup {
file delete -force td2
diff --git a/tests/format.test b/tests/format.test
index 41918b2..c5053e8 100644
--- a/tests/format.test
+++ b/tests/format.test
@@ -23,8 +23,8 @@ testConstraint pointerIs64bit [expr {$tcl_platform(pointerSize) >= 8}]
# MSVC uses a broken libc that gets sprintf("%g") wrong. This is a pain
# particularly in Continuous Integration, and there isn't anything much we can
# do about it.
-testConstraint knownMsvcBug [expr {![info exists ::env(CI_BUILD_WITH_MSVC)]}]
-
+testConstraint knownMsvcBug [expr {![string match msvc-* [tcl::build-info compiler]]}]
+
test format-1.1 {integer formatting} {
format "%*d %d %d %d" 6 34 16923 -12 -1
} { 34 16923 -12 -1}
@@ -620,12 +620,12 @@ test format-19.4.2 {Bug d498578df4: width overflow should cause limit exceeded}
} -returnCodes error -result "max size for a Tcl value exceeded"
# Note that this test may fail in future versions
-test format-20.1 {Bug 2932421: plain %s caused intrep change of args} -body {
+test format-20.1 {Bug 2932421: plain %s caused internalrep change of args} -body {
set x [dict create a b c d]
format %s $x
# After this, obj in $x should be a dict
# We are testing to make sure it has not been shimmered to a
- # different intrep when that is not necessary.
+ # different internalrep when that is not necessary.
# Whether or not there is a string rep - we should not care!
tcl::unsupported::representation $x
} -match glob -result {value is a dict *}
diff --git a/tests/info.test b/tests/info.test
index ced4435..46f85e7 100644
--- a/tests/info.test
+++ b/tests/info.test
@@ -20,9 +20,9 @@ if {{::tcltest} ni [namespace children]} {
namespace import -force ::tcltest::*
}
::tcltest::loadTestedCommands
+package require tcltests
catch [list package require -exact tcl::test [info patchlevel]]
testConstraint zlib [llength [info commands zlib]]
-testConstraint nodep [info exists tcl_precision]
# Set up namespaces needed to test operation of "info args", "info body",
# "info default", and "info procs" with imported procedures.
diff --git a/tests/io.test b/tests/io.test
index e26c97f..0ef3422 100644
--- a/tests/io.test
+++ b/tests/io.test
@@ -8752,7 +8752,7 @@ test io-73.1 {channel Tcl_Obj SetChannelFromAny} {} {
} {1}
test io-73.2 {channel Tcl_Obj SetChannelFromAny, bug 2407783} -setup {
- # Invalidate intrep of 'channel' Tcl_Obj when transiting between interpreters.
+ # Invalidate internalrep of 'channel' Tcl_Obj when transiting between interpreters.
set f [open [info script] r]
} -body {
interp create foo
diff --git a/tests/lset.test b/tests/lset.test
index 5093369..72d68ec 100644
--- a/tests/lset.test
+++ b/tests/lset.test
@@ -412,7 +412,7 @@ test lset-14.2 {lset, not compiled, flat args, is string rep preserved?} testeva
} "{ { 1 2 } { 3 4 } } { 3 4 }"
testConstraint testobj [llength [info commands testobj]]
-test lset-15.1 {lset: shared intrep [Bug 1677512]} -setup {
+test lset-15.1 {lset: shared internalrep [Bug 1677512]} -setup {
teststringobj set 1 {{1 2} 3}
testobj convert 1 list
testobj duplicate 1 2
diff --git a/tests/proc.test b/tests/proc.test
index ab32567..b87af57 100644
--- a/tests/proc.test
+++ b/tests/proc.test
@@ -325,6 +325,15 @@ test proc-4.8 {TclCreateProc, procbody obj, no leak on multiple iterations} -set
test proc-4.9 {[39fed4dae5] Valid Tcl_PkgPresent return} tcl::test {
tcl::procbodytest::check
} 1
+test proc-4.10 {
+ TclCreateProc, issue a8579d906a28, argument with no name
+} -body {
+ catch {
+ proc p1 [list [list [expr {1 + 2}] default]] {}
+ }
+} -cleanup {
+ catch {rename p1 {}}
+} -result 0
test proc-5.1 {Bytecompiling noop; test for correct argument substitution} -body {
proc p args {} ; # this will be bytecompiled into t
diff --git a/tests/regexp.test b/tests/regexp.test
index 6bed21e..a44f2e3 100644
--- a/tests/regexp.test
+++ b/tests/regexp.test
@@ -17,9 +17,8 @@ if {"::tcltest" ni [namespace children]} {
}
unset -nocomplain foo
-
+package require tcltests
testConstraint exec [llength [info commands exec]]
-testConstraint nodep [info exists tcl_precision]
# Used for constraining memory leak tests
testConstraint memory [llength [info commands memory]]
diff --git a/tests/regexpComp.test b/tests/regexpComp.test
index 1587c72..e78c0df 100644
--- a/tests/regexpComp.test
+++ b/tests/regexpComp.test
@@ -16,7 +16,7 @@ if {"::tcltest" ni [namespace children]} {
namespace import -force ::tcltest::*
}
-testConstraint nodep [info exists tcl_precision]
+package require tcltests
# Procedure to evaluate a script within a proc, to test compilation
# functionality
diff --git a/tests/socket.test b/tests/socket.test
index a1a66b5..4644e1d 100644
--- a/tests/socket.test
+++ b/tests/socket.test
@@ -79,7 +79,6 @@ testConstraint notWine [expr {![info exists ::env(CI_USING_WINE)]}]
# Some tests require the Thread package or exec command
testConstraint thread [expr {0 == [catch {package require Thread 2.7-}]}]
testConstraint exec [llength [info commands exec]]
-testConstraint knownMsvcBug [expr {![info exists ::env(CI_BUILD_WITH_MSVC)]}]
testConstraint notWinCI [expr {
$tcl_platform(platform) ne "windows" || ![info exists ::env(CI)]}]
diff --git a/tests/string.test b/tests/string.test
index 822899c..6750a5c 100644
--- a/tests/string.test
+++ b/tests/string.test
@@ -19,6 +19,7 @@ if {"::tcltest" ni [namespace children]} {
::tcltest::loadTestedCommands
catch [list package require -exact tcl::test [info patchlevel]]
+package require tcltests
# Helper commands to test various optimizations, code paths, and special cases.
proc makeByteArray {s} {binary format a* $s}
@@ -33,7 +34,6 @@ testConstraint testindexobj [expr {[info commands testindexobj] ne {}}]
testConstraint testevalex [expr {[info commands testevalex] ne {}}]
testConstraint utf16 [expr {[string length \U010000] == 2}]
testConstraint testbytestring [llength [info commands testbytestring]]
-testConstraint nodep [info exists tcl_precision]
# Used for constraining memory leak tests
testConstraint memory [llength [info commands memory]]
diff --git a/tests/stringObj.test b/tests/stringObj.test
index 135830c..4402185 100644
--- a/tests/stringObj.test
+++ b/tests/stringObj.test
@@ -19,12 +19,12 @@ if {"::tcltest" ni [namespace children]} {
::tcltest::loadTestedCommands
catch [list package require -exact tcl::test [info patchlevel]]
+package require tcltests
testConstraint testobj [llength [info commands testobj]]
testConstraint testbytestring [llength [info commands testbytestring]]
testConstraint testdstring [llength [info commands testdstring]]
testConstraint tip389 [expr {[string length \U010000] == 2}]
-testConstraint nodep [info exists tcl_precision]
test stringObj-1.1 {string type registration} testobj {
set t [testobj types]
diff --git a/tests/tcltest.test b/tests/tcltest.test
index 3177580..a9ce785 100644
--- a/tests/tcltest.test
+++ b/tests/tcltest.test
@@ -716,8 +716,8 @@ test tcltest-8.60 {::workingDirectory} {
switch -- $::tcl_platform(platform) {
unix {
- file attributes $notReadableDir -permissions 777
- file attributes $notWriteableDir -permissions 777
+ file attributes $notReadableDir -permissions 0o777
+ file attributes $notWriteableDir -permissions 0o777
}
default {
catch {testchmod 0o777 $notWriteableDir}
diff --git a/tests/tcltests.tcl b/tests/tcltests.tcl
index 1ee37d3..61076f5 100644
--- a/tests/tcltests.tcl
+++ b/tests/tcltests.tcl
@@ -2,23 +2,19 @@
package require tcltest 2.5
namespace import ::tcltest::*
-testConstraint exec [llength [info commands exec]]
-if {[namespace which testdebug] ne {}} {
- testConstraint debug [testdebug]
- testConstraint purify [testpurify]
- testConstraint debugpurify [
- expr {
- ![testConstraint memory]
- &&
- [testConstraint debug]
- &&
- [testConstraint purify]
- }]
-}
+testConstraint exec [llength [info commands exec]]
+testConstraint nodep [expr {![tcl::build-info no-deprecate]}]
+testConstraint debug [tcl::build-info debug]
+testConstraint purify [tcl::build-info purify]
+testConstraint debugpurify [
+ expr {
+ ![tcl::build-info memdebug]
+ && [testConstraint debug]
+ && [testConstraint purify]
+ }]
testConstraint fcopy [llength [info commands fcopy]]
testConstraint fileevent [llength [info commands fileevent]]
-testConstraint thread [
- expr {0 == [catch {package require Thread 2.7-}]}]
+testConstraint thread [expr {![catch {package require Thread 2.7-}]}]
testConstraint notValgrind [expr {![testConstraint valgrind]}]
diff --git a/tests/var.test b/tests/var.test
index 3ca1a76..15edf6e 100644
--- a/tests/var.test
+++ b/tests/var.test
@@ -1038,7 +1038,7 @@ test var-22.0 {leak in array element unset: Bug a3309d01db} -setup {
array unset A
rename doit {}
} -result 0
-test var-22.1 {leak in localVarName intrep: Bug 80304238ac} -setup {
+test var-22.1 {leak in localVarName internalrep: Bug 80304238ac} -setup {
proc doit {} {
interp create child
child eval {
diff --git a/tests/winDde.test b/tests/winDde.test
index 925574b..ad21426 100644
--- a/tests/winDde.test
+++ b/tests/winDde.test
@@ -13,8 +13,8 @@ if {"::tcltest" ni [namespace children]} {
package require tcltest 2.5
namespace import -force ::tcltest::*
}
+package require tcltests
-testConstraint debug [::tcl::pkgconfig get debug]
testConstraint dde 0
if {[testConstraint win]} {
if {![catch {
diff --git a/tests/winFCmd.test b/tests/winFCmd.test
index d118725..43c7ced 100644
--- a/tests/winFCmd.test
+++ b/tests/winFCmd.test
@@ -29,7 +29,7 @@ testConstraint longFileNames 0
# Some things fail under all Continuous Integration systems for subtle reasons
# such as CI often running with elevated privileges in a container.
testConstraint notInCIenv [expr {![info exists ::env(CI)]}]
-testConstraint knownMsvcBug [expr {![info exists ::env(CI_BUILD_WITH_MSVC)]}]
+testConstraint knownMsvcBug [expr {![string match msvc-* [tcl::build-info compiler]]}]
proc createfile {file {string a}} {
set f [open $file w]
diff --git a/unix/Makefile.in b/unix/Makefile.in
index f97573e..afadc2c 100644
--- a/unix/Makefile.in
+++ b/unix/Makefile.in
@@ -1035,10 +1035,8 @@ install-libraries: libraries
$(INSTALL_DATA) $$i "$(SCRIPT_INSTALL_DIR)"; \
done
@echo "Installing package cookiejar 0.2 files to $(SCRIPT_INSTALL_DIR)/cookiejar0.2/"
- @for i in $(TOP_DIR)/library/cookiejar/*.tcl; do \
- $(INSTALL_DATA) $$i "$(SCRIPT_INSTALL_DIR)/cookiejar0.2"; \
- done
- @for i in $(TOP_DIR)/library/cookiejar/*.gz; do \
+ @for i in $(TOP_DIR)/library/cookiejar/*.tcl \
+ $(TOP_DIR)/library/cookiejar/*.gz; do \
$(INSTALL_DATA) $$i "$(SCRIPT_INSTALL_DIR)/cookiejar0.2"; \
done
@echo "Installing package http 2.10a1 as a Tcl Module"
@@ -1054,9 +1052,9 @@ install-libraries: libraries
@echo "Installing package tcltest 2.5.4 as a Tcl Module"
@$(INSTALL_DATA) $(TOP_DIR)/library/tcltest/tcltest.tcl \
"$(MODULE_INSTALL_DIR)/8.5/tcltest-2.5.4.tm"
- @echo "Installing package platform 1.0.17 as a Tcl Module"
+ @echo "Installing package platform 1.0.18 as a Tcl Module"
@$(INSTALL_DATA) $(TOP_DIR)/library/platform/platform.tcl \
- "$(MODULE_INSTALL_DIR)/8.4/platform-1.0.17.tm"
+ "$(MODULE_INSTALL_DIR)/8.4/platform-1.0.18.tm"
@echo "Installing package platform::shell 1.1.4 as a Tcl Module"
@$(INSTALL_DATA) $(TOP_DIR)/library/platform/shell.tcl \
"$(MODULE_INSTALL_DIR)/8.4/platform/shell-1.1.4.tm"
@@ -1319,7 +1317,7 @@ tclEnsemble.o: $(GENERIC_DIR)/tclEnsemble.c $(COMPILEHDR)
tclEnv.o: $(GENERIC_DIR)/tclEnv.c
$(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclEnv.c
-tclEvent.o: $(GENERIC_DIR)/tclEvent.c
+tclEvent.o: $(GENERIC_DIR)/tclEvent.c tclUuid.h
$(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclEvent.c
tclExecute.o: $(GENERIC_DIR)/tclExecute.c $(COMPILEHDR) $(MATHHDRS) $(NREHDR)
@@ -1535,7 +1533,7 @@ tclZipfs.o: $(GENERIC_DIR)/tclZipfs.c
-I$(ZLIB_DIR) -I$(ZLIB_DIR)/contrib/minizip \
$(GENERIC_DIR)/tclZipfs.c
-tclTest.o: $(GENERIC_DIR)/tclTest.c $(IOHDR) $(TCLREHDRS)
+tclTest.o: $(GENERIC_DIR)/tclTest.c $(IOHDR) $(TCLREHDRS) tclUuid.h
$(CC) -c $(APP_CC_SWITCHES) $(GENERIC_DIR)/tclTest.c
tclTestObj.o: $(GENERIC_DIR)/tclTestObj.c $(MATHHDRS)
@@ -2236,9 +2234,17 @@ $(MAC_OSX_DIR)/configure: $(MAC_OSX_DIR)/configure.ac $(UNIX_DIR)/configure
$(UNIX_DIR)/tclConfig.h.in: $(MAC_OSX_DIR)/configure
cd $(MAC_OSX_DIR); autoheader; touch $@
+tclUuid.h: $(TOP_DIR)/manifest.uuid
+ echo "#define TCL_VERSION_UUID \\" >$@
+ cat $(TOP_DIR)/manifest.uuid >>$@
+ echo "" >>$@
+
$(TOP_DIR)/manifest.uuid:
- printf "git." >$(TOP_DIR)/manifest.uuid
- git rev-parse HEAD >>$(TOP_DIR)/manifest.uuid
+ printf "git-" >$(TOP_DIR)/manifest.uuid
+ (cd $(TOP_DIR); git rev-parse HEAD >>$(TOP_DIR)/manifest.uuid || \
+ (printf "svn-r" >$(TOP_DIR)/manifest.uuid ; \
+ svn info --show-item last-changed-revision >>$(TOP_DIR)/manifest.uuid) || \
+ printf "unknown" >$(TOP_DIR)/manifest.uuid)
dist: $(UNIX_DIR)/configure $(UNIX_DIR)/tclConfig.h.in $(UNIX_DIR)/tcl.pc.in genstubs \
$(MAC_OSX_DIR)/configure $(TOP_DIR)/manifest.uuid dist-packages ${NATIVE_TCLSH}
@@ -2321,7 +2327,8 @@ dist: $(UNIX_DIR)/configure $(UNIX_DIR)/tclConfig.h.in $(UNIX_DIR)/tcl.pc.in gen
cp -p $(TOP_DIR)/win/configure.ac $(TOP_DIR)/win/configure \
$(TOP_DIR)/win/tclConfig.sh.in $(TOP_DIR)/win/tclooConfig.sh \
$(TOP_DIR)/win/tcl.m4 $(TOP_DIR)/win/aclocal.m4 \
- $(TOP_DIR)/win/tclsh.exe.manifest.in \
+ $(TOP_DIR)/win/tclsh.exe.manifest.in $(TOP_DIR)/win/tclUuid.h.in \
+ $(TOP_DIR)/win/gitmanifest.in $(TOP_DIR)/win/svnmanifest.in \
$(DISTDIR)/win
cp -p $(TOP_DIR)/win/*.[ch] $(TOP_DIR)/win/*.ico $(TOP_DIR)/win/*.rc \
$(DISTDIR)/win
diff --git a/unix/configure b/unix/configure
index 86c93f4..4a6ee81 100755
--- a/unix/configure
+++ b/unix/configure
@@ -5903,9 +5903,9 @@ printf "%s\n" "$ac_cv_cygwin" >&6; }
fi
do64bit_ok=yes
if test "x${SHARED_BUILD}" = "x1"; then
- echo "running cd ../win; ${CONFIG_SHELL-/bin/sh} ./configure $ac_configure_args"
+ echo "running cd ../win; ${CONFIG_SHELL-/bin/sh} ./configure $ac_configure_args --enable-64bit --host=x86_64-w64-mingw32"
# The eval makes quoting arguments work.
- if cd ../win; eval ${CONFIG_SHELL-/bin/sh} ./configure $ac_configure_args; cd ../unix
+ if cd ../win; eval ${CONFIG_SHELL-/bin/sh} ./configure $ac_configure_args --enable-64bit --host=x86_64-w64-mingw32; cd ../unix
then :
else
{ echo "configure: error: configure failed for ../win" 1>&2; exit 1; }
@@ -6251,7 +6251,7 @@ fi
fi
;;
- Linux*|GNU*|NetBSD-Debian)
+ Linux*|GNU*|NetBSD-Debian|DragonFly-*|FreeBSD-*)
SHLIB_CFLAGS="-fPIC -fno-common"
SHLIB_SUFFIX=".so"
@@ -6265,6 +6265,20 @@ fi
DL_OBJS="tclLoadDl.o"
DL_LIBS="-ldl"
LDFLAGS="$LDFLAGS -Wl,--export-dynamic"
+
+ case $system in
+ DragonFly-*|FreeBSD-*)
+ if test "${TCL_THREADS}" = "1"
+then :
+
+ # The -pthread needs to go in the LDFLAGS, not LIBS
+ LIBS=`echo $LIBS | sed s/-pthread//`
+ CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
+ LDFLAGS="$LDFLAGS $PTHREAD_LIBS"
+fi
+ ;;
+ esac
+
if test $doRpath = yes
then :
@@ -6396,33 +6410,6 @@ fi
CFLAGS="$CFLAGS -pthread"
LDFLAGS="$LDFLAGS -pthread"
;;
- DragonFly-*|FreeBSD-*)
- # This configuration from FreeBSD Ports.
- SHLIB_LD="${CC} -shared"
- SHLIB_LD_LIBS="${SHLIB_LD_LIBS} -Wl,-soname,\$@"
- SHLIB_SUFFIX=".so"
- DL_OBJS="tclLoadDl.o"
- DL_LIBS=""
- if test $doRpath = yes
-then :
-
- CC_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"'
- LD_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"'
-fi
- # The -pthread needs to go in the LDFLAGS, not LIBS
- LIBS=`echo $LIBS | sed s/-pthread//`
- CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
- LDFLAGS="$LDFLAGS $PTHREAD_LIBS"
- case $system in
- FreeBSD-3.*)
- # Version numbers are dot-stripped by system policy.
- TCL_TRIM_DOTS=`echo ${VERSION} | tr -d .`
- UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a'
- SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so'
- TCL_LIB_VERSIONS_OK=nodots
- ;;
- esac
- ;;
Darwin-*)
CFLAGS_OPTIMIZE="-Os"
SHLIB_CFLAGS="-fno-common"
@@ -9406,6 +9393,7 @@ else $as_nop
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <time.h>
+#include <stdlib.h>
int
main (void)
{
@@ -9444,6 +9432,7 @@ else $as_nop
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <time.h>
+#include <stdlib.h>
int
main (void)
{
@@ -10969,7 +10958,6 @@ printf "%s\n" "static library" >&6; }
echo "$LDFLAGS " | grep -q -- '-prebind ' && TCL_SHLIB_LD_EXTRAS="${TCL_SHLIB_LD_EXTRAS}"' -seg1addr 0xA000000'
TCL_SHLIB_LD_EXTRAS="${TCL_SHLIB_LD_EXTRAS}"' -sectcreate __TEXT __info_plist Tcl-Info.plist'
EXTRA_TCLSH_LIBS='-sectcreate __TEXT __info_plist Tclsh-Info.plist'
- EXTRA_APP_CC_SWITCHES='-mdynamic-no-pic'
ac_config_files="$ac_config_files Tcl-Info.plist:../macosx/Tcl-Info.plist.in Tclsh-Info.plist:../macosx/Tclsh-Info.plist.in"
TCL_YEAR="`date +%Y`"
diff --git a/unix/configure.ac b/unix/configure.ac
index b824ede..335c5a2 100644
--- a/unix/configure.ac
+++ b/unix/configure.ac
@@ -814,7 +814,6 @@ if test "`uname -s`" = "Darwin" ; then
echo "$LDFLAGS " | grep -q -- '-prebind ' && TCL_SHLIB_LD_EXTRAS="${TCL_SHLIB_LD_EXTRAS}"' -seg1addr 0xA000000'
TCL_SHLIB_LD_EXTRAS="${TCL_SHLIB_LD_EXTRAS}"' -sectcreate __TEXT __info_plist Tcl-Info.plist'
EXTRA_TCLSH_LIBS='-sectcreate __TEXT __info_plist Tclsh-Info.plist'
- EXTRA_APP_CC_SWITCHES='-mdynamic-no-pic'
AC_CONFIG_FILES([Tcl-Info.plist:../macosx/Tcl-Info.plist.in Tclsh-Info.plist:../macosx/Tclsh-Info.plist.in])
TCL_YEAR="`date +%Y`"
fi
diff --git a/unix/tcl.m4 b/unix/tcl.m4
index 9cfec6b..a5a4884 100644
--- a/unix/tcl.m4
+++ b/unix/tcl.m4
@@ -1105,9 +1105,9 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
fi
do64bit_ok=yes
if test "x${SHARED_BUILD}" = "x1"; then
- echo "running cd ../win; ${CONFIG_SHELL-/bin/sh} ./configure $ac_configure_args"
+ echo "running cd ../win; ${CONFIG_SHELL-/bin/sh} ./configure $ac_configure_args --enable-64bit --host=x86_64-w64-mingw32"
# The eval makes quoting arguments work.
- if cd ../win; eval ${CONFIG_SHELL-/bin/sh} ./configure $ac_configure_args; cd ../unix
+ if cd ../win; eval ${CONFIG_SHELL-/bin/sh} ./configure $ac_configure_args --enable-64bit --host=x86_64-w64-mingw32; cd ../unix
then :
else
{ echo "configure: error: configure failed for ../win" 1>&2; exit 1; }
@@ -1262,7 +1262,7 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
])
])
;;
- Linux*|GNU*|NetBSD-Debian)
+ Linux*|GNU*|NetBSD-Debian|DragonFly-*|FreeBSD-*)
SHLIB_CFLAGS="-fPIC -fno-common"
SHLIB_SUFFIX=".so"
@@ -1276,6 +1276,17 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
DL_OBJS="tclLoadDl.o"
DL_LIBS="-ldl"
LDFLAGS="$LDFLAGS -Wl,--export-dynamic"
+
+ case $system in
+ DragonFly-*|FreeBSD-*)
+ AS_IF([test "${TCL_THREADS}" = "1"], [
+ # The -pthread needs to go in the LDFLAGS, not LIBS
+ LIBS=`echo $LIBS | sed s/-pthread//`
+ CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
+ LDFLAGS="$LDFLAGS $PTHREAD_LIBS"])
+ ;;
+ esac
+
AS_IF([test $doRpath = yes], [
CC_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"'])
LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
@@ -1284,7 +1295,8 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
AC_CACHE_CHECK([if compiler accepts -m64 flag], tcl_cv_cc_m64, [
hold_cflags=$CFLAGS
CFLAGS="$CFLAGS -m64"
- AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[]])],[tcl_cv_cc_m64=yes],[tcl_cv_cc_m64=no])
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
+ [tcl_cv_cc_m64=yes],[tcl_cv_cc_m64=no])
CFLAGS=$hold_cflags])
AS_IF([test $tcl_cv_cc_m64 = yes], [
CFLAGS="$CFLAGS -m64"
@@ -1356,30 +1368,6 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
CFLAGS="$CFLAGS -pthread"
LDFLAGS="$LDFLAGS -pthread"
;;
- DragonFly-*|FreeBSD-*)
- # This configuration from FreeBSD Ports.
- SHLIB_LD="${CC} -shared"
- SHLIB_LD_LIBS="${SHLIB_LD_LIBS} -Wl,-soname,\$[@]"
- SHLIB_SUFFIX=".so"
- DL_OBJS="tclLoadDl.o"
- DL_LIBS=""
- AS_IF([test $doRpath = yes], [
- CC_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"'
- LD_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"'])
- # The -pthread needs to go in the LDFLAGS, not LIBS
- LIBS=`echo $LIBS | sed s/-pthread//`
- CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
- LDFLAGS="$LDFLAGS $PTHREAD_LIBS"
- case $system in
- FreeBSD-3.*)
- # Version numbers are dot-stripped by system policy.
- TCL_TRIM_DOTS=`echo ${VERSION} | tr -d .`
- UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a'
- SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so'
- TCL_LIB_VERSIONS_OK=nodots
- ;;
- esac
- ;;
Darwin-*)
CFLAGS_OPTIMIZE="-Os"
SHLIB_CFLAGS="-fno-common"
@@ -1400,8 +1388,7 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
hold_cflags=$CFLAGS
CFLAGS="$CFLAGS -arch ppc64 -mpowerpc64 -mcpu=G5"
AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
- [tcl_cv_cc_arch_ppc64=yes],
- [tcl_cv_cc_arch_ppc64=no])
+ [tcl_cv_cc_arch_ppc64=yes],[tcl_cv_cc_arch_ppc64=no])
CFLAGS=$hold_cflags])
AS_IF([test $tcl_cv_cc_arch_ppc64 = yes], [
CFLAGS="$CFLAGS -arch ppc64 -mpowerpc64 -mcpu=G5"
@@ -1413,8 +1400,7 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
hold_cflags=$CFLAGS
CFLAGS="$CFLAGS -arch x86_64"
AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
- [tcl_cv_cc_arch_x86_64=yes],
- [tcl_cv_cc_arch_x86_64=no])
+ [tcl_cv_cc_arch_x86_64=yes],[tcl_cv_cc_arch_x86_64=no])
CFLAGS=$hold_cflags])
AS_IF([test $tcl_cv_cc_arch_x86_64 = yes], [
CFLAGS="$CFLAGS -arch x86_64"
@@ -2164,7 +2150,8 @@ AC_DEFUN([SC_TIME_HANDLER], [
# (like convex) have timezone functions, etc.
#
AC_CACHE_CHECK([long timezone variable], tcl_cv_timezone_long, [
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <time.h>]],
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <time.h>
+#include <stdlib.h>]],
[[extern long timezone;
timezone += 1;
exit (0);]])],
@@ -2176,7 +2163,8 @@ AC_DEFUN([SC_TIME_HANDLER], [
# On some systems (eg IRIX 6.2), timezone is a time_t and not a long.
#
AC_CACHE_CHECK([time_t timezone variable], tcl_cv_timezone_time, [
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <time.h>]],
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <time.h>
+#include <stdlib.h>]],
[[extern time_t timezone;
timezone += 1;
exit (0);]])],
diff --git a/unix/tclConfig.h.in b/unix/tclConfig.h.in
index d7f51bf..5c24d40 100644
--- a/unix/tclConfig.h.in
+++ b/unix/tclConfig.h.in
@@ -184,15 +184,15 @@
/* Define to 1 if you have the `OSSpinLockLock' function. */
#undef HAVE_OSSPINLOCKLOCK
+/* Should we use pselect()? */
+#undef HAVE_PSELECT
+
/* Define to 1 if you have the `pthread_atfork' function. */
#undef HAVE_PTHREAD_ATFORK
/* Define to 1 if you have the `pthread_attr_setstacksize' function. */
#undef HAVE_PTHREAD_ATTR_SETSTACKSIZE
-/* Define to 1 if you have the `pselect' function */
-#undef HAVE_PSELECT
-
/* Does putenv() copy strings or incorporate them by reference? */
#undef HAVE_PUTENV_THAT_COPIES
diff --git a/win/Makefile.in b/win/Makefile.in
index 1e3e7b7..5003ec0 100644
--- a/win/Makefile.in
+++ b/win/Makefile.in
@@ -579,7 +579,7 @@ ${TCL_LIB_FILE}: ${TCL_OBJS}
@MAKE_LIB@ ${TCL_OBJS} ${DDE_OBJS} ${REG_OBJS}
@POST_MAKE_LIB@
-${DDE_DLL_FILE}: ${TCL_STUB_LIB_FILE}
+${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
@@ -675,6 +675,20 @@ tclPkgConfig.${OBJEXT}: tclPkgConfig.c
-DBUILD_tcl \
@DEPARG@ $(CC_OBJNAME)
+tclEvent.${OBJEXT}: tclEvent.c tclUuid.h
+
+$(TOP_DIR)/manifest.uuid:
+ printf "git-" >$(TOP_DIR)/manifest.uuid
+ (cd $(TOP_DIR); git rev-parse HEAD >>$(TOP_DIR)/manifest.uuid || \
+ (printf "svn-r" >$(TOP_DIR)/manifest.uuid ; \
+ svn info --show-item last-changed-revision >>$(TOP_DIR)/manifest.uuid) || \
+ printf "unknown" >$(TOP_DIR)/manifest.uuid)
+
+tclUuid.h: $(TOP_DIR)/manifest.uuid
+ echo "#define TCL_VERSION_UUID \\" >$@
+ cat $(TOP_DIR)/manifest.uuid >>$@
+ echo "" >>$@
+
# The following objects are part of the stub library and should not be built
# as DLL objects but none of the symbols should be exported
@@ -853,28 +867,26 @@ install-libraries: libraries install-tzdata install-msgs
fi; \
done;
@echo "Installing library files to $(SCRIPT_INSTALL_DIR)";
- @for i in $(ROOT_DIR)/library/*.tcl $(ROOT_DIR)/library/tclIndex; \
- do \
+ @for i in $(ROOT_DIR)/library/*.tcl $(ROOT_DIR)/library/tclIndex; do \
$(COPY) "$$i" "$(SCRIPT_INSTALL_DIR)"; \
done;
@echo "Installing package cookiejar 0.2"
- @for j in $(ROOT_DIR)/library/cookiejar/*.{tcl,gz}; \
- do \
+ @for j in $(ROOT_DIR)/library/cookiejar/*.tcl \
+ $(ROOT_DIR)/library/cookiejar/*.gz; do \
$(COPY) "$$j" "$(SCRIPT_INSTALL_DIR)/cookiejar0.2"; \
done;
@echo "Installing package http 2.10a1 as a Tcl Module";
@$(COPY) $(ROOT_DIR)/library/http/http.tcl "$(MODULE_INSTALL_DIR)/8.6/http-2.10a1.tm";
@echo "Installing package opt 0.4.7";
- @for j in $(ROOT_DIR)/library/opt/*.tcl; \
- do \
+ @for j in $(ROOT_DIR)/library/opt/*.tcl; do \
$(COPY) "$$j" "$(SCRIPT_INSTALL_DIR)/opt0.4"; \
done;
@echo "Installing package msgcat 1.7.1 as a Tcl Module";
@$(COPY) $(ROOT_DIR)/library/msgcat/msgcat.tcl "$(MODULE_INSTALL_DIR)/8.7/msgcat-1.7.1.tm";
@echo "Installing package tcltest 2.5.4 as a Tcl Module";
@$(COPY) $(ROOT_DIR)/library/tcltest/tcltest.tcl "$(MODULE_INSTALL_DIR)/8.5/tcltest-2.5.4.tm";
- @echo "Installing package platform 1.0.17 as a Tcl Module";
- @$(COPY) $(ROOT_DIR)/library/platform/platform.tcl "$(MODULE_INSTALL_DIR)/8.4/platform-1.0.17.tm";
+ @echo "Installing package platform 1.0.18 as a Tcl Module";
+ @$(COPY) $(ROOT_DIR)/library/platform/platform.tcl "$(MODULE_INSTALL_DIR)/8.4/platform-1.0.18.tm";
@echo "Installing package platform::shell 1.1.4 as a Tcl Module";
@$(COPY) $(ROOT_DIR)/library/platform/shell.tcl "$(MODULE_INSTALL_DIR)/8.4/platform/shell-1.1.4.tm";
@echo "Installing encodings";
diff --git a/win/README b/win/README
index df65d1d..8dd0574 100644
--- a/win/README
+++ b/win/README
@@ -24,7 +24,7 @@ In order to compile Tcl for Windows, you need the following:
or
- Linux + MinGW-w64 [http://mingw-w64.sourceforge.net/]
+ Linux + MinGW-w64 [https://www.mingw-w64.org/]
(win32 or win64)
or
@@ -34,12 +34,12 @@ In order to compile Tcl for Windows, you need the following:
or
- Darwin + MinGW-w64 [http://mingw-w64.sourceforge.net/]
+ Darwin + MinGW-w64 [https://www.mingw-w64.org/]
(win32 or win64)
or
- Msys + MinGW-w64 [http://mingw-w64.sourceforge.net/]
+ Msys + MinGW-w64 [https://www.mingw-w64.org/]
(win32 or win64)
diff --git a/win/configure b/win/configure
index 54ce90b..96f92d2 100755
--- a/win/configure
+++ b/win/configure
@@ -4283,6 +4283,7 @@ printf "%s\n" "$ac_cv_municode" >&6; }
else
extra_cflags="$extra_cflags -DTCL_BROKEN_MAINARGS"
fi
+ hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -fno-lto"
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working -fno-lto" >&5
printf %s "checking for working -fno-lto... " >&6; }
if test ${ac_cv_nolto+y}
@@ -4352,6 +4353,40 @@ printf "%s\n" "$tcl_cv_cc_input_charset" >&6; }
fi
fi
+ hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -Wl,--enable-auto-image-base"
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working --enable-auto-image-base" >&5
+printf %s "checking for working --enable-auto-image-base... " >&6; }
+if test ${ac_cv_enable_auto_image_base+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main (void)
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+ ac_cv_enable_auto_image_base=yes
+else $as_nop
+ ac_cv_enable_auto_image_base=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_enable_auto_image_base" >&5
+printf "%s\n" "$ac_cv_enable_auto_image_base" >&6; }
+ CFLAGS=$hold_cflags
+ if test "$ac_cv_enable_auto_image_base" == "yes" ; then
+ extra_ldflags="$extra_ldflags -Wl,--enable-auto-image-base"
+ fi
+
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking compiler flags" >&5
printf %s "checking compiler flags... " >&6; }
if test "${GCC}" = "yes" ; then
diff --git a/win/gitmanifest.in b/win/gitmanifest.in
new file mode 100644
index 0000000..3e7de84
--- /dev/null
+++ b/win/gitmanifest.in
@@ -0,0 +1 @@
+git- \ No newline at end of file
diff --git a/win/makefile.vc b/win/makefile.vc
index 9fb01e2..dea104f 100644
--- a/win/makefile.vc
+++ b/win/makefile.vc
@@ -800,8 +800,19 @@ $(TMP_DIR)\tclMainW.obj: $(GENERICDIR)\tclMain.c
$(cc32) $(pkgcflags) /DUNICODE /D_UNICODE \
-Fo$@ $?
-$(TMP_DIR)\tclTest.obj: $(GENERICDIR)\tclTest.c
- $(cc32) $(appcflags) -Fo$@ $?
+$(ROOT)\manifest.uuid:
+ copy $(WIN_DIR)\gitmanifest.in $(ROOT)\manifest.uuid
+ git rev-parse HEAD >>$(ROOT)\manifest.uuid
+
+$(TMP_DIR)\tclUuid.h: $(ROOT)\manifest.uuid
+ copy $(WIN_DIR)\tclUuid.h.in+$(ROOT)\manifest.uuid $(TMP_DIR)\tclUuid.h
+
+$(TMP_DIR)\tclEvent.obj: $(GENERICDIR)\tclEvent.c $(TMP_DIR)\tclUuid.h
+ $(cc32) $(pkgcflags) -I$(TMP_DIR) \
+ -Fo$@ $(GENERICDIR)\tclEvent.c
+
+$(TMP_DIR)\tclTest.obj: $(GENERICDIR)\tclTest.c $(TMP_DIR)\tclUuid.h
+ $(cc32) $(appcflags) -I$(TMP_DIR) -Fo$@ $?
$(TMP_DIR)\tclTestObj.obj: $(GENERICDIR)\tclTestObj.c
$(cc32) $(appcflags) -Fo$@ $?
diff --git a/win/svnmanifest.in b/win/svnmanifest.in
new file mode 100644
index 0000000..18d2cad
--- /dev/null
+++ b/win/svnmanifest.in
@@ -0,0 +1 @@
+svn-r \ No newline at end of file
diff --git a/win/tcl.m4 b/win/tcl.m4
index ee2256d..5d28012 100644
--- a/win/tcl.m4
+++ b/win/tcl.m4
@@ -603,6 +603,7 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
else
extra_cflags="$extra_cflags -DTCL_BROKEN_MAINARGS"
fi
+ hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -fno-lto"
AC_CACHE_CHECK(for working -fno-lto,
ac_cv_nolto,
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])],
@@ -625,6 +626,18 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
fi
fi
+ hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -Wl,--enable-auto-image-base"
+ AC_CACHE_CHECK(for working --enable-auto-image-base,
+ ac_cv_enable_auto_image_base,
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])],
+ [ac_cv_enable_auto_image_base=yes],
+ [ac_cv_enable_auto_image_base=no])
+ )
+ CFLAGS=$hold_cflags
+ if test "$ac_cv_enable_auto_image_base" == "yes" ; then
+ extra_ldflags="$extra_ldflags -Wl,--enable-auto-image-base"
+ fi
+
AC_MSG_CHECKING([compiler flags])
if test "${GCC}" = "yes" ; then
SHLIB_LD=""
diff --git a/win/tclUuid.h.in b/win/tclUuid.h.in
new file mode 100644
index 0000000..cbb83e4
--- /dev/null
+++ b/win/tclUuid.h.in
@@ -0,0 +1 @@
+#define TCL_VERSION_UUID \
diff --git a/win/tclWinInit.c b/win/tclWinInit.c
index 2830a85..e51b909 100644
--- a/win/tclWinInit.c
+++ b/win/tclWinInit.c
@@ -535,7 +535,8 @@ TclpSetVariables(
TCL_GLOBAL_ONLY);
}
-#ifndef NDEBUG
+#if !defined(NDEBUG) && !defined(TCL_NO_DEPRECATED) && TCL_MAJOR_VERSION < 9
+
/*
* 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/tclsh.exe.manifest.in b/win/tclsh.exe.manifest.in
index dd8a7c5..dc652e6 100644
--- a/win/tclsh.exe.manifest.in
+++ b/win/tclsh.exe.manifest.in
@@ -35,6 +35,10 @@
xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">
<dpiAware>true</dpiAware>
</asmv3:windowsSettings>
+ <asmv3:windowsSettings
+ xmlns="http://schemas.microsoft.com/SMI/2019/WindowsSettings">
+ <activeCodePage>UTF-8</activeCodePage>
+ </asmv3:windowsSettings>
</asmv3:application>
<dependency>
<dependentAssembly>