Compare commits

..
Author SHA1 Message Date
jan.nijtmans df2ff9d43d Store userEncoding in Thread Local Storage 2025-05-09 09:04:55 +00:00
jan.nijtmans 980b9441a4 Merge 9.0. Handle one-argument "encoding user" better. 2025-05-09 08:19:24 +00:00
jan.nijtmans 9c7449fb49 Fix [9dcdddeefe]: compiler warnings. No need to put this in changelog, since it's introduced after 9.0.1. 2025-05-08 15:19:32 +00:00
jan.nijtmans a67ca85c2b TIP #718 testcase 2025-05-08 12:42:11 +00:00
jan.nijtmans e00d26bace Fix "make dist". Don't use UTF-8 setting in registry/dde dll's 2025-05-08 08:54:15 +00:00
jan.nijtmans df7ef174ae Merge 8.6 2025-05-07 21:15:53 +00:00
jan.nijtmans 47f3be4dd5 Only call GetACP() once. Cleanup backported from 9.0 2025-05-07 21:01:31 +00:00
jan.nijtmans 4dc1ddd646 Get rid of the "c" version of tclsh in onefiledist.yml 2025-05-07 13:22:05 +00:00
jan.nijtmans 5b20eff788 Disable scan-15.1 (temporary) 2025-05-06 14:52:47 +00:00
jan.nijtmans 3916b47358 Rebase to trunk 2025-05-06 12:51:39 +00:00
sbron adb1650aa3 Fix links to tickets. 2025-05-06 08:46:45 +00:00
apnadkarni 218a91458a Update changes.md for fixed lseq tickets 2025-05-06 07:54:14 +00:00
jan.nijtmans a034b5b04e Fix [8ffd8cabd1]: "encoding system": wrong result without manifest 2025-05-06 07:42:52 +00:00
oehhar a0ecb0cc3c [78f44214] Document Tcl_InitStringRep: copy description from TIP 445: better than nothing... 2025-05-05 16:27:48 +00:00
jan.nijtmans 9e8816331f Merge-mark 2025-05-05 15:38:09 +00:00
jan.nijtmans 8d9737dce6 Fix [b7834045b9]: MS-VC 6 on core-8-6-branch: compile error C2520: conversion from unsigned __int64 to double not implemented, use signed __int64
No need to put it in change log, because regression was caused by [4128866276b86868]
2025-05-05 15:37:13 +00:00
oehhar 165eb1f3e7 Add to changes.md bug section: scan "long mantissa" %g [42d14c] 2025-05-05 14:47:52 +00:00
oehhar 39223e515f Add to changes: 2025-05-05 (bug) [42d14c] Fix scan with long mantissa. Ex.: scan "1.[string repeat 1 191]e-321" %g 2025-05-05 14:41:31 +00:00
oehhar ea6c1b6230 [42d14c495a] Parsing long floating point strings 2025-05-05 14:40:43 +00:00
oehhar 7ece2cabd3 [42d14c495a] Parsing long floating point strings 2025-05-05 14:30:52 +00:00
jan.nijtmans 207bf9aa69 Add "tclsh90c", which has a manifest without UTF-8 setting 2025-05-05 11:42:39 +00:00
jan.nijtmans 974b592602 Rebase (makes use of [8ffd8cabd1]) 2025-05-05 11:22:33 +00:00
jan.nijtmans ab8975174d Proposed fix for [8ffd8cabd1]: "encoding system": wrong result without manifest
Extracted from TIP 716 implementation
2025-05-05 09:14:42 +00:00
jan.nijtmans c7d153cbbb Missing TclOOM() calls, which produce a panic when Tcl_InitStringRep() fails 2025-05-05 06:53:48 +00:00
oehhar 075a14cd43 [42d14c495a] Add source code comment and test case provided by Christian Werner (thanks) 2025-05-05 06:21:52 +00:00
oehhar 0ec38e800a [42d14c495a] Add simple test cases 2025-05-03 13:15:15 +00:00
dgp 4078b3aa79 merge 8.7 2025-05-02 18:30:34 +00:00
dgp 47dd25a0aa Use Tcl_InitStringRep() as intended. 2025-05-02 18:29:24 +00:00
dgp dd843d4484 merge fix 2025-05-02 17:58:06 +00:00
dgp 51df805a81 Rework overflow test so it happens in a valid range. 2025-05-02 17:57:36 +00:00
dgp 6e4e90b77a typo 2025-05-02 16:57:37 +00:00
jan.nijtmans ac3567a097 Indenting and comments, backported from 9.1 2025-04-29 13:48:09 +00:00
jan.nijtmans 9d4ac69dfc Rebase to tip-716 2025-04-29 11:13:24 +00:00
jan.nijtmans e9fe9e755c Unbreak (gcc) build 2025-04-29 08:51:25 +00:00
jan.nijtmans 45b9ed7703 typo (breaks static MSVC build) 2025-04-29 08:35:32 +00:00
jan.nijtmans 090e5041f7 Have both tclsh90.exe (full compatibility) and tclsh90c.exe (without UTF-8 in manifest) side-by-side 2025-04-28 15:10:54 +00:00
apnadkarni 67681ec324 Fix cmdAH tests. See comments below.
Tcl_GetEncodingForUser will not be available until 9.1 for stubs compatibility.
In any case, as a rule, wide char API's should be used in code and tests to avoid the exact kind
of problems we are currently trying to solve with code pages.
2025-04-28 11:30:02 +00:00
apnadkarni a905678adc Minor tweak. Pass interp as NULL as error thrown away. 2025-04-28 09:51:38 +00:00
apnadkarni 96b3e6bc09 Fix [7d3101bf28] and [452b103a74] - lseq indexing crashes. 2025-04-28 09:01:15 +00:00
jan.nijtmans 8e247cc6a3 Attempt to fix cmdAH test failures. Doesn't work. 2025-04-28 07:37:06 +00:00
apnadkarni 6625300b0d Fix compiled indexlist for lseq 2025-04-28 03:05:52 +00:00
apnadkarni 7e6ae2d3b4 Partial fix and test cases for bug [452b103a74] - lseq nested indices 2025-04-27 14:59:58 +00:00
apnadkarni 1bd82c3ea9 Fix [7d3101bf28] - crash on out of bounds lindex into lseq 2025-04-27 10:48:52 +00:00
apnadkarni 81f7db2d51 Fix lindex crash on non-numeric index into lseq 2025-04-27 10:42:36 +00:00
apnadkarni 1fd30794f5 Crash tests for bugs [45b2] and [7d31] 2025-04-27 10:29:26 +00:00
jan.nijtmans d1d3fd976d Protect TclWinGetUserEncoding() for environments it doen't exist, e.g. Tcl 9.0.0/9.0.1 2025-04-25 08:11:10 +00:00
jan.nijtmans 03eff5665c Unneeded (char *) typecast 2025-04-24 10:06:25 +00:00
jan.nijtmans d8dbc22dc7 Implement "encoding user" without TIP #716 2025-04-24 09:51:35 +00:00
jan.nijtmans 07df807261 VarHashCreateVar() isn't used in tclExecute.c 2025-04-20 16:58:24 +00:00
jan.nijtmans f2e4744fc4 Merge 9.0 2025-04-18 14:04:28 +00:00
dgp b1b52b0143 Correct false claims in the header comment of RequiredPrecision() 2025-04-16 17:34:13 +00:00
apnadkarni 2c5e45746f Fix Unix build. Add basic tests 2025-04-14 16:15:05 +00:00
apnadkarni 6beacbba8a Added -encoding option to exec 2025-04-12 16:57:22 +00:00
apnadkarni ad696be16d Added encoding user command 2025-04-12 15:11:18 +00:00
apnadkarni 8e89253fad Start on TIP 716 implementation 2025-04-12 12:03:19 +00:00
jan.nijtmans aeecd32b9b Proposed fix for [42d14c495a]: Parsing long floating point strings (thanks, Christian) 2025-04-02 21:18:41 +00:00
147 changed files with 3315 additions and 1675 deletions
+3 -2
View File
@@ -11,7 +11,7 @@ permissions:
jobs:
linux:
name: Linux
runs-on: ubuntu-24.04
runs-on: ubuntu-22.04
defaults:
run:
shell: bash
@@ -124,7 +124,7 @@ jobs:
url: ${{ steps.upload.outputs.artifact-url }}
win:
name: Windows
runs-on: windows-2025
runs-on: windows-2019
defaults:
run:
shell: msys2 {0}
@@ -153,6 +153,7 @@ jobs:
run: |
make binaries libraries
echo "TCL_ZIP=`pwd`/`echo libtcl*.zip`" >> $GITHUB_ENV
rm tclsh*c*.exe
working-directory: win
- name: Get Exact Version
run: |
+4 -4
View File
@@ -1,6 +1,6 @@
# README: Tcl
This is the **Tcl 9.1a0** source distribution.
This is the **Tcl 9.0.2** source distribution.
You can get any source release of Tcl from [our distribution
site](https://sourceforge.net/projects/tcl/files/Tcl/).
@@ -51,7 +51,7 @@ and selling it either in whole or in part. See the file
## <a id="doc">2.</a> Documentation
Extensive documentation is available on our website.
The home page for this release, including new features, is
[here](https://www.tcl-lang.org/software/tcltk/9.1.html).
[here](https://www.tcl-lang.org/software/tcltk/9.0.html).
Detailed release notes can be found at the
[file distributions page](https://sourceforge.net/projects/tcl/files/Tcl/)
by clicking on the relevant version.
@@ -61,8 +61,8 @@ Xchange](https://www.tcl-lang.org/about/).
There have been many Tcl books on the market. Many are mentioned in
[the Wiki](https://wiki.tcl-lang.org/_/ref?N=25206).
The complete set of reference manual entries for Tcl 9.1 is [online,
here](https://www.tcl-lang.org/man/tcl9.1/).
The complete set of reference manual entries for Tcl 9.0 is [online,
here](https://www.tcl-lang.org/man/tcl9.0/).
### <a id="doc.unix">2a.</a> Unix Documentation
The `doc` subdirectory in this release contains a complete set of
+203 -4
View File
@@ -4,12 +4,211 @@ changes to the Tcl source code at
> [Tcl Source Code](https://core.tcl-lang.org/tcl/timeline)
Release Tcl 9.1a0 arises from the check-in with tag `core-9-1-a0`.
Release Tcl 9.0.2 arises from the check-in with tag `core-9-0-2`.
Highlighted differences between Tcl 9.1 and Tcl 9.0 are summarized below,
Tcl patch releases have the primary purpose of delivering bug fixes
to the userbase.
# Bug fixes
- [Better error-message than "interpreter uses an incompatible stubs mechanism"](https://core.tcl-lang.org/tcl/tktview/fc3509)
- [\[$interp eval $lambda\] after \[eval $lambda\] or vice versa fails](https://core.tcl-lang.org/tcl/tktview/67d5f7)
- [tcl::mathfunc::isunordered inconsistency with some integer values](https://core.tcl-lang.org/tcl/tktview/98006f)
- [test lseq hangs with -Os](https://core.tcl-lang.org/tcl/tktview/d2a3c5)
- [exec does not handle app execution aliases on Windows](https://core.tcl-lang.org/tcl/tktview/4f0b57)
- [auto_execok does not find several built-in cmd commands](https://core.tcl-lang.org/tcl/tktview/4e2c8b)
- [Panic "Buffer Underflow, BUFFER_PADDING not enough"](https://core.tcl-lang.org/tcl/tktview/73bb42)
- [MS-VS build system: pckIndex.tcl when building for 9 misses "t" for TCL 8.6 part](https://core.tcl-lang.org/tcl/tktview/a77029)
- [clock format -locale does not look up locale children if parent locale used first](https://core.tcl-lang.org/tcl/tktview/2c0f49)
- [Missing libtcl?.?.dll.a in Cygwin](https://core.tcl-lang.org/tcl/tktview/dcedba)
- [tclEpollNotfy PlatformEventsControl panics if websocket disconnected](https://core.tcl-lang.org/tcl/tktview/010d8f)
- [Tcl_InitStubs compatibility for 9.1](https://core.tcl-lang.org/tcl/tktview/fd8341)
- [proc with more than 2**31 variables](https://core.tcl-lang.org/tcl/tktview/92aeb8)
- [scan "long mantissa" %g](https://core.tcl-lang.org/tcl/tktview/42d14c)
- ["encoding system": wrong result without manifest](https://core.tcl-lang.org/tcl/tktview/8ffd8c)
- [lseq crash on out-of-range index](https://core.tcl-lang.org/tcl/tktview/7d3101)
- [lseq crash on nested indices](https://core.tcl-lang.org/tcl/tktview/452b10)
# Incompatibilities
- No known incompatibilities with the Tcl 9.0.0 public interface.
# Updated bundled packages, libraries, standards, data
- sqlite3 3.49.1
- tzdata 2025b
Release Tcl 9.0.1 arises from the check-in with tag `core-9-0-1`.
Tcl patch releases have the primary purpose of delivering bug fixes
to the userbase. As the first patch release in the Tcl 9.0.\* series,
Tcl 9.0.1 also includes a small number of interface changes that complete
some incomplete features first delivered in Tcl 9.0.0.
# Completed 9.0 Features and Interfaces
- [TIP 701 - Tcl_FSTildeExpand C API](https://core.tcl-lang.org/tips/doc/trunk/tip/701.md)
- [TIP 707 - ptrAndSize internal rep in Tcl_Obj](https://core.tcl-lang.org/tips/doc/trunk/tip/707.md)
- [Size modifiers j, q, z, t not implemented]( https://core.tcl-lang.org/tcl/info/c4f365)
# Bug fixes
- [regression in tzdata, %z instead of offset TZ-name](https://core.tcl-lang.org/tcl/tktview/2c237b)
- [Tcl will not start properly if there is an init.tcl file in the current dir](https://core.tcl-lang.org/tcl/tktview/43c94f)
- [clock scan "24:00", ISO-8601 compatibility](https://core.tcl-lang.org/tcl/tktview/aee9f2)
- [Temporary folder with file "tcl9registry13.dll" remains after "exit"](https://core.tcl-lang.org/tcl/tktview/6ce3c0)
- [Wrong result by "lsearch -stride -subindices -inline -all"](https://core.tcl-lang.org/tcl/info/5a1aaa)
- [TIP 609 - required Tcl_ThreadAlert() skipped with nested event loop](https://core.tcl-lang.org/tcl/info/c7e4c4)
- [buffer overwrite for non-BMP characters in utf-16](https://core.tcl-lang.org/tcl/tktview/66da4d)
- [zipfs info on mountpoint of executable returns zero offset in field 4"](https://core.tcl-lang.org/tcl/info/aaa84f)
- [zlib-8.8, zlib-8.16 fail on Fedora 40, gcc 14.1.1](https://core.tcl-lang.org/tcl/tktview/73d5cb)
- [install registry and dde in $INSTALL_DIR\lib always](https://core.tcl-lang.org/tcl/tktview/364bd9)
- [cannot build .chm help file (Windows)](https://core.tcl-lang.org/tcl/tktview/bb110c)
# Incompatibilities
- No known incompatibilities with the Tcl 9.0.0 public interface.
# Updated bundled packages, libraries, standards, data
- Itcl 4.3.2
- sqlite3 3.47.2
- Thread 3.0.1
- TDBC\* 1.1.10
- tcltest 2.5.9
- tzdata 2024b, corrected
Release Tcl 9.0.0 arises from the check-in with tag `core-9-0-0`.
Highlighted differences between Tcl 9.0 and Tcl 8.6 are summarized below,
with focus on changes important to programmers using the Tcl library and
writing Tcl scripts.
# Bug fixes
- [tclEpollNotfy PlatformEventsControl panics if websocket disconnected](https://core.tcl-lang.org/tcl/tktview/010d8f38)
# Major Features
## 64-bit capacity: Data values larger than 2Gb
- Strings can be any length (that fits in your available memory)
- Lists and dictionaries can have very large numbers of elements
## Internationalization of text
- Full Unicode range of codepoints
- New encodings: `utf-16`/`utf-32`/`ucs-2`(`le`|`be`), `CESU-8`, etc.
- `encoding` options `-profile`, `-failindex` manage encoding of I/O.
- `msgcat` supports custom locale search list
- `source` defaults to `-encoding utf-8`
## Zip filesystems and attached archives.
- Packaging of the Tcl script library with the Tcl binary library,
meaning that the `TCL_LIBRARY` environment variable is usually not required.
- Packaging of an application into a virtual filesystem is now a supported
core Tcl feature.
## Unix notifiers available using `epoll()` or `kqueue()`
- This relieves limits on file descriptors imposed by legacy `select()` and fixes a performance bottleneck.
# Incompatibilities
## Notable incompatibilities
- Unqualified varnames resolved in current namespace, not global.
Note that in almost all cases where this causes a change, the change is actually the removal of a latent bug.
- No `--disable-threads` build option. Always thread-enabled.
- I/O malencoding default response: raise error (`-profile strict`)
- Windows platform needs Windows 7 or Windows Server 2008 R2 or later
- Ended interpretation of `~` as home directory in pathnames.
(See `file home` and `file tildeexpand` for replacements when you need them.)
- Removed the `identity` encoding.
(There were only ever very few valid use cases for this; almost all uses
were systematically wrong.)
- Removed the encoding alias `binary` to `iso8859-1`.
- `$::tcl_precision` no longer controls string generation of doubles.
(If you need a particular precision, use `format`.)
- Removed pre-Tcl 8 legacies: `case`, `puts` and `read` variant syntaxes.
- Removed subcommands [`trace variable`|`vdelete`|`vinfo`]
- Removed `-eofchar` option for write channels.
- On Windows 10+ (Version 1903 or higher), system encoding is always utf-8.
- `%b`/`%d`/`%o`/`%x` format modifiers (without size modifier) for `format`
and `scan` always truncate to 32-bits on all platforms.
- `%L` size modifier for `scan` no longer truncates to 64-bit.
- Removed command `::tcl::unsupported::inject`.
(See `coroinject` and `coroprobe` for supported commands with significantly
more comprehensible semantics.)
## Incompatibilities in C public interface
- Extensions built against Tcl 8.6 and before will not work with Tcl 9.0;
ABI compatibility was a non-goal for 9.0. In _most_ cases, rebuilding
against Tcl 9.0 should work except when a removed API function is used.
- Many arguments expanded type from `int` to `Tcl_Size`, a signed integer type
large enough to support 64-bit sized memory objects.
The constant `TCL_AUTO_LENGTH` is a value of that type that indicates that
the length should be obtained using an appropriate function (typically `strlen()` for `char *` values).
- Ended support for `Tcl_ChannelTypeVersion` less than 5
- Introduced versioning of the `Tcl_ObjType` struct
- Removed macros `CONST*`: Tcl 9 support means dropping Tcl 8.3 support.
(Replaced with standard C `const` keyword going forward.)
- Removed registration of several `Tcl_ObjType`s.
- Removed API functions:
`Tcl_Backslash()`,
`Tcl_*VA()`,
`Tcl_*MathFunc*()`,
`Tcl_MakeSafe()`,
`Tcl_(Save|Restore|Discard|Free)Result()`,
`Tcl_EvalTokens()`,
`Tcl_(Get|Set)DefaultEncodingDir()`,
`Tcl_UniCharN(case)cmp()`,
`Tcl_UniCharCaseMatch()`
- Revised many internals; beware reliance on undocumented behaviors.
# New Features
## New commands
- `array default` — Specify default values for arrays (note that this alters the behaviour of `append`, `incr`, `lappend`).
- `array for` — Cheap iteration over an array's contents.
- `chan isbinary` — Test if a channel is configured to work with binary data.
- `coroinject`, `coroprobe` — Interact with paused coroutines.
- `clock add weekdays` — Clock arithmetic with week days.
- `const`, `info const*` — Commands for defining constants (variables that can't be modified).
- `dict getwithdefault` — Define a fallback value to use when `dict get` would otherwise fail.
- `file home` — Get the user home directory.
- `file tempdir` — Create a temporary directory.
- `file tildeexpand` — Expand a file path containing a `~`.
- `info commandtype` — Introspection for the kinds of commands.
- `ledit` — Equivalent to `lreplace` but on a list in a variable.
- `lpop` — Remove an item from a list in a variable.
- `lremove` — Remove a sublist from a list in a variable.
- `lseq` — Generate a list of numbers in a sequence.
- `package files` — Describe the contents of a package.
- `string insert` — Insert a string as a substring of another string.
- `string is dict` — Test whether a string is a dictionary.
- `tcl::process` — Commands for working with subprocesses.
- `*::build-info` — Obtain information about the build of Tcl.
- `readFile`, `writeFile`, `foreachLine` — Simple procedures for basic working with files.
- `tcl::idna::*` — Commands for working with encoded DNS names.
## New command options
- `chan configure ... -inputmode ...` — Support for raw terminal input and reading passwords.
- `clock scan ... -validate ...`
- `info loaded ... ?prefix?`
- `lsearch ... -stride ...` — Search a list by groups of items.
- `regsub ... -command ...` — Generate the replacement for a regular expression by calling a command.
- `socket ... -nodelay ... -keepalive ...`
- `vwait` controlled by several new options
- `expr` string comparators `lt`, `gt`, `le`, `ge`
- `expr` supports comments inside expressions
## Numbers
- <code>0<i>NNN</i></code> format is no longer octal interpretation. Use <code>0o<i>NNN</i></code>.
- <code>0d<i>NNNN</i></code> format to compel decimal interpretation.
- <code>NN_NNN_NNN</code>, underscores in numbers for optional readability
- Functions: `isinf()`, `isnan()`, `isnormal()`, `issubnormal()`, `isunordered()`
- Command: `fpclassify`
- Function `int()` no longer truncates to word size
## TclOO facilities
- private variables and methods
- class variables and methods
- abstract and singleton classes
- configurable properties
- `method -export`, `method -unexport`
# Known bugs
- [changed behaviour wrt command names, namespaces and resolution](https://core.tcl-lang.org/tcl/tktview/f14b33)
- [windows dos device paths inconsistencies and missing functionality](https://core.tcl-lang.org/tcl/tktview/d8f121)
- [load library (dll) from zipfs-library causes a leak in temporary folder](https://core.tcl-lang.org/tcl/tktview/a8e4f7)
- [lsearch -sorted -inline -subindices incorrect result](https://core.tcl-lang.org/tcl/tktview/bc4ac0)
- ["No error" when load fails due to a missing secondary DLL](https://core.tcl-lang.org/tcl/tktview/bc4ac0)
+1 -1
View File
@@ -276,7 +276,7 @@ The \fIhashKeyProc\fR member contains the address of a function called to
calculate a hash value for the key.
.PP
.CS
typedef size_t \fBTcl_HashKeyProc\fR(
typedef TCL_HASH_TYPE \fBTcl_HashKeyProc\fR(
Tcl_HashTable *\fItablePtr\fR,
void *\fIkeyPtr\fR);
.CE
+1 -1
View File
@@ -32,7 +32,7 @@ int
.sp
\fBTcl_LimitTypeReset\fR(\fIinterp, type\fR)
.sp
Tcl_Size
int
\fBTcl_LimitGetCommands\fR(\fIinterp\fR)
.sp
\fBTcl_LimitSetCommands\fR(\fIinterp, commandLimit\fR)
+1 -1
View File
@@ -28,7 +28,7 @@ Tcl_Obj *
int
\fBTcl_IsShared\fR(\fIobjPtr\fR)
.sp
\fBTcl_InvalidateStringRep\fR(\fIobjPtr\fR)3
\fBTcl_InvalidateStringRep\fR(\fIobjPtr\fR)
.fi
.SH ARGUMENTS
.AS Tcl_Obj *objPtr
+11
View File
@@ -128,6 +128,17 @@ When \fInumBytes\fR is greater than zero, and the returned pointer is
representation.
The caller may then choose whether to raise an error or panic.
.PP
\fBTcl_InitStringRep\fR performs the function of the existing internal macro
\fBTclInitStringRep\fR, but is extended to return a pointer to the string rep,
and to accept \fBNULL\fR as a value for bytes.
When \fIbytes\fR is \fBNULL\fR and \fIobjPtr\fR has no string rep, an uninitialzed
buffer of numBytes bytes is created for filling by the caller.
When \fIbytes\fR is \fBNULL\fR and \fIobjPtr\fR has a string rep, the string
rep will be truncated to a length of numBytes bytes.
When numBytes is greater than zero, and the returned pointer is \fBNULL\fR, that
indicates a failure to allocate memory for the string representation.
The caller may then choose whether to raise an error or panic.
.PP
\fBTcl_HasStringRep\fR returns a boolean indicating whether or not a string
rep is currently stored in \fIobjPtr\fR.
This is used when the caller wants to act on \fIobjPtr\fR differently
+1 -11
View File
@@ -8,7 +8,7 @@
.so man.macros
.BS
.SH NAME
Tcl_NewStringObj, Tcl_NewUnicodeObj, Tcl_SetStringObj, Tcl_SetUnicodeObj, Tcl_GetStringFromObj, Tcl_GetString, Tcl_GetUnicodeFromObj, Tcl_GetUnicode, Tcl_GetUniChar, Tcl_GetCharLength, Tcl_GetRange, Tcl_AppendToObj, Tcl_AppendUnicodeToObj, Tcl_AppendObjToObj, Tcl_AppendStringsToObj, Tcl_AppendLimitedToObj, Tcl_Format, Tcl_AppendFormatToObj, Tcl_ObjPrintf, Tcl_AppendPrintfToObj, Tcl_SetObjLength, Tcl_AttemptSetObjLength, Tcl_ConcatObj, Tcl_IsEmpty \- manipulate Tcl values as strings
Tcl_NewStringObj, Tcl_NewUnicodeObj, Tcl_SetStringObj, Tcl_SetUnicodeObj, Tcl_GetStringFromObj, Tcl_GetString, Tcl_GetUnicodeFromObj, Tcl_GetUnicode, Tcl_GetUniChar, Tcl_GetCharLength, Tcl_GetRange, Tcl_AppendToObj, Tcl_AppendUnicodeToObj, Tcl_AppendObjToObj, Tcl_AppendStringsToObj, Tcl_AppendLimitedToObj, Tcl_Format, Tcl_AppendFormatToObj, Tcl_ObjPrintf, Tcl_AppendPrintfToObj, Tcl_SetObjLength, Tcl_AttemptSetObjLength, Tcl_ConcatObj \- manipulate Tcl values as strings
.SH SYNOPSIS
.nf
\fB#include <tcl.h>\fR
@@ -81,9 +81,6 @@ int
.sp
Tcl_Obj *
\fBTcl_ConcatObj\fR(\fIobjc, objv\fR)
.sp
int
\fBTcl_IsEmpty\fR(\fIfIobjPtr\fR)
.fi
.SH ARGUMENTS
.AS "const Tcl_UniChar" *appendObjPtr in/out
@@ -406,13 +403,6 @@ white space, then that value is ignored entirely. This white-space
removal was added to make the output of the \fBconcat\fR command
cleaner-looking. \fBTcl_ConcatObj\fR returns a pointer to a
newly-created value whose ref count is zero.
.PP
The \fBTcl_IsEmpty\fR function returns 1 if \fIobjPtr\fR is the empty
string, 0 otherwise.
It doesn't generate the string representation (unless there
is no other way to do it), so it can safely be called on lists with
billions of elements, or any other data structure for which
it is impossible or expensive to construct the string representation.
.SH "REFERENCE COUNT MANAGEMENT"
.PP
\fBTcl_NewStringObj\fR, \fBTcl_NewUnicodeObj\fR, \fBTcl_Format\fR,
+1 -1
View File
@@ -13,7 +13,7 @@
registry \- Manipulate the Windows registry
.SH SYNOPSIS
.nf
\fBpackage require registry 1.4\fR
\fBpackage require registry 1.3\fR
\fBregistry \fR?\fI\-mode\fR? \fIoption keyName\fR ?\fIarg arg ...\fR?
.fi
+1 -1
View File
@@ -412,7 +412,7 @@ newsub(
sco = cm->cd[co].sub;
if (sco == NOSUB) { /* color has no open subcolor */
if (cm->cd[co].nchrs == 1) { /* optimization */
return (color)co;
return co;
}
sco = newcolor(cm); /* must create subcolor */
if (sco == COLORLESS) {
+7 -7
View File
@@ -592,8 +592,8 @@ sortins(
{
struct arc **sortarray;
struct arc *a;
size_t n = s->nins;
size_t i;
int n = s->nins;
int i;
if (n <= 1) {
return; /* nothing to do */
@@ -668,8 +668,8 @@ sortouts(
{
struct arc **sortarray;
struct arc *a;
size_t n = s->nouts;
size_t i;
int n = s->nouts;
int i;
if (n <= 1) {
return; /* nothing to do */
@@ -1872,12 +1872,12 @@ fixempties(
struct state *nexts;
struct arc *a;
struct arc *nexta;
size_t totalinarcs;
int totalinarcs;
struct arc **inarcsorig;
struct arc **arcarray;
int arccount;
size_t prevnins;
size_t nskip;
int prevnins;
int nskip;
/*
* First, get rid of any states whose sole out-arc is an EMPTY,
+27 -27
View File
@@ -48,7 +48,7 @@ static void parseqatom(struct vars *, int, int, struct state *, struct state *,
static void nonword(struct vars *, int, struct state *, struct state *);
static void word(struct vars *, int, struct state *, struct state *);
static int scannum(struct vars *);
static void repeat(struct vars *, struct state *, struct state *, size_t, size_t);
static void repeat(struct vars *, struct state *, struct state *, int, int);
static void bracket(struct vars *, struct state *, struct state *);
static void cbracket(struct vars *, struct state *, struct state *);
static void brackpart(struct vars *, struct state *, struct state *);
@@ -64,8 +64,8 @@ static void markst(struct subre *);
static void cleanst(struct vars *);
static long nfatree(struct vars *, struct subre *, FILE *);
static long nfanode(struct vars *, struct subre *, FILE *);
static size_t newlacon(struct vars *, struct state *, struct state *, size_t);
static void freelacons(struct subre *, size_t);
static int newlacon(struct vars *, struct state *, struct state *, int);
static void freelacons(struct subre *, int);
static void rfree(regex_t *);
static void dump(regex_t *, FILE *);
static void dumpst(struct subre *, FILE *, int);
@@ -205,7 +205,7 @@ struct vars {
int cflags; /* copy of compile flags */
int lasttype; /* type of previous token */
int nexttype; /* type of next token */
chr nextvalue; /* value (if any) of next token */
size_t nextvalue; /* value (if any) of next token */
int lexcon; /* lexical context type (see lex.c) */
size_t nsubexp; /* subexpression count */
struct subre **subs; /* subRE pointer vector */
@@ -685,7 +685,7 @@ parse(
NOERRN();
branch->left = parsebranch(v, stopper, type, left, right, 0);
NOERRN();
branch->flags |= (char)(UP(branch->flags | branch->left->flags));
branch->flags |= UP(branch->flags | branch->left->flags);
if ((branch->flags &~ branches->flags) != 0) { /* new flags */
for (t = branches; t != branch; t = t->right) {
t->flags |= branch->flags;
@@ -788,12 +788,12 @@ parseqatom(
{
struct state *s; /* temporaries for new states */
struct state *s2;
#define ARCV(t, val) newarc(v->nfa, (t), (pcolor)(val), lp, rp)
size_t m, n;
#define ARCV(t, val) newarc(v->nfa, t, val, lp, rp)
int m, n;
struct subre *atom; /* atom's subtree */
struct subre *t;
size_t cap; /* capturing parens? */
size_t pos; /* positive lookahead? */
int cap; /* capturing parens? */
int pos; /* positive lookahead? */
size_t subno; /* capturing-parens or backref number */
int atomtype;
int qprefer; /* quantifier short/long preference */
@@ -990,7 +990,7 @@ parseqatom(
break;
case BACKREF: /* the Feature From The Black Lagoon */
INSIST(type != LACON, REG_ESUBREG);
INSIST((size_t)v->nextvalue < v->nsubs, REG_ESUBREG);
INSIST(v->nextvalue < v->nsubs, REG_ESUBREG);
INSIST(v->subs[v->nextvalue] != NULL, REG_ESUBREG);
NOERR();
assert(v->nextvalue > 0);
@@ -1094,7 +1094,7 @@ parseqatom(
if (atom != NULL) {
freesubre(v, atom);
}
top->flags = (char)f;
top->flags = f;
return;
}
@@ -1204,7 +1204,7 @@ parseqatom(
repeat(v, atom->begin, atom->end, m, n);
atom->min = (short) m;
atom->max = (short) n;
atom->flags |= (char)COMBINE(qprefer, atom->flags);
atom->flags |= COMBINE(qprefer, atom->flags);
/* rest of branch can be strung starting from atom->end */
s2 = atom->end;
} else if (m == 1 && n == 1) {
@@ -1268,8 +1268,8 @@ parseqatom(
}
NOERR();
assert(SEE('|') || SEE(stopper) || SEE(EOS));
t->flags |= (char)COMBINE(t->flags, t->right->flags);
top->flags |= (char)COMBINE(top->flags, t->flags);
t->flags |= COMBINE(t->flags, t->right->flags);
top->flags |= COMBINE(top->flags, t->flags);
}
/*
@@ -1346,13 +1346,13 @@ repeat(
struct vars *v,
struct state *lp,
struct state *rp,
size_t m,
size_t n)
int m,
int n)
{
#define SOME 2
#define INF 3
#define PAIR(x, y) ((x)*4 + (y))
#define REDUCE(x) ( ((x) == DUPINF) ? INF : (((x) > 1) ? SOME : (int)(x)) )
#define REDUCE(x) ( ((x) == DUPINF) ? INF : (((x) > 1) ? SOME : (x)) )
const int rm = REDUCE(m);
const int rn = REDUCE(n);
struct state *s, *s2;
@@ -1660,7 +1660,7 @@ dovec(
{
chr ch, from, to;
const chr *p;
size_t i;
int i;
for (p = cv->chrs, i = cv->nchrs; i > 0; p++, i--) {
ch = *p;
@@ -1744,8 +1744,8 @@ sub_re(
assert(strchr("=b|.*(", op) != NULL);
ret->op = (char)op;
ret->flags = (char)flags;
ret->op = op;
ret->flags = flags;
ret->id = 0; /* will be assigned later */
ret->subno = 0;
ret->min = ret->max = 1;
@@ -1944,16 +1944,16 @@ nfanode(
/*
- newlacon - allocate a lookahead-constraint subRE
^ static size_t newlacon(struct vars *, struct state *, struct state *, size_t);
^ static int newlacon(struct vars *, struct state *, struct state *, int);
*/
static size_t /* lacon number */
static int /* lacon number */
newlacon(
struct vars *v,
struct state *begin,
struct state *end,
size_t pos)
int pos)
{
size_t n;
int n;
struct subre *newlacons;
struct subre *sub;
@@ -1988,10 +1988,10 @@ newlacon(
static void
freelacons(
struct subre *subs,
size_t n)
int n)
{
struct subre *sub;
size_t i;
int i;
assert(n > 0);
for (sub=subs+1, i=n-1; i>0; sub++, i--) { /* no 0th */
@@ -2135,7 +2135,7 @@ stdump(
fprintf(f, " UNUSED");
}
if (t->subno != 0) {
fprintf(f, " (#%" TCL_Z_MODIFIER "d)", t->subno);
fprintf(f, " (#%d)", t->subno);
}
if (t->min != 1 || t->max != 1) {
fprintf(f, " {%d,", t->min);
+3 -3
View File
@@ -414,14 +414,14 @@ freeDFA(
/*
- hash - construct a hash code for a bitvector
* There are probably better ways, but they're more expensive.
^ static unsigned hash(unsigned *, size_t);
^ static unsigned hash(unsigned *, int);
*/
static unsigned
hash(
unsigned *const uv,
size_t n)
int n)
{
size_t i;
int i;
unsigned h;
h = 0;
+5 -6
View File
@@ -145,7 +145,7 @@ static chr *shortest(struct vars *const, struct dfa *const, chr *const, chr *con
static chr *lastCold(struct vars *const, struct dfa *const);
static struct dfa *newDFA(struct vars *const, struct cnfa *const, struct colormap *const, struct smalldfa *);
static void freeDFA(struct dfa *const);
static unsigned hash(unsigned *const, size_t);
static unsigned hash(unsigned *const, int);
static struct sset *initialize(struct vars *const, struct dfa *const, chr *const);
static struct sset *miss(struct vars *const, struct dfa *const, struct sset *const, const pcolor, chr *const, chr *const);
static int checkLAConstraint(struct vars *const, struct cnfa *const, chr *const, const pcolor);
@@ -171,8 +171,8 @@ exec(
{
AllocVars(v);
int st, backref;
size_t n;
size_t i;
int n;
int i;
#define LOCALMAT 20
regmatch_t mat[LOCALMAT];
#define LOCALDFAS 40
@@ -592,7 +592,7 @@ subset(
chr *const begin,
chr *const end)
{
size_t n = sub->subno;
int n = sub->subno;
assert(n > 0);
if ((size_t)n >= v->nmatch) {
@@ -874,8 +874,7 @@ cbrdissect(
chr *begin, /* beginning of relevant substring */
chr *end) /* end of same */
{
size_t n = t->subno;
int min = t->min, max = t->max;
int n = t->subno, min = t->min, max = t->max;
size_t numreps;
size_t tlen;
size_t brlen;
+1 -1
View File
@@ -364,7 +364,7 @@ struct subre {
#define PREF2(f1, f2) ((PREF(f1) != 0) ? PREF(f1) : PREF(f2))
#define COMBINE(f1, f2) (UP((f1)|(f2)) | PREF2(f1, f2))
short id; /* ID of subre (1..ntree-1) */
size_t subno; /* subexpression number (for 'b' and '(') */
int subno; /* subexpression number (for 'b' and '(') */
short min; /* min repetitions for iteration or backref */
short max; /* max repetitions for iteration or backref */
struct subre *left; /* left child, if any (also freelist chain) */
+26 -17
View File
@@ -40,22 +40,22 @@ declare 2 {
TCL_NORETURN void Tcl_Panic(const char *format, ...)
}
declare 3 {
void *Tcl_Alloc(size_t size)
void *Tcl_Alloc(TCL_HASH_TYPE size)
}
declare 4 {
void Tcl_Free(void *ptr)
}
declare 5 {
void *Tcl_Realloc(void *ptr, size_t size)
void *Tcl_Realloc(void *ptr, TCL_HASH_TYPE size)
}
declare 6 {
void *Tcl_DbCkalloc(size_t size, const char *file, int line)
void *Tcl_DbCkalloc(TCL_HASH_TYPE size, const char *file, int line)
}
declare 7 {
void Tcl_DbCkfree(void *ptr, const char *file, int line)
}
declare 8 {
void *Tcl_DbCkrealloc(void *ptr, size_t size,
void *Tcl_DbCkrealloc(void *ptr, TCL_HASH_TYPE size,
const char *file, int line)
}
@@ -129,6 +129,17 @@ declare 29 {
declare 30 {
void TclFreeObj(Tcl_Obj *objPtr)
}
declare 31 {
int Tcl_GetBoolean(Tcl_Interp *interp, const char *src, int *intPtr)
}
declare 32 {
int Tcl_GetBooleanFromObj(Tcl_Interp *interp, Tcl_Obj *objPtr,
int *intPtr)
}
# Only available in Tcl 8.x, NULL in Tcl 9.0
declare 33 {
unsigned char *Tcl_GetByteArrayFromObj(Tcl_Obj *objPtr, Tcl_Size *numBytesPtr)
}
declare 34 {
int Tcl_GetDouble(Tcl_Interp *interp, const char *src, double *doublePtr)
}
@@ -248,6 +259,10 @@ declare 79 {
declare 80 {
void Tcl_CancelIdleCall(Tcl_IdleProc *idleProc, void *clientData)
}
# Only available in Tcl 8.x, NULL in Tcl 9.0
declare 81 {
int Tcl_Close(Tcl_Interp *interp, Tcl_Channel chan)
}
declare 82 {
int Tcl_CommandComplete(const char *cmd)
}
@@ -1202,7 +1217,7 @@ declare 392 {
}
declare 393 {
int Tcl_CreateThread(Tcl_ThreadId *idPtr, Tcl_ThreadCreateProc *proc,
void *clientData, size_t stackSize, int flags)
void *clientData, TCL_HASH_TYPE stackSize, int flags)
}
# Introduced in 8.3.2
@@ -1309,16 +1324,16 @@ declare 427 {
int flags, Tcl_CommandTraceProc *proc, void *clientData)
}
declare 428 {
void *Tcl_AttemptAlloc(size_t size)
void *Tcl_AttemptAlloc(TCL_HASH_TYPE size)
}
declare 429 {
void *Tcl_AttemptDbCkalloc(size_t size, const char *file, int line)
void *Tcl_AttemptDbCkalloc(TCL_HASH_TYPE size, const char *file, int line)
}
declare 430 {
void *Tcl_AttemptRealloc(void *ptr, size_t size)
void *Tcl_AttemptRealloc(void *ptr, TCL_HASH_TYPE size)
}
declare 431 {
void *Tcl_AttemptDbCkrealloc(void *ptr, size_t size,
void *Tcl_AttemptDbCkrealloc(void *ptr, TCL_HASH_TYPE size,
const char *file, int line)
}
declare 432 {
@@ -1689,7 +1704,7 @@ declare 531 {
void Tcl_LimitTypeReset(Tcl_Interp *interp, int type)
}
declare 532 {
Tcl_Size Tcl_LimitGetCommands(Tcl_Interp *interp)
int Tcl_LimitGetCommands(Tcl_Interp *interp)
}
declare 533 {
void Tcl_LimitGetTime(Tcl_Interp *interp, Tcl_Time *timeLimitPtr)
@@ -2129,7 +2144,7 @@ declare 636 {
}
declare 637 {
char *Tcl_InitStringRep(Tcl_Obj *objPtr, const char *bytes,
size_t numBytes)
TCL_HASH_TYPE numBytes)
}
declare 638 {
Tcl_ObjInternalRep *Tcl_FetchInternalRep(Tcl_Obj *objPtr, const Tcl_ObjType *typePtr)
@@ -2363,12 +2378,6 @@ declare 689 {
# ----- BASELINE -- FOR -- 8.7.0 / 9.0.0 ----- #
declare 690 {
int Tcl_IsEmpty(Tcl_Obj *obj)
}
# ----- BASELINE -- FOR -- 9.1.0 ----- #
declare 691 {
void TclUnusedStubEntry(void)
}
+134 -31
View File
@@ -49,15 +49,14 @@ extern "C" {
#if !defined(TCL_MAJOR_VERSION)
# define TCL_MAJOR_VERSION 9
#endif
#if TCL_MAJOR_VERSION != 9
# error "This header-file is for Tcl 9 only"
#endif
#define TCL_MINOR_VERSION 1
#define TCL_RELEASE_LEVEL TCL_ALPHA_RELEASE
#define TCL_RELEASE_SERIAL 0
#if TCL_MAJOR_VERSION == 9
# define TCL_MINOR_VERSION 0
# define TCL_RELEASE_LEVEL TCL_FINAL_RELEASE
# define TCL_RELEASE_SERIAL 2
#define TCL_VERSION "9.1"
#define TCL_PATCH_LEVEL "9.1a0"
# define TCL_VERSION "9.0"
# define TCL_PATCH_LEVEL "9.0.2"
#endif /* TCL_MAJOR_VERSION */
#if defined(RC_INVOKED)
/*
@@ -322,12 +321,30 @@ typedef unsigned TCL_WIDE_INT_TYPE Tcl_WideUInt;
#define Tcl_WideAsDouble(val) ((double)((Tcl_WideInt)(val)))
#define Tcl_DoubleAsWide(val) ((Tcl_WideInt)((double)(val)))
typedef ptrdiff_t Tcl_Size;
#define TCL_SIZE_MAX ((Tcl_Size)(((size_t)-1)>>1))
#define TCL_SIZE_MODIFIER TCL_T_MODIFIER
#if TCL_MAJOR_VERSION < 9
# ifndef Tcl_Size
typedef int Tcl_Size;
# endif
# ifndef TCL_SIZE_MAX
# define TCL_SIZE_MAX ((int)(((unsigned int)-1)>>1))
# endif
# ifndef TCL_SIZE_MODIFIER
# define TCL_SIZE_MODIFIER ""
#endif
#else
typedef ptrdiff_t Tcl_Size;
# define TCL_SIZE_MAX ((Tcl_Size)(((size_t)-1)>>1))
# define TCL_SIZE_MODIFIER TCL_T_MODIFIER
#endif /* TCL_MAJOR_VERSION */
#ifdef _WIN32
typedef struct __stat64 Tcl_StatBuf;
# if TCL_MAJOR_VERSION > 8 || defined(_WIN64) || defined(_USE_64BIT_TIME_T)
typedef struct __stat64 Tcl_StatBuf;
# elif defined(_USE_32BIT_TIME_T)
typedef struct _stati64 Tcl_StatBuf;
# else
typedef struct _stat32i64 Tcl_StatBuf;
# endif
#elif defined(__CYGWIN__)
typedef struct {
unsigned st_dev;
@@ -408,7 +425,7 @@ typedef void (Tcl_ThreadCreateProc) (void *clientData);
* given to Tcl_CreateThread.
*/
#define TCL_THREAD_STACK_DEFAULT (0) /* Use default size for stack. */
#define TCL_THREAD_STACK_DEFAULT (0) /* Use default size for stack. */
#define TCL_THREAD_NOFLAGS (0000) /* Standard flags, default
* behaviour. */
#define TCL_THREAD_JOINABLE (0001) /* Mark the thread as joinable. */
@@ -452,18 +469,28 @@ typedef void (Tcl_ThreadCreateProc) (void *clientData);
*/
typedef struct Tcl_RegExpIndices {
#if TCL_MAJOR_VERSION > 8
Tcl_Size start; /* Character offset of first character in
* match. */
Tcl_Size end; /* Character offset of first character after
* the match. */
#else
long start;
long end;
#endif
} Tcl_RegExpIndices;
typedef struct Tcl_RegExpInfo {
Tcl_Size nsubs; /* Number of subexpressions in the compiled
* expression. */
Tcl_RegExpIndices *matches; /* Array of nsubs match offset pairs. */
#if TCL_MAJOR_VERSION > 8
Tcl_Size extendStart; /* The offset at which a subsequent match
* might begin. */
#else
long extendStart;
long reserved; /* Reserved for later use. */
#endif
} Tcl_RegExpInfo;
/*
@@ -562,6 +589,7 @@ typedef void (Tcl_InterpDeleteProc) (void *clientData,
typedef void (Tcl_NamespaceDeleteProc) (void *clientData);
typedef int (Tcl_ObjCmdProc) (void *clientData, Tcl_Interp *interp,
int objc, struct Tcl_Obj *const *objv);
#if TCL_MAJOR_VERSION > 8
typedef int (Tcl_ObjCmdProc2) (void *clientData, Tcl_Interp *interp,
Tcl_Size objc, struct Tcl_Obj *const *objv);
typedef int (Tcl_CmdObjTraceProc2) (void *clientData, Tcl_Interp *interp,
@@ -572,6 +600,11 @@ typedef void (Tcl_FreeProc) (void *blockPtr);
#define Tcl_FileFreeProc Tcl_FreeProc
#define Tcl_FileFreeProc Tcl_FreeProc
#define Tcl_EncodingFreeProc Tcl_FreeProc
#else
#define Tcl_ObjCmdProc2 Tcl_ObjCmdProc
#define Tcl_CmdObjTraceProc2 Tcl_CmdObjTraceProc
typedef void (Tcl_FreeProc) (char *blockPtr);
#endif
typedef int (Tcl_LibraryInitProc) (Tcl_Interp *interp);
typedef int (Tcl_LibraryUnloadProc) (Tcl_Interp *interp, int flags);
typedef void (Tcl_PanicProc) (const char *format, ...);
@@ -640,6 +673,7 @@ typedef struct Tcl_ObjType {
/* Called to convert the object's internal rep
* to this type. Frees the internal rep of the
* old type. Returns TCL_ERROR on failure. */
#if TCL_MAJOR_VERSION > 8
size_t version; /* Version field for future-proofing. */
/* List emulation functions - ObjType Version 1 */
@@ -663,14 +697,21 @@ typedef struct Tcl_ObjType {
/* "in" and "ni" expr list operation.
* Determine if the given string value matches
* an element in the list. */
#endif
} Tcl_ObjType;
#define TCL_OBJTYPE_V0 0, \
0,0,0,0,0,0,0,0 /* Pre-Tcl 9 */
#define TCL_OBJTYPE_V1(a) offsetof(Tcl_ObjType, indexProc), \
a,0,0,0,0,0,0,0 /* Tcl 9 Version 1 */
#define TCL_OBJTYPE_V2(a,b,c,d,e,f,g,h) sizeof(Tcl_ObjType), \
a,b,c,d,e,f,g,h /* Tcl 9 - AbstractLists */
#if TCL_MAJOR_VERSION > 8
# define TCL_OBJTYPE_V0 0, \
0,0,0,0,0,0,0,0 /* Pre-Tcl 9 */
# define TCL_OBJTYPE_V1(a) offsetof(Tcl_ObjType, indexProc), \
a,0,0,0,0,0,0,0 /* Tcl 9 Version 1 */
# define TCL_OBJTYPE_V2(a,b,c,d,e,f,g,h) sizeof(Tcl_ObjType), \
a,b,c,d,e,f,g,h /* Tcl 9 - AbstractLists */
#else
# define TCL_OBJTYPE_V0 /* just empty */
# define TCL_OBJTYPE_V1(a) /* just empty */
# define TCL_OBJTYPE_V2(a,b,c,d,e,f,g,h) /* just empty */
#endif
/*
* The following structure stores an internal representation (internalrep) for
@@ -679,7 +720,7 @@ typedef struct Tcl_ObjType {
* the handling of the internalrep.
*/
typedef union Tcl_ObjInternalRep {/* 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, */
@@ -916,7 +957,11 @@ typedef struct Tcl_DString {
* TCL_COMBINE Combine surrogates
*/
#define TCL_COMBINE 0x1000000
#if TCL_MAJOR_VERSION > 8
# define TCL_COMBINE 0x1000000
#else
# define TCL_COMBINE 0
#endif
/*
*----------------------------------------------------------------------------
* Flag values passed to Tcl_RecordAndEval, Tcl_EvalObj, Tcl_EvalObjv.
@@ -1021,14 +1066,18 @@ typedef struct Tcl_DString {
*/
#ifndef TCL_HASH_TYPE
# define TCL_HASH_TYPE size_t
#if TCL_MAJOR_VERSION > 8
# define TCL_HASH_TYPE size_t
#else
# define TCL_HASH_TYPE unsigned
#endif
#endif
typedef struct Tcl_HashKeyType Tcl_HashKeyType;
typedef struct Tcl_HashTable Tcl_HashTable;
typedef struct Tcl_HashEntry Tcl_HashEntry;
typedef size_t (Tcl_HashKeyProc) (Tcl_HashTable *tablePtr, void *keyPtr);
typedef TCL_HASH_TYPE (Tcl_HashKeyProc) (Tcl_HashTable *tablePtr, void *keyPtr);
typedef int (Tcl_CompareHashKeysProc) (void *keyPtr, Tcl_HashEntry *hPtr);
typedef Tcl_HashEntry * (Tcl_AllocHashEntryProc) (Tcl_HashTable *tablePtr,
void *keyPtr);
@@ -1146,10 +1195,15 @@ struct Tcl_HashTable {
* table. */
Tcl_Size rebuildSize; /* Enlarge table when numEntries gets to be
* this large. */
#if TCL_MAJOR_VERSION > 8
size_t mask; /* Mask value used in hashing function. */
#endif
int downShift; /* Shift count used in hashing function.
* Designed to use high-order bits of
* randomized keys. */
#if TCL_MAJOR_VERSION < 9
int mask; /* Mask value used in hashing function. */
#endif
int keyType; /* Type of keys used in this table. It's
* either TCL_CUSTOM_KEYS, TCL_STRING_KEYS,
* TCL_ONE_WORD_KEYS, or an integer giving the
@@ -1211,7 +1265,7 @@ typedef struct Tcl_HashSearch {
typedef struct {
void *next; /* Search position for underlying hash
* table. */
size_t epoch; /* Epoch marker for dictionary being searched,
TCL_HASH_TYPE epoch; /* Epoch marker for dictionary being searched,
* or 0 if search has terminated. */
Tcl_Dict dictionaryPtr; /* Reference to dictionary being searched. */
} Tcl_DictSearch;
@@ -1267,8 +1321,12 @@ typedef enum {
*/
typedef struct Tcl_Time {
#if TCL_MAJOR_VERSION > 8
long long sec; /* Seconds. */
#if defined(_CYGWIN_)
#else
long sec; /* Seconds. */
#endif
#if defined(_CYGWIN_) && TCL_MAJOR_VERSION > 8
int usec; /* Microseconds. */
#else
long usec; /* Microseconds. */
@@ -1319,7 +1377,11 @@ typedef void (Tcl_ScaleTimeProc) (Tcl_Time *timebuf, void *clientData);
* interface.
*/
#define TCL_CLOSE2PROC NULL
#if TCL_MAJOR_VERSION > 8
# define TCL_CLOSE2PROC NULL
#else
# define TCL_CLOSE2PROC ((void *) 1)
#endif
/*
* Channel version tag. This was introduced in 8.3.2/8.4.
@@ -1867,10 +1929,12 @@ typedef struct Tcl_Parse {
* *tokenPtr. */
int errorType; /* One of the parsing error types defined
* above. */
#if TCL_MAJOR_VERSION > 8
int incomplete; /* This field is set to 1 by Tcl_ParseCommand
* if the command appears to be incomplete.
* This information is used by
* Tcl_CommandComplete. */
#endif
/*
* The fields below are intended only for the private use of the parser.
@@ -1889,6 +1953,9 @@ typedef struct Tcl_Parse {
* beginning of region where the error
* occurred (e.g. the open brace if the close
* brace is missing). */
#if TCL_MAJOR_VERSION < 9
int incomplete;
#endif
Tcl_Token staticTokens[NUM_STATIC_TOKENS];
/* Initial space for tokens for command. This
* space should be large enough to accommodate
@@ -1969,7 +2036,11 @@ typedef struct Tcl_EncodingType {
#define TCL_ENCODING_START 0x01
#define TCL_ENCODING_END 0x02
#define TCL_ENCODING_STOPONERROR 0x0 /* Not used any more */
#if TCL_MAJOR_VERSION > 8
# define TCL_ENCODING_STOPONERROR 0x0 /* Not used any more */
#else
# define TCL_ENCODING_STOPONERROR 0x04
#endif
#define TCL_ENCODING_NO_TERMINATE 0x08
#define TCL_ENCODING_CHAR_LIMIT 0x10
/* Internal use bits, do not define bits in this space. See above comment */
@@ -1979,7 +2050,7 @@ typedef struct Tcl_EncodingType {
* changes, ensure ENCODING_PROFILE_* macros in tclInt.h are modified if
* necessary.
*/
#define TCL_ENCODING_PROFILE_STRICT 0x00000000
#define TCL_ENCODING_PROFILE_STRICT TCL_ENCODING_STOPONERROR
#define TCL_ENCODING_PROFILE_TCL8 0x01000000
#define TCL_ENCODING_PROFILE_REPLACE 0x02000000
@@ -2022,7 +2093,11 @@ typedef struct Tcl_EncodingType {
*/
#ifndef TCL_UTF_MAX
# define TCL_UTF_MAX 4
# if defined(BUILD_tcl) || TCL_MAJOR_VERSION > 8
# define TCL_UTF_MAX 4
# else
# define TCL_UTF_MAX 3
# endif
#endif
/*
@@ -2071,7 +2146,11 @@ typedef struct Tcl_Config {
*/
typedef void (Tcl_LimitHandlerProc) (void *clientData, Tcl_Interp *interp);
#if TCL_MAJOR_VERSION > 8
#define Tcl_LimitHandlerDeleteProc Tcl_FreeProc
#else
typedef void (Tcl_LimitHandlerDeleteProc) (void *clientData);
#endif
#if 0
/*
@@ -2228,7 +2307,11 @@ typedef int (Tcl_NRPostProc) (void *data[], Tcl_Interp *interp,
* stubs tables.
*/
#define TCL_STUB_MAGIC ((int) 0xFCA3BACB + (int) sizeof(void *))
#if TCL_MAJOR_VERSION > 8
# define TCL_STUB_MAGIC ((int) 0xFCA3BACB + (int) sizeof(void *))
#else
# define TCL_STUB_MAGIC ((int) 0xFCA3BACF)
#endif
/*
* The following function is required to be defined in all stubs aware
@@ -2250,15 +2333,35 @@ void * TclStubCall(void *arg);
#endif
#ifdef USE_TCL_STUBS
#if TCL_MAJOR_VERSION < 9
# if TCL_UTF_MAX < 4
# define Tcl_InitStubs(interp, version, exact) \
(Tcl_InitStubs)(interp, version, \
(exact)|(TCL_MAJOR_VERSION<<8)|(0xFF<<16), \
TCL_STUB_MAGIC)
# else
# define Tcl_InitStubs(interp, version, exact) \
(Tcl_InitStubs)(interp, "8.7b1", \
(exact)|(TCL_MAJOR_VERSION<<8)|(0xFF<<16), \
TCL_STUB_MAGIC)
# endif
#else
# define Tcl_InitStubs(interp, version, exact) \
(Tcl_InitStubs)(interp, version, \
(exact)|(TCL_MAJOR_VERSION<<8)|(TCL_MINOR_VERSION<<16), \
TCL_STUB_MAGIC)
#endif
#else
#if TCL_MAJOR_VERSION < 9
# define Tcl_InitStubs(interp, version, exact) \
Tcl_Panic(((void)interp, (void)version, \
(void)exact, "Please define -DUSE_TCL_STUBS"))
#else
# define Tcl_InitStubs(interp, version, exact) \
Tcl_PkgInitStubsCheck(interp, version, \
(exact)|(TCL_MAJOR_VERSION<<8)|(TCL_MINOR_VERSION<<16))
#endif
#endif
/*
* Public functions that are not accessible via the stubs table.
@@ -2298,7 +2401,7 @@ EXTERN const char *TclZipfs_AppHook(int *argc, char ***argv);
EXTERN TCL_NORETURN void Tcl_MainExW(Tcl_Size argc, wchar_t **argv,
Tcl_AppInitProc *appInitProc, Tcl_Interp *interp);
#endif
#if defined(USE_TCL_STUBS)
#if defined(USE_TCL_STUBS) && (TCL_MAJOR_VERSION > 8)
#define Tcl_SetPanicProc(panicProc) \
TclInitStubTable(((const char *(*)(Tcl_PanicProc *))TclStubCall((void *)panicProc))(panicProc))
#define Tcl_InitSubsystems() \
+34 -28
View File
@@ -168,7 +168,7 @@ ArithSeriesEndDbl(
if (!dblRepPtr->base.len) {
return dblRepPtr->start;
}
d = dblRepPtr->start + ((double)(dblRepPtr->base.len-1) * dblRepPtr->step);
d = dblRepPtr->start + ((dblRepPtr->base.len-1) * dblRepPtr->step);
return ArithRound(d, dblRepPtr->precision);
}
@@ -191,7 +191,7 @@ ArithSeriesIndexDbl(
assert(arithSeriesRepPtr->isDouble);
double d = dblRepPtr->start;
if (index) {
d += ((double)index * dblRepPtr->step);
d += (index * dblRepPtr->step);
}
return ArithRound(d, dblRepPtr->precision);
@@ -227,14 +227,15 @@ ObjPrecision(
int type;
if (TclHasInternalRep(numObj, &tclDoubleType) || (
Tcl_GetNumberFromObj(NULL, numObj, &ptr, &type) == TCL_OK
&& type == TCL_NUMBER_DOUBLE)
Tcl_GetNumberFromObj(NULL, numObj, &ptr, &type) == TCL_OK &&
type == TCL_NUMBER_DOUBLE
)
) { /* TCL_NUMBER_DOUBLE */
const char *str = TclGetString(numObj);
if (strchr(str, 'e') == NULL && strchr(str, 'E') == NULL) {
str = strchr(str, '.');
return (str ? (unsigned)strlen(str + 1) : 0);
return (str ? strlen(str + 1) : 0);
}
/* don't calculate precision for e-notation */
}
@@ -337,8 +338,10 @@ ArithSeriesLenDbl(
* To improve numerical stability use wide arithmetic instead of IEEE-754
* when distance and step do not exceed wide-integers.
*/
if (((double)WIDE_MIN <= end && end <= (double)WIDE_MAX) &&
((double)WIDE_MIN <= step && step <= (double)WIDE_MAX)) {
if (
((double)WIDE_MIN <= end && end <= (double)WIDE_MAX) &&
((double)WIDE_MIN <= step && step <= (double)WIDE_MAX)
) {
Tcl_WideInt iend = end < 0 ? end - 0.5 : end + 0.5;
Tcl_WideInt istep = step < 0 ? step - 0.5 : step + 0.5;
if (istep) { /* avoid div by zero, steps like 0.1, precision 0 */
@@ -626,13 +629,13 @@ assignNumber(
*/
Tcl_Obj *
TclNewArithSeriesObj(
Tcl_Interp *interp, /* For error reporting */
int useDoubles, /* Flag indicates values start,
* end, step, are treated as doubles */
Tcl_Obj *startObj, /* Starting value */
Tcl_Obj *endObj, /* Ending limit */
Tcl_Obj *stepObj, /* increment value */
Tcl_Obj *lenObj) /* Number of elements */
Tcl_Interp *interp, /* For error reporting */
int useDoubles, /* Flag indicates values start,
** end, step, are treated as doubles */
Tcl_Obj *startObj, /* Starting value */
Tcl_Obj *endObj, /* Ending limit */
Tcl_Obj *stepObj, /* increment value */
Tcl_Obj *lenObj) /* Number of elements */
{
double dstart, dend, dstep = 1.0;
Tcl_WideInt start, end, step = 1;
@@ -712,13 +715,13 @@ TclNewArithSeriesObj(
// Compute precision based on given command argument values
precision = maxObjPrecision(startObj, NULL, stepObj);
dend = dstart + (dstep * (double)(len-1));
dend = dstart + (dstep * (len-1));
// Make computed end value match argument(s) precision
dend = ArithRound(dend, precision);
end = dend;
} else {
end = start + (step * (len - 1));
dend = (double)end;
dend = end;
}
}
@@ -738,7 +741,7 @@ TclNewArithSeriesObj(
if (useDoubles) {
/* ensure we'll not get NaN somewhere in the arith-series,
* so simply check the end of it and behave like [expr {Inf - Inf}] */
double d = dstart + (double)(len - 1) * dstep;
double d = dstart + (len - 1) * dstep;
if (isnan(d)) {
const char *s = "domain error: argument not in valid range";
Tcl_SetObjResult(interp, Tcl_NewStringObj(s, -1));
@@ -873,11 +876,11 @@ SetArithSeriesFromAny(
int
TclArithSeriesObjRange(
Tcl_Interp *interp, /* For error message(s) */
Tcl_Interp *interp, /* For error message(s) */
Tcl_Obj *arithSeriesObj, /* List object to take a range from. */
Tcl_Size fromIdx, /* Index of first element to include. */
Tcl_Size toIdx, /* Index of last element to include. */
Tcl_Obj **newObjPtr) /* return value */
Tcl_Obj **newObjPtr) /* return value */
{
ArithSeries *arithSeriesRepPtr;
Tcl_WideInt len;
@@ -1063,7 +1066,7 @@ TclArithSeriesGetElements(
*/
int
TclArithSeriesObjReverse(
Tcl_Interp *interp, /* For error message(s) */
Tcl_Interp *interp, /* For error message(s) */
Tcl_Obj *arithSeriesObj, /* List object to reverse. */
Tcl_Obj **newObjPtr)
{
@@ -1147,11 +1150,11 @@ UpdateStringOfArithSeries(
{
ArithSeries *arithSeriesRepPtr = (ArithSeries *)
arithSeriesObjPtr->internalRep.twoPtrValue.ptr1;
char *p;
char *p, *srep;
Tcl_Size i, bytlen = 0;
if (!arithSeriesRepPtr->len) {
TclInitEmptyStringRep(arithSeriesObjPtr);
if (arithSeriesRepPtr->len == 0) {
(void)Tcl_InitStringRep(arithSeriesObjPtr, NULL, 0);
return;
}
@@ -1169,15 +1172,17 @@ UpdateStringOfArithSeries(
char tmp[TCL_DOUBLE_SPACE + 2];
for (i = 0; i < arithSeriesRepPtr->len; i++) {
double d = ArithSeriesIndexDbl(arithSeriesRepPtr, i);
Tcl_Size elen;
tmp[0] = '\0';
Tcl_PrintDouble(NULL,d,tmp);
bytlen += strlen(tmp);
if (bytlen > TCL_SIZE_MAX) {
elen = strlen(tmp);
if (bytlen > TCL_SIZE_MAX - elen) {
/* overflow, todo: check we could use some representation instead of the panic
* to signal it is too large for string representation, because too heavy */
Tcl_Panic("UpdateStringOfArithSeries: too large to represent");
}
bytlen += elen;
}
}
bytlen += arithSeriesRepPtr->len; // Space for each separator
@@ -1186,7 +1191,9 @@ UpdateStringOfArithSeries(
* Pass 2: generate the string repr.
*/
p = Tcl_InitStringRep(arithSeriesObjPtr, NULL, bytlen);
p = srep = Tcl_InitStringRep(arithSeriesObjPtr, NULL, bytlen);
TclOOM(p, bytlen+1);
if (!arithSeriesRepPtr->isDouble) {
for (i = 0; i < arithSeriesRepPtr->len; i++) {
Tcl_WideInt d = ArithSeriesIndexInt(arithSeriesRepPtr, i);
@@ -1205,8 +1212,7 @@ UpdateStringOfArithSeries(
*p++ = ' ';
}
}
*(--p) = '\0';
arithSeriesObjPtr->length = p - arithSeriesObjPtr->bytes;
(void) Tcl_InitStringRep(arithSeriesObjPtr, NULL, (--p - srep));
}
/*
+43 -43
View File
@@ -222,9 +222,9 @@ typedef struct AssemblyEnv {
Tcl_HashTable labelHash; /* Hash table whose keys are labels and whose
* values are 'label' objects storing the code
* offsets of the labels. */
int cmdLine; /* Current line number within the assembly
Tcl_Size cmdLine; /* Current line number within the assembly
* code */
Tcl_Size* clNext; /* Invisible continuation line for
Tcl_Size* clNext; /* Invisible continuation line for
* [info frame] */
BasicBlock* head_bb; /* First basic block in the code */
BasicBlock* curr_bb; /* Current basic block */
@@ -262,12 +262,12 @@ static int CheckNonThrowingBlock(AssemblyEnv*, BasicBlock*);
static int BytecodeMightThrow(unsigned char);
static int CheckJumpTableLabels(AssemblyEnv*, BasicBlock*);
static int CheckNamespaceQualifiers(Tcl_Interp*, const char*,
Tcl_Size);
static int CheckNonNegative(Tcl_Interp*, Tcl_Size);
static int CheckOneByte(Tcl_Interp*, Tcl_Size);
static int CheckSignedOneByte(Tcl_Interp*, Tcl_Size);
int);
static int CheckNonNegative(Tcl_Interp*, int);
static int CheckOneByte(Tcl_Interp*, int);
static int CheckSignedOneByte(Tcl_Interp*, int);
static int CheckStack(AssemblyEnv*);
static int CheckStrictlyPositive(Tcl_Interp*, Tcl_Size);
static int CheckStrictlyPositive(Tcl_Interp*, int);
static ByteCode * CompileAssembleObj(Tcl_Interp *interp,
Tcl_Obj *objPtr);
static void CompileEmbeddedScript(AssemblyEnv*, Tcl_Token*,
@@ -287,7 +287,7 @@ static int GetIntegerOperand(AssemblyEnv*, Tcl_Token**, int*);
static int GetNextOperand(AssemblyEnv*, Tcl_Token**, Tcl_Obj**);
static void LookForFreshCatches(BasicBlock*, BasicBlock**);
static void MoveCodeForJumps(AssemblyEnv*, int);
static void MoveExceptionRangesToBasicBlock(AssemblyEnv*, Tcl_Size);
static void MoveExceptionRangesToBasicBlock(AssemblyEnv*, int);
static AssemblyEnv* NewAssemblyEnv(CompileEnv*, int);
static int ProcessCatches(AssemblyEnv*);
static int ProcessCatchesInBasicBlock(AssemblyEnv*, BasicBlock*,
@@ -306,12 +306,12 @@ static int StackCheckBasicBlock(AssemblyEnv*, BasicBlock *,
BasicBlock *, int);
static int StackCheckExit(AssemblyEnv*);
static void StackFreshCatches(AssemblyEnv*, BasicBlock*, int,
BasicBlock**, Tcl_Size*);
BasicBlock**, int*);
static void SyncStackDepth(AssemblyEnv*);
static int TclAssembleCode(CompileEnv* envPtr, const char* code,
Tcl_Size codeLen, int flags);
int codeLen, int flags);
static void UnstackExpiredCatches(CompileEnv*, BasicBlock*, int,
BasicBlock**, Tcl_Size*);
BasicBlock**, int*);
/*
* Tcl_ObjType that describes bytecode emitted by the assembler.
@@ -959,9 +959,9 @@ TclCompileAssembleCmd(
{
Tcl_Token *tokenPtr; /* Token in the input script */
Tcl_Size numCommands = envPtr->numCommands;
Tcl_Size offset = envPtr->codeNext - envPtr->codeStart;
Tcl_Size depth = envPtr->currStackDepth;
size_t numCommands = envPtr->numCommands;
int offset = envPtr->codeNext - envPtr->codeStart;
size_t depth = envPtr->currStackDepth;
/*
* Make sure that the command has a single arg that is a simple word.
*/
@@ -1017,7 +1017,7 @@ TclAssembleCode(
CompileEnv *envPtr, /* Compilation environment that is to receive
* the generated bytecode */
const char* codePtr, /* Assembly-language code to be processed */
Tcl_Size codeLen, /* Length of the code */
int codeLen, /* Length of the code */
int flags) /* OR'ed combination of flags */
{
Tcl_Interp* interp = (Tcl_Interp*) envPtr->iPtr;
@@ -1030,7 +1030,7 @@ TclAssembleCode(
const char* instPtr = codePtr;
/* Where to start looking for a line of code */
const char* nextPtr; /* Pointer to the end of the line of code */
Tcl_Size bytesLeft = codeLen; /* Number of bytes of source code remaining to
int bytesLeft = codeLen; /* Number of bytes of source code remaining to
* be parsed */
int status; /* Tcl status return */
AssemblyEnv* assemEnvPtr = NewAssemblyEnv(envPtr, flags);
@@ -1266,10 +1266,10 @@ AssembleOneLine(
Tcl_Size operand1Len; /* String length of the operand */
int opnd; /* Integer representation of an operand */
int litIndex; /* Literal pool index of a constant */
Tcl_Size localVar; /* LVT index of a local variable */
Tcl_Size localVar; /* LVT index of a local variable */
int flags; /* Flags for a basic block */
JumptableInfo* jtPtr; /* Pointer to a jumptable */
Tcl_Size infoIndex; /* Index of the jumptable in auxdata */
int infoIndex; /* Index of the jumptable in auxdata */
int status = TCL_ERROR; /* Return value from this function */
/*
@@ -1808,7 +1808,7 @@ CompileEmbeddedScript(
size_t savedStackDepth = envPtr->currStackDepth;
size_t savedMaxStackDepth = envPtr->maxStackDepth;
Tcl_Size savedExceptArrayNext = envPtr->exceptArrayNext;
int savedExceptArrayNext = envPtr->exceptArrayNext;
envPtr->currStackDepth = 0;
envPtr->maxStackDepth = 0;
@@ -1874,7 +1874,7 @@ SyncStackDepth(
/* Compilation environment */
BasicBlock* curr_bb = assemEnvPtr->curr_bb;
/* Current basic block */
Tcl_Size maxStackDepth = curr_bb->finalStackDepth + envPtr->maxStackDepth;
int maxStackDepth = curr_bb->finalStackDepth + envPtr->maxStackDepth;
/* Max stack depth in the basic block */
if (maxStackDepth > curr_bb->maxStackDepth) {
@@ -1899,16 +1899,16 @@ SyncStackDepth(
static void
MoveExceptionRangesToBasicBlock(
AssemblyEnv* assemEnvPtr, /* Assembly environment */
Tcl_Size savedExceptArrayNext) /* Saved index of the end of the exception
int savedExceptArrayNext) /* Saved index of the end of the exception
* range array */
{
CompileEnv* envPtr = assemEnvPtr->envPtr;
/* Compilation environment */
BasicBlock* curr_bb = assemEnvPtr->curr_bb;
/* Current basic block */
Tcl_Size exceptionCount = envPtr->exceptArrayNext - savedExceptArrayNext;
int exceptionCount = envPtr->exceptArrayNext - savedExceptArrayNext;
/* Number of ranges that must be moved */
Tcl_Size i;
int i;
if (exceptionCount == 0) {
/* Nothing to do */
@@ -1963,7 +1963,7 @@ CreateMirrorJumpTable(
AssemblyEnv* assemEnvPtr, /* Assembly environment */
Tcl_Obj* jumps) /* List of alternating keywords and labels */
{
Tcl_Size objc; /* Number of elements in the 'jumps' list */
Tcl_Size objc; /* Number of elements in the 'jumps' list */
Tcl_Obj** objv; /* Pointers to the elements in the list */
CompileEnv* envPtr = assemEnvPtr->envPtr;
/* Compilation environment */
@@ -2352,7 +2352,7 @@ static int
CheckNamespaceQualifiers(
Tcl_Interp* interp, /* Tcl interpreter for error reporting */
const char* name, /* Variable name to check */
Tcl_Size nameLen) /* Length of the variable */
int nameLen) /* Length of the variable */
{
const char* p;
@@ -2389,7 +2389,7 @@ CheckNamespaceQualifiers(
static int
CheckOneByte(
Tcl_Interp* interp, /* Tcl interpreter for error reporting */
Tcl_Size value) /* Value to check */
int value) /* Value to check */
{
Tcl_Obj* result; /* Error message */
@@ -2424,7 +2424,7 @@ CheckOneByte(
static int
CheckSignedOneByte(
Tcl_Interp* interp, /* Tcl interpreter for error reporting */
Tcl_Size value) /* Value to check */
int value) /* Value to check */
{
Tcl_Obj* result; /* Error message */
@@ -2457,11 +2457,11 @@ CheckSignedOneByte(
static int
CheckNonNegative(
Tcl_Interp* interp, /* Tcl interpreter for error reporting */
Tcl_Size value) /* Value to check */
int value) /* Value to check */
{
Tcl_Obj* result; /* Error message */
if (value < 0 || value > INT_MAX) {
if (value < 0) {
result = Tcl_NewStringObj("operand must be nonnegative", -1);
Tcl_SetObjResult(interp, result);
Tcl_SetErrorCode(interp, "TCL", "ASSEM", "NONNEGATIVE", (char *)NULL);
@@ -2490,11 +2490,11 @@ CheckNonNegative(
static int
CheckStrictlyPositive(
Tcl_Interp* interp, /* Tcl interpreter for error reporting */
Tcl_Size value) /* Value to check */
int value) /* Value to check */
{
Tcl_Obj* result; /* Error message */
if (value <= 0 || value > INT_MAX) {
if (value <= 0) {
result = Tcl_NewStringObj("operand must be positive", -1);
Tcl_SetObjResult(interp, result);
Tcl_SetErrorCode(interp, "TCL", "ASSEM", "POSITIVE", (char *)NULL);
@@ -2974,7 +2974,7 @@ MoveCodeForJumps(
CompileEnv* envPtr = assemEnvPtr->envPtr;
/* Compilation environment */
BasicBlock* bbPtr; /* Pointer to a basic block being checked */
Tcl_Size topOffset; /* Bytecode offset of the following basic
int topOffset; /* Bytecode offset of the following basic
* block before code motion */
/*
@@ -3196,9 +3196,9 @@ CheckNonThrowingBlock(
Tcl_Interp* interp = (Tcl_Interp*) envPtr->iPtr;
/* Tcl interpreter */
BasicBlock* nextPtr; /* Pointer to the succeeding basic block */
Tcl_Size offset; /* Bytecode offset of the current
int offset; /* Bytecode offset of the current
* instruction */
Tcl_Size bound; /* Bytecode offset following the last
int bound; /* Bytecode offset following the last
* instruction of the block. */
unsigned char opcode; /* Current bytecode instruction */
@@ -3906,7 +3906,7 @@ BuildExceptionRanges(
int catchDepth = 0; /* Current catch depth */
int maxCatchDepth = 0; /* Maximum catch depth in the program */
BasicBlock** catches; /* Stack of catches in progress */
Tcl_Size* catchIndices; /* Indices of the exception ranges of catches
int* catchIndices; /* Indices of the exception ranges of catches
* in progress */
int i;
@@ -3926,7 +3926,7 @@ BuildExceptionRanges(
*/
catches = (BasicBlock**)Tcl_Alloc(maxCatchDepth * sizeof(BasicBlock*));
catchIndices = (Tcl_Size *)Tcl_Alloc(maxCatchDepth * sizeof(Tcl_Size));
catchIndices = (int *)Tcl_Alloc(maxCatchDepth * sizeof(int));
for (i = 0; i < maxCatchDepth; ++i) {
catches[i] = NULL;
catchIndices[i] = -1;
@@ -3985,12 +3985,12 @@ BuildExceptionRanges(
static void
UnstackExpiredCatches(
CompileEnv *envPtr, /* Compilation environment */
BasicBlock *bbPtr, /* Basic block being processed */
CompileEnv* envPtr, /* Compilation environment */
BasicBlock* bbPtr, /* Basic block being processed */
int catchDepth, /* Depth of nesting of catches prior to entry
* to this block */
BasicBlock **catches, /* Array of catch contexts */
Tcl_Size *catchIndices) /* Indices of the exception ranges
BasicBlock** catches, /* Array of catch contexts */
int* catchIndices) /* Indices of the exception ranges
* corresponding to the catch contexts */
{
ExceptionRange* range; /* Exception range for a specific catch */
@@ -4096,7 +4096,7 @@ StackFreshCatches(
int catchDepth, /* Depth of nesting of catches prior to entry
* to this block */
BasicBlock** catches, /* Array of catch contexts */
Tcl_Size* catchIndices) /* Indices of the exception ranges
int* catchIndices) /* Indices of the exception ranges
* corresponding to the catch contexts */
{
CompileEnv* envPtr = assemEnvPtr->envPtr;
@@ -4159,13 +4159,13 @@ RestoreEmbeddedExceptionRanges(
CompileEnv* envPtr = assemEnvPtr->envPtr;
/* Compilation environment */
BasicBlock* bbPtr; /* Current basic block */
Tcl_Size rangeBase; /* Base of the foreign exception ranges when
int rangeBase; /* Base of the foreign exception ranges when
* they are reinstalled */
size_t rangeIndex; /* Index of the current foreign exception
* range as reinstalled */
ExceptionRange* range; /* Current foreign exception range */
unsigned char opcode; /* Current instruction's opcode */
Tcl_Size catchIndex; /* Index of the exception range to which the
int catchIndex; /* Index of the exception range to which the
* current instruction refers */
int i;
+8 -7
View File
@@ -30,7 +30,7 @@ typedef struct AsyncHandler {
* for the process. */
Tcl_AsyncProc *proc; /* Procedure to call when handler is
* invoked. */
void *clientData; /* Value to pass to handler when it is
void *clientData; /* Value to pass to handler when it is
* invoked. */
struct ThreadSpecificData *originTsd;
/* Used in Tcl_AsyncMark to modify thread-
@@ -38,7 +38,7 @@ typedef struct AsyncHandler {
* associated to. */
Tcl_ThreadId originThrdId; /* Origin thread where this token was created
* and where it will be yielded. */
void *notifierData; /* Platform notifier data or NULL. */
void *notifierData; /* Platform notifier data or NULL. */
} AsyncHandler;
typedef struct ThreadSpecificData {
@@ -142,7 +142,7 @@ Tcl_AsyncHandler
Tcl_AsyncCreate(
Tcl_AsyncProc *proc, /* Procedure to call when handler is
* invoked. */
void *clientData) /* Argument to pass to handler. */
void *clientData) /* Argument to pass to handler. */
{
AsyncHandler *asyncPtr;
ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey);
@@ -190,7 +190,7 @@ Tcl_AsyncCreate(
void
Tcl_AsyncMark(
Tcl_AsyncHandler async) /* Token for handler. */
Tcl_AsyncHandler async) /* Token for handler. */
{
AsyncHandler *token = (AsyncHandler *) async;
@@ -201,6 +201,7 @@ Tcl_AsyncMark(
Tcl_ThreadAlert(token->originThrdId);
}
Tcl_MutexUnlock(&asyncMutex);
}
/*
@@ -223,8 +224,8 @@ Tcl_AsyncMark(
int
Tcl_AsyncMarkFromSignal(
Tcl_AsyncHandler async, /* Token for handler. */
int sigNumber) /* Signal number. */
Tcl_AsyncHandler async, /* Token for handler. */
int sigNumber) /* Signal number. */
{
#if TCL_THREADS
AsyncHandler *token = (AsyncHandler *) async;
@@ -377,7 +378,7 @@ Tcl_AsyncInvoke(
void
Tcl_AsyncDelete(
Tcl_AsyncHandler async) /* Token for handler to delete. */
Tcl_AsyncHandler async) /* Token for handler to delete. */
{
AsyncHandler *asyncPtr = (AsyncHandler *) async;
+36 -33
View File
@@ -207,8 +207,8 @@ static Tcl_ObjCmdProc ExprSrandFunc;
static Tcl_ObjCmdProc ExprUnaryFunc;
static Tcl_ObjCmdProc ExprWideFunc;
static Tcl_ObjCmdProc FloatClassifyObjCmd;
static void MathFuncWrongNumArgs(Tcl_Interp *interp, Tcl_Size expected,
Tcl_Size actual, Tcl_Obj *const *objv);
static void MathFuncWrongNumArgs(Tcl_Interp *interp, int expected,
int actual, Tcl_Obj *const *objv);
static Tcl_NRPostProc NRCoroutineCallerCallback;
static Tcl_NRPostProc NRCoroutineExitCallback;
static Tcl_NRPostProc NRCommand;
@@ -2717,9 +2717,9 @@ Tcl_CreateCommand(
typedef struct {
Tcl_ObjCmdProc2 *proc;
void *clientData; /* Arbitrary value to pass to proc function. */
void *clientData; /* Arbitrary value to pass to proc function. */
Tcl_CmdDeleteProc *deleteProc;
void *deleteData; /* Arbitrary value to pass to deleteProc function. */
void *deleteData; /* Arbitrary value to pass to deleteProc function. */
Tcl_ObjCmdProc2 *nreProc;
} CmdWrapperInfo;
@@ -2734,7 +2734,7 @@ cmdWrapperProc(
if (objc < 0) {
objc = -1;
}
return info->proc(info->clientData, interp, (int)objc, objv);
return info->proc(info->clientData, interp, objc, objv);
}
static void
@@ -3006,9 +3006,9 @@ TclCreateObjCommandInNs(
int
InvokeStringCommand(
void *clientData, /* Points to command's Command structure. */
void *clientData, /* Points to command's Command structure. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
{
Command *cmdPtr = (Command *)clientData;
@@ -3550,6 +3550,7 @@ Tcl_GetCommandFullName(
* not have been deleted. */
Tcl_Obj *objPtr) /* Points to the object onto which the
* command's full name is appended. */
{
Interp *iPtr = (Interp *) interp;
Command *cmdPtr = (Command *) command;
@@ -3947,7 +3948,7 @@ CallCommandTraces(
static int
CancelEvalProc(
void *clientData, /* Interp to cancel the script in progress. */
void *clientData, /* Interp to cancel the script in progress. */
TCL_UNUSED(Tcl_Interp *),
int code) /* Current return code from command. */
{
@@ -4437,7 +4438,7 @@ EvalObjvCore(
TCL_UNUSED(int) /*result*/)
{
Command *cmdPtr = NULL, *preCmdPtr = (Command *)data[0];
int flags = (int)PTR2INT(data[1]);
int flags = PTR2INT(data[1]);
Tcl_Size objc = PTR2INT(data[2]);
Tcl_Obj **objv = (Tcl_Obj **)data[3];
Interp *iPtr = (Interp *) interp;
@@ -5156,7 +5157,7 @@ TclEvalEx(
int flags, /* Collection of OR-ed bits that control the
* evaluation of the script. Only
* TCL_EVAL_GLOBAL is currently supported. */
int line, /* The line the script starts on. */
Tcl_Size line, /* The line the script starts on. */
Tcl_Size *clNextOuter, /* Information about an outer context for */
const char *outerScript) /* continuation line data. This is set only in
* TclSubstTokens(), to properly handle
@@ -5179,8 +5180,8 @@ TclEvalEx(
const char *p, *next;
const int minObjs = 20;
Tcl_Obj **objv, **objvSpace;
char *expand;
int *lines, *lineSpace;
int *expand;
Tcl_Size *lines, *lineSpace;
Tcl_Token *tokenPtr;
int expandRequested, code = TCL_OK;
Tcl_Size bytesLeft, commandLength;
@@ -5196,8 +5197,8 @@ TclEvalEx(
Tcl_Parse *parsePtr = (Tcl_Parse *)TclStackAlloc(interp, sizeof(Tcl_Parse));
CmdFrame *eeFramePtr = (CmdFrame *)TclStackAlloc(interp, sizeof(CmdFrame));
Tcl_Obj **stackObjArray = (Tcl_Obj **)TclStackAlloc(interp, minObjs * sizeof(Tcl_Obj *));
char *expandStack = (char *)TclStackAlloc(interp, minObjs * sizeof(char));
int *linesStack = (int *)TclStackAlloc(interp, minObjs * sizeof(int));
int *expandStack = (int *)TclStackAlloc(interp, minObjs * sizeof(int));
Tcl_Size *linesStack = (Tcl_Size *)TclStackAlloc(interp, minObjs * sizeof(Tcl_Size));
/* TIP #280 Structures for tracking of command
* locations. */
Tcl_Size *clNext = NULL; /* Pointer for the tracking of invisible
@@ -5322,7 +5323,7 @@ TclEvalEx(
* per-command parsing.
*/
int wordLine = line;
Tcl_Size wordLine = line;
const char *wordStart = parsePtr->commandStart;
Tcl_Size *wordCLNext = clNext;
Tcl_Size objectsNeeded = 0;
@@ -5333,11 +5334,11 @@ TclEvalEx(
*/
if (numWords > minObjs) {
expand = (char *)Tcl_Alloc(numWords * sizeof(char));
expand = (int *)Tcl_Alloc(numWords * sizeof(int));
objvSpace = (Tcl_Obj **)
Tcl_Alloc(numWords * sizeof(Tcl_Obj *));
lineSpace = (int *)
Tcl_Alloc(numWords * sizeof(int));
lineSpace = (Tcl_Size *)
Tcl_Alloc(numWords * sizeof(Tcl_Size));
}
expandRequested = 0;
objv = objvSpace;
@@ -5429,13 +5430,13 @@ TclEvalEx(
*/
Tcl_Obj **copy = objvSpace;
int *lcopy = lineSpace;
Tcl_Size *lcopy = lineSpace;
Tcl_Size wordIdx = numWords;
Tcl_Size objIdx = objectsNeeded - 1;
if ((numWords > minObjs) || (objectsNeeded > minObjs)) {
objv = objvSpace = (Tcl_Obj **)Tcl_Alloc(objectsNeeded * sizeof(Tcl_Obj *));
lines = lineSpace = (int *)Tcl_Alloc(objectsNeeded * sizeof(int));
lines = lineSpace = (Tcl_Size *)Tcl_Alloc(objectsNeeded * sizeof(Tcl_Size));
}
objectsUsed = 0;
@@ -5634,7 +5635,7 @@ TclEvalEx(
void
TclAdvanceLines(
int *line,
Tcl_Size *line,
const char *start,
const char *end)
{
@@ -5669,9 +5670,9 @@ TclAdvanceLines(
void
TclAdvanceContinuations(
int *line,
Tcl_Size *line,
Tcl_Size **clNextPtrPtr,
Tcl_Size loc)
int loc)
{
/*
* Track the invisible continuation lines embedded in a script, if any.
@@ -5852,7 +5853,7 @@ TclArgumentBCEnter(
Tcl_Size pc)
{
ExtCmdLoc *eclPtr;
int word;
Tcl_Size word;
ECL *ePtr;
CFWordBC *lastPtr = NULL;
Interp *iPtr = (Interp *) interp;
@@ -6124,7 +6125,7 @@ TclNREvalObjEx(
* evaluation of the script. Supported values
* are TCL_EVAL_GLOBAL and TCL_EVAL_DIRECT. */
const CmdFrame *invoker, /* Frame of the command doing the eval. */
int word) /* Index of the word which is in objPtr. */
int word) /* Index of the word which is in objPtr. */
{
Interp *iPtr = (Interp *) interp;
int result;
@@ -6293,7 +6294,7 @@ TEOEx_ByteCodeCallback(
Interp *iPtr = (Interp *) interp;
CallFrame *savedVarFramePtr = (CallFrame *)data[0];
Tcl_Obj *objPtr = (Tcl_Obj *)data[1];
int allowExceptions = (int)PTR2INT(data[2]);
int allowExceptions = PTR2INT(data[2]);
if (iPtr->numLevels == 0) {
if (result == TCL_RETURN) {
@@ -7715,7 +7716,7 @@ ExprRandFunc(
* take into consideration the thread this interp is running in.
*/
iPtr->randSeed = (long)TclpGetClicks() + (long)PTR2UINT(Tcl_GetCurrentThread()) * 4093U;
iPtr->randSeed = TclpGetClicks() + PTR2UINT(Tcl_GetCurrentThread()) * 4093U;
/*
* Make sure 1 <= randSeed <= (2^31) - 2. See below.
@@ -7770,7 +7771,7 @@ ExprRandFunc(
* dividing by RAND_IM yields a double in the range (0, 1).
*/
dResult = (double)iPtr->randSeed * (1.0/RAND_IM);
dResult = iPtr->randSeed * (1.0/RAND_IM);
/*
* Push a Tcl object with the result.
@@ -8087,7 +8088,7 @@ DoubleObjIsClass(
int objc, /* Actual parameter count */
Tcl_Obj *const *objv, /* Actual parameter list */
int cmpCls, /* FP class to compare. */
int positive) /* 1 if compare positive, 0 - otherwise */
int positive) /* 1 if compare positive, 0 - otherwise */
{
int dCls;
@@ -8178,8 +8179,10 @@ ExprIsUnorderedFunc(
return TCL_ERROR;
}
if (DoubleObjClass(interp, objv[1], &dCls) != TCL_OK ||
DoubleObjClass(interp, objv[2], &dCls2) != TCL_OK) {
if (
DoubleObjClass(interp, objv[1], &dCls) != TCL_OK ||
DoubleObjClass(interp, objv[2], &dCls2) != TCL_OK
) {
return TCL_ERROR;
}
@@ -8260,8 +8263,8 @@ FloatClassifyObjCmd(
static void
MathFuncWrongNumArgs(
Tcl_Interp *interp, /* Tcl interpreter */
Tcl_Size expected, /* Formal parameter count. */
Tcl_Size found, /* Actual parameter count. */
int expected, /* Formal parameter count. */
int found, /* Actual parameter count. */
Tcl_Obj *const *objv) /* Actual parameter vector. */
{
const char *name = TclGetString(objv[0]);
+6 -6
View File
@@ -512,7 +512,7 @@ MakeByteArray(
for (; src < srcEnd && dst < dstEnd; ) {
int ch;
Tcl_Size count = TclUtfToUniChar(src, &ch);
int count = TclUtfToUniChar(src, &ch);
if (ch > 255) {
proper = 0;
@@ -2665,7 +2665,7 @@ BinaryEncode64(
size = (((count * 4) / 3) + 3) & ~3; /* ensure 4 byte chunks */
if (maxlen > 0 && size > maxlen) {
Tcl_Size adjusted = size + (wrapcharlen * (size / maxlen));
int adjusted = size + (wrapcharlen * (size / maxlen));
if (size % maxlen == 0) {
adjusted -= wrapcharlen;
@@ -2972,14 +2972,14 @@ BinaryDecodeUu(
*/
if (lineLen > 0) {
*cursor++ = (unsigned char)(((d[0] - 0x20) & 0x3F) << 2)
*cursor++ = (((d[0] - 0x20) & 0x3F) << 2)
| (((d[1] - 0x20) & 0x3F) >> 4);
if (--lineLen > 0) {
*cursor++ = (unsigned char)(((d[1] - 0x20) & 0x3F) << 4)
*cursor++ = (((d[1] - 0x20) & 0x3F) << 4)
| (((d[2] - 0x20) & 0x3F) >> 2);
if (--lineLen > 0) {
*cursor++ = (unsigned char)((((d[2] - 0x20) & 0x3F) << 6)
| (((d[3] - 0x20) & 0x3F)));
*cursor++ = (((d[2] - 0x20) & 0x3F) << 6)
| (((d[3] - 0x20) & 0x3F));
lineLen--;
}
}
+1
View File
@@ -276,6 +276,7 @@ ValidateMemory(
memset(memHeaderP->low_guard, 0, LOW_GUARD_SIZE);
memset(hiPtr, 0, HIGH_GUARD_SIZE);
}
}
/*
+4
View File
@@ -4706,7 +4706,11 @@ ClockSafeCatchCmd(
typedef struct ClockTzStatic {
WCHAR *was; /* Previous value of TZ. */
#if TCL_MAJOR_VERSION > 8
long long lastRefresh; /* Used for latency before next refresh. */
#else
long lastRefresh; /* Used for latency before next refresh. */
#endif
size_t epoch; /* Epoch, signals that TZ changed. */
size_t envEpoch; /* Last env epoch, for faster signaling,
* that TZ changed via TCL */
+43 -4
View File
@@ -53,6 +53,7 @@ static Tcl_ObjCmdProc EncodingDirsObjCmd;
static Tcl_ObjCmdProc EncodingNamesObjCmd;
static Tcl_ObjCmdProc EncodingProfilesObjCmd;
static Tcl_ObjCmdProc EncodingSystemObjCmd;
static Tcl_ObjCmdProc EncodingUserObjCmd;
static inline int ForeachAssignments(Tcl_Interp *interp,
struct ForeachState *statePtr);
static inline void ForeachCleanup(Tcl_Interp *interp,
@@ -394,6 +395,7 @@ TclInitEncodingCmd(
{"names", EncodingNamesObjCmd, TclCompileBasic0ArgCmd, NULL, NULL, 0},
{"profiles", EncodingProfilesObjCmd, TclCompileBasic0ArgCmd, NULL, NULL, 0},
{"system", EncodingSystemObjCmd, TclCompileBasic0Or1ArgCmd, NULL, NULL, 1},
{"user", EncodingUserObjCmd, TclCompileBasic0ArgCmd, NULL, NULL, 1},
{NULL, NULL, NULL, NULL, NULL, 0}
};
@@ -524,7 +526,7 @@ EncodingConvertfromObjCmd(
Tcl_Obj *data; /* Byte array to convert */
Tcl_DString ds; /* Buffer to hold the string */
Tcl_Encoding encoding; /* Encoding to use */
Tcl_Size length = 0; /* Length of the byte array being converted */
Tcl_Size length = 0; /* Length of the byte array being converted */
const char *bytesPtr; /* Pointer to the first byte of the array */
int flags;
int result;
@@ -593,6 +595,7 @@ EncodingConvertfromObjCmd(
Tcl_FreeEncoding(encoding);
return TCL_OK;
}
/*
@@ -685,6 +688,7 @@ EncodingConverttoObjCmd(
Tcl_FreeEncoding(encoding);
return TCL_OK;
}
/*
@@ -750,9 +754,9 @@ EncodingDirsObjCmd(
int
EncodingNamesObjCmd(
TCL_UNUSED(void *),
Tcl_Interp* interp, /* Tcl interpreter */
int objc, /* Number of command line args */
Tcl_Obj* const objv[]) /* Vector of command line args */
Tcl_Interp* interp, /* Tcl interpreter */
int objc, /* Number of command line args */
Tcl_Obj* const objv[]) /* Vector of command line args */
{
if (objc > 1) {
Tcl_WrongNumArgs(interp, 1, objv, NULL);
@@ -826,6 +830,41 @@ EncodingSystemObjCmd(
return TCL_OK;
}
/*
*-----------------------------------------------------------------------------
*
* EncodingUserObjCmd --
*
* This command retrieves the encoding as per the user settings.
*
* Results:
* Returns a standard Tcl result
*
*-----------------------------------------------------------------------------
*/
int
EncodingUserObjCmd(
TCL_UNUSED(void *),
Tcl_Interp* interp, /* Tcl interpreter */
int objc, /* Number of command line args */
Tcl_Obj* const objv[]) /* Vector of command line args */
{
if (objc != 1) {
Tcl_WrongNumArgs(interp, 1, objv, "");
return TCL_ERROR;
}
#ifdef _WIN32
const char *encodingName = Tcl_GetEncodingName(TclWinGetUserEncoding(interp));
if (encodingName) {
Tcl_SetObjResult(interp, Tcl_NewStringObj(encodingName, -1));
}
return TCL_OK;
#else
return EncodingSystemObjCmd(NULL, interp, objc, objv);
#endif
}
/*
*----------------------------------------------------------------------
*
+24 -18
View File
@@ -1259,7 +1259,7 @@ TclInfoFrame(
{
Interp *iPtr = (Interp *) interp;
Tcl_Obj *tmpObj;
Tcl_Obj *lv[20] = {NULL}; /* Keep uptodate when more keys are added to
Tcl_Obj *lv[20] = {NULL}; /* Keep uptodate when more keys are added to
* the dict. */
int lc = 0;
/*
@@ -2427,7 +2427,7 @@ int
Tcl_LinsertObjCmd(
TCL_UNUSED(void *),
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
{
Tcl_Obj *listPtr;
@@ -2520,8 +2520,9 @@ int
Tcl_ListObjCmd(
TCL_UNUSED(void *),
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* The argument objects. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[])
/* The argument objects. */
{
/*
* If there are no list elements, the result is an empty object.
@@ -2556,7 +2557,8 @@ Tcl_LlengthObjCmd(
TCL_UNUSED(void *),
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
Tcl_Obj *const objv[])
/* Argument objects. */
{
Tcl_Size listLen;
int result;
@@ -2604,7 +2606,8 @@ Tcl_LpopObjCmd(
TCL_UNUSED(void *),
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
Tcl_Obj *const objv[])
/* Argument objects. */
{
Tcl_Size listLen;
int copied = 0, result;
@@ -2722,7 +2725,8 @@ Tcl_LrangeObjCmd(
TCL_UNUSED(void *),
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
Tcl_Obj *const objv[])
/* Argument objects. */
{
int result;
Tcl_Size listLen, first, last;
@@ -2933,8 +2937,9 @@ int
Tcl_LrepeatObjCmd(
TCL_UNUSED(void *),
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* The argument objects. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[])
/* The argument objects. */
{
Tcl_WideInt elementCount, i;
Tcl_Size totalElems;
@@ -4032,11 +4037,11 @@ Tcl_LsearchObjCmd(
static SequenceDecoded
SequenceIdentifyArgument(
Tcl_Interp *interp, /* for error reporting */
Tcl_Obj *argPtr, /* Argument to decode */
Tcl_Interp *interp, /* for error reporting */
Tcl_Obj *argPtr, /* Argument to decode */
int allowedArgs, /* Flags if keyword or numeric allowed. */
Tcl_Obj **numValuePtr, /* Return numeric value */
int *keywordIndexPtr) /* Return keyword enum */
Tcl_Obj **numValuePtr, /* Return numeric value */
int *keywordIndexPtr) /* Return keyword enum */
{
int result = TCL_ERROR;
SequenceOperators opmode;
@@ -4080,7 +4085,8 @@ SequenceIdentifyArgument(
int keyword;
/* Determine if result of expression is double or int */
if (Tcl_GetNumberFromObj(interp, exprValueObj, &internalPtr,
&keyword) != TCL_OK) {
&keyword) != TCL_OK
) {
return ErrArg;
}
*numValuePtr = exprValueObj; /* incremented in Tcl_ExprObj */
@@ -4128,9 +4134,9 @@ SequenceIdentifyArgument(
int
Tcl_LseqObjCmd(
TCL_UNUSED(void *),
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* The argument objects. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* The argument objects. */
{
Tcl_Obj *elementCount = NULL;
Tcl_Obj *start = NULL, *end = NULL, *step = NULL;
@@ -5356,7 +5362,7 @@ DictionaryCompare(
int secondaryDiff = 0;
while (1) {
if (isdigit(UCHAR(*right)) /* INTL: digit */
if (isdigit(UCHAR(*right)) /* INTL: digit */
&& isdigit(UCHAR(*left))) { /* INTL: digit */
/*
* There are decimal numbers embedded in the two strings. Compare
+5 -5
View File
@@ -3840,7 +3840,7 @@ TclNRSwitchObjCmd(
if (ctxPtr->type == TCL_LOCATION_SOURCE && ctxPtr->line[bidx] >= 0) {
int bline = ctxPtr->line[bidx];
ctxPtr->line = (int *)Tcl_Alloc(objc * sizeof(int));
ctxPtr->line = (Tcl_Size *)Tcl_Alloc(objc * sizeof(Tcl_Size));
ctxPtr->nline = objc;
TclListLines(blist, bline, objc, ctxPtr->line, objv);
} else {
@@ -3854,7 +3854,7 @@ TclNRSwitchObjCmd(
int k;
ctxPtr->line = (int *)Tcl_Alloc(objc * sizeof(int));
ctxPtr->line = (Tcl_Size *)Tcl_Alloc(objc * sizeof(Tcl_Size));
ctxPtr->nline = objc;
for (k=0; k < objc; k++) {
ctxPtr->line[k] = -1;
@@ -5337,10 +5337,10 @@ TclListLines(
Tcl_Obj *listObj, /* Pointer to obj holding a string with list
* structure. Assumed to be valid. Assumed to
* contain n elements. */
int line, /* Line the list as a whole starts on. */
Tcl_Size line, /* Line the list as a whole starts on. */
Tcl_Size n, /* #elements in lines */
int *lines, /* Array of line numbers, to fill. */
Tcl_Obj *const *elems) /* The list elems as Tcl_Obj*, in need of
Tcl_Size *lines, /* Array of line numbers, to fill. */
Tcl_Obj *const *elems) /* The list elems as Tcl_Obj*, in need of
* derived continuation data */
{
const char *listStr = TclGetString(listObj);
+104 -117
View File
@@ -128,12 +128,11 @@ TclCompileAppendCmd(
{
DefineLineInformation; /* TIP #280 */
Tcl_Token *varTokenPtr, *valueTokenPtr;
int isScalar;
Tcl_Size i, numWords, localIndex;
int isScalar, localIndex, numWords, i;
/* TODO: Consider support for compiling expanded args. */
numWords = parsePtr->numWords;
if (numWords == 1 || numWords > INT_MAX) {
if (numWords == 1) {
return TCL_ERROR;
} else if (numWords == 2) {
/*
@@ -254,8 +253,7 @@ TclCompileArrayExistsCmd(
{
DefineLineInformation; /* TIP #280 */
Tcl_Token *tokenPtr;
int isScalar;
Tcl_Size localIndex;
int isScalar, localIndex;
if (parsePtr->numWords != 2) {
return TCL_ERROR;
@@ -264,7 +262,7 @@ TclCompileArrayExistsCmd(
tokenPtr = TokenAfter(parsePtr->tokenPtr);
PushVarNameWord(interp, tokenPtr, envPtr, TCL_NO_ELEMENT,
&localIndex, &isScalar, 1);
if (!isScalar || localIndex > INT_MAX) {
if (!isScalar) {
return TCL_ERROR;
}
@@ -287,11 +285,11 @@ TclCompileArraySetCmd(
{
DefineLineInformation; /* TIP #280 */
Tcl_Token *varTokenPtr, *dataTokenPtr;
int isScalar, code = TCL_OK;
int isScalar, localIndex, code = TCL_OK;
int isDataLiteral, isDataValid, isDataEven;
Tcl_Size localIndex, len;
Tcl_Size keyVar, valVar, infoIndex;
Tcl_Size fwd, offsetBack, offsetFwd;
Tcl_Size len;
int keyVar, valVar, infoIndex;
int fwd, offsetBack, offsetFwd;
Tcl_Obj *literalObj;
ForeachInfo *infoPtr;
@@ -343,7 +341,7 @@ TclCompileArraySetCmd(
PushVarNameWord(interp, varTokenPtr, envPtr, TCL_NO_ELEMENT,
&localIndex, &isScalar, 1);
if (!isScalar || localIndex > INT_MAX) {
if (!isScalar) {
code = TCL_ERROR;
goto done;
}
@@ -461,8 +459,7 @@ TclCompileArrayUnsetCmd(
{
DefineLineInformation; /* TIP #280 */
Tcl_Token *tokenPtr = TokenAfter(parsePtr->tokenPtr);
int isScalar;
Tcl_Size localIndex;
int isScalar, localIndex;
if (parsePtr->numWords != 2) {
return TclCompileBasic2ArgCmd(interp, parsePtr, cmdPtr, envPtr);
@@ -579,15 +576,15 @@ TclCompileCatchCmd(
DefineLineInformation; /* TIP #280 */
JumpFixup jumpFixup;
Tcl_Token *cmdTokenPtr, *resultNameTokenPtr, *optsNameTokenPtr;
Tcl_Size resultIndex, optsIndex, range, dropScript = 0;
Tcl_Size depth = TclGetStackDepth(envPtr);
int resultIndex, optsIndex, range, dropScript = 0;
int depth = TclGetStackDepth(envPtr);
/*
* If syntax does not match what we expect for [catch], do not compile.
* Let runtime checks determine if syntax has changed.
*/
if ((parsePtr->numWords < 2) || (parsePtr->numWords > 4)) {
if (((int)parsePtr->numWords < 2) || ((int)parsePtr->numWords > 4)) {
return TCL_ERROR;
}
@@ -596,7 +593,7 @@ TclCompileCatchCmd(
* (not in a procedure), don't compile it inline: the payoff is too small.
*/
if ((parsePtr->numWords >= 3) && !EnvHasLVT(envPtr)) {
if (((int)parsePtr->numWords >= 3) && !EnvHasLVT(envPtr)) {
return TCL_ERROR;
}
@@ -607,7 +604,7 @@ TclCompileCatchCmd(
resultIndex = optsIndex = -1;
cmdTokenPtr = TokenAfter(parsePtr->tokenPtr);
if (parsePtr->numWords >= 3) {
if ((int)parsePtr->numWords >= 3) {
resultNameTokenPtr = TokenAfter(cmdTokenPtr);
/* DGP */
resultIndex = LocalScalarFromToken(resultNameTokenPtr, envPtr);
@@ -859,7 +856,7 @@ TclCompileConcatCmd(
DefineLineInformation; /* TIP #280 */
Tcl_Obj *objPtr, *listObj;
Tcl_Token *tokenPtr;
Tcl_Size i;
int i;
/* TODO: Consider compiling expansion case. */
if (parsePtr->numWords == 1) {
@@ -869,8 +866,6 @@ TclCompileConcatCmd(
PushStringLiteral(envPtr, "");
return TCL_OK;
} else if (parsePtr->numWords > INT_MAX) {
return TCL_ERROR;
}
/*
@@ -879,7 +874,7 @@ TclCompileConcatCmd(
*/
TclNewObj(listObj);
for (i = 1, tokenPtr = parsePtr->tokenPtr; i < parsePtr->numWords; i++) {
for (i = 1, tokenPtr = parsePtr->tokenPtr; i < (int)parsePtr->numWords; i++) {
tokenPtr = TokenAfter(tokenPtr);
TclNewObj(objPtr);
if (!TclWordKnownAtCompileTime(tokenPtr, objPtr)) {
@@ -908,10 +903,7 @@ TclCompileConcatCmd(
* General case: runtime concat.
*/
if (parsePtr->numWords > 256) {
return TCL_ERROR;
}
for (i = 1, tokenPtr = parsePtr->tokenPtr; i < parsePtr->numWords; i++) {
for (i = 1, tokenPtr = parsePtr->tokenPtr; i < (int)parsePtr->numWords; i++) {
tokenPtr = TokenAfter(tokenPtr);
CompileWord(envPtr, tokenPtr, interp, i);
}
@@ -949,8 +941,7 @@ TclCompileConstCmd(
{
DefineLineInformation; /* TIP #280 */
Tcl_Token *varTokenPtr, *valueTokenPtr;
int isScalar;
Tcl_Size localIndex;
int isScalar, localIndex;
/*
* Need exactly two arguments.
@@ -975,7 +966,7 @@ TclCompileConstCmd(
* If the user specified an array element, we don't bother handling
* that.
*/
if (!isScalar || localIndex > INT_MAX) {
if (!isScalar) {
return TCL_ERROR;
}
@@ -1090,14 +1081,14 @@ TclCompileDictSetCmd(
{
DefineLineInformation; /* TIP #280 */
Tcl_Token *tokenPtr;
Tcl_Size i, dictVarIndex;
int i, dictVarIndex;
Tcl_Token *varTokenPtr;
/*
* There must be at least one argument after the command.
*/
if (parsePtr->numWords < 4 || parsePtr->numWords > INT_MAX) {
if ((int)parsePtr->numWords < 4) {
return TCL_ERROR;
}
@@ -1118,7 +1109,7 @@ TclCompileDictSetCmd(
*/
tokenPtr = TokenAfter(varTokenPtr);
for (i=2 ; i< parsePtr->numWords ; i++) {
for (i=2 ; i< (int)parsePtr->numWords ; i++) {
CompileWord(envPtr, tokenPtr, interp, i);
tokenPtr = TokenAfter(tokenPtr);
}
@@ -1127,7 +1118,7 @@ TclCompileDictSetCmd(
* Now emit the instruction to do the dict manipulation.
*/
TclEmitInstInt4( INST_DICT_SET, parsePtr->numWords-3, envPtr);
TclEmitInstInt4( INST_DICT_SET, (int)parsePtr->numWords-3, envPtr);
TclEmitInt4( dictVarIndex, envPtr);
TclAdjustStackDepth(-1, envPtr);
return TCL_OK;
@@ -1144,14 +1135,13 @@ TclCompileDictIncrCmd(
{
DefineLineInformation; /* TIP #280 */
Tcl_Token *varTokenPtr, *keyTokenPtr;
Tcl_Size dictVarIndex;
int incrAmount;
int dictVarIndex, incrAmount;
/*
* There must be at least two arguments after the command.
*/
if (parsePtr->numWords < 3 || parsePtr->numWords > 4) {
if ((int)parsePtr->numWords < 3 || (int)parsePtr->numWords > 4) {
return TCL_ERROR;
}
varTokenPtr = TokenAfter(parsePtr->tokenPtr);
@@ -1217,7 +1207,7 @@ TclCompileDictGetCmd(
{
DefineLineInformation; /* TIP #280 */
Tcl_Token *tokenPtr;
Tcl_Size i;
int i;
/*
* There must be at least two arguments after the command (the single-arg
@@ -1225,7 +1215,7 @@ TclCompileDictGetCmd(
*/
/* TODO: Consider support for compiling expanded args. */
if (parsePtr->numWords < 3 || parsePtr->numWords > INT_MAX) {
if ((int)parsePtr->numWords < 3) {
return TCL_ERROR;
}
tokenPtr = TokenAfter(parsePtr->tokenPtr);
@@ -1234,11 +1224,11 @@ TclCompileDictGetCmd(
* Only compile this because we need INST_DICT_GET anyway.
*/
for (i=1 ; i<parsePtr->numWords ; i++) {
for (i=1 ; i<(int)parsePtr->numWords ; i++) {
CompileWord(envPtr, tokenPtr, interp, i);
tokenPtr = TokenAfter(tokenPtr);
}
TclEmitInstInt4(INST_DICT_GET, parsePtr->numWords-2, envPtr);
TclEmitInstInt4(INST_DICT_GET, (int)parsePtr->numWords-2, envPtr);
TclAdjustStackDepth(-1, envPtr);
return TCL_OK;
}
@@ -1253,23 +1243,23 @@ TclCompileDictGetWithDefaultCmd(
{
DefineLineInformation; /* TIP #280 */
Tcl_Token *tokenPtr;
Tcl_Size i;
int i;
/*
* There must be at least three arguments after the command.
*/
/* TODO: Consider support for compiling expanded args. */
if (parsePtr->numWords < 4 || parsePtr->numWords > INT_MAX) {
if ((int)parsePtr->numWords < 4) {
return TCL_ERROR;
}
tokenPtr = TokenAfter(parsePtr->tokenPtr);
for (i=1 ; i<parsePtr->numWords ; i++) {
for (i=1 ; i<(int)parsePtr->numWords ; i++) {
CompileWord(envPtr, tokenPtr, interp, i);
tokenPtr = TokenAfter(tokenPtr);
}
TclEmitInstInt4(INST_DICT_GET_DEF, parsePtr->numWords-3, envPtr);
TclEmitInstInt4(INST_DICT_GET_DEF, (int)parsePtr->numWords-3, envPtr);
TclAdjustStackDepth(-2, envPtr);
return TCL_OK;
}
@@ -1284,7 +1274,7 @@ TclCompileDictExistsCmd(
{
DefineLineInformation; /* TIP #280 */
Tcl_Token *tokenPtr;
Tcl_Size i;
int i;
/*
* There must be at least two arguments after the command (the single-arg
@@ -1292,7 +1282,7 @@ TclCompileDictExistsCmd(
*/
/* TODO: Consider support for compiling expanded args. */
if (parsePtr->numWords < 3 || parsePtr->numWords > INT_MAX) {
if ((int)parsePtr->numWords < 3) {
return TCL_ERROR;
}
tokenPtr = TokenAfter(parsePtr->tokenPtr);
@@ -1301,11 +1291,11 @@ TclCompileDictExistsCmd(
* Now we do the code generation.
*/
for (i=1 ; i<parsePtr->numWords ; i++) {
for (i=1 ; i<(int)parsePtr->numWords ; i++) {
CompileWord(envPtr, tokenPtr, interp, i);
tokenPtr = TokenAfter(tokenPtr);
}
TclEmitInstInt4(INST_DICT_EXISTS, parsePtr->numWords-2, envPtr);
TclEmitInstInt4(INST_DICT_EXISTS, (int)parsePtr->numWords-2, envPtr);
TclAdjustStackDepth(-1, envPtr);
return TCL_OK;
}
@@ -1321,7 +1311,7 @@ TclCompileDictUnsetCmd(
{
DefineLineInformation; /* TIP #280 */
Tcl_Token *tokenPtr;
Tcl_Size i, dictVarIndex;
int i, dictVarIndex;
/*
* There must be at least one argument after the variable name for us to
@@ -1329,7 +1319,7 @@ TclCompileDictUnsetCmd(
*/
/* TODO: Consider support for compiling expanded args. */
if (parsePtr->numWords < 3 || parsePtr->numWords > INT_MAX) {
if ((int)parsePtr->numWords < 3) {
return TCL_ERROR;
}
@@ -1349,7 +1339,7 @@ TclCompileDictUnsetCmd(
* Remaining words (the key path) can be handled normally.
*/
for (i=2 ; i<parsePtr->numWords ; i++) {
for (i=2 ; i<(int)parsePtr->numWords ; i++) {
tokenPtr = TokenAfter(tokenPtr);
CompileWord(envPtr, tokenPtr, interp, i);
}
@@ -1358,7 +1348,7 @@ TclCompileDictUnsetCmd(
* Now emit the instruction to do the dict manipulation.
*/
TclEmitInstInt4( INST_DICT_UNSET, parsePtr->numWords-2, envPtr);
TclEmitInstInt4( INST_DICT_UNSET, (int)parsePtr->numWords-2, envPtr);
TclEmitInt4( dictVarIndex, envPtr);
return TCL_OK;
}
@@ -1373,13 +1363,14 @@ TclCompileDictCreateCmd(
CompileEnv *envPtr) /* Holds resulting instructions. */
{
DefineLineInformation; /* TIP #280 */
Tcl_Size worker; /* Temp var for building the value in. */
int worker; /* Temp var for building the value in. */
Tcl_Token *tokenPtr;
Tcl_Obj *keyObj, *valueObj, *dictObj;
const char *bytes;
Tcl_Size i, len;
int i;
Tcl_Size len;
if ((parsePtr->numWords & 1) == 0 || parsePtr->numWords > INT_MAX) {
if ((parsePtr->numWords & 1) == 0) {
return TCL_ERROR;
}
@@ -1390,7 +1381,7 @@ TclCompileDictCreateCmd(
tokenPtr = TokenAfter(parsePtr->tokenPtr);
TclNewObj(dictObj);
Tcl_IncrRefCount(dictObj);
for (i=1 ; i<parsePtr->numWords ; i+=2) {
for (i=1 ; i<(int)parsePtr->numWords ; i+=2) {
TclNewObj(keyObj);
Tcl_IncrRefCount(keyObj);
if (!TclWordKnownAtCompileTime(tokenPtr, keyObj)) {
@@ -1440,7 +1431,7 @@ TclCompileDictCreateCmd(
Emit14Inst( INST_STORE_SCALAR, worker, envPtr);
TclEmitOpcode( INST_POP, envPtr);
tokenPtr = TokenAfter(parsePtr->tokenPtr);
for (i=1 ; i<parsePtr->numWords ; i+=2) {
for (i=1 ; i<(int)parsePtr->numWords ; i+=2) {
CompileWord(envPtr, tokenPtr, interp, i);
tokenPtr = TokenAfter(tokenPtr);
CompileWord(envPtr, tokenPtr, interp, i+1);
@@ -1467,8 +1458,7 @@ TclCompileDictMergeCmd(
{
DefineLineInformation; /* TIP #280 */
Tcl_Token *tokenPtr;
Tcl_Size i;
Tcl_Size workerIndex, infoIndex, outLoop;
int i, workerIndex, infoIndex, outLoop;
/*
* Deal with some special edge cases. Note that in the case with one
@@ -1476,7 +1466,7 @@ TclCompileDictMergeCmd(
*/
/* TODO: Consider support for compiling expanded args. (less likely) */
if (parsePtr->numWords < 2) {
if ((int)parsePtr->numWords < 2) {
PushStringLiteral(envPtr, "");
return TCL_OK;
} else if (parsePtr->numWords == 2) {
@@ -1518,7 +1508,7 @@ TclCompileDictMergeCmd(
outLoop = TclCreateExceptRange(CATCH_EXCEPTION_RANGE, envPtr);
TclEmitInstInt4( INST_BEGIN_CATCH4, outLoop, envPtr);
ExceptionRangeStarts(envPtr, outLoop);
for (i=2 ; i<parsePtr->numWords ; i++) {
for (i=2 ; i<(int)parsePtr->numWords ; i++) {
/*
* Get the dictionary, and merge its pairs into the first dict (using
* a small loop).
@@ -1611,11 +1601,11 @@ CompileDictEachCmd(
{
DefineLineInformation; /* TIP #280 */
Tcl_Token *varsTokenPtr, *dictTokenPtr, *bodyTokenPtr;
Tcl_Size keyVarIndex, valueVarIndex, nameChars, loopRange, catchRange;
Tcl_Size infoIndex, jumpDisplacement, bodyTargetOffset, emptyTargetOffset;
int keyVarIndex, valueVarIndex, nameChars, loopRange, catchRange;
int infoIndex, jumpDisplacement, bodyTargetOffset, emptyTargetOffset;
Tcl_Size numVars;
Tcl_Size endTargetOffset;
Tcl_Size collectVar = -1; /* Index of temp var holding the result
int endTargetOffset;
int collectVar = -1; /* Index of temp var holding the result
* dict. */
const char **argv;
Tcl_DString buffer;
@@ -1837,7 +1827,7 @@ TclCompileDictUpdateCmd(
CompileEnv *envPtr) /* Holds resulting instructions. */
{
DefineLineInformation; /* TIP #280 */
Tcl_Size i, dictIndex, numVars, range, infoIndex;
int i, dictIndex, numVars, range, infoIndex;
Tcl_Token **keyTokenPtrs, *dictVarTokenPtr, *bodyTokenPtr, *tokenPtr;
DictUpdateInfo *duiPtr;
JumpFixup jumpFixup;
@@ -1846,7 +1836,7 @@ TclCompileDictUpdateCmd(
* There must be at least one argument after the command.
*/
if (parsePtr->numWords < 5) {
if ((int)parsePtr->numWords < 5) {
return TCL_ERROR;
}
@@ -1855,7 +1845,7 @@ TclCompileDictUpdateCmd(
* dict update <lit(eral)> <any> <lit> ?<any> <lit> ...? <lit>
*/
if (!(parsePtr->numWords & 1) || parsePtr->numWords > INT_MAX) {
if (((int)parsePtr->numWords - 1) & 1) {
return TCL_ERROR;
}
numVars = (parsePtr->numWords - 3) / 2;
@@ -1989,8 +1979,7 @@ TclCompileDictAppendCmd(
{
DefineLineInformation; /* TIP #280 */
Tcl_Token *tokenPtr;
Tcl_Size i;
Tcl_Size dictVarIndex;
int i, dictVarIndex;
/*
* There must be at least two argument after the command. And we impose an
@@ -1999,7 +1988,7 @@ TclCompileDictAppendCmd(
*/
/* TODO: Consider support for compiling expanded args. */
if (parsePtr->numWords<4 || parsePtr->numWords>100) {
if ((int)parsePtr->numWords<4 || (int)parsePtr->numWords>100) {
return TCL_ERROR;
}
@@ -2018,12 +2007,12 @@ TclCompileDictAppendCmd(
*/
tokenPtr = TokenAfter(tokenPtr);
for (i=2 ; i<parsePtr->numWords ; i++) {
for (i=2 ; i<(int)parsePtr->numWords ; i++) {
CompileWord(envPtr, tokenPtr, interp, i);
tokenPtr = TokenAfter(tokenPtr);
}
if (parsePtr->numWords > 4) {
TclEmitInstInt1(INST_STR_CONCAT1, parsePtr->numWords-3, envPtr);
if ((int)parsePtr->numWords > 4) {
TclEmitInstInt1(INST_STR_CONCAT1, (int)parsePtr->numWords-3, envPtr);
}
/*
@@ -2045,7 +2034,7 @@ TclCompileDictLappendCmd(
{
DefineLineInformation; /* TIP #280 */
Tcl_Token *varTokenPtr, *keyTokenPtr, *valueTokenPtr;
Tcl_Size dictVarIndex;
int dictVarIndex;
/*
* There must be three arguments after the command.
@@ -2089,9 +2078,8 @@ TclCompileDictWithCmd(
CompileEnv *envPtr) /* Holds resulting instructions. */
{
DefineLineInformation; /* TIP #280 */
Tcl_Size dictVar, i;
Tcl_Size range, varNameTmp = -1, pathTmp = -1, keysTmp;
int bodyIsEmpty = 1, gotPath;
int i, range, varNameTmp = -1, pathTmp = -1, keysTmp, gotPath;
int dictVar, bodyIsEmpty = 1;
Tcl_Token *varTokenPtr, *tokenPtr;
JumpFixup jumpFixup;
const char *ptr, *end;
@@ -2101,7 +2089,7 @@ TclCompileDictWithCmd(
*/
/* TODO: Consider support for compiling expanded args. */
if (parsePtr->numWords < 3 || parsePtr->numWords > INT_MAX) {
if ((int)parsePtr->numWords < 3) {
return TCL_ERROR;
}
@@ -2112,7 +2100,7 @@ TclCompileDictWithCmd(
varTokenPtr = TokenAfter(parsePtr->tokenPtr);
tokenPtr = TokenAfter(varTokenPtr);
for (i=3 ; i<parsePtr->numWords ; i++) {
for (i=3 ; i<(int)parsePtr->numWords ; i++) {
tokenPtr = TokenAfter(tokenPtr);
}
if (tokenPtr->type != TCL_TOKEN_SIMPLE_WORD) {
@@ -2140,7 +2128,7 @@ TclCompileDictWithCmd(
* Determine if we're manipulating a dict in a simple local variable.
*/
gotPath = (parsePtr->numWords > 3);
gotPath = ((int)parsePtr->numWords > 3);
dictVar = LocalScalarFromToken(varTokenPtr, envPtr);
/*
@@ -2159,11 +2147,11 @@ TclCompileDictWithCmd(
*/
tokenPtr = TokenAfter(varTokenPtr);
for (i=2 ; i<parsePtr->numWords-1 ; i++) {
for (i=2 ; i<(int)parsePtr->numWords-1 ; i++) {
CompileWord(envPtr, tokenPtr, interp, i);
tokenPtr = TokenAfter(tokenPtr);
}
TclEmitInstInt4(INST_LIST, parsePtr->numWords-3,envPtr);
TclEmitInstInt4(INST_LIST, (int)parsePtr->numWords-3,envPtr);
Emit14Inst( INST_LOAD_SCALAR, dictVar, envPtr);
TclEmitInstInt4(INST_OVER, 1, envPtr);
TclEmitOpcode( INST_DICT_EXPAND, envPtr);
@@ -2186,11 +2174,11 @@ TclCompileDictWithCmd(
*/
tokenPtr = varTokenPtr;
for (i=1 ; i<parsePtr->numWords-1 ; i++) {
for (i=1 ; i<(int)parsePtr->numWords-1 ; i++) {
CompileWord(envPtr, tokenPtr, interp, i);
tokenPtr = TokenAfter(tokenPtr);
}
TclEmitInstInt4(INST_LIST, parsePtr->numWords-3,envPtr);
TclEmitInstInt4(INST_LIST, (int)parsePtr->numWords-3,envPtr);
TclEmitInstInt4(INST_OVER, 1, envPtr);
TclEmitOpcode( INST_LOAD_STK, envPtr);
TclEmitInstInt4(INST_OVER, 1, envPtr);
@@ -2241,11 +2229,11 @@ TclCompileDictWithCmd(
}
tokenPtr = TokenAfter(varTokenPtr);
if (gotPath) {
for (i=2 ; i<parsePtr->numWords-1 ; i++) {
for (i=2 ; i<(int)parsePtr->numWords-1 ; i++) {
CompileWord(envPtr, tokenPtr, interp, i);
tokenPtr = TokenAfter(tokenPtr);
}
TclEmitInstInt4( INST_LIST, parsePtr->numWords-3,envPtr);
TclEmitInstInt4( INST_LIST, (int)parsePtr->numWords-3,envPtr);
Emit14Inst( INST_STORE_SCALAR, pathTmp, envPtr);
TclEmitOpcode( INST_POP, envPtr);
}
@@ -2307,7 +2295,7 @@ TclCompileDictWithCmd(
if (dictVar == -1) {
Emit14Inst( INST_LOAD_SCALAR, varNameTmp, envPtr);
}
if (parsePtr->numWords > 3) {
if ((int)parsePtr->numWords > 3) {
Emit14Inst( INST_LOAD_SCALAR, pathTmp, envPtr);
} else {
PushStringLiteral(envPtr, "");
@@ -2445,7 +2433,7 @@ TclCompileErrorCmd(
* General syntax: [error message ?errorInfo? ?errorCode?]
*/
if (parsePtr->numWords < 2 || parsePtr->numWords > 4) {
if ((int)parsePtr->numWords < 2 || (int)parsePtr->numWords > 4) {
return TCL_ERROR;
}
@@ -2513,7 +2501,7 @@ TclCompileExprCmd(
{
Tcl_Token *firstWordPtr;
if (parsePtr->numWords == 1 || parsePtr->numWords > INT_MAX) {
if (parsePtr->numWords == 1) {
return TCL_ERROR;
}
@@ -2525,7 +2513,7 @@ TclCompileExprCmd(
envPtr->extCmdMapPtr->nuloc-1].line[1];
firstWordPtr = TokenAfter(parsePtr->tokenPtr);
TclCompileExprWords(interp, firstWordPtr, parsePtr->numWords-1, envPtr);
TclCompileExprWords(interp, firstWordPtr, (int)parsePtr->numWords-1, envPtr);
return TCL_OK;
}
@@ -2558,8 +2546,8 @@ TclCompileForCmd(
DefineLineInformation; /* TIP #280 */
Tcl_Token *startTokenPtr, *testTokenPtr, *nextTokenPtr, *bodyTokenPtr;
JumpFixup jumpEvalCondFixup;
Tcl_Size bodyCodeOffset, nextCodeOffset, jumpDist;
Tcl_Size bodyRange, nextRange;
int bodyCodeOffset, nextCodeOffset, jumpDist;
int bodyRange, nextRange;
if (parsePtr->numWords != 5) {
return TCL_ERROR;
@@ -2774,9 +2762,8 @@ CompileEachloopCmd(
* record in the ByteCode. */
Tcl_Token *tokenPtr, *bodyTokenPtr;
Tcl_Size jumpBackOffset, infoIndex, range;
Tcl_Size numWords, numLists, i;
int code = TCL_OK;
int jumpBackOffset, infoIndex, range;
int numWords, numLists, i, code = TCL_OK;
Tcl_Size j;
Tcl_Obj *varListObj = NULL;
@@ -2789,8 +2776,8 @@ CompileEachloopCmd(
return TCL_ERROR;
}
numWords = parsePtr->numWords;
if ((numWords < 4) || (numWords > INT_MAX) || (numWords%2 != 0)) {
numWords = (int)parsePtr->numWords;
if ((numWords < 4) || (numWords%2 != 0)) {
return TCL_ERROR;
}
@@ -2857,7 +2844,7 @@ CompileEachloopCmd(
for (j = 0; j < numVars; j++) {
Tcl_Obj *varNameObj;
const char *bytes;
Tcl_Size varIndex;
int varIndex;
Tcl_Size length;
Tcl_ListObjIndex(NULL, varListObj, j, &varNameObj);
@@ -2977,13 +2964,13 @@ CompileEachloopCmd(
static void *
DupForeachInfo(
void *clientData) /* The foreach command's compilation auxiliary
void *clientData) /* The foreach command's compilation auxiliary
* data to duplicate. */
{
ForeachInfo *srcPtr = (ForeachInfo *)clientData;
ForeachInfo *dupPtr;
ForeachVarList *srcListPtr, *dupListPtr;
Tcl_Size numVars, i, j, numLists = srcPtr->numLists;
int numVars, i, j, numLists = srcPtr->numLists;
dupPtr = (ForeachInfo *)Tcl_Alloc(offsetof(ForeachInfo, varLists)
+ numLists * sizeof(ForeachVarList *));
@@ -3026,12 +3013,12 @@ DupForeachInfo(
static void
FreeForeachInfo(
void *clientData) /* The foreach command's compilation auxiliary
void *clientData) /* The foreach command's compilation auxiliary
* data to free. */
{
ForeachInfo *infoPtr = (ForeachInfo *)clientData;
ForeachVarList *listPtr;
Tcl_Size i, numLists = infoPtr->numLists;
size_t i, numLists = infoPtr->numLists;
for (i = 0; i < numLists; i++) {
listPtr = infoPtr->varLists[i];
@@ -3240,13 +3227,14 @@ TclCompileFormatCmd(
Tcl_Token *tokenPtr = parsePtr->tokenPtr;
Tcl_Obj **objv, *formatObj, *tmpObj;
const char *bytes, *start;
Tcl_Size i, j, len;
int i, j;
Tcl_Size len;
/*
* Don't handle any guaranteed-error cases.
*/
if (parsePtr->numWords < 2 || parsePtr->numWords > INT_MAX) {
if ((int)parsePtr->numWords < 2) {
return TCL_ERROR;
}
@@ -3263,8 +3251,8 @@ TclCompileFormatCmd(
return TCL_ERROR;
}
objv = (Tcl_Obj **)Tcl_Alloc((parsePtr->numWords-2) * sizeof(Tcl_Obj *));
for (i=0 ; i+2 < parsePtr->numWords ; i++) {
objv = (Tcl_Obj **)Tcl_Alloc(((int)parsePtr->numWords-2) * sizeof(Tcl_Obj *));
for (i=0 ; i+2 < (int)parsePtr->numWords ; i++) {
tokenPtr = TokenAfter(tokenPtr);
TclNewObj(objv[i]);
Tcl_IncrRefCount(objv[i]);
@@ -3279,7 +3267,7 @@ TclCompileFormatCmd(
*/
tmpObj = Tcl_Format(interp, TclGetString(formatObj),
parsePtr->numWords-2, objv);
(int)parsePtr->numWords-2, objv);
for (; --i>=0 ;) {
Tcl_DecrRefCount(objv[i]);
}
@@ -3340,7 +3328,7 @@ TclCompileFormatCmd(
* Check if the number of things to concatenate will fit in a byte.
*/
if (i+2 != parsePtr->numWords || i > 125) {
if (i+2 != (int)parsePtr->numWords || i > 125) {
Tcl_DecrRefCount(formatObj);
return TCL_ERROR;
}
@@ -3358,7 +3346,7 @@ TclCompileFormatCmd(
start = TclGetString(formatObj);
/* The start of the currently-scanned literal
* in the format string. */
TclNewObj(tmpObj); /* The buffer used to accumulate the literal
TclNewObj(tmpObj); /* The buffer used to accumulate the literal
* being built. */
for (bytes = start ; *bytes ; bytes++) {
if (*bytes == '%') {
@@ -3438,13 +3426,12 @@ TclCompileFormatCmd(
*----------------------------------------------------------------------
*/
Tcl_Size
size_t
TclLocalScalarFromToken(
Tcl_Token *tokenPtr,
CompileEnv *envPtr)
{
Tcl_Size index;
int isScalar;
int isScalar, index;
TclPushVarName(NULL, tokenPtr, envPtr, TCL_NO_ELEMENT, &index, &isScalar);
if (!isScalar) {
@@ -3453,7 +3440,7 @@ TclLocalScalarFromToken(
return index;
}
Tcl_Size
size_t
TclLocalScalar(
const char *bytes,
size_t numBytes,
@@ -3504,15 +3491,15 @@ TclPushVarName(
Tcl_Token *varTokenPtr, /* Points to a variable token. */
CompileEnv *envPtr, /* Holds resulting instructions. */
int flags, /* TCL_NO_LARGE_INDEX | TCL_NO_ELEMENT. */
Tcl_Size *localIndexPtr, /* Must not be NULL. */
int *localIndexPtr, /* Must not be NULL. */
int *isScalarPtr) /* Must not be NULL. */
{
const char *p;
const char *last, *name, *elName;
Tcl_Size n;
Tcl_Token *elemTokenPtr = NULL;
Tcl_Size nameLen, elNameLen, localIndex;
int simpleVarName;
size_t nameLen, elNameLen;
int simpleVarName, localIndex;
Tcl_Size elemTokenCount = 0, removedParen = 0;
int allocedTokens = 0;
+54 -62
View File
@@ -25,7 +25,7 @@
static void CompileReturnInternal(CompileEnv *envPtr,
unsigned char op, int code, int level,
Tcl_Obj *returnOpts);
static Tcl_Size IndexTailVarIfKnown(Tcl_Interp *interp,
static int IndexTailVarIfKnown(Tcl_Interp *interp,
Tcl_Token *varTokenPtr, CompileEnv *envPtr);
/*
@@ -58,7 +58,7 @@ TclGetIndexFromToken(
TclNewObj(tmpObj);
if (TclWordKnownAtCompileTime(tokenPtr, tmpObj)) {
result = TclIndexEncode(NULL, tmpObj, (int)before, (int)after, indexPtr);
result = TclIndexEncode(NULL, tmpObj, before, after, indexPtr);
}
Tcl_DecrRefCount(tmpObj);
return result;
@@ -92,7 +92,7 @@ TclCompileGlobalCmd(
{
DefineLineInformation; /* TIP #280 */
Tcl_Token *varTokenPtr;
Tcl_Size localIndex, numWords, i;
int localIndex, numWords, i;
/* TODO: Consider support for compiling expanded args. */
numWords = parsePtr->numWords;
@@ -122,7 +122,7 @@ TclCompileGlobalCmd(
for (i=1; i<numWords; varTokenPtr = TokenAfter(varTokenPtr),i++) {
localIndex = IndexTailVarIfKnown(interp, varTokenPtr, envPtr);
if (localIndex < 0 || localIndex > INT_MAX) {
if (localIndex < 0) {
return TCL_ERROR;
}
@@ -180,10 +180,9 @@ TclCompileIfCmd(
* to the end of the "if" when that PC is
* determined. */
Tcl_Token *tokenPtr, *testTokenPtr;
Tcl_Size jumpIndex = 0; /* Avoid compiler warning. */
int jumpIndex = 0; /* Avoid compiler warning. */
size_t numBytes, j;
int jumpFalseDist, code;
Tcl_Size numWords, wordIdx;
int jumpFalseDist, numWords, wordIdx, code;
const char *word;
int realCond = 1; /* Set to 0 for static conditions:
* "if 0 {..}" */
@@ -477,8 +476,7 @@ TclCompileIncrCmd(
{
DefineLineInformation; /* TIP #280 */
Tcl_Token *varTokenPtr, *incrTokenPtr;
int isScalar, haveImmValue;
Tcl_Size localIndex;
int isScalar, localIndex, haveImmValue;
Tcl_WideInt immValue;
if ((parsePtr->numWords != 2) && (parsePtr->numWords != 3)) {
@@ -674,8 +672,7 @@ TclCompileInfoExistsCmd(
{
DefineLineInformation; /* TIP #280 */
Tcl_Token *tokenPtr;
int isScalar;
Tcl_Size localIndex;
int isScalar, localIndex;
if (parsePtr->numWords != 2) {
return TCL_ERROR;
@@ -848,8 +845,7 @@ TclCompileLappendCmd(
{
DefineLineInformation; /* TIP #280 */
Tcl_Token *varTokenPtr, *valueTokenPtr;
int isScalar;
Tcl_Size localIndex, numWords, i;
int isScalar, localIndex, numWords, i;
/* TODO: Consider support for compiling expanded args. */
numWords = parsePtr->numWords;
@@ -964,8 +960,7 @@ TclCompileLassignCmd(
{
DefineLineInformation; /* TIP #280 */
Tcl_Token *tokenPtr;
int isScalar;
Tcl_Size localIndex, numWords, idx;
int isScalar, localIndex, numWords, idx;
numWords = parsePtr->numWords;
@@ -1035,7 +1030,7 @@ TclCompileLassignCmd(
*/
TclEmitInstInt4( INST_LIST_RANGE_IMM, idx, envPtr);
TclEmitInt4( TCL_INDEX_END, envPtr);
TclEmitInt4( (int)TCL_INDEX_END, envPtr);
return TCL_OK;
}
@@ -1068,8 +1063,7 @@ TclCompileLindexCmd(
{
DefineLineInformation; /* TIP #280 */
Tcl_Token *idxTokenPtr, *valTokenPtr;
Tcl_Size i, numWords = parsePtr->numWords;
int idx;
int i, idx, numWords = parsePtr->numWords;
/*
* Quit if not enough args.
@@ -1159,12 +1153,10 @@ TclCompileListCmd(
{
DefineLineInformation; /* TIP #280 */
Tcl_Token *valueTokenPtr;
Tcl_Size i, numWords;
int concat, build;
int i, numWords, concat, build;
Tcl_Obj *listObj, *objPtr;
numWords = parsePtr->numWords;
if (numWords == 1) {
if (parsePtr->numWords == 1) {
/*
* [list] without arguments just pushes an empty object.
*/
@@ -1178,6 +1170,7 @@ TclCompileListCmd(
* implement with a simple push.
*/
numWords = parsePtr->numWords;
valueTokenPtr = TokenAfter(parsePtr->tokenPtr);
TclNewObj(listObj);
for (i = 1; i < numWords && listObj != NULL; i++) {
@@ -1200,6 +1193,7 @@ TclCompileListCmd(
* Push the all values onto the stack.
*/
numWords = parsePtr->numWords;
valueTokenPtr = TokenAfter(parsePtr->tokenPtr);
concat = build = 0;
for (i = 1; i < numWords; i++) {
@@ -1239,7 +1233,7 @@ TclCompileListCmd(
if (concat && numWords == 2) {
TclEmitInstInt4( INST_LIST_RANGE_IMM, 0, envPtr);
TclEmitInt4( TCL_INDEX_END, envPtr);
TclEmitInt4( (int)TCL_INDEX_END, envPtr);
}
return TCL_OK;
}
@@ -1364,9 +1358,9 @@ TclCompileLinsertCmd(
{
DefineLineInformation; /* TIP #280 */
Tcl_Token *tokenPtr;
Tcl_Size i;
int i;
if (parsePtr->numWords < 3) {
if ((int)parsePtr->numWords < 3) {
return TCL_ERROR;
}
@@ -1377,7 +1371,7 @@ TclCompileLinsertCmd(
CompileWord(envPtr, tokenPtr, interp, 2);
/* Push new elements to be inserted */
for (i=3 ; i<parsePtr->numWords ; i++) {
for (i=3 ; i<(int)parsePtr->numWords ; i++) {
tokenPtr = TokenAfter(tokenPtr);
CompileWord(envPtr, tokenPtr, interp, i);
}
@@ -1416,7 +1410,7 @@ TclCompileLreplaceCmd(
{
DefineLineInformation; /* TIP #280 */
Tcl_Token *tokenPtr;
Tcl_Size i;
int i;
if (parsePtr->numWords < 4) {
return TCL_ERROR;
@@ -1431,7 +1425,7 @@ TclCompileLreplaceCmd(
CompileWord(envPtr, tokenPtr, interp, 3);
/* Push new elements to be inserted */
for (i=4 ; i< parsePtr->numWords ; i++) {
for (i=4 ; i< (int)parsePtr->numWords ; i++) {
tokenPtr = TokenAfter(tokenPtr);
CompileWord(envPtr, tokenPtr, interp, i);
}
@@ -1496,20 +1490,20 @@ TclCompileLsetCmd(
CompileEnv *envPtr) /* Holds the resulting instructions. */
{
DefineLineInformation; /* TIP #280 */
Tcl_Size tempDepth; /* Depth used for emitting one part of the
int tempDepth; /* Depth used for emitting one part of the
* code burst. */
Tcl_Token *varTokenPtr; /* Pointer to the Tcl_Token representing the
* parse of the variable name. */
Tcl_Size localIndex; /* Index of var in local var table. */
int localIndex; /* Index of var in local var table. */
int isScalar; /* Flag == 1 if scalar, 0 if array. */
Tcl_Size i;
int i;
/*
* Check argument count.
*/
/* TODO: Consider support for compiling expanded args. */
if (parsePtr->numWords < 3) {
if ((int)parsePtr->numWords < 3) {
/*
* Fail at run time, not in compilation.
*/
@@ -1533,7 +1527,7 @@ TclCompileLsetCmd(
* Push the "index" args and the new element value.
*/
for (i=2 ; i<parsePtr->numWords ; ++i) {
for (i=2 ; i<(int)parsePtr->numWords ; ++i) {
varTokenPtr = TokenAfter(varTokenPtr);
CompileWord(envPtr, varTokenPtr, interp, i);
}
@@ -1737,7 +1731,7 @@ TclCompileNamespaceQualifiersCmd(
{
DefineLineInformation; /* TIP #280 */
Tcl_Token *tokenPtr = TokenAfter(parsePtr->tokenPtr);
Tcl_Size off;
int off;
if (parsePtr->numWords != 2) {
return TCL_ERROR;
@@ -1808,8 +1802,7 @@ TclCompileNamespaceUpvarCmd(
{
DefineLineInformation; /* TIP #280 */
Tcl_Token *tokenPtr, *otherTokenPtr, *localTokenPtr;
Tcl_Size localIndex;
Tcl_Size numWords, i;
int localIndex, numWords, i;
if (envPtr->procPtr == NULL) {
return TCL_ERROR;
@@ -1819,7 +1812,7 @@ TclCompileNamespaceUpvarCmd(
* Only compile [namespace upvar ...]: needs an even number of args, >=4
*/
numWords = parsePtr->numWords;
numWords = (int)parsePtr->numWords;
if ((numWords % 2) || (numWords < 4)) {
return TCL_ERROR;
}
@@ -1871,7 +1864,7 @@ TclCompileNamespaceWhichCmd(
Tcl_Token *tokenPtr, *opt;
int idx;
if (parsePtr->numWords < 2 || parsePtr->numWords > 3) {
if ((int)parsePtr->numWords < 2 || (int)parsePtr->numWords > 3) {
return TCL_ERROR;
}
tokenPtr = TokenAfter(parsePtr->tokenPtr);
@@ -1934,8 +1927,7 @@ TclCompileRegexpCmd(
Tcl_Token *varTokenPtr; /* Pointer to the Tcl_Token representing the
* parse of the RE or string. */
size_t len;
Tcl_Size i;
int nocase, exact, sawLast, simple;
int i, nocase, exact, sawLast, simple;
const char *str;
/*
@@ -1945,7 +1937,7 @@ TclCompileRegexpCmd(
* regexp ?-nocase? ?--? {^staticString$} $var
*/
if (parsePtr->numWords < 3) {
if ((int)parsePtr->numWords < 3) {
return TCL_ERROR;
}
@@ -1960,7 +1952,7 @@ TclCompileRegexpCmd(
* handling, but satisfies our stricter needs.
*/
for (i = 1; i < parsePtr->numWords - 2; i++) {
for (i = 1; i < (int)parsePtr->numWords - 2; i++) {
varTokenPtr = TokenAfter(varTokenPtr);
if (varTokenPtr->type != TCL_TOKEN_SIMPLE_WORD) {
/*
@@ -1986,7 +1978,7 @@ TclCompileRegexpCmd(
}
}
if ((parsePtr->numWords - i) != 2) {
if (((int)parsePtr->numWords - i) != 2) {
/*
* We don't support capturing to variables.
*/
@@ -2039,7 +2031,7 @@ TclCompileRegexpCmd(
}
if (!simple) {
CompileWord(envPtr, varTokenPtr, interp, parsePtr->numWords - 2);
CompileWord(envPtr, varTokenPtr, interp, (int)parsePtr->numWords - 2);
}
/*
@@ -2047,7 +2039,7 @@ TclCompileRegexpCmd(
*/
varTokenPtr = TokenAfter(varTokenPtr);
CompileWord(envPtr, varTokenPtr, interp, parsePtr->numWords - 1);
CompileWord(envPtr, varTokenPtr, interp, (int)parsePtr->numWords - 1);
if (simple) {
if (exact && !nocase) {
@@ -2124,7 +2116,7 @@ TclCompileRegsubCmd(
int exact, quantified, result = TCL_ERROR;
Tcl_Size len;
if (parsePtr->numWords < 5 || parsePtr->numWords > 6) {
if ((int)parsePtr->numWords < 5 || (int)parsePtr->numWords > 6) {
return TCL_ERROR;
}
@@ -2231,7 +2223,7 @@ TclCompileRegsubCmd(
PushLiteral(envPtr, bytes, len);
bytes = TclGetStringFromObj(replacementObj, &len);
PushLiteral(envPtr, bytes, len);
CompileWord(envPtr, stringTokenPtr, interp, parsePtr->numWords - 2);
CompileWord(envPtr, stringTokenPtr, interp, (int)parsePtr->numWords - 2);
TclEmitOpcode( INST_STR_MAP, envPtr);
done:
@@ -2278,9 +2270,9 @@ TclCompileReturnCmd(
*/
int level, code, objc, status = TCL_OK;
Tcl_Size size;
Tcl_Size numWords = parsePtr->numWords;
int numWords = parsePtr->numWords;
int explicitResult = (0 == (numWords % 2));
Tcl_Size numOptionWords = numWords - 1 - explicitResult;
int numOptionWords = numWords - 1 - explicitResult;
Tcl_Obj *returnOpts, **objv;
Tcl_Token *wordTokenPtr = TokenAfter(parsePtr->tokenPtr);
@@ -2380,7 +2372,7 @@ TclCompileReturnCmd(
* We have default return options and we're in a proc ...
*/
Tcl_Size index = envPtr->exceptArrayNext - 1;
int index = envPtr->exceptArrayNext - 1;
int enclosingCatch = 0;
while (index >= 0) {
@@ -2525,7 +2517,7 @@ TclCompileUpvarCmd(
{
DefineLineInformation; /* TIP #280 */
Tcl_Token *tokenPtr, *otherTokenPtr, *localTokenPtr;
Tcl_Size localIndex, numWords, i;
int localIndex, numWords, i;
Tcl_Obj *objPtr;
if (envPtr->procPtr == NULL) {
@@ -2631,7 +2623,7 @@ TclCompileVariableCmd(
{
DefineLineInformation; /* TIP #280 */
Tcl_Token *varTokenPtr, *valueTokenPtr;
Tcl_Size localIndex, numWords, i;
int localIndex, numWords, i;
numWords = parsePtr->numWords;
if (numWords < 2) {
@@ -2705,7 +2697,7 @@ TclCompileVariableCmd(
*----------------------------------------------------------------------
*/
static Tcl_Size
static int
IndexTailVarIfKnown(
TCL_UNUSED(Tcl_Interp *),
Tcl_Token *varTokenPtr, /* Token representing the variable name */
@@ -2713,10 +2705,10 @@ IndexTailVarIfKnown(
{
Tcl_Obj *tailPtr;
const char *tailName, *p;
Tcl_Size n = varTokenPtr->numComponents;
Tcl_Size len, localIndex;
int n = varTokenPtr->numComponents;
Tcl_Size len;
Tcl_Token *lastTokenPtr;
int full;
int full, localIndex;
/*
* Determine if the tail is (a) known at compile time, and (b) not an
@@ -2805,13 +2797,13 @@ TclCompileObjectNextCmd(
{
DefineLineInformation; /* TIP #280 */
Tcl_Token *tokenPtr = parsePtr->tokenPtr;
Tcl_Size i;
int i;
if (parsePtr->numWords > 255) {
if ((int)parsePtr->numWords > 255) {
return TCL_ERROR;
}
for (i=0 ; i<parsePtr->numWords ; i++) {
for (i=0 ; i<(int)parsePtr->numWords ; i++) {
CompileWord(envPtr, tokenPtr, interp, i);
tokenPtr = TokenAfter(tokenPtr);
}
@@ -2829,13 +2821,13 @@ TclCompileObjectNextToCmd(
{
DefineLineInformation; /* TIP #280 */
Tcl_Token *tokenPtr = parsePtr->tokenPtr;
Tcl_Size i;
int i;
if (parsePtr->numWords < 2 || parsePtr->numWords > 255) {
if ((int)parsePtr->numWords < 2 || (int)parsePtr->numWords > 255) {
return TCL_ERROR;
}
for (i=0 ; i<parsePtr->numWords ; i++) {
for (i=0 ; i<(int)parsePtr->numWords ; i++) {
CompileWord(envPtr, tokenPtr, interp, i);
tokenPtr = TokenAfter(tokenPtr);
}
+84 -95
View File
@@ -42,21 +42,21 @@ static int CompileUnaryOpCmd(Tcl_Interp *interp,
static void IssueSwitchChainedTests(Tcl_Interp *interp,
CompileEnv *envPtr, int mode, int noCase,
Tcl_Size numWords, Tcl_Token **bodyToken,
int *bodyLines, Tcl_Size **bodyNext);
Tcl_Size *bodyLines, Tcl_Size **bodyNext);
static void IssueSwitchJumpTable(Tcl_Interp *interp,
CompileEnv *envPtr, Tcl_Size numWords,
Tcl_Token **bodyToken, int *bodyLines,
CompileEnv *envPtr, int numWords,
Tcl_Token **bodyToken, Tcl_Size *bodyLines,
Tcl_Size **bodyContLines);
static int IssueTryClausesInstructions(Tcl_Interp *interp,
CompileEnv *envPtr, Tcl_Token *bodyToken,
Tcl_Size numHandlers, int *matchCodes,
Tcl_Obj **matchClauses, Tcl_Size *resultVarIndices,
Tcl_Size *optionVarIndices, Tcl_Token **handlerTokens);
int numHandlers, int *matchCodes,
Tcl_Obj **matchClauses, int *resultVarIndices,
int *optionVarIndices, Tcl_Token **handlerTokens);
static int IssueTryClausesFinallyInstructions(Tcl_Interp *interp,
CompileEnv *envPtr, Tcl_Token *bodyToken,
Tcl_Size numHandlers, int *matchCodes,
Tcl_Obj **matchClauses, Tcl_Size *resultVarIndices,
Tcl_Size *optionVarIndices, Tcl_Token **handlerTokens,
int numHandlers, int *matchCodes,
Tcl_Obj **matchClauses, int *resultVarIndices,
int *optionVarIndices, Tcl_Token **handlerTokens,
Tcl_Token *finallyToken);
static int IssueTryFinallyInstructions(Tcl_Interp *interp,
CompileEnv *envPtr, Tcl_Token *bodyToken,
@@ -130,8 +130,7 @@ TclCompileSetCmd(
{
DefineLineInformation; /* TIP #280 */
Tcl_Token *varTokenPtr, *valueTokenPtr;
int isAssignment, isScalar;
Tcl_Size localIndex, numWords;
int isAssignment, isScalar, localIndex, numWords;
numWords = parsePtr->numWords;
if ((numWords != 2) && (numWords != 3)) {
@@ -223,7 +222,7 @@ TclCompileStringCatCmd(
CompileEnv *envPtr) /* Holds resulting instructions. */
{
DefineLineInformation; /* TIP #280 */
Tcl_Size i, numWords = parsePtr->numWords, numArgs;
int i, numWords = parsePtr->numWords, numArgs;
Tcl_Token *wordTokenPtr;
Tcl_Obj *obj, *folded;
@@ -519,8 +518,7 @@ TclCompileStringIsCmd(
STR_IS_SPACE, STR_IS_TRUE, STR_IS_UPPER,
STR_IS_WIDE, STR_IS_WORD, STR_IS_XDIGIT
} t;
Tcl_Size range, end;
int allowEmpty = 0;
int range, allowEmpty = 0, end;
InstStringClassType strClassType;
Tcl_Obj *isClass;
@@ -574,7 +572,7 @@ TclCompileStringIsCmd(
* 5. Lists
*/
CompileWord(envPtr, tokenPtr, interp, parsePtr->numWords-1);
CompileWord(envPtr, tokenPtr, interp, (int)parsePtr->numWords-1);
switch (t) {
case STR_IS_ALNUM:
@@ -619,7 +617,7 @@ TclCompileStringIsCmd(
if (allowEmpty) {
OP1( STR_CLASS, strClassType);
} else {
Tcl_Size over, over2;
int over, over2;
OP( DUP);
OP1( STR_CLASS, strClassType);
@@ -639,7 +637,7 @@ TclCompileStringIsCmd(
case STR_IS_TRUE:
OP( TRY_CVT_TO_BOOLEAN);
switch (t) {
Tcl_Size over, over2;
int over, over2;
case STR_IS_BOOL:
if (allowEmpty) {
@@ -687,7 +685,7 @@ TclCompileStringIsCmd(
break;
case STR_IS_DOUBLE: {
Tcl_Size satisfied, isEmpty;
int satisfied, isEmpty;
if (allowEmpty) {
OP( DUP);
@@ -718,7 +716,7 @@ TclCompileStringIsCmd(
case STR_IS_WIDE:
case STR_IS_ENTIER:
if (allowEmpty) {
Tcl_Size testNumType;
int testNumType;
OP( DUP);
OP( NUM_TYPE);
@@ -1056,7 +1054,7 @@ TclCompileStringReplaceCmd(
Tcl_Token *tokenPtr, *valueTokenPtr;
int first, last;
if (parsePtr->numWords < 4 || parsePtr->numWords > 5) {
if ((int)parsePtr->numWords < 4 || (int)parsePtr->numWords > 5) {
return TCL_ERROR;
}
@@ -1178,7 +1176,7 @@ TclCompileStringReplaceCmd(
if (last == INT_MAX) {
OP( POP); /* Pop original */
} else {
OP44( STR_RANGE_IMM, last + 1, TCL_INDEX_END);
OP44( STR_RANGE_IMM, last + 1, (int)TCL_INDEX_END);
OP1( STR_CONCAT1, 2);
}
return TCL_OK;
@@ -1210,7 +1208,7 @@ TclCompileStringReplaceCmd(
PUSH ( "");
return TCL_OK;
}
OP44( STR_RANGE_IMM, last + 1, TCL_INDEX_END);
OP44( STR_RANGE_IMM, last + 1, (int)TCL_INDEX_END);
return TCL_OK;
} else {
if (last == (int)TCL_INDEX_END) {
@@ -1221,7 +1219,7 @@ TclCompileStringReplaceCmd(
OP( DUP);
OP44( STR_RANGE_IMM, 0, first-1);
OP4( REVERSE, 2);
OP44( STR_RANGE_IMM, last + 1, TCL_INDEX_END);
OP44( STR_RANGE_IMM, last + 1, (int)TCL_INDEX_END);
OP1( STR_CONCAT1, 2);
return TCL_OK;
}
@@ -1453,9 +1451,9 @@ TclCompileSubstCmd(
CompileEnv *envPtr) /* Holds resulting instructions. */
{
DefineLineInformation; /* TIP #280 */
Tcl_Size numArgs = parsePtr->numWords - 1;
Tcl_Size objc, numOpts = numArgs - 1;
int flags = TCL_SUBST_ALL;
int numArgs = parsePtr->numWords - 1;
int numOpts = numArgs - 1;
int objc, flags = TCL_SUBST_ALL;
Tcl_Obj **objv/*, *toSubst = NULL*/;
Tcl_Token *wordTokenPtr = TokenAfter(parsePtr->tokenPtr);
int code = TCL_ERROR;
@@ -1516,12 +1514,12 @@ TclSubstCompile(
const char *bytes,
Tcl_Size numBytes,
int flags,
int line,
Tcl_Size line,
CompileEnv *envPtr)
{
Tcl_Token *endTokenPtr, *tokenPtr;
Tcl_Size breakOffset = 0, count = 0;
int bline = line;
int breakOffset = 0, count = 0;
Tcl_Size bline = line;
Tcl_Parse parse;
Tcl_InterpState state = NULL;
@@ -1546,9 +1544,8 @@ TclSubstCompile(
for (endTokenPtr = tokenPtr + parse.numTokens;
tokenPtr < endTokenPtr; tokenPtr = TokenAfter(tokenPtr)) {
Tcl_Size length, catchRange;
int literal;
Tcl_Size breakJump;
Tcl_Size length;
int literal, catchRange, breakJump;
char buf[4] = "";
JumpFixup startFixup, okFixup, returnFixup, breakFixup;
JumpFixup continueFixup, otherFixup, endFixup;
@@ -1790,7 +1787,7 @@ TclCompileSwitchCmd(
{
DefineLineInformation; /* TIP #280 */
Tcl_Token *tokenPtr; /* Pointer to tokens in command. */
Tcl_Size numWords; /* Number of words in command. */
int numWords; /* Number of words in command. */
Tcl_Token *valueTokenPtr; /* Token for the value to switch on. */
enum {Switch_Exact, Switch_Glob, Switch_Regexp} mode;
@@ -1798,7 +1795,7 @@ TclCompileSwitchCmd(
Tcl_Token *bodyTokenArray; /* Array of real pattern list items. */
Tcl_Token **bodyToken; /* Array of pointers to pattern list items. */
int *bodyLines; /* Array of line numbers for body list
Tcl_Size *bodyLines; /* Array of line numbers for body list
* items. */
Tcl_Size **bodyContLines; /* Array of continuation line info. */
int noCase; /* Has the -nocase flag been given? */
@@ -1944,7 +1941,7 @@ TclCompileSwitchCmd(
if (numWords == 1) {
const char *bytes;
Tcl_Size maxLen, numBytes;
int bline; /* TIP #280: line of the pattern/action list,
Tcl_Size bline; /* TIP #280: line of the pattern/action list,
* and start of list for when tracking the
* location. This list comes immediately after
* the value we switch on. */
@@ -1962,7 +1959,7 @@ TclCompileSwitchCmd(
}
bodyTokenArray = (Tcl_Token *)Tcl_Alloc(sizeof(Tcl_Token) * maxLen);
bodyToken = (Tcl_Token **)Tcl_Alloc(sizeof(Tcl_Token *) * maxLen);
bodyLines = (int *)Tcl_Alloc(sizeof(int) * maxLen);
bodyLines = (Tcl_Size *)Tcl_Alloc(sizeof(Tcl_Size) * maxLen);
bodyContLines = (Tcl_Size **)Tcl_Alloc(sizeof(Tcl_Size*) * maxLen);
bline = mapPtr->loc[eclIndex].line[valueIndex+1];
@@ -2023,7 +2020,7 @@ TclCompileSwitchCmd(
*/
bodyToken = (Tcl_Token **)Tcl_Alloc(sizeof(Tcl_Token *) * numWords);
bodyLines = (int *)Tcl_Alloc(sizeof(int) * numWords);
bodyLines = (Tcl_Size *)Tcl_Alloc(sizeof(Tcl_Size) * numWords);
bodyContLines = (Tcl_Size **)Tcl_Alloc(sizeof(Tcl_Size*) * numWords);
bodyTokenArray = NULL;
for (i=0 ; i<numWords ; i++) {
@@ -2118,7 +2115,7 @@ IssueSwitchChainedTests(
* switch can match against and bodies to
* execute when the match succeeds. */
Tcl_Token **bodyToken, /* Array of pointers to pattern list items. */
int *bodyLines, /* Array of line numbers for body list
Tcl_Size *bodyLines, /* Array of line numbers for body list
* items. */
Tcl_Size **bodyContLines) /* Array of continuation line info. */
{
@@ -2126,7 +2123,7 @@ IssueSwitchChainedTests(
int foundDefault; /* Flag to indicate whether a "default" clause
* is present. */
JumpFixup *fixupArray; /* Array of forward-jump fixup records. */
Tcl_Size *fixupTargetArray; /* Array of places for fixups to point at. */
unsigned int *fixupTargetArray; /* Array of places for fixups to point at. */
int fixupCount; /* Number of places to fix up. */
int contFixIndex; /* Where the first of the jumps due to a group
* of continuation bodies starts, or -1 if
@@ -2135,7 +2132,7 @@ IssueSwitchChainedTests(
* the current (or next) real body. */
int nextArmFixupIndex;
int simple, exact; /* For extracting the type of regexp. */
Tcl_Size i;
int i;
/*
* Generate a test for each arm.
@@ -2144,8 +2141,8 @@ IssueSwitchChainedTests(
contFixIndex = -1;
contFixCount = 0;
fixupArray = (JumpFixup *)TclStackAlloc(interp, sizeof(JumpFixup) * numBodyTokens);
fixupTargetArray = (Tcl_Size *)TclStackAlloc(interp, sizeof(Tcl_Size) * numBodyTokens);
memset(fixupTargetArray, 0, numBodyTokens * sizeof(Tcl_Size));
fixupTargetArray = (unsigned int *)TclStackAlloc(interp, sizeof(int) * numBodyTokens);
memset(fixupTargetArray, 0, numBodyTokens * sizeof(int));
fixupCount = 0;
foundDefault = 0;
for (i=0 ; i<numBodyTokens ; i+=2) {
@@ -2332,7 +2329,7 @@ IssueSwitchChainedTests(
for (i=fixupCount-1 ; i>=0 ; i--) {
if (TclFixupForwardJump(envPtr, &fixupArray[i],
fixupTargetArray[i] - fixupArray[i].codeOffset, 127)) {
Tcl_Size j;
int j;
for (j=i-1 ; j>=0 ; j--) {
if (fixupTargetArray[j] > fixupArray[i].codeOffset) {
@@ -2362,18 +2359,17 @@ static void
IssueSwitchJumpTable(
Tcl_Interp *interp, /* Context for compiling script bodies. */
CompileEnv *envPtr, /* Holds resulting instructions. */
Tcl_Size numBodyTokens, /* Number of tokens describing things the
int numBodyTokens, /* Number of tokens describing things the
* switch can match against and bodies to
* execute when the match succeeds. */
Tcl_Token **bodyToken, /* Array of pointers to pattern list items. */
int *bodyLines, /* Array of line numbers for body list
Tcl_Size *bodyLines, /* Array of line numbers for body list
* items. */
Tcl_Size **bodyContLines) /* Array of continuation line info. */
{
JumptableInfo *jtPtr;
Tcl_Size infoIndex, *finalFixups;
int isNew, mustGenerate, foundDefault;
Tcl_Size i, numRealBodies = 0, jumpLocation, jumpToDefault;
int infoIndex, isNew, *finalFixups, numRealBodies = 0, jumpLocation;
int mustGenerate, foundDefault, jumpToDefault, i;
Tcl_DString buffer;
Tcl_HashEntry *hPtr;
@@ -2390,7 +2386,7 @@ IssueSwitchJumpTable(
jtPtr = (JumptableInfo *)Tcl_Alloc(sizeof(JumptableInfo));
Tcl_InitHashTable(&jtPtr->hashTable, TCL_STRING_KEYS);
infoIndex = TclCreateAuxData(jtPtr, &tclJumptableInfoType, envPtr);
finalFixups = (Tcl_Size *)TclStackAlloc(interp, sizeof(Tcl_Size) * (numBodyTokens/2));
finalFixups = (int *)TclStackAlloc(interp, sizeof(int) * (numBodyTokens/2));
foundDefault = 0;
mustGenerate = 1;
@@ -2665,7 +2661,7 @@ TclCompileTailcallCmd(
{
DefineLineInformation; /* TIP #280 */
Tcl_Token *tokenPtr = parsePtr->tokenPtr;
Tcl_Size i;
int i;
if (parsePtr->numWords < 2 || parsePtr->numWords >= 256
|| envPtr->procPtr == NULL) {
@@ -2675,11 +2671,11 @@ TclCompileTailcallCmd(
/* make room for the nsObjPtr */
/* TODO: Doesn't this have to be a known value? */
CompileWord(envPtr, tokenPtr, interp, 0);
for (i=1 ; i<parsePtr->numWords ; i++) {
for (i=1 ; i<(int)parsePtr->numWords ; i++) {
tokenPtr = TokenAfter(tokenPtr);
CompileWord(envPtr, tokenPtr, interp, i);
}
TclEmitInstInt1( INST_TAILCALL, parsePtr->numWords, envPtr);
TclEmitInstInt1( INST_TAILCALL, (int)parsePtr->numWords, envPtr);
return TCL_OK;
}
@@ -2710,7 +2706,7 @@ TclCompileThrowCmd(
CompileEnv *envPtr) /* Holds resulting instructions. */
{
DefineLineInformation; /* TIP #280 */
Tcl_Size numWords = parsePtr->numWords;
int numWords = parsePtr->numWords;
Tcl_Token *codeToken, *msgToken;
Tcl_Obj *objPtr;
int codeKnown, codeIsList, codeIsValid;
@@ -2812,14 +2808,12 @@ TclCompileTryCmd(
TCL_UNUSED(Command *),
CompileEnv *envPtr) /* Holds resulting instructions. */
{
Tcl_Size numHandlers, numWords = parsePtr->numWords;
int result = TCL_ERROR;
int numWords = parsePtr->numWords, numHandlers, result = TCL_ERROR;
Tcl_Token *bodyToken, *finallyToken, *tokenPtr;
Tcl_Token **handlerTokens = NULL;
Tcl_Obj **matchClauses = NULL;
int *matchCodes=NULL;
Tcl_Size *resultVarIndices=NULL, *optionVarIndices=NULL;
Tcl_Size i;
int *matchCodes=NULL, *resultVarIndices=NULL, *optionVarIndices=NULL;
int i;
if (numWords < 2) {
return TCL_ERROR;
@@ -2851,8 +2845,8 @@ TclCompileTryCmd(
matchClauses = (Tcl_Obj **)TclStackAlloc(interp, sizeof(Tcl_Obj *) * numHandlers);
memset(matchClauses, 0, sizeof(Tcl_Obj *) * numHandlers);
matchCodes = (int *)TclStackAlloc(interp, sizeof(int) * numHandlers);
resultVarIndices = (Tcl_Size *)TclStackAlloc(interp, sizeof(Tcl_Size) * numHandlers);
optionVarIndices = (Tcl_Size *)TclStackAlloc(interp, sizeof(Tcl_Size) * numHandlers);
resultVarIndices = (int *)TclStackAlloc(interp, sizeof(int) * numHandlers);
optionVarIndices = (int *)TclStackAlloc(interp, sizeof(int) * numHandlers);
for (i=0 ; i<numHandlers ; i++) {
Tcl_Obj *tmpObj, **objv;
@@ -3045,19 +3039,19 @@ IssueTryClausesInstructions(
Tcl_Interp *interp,
CompileEnv *envPtr,
Tcl_Token *bodyToken,
Tcl_Size numHandlers,
int numHandlers,
int *matchCodes,
Tcl_Obj **matchClauses,
Tcl_Size *resultVars,
Tcl_Size *optionVars,
int *resultVars,
int *optionVars,
Tcl_Token **handlerTokens)
{
DefineLineInformation; /* TIP #280 */
Tcl_Size range, resultVar, optionsVar;
int forwardsNeedFixing = 0, trapZero = 0;
Tcl_Size i, j, slen, len, afterBody = 0;
Tcl_Size notCodeJumpSource, notECJumpSource;
Tcl_Size *addrsToFix, *noError, *forwardsToFix;
int range, resultVar, optionsVar;
int i, j, forwardsNeedFixing = 0, trapZero = 0, afterBody = 0;
Tcl_Size slen, len;
int *addrsToFix, *forwardsToFix, notCodeJumpSource, notECJumpSource;
int *noError;
char buf[TCL_INTEGER_SPACE];
resultVar = AnonymousLocal(envPtr);
@@ -3117,9 +3111,9 @@ IssueTryClausesInstructions(
* Slight overallocation, but reduces size of this function.
*/
addrsToFix = (Tcl_Size *)TclStackAlloc(interp, sizeof(Tcl_Size)*numHandlers);
forwardsToFix = (Tcl_Size *)TclStackAlloc(interp, sizeof(Tcl_Size)*numHandlers);
noError = (Tcl_Size *)TclStackAlloc(interp, sizeof(Tcl_Size)*numHandlers);
addrsToFix = (int *)TclStackAlloc(interp, sizeof(int)*numHandlers);
forwardsToFix = (int *)TclStackAlloc(interp, sizeof(int)*numHandlers);
noError = (int *)TclStackAlloc(interp, sizeof(int)*numHandlers);
for (i=0 ; i<numHandlers ; i++) {
noError[i] = -1;
@@ -3171,7 +3165,7 @@ IssueTryClausesInstructions(
JUMP4( JUMP, forwardsToFix[i]);
TclAdjustStackDepth(1, envPtr);
} else {
Tcl_Size dontChangeOptions;
int dontChangeOptions;
forwardsToFix[i] = -1;
if (forwardsNeedFixing) {
@@ -3256,20 +3250,18 @@ IssueTryClausesFinallyInstructions(
Tcl_Interp *interp,
CompileEnv *envPtr,
Tcl_Token *bodyToken,
Tcl_Size numHandlers,
int numHandlers,
int *matchCodes,
Tcl_Obj **matchClauses,
Tcl_Size *resultVars,
Tcl_Size *optionVars,
int *resultVars,
int *optionVars,
Tcl_Token **handlerTokens,
Tcl_Token *finallyToken) /* Not NULL */
{
DefineLineInformation; /* TIP #280 */
int forwardsNeedFixing = 0;
Tcl_Size range, resultVar, optionsVar, i, j;
int trapZero = 0;
Tcl_Size *addrsToFix, *forwardsToFix, afterBody = 0, finalOK;
Tcl_Size notCodeJumpSource, notECJumpSource, finalError, noFinalError;
int range, resultVar, optionsVar, i, j, forwardsNeedFixing = 0;
int trapZero = 0, afterBody = 0, finalOK, finalError, noFinalError;
int *addrsToFix, *forwardsToFix, notCodeJumpSource, notECJumpSource;
char buf[TCL_INTEGER_SPACE];
Tcl_Size slen, len;
@@ -3331,11 +3323,11 @@ IssueTryClausesFinallyInstructions(
* Slight overallocation, but reduces size of this function.
*/
addrsToFix = (Tcl_Size *)TclStackAlloc(interp, sizeof(Tcl_Size)*numHandlers);
forwardsToFix = (Tcl_Size *)TclStackAlloc(interp, sizeof(Tcl_Size)*numHandlers);
addrsToFix = (int *)TclStackAlloc(interp, sizeof(int)*numHandlers);
forwardsToFix = (int *)TclStackAlloc(interp, sizeof(int)*numHandlers);
for (i=0 ; i<numHandlers ; i++) {
Tcl_Size noTrapError, trapError;
int noTrapError, trapError;
const char *p;
snprintf(buf, sizeof(buf), "%d", matchCodes[i]);
@@ -3554,8 +3546,7 @@ IssueTryFinallyInstructions(
Tcl_Token *finallyToken)
{
DefineLineInformation; /* TIP #280 */
Tcl_Size range;
Tcl_Size jumpOK, jumpSplice;
int range, jumpOK, jumpSplice;
/*
* Note that this one is simple enough that we can issue it without
@@ -3633,8 +3624,7 @@ TclCompileUnsetCmd(
{
DefineLineInformation; /* TIP #280 */
Tcl_Token *varTokenPtr;
int isScalar, flags = 1;
Tcl_Size i, localIndex, haveFlags = 0, varCount = 0;
int isScalar, localIndex, flags = 1, i, varCount = 0, haveFlags = 0;
/* TODO: Consider support for compiling expanded args. */
@@ -3644,7 +3634,7 @@ TclCompileUnsetCmd(
* push/rotate. [Bug 3970f54c4e]
*/
for (i=1,varTokenPtr=parsePtr->tokenPtr ; i<parsePtr->numWords ; i++) {
for (i=1,varTokenPtr=parsePtr->tokenPtr ; i<(int)parsePtr->numWords ; i++) {
Tcl_Obj *leadingWord;
TclNewObj(leadingWord);
@@ -3708,7 +3698,7 @@ TclCompileUnsetCmd(
for (i=0; i<haveFlags;i++) {
varTokenPtr = TokenAfter(varTokenPtr);
}
for (i=1+haveFlags ; i<parsePtr->numWords ; i++) {
for (i=1+haveFlags ; i<(int)parsePtr->numWords ; i++) {
/*
* Decide if we can use a frame slot for the var/array name or if we
* need to emit code to compute and push the name at runtime. We use a
@@ -3773,8 +3763,7 @@ TclCompileWhileCmd(
DefineLineInformation; /* TIP #280 */
Tcl_Token *testTokenPtr, *bodyTokenPtr;
JumpFixup jumpEvalCondFixup;
int code, boolVal;
Tcl_Size bodyCodeOffset, testCodeOffset, range, jumpDist;
int testCodeOffset, bodyCodeOffset, jumpDist, range, code, boolVal;
int loopMayEnd = 1; /* This is set to 0 if it is recognized as an
* infinite loop. */
Tcl_Obj *boolObj;
@@ -3992,14 +3981,14 @@ TclCompileYieldToCmd(
{
DefineLineInformation; /* TIP #280 */
Tcl_Token *tokenPtr = TokenAfter(parsePtr->tokenPtr);
Tcl_Size i;
int i;
if ((int)parsePtr->numWords < 2) {
return TCL_ERROR;
}
OP( NS_CURRENT);
for (i = 1 ; i < parsePtr->numWords ; i++) {
for (i = 1 ; i < (int)parsePtr->numWords ; i++) {
CompileWord(envPtr, tokenPtr, interp, i);
tokenPtr = TokenAfter(tokenPtr);
}
@@ -4164,7 +4153,7 @@ CompileComparisonOpCmd(
Tcl_Token *tokenPtr;
/* TODO: Consider support for compiling expanded args. */
if (parsePtr->numWords < 3) {
if ((int)parsePtr->numWords < 3) {
PUSH("1");
} else if (parsePtr->numWords == 3) {
tokenPtr = TokenAfter(parsePtr->tokenPtr);
@@ -4179,7 +4168,7 @@ CompileComparisonOpCmd(
return TCL_ERROR;
} else {
Tcl_Size tmpIndex = AnonymousLocal(envPtr);
int tmpIndex = AnonymousLocal(envPtr);
Tcl_Size words;
tokenPtr = TokenAfter(parsePtr->tokenPtr);
+8 -8
View File
@@ -162,7 +162,7 @@ enum LexemeCodes {
* FUNCTION or a parse error according to
* context and value. */
INCOMPLETE = 4, /* A parse error. Used only when the single
* "=" is encountered. */
* "=" is encountered. */
INVALID = 5, /* A parse error. Used when any punctuation
* appears that's not a supported operator. */
COMMENT = 6, /* Comment. Lasts to end of line or end of
@@ -223,7 +223,7 @@ enum LexemeCodes {
* that this operator can only legally appear
* at the right places within a function call
* argument list are hard coded within
* ParseExpr(). */
* ParseExpr(). */
MULT = BINARY | 4,
DIVIDE = BINARY | 5,
MOD = BINARY | 6,
@@ -740,7 +740,7 @@ ParseExpr(
* Tricky case: see test expr-62.10
*/
Tcl_Size scanned2 = scanned;
int scanned2 = scanned;
do {
scanned2 += TclParseAllWhiteSpace(
start + scanned2, numBytes - scanned2);
@@ -842,7 +842,7 @@ ParseExpr(
Tcl_Token *tokenPtr;
const char *end = start;
Tcl_Size wordIndex;
int wordIndex;
int code = TCL_OK;
/*
@@ -1504,13 +1504,13 @@ ConvertTreeToTokens(
Tcl_Token *tokenPtr,
Tcl_Parse *parsePtr)
{
Tcl_Size subExprTokenIdx = 0;
int subExprTokenIdx = 0;
OpNode *nodePtr = nodes;
int next = nodePtr->right;
while (1) {
Tcl_Token *subExprTokenPtr;
Tcl_Size scanned, parentIdx;
int scanned, parentIdx;
unsigned char lexeme;
/*
@@ -1577,7 +1577,7 @@ ConvertTreeToTokens(
* do better.
*/
Tcl_Size toCopy = tokenPtr->numComponents + 1;
int toCopy = tokenPtr->numComponents + 1;
if (tokenPtr->numComponents == tokenPtr[1].numComponents + 1) {
/*
@@ -2386,7 +2386,7 @@ CompileExprTree(
break;
}
} else {
Tcl_Size pc1, pc2, target;
int pc1, pc2, target;
switch (nodePtr->lexeme) {
case START:
+71 -73
View File
@@ -708,8 +708,8 @@ static void StartExpanding(CompileEnv *envPtr);
*/
static void EnterCmdWordData(ExtCmdLoc *eclPtr, Tcl_Size srcOffset,
Tcl_Token *tokenPtr, const char *cmd,
Tcl_Size numWords, int line,
Tcl_Size *clNext, int **lines,
Tcl_Size numWords, Tcl_Size line,
Tcl_Size *clNext, Tcl_Size **lines,
CompileEnv *envPtr);
static void ReleaseCmdWordData(ExtCmdLoc *eclPtr);
@@ -779,7 +779,7 @@ TclSetByteCodeFromAny(
* compiled. Must not be NULL. */
Tcl_Obj *objPtr, /* The object to make a ByteCode object. */
CompileHookProc *hookProc, /* Procedure to invoke after compilation. */
void *clientData) /* Hook procedure private data. */
void *clientData) /* Hook procedure private data. */
{
Interp *iPtr = (Interp *) interp;
CompileEnv compEnv; /* Compilation environment structure allocated
@@ -1435,7 +1435,7 @@ TclInitCompileEnv(
const char *stringPtr, /* The source string to be compiled. */
size_t numBytes, /* Number of bytes in source string. */
const CmdFrame *invoker, /* Location context invoking the bcc */
Tcl_Size word) /* Index of the word in that context getting
int word) /* Index of the word in that context getting
* compiled */
{
Interp *iPtr = (Interp *) interp;
@@ -1722,7 +1722,7 @@ TclWordKnownAtCompileTime(
* to which we should append the known value
* of the word. */
{
Tcl_Size numComponents = tokenPtr->numComponents;
int numComponents = tokenPtr->numComponents;
Tcl_Obj *tempPtr = NULL;
if (tokenPtr->type == TCL_TOKEN_SIMPLE_WORD) {
@@ -1793,7 +1793,7 @@ TclWordKnownAtCompileTime(
static int
ExpandRequested(
Tcl_Token *tokenPtr,
Tcl_Size numWords)
size_t numWords)
{
/* Determine whether any words of the command require expansion */
while (numWords--) {
@@ -1840,7 +1840,7 @@ TclCompileInvocation(
{
DefineLineInformation;
size_t wordIdx = 0;
Tcl_Size depth = TclGetStackDepth(envPtr);
int depth = TclGetStackDepth(envPtr);
if (cmdObj) {
CompileCmdLiteral(interp, cmdObj, envPtr);
@@ -1880,12 +1880,12 @@ CompileExpanded(
Tcl_Interp *interp,
Tcl_Token *tokenPtr,
Tcl_Obj *cmdObj,
Tcl_Size numWords,
int numWords,
CompileEnv *envPtr)
{
DefineLineInformation;
Tcl_Size wordIdx = 0;
Tcl_Size depth = TclGetStackDepth(envPtr);
int wordIdx = 0;
int depth = TclGetStackDepth(envPtr);
StartExpanding(envPtr);
if (cmdObj) {
@@ -1945,7 +1945,7 @@ CompileCmdCompileProc(
DefineLineInformation;
int unwind = 0;
Tcl_Size incrOffset = -1;
Tcl_Size depth = TclGetStackDepth(envPtr);
int depth = TclGetStackDepth(envPtr);
/*
* Emission of the INST_START_CMD instruction is controlled by the value of
@@ -2018,7 +2018,7 @@ CompileCmdCompileProc(
return TCL_ERROR;
}
static Tcl_Size
static int
CompileCommandTokens(
Tcl_Interp *interp,
Tcl_Parse *parsePtr,
@@ -2031,15 +2031,14 @@ CompileCommandTokens(
Command *cmdPtr = NULL;
int code = TCL_ERROR;
int cmdKnown, expand = -1;
int *wlines;
Tcl_Size wlineat;
Tcl_Size *wlines, wlineat;
Tcl_Size cmdLine = envPtr->line;
Tcl_Size *clNext = envPtr->clNext;
Tcl_Size cmdIdx = envPtr->numCommands;
Tcl_Size startCodeOffset = envPtr->codeNext - envPtr->codeStart;
Tcl_Size depth = TclGetStackDepth(envPtr);
int depth = TclGetStackDepth(envPtr);
assert (parsePtr->numWords > 0);
assert ((int)parsePtr->numWords > 0);
/* Precompile */
@@ -2084,7 +2083,7 @@ CompileCommandTokens(
}
}
if (cmdPtr && !(cmdPtr->flags & CMD_COMPILES_EXPANDED)) {
expand = ExpandRequested(parsePtr->tokenPtr, parsePtr->numWords);
expand = ExpandRequested(parsePtr->tokenPtr, (int)parsePtr->numWords);
if (expand) {
/* We need to expand, but compileProc cannot. */
cmdPtr = NULL;
@@ -2099,15 +2098,15 @@ CompileCommandTokens(
if (code == TCL_ERROR) {
if (expand < 0) {
expand = ExpandRequested(parsePtr->tokenPtr, parsePtr->numWords);
expand = ExpandRequested(parsePtr->tokenPtr, (int)parsePtr->numWords);
}
if (expand) {
CompileExpanded(interp, parsePtr->tokenPtr,
cmdKnown ? cmdObj : NULL, parsePtr->numWords, envPtr);
cmdKnown ? cmdObj : NULL, (int)parsePtr->numWords, envPtr);
} else {
TclCompileInvocation(interp, parsePtr->tokenPtr,
cmdKnown ? cmdObj : NULL, parsePtr->numWords, envPtr);
cmdKnown ? cmdObj : NULL, (int)parsePtr->numWords, envPtr);
}
}
@@ -2145,12 +2144,12 @@ TclCompileScript(
* first null character. */
CompileEnv *envPtr) /* Holds resulting instructions. */
{
Tcl_Size lastCmdIdx = -1; /* Index into envPtr->cmdMapPtr of the last
int lastCmdIdx = -1; /* Index into envPtr->cmdMapPtr of the last
* command this routine compiles into bytecode.
* Initial value of -1 indicates this routine
* has not yet generated any bytecode. */
const char *p = script; /* Where we are in our compile. */
Tcl_Size depth = TclGetStackDepth(envPtr);
int depth = TclGetStackDepth(envPtr);
Interp *iPtr = (Interp *) interp;
if (envPtr->iPtr == NULL) {
@@ -2259,7 +2258,7 @@ TclCompileScript(
* Tcl_FreeParse() to do.
*
* The advantage of this shortcut is that CompileCommandTokens()
* can be written with an assumption that parsePtr->numWords > 0, with
* can be written with an assumption that (int)parsePtr->numWords > 0, with
* the implication the CCT() always generates bytecode.
*/
continue;
@@ -2421,13 +2420,13 @@ TclCompileTokens(
* TCL_TOKEN_TEXT, TCL_TOKEN_BS tokens. */
char buffer[4] = "";
Tcl_Size i, numObjsToConcat, adjust;
Tcl_Size length;
int length;
unsigned char *entryCodeNext = envPtr->codeNext;
#define NUM_STATIC_POS 20
int isLiteral;
Tcl_Size maxNumCL, numCL;
Tcl_Size *clPosition = NULL;
Tcl_Size depth = TclGetStackDepth(envPtr);
int depth = TclGetStackDepth(envPtr);
/*
* If this is actually a literal, handle continuation lines by
@@ -2491,7 +2490,7 @@ TclCompileTokens(
if ((length == 1) && (buffer[0] == ' ') &&
(tokenPtr->start[1] == '\n')) {
if (isLiteral) {
Tcl_Size clPos = Tcl_DStringLength(&textBuffer);
int clPos = Tcl_DStringLength(&textBuffer);
if (numCL >= maxNumCL) {
maxNumCL *= 2;
@@ -2680,13 +2679,14 @@ TclCompileExprWords(
Tcl_Interp *interp, /* Used for error and status reporting. */
Tcl_Token *tokenPtr, /* Points to first in an array of word tokens
* for the expression to compile inline. */
size_t numWords, /* Number of word tokens starting at tokenPtr.
size_t numWords1, /* Number of word tokens starting at tokenPtr.
* Must be at least 1. Each word token
* contains one or more subtokens. */
CompileEnv *envPtr) /* Holds the resulting instructions. */
{
Tcl_Token *wordPtr;
size_t i, concatItems;
int i, concatItems;
int numWords = numWords1;
/*
* If the expression is a single word that doesn't require substitutions,
@@ -2706,7 +2706,7 @@ TclCompileExprWords(
wordPtr = tokenPtr;
for (i = 0; i < numWords; i++) {
CompileTokens(envPtr, wordPtr, interp);
if (i + 1 < numWords) {
if (i < (numWords - 1)) {
PushStringLiteral(envPtr, " ");
}
wordPtr += wordPtr->numComponents + 1;
@@ -2823,7 +2823,7 @@ PreventCycle(
ByteCode *
TclInitByteCode(
CompileEnv *envPtr) /* Points to the CompileEnv structure from
CompileEnv *envPtr)/* Points to the CompileEnv structure from
* which to create a ByteCode structure. */
{
ByteCode *codePtr;
@@ -2968,7 +2968,7 @@ TclInitByteCodeObj(
* and whose string rep contains the source
* code. */
const Tcl_ObjType *typePtr,
CompileEnv *envPtr) /* Points to the CompileEnv structure from
CompileEnv *envPtr)/* Points to the CompileEnv structure from
* which to create a ByteCode structure. */
{
ByteCode *codePtr;
@@ -3013,7 +3013,7 @@ TclInitByteCodeObj(
Tcl_Size
TclFindCompiledLocal(
const char *name, /* Points to first character of the name of a
const char *name, /* Points to first character of the name of a
* scalar or array variable. If NULL, a
* temporary var should be created. */
Tcl_Size nameBytes, /* Number of bytes in the name. */
@@ -3192,7 +3192,7 @@ EnterCmdStartData(
Tcl_Size cmdIndex, /* Index of the command whose start data is
* being set. */
Tcl_Size srcOffset, /* Offset of first char of the command. */
Tcl_Size codeOffset) /* Offset of first byte of command code. */
Tcl_Size codeOffset) /* Offset of first byte of command code. */
{
CmdLocation *cmdLocPtr;
@@ -3270,8 +3270,8 @@ EnterCmdExtentData(
* location information. */
Tcl_Size cmdIndex, /* Index of the command whose source and code
* length data is being set. */
Tcl_Size numSrcBytes, /* Number of command source chars. */
Tcl_Size numCodeBytes) /* Offset of last byte of command code. */
Tcl_Size numSrcBytes, /* Number of command source chars. */
Tcl_Size numCodeBytes) /* Offset of last byte of command code. */
{
CmdLocation *cmdLocPtr;
@@ -3318,17 +3318,15 @@ EnterCmdWordData(
Tcl_Token *tokenPtr,
const char *cmd,
Tcl_Size numWords,
int line,
Tcl_Size line,
Tcl_Size *clNext,
int **wlines,
Tcl_Size **wlines,
CompileEnv *envPtr)
{
ECL *ePtr;
const char *last;
Tcl_Size wordIdx;
int wordLine;
int *wwlines;
Tcl_Size *wordNext;
Tcl_Size wordIdx, wordLine;
Tcl_Size *wwlines, *wordNext;
if (eclPtr->nuloc >= eclPtr->nloc) {
/*
@@ -3347,10 +3345,10 @@ EnterCmdWordData(
ePtr = &eclPtr->loc[eclPtr->nuloc];
ePtr->srcOffset = srcOffset;
ePtr->line = (int *)Tcl_Alloc(numWords * sizeof(int));
ePtr->line = (Tcl_Size *)Tcl_Alloc(numWords * sizeof(Tcl_Size));
ePtr->next = (Tcl_Size **)Tcl_Alloc(numWords * sizeof(Tcl_Size *));
ePtr->nline = numWords;
wwlines = (int *)Tcl_Alloc(numWords * sizeof(int));
wwlines = (Tcl_Size *)Tcl_Alloc(numWords * sizeof(Tcl_Size));
last = cmd;
wordLine = line;
@@ -3489,9 +3487,9 @@ TclGetInnermostExceptionRange(
while (i > 0) {
rangePtr--; i--;
if (CurrentOffset(envPtr) >= rangePtr->codeOffset &&
if (CurrentOffset(envPtr) >= (int)rangePtr->codeOffset &&
(rangePtr->numCodeBytes == TCL_INDEX_NONE || CurrentOffset(envPtr) <
rangePtr->codeOffset+rangePtr->numCodeBytes) &&
(int)rangePtr->codeOffset+(int)rangePtr->numCodeBytes) &&
(returnCode != TCL_CONTINUE ||
envPtr->exceptAuxArrayPtr[i].supportsContinue)) {
@@ -3522,7 +3520,7 @@ TclAddLoopBreakFixup(
CompileEnv *envPtr,
ExceptionAux *auxPtr)
{
Tcl_Size range = auxPtr - envPtr->exceptAuxArrayPtr;
int range = auxPtr - envPtr->exceptAuxArrayPtr;
if (envPtr->exceptArrayPtr[range].type != LOOP_EXCEPTION_RANGE) {
Tcl_Panic("trying to add 'break' fixup to full exception range");
@@ -3548,7 +3546,7 @@ TclAddLoopContinueFixup(
CompileEnv *envPtr,
ExceptionAux *auxPtr)
{
Tcl_Size range = auxPtr - envPtr->exceptAuxArrayPtr;
int range = auxPtr - envPtr->exceptAuxArrayPtr;
if (envPtr->exceptArrayPtr[range].type != LOOP_EXCEPTION_RANGE) {
Tcl_Panic("trying to add 'continue' fixup to full exception range");
@@ -3588,13 +3586,13 @@ TclCleanupStackForBreakContinue(
ExceptionAux *auxPtr)
{
size_t savedStackDepth = envPtr->currStackDepth;
Tcl_Size toPop = envPtr->expandCount - auxPtr->expandTarget;
int toPop = envPtr->expandCount - auxPtr->expandTarget;
if (toPop > 0) {
while (toPop --> 0) {
TclEmitOpcode(INST_EXPAND_DROP, envPtr);
}
TclAdjustStackDepth((auxPtr->expandTargetDepth - envPtr->currStackDepth),
TclAdjustStackDepth((int)(auxPtr->expandTargetDepth - envPtr->currStackDepth),
envPtr);
envPtr->currStackDepth = auxPtr->expandTargetDepth;
}
@@ -3621,7 +3619,7 @@ static void
StartExpanding(
CompileEnv *envPtr)
{
Tcl_Size i;
int i;
TclEmitOpcode(INST_EXPAND_START, envPtr);
@@ -3630,7 +3628,7 @@ StartExpanding(
* where this expansion started.
*/
for (i=0 ; i<envPtr->exceptArrayNext ; i++) {
for (i=0 ; i<(int)envPtr->exceptArrayNext ; i++) {
ExceptionRange *rangePtr = &envPtr->exceptArrayPtr[i];
ExceptionAux *auxPtr = &envPtr->exceptAuxArrayPtr[i];
@@ -3638,7 +3636,7 @@ StartExpanding(
* Ignore loops unless they're still being built.
*/
if (rangePtr->codeOffset > CurrentOffset(envPtr)) {
if ((int)rangePtr->codeOffset > CurrentOffset(envPtr)) {
continue;
}
if (rangePtr->numCodeBytes != TCL_INDEX_NONE) {
@@ -3678,11 +3676,11 @@ StartExpanding(
void
TclFinalizeLoopExceptionRange(
CompileEnv *envPtr,
Tcl_Size range)
int range)
{
ExceptionRange *rangePtr = &envPtr->exceptArrayPtr[range];
ExceptionAux *auxPtr = &envPtr->exceptAuxArrayPtr[range];
Tcl_Size i, offset;
int i, offset;
unsigned char *site;
if (rangePtr->type != LOOP_EXCEPTION_RANGE) {
@@ -3694,7 +3692,7 @@ TclFinalizeLoopExceptionRange(
* there is no need to fuss around with updating code offsets.
*/
for (i=0 ; i<auxPtr->numBreakTargets ; i++) {
for (i=0 ; i<(int)auxPtr->numBreakTargets ; i++) {
site = envPtr->codeStart + auxPtr->breakTargets[i];
offset = rangePtr->breakOffset - auxPtr->breakTargets[i];
TclUpdateInstInt4AtPc(INST_JUMP4, offset, site);
@@ -3756,11 +3754,11 @@ TclFinalizeLoopExceptionRange(
Tcl_Size
TclCreateAuxData(
void *clientData, /* The compilation auxiliary data to store in
void *clientData, /* The compilation auxiliary data to store in
* the new aux data record. */
const AuxDataType *typePtr, /* Pointer to the type to attach to this
* AuxData */
CompileEnv *envPtr) /* Points to the CompileEnv for which a new
CompileEnv *envPtr)/* Points to the CompileEnv for which a new
* aux data structure is to be allocated. */
{
Tcl_Size index; /* Index for the new AuxData structure. */
@@ -3954,9 +3952,9 @@ TclEmitForwardJump(
*/
jumpFixupPtr->jumpType = jumpType;
jumpFixupPtr->codeOffset = (unsigned int)(envPtr->codeNext - envPtr->codeStart);
jumpFixupPtr->cmdIndex = (int)envPtr->numCommands;
jumpFixupPtr->exceptIndex = (int)envPtr->exceptArrayNext;
jumpFixupPtr->codeOffset = envPtr->codeNext - envPtr->codeStart;
jumpFixupPtr->cmdIndex = envPtr->numCommands;
jumpFixupPtr->exceptIndex = envPtr->exceptArrayNext;
switch (jumpType) {
case TCL_UNCONDITIONAL_JUMP:
@@ -4004,12 +4002,12 @@ TclFixupForwardJump(
* holds the resulting instruction. */
JumpFixup *jumpFixupPtr, /* Points to the JumpFixup structure that
* describes the forward jump. */
Tcl_Size jumpDist, /* Jump distance to set in jump instr. */
Tcl_Size distThreshold) /* Maximum distance before the two byte jump
int jumpDist, /* Jump distance to set in jump instr. */
int distThreshold) /* Maximum distance before the two byte jump
* is grown to five bytes. */
{
unsigned char *jumpPc, *p;
Tcl_Size firstCmd, lastCmd, firstRange, lastRange, k;
int firstCmd, lastCmd, firstRange, lastRange, k;
size_t numBytes;
if (jumpDist <= distThreshold) {
@@ -4094,14 +4092,14 @@ TclFixupForwardJump(
for (k = 0 ; k < (int)envPtr->exceptArrayNext ; k++) {
ExceptionAux *auxPtr = &envPtr->exceptAuxArrayPtr[k];
Tcl_Size i;
int i;
for (i=0 ; i<auxPtr->numBreakTargets ; i++) {
for (i=0 ; i<(int)auxPtr->numBreakTargets ; i++) {
if (jumpFixupPtr->codeOffset < auxPtr->breakTargets[i]) {
auxPtr->breakTargets[i] += 3;
}
}
for (i=0 ; i<auxPtr->numContinueTargets ; i++) {
for (i=0 ; i<(int)auxPtr->numContinueTargets ; i++) {
if (jumpFixupPtr->codeOffset < auxPtr->continueTargets[i]) {
auxPtr->continueTargets[i] += 3;
}
@@ -4141,9 +4139,9 @@ TclEmitInvoke(
va_list argList;
ExceptionRange *rangePtr;
ExceptionAux *auxBreakPtr, *auxContinuePtr;
Tcl_Size arg1, arg2, wordCount = 0, expandCount = 0;
Tcl_Size loopRange = 0, breakRange = 0, continueRange = 0;
Tcl_Size cleanup, depth = TclGetStackDepth(envPtr);
int arg1, arg2, wordCount = 0, expandCount = 0;
int loopRange = 0, breakRange = 0, continueRange = 0;
int cleanup, depth = TclGetStackDepth(envPtr);
/*
* Parse the arguments.
@@ -4352,13 +4350,13 @@ GetCmdLocEncodingSize(
* encode. */
{
CmdLocation *mapPtr = envPtr->cmdMapPtr;
Tcl_Size numCmds = envPtr->numCommands;
Tcl_Size codeDelta, codeLen, srcDelta, srcLen;
int numCmds = envPtr->numCommands;
int codeDelta, codeLen, srcDelta, srcLen;
int codeDeltaNext, codeLengthNext, srcDeltaNext, srcLengthNext;
/* The offsets in their respective byte
* sequences where the next encoded offset or
* length should go. */
Tcl_Size prevCodeOffset, prevSrcOffset, i;
int prevCodeOffset, prevSrcOffset, i;
codeDeltaNext = codeLengthNext = srcDeltaNext = srcLengthNext = 0;
prevCodeOffset = prevSrcOffset = 0;
@@ -4439,7 +4437,7 @@ EncodeCmdLocMap(
Tcl_Size i, codeDelta, codeLen, srcLen, prevOffset;
Tcl_Size numCmds = envPtr->numCommands;
unsigned char *p = startPtr;
Tcl_Size srcDelta;
int srcDelta;
/*
* Encode the code offset for each command as a sequence of deltas.
+36 -27
View File
@@ -135,7 +135,7 @@ typedef struct ExceptionAux {
Tcl_Size numBreakTargets; /* The number of [break]s that want to be
* targeted to the place where this loop
* exception will be bound to. */
size_t *breakTargets;/* The offsets of the INST_JUMP4 instructions
TCL_HASH_TYPE *breakTargets;/* The offsets of the INST_JUMP4 instructions
* issued by the [break]s that we must
* update. Note that resizing a jump (via
* TclFixupForwardJump) can cause the contents
@@ -145,7 +145,7 @@ typedef struct ExceptionAux {
Tcl_Size numContinueTargets;/* The number of [continue]s that want to be
* targeted to the place where this loop
* exception will be bound to. */
size_t *continueTargets;
TCL_HASH_TYPE *continueTargets;
/* The offsets of the INST_JUMP4 instructions
* issued by the [continue]s that we must
* update. Note that resizing a jump (via
@@ -185,7 +185,7 @@ typedef struct {
typedef struct {
Tcl_Size srcOffset; /* Command location to find the entry. */
Tcl_Size nline; /* Number of words in the command */
int *line; /* Line information for all words in the
Tcl_Size *line; /* Line information for all words in the
* command. */
Tcl_Size **next; /* Transient information used by the compiler
* for tracking of hidden continuation
@@ -223,7 +223,7 @@ typedef void * (AuxDataDupProc) (void *clientData);
typedef void (AuxDataFreeProc) (void *clientData);
typedef void (AuxDataPrintProc) (void *clientData,
Tcl_Obj *appendObj, struct ByteCode *codePtr,
size_t pcOffset);
TCL_HASH_TYPE pcOffset);
/*
* We define a separate AuxDataType struct to hold type-related information
@@ -320,8 +320,10 @@ typedef struct CompileEnv {
* array byte. */
int mallocedCodeArray; /* Set 1 if code array was expanded and
* codeStart points into the heap.*/
#if TCL_MAJOR_VERSION > 8
int mallocedExceptArray; /* 1 if ExceptionRange array was expanded and
* exceptArrayPtr points in heap, else 0. */
#endif
LiteralEntry *literalArrayPtr;
/* Points to start of LiteralEntry array. */
Tcl_Size literalArrayNext; /* Index of next free object array entry. */
@@ -337,6 +339,9 @@ typedef struct CompileEnv {
* current range's array entry. */
Tcl_Size exceptArrayEnd; /* Index after the last ExceptionRange array
* entry. */
#if TCL_MAJOR_VERSION < 9
int mallocedExceptArray;
#endif
ExceptionAux *exceptAuxArrayPtr;
/* Array of information used to restore the
* state when processing BREAK/CONTINUE
@@ -349,14 +354,19 @@ typedef struct CompileEnv {
Tcl_Size cmdMapEnd; /* Index after last CmdLocation entry. */
int mallocedCmdMap; /* 1 if command map array was expanded and
* cmdMapPtr points in the heap, else 0. */
#if TCL_MAJOR_VERSION > 8
int mallocedAuxDataArray; /* 1 if aux data array was expanded and
* auxDataArrayPtr points in heap else 0. */
#endif
AuxData *auxDataArrayPtr; /* Points to auxiliary data array start. */
Tcl_Size auxDataArrayNext; /* Next free compile aux data array index.
* auxDataArrayNext is the number of aux data
* items and (auxDataArrayNext-1) is index of
* current aux data array entry. */
Tcl_Size auxDataArrayEnd; /* Index after last aux data array entry. */
#if TCL_MAJOR_VERSION < 9
int mallocedAuxDataArray;
#endif
unsigned char staticCodeSpace[COMPILEENV_INIT_CODE_BYTES];
/* Initial storage for code. */
LiteralEntry staticLiteralSpace[COMPILEENV_INIT_NUM_OBJECTS];
@@ -373,7 +383,7 @@ typedef struct CompileEnv {
/* TIP #280 */
ExtCmdLoc *extCmdMapPtr; /* Extended command location information for
* 'info frame'. */
int line; /* First line of the script, based on the
Tcl_Size line; /* First line of the script, based on the
* invoking context, then the line of the
* command currently compiled. */
int atCmdStart; /* Flag to say whether an INST_START_CMD
@@ -1062,6 +1072,7 @@ typedef struct {
*----------------------------------------------------------------
*/
#if TCL_MAJOR_VERSION > 8
MODULE_SCOPE Tcl_ObjCmdProc TclNRInterpCoroutine;
/*
@@ -1071,7 +1082,7 @@ MODULE_SCOPE Tcl_ObjCmdProc TclNRInterpCoroutine;
*/
MODULE_SCOPE ByteCode * TclCompileObj(Tcl_Interp *interp, Tcl_Obj *objPtr,
const CmdFrame *invoker, Tcl_Size word);
const CmdFrame *invoker, int word);
/*
*----------------------------------------------------------------
@@ -1130,8 +1141,8 @@ MODULE_SCOPE Tcl_Obj * TclFetchLiteral(CompileEnv *envPtr, Tcl_Size index);
MODULE_SCOPE Tcl_Size TclFindCompiledLocal(const char *name, Tcl_Size nameChars,
int create, CompileEnv *envPtr);
MODULE_SCOPE int TclFixupForwardJump(CompileEnv *envPtr,
JumpFixup *jumpFixupPtr, Tcl_Size jumpDist,
Tcl_Size distThreshold);
JumpFixup *jumpFixupPtr, int jumpDist,
int distThreshold);
MODULE_SCOPE void TclFreeCompileEnv(CompileEnv *envPtr);
MODULE_SCOPE void TclFreeJumpFixupArray(JumpFixupArray *fixupArrayPtr);
MODULE_SCOPE int TclGetIndexFromToken(Tcl_Token *tokenPtr,
@@ -1141,7 +1152,7 @@ MODULE_SCOPE ByteCode * TclInitByteCodeObj(Tcl_Obj *objPtr,
const Tcl_ObjType *typePtr, CompileEnv *envPtr);
MODULE_SCOPE void TclInitCompileEnv(Tcl_Interp *interp,
CompileEnv *envPtr, const char *string,
size_t numBytes, const CmdFrame *invoker, Tcl_Size word);
size_t numBytes, const CmdFrame *invoker, int word);
MODULE_SCOPE void TclInitJumpFixupArray(JumpFixupArray *fixupArrayPtr);
MODULE_SCOPE void TclInitLiteralTable(LiteralTable *tablePtr);
MODULE_SCOPE ExceptionRange *TclGetInnermostExceptionRange(CompileEnv *envPtr,
@@ -1151,14 +1162,14 @@ MODULE_SCOPE void TclAddLoopBreakFixup(CompileEnv *envPtr,
MODULE_SCOPE void TclAddLoopContinueFixup(CompileEnv *envPtr,
ExceptionAux *auxPtr);
MODULE_SCOPE void TclFinalizeLoopExceptionRange(CompileEnv *envPtr,
Tcl_Size range);
int range);
#ifdef TCL_COMPILE_STATS
MODULE_SCOPE char * TclLiteralStats(LiteralTable *tablePtr);
MODULE_SCOPE int TclLog2(long long value);
#endif
MODULE_SCOPE Tcl_Size TclLocalScalar(const char *bytes, size_t numBytes,
MODULE_SCOPE size_t TclLocalScalar(const char *bytes, size_t numBytes,
CompileEnv *envPtr);
MODULE_SCOPE Tcl_Size TclLocalScalarFromToken(Tcl_Token *tokenPtr,
MODULE_SCOPE size_t TclLocalScalarFromToken(Tcl_Token *tokenPtr,
CompileEnv *envPtr);
MODULE_SCOPE void TclOptimizeBytecode(void *envPtr);
#ifdef TCL_COMPILE_DEBUG
@@ -1174,7 +1185,7 @@ MODULE_SCOPE void TclPrintSource(FILE *outFile,
const char *string, Tcl_Size maxChars);
MODULE_SCOPE void TclPushVarName(Tcl_Interp *interp,
Tcl_Token *varTokenPtr, CompileEnv *envPtr,
int flags, Tcl_Size *localIndexPtr,
int flags, int *localIndexPtr,
int *isScalarPtr);
MODULE_SCOPE void TclPreserveByteCode(ByteCode *codePtr);
MODULE_SCOPE void TclReleaseByteCode(ByteCode *codePtr);
@@ -1201,6 +1212,7 @@ MODULE_SCOPE Tcl_Obj * TclNewInstNameObj(unsigned char inst);
MODULE_SCOPE int TclPushProcCallFrame(void *clientData,
Tcl_Interp *interp, Tcl_Size objc,
Tcl_Obj *const objv[], int isLambda);
#endif /* TCL_MAJOR_VERSION > 8 */
/*
*----------------------------------------------------------------
@@ -1212,7 +1224,7 @@ MODULE_SCOPE int TclPushProcCallFrame(void *clientData,
/*
* Simplified form to access AuxData.
*
* void *TclFetchAuxData(CompileEng *envPtr, Tcl_Size index);
* void *TclFetchAuxData(CompileEng *envPtr, int index);
*/
#define TclFetchAuxData(envPtr, index) \
@@ -1229,11 +1241,11 @@ MODULE_SCOPE int TclPushProcCallFrame(void *clientData,
*/
static inline void
TclAdjustStackDepth(
Tcl_Size delta,
int delta,
CompileEnv *envPtr)
{
if (delta < 0) {
if (envPtr->maxStackDepth < envPtr->currStackDepth) {
if ((int) envPtr->maxStackDepth < (int) envPtr->currStackDepth) {
envPtr->maxStackDepth = envPtr->currStackDepth;
}
}
@@ -1272,16 +1284,13 @@ TclCheckStackDepth(
static inline void
TclUpdateStackReqs(
unsigned char op,
Tcl_Size i,
int i,
CompileEnv *envPtr)
{
int delta = tclInstructionTable[op].stackEffect;
if (delta) {
if (delta == INT_MIN) {
if (i > INT_MAX || i < INT_MIN+2) {
Tcl_Panic("%s: stack effect too big", "TclUpdateStackReqs");
}
delta = 1 - (int)i;
delta = 1 - i;
}
TclAdjustStackDepth(delta, envPtr);
}
@@ -1312,8 +1321,8 @@ TclUpdateStackReqs(
TclExpandCodeArray(envPtr); \
} \
*(envPtr)->codeNext++ = (unsigned char) (op); \
TclUpdateAtCmdStart((unsigned char)op, envPtr); \
TclUpdateStackReqs((unsigned char)op, 0, envPtr); \
TclUpdateAtCmdStart(op, envPtr); \
TclUpdateStackReqs(op, 0, envPtr); \
} while (0)
/*
@@ -1452,12 +1461,12 @@ TclUpdateStackReqs(
* "prototypes" for this macro is:
*
* int TclFixupForwardJumpToHere(CompileEnv *envPtr, JumpFixup *fixupPtr,
* Tcl_Size threshold);
* int threshold);
*/
#define TclFixupForwardJumpToHere(envPtr, fixupPtr, threshold) \
TclFixupForwardJump((envPtr), (fixupPtr), \
(envPtr)->codeNext-(envPtr)->codeStart-(fixupPtr)->codeOffset, \
(envPtr)->codeNext-(envPtr)->codeStart-(int)(fixupPtr)->codeOffset, \
(threshold))
/*
@@ -1518,7 +1527,7 @@ TclUpdateStackReqs(
* Convenience macros for use when compiling bodies of commands. The ANSI C
* "prototype" for these macros are:
*
* static void BODY(Tcl_Token *tokenPtr, Tcl_Size word);
* static void BODY(Tcl_Token *tokenPtr, int word);
*/
#define BODY(tokenPtr, word) \
@@ -1618,7 +1627,7 @@ TclUpdateStackReqs(
* the simplest of compiles. The ANSI C "prototype" for this macro is:
*
* static void CompileWord(CompileEnv *envPtr, Tcl_Token *tokenPtr,
* Tcl_Interp *interp, Tcl_Size word);
* Tcl_Interp *interp, int word);
*/
#define CompileWord(envPtr, tokenPtr, interp, word) \
+1 -1
View File
@@ -391,7 +391,7 @@ GetConfigDict(
static void
ConfigDictDeleteProc(
void *clientData, /* Pointer to Tcl_Obj. */
void *clientData, /* Pointer to Tcl_Obj. */
TCL_UNUSED(Tcl_Interp *))
{
Tcl_DecrRefCount((Tcl_Obj *)clientData);
+145 -62
View File
@@ -61,18 +61,18 @@ EXTERN const char * Tcl_PkgRequireEx(Tcl_Interp *interp,
/* 2 */
EXTERN TCL_NORETURN void Tcl_Panic(const char *format, ...) TCL_FORMAT_PRINTF(1, 2);
/* 3 */
EXTERN void * Tcl_Alloc(size_t size);
EXTERN void * Tcl_Alloc(TCL_HASH_TYPE size);
/* 4 */
EXTERN void Tcl_Free(void *ptr);
/* 5 */
EXTERN void * Tcl_Realloc(void *ptr, size_t size);
EXTERN void * Tcl_Realloc(void *ptr, TCL_HASH_TYPE size);
/* 6 */
EXTERN void * Tcl_DbCkalloc(size_t size, const char *file,
EXTERN void * Tcl_DbCkalloc(TCL_HASH_TYPE size, const char *file,
int line);
/* 7 */
EXTERN void Tcl_DbCkfree(void *ptr, const char *file, int line);
/* 8 */
EXTERN void * Tcl_DbCkrealloc(void *ptr, size_t size,
EXTERN void * Tcl_DbCkrealloc(void *ptr, TCL_HASH_TYPE size,
const char *file, int line);
/* 9 */
EXTERN void Tcl_CreateFileHandler(int fd, int mask,
@@ -128,9 +128,15 @@ EXTERN Tcl_Obj * Tcl_DbNewStringObj(const char *bytes,
EXTERN Tcl_Obj * Tcl_DuplicateObj(Tcl_Obj *objPtr);
/* 30 */
EXTERN void TclFreeObj(Tcl_Obj *objPtr);
/* Slot 31 is reserved */
/* Slot 32 is reserved */
/* Slot 33 is reserved */
/* 31 */
EXTERN int Tcl_GetBoolean(Tcl_Interp *interp, const char *src,
int *intPtr);
/* 32 */
EXTERN int Tcl_GetBooleanFromObj(Tcl_Interp *interp,
Tcl_Obj *objPtr, int *intPtr);
/* 33 */
EXTERN unsigned char * Tcl_GetByteArrayFromObj(Tcl_Obj *objPtr,
Tcl_Size *numBytesPtr);
/* 34 */
EXTERN int Tcl_GetDouble(Tcl_Interp *interp, const char *src,
double *doublePtr);
@@ -241,7 +247,8 @@ EXTERN void Tcl_CallWhenDeleted(Tcl_Interp *interp,
/* 80 */
EXTERN void Tcl_CancelIdleCall(Tcl_IdleProc *idleProc,
void *clientData);
/* Slot 81 is reserved */
/* 81 */
EXTERN int Tcl_Close(Tcl_Interp *interp, Tcl_Channel chan);
/* 82 */
EXTERN int Tcl_CommandComplete(const char *cmd);
/* 83 */
@@ -1029,7 +1036,7 @@ EXTERN void Tcl_MutexFinalize(Tcl_Mutex *mutex);
/* 393 */
EXTERN int Tcl_CreateThread(Tcl_ThreadId *idPtr,
Tcl_ThreadCreateProc *proc, void *clientData,
size_t stackSize, int flags);
TCL_HASH_TYPE stackSize, int flags);
/* 394 */
EXTERN Tcl_Size Tcl_ReadRaw(Tcl_Channel chan, char *dst,
Tcl_Size bytesToRead);
@@ -1115,14 +1122,14 @@ EXTERN void Tcl_UntraceCommand(Tcl_Interp *interp,
const char *varName, int flags,
Tcl_CommandTraceProc *proc, void *clientData);
/* 428 */
EXTERN void * Tcl_AttemptAlloc(size_t size);
EXTERN void * Tcl_AttemptAlloc(TCL_HASH_TYPE size);
/* 429 */
EXTERN void * Tcl_AttemptDbCkalloc(size_t size, const char *file,
int line);
EXTERN void * Tcl_AttemptDbCkalloc(TCL_HASH_TYPE size,
const char *file, int line);
/* 430 */
EXTERN void * Tcl_AttemptRealloc(void *ptr, size_t size);
EXTERN void * Tcl_AttemptRealloc(void *ptr, TCL_HASH_TYPE size);
/* 431 */
EXTERN void * Tcl_AttemptDbCkrealloc(void *ptr, size_t size,
EXTERN void * Tcl_AttemptDbCkrealloc(void *ptr, TCL_HASH_TYPE size,
const char *file, int line);
/* 432 */
EXTERN int Tcl_AttemptSetObjLength(Tcl_Obj *objPtr,
@@ -1401,7 +1408,7 @@ EXTERN void Tcl_LimitTypeSet(Tcl_Interp *interp, int type);
/* 531 */
EXTERN void Tcl_LimitTypeReset(Tcl_Interp *interp, int type);
/* 532 */
EXTERN Tcl_Size Tcl_LimitGetCommands(Tcl_Interp *interp);
EXTERN int Tcl_LimitGetCommands(Tcl_Interp *interp);
/* 533 */
EXTERN void Tcl_LimitGetTime(Tcl_Interp *interp,
Tcl_Time *timeLimitPtr);
@@ -1704,7 +1711,7 @@ EXTERN int TclZipfs_MountBuffer(Tcl_Interp *interp,
EXTERN void Tcl_FreeInternalRep(Tcl_Obj *objPtr);
/* 637 */
EXTERN char * Tcl_InitStringRep(Tcl_Obj *objPtr, const char *bytes,
size_t numBytes);
TCL_HASH_TYPE numBytes);
/* 638 */
EXTERN Tcl_ObjInternalRep * Tcl_FetchInternalRep(Tcl_Obj *objPtr,
const Tcl_ObjType *typePtr);
@@ -1867,8 +1874,6 @@ EXTERN Tcl_Obj * Tcl_NewWideUIntObj(Tcl_WideUInt wideValue);
EXTERN void Tcl_SetWideUIntObj(Tcl_Obj *objPtr,
Tcl_WideUInt uwideValue);
/* 690 */
EXTERN int Tcl_IsEmpty(Tcl_Obj *obj);
/* 691 */
EXTERN void TclUnusedStubEntry(void);
typedef struct {
@@ -1884,12 +1889,12 @@ typedef struct TclStubs {
int (*tcl_PkgProvideEx) (Tcl_Interp *interp, const char *name, const char *version, const void *clientData); /* 0 */
const char * (*tcl_PkgRequireEx) (Tcl_Interp *interp, const char *name, const char *version, int exact, void *clientDataPtr); /* 1 */
TCL_NORETURN1 void (*tcl_Panic) (const char *format, ...) TCL_FORMAT_PRINTF(1, 2); /* 2 */
void * (*tcl_Alloc) (size_t size); /* 3 */
void * (*tcl_Alloc) (TCL_HASH_TYPE size); /* 3 */
void (*tcl_Free) (void *ptr); /* 4 */
void * (*tcl_Realloc) (void *ptr, size_t size); /* 5 */
void * (*tcl_DbCkalloc) (size_t size, const char *file, int line); /* 6 */
void * (*tcl_Realloc) (void *ptr, TCL_HASH_TYPE size); /* 5 */
void * (*tcl_DbCkalloc) (TCL_HASH_TYPE size, const char *file, int line); /* 6 */
void (*tcl_DbCkfree) (void *ptr, const char *file, int line); /* 7 */
void * (*tcl_DbCkrealloc) (void *ptr, size_t size, const char *file, int line); /* 8 */
void * (*tcl_DbCkrealloc) (void *ptr, TCL_HASH_TYPE size, const char *file, int line); /* 8 */
void (*tcl_CreateFileHandler) (int fd, int mask, Tcl_FileProc *proc, void *clientData); /* 9 */
void (*tcl_DeleteFileHandler) (int fd); /* 10 */
void (*tcl_SetTimer) (const Tcl_Time *timePtr); /* 11 */
@@ -1912,9 +1917,9 @@ typedef struct TclStubs {
Tcl_Obj * (*tcl_DbNewStringObj) (const char *bytes, Tcl_Size length, const char *file, int line); /* 28 */
Tcl_Obj * (*tcl_DuplicateObj) (Tcl_Obj *objPtr); /* 29 */
void (*tclFreeObj) (Tcl_Obj *objPtr); /* 30 */
void (*reserved31)(void);
void (*reserved32)(void);
void (*reserved33)(void);
int (*tcl_GetBoolean) (Tcl_Interp *interp, const char *src, int *intPtr); /* 31 */
int (*tcl_GetBooleanFromObj) (Tcl_Interp *interp, Tcl_Obj *objPtr, int *intPtr); /* 32 */
unsigned char * (*tcl_GetByteArrayFromObj) (Tcl_Obj *objPtr, Tcl_Size *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 */
void (*reserved36)(void);
@@ -1962,7 +1967,7 @@ typedef struct TclStubs {
int (*tcl_BadChannelOption) (Tcl_Interp *interp, const char *optionName, const char *optionList); /* 78 */
void (*tcl_CallWhenDeleted) (Tcl_Interp *interp, Tcl_InterpDeleteProc *proc, void *clientData); /* 79 */
void (*tcl_CancelIdleCall) (Tcl_IdleProc *idleProc, void *clientData); /* 80 */
void (*reserved81)(void);
int (*tcl_Close) (Tcl_Interp *interp, Tcl_Channel chan); /* 81 */
int (*tcl_CommandComplete) (const char *cmd); /* 82 */
char * (*tcl_Concat) (Tcl_Size argc, const char *const *argv); /* 83 */
Tcl_Size (*tcl_ConvertElement) (const char *src, char *dst, int flags); /* 84 */
@@ -2274,7 +2279,7 @@ typedef struct TclStubs {
int (*tcl_ProcObjCmd) (void *clientData, Tcl_Interp *interp, Tcl_Size objc, Tcl_Obj *const objv[]); /* 390 */
void (*tcl_ConditionFinalize) (Tcl_Condition *condPtr); /* 391 */
void (*tcl_MutexFinalize) (Tcl_Mutex *mutex); /* 392 */
int (*tcl_CreateThread) (Tcl_ThreadId *idPtr, Tcl_ThreadCreateProc *proc, void *clientData, size_t stackSize, int flags); /* 393 */
int (*tcl_CreateThread) (Tcl_ThreadId *idPtr, Tcl_ThreadCreateProc *proc, void *clientData, TCL_HASH_TYPE stackSize, int flags); /* 393 */
Tcl_Size (*tcl_ReadRaw) (Tcl_Channel chan, char *dst, Tcl_Size bytesToRead); /* 394 */
Tcl_Size (*tcl_WriteRaw) (Tcl_Channel chan, const char *src, Tcl_Size srcLen); /* 395 */
Tcl_Channel (*tcl_GetTopChannel) (Tcl_Channel chan); /* 396 */
@@ -2309,10 +2314,10 @@ typedef struct TclStubs {
void * (*tcl_CommandTraceInfo) (Tcl_Interp *interp, const char *varName, int flags, Tcl_CommandTraceProc *procPtr, void *prevClientData); /* 425 */
int (*tcl_TraceCommand) (Tcl_Interp *interp, const char *varName, int flags, Tcl_CommandTraceProc *proc, void *clientData); /* 426 */
void (*tcl_UntraceCommand) (Tcl_Interp *interp, const char *varName, int flags, Tcl_CommandTraceProc *proc, void *clientData); /* 427 */
void * (*tcl_AttemptAlloc) (size_t size); /* 428 */
void * (*tcl_AttemptDbCkalloc) (size_t size, const char *file, int line); /* 429 */
void * (*tcl_AttemptRealloc) (void *ptr, size_t size); /* 430 */
void * (*tcl_AttemptDbCkrealloc) (void *ptr, size_t size, const char *file, int line); /* 431 */
void * (*tcl_AttemptAlloc) (TCL_HASH_TYPE size); /* 428 */
void * (*tcl_AttemptDbCkalloc) (TCL_HASH_TYPE size, const char *file, int line); /* 429 */
void * (*tcl_AttemptRealloc) (void *ptr, TCL_HASH_TYPE size); /* 430 */
void * (*tcl_AttemptDbCkrealloc) (void *ptr, TCL_HASH_TYPE size, const char *file, int line); /* 431 */
int (*tcl_AttemptSetObjLength) (Tcl_Obj *objPtr, Tcl_Size length); /* 432 */
Tcl_ThreadId (*tcl_GetChannelThread) (Tcl_Channel channel); /* 433 */
Tcl_UniChar * (*tclGetUnicodeFromObj) (Tcl_Obj *objPtr, void *lengthPtr); /* 434 */
@@ -2413,7 +2418,7 @@ typedef struct TclStubs {
int (*tcl_LimitTypeExceeded) (Tcl_Interp *interp, int type); /* 529 */
void (*tcl_LimitTypeSet) (Tcl_Interp *interp, int type); /* 530 */
void (*tcl_LimitTypeReset) (Tcl_Interp *interp, int type); /* 531 */
Tcl_Size (*tcl_LimitGetCommands) (Tcl_Interp *interp); /* 532 */
int (*tcl_LimitGetCommands) (Tcl_Interp *interp); /* 532 */
void (*tcl_LimitGetTime) (Tcl_Interp *interp, Tcl_Time *timeLimitPtr); /* 533 */
int (*tcl_LimitGetGranularity) (Tcl_Interp *interp, int type); /* 534 */
Tcl_InterpState (*tcl_SaveInterpState) (Tcl_Interp *interp, int status); /* 535 */
@@ -2518,7 +2523,7 @@ typedef struct TclStubs {
Tcl_Obj * (*tclZipfs_TclLibrary) (void); /* 634 */
int (*tclZipfs_MountBuffer) (Tcl_Interp *interp, const void *data, size_t datalen, const char *mountPoint, int copy); /* 635 */
void (*tcl_FreeInternalRep) (Tcl_Obj *objPtr); /* 636 */
char * (*tcl_InitStringRep) (Tcl_Obj *objPtr, const char *bytes, size_t numBytes); /* 637 */
char * (*tcl_InitStringRep) (Tcl_Obj *objPtr, const char *bytes, TCL_HASH_TYPE numBytes); /* 637 */
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 */
@@ -2571,8 +2576,7 @@ typedef struct TclStubs {
int (*tcl_UtfNcasecmp) (const char *s1, const char *s2, size_t n); /* 687 */
Tcl_Obj * (*tcl_NewWideUIntObj) (Tcl_WideUInt wideValue); /* 688 */
void (*tcl_SetWideUIntObj) (Tcl_Obj *objPtr, Tcl_WideUInt uwideValue); /* 689 */
int (*tcl_IsEmpty) (Tcl_Obj *obj); /* 690 */
void (*tclUnusedStubEntry) (void); /* 691 */
void (*tclUnusedStubEntry) (void); /* 690 */
} TclStubs;
extern const TclStubs *tclStubsPtr;
@@ -2647,9 +2651,12 @@ extern const TclStubs *tclStubsPtr;
(tclStubsPtr->tcl_DuplicateObj) /* 29 */
#define TclFreeObj \
(tclStubsPtr->tclFreeObj) /* 30 */
/* Slot 31 is reserved */
/* Slot 32 is reserved */
/* Slot 33 is reserved */
#define Tcl_GetBoolean \
(tclStubsPtr->tcl_GetBoolean) /* 31 */
#define Tcl_GetBooleanFromObj \
(tclStubsPtr->tcl_GetBooleanFromObj) /* 32 */
#define Tcl_GetByteArrayFromObj \
(tclStubsPtr->tcl_GetByteArrayFromObj) /* 33 */
#define Tcl_GetDouble \
(tclStubsPtr->tcl_GetDouble) /* 34 */
#define Tcl_GetDoubleFromObj \
@@ -2733,7 +2740,8 @@ extern const TclStubs *tclStubsPtr;
(tclStubsPtr->tcl_CallWhenDeleted) /* 79 */
#define Tcl_CancelIdleCall \
(tclStubsPtr->tcl_CancelIdleCall) /* 80 */
/* Slot 81 is reserved */
#define Tcl_Close \
(tclStubsPtr->tcl_Close) /* 81 */
#define Tcl_CommandComplete \
(tclStubsPtr->tcl_CommandComplete) /* 82 */
#define Tcl_Concat \
@@ -3901,10 +3909,8 @@ extern const TclStubs *tclStubsPtr;
(tclStubsPtr->tcl_NewWideUIntObj) /* 688 */
#define Tcl_SetWideUIntObj \
(tclStubsPtr->tcl_SetWideUIntObj) /* 689 */
#define Tcl_IsEmpty \
(tclStubsPtr->tcl_IsEmpty) /* 690 */
#define TclUnusedStubEntry \
(tclStubsPtr->tclUnusedStubEntry) /* 691 */
(tclStubsPtr->tclUnusedStubEntry) /* 690 */
#endif /* defined(USE_TCL_STUBS) */
@@ -3974,6 +3980,23 @@ extern const TclStubs *tclStubsPtr;
} while(0)
#if defined(USE_TCL_STUBS)
# if defined(_WIN32) && defined(_WIN64) && TCL_MAJOR_VERSION < 9
# undef Tcl_GetTime
/* Handle Win64 tk.dll being loaded in Cygwin64 (only needed for Tcl 8). */
# define Tcl_GetTime(t) \
do { \
struct { \
Tcl_Time now; \
long long reserved; \
} _t; \
_t.reserved = -1; \
tclStubsPtr->tcl_GetTime((&_t.now)); \
if (_t.reserved != -1) { \
_t.now.usec = (long) _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
@@ -4026,22 +4049,26 @@ extern const TclStubs *tclStubsPtr;
#define Tcl_GetIndexFromObjStruct(interp, objPtr, tablePtr, offset, msg, flags, indexPtr) \
(tclStubsPtr->tcl_GetIndexFromObjStruct((interp), (objPtr), (tablePtr), (offset), (msg), \
(flags)|(int)(sizeof(*(indexPtr))<<1), (indexPtr)))
#define Tcl_GetBooleanFromObj(interp, objPtr, boolPtr) ((sizeof(*(boolPtr)) <= sizeof(int)) \
? Tcl_GetBoolFromObj(interp, objPtr, (TCL_NULL_OK-2)&(int)sizeof((*(boolPtr))), (char *)(boolPtr)) \
: (TCLBOOLWARNING(boolPtr)Tcl_Panic("sizeof(%s) must be <= sizeof(int)", & #boolPtr [1]),TCL_ERROR))
#define Tcl_GetBoolean(interp, src, boolPtr) ((sizeof(*(boolPtr)) <= sizeof(int)) \
? Tcl_GetBool(interp, src, (TCL_NULL_OK-2)&(int)sizeof((*(boolPtr))), (char *)(boolPtr)) \
: (TCLBOOLWARNING(boolPtr)Tcl_Panic("sizeof(%s) must be <= sizeof(int)", & #boolPtr [1]),TCL_ERROR))
#define Tcl_GetBooleanFromObj(interp, objPtr, boolPtr) \
((sizeof(*(boolPtr)) == sizeof(int) && (TCL_MAJOR_VERSION == 8)) ? tclStubsPtr->tcl_GetBooleanFromObj(interp, objPtr, (int *)(boolPtr)) : \
((sizeof(*(boolPtr)) <= sizeof(int)) ? Tcl_GetBoolFromObj(interp, objPtr, (TCL_NULL_OK-2)&(int)sizeof((*(boolPtr))), (char *)(boolPtr)) : \
(TCLBOOLWARNING(boolPtr)Tcl_Panic("sizeof(%s) must be <= sizeof(int)", & #boolPtr [1]),TCL_ERROR)))
#define Tcl_GetBoolean(interp, src, boolPtr) \
((sizeof(*(boolPtr)) == sizeof(int) && (TCL_MAJOR_VERSION == 8)) ? tclStubsPtr->tcl_GetBoolean(interp, src, (int *)(boolPtr)) : \
((sizeof(*(boolPtr)) <= sizeof(int)) ? Tcl_GetBool(interp, src, (TCL_NULL_OK-2)&(int)sizeof((*(boolPtr))), (char *)(boolPtr)) : \
(TCLBOOLWARNING(boolPtr)Tcl_Panic("sizeof(%s) must be <= sizeof(int)", & #boolPtr [1]),TCL_ERROR)))
#else
#define Tcl_GetIndexFromObjStruct(interp, objPtr, tablePtr, offset, msg, flags, indexPtr) \
((Tcl_GetIndexFromObjStruct)((interp), (objPtr), (tablePtr), (offset), (msg), \
(flags)|(int)(sizeof(*(indexPtr))<<1), (indexPtr)))
#define Tcl_GetBooleanFromObj(interp, objPtr, boolPtr) ((sizeof(*(boolPtr)) <= sizeof(int)) \
? Tcl_GetBoolFromObj(interp, objPtr, (TCL_NULL_OK-2)&(int)sizeof((*(boolPtr))), (char *)(boolPtr)) \
: (TCLBOOLWARNING(boolPtr)Tcl_Panic("sizeof(%s) must be <= sizeof(int)", & #boolPtr [1]),TCL_ERROR))
#define Tcl_GetBoolean(interp, src, boolPtr) ((sizeof(*(boolPtr)) <= sizeof(int)) \
? Tcl_GetBool(interp, src, (TCL_NULL_OK-2)&(int)sizeof((*(boolPtr))), (char *)(boolPtr)) \
: (TCLBOOLWARNING(boolPtr)Tcl_Panic("sizeof(%s) must be <= sizeof(int)", & #boolPtr [1]),TCL_ERROR))
#define Tcl_GetBooleanFromObj(interp, objPtr, boolPtr) \
((sizeof(*(boolPtr)) == sizeof(int) && (TCL_MAJOR_VERSION == 8)) ? Tcl_GetBooleanFromObj(interp, objPtr, (int *)(boolPtr)) : \
((sizeof(*(boolPtr)) <= sizeof(int)) ? Tcl_GetBoolFromObj(interp, objPtr, (TCL_NULL_OK-2)&(int)sizeof((*(boolPtr))), (char *)(boolPtr)) : \
(TCLBOOLWARNING(boolPtr)Tcl_Panic("sizeof(%s) must be <= sizeof(int)", & #boolPtr [1]),TCL_ERROR)))
#define Tcl_GetBoolean(interp, src, boolPtr) \
((sizeof(*(boolPtr)) == sizeof(int) && (TCL_MAJOR_VERSION == 8)) ? Tcl_GetBoolean(interp, src, (int *)(boolPtr)) : \
((sizeof(*(boolPtr)) <= sizeof(int)) ? Tcl_GetBool(interp, src, (TCL_NULL_OK-2)&(int)sizeof((*(boolPtr))), (char *)(boolPtr)) : \
(TCLBOOLWARNING(boolPtr)Tcl_Panic("sizeof(%s) must be <= sizeof(int)", & #boolPtr [1]),TCL_ERROR)))
#endif
#ifdef TCL_MEM_DEBUG
@@ -4138,7 +4165,11 @@ extern const TclStubs *tclStubsPtr;
Tcl_EvalObjEx(interp, objPtr, 0)
#define Tcl_GlobalEvalObj(interp, objPtr) \
Tcl_EvalObjEx(interp, objPtr, TCL_EVAL_GLOBAL)
#define Tcl_Close(interp, chan) Tcl_CloseEx(interp, chan, 0)
#if TCL_MAJOR_VERSION > 8
# undef Tcl_Close
# define Tcl_Close(interp, chan) Tcl_CloseEx(interp, chan, 0)
#endif
#undef TclUtfCharComplete
#undef TclUtfNext
@@ -4162,7 +4193,55 @@ extern const TclStubs *tclStubsPtr;
#undef TclParseArgsObjv
#undef TclGetAliasObj
#if defined(TCL_8_API)
#if TCL_MAJOR_VERSION < 9
/* TIP #627 for 8.7 */
# undef Tcl_CreateObjCommand2
# define Tcl_CreateObjCommand2 Tcl_CreateObjCommand
# undef Tcl_CreateObjTrace2
# define Tcl_CreateObjTrace2 Tcl_CreateObjTrace
# undef Tcl_NRCreateCommand2
# define Tcl_NRCreateCommand2 Tcl_NRCreateCommand
# undef Tcl_NRCallObjProc2
# define Tcl_NRCallObjProc2 Tcl_NRCallObjProc
/* TIP #660 for 8.7 */
# undef Tcl_GetSizeIntFromObj
# define Tcl_GetSizeIntFromObj Tcl_GetIntFromObj
# undef Tcl_GetBytesFromObj
# define Tcl_GetBytesFromObj(interp, objPtr, sizePtr) \
tclStubsPtr->tclGetBytesFromObj((interp), (objPtr), (sizePtr))
# undef Tcl_GetStringFromObj
# define Tcl_GetStringFromObj(objPtr, sizePtr) \
tclStubsPtr->tclGetStringFromObj((objPtr), (sizePtr))
# undef Tcl_GetUnicodeFromObj
# define Tcl_GetUnicodeFromObj(objPtr, sizePtr) \
tclStubsPtr->tclGetUnicodeFromObj((objPtr), (sizePtr))
# undef Tcl_ListObjGetElements
# define Tcl_ListObjGetElements(interp, listPtr, objcPtr, objvPtr) \
tclStubsPtr->tclListObjGetElements((interp), (listPtr), (objcPtr), (objvPtr))
# undef Tcl_ListObjLength
# define Tcl_ListObjLength(interp, listPtr, lengthPtr) \
tclStubsPtr->tclListObjLength((interp), (listPtr), (lengthPtr))
# undef Tcl_DictObjSize
# define Tcl_DictObjSize(interp, dictPtr, sizePtr) \
tclStubsPtr->tclDictObjSize((interp), (dictPtr), (sizePtr))
# undef Tcl_SplitList
# define Tcl_SplitList(interp, listStr, argcPtr, argvPtr) \
tclStubsPtr->tclSplitList((interp), (listStr), (argcPtr), (argvPtr))
# undef Tcl_SplitPath
# define Tcl_SplitPath(path, argcPtr, argvPtr) \
tclStubsPtr->tclSplitPath((path), (argcPtr), (argvPtr))
# undef Tcl_FSSplitPath
# define Tcl_FSSplitPath(pathPtr, lenPtr) \
tclStubsPtr->tclFSSplitPath((pathPtr), (lenPtr))
# undef Tcl_ParseArgsObjv
# define Tcl_ParseArgsObjv(interp, argTable, objcPtr, objv, remObjv) \
tclStubsPtr->tclParseArgsObjv((interp), (argTable), (objcPtr), (objv), (remObjv))
# undef Tcl_GetAliasObj
# define Tcl_GetAliasObj(interp, childCmd, targetInterpPtr, targetCmdPtr, objcPtr, objv) \
tclStubsPtr->tclGetAliasObj((interp), (childCmd), (targetInterpPtr), (targetCmdPtr), (objcPtr), (objv))
#elif defined(TCL_8_API)
# undef Tcl_GetByteArrayFromObj
# undef Tcl_GetBytesFromObj
# undef Tcl_GetStringFromObj
# undef Tcl_GetUnicodeFromObj
@@ -4175,6 +4254,9 @@ extern const TclStubs *tclStubsPtr;
# undef Tcl_ParseArgsObjv
# undef Tcl_GetAliasObj
# if !defined(USE_TCL_STUBS)
# define Tcl_GetByteArrayFromObj(objPtr, sizePtr) (sizeof(*(sizePtr)) <= sizeof(int) ? \
TclGetBytesFromObj(NULL, (objPtr), (sizePtr)) : \
(Tcl_GetBytesFromObj)(NULL, (objPtr), (Tcl_Size *)(void *)(sizePtr)))
# define Tcl_GetBytesFromObj(interp, objPtr, sizePtr) (sizeof(*(sizePtr)) <= sizeof(int) ? \
TclGetBytesFromObj((interp), (objPtr), (sizePtr)) : \
(Tcl_GetBytesFromObj)((interp), (objPtr), (Tcl_Size *)(void *)(sizePtr)))
@@ -4209,6 +4291,9 @@ extern const TclStubs *tclStubsPtr;
TclGetAliasObj((interp), (childCmd), (targetInterpPtr), (targetCmdPtr), (objcPtr), (objv)) : \
(Tcl_GetAliasObj)((interp), (childCmd), (targetInterpPtr), (targetCmdPtr), (Tcl_Size *)(void *)(objcPtr), (objv)))
# elif !defined(BUILD_tcl)
# define Tcl_GetByteArrayFromObj(objPtr, sizePtr) (sizeof(*(sizePtr)) <= sizeof(int) ? \
tclStubsPtr->tclGetBytesFromObj(NULL, (objPtr), (sizePtr)) : \
tclStubsPtr->tcl_GetBytesFromObj(NULL, (objPtr), (Tcl_Size *)(void *)(sizePtr)))
# define Tcl_GetBytesFromObj(interp, objPtr, sizePtr) (sizeof(*(sizePtr)) <= sizeof(int) ? \
tclStubsPtr->tclGetBytesFromObj((interp), (objPtr), (sizePtr)) : \
tclStubsPtr->tcl_GetBytesFromObj((interp), (objPtr), (Tcl_Size *)(void *)(sizePtr)))
@@ -4243,12 +4328,10 @@ extern const TclStubs *tclStubsPtr;
tclStubsPtr->tclGetAliasObj((interp), (childCmd), (targetInterpPtr), (targetCmdPtr), (objcPtr), (objv)) : \
tclStubsPtr->tcl_GetAliasObj((interp), (childCmd), (targetInterpPtr), (targetCmdPtr), (Tcl_Size *)(void *)(objcPtr), (objv)))
# endif /* defined(USE_TCL_STUBS) */
#else /* !defined(TCL_8_API) */
# undef Tcl_GetByteArrayFromObj
# define Tcl_GetByteArrayFromObj(objPtr, sizePtr) \
Tcl_GetBytesFromObj(NULL, (objPtr), (sizePtr))
#endif /* defined(TCL_8_API) */
#define Tcl_GetByteArrayFromObj(objPtr, sizePtr) \
Tcl_GetBytesFromObj(NULL, (objPtr), (sizePtr))
#if TCL_MINOR_VERSION < 1
# undef Tcl_IsEmpty
#endif
#endif /* _TCLDECLS */
+8 -11
View File
@@ -177,7 +177,7 @@ const Tcl_ObjType tclDictType = {
static const Tcl_HashKeyType chainHashType = {
TCL_HASH_KEY_TYPE_VERSION,
TCL_HASH_KEY_DIRECT_COMPARE, /* allows compare keys by pointers */
TCL_HASH_KEY_DIRECT_COMPARE, /* allows compare keys by pointers */
TclHashObjKey,
TclCompareObjKeys,
AllocChainEntry,
@@ -546,9 +546,7 @@ UpdateStringOfDict(
dst = Tcl_InitStringRep(dictPtr, NULL, bytesNeeded - 1);
TclOOM(dst, bytesNeeded);
for (i=0,cPtr=dict->entryChainHead; i<numElems; i+=2,cPtr=cPtr->nextPtr) {
if (i) {
flagPtr[i] |= TCL_DONT_QUOTE_HASH;
}
flagPtr[i] |= ( i ? TCL_DONT_QUOTE_HASH : 0 );
keyPtr = (Tcl_Obj *)Tcl_GetHashKey(&dict->table, &cPtr->entry);
elem = TclGetStringFromObj(keyPtr, &length);
dst += TclConvertElement(elem, length, dst, flagPtr[i]);
@@ -1267,7 +1265,7 @@ Tcl_DictObjNext(
void
Tcl_DictObjDone(
Tcl_DictSearch *searchPtr) /* Pointer to a hash search context. */
Tcl_DictSearch *searchPtr) /* Pointer to a hash search context. */
{
Dict *dict;
@@ -1969,8 +1967,8 @@ DictMergeCmd(
Tcl_Obj *const *objv)
{
Tcl_Obj *targetObj, *keyObj = NULL, *valueObj = NULL;
int done, allocatedDict = 0;
int i;
int allocatedDict = 0;
int i, done;
Tcl_DictSearch search;
if (objc == 1) {
@@ -2495,8 +2493,7 @@ DictLappendCmd(
Tcl_Obj *const *objv)
{
Tcl_Obj *dictPtr, *valuePtr, *resultPtr;
int allocatedDict = 0, allocatedValue = 0;
int i;
int i, allocatedDict = 0, allocatedValue = 0;
if (objc < 3) {
Tcl_WrongNumArgs(interp, 1, objv, "dictVarName key ?value ...?");
@@ -3858,10 +3855,10 @@ TclDictWithFinish(
* parameter is >= 0 */
Tcl_Obj *part2Ptr, /* If non-NULL, gives the name of an element
* in the array part1. */
Tcl_Size index, /* Index into the local variable table of the
int index, /* Index into the local variable table of the
* variable, or -1. Only used when part1Ptr is
* NULL. */
Tcl_Size pathc, /* The number of elements in the path into the
int pathc, /* The number of elements in the path into the
* dictionary. */
Tcl_Obj *const pathv[], /* The elements of the path to the subdict. */
Tcl_Obj *keysPtr) /* List of keys to be synchronized. This is
+1 -1
View File
@@ -3057,7 +3057,7 @@ Utf16ToUtfProc(
if (PROFILE_STRICT(flags)) {
result = TCL_CONVERT_SYNTAX;
src -= 2; /* Go back to beginning of high surrogate */
dst--; /* Also undo writing a single byte too much */
dst--; /* Also undo writing a single byte too much */
break;
}
if (PROFILE_REPLACE(flags)) {
+3 -4
View File
@@ -24,7 +24,7 @@ static int ReadOneEnsembleOption(Tcl_Interp *interp,
static int ReadAllEnsembleOptions(Tcl_Interp *interp,
Tcl_Command token);
static int SetEnsembleConfigOptions(Tcl_Interp *interp,
Tcl_Command token, Tcl_Size objc,
Tcl_Command token, int objc,
Tcl_Obj *const objv[]);
static inline int EnsembleUnknownCallback(Tcl_Interp *interp,
EnsembleConfig *ensemblePtr, int objc,
@@ -585,7 +585,7 @@ static int
SetEnsembleConfigOptions(
Tcl_Interp *interp,
Tcl_Command token, /* The ensemble to configure. */
Tcl_Size objc, /* The count of option-related arguments. */
int objc, /* The count of option-related arguments. */
Tcl_Obj *const objv[]) /* Option-related arguments. */
{
Tcl_Size len;
@@ -1578,8 +1578,7 @@ TclMakeEnsemble(
const char **nameParts = NULL;
const char *cmdName = NULL;
Tcl_Size i, nameCount = 0;
int ensembleFlags = 0;
Tcl_Size hiddenLen;
int ensembleFlags = 0, hiddenLen;
/*
* Construct the path for the ensemble namespace and create it.
+1 -1
View File
@@ -45,7 +45,7 @@ static struct {
char **cache; /* Array containing all of the environment
* strings that Tcl has allocated. */
#ifndef USE_PUTENV
techar **ourEnviron; /* Cache of the array that we allocate. We
techar **ourEnviron; /* Cache of the array that we allocate. We
* need to track this in case another
* subsystem swaps around the environ array
* like we do. */
+10 -10
View File
@@ -72,7 +72,7 @@ typedef struct {
typedef struct ExitHandler {
Tcl_ExitProc *proc; /* Function to call when process exits. */
void *clientData; /* One word of information to pass to proc. */
void *clientData; /* One word of information to pass to proc. */
struct ExitHandler *nextPtr;/* Next in list of all exit handlers for this
* application, or NULL for end of list. */
} ExitHandler;
@@ -122,7 +122,7 @@ static Tcl_ThreadDataKey dataKey;
#if TCL_THREADS
typedef struct {
Tcl_ThreadCreateProc *proc; /* Main() function of the thread */
void *clientData; /* The one argument to Main() */
void *clientData; /* The one argument to Main() */
} ThreadClientData;
static Tcl_ThreadCreateType NewThreadProc(void *clientData);
#endif /* TCL_THREADS */
@@ -212,7 +212,7 @@ Tcl_BackgroundException(
static void
HandleBgErrors(
void *clientData) /* Pointer to ErrAssocData structure. */
void *clientData) /* Pointer to ErrAssocData structure. */
{
ErrAssocData *assocPtr = (ErrAssocData *)clientData;
Tcl_Interp *interp = assocPtr->interp;
@@ -600,7 +600,7 @@ TclGetBgErrorHandler(
static void
BgErrorDeleteProc(
void *clientData, /* Pointer to ErrAssocData structure. */
void *clientData, /* Pointer to ErrAssocData structure. */
TCL_UNUSED(Tcl_Interp *))
{
ErrAssocData *assocPtr = (ErrAssocData *)clientData;
@@ -639,7 +639,7 @@ BgErrorDeleteProc(
void
Tcl_CreateExitHandler(
Tcl_ExitProc *proc, /* Function to invoke. */
void *clientData) /* Arbitrary value to pass to proc. */
void *clientData) /* Arbitrary value to pass to proc. */
{
ExitHandler *exitPtr = (ExitHandler*)Tcl_Alloc(sizeof(ExitHandler));
@@ -672,7 +672,7 @@ Tcl_CreateExitHandler(
void
TclCreateLateExitHandler(
Tcl_ExitProc *proc, /* Function to invoke. */
void *clientData) /* Arbitrary value to pass to proc. */
void *clientData) /* Arbitrary value to pass to proc. */
{
ExitHandler *exitPtr = (ExitHandler*)Tcl_Alloc(sizeof(ExitHandler));
@@ -705,7 +705,7 @@ TclCreateLateExitHandler(
void
Tcl_DeleteExitHandler(
Tcl_ExitProc *proc, /* Function that was previously registered. */
void *clientData) /* Arbitrary value to pass to proc. */
void *clientData) /* Arbitrary value to pass to proc. */
{
ExitHandler *exitPtr, *prevPtr;
@@ -748,7 +748,7 @@ Tcl_DeleteExitHandler(
void
TclDeleteLateExitHandler(
Tcl_ExitProc *proc, /* Function that was previously registered. */
void *clientData) /* Arbitrary value to pass to proc. */
void *clientData) /* Arbitrary value to pass to proc. */
{
ExitHandler *exitPtr, *prevPtr;
@@ -791,7 +791,7 @@ TclDeleteLateExitHandler(
void
Tcl_CreateThreadExitHandler(
Tcl_ExitProc *proc, /* Function to invoke. */
void *clientData) /* Arbitrary value to pass to proc. */
void *clientData) /* Arbitrary value to pass to proc. */
{
ExitHandler *exitPtr;
ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey);
@@ -824,7 +824,7 @@ Tcl_CreateThreadExitHandler(
void
Tcl_DeleteThreadExitHandler(
Tcl_ExitProc *proc, /* Function that was previously registered. */
void *clientData) /* Arbitrary value to pass to proc. */
void *clientData) /* Arbitrary value to pass to proc. */
{
ExitHandler *exitPtr, *prevPtr;
ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey);
+39 -48
View File
@@ -155,22 +155,17 @@ typedef struct {
((Var *) ((char *)hPtr - offsetof(VarInHash, entry)))
static inline Var *
VarHashCreateVar(
VarHashFindVar(
TclVarHashTable *tablePtr,
Tcl_Obj *key,
int *newPtr)
Tcl_Obj *key)
{
Tcl_HashEntry *hPtr = Tcl_CreateHashEntry(&tablePtr->table,
key, newPtr);
Tcl_HashEntry *hPtr = Tcl_FindHashEntry(&tablePtr->table,
key);
if (!hPtr) {
return NULL;
}
return VarHashGetValue(hPtr);
}
#define VarHashFindVar(tablePtr, key) \
VarHashCreateVar((tablePtr), (key), NULL)
/*
* The new macro for ending an instruction; note that a reasonable C-optimiser
@@ -943,8 +938,8 @@ wordSkip(
void *ptr)
{
int mask = TCL_ALLOCALIGN-1;
int base = (int)PTR2INT(ptr) & mask;
return (TCL_ALLOCALIGN - base)/(int)sizeof(Tcl_Obj *);
int base = PTR2INT(ptr) & mask;
return (TCL_ALLOCALIGN - base)/sizeof(Tcl_Obj *);
}
/*
@@ -1556,7 +1551,7 @@ TclCompileObj(
Tcl_Interp *interp,
Tcl_Obj *objPtr,
const CmdFrame *invoker,
Tcl_Size word)
int word)
{
Interp *iPtr = (Interp *) interp;
ByteCode *codePtr; /* Tcl Internal type of bytecode. */
@@ -2031,7 +2026,7 @@ TEBCresume(
* executing an instruction.
*/
Tcl_Size cleanup = PTR2INT(data[2]);
int cleanup = PTR2INT(data[2]);
Tcl_Obj *objResultPtr;
int checkInterp = 0; /* Indicates when a check of interp readyness
* is necessary. Set by CACHE_STACK_INFO() */
@@ -4224,7 +4219,7 @@ TEBCresume(
case INST_JUMP4:
opnd = TclGetInt4AtPtr(pc+1);
TRACE(("%d => new pc %" TCL_Z_MODIFIER "u\n", opnd,
(pc + opnd - codePtr->codeStart)));
(size_t)(pc + opnd - codePtr->codeStart)));
NEXT_INST_F(opnd, 0, 0);
{
@@ -4266,8 +4261,8 @@ TEBCresume(
#ifdef TCL_COMPILE_DEBUG
if (b) {
if ((*pc == INST_JUMP_TRUE1) || (*pc == INST_JUMP_TRUE4)) {
TRACE_APPEND(("%.20s true, new pc %" TCL_T_MODIFIER "u\n", O2S(valuePtr),
(pc + jmpOffset[1] - codePtr->codeStart)));
TRACE_APPEND(("%.20s true, new pc %" TCL_Z_MODIFIER "u\n", O2S(valuePtr),
(size_t)(pc + jmpOffset[1] - codePtr->codeStart)));
} else {
TRACE_APPEND(("%.20s true\n", O2S(valuePtr)));
}
@@ -4275,8 +4270,8 @@ TEBCresume(
if ((*pc == INST_JUMP_TRUE1) || (*pc == INST_JUMP_TRUE4)) {
TRACE_APPEND(("%.20s false\n", O2S(valuePtr)));
} else {
TRACE_APPEND(("%.20s false, new pc %" TCL_T_MODIFIER "u\n", O2S(valuePtr),
(pc + jmpOffset[0] - codePtr->codeStart)));
TRACE_APPEND(("%.20s false, new pc %" TCL_Z_MODIFIER "u\n", O2S(valuePtr),
(size_t)(pc + jmpOffset[0] - codePtr->codeStart)));
}
}
#endif
@@ -4301,7 +4296,7 @@ TEBCresume(
Tcl_Size jumpOffset = PTR2INT(Tcl_GetHashValue(hPtr));
TRACE_APPEND(("found in table, new pc %" TCL_Z_MODIFIER "u\n",
(pc - codePtr->codeStart + jumpOffset)));
(size_t)(pc - codePtr->codeStart + jumpOffset)));
NEXT_INST_F(jumpOffset, 1, 0);
} else {
TRACE_APPEND(("not found in table\n"));
@@ -4338,12 +4333,12 @@ TEBCresume(
NEXT_INST_F(1, 0, 1);
break;
case INST_INFO_LEVEL_ARGS: {
Tcl_WideInt level;
int level;
CallFrame *framePtr = iPtr->varFramePtr;
CallFrame *rootFramePtr = iPtr->rootFramePtr;
TRACE(("\"%.30s\" => ", O2S(OBJ_AT_TOS)));
if (TclGetWideIntFromObj(interp, OBJ_AT_TOS, &level) != TCL_OK) {
if (TclGetIntFromObj(interp, OBJ_AT_TOS, &level) != TCL_OK) {
TRACE_ERROR(interp);
goto gotError;
}
@@ -4495,7 +4490,7 @@ TEBCresume(
} else {
fprintf(stdout, "%" TCL_SIZE_MODIFIER "d: (%" TCL_T_MODIFIER "d) invoking ",
iPtr->numLevels,
(pc - codePtr->codeStart));
(size_t)(pc - codePtr->codeStart));
}
for (i = 0; i < opnd; i++) {
TclPrintObject(stdout, objv[i], 15);
@@ -4720,30 +4715,26 @@ TEBCresume(
if (TclObjTypeHasProc(valuePtr, indexProc)) {
DECACHE_STACK_INFO();
length = TclObjTypeLength(valuePtr);
if (TclGetIntForIndexM(interp, value2Ptr, length-1, &index)!=TCL_OK) {
if (TclGetIntForIndexM(NULL, value2Ptr, length-1, &index)!=TCL_OK) {
CACHE_STACK_INFO();
TRACE_ERROR(interp);
goto gotError;
}
if (TclObjTypeIndex(interp, valuePtr, index, &objResultPtr)!=TCL_OK) {
/* Could be list of indices. Let TclLindexList handle it below */
} else {
if (TclObjTypeIndex(interp, valuePtr, index, &objResultPtr) !=
TCL_OK) {
CACHE_STACK_INFO();
TRACE_ERROR(interp);
goto gotError;
}
CACHE_STACK_INFO();
TRACE_ERROR(interp);
goto gotError;
if (objResultPtr == NULL) {
/* Index is out of range, return empty result. */
TclNewObj(objResultPtr);
}
Tcl_IncrRefCount(objResultPtr); // reference held here
goto lindexDone;
}
CACHE_STACK_INFO();
if (objResultPtr == NULL) {
/* Index is out of range, return empty result. */
TclNewObj(objResultPtr);
}
Tcl_IncrRefCount(objResultPtr); // reference held here
goto lindexDone;
}
/*
* Extract the desired list element.
*/
{
} else {
/* Non-abstract list */
Tcl_Size value2Length;
Tcl_Obj *indexListPtr = value2Ptr;
@@ -5015,7 +5006,7 @@ TEBCresume(
TRACE_APPEND(("\"%.30s\"", O2S(objResultPtr)));
NEXT_INST_F(9, 1, 1);
}
toIdx = TclIndexDecode((int)toIdx, objc - 1);
toIdx = TclIndexDecode(toIdx, objc - 1);
if (toIdx == TCL_INDEX_NONE) {
goto emptyList;
} else if (toIdx >= objc) {
@@ -5032,7 +5023,7 @@ TEBCresume(
fromIdx = TCL_INDEX_START;
}
fromIdx = TclIndexDecode((int)fromIdx, objc - 1);
fromIdx = TclIndexDecode(fromIdx, objc - 1);
DECACHE_STACK_INFO();
if (TclObjTypeHasProc(valuePtr, sliceProc)) {
@@ -5438,8 +5429,8 @@ TEBCresume(
/* Decode index operands. */
toIdx = TclIndexDecode((int)toIdx, slength - 1);
fromIdx = TclIndexDecode((int)fromIdx, slength - 1);
toIdx = TclIndexDecode(toIdx, slength - 1);
fromIdx = TclIndexDecode(fromIdx, slength - 1);
if (toIdx == TCL_INDEX_NONE) {
TclNewObj(objResultPtr);
} else {
@@ -9341,7 +9332,7 @@ GetSrcInfoForPc(
break;
}
if (pcOffset <= codeEnd) { /* This cmd's code encloses pc */
Tcl_Size dist = (pcOffset - codeOffset);
int dist = (pcOffset - codeOffset);
if (dist <= bestDist) {
bestDist = dist;
+1 -1
View File
@@ -603,7 +603,7 @@ CopyRenameOneFile(
{
Tcl_Obj *perm;
Tcl_Size index;
int index;
TclNewLiteralStringObj(perm, "u+w");
Tcl_IncrRefCount(perm);
+6 -4
View File
@@ -104,7 +104,8 @@ const Tcl_HashKeyType tclStringHashKeyType = {
void
Tcl_InitHashTable(
Tcl_HashTable *tablePtr, /* Pointer to table record, which is supplied
Tcl_HashTable *tablePtr,
/* Pointer to table record, which is supplied
* by the caller. */
int keyType) /* Type of keys to use in table:
* TCL_STRING_KEYS, TCL_ONE_WORD_KEYS, or an
@@ -141,7 +142,8 @@ Tcl_InitHashTable(
void
Tcl_InitCustomHashTable(
Tcl_HashTable *tablePtr, /* Pointer to table record, which is supplied
Tcl_HashTable *tablePtr,
/* Pointer to table record, which is supplied
* by the caller. */
int keyType, /* Type of keys to use in table:
* TCL_STRING_KEYS, TCL_ONE_WORD_KEYS,
@@ -621,9 +623,9 @@ Tcl_HashStats(
} else {
overflow++;
}
tmp = (double)j;
tmp = j;
if (tablePtr->numEntries != 0) {
average += (tmp+1.0)*(tmp/(double)tablePtr->numEntries)/2.0;
average += (tmp+1.0)*(tmp/tablePtr->numEntries)/2.0;
}
}
+6 -1
View File
@@ -95,7 +95,7 @@ typedef struct EventScriptRecord {
*/
typedef struct Channel {
struct ChannelState *state; /* Split out state information */
struct ChannelState *state; /* Split out state information */
void *instanceData; /* Instance-specific data provided by creator
* of channel. */
const Tcl_ChannelType *typePtr; /* Pointer to channel type structure. */
@@ -158,6 +158,11 @@ typedef struct ChannelState {
* of line sequences in output? */
int inEofChar; /* If nonzero, use this as a signal of EOF on
* input. */
#if TCL_MAJOR_VERSION < 9
int outEofChar; /* If nonzero, append this to the channel when
* it is closed if it is open for writing.
* For Tcl 8.x only */
#endif
int unreportedError; /* Non-zero if an error report was deferred
* because it happened in the background. The
* value is the POSIX error code. */
+6 -6
View File
@@ -369,8 +369,8 @@ Tcl_ReadObjCmd(
{
Tcl_Channel chan; /* The channel to read from. */
int newline, i; /* Discard newline at end? */
Tcl_WideInt toRead; /* How many bytes to read? */
Tcl_Size charactersRead; /* How many characters were read? */
Tcl_WideInt toRead; /* How many bytes to read? */
Tcl_Size charactersRead; /* How many characters were read? */
int mode; /* Mode in which channel is opened. */
Tcl_Obj *resultPtr, *chanObjPtr;
@@ -1136,7 +1136,7 @@ Tcl_OpenObjCmd(
if (objc == 4) {
const char *permString = TclGetString(objv[3]);
int code = TCL_ERROR;
Tcl_Size scanned = TclParseAllWhiteSpace(permString, -1);
int scanned = TclParseAllWhiteSpace(permString, -1);
/*
* Support legacy octal numbers.
@@ -1239,7 +1239,7 @@ Tcl_OpenObjCmd(
static void
TcpAcceptCallbacksDeleteProc(
void *clientData, /* Data which was passed when the assocdata
void *clientData, /* Data which was passed when the assocdata
* was registered. */
TCL_UNUSED(Tcl_Interp *))
{
@@ -1367,7 +1367,7 @@ UnregisterTcpServerInterpCleanupProc(
static void
AcceptCallbackProc(
void *callbackData, /* The data stored when the callback was
void *callbackData, /* The data stored when the callback was
* created in the call to
* Tcl_OpenTcpServer. */
Tcl_Channel chan, /* Channel for the newly accepted
@@ -1458,7 +1458,7 @@ AcceptCallbackProc(
static void
TcpServerCloseProc(
void *callbackData) /* The data passed in the call to
void *callbackData) /* The data passed in the call to
* Tcl_CreateCloseHandler. */
{
AcceptCallback *acceptCallbackPtr = (AcceptCallback *)callbackData;
+9 -10
View File
@@ -56,7 +56,7 @@ typedef struct TransformChannelData TransformChannelData;
static int ExecuteCallback(TransformChannelData *ctrl,
Tcl_Interp *interp, unsigned char *op,
unsigned char *buf, Tcl_Size bufLen, int transmit,
unsigned char *buf, int bufLen, int transmit,
int preserve);
/*
@@ -366,7 +366,7 @@ ExecuteCallback(
Tcl_Interp *interp, /* Current interpreter, possibly NULL. */
unsigned char *op, /* Operation invoking the callback. */
unsigned char *buf, /* Buffer to give to the script. */
Tcl_Size bufLen, /* And its length. */
int bufLen, /* And its length. */
int transmit, /* Flag, determines whether the result of the
* callback is sent to the underlying channel
* or not. */
@@ -515,7 +515,7 @@ ExecuteCallback(
static int
TransformBlockModeProc(
void *instanceData, /* State of transformation. */
void *instanceData, /* State of transformation. */
int mode) /* New blocking mode. */
{
TransformChannelData *dataPtr = (TransformChannelData *)instanceData;
@@ -637,8 +637,7 @@ TransformInputProc(
int *errorCodePtr)
{
TransformChannelData *dataPtr = (TransformChannelData *)instanceData;
int gotBytes, copied;
Tcl_Size read;
int gotBytes, read, copied;
Tcl_Channel downChan;
/*
@@ -1014,7 +1013,7 @@ TransformGetOptionProc(
static void
TransformWatchProc(
void *instanceData, /* Channel to watch. */
void *instanceData, /* Channel to watch. */
int mask) /* Events of interest. */
{
TransformChannelData *dataPtr = (TransformChannelData *)instanceData;
@@ -1092,9 +1091,9 @@ TransformWatchProc(
static int
TransformGetFileHandleProc(
void *instanceData, /* Channel to query. */
void *instanceData, /* Channel to query. */
int direction, /* Direction of interest. */
void **handlePtr) /* Place to store the handle into. */
void **handlePtr) /* Place to store the handle into. */
{
TransformChannelData *dataPtr = (TransformChannelData *)instanceData;
@@ -1126,7 +1125,7 @@ TransformGetFileHandleProc(
static int
TransformNotifyProc(
void *clientData, /* The state of the notified
void *clientData, /* The state of the notified
* transformation. */
int mask) /* The mask of occurring events. */
{
@@ -1171,7 +1170,7 @@ TransformNotifyProc(
static void
TransformChannelHandlerTimer(
void *clientData) /* Transformation to query. */
void *clientData) /* Transformation to query. */
{
TransformChannelData *dataPtr = (TransformChannelData *)clientData;
+8 -8
View File
@@ -162,7 +162,7 @@ typedef enum {
static const char *const methodNames[] = {
"blocking", /* OPT */
"cget", /* OPT \/ Together or none */
"cgetall", /* OPT /\ of these two. */
"cgetall", /* OPT /\ of these two */
"configure", /* OPT */
"finalize", /* */
"initialize", /* */
@@ -1778,7 +1778,7 @@ ReflectThread(
static int
ReflectSetOption(
void *clientData, /* Channel to query */
void *clientData, /* Channel to query */
Tcl_Interp *interp, /* Interpreter to leave error messages in */
const char *optionName, /* Name of requested option */
const char *newValue) /* The new value */
@@ -1850,7 +1850,7 @@ ReflectSetOption(
static int
ReflectGetOption(
void *clientData, /* Channel to query */
void *clientData, /* Channel to query */
Tcl_Interp *interp, /* Interpreter to leave error messages in */
const char *optionName, /* Name of reuqested option */
Tcl_DString *dsPtr) /* String to place the result into */
@@ -2003,7 +2003,7 @@ ReflectGetOption(
static int
ReflectTruncate(
void *clientData, /* Channel to query */
void *clientData, /* Channel to query */
long long length) /* Length to truncate to. */
{
ReflectedChannel *rcPtr = (ReflectedChannel *)clientData;
@@ -2086,7 +2086,7 @@ EncodeEventMask(
int *mask)
{
int events; /* Mask of events to post */
Tcl_Size listc; /* #elements in eventspec list */
Tcl_Size listc; /* #elements in eventspec list */
Tcl_Obj **listv; /* Elements of eventspec list */
int evIndex; /* Id of event for an element of the eventspec
* list. */
@@ -2563,13 +2563,13 @@ MarkDead(
static void
DeleteReflectedChannelMap(
void *clientData, /* The per-interpreter data structure. */
void *clientData, /* The per-interpreter data structure. */
Tcl_Interp *interp) /* The interpreter being deleted. */
{
ReflectedChannelMap *rcmPtr = (ReflectedChannelMap *)clientData;
/* The map */
Tcl_HashSearch hSearch; /* Search variable. */
Tcl_HashEntry *hPtr; /* Search variable. */
Tcl_HashSearch hSearch; /* Search variable. */
Tcl_HashEntry *hPtr; /* Search variable. */
ReflectedChannel *rcPtr;
Tcl_Channel chan;
#if TCL_THREADS
+4 -4
View File
@@ -2106,8 +2106,8 @@ DeleteReflectedTransformMap(
Tcl_Interp *interp) /* The interpreter being deleted. */
{
ReflectedTransformMap *rtmPtr; /* The map */
Tcl_HashSearch hSearch; /* Search variable. */
Tcl_HashEntry *hPtr; /* Search variable. */
Tcl_HashSearch hSearch; /* Search variable. */
Tcl_HashEntry *hPtr; /* Search variable. */
ReflectedTransform *rtPtr;
#if TCL_THREADS
ForwardingResult *resultPtr;
@@ -2268,8 +2268,8 @@ static void
DeleteThreadReflectedTransformMap(
TCL_UNUSED(void *))
{
Tcl_HashSearch hSearch; /* Search variable. */
Tcl_HashEntry *hPtr; /* Search variable. */
Tcl_HashSearch hSearch; /* Search variable. */
Tcl_HashEntry *hPtr; /* Search variable. */
Tcl_ThreadId self = Tcl_GetCurrentThread();
ReflectedTransformMap *rtmPtr; /* The map */
ForwardingResult *resultPtr;
+10 -10
View File
@@ -208,8 +208,8 @@ TCL_DECLARE_MUTEX(filesystemMutex)
* A files-system indepent sense of the current directory.
*/
static Tcl_Obj *cwdPathPtr = NULL; /* The pathname of the current directory */
static size_t cwdPathEpoch = 0;
static Tcl_Obj *cwdPathPtr = NULL;
static size_t cwdPathEpoch = 0; /* The pathname of the current directory */
static void *cwdClientData = NULL;
TCL_DECLARE_MUTEX(cwdMutex)
@@ -1323,8 +1323,8 @@ TclFSNormalizeToUniquePath(
int startAt) /* Offset the string of pathPtr to start at.
* Must either be 0 or offset of a directory
* separator at the end of a pathname part that
* is already normalized, i.e. not the index of
* the byte just after the separator. */
* is already normalized, I.e. not the index of
* the byte just after the separator. */
{
FilesystemRecord *fsRecPtr, *firstFsRecPtr;
@@ -2447,7 +2447,7 @@ int
TclFSFileAttrIndex(
Tcl_Obj *pathPtr, /* Pathname of the file. */
const char *attributeName, /* The name of the attribute. */
Tcl_Size *indexPtr) /* A place to store the result. */
int *indexPtr) /* A place to store the result. */
{
Tcl_Obj *listObj = NULL;
const char *const *attrTable;
@@ -2912,7 +2912,7 @@ Tcl_FSChdir(
if (retVal == 0) {
/* Assume that the cwd was actually changed to the normalized value
* just calculated, and cache that information. */
* just calculated, and cache that information. */
/*
* If the filesystem epoch changed recently, the normalized pathname or
@@ -3311,7 +3311,7 @@ Tcl_LoadFile(
*/
{
Tcl_Size index;
int index;
Tcl_Obj *perm;
TclNewLiteralStringObj(perm, "0700");
@@ -3377,7 +3377,7 @@ Tcl_LoadFile(
tvdlPtr->unloadProcPtr = newUnloadProcPtr;
if (copyFsPtr != &tclNativeFilesystem) {
/* refCount of copyToPtr is already incremented. */
/* refCount of copyToPtr is already incremented. */
tvdlPtr->divertedFile = copyToPtr;
/*
@@ -4341,7 +4341,7 @@ Tcl_FSRemoveDirectory(
Tcl_Obj *pathPtr, /* The pathname of the directory to be removed. */
int recursive, /* If zero, removes only an empty directory.
* Otherwise, removes the directory and all its
* contents. */
* contents. */
Tcl_Obj **errorPtr) /* If not NULL and an error occurs, stores a
* place to store a pointer to a new
* object having a refCount of 1 and containing
@@ -4460,7 +4460,7 @@ Tcl_FSGetFileSystemForPath(
/* This is the filesystem for pathPtr. Assume the type of pathPtr
* hasn't been changed by the above call to the
* pathInFilesystemProc, and cache this result in the internal
* representation of pathPtr. */
* representation of pathPtr. */
TclFSSetPathDetails(pathPtr, fsRecPtr->fsPtr, clientData);
Disclaim();
+15 -14
View File
@@ -55,7 +55,7 @@ const Tcl_ObjType tclIndexType = {
typedef struct {
void *tablePtr; /* Pointer to the table of strings */
Tcl_Size offset; /* Offset between table entries */
Tcl_Size offset; /* Offset between table entries */
Tcl_Size index; /* Selected index into table. */
} IndexRep;
@@ -303,20 +303,20 @@ Tcl_GetIndexFromObjStruct(
flags &= (30-(int)(sizeof(int)<<1));
if (flags) {
if (flags == sizeof(uint16_t)<<1) {
*(uint16_t *)indexPtr = (uint16_t)index;
*(uint16_t *)indexPtr = index;
return TCL_OK;
} else if (flags == (int)(sizeof(uint8_t)<<1)) {
*(uint8_t *)indexPtr = (uint8_t)index;
*(uint8_t *)indexPtr = index;
return TCL_OK;
} else if (flags == (int)(sizeof(int64_t)<<1)) {
*(int64_t *)indexPtr = index;
return TCL_OK;
} else if (flags == (int)(sizeof(int32_t)<<1)) {
*(int32_t *)indexPtr = (int32_t)index;
*(int32_t *)indexPtr = index;
return TCL_OK;
}
}
*(int *)indexPtr = (int)index;
*(int *)indexPtr = index;
}
return TCL_OK;
@@ -388,8 +388,9 @@ UpdateStringOfIndex(
{
IndexRep *indexRep = (IndexRep *)TclFetchInternalRep(objPtr, &tclIndexType)->twoPtrValue.ptr1;
const char *indexStr = EXPAND_OF(indexRep);
size_t len = strlen(indexStr);
Tcl_InitStringRep(objPtr, indexStr, strlen(indexStr));
TclOOM(Tcl_InitStringRep(objPtr, indexStr, len), len+1);
}
/*
@@ -806,7 +807,7 @@ PrefixLongestObjCmd(
void
Tcl_WrongNumArgs(
Tcl_Interp *interp, /* Current interpreter. */
Tcl_Size objc, /* Number of arguments to print from objv. */
Tcl_Size objc, /* Number of arguments to print from objv. */
Tcl_Obj *const objv[], /* Initial argument objects, which should be
* included in the error message. */
const char *message) /* Error message to print after the leading
@@ -1009,13 +1010,13 @@ Tcl_ParseArgsObjv(
/* Descriptor that matches current argument */
Tcl_Obj *curArg; /* Current argument */
const char *str = NULL;
char c; /* Second character of current arg (used for
char c; /* Second character of current arg (used for
* quick check for matching; use 2nd char.
* because first char. will almost always be
* '-'). */
Tcl_Size srcIndex; /* Location from which to read next argument
Tcl_Size srcIndex; /* Location from which to read next argument
* from objv. */
Tcl_Size dstIndex; /* Used to keep track of current arguments
Tcl_Size dstIndex; /* Used to keep track of current arguments
* being processed, primarily for error
* reporting. */
Tcl_Size objc; /* # arguments in objv still to process. */
@@ -1107,7 +1108,7 @@ Tcl_ParseArgsObjv(
infoPtr = matchPtr;
switch (infoPtr->type) {
case TCL_ARGV_CONSTANT:
*((int *)infoPtr->dstPtr) = (int)PTR2INT(infoPtr->srcPtr);
*((int *) infoPtr->dstPtr) = PTR2INT(infoPtr->srcPtr);
break;
case TCL_ARGV_INT:
if (objc == 0) {
@@ -1139,7 +1140,7 @@ Tcl_ParseArgsObjv(
*/
if (infoPtr->dstPtr != NULL) {
*((int *)infoPtr->dstPtr) = (int)dstIndex;
*((int *) infoPtr->dstPtr) = dstIndex;
}
goto argsDone;
case TCL_ARGV_FLOAT:
@@ -1147,7 +1148,7 @@ Tcl_ParseArgsObjv(
goto missingArg;
}
if (Tcl_GetDoubleFromObj(interp, objv[srcIndex],
(double *)infoPtr->dstPtr) == TCL_ERROR) {
(double *) infoPtr->dstPtr) == TCL_ERROR) {
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"expected floating-point argument for \"%s\" but got \"%s\"",
infoPtr->keyStr, TclGetString(objv[srcIndex])));
@@ -1268,7 +1269,7 @@ PrintUsage(
* descriptions. */
{
const Tcl_ArgvInfo *infoPtr;
Tcl_Size width, numSpaces;
int width, numSpaces;
#define NUM_SPACES 20
static const char spaces[] = " ";
Tcl_Obj *msg;
+11 -3
View File
@@ -158,12 +158,17 @@ declare 61 {
declare 62 {
int TclObjCommandComplete(Tcl_Obj *cmdPtr)
}
# Removed in 9.0:
#declare 63 {
# int TclObjInterpProc(void *clientData, Tcl_Interp *interp,
# Tcl_Size objc, Tcl_Obj *const objv[])
#}
declare 64 {
int TclObjInvoke(Tcl_Interp *interp, Tcl_Size objc, Tcl_Obj *const objv[],
int flags)
}
declare 69 {
void *TclpAlloc(size_t size)
void *TclpAlloc(TCL_HASH_TYPE size)
}
declare 74 {
void TclpFree(void *ptr)
@@ -179,7 +184,7 @@ declare 76 {
# void TclpGetTime(Tcl_Time *time)
#}
declare 81 {
void *TclpRealloc(void *ptr, size_t size)
void *TclpRealloc(void *ptr, TCL_HASH_TYPE size)
}
# Removed in 9.0:
#declare 88 {
@@ -460,7 +465,7 @@ declare 214 {
void TclSetObjNameOfExecutable(Tcl_Obj *name, Tcl_Encoding encoding)
}
declare 215 {
void *TclStackAlloc(Tcl_Interp *interp, size_t numBytes)
void *TclStackAlloc(Tcl_Interp *interp, TCL_HASH_TYPE numBytes)
}
declare 216 {
void TclStackFree(Tcl_Interp *interp, void *freePtr)
@@ -678,6 +683,9 @@ declare 8 {
declare 9 {
TclFile TclpCreateTempFile(const char *contents)
}
declare 10 {
Tcl_Encoding TclWinGetUserEncoding(Tcl_Interp *interp)
}
declare 11 {
void TclGetAndDetachPids(Tcl_Interp *interp, Tcl_Channel chan)
}
+86 -36
View File
@@ -218,8 +218,10 @@ typedef struct NamespacePathEntry NamespacePathEntry;
typedef struct TclVarHashTable {
Tcl_HashTable table; /* "Inherit" from Tcl_HashTable. */
struct Namespace *nsPtr; /* The namespace containing the variables. */
#if TCL_MAJOR_VERSION > 8
struct Var *arrayPtr; /* The array containing the variables, if they
* are variables in an array at all. */
#endif /* TCL_MAJOR_VERSION > 8 */
} TclVarHashTable;
/*
@@ -262,7 +264,11 @@ typedef struct Namespace {
* strings; values have type (Namespace *). If
* NULL, there are no children. */
#endif
#if TCL_MAJOR_VERSION > 8
size_t nsId; /* Unique id for the namespace. */
#else
unsigned long nsId;
#endif
Tcl_Interp *interp; /* The interpreter containing this
* namespace. */
int flags; /* OR-ed combination of the namespace status
@@ -961,6 +967,9 @@ typedef struct CompiledLocal {
* Among others used to speed up var lookups. */
Tcl_Size frameIndex; /* Index in the array of compiler-assigned
* variables in the procedure call frame. */
#if TCL_MAJOR_VERSION < 9
int flags;
#endif
Tcl_Obj *defValuePtr; /* Pointer to the default value of an
* argument, if any. NULL if not an argument
* or, if an argument, no default value. */
@@ -971,10 +980,12 @@ typedef struct CompiledLocal {
* is marked by a unique tag during
* compilation, and that same tag is used to
* find the variable at runtime. */
#if TCL_MAJOR_VERSION > 8
int flags; /* Flag bits for the local variable. Same as
* the flags for the Var structure above,
* although only VAR_ARGUMENT, VAR_TEMPORARY,
* and VAR_RESOLVED make sense. */
#endif
char name[TCLFLEXARRAY]; /* Name of the local variable starts here. If
* the name is NULL, this will just be '\0'.
* The actual size of this field will be large
@@ -1032,7 +1043,11 @@ typedef void (ProcErrorProc)(Tcl_Interp *interp, Tcl_Obj *procNameObj);
typedef struct Trace {
Tcl_Size level; /* Only trace commands at nesting level less
* than or equal to this. */
#if TCL_MAJOR_VERSION > 8
Tcl_CmdObjTraceProc2 *proc; /* Procedure to call to trace command. */
#else
Tcl_CmdObjTraceProc *proc; /* Procedure to call to trace command. */
#endif
void *clientData; /* Arbitrary value to pass to proc. */
struct Trace *nextPtr; /* Next in list of traces for this interp. */
int flags; /* Flags governing the trace - see
@@ -1076,6 +1091,7 @@ typedef struct ActiveInterpTrace {
#define TCL_TRACE_ENTER_EXEC 1
#define TCL_TRACE_LEAVE_EXEC 2
#if TCL_MAJOR_VERSION > 8
#define TclObjTypeHasProc(objPtr, proc) (((objPtr)->typePtr \
&& ((offsetof(Tcl_ObjType, proc) < offsetof(Tcl_ObjType, version)) \
|| (offsetof(Tcl_ObjType, proc) < (objPtr)->typePtr->version))) ? \
@@ -1177,6 +1193,7 @@ TclObjTypeInOperator(
Tcl_ObjTypeInOperatorProc *proc = TclObjTypeHasProc(listObj, inOperProc);
return proc(interp, valueObj, listObj, boolResult);
}
#endif /* TCL_MAJOR_VERSION > 8 */
/*
* The structure below defines an entry in the assocData hash table which is
@@ -1320,7 +1337,7 @@ typedef struct CmdFrame {
int type; /* Values see below. */
int level; /* Number of frames in stack, prevent O(n)
* scan of list. */
int *line; /* Lines the words of the command start on. */
Tcl_Size *line; /* Lines the words of the command start on. */
Tcl_Size nline; /* Number of lines in CmdFrame.line. */
CallFrame *framePtr; /* Procedure activation record, may be
* NULL. */
@@ -1415,7 +1432,7 @@ typedef struct CFWordBC {
typedef struct ContLineLoc {
Tcl_Size num; /* Number of entries in loc, not counting the
* final -1 marker entry. */
Tcl_Size loc[TCLFLEXARRAY]; /* Table of locations, as character offsets.
Tcl_Size loc[TCLFLEXARRAY];/* Table of locations, as character offsets.
* The table is allocated as part of the
* structure, extending behind the nominal end
* of the structure. An entry containing the
@@ -1671,13 +1688,13 @@ typedef struct LiteralTable {
LiteralEntry *staticBuckets[TCL_SMALL_HASH_TABLE];
/* Bucket array used for small tables to avoid
* mallocs and frees. */
size_t numBuckets; /* Total number of buckets allocated at
TCL_HASH_TYPE numBuckets; /* Total number of buckets allocated at
* **buckets. */
size_t numEntries; /* Total number of entries present in
TCL_HASH_TYPE numEntries; /* Total number of entries present in
* table. */
size_t rebuildSize; /* Enlarge table when numEntries gets to be
TCL_HASH_TYPE rebuildSize; /* Enlarge table when numEntries gets to be
* this large. */
size_t mask; /* Mask value used in hashing function. */
TCL_HASH_TYPE mask; /* Mask value used in hashing function. */
} LiteralTable;
/*
@@ -1971,9 +1988,20 @@ typedef struct Interp {
void *interpInfo; /* Information used by tclInterp.c to keep
* track of parent/child interps on a
* per-interp basis. */
#if TCL_MAJOR_VERSION > 8
void (*optimizer)(void *envPtr);
/* Reference to the bytecode optimizer, if one
* is set. */
#else
union {
void (*optimizer)(void *envPtr);
Tcl_HashTable unused2; /* No longer used (was mathFuncTable). The
* unused space in interp was repurposed for
* pluggable bytecode optimizers. The core
* contains one optimizer, which can be
* selectively overridden by extensions. */
} extra;
#endif
/*
* Information related to procedures and variables. See tclProc.c and
* tclVar.c for usage.
@@ -2002,6 +2030,11 @@ typedef struct Interp {
Namespace *lookupNsPtr; /* Namespace to use ONLY on the next
* TCL_EVAL_INVOKE call to Tcl_EvalObjv. */
#if TCL_MAJOR_VERSION < 9
char *appendResultDontUse;
int appendAvlDontUse;
int appendUsedDontUse;
#endif
/*
* Information about packages. Used only in tclPkg.c.
@@ -2025,6 +2058,9 @@ typedef struct Interp {
* Normally zero, but may be set before
* calling Tcl_Eval. See below for valid
* values. */
#if TCL_MAJOR_VERSION < 9
int unused1; /* No longer used (was termOffset) */
#endif
LiteralTable literalTable; /* Contains LiteralEntry's describing all Tcl
* objects holding literals of scripts
* compiled by the interpreter. Indexed by the
@@ -2061,6 +2097,9 @@ typedef struct Interp {
* string. Returned by Tcl_ObjSetVar2 when
* variable traces change a variable in a
* gross way. */
#if TCL_MAJOR_VERSION < 9
char resultSpaceDontUse[TCL_DSTRING_STATIC_SIZE+1];
#endif
Tcl_Obj *objResultPtr; /* If the last command returned an object
* result, this points to it. Should not be
* accessed directly; see comment above. */
@@ -2168,7 +2207,7 @@ typedef struct Interp {
* invoking context of the bytecode compiler.
* NULL when the byte code compiler is not
* active. */
Tcl_Size invokeWord; /* Index of the word in the command which
int invokeWord; /* Index of the word in the command which
* is getting compiled. */
Tcl_HashTable *linePBodyPtr;/* This table remembers for each statically
* defined procedure the location information
@@ -2428,7 +2467,7 @@ typedef struct Interp {
#if defined(__APPLE__)
#define TCL_ALLOCALIGN 16
#else
#define TCL_ALLOCALIGN (2*(int)sizeof(void *))
#define TCL_ALLOCALIGN (2*sizeof(void *))
#endif
/*
@@ -2724,11 +2763,20 @@ typedef struct ListRep {
* WARNING: these macros eval their args more than once.
*/
#if TCL_MAJOR_VERSION > 8
#define TclGetBooleanFromObj(interp, objPtr, intPtr) \
((TclHasInternalRep((objPtr), &tclIntType) \
|| TclHasInternalRep((objPtr), &tclBooleanType)) \
? (*(intPtr) = ((objPtr)->internalRep.wideValue!=0), TCL_OK) \
: Tcl_GetBooleanFromObj((interp), (objPtr), (intPtr)))
#else
#define TclGetBooleanFromObj(interp, objPtr, intPtr) \
((TclHasInternalRep((objPtr), &tclIntType)) \
? (*(intPtr) = ((objPtr)->internalRep.wideValue!=0), TCL_OK) \
: (TclHasInternalRep((objPtr), &tclBooleanType)) \
? (*(intPtr) = ((objPtr)->internalRep.longValue!=0), TCL_OK) \
: Tcl_GetBooleanFromObj((interp), (objPtr), (intPtr)))
#endif
#ifdef TCL_WIDE_INT_IS_LONG
#define TclGetLongFromObj(interp, objPtr, longPtr) \
@@ -2866,7 +2914,7 @@ typedef Tcl_Channel (TclOpenFileChannelProc_)(Tcl_Interp *interp,
*/
typedef void (TclInitProcessGlobalValueProc)(char **valuePtr,
size_t *lengthPtr,
TCL_HASH_TYPE *lengthPtr,
Tcl_Encoding *encodingPtr);
#ifdef _WIN32
@@ -2888,7 +2936,7 @@ typedef void (TclInitProcessGlobalValueProc)(char **valuePtr,
typedef struct ProcessGlobalValue {
Tcl_Size epoch; /* Epoch counter to detect changes in the
* global value. */
size_t numBytes; /* Length of the global string. */
TCL_HASH_TYPE numBytes; /* Length of the global string. */
char *value; /* The global string value. */
Tcl_Encoding encoding; /* system encoding when global string was
* initialized. */
@@ -3228,9 +3276,10 @@ struct Tcl_LoadHandle_ {
*----------------------------------------------------------------
*/
MODULE_SCOPE void TclAdvanceContinuations(int *line, Tcl_Size **next,
Tcl_Size loc);
MODULE_SCOPE void TclAdvanceLines(int *line, const char *start,
#if TCL_MAJOR_VERSION > 8
MODULE_SCOPE void TclAdvanceContinuations(Tcl_Size *line, Tcl_Size **next,
int loc);
MODULE_SCOPE void TclAdvanceLines(Tcl_Size *line, const char *start,
const char *end);
MODULE_SCOPE void TclAppendBytesToByteArray(Tcl_Obj *objPtr,
const unsigned char *bytes, Tcl_Size len);
@@ -3260,7 +3309,7 @@ MODULE_SCOPE void TclChannelPreserve(Tcl_Channel chan);
MODULE_SCOPE void TclChannelRelease(Tcl_Channel chan);
MODULE_SCOPE int TclChannelGetBlockingMode(Tcl_Channel chan);
MODULE_SCOPE int TclCheckArrayTraces(Tcl_Interp *interp, Var *varPtr,
Var *arrayPtr, Tcl_Obj *name, Tcl_Size index);
Var *arrayPtr, Tcl_Obj *name, int index);
MODULE_SCOPE int TclCheckEmptyString(Tcl_Obj *objPtr);
MODULE_SCOPE int TclChanCaughtErrorBypass(Tcl_Interp *interp,
Tcl_Channel chan);
@@ -3303,7 +3352,7 @@ MODULE_SCOPE int TclDictRemove(Tcl_Interp *interp, Tcl_Obj *dictPtr,
const char *key);
/* TIP #280 - Modified token based evaluation, with line information. */
MODULE_SCOPE int TclEvalEx(Tcl_Interp *interp, const char *script,
Tcl_Size numBytes, int flags, int line,
Tcl_Size numBytes, int flags, Tcl_Size line,
Tcl_Size *clNextOuter, const char *outerScript);
MODULE_SCOPE Tcl_ObjCmdProc TclFileAttrsCmd;
MODULE_SCOPE Tcl_ObjCmdProc TclFileCopyCmd;
@@ -3355,7 +3404,7 @@ MODULE_SCOPE void TclFinalizeThreadObjects(void);
MODULE_SCOPE double TclFloor(const void *a);
MODULE_SCOPE void TclFormatNaN(double value, char *buffer);
MODULE_SCOPE int TclFSFileAttrIndex(Tcl_Obj *pathPtr,
const char *attributeName, Tcl_Size *indexPtr);
const char *attributeName, int *indexPtr);
MODULE_SCOPE Tcl_Command TclNRCreateCommandInNs(Tcl_Interp *interp,
const char *cmdName, Tcl_Namespace *nsPtr,
Tcl_ObjCmdProc *proc, Tcl_ObjCmdProc *nreProc,
@@ -3423,8 +3472,8 @@ MODULE_SCOPE Tcl_Obj * TclLindexFlat(Tcl_Interp *interp, Tcl_Obj *listPtr,
Tcl_Size indexCount, Tcl_Obj *const indexArray[]);
MODULE_SCOPE Tcl_Obj * TclListObjGetElement(Tcl_Obj *listObj, Tcl_Size index);
/* TIP #280 */
MODULE_SCOPE void TclListLines(Tcl_Obj *listObj, int line, Tcl_Size n,
int *lines, Tcl_Obj *const *elems);
MODULE_SCOPE void TclListLines(Tcl_Obj *listObj, Tcl_Size line, Tcl_Size n,
Tcl_Size *lines, Tcl_Obj *const *elems);
MODULE_SCOPE Tcl_Obj * TclListObjCopy(Tcl_Interp *interp, Tcl_Obj *listPtr);
MODULE_SCOPE int TclListObjAppendElements(Tcl_Interp *interp,
Tcl_Obj *toObj, Tcl_Size elemCount,
@@ -3440,7 +3489,7 @@ MODULE_SCOPE Tcl_Command TclMakeEnsemble(Tcl_Interp *interp, const char *name,
const EnsembleImplMap map[]);
MODULE_SCOPE Tcl_Size TclMaxListLength(const char *bytes, Tcl_Size numBytes,
const char **endPtr);
MODULE_SCOPE int TclMergeReturnOptions(Tcl_Interp *interp, Tcl_Size objc,
MODULE_SCOPE int TclMergeReturnOptions(Tcl_Interp *interp, int objc,
Tcl_Obj *const objv[], Tcl_Obj **optionsPtrPtr,
int *codePtr, int *levelPtr);
MODULE_SCOPE Tcl_Obj * TclNoErrorStack(Tcl_Interp *interp, Tcl_Obj *options);
@@ -3449,13 +3498,13 @@ MODULE_SCOPE void TclNsDecrRefCount(Namespace *nsPtr);
MODULE_SCOPE int TclNamespaceDeleted(Namespace *nsPtr);
MODULE_SCOPE void TclObjVarErrMsg(Tcl_Interp *interp, Tcl_Obj *part1Ptr,
Tcl_Obj *part2Ptr, const char *operation,
const char *reason, Tcl_Size index);
const char *reason, int index);
MODULE_SCOPE int TclObjInvokeNamespace(Tcl_Interp *interp,
Tcl_Size objc, Tcl_Obj *const objv[],
Tcl_Namespace *nsPtr, int flags);
MODULE_SCOPE int TclObjUnsetVar2(Tcl_Interp *interp,
Tcl_Obj *part1Ptr, Tcl_Obj *part2Ptr, int flags);
MODULE_SCOPE Tcl_Size TclParseBackslash(const char *src,
MODULE_SCOPE int TclParseBackslash(const char *src,
Tcl_Size numBytes, Tcl_Size *readPtr, char *dst);
MODULE_SCOPE int TclParseNumber(Tcl_Interp *interp, Tcl_Obj *objPtr,
const char *expected, const char *bytes,
@@ -3502,10 +3551,10 @@ MODULE_SCOPE int TclCreateSocketAddress(Tcl_Interp *interp,
const char **errorMsgPtr);
MODULE_SCOPE int TclpThreadCreate(Tcl_ThreadId *idPtr,
Tcl_ThreadCreateProc *proc, void *clientData,
size_t stackSize, int flags);
TCL_HASH_TYPE stackSize, int flags);
MODULE_SCOPE Tcl_Size TclpFindVariable(const char *name, Tcl_Size *lengthPtr);
MODULE_SCOPE void TclpInitLibraryPath(char **valuePtr,
size_t *lengthPtr, Tcl_Encoding *encodingPtr);
TCL_HASH_TYPE *lengthPtr, Tcl_Encoding *encodingPtr);
MODULE_SCOPE void TclpInitLock(void);
MODULE_SCOPE void * TclpInitNotifier(void);
MODULE_SCOPE void TclpInitPlatform(void);
@@ -3569,7 +3618,7 @@ MODULE_SCOPE void TclSpellFix(Tcl_Interp *interp,
Tcl_Obj *const *objv, Tcl_Size objc, Tcl_Size subIdx,
Tcl_Obj *bad, Tcl_Obj *fix);
MODULE_SCOPE void * TclStackRealloc(Tcl_Interp *interp, void *ptr,
size_t numBytes);
TCL_HASH_TYPE numBytes);
typedef int (*memCmpFn_t)(const void*, const void*, size_t);
MODULE_SCOPE int TclStringCmp(Tcl_Obj *value1Ptr, Tcl_Obj *value2Ptr,
int checkEq, int nocase, Tcl_Size reqlength);
@@ -3578,7 +3627,7 @@ MODULE_SCOPE int TclStringMatch(const char *str, Tcl_Size strLen,
MODULE_SCOPE int TclStringMatchObj(Tcl_Obj *stringObj,
Tcl_Obj *patternObj, int flags);
MODULE_SCOPE void TclSubstCompile(Tcl_Interp *interp, const char *bytes,
Tcl_Size numBytes, int flags, int line,
Tcl_Size numBytes, int flags, Tcl_Size line,
struct CompileEnv *envPtr);
MODULE_SCOPE int TclSubstOptions(Tcl_Interp *interp, Tcl_Size numOpts,
Tcl_Obj *const opts[], int *flagPtr);
@@ -3586,7 +3635,7 @@ MODULE_SCOPE void TclSubstParse(Tcl_Interp *interp, const char *bytes,
Tcl_Size numBytes, int flags, Tcl_Parse *parsePtr,
Tcl_InterpState *statePtr);
MODULE_SCOPE int TclSubstTokens(Tcl_Interp *interp, Tcl_Token *tokenPtr,
Tcl_Size count, Tcl_Size *tokensLeftPtr, int line,
Tcl_Size count, int *tokensLeftPtr, Tcl_Size line,
Tcl_Size *clNextOuter, const char *outerScript);
MODULE_SCOPE Tcl_Size TclTrim(const char *bytes, Tcl_Size numBytes,
const char *trim, Tcl_Size numTrim,
@@ -3690,7 +3739,7 @@ MODULE_SCOPE Tcl_ObjCmdProc TclDefaultBgErrorHandlerObjCmd;
MODULE_SCOPE Tcl_Command TclInitDictCmd(Tcl_Interp *interp);
MODULE_SCOPE int TclDictWithFinish(Tcl_Interp *interp, Var *varPtr,
Var *arrayPtr, Tcl_Obj *part1Ptr,
Tcl_Obj *part2Ptr, Tcl_Size index, Tcl_Size pathc,
Tcl_Obj *part2Ptr, int index, int pathc,
Tcl_Obj *const pathv[], Tcl_Obj *keysPtr);
MODULE_SCOPE Tcl_Obj * TclDictWithInit(Tcl_Interp *interp, Tcl_Obj *dictPtr,
Tcl_Size pathc, Tcl_Obj *const pathv[]);
@@ -3981,25 +4030,25 @@ MODULE_SCOPE Var * TclLookupArrayElement(Tcl_Interp *interp,
Tcl_Obj *arrayNamePtr, Tcl_Obj *elNamePtr,
int flags, const char *msg,
int createPart1, int createPart2,
Var *arrayPtr, Tcl_Size index);
Var *arrayPtr, int index);
MODULE_SCOPE Tcl_Obj * TclPtrGetVarIdx(Tcl_Interp *interp,
Var *varPtr, Var *arrayPtr, Tcl_Obj *part1Ptr,
Tcl_Obj *part2Ptr, int flags, Tcl_Size index);
Tcl_Obj *part2Ptr, int flags, int index);
MODULE_SCOPE Tcl_Obj * TclPtrSetVarIdx(Tcl_Interp *interp,
Var *varPtr, Var *arrayPtr, Tcl_Obj *part1Ptr,
Tcl_Obj *part2Ptr, Tcl_Obj *newValuePtr,
int flags, Tcl_Size index);
int flags, int index);
MODULE_SCOPE Tcl_Obj * TclPtrIncrObjVarIdx(Tcl_Interp *interp,
Var *varPtr, Var *arrayPtr, Tcl_Obj *part1Ptr,
Tcl_Obj *part2Ptr, Tcl_Obj *incrPtr,
int flags, Tcl_Size index);
int flags, int index);
MODULE_SCOPE int TclPtrObjMakeUpvarIdx(Tcl_Interp *interp,
Var *otherPtr, Tcl_Obj *myNamePtr, int myFlags,
Tcl_Size index);
int index);
MODULE_SCOPE int TclPtrUnsetVarIdx(Tcl_Interp *interp, Var *varPtr,
Var *arrayPtr, Tcl_Obj *part1Ptr,
Tcl_Obj *part2Ptr, int flags,
Tcl_Size index);
int index);
MODULE_SCOPE void TclInvalidateNsPath(Namespace *nsPtr);
MODULE_SCOPE void TclFindArrayPtrElements(Var *arrayPtr,
Tcl_HashTable *tablePtr);
@@ -4010,7 +4059,7 @@ MODULE_SCOPE void TclFindArrayPtrElements(Var *arrayPtr,
MODULE_SCOPE int TclObjCallVarTraces(Interp *iPtr, Var *arrayPtr,
Var *varPtr, Tcl_Obj *part1Ptr, Tcl_Obj *part2Ptr,
int flags, int leaveErrMsg, Tcl_Size index);
int flags, int leaveErrMsg, int index);
/*
* So tclObj.c and tclDictObj.c can share these implementations.
@@ -4018,7 +4067,7 @@ MODULE_SCOPE int TclObjCallVarTraces(Interp *iPtr, Var *arrayPtr,
MODULE_SCOPE int TclCompareObjKeys(void *keyPtr, Tcl_HashEntry *hPtr);
MODULE_SCOPE void TclFreeObjEntry(Tcl_HashEntry *hPtr);
MODULE_SCOPE size_t TclHashObjKey(Tcl_HashTable *tablePtr, void *keyPtr);
MODULE_SCOPE TCL_HASH_TYPE TclHashObjKey(Tcl_HashTable *tablePtr, void *keyPtr);
MODULE_SCOPE int TclFullFinalizationRequested(void);
@@ -4094,6 +4143,7 @@ MODULE_SCOPE Tcl_Size TclIndexDecode(int encoded, Tcl_Size endValue);
MODULE_SCOPE int TclCommandWordLimitError(Tcl_Interp *interp,
Tcl_Size count);
#endif /* TCL_MAJOR_VERSION > 8 */
/* Constants used in index value encoding routines. */
#define TCL_INDEX_END ((Tcl_Size)-2)
@@ -4496,7 +4546,7 @@ MODULE_SCOPE const TclFileAttrProcs tclpFileAttrProcs[];
do { \
Tcl_Obj *bignumObj = (objPtr); \
int bignumPayload = \
(int)PTR2INT(bignumObj->internalRep.twoPtrValue.ptr2); \
PTR2INT(bignumObj->internalRep.twoPtrValue.ptr2); \
if (bignumPayload == -1) { \
(bignum) = *((mp_int *) bignumObj->internalRep.twoPtrValue.ptr1); \
} else { \
+18 -6
View File
@@ -171,7 +171,7 @@ EXTERN int TclObjInvoke(Tcl_Interp *interp, Tcl_Size objc,
/* Slot 67 is reserved */
/* Slot 68 is reserved */
/* 69 */
EXTERN void * TclpAlloc(size_t size);
EXTERN void * TclpAlloc(TCL_HASH_TYPE size);
/* Slot 70 is reserved */
/* Slot 71 is reserved */
/* Slot 72 is reserved */
@@ -187,7 +187,7 @@ EXTERN unsigned long long TclpGetSeconds(void);
/* Slot 79 is reserved */
/* Slot 80 is reserved */
/* 81 */
EXTERN void * TclpRealloc(void *ptr, size_t size);
EXTERN void * TclpRealloc(void *ptr, TCL_HASH_TYPE size);
/* Slot 82 is reserved */
/* Slot 83 is reserved */
/* Slot 84 is reserved */
@@ -440,7 +440,8 @@ EXTERN Tcl_Obj * TclGetObjNameOfExecutable(void);
EXTERN void TclSetObjNameOfExecutable(Tcl_Obj *name,
Tcl_Encoding encoding);
/* 215 */
EXTERN void * TclStackAlloc(Tcl_Interp *interp, size_t numBytes);
EXTERN void * TclStackAlloc(Tcl_Interp *interp,
TCL_HASH_TYPE numBytes);
/* 216 */
EXTERN void TclStackFree(Tcl_Interp *interp, void *freePtr);
/* 217 */
@@ -648,7 +649,7 @@ typedef struct TclIntStubs {
void (*reserved66)(void);
void (*reserved67)(void);
void (*reserved68)(void);
void * (*tclpAlloc) (size_t size); /* 69 */
void * (*tclpAlloc) (TCL_HASH_TYPE size); /* 69 */
void (*reserved70)(void);
void (*reserved71)(void);
void (*reserved72)(void);
@@ -660,7 +661,7 @@ typedef struct TclIntStubs {
void (*reserved78)(void);
void (*reserved79)(void);
void (*reserved80)(void);
void * (*tclpRealloc) (void *ptr, size_t size); /* 81 */
void * (*tclpRealloc) (void *ptr, TCL_HASH_TYPE size); /* 81 */
void (*reserved82)(void);
void (*reserved83)(void);
void (*reserved84)(void);
@@ -794,7 +795,7 @@ typedef struct TclIntStubs {
void (*tclpFindExecutable) (const char *argv0); /* 212 */
Tcl_Obj * (*tclGetObjNameOfExecutable) (void); /* 213 */
void (*tclSetObjNameOfExecutable) (Tcl_Obj *name, Tcl_Encoding encoding); /* 214 */
void * (*tclStackAlloc) (Tcl_Interp *interp, size_t numBytes); /* 215 */
void * (*tclStackAlloc) (Tcl_Interp *interp, TCL_HASH_TYPE numBytes); /* 215 */
void (*tclStackFree) (Tcl_Interp *interp, void *freePtr); /* 216 */
int (*tclPushStackFrame) (Tcl_Interp *interp, Tcl_CallFrame **framePtrPtr, Tcl_Namespace *namespacePtr, int isProcCallFrame); /* 217 */
void (*tclPopStackFrame) (Tcl_Interp *interp); /* 218 */
@@ -1268,6 +1269,17 @@ extern const TclIntStubs *tclIntStubsPtr;
(tclIntStubsPtr->tclStaticLibrary)
#endif /* defined(USE_TCL_STUBS) */
#if (TCL_MAJOR_VERSION < 9) && defined(USE_TCL_STUBS)
#undef TclpGetClicks
#define TclpGetClicks() \
((unsigned long)tclIntStubsPtr->tclpGetClicks())
#undef TclpGetSeconds
#define TclpGetSeconds() \
((unsigned long)tclIntStubsPtr->tclpGetSeconds())
#undef TclGetObjInterpProc2
#define TclGetObjInterpProc2 TclGetObjInterpProc
#endif
#undef TclUnusedStubEntry
#define TclObjInterpProc TclGetObjInterpProc()
#define TclObjInterpProc2 TclGetObjInterpProc2()
+500 -3
View File
@@ -30,6 +30,492 @@
* in the generic/tclInt.decls script.
*/
#if TCL_MAJOR_VERSION < 9
#ifdef __cplusplus
extern "C" {
#endif
/*
* Exported function declarations:
*/
#if !defined(_WIN32) && !defined(__CYGWIN__) && !defined(MAC_OSX_TCL) /* UNIX */
/* 0 */
EXTERN void TclGetAndDetachPids(Tcl_Interp *interp,
Tcl_Channel chan);
/* 1 */
EXTERN int TclpCloseFile(TclFile file);
/* 2 */
EXTERN Tcl_Channel TclpCreateCommandChannel(TclFile readFile,
TclFile writeFile, TclFile errorFile,
int numPids, Tcl_Pid *pidPtr);
/* 3 */
EXTERN int TclpCreatePipe(TclFile *readPipe, TclFile *writePipe);
/* 4 */
EXTERN int TclpCreateProcess(Tcl_Interp *interp, int argc,
const char **argv, TclFile inputFile,
TclFile outputFile, TclFile errorFile,
Tcl_Pid *pidPtr);
/* Slot 5 is reserved */
/* 6 */
EXTERN TclFile TclpMakeFile(Tcl_Channel channel, int direction);
/* 7 */
EXTERN TclFile TclpOpenFile(const char *fname, int mode);
/* 8 */
EXTERN int TclUnixWaitForFile(int fd, int mask, int timeout);
/* 9 */
EXTERN TclFile TclpCreateTempFile(const char *contents);
/* 10 */
EXTERN Tcl_DirEntry * TclpReaddir(TclDIR *dir);
/* Slot 11 is reserved */
/* Slot 12 is reserved */
/* Slot 13 is reserved */
/* 14 */
EXTERN int TclUnixCopyFile(const char *src, const char *dst,
const Tcl_StatBuf *statBufPtr,
int dontCopyAtts);
/* 15 */
EXTERN int TclMacOSXGetFileAttribute(Tcl_Interp *interp,
int objIndex, Tcl_Obj *fileName,
Tcl_Obj **attributePtrPtr);
/* 16 */
EXTERN int TclMacOSXSetFileAttribute(Tcl_Interp *interp,
int objIndex, Tcl_Obj *fileName,
Tcl_Obj *attributePtr);
/* 17 */
EXTERN int TclMacOSXCopyFileAttributes(const char *src,
const char *dst,
const Tcl_StatBuf *statBufPtr);
/* 18 */
EXTERN int TclMacOSXMatchType(Tcl_Interp *interp,
const char *pathName, const char *fileName,
Tcl_StatBuf *statBufPtr,
Tcl_GlobTypeData *types);
/* 19 */
EXTERN void TclMacOSXNotifierAddRunLoopMode(
const void *runLoopMode);
/* Slot 20 is reserved */
/* Slot 21 is reserved */
/* Slot 22 is reserved */
/* Slot 23 is reserved */
/* Slot 24 is reserved */
/* Slot 25 is reserved */
/* Slot 26 is reserved */
/* Slot 27 is reserved */
/* Slot 28 is reserved */
/* 29 */
EXTERN int TclWinCPUID(int index, int *regs);
/* 30 */
EXTERN int TclUnixOpenTemporaryFile(Tcl_Obj *dirObj,
Tcl_Obj *basenameObj, Tcl_Obj *extensionObj,
Tcl_Obj *resultingNameObj);
#endif /* UNIX */
#if defined(_WIN32) || defined(__CYGWIN__) /* WIN */
/* Slot 0 is reserved */
/* Slot 1 is reserved */
/* Slot 2 is reserved */
/* Slot 3 is reserved */
/* 4 */
EXTERN void * TclWinGetTclInstance(void);
/* 5 */
EXTERN int TclUnixWaitForFile(int fd, int mask, int timeout);
/* Slot 6 is reserved */
/* Slot 7 is reserved */
/* 8 */
EXTERN Tcl_Size TclpGetPid(Tcl_Pid pid);
/* Slot 9 is reserved */
/* Slot 10 is reserved */
/* 11 */
EXTERN void TclGetAndDetachPids(Tcl_Interp *interp,
Tcl_Channel chan);
/* 12 */
EXTERN int TclpCloseFile(TclFile file);
/* 13 */
EXTERN Tcl_Channel TclpCreateCommandChannel(TclFile readFile,
TclFile writeFile, TclFile errorFile,
int numPids, Tcl_Pid *pidPtr);
/* 14 */
EXTERN int TclpCreatePipe(TclFile *readPipe, TclFile *writePipe);
/* 15 */
EXTERN int TclpCreateProcess(Tcl_Interp *interp, int argc,
const char **argv, TclFile inputFile,
TclFile outputFile, TclFile errorFile,
Tcl_Pid *pidPtr);
/* 16 */
EXTERN int TclpIsAtty(int fd);
/* 17 */
EXTERN int TclUnixCopyFile(const char *src, const char *dst,
const Tcl_StatBuf *statBufPtr,
int dontCopyAtts);
/* 18 */
EXTERN TclFile TclpMakeFile(Tcl_Channel channel, int direction);
/* 19 */
EXTERN TclFile TclpOpenFile(const char *fname, int mode);
/* 20 */
EXTERN void TclWinAddProcess(void *hProcess, Tcl_Size id);
/* Slot 21 is reserved */
/* 22 */
EXTERN TclFile TclpCreateTempFile(const char *contents);
/* Slot 23 is reserved */
/* 24 */
EXTERN char * TclWinNoBackslash(char *path);
/* Slot 25 is reserved */
/* Slot 26 is reserved */
/* 27 */
EXTERN void TclWinFlushDirtyChannels(void);
/* Slot 28 is reserved */
/* 29 */
EXTERN int TclWinCPUID(int index, int *regs);
/* 30 */
EXTERN int TclUnixOpenTemporaryFile(Tcl_Obj *dirObj,
Tcl_Obj *basenameObj, Tcl_Obj *extensionObj,
Tcl_Obj *resultingNameObj);
#endif /* WIN */
#ifdef MAC_OSX_TCL /* MACOSX */
/* 0 */
EXTERN void TclGetAndDetachPids(Tcl_Interp *interp,
Tcl_Channel chan);
/* 1 */
EXTERN int TclpCloseFile(TclFile file);
/* 2 */
EXTERN Tcl_Channel TclpCreateCommandChannel(TclFile readFile,
TclFile writeFile, TclFile errorFile,
int numPids, Tcl_Pid *pidPtr);
/* 3 */
EXTERN int TclpCreatePipe(TclFile *readPipe, TclFile *writePipe);
/* 4 */
EXTERN int TclpCreateProcess(Tcl_Interp *interp, int argc,
const char **argv, TclFile inputFile,
TclFile outputFile, TclFile errorFile,
Tcl_Pid *pidPtr);
/* Slot 5 is reserved */
/* 6 */
EXTERN TclFile TclpMakeFile(Tcl_Channel channel, int direction);
/* 7 */
EXTERN TclFile TclpOpenFile(const char *fname, int mode);
/* 8 */
EXTERN int TclUnixWaitForFile(int fd, int mask, int timeout);
/* 9 */
EXTERN TclFile TclpCreateTempFile(const char *contents);
/* 10 */
EXTERN Tcl_DirEntry * TclpReaddir(TclDIR *dir);
/* Slot 13 is reserved */
/* 14 */
EXTERN int TclUnixCopyFile(const char *src, const char *dst,
const Tcl_StatBuf *statBufPtr,
int dontCopyAtts);
/* 15 */
EXTERN int TclMacOSXGetFileAttribute(Tcl_Interp *interp,
int objIndex, Tcl_Obj *fileName,
Tcl_Obj **attributePtrPtr);
/* 16 */
EXTERN int TclMacOSXSetFileAttribute(Tcl_Interp *interp,
int objIndex, Tcl_Obj *fileName,
Tcl_Obj *attributePtr);
/* 17 */
EXTERN int TclMacOSXCopyFileAttributes(const char *src,
const char *dst,
const Tcl_StatBuf *statBufPtr);
/* 18 */
EXTERN int TclMacOSXMatchType(Tcl_Interp *interp,
const char *pathName, const char *fileName,
Tcl_StatBuf *statBufPtr,
Tcl_GlobTypeData *types);
/* 19 */
EXTERN void TclMacOSXNotifierAddRunLoopMode(
const void *runLoopMode);
/* Slot 20 is reserved */
/* Slot 21 is reserved */
/* Slot 22 is reserved */
/* Slot 23 is reserved */
/* Slot 24 is reserved */
/* Slot 25 is reserved */
/* Slot 26 is reserved */
/* Slot 27 is reserved */
/* Slot 28 is reserved */
/* 29 */
EXTERN int TclWinCPUID(int index, int *regs);
/* 30 */
EXTERN int TclUnixOpenTemporaryFile(Tcl_Obj *dirObj,
Tcl_Obj *basenameObj, Tcl_Obj *extensionObj,
Tcl_Obj *resultingNameObj);
#endif /* MACOSX */
typedef struct TclIntPlatStubs {
int magic;
void *hooks;
#if !defined(_WIN32) && !defined(__CYGWIN__) && !defined(MAC_OSX_TCL) /* UNIX */
void (*tclGetAndDetachPids) (Tcl_Interp *interp, Tcl_Channel chan); /* 0 */
int (*tclpCloseFile) (TclFile file); /* 1 */
Tcl_Channel (*tclpCreateCommandChannel) (TclFile readFile, TclFile writeFile, TclFile errorFile, int numPids, Tcl_Pid *pidPtr); /* 2 */
int (*tclpCreatePipe) (TclFile *readPipe, TclFile *writePipe); /* 3 */
int (*tclpCreateProcess) (Tcl_Interp *interp, int argc, const char **argv, TclFile inputFile, TclFile outputFile, TclFile errorFile, Tcl_Pid *pidPtr); /* 4 */
int (*tclUnixWaitForFile_) (int fd, int mask, int timeout); /* 5 */
TclFile (*tclpMakeFile) (Tcl_Channel channel, int direction); /* 6 */
TclFile (*tclpOpenFile) (const char *fname, int mode); /* 7 */
int (*tclUnixWaitForFile) (int fd, int mask, int timeout); /* 8 */
TclFile (*tclpCreateTempFile) (const char *contents); /* 9 */
Tcl_DirEntry * (*tclpReaddir) (TclDIR *dir); /* 10 */
void (*reserved11)(void);
void (*reserved12)(void);
void (*reserved13)(void);
int (*tclUnixCopyFile) (const char *src, const char *dst, const Tcl_StatBuf *statBufPtr, int dontCopyAtts); /* 14 */
int (*tclMacOSXGetFileAttribute) (Tcl_Interp *interp, int objIndex, Tcl_Obj *fileName, Tcl_Obj **attributePtrPtr); /* 15 */
int (*tclMacOSXSetFileAttribute) (Tcl_Interp *interp, int objIndex, Tcl_Obj *fileName, Tcl_Obj *attributePtr); /* 16 */
int (*tclMacOSXCopyFileAttributes) (const char *src, const char *dst, const Tcl_StatBuf *statBufPtr); /* 17 */
int (*tclMacOSXMatchType) (Tcl_Interp *interp, const char *pathName, const char *fileName, Tcl_StatBuf *statBufPtr, Tcl_GlobTypeData *types); /* 18 */
void (*tclMacOSXNotifierAddRunLoopMode) (const void *runLoopMode); /* 19 */
void (*reserved20)(void);
void (*reserved21)(void);
TclFile (*tclpCreateTempFile_) (const char *contents); /* 22 */
void (*reserved23)(void);
void (*reserved24)(void);
void (*reserved25)(void);
void (*reserved26)(void);
void (*reserved27)(void);
void (*reserved28)(void);
int (*tclWinCPUID) (int index, int *regs); /* 29 */
int (*tclUnixOpenTemporaryFile) (Tcl_Obj *dirObj, Tcl_Obj *basenameObj, Tcl_Obj *extensionObj, Tcl_Obj *resultingNameObj); /* 30 */
#endif /* UNIX */
#if defined(_WIN32) || defined(__CYGWIN__) /* WIN */
void (*reserved0)(void);
void (*reserved1)(void);
void (*reserved2)(void);
void (*reserved3)(void);
void * (*tclWinGetTclInstance) (void); /* 4 */
int (*tclUnixWaitForFile) (int fd, int mask, int timeout); /* 5 */
void (*reserved6)(void);
void (*reserved7)(void);
Tcl_Size (*tclpGetPid) (Tcl_Pid pid); /* 8 */
void (*reserved9)(void);
void *(*tclpReaddir) (void *dir); /* 10 */
void (*tclGetAndDetachPids) (Tcl_Interp *interp, Tcl_Channel chan); /* 11 */
int (*tclpCloseFile) (TclFile file); /* 12 */
Tcl_Channel (*tclpCreateCommandChannel) (TclFile readFile, TclFile writeFile, TclFile errorFile, int numPids, Tcl_Pid *pidPtr); /* 13 */
int (*tclpCreatePipe) (TclFile *readPipe, TclFile *writePipe); /* 14 */
int (*tclpCreateProcess) (Tcl_Interp *interp, int argc, const char **argv, TclFile inputFile, TclFile outputFile, TclFile errorFile, Tcl_Pid *pidPtr); /* 15 */
int (*tclpIsAtty) (int fd); /* 16 */
int (*tclUnixCopyFile) (const char *src, const char *dst, const Tcl_StatBuf *statBufPtr, int dontCopyAtts); /* 17 */
TclFile (*tclpMakeFile) (Tcl_Channel channel, int direction); /* 18 */
TclFile (*tclpOpenFile) (const char *fname, int mode); /* 19 */
void (*tclWinAddProcess) (void *hProcess, Tcl_Size id); /* 20 */
void (*reserved21)(void);
TclFile (*tclpCreateTempFile) (const char *contents); /* 22 */
void (*reserved23)(void);
char * (*tclWinNoBackslash) (char *path); /* 24 */
void (*reserved25)(void);
void (*reserved26)(void);
void (*tclWinFlushDirtyChannels) (void); /* 27 */
void (*reserved28)(void);
int (*tclWinCPUID) (int index, int *regs); /* 29 */
int (*tclUnixOpenTemporaryFile) (Tcl_Obj *dirObj, Tcl_Obj *basenameObj, Tcl_Obj *extensionObj, Tcl_Obj *resultingNameObj); /* 30 */
#endif /* WIN */
#ifdef MAC_OSX_TCL /* MACOSX */
void (*tclGetAndDetachPids) (Tcl_Interp *interp, Tcl_Channel chan); /* 0 */
int (*tclpCloseFile) (TclFile file); /* 1 */
Tcl_Channel (*tclpCreateCommandChannel) (TclFile readFile, TclFile writeFile, TclFile errorFile, int numPids, Tcl_Pid *pidPtr); /* 2 */
int (*tclpCreatePipe) (TclFile *readPipe, TclFile *writePipe); /* 3 */
int (*tclpCreateProcess) (Tcl_Interp *interp, int argc, const char **argv, TclFile inputFile, TclFile outputFile, TclFile errorFile, Tcl_Pid *pidPtr); /* 4 */
int (*tclUnixWaitForFile_) (int fd, int mask, int timeout); /* 5 */
TclFile (*tclpMakeFile) (Tcl_Channel channel, int direction); /* 6 */
TclFile (*tclpOpenFile) (const char *fname, int mode); /* 7 */
int (*tclUnixWaitForFile) (int fd, int mask, int timeout); /* 8 */
TclFile (*tclpCreateTempFile) (const char *contents); /* 9 */
Tcl_DirEntry * (*tclpReaddir) (TclDIR *dir); /* 10 */
void (*reserved11)(void);
void (*reserved12)(void);
void (*reserved13)(void);
int (*tclUnixCopyFile) (const char *src, const char *dst, const Tcl_StatBuf *statBufPtr, int dontCopyAtts); /* 14 */
int (*tclMacOSXGetFileAttribute) (Tcl_Interp *interp, int objIndex, Tcl_Obj *fileName, Tcl_Obj **attributePtrPtr); /* 15 */
int (*tclMacOSXSetFileAttribute) (Tcl_Interp *interp, int objIndex, Tcl_Obj *fileName, Tcl_Obj *attributePtr); /* 16 */
int (*tclMacOSXCopyFileAttributes) (const char *src, const char *dst, const Tcl_StatBuf *statBufPtr); /* 17 */
int (*tclMacOSXMatchType) (Tcl_Interp *interp, const char *pathName, const char *fileName, Tcl_StatBuf *statBufPtr, Tcl_GlobTypeData *types); /* 18 */
void (*tclMacOSXNotifierAddRunLoopMode) (const void *runLoopMode); /* 19 */
void (*reserved20)(void);
void (*reserved21)(void);
TclFile (*tclpCreateTempFile_) (const char *contents); /* 22 */
void (*reserved23)(void);
void (*reserved24)(void);
void (*reserved25)(void);
void (*reserved26)(void);
void (*reserved27)(void);
void (*reserved28)(void);
int (*tclWinCPUID) (int index, int *regs); /* 29 */
int (*tclUnixOpenTemporaryFile) (Tcl_Obj *dirObj, Tcl_Obj *basenameObj, Tcl_Obj *extensionObj, Tcl_Obj *resultingNameObj); /* 30 */
#endif /* MACOSX */
} TclIntPlatStubs;
extern const TclIntPlatStubs *tclIntPlatStubsPtr;
#ifdef __cplusplus
}
#endif
#if defined(USE_TCL_STUBS)
/*
* Inline function declarations:
*/
#if !defined(_WIN32) && !defined(__CYGWIN__) && !defined(MAC_OSX_TCL) /* UNIX */
#define TclGetAndDetachPids \
(tclIntPlatStubsPtr->tclGetAndDetachPids) /* 0 */
#define TclpCloseFile \
(tclIntPlatStubsPtr->tclpCloseFile) /* 1 */
#define TclpCreateCommandChannel \
(tclIntPlatStubsPtr->tclpCreateCommandChannel) /* 2 */
#define TclpCreatePipe \
(tclIntPlatStubsPtr->tclpCreatePipe) /* 3 */
#define TclpCreateProcess \
(tclIntPlatStubsPtr->tclpCreateProcess) /* 4 */
/* Slot 5 is reserved */
#define TclpMakeFile \
(tclIntPlatStubsPtr->tclpMakeFile) /* 6 */
#define TclpOpenFile \
(tclIntPlatStubsPtr->tclpOpenFile) /* 7 */
#define TclUnixWaitForFile \
(tclIntPlatStubsPtr->tclUnixWaitForFile) /* 8 */
#define TclpCreateTempFile \
(tclIntPlatStubsPtr->tclpCreateTempFile) /* 9 */
#define TclpReaddir \
(tclIntPlatStubsPtr->tclpReaddir) /* 10 */
/* Slot 11 is reserved */
/* Slot 12 is reserved */
/* Slot 13 is reserved */
#define TclUnixCopyFile \
(tclIntPlatStubsPtr->tclUnixCopyFile) /* 14 */
#define TclMacOSXGetFileAttribute \
(tclIntPlatStubsPtr->tclMacOSXGetFileAttribute) /* 15 */
#define TclMacOSXSetFileAttribute \
(tclIntPlatStubsPtr->tclMacOSXSetFileAttribute) /* 16 */
#define TclMacOSXCopyFileAttributes \
(tclIntPlatStubsPtr->tclMacOSXCopyFileAttributes) /* 17 */
#define TclMacOSXMatchType \
(tclIntPlatStubsPtr->tclMacOSXMatchType) /* 18 */
#define TclMacOSXNotifierAddRunLoopMode \
(tclIntPlatStubsPtr->tclMacOSXNotifierAddRunLoopMode) /* 19 */
/* Slot 20 is reserved */
/* Slot 21 is reserved */
/* Slot 22 is reserved */
/* Slot 23 is reserved */
/* Slot 24 is reserved */
/* Slot 25 is reserved */
/* Slot 26 is reserved */
/* Slot 27 is reserved */
/* Slot 28 is reserved */
#define TclWinCPUID \
(tclIntPlatStubsPtr->tclWinCPUID) /* 29 */
#define TclUnixOpenTemporaryFile \
(tclIntPlatStubsPtr->tclUnixOpenTemporaryFile) /* 30 */
#endif /* UNIX */
#if defined(_WIN32) || defined(__CYGWIN__) /* WIN */
/* Slot 0 is reserved */
/* Slot 1 is reserved */
/* Slot 2 is reserved */
/* Slot 3 is reserved */
#define TclWinGetTclInstance \
(tclIntPlatStubsPtr->tclWinGetTclInstance) /* 4 */
#define TclUnixWaitForFile \
(tclIntPlatStubsPtr->tclUnixWaitForFile) /* 5 */
/* Slot 6 is reserved */
/* Slot 7 is reserved */
#define TclpGetPid \
(tclIntPlatStubsPtr->tclpGetPid) /* 8 */
/* Slot 9 is reserved */
/* Slot 10 is reserved */
#define TclGetAndDetachPids \
(tclIntPlatStubsPtr->tclGetAndDetachPids) /* 11 */
#define TclpCloseFile \
(tclIntPlatStubsPtr->tclpCloseFile) /* 12 */
#define TclpCreateCommandChannel \
(tclIntPlatStubsPtr->tclpCreateCommandChannel) /* 13 */
#define TclpCreatePipe \
(tclIntPlatStubsPtr->tclpCreatePipe) /* 14 */
#define TclpCreateProcess \
(tclIntPlatStubsPtr->tclpCreateProcess) /* 15 */
#define TclpIsAtty \
(tclIntPlatStubsPtr->tclpIsAtty) /* 16 */
#define TclUnixCopyFile \
(tclIntPlatStubsPtr->tclUnixCopyFile) /* 17 */
#define TclpMakeFile \
(tclIntPlatStubsPtr->tclpMakeFile) /* 18 */
#define TclpOpenFile \
(tclIntPlatStubsPtr->tclpOpenFile) /* 19 */
#define TclWinAddProcess \
(tclIntPlatStubsPtr->tclWinAddProcess) /* 20 */
/* Slot 21 is reserved */
#define TclpCreateTempFile \
(tclIntPlatStubsPtr->tclpCreateTempFile) /* 22 */
/* Slot 23 is reserved */
#define TclWinNoBackslash \
(tclIntPlatStubsPtr->tclWinNoBackslash) /* 24 */
/* Slot 25 is reserved */
/* Slot 26 is reserved */
#define TclWinFlushDirtyChannels \
(tclIntPlatStubsPtr->tclWinFlushDirtyChannels) /* 27 */
/* Slot 28 is reserved */
#define TclWinCPUID \
(tclIntPlatStubsPtr->tclWinCPUID) /* 29 */
#define TclUnixOpenTemporaryFile \
(tclIntPlatStubsPtr->tclUnixOpenTemporaryFile) /* 30 */
#endif /* WIN */
#ifdef MAC_OSX_TCL /* MACOSX */
#define TclGetAndDetachPids \
(tclIntPlatStubsPtr->tclGetAndDetachPids) /* 0 */
#define TclpCloseFile \
(tclIntPlatStubsPtr->tclpCloseFile) /* 1 */
#define TclpCreateCommandChannel \
(tclIntPlatStubsPtr->tclpCreateCommandChannel) /* 2 */
#define TclpCreatePipe \
(tclIntPlatStubsPtr->tclpCreatePipe) /* 3 */
#define TclpCreateProcess \
(tclIntPlatStubsPtr->tclpCreateProcess) /* 4 */
/* Slot 5 is reserved */
#define TclpMakeFile \
(tclIntPlatStubsPtr->tclpMakeFile) /* 6 */
#define TclpOpenFile \
(tclIntPlatStubsPtr->tclpOpenFile) /* 7 */
#define TclUnixWaitForFile \
(tclIntPlatStubsPtr->tclUnixWaitForFile) /* 8 */
#define TclpCreateTempFile \
(tclIntPlatStubsPtr->tclpCreateTempFile) /* 9 */
#define TclpReaddir \
(tclIntPlatStubsPtr->tclpReaddir) /* 10 */
/* Slot 11 is reserved */
/* Slot 12 is reserved */
/* Slot 13 is reserved */
#define TclUnixCopyFile \
(tclIntPlatStubsPtr->tclUnixCopyFile) /* 14 */
#define TclMacOSXGetFileAttribute \
(tclIntPlatStubsPtr->tclMacOSXGetFileAttribute) /* 15 */
#define TclMacOSXSetFileAttribute \
(tclIntPlatStubsPtr->tclMacOSXSetFileAttribute) /* 16 */
#define TclMacOSXCopyFileAttributes \
(tclIntPlatStubsPtr->tclMacOSXCopyFileAttributes) /* 17 */
#define TclMacOSXMatchType \
(tclIntPlatStubsPtr->tclMacOSXMatchType) /* 18 */
#define TclMacOSXNotifierAddRunLoopMode \
(tclIntPlatStubsPtr->tclMacOSXNotifierAddRunLoopMode) /* 19 */
/* Slot 20 is reserved */
/* Slot 21 is reserved */
/* Slot 22 is reserved */
/* Slot 23 is reserved */
/* Slot 24 is reserved */
/* Slot 25 is reserved */
/* Slot 26 is reserved */
/* Slot 27 is reserved */
/* Slot 28 is reserved */
#define TclWinCPUID \
(tclIntPlatStubsPtr->tclWinCPUID) /* 29 */
#define TclUnixOpenTemporaryFile \
(tclIntPlatStubsPtr->tclUnixOpenTemporaryFile) /* 30 */
#endif /* MACOSX */
#endif /* defined(USE_TCL_STUBS) */
#else /* TCL_MAJOR_VERSION > 8 */
/* !BEGIN!: Do not edit below this line. */
#ifdef __cplusplus
@@ -61,7 +547,8 @@ EXTERN TclFile TclpOpenFile(const char *fname, int mode);
EXTERN Tcl_Size TclpGetPid(Tcl_Pid pid);
/* 9 */
EXTERN TclFile TclpCreateTempFile(const char *contents);
/* Slot 10 is reserved */
/* 10 */
EXTERN Tcl_Encoding TclWinGetUserEncoding(Tcl_Interp *interp);
/* 11 */
EXTERN void TclGetAndDetachPids(Tcl_Interp *interp,
Tcl_Channel chan);
@@ -114,7 +601,7 @@ typedef struct TclIntPlatStubs {
TclFile (*tclpOpenFile) (const char *fname, int mode); /* 7 */
Tcl_Size (*tclpGetPid) (Tcl_Pid pid); /* 8 */
TclFile (*tclpCreateTempFile) (const char *contents); /* 9 */
void (*reserved10)(void);
Tcl_Encoding (*tclWinGetUserEncoding) (Tcl_Interp *interp); /* 10 */
void (*tclGetAndDetachPids) (Tcl_Interp *interp, Tcl_Channel chan); /* 11 */
void (*reserved12)(void);
void (*reserved13)(void);
@@ -168,7 +655,8 @@ extern const TclIntPlatStubs *tclIntPlatStubsPtr;
(tclIntPlatStubsPtr->tclpGetPid) /* 8 */
#define TclpCreateTempFile \
(tclIntPlatStubsPtr->tclpCreateTempFile) /* 9 */
/* Slot 10 is reserved */
#define TclWinGetUserEncoding \
(tclIntPlatStubsPtr->tclWinGetUserEncoding) /* 10 */
#define TclGetAndDetachPids \
(tclIntPlatStubsPtr->tclGetAndDetachPids) /* 11 */
/* Slot 12 is reserved */
@@ -202,6 +690,7 @@ extern const TclIntPlatStubs *tclIntPlatStubsPtr;
#endif /* defined(USE_TCL_STUBS) */
/* !END!: Do not edit above this line. */
#endif /* TCL_MAJOR_VERSION */
#undef TCL_STORAGE_CLASS
#define TCL_STORAGE_CLASS DLLIMPORT
@@ -249,4 +738,12 @@ MODULE_SCOPE int TclMacOSXMatchType(Tcl_Interp *interp,
# define TclpGetPid(pid) ((Tcl_Size)(pid))
#endif
#ifdef USE_TCL_STUBS
/* Protect TclWinGetUserEncoding() for environments it doen't exist, e.g. Tcl 9.0.0/9.0.1 */
#undef TclWinGetUserEncoding
#define TclWinGetUserEncoding(interp) \
(tclIntPlatStubsPtr->tclWinGetUserEncoding ? tclIntPlatStubsPtr->tclWinGetUserEncoding(interp) : NULL)
#endif
#endif /* _TCLINTPLATDECLS */
+4 -4
View File
@@ -340,8 +340,8 @@ Tcl_Init(
* pre-init and init scripts are running. The real version of this struct
* is in tclPkg.c.
*/
typedef struct PkgNameStruct {
struct PkgNameStruct *nextPtr;/* Next in list of package names being
typedef struct PkgName {
struct PkgName *nextPtr;/* Next in list of package names being
* initialized. */
char name[4]; /* Enough space for "tcl". The *real* version
* of this structure uses a flex array. */
@@ -3962,7 +3962,7 @@ Tcl_LimitSetCommands(
*----------------------------------------------------------------------
*/
Tcl_Size
int
Tcl_LimitGetCommands(
Tcl_Interp *interp)
{
@@ -4329,7 +4329,7 @@ TclRemoveScriptLimitCallbacks(
while (hashPtr != NULL) {
keyPtr = (ScriptLimitCallbackKey *)
Tcl_GetHashKey(&iPtr->limit.callbacks, hashPtr);
Tcl_LimitRemoveHandler(keyPtr->interp, (int)keyPtr->type,
Tcl_LimitRemoveHandler(keyPtr->interp, keyPtr->type,
CallScriptLimitCallback, Tcl_GetHashValue(hashPtr));
hashPtr = Tcl_NextHashEntry(&search);
}
+2 -2
View File
@@ -36,7 +36,7 @@ typedef struct {
Tcl_Size bytes; /* Size of C variable array. This is 0 when
* single variables, and >0 used for array
* variables. */
Tcl_Size numElems; /* Number of elements in C variable array.
Tcl_Size numElems; /* Number of elements in C variable array.
* Zero for single variables. */
int type; /* Type of link (TCL_LINK_INT, etc.). */
union {
@@ -680,7 +680,7 @@ GetInvalidDoubleFromObj(
static char *
LinkTraceProc(
void *clientData, /* Contains information about the link. */
void *clientData, /* Contains information about the link. */
Tcl_Interp *interp, /* Interpreter containing Tcl variable. */
TCL_UNUSED(const char *) /*name1*/,
TCL_UNUSED(const char *) /*name2*/,
+39 -33
View File
@@ -239,8 +239,8 @@ const Tcl_ObjType tclListType = {
*/
static inline ListSpan *
ListSpanNew(
Tcl_Size firstSlot, /* Starting slot index of the span */
Tcl_Size numSlots) /* Number of slots covered by the span */
Tcl_Size firstSlot, /* Starting slot index of the span */
Tcl_Size numSlots) /* Number of slots covered by the span */
{
ListSpan *spanPtr = (ListSpan *) Tcl_Alloc(sizeof(*spanPtr));
spanPtr->refCount = 0;
@@ -298,8 +298,8 @@ ListSpanDecrRefs(
*/
static inline int
ListSpanMerited(
Tcl_Size length, /* Length of the proposed span */
Tcl_Size usedStorageLength, /* Number of slots currently in used */
Tcl_Size length, /* Length of the proposed span */
Tcl_Size usedStorageLength, /* Number of slots currently in used */
Tcl_Size allocatedStorageLength) /* Length of the currently allocation */
{
/*
@@ -370,9 +370,9 @@ ListRepFreeUnreferenced(
*/
static inline void
ObjArrayIncrRefs(
Tcl_Obj * const *objv, /* Pointer to the array */
Tcl_Size startIdx, /* Starting index of subarray within objv */
Tcl_Size count) /* Number of elements in the subarray */
Tcl_Obj * const *objv, /* Pointer to the array */
Tcl_Size startIdx, /* Starting index of subarray within objv */
Tcl_Size count) /* Number of elements in the subarray */
{
Tcl_Obj *const *end;
LIST_INDEX_ASSERT(startIdx);
@@ -402,9 +402,9 @@ ObjArrayIncrRefs(
*/
static inline void
ObjArrayDecrRefs(
Tcl_Obj * const *objv, /* Pointer to the array */
Tcl_Size startIdx, /* Starting index of subarray within objv */
Tcl_Size count) /* Number of elements in the subarray */
Tcl_Obj * const *objv, /* Pointer to the array */
Tcl_Size startIdx, /* Starting index of subarray within objv */
Tcl_Size count) /* Number of elements in the subarray */
{
Tcl_Obj * const *end;
LIST_INDEX_ASSERT(startIdx);
@@ -434,9 +434,9 @@ ObjArrayDecrRefs(
*/
static inline void
ObjArrayCopy(
Tcl_Obj **to, /* Destination */
Tcl_Size count, /* Number of pointers to copy */
Tcl_Obj *const from[]) /* Source array of Tcl_Obj* */
Tcl_Obj **to, /* Destination */
Tcl_Size count, /* Number of pointers to copy */
Tcl_Obj *const from[]) /* Source array of Tcl_Obj* */
{
Tcl_Obj **end;
LIST_COUNT_ASSERT(count);
@@ -465,8 +465,8 @@ ObjArrayCopy(
*/
static int
MemoryAllocationError(
Tcl_Interp *interp, /* Interpreter for error message. May be NULL */
size_t size) /* Size of attempted allocation that failed */
Tcl_Interp *interp, /* Interpreter for error message. May be NULL */
size_t size) /* Size of attempted allocation that failed */
{
if (interp != NULL) {
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
@@ -1258,10 +1258,10 @@ TclNewListObj2(
static int
TclListObjGetRep(
Tcl_Interp *interp, /* Used to report errors if not NULL. */
Tcl_Obj *listObj, /* List object for which an element array is
* to be returned. */
ListRep *repPtr) /* Location to store descriptor */
Tcl_Interp *interp, /* Used to report errors if not NULL. */
Tcl_Obj *listObj, /* List object for which an element array is
* to be returned. */
ListRep *repPtr) /* Location to store descriptor */
{
if (!TclHasInternalRep(listObj, &tclListType)) {
int result;
@@ -1460,7 +1460,7 @@ ListRepRange(
*rangeRepPtr = *srcRepPtr; /* Not ref counts not incremented */
} else if (rangeStart == 0 && (!preserveSrcRep)
&& (!ListRepIsShared(srcRepPtr) && srcRepPtr->spanPtr == NULL)) {
/* Option 1 - Special case unshared, exclude end elements, no span */
/* Option 1 - Special case unshared, exclude end elements, no span */
LIST_ASSERT(srcRepPtr->storePtr->firstUsed == 0); /* If no span */
ListRepElements(srcRepPtr, numSrcElems, srcElems);
numAfterRangeEnd = numSrcElems - (rangeEnd + 1);
@@ -2017,9 +2017,9 @@ Tcl_ListObjIndex(
#undef Tcl_ListObjLength
int
Tcl_ListObjLength(
Tcl_Interp *interp, /* Used to report errors if not NULL. */
Tcl_Obj *listObj, /* List object whose #elements to return. */
Tcl_Size *lenPtr) /* The resulting length is stored here. */
Tcl_Interp *interp, /* Used to report errors if not NULL. */
Tcl_Obj *listObj, /* List object whose #elements to return. */
Tcl_Size *lenPtr) /* The resulting length is stored here. */
{
ListRep listRep;
@@ -2664,14 +2664,14 @@ TclLindexFlat(
Tcl_Size i;
/* Handle AbstractList as special case */
if (TclObjTypeHasProc(listObj,indexProc)) {
if (indexCount == 1 && TclObjTypeHasProc(listObj,indexProc)) {
Tcl_Size listLen = TclObjTypeLength(listObj);
Tcl_Size index;
Tcl_Obj *elemObj = listObj; /* for lindex without indices return list */
for (i=0 ; i<indexCount && listObj ; i++) {
if (TclGetIntForIndexM(interp, indexArray[i], /*endValue*/ listLen-1,
&index) == TCL_OK) {
// TODO: ???
&index) != TCL_OK) {
return NULL;
}
if (i==0) {
if (TclObjTypeIndex(interp, listObj, index, &elemObj) != TCL_OK) {
@@ -2684,6 +2684,13 @@ TclLindexFlat(
elemObj = e2Obj;
}
}
if (elemObj == NULL) {
/*
* TclObjTypeIndex returns TCL_OK with NULL in elemObj if
* index was out of bounds.
*/
TclNewObj(elemObj);
}
Tcl_IncrRefCount(elemObj);
return elemObj;
}
@@ -2720,6 +2727,7 @@ TclLindexFlat(
Tcl_IncrRefCount(listObj);
} else {
Tcl_Obj *itemObj;
/* TODO - this will cause shimmering of inner abstract lists! */
/*
* Must set the internal rep again because it may have been
* changed by TclGetIntForIndexM. See test lindex-8.4.
@@ -2727,7 +2735,7 @@ TclLindexFlat(
if (!TclHasInternalRep(listObj, &tclListType)) {
status = SetListFromAny(interp, listObj);
if (status != TCL_OK) {
/* The list is not a list at all => error. */
/* The list is not a list at all => error. */
Tcl_DecrRefCount(listObj);
return NULL;
}
@@ -2784,10 +2792,10 @@ TclLsetList(
Tcl_Obj *indexArgObj, /* Index or index-list arg to 'lset'. */
Tcl_Obj *valueObj) /* Value arg to 'lset' or NULL to 'lpop'. */
{
Tcl_Size indexCount = 0; /* Number of indices in the index list. */
Tcl_Size indexCount = 0; /* Number of indices in the index list. */
Tcl_Obj **indices = NULL; /* Vector of indices in the index list. */
Tcl_Obj *retValueObj; /* Pointer to the list to be returned. */
Tcl_Size index; /* Current index in the list - discarded. */
Tcl_Size index; /* Current index in the list - discarded. */
Tcl_Obj *indexListCopy;
/*
@@ -3157,7 +3165,7 @@ TclListObjSetElement(
* element. */
{
ListRep listRep;
Tcl_Obj **elemPtrs; /* Pointers to elements of the list. */
Tcl_Obj **elemPtrs; /* Pointers to elements of the list. */
Tcl_Size elemCount; /* Number of elements in the list. */
/* Ensure that the listObj parameter designates an unshared list. */
@@ -3550,9 +3558,7 @@ UpdateStringOfList(
start = dst = Tcl_InitStringRep(listObj, NULL, bytesNeeded);
TclOOM(dst, bytesNeeded);
for (i = 0; i < numElems; i++) {
if (i) {
flagPtr[i] |= TCL_DONT_QUOTE_HASH;
}
flagPtr[i] |= (i ? TCL_DONT_QUOTE_HASH : 0);
elem = TclGetStringFromObj(elemPtrs[i], &length);
dst += TclConvertElement(elem, length, dst, flagPtr[i]);
*dst++ = ' ';
+19 -17
View File
@@ -29,9 +29,9 @@
*/
static size_t AddLocalLiteralEntry(CompileEnv *envPtr,
Tcl_Obj *objPtr, size_t localHash);
Tcl_Obj *objPtr, int localHash);
static void ExpandLocalLiteralArray(CompileEnv *envPtr);
static size_t HashString(const char *string, Tcl_Size length);
static size_t HashString(const char *string, size_t length);
#ifdef TCL_COMPILE_DEBUG
static LiteralEntry * LookupLiteralEntry(Tcl_Interp *interp,
Tcl_Obj *objPtr);
@@ -58,7 +58,8 @@ static void RebuildLiteralTable(LiteralTable *tablePtr);
void
TclInitLiteralTable(
LiteralTable *tablePtr) /* Pointer to table structure, which is
LiteralTable *tablePtr)
/* Pointer to table structure, which is
* supplied by the caller. */
{
#if (TCL_SMALL_HASH_TABLE != 4)
@@ -175,11 +176,11 @@ TclDeleteLiteralTable(
Tcl_Obj *
TclCreateLiteral(
Interp *iPtr,
const char *bytes, /* The start of the string. Note that this is
const char *bytes, /* The start of the string. Note that this is
* not a NUL-terminated string. */
Tcl_Size length, /* Number of bytes in the string. */
size_t hash, /* The string's hash. If the value is
* TCL_INDEX_NONE, it will be computed here. */
Tcl_Size length, /* Number of bytes in the string. */
size_t hash, /* The string's hash. If the value is
* TCL_INDEX_NONE, it will be computed here. */
int *newPtr,
Namespace *nsPtr,
int flags,
@@ -388,12 +389,12 @@ TclFetchLiteral(
int /* Do NOT change this type. Should not be wider than TclEmitPush operand*/
TclRegisterLiteral(
void *ePtr, /* Points to the CompileEnv in whose object
void *ePtr, /* Points to the CompileEnv in whose object
* array an object is found or created. */
const char *bytes, /* Points to string for which to find or
const char *bytes, /* Points to string for which to find or
* create an object in CompileEnv's object
* array. */
Tcl_Size length, /* Number of bytes in the string. If -1, the
Tcl_Size length, /* Number of bytes in the string. If -1, the
* string consists of all bytes up to the
* first null character. */
int flags) /* If LITERAL_ON_HEAP then the caller already
@@ -439,7 +440,7 @@ TclRegisterLiteral(
if (objIndex > INT_MAX) {
Tcl_Panic("Literal table index too large. Cannot be handled by TclEmitPush");
}
return (int)objIndex;
return objIndex;
}
}
@@ -481,7 +482,7 @@ TclRegisterLiteral(
Tcl_Panic(
"Literal table index too large. Cannot be handled by TclEmitPush");
}
return (int)objIndex;
return objIndex;
}
#ifdef TCL_COMPILE_DEBUG
@@ -646,7 +647,7 @@ TclAddLiteralObj(
*litPtrPtr = lPtr;
}
return (int)objIndex;
return objIndex;
}
/*
@@ -672,7 +673,7 @@ AddLocalLiteralEntry(
CompileEnv *envPtr,/* Points to CompileEnv in whose literal array
* the object is to be inserted. */
Tcl_Obj *objPtr, /* The literal to add to the CompileEnv. */
size_t localHash) /* Hash value for the literal's string. */
int localHash) /* Hash value for the literal's string. */
{
LiteralTable *localTablePtr = &envPtr->localLitTable;
LiteralEntry *localPtr;
@@ -910,8 +911,8 @@ TclReleaseLiteral(
static size_t
HashString(
const char *string, /* String for which to compute hash value. */
Tcl_Size length) /* Number of bytes in the string. */
const char *string, /* String for which to compute hash value. */
size_t length) /* Number of bytes in the string. */
{
size_t result = 0;
@@ -974,7 +975,8 @@ HashString(
static void
RebuildLiteralTable(
LiteralTable *tablePtr) /* Local or global table to enlarge. */
LiteralTable *tablePtr)
/* Local or global table to enlarge. */
{
LiteralEntry **oldBuckets;
LiteralEntry **oldChainPtr, **newChainPtr;
+1 -2
View File
@@ -132,8 +132,7 @@ Tcl_LoadObjCmd(
Tcl_DString pfx, tmp, initName, safeInitName;
Tcl_DString unloadName, safeUnloadName;
InterpLibrary *ipFirstPtr, *ipPtr;
int code, namesMatch, filesMatch;
Tcl_Size offset;
int code, namesMatch, filesMatch, offset;
const char *symbols[2];
Tcl_LibraryInitProc *initProc;
const char *p, *fullFileName, *prefix;
+2 -2
View File
@@ -276,7 +276,7 @@ Tcl_SourceRCFile(
TCL_NORETURN void
Tcl_MainEx(
Tcl_Size argc, /* Number of arguments. */
Tcl_Size argc, /* Number of arguments. */
TCHAR **argv, /* Array of argument strings. */
Tcl_AppInitProc *appInitProc,
/* Application-specific initialization
@@ -735,7 +735,7 @@ TclFullFinalizationRequested(void)
static void
StdinProc(
void *clientData, /* The state of interactive cmd line */
void *clientData, /* The state of interactive cmd line */
TCL_UNUSED(int) /*mask*/)
{
int code;
+7 -7
View File
@@ -2028,7 +2028,8 @@ Tcl_ForgetImport(
*/
Command *cmdPtr = (Command *) token;
ImportedCmdData *dataPtr = (ImportedCmdData *)cmdPtr->objClientData;
ImportedCmdData *dataPtr = (ImportedCmdData *)
cmdPtr->objClientData;
Tcl_Command firstToken = (Tcl_Command) dataPtr->realCmdPtr;
if (firstToken == origin) {
@@ -2301,7 +2302,7 @@ TclGetNamespaceForQualName(
* namespace if TCL_GLOBAL_ONLY was specified,
* or the current namespace if cxtNsPtr was
* NULL. */
const char **simpleNamePtr) /* Address where function stores the simple
const char **simpleNamePtr) /* Address where function stores the simple
* name at end of the qualName, or NULL if
* qualName is "::" or the flag
* TCL_FIND_ONLY_NS was specified. */
@@ -3743,8 +3744,7 @@ NamespaceForgetCmd(
Tcl_Obj *const objv[]) /* Argument objects. */
{
const char *pattern;
int i;
int result;
int i, result;
if (objc < 1) {
Tcl_WrongNumArgs(interp, 1, objv, "?pattern pattern...?");
@@ -3810,8 +3810,8 @@ NamespaceImportCmd(
{
int allowOverwrite = 0;
const char *string, *pattern;
int i, firstArg;
int result;
int i, result;
int firstArg;
if (objc < 1) {
Tcl_WrongNumArgs(interp, 1, objv, "?-force? ?pattern pattern...?");
@@ -5020,7 +5020,7 @@ TclLogCommandInfo(
* the error. */
Tcl_Size length, /* Number of bytes in command (< 0 means use
* all bytes up to first null byte). */
const unsigned char *pc, /* Current pc of bytecode execution context */
const unsigned char *pc, /* Current pc of bytecode execution context */
Tcl_Obj **tosPtr) /* Current stack of bytecode execution
* context */
{
+11 -11
View File
@@ -74,7 +74,7 @@ typedef struct ThreadSpecificData {
/* Pointer to first event source in list of
* event sources for this thread. */
Tcl_ThreadId threadId; /* Thread that owns this notifier instance. */
void *clientData; /* Opaque handle for platform specific
void *clientData; /* Opaque handle for platform specific
* notifier. */
struct ThreadSpecificData *nextPtr;
/* Next notifier in global list of notifiers.
@@ -308,7 +308,7 @@ Tcl_CreateEventSource(
Tcl_EventCheckProc *checkProc,
/* Function to call after waiting to see what
* happened. */
void *clientData) /* One-word argument to pass to setupProc and
void *clientData) /* One-word argument to pass to setupProc and
* checkProc. */
{
ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey);
@@ -347,7 +347,7 @@ Tcl_DeleteEventSource(
Tcl_EventCheckProc *checkProc,
/* Function to call after waiting to see what
* happened. */
void *clientData) /* One-word argument to pass to setupProc and
void *clientData) /* One-word argument to pass to setupProc and
* checkProc. */
{
ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey);
@@ -394,7 +394,7 @@ Tcl_QueueEvent(
* malloc (Tcl_Alloc), and it becomes the
* property of the event queue. It will be
* freed after the event has been handled. */
int position) /* One of TCL_QUEUE_TAIL, TCL_QUEUE_HEAD, TCL_QUEUE_MARK,
int position) /* One of TCL_QUEUE_TAIL, TCL_QUEUE_HEAD, TCL_QUEUE_MARK,
* possibly combined with TCL_QUEUE_ALERT_IF_EMPTY. */
{
ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey);
@@ -426,7 +426,7 @@ Tcl_ThreadQueueEvent(
* malloc (Tcl_Alloc), and it becomes the
* property of the event queue. It will be
* freed after the event has been handled. */
int position) /* One of TCL_QUEUE_TAIL, TCL_QUEUE_HEAD, TCL_QUEUE_MARK,
int position) /* One of TCL_QUEUE_TAIL, TCL_QUEUE_HEAD, TCL_QUEUE_MARK,
* possibly combined with TCL_QUEUE_ALERT_IF_EMPTY. */
{
ThreadSpecificData *tsdPtr;
@@ -486,7 +486,7 @@ QueueEvent(
* malloc (Tcl_Alloc), and it becomes the
* property of the event queue. It will be
* freed after the event has been handled. */
int position) /* One of TCL_QUEUE_TAIL, TCL_QUEUE_HEAD, TCL_QUEUE_MARK,
int position) /* One of TCL_QUEUE_TAIL, TCL_QUEUE_HEAD, TCL_QUEUE_MARK,
* possibly combined with TCL_QUEUE_ALERT_IF_EMPTY */
{
int wasEmpty = 0;
@@ -562,7 +562,7 @@ QueueEvent(
void
Tcl_DeleteEvents(
Tcl_EventDeleteProc *proc, /* The function to call. */
void *clientData) /* The type-specific data. */
void *clientData) /* The type-specific data. */
{
Tcl_Event *evPtr; /* Pointer to the event being examined */
Tcl_Event *prevPtr; /* Pointer to evPtr's predecessor, or NULL if
@@ -1270,7 +1270,7 @@ Tcl_FinalizeNotifier(
void
Tcl_AlertNotifier(
void *clientData) /* Pointer to thread data. */
void *clientData) /* Pointer to thread data. */
{
if (tclNotifierHooks.alertNotifierProc) {
tclNotifierHooks.alertNotifierProc(clientData);
@@ -1327,7 +1327,7 @@ Tcl_ServiceModeHook(
void
Tcl_SetTimer(
const Tcl_Time *timePtr) /* Timeout value, may be NULL. */
const Tcl_Time *timePtr) /* Timeout value, may be NULL. */
{
if (tclNotifierHooks.setTimerProc) {
tclNotifierHooks.setTimerProc(timePtr);
@@ -1358,7 +1358,7 @@ Tcl_SetTimer(
int
Tcl_WaitForEvent(
const Tcl_Time *timePtr) /* Maximum block time, or NULL. */
const Tcl_Time *timePtr) /* Maximum block time, or NULL. */
{
if (tclNotifierHooks.waitForEventProc) {
return tclNotifierHooks.waitForEventProc(timePtr);
@@ -1397,7 +1397,7 @@ Tcl_CreateFileHandler(
* called. */
Tcl_FileProc *proc, /* Function to call for each selected
* event. */
void *clientData) /* Arbitrary data to pass to proc. */
void *clientData) /* Arbitrary data to pass to proc. */
{
if (tclNotifierHooks.createFileHandlerProc) {
tclNotifierHooks.createFileHandlerProc(fd, mask, proc, clientData);
+8
View File
@@ -62,8 +62,12 @@ typedef struct Tcl_ObjectContext_ *Tcl_ObjectContext;
typedef int (Tcl_MethodCallProc)(void *clientData, Tcl_Interp *interp,
Tcl_ObjectContext objectContext, int objc, Tcl_Obj *const *objv);
#if TCL_MAJOR_VERSION > 8
typedef int (Tcl_MethodCallProc2)(void *clientData, Tcl_Interp *interp,
Tcl_ObjectContext objectContext, Tcl_Size objc, Tcl_Obj *const *objv);
#else
#define Tcl_MethodCallProc2 Tcl_MethodCallProc
#endif
typedef void (Tcl_MethodDeleteProc)(void *clientData);
typedef int (Tcl_CloneProc)(Tcl_Interp *interp, void *oldClientData,
void **newClientData);
@@ -94,6 +98,7 @@ typedef struct Tcl_MethodType {
* be copied directly. */
} Tcl_MethodType;
#if TCL_MAJOR_VERSION > 8
typedef struct Tcl_MethodType2 {
int version; /* Structure version field. Always to be equal
* to TCL_OO_METHOD_VERSION_2 in
@@ -110,6 +115,9 @@ typedef struct Tcl_MethodType2 {
* data, or NULL if the type-specific data can
* be copied directly. */
} Tcl_MethodType2;
#else
#define Tcl_MethodType2 Tcl_MethodType
#endif
/*
* The correct value for the version field of the Tcl_MethodType structure.
+2 -2
View File
@@ -437,7 +437,7 @@ FinalizeMethodRefs(
* ----------------------------------------------------------------------
*/
Tcl_Size
int
TclOOGetSortedMethodList(
Object *oPtr, /* The object to get the method names for. */
Object *contextObj, /* From what context object we are inquiring.
@@ -804,7 +804,7 @@ AddStandardMethodName(
Tcl_SetHashValue(hPtr, INT2PTR(isWanted));
} else if ((PTR2INT(Tcl_GetHashValue(hPtr)) & NO_IMPLEMENTATION)
&& mPtr->typePtr != NULL) {
Tcl_Size isWanted = PTR2INT(Tcl_GetHashValue(hPtr));
int isWanted = PTR2INT(Tcl_GetHashValue(hPtr));
isWanted &= ~NO_IMPLEMENTATION;
Tcl_SetHashValue(hPtr, INT2PTR(isWanted));
+10
View File
@@ -270,4 +270,14 @@ extern const TclOOStubs *tclOOStubsPtr;
/* !END!: Do not edit above this line. */
#if TCL_MAJOR_VERSION < 9
/* TIP #630 for 8.7 */
# undef Tcl_MethodIsType2
# define Tcl_MethodIsType2 Tcl_MethodIsType
# undef Tcl_NewInstanceMethod2
# define Tcl_NewInstanceMethod2 Tcl_NewInstanceMethod
# undef Tcl_NewMethod2
# define Tcl_NewMethod2 Tcl_NewMethod
#endif
#endif /* _TCLOODECLS */
+4 -3
View File
@@ -180,7 +180,7 @@ static const DeclaredSlot slots[] = {
* used with Tcl_ObjPrintf().
*/
#define PRIVATE_VARIABLE_PATTERN "%" TCL_Z_MODIFIER "d : %s"
#define PRIVATE_VARIABLE_PATTERN "%d : %s"
/*
* ----------------------------------------------------------------------
@@ -620,7 +620,7 @@ InstallPrivateVariableMapping(
PrivateVariableList *pvlPtr,
Tcl_Size varc,
Tcl_Obj *const *varv,
Tcl_Size creationEpoch)
int creationEpoch)
{
PrivateVariableMapping *privatePtr;
Tcl_Size i, n;
@@ -2497,6 +2497,7 @@ ClassMixin_Get(
}
Tcl_SetObjResult(interp, resultObj);
return TCL_OK;
}
static int
@@ -3121,7 +3122,7 @@ ResolveClass(
int objc,
Tcl_Obj *const *objv)
{
Tcl_Size idx = Tcl_ObjectContextSkippedArgs(context);
int idx = Tcl_ObjectContextSkippedArgs(context);
Object *oPtr = (Object *) TclOOGetDefineCmdContext(interp);
Class *clsPtr;
+8 -8
View File
@@ -202,7 +202,7 @@ struct PropertyStorage {
* exposed by this object or class (in its
* stereotypical instances). Contains a sorted
* unique list if not NULL. */
Tcl_Size epoch; /* The epoch that the caches are valid for. */
int epoch; /* The epoch that the caches are valid for. */
};
/*
@@ -259,7 +259,7 @@ struct Object {
enum ObjectFlags {
OBJECT_DESTRUCTING = 1, /* Indicates that an object is being or has
* been destroyed. */
* been destroyed */
DESTRUCTOR_CALLED = 2, /* Indicates that evaluation of destructor
* script for the object has began */
ROOT_OBJECT = 0x1000, /* Flag to say that this object is the root of
@@ -591,7 +591,7 @@ MODULE_SCOPE Proc * TclOOGetProcFromMethod(Method *mPtr);
MODULE_SCOPE Tcl_Obj * TclOOGetMethodBody(Method *mPtr);
MODULE_SCOPE size_t TclOOGetSortedClassMethodList(Class *clsPtr,
int flags, const char ***stringsPtr);
MODULE_SCOPE Tcl_Size TclOOGetSortedMethodList(Object *oPtr,
MODULE_SCOPE int TclOOGetSortedMethodList(Object *oPtr,
Object *contextObj, Class *contextCls, int flags,
const char ***stringsPtr);
MODULE_SCOPE int TclOOInit(Tcl_Interp *interp);
@@ -656,7 +656,7 @@ MODULE_SCOPE void TclOORegisterInstanceProperty(Object *oPtr,
*/
#define FOREACH(var,ary) \
for (i=0 ; i<(ary).num; i++) if ((ary).list[i] == NULL) { \
for(i=0 ; i<(ary).num; i++) if ((ary).list[i] == NULL) { \
continue; \
} else if ((var) = (ary).list[i], 1)
@@ -668,7 +668,7 @@ MODULE_SCOPE void TclOORegisterInstanceProperty(Object *oPtr,
*/
#define FOREACH_STRUCT(var,ary) \
if (i=0, (ary).num>0) for (; var=&((ary).list[i]), i<(ary).num; i++)
if (i=0, (ary).num>0) for(; var=&((ary).list[i]), i<(ary).num; i++)
/*
* Convenience macros for iterating through hash tables. FOREACH_HASH_DECLS
@@ -681,16 +681,16 @@ MODULE_SCOPE void TclOORegisterInstanceProperty(Object *oPtr,
#define FOREACH_HASH_DECLS \
Tcl_HashEntry *hPtr;Tcl_HashSearch search
#define FOREACH_HASH(key, val, tablePtr) \
for (hPtr = Tcl_FirstHashEntry((tablePtr), &search); hPtr != NULL ? \
for(hPtr = Tcl_FirstHashEntry((tablePtr), &search); hPtr != NULL ? \
(*(void **)&(key) = Tcl_GetHashKey((tablePtr), hPtr), \
*(void **)&(val) = Tcl_GetHashValue(hPtr), 1) : 0; \
hPtr = Tcl_NextHashEntry(&search))
#define FOREACH_HASH_KEY(key, tablePtr) \
for (hPtr = Tcl_FirstHashEntry((tablePtr), &search); hPtr != NULL ? \
for(hPtr = Tcl_FirstHashEntry((tablePtr), &search); hPtr != NULL ? \
(*(void **)&(key) = Tcl_GetHashKey((tablePtr), hPtr), 1) : 0; \
hPtr = Tcl_NextHashEntry(&search))
#define FOREACH_HASH_VALUE(val, tablePtr) \
for (hPtr = Tcl_FirstHashEntry((tablePtr), &search); hPtr != NULL ? \
for(hPtr = Tcl_FirstHashEntry((tablePtr), &search); hPtr != NULL ? \
(*(void **)&(val) = Tcl_GetHashValue(hPtr), 1) : 0; \
hPtr = Tcl_NextHashEntry(&search))
+1 -1
View File
@@ -561,7 +561,7 @@ InitCmdFrame(
cfPtr->level = -1;
cfPtr->type = context.type;
cfPtr->line = (int *) Tcl_Alloc(sizeof(int));
cfPtr->line = (Tcl_Size *) Tcl_Alloc(sizeof(Tcl_Size));
cfPtr->line[0] = context.line[context.nline - 1];
cfPtr->nline = 1;
cfPtr->framePtr = NULL;
+74 -65
View File
@@ -77,7 +77,7 @@ typedef struct {
*/
typedef struct {
Tcl_HashTable *lineCLPtr; /* This table remembers for each Tcl_Obj
Tcl_HashTable *lineCLPtr; /* This table remembers for each Tcl_Obj
* generated by a call to the function
* TclSubstTokens() from a literal text
* where bs+nl sequences occurred in it, if
@@ -1034,9 +1034,9 @@ TclDbDumpActiveObjects(
void
TclDbInitNewObj(
Tcl_Obj *objPtr,
const char *file, /* The name of the source file calling this
const char *file, /* The name of the source file calling this
* function; used for debugging. */
int line) /* Line number in the source file; used for
int line) /* Line number in the source file; used for
* debugging. */
{
objPtr->refCount = 0;
@@ -1162,9 +1162,9 @@ Tcl_NewObj(void)
Tcl_Obj *
Tcl_DbNewObj(
const char *file, /* The name of the source file calling this
const char *file, /* The name of the source file calling this
* function; used for debugging. */
int line) /* Line number in the source file; used for
int line) /* Line number in the source file; used for
* debugging. */
{
Tcl_Obj *objPtr;
@@ -1662,9 +1662,9 @@ Tcl_GetString(
#undef TclGetStringFromObj
char *
TclGetStringFromObj(
Tcl_Obj *objPtr, /* Object whose string rep byte pointer should
Tcl_Obj *objPtr, /* Object whose string rep byte pointer should
* be returned. */
void *lengthPtr) /* If non-NULL, the location where the string
void *lengthPtr) /* If non-NULL, the location where the string
* rep's byte array length should * be stored.
* If NULL, no length is stored. */
{
@@ -1707,7 +1707,7 @@ TclGetStringFromObj(
#undef Tcl_GetStringFromObj
char *
Tcl_GetStringFromObj(
Tcl_Obj *objPtr, /* Object whose string rep byte pointer should
Tcl_Obj *objPtr, /* Object whose string rep byte pointer should
* be returned. */
Tcl_Size *lengthPtr) /* If non-NULL, the location where the string
* rep's byte array length should * be stored.
@@ -1790,7 +1790,7 @@ Tcl_GetStringFromObj(
char *
Tcl_InitStringRep(
Tcl_Obj *objPtr, /* Object whose string rep is to be set */
Tcl_Obj *objPtr, /* Object whose string rep is to be set */
const char *bytes,
size_t numBytes)
{
@@ -1861,7 +1861,7 @@ Tcl_InitStringRep(
void
Tcl_InvalidateStringRep(
Tcl_Obj *objPtr) /* Object whose string rep byte pointer should
Tcl_Obj *objPtr) /* Object whose string rep byte pointer should
* be freed. */
{
TclInvalidateStringRep(objPtr);
@@ -1973,7 +1973,7 @@ Tcl_FetchInternalRep(
void
Tcl_FreeInternalRep(
Tcl_Obj *objPtr) /* Object whose internal rep should be freed. */
Tcl_Obj *objPtr) /* Object whose internal rep should be freed. */
{
TclFreeInternalRep(objPtr);
}
@@ -2000,10 +2000,10 @@ Tcl_FreeInternalRep(
#undef Tcl_GetBoolFromObj
int
Tcl_GetBoolFromObj(
Tcl_Interp *interp, /* Used for error reporting if not NULL. */
Tcl_Obj *objPtr, /* The object from which to get boolean. */
Tcl_Interp *interp, /* Used for error reporting if not NULL. */
Tcl_Obj *objPtr, /* The object from which to get boolean. */
int flags,
char *charPtr) /* Place to store resulting boolean. */
char *charPtr) /* Place to store resulting boolean. */
{
int result;
Tcl_Size length;
@@ -2052,13 +2052,13 @@ Tcl_GetBoolFromObj(
*(int *)charPtr = result;
return TCL_OK;
} else if (flags == (int)sizeof(short)) {
*(short *)charPtr = (short)result;
*(short *)charPtr = result;
return TCL_OK;
} else {
Tcl_Panic("Wrong bool var for %s", "Tcl_GetBoolFromObj");
}
}
*charPtr = (char)result;
*charPtr = result;
}
return TCL_OK;
}
@@ -2087,9 +2087,9 @@ Tcl_GetBoolFromObj(
#undef Tcl_GetBooleanFromObj
int
Tcl_GetBooleanFromObj(
Tcl_Interp *interp, /* Used for error reporting if not NULL. */
Tcl_Obj *objPtr, /* The object from which to get boolean. */
int *intPtr) /* Place to store resulting boolean. */
Tcl_Interp *interp, /* Used for error reporting if not NULL. */
Tcl_Obj *objPtr, /* The object from which to get boolean. */
int *intPtr) /* Place to store resulting boolean. */
{
return Tcl_GetBoolFromObj(interp, objPtr, (TCL_NULL_OK-2)&(int)sizeof(int), (char *)(void *)intPtr);
}
@@ -2117,7 +2117,7 @@ Tcl_GetBooleanFromObj(
int
TclSetBooleanFromAny(
Tcl_Interp *interp, /* Used for error reporting if not NULL. */
Tcl_Obj *objPtr) /* The object to convert. */
Tcl_Obj *objPtr) /* The object to convert. */
{
/*
* For some "pure" numeric Tcl_ObjTypes (no string rep), we can determine
@@ -2163,7 +2163,7 @@ TclSetBooleanFromAny(
static int
ParseBoolean(
Tcl_Obj *objPtr) /* The object to parse/convert. */
Tcl_Obj *objPtr) /* The object to parse/convert. */
{
int newBool;
char lowerCase[6];
@@ -2305,7 +2305,7 @@ ParseBoolean(
Tcl_Obj *
Tcl_NewDoubleObj(
double dblValue) /* Double used to initialize the object. */
double dblValue) /* Double used to initialize the object. */
{
return Tcl_DbNewDoubleObj(dblValue, "unknown", 0);
}
@@ -2314,7 +2314,7 @@ Tcl_NewDoubleObj(
Tcl_Obj *
Tcl_NewDoubleObj(
double dblValue) /* Double used to initialize the object. */
double dblValue) /* Double used to initialize the object. */
{
Tcl_Obj *objPtr;
@@ -2353,7 +2353,7 @@ Tcl_NewDoubleObj(
Tcl_Obj *
Tcl_DbNewDoubleObj(
double dblValue, /* Double used to initialize the object. */
double dblValue, /* Double used to initialize the object. */
const char *file, /* The name of the source file calling this
* function; used for debugging. */
int line) /* Line number in the source file; used for
@@ -2434,9 +2434,9 @@ Tcl_SetDoubleObj(
int
Tcl_GetDoubleFromObj(
Tcl_Interp *interp, /* Used for error reporting if not NULL. */
Tcl_Obj *objPtr, /* The object from which to get a double. */
double *dblPtr) /* Place to store resulting double. */
Tcl_Interp *interp, /* Used for error reporting if not NULL. */
Tcl_Obj *objPtr, /* The object from which to get a double. */
double *dblPtr) /* Place to store resulting double. */
{
Tcl_Size length;
do {
@@ -2576,9 +2576,9 @@ UpdateStringOfDouble(
int
Tcl_GetIntFromObj(
Tcl_Interp *interp, /* Used for error reporting if not NULL. */
Tcl_Obj *objPtr, /* The object from which to get a int. */
int *intPtr) /* Place to store resulting int. */
Tcl_Interp *interp, /* Used for error reporting if not NULL. */
Tcl_Obj *objPtr, /* The object from which to get a int. */
int *intPtr) /* Place to store resulting int. */
{
#if (LONG_MAX == INT_MAX)
return TclGetLongFromObj(interp, objPtr, (long *) intPtr);
@@ -2648,7 +2648,7 @@ SetIntFromAny(
static void
UpdateStringOfInt(
Tcl_Obj *objPtr) /* Int object whose string rep to update. */
Tcl_Obj *objPtr) /* Int object whose string rep to update. */
{
char *dst = Tcl_InitStringRep( objPtr, NULL, TCL_INTEGER_SPACE);
@@ -2680,9 +2680,9 @@ UpdateStringOfInt(
int
Tcl_GetLongFromObj(
Tcl_Interp *interp, /* Used for error reporting if not NULL. */
Tcl_Obj *objPtr, /* The object from which to get a long. */
long *longPtr) /* Place to store resulting long. */
Tcl_Interp *interp, /* Used for error reporting if not NULL. */
Tcl_Obj *objPtr, /* The object from which to get a long. */
long *longPtr) /* Place to store resulting long. */
{
Tcl_Size length;
do {
@@ -2814,7 +2814,8 @@ Tcl_GetLongFromObj(
Tcl_Obj *
Tcl_NewWideIntObj(
Tcl_WideInt wideValue) /* Wide integer used to initialize the new
Tcl_WideInt wideValue)
/* Wide integer used to initialize the new
* object. */
{
return Tcl_DbNewWideIntObj(wideValue, "unknown", 0);
@@ -2824,7 +2825,8 @@ Tcl_NewWideIntObj(
Tcl_Obj *
Tcl_NewWideIntObj(
Tcl_WideInt wideValue) /* Wide integer used to initialize the new
Tcl_WideInt wideValue)
/* Wide integer used to initialize the new
* object. */
{
Tcl_Obj *objPtr;
@@ -2852,7 +2854,8 @@ Tcl_NewWideIntObj(
Tcl_Obj *
Tcl_NewWideUIntObj(
Tcl_WideUInt uwideValue) /* Wide integer used to initialize the new
Tcl_WideUInt uwideValue)
/* Wide integer used to initialize the new
* object. */
{
Tcl_Obj *objPtr;
@@ -2897,7 +2900,8 @@ Tcl_NewWideUIntObj(
Tcl_Obj *
Tcl_DbNewWideIntObj(
Tcl_WideInt wideValue, /* Wide integer used to initialize the new
Tcl_WideInt wideValue,
/* Wide integer used to initialize the new
* object. */
const char *file, /* The name of the source file calling this
* function; used for debugging. */
@@ -2915,7 +2919,8 @@ Tcl_DbNewWideIntObj(
Tcl_Obj *
Tcl_DbNewWideIntObj(
Tcl_WideInt wideValue, /* Long integer used to initialize the new
Tcl_WideInt wideValue,
/* Long integer used to initialize the new
* object. */
TCL_UNUSED(const char *) /*file*/,
TCL_UNUSED(int) /*line*/)
@@ -2944,8 +2949,9 @@ Tcl_DbNewWideIntObj(
void
Tcl_SetWideIntObj(
Tcl_Obj *objPtr, /* Object w. internal rep to init. */
Tcl_WideInt wideValue) /* Wide integer used to initialize the
Tcl_Obj *objPtr, /* Object w. internal rep to init. */
Tcl_WideInt wideValue)
/* Wide integer used to initialize the
* object's value. */
{
if (Tcl_IsShared(objPtr)) {
@@ -2975,8 +2981,9 @@ Tcl_SetWideIntObj(
void
Tcl_SetWideUIntObj(
Tcl_Obj *objPtr, /* Object w. internal rep to init. */
Tcl_WideUInt uwideValue) /* Wide integer used to initialize the
Tcl_Obj *objPtr, /* Object w. internal rep to init. */
Tcl_WideUInt uwideValue)
/* Wide integer used to initialize the
* object's value. */
{
if (Tcl_IsShared(objPtr)) {
@@ -3017,9 +3024,10 @@ Tcl_SetWideUIntObj(
int
Tcl_GetWideIntFromObj(
Tcl_Interp *interp, /* Used for error reporting if not NULL. */
Tcl_Obj *objPtr, /* Object from which to get a wide int. */
Tcl_WideInt *wideIntPtr) /* Place to store resulting long. */
Tcl_Interp *interp, /* Used for error reporting if not NULL. */
Tcl_Obj *objPtr, /* Object from which to get a wide int. */
Tcl_WideInt *wideIntPtr)
/* Place to store resulting long. */
{
Tcl_Size length;
do {
@@ -3117,9 +3125,10 @@ Tcl_GetWideIntFromObj(
int
Tcl_GetWideUIntFromObj(
Tcl_Interp *interp, /* Used for error reporting if not NULL. */
Tcl_Obj *objPtr, /* Object from which to get a wide int. */
Tcl_WideUInt *wideUIntPtr) /* Place to store resulting long. */
Tcl_Interp *interp, /* Used for error reporting if not NULL. */
Tcl_Obj *objPtr, /* Object from which to get a wide int. */
Tcl_WideUInt *wideUIntPtr)
/* Place to store resulting long. */
{
do {
if (TclHasInternalRep(objPtr, &tclIntType)) {
@@ -3201,9 +3210,9 @@ Tcl_GetWideUIntFromObj(
int
TclGetWideBitsFromObj(
Tcl_Interp *interp, /* Used for error reporting if not NULL. */
Tcl_Obj *objPtr, /* Object from which to get a wide int. */
Tcl_WideInt *wideIntPtr) /* Place to store resulting wide integer. */
Tcl_Interp *interp, /* Used for error reporting if not NULL. */
Tcl_Obj *objPtr, /* Object from which to get a wide int. */
Tcl_WideInt *wideIntPtr) /* Place to store resulting wide integer. */
{
do {
if (TclHasInternalRep(objPtr, &tclIntType)) {
@@ -3265,9 +3274,9 @@ TclGetWideBitsFromObj(
*/
int
Tcl_GetSizeIntFromObj(
Tcl_Interp *interp, /* Used for error reporting if not NULL. */
Tcl_Obj *objPtr, /* The object from which to get a int. */
Tcl_Size *sizePtr) /* Place to store resulting int. */
Tcl_Interp *interp, /* Used for error reporting if not NULL. */
Tcl_Obj *objPtr, /* The object from which to get a int. */
Tcl_Size *sizePtr) /* Place to store resulting int. */
{
if (sizeof(Tcl_Size) == sizeof(int)) {
return TclGetIntFromObj(interp, objPtr, (int *)sizePtr);
@@ -3577,7 +3586,7 @@ int
Tcl_GetBignumFromObj(
Tcl_Interp *interp, /* Tcl interpreter for error reporting */
Tcl_Obj *objPtr, /* Object to read */
void *bignumValue) /* Returned bignum value. */
void *bignumValue) /* Returned bignum value. */
{
return GetBignumFromObj(interp, objPtr, 1, (mp_int *)bignumValue);
}
@@ -3612,7 +3621,7 @@ int
Tcl_TakeBignumFromObj(
Tcl_Interp *interp, /* Tcl interpreter for error reporting */
Tcl_Obj *objPtr, /* Object to read */
void *bignumValue) /* Returned bignum value. */
void *bignumValue) /* Returned bignum value. */
{
return GetBignumFromObj(interp, objPtr, 0, (mp_int *)bignumValue);
}
@@ -3637,7 +3646,7 @@ Tcl_TakeBignumFromObj(
void
Tcl_SetBignumObj(
Tcl_Obj *objPtr, /* Object to set */
void *big) /* Value to store */
void *big) /* Value to store */
{
Tcl_WideUInt value = 0;
size_t numBytes;
@@ -3929,7 +3938,7 @@ Tcl_IsShared(
#ifdef TCL_MEM_DEBUG
void
Tcl_DbIncrRefCount(
Tcl_Obj *objPtr, /* The object we are registering a reference
Tcl_Obj *objPtr, /* The object we are registering a reference
* to. */
const char *file, /* The name of the source file calling this
* function; used for debugging. */
@@ -4002,7 +4011,7 @@ Tcl_DbIncrRefCount(
#ifdef TCL_MEM_DEBUG
void
Tcl_DbDecrRefCount(
Tcl_Obj *objPtr, /* The object we are releasing a reference
Tcl_Obj *objPtr, /* The object we are releasing a reference
* to. */
const char *file, /* The name of the source file calling this
* function; used for debugging. */
@@ -4079,17 +4088,16 @@ Tcl_DbDecrRefCount(
int
Tcl_DbIsShared(
Tcl_Obj *objPtr, /* The object to test for being shared. */
Tcl_Obj *objPtr, /* The object to test for being shared. */
#ifdef TCL_MEM_DEBUG
const char *file, /* The name of the source file calling this
* function; used for debugging. */
int line /* Line number in the source file; used for
int line) /* Line number in the source file; used for
* debugging. */
#else
TCL_UNUSED(const char *) /*file*/,
TCL_UNUSED(int) /*line*/
TCL_UNUSED(int) /*line*/)
#endif
)
{
#ifdef TCL_MEM_DEBUG
if (objPtr->refCount == FREEDREFCOUNTFILLER) {
@@ -4157,7 +4165,8 @@ Tcl_DbIsShared(
void
Tcl_InitObjHashTable(
Tcl_HashTable *tablePtr) /* Pointer to table record, which is supplied
Tcl_HashTable *tablePtr)
/* Pointer to table record, which is supplied
* by the caller. */
{
Tcl_InitCustomHashTable(tablePtr, TCL_CUSTOM_PTR_KEYS,
+13 -10
View File
@@ -129,7 +129,7 @@ static Tcl_Size ParseWhiteSpace(const char *src, Tcl_Size numBytes,
int *incompletePtr, char *typePtr);
static Tcl_Size ParseAllWhiteSpace(const char *src, Tcl_Size numBytes,
int *incompletePtr);
static Tcl_Size ParseHex(const char *src, Tcl_Size numBytes,
static int ParseHex(const char *src, Tcl_Size numBytes,
int *resultPtr);
/*
@@ -205,7 +205,8 @@ Tcl_ParseCommand(
* close bracket should be considered a
* command terminator. If zero, then close
* bracket has no special meaning. */
Tcl_Parse *parsePtr) /* Structure to fill in with information about
Tcl_Parse *parsePtr)
/* Structure to fill in with information about
* the parsed command; any previous
* information in the structure is ignored. */
{
@@ -724,7 +725,7 @@ TclParseAllWhiteSpace(
*----------------------------------------------------------------------
*/
Tcl_Size
int
ParseHex(
const char *src, /* First character to parse. */
Tcl_Size numBytes, /* Max number of byes to scan */
@@ -779,7 +780,7 @@ ParseHex(
*----------------------------------------------------------------------
*/
Tcl_Size
int
TclParseBackslash(
const char *src, /* Points to the backslash character of a
* backslash sequence. */
@@ -1329,7 +1330,7 @@ Tcl_ParseVarName(
{
Tcl_Token *tokenPtr;
const char *src;
Tcl_Size varIndex;
int varIndex;
unsigned array;
if (numBytes < 0 && start) {
@@ -1618,7 +1619,8 @@ Tcl_ParseBraces(
Tcl_Size numBytes, /* Total number of bytes in string. If -1,
* the string consists of all bytes up to the
* first null character. */
Tcl_Parse *parsePtr, /* Structure to fill in with information about
Tcl_Parse *parsePtr,
/* Structure to fill in with information about
* the string. */
int append, /* Non-zero means append tokens to existing
* information in parsePtr; zero means ignore
@@ -1818,7 +1820,8 @@ Tcl_ParseQuotedString(
Tcl_Size numBytes, /* Total number of bytes in string. If -1,
* the string consists of all bytes up to the
* first null character. */
Tcl_Parse *parsePtr, /* Structure to fill in with information about
Tcl_Parse *parsePtr,
/* Structure to fill in with information about
* the string. */
int append, /* Non-zero means append tokens to existing
* information in parsePtr; zero means ignore
@@ -2096,10 +2099,10 @@ TclSubstTokens(
* evaluate and concatenate. */
Tcl_Size count, /* Number of tokens to consider at tokenPtr.
* Must be at least 1. */
Tcl_Size *tokensLeftPtr, /* If not NULL, points to memory where an
int *tokensLeftPtr, /* If not NULL, points to memory where an
* integer representing the number of tokens
* left to be substituted will be written */
int line, /* The line the script starts on. */
Tcl_Size line, /* The line the script starts on. */
Tcl_Size *clNextOuter, /* Information about an outer context for */
const char *outerScript) /* continuation line data. This is set by
* EvalEx() to properly handle [...]-nested
@@ -2166,7 +2169,7 @@ TclSubstTokens(
for (; count>0 && code==TCL_OK ; count--, tokenPtr++) {
Tcl_Obj *appendObj = NULL;
const char *append = NULL;
Tcl_Size appendByteLength = 0;
int appendByteLength = 0;
char utfCharBytes[4] = "";
switch (tokenPtr->type) {
+16 -16
View File
@@ -55,17 +55,17 @@ static const Tcl_ObjType fsPathType = {
*/
typedef struct {
Tcl_Obj *translatedPathPtr; /* If the path has been normalized (flags ==
* 0), this is NULL. Otherwise it is a path
* in which any ~user sequences have been
* translated away. */
Tcl_Obj *normPathPtr; /* If the path has been normalized (flags ==
* 0), this is an absolute path without ., ..
* or ~user components. Otherwise it is a
* path, possibly absolute, to normalize
* relative to cwdPtr. */
Tcl_Obj *cwdPtr; /* If NULL, either translatedPtr exists or
* normPathPtr exists and is absolute. */
Tcl_Obj *translatedPathPtr; /* If the path has been normalized (flags ==
* 0), this is NULL. Otherwise it is a path
* in which any ~user sequences have been
* translated away. */
Tcl_Obj *normPathPtr; /* If the path has been normalized (flags ==
* 0), this is an absolute path without ., ..
* or ~user components. Otherwise it is a
* path, possibly absolute, to normalize
* relative to cwdPtr. */
Tcl_Obj *cwdPtr; /* If NULL, either translatedPtr exists or
* normPathPtr exists and is absolute. */
int flags; /* Flags to describe interpretation - see
* below. */
void *nativePathPtr; /* Native representation of this path, which
@@ -2566,11 +2566,11 @@ TclGetHomeDirObj(
*
*----------------------------------------------------------------------
*/
int
Tcl_FSTildeExpand(
Tcl_Interp *interp, /* May be NULL. Only used for error messages */
const char *path, /* Path to resolve tilde */
Tcl_DString *dsPtr) /* Output DString for resolved path. */
int Tcl_FSTildeExpand(
Tcl_Interp *interp, /* May be NULL. Only used for error messages */
const char *path, /* Path to resolve tilde */
Tcl_DString *dsPtr) /* Output DString for resolved path. */
{
Tcl_Size split;
int result;
+2 -1
View File
@@ -194,6 +194,7 @@ Tcl_DetachPids(
detList = detPtr;
}
Tcl_MutexUnlock(&pipeMutex);
}
/*
@@ -329,7 +330,7 @@ TclCleanupChildren(
*/
if (interp != NULL) {
Tcl_Size count;
int count;
Tcl_Obj *objPtr;
Tcl_Seek(errorChan, 0, SEEK_SET);
+10 -10
View File
@@ -86,12 +86,12 @@ static int CompareVersions(char *v1i, char *v2i,
int *isMajorPtr);
static int CheckRequirement(Tcl_Interp *interp,
const char *string);
static int CheckAllRequirements(Tcl_Interp *interp, Tcl_Size reqc,
static int CheckAllRequirements(Tcl_Interp *interp, int reqc,
Tcl_Obj *const reqv[]);
static int RequirementSatisfied(char *havei, const char *req);
static int SomeRequirementSatisfied(char *havei, Tcl_Size reqc,
static int SomeRequirementSatisfied(char *havei, int reqc,
Tcl_Obj *const reqv[]);
static void AddRequirementsToResult(Tcl_Interp *interp, Tcl_Size reqc,
static void AddRequirementsToResult(Tcl_Interp *interp, int reqc,
Tcl_Obj *const reqv[]);
static void AddRequirementsToDString(Tcl_DString *dstring,
int reqc, Tcl_Obj *const reqv[]);
@@ -583,7 +583,7 @@ PkgRequireCoreFinal(
TCL_UNUSED(int))
{
Require *reqPtr = (Require *)data[0];
Tcl_Size reqc = PTR2INT(data[1]), satisfies;
int reqc = (int)PTR2INT(data[1]), satisfies;
Tcl_Obj **const reqv = (Tcl_Obj **)data[2];
char *pkgVersionI;
void *clientDataPtr = reqPtr->clientDataPtr;
@@ -649,7 +649,7 @@ SelectPackage(
/* Internal rep. of versions */
int availStable, satisfies;
Require *reqPtr = (Require *)data[0];
Tcl_Size reqc = PTR2INT(data[1]);
int reqc = (int)PTR2INT(data[1]);
Tcl_Obj **const reqv = (Tcl_Obj **)data[2];
const char *name = reqPtr->name;
Package *pkgPtr = reqPtr->pkgPtr;
@@ -1955,10 +1955,10 @@ CompareVersions(
static int
CheckAllRequirements(
Tcl_Interp *interp,
Tcl_Size reqc, /* Requirements to check. */
int reqc, /* Requirements to check. */
Tcl_Obj *const reqv[])
{
Tcl_Size i;
int i;
for (i = 0; i < reqc; i++) {
if ((CheckRequirement(interp, TclGetString(reqv[i])) != TCL_OK)) {
@@ -2061,7 +2061,7 @@ CheckRequirement(
static void
AddRequirementsToResult(
Tcl_Interp *interp,
Tcl_Size reqc, /* Requirements constraining the desired
int reqc, /* Requirements constraining the desired
* version. */
Tcl_Obj *const reqv[]) /* 0 means to use the latest version
* available. */
@@ -2141,12 +2141,12 @@ static int
SomeRequirementSatisfied(
char *availVersionI, /* Candidate version to check against the
* requirements. */
Tcl_Size reqc, /* Requirements constraining the desired
int reqc, /* Requirements constraining the desired
* version. */
Tcl_Obj *const reqv[]) /* 0 means to use the latest version
* available. */
{
Tcl_Size i;
int i;
for (i = 0; i < reqc; i++) {
if (RequirementSatisfied(availVersionI, TclGetString(reqv[i]))) {
+95 -2
View File
@@ -48,6 +48,94 @@
# endif
#endif
#if TCL_MAJOR_VERSION < 9
#ifdef __cplusplus
extern "C" {
#endif
/*
* Exported function declarations:
*/
#if defined(_WIN32) || defined(__CYGWIN__) /* WIN */
/* 0 */
EXTERN TCHAR * Tcl_WinUtfToTChar(const char *str, int len,
Tcl_DString *dsPtr);
/* 1 */
EXTERN char * Tcl_WinTCharToUtf(const TCHAR *str, int len,
Tcl_DString *dsPtr);
/* Slot 2 is reserved */
/* 3 */
EXTERN void Tcl_WinConvertError(unsigned errCode);
#endif /* WIN */
#ifdef MAC_OSX_TCL /* MACOSX */
/* 0 */
EXTERN int Tcl_MacOSXOpenBundleResources(Tcl_Interp *interp,
const char *bundleName, int hasResourceFile,
Tcl_Size maxPathLen, char *libraryPath);
/* 1 */
EXTERN int Tcl_MacOSXOpenVersionedBundleResources(
Tcl_Interp *interp, const char *bundleName,
const char *bundleVersion,
int hasResourceFile, Tcl_Size maxPathLen,
char *libraryPath);
/* 2 */
EXTERN void Tcl_MacOSXNotifierAddRunLoopMode(
const void *runLoopMode);
#endif /* MACOSX */
typedef struct TclPlatStubs {
int magic;
void *hooks;
#if defined(_WIN32) || defined(__CYGWIN__) /* WIN */
TCHAR * (*tcl_WinUtfToTChar) (const char *str, int len, Tcl_DString *dsPtr); /* 0 */
char * (*tcl_WinTCharToUtf) (const TCHAR *str, int len, Tcl_DString *dsPtr); /* 1 */
void (*reserved2)(void);
void (*tcl_WinConvertError) (unsigned errCode); /* 3 */
#endif /* WIN */
#ifdef MAC_OSX_TCL /* MACOSX */
int (*tcl_MacOSXOpenBundleResources) (Tcl_Interp *interp, const char *bundleName, int hasResourceFile, Tcl_Size maxPathLen, char *libraryPath); /* 0 */
int (*tcl_MacOSXOpenVersionedBundleResources) (Tcl_Interp *interp, const char *bundleName, const char *bundleVersion, int hasResourceFile, Tcl_Size maxPathLen, char *libraryPath); /* 1 */
void (*tcl_MacOSXNotifierAddRunLoopMode) (const void *runLoopMode); /* 2 */
#endif /* MACOSX */
} TclPlatStubs;
extern const TclPlatStubs *tclPlatStubsPtr;
#ifdef __cplusplus
}
#endif
#if defined(USE_TCL_STUBS)
/*
* Inline function declarations:
*/
#if defined(_WIN32) || defined(__CYGWIN__) /* WIN */
#define Tcl_WinUtfToTChar \
(tclPlatStubsPtr->tcl_WinUtfToTChar) /* 0 */
#define Tcl_WinTCharToUtf \
(tclPlatStubsPtr->tcl_WinTCharToUtf) /* 1 */
/* Slot 2 is reserved */
#define Tcl_WinConvertError \
(tclPlatStubsPtr->tcl_WinConvertError) /* 3 */
#endif /* WIN */
#ifdef MAC_OSX_TCL /* MACOSX */
#define Tcl_MacOSXOpenBundleResources \
(tclPlatStubsPtr->tcl_MacOSXOpenBundleResources) /* 0 */
#define Tcl_MacOSXOpenVersionedBundleResources \
(tclPlatStubsPtr->tcl_MacOSXOpenVersionedBundleResources) /* 1 */
#define Tcl_MacOSXNotifierAddRunLoopMode \
(tclPlatStubsPtr->tcl_MacOSXNotifierAddRunLoopMode) /* 2 */
#endif /* MACOSX */
#endif /* defined(USE_TCL_STUBS) */
#else /* TCL_MAJOR_VERSION > 8 */
/* !BEGIN!: Do not edit below this line. */
#ifdef __cplusplus
@@ -105,6 +193,8 @@ extern const TclPlatStubs *tclPlatStubsPtr;
/* !END!: Do not edit above this line. */
#endif /* TCL_MAJOR_VERSION */
#ifdef MAC_OSX_TCL /* MACOSX */
#undef Tcl_MacOSXOpenBundleResources
#define Tcl_MacOSXOpenBundleResources(a,b,c,d,e) Tcl_MacOSXOpenVersionedBundleResources(a,b,NULL,c,d,e)
@@ -123,13 +213,16 @@ extern const TclPlatStubs *tclPlatStubsPtr;
# undef Tcl_MacOSXNotifierAddRunLoopMode
#endif
#if defined(USE_TCL_STUBS) && (defined(_WIN32) || defined(__CYGWIN__))\
&& (defined(TCL_NO_DEPRECATED) || TCL_MAJOR_VERSION > 8)
#undef Tcl_WinUtfToTChar
#undef Tcl_WinTCharToUtf
#ifdef _WIN32
#define Tcl_WinUtfToTChar(string, len, dsPtr) (Tcl_DStringInit(dsPtr), \
(TCHAR *)Tcl_UtfToChar16DString((string), (len), (dsPtr)))
(TCHAR *)Tcl_UtfToChar16DString((string), (len), (dsPtr)))
#define Tcl_WinTCharToUtf(string, len, dsPtr) (Tcl_DStringInit(dsPtr), \
(char *)Tcl_Char16ToUtfDString((const unsigned short *)(string), ((((len) + 2) >> 1) - 1), (dsPtr)))
Tcl_Char16ToUtfDString((const unsigned short *)(string), ((((len) + 2) >> 1) - 1), (dsPtr)))
#endif
#endif
#endif /* _TCLPLATDECLS */
+5 -6
View File
@@ -272,7 +272,7 @@ Tcl_ProcObjCmd(
cfPtr->level = -1;
cfPtr->type = contextPtr->type;
cfPtr->line = (int *)Tcl_Alloc(sizeof(int));
cfPtr->line = (Tcl_Size *)Tcl_Alloc(sizeof(Tcl_Size));
cfPtr->line[0] = contextPtr->line[3];
cfPtr->nline = 1;
cfPtr->framePtr = NULL;
@@ -777,8 +777,7 @@ TclObjGetFrame(
* global frame indicated). */
{
Interp *iPtr = (Interp *) interp;
int curLevel;
int result, level;
int curLevel, level, result;
const Tcl_ObjInternalRep *irPtr;
const char *name = NULL;
Tcl_WideInt w;
@@ -1646,7 +1645,7 @@ TclNRInterpProc(
}
return TclNRInterpProcCore(interp, objv[0], 1, &MakeProcError);
}
static int
NRInterpProc(
void *clientData, /* Record describing procedure to be
@@ -2560,7 +2559,7 @@ SetLambdaFromAny(
if (contextPtr->line
&& (contextPtr->nline >= 2) && (contextPtr->line[1] >= 0)) {
int buf[2];
Tcl_Size buf[2];
/*
* Move from approximation (line of list cmd word) to actual
@@ -2572,7 +2571,7 @@ SetLambdaFromAny(
cfPtr->level = -1;
cfPtr->type = contextPtr->type;
cfPtr->line = (int *)Tcl_Alloc(sizeof(int));
cfPtr->line = (Tcl_Size *)Tcl_Alloc(sizeof(Tcl_Size));
cfPtr->line[0] = buf[1];
cfPtr->nline = 1;
cfPtr->framePtr = NULL;
+1 -1
View File
@@ -26,7 +26,7 @@ static int autopurge = 1; /* Autopurge flag. */
typedef struct ProcessInfo {
Tcl_Pid pid; /* Process id. */
Tcl_Size resolvedPid; /* Resolved process id. */
int resolvedPid; /* Resolved process id. */
int purge; /* Purge eventualy. */
TclProcessWaitStatus status;/* Process status. */
int code; /* Error code, exit status or signal
+1 -2
View File
@@ -863,8 +863,7 @@ CompileRegexp(
{
TclRegexp *regexpPtr;
const Tcl_UniChar *uniString;
int status, i, exact;
Tcl_Size numChars;
int numChars, status, i, exact;
Tcl_DString stringBuf;
ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey);
+1 -1
View File
@@ -65,7 +65,7 @@ Tcl_AddInterpResolvers(
{
Interp *iPtr = (Interp *) interp;
ResolverScheme *resPtr;
size_t len;
unsigned len;
/*
* Since we're adding a new name resolution scheme, we must force all code
+1 -1
View File
@@ -807,7 +807,7 @@ TclProcessReturn(
int
TclMergeReturnOptions(
Tcl_Interp *interp, /* Current interpreter. */
Tcl_Size objc, /* Number of arguments. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[], /* Argument objects. */
Tcl_Obj **optionsPtrPtr, /* If not NULL, points to space for a (Tcl_Obj
* *) where the pointer to the merged return
+44 -2
View File
@@ -40,7 +40,7 @@
* Rounding controls. (Thanks a lot, Intel!)
*/
#ifdef __i386
#if defined(i386) || defined(__i386__) || defined(__i386) || defined(_M_IX86)
/*
* gcc on x86 needs access to rounding controls, because of a questionable
* feature where it retains intermediate results as IEEE 'long double' values
@@ -1252,7 +1252,7 @@ TclParseNumber(
}
}
if (endPtrPtr == NULL) {
if ((len != 0) && ((numBytes + 1 > 1) || (*p != '\0'))) {
if ((len != 0) && ((numBytes > 0) || (*p != '\0'))) {
status = TCL_ERROR;
}
} else {
@@ -1822,6 +1822,8 @@ MakeHighPrecisionDouble(
TCL_IEEE_DOUBLE_ROUNDING_DECL
int machexp = 0; /* Machine exponent of a power of 10. */
int shift, n;
mp_int bntmp;
/*
* With gcc on x86, the floating point rounding mode is double-extended.
@@ -1869,6 +1871,43 @@ MakeHighPrecisionDouble(
* for overflow. Convert back to a double, and test for underflow.
*/
/*
* TCL bug ca62367d61: the following two if-conditions handle the case,
* if the mantissa is to long to be represented.
* Very high numbers are returned, if this is not handled
*/
if (exponent < -511) {
if (mp_init_copy(&bntmp, significand) != MP_OKAY) {
Tcl_Panic("initialization failure in MakeHighPrecisionDouble");
}
shift = -exponent - 511;
exponent += shift;
while (shift > 0) {
n = (shift > 9) ? 9 : shift;
if (mp_div_d(&bntmp, (mp_digit) pow10_wide[n], &bntmp, NULL) != MP_OKAY) {
Tcl_Panic("initialization failure in MakeHighPrecisionDouble");
}
shift -= n;
}
significand = &bntmp;
} else if (exponent > 511) {
if (mp_init_copy(&bntmp, significand) != MP_OKAY) {
Tcl_Panic("initialization failure in MakeHighPrecisionDouble");
}
shift = exponent - 511;
exponent -= shift;
while (shift > 0) {
n = (shift > 9) ? 9 : shift;
if (mp_mul_d(&bntmp, (mp_digit) pow10_wide[n], &bntmp) != MP_OKAY) {
Tcl_Panic("initialization failure in MakeHighPrecisionDouble");
}
shift -= n;
}
significand = &bntmp;
}
retval = BignumToBiasedFrExp(significand, &machexp);
retval = Pow10TimesFrExp(exponent, retval, &machexp);
if (machexp > DBL_MAX_EXP*log2FLT_RADIX) {
@@ -1896,6 +1935,9 @@ MakeHighPrecisionDouble(
*/
returnValue:
if (significand == &bntmp) {
mp_clear(&bntmp);
}
if (signum) {
retval = -retval;
}
-43
View File
@@ -4364,49 +4364,6 @@ ExtendUnicodeRepWithString(
}
*dst = 0;
}
/*
*----------------------------------------------------------------------
*
* Tcl_IsEmpty --
*
* Check whether the obj is the empty string.
*
* Results:
* 1 if the obj is ""
* 0 otherwise
*
* Side effects:
* If there is no other way to determine whethere the string
* representation is the empty string, the string representation
* is generated.
*
*----------------------------------------------------------------------
*/
int
Tcl_IsEmpty(
Tcl_Obj *objPtr)
{
if (objPtr == NULL) {
Tcl_Panic("%s: objPtr is NULL", "Tcl_IsEmpty");
}
if (!objPtr->bytes) {
if (TclHasInternalRep(objPtr, &tclDictType)) {
/* Since "dict" doesn't have a lengthProc */
Tcl_Size size;
Tcl_DictObjSize(NULL, objPtr, &size);
return !size;
}
Tcl_ObjTypeLengthProc *proc = TclObjTypeHasProc(objPtr, lengthProc);
if (proc != NULL) {
return !proc(objPtr);
}
(void)TclGetString(objPtr);
}
return !objPtr->length;
}
/*
*----------------------------------------------------------------------
+1 -1
View File
@@ -66,7 +66,7 @@ typedef struct {
((objPtr)->internalRep.twoPtrValue.ptr2 = NULL), \
((objPtr)->internalRep.twoPtrValue.ptr1 = (void *) (stringPtr))
#endif /* _TCLSTRINGREP */
#endif /* _TCLSTRINGREP */
/*
* Local Variables:
* mode: c
+10 -7
View File
@@ -69,6 +69,10 @@
# undef Tcl_WinConvertError
# define Tcl_WinConvertError 0
#endif
#if !defined(_WIN32)
# undef TclWinGetUserEncoding
# define TclWinGetUserEncoding 0
#endif
#undef TclGetStringFromObj
#if defined(TCL_NO_DEPRECATED)
# define TclGetStringFromObj 0
@@ -692,7 +696,7 @@ static const TclIntPlatStubs tclIntPlatStubs = {
TclpOpenFile, /* 7 */
TclpGetPid, /* 8 */
TclpCreateTempFile, /* 9 */
0, /* 10 */
TclWinGetUserEncoding, /* 10 */
TclGetAndDetachPids, /* 11 */
0, /* 12 */
0, /* 13 */
@@ -850,9 +854,9 @@ const TclStubs tclStubs = {
Tcl_DbNewStringObj, /* 28 */
Tcl_DuplicateObj, /* 29 */
TclFreeObj, /* 30 */
0, /* 31 */
0, /* 32 */
0, /* 33 */
Tcl_GetBoolean, /* 31 */
Tcl_GetBooleanFromObj, /* 32 */
Tcl_GetByteArrayFromObj, /* 33 */
Tcl_GetDouble, /* 34 */
Tcl_GetDoubleFromObj, /* 35 */
0, /* 36 */
@@ -900,7 +904,7 @@ const TclStubs tclStubs = {
Tcl_BadChannelOption, /* 78 */
Tcl_CallWhenDeleted, /* 79 */
Tcl_CancelIdleCall, /* 80 */
0, /* 81 */
Tcl_Close, /* 81 */
Tcl_CommandComplete, /* 82 */
Tcl_Concat, /* 83 */
Tcl_ConvertElement, /* 84 */
@@ -1509,8 +1513,7 @@ const TclStubs tclStubs = {
Tcl_UtfNcasecmp, /* 687 */
Tcl_NewWideUIntObj, /* 688 */
Tcl_SetWideUIntObj, /* 689 */
Tcl_IsEmpty, /* 690 */
TclUnusedStubEntry, /* 691 */
TclUnusedStubEntry, /* 690 */
};
/* !END!: Do not edit above this line. */
+69 -62
View File
@@ -829,9 +829,9 @@ Tcltest_SafeInit(
static int
TestasyncCmd(
TCL_UNUSED(void *),
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const *objv) /* Arguments. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const *objv) /* Arguments. */
{
TestAsyncHandler *asyncPtr, *prevPtr;
int id, code;
@@ -945,14 +945,14 @@ TestasyncCmd(
static int
AsyncHandlerProc(
void *clientData, /* If of TestAsyncHandler structure.
void *clientData, /* If of TestAsyncHandler structure.
* in global list. */
Tcl_Interp *interp, /* Interpreter in which command was
* executed, or NULL. */
int code) /* Current return code from command. */
{
TestAsyncHandler *asyncPtr;
int id = (int)PTR2INT(clientData);
int id = PTR2INT(clientData);
const char *listArgv[4];
char *cmd;
char string[TCL_INTEGER_SPACE];
@@ -1007,11 +1007,11 @@ AsyncHandlerProc(
static Tcl_ThreadCreateType
AsyncThreadProc(
void *clientData) /* Parameter is the id of a
void *clientData) /* Parameter is the id of a
* TestAsyncHandler, defined above. */
{
TestAsyncHandler *asyncPtr;
int id = (int)PTR2INT(clientData);
int id = PTR2INT(clientData);
Tcl_Sleep(1);
Tcl_MutexLock(&asyncTestMutex);
@@ -1064,7 +1064,7 @@ static int
Testcmdobj2Cmd(
TCL_UNUSED(void *),
Tcl_Interp *interp, /* Current interpreter. */
Tcl_Size objc, /* Number of arguments. */
Tcl_Size objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
{
Tcl_Obj *resultObj;
@@ -1101,7 +1101,7 @@ TestcmdinfoCmd(
TCL_UNUSED(void *),
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
Tcl_Obj *const objv[]) /* Argument objects. */
{
static const char *const subcmds[] = {
"call", "call2", "create", "delete", "get", "modify", NULL
@@ -1214,7 +1214,7 @@ TestcmdinfoCmd(
static int
CmdProc0(
void *clientData, /* String to return. */
void *clientData, /* String to return. */
Tcl_Interp *interp, /* Current interpreter. */
TCL_UNUSED(int) /*objc*/,
TCL_UNUSED(Tcl_Obj *const *) /*objv*/)
@@ -1226,7 +1226,7 @@ CmdProc0(
static int
CmdProc1(
void *clientData, /* String to return. */
void *clientData, /* String to return. */
Tcl_Interp *interp, /* Current interpreter. */
TCL_UNUSED(int) /*argc*/,
TCL_UNUSED(const char **) /*argv*/)
@@ -1237,7 +1237,7 @@ CmdProc1(
static int
CmdProc2(
void *clientData, /* String to return. */
void *clientData, /* String to return. */
Tcl_Interp *interp, /* Current interpreter. */
TCL_UNUSED(int) /*argc*/,
TCL_UNUSED(const char **) /*argv*/)
@@ -1248,7 +1248,7 @@ CmdProc2(
static void
CmdDelProc0(
void *clientData) /* String to save. */
void *clientData) /* String to save. */
{
TestCommandTokenRef *thisRefPtr, *prevRefPtr = NULL;
TestCommandTokenRef *refPtr = (TestCommandTokenRef *) clientData;
@@ -1270,7 +1270,7 @@ CmdDelProc0(
static void
CmdDelProc1(
void *clientData) /* String to save. */
void *clientData) /* String to save. */
{
Tcl_DStringInit(&delString);
Tcl_DStringAppend(&delString, "CmdDelProc1 ", -1);
@@ -1279,7 +1279,7 @@ CmdDelProc1(
static void
CmdDelProc2(
void *clientData) /* String to save. */
void *clientData) /* String to save. */
{
Tcl_DStringInit(&delString);
Tcl_DStringAppend(&delString, "CmdDelProc2 ", -1);
@@ -1477,12 +1477,12 @@ TestcmdtraceCmd(
static int
CmdTraceProc(
void *clientData, /* Pointer to buffer in which the
void *clientData, /* Pointer to buffer in which the
* command and arguments are appended.
* Accumulates test result. */
TCL_UNUSED(Tcl_Interp *),
TCL_UNUSED(int) /*level*/,
const char *command, /* The command being traced (after
const char *command, /* The command being traced (after
* substitutions). */
TCL_UNUSED(Tcl_Command) /*cmdProc*/,
int objc, /* Number of arguments. */
@@ -1583,7 +1583,7 @@ TestcreatecommandCmd(
TCL_UNUSED(void *),
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument strings. */
Tcl_Obj *const objv[]) /* Argument strings. */
{
if (objc != 2) {
Tcl_WrongNumArgs(interp, 1, objv, "option");
@@ -1702,10 +1702,10 @@ TestdcallCmd(
static void
DelCallbackProc(
void *clientData, /* Numerical value to append to delString. */
void *clientData, /* Numerical value to append to delString. */
Tcl_Interp *interp) /* Interpreter being deleted. */
{
int id = (int)PTR2INT(clientData);
int id = PTR2INT(clientData);
char buffer[TCL_INTEGER_SPACE];
TclFormatInt(buffer, id);
@@ -1764,7 +1764,7 @@ TestdelCmd(
static int
DelCmdProc(
void *clientData, /* String result to return. */
void *clientData, /* String result to return. */
Tcl_Interp *interp, /* Current interpreter. */
TCL_UNUSED(int) /*objv*/,
TCL_UNUSED(Tcl_Obj *const *) /*objv*/)
@@ -1779,7 +1779,7 @@ DelCmdProc(
static void
DelDeleteProc(
void *clientData) /* String command to evaluate. */
void *clientData) /* String command to evaluate. */
{
DelCmd *dPtr = (DelCmd *)clientData;
@@ -2039,8 +2039,12 @@ TestdstringCmd(
*/
static void SpecialFree(
void *blockPtr) /* Block to free. */
{
#if TCL_MAJOR_VERSION > 8
void *blockPtr /* Block to free. */
#else
char *blockPtr /* Block to free. */
#endif
) {
Tcl_Free(((char *)blockPtr) - 16);
}
@@ -2178,10 +2182,11 @@ static int UtfExtWrapper(
/* Caller should have specified the dest char limit */
Tcl_Obj *valueObj;
if (dstCharsVar == NULL ||
(valueObj = Tcl_ObjGetVar2(interp, dstCharsVar, NULL, 0)) == NULL) {
(valueObj = Tcl_ObjGetVar2(interp, dstCharsVar, NULL, 0)) == NULL
) {
Tcl_SetResult(interp,
"dstCharsVar must be specified with integer value if "
"TCL_ENCODING_CHAR_LIMIT set in flags.", TCL_STATIC);
"dstCharsVar must be specified with integer value if "
"TCL_ENCODING_CHAR_LIMIT set in flags.", TCL_STATIC);
return TCL_ERROR;
}
if (Tcl_GetIntFromObj(interp, valueObj, &dstChars) != TCL_OK) {
@@ -2371,7 +2376,7 @@ TestencodingCmd(
static int
EncodingToUtfProc(
void *clientData, /* TclEncoding structure. */
void *clientData, /* TclEncoding structure. */
TCL_UNUSED(const char *) /*src*/,
int srcLen, /* Source string length in bytes. */
TCL_UNUSED(int) /*flags*/,
@@ -2403,7 +2408,7 @@ EncodingToUtfProc(
static int
EncodingFromUtfProc(
void *clientData, /* TclEncoding structure. */
void *clientData, /* TclEncoding structure. */
TCL_UNUSED(const char *) /*src*/,
int srcLen, /* Source string length in bytes. */
TCL_UNUSED(int) /*flags*/,
@@ -2435,7 +2440,7 @@ EncodingFromUtfProc(
static void
EncodingFreeProc(
void *clientData) /* ClientData associated with type. */
void *clientData) /* ClientData associated with type. */
{
TclEncoding *encodingPtr = (TclEncoding *)clientData;
@@ -2694,7 +2699,7 @@ TesteventProc(
static int
TesteventDeleteProc(
Tcl_Event *event, /* Event to examine */
void *clientData) /* Tcl_Obj containing the name of the event(s)
void *clientData) /* Tcl_Obj containing the name of the event(s)
* to remove */
{
TestEvent *ev; /* Event to examine */
@@ -2767,7 +2772,7 @@ TestexithandlerCmd(
static void
ExitProcOdd(
void *clientData) /* Integer value to print. */
void *clientData) /* Integer value to print. */
{
char buf[16 + TCL_INTEGER_SPACE];
int len;
@@ -2781,7 +2786,7 @@ ExitProcOdd(
static void
ExitProcEven(
void *clientData) /* Integer value to print. */
void *clientData) /* Integer value to print. */
{
char buf[16 + TCL_INTEGER_SPACE];
int len;
@@ -2984,7 +2989,7 @@ TestexprstringCmd(
TCL_UNUSED(void *),
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const *objv) /* Argument strings. */
Tcl_Obj *const *objv) /* Argument strings. */
{
if (objc != 2) {
Tcl_WrongNumArgs(interp, 1, objv, "expression");
@@ -3656,9 +3661,9 @@ TestlinkCmd(
static int
TestlinkarrayCmd(
TCL_UNUSED(void *),
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
{
static const char *LinkOption[] = {
"update", "remove", "create", NULL
@@ -3775,9 +3780,9 @@ TestlinkarrayCmd(
static int
TestlistrepCmd(
TCL_UNUSED(void *),
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
{
/* Subcommands supported by this command */
static const char *const subcommands[] = {
@@ -3989,7 +3994,7 @@ TestlocaleCmd(
static void
CleanupTestSetassocdataTests(
void *clientData, /* Data to be released. */
void *clientData, /* Data to be released. */
TCL_UNUSED(Tcl_Interp *))
{
Tcl_Free(clientData);
@@ -4630,8 +4635,8 @@ TestregexpCmd(
static void
TestregexpXflags(
const char *string, /* The string of flags. */
size_t length, /* The length of the string in bytes. */
const char *string, /* The string of flags. */
size_t length, /* The length of the string in bytes. */
int *cflagsPtr, /* compile flags word */
int *eflagsPtr) /* exec flags word */
{
@@ -5793,12 +5798,12 @@ TestbytestringCmd(
static int
TestsetCmd(
void *data, /* Additional flags for Get/SetVar2. */
Tcl_Interp *interp, /* Current interpreter. */
void *data, /* Additional flags for Get/SetVar2. */
Tcl_Interp *interp,/* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const *objv) /* Arguments. */
{
int flags = (int)PTR2INT(data);
int flags = PTR2INT(data);
const char *value;
if (objc == 2) {
@@ -5824,12 +5829,12 @@ TestsetCmd(
}
static int
Testset2Cmd(
void *data, /* Additional flags for Get/SetVar2. */
Tcl_Interp *interp, /* Current interpreter. */
void *data, /* Additional flags for Get/SetVar2. */
Tcl_Interp *interp,/* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const *objv) /* Argument strings. */
{
int flags = (int)PTR2INT(data);
int flags = PTR2INT(data);
const char *value;
if (objc == 3) {
@@ -5874,7 +5879,7 @@ Testset2Cmd(
static int
TestmainthreadCmd(
TCL_UNUSED(void *),
Tcl_Interp *interp, /* Current interpreter. */
Tcl_Interp *interp,/* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const *objv)
{
@@ -6003,7 +6008,7 @@ TestChannelCmd(
Channel *chanPtr; /* The actual channel. */
ChannelState *statePtr; /* state info for channel */
Tcl_Channel chan; /* The opaque type. */
Tcl_Size len; /* Length of subcommand string. */
Tcl_Size len; /* Length of subcommand string. */
int IOQueued; /* How much IO is queued inside channel? */
char buf[TCL_INTEGER_SPACE];/* For snprintf. */
int mode; /* rw mode of the channel */
@@ -6703,7 +6708,7 @@ TestSocketCmd(
Tcl_Obj *const *objv) /* Additional args. */
{
const char *cmdName; /* Sub command. */
Tcl_Size len; /* Length of subcommand string. */
Tcl_Size len; /* Length of subcommand string. */
if (objc < 2) {
Tcl_WrongNumArgs(interp, 1, objv, "subcommand ?additional args..?");
@@ -6818,7 +6823,7 @@ static int
TestWrongNumArgsCmd(
TCL_UNUSED(void *),
Tcl_Interp *interp, /* Current interpreter. */
Tcl_Size objc, /* Number of arguments. */
Tcl_Size objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
{
Tcl_Size i, length;
@@ -7599,7 +7604,8 @@ TestGetUniCharCmd(
TCL_UNUSED(void *),
Tcl_Interp *interp, /* Current interpreter */
int objc, /* Number of arguments */
Tcl_Obj *const objv[]) /* Argument strings */
Tcl_Obj *const objv[] /* Argument strings */
)
{
int index;
int c ;
@@ -8341,9 +8347,11 @@ InterpCmdResolver(
if ( (name[0] == 'z') && (name[1] == '\0') ) {
Namespace *ns2NsPtr = (Namespace *) Tcl_FindNamespace(interp, "::ns2", NULL, 0);
if (procPtr != NULL && (
(procPtr->cmdPtr->nsPtr == iPtr->globalNsPtr)
|| (ns2NsPtr != NULL && procPtr->cmdPtr->nsPtr == ns2NsPtr))) {
if (procPtr != NULL
&& ((procPtr->cmdPtr->nsPtr == iPtr->globalNsPtr)
|| (ns2NsPtr != NULL && procPtr->cmdPtr->nsPtr == ns2NsPtr)
)
) {
/*
* Case A)
*
@@ -8425,7 +8433,7 @@ InterpVarResolver(
}
typedef struct MyResolvedVarInfo {
Tcl_ResolvedVarInfo vInfo; /* This must be the first element. */
Tcl_ResolvedVarInfo vInfo; /* This must be the first element. */
Tcl_Var var;
Tcl_Obj *nameObj;
} MyResolvedVarInfo;
@@ -8587,11 +8595,10 @@ TestInterpResolverCmd(
*
*------------------------------------------------------------------------
*/
int
TestApplyLambdaCmd(
int TestApplyLambdaCmd (
TCL_UNUSED(void*),
Tcl_Interp *interp, /* Current interpreter. */
TCL_UNUSED(int), /* objc. */
Tcl_Interp *interp, /* Current interpreter. */
TCL_UNUSED(int), /* objc. */
TCL_UNUSED(Tcl_Obj *const *)) /* objv. */
{
Tcl_Obj *lambdaObjs[2];
+19 -18
View File
@@ -50,11 +50,11 @@ static void UpdateStringOfLString(Tcl_Obj *objPtr);
*/
typedef struct LString {
char *string; // NULL terminated utf-8 string
Tcl_Size strlen; // num bytes in string
Tcl_Size allocated; // num bytes allocated
Tcl_Obj**elements; // elements array, allocated when GetElements is
// called
char *string; // NULL terminated utf-8 string
Tcl_Size strlen; // num bytes in string
Tcl_Size allocated; // num bytes allocated
Tcl_Obj**elements; // elements array, allocated when GetElements is
// called
} LString;
/*
@@ -605,17 +605,17 @@ my_LStringReplace(
}
// move front elements to keep
for (x=0, kx=0; x<newLen && kx<first; kx++, x++) {
for(x=0, kx=0; x<newLen && kx<first; kx++, x++) {
newStr[x] = oldStr[kx];
}
// Insert new elements into new string
for (x=first, ix=0; ix<numToInsert; x++, ix++) {
for(x=first, ix=0; ix<numToInsert; x++, ix++) {
char const *svalue = Tcl_GetString(insertObjs[ix]);
newStr[x] = svalue[0];
}
// Move remaining elements
if ((first+numToDelete) < newLen) {
for (/*x,*/ kx=first+numToDelete; (kx <lstringRep->strlen && x<newLen); x++, kx++) {
for(/*x,*/ kx=first+numToDelete; (kx <lstringRep->strlen && x<newLen); x++, kx++) {
newStr[x] = oldStr[kx];
}
}
@@ -833,8 +833,8 @@ UpdateStringOfLString(Tcl_Obj *objPtr)
int localFlags[LOCAL_SIZE], *flagPtr = NULL;
Tcl_ObjType const *typePtr = objPtr->typePtr;
char *p;
Tcl_Size bytesNeeded = 0;
Tcl_Size llen, i;
int bytesNeeded = 0;
int llen, i;
/*
@@ -952,11 +952,11 @@ lLStringObjCmd(
* Internal rep for the Generate Series
*/
typedef struct LgenSeries {
Tcl_Interp *interp; // used to evaluate gen script
Tcl_Size len; // list length
Tcl_Size nargs; // Number of arguments in genFn including "index"
Tcl_Obj *genFnObj; // The preformed command as a list. Index is set in
// the last element (last argument)
Tcl_Interp *interp; // used to evaluate gen script
Tcl_Size len; // list length
Tcl_Size nargs; // Number of arguments in genFn including "index"
Tcl_Obj *genFnObj; // The preformed command as a list. Index is set in
// the last element (last argument)
} LgenSeries;
/*
@@ -1047,7 +1047,7 @@ UpdateStringOfLgen(Tcl_Obj *objPtr)
LgenSeries *lgenSeriesRepPtr;
Tcl_Obj *element;
Tcl_Size i;
size_t bytlen;
Tcl_Size bytlen;
Tcl_Obj *tmpstr = Tcl_NewObj();
lgenSeriesRepPtr = (LgenSeries*)objPtr->internalRep.twoPtrValue.ptr1;
@@ -1062,8 +1062,9 @@ UpdateStringOfLgen(Tcl_Obj *objPtr)
}
}
bytlen = Tcl_GetCharLength(tmpstr);
Tcl_InitStringRep(objPtr, Tcl_GetString(tmpstr), bytlen);
char *str = Tcl_GetStringFromObj(tmpstr, &bytlen);
TclOOM(Tcl_InitStringRep(objPtr, str, bytlen), bytlen+1);
Tcl_DecrRefCount(tmpstr);
return;
+17 -44
View File
@@ -46,7 +46,6 @@ static Tcl_ObjCmdProc TestlistobjCmd;
static Tcl_ObjCmdProc TestobjCmd;
static Tcl_ObjCmdProc TeststringobjCmd;
static Tcl_ObjCmdProc TestbigdataCmd;
static Tcl_ObjCmdProc TestisemptyCmd;
#define VARPTR_KEY "TCLOBJTEST_VARPTR"
#define NUMBER_OF_OBJECT_VARS 20
@@ -134,8 +133,6 @@ TclObjTest_Init(
Tcl_CreateObjCommand(interp, "testobj", TestobjCmd, NULL, NULL);
Tcl_CreateObjCommand(interp, "teststringobj", TeststringobjCmd,
NULL, NULL);
Tcl_CreateObjCommand(interp, "testisempty", TestisemptyCmd,
NULL, NULL);
if (sizeof(Tcl_Size) == sizeof(Tcl_WideInt)) {
Tcl_CreateObjCommand(interp, "testbigdata", TestbigdataCmd,
NULL, NULL);
@@ -593,7 +590,7 @@ TestindexobjCmd(
*/
struct IndexRep {
void *tablePtr; /* Pointer to the table of strings. */
Tcl_Size offset; /* Offset between table entries. */
Tcl_Size offset; /* Offset between table entries. */
Tcl_Size index; /* Selected index into table. */
} *indexRep;
@@ -921,8 +918,8 @@ TestlistobjCmd(
} cmdIndex;
Tcl_Size varIndex; /* Variable number converted to binary */
Tcl_Size first; /* First index in the list */
Tcl_Size count; /* Count of elements in a list */
Tcl_Size first; /* First index in the list */
Tcl_Size count; /* Count of elements in a list */
Tcl_Obj **varPtr;
Tcl_Size i, len;
@@ -1082,13 +1079,13 @@ static int V1TestListObjIndex(
static const Tcl_ObjType v1TestListType = {
"testlist", /* name */
NULL, /* freeIntRepProc */
NULL, /* dupIntRepProc */
NULL, /* updateStringProc */
NULL, /* setFromAnyProc */
offsetof(Tcl_ObjType, indexProc), /* This is a V1 objType, which doesn't have an indexProc */
V1TestListObjLength, /* always return 100, doesn't really matter */
V1TestListObjIndex, /* should never be accessed, because this objType = V1*/
NULL, /* freeIntRepProc */
NULL, /* dupIntRepProc */
NULL, /* updateStringProc */
NULL, /* setFromAnyProc */
offsetof(Tcl_ObjType, indexProc), /* This is a V1 objType, which doesn't have an indexProc */
V1TestListObjLength, /* always return 100, doesn't really matter */
V1TestListObjIndex, /* should never be accessed, because this objType = V1*/
NULL, NULL, NULL, NULL, NULL, NULL
};
@@ -1493,7 +1490,7 @@ TeststringobjCmd(
}
Tcl_SetWideIntObj(Tcl_GetObjResult(interp), length);
break;
case 10: { /* range */
case 10: { /* range */
Tcl_Size first, last;
if (objc != 5) {
goto wrongNumArgs;
@@ -1567,7 +1564,7 @@ TeststringobjCmd(
Tcl_AppendUnicodeToObj(varPtr[varIndex], unicode + length, size - length);
Tcl_SetObjResult(interp, varPtr[varIndex]);
break;
case 13: /* newunicode*/
case 13: /* newunicode*/
unicode = (Tcl_UniChar *)Tcl_Alloc((objc - 3) * sizeof(Tcl_UniChar));
for (i = 0; i < (objc - 3); ++i) {
int val;
@@ -1613,9 +1610,9 @@ TeststringobjCmd(
static int
TestbigdataCmd (
TCL_UNUSED(void *),
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
{
static const char *const subcmds[] = {
"string", "bytearray", "list", "dict", NULL
@@ -1670,7 +1667,7 @@ TestbigdataCmd (
Tcl_DStringSetLength(&ds, len);/* Also stores \0 at index len+1 */
s = Tcl_DStringValue(&ds);
for (i = 0; i < len; ++i) {
s[i] = '0' + (char)(i % PATTERN_LEN);
s[i] = '0' + (i % PATTERN_LEN);
}
if (split >= 0) {
assert(split < len);
@@ -1682,7 +1679,7 @@ TestbigdataCmd (
objPtr = Tcl_NewByteArrayObj(NULL, len);
p = Tcl_GetByteArrayFromObj(objPtr, &len);
for (i = 0; i < len; ++i) {
p[i] = (char)('0' + (i % PATTERN_LEN));
p[i] = '0' + (i % PATTERN_LEN);
}
if (split >= 0) {
assert(split < len);
@@ -1831,30 +1828,6 @@ CheckIfVarUnset(
return 0;
}
static int
TestisemptyCmd (
TCL_UNUSED(void *),
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
{
Tcl_Obj *result;
if (objc != 2) {
Tcl_WrongNumArgs(interp, 1, objv, "value");
return TCL_ERROR;
}
result = Tcl_NewIntObj(Tcl_IsEmpty(objv[1]));
if (!objv[1]->bytes) {
Tcl_AppendToObj(result, " pure", TCL_INDEX_NONE);
}
if (objv[1]->typePtr) {
Tcl_AppendToObj(result, " ", TCL_INDEX_NONE);
Tcl_AppendToObj(result, objv[1]->typePtr->name, TCL_INDEX_NONE);
}
Tcl_SetObjResult(interp, result);
return TCL_OK;
}
/*
* Local Variables:
* mode: c
+1 -1
View File
@@ -38,7 +38,7 @@ static const char checkCommand[] = "check";
*/
typedef struct {
const char *cmdName; /* command name */
const char *cmdName; /* command name */
Tcl_ObjCmdProc *proc; /* command proc */
int exportIt; /* if 1, export the command */
} CmdTable;
+4 -3
View File
@@ -23,9 +23,9 @@
*/
typedef struct {
int num; /* Number of objects remembered */
int max; /* Max size of the array */
void **list; /* List of pointers */
int num; /* Number of objects remembered */
int max; /* Max size of the array */
void **list; /* List of pointers */
} SyncObjRecord;
static SyncObjRecord keyRecord = {0, 0, NULL};
@@ -109,6 +109,7 @@ Tcl_GetThreadData(
void *
TclThreadDataKeyGet(
Tcl_ThreadDataKey *keyPtr) /* Identifier for the data chunk. */
{
#if TCL_THREADS
return TclThreadStorageKeyGet(keyPtr);
+1 -1
View File
@@ -92,7 +92,7 @@ typedef struct {
size_t numRemoves; /* Number of removes from bucket */
size_t numInserts; /* Number of inserts into bucket */
size_t numLocks; /* Number of locks acquired */
size_t totalAssigned; /* Total space assigned to bucket */
size_t totalAssigned; /* Total space assigned to bucket */
} Bucket;
/*
+1 -1
View File
@@ -48,7 +48,7 @@ static struct {
*/
typedef struct {
void **tablePtr; /* The table of Tcl TSDs. */
void **tablePtr; /* The table of Tcl TSDs. */
sig_atomic_t allocated; /* The size of the table in the current
* thread. */
} TSDTable;
+1
View File
@@ -101,6 +101,7 @@ typedef struct ThreadEventResult {
struct ThreadEvent *eventPtr; /* Back pointer */
struct ThreadEventResult *nextPtr; /* List for cleanup */
struct ThreadEventResult *prevPtr;
} ThreadEventResult;
static ThreadEventResult *resultList;
+9 -9
View File
@@ -21,7 +21,7 @@
typedef struct TimerHandler {
Tcl_Time time; /* When timer is to fire. */
Tcl_TimerProc *proc; /* Function to call. */
void *clientData; /* Argument to pass to proc. */
void *clientData; /* Argument to pass to proc. */
Tcl_TimerToken token; /* Identifies handler so it can be deleted. */
struct TimerHandler *nextPtr;
/* Next event in queue, or NULL for end of
@@ -73,7 +73,7 @@ typedef struct AfterAssocData {
typedef struct IdleHandler {
Tcl_IdleProc *proc; /* Function to call. */
void *clientData; /* Value to pass to proc. */
void *clientData; /* Value to pass to proc. */
int generation; /* Used to distinguish older handlers from
* recently-created ones. */
struct IdleHandler *nextPtr;/* Next in list of active handlers. */
@@ -251,7 +251,7 @@ Tcl_CreateTimerHandler(
int milliseconds, /* How many milliseconds to wait before
* invoking proc. */
Tcl_TimerProc *proc, /* Function to invoke. */
void *clientData) /* Arbitrary data to pass to proc. */
void *clientData) /* Arbitrary data to pass to proc. */
{
Tcl_Time time;
@@ -619,7 +619,7 @@ TimerHandlerEventProc(
void
Tcl_DoWhenIdle(
Tcl_IdleProc *proc, /* Function to invoke. */
void *clientData) /* Arbitrary value to pass to proc. */
void *clientData) /* Arbitrary value to pass to proc. */
{
IdleHandler *idlePtr;
Tcl_Time blockTime;
@@ -663,7 +663,7 @@ Tcl_DoWhenIdle(
void
Tcl_CancelIdleCall(
Tcl_IdleProc *proc, /* Function that was previously registered. */
void *clientData) /* Arbitrary value to pass to proc. */
void *clientData) /* Arbitrary value to pass to proc. */
{
IdleHandler *idlePtr, *prevPtr;
IdleHandler *nextPtr;
@@ -1115,7 +1115,7 @@ GetAfterEvent(
return NULL;
}
cmdString += 6;
id = (int)strtoul(cmdString, &end, 10);
id = strtoul(cmdString, &end, 10);
if ((end == cmdString) || (*end != 0)) {
return NULL;
}
@@ -1149,7 +1149,7 @@ GetAfterEvent(
static void
AfterProc(
void *clientData) /* Describes command to execute. */
void *clientData) /* Describes command to execute. */
{
AfterInfo *afterPtr = (AfterInfo *)clientData;
AfterAssocData *assocPtr = afterPtr->assocPtr;
@@ -1214,7 +1214,7 @@ AfterProc(
static void
FreeAfterPtr(
AfterInfo *afterPtr) /* Command to be deleted. */
AfterInfo *afterPtr) /* Command to be deleted. */
{
AfterInfo *prevPtr;
AfterAssocData *assocPtr = afterPtr->assocPtr;
@@ -1251,7 +1251,7 @@ FreeAfterPtr(
static void
AfterCleanupProc(
void *clientData, /* Points to AfterAssocData for the
void *clientData, /* Points to AfterAssocData for the
* interpreter. */
TCL_UNUSED(Tcl_Interp *))
{
+33 -33
View File
@@ -22,7 +22,7 @@ typedef struct {
int flags; /* Operations for which Tcl command is to be
* invoked. */
Tcl_Size length; /* Number of non-NUL chars. in command. */
char command[TCLFLEXARRAY]; /* Space for Tcl command to invoke. Actual
char command[TCLFLEXARRAY]; /* Space for Tcl command to invoke. Actual
* size will be as large as necessary to hold
* command. This field must be the last in the
* structure, so that it can be larger than 1
@@ -44,7 +44,7 @@ typedef struct {
Tcl_Size length; /* Number of non-NUL chars. in command. */
Tcl_Trace stepTrace; /* Used for execution traces, when tracing
* inside the given command */
Tcl_Size startLevel; /* Used for bookkeeping with step execution
Tcl_Size startLevel; /* Used for bookkeeping with step execution
* traces, store the level at which the step
* trace was invoked */
char *startCmd; /* Used for bookkeeping with step execution
@@ -56,7 +56,7 @@ typedef struct {
* deleted too early. Keeps track of how many
* pieces of code have a pointer to this
* structure. */
char command[TCLFLEXARRAY]; /* Space for Tcl command to invoke. Actual
char command[TCLFLEXARRAY]; /* Space for Tcl command to invoke. Actual
* size will be as large as necessary to hold
* command. This field must be the last in the
* structure, so that it can be larger than 1
@@ -146,7 +146,7 @@ static int TraceVarEx(Tcl_Interp *interp, const char *part1,
*/
typedef struct {
void *clientData; /* Client data from Tcl_CreateTrace */
void *clientData; /* Client data from Tcl_CreateTrace */
Tcl_CmdTraceProc *proc; /* Trace function from Tcl_CreateTrace */
} StringTraceData;
@@ -279,8 +279,8 @@ Tcl_TraceObjCmd(
static int
TraceExecutionObjCmd(
Tcl_Interp *interp, /* Current interpreter. */
enum traceOptionsEnum optionIndex, /* Add, info or remove */
Tcl_Size objc, /* Number of arguments. */
enum traceOptionsEnum optionIndex, /* Add, info or remove */
Tcl_Size objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
{
const char *name, *command;
@@ -526,8 +526,8 @@ TraceExecutionObjCmd(
static int
TraceCommandObjCmd(
Tcl_Interp *interp, /* Current interpreter. */
enum traceOptionsEnum optionIndex, /* Add, info or remove */
Tcl_Size objc, /* Number of arguments. */
enum traceOptionsEnum optionIndex, /* Add, info or remove */
Tcl_Size objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
{
const char *name, *command;
@@ -720,8 +720,8 @@ TraceCommandObjCmd(
static int
TraceVariableObjCmd(
Tcl_Interp *interp, /* Current interpreter. */
enum traceOptionsEnum optionIndex, /* Add, info or remove */
Tcl_Size objc, /* Number of arguments. */
enum traceOptionsEnum optionIndex, /* Add, info or remove */
Tcl_Size objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
{
const char *name, *command;
@@ -981,7 +981,7 @@ Tcl_TraceCommand(
* of the TRACE_*_EXEC flags */
Tcl_CommandTraceProc *proc, /* Function to call when specified ops are
* invoked upon cmdName. */
void *clientData) /* Arbitrary argument to pass to proc. */
void *clientData) /* Arbitrary argument to pass to proc. */
{
Command *cmdPtr;
CommandTrace *tracePtr;
@@ -1044,7 +1044,7 @@ Tcl_UntraceCommand(
* TCL_TRACE_RENAME, TCL_TRACE_DELETE, and any
* of the TRACE_*_EXEC flags */
Tcl_CommandTraceProc *proc, /* Function assocated with trace. */
void *clientData) /* Arbitrary argument to pass to proc. */
void *clientData) /* Arbitrary argument to pass to proc. */
{
CommandTrace *tracePtr;
CommandTrace *prevPtr;
@@ -1149,7 +1149,7 @@ Tcl_UntraceCommand(
static void
TraceCommandProc(
void *clientData, /* Information about the command trace. */
void *clientData, /* Information about the command trace. */
Tcl_Interp *interp, /* Interpreter containing command. */
const char *oldName, /* Name of command being changed. */
const char *newName, /* New name of command. Empty string or NULL
@@ -1294,7 +1294,7 @@ TclCheckExecutionTraces(
Command *cmdPtr, /* Points to command's Command struct. */
int code, /* The current result code. */
int traceFlags, /* Current tracing situation. */
Tcl_Size objc, /* Number of arguments for the command. */
Tcl_Size objc, /* Number of arguments for the command. */
Tcl_Obj *const objv[]) /* Pointers to Tcl_Obj of each argument. */
{
Interp *iPtr = (Interp *) interp;
@@ -1400,7 +1400,7 @@ TclCheckInterpTraces(
Command *cmdPtr, /* Points to command's Command struct. */
int code, /* The current result code. */
int traceFlags, /* Current tracing situation. */
Tcl_Size objc, /* Number of arguments for the command. */
Tcl_Size objc, /* Number of arguments for the command. */
Tcl_Obj *const objv[]) /* Pointers to Tcl_Obj of each argument. */
{
Interp *iPtr = (Interp *) interp;
@@ -1538,7 +1538,7 @@ TclCheckInterpTraces(
static int
CallTraceFunction(
Tcl_Interp *interp, /* The current interpreter. */
Trace *tracePtr, /* Describes the trace function to call. */
Trace *tracePtr, /* Describes the trace function to call. */
Command *cmdPtr, /* Points to command's Command struct. */
const char *command, /* Points to the first character of the
* command's source before substitutions. */
@@ -1787,7 +1787,7 @@ TraceExecutionProc(
if ((flags & TCL_TRACE_ENTER_EXEC) && (tcmdPtr->stepTrace == NULL)
&& (tcmdPtr->flags & (TCL_TRACE_ENTER_DURING_EXEC |
TCL_TRACE_LEAVE_DURING_EXEC))) {
size_t len = strlen(command) + 1;
unsigned len = strlen(command) + 1;
tcmdPtr->startLevel = level;
tcmdPtr->startCmd = (char *)Tcl_Alloc(len);
@@ -1833,7 +1833,7 @@ TraceExecutionProc(
static char *
TraceVarProc(
void *clientData, /* Information about the variable trace. */
void *clientData, /* Information about the variable trace. */
Tcl_Interp *interp, /* Interpreter containing variable. */
const char *name1, /* Name of variable or array. */
const char *name2, /* Name of element within array; NULL means
@@ -1995,10 +1995,10 @@ traceWrapperProc(
Tcl_Obj *const objv[])
{
TraceWrapperInfo *info = (TraceWrapperInfo *)clientData;
if (objc > INT_MAX || objc < 0) {
if (objc > INT_MAX) {
objc = -1; /* Signal Tcl_CmdObjTraceProc that objc is out of range */
}
return info->proc(info->clientData, interp, (int)level, command, commandInfo, (int)objc, objv);
return info->proc(info->clientData, interp, (int)level, command, commandInfo, objc, objv);
}
static void
@@ -2016,10 +2016,10 @@ traceWrapperDelProc(
Tcl_Trace
Tcl_CreateObjTrace(
Tcl_Interp *interp, /* Tcl interpreter */
Tcl_Size level, /* Maximum nesting level */
Tcl_Size level, /* Maximum nesting level */
int flags, /* Flags, see above */
Tcl_CmdObjTraceProc *proc, /* Trace callback */
void *clientData, /* Client data for the callback */
void *clientData, /* Client data for the callback */
Tcl_CmdObjTraceDeleteProc *delProc)
/* Function to call when trace is deleted */
{
@@ -2035,10 +2035,10 @@ Tcl_CreateObjTrace(
Tcl_Trace
Tcl_CreateObjTrace2(
Tcl_Interp *interp, /* Tcl interpreter */
Tcl_Size level, /* Maximum nesting level */
Tcl_Size level, /* Maximum nesting level */
int flags, /* Flags, see above */
Tcl_CmdObjTraceProc2 *proc, /* Trace callback */
void *clientData, /* Client data for the callback */
void *clientData, /* Client data for the callback */
Tcl_CmdObjTraceDeleteProc *delProc)
/* Function to call when trace is deleted */
{
@@ -2124,11 +2124,11 @@ Tcl_CreateObjTrace2(
Tcl_Trace
Tcl_CreateTrace(
Tcl_Interp *interp, /* Interpreter in which to create trace. */
Tcl_Size level, /* Only call proc for commands at nesting
Tcl_Size level, /* Only call proc for commands at nesting
* level<=argument level (1=>top level). */
Tcl_CmdTraceProc *proc, /* Function to call before executing each
* command. */
void *clientData) /* Arbitrary value word to pass to proc. */
void *clientData) /* Arbitrary value word to pass to proc. */
{
StringTraceData *data = (StringTraceData *)Tcl_Alloc(sizeof(StringTraceData));
@@ -2187,8 +2187,8 @@ StringTraceProc(
* either command or argv.
*/
data->proc(data->clientData, interp, (int)level, (char *) command,
cmdPtr->proc, cmdPtr->clientData, (int)objc, argv);
data->proc(data->clientData, interp, level, (char *) command,
cmdPtr->proc, cmdPtr->clientData, objc, argv);
TclStackFree(interp, (void *) argv);
return TCL_OK;
@@ -2393,7 +2393,7 @@ TclCheckArrayTraces(
Var *varPtr,
Var *arrayPtr,
Tcl_Obj *name,
Tcl_Size index)
int index)
{
int code = TCL_OK;
@@ -2446,7 +2446,7 @@ TclObjCallVarTraces(
int leaveErrMsg, /* If true, and one of the traces indicates an
* error, then leave an error message and
* stack trace information in *iPTr. */
Tcl_Size index) /* Index into the local variable table of the
int index) /* Index into the local variable table of the
* variable, or -1. Only used when part1Ptr is
* NULL. */
{
@@ -2528,7 +2528,7 @@ TclCallVarTraces(
} while (*p != '\0');
p--;
if (*p == ')') {
Tcl_Size offset = (openParen - part1);
int offset = (openParen - part1);
char *newPart1;
Tcl_DStringInit(&nameCopy);
@@ -2776,7 +2776,7 @@ Tcl_UntraceVar2(
* TCL_TRACE_WRITES, TCL_TRACE_UNSETS,
* TCL_GLOBAL_ONLY, and TCL_NAMESPACE_ONLY. */
Tcl_VarTraceProc *proc, /* Function associated with trace. */
void *clientData) /* Arbitrary argument to pass to proc. */
void *clientData) /* Arbitrary argument to pass to proc. */
{
VarTrace *tracePtr;
VarTrace *prevPtr, *nextPtr;
@@ -2979,7 +2979,7 @@ Tcl_TraceVar2(
* TCL_NAMESPACE_ONLY. */
Tcl_VarTraceProc *proc, /* Function to call when specified ops are
* invoked upon varName. */
void *clientData) /* Arbitrary argument to pass to proc. */
void *clientData) /* Arbitrary argument to pass to proc. */
{
VarTrace *tracePtr;
int result;
+16 -16
View File
@@ -552,7 +552,7 @@ Tcl_UtfToChar16(
&& ((src[1] & 0xC0) == 0x80) && ((src[2] & 0xC0) == 0x80)
&& (((((byte - 0x10) << 2) & 0xFC) | 0xD800) == (*chPtr & 0xFCFC))
&& ((src[1] & 0xF0) == (((*chPtr << 4) & 0x30) | 0x80))) {
*chPtr = (unsigned short)(((src[1] & 0x0F) << 6) + (src[2] & 0x3F) + 0xDC00);
*chPtr = ((src[1] & 0x0F) << 6) + (src[2] & 0x3F) + 0xDC00;
return 3;
}
if ((unsigned)(byte-0x80) < (unsigned)0x20) {
@@ -604,7 +604,7 @@ Tcl_UtfToChar16(
| ((src[2] & 0x3F) >> 4)) - 0x40;
if (high < 0x400) {
/* produce high surrogate, advance source pointer */
*chPtr = (unsigned short)(0xD800 + high);
*chPtr = 0xD800 + high;
return 1;
}
/* out of range, < 0x10000 or > 0x10FFFF */
@@ -801,9 +801,9 @@ Tcl_UtfCharComplete(
Tcl_Size
Tcl_NumUtfChars(
const char *src, /* The UTF-8 string to measure. */
Tcl_Size length) /* The length of the string in bytes, or
* negative value for strlen(src). */
const char *src, /* The UTF-8 string to measure. */
Tcl_Size length) /* The length of the string in bytes, or
* negative value for strlen(src). */
{
Tcl_UniChar ch = 0;
Tcl_Size i = 0;
@@ -853,9 +853,9 @@ Tcl_NumUtfChars(
Tcl_Size
TclNumUtfChars(
const char *src, /* The UTF-8 string to measure. */
Tcl_Size length) /* The length of the string in bytes, or
* negative for strlen(src). */
const char *src, /* The UTF-8 string to measure. */
Tcl_Size length) /* The length of the string in bytes, or
* negative for strlen(src). */
{
unsigned short ch = 0;
Tcl_Size i = 0;
@@ -1177,8 +1177,8 @@ Tcl_UtfPrev(
int
Tcl_UniCharAtIndex(
const char *src, /* The UTF-8 string to dereference. */
Tcl_Size index) /* The position of the desired character. */
const char *src, /* The UTF-8 string to dereference. */
Tcl_Size index) /* The position of the desired character. */
{
Tcl_UniChar ch = 0;
int i = 0;
@@ -1213,8 +1213,8 @@ Tcl_UniCharAtIndex(
const char *
Tcl_UtfAtIndex(
const char *src, /* The UTF-8 string. */
Tcl_Size index) /* The position of the desired character. */
const char *src, /* The UTF-8 string. */
Tcl_Size index) /* The position of the desired character. */
{
Tcl_UniChar ch = 0;
@@ -1226,8 +1226,8 @@ Tcl_UtfAtIndex(
const char *
TclUtfAtIndex(
const char *src, /* The UTF-8 string. */
Tcl_Size index) /* The position of the desired character. */
const char *src, /* The UTF-8 string. */
Tcl_Size index) /* The position of the desired character. */
{
unsigned short ch = 0;
Tcl_Size len = 0;
@@ -1646,8 +1646,8 @@ TclUtfNcasecmp(
} else if ((ch2 & 0xFC00) == 0xD800) {
return -ch2;
}
ch1 = (unsigned short)Tcl_UniCharToLower(ch1);
ch2 = (unsigned short)Tcl_UniCharToLower(ch2);
ch1 = Tcl_UniCharToLower(ch1);
ch2 = Tcl_UniCharToLower(ch2);
if (ch1 != ch2) {
return (ch1 - ch2);
}
+57 -59
View File
@@ -1051,7 +1051,7 @@ TclScanElement(
Tcl_Size extra = 0; /* Count of number of extra bytes needed for
* formatted element, assuming we use escape
* sequences in formatting. */
Tcl_Size bytesNeeded; /* Buffer length computed to complete the
Tcl_Size bytesNeeded; /* Buffer length computed to complete the
* element formatting in the selected mode. */
#if COMPAT
int preferEscape = 0; /* Use preferences to track whether to use */
@@ -1338,9 +1338,9 @@ TclScanElement(
Tcl_Size
Tcl_ConvertElement(
const char *src, /* Source information for list element. */
char *dst, /* Place to put list-ified element. */
int flags) /* Flags produced by Tcl_ScanElement. */
const char *src, /* Source information for list element. */
char *dst, /* Place to put list-ified element. */
int flags) /* Flags produced by Tcl_ScanElement. */
{
return Tcl_ConvertCountedElement(src, TCL_INDEX_NONE, dst, flags);
}
@@ -1368,7 +1368,7 @@ Tcl_ConvertElement(
Tcl_Size
Tcl_ConvertCountedElement(
const char *src, /* Source information for list element. */
const char *src, /* Source information for list element. */
Tcl_Size length, /* Number of bytes in src, or TCL_INDEX_NONE. */
char *dst, /* Place to put list-ified element. */
int flags) /* Flags produced by Tcl_ScanElement. */
@@ -1401,7 +1401,7 @@ Tcl_ConvertCountedElement(
Tcl_Size
TclConvertElement(
const char *src, /* Source information for list element. */
const char *src, /* Source information for list element. */
Tcl_Size length, /* Number of bytes in src, or TCL_INDEX_NONE. */
char *dst, /* Place to put list-ified element. */
int flags) /* Flags produced by Tcl_ScanElement. */
@@ -1582,7 +1582,7 @@ TclConvertElement(
char *
Tcl_Merge(
Tcl_Size argc, /* How many strings to merge. */
Tcl_Size argc, /* How many strings to merge. */
const char *const *argv) /* Array of string values. */
{
#define LOCAL_SIZE 64
@@ -1627,9 +1627,7 @@ Tcl_Merge(
result = (char *)Tcl_Alloc(bytesNeeded);
dst = result;
for (i = 0; i < argc; i++) {
if (i) {
flagPtr[i] |= DONT_QUOTE_HASH;
}
flagPtr[i] |= ( i ? DONT_QUOTE_HASH : 0 );
dst += TclConvertElement(argv[i], TCL_INDEX_NONE, dst, flagPtr[i]);
*dst = ' ';
dst++;
@@ -1661,14 +1659,14 @@ Tcl_Merge(
Tcl_Size
TclTrimRight(
const char *bytes, /* String to be trimmed... */
Tcl_Size numBytes, /* ...and its length in bytes */
/* Calls to TclUtfToUniChar() in this routine
* rely on (bytes[numBytes] == '\0'). */
const char *trim, /* String of trim characters... */
Tcl_Size numTrim) /* ...and its length in bytes */
/* Calls to TclUtfToUniChar() in this routine
* rely on (trim[numTrim] == '\0'). */
const char *bytes, /* String to be trimmed... */
Tcl_Size numBytes, /* ...and its length in bytes */
/* Calls to TclUtfToUniChar() in this routine
* rely on (bytes[numBytes] == '\0'). */
const char *trim, /* String of trim characters... */
Tcl_Size numTrim) /* ...and its length in bytes */
/* Calls to TclUtfToUniChar() in this routine
* rely on (trim[numTrim] == '\0'). */
{
const char *pp, *p = bytes + numBytes;
int ch1, ch2;
@@ -1740,14 +1738,14 @@ TclTrimRight(
Tcl_Size
TclTrimLeft(
const char *bytes, /* String to be trimmed... */
Tcl_Size numBytes, /* ...and its length in bytes */
/* Calls to TclUtfToUniChar() in this routine
* rely on (bytes[numBytes] == '\0'). */
const char *trim, /* String of trim characters... */
Tcl_Size numTrim) /* ...and its length in bytes */
/* Calls to TclUtfToUniChar() in this routine
* rely on (trim[numTrim] == '\0'). */
const char *bytes, /* String to be trimmed... */
Tcl_Size numBytes, /* ...and its length in bytes */
/* Calls to TclUtfToUniChar() in this routine
* rely on (bytes[numBytes] == '\0'). */
const char *trim, /* String of trim characters... */
Tcl_Size numTrim) /* ...and its length in bytes */
/* Calls to TclUtfToUniChar() in this routine
* rely on (trim[numTrim] == '\0'). */
{
const char *p = bytes;
int ch1, ch2;
@@ -1814,14 +1812,14 @@ TclTrimLeft(
Tcl_Size
TclTrim(
const char *bytes, /* String to be trimmed... */
Tcl_Size numBytes, /* ...and its length in bytes */
/* Calls in this routine
* rely on (bytes[numBytes] == '\0'). */
const char *trim, /* String of trim characters... */
Tcl_Size numTrim, /* ...and its length in bytes */
/* Calls in this routine
* rely on (trim[numTrim] == '\0'). */
const char *bytes, /* String to be trimmed... */
Tcl_Size numBytes, /* ...and its length in bytes */
/* Calls in this routine
* rely on (bytes[numBytes] == '\0'). */
const char *trim, /* String of trim characters... */
Tcl_Size numTrim, /* ...and its length in bytes */
/* Calls in this routine
* rely on (trim[numTrim] == '\0'). */
Tcl_Size *trimRightPtr) /* Offset from the end of the string. */
{
Tcl_Size trimLeft = 0, trimRight = 0;
@@ -1876,7 +1874,7 @@ TclTrim(
char *
Tcl_Concat(
Tcl_Size argc, /* Number of strings to concatenate. */
Tcl_Size argc, /* Number of strings to concatenate. */
const char *const *argv) /* Array of strings to concatenate. */
{
Tcl_Size i, needSpace = 0, bytesNeeded = 0;
@@ -2123,8 +2121,8 @@ Tcl_StringCaseMatch(
* characters. */
int nocase) /* 0 for case sensitive, 1 for insensitive */
{
Tcl_Size charLen;
int p, ch1 = 0, ch2 = 0;
int p, charLen;
int ch1 = 0, ch2 = 0;
while (1) {
p = *pattern;
@@ -2354,11 +2352,11 @@ Tcl_StringCaseMatch(
int
TclByteArrayMatch(
const unsigned char *string,/* String. */
Tcl_Size strLen, /* Length of String */
Tcl_Size strLen, /* Length of String */
const unsigned char *pattern,
/* Pattern, which may contain special
* characters. */
Tcl_Size ptnLen, /* Length of Pattern */
Tcl_Size ptnLen, /* Length of Pattern */
TCL_UNUSED(int) /*flags*/)
{
const unsigned char *stringEnd, *patternEnd;
@@ -2772,7 +2770,7 @@ Tcl_DStringAppendElement(
memcpy(newString, dsPtr->string, dsPtr->length);
dsPtr->string = newString;
} else {
Tcl_Size offset = -1;
int offset = -1;
/* See [16896d49fd] */
if (element >= dsPtr->string
@@ -2826,7 +2824,7 @@ Tcl_DStringAppendElement(
void
Tcl_DStringSetLength(
Tcl_DString *dsPtr, /* Structure describing dynamic string. */
Tcl_Size length) /* New length for dynamic string. */
Tcl_Size length) /* New length for dynamic string. */
{
Tcl_Size newsize;
@@ -3315,7 +3313,7 @@ Tcl_Size
TclFormatInt(
char *buffer, /* Points to the storage into which the
* formatted characters are written. */
Tcl_WideInt n) /* The integer to format. */
Tcl_WideInt n) /* The integer to format. */
{
Tcl_WideUInt intVal;
int i = 0, numFormatted, j;
@@ -3377,14 +3375,14 @@ TclFormatInt(
static int
GetWideForIndex(
Tcl_Interp *interp, /* Interpreter to use for error reporting. If
Tcl_Interp *interp, /* Interpreter to use for error reporting. If
* NULL, then no error message is left after
* errors. */
Tcl_Obj *objPtr, /* Points to the value to be parsed */
Tcl_WideInt endValue, /* The value to be stored at *widePtr if
Tcl_Obj *objPtr, /* Points to the value to be parsed */
Tcl_WideInt endValue, /* The value to be stored at *widePtr if
* objPtr holds "end".
* NOTE: this value may be TCL_INDEX_NONE. */
Tcl_WideInt *widePtr) /* Location filled in with a wide integer
Tcl_WideInt *widePtr) /* Location filled in with a wide integer
* representing an index. */
{
int numType;
@@ -3512,10 +3510,10 @@ Tcl_GetIntForIndex(
static int
GetEndOffsetFromObj(
Tcl_Interp *interp,
Tcl_Obj *objPtr, /* Pointer to the object to parse */
Tcl_WideInt endValue, /* The value to be stored at "widePtr" if
Tcl_Obj *objPtr, /* Pointer to the object to parse */
Tcl_WideInt endValue, /* The value to be stored at "widePtr" if
* "objPtr" holds "end". */
Tcl_WideInt *widePtr) /* Location filled in with an integer
Tcl_WideInt *widePtr) /* Location filled in with an integer
* representing an index. */
{
Tcl_ObjInternalRep *irPtr;
@@ -3811,11 +3809,11 @@ GetEndOffsetFromObj(
int
TclIndexEncode(
Tcl_Interp *interp, /* For error reporting, may be NULL */
Tcl_Obj *objPtr, /* Index value to parse */
int before, /* Value to return for index before beginning */
int after, /* Value to return for index after end */
int *indexPtr) /* Where to write the encoded answer, not NULL */
Tcl_Interp *interp, /* For error reporting, may be NULL */
Tcl_Obj *objPtr, /* Index value to parse */
int before, /* Value to return for index before beginning */
int after, /* Value to return for index after end */
int *indexPtr) /* Where to write the encoded answer, not NULL */
{
Tcl_WideInt wide;
int idx;
@@ -3898,7 +3896,7 @@ TclIndexEncode(
idx = (int)wide;
}
} else {
/* objPtr is not purely numeric (end etc.) */
/* objPtr is not purely numeric (end etc.) */
/*
* On 64-bit systems, indices in the range end-LIST_MAX:end-INT_MAX
@@ -3957,8 +3955,8 @@ rangeerror:
Tcl_Size
TclIndexDecode(
int encoded, /* Value to decode */
Tcl_Size endValue) /* Meaning of "end" to use, > TCL_INDEX_END */
int encoded, /* Value to decode */
Tcl_Size endValue) /* Meaning of "end" to use, > TCL_INDEX_END */
{
if (encoded > TCL_INDEX_END) {
return encoded;
@@ -3987,8 +3985,8 @@ TclIndexDecode(
*/
int
TclCommandWordLimitError(
Tcl_Interp *interp, /* May be NULL */
Tcl_Size count) /* If <= 0, "unknown" */
Tcl_Interp *interp, /* May be NULL */
Tcl_Size count) /* If <= 0, "unknown" */
{
if (interp) {
if (count > 0) {
+19 -23
View File
@@ -191,7 +191,7 @@ static Tcl_NRPostProc ArrayForLoopCallback;
static Tcl_ObjCmdProc ArrayForNRCmd;
static void DeleteSearches(Interp *iPtr, Var *arrayVarPtr);
static void DeleteArray(Interp *iPtr, Tcl_Obj *arrayNamePtr,
Var *varPtr, int flags, Tcl_Size index);
Var *varPtr, int flags, int index);
static int LocateArray(Tcl_Interp *interp, Tcl_Obj *name,
Var **varPtrPtr, int *isArrayPtr);
static int NotArrayError(Tcl_Interp *interp, Tcl_Obj *name);
@@ -201,12 +201,12 @@ static Tcl_Var ObjFindNamespaceVar(Tcl_Interp *interp,
static int ObjMakeUpvar(Tcl_Interp *interp,
CallFrame *framePtr, Tcl_Obj *otherP1Ptr,
const char *otherP2, int otherFlags,
Tcl_Obj *myNamePtr, int myFlags, Tcl_Size index);
Tcl_Obj *myNamePtr, int myFlags, int index);
static ArraySearch * ParseSearchId(Tcl_Interp *interp, const Var *varPtr,
Tcl_Obj *varNamePtr, Tcl_Obj *handleObj);
static void UnsetVarStruct(Var *varPtr, Var *arrayPtr,
Interp *iPtr, Tcl_Obj *part1Ptr,
Tcl_Obj *part2Ptr, int flags, Tcl_Size index);
Tcl_Obj *part2Ptr, int flags, int index);
/*
* TIP #508: [array default]
@@ -223,7 +223,7 @@ static void SetArrayDefault(Var *arrayPtr, Tcl_Obj *defaultObj);
MODULE_SCOPE Var * TclLookupSimpleVar(Tcl_Interp *interp,
Tcl_Obj *varNamePtr, int flags, int create,
const char **errMsgPtr, Tcl_Size *indexPtr);
const char **errMsgPtr, int *indexPtr);
static Tcl_DupInternalRepProc DupLocalVarName;
static Tcl_FreeInternalRepProc FreeLocalVarName;
@@ -607,8 +607,7 @@ TclObjLookupVarEx(
Var *varPtr; /* Points to the variable's in-frame Var
* structure. */
const char *errMsg = NULL;
Tcl_Size index;
int parsed = 0;
int index, parsed = 0;
Tcl_Size localIndex;
Tcl_Obj *namePtr, *arrayPtr, *elem;
@@ -832,7 +831,7 @@ TclLookupSimpleVar(
* if it doesn't already exist. If 0, return
* error if it doesn't exist. */
const char **errMsgPtr,
Tcl_Size *indexPtr)
int *indexPtr)
{
Interp *iPtr = (Interp *) interp;
CallFrame *varFramePtr = iPtr->varFramePtr;
@@ -1073,7 +1072,7 @@ TclLookupArrayElement(
* element, if it doesn't already exist. If 0,
* return error if it doesn't exist. */
Var *arrayPtr, /* Pointer to the array's Var structure. */
Tcl_Size index) /* If >=0, the index of the local array. */
int index) /* If >=0, the index of the local array. */
{
int isNew;
Var *varPtr;
@@ -1385,7 +1384,7 @@ TclPtrGetVarIdx(
* in the array part1. */
int flags, /* OR-ed combination of TCL_GLOBAL_ONLY, and
* TCL_LEAVE_ERR_MSG bits. */
Tcl_Size index) /* Index into the local variable table of the
int index) /* Index into the local variable table of the
* variable, or -1. Only used when part1Ptr is
* NULL. */
{
@@ -1913,7 +1912,7 @@ TclPtrSetVarIdx(
Tcl_Obj *newValuePtr, /* New value for variable. */
int flags, /* OR-ed combination of TCL_GLOBAL_ONLY, and
* TCL_LEAVE_ERR_MSG bits. */
Tcl_Size index) /* Index of local var where part1 is to be
int index) /* Index of local var where part1 is to be
* found. */
{
Interp *iPtr = (Interp *) interp;
@@ -2230,7 +2229,7 @@ TclPtrIncrObjVarIdx(
* any of TCL_GLOBAL_ONLY, TCL_NAMESPACE_ONLY,
* TCL_APPEND_VALUE, TCL_LIST_ELEMENT,
* TCL_LEAVE_ERR_MSG. */
Tcl_Size index) /* Index into the local variable table of the
int index) /* Index into the local variable table of the
* variable, or -1. Only used when part1Ptr is
* NULL. */
{
@@ -2465,7 +2464,7 @@ TclPtrUnsetVarIdx(
int flags, /* OR-ed combination of any of
* TCL_GLOBAL_ONLY, TCL_NAMESPACE_ONLY,
* TCL_LEAVE_ERR_MSG. */
Tcl_Size index) /* Index into the local variable table of the
int index) /* Index into the local variable table of the
* variable, or -1. Only used when part1Ptr is
* NULL. */
{
@@ -2551,7 +2550,7 @@ UnsetVarStruct(
Tcl_Obj *part1Ptr,
Tcl_Obj *part2Ptr,
int flags,
Tcl_Size index)
int index)
{
Var dummyVar;
int traced = TclIsVarTraced(varPtr)
@@ -2736,8 +2735,7 @@ Tcl_UnsetObjCmd(
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
{
int i;
int flags = TCL_LEAVE_ERR_MSG;
int i, flags = TCL_LEAVE_ERR_MSG;
const char *name;
if (objc == 1) {
@@ -4488,7 +4486,7 @@ ObjMakeUpvar(
* otherP1/otherP2. Must be a scalar. */
int myFlags, /* 0, TCL_GLOBAL_ONLY or TCL_NAMESPACE_ONLY:
* indicates scope of myName. */
Tcl_Size index) /* If the variable to be linked is an indexed
int index) /* If the variable to be linked is an indexed
* scalar, this is its index. Otherwise, -1 */
{
Interp *iPtr = (Interp *) interp;
@@ -4618,7 +4616,7 @@ TclPtrObjMakeUpvarIdx(
* otherP1/otherP2. Must be a scalar. */
int myFlags, /* 0, TCL_GLOBAL_ONLY or TCL_NAMESPACE_ONLY:
* indicates scope of myName. */
Tcl_Size index) /* If the variable to be linked is an indexed
int index) /* If the variable to be linked is an indexed
* scalar, this is its index. Otherwise, -1 */
{
Interp *iPtr = (Interp *) interp;
@@ -4946,8 +4944,7 @@ Tcl_GlobalObjCmd(
Tcl_Obj *objPtr, *tailPtr;
const char *varName;
const char *tail;
int result;
int i;
int result, i;
/*
* If we are not executing inside a Tcl procedure, just return.
@@ -5051,8 +5048,7 @@ Tcl_VariableObjCmd(
const char *varName, *tail, *cp;
Var *varPtr, *arrayPtr;
Tcl_Obj *varValuePtr;
int i;
int result;
int i, result;
Tcl_Obj *varNamePtr, *tailPtr;
for (i=1 ; i<objc ; i+=2) {
@@ -5581,7 +5577,7 @@ DeleteArray(
int flags, /* Flags to pass to TclCallVarTraces:
* TCL_TRACE_UNSETS and sometimes
* TCL_NAMESPACE_ONLY or TCL_GLOBAL_ONLY. */
Tcl_Size index)
int index)
{
Tcl_HashSearch search;
Tcl_HashEntry *tPtr;
@@ -5698,7 +5694,7 @@ TclObjVarErrMsg(
const char *operation, /* String describing operation that failed,
* e.g. "read", "set", or "unset". */
const char *reason, /* String describing why operation failed. */
Tcl_Size index) /* Index into the local variable table of the
int index) /* Index into the local variable table of the
* variable, or -1. Only used when part1Ptr is
* NULL. */
{
+3 -2
View File
@@ -3883,7 +3883,8 @@ 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
long long dataStartOffset,
/* The overall file offset of the start of the
* data file. */
long long directoryStartOffset,
/* The overall file offset of the start of the
@@ -5633,7 +5634,7 @@ ZipFSMatchInDirectoryProc(
Tcl_DString dsPref, *prefixBuf = NULL;
int foundInHash, notDuplicate;
ZipEntry *z;
int wanted; /* TCL_GLOB_TYPE* */
int wanted; /* TCL_GLOB_TYPE* */
if (!normPathPtr) {
return -1;
+11 -4
View File
@@ -1,5 +1,12 @@
if {![package vsatisfies [package provide Tcl] 9.0-]} return
if {[info sharedlibextension] != ".dll"} return
package ifneeded dde 1.5a0 \
[list load [file join $dir tcl9dde15.dll] Dde]
if {[package vsatisfies [package provide Tcl] 9.0-]} {
package ifneeded dde 1.4.5 \
[list load [file join $dir tcl9dde14.dll] Dde]
} elseif {![package vsatisfies [package provide Tcl] 8.7]
&& [::tcl::pkgconfig get debug]} {
package ifneeded dde 1.4.5 \
[list load [file join $dir tcldde14g.dll] Dde]
} else {
package ifneeded dde 1.4.5 \
[list load [file join $dir tcldde14.dll] Dde]
}
+1 -1
View File
@@ -15,7 +15,7 @@
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
package require -exact tcl 9.1a0
package require -exact tcl 9.0.2
# Compute the auto path to use in this interpreter.
# The values on the path come from several locations:
+8 -3
View File
@@ -1,4 +1,9 @@
if {![package vsatisfies [package provide Tcl] 9.0-]} return
if {![package vsatisfies [package provide Tcl] 8.5-]} return
if {[info sharedlibextension] != ".dll"} return
package ifneeded registry 1.4a0 \
[list load [file join $dir tcl9registry14.dll] Registry]
if {[package vsatisfies [package provide Tcl] 9.0-]} {
package ifneeded registry 1.3.7 \
[list load [file join $dir tcl9registry13.dll] Registry]
} else {
package ifneeded registry 1.3.7 \
[list load [file join $dir tclregistry13.dll] Registry]
}

Some files were not shown because too many files have changed in this diff Show More