Compare commits
10
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
47e2f9e1fb | ||
|
|
5ed9b2f277 | ||
|
|
5530db2715 | ||
|
|
f70603d910 | ||
|
|
2c6bdbf7af | ||
|
|
7bf96e0035 | ||
|
|
7add1b667d | ||
|
|
ace71ee517 | ||
|
|
51d6aedd18 | ||
|
|
a8fc23ad30 |
@@ -11,7 +11,7 @@ permissions:
|
||||
jobs:
|
||||
linux:
|
||||
name: Linux
|
||||
runs-on: ubuntu-22.04
|
||||
runs-on: ubuntu-24.04
|
||||
defaults:
|
||||
run:
|
||||
shell: bash
|
||||
@@ -124,7 +124,7 @@ jobs:
|
||||
url: ${{ steps.upload.outputs.artifact-url }}
|
||||
win:
|
||||
name: Windows
|
||||
runs-on: windows-2019
|
||||
runs-on: windows-2025
|
||||
defaults:
|
||||
run:
|
||||
shell: msys2 {0}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# README: Tcl
|
||||
|
||||
This is the **Tcl 9.0.2** source distribution.
|
||||
This is the **Tcl 9.1a0** 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.0.html).
|
||||
[here](https://www.tcl-lang.org/software/tcltk/9.1.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.0 is [online,
|
||||
here](https://www.tcl-lang.org/man/tcl9.0/).
|
||||
The complete set of reference manual entries for Tcl 9.1 is [online,
|
||||
here](https://www.tcl-lang.org/man/tcl9.1/).
|
||||
|
||||
### <a id="doc.unix">2a.</a> Unix Documentation
|
||||
The `doc` subdirectory in this release contains a complete set of
|
||||
|
||||
+4
-199
@@ -4,207 +4,12 @@ changes to the Tcl source code at
|
||||
|
||||
> [Tcl Source Code](https://core.tcl-lang.org/tcl/timeline)
|
||||
|
||||
Release Tcl 9.0.2 arises from the check-in with tag `core-9-0-2`.
|
||||
Release Tcl 9.1a0 arises from the check-in with tag `core-9-1-a0`.
|
||||
|
||||
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/98006f)
|
||||
- [tcl::mathfunc::isunordered inconsistency with some integer values](https://core.tcl-lang.org/tcl/tktview/67d5f7)
|
||||
- [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)
|
||||
|
||||
# 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,
|
||||
Highlighted differences between Tcl 9.1 and Tcl 9.0 are summarized below,
|
||||
with focus on changes important to programmers using the Tcl library and
|
||||
writing Tcl scripts.
|
||||
|
||||
# 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)
|
||||
# Bug fixes
|
||||
- [tclEpollNotfy PlatformEventsControl panics if websocket disconnected](https://core.tcl-lang.org/tcl/tktview/010d8f38)
|
||||
|
||||
|
||||
+1
-1
@@ -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 TCL_HASH_TYPE \fBTcl_HashKeyProc\fR(
|
||||
typedef size_t \fBTcl_HashKeyProc\fR(
|
||||
Tcl_HashTable *\fItablePtr\fR,
|
||||
void *\fIkeyPtr\fR);
|
||||
.CE
|
||||
|
||||
+1
-1
@@ -32,7 +32,7 @@ int
|
||||
.sp
|
||||
\fBTcl_LimitTypeReset\fR(\fIinterp, type\fR)
|
||||
.sp
|
||||
int
|
||||
Tcl_Size
|
||||
\fBTcl_LimitGetCommands\fR(\fIinterp\fR)
|
||||
.sp
|
||||
\fBTcl_LimitSetCommands\fR(\fIinterp, commandLimit\fR)
|
||||
|
||||
+11
-1
@@ -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 \- 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, Tcl_IsEmpty \- manipulate Tcl values as strings
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
\fB#include <tcl.h>\fR
|
||||
@@ -81,6 +81,9 @@ 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
|
||||
@@ -403,6 +406,13 @@ 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
@@ -13,7 +13,7 @@
|
||||
registry \- Manipulate the Windows registry
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
\fBpackage require registry 1.3\fR
|
||||
\fBpackage require registry 1.4\fR
|
||||
|
||||
\fBregistry \fR?\fI\-mode\fR? \fIoption keyName\fR ?\fIarg arg ...\fR?
|
||||
.fi
|
||||
|
||||
@@ -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 co;
|
||||
return (color)co;
|
||||
}
|
||||
sco = newcolor(cm); /* must create subcolor */
|
||||
if (sco == COLORLESS) {
|
||||
|
||||
+7
-7
@@ -592,8 +592,8 @@ sortins(
|
||||
{
|
||||
struct arc **sortarray;
|
||||
struct arc *a;
|
||||
int n = s->nins;
|
||||
int i;
|
||||
size_t n = s->nins;
|
||||
size_t i;
|
||||
|
||||
if (n <= 1) {
|
||||
return; /* nothing to do */
|
||||
@@ -668,8 +668,8 @@ sortouts(
|
||||
{
|
||||
struct arc **sortarray;
|
||||
struct arc *a;
|
||||
int n = s->nouts;
|
||||
int i;
|
||||
size_t n = s->nouts;
|
||||
size_t i;
|
||||
|
||||
if (n <= 1) {
|
||||
return; /* nothing to do */
|
||||
@@ -1872,12 +1872,12 @@ fixempties(
|
||||
struct state *nexts;
|
||||
struct arc *a;
|
||||
struct arc *nexta;
|
||||
int totalinarcs;
|
||||
size_t totalinarcs;
|
||||
struct arc **inarcsorig;
|
||||
struct arc **arcarray;
|
||||
int arccount;
|
||||
int prevnins;
|
||||
int nskip;
|
||||
size_t prevnins;
|
||||
size_t nskip;
|
||||
|
||||
/*
|
||||
* First, get rid of any states whose sole out-arc is an EMPTY,
|
||||
|
||||
+27
-27
@@ -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 *, int, int);
|
||||
static void repeat(struct vars *, struct state *, struct state *, size_t, size_t);
|
||||
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 int newlacon(struct vars *, struct state *, struct state *, int);
|
||||
static void freelacons(struct subre *, int);
|
||||
static size_t newlacon(struct vars *, struct state *, struct state *, size_t);
|
||||
static void freelacons(struct subre *, size_t);
|
||||
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 */
|
||||
size_t nextvalue; /* value (if any) of next token */
|
||||
chr 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 |= UP(branch->flags | branch->left->flags);
|
||||
branch->flags |= (char)(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, val, lp, rp)
|
||||
int m, n;
|
||||
#define ARCV(t, val) newarc(v->nfa, (t), (pcolor)(val), lp, rp)
|
||||
size_t m, n;
|
||||
struct subre *atom; /* atom's subtree */
|
||||
struct subre *t;
|
||||
int cap; /* capturing parens? */
|
||||
int pos; /* positive lookahead? */
|
||||
size_t cap; /* capturing parens? */
|
||||
size_t 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(v->nextvalue < v->nsubs, REG_ESUBREG);
|
||||
INSIST((size_t)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 = f;
|
||||
top->flags = (char)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 |= COMBINE(qprefer, atom->flags);
|
||||
atom->flags |= (char)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 |= COMBINE(t->flags, t->right->flags);
|
||||
top->flags |= COMBINE(top->flags, t->flags);
|
||||
t->flags |= (char)COMBINE(t->flags, t->right->flags);
|
||||
top->flags |= (char)COMBINE(top->flags, t->flags);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1346,13 +1346,13 @@ repeat(
|
||||
struct vars *v,
|
||||
struct state *lp,
|
||||
struct state *rp,
|
||||
int m,
|
||||
int n)
|
||||
size_t m,
|
||||
size_t n)
|
||||
{
|
||||
#define SOME 2
|
||||
#define INF 3
|
||||
#define PAIR(x, y) ((x)*4 + (y))
|
||||
#define REDUCE(x) ( ((x) == DUPINF) ? INF : (((x) > 1) ? SOME : (x)) )
|
||||
#define REDUCE(x) ( ((x) == DUPINF) ? INF : (((x) > 1) ? SOME : (int)(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;
|
||||
int i;
|
||||
size_t 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 = op;
|
||||
ret->flags = flags;
|
||||
ret->op = (char)op;
|
||||
ret->flags = (char)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 int newlacon(struct vars *, struct state *, struct state *, int);
|
||||
^ static size_t newlacon(struct vars *, struct state *, struct state *, size_t);
|
||||
*/
|
||||
static int /* lacon number */
|
||||
static size_t /* lacon number */
|
||||
newlacon(
|
||||
struct vars *v,
|
||||
struct state *begin,
|
||||
struct state *end,
|
||||
int pos)
|
||||
size_t pos)
|
||||
{
|
||||
int n;
|
||||
size_t n;
|
||||
struct subre *newlacons;
|
||||
struct subre *sub;
|
||||
|
||||
@@ -1988,10 +1988,10 @@ newlacon(
|
||||
static void
|
||||
freelacons(
|
||||
struct subre *subs,
|
||||
int n)
|
||||
size_t n)
|
||||
{
|
||||
struct subre *sub;
|
||||
int i;
|
||||
size_t 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, " (#%d)", t->subno);
|
||||
fprintf(f, " (#%" TCL_Z_MODIFIER "d)", t->subno);
|
||||
}
|
||||
if (t->min != 1 || t->max != 1) {
|
||||
fprintf(f, " {%d,", t->min);
|
||||
|
||||
+3
-3
@@ -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 *, int);
|
||||
^ static unsigned hash(unsigned *, size_t);
|
||||
*/
|
||||
static unsigned
|
||||
hash(
|
||||
unsigned *const uv,
|
||||
int n)
|
||||
size_t n)
|
||||
{
|
||||
int i;
|
||||
size_t i;
|
||||
unsigned h;
|
||||
|
||||
h = 0;
|
||||
|
||||
+6
-5
@@ -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, int);
|
||||
static unsigned hash(unsigned *const, size_t);
|
||||
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;
|
||||
int n;
|
||||
int i;
|
||||
size_t n;
|
||||
size_t i;
|
||||
#define LOCALMAT 20
|
||||
regmatch_t mat[LOCALMAT];
|
||||
#define LOCALDFAS 40
|
||||
@@ -592,7 +592,7 @@ subset(
|
||||
chr *const begin,
|
||||
chr *const end)
|
||||
{
|
||||
int n = sub->subno;
|
||||
size_t n = sub->subno;
|
||||
|
||||
assert(n > 0);
|
||||
if ((size_t)n >= v->nmatch) {
|
||||
@@ -874,7 +874,8 @@ cbrdissect(
|
||||
chr *begin, /* beginning of relevant substring */
|
||||
chr *end) /* end of same */
|
||||
{
|
||||
int n = t->subno, min = t->min, max = t->max;
|
||||
size_t n = t->subno;
|
||||
int min = t->min, max = t->max;
|
||||
size_t numreps;
|
||||
size_t tlen;
|
||||
size_t brlen;
|
||||
|
||||
+1
-1
@@ -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) */
|
||||
int subno; /* subexpression number (for 'b' and '(') */
|
||||
size_t 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) */
|
||||
|
||||
+17
-26
@@ -40,22 +40,22 @@ declare 2 {
|
||||
TCL_NORETURN void Tcl_Panic(const char *format, ...)
|
||||
}
|
||||
declare 3 {
|
||||
void *Tcl_Alloc(TCL_HASH_TYPE size)
|
||||
void *Tcl_Alloc(size_t size)
|
||||
}
|
||||
declare 4 {
|
||||
void Tcl_Free(void *ptr)
|
||||
}
|
||||
declare 5 {
|
||||
void *Tcl_Realloc(void *ptr, TCL_HASH_TYPE size)
|
||||
void *Tcl_Realloc(void *ptr, size_t size)
|
||||
}
|
||||
declare 6 {
|
||||
void *Tcl_DbCkalloc(TCL_HASH_TYPE size, const char *file, int line)
|
||||
void *Tcl_DbCkalloc(size_t 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, TCL_HASH_TYPE size,
|
||||
void *Tcl_DbCkrealloc(void *ptr, size_t size,
|
||||
const char *file, int line)
|
||||
}
|
||||
|
||||
@@ -129,17 +129,6 @@ 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)
|
||||
}
|
||||
@@ -259,10 +248,6 @@ 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)
|
||||
}
|
||||
@@ -1217,7 +1202,7 @@ declare 392 {
|
||||
}
|
||||
declare 393 {
|
||||
int Tcl_CreateThread(Tcl_ThreadId *idPtr, Tcl_ThreadCreateProc *proc,
|
||||
void *clientData, TCL_HASH_TYPE stackSize, int flags)
|
||||
void *clientData, size_t stackSize, int flags)
|
||||
}
|
||||
|
||||
# Introduced in 8.3.2
|
||||
@@ -1324,16 +1309,16 @@ declare 427 {
|
||||
int flags, Tcl_CommandTraceProc *proc, void *clientData)
|
||||
}
|
||||
declare 428 {
|
||||
void *Tcl_AttemptAlloc(TCL_HASH_TYPE size)
|
||||
void *Tcl_AttemptAlloc(size_t size)
|
||||
}
|
||||
declare 429 {
|
||||
void *Tcl_AttemptDbCkalloc(TCL_HASH_TYPE size, const char *file, int line)
|
||||
void *Tcl_AttemptDbCkalloc(size_t size, const char *file, int line)
|
||||
}
|
||||
declare 430 {
|
||||
void *Tcl_AttemptRealloc(void *ptr, TCL_HASH_TYPE size)
|
||||
void *Tcl_AttemptRealloc(void *ptr, size_t size)
|
||||
}
|
||||
declare 431 {
|
||||
void *Tcl_AttemptDbCkrealloc(void *ptr, TCL_HASH_TYPE size,
|
||||
void *Tcl_AttemptDbCkrealloc(void *ptr, size_t size,
|
||||
const char *file, int line)
|
||||
}
|
||||
declare 432 {
|
||||
@@ -1704,7 +1689,7 @@ declare 531 {
|
||||
void Tcl_LimitTypeReset(Tcl_Interp *interp, int type)
|
||||
}
|
||||
declare 532 {
|
||||
int Tcl_LimitGetCommands(Tcl_Interp *interp)
|
||||
Tcl_Size Tcl_LimitGetCommands(Tcl_Interp *interp)
|
||||
}
|
||||
declare 533 {
|
||||
void Tcl_LimitGetTime(Tcl_Interp *interp, Tcl_Time *timeLimitPtr)
|
||||
@@ -2144,7 +2129,7 @@ declare 636 {
|
||||
}
|
||||
declare 637 {
|
||||
char *Tcl_InitStringRep(Tcl_Obj *objPtr, const char *bytes,
|
||||
TCL_HASH_TYPE numBytes)
|
||||
size_t numBytes)
|
||||
}
|
||||
declare 638 {
|
||||
Tcl_ObjInternalRep *Tcl_FetchInternalRep(Tcl_Obj *objPtr, const Tcl_ObjType *typePtr)
|
||||
@@ -2378,6 +2363,12 @@ 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)
|
||||
}
|
||||
|
||||
|
||||
+31
-134
@@ -49,14 +49,15 @@ extern "C" {
|
||||
#if !defined(TCL_MAJOR_VERSION)
|
||||
# define TCL_MAJOR_VERSION 9
|
||||
#endif
|
||||
#if TCL_MAJOR_VERSION == 9
|
||||
# define TCL_MINOR_VERSION 0
|
||||
# define TCL_RELEASE_LEVEL TCL_FINAL_RELEASE
|
||||
# define TCL_RELEASE_SERIAL 2
|
||||
#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
|
||||
|
||||
# define TCL_VERSION "9.0"
|
||||
# define TCL_PATCH_LEVEL "9.0.2"
|
||||
#endif /* TCL_MAJOR_VERSION */
|
||||
#define TCL_VERSION "9.1"
|
||||
#define TCL_PATCH_LEVEL "9.1a0"
|
||||
|
||||
#if defined(RC_INVOKED)
|
||||
/*
|
||||
@@ -321,30 +322,12 @@ typedef unsigned TCL_WIDE_INT_TYPE Tcl_WideUInt;
|
||||
#define Tcl_WideAsDouble(val) ((double)((Tcl_WideInt)(val)))
|
||||
#define Tcl_DoubleAsWide(val) ((Tcl_WideInt)((double)(val)))
|
||||
|
||||
#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 */
|
||||
typedef ptrdiff_t Tcl_Size;
|
||||
#define TCL_SIZE_MAX ((Tcl_Size)(((size_t)-1)>>1))
|
||||
#define TCL_SIZE_MODIFIER TCL_T_MODIFIER
|
||||
|
||||
#ifdef _WIN32
|
||||
# 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
|
||||
typedef struct __stat64 Tcl_StatBuf;
|
||||
#elif defined(__CYGWIN__)
|
||||
typedef struct {
|
||||
unsigned st_dev;
|
||||
@@ -425,7 +408,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. */
|
||||
@@ -469,28 +452,18 @@ 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;
|
||||
|
||||
/*
|
||||
@@ -589,7 +562,6 @@ 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,
|
||||
@@ -600,11 +572,6 @@ 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, ...);
|
||||
@@ -673,7 +640,6 @@ 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 */
|
||||
@@ -697,21 +663,14 @@ 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;
|
||||
|
||||
#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
|
||||
#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 */
|
||||
|
||||
/*
|
||||
* The following structure stores an internal representation (internalrep) for
|
||||
@@ -720,7 +679,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, */
|
||||
@@ -957,11 +916,7 @@ typedef struct Tcl_DString {
|
||||
* TCL_COMBINE Combine surrogates
|
||||
*/
|
||||
|
||||
#if TCL_MAJOR_VERSION > 8
|
||||
# define TCL_COMBINE 0x1000000
|
||||
#else
|
||||
# define TCL_COMBINE 0
|
||||
#endif
|
||||
#define TCL_COMBINE 0x1000000
|
||||
/*
|
||||
*----------------------------------------------------------------------------
|
||||
* Flag values passed to Tcl_RecordAndEval, Tcl_EvalObj, Tcl_EvalObjv.
|
||||
@@ -1066,18 +1021,14 @@ typedef struct Tcl_DString {
|
||||
*/
|
||||
|
||||
#ifndef TCL_HASH_TYPE
|
||||
#if TCL_MAJOR_VERSION > 8
|
||||
# define TCL_HASH_TYPE size_t
|
||||
#else
|
||||
# define TCL_HASH_TYPE unsigned
|
||||
#endif
|
||||
# define TCL_HASH_TYPE size_t
|
||||
#endif
|
||||
|
||||
typedef struct Tcl_HashKeyType Tcl_HashKeyType;
|
||||
typedef struct Tcl_HashTable Tcl_HashTable;
|
||||
typedef struct Tcl_HashEntry Tcl_HashEntry;
|
||||
|
||||
typedef TCL_HASH_TYPE (Tcl_HashKeyProc) (Tcl_HashTable *tablePtr, void *keyPtr);
|
||||
typedef size_t (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);
|
||||
@@ -1195,15 +1146,10 @@ 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
|
||||
@@ -1265,7 +1211,7 @@ typedef struct Tcl_HashSearch {
|
||||
typedef struct {
|
||||
void *next; /* Search position for underlying hash
|
||||
* table. */
|
||||
TCL_HASH_TYPE epoch; /* Epoch marker for dictionary being searched,
|
||||
size_t epoch; /* Epoch marker for dictionary being searched,
|
||||
* or 0 if search has terminated. */
|
||||
Tcl_Dict dictionaryPtr; /* Reference to dictionary being searched. */
|
||||
} Tcl_DictSearch;
|
||||
@@ -1321,12 +1267,8 @@ typedef enum {
|
||||
*/
|
||||
|
||||
typedef struct Tcl_Time {
|
||||
#if TCL_MAJOR_VERSION > 8
|
||||
long long sec; /* Seconds. */
|
||||
#else
|
||||
long sec; /* Seconds. */
|
||||
#endif
|
||||
#if defined(_CYGWIN_) && TCL_MAJOR_VERSION > 8
|
||||
#if defined(_CYGWIN_)
|
||||
int usec; /* Microseconds. */
|
||||
#else
|
||||
long usec; /* Microseconds. */
|
||||
@@ -1377,11 +1319,7 @@ typedef void (Tcl_ScaleTimeProc) (Tcl_Time *timebuf, void *clientData);
|
||||
* interface.
|
||||
*/
|
||||
|
||||
#if TCL_MAJOR_VERSION > 8
|
||||
# define TCL_CLOSE2PROC NULL
|
||||
#else
|
||||
# define TCL_CLOSE2PROC ((void *) 1)
|
||||
#endif
|
||||
#define TCL_CLOSE2PROC NULL
|
||||
|
||||
/*
|
||||
* Channel version tag. This was introduced in 8.3.2/8.4.
|
||||
@@ -1929,12 +1867,10 @@ 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.
|
||||
@@ -1953,9 +1889,6 @@ 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
|
||||
@@ -2036,11 +1969,7 @@ typedef struct Tcl_EncodingType {
|
||||
|
||||
#define TCL_ENCODING_START 0x01
|
||||
#define TCL_ENCODING_END 0x02
|
||||
#if TCL_MAJOR_VERSION > 8
|
||||
# define TCL_ENCODING_STOPONERROR 0x0 /* Not used any more */
|
||||
#else
|
||||
# define TCL_ENCODING_STOPONERROR 0x04
|
||||
#endif
|
||||
#define TCL_ENCODING_STOPONERROR 0x0 /* Not used any more */
|
||||
#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 */
|
||||
@@ -2050,7 +1979,7 @@ typedef struct Tcl_EncodingType {
|
||||
* changes, ensure ENCODING_PROFILE_* macros in tclInt.h are modified if
|
||||
* necessary.
|
||||
*/
|
||||
#define TCL_ENCODING_PROFILE_STRICT TCL_ENCODING_STOPONERROR
|
||||
#define TCL_ENCODING_PROFILE_STRICT 0x00000000
|
||||
#define TCL_ENCODING_PROFILE_TCL8 0x01000000
|
||||
#define TCL_ENCODING_PROFILE_REPLACE 0x02000000
|
||||
|
||||
@@ -2093,11 +2022,7 @@ typedef struct Tcl_EncodingType {
|
||||
*/
|
||||
|
||||
#ifndef TCL_UTF_MAX
|
||||
# if defined(BUILD_tcl) || TCL_MAJOR_VERSION > 8
|
||||
# define TCL_UTF_MAX 4
|
||||
# else
|
||||
# define TCL_UTF_MAX 3
|
||||
# endif
|
||||
# define TCL_UTF_MAX 4
|
||||
#endif
|
||||
|
||||
/*
|
||||
@@ -2146,11 +2071,7 @@ 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
|
||||
/*
|
||||
@@ -2307,11 +2228,7 @@ typedef int (Tcl_NRPostProc) (void *data[], Tcl_Interp *interp,
|
||||
* stubs tables.
|
||||
*/
|
||||
|
||||
#if TCL_MAJOR_VERSION > 8
|
||||
# define TCL_STUB_MAGIC ((int) 0xFCA3BACB + (int) sizeof(void *))
|
||||
#else
|
||||
# define TCL_STUB_MAGIC ((int) 0xFCA3BACF)
|
||||
#endif
|
||||
#define TCL_STUB_MAGIC ((int) 0xFCA3BACB + (int) sizeof(void *))
|
||||
|
||||
/*
|
||||
* The following function is required to be defined in all stubs aware
|
||||
@@ -2333,35 +2250,15 @@ 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.
|
||||
@@ -2401,7 +2298,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) && (TCL_MAJOR_VERSION > 8)
|
||||
#if defined(USE_TCL_STUBS)
|
||||
#define Tcl_SetPanicProc(panicProc) \
|
||||
TclInitStubTable(((const char *(*)(Tcl_PanicProc *))TclStubCall((void *)panicProc))(panicProc))
|
||||
#define Tcl_InitSubsystems() \
|
||||
|
||||
+20
-23
@@ -168,7 +168,7 @@ ArithSeriesEndDbl(
|
||||
if (!dblRepPtr->base.len) {
|
||||
return dblRepPtr->start;
|
||||
}
|
||||
d = dblRepPtr->start + ((dblRepPtr->base.len-1) * dblRepPtr->step);
|
||||
d = dblRepPtr->start + ((double)(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 += (index * dblRepPtr->step);
|
||||
d += ((double)index * dblRepPtr->step);
|
||||
}
|
||||
|
||||
return ArithRound(d, dblRepPtr->precision);
|
||||
@@ -227,15 +227,14 @@ 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 ? strlen(str + 1) : 0);
|
||||
return (str ? (unsigned)strlen(str + 1) : 0);
|
||||
}
|
||||
/* don't calculate precision for e-notation */
|
||||
}
|
||||
@@ -338,10 +337,8 @@ 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 */
|
||||
@@ -629,13 +626,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;
|
||||
@@ -715,13 +712,13 @@ TclNewArithSeriesObj(
|
||||
// Compute precision based on given command argument values
|
||||
precision = maxObjPrecision(startObj, NULL, stepObj);
|
||||
|
||||
dend = dstart + (dstep * (len-1));
|
||||
dend = dstart + (dstep * (double)(len-1));
|
||||
// Make computed end value match argument(s) precision
|
||||
dend = ArithRound(dend, precision);
|
||||
end = dend;
|
||||
} else {
|
||||
end = start + (step * (len - 1));
|
||||
dend = end;
|
||||
dend = (double)end;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -741,7 +738,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 + (len - 1) * dstep;
|
||||
double d = dstart + (double)(len - 1) * dstep;
|
||||
if (isnan(d)) {
|
||||
const char *s = "domain error: argument not in valid range";
|
||||
Tcl_SetObjResult(interp, Tcl_NewStringObj(s, -1));
|
||||
@@ -876,11 +873,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;
|
||||
@@ -1066,7 +1063,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)
|
||||
{
|
||||
|
||||
+43
-43
@@ -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. */
|
||||
Tcl_Size cmdLine; /* Current line number within the assembly
|
||||
int 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*,
|
||||
int);
|
||||
static int CheckNonNegative(Tcl_Interp*, int);
|
||||
static int CheckOneByte(Tcl_Interp*, int);
|
||||
static int CheckSignedOneByte(Tcl_Interp*, int);
|
||||
Tcl_Size);
|
||||
static int CheckNonNegative(Tcl_Interp*, Tcl_Size);
|
||||
static int CheckOneByte(Tcl_Interp*, Tcl_Size);
|
||||
static int CheckSignedOneByte(Tcl_Interp*, Tcl_Size);
|
||||
static int CheckStack(AssemblyEnv*);
|
||||
static int CheckStrictlyPositive(Tcl_Interp*, int);
|
||||
static int CheckStrictlyPositive(Tcl_Interp*, Tcl_Size);
|
||||
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*, int);
|
||||
static void MoveExceptionRangesToBasicBlock(AssemblyEnv*, Tcl_Size);
|
||||
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**, int*);
|
||||
BasicBlock**, Tcl_Size*);
|
||||
static void SyncStackDepth(AssemblyEnv*);
|
||||
static int TclAssembleCode(CompileEnv* envPtr, const char* code,
|
||||
int codeLen, int flags);
|
||||
Tcl_Size codeLen, int flags);
|
||||
static void UnstackExpiredCatches(CompileEnv*, BasicBlock*, int,
|
||||
BasicBlock**, int*);
|
||||
BasicBlock**, Tcl_Size*);
|
||||
|
||||
/*
|
||||
* Tcl_ObjType that describes bytecode emitted by the assembler.
|
||||
@@ -959,9 +959,9 @@ TclCompileAssembleCmd(
|
||||
{
|
||||
Tcl_Token *tokenPtr; /* Token in the input script */
|
||||
|
||||
size_t numCommands = envPtr->numCommands;
|
||||
int offset = envPtr->codeNext - envPtr->codeStart;
|
||||
size_t depth = envPtr->currStackDepth;
|
||||
Tcl_Size numCommands = envPtr->numCommands;
|
||||
Tcl_Size offset = envPtr->codeNext - envPtr->codeStart;
|
||||
Tcl_Size 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 */
|
||||
int codeLen, /* Length of the code */
|
||||
Tcl_Size 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 */
|
||||
int bytesLeft = codeLen; /* Number of bytes of source code remaining to
|
||||
Tcl_Size 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 */
|
||||
int infoIndex; /* Index of the jumptable in auxdata */
|
||||
Tcl_Size 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;
|
||||
int savedExceptArrayNext = envPtr->exceptArrayNext;
|
||||
Tcl_Size 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 */
|
||||
int maxStackDepth = curr_bb->finalStackDepth + envPtr->maxStackDepth;
|
||||
Tcl_Size 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 */
|
||||
int savedExceptArrayNext) /* Saved index of the end of the exception
|
||||
Tcl_Size 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 */
|
||||
int exceptionCount = envPtr->exceptArrayNext - savedExceptArrayNext;
|
||||
Tcl_Size exceptionCount = envPtr->exceptArrayNext - savedExceptArrayNext;
|
||||
/* Number of ranges that must be moved */
|
||||
int i;
|
||||
Tcl_Size 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 */
|
||||
int nameLen) /* Length of the variable */
|
||||
Tcl_Size nameLen) /* Length of the variable */
|
||||
{
|
||||
const char* p;
|
||||
|
||||
@@ -2389,7 +2389,7 @@ CheckNamespaceQualifiers(
|
||||
static int
|
||||
CheckOneByte(
|
||||
Tcl_Interp* interp, /* Tcl interpreter for error reporting */
|
||||
int value) /* Value to check */
|
||||
Tcl_Size 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 */
|
||||
int value) /* Value to check */
|
||||
Tcl_Size 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 */
|
||||
int value) /* Value to check */
|
||||
Tcl_Size value) /* Value to check */
|
||||
{
|
||||
Tcl_Obj* result; /* Error message */
|
||||
|
||||
if (value < 0) {
|
||||
if (value < 0 || value > INT_MAX) {
|
||||
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 */
|
||||
int value) /* Value to check */
|
||||
Tcl_Size value) /* Value to check */
|
||||
{
|
||||
Tcl_Obj* result; /* Error message */
|
||||
|
||||
if (value <= 0) {
|
||||
if (value <= 0 || value > INT_MAX) {
|
||||
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 */
|
||||
int topOffset; /* Bytecode offset of the following basic
|
||||
Tcl_Size 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 */
|
||||
int offset; /* Bytecode offset of the current
|
||||
Tcl_Size offset; /* Bytecode offset of the current
|
||||
* instruction */
|
||||
int bound; /* Bytecode offset following the last
|
||||
Tcl_Size 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 */
|
||||
int* catchIndices; /* Indices of the exception ranges of catches
|
||||
Tcl_Size* 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 = (int *)Tcl_Alloc(maxCatchDepth * sizeof(int));
|
||||
catchIndices = (Tcl_Size *)Tcl_Alloc(maxCatchDepth * sizeof(Tcl_Size));
|
||||
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 */
|
||||
int* catchIndices) /* Indices of the exception ranges
|
||||
BasicBlock **catches, /* Array of catch contexts */
|
||||
Tcl_Size *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 */
|
||||
int* catchIndices) /* Indices of the exception ranges
|
||||
Tcl_Size* 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 */
|
||||
int rangeBase; /* Base of the foreign exception ranges when
|
||||
Tcl_Size 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 */
|
||||
int catchIndex; /* Index of the exception range to which the
|
||||
Tcl_Size catchIndex; /* Index of the exception range to which the
|
||||
* current instruction refers */
|
||||
int i;
|
||||
|
||||
|
||||
+7
-8
@@ -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,7 +201,6 @@ Tcl_AsyncMark(
|
||||
Tcl_ThreadAlert(token->originThrdId);
|
||||
}
|
||||
Tcl_MutexUnlock(&asyncMutex);
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -224,8 +223,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;
|
||||
@@ -378,7 +377,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;
|
||||
|
||||
|
||||
+33
-36
@@ -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, int expected,
|
||||
int actual, Tcl_Obj *const *objv);
|
||||
static void MathFuncWrongNumArgs(Tcl_Interp *interp, Tcl_Size expected,
|
||||
Tcl_Size 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, objc, objv);
|
||||
return info->proc(info->clientData, interp, (int)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,7 +3550,6 @@ 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;
|
||||
@@ -3948,7 +3947,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. */
|
||||
{
|
||||
@@ -4438,7 +4437,7 @@ EvalObjvCore(
|
||||
TCL_UNUSED(int) /*result*/)
|
||||
{
|
||||
Command *cmdPtr = NULL, *preCmdPtr = (Command *)data[0];
|
||||
int flags = PTR2INT(data[1]);
|
||||
int flags = (int)PTR2INT(data[1]);
|
||||
Tcl_Size objc = PTR2INT(data[2]);
|
||||
Tcl_Obj **objv = (Tcl_Obj **)data[3];
|
||||
Interp *iPtr = (Interp *) interp;
|
||||
@@ -5157,7 +5156,7 @@ TclEvalEx(
|
||||
int flags, /* Collection of OR-ed bits that control the
|
||||
* evaluation of the script. Only
|
||||
* TCL_EVAL_GLOBAL is currently supported. */
|
||||
Tcl_Size line, /* The line the script starts on. */
|
||||
int 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
|
||||
@@ -5180,8 +5179,8 @@ TclEvalEx(
|
||||
const char *p, *next;
|
||||
const int minObjs = 20;
|
||||
Tcl_Obj **objv, **objvSpace;
|
||||
int *expand;
|
||||
Tcl_Size *lines, *lineSpace;
|
||||
char *expand;
|
||||
int *lines, *lineSpace;
|
||||
Tcl_Token *tokenPtr;
|
||||
int expandRequested, code = TCL_OK;
|
||||
Tcl_Size bytesLeft, commandLength;
|
||||
@@ -5197,8 +5196,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 *));
|
||||
int *expandStack = (int *)TclStackAlloc(interp, minObjs * sizeof(int));
|
||||
Tcl_Size *linesStack = (Tcl_Size *)TclStackAlloc(interp, minObjs * sizeof(Tcl_Size));
|
||||
char *expandStack = (char *)TclStackAlloc(interp, minObjs * sizeof(char));
|
||||
int *linesStack = (int *)TclStackAlloc(interp, minObjs * sizeof(int));
|
||||
/* TIP #280 Structures for tracking of command
|
||||
* locations. */
|
||||
Tcl_Size *clNext = NULL; /* Pointer for the tracking of invisible
|
||||
@@ -5323,7 +5322,7 @@ TclEvalEx(
|
||||
* per-command parsing.
|
||||
*/
|
||||
|
||||
Tcl_Size wordLine = line;
|
||||
int wordLine = line;
|
||||
const char *wordStart = parsePtr->commandStart;
|
||||
Tcl_Size *wordCLNext = clNext;
|
||||
Tcl_Size objectsNeeded = 0;
|
||||
@@ -5334,11 +5333,11 @@ TclEvalEx(
|
||||
*/
|
||||
|
||||
if (numWords > minObjs) {
|
||||
expand = (int *)Tcl_Alloc(numWords * sizeof(int));
|
||||
expand = (char *)Tcl_Alloc(numWords * sizeof(char));
|
||||
objvSpace = (Tcl_Obj **)
|
||||
Tcl_Alloc(numWords * sizeof(Tcl_Obj *));
|
||||
lineSpace = (Tcl_Size *)
|
||||
Tcl_Alloc(numWords * sizeof(Tcl_Size));
|
||||
lineSpace = (int *)
|
||||
Tcl_Alloc(numWords * sizeof(int));
|
||||
}
|
||||
expandRequested = 0;
|
||||
objv = objvSpace;
|
||||
@@ -5430,13 +5429,13 @@ TclEvalEx(
|
||||
*/
|
||||
|
||||
Tcl_Obj **copy = objvSpace;
|
||||
Tcl_Size *lcopy = lineSpace;
|
||||
int *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 = (Tcl_Size *)Tcl_Alloc(objectsNeeded * sizeof(Tcl_Size));
|
||||
lines = lineSpace = (int *)Tcl_Alloc(objectsNeeded * sizeof(int));
|
||||
}
|
||||
|
||||
objectsUsed = 0;
|
||||
@@ -5635,7 +5634,7 @@ TclEvalEx(
|
||||
|
||||
void
|
||||
TclAdvanceLines(
|
||||
Tcl_Size *line,
|
||||
int *line,
|
||||
const char *start,
|
||||
const char *end)
|
||||
{
|
||||
@@ -5670,9 +5669,9 @@ TclAdvanceLines(
|
||||
|
||||
void
|
||||
TclAdvanceContinuations(
|
||||
Tcl_Size *line,
|
||||
int *line,
|
||||
Tcl_Size **clNextPtrPtr,
|
||||
int loc)
|
||||
Tcl_Size loc)
|
||||
{
|
||||
/*
|
||||
* Track the invisible continuation lines embedded in a script, if any.
|
||||
@@ -5853,7 +5852,7 @@ TclArgumentBCEnter(
|
||||
Tcl_Size pc)
|
||||
{
|
||||
ExtCmdLoc *eclPtr;
|
||||
Tcl_Size word;
|
||||
int word;
|
||||
ECL *ePtr;
|
||||
CFWordBC *lastPtr = NULL;
|
||||
Interp *iPtr = (Interp *) interp;
|
||||
@@ -6125,7 +6124,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;
|
||||
@@ -6294,7 +6293,7 @@ TEOEx_ByteCodeCallback(
|
||||
Interp *iPtr = (Interp *) interp;
|
||||
CallFrame *savedVarFramePtr = (CallFrame *)data[0];
|
||||
Tcl_Obj *objPtr = (Tcl_Obj *)data[1];
|
||||
int allowExceptions = PTR2INT(data[2]);
|
||||
int allowExceptions = (int)PTR2INT(data[2]);
|
||||
|
||||
if (iPtr->numLevels == 0) {
|
||||
if (result == TCL_RETURN) {
|
||||
@@ -7716,7 +7715,7 @@ ExprRandFunc(
|
||||
* take into consideration the thread this interp is running in.
|
||||
*/
|
||||
|
||||
iPtr->randSeed = TclpGetClicks() + PTR2UINT(Tcl_GetCurrentThread()) * 4093U;
|
||||
iPtr->randSeed = (long)TclpGetClicks() + (long)PTR2UINT(Tcl_GetCurrentThread()) * 4093U;
|
||||
|
||||
/*
|
||||
* Make sure 1 <= randSeed <= (2^31) - 2. See below.
|
||||
@@ -7771,7 +7770,7 @@ ExprRandFunc(
|
||||
* dividing by RAND_IM yields a double in the range (0, 1).
|
||||
*/
|
||||
|
||||
dResult = iPtr->randSeed * (1.0/RAND_IM);
|
||||
dResult = (double)iPtr->randSeed * (1.0/RAND_IM);
|
||||
|
||||
/*
|
||||
* Push a Tcl object with the result.
|
||||
@@ -8088,7 +8087,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;
|
||||
|
||||
@@ -8179,10 +8178,8 @@ 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;
|
||||
}
|
||||
|
||||
@@ -8263,8 +8260,8 @@ FloatClassifyObjCmd(
|
||||
static void
|
||||
MathFuncWrongNumArgs(
|
||||
Tcl_Interp *interp, /* Tcl interpreter */
|
||||
int expected, /* Formal parameter count. */
|
||||
int found, /* Actual parameter count. */
|
||||
Tcl_Size expected, /* Formal parameter count. */
|
||||
Tcl_Size found, /* Actual parameter count. */
|
||||
Tcl_Obj *const *objv) /* Actual parameter vector. */
|
||||
{
|
||||
const char *name = TclGetString(objv[0]);
|
||||
|
||||
+6
-6
@@ -512,7 +512,7 @@ MakeByteArray(
|
||||
|
||||
for (; src < srcEnd && dst < dstEnd; ) {
|
||||
int ch;
|
||||
int count = TclUtfToUniChar(src, &ch);
|
||||
Tcl_Size 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) {
|
||||
int adjusted = size + (wrapcharlen * (size / maxlen));
|
||||
Tcl_Size adjusted = size + (wrapcharlen * (size / maxlen));
|
||||
|
||||
if (size % maxlen == 0) {
|
||||
adjusted -= wrapcharlen;
|
||||
@@ -2972,14 +2972,14 @@ BinaryDecodeUu(
|
||||
*/
|
||||
|
||||
if (lineLen > 0) {
|
||||
*cursor++ = (((d[0] - 0x20) & 0x3F) << 2)
|
||||
*cursor++ = (unsigned char)(((d[0] - 0x20) & 0x3F) << 2)
|
||||
| (((d[1] - 0x20) & 0x3F) >> 4);
|
||||
if (--lineLen > 0) {
|
||||
*cursor++ = (((d[1] - 0x20) & 0x3F) << 4)
|
||||
*cursor++ = (unsigned char)(((d[1] - 0x20) & 0x3F) << 4)
|
||||
| (((d[2] - 0x20) & 0x3F) >> 2);
|
||||
if (--lineLen > 0) {
|
||||
*cursor++ = (((d[2] - 0x20) & 0x3F) << 6)
|
||||
| (((d[3] - 0x20) & 0x3F));
|
||||
*cursor++ = (unsigned char)((((d[2] - 0x20) & 0x3F) << 6)
|
||||
| (((d[3] - 0x20) & 0x3F)));
|
||||
lineLen--;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -276,7 +276,6 @@ ValidateMemory(
|
||||
memset(memHeaderP->low_guard, 0, LOW_GUARD_SIZE);
|
||||
memset(hiPtr, 0, HIGH_GUARD_SIZE);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
+10
-14
@@ -116,7 +116,7 @@ struct ClockCommand {
|
||||
const char *name; /* The tail of the command name. The full name
|
||||
* is "::tcl::clock::<name>". When NULL marks
|
||||
* the end of the table. */
|
||||
Tcl_ObjCmdProc *objCmdProc; /* Function that implements the command. This
|
||||
Tcl_ObjCmdProc *objCmdProc; /* Function that implements the command. This
|
||||
* will always have the ClockClientData sent
|
||||
* to it, but may well ignore this data. */
|
||||
CompileProc *compileProc; /* The compiler for the command. */
|
||||
@@ -341,7 +341,7 @@ ClockConfigureClear(
|
||||
*/
|
||||
static void
|
||||
ClockDeleteCmdProc(
|
||||
void *clientData) /* Opaque pointer to the client data */
|
||||
void *clientData) /* Opaque pointer to the client data */
|
||||
{
|
||||
ClockClientData *data = (ClockClientData *)clientData;
|
||||
int i;
|
||||
@@ -3277,7 +3277,7 @@ ClockParseFmtScnArgs(
|
||||
ClockFmtScnCmdArgs *opts, /* Result vector: format, locale, timezone... */
|
||||
TclDateFields *date, /* Extracted date-time corresponding base
|
||||
* (by scan or add) resp. clockval (by format) */
|
||||
Tcl_Size objc, /* Parameter count */
|
||||
Tcl_Size objc, /* Parameter count */
|
||||
Tcl_Obj *const objv[], /* Parameter vector */
|
||||
ClockOperation operation, /* What operation are we doing: format, scan, add */
|
||||
const char *syntax) /* Syntax of the current command */
|
||||
@@ -4255,7 +4255,7 @@ ClockCalcRelTime(
|
||||
* and hereafter convert back to TZ, otherwise apply it direct here.
|
||||
*/
|
||||
if (opts->timezoneObj != opts->dataPtr->literals[LIT_GMT]) {
|
||||
/*
|
||||
/*
|
||||
* Convert date info structure into UTC seconds and add relative
|
||||
* seconds (happens in commit).
|
||||
*/
|
||||
@@ -4277,7 +4277,7 @@ ClockCalcRelTime(
|
||||
/* restore scanned day of week */
|
||||
yyDayOfWeek = prevDayOfWeek;
|
||||
} else {
|
||||
/*
|
||||
/*
|
||||
* GMT/UTC zone, so no DST and no offsets - apply it here, so that
|
||||
* if time exceeds current date, do the day conversion and leave the
|
||||
* rest of increment in yyRelSeconds (add it later in UTC by commit)
|
||||
@@ -4625,11 +4625,11 @@ ClockSafeCatchCmd(
|
||||
Tcl_Obj *const objv[])
|
||||
{
|
||||
typedef struct {
|
||||
int status; /* return code status */
|
||||
int flags; /* Each remaining field saves the */
|
||||
int returnLevel; /* corresponding field of the Interp */
|
||||
int returnCode; /* struct. These fields taken together are */
|
||||
Tcl_Obj *errorInfo; /* the "state" of the interp. */
|
||||
int status; /* return code status */
|
||||
int flags; /* Each remaining field saves the */
|
||||
int returnLevel; /* corresponding field of the Interp */
|
||||
int returnCode; /* struct. These fields taken together are */
|
||||
Tcl_Obj *errorInfo; /* the "state" of the interp. */
|
||||
Tcl_Obj *errorCode;
|
||||
Tcl_Obj *returnOpts;
|
||||
Tcl_Obj *objResult;
|
||||
@@ -4706,11 +4706,7 @@ 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 */
|
||||
|
||||
+4
-6
@@ -524,7 +524,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,7 +593,6 @@ EncodingConvertfromObjCmd(
|
||||
|
||||
Tcl_FreeEncoding(encoding);
|
||||
return TCL_OK;
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -686,7 +685,6 @@ EncodingConverttoObjCmd(
|
||||
|
||||
Tcl_FreeEncoding(encoding);
|
||||
return TCL_OK;
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -752,9 +750,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);
|
||||
|
||||
+18
-24
@@ -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,9 +2520,8 @@ 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.
|
||||
@@ -2557,8 +2556,7 @@ 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;
|
||||
@@ -2606,8 +2604,7 @@ 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;
|
||||
@@ -2725,8 +2722,7 @@ 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;
|
||||
@@ -2937,9 +2933,8 @@ 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;
|
||||
@@ -4037,11 +4032,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;
|
||||
@@ -4085,8 +4080,7 @@ 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 */
|
||||
@@ -4134,9 +4128,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;
|
||||
@@ -5362,7 +5356,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
@@ -3840,7 +3840,7 @@ TclNRSwitchObjCmd(
|
||||
if (ctxPtr->type == TCL_LOCATION_SOURCE && ctxPtr->line[bidx] >= 0) {
|
||||
int bline = ctxPtr->line[bidx];
|
||||
|
||||
ctxPtr->line = (Tcl_Size *)Tcl_Alloc(objc * sizeof(Tcl_Size));
|
||||
ctxPtr->line = (int *)Tcl_Alloc(objc * sizeof(int));
|
||||
ctxPtr->nline = objc;
|
||||
TclListLines(blist, bline, objc, ctxPtr->line, objv);
|
||||
} else {
|
||||
@@ -3854,7 +3854,7 @@ TclNRSwitchObjCmd(
|
||||
|
||||
int k;
|
||||
|
||||
ctxPtr->line = (Tcl_Size *)Tcl_Alloc(objc * sizeof(Tcl_Size));
|
||||
ctxPtr->line = (int *)Tcl_Alloc(objc * sizeof(int));
|
||||
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. */
|
||||
Tcl_Size line, /* Line the list as a whole starts on. */
|
||||
int line, /* Line the list as a whole starts on. */
|
||||
Tcl_Size n, /* #elements in lines */
|
||||
Tcl_Size *lines, /* Array of line numbers, to fill. */
|
||||
Tcl_Obj *const *elems) /* The list elems as Tcl_Obj*, in need of
|
||||
int *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);
|
||||
|
||||
+117
-104
@@ -128,11 +128,12 @@ TclCompileAppendCmd(
|
||||
{
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
Tcl_Token *varTokenPtr, *valueTokenPtr;
|
||||
int isScalar, localIndex, numWords, i;
|
||||
int isScalar;
|
||||
Tcl_Size i, numWords, localIndex;
|
||||
|
||||
/* TODO: Consider support for compiling expanded args. */
|
||||
numWords = parsePtr->numWords;
|
||||
if (numWords == 1) {
|
||||
if (numWords == 1 || numWords > INT_MAX) {
|
||||
return TCL_ERROR;
|
||||
} else if (numWords == 2) {
|
||||
/*
|
||||
@@ -253,7 +254,8 @@ TclCompileArrayExistsCmd(
|
||||
{
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
Tcl_Token *tokenPtr;
|
||||
int isScalar, localIndex;
|
||||
int isScalar;
|
||||
Tcl_Size localIndex;
|
||||
|
||||
if (parsePtr->numWords != 2) {
|
||||
return TCL_ERROR;
|
||||
@@ -262,7 +264,7 @@ TclCompileArrayExistsCmd(
|
||||
tokenPtr = TokenAfter(parsePtr->tokenPtr);
|
||||
PushVarNameWord(interp, tokenPtr, envPtr, TCL_NO_ELEMENT,
|
||||
&localIndex, &isScalar, 1);
|
||||
if (!isScalar) {
|
||||
if (!isScalar || localIndex > INT_MAX) {
|
||||
return TCL_ERROR;
|
||||
}
|
||||
|
||||
@@ -285,11 +287,11 @@ TclCompileArraySetCmd(
|
||||
{
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
Tcl_Token *varTokenPtr, *dataTokenPtr;
|
||||
int isScalar, localIndex, code = TCL_OK;
|
||||
int isScalar, code = TCL_OK;
|
||||
int isDataLiteral, isDataValid, isDataEven;
|
||||
Tcl_Size len;
|
||||
int keyVar, valVar, infoIndex;
|
||||
int fwd, offsetBack, offsetFwd;
|
||||
Tcl_Size localIndex, len;
|
||||
Tcl_Size keyVar, valVar, infoIndex;
|
||||
Tcl_Size fwd, offsetBack, offsetFwd;
|
||||
Tcl_Obj *literalObj;
|
||||
ForeachInfo *infoPtr;
|
||||
|
||||
@@ -341,7 +343,7 @@ TclCompileArraySetCmd(
|
||||
|
||||
PushVarNameWord(interp, varTokenPtr, envPtr, TCL_NO_ELEMENT,
|
||||
&localIndex, &isScalar, 1);
|
||||
if (!isScalar) {
|
||||
if (!isScalar || localIndex > INT_MAX) {
|
||||
code = TCL_ERROR;
|
||||
goto done;
|
||||
}
|
||||
@@ -459,7 +461,8 @@ TclCompileArrayUnsetCmd(
|
||||
{
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
Tcl_Token *tokenPtr = TokenAfter(parsePtr->tokenPtr);
|
||||
int isScalar, localIndex;
|
||||
int isScalar;
|
||||
Tcl_Size localIndex;
|
||||
|
||||
if (parsePtr->numWords != 2) {
|
||||
return TclCompileBasic2ArgCmd(interp, parsePtr, cmdPtr, envPtr);
|
||||
@@ -576,15 +579,15 @@ TclCompileCatchCmd(
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
JumpFixup jumpFixup;
|
||||
Tcl_Token *cmdTokenPtr, *resultNameTokenPtr, *optsNameTokenPtr;
|
||||
int resultIndex, optsIndex, range, dropScript = 0;
|
||||
int depth = TclGetStackDepth(envPtr);
|
||||
Tcl_Size resultIndex, optsIndex, range, dropScript = 0;
|
||||
Tcl_Size 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 (((int)parsePtr->numWords < 2) || ((int)parsePtr->numWords > 4)) {
|
||||
if ((parsePtr->numWords < 2) || (parsePtr->numWords > 4)) {
|
||||
return TCL_ERROR;
|
||||
}
|
||||
|
||||
@@ -593,7 +596,7 @@ TclCompileCatchCmd(
|
||||
* (not in a procedure), don't compile it inline: the payoff is too small.
|
||||
*/
|
||||
|
||||
if (((int)parsePtr->numWords >= 3) && !EnvHasLVT(envPtr)) {
|
||||
if ((parsePtr->numWords >= 3) && !EnvHasLVT(envPtr)) {
|
||||
return TCL_ERROR;
|
||||
}
|
||||
|
||||
@@ -604,7 +607,7 @@ TclCompileCatchCmd(
|
||||
|
||||
resultIndex = optsIndex = -1;
|
||||
cmdTokenPtr = TokenAfter(parsePtr->tokenPtr);
|
||||
if ((int)parsePtr->numWords >= 3) {
|
||||
if (parsePtr->numWords >= 3) {
|
||||
resultNameTokenPtr = TokenAfter(cmdTokenPtr);
|
||||
/* DGP */
|
||||
resultIndex = LocalScalarFromToken(resultNameTokenPtr, envPtr);
|
||||
@@ -856,7 +859,7 @@ TclCompileConcatCmd(
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
Tcl_Obj *objPtr, *listObj;
|
||||
Tcl_Token *tokenPtr;
|
||||
int i;
|
||||
Tcl_Size i;
|
||||
|
||||
/* TODO: Consider compiling expansion case. */
|
||||
if (parsePtr->numWords == 1) {
|
||||
@@ -866,6 +869,8 @@ TclCompileConcatCmd(
|
||||
|
||||
PushStringLiteral(envPtr, "");
|
||||
return TCL_OK;
|
||||
} else if (parsePtr->numWords > INT_MAX) {
|
||||
return TCL_ERROR;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -874,7 +879,7 @@ TclCompileConcatCmd(
|
||||
*/
|
||||
|
||||
TclNewObj(listObj);
|
||||
for (i = 1, tokenPtr = parsePtr->tokenPtr; i < (int)parsePtr->numWords; i++) {
|
||||
for (i = 1, tokenPtr = parsePtr->tokenPtr; i < parsePtr->numWords; i++) {
|
||||
tokenPtr = TokenAfter(tokenPtr);
|
||||
TclNewObj(objPtr);
|
||||
if (!TclWordKnownAtCompileTime(tokenPtr, objPtr)) {
|
||||
@@ -903,7 +908,10 @@ TclCompileConcatCmd(
|
||||
* General case: runtime concat.
|
||||
*/
|
||||
|
||||
for (i = 1, tokenPtr = parsePtr->tokenPtr; i < (int)parsePtr->numWords; i++) {
|
||||
if (parsePtr->numWords > 256) {
|
||||
return TCL_ERROR;
|
||||
}
|
||||
for (i = 1, tokenPtr = parsePtr->tokenPtr; i < parsePtr->numWords; i++) {
|
||||
tokenPtr = TokenAfter(tokenPtr);
|
||||
CompileWord(envPtr, tokenPtr, interp, i);
|
||||
}
|
||||
@@ -941,7 +949,8 @@ TclCompileConstCmd(
|
||||
{
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
Tcl_Token *varTokenPtr, *valueTokenPtr;
|
||||
int isScalar, localIndex;
|
||||
int isScalar;
|
||||
Tcl_Size localIndex;
|
||||
|
||||
/*
|
||||
* Need exactly two arguments.
|
||||
@@ -966,7 +975,7 @@ TclCompileConstCmd(
|
||||
* If the user specified an array element, we don't bother handling
|
||||
* that.
|
||||
*/
|
||||
if (!isScalar) {
|
||||
if (!isScalar || localIndex > INT_MAX) {
|
||||
return TCL_ERROR;
|
||||
}
|
||||
|
||||
@@ -1081,14 +1090,14 @@ TclCompileDictSetCmd(
|
||||
{
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
Tcl_Token *tokenPtr;
|
||||
int i, dictVarIndex;
|
||||
Tcl_Size i, dictVarIndex;
|
||||
Tcl_Token *varTokenPtr;
|
||||
|
||||
/*
|
||||
* There must be at least one argument after the command.
|
||||
*/
|
||||
|
||||
if ((int)parsePtr->numWords < 4) {
|
||||
if (parsePtr->numWords < 4 || parsePtr->numWords > INT_MAX) {
|
||||
return TCL_ERROR;
|
||||
}
|
||||
|
||||
@@ -1109,7 +1118,7 @@ TclCompileDictSetCmd(
|
||||
*/
|
||||
|
||||
tokenPtr = TokenAfter(varTokenPtr);
|
||||
for (i=2 ; i< (int)parsePtr->numWords ; i++) {
|
||||
for (i=2 ; i< parsePtr->numWords ; i++) {
|
||||
CompileWord(envPtr, tokenPtr, interp, i);
|
||||
tokenPtr = TokenAfter(tokenPtr);
|
||||
}
|
||||
@@ -1118,7 +1127,7 @@ TclCompileDictSetCmd(
|
||||
* Now emit the instruction to do the dict manipulation.
|
||||
*/
|
||||
|
||||
TclEmitInstInt4( INST_DICT_SET, (int)parsePtr->numWords-3, envPtr);
|
||||
TclEmitInstInt4( INST_DICT_SET, parsePtr->numWords-3, envPtr);
|
||||
TclEmitInt4( dictVarIndex, envPtr);
|
||||
TclAdjustStackDepth(-1, envPtr);
|
||||
return TCL_OK;
|
||||
@@ -1135,13 +1144,14 @@ TclCompileDictIncrCmd(
|
||||
{
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
Tcl_Token *varTokenPtr, *keyTokenPtr;
|
||||
int dictVarIndex, incrAmount;
|
||||
Tcl_Size dictVarIndex;
|
||||
int incrAmount;
|
||||
|
||||
/*
|
||||
* There must be at least two arguments after the command.
|
||||
*/
|
||||
|
||||
if ((int)parsePtr->numWords < 3 || (int)parsePtr->numWords > 4) {
|
||||
if (parsePtr->numWords < 3 || parsePtr->numWords > 4) {
|
||||
return TCL_ERROR;
|
||||
}
|
||||
varTokenPtr = TokenAfter(parsePtr->tokenPtr);
|
||||
@@ -1207,7 +1217,7 @@ TclCompileDictGetCmd(
|
||||
{
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
Tcl_Token *tokenPtr;
|
||||
int i;
|
||||
Tcl_Size i;
|
||||
|
||||
/*
|
||||
* There must be at least two arguments after the command (the single-arg
|
||||
@@ -1215,7 +1225,7 @@ TclCompileDictGetCmd(
|
||||
*/
|
||||
|
||||
/* TODO: Consider support for compiling expanded args. */
|
||||
if ((int)parsePtr->numWords < 3) {
|
||||
if (parsePtr->numWords < 3 || parsePtr->numWords > INT_MAX) {
|
||||
return TCL_ERROR;
|
||||
}
|
||||
tokenPtr = TokenAfter(parsePtr->tokenPtr);
|
||||
@@ -1224,11 +1234,11 @@ TclCompileDictGetCmd(
|
||||
* Only compile this because we need INST_DICT_GET anyway.
|
||||
*/
|
||||
|
||||
for (i=1 ; i<(int)parsePtr->numWords ; i++) {
|
||||
for (i=1 ; i<parsePtr->numWords ; i++) {
|
||||
CompileWord(envPtr, tokenPtr, interp, i);
|
||||
tokenPtr = TokenAfter(tokenPtr);
|
||||
}
|
||||
TclEmitInstInt4(INST_DICT_GET, (int)parsePtr->numWords-2, envPtr);
|
||||
TclEmitInstInt4(INST_DICT_GET, parsePtr->numWords-2, envPtr);
|
||||
TclAdjustStackDepth(-1, envPtr);
|
||||
return TCL_OK;
|
||||
}
|
||||
@@ -1243,23 +1253,23 @@ TclCompileDictGetWithDefaultCmd(
|
||||
{
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
Tcl_Token *tokenPtr;
|
||||
int i;
|
||||
Tcl_Size i;
|
||||
|
||||
/*
|
||||
* There must be at least three arguments after the command.
|
||||
*/
|
||||
|
||||
/* TODO: Consider support for compiling expanded args. */
|
||||
if ((int)parsePtr->numWords < 4) {
|
||||
if (parsePtr->numWords < 4 || parsePtr->numWords > INT_MAX) {
|
||||
return TCL_ERROR;
|
||||
}
|
||||
tokenPtr = TokenAfter(parsePtr->tokenPtr);
|
||||
|
||||
for (i=1 ; i<(int)parsePtr->numWords ; i++) {
|
||||
for (i=1 ; i<parsePtr->numWords ; i++) {
|
||||
CompileWord(envPtr, tokenPtr, interp, i);
|
||||
tokenPtr = TokenAfter(tokenPtr);
|
||||
}
|
||||
TclEmitInstInt4(INST_DICT_GET_DEF, (int)parsePtr->numWords-3, envPtr);
|
||||
TclEmitInstInt4(INST_DICT_GET_DEF, parsePtr->numWords-3, envPtr);
|
||||
TclAdjustStackDepth(-2, envPtr);
|
||||
return TCL_OK;
|
||||
}
|
||||
@@ -1274,7 +1284,7 @@ TclCompileDictExistsCmd(
|
||||
{
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
Tcl_Token *tokenPtr;
|
||||
int i;
|
||||
Tcl_Size i;
|
||||
|
||||
/*
|
||||
* There must be at least two arguments after the command (the single-arg
|
||||
@@ -1282,7 +1292,7 @@ TclCompileDictExistsCmd(
|
||||
*/
|
||||
|
||||
/* TODO: Consider support for compiling expanded args. */
|
||||
if ((int)parsePtr->numWords < 3) {
|
||||
if (parsePtr->numWords < 3 || parsePtr->numWords > INT_MAX) {
|
||||
return TCL_ERROR;
|
||||
}
|
||||
tokenPtr = TokenAfter(parsePtr->tokenPtr);
|
||||
@@ -1291,11 +1301,11 @@ TclCompileDictExistsCmd(
|
||||
* Now we do the code generation.
|
||||
*/
|
||||
|
||||
for (i=1 ; i<(int)parsePtr->numWords ; i++) {
|
||||
for (i=1 ; i<parsePtr->numWords ; i++) {
|
||||
CompileWord(envPtr, tokenPtr, interp, i);
|
||||
tokenPtr = TokenAfter(tokenPtr);
|
||||
}
|
||||
TclEmitInstInt4(INST_DICT_EXISTS, (int)parsePtr->numWords-2, envPtr);
|
||||
TclEmitInstInt4(INST_DICT_EXISTS, parsePtr->numWords-2, envPtr);
|
||||
TclAdjustStackDepth(-1, envPtr);
|
||||
return TCL_OK;
|
||||
}
|
||||
@@ -1311,7 +1321,7 @@ TclCompileDictUnsetCmd(
|
||||
{
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
Tcl_Token *tokenPtr;
|
||||
int i, dictVarIndex;
|
||||
Tcl_Size i, dictVarIndex;
|
||||
|
||||
/*
|
||||
* There must be at least one argument after the variable name for us to
|
||||
@@ -1319,7 +1329,7 @@ TclCompileDictUnsetCmd(
|
||||
*/
|
||||
|
||||
/* TODO: Consider support for compiling expanded args. */
|
||||
if ((int)parsePtr->numWords < 3) {
|
||||
if (parsePtr->numWords < 3 || parsePtr->numWords > INT_MAX) {
|
||||
return TCL_ERROR;
|
||||
}
|
||||
|
||||
@@ -1339,7 +1349,7 @@ TclCompileDictUnsetCmd(
|
||||
* Remaining words (the key path) can be handled normally.
|
||||
*/
|
||||
|
||||
for (i=2 ; i<(int)parsePtr->numWords ; i++) {
|
||||
for (i=2 ; i<parsePtr->numWords ; i++) {
|
||||
tokenPtr = TokenAfter(tokenPtr);
|
||||
CompileWord(envPtr, tokenPtr, interp, i);
|
||||
}
|
||||
@@ -1348,7 +1358,7 @@ TclCompileDictUnsetCmd(
|
||||
* Now emit the instruction to do the dict manipulation.
|
||||
*/
|
||||
|
||||
TclEmitInstInt4( INST_DICT_UNSET, (int)parsePtr->numWords-2, envPtr);
|
||||
TclEmitInstInt4( INST_DICT_UNSET, parsePtr->numWords-2, envPtr);
|
||||
TclEmitInt4( dictVarIndex, envPtr);
|
||||
return TCL_OK;
|
||||
}
|
||||
@@ -1363,14 +1373,13 @@ TclCompileDictCreateCmd(
|
||||
CompileEnv *envPtr) /* Holds resulting instructions. */
|
||||
{
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
int worker; /* Temp var for building the value in. */
|
||||
Tcl_Size worker; /* Temp var for building the value in. */
|
||||
Tcl_Token *tokenPtr;
|
||||
Tcl_Obj *keyObj, *valueObj, *dictObj;
|
||||
const char *bytes;
|
||||
int i;
|
||||
Tcl_Size len;
|
||||
Tcl_Size i, len;
|
||||
|
||||
if ((parsePtr->numWords & 1) == 0) {
|
||||
if ((parsePtr->numWords & 1) == 0 || parsePtr->numWords > INT_MAX) {
|
||||
return TCL_ERROR;
|
||||
}
|
||||
|
||||
@@ -1381,7 +1390,7 @@ TclCompileDictCreateCmd(
|
||||
tokenPtr = TokenAfter(parsePtr->tokenPtr);
|
||||
TclNewObj(dictObj);
|
||||
Tcl_IncrRefCount(dictObj);
|
||||
for (i=1 ; i<(int)parsePtr->numWords ; i+=2) {
|
||||
for (i=1 ; i<parsePtr->numWords ; i+=2) {
|
||||
TclNewObj(keyObj);
|
||||
Tcl_IncrRefCount(keyObj);
|
||||
if (!TclWordKnownAtCompileTime(tokenPtr, keyObj)) {
|
||||
@@ -1431,7 +1440,7 @@ TclCompileDictCreateCmd(
|
||||
Emit14Inst( INST_STORE_SCALAR, worker, envPtr);
|
||||
TclEmitOpcode( INST_POP, envPtr);
|
||||
tokenPtr = TokenAfter(parsePtr->tokenPtr);
|
||||
for (i=1 ; i<(int)parsePtr->numWords ; i+=2) {
|
||||
for (i=1 ; i<parsePtr->numWords ; i+=2) {
|
||||
CompileWord(envPtr, tokenPtr, interp, i);
|
||||
tokenPtr = TokenAfter(tokenPtr);
|
||||
CompileWord(envPtr, tokenPtr, interp, i+1);
|
||||
@@ -1458,7 +1467,8 @@ TclCompileDictMergeCmd(
|
||||
{
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
Tcl_Token *tokenPtr;
|
||||
int i, workerIndex, infoIndex, outLoop;
|
||||
Tcl_Size i;
|
||||
Tcl_Size workerIndex, infoIndex, outLoop;
|
||||
|
||||
/*
|
||||
* Deal with some special edge cases. Note that in the case with one
|
||||
@@ -1466,7 +1476,7 @@ TclCompileDictMergeCmd(
|
||||
*/
|
||||
|
||||
/* TODO: Consider support for compiling expanded args. (less likely) */
|
||||
if ((int)parsePtr->numWords < 2) {
|
||||
if (parsePtr->numWords < 2) {
|
||||
PushStringLiteral(envPtr, "");
|
||||
return TCL_OK;
|
||||
} else if (parsePtr->numWords == 2) {
|
||||
@@ -1508,7 +1518,7 @@ TclCompileDictMergeCmd(
|
||||
outLoop = TclCreateExceptRange(CATCH_EXCEPTION_RANGE, envPtr);
|
||||
TclEmitInstInt4( INST_BEGIN_CATCH4, outLoop, envPtr);
|
||||
ExceptionRangeStarts(envPtr, outLoop);
|
||||
for (i=2 ; i<(int)parsePtr->numWords ; i++) {
|
||||
for (i=2 ; i<parsePtr->numWords ; i++) {
|
||||
/*
|
||||
* Get the dictionary, and merge its pairs into the first dict (using
|
||||
* a small loop).
|
||||
@@ -1601,11 +1611,11 @@ CompileDictEachCmd(
|
||||
{
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
Tcl_Token *varsTokenPtr, *dictTokenPtr, *bodyTokenPtr;
|
||||
int keyVarIndex, valueVarIndex, nameChars, loopRange, catchRange;
|
||||
int infoIndex, jumpDisplacement, bodyTargetOffset, emptyTargetOffset;
|
||||
Tcl_Size keyVarIndex, valueVarIndex, nameChars, loopRange, catchRange;
|
||||
Tcl_Size infoIndex, jumpDisplacement, bodyTargetOffset, emptyTargetOffset;
|
||||
Tcl_Size numVars;
|
||||
int endTargetOffset;
|
||||
int collectVar = -1; /* Index of temp var holding the result
|
||||
Tcl_Size endTargetOffset;
|
||||
Tcl_Size collectVar = -1; /* Index of temp var holding the result
|
||||
* dict. */
|
||||
const char **argv;
|
||||
Tcl_DString buffer;
|
||||
@@ -1827,7 +1837,7 @@ TclCompileDictUpdateCmd(
|
||||
CompileEnv *envPtr) /* Holds resulting instructions. */
|
||||
{
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
int i, dictIndex, numVars, range, infoIndex;
|
||||
Tcl_Size i, dictIndex, numVars, range, infoIndex;
|
||||
Tcl_Token **keyTokenPtrs, *dictVarTokenPtr, *bodyTokenPtr, *tokenPtr;
|
||||
DictUpdateInfo *duiPtr;
|
||||
JumpFixup jumpFixup;
|
||||
@@ -1836,7 +1846,7 @@ TclCompileDictUpdateCmd(
|
||||
* There must be at least one argument after the command.
|
||||
*/
|
||||
|
||||
if ((int)parsePtr->numWords < 5) {
|
||||
if (parsePtr->numWords < 5) {
|
||||
return TCL_ERROR;
|
||||
}
|
||||
|
||||
@@ -1845,7 +1855,7 @@ TclCompileDictUpdateCmd(
|
||||
* dict update <lit(eral)> <any> <lit> ?<any> <lit> ...? <lit>
|
||||
*/
|
||||
|
||||
if (((int)parsePtr->numWords - 1) & 1) {
|
||||
if (!(parsePtr->numWords & 1) || parsePtr->numWords > INT_MAX) {
|
||||
return TCL_ERROR;
|
||||
}
|
||||
numVars = (parsePtr->numWords - 3) / 2;
|
||||
@@ -1979,7 +1989,8 @@ TclCompileDictAppendCmd(
|
||||
{
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
Tcl_Token *tokenPtr;
|
||||
int i, dictVarIndex;
|
||||
Tcl_Size i;
|
||||
Tcl_Size dictVarIndex;
|
||||
|
||||
/*
|
||||
* There must be at least two argument after the command. And we impose an
|
||||
@@ -1988,7 +1999,7 @@ TclCompileDictAppendCmd(
|
||||
*/
|
||||
|
||||
/* TODO: Consider support for compiling expanded args. */
|
||||
if ((int)parsePtr->numWords<4 || (int)parsePtr->numWords>100) {
|
||||
if (parsePtr->numWords<4 || parsePtr->numWords>100) {
|
||||
return TCL_ERROR;
|
||||
}
|
||||
|
||||
@@ -2007,12 +2018,12 @@ TclCompileDictAppendCmd(
|
||||
*/
|
||||
|
||||
tokenPtr = TokenAfter(tokenPtr);
|
||||
for (i=2 ; i<(int)parsePtr->numWords ; i++) {
|
||||
for (i=2 ; i<parsePtr->numWords ; i++) {
|
||||
CompileWord(envPtr, tokenPtr, interp, i);
|
||||
tokenPtr = TokenAfter(tokenPtr);
|
||||
}
|
||||
if ((int)parsePtr->numWords > 4) {
|
||||
TclEmitInstInt1(INST_STR_CONCAT1, (int)parsePtr->numWords-3, envPtr);
|
||||
if (parsePtr->numWords > 4) {
|
||||
TclEmitInstInt1(INST_STR_CONCAT1, parsePtr->numWords-3, envPtr);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -2034,7 +2045,7 @@ TclCompileDictLappendCmd(
|
||||
{
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
Tcl_Token *varTokenPtr, *keyTokenPtr, *valueTokenPtr;
|
||||
int dictVarIndex;
|
||||
Tcl_Size dictVarIndex;
|
||||
|
||||
/*
|
||||
* There must be three arguments after the command.
|
||||
@@ -2078,8 +2089,9 @@ TclCompileDictWithCmd(
|
||||
CompileEnv *envPtr) /* Holds resulting instructions. */
|
||||
{
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
int i, range, varNameTmp = -1, pathTmp = -1, keysTmp, gotPath;
|
||||
int dictVar, bodyIsEmpty = 1;
|
||||
Tcl_Size dictVar, i;
|
||||
Tcl_Size range, varNameTmp = -1, pathTmp = -1, keysTmp;
|
||||
int bodyIsEmpty = 1, gotPath;
|
||||
Tcl_Token *varTokenPtr, *tokenPtr;
|
||||
JumpFixup jumpFixup;
|
||||
const char *ptr, *end;
|
||||
@@ -2089,7 +2101,7 @@ TclCompileDictWithCmd(
|
||||
*/
|
||||
|
||||
/* TODO: Consider support for compiling expanded args. */
|
||||
if ((int)parsePtr->numWords < 3) {
|
||||
if (parsePtr->numWords < 3 || parsePtr->numWords > INT_MAX) {
|
||||
return TCL_ERROR;
|
||||
}
|
||||
|
||||
@@ -2100,7 +2112,7 @@ TclCompileDictWithCmd(
|
||||
|
||||
varTokenPtr = TokenAfter(parsePtr->tokenPtr);
|
||||
tokenPtr = TokenAfter(varTokenPtr);
|
||||
for (i=3 ; i<(int)parsePtr->numWords ; i++) {
|
||||
for (i=3 ; i<parsePtr->numWords ; i++) {
|
||||
tokenPtr = TokenAfter(tokenPtr);
|
||||
}
|
||||
if (tokenPtr->type != TCL_TOKEN_SIMPLE_WORD) {
|
||||
@@ -2128,7 +2140,7 @@ TclCompileDictWithCmd(
|
||||
* Determine if we're manipulating a dict in a simple local variable.
|
||||
*/
|
||||
|
||||
gotPath = ((int)parsePtr->numWords > 3);
|
||||
gotPath = (parsePtr->numWords > 3);
|
||||
dictVar = LocalScalarFromToken(varTokenPtr, envPtr);
|
||||
|
||||
/*
|
||||
@@ -2147,11 +2159,11 @@ TclCompileDictWithCmd(
|
||||
*/
|
||||
|
||||
tokenPtr = TokenAfter(varTokenPtr);
|
||||
for (i=2 ; i<(int)parsePtr->numWords-1 ; i++) {
|
||||
for (i=2 ; i<parsePtr->numWords-1 ; i++) {
|
||||
CompileWord(envPtr, tokenPtr, interp, i);
|
||||
tokenPtr = TokenAfter(tokenPtr);
|
||||
}
|
||||
TclEmitInstInt4(INST_LIST, (int)parsePtr->numWords-3,envPtr);
|
||||
TclEmitInstInt4(INST_LIST, parsePtr->numWords-3,envPtr);
|
||||
Emit14Inst( INST_LOAD_SCALAR, dictVar, envPtr);
|
||||
TclEmitInstInt4(INST_OVER, 1, envPtr);
|
||||
TclEmitOpcode( INST_DICT_EXPAND, envPtr);
|
||||
@@ -2174,11 +2186,11 @@ TclCompileDictWithCmd(
|
||||
*/
|
||||
|
||||
tokenPtr = varTokenPtr;
|
||||
for (i=1 ; i<(int)parsePtr->numWords-1 ; i++) {
|
||||
for (i=1 ; i<parsePtr->numWords-1 ; i++) {
|
||||
CompileWord(envPtr, tokenPtr, interp, i);
|
||||
tokenPtr = TokenAfter(tokenPtr);
|
||||
}
|
||||
TclEmitInstInt4(INST_LIST, (int)parsePtr->numWords-3,envPtr);
|
||||
TclEmitInstInt4(INST_LIST, parsePtr->numWords-3,envPtr);
|
||||
TclEmitInstInt4(INST_OVER, 1, envPtr);
|
||||
TclEmitOpcode( INST_LOAD_STK, envPtr);
|
||||
TclEmitInstInt4(INST_OVER, 1, envPtr);
|
||||
@@ -2229,11 +2241,11 @@ TclCompileDictWithCmd(
|
||||
}
|
||||
tokenPtr = TokenAfter(varTokenPtr);
|
||||
if (gotPath) {
|
||||
for (i=2 ; i<(int)parsePtr->numWords-1 ; i++) {
|
||||
for (i=2 ; i<parsePtr->numWords-1 ; i++) {
|
||||
CompileWord(envPtr, tokenPtr, interp, i);
|
||||
tokenPtr = TokenAfter(tokenPtr);
|
||||
}
|
||||
TclEmitInstInt4( INST_LIST, (int)parsePtr->numWords-3,envPtr);
|
||||
TclEmitInstInt4( INST_LIST, parsePtr->numWords-3,envPtr);
|
||||
Emit14Inst( INST_STORE_SCALAR, pathTmp, envPtr);
|
||||
TclEmitOpcode( INST_POP, envPtr);
|
||||
}
|
||||
@@ -2295,7 +2307,7 @@ TclCompileDictWithCmd(
|
||||
if (dictVar == -1) {
|
||||
Emit14Inst( INST_LOAD_SCALAR, varNameTmp, envPtr);
|
||||
}
|
||||
if ((int)parsePtr->numWords > 3) {
|
||||
if (parsePtr->numWords > 3) {
|
||||
Emit14Inst( INST_LOAD_SCALAR, pathTmp, envPtr);
|
||||
} else {
|
||||
PushStringLiteral(envPtr, "");
|
||||
@@ -2433,7 +2445,7 @@ TclCompileErrorCmd(
|
||||
* General syntax: [error message ?errorInfo? ?errorCode?]
|
||||
*/
|
||||
|
||||
if ((int)parsePtr->numWords < 2 || (int)parsePtr->numWords > 4) {
|
||||
if (parsePtr->numWords < 2 || parsePtr->numWords > 4) {
|
||||
return TCL_ERROR;
|
||||
}
|
||||
|
||||
@@ -2501,7 +2513,7 @@ TclCompileExprCmd(
|
||||
{
|
||||
Tcl_Token *firstWordPtr;
|
||||
|
||||
if (parsePtr->numWords == 1) {
|
||||
if (parsePtr->numWords == 1 || parsePtr->numWords > INT_MAX) {
|
||||
return TCL_ERROR;
|
||||
}
|
||||
|
||||
@@ -2513,7 +2525,7 @@ TclCompileExprCmd(
|
||||
envPtr->extCmdMapPtr->nuloc-1].line[1];
|
||||
|
||||
firstWordPtr = TokenAfter(parsePtr->tokenPtr);
|
||||
TclCompileExprWords(interp, firstWordPtr, (int)parsePtr->numWords-1, envPtr);
|
||||
TclCompileExprWords(interp, firstWordPtr, parsePtr->numWords-1, envPtr);
|
||||
return TCL_OK;
|
||||
}
|
||||
|
||||
@@ -2546,8 +2558,8 @@ TclCompileForCmd(
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
Tcl_Token *startTokenPtr, *testTokenPtr, *nextTokenPtr, *bodyTokenPtr;
|
||||
JumpFixup jumpEvalCondFixup;
|
||||
int bodyCodeOffset, nextCodeOffset, jumpDist;
|
||||
int bodyRange, nextRange;
|
||||
Tcl_Size bodyCodeOffset, nextCodeOffset, jumpDist;
|
||||
Tcl_Size bodyRange, nextRange;
|
||||
|
||||
if (parsePtr->numWords != 5) {
|
||||
return TCL_ERROR;
|
||||
@@ -2762,8 +2774,9 @@ CompileEachloopCmd(
|
||||
* record in the ByteCode. */
|
||||
|
||||
Tcl_Token *tokenPtr, *bodyTokenPtr;
|
||||
int jumpBackOffset, infoIndex, range;
|
||||
int numWords, numLists, i, code = TCL_OK;
|
||||
Tcl_Size jumpBackOffset, infoIndex, range;
|
||||
Tcl_Size numWords, numLists, i;
|
||||
int code = TCL_OK;
|
||||
Tcl_Size j;
|
||||
Tcl_Obj *varListObj = NULL;
|
||||
|
||||
@@ -2776,8 +2789,8 @@ CompileEachloopCmd(
|
||||
return TCL_ERROR;
|
||||
}
|
||||
|
||||
numWords = (int)parsePtr->numWords;
|
||||
if ((numWords < 4) || (numWords%2 != 0)) {
|
||||
numWords = parsePtr->numWords;
|
||||
if ((numWords < 4) || (numWords > INT_MAX) || (numWords%2 != 0)) {
|
||||
return TCL_ERROR;
|
||||
}
|
||||
|
||||
@@ -2844,7 +2857,7 @@ CompileEachloopCmd(
|
||||
for (j = 0; j < numVars; j++) {
|
||||
Tcl_Obj *varNameObj;
|
||||
const char *bytes;
|
||||
int varIndex;
|
||||
Tcl_Size varIndex;
|
||||
Tcl_Size length;
|
||||
|
||||
Tcl_ListObjIndex(NULL, varListObj, j, &varNameObj);
|
||||
@@ -2964,13 +2977,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;
|
||||
int numVars, i, j, numLists = srcPtr->numLists;
|
||||
Tcl_Size numVars, i, j, numLists = srcPtr->numLists;
|
||||
|
||||
dupPtr = (ForeachInfo *)Tcl_Alloc(offsetof(ForeachInfo, varLists)
|
||||
+ numLists * sizeof(ForeachVarList *));
|
||||
@@ -3013,12 +3026,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;
|
||||
size_t i, numLists = infoPtr->numLists;
|
||||
Tcl_Size i, numLists = infoPtr->numLists;
|
||||
|
||||
for (i = 0; i < numLists; i++) {
|
||||
listPtr = infoPtr->varLists[i];
|
||||
@@ -3227,14 +3240,13 @@ TclCompileFormatCmd(
|
||||
Tcl_Token *tokenPtr = parsePtr->tokenPtr;
|
||||
Tcl_Obj **objv, *formatObj, *tmpObj;
|
||||
const char *bytes, *start;
|
||||
int i, j;
|
||||
Tcl_Size len;
|
||||
Tcl_Size i, j, len;
|
||||
|
||||
/*
|
||||
* Don't handle any guaranteed-error cases.
|
||||
*/
|
||||
|
||||
if ((int)parsePtr->numWords < 2) {
|
||||
if (parsePtr->numWords < 2 || parsePtr->numWords > INT_MAX) {
|
||||
return TCL_ERROR;
|
||||
}
|
||||
|
||||
@@ -3251,8 +3263,8 @@ TclCompileFormatCmd(
|
||||
return TCL_ERROR;
|
||||
}
|
||||
|
||||
objv = (Tcl_Obj **)Tcl_Alloc(((int)parsePtr->numWords-2) * sizeof(Tcl_Obj *));
|
||||
for (i=0 ; i+2 < (int)parsePtr->numWords ; i++) {
|
||||
objv = (Tcl_Obj **)Tcl_Alloc((parsePtr->numWords-2) * sizeof(Tcl_Obj *));
|
||||
for (i=0 ; i+2 < parsePtr->numWords ; i++) {
|
||||
tokenPtr = TokenAfter(tokenPtr);
|
||||
TclNewObj(objv[i]);
|
||||
Tcl_IncrRefCount(objv[i]);
|
||||
@@ -3267,7 +3279,7 @@ TclCompileFormatCmd(
|
||||
*/
|
||||
|
||||
tmpObj = Tcl_Format(interp, TclGetString(formatObj),
|
||||
(int)parsePtr->numWords-2, objv);
|
||||
parsePtr->numWords-2, objv);
|
||||
for (; --i>=0 ;) {
|
||||
Tcl_DecrRefCount(objv[i]);
|
||||
}
|
||||
@@ -3328,7 +3340,7 @@ TclCompileFormatCmd(
|
||||
* Check if the number of things to concatenate will fit in a byte.
|
||||
*/
|
||||
|
||||
if (i+2 != (int)parsePtr->numWords || i > 125) {
|
||||
if (i+2 != parsePtr->numWords || i > 125) {
|
||||
Tcl_DecrRefCount(formatObj);
|
||||
return TCL_ERROR;
|
||||
}
|
||||
@@ -3346,7 +3358,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 == '%') {
|
||||
@@ -3426,12 +3438,13 @@ TclCompileFormatCmd(
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
size_t
|
||||
Tcl_Size
|
||||
TclLocalScalarFromToken(
|
||||
Tcl_Token *tokenPtr,
|
||||
CompileEnv *envPtr)
|
||||
{
|
||||
int isScalar, index;
|
||||
Tcl_Size index;
|
||||
int isScalar;
|
||||
|
||||
TclPushVarName(NULL, tokenPtr, envPtr, TCL_NO_ELEMENT, &index, &isScalar);
|
||||
if (!isScalar) {
|
||||
@@ -3440,7 +3453,7 @@ TclLocalScalarFromToken(
|
||||
return index;
|
||||
}
|
||||
|
||||
size_t
|
||||
Tcl_Size
|
||||
TclLocalScalar(
|
||||
const char *bytes,
|
||||
size_t numBytes,
|
||||
@@ -3491,15 +3504,15 @@ TclPushVarName(
|
||||
Tcl_Token *varTokenPtr, /* Points to a variable token. */
|
||||
CompileEnv *envPtr, /* Holds resulting instructions. */
|
||||
int flags, /* TCL_NO_LARGE_INDEX | TCL_NO_ELEMENT. */
|
||||
int *localIndexPtr, /* Must not be NULL. */
|
||||
Tcl_Size *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;
|
||||
size_t nameLen, elNameLen;
|
||||
int simpleVarName, localIndex;
|
||||
Tcl_Size nameLen, elNameLen, localIndex;
|
||||
int simpleVarName;
|
||||
Tcl_Size elemTokenCount = 0, removedParen = 0;
|
||||
int allocedTokens = 0;
|
||||
|
||||
|
||||
+62
-54
@@ -25,7 +25,7 @@
|
||||
static void CompileReturnInternal(CompileEnv *envPtr,
|
||||
unsigned char op, int code, int level,
|
||||
Tcl_Obj *returnOpts);
|
||||
static int IndexTailVarIfKnown(Tcl_Interp *interp,
|
||||
static Tcl_Size IndexTailVarIfKnown(Tcl_Interp *interp,
|
||||
Tcl_Token *varTokenPtr, CompileEnv *envPtr);
|
||||
|
||||
/*
|
||||
@@ -58,7 +58,7 @@ TclGetIndexFromToken(
|
||||
|
||||
TclNewObj(tmpObj);
|
||||
if (TclWordKnownAtCompileTime(tokenPtr, tmpObj)) {
|
||||
result = TclIndexEncode(NULL, tmpObj, before, after, indexPtr);
|
||||
result = TclIndexEncode(NULL, tmpObj, (int)before, (int)after, indexPtr);
|
||||
}
|
||||
Tcl_DecrRefCount(tmpObj);
|
||||
return result;
|
||||
@@ -92,7 +92,7 @@ TclCompileGlobalCmd(
|
||||
{
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
Tcl_Token *varTokenPtr;
|
||||
int localIndex, numWords, i;
|
||||
Tcl_Size 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) {
|
||||
if (localIndex < 0 || localIndex > INT_MAX) {
|
||||
return TCL_ERROR;
|
||||
}
|
||||
|
||||
@@ -180,9 +180,10 @@ TclCompileIfCmd(
|
||||
* to the end of the "if" when that PC is
|
||||
* determined. */
|
||||
Tcl_Token *tokenPtr, *testTokenPtr;
|
||||
int jumpIndex = 0; /* Avoid compiler warning. */
|
||||
Tcl_Size jumpIndex = 0; /* Avoid compiler warning. */
|
||||
size_t numBytes, j;
|
||||
int jumpFalseDist, numWords, wordIdx, code;
|
||||
int jumpFalseDist, code;
|
||||
Tcl_Size numWords, wordIdx;
|
||||
const char *word;
|
||||
int realCond = 1; /* Set to 0 for static conditions:
|
||||
* "if 0 {..}" */
|
||||
@@ -476,7 +477,8 @@ TclCompileIncrCmd(
|
||||
{
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
Tcl_Token *varTokenPtr, *incrTokenPtr;
|
||||
int isScalar, localIndex, haveImmValue;
|
||||
int isScalar, haveImmValue;
|
||||
Tcl_Size localIndex;
|
||||
Tcl_WideInt immValue;
|
||||
|
||||
if ((parsePtr->numWords != 2) && (parsePtr->numWords != 3)) {
|
||||
@@ -672,7 +674,8 @@ TclCompileInfoExistsCmd(
|
||||
{
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
Tcl_Token *tokenPtr;
|
||||
int isScalar, localIndex;
|
||||
int isScalar;
|
||||
Tcl_Size localIndex;
|
||||
|
||||
if (parsePtr->numWords != 2) {
|
||||
return TCL_ERROR;
|
||||
@@ -845,7 +848,8 @@ TclCompileLappendCmd(
|
||||
{
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
Tcl_Token *varTokenPtr, *valueTokenPtr;
|
||||
int isScalar, localIndex, numWords, i;
|
||||
int isScalar;
|
||||
Tcl_Size localIndex, numWords, i;
|
||||
|
||||
/* TODO: Consider support for compiling expanded args. */
|
||||
numWords = parsePtr->numWords;
|
||||
@@ -960,7 +964,8 @@ TclCompileLassignCmd(
|
||||
{
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
Tcl_Token *tokenPtr;
|
||||
int isScalar, localIndex, numWords, idx;
|
||||
int isScalar;
|
||||
Tcl_Size localIndex, numWords, idx;
|
||||
|
||||
numWords = parsePtr->numWords;
|
||||
|
||||
@@ -1030,7 +1035,7 @@ TclCompileLassignCmd(
|
||||
*/
|
||||
|
||||
TclEmitInstInt4( INST_LIST_RANGE_IMM, idx, envPtr);
|
||||
TclEmitInt4( (int)TCL_INDEX_END, envPtr);
|
||||
TclEmitInt4( TCL_INDEX_END, envPtr);
|
||||
|
||||
return TCL_OK;
|
||||
}
|
||||
@@ -1063,7 +1068,8 @@ TclCompileLindexCmd(
|
||||
{
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
Tcl_Token *idxTokenPtr, *valTokenPtr;
|
||||
int i, idx, numWords = parsePtr->numWords;
|
||||
Tcl_Size i, numWords = parsePtr->numWords;
|
||||
int idx;
|
||||
|
||||
/*
|
||||
* Quit if not enough args.
|
||||
@@ -1153,10 +1159,12 @@ TclCompileListCmd(
|
||||
{
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
Tcl_Token *valueTokenPtr;
|
||||
int i, numWords, concat, build;
|
||||
Tcl_Size i, numWords;
|
||||
int concat, build;
|
||||
Tcl_Obj *listObj, *objPtr;
|
||||
|
||||
if (parsePtr->numWords == 1) {
|
||||
numWords = parsePtr->numWords;
|
||||
if (numWords == 1) {
|
||||
/*
|
||||
* [list] without arguments just pushes an empty object.
|
||||
*/
|
||||
@@ -1170,7 +1178,6 @@ TclCompileListCmd(
|
||||
* implement with a simple push.
|
||||
*/
|
||||
|
||||
numWords = parsePtr->numWords;
|
||||
valueTokenPtr = TokenAfter(parsePtr->tokenPtr);
|
||||
TclNewObj(listObj);
|
||||
for (i = 1; i < numWords && listObj != NULL; i++) {
|
||||
@@ -1193,7 +1200,6 @@ TclCompileListCmd(
|
||||
* Push the all values onto the stack.
|
||||
*/
|
||||
|
||||
numWords = parsePtr->numWords;
|
||||
valueTokenPtr = TokenAfter(parsePtr->tokenPtr);
|
||||
concat = build = 0;
|
||||
for (i = 1; i < numWords; i++) {
|
||||
@@ -1233,7 +1239,7 @@ TclCompileListCmd(
|
||||
|
||||
if (concat && numWords == 2) {
|
||||
TclEmitInstInt4( INST_LIST_RANGE_IMM, 0, envPtr);
|
||||
TclEmitInt4( (int)TCL_INDEX_END, envPtr);
|
||||
TclEmitInt4( TCL_INDEX_END, envPtr);
|
||||
}
|
||||
return TCL_OK;
|
||||
}
|
||||
@@ -1358,9 +1364,9 @@ TclCompileLinsertCmd(
|
||||
{
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
Tcl_Token *tokenPtr;
|
||||
int i;
|
||||
Tcl_Size i;
|
||||
|
||||
if ((int)parsePtr->numWords < 3) {
|
||||
if (parsePtr->numWords < 3) {
|
||||
return TCL_ERROR;
|
||||
}
|
||||
|
||||
@@ -1371,7 +1377,7 @@ TclCompileLinsertCmd(
|
||||
CompileWord(envPtr, tokenPtr, interp, 2);
|
||||
|
||||
/* Push new elements to be inserted */
|
||||
for (i=3 ; i<(int)parsePtr->numWords ; i++) {
|
||||
for (i=3 ; i<parsePtr->numWords ; i++) {
|
||||
tokenPtr = TokenAfter(tokenPtr);
|
||||
CompileWord(envPtr, tokenPtr, interp, i);
|
||||
}
|
||||
@@ -1410,7 +1416,7 @@ TclCompileLreplaceCmd(
|
||||
{
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
Tcl_Token *tokenPtr;
|
||||
int i;
|
||||
Tcl_Size i;
|
||||
|
||||
if (parsePtr->numWords < 4) {
|
||||
return TCL_ERROR;
|
||||
@@ -1425,7 +1431,7 @@ TclCompileLreplaceCmd(
|
||||
CompileWord(envPtr, tokenPtr, interp, 3);
|
||||
|
||||
/* Push new elements to be inserted */
|
||||
for (i=4 ; i< (int)parsePtr->numWords ; i++) {
|
||||
for (i=4 ; i< parsePtr->numWords ; i++) {
|
||||
tokenPtr = TokenAfter(tokenPtr);
|
||||
CompileWord(envPtr, tokenPtr, interp, i);
|
||||
}
|
||||
@@ -1490,20 +1496,20 @@ TclCompileLsetCmd(
|
||||
CompileEnv *envPtr) /* Holds the resulting instructions. */
|
||||
{
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
int tempDepth; /* Depth used for emitting one part of the
|
||||
Tcl_Size 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. */
|
||||
int localIndex; /* Index of var in local var table. */
|
||||
Tcl_Size localIndex; /* Index of var in local var table. */
|
||||
int isScalar; /* Flag == 1 if scalar, 0 if array. */
|
||||
int i;
|
||||
Tcl_Size i;
|
||||
|
||||
/*
|
||||
* Check argument count.
|
||||
*/
|
||||
|
||||
/* TODO: Consider support for compiling expanded args. */
|
||||
if ((int)parsePtr->numWords < 3) {
|
||||
if (parsePtr->numWords < 3) {
|
||||
/*
|
||||
* Fail at run time, not in compilation.
|
||||
*/
|
||||
@@ -1527,7 +1533,7 @@ TclCompileLsetCmd(
|
||||
* Push the "index" args and the new element value.
|
||||
*/
|
||||
|
||||
for (i=2 ; i<(int)parsePtr->numWords ; ++i) {
|
||||
for (i=2 ; i<parsePtr->numWords ; ++i) {
|
||||
varTokenPtr = TokenAfter(varTokenPtr);
|
||||
CompileWord(envPtr, varTokenPtr, interp, i);
|
||||
}
|
||||
@@ -1731,7 +1737,7 @@ TclCompileNamespaceQualifiersCmd(
|
||||
{
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
Tcl_Token *tokenPtr = TokenAfter(parsePtr->tokenPtr);
|
||||
int off;
|
||||
Tcl_Size off;
|
||||
|
||||
if (parsePtr->numWords != 2) {
|
||||
return TCL_ERROR;
|
||||
@@ -1802,7 +1808,8 @@ TclCompileNamespaceUpvarCmd(
|
||||
{
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
Tcl_Token *tokenPtr, *otherTokenPtr, *localTokenPtr;
|
||||
int localIndex, numWords, i;
|
||||
Tcl_Size localIndex;
|
||||
Tcl_Size numWords, i;
|
||||
|
||||
if (envPtr->procPtr == NULL) {
|
||||
return TCL_ERROR;
|
||||
@@ -1812,7 +1819,7 @@ TclCompileNamespaceUpvarCmd(
|
||||
* Only compile [namespace upvar ...]: needs an even number of args, >=4
|
||||
*/
|
||||
|
||||
numWords = (int)parsePtr->numWords;
|
||||
numWords = parsePtr->numWords;
|
||||
if ((numWords % 2) || (numWords < 4)) {
|
||||
return TCL_ERROR;
|
||||
}
|
||||
@@ -1864,7 +1871,7 @@ TclCompileNamespaceWhichCmd(
|
||||
Tcl_Token *tokenPtr, *opt;
|
||||
int idx;
|
||||
|
||||
if ((int)parsePtr->numWords < 2 || (int)parsePtr->numWords > 3) {
|
||||
if (parsePtr->numWords < 2 || parsePtr->numWords > 3) {
|
||||
return TCL_ERROR;
|
||||
}
|
||||
tokenPtr = TokenAfter(parsePtr->tokenPtr);
|
||||
@@ -1927,7 +1934,8 @@ TclCompileRegexpCmd(
|
||||
Tcl_Token *varTokenPtr; /* Pointer to the Tcl_Token representing the
|
||||
* parse of the RE or string. */
|
||||
size_t len;
|
||||
int i, nocase, exact, sawLast, simple;
|
||||
Tcl_Size i;
|
||||
int nocase, exact, sawLast, simple;
|
||||
const char *str;
|
||||
|
||||
/*
|
||||
@@ -1937,7 +1945,7 @@ TclCompileRegexpCmd(
|
||||
* regexp ?-nocase? ?--? {^staticString$} $var
|
||||
*/
|
||||
|
||||
if ((int)parsePtr->numWords < 3) {
|
||||
if (parsePtr->numWords < 3) {
|
||||
return TCL_ERROR;
|
||||
}
|
||||
|
||||
@@ -1952,7 +1960,7 @@ TclCompileRegexpCmd(
|
||||
* handling, but satisfies our stricter needs.
|
||||
*/
|
||||
|
||||
for (i = 1; i < (int)parsePtr->numWords - 2; i++) {
|
||||
for (i = 1; i < parsePtr->numWords - 2; i++) {
|
||||
varTokenPtr = TokenAfter(varTokenPtr);
|
||||
if (varTokenPtr->type != TCL_TOKEN_SIMPLE_WORD) {
|
||||
/*
|
||||
@@ -1978,7 +1986,7 @@ TclCompileRegexpCmd(
|
||||
}
|
||||
}
|
||||
|
||||
if (((int)parsePtr->numWords - i) != 2) {
|
||||
if ((parsePtr->numWords - i) != 2) {
|
||||
/*
|
||||
* We don't support capturing to variables.
|
||||
*/
|
||||
@@ -2031,7 +2039,7 @@ TclCompileRegexpCmd(
|
||||
}
|
||||
|
||||
if (!simple) {
|
||||
CompileWord(envPtr, varTokenPtr, interp, (int)parsePtr->numWords - 2);
|
||||
CompileWord(envPtr, varTokenPtr, interp, parsePtr->numWords - 2);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -2039,7 +2047,7 @@ TclCompileRegexpCmd(
|
||||
*/
|
||||
|
||||
varTokenPtr = TokenAfter(varTokenPtr);
|
||||
CompileWord(envPtr, varTokenPtr, interp, (int)parsePtr->numWords - 1);
|
||||
CompileWord(envPtr, varTokenPtr, interp, parsePtr->numWords - 1);
|
||||
|
||||
if (simple) {
|
||||
if (exact && !nocase) {
|
||||
@@ -2116,7 +2124,7 @@ TclCompileRegsubCmd(
|
||||
int exact, quantified, result = TCL_ERROR;
|
||||
Tcl_Size len;
|
||||
|
||||
if ((int)parsePtr->numWords < 5 || (int)parsePtr->numWords > 6) {
|
||||
if (parsePtr->numWords < 5 || parsePtr->numWords > 6) {
|
||||
return TCL_ERROR;
|
||||
}
|
||||
|
||||
@@ -2223,7 +2231,7 @@ TclCompileRegsubCmd(
|
||||
PushLiteral(envPtr, bytes, len);
|
||||
bytes = TclGetStringFromObj(replacementObj, &len);
|
||||
PushLiteral(envPtr, bytes, len);
|
||||
CompileWord(envPtr, stringTokenPtr, interp, (int)parsePtr->numWords - 2);
|
||||
CompileWord(envPtr, stringTokenPtr, interp, parsePtr->numWords - 2);
|
||||
TclEmitOpcode( INST_STR_MAP, envPtr);
|
||||
|
||||
done:
|
||||
@@ -2270,9 +2278,9 @@ TclCompileReturnCmd(
|
||||
*/
|
||||
int level, code, objc, status = TCL_OK;
|
||||
Tcl_Size size;
|
||||
int numWords = parsePtr->numWords;
|
||||
Tcl_Size numWords = parsePtr->numWords;
|
||||
int explicitResult = (0 == (numWords % 2));
|
||||
int numOptionWords = numWords - 1 - explicitResult;
|
||||
Tcl_Size numOptionWords = numWords - 1 - explicitResult;
|
||||
Tcl_Obj *returnOpts, **objv;
|
||||
Tcl_Token *wordTokenPtr = TokenAfter(parsePtr->tokenPtr);
|
||||
|
||||
@@ -2372,7 +2380,7 @@ TclCompileReturnCmd(
|
||||
* We have default return options and we're in a proc ...
|
||||
*/
|
||||
|
||||
int index = envPtr->exceptArrayNext - 1;
|
||||
Tcl_Size index = envPtr->exceptArrayNext - 1;
|
||||
int enclosingCatch = 0;
|
||||
|
||||
while (index >= 0) {
|
||||
@@ -2517,7 +2525,7 @@ TclCompileUpvarCmd(
|
||||
{
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
Tcl_Token *tokenPtr, *otherTokenPtr, *localTokenPtr;
|
||||
int localIndex, numWords, i;
|
||||
Tcl_Size localIndex, numWords, i;
|
||||
Tcl_Obj *objPtr;
|
||||
|
||||
if (envPtr->procPtr == NULL) {
|
||||
@@ -2623,7 +2631,7 @@ TclCompileVariableCmd(
|
||||
{
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
Tcl_Token *varTokenPtr, *valueTokenPtr;
|
||||
int localIndex, numWords, i;
|
||||
Tcl_Size localIndex, numWords, i;
|
||||
|
||||
numWords = parsePtr->numWords;
|
||||
if (numWords < 2) {
|
||||
@@ -2697,7 +2705,7 @@ TclCompileVariableCmd(
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
static int
|
||||
static Tcl_Size
|
||||
IndexTailVarIfKnown(
|
||||
TCL_UNUSED(Tcl_Interp *),
|
||||
Tcl_Token *varTokenPtr, /* Token representing the variable name */
|
||||
@@ -2705,10 +2713,10 @@ IndexTailVarIfKnown(
|
||||
{
|
||||
Tcl_Obj *tailPtr;
|
||||
const char *tailName, *p;
|
||||
int n = varTokenPtr->numComponents;
|
||||
Tcl_Size len;
|
||||
Tcl_Size n = varTokenPtr->numComponents;
|
||||
Tcl_Size len, localIndex;
|
||||
Tcl_Token *lastTokenPtr;
|
||||
int full, localIndex;
|
||||
int full;
|
||||
|
||||
/*
|
||||
* Determine if the tail is (a) known at compile time, and (b) not an
|
||||
@@ -2797,13 +2805,13 @@ TclCompileObjectNextCmd(
|
||||
{
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
Tcl_Token *tokenPtr = parsePtr->tokenPtr;
|
||||
int i;
|
||||
Tcl_Size i;
|
||||
|
||||
if ((int)parsePtr->numWords > 255) {
|
||||
if (parsePtr->numWords > 255) {
|
||||
return TCL_ERROR;
|
||||
}
|
||||
|
||||
for (i=0 ; i<(int)parsePtr->numWords ; i++) {
|
||||
for (i=0 ; i<parsePtr->numWords ; i++) {
|
||||
CompileWord(envPtr, tokenPtr, interp, i);
|
||||
tokenPtr = TokenAfter(tokenPtr);
|
||||
}
|
||||
@@ -2821,13 +2829,13 @@ TclCompileObjectNextToCmd(
|
||||
{
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
Tcl_Token *tokenPtr = parsePtr->tokenPtr;
|
||||
int i;
|
||||
Tcl_Size i;
|
||||
|
||||
if ((int)parsePtr->numWords < 2 || (int)parsePtr->numWords > 255) {
|
||||
if (parsePtr->numWords < 2 || parsePtr->numWords > 255) {
|
||||
return TCL_ERROR;
|
||||
}
|
||||
|
||||
for (i=0 ; i<(int)parsePtr->numWords ; i++) {
|
||||
for (i=0 ; i<parsePtr->numWords ; i++) {
|
||||
CompileWord(envPtr, tokenPtr, interp, i);
|
||||
tokenPtr = TokenAfter(tokenPtr);
|
||||
}
|
||||
|
||||
+95
-84
@@ -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,
|
||||
Tcl_Size *bodyLines, Tcl_Size **bodyNext);
|
||||
int *bodyLines, Tcl_Size **bodyNext);
|
||||
static void IssueSwitchJumpTable(Tcl_Interp *interp,
|
||||
CompileEnv *envPtr, int numWords,
|
||||
Tcl_Token **bodyToken, Tcl_Size *bodyLines,
|
||||
CompileEnv *envPtr, Tcl_Size numWords,
|
||||
Tcl_Token **bodyToken, int *bodyLines,
|
||||
Tcl_Size **bodyContLines);
|
||||
static int IssueTryClausesInstructions(Tcl_Interp *interp,
|
||||
CompileEnv *envPtr, Tcl_Token *bodyToken,
|
||||
int numHandlers, int *matchCodes,
|
||||
Tcl_Obj **matchClauses, int *resultVarIndices,
|
||||
int *optionVarIndices, Tcl_Token **handlerTokens);
|
||||
Tcl_Size numHandlers, int *matchCodes,
|
||||
Tcl_Obj **matchClauses, Tcl_Size *resultVarIndices,
|
||||
Tcl_Size *optionVarIndices, Tcl_Token **handlerTokens);
|
||||
static int IssueTryClausesFinallyInstructions(Tcl_Interp *interp,
|
||||
CompileEnv *envPtr, Tcl_Token *bodyToken,
|
||||
int numHandlers, int *matchCodes,
|
||||
Tcl_Obj **matchClauses, int *resultVarIndices,
|
||||
int *optionVarIndices, Tcl_Token **handlerTokens,
|
||||
Tcl_Size numHandlers, int *matchCodes,
|
||||
Tcl_Obj **matchClauses, Tcl_Size *resultVarIndices,
|
||||
Tcl_Size *optionVarIndices, Tcl_Token **handlerTokens,
|
||||
Tcl_Token *finallyToken);
|
||||
static int IssueTryFinallyInstructions(Tcl_Interp *interp,
|
||||
CompileEnv *envPtr, Tcl_Token *bodyToken,
|
||||
@@ -130,7 +130,8 @@ TclCompileSetCmd(
|
||||
{
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
Tcl_Token *varTokenPtr, *valueTokenPtr;
|
||||
int isAssignment, isScalar, localIndex, numWords;
|
||||
int isAssignment, isScalar;
|
||||
Tcl_Size localIndex, numWords;
|
||||
|
||||
numWords = parsePtr->numWords;
|
||||
if ((numWords != 2) && (numWords != 3)) {
|
||||
@@ -222,7 +223,7 @@ TclCompileStringCatCmd(
|
||||
CompileEnv *envPtr) /* Holds resulting instructions. */
|
||||
{
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
int i, numWords = parsePtr->numWords, numArgs;
|
||||
Tcl_Size i, numWords = parsePtr->numWords, numArgs;
|
||||
Tcl_Token *wordTokenPtr;
|
||||
Tcl_Obj *obj, *folded;
|
||||
|
||||
@@ -518,7 +519,8 @@ TclCompileStringIsCmd(
|
||||
STR_IS_SPACE, STR_IS_TRUE, STR_IS_UPPER,
|
||||
STR_IS_WIDE, STR_IS_WORD, STR_IS_XDIGIT
|
||||
} t;
|
||||
int range, allowEmpty = 0, end;
|
||||
Tcl_Size range, end;
|
||||
int allowEmpty = 0;
|
||||
InstStringClassType strClassType;
|
||||
Tcl_Obj *isClass;
|
||||
|
||||
@@ -572,7 +574,7 @@ TclCompileStringIsCmd(
|
||||
* 5. Lists
|
||||
*/
|
||||
|
||||
CompileWord(envPtr, tokenPtr, interp, (int)parsePtr->numWords-1);
|
||||
CompileWord(envPtr, tokenPtr, interp, parsePtr->numWords-1);
|
||||
|
||||
switch (t) {
|
||||
case STR_IS_ALNUM:
|
||||
@@ -617,7 +619,7 @@ TclCompileStringIsCmd(
|
||||
if (allowEmpty) {
|
||||
OP1( STR_CLASS, strClassType);
|
||||
} else {
|
||||
int over, over2;
|
||||
Tcl_Size over, over2;
|
||||
|
||||
OP( DUP);
|
||||
OP1( STR_CLASS, strClassType);
|
||||
@@ -637,7 +639,7 @@ TclCompileStringIsCmd(
|
||||
case STR_IS_TRUE:
|
||||
OP( TRY_CVT_TO_BOOLEAN);
|
||||
switch (t) {
|
||||
int over, over2;
|
||||
Tcl_Size over, over2;
|
||||
|
||||
case STR_IS_BOOL:
|
||||
if (allowEmpty) {
|
||||
@@ -685,7 +687,7 @@ TclCompileStringIsCmd(
|
||||
break;
|
||||
|
||||
case STR_IS_DOUBLE: {
|
||||
int satisfied, isEmpty;
|
||||
Tcl_Size satisfied, isEmpty;
|
||||
|
||||
if (allowEmpty) {
|
||||
OP( DUP);
|
||||
@@ -716,7 +718,7 @@ TclCompileStringIsCmd(
|
||||
case STR_IS_WIDE:
|
||||
case STR_IS_ENTIER:
|
||||
if (allowEmpty) {
|
||||
int testNumType;
|
||||
Tcl_Size testNumType;
|
||||
|
||||
OP( DUP);
|
||||
OP( NUM_TYPE);
|
||||
@@ -1054,7 +1056,7 @@ TclCompileStringReplaceCmd(
|
||||
Tcl_Token *tokenPtr, *valueTokenPtr;
|
||||
int first, last;
|
||||
|
||||
if ((int)parsePtr->numWords < 4 || (int)parsePtr->numWords > 5) {
|
||||
if (parsePtr->numWords < 4 || parsePtr->numWords > 5) {
|
||||
return TCL_ERROR;
|
||||
}
|
||||
|
||||
@@ -1176,7 +1178,7 @@ TclCompileStringReplaceCmd(
|
||||
if (last == INT_MAX) {
|
||||
OP( POP); /* Pop original */
|
||||
} else {
|
||||
OP44( STR_RANGE_IMM, last + 1, (int)TCL_INDEX_END);
|
||||
OP44( STR_RANGE_IMM, last + 1, TCL_INDEX_END);
|
||||
OP1( STR_CONCAT1, 2);
|
||||
}
|
||||
return TCL_OK;
|
||||
@@ -1208,7 +1210,7 @@ TclCompileStringReplaceCmd(
|
||||
PUSH ( "");
|
||||
return TCL_OK;
|
||||
}
|
||||
OP44( STR_RANGE_IMM, last + 1, (int)TCL_INDEX_END);
|
||||
OP44( STR_RANGE_IMM, last + 1, TCL_INDEX_END);
|
||||
return TCL_OK;
|
||||
} else {
|
||||
if (last == (int)TCL_INDEX_END) {
|
||||
@@ -1219,7 +1221,7 @@ TclCompileStringReplaceCmd(
|
||||
OP( DUP);
|
||||
OP44( STR_RANGE_IMM, 0, first-1);
|
||||
OP4( REVERSE, 2);
|
||||
OP44( STR_RANGE_IMM, last + 1, (int)TCL_INDEX_END);
|
||||
OP44( STR_RANGE_IMM, last + 1, TCL_INDEX_END);
|
||||
OP1( STR_CONCAT1, 2);
|
||||
return TCL_OK;
|
||||
}
|
||||
@@ -1451,9 +1453,9 @@ TclCompileSubstCmd(
|
||||
CompileEnv *envPtr) /* Holds resulting instructions. */
|
||||
{
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
int numArgs = parsePtr->numWords - 1;
|
||||
int numOpts = numArgs - 1;
|
||||
int objc, flags = TCL_SUBST_ALL;
|
||||
Tcl_Size numArgs = parsePtr->numWords - 1;
|
||||
Tcl_Size objc, numOpts = numArgs - 1;
|
||||
int flags = TCL_SUBST_ALL;
|
||||
Tcl_Obj **objv/*, *toSubst = NULL*/;
|
||||
Tcl_Token *wordTokenPtr = TokenAfter(parsePtr->tokenPtr);
|
||||
int code = TCL_ERROR;
|
||||
@@ -1514,12 +1516,12 @@ TclSubstCompile(
|
||||
const char *bytes,
|
||||
Tcl_Size numBytes,
|
||||
int flags,
|
||||
Tcl_Size line,
|
||||
int line,
|
||||
CompileEnv *envPtr)
|
||||
{
|
||||
Tcl_Token *endTokenPtr, *tokenPtr;
|
||||
int breakOffset = 0, count = 0;
|
||||
Tcl_Size bline = line;
|
||||
Tcl_Size breakOffset = 0, count = 0;
|
||||
int bline = line;
|
||||
Tcl_Parse parse;
|
||||
Tcl_InterpState state = NULL;
|
||||
|
||||
@@ -1544,8 +1546,9 @@ TclSubstCompile(
|
||||
|
||||
for (endTokenPtr = tokenPtr + parse.numTokens;
|
||||
tokenPtr < endTokenPtr; tokenPtr = TokenAfter(tokenPtr)) {
|
||||
Tcl_Size length;
|
||||
int literal, catchRange, breakJump;
|
||||
Tcl_Size length, catchRange;
|
||||
int literal;
|
||||
Tcl_Size breakJump;
|
||||
char buf[4] = "";
|
||||
JumpFixup startFixup, okFixup, returnFixup, breakFixup;
|
||||
JumpFixup continueFixup, otherFixup, endFixup;
|
||||
@@ -1787,7 +1790,7 @@ TclCompileSwitchCmd(
|
||||
{
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
Tcl_Token *tokenPtr; /* Pointer to tokens in command. */
|
||||
int numWords; /* Number of words in command. */
|
||||
Tcl_Size numWords; /* Number of words in command. */
|
||||
|
||||
Tcl_Token *valueTokenPtr; /* Token for the value to switch on. */
|
||||
enum {Switch_Exact, Switch_Glob, Switch_Regexp} mode;
|
||||
@@ -1795,7 +1798,7 @@ TclCompileSwitchCmd(
|
||||
|
||||
Tcl_Token *bodyTokenArray; /* Array of real pattern list items. */
|
||||
Tcl_Token **bodyToken; /* Array of pointers to pattern list items. */
|
||||
Tcl_Size *bodyLines; /* Array of line numbers for body list
|
||||
int *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? */
|
||||
@@ -1941,7 +1944,7 @@ TclCompileSwitchCmd(
|
||||
if (numWords == 1) {
|
||||
const char *bytes;
|
||||
Tcl_Size maxLen, numBytes;
|
||||
Tcl_Size bline; /* TIP #280: line of the pattern/action list,
|
||||
int 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. */
|
||||
@@ -1959,7 +1962,7 @@ TclCompileSwitchCmd(
|
||||
}
|
||||
bodyTokenArray = (Tcl_Token *)Tcl_Alloc(sizeof(Tcl_Token) * maxLen);
|
||||
bodyToken = (Tcl_Token **)Tcl_Alloc(sizeof(Tcl_Token *) * maxLen);
|
||||
bodyLines = (Tcl_Size *)Tcl_Alloc(sizeof(Tcl_Size) * maxLen);
|
||||
bodyLines = (int *)Tcl_Alloc(sizeof(int) * maxLen);
|
||||
bodyContLines = (Tcl_Size **)Tcl_Alloc(sizeof(Tcl_Size*) * maxLen);
|
||||
|
||||
bline = mapPtr->loc[eclIndex].line[valueIndex+1];
|
||||
@@ -2020,7 +2023,7 @@ TclCompileSwitchCmd(
|
||||
*/
|
||||
|
||||
bodyToken = (Tcl_Token **)Tcl_Alloc(sizeof(Tcl_Token *) * numWords);
|
||||
bodyLines = (Tcl_Size *)Tcl_Alloc(sizeof(Tcl_Size) * numWords);
|
||||
bodyLines = (int *)Tcl_Alloc(sizeof(int) * numWords);
|
||||
bodyContLines = (Tcl_Size **)Tcl_Alloc(sizeof(Tcl_Size*) * numWords);
|
||||
bodyTokenArray = NULL;
|
||||
for (i=0 ; i<numWords ; i++) {
|
||||
@@ -2115,7 +2118,7 @@ IssueSwitchChainedTests(
|
||||
* switch can match against and bodies to
|
||||
* execute when the match succeeds. */
|
||||
Tcl_Token **bodyToken, /* Array of pointers to pattern list items. */
|
||||
Tcl_Size *bodyLines, /* Array of line numbers for body list
|
||||
int *bodyLines, /* Array of line numbers for body list
|
||||
* items. */
|
||||
Tcl_Size **bodyContLines) /* Array of continuation line info. */
|
||||
{
|
||||
@@ -2123,7 +2126,7 @@ IssueSwitchChainedTests(
|
||||
int foundDefault; /* Flag to indicate whether a "default" clause
|
||||
* is present. */
|
||||
JumpFixup *fixupArray; /* Array of forward-jump fixup records. */
|
||||
unsigned int *fixupTargetArray; /* Array of places for fixups to point at. */
|
||||
Tcl_Size *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
|
||||
@@ -2132,7 +2135,7 @@ IssueSwitchChainedTests(
|
||||
* the current (or next) real body. */
|
||||
int nextArmFixupIndex;
|
||||
int simple, exact; /* For extracting the type of regexp. */
|
||||
int i;
|
||||
Tcl_Size i;
|
||||
|
||||
/*
|
||||
* Generate a test for each arm.
|
||||
@@ -2141,8 +2144,8 @@ IssueSwitchChainedTests(
|
||||
contFixIndex = -1;
|
||||
contFixCount = 0;
|
||||
fixupArray = (JumpFixup *)TclStackAlloc(interp, sizeof(JumpFixup) * numBodyTokens);
|
||||
fixupTargetArray = (unsigned int *)TclStackAlloc(interp, sizeof(int) * numBodyTokens);
|
||||
memset(fixupTargetArray, 0, numBodyTokens * sizeof(int));
|
||||
fixupTargetArray = (Tcl_Size *)TclStackAlloc(interp, sizeof(Tcl_Size) * numBodyTokens);
|
||||
memset(fixupTargetArray, 0, numBodyTokens * sizeof(Tcl_Size));
|
||||
fixupCount = 0;
|
||||
foundDefault = 0;
|
||||
for (i=0 ; i<numBodyTokens ; i+=2) {
|
||||
@@ -2329,7 +2332,7 @@ IssueSwitchChainedTests(
|
||||
for (i=fixupCount-1 ; i>=0 ; i--) {
|
||||
if (TclFixupForwardJump(envPtr, &fixupArray[i],
|
||||
fixupTargetArray[i] - fixupArray[i].codeOffset, 127)) {
|
||||
int j;
|
||||
Tcl_Size j;
|
||||
|
||||
for (j=i-1 ; j>=0 ; j--) {
|
||||
if (fixupTargetArray[j] > fixupArray[i].codeOffset) {
|
||||
@@ -2359,17 +2362,18 @@ static void
|
||||
IssueSwitchJumpTable(
|
||||
Tcl_Interp *interp, /* Context for compiling script bodies. */
|
||||
CompileEnv *envPtr, /* Holds resulting instructions. */
|
||||
int numBodyTokens, /* Number of tokens describing things the
|
||||
Tcl_Size 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. */
|
||||
Tcl_Size *bodyLines, /* Array of line numbers for body list
|
||||
int *bodyLines, /* Array of line numbers for body list
|
||||
* items. */
|
||||
Tcl_Size **bodyContLines) /* Array of continuation line info. */
|
||||
{
|
||||
JumptableInfo *jtPtr;
|
||||
int infoIndex, isNew, *finalFixups, numRealBodies = 0, jumpLocation;
|
||||
int mustGenerate, foundDefault, jumpToDefault, i;
|
||||
Tcl_Size infoIndex, *finalFixups;
|
||||
int isNew, mustGenerate, foundDefault;
|
||||
Tcl_Size i, numRealBodies = 0, jumpLocation, jumpToDefault;
|
||||
Tcl_DString buffer;
|
||||
Tcl_HashEntry *hPtr;
|
||||
|
||||
@@ -2386,7 +2390,7 @@ IssueSwitchJumpTable(
|
||||
jtPtr = (JumptableInfo *)Tcl_Alloc(sizeof(JumptableInfo));
|
||||
Tcl_InitHashTable(&jtPtr->hashTable, TCL_STRING_KEYS);
|
||||
infoIndex = TclCreateAuxData(jtPtr, &tclJumptableInfoType, envPtr);
|
||||
finalFixups = (int *)TclStackAlloc(interp, sizeof(int) * (numBodyTokens/2));
|
||||
finalFixups = (Tcl_Size *)TclStackAlloc(interp, sizeof(Tcl_Size) * (numBodyTokens/2));
|
||||
foundDefault = 0;
|
||||
mustGenerate = 1;
|
||||
|
||||
@@ -2661,7 +2665,7 @@ TclCompileTailcallCmd(
|
||||
{
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
Tcl_Token *tokenPtr = parsePtr->tokenPtr;
|
||||
int i;
|
||||
Tcl_Size i;
|
||||
|
||||
if (parsePtr->numWords < 2 || parsePtr->numWords >= 256
|
||||
|| envPtr->procPtr == NULL) {
|
||||
@@ -2671,11 +2675,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<(int)parsePtr->numWords ; i++) {
|
||||
for (i=1 ; i<parsePtr->numWords ; i++) {
|
||||
tokenPtr = TokenAfter(tokenPtr);
|
||||
CompileWord(envPtr, tokenPtr, interp, i);
|
||||
}
|
||||
TclEmitInstInt1( INST_TAILCALL, (int)parsePtr->numWords, envPtr);
|
||||
TclEmitInstInt1( INST_TAILCALL, parsePtr->numWords, envPtr);
|
||||
return TCL_OK;
|
||||
}
|
||||
|
||||
@@ -2706,7 +2710,7 @@ TclCompileThrowCmd(
|
||||
CompileEnv *envPtr) /* Holds resulting instructions. */
|
||||
{
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
int numWords = parsePtr->numWords;
|
||||
Tcl_Size numWords = parsePtr->numWords;
|
||||
Tcl_Token *codeToken, *msgToken;
|
||||
Tcl_Obj *objPtr;
|
||||
int codeKnown, codeIsList, codeIsValid;
|
||||
@@ -2808,12 +2812,14 @@ TclCompileTryCmd(
|
||||
TCL_UNUSED(Command *),
|
||||
CompileEnv *envPtr) /* Holds resulting instructions. */
|
||||
{
|
||||
int numWords = parsePtr->numWords, numHandlers, result = TCL_ERROR;
|
||||
Tcl_Size numHandlers, numWords = parsePtr->numWords;
|
||||
int result = TCL_ERROR;
|
||||
Tcl_Token *bodyToken, *finallyToken, *tokenPtr;
|
||||
Tcl_Token **handlerTokens = NULL;
|
||||
Tcl_Obj **matchClauses = NULL;
|
||||
int *matchCodes=NULL, *resultVarIndices=NULL, *optionVarIndices=NULL;
|
||||
int i;
|
||||
int *matchCodes=NULL;
|
||||
Tcl_Size *resultVarIndices=NULL, *optionVarIndices=NULL;
|
||||
Tcl_Size i;
|
||||
|
||||
if (numWords < 2) {
|
||||
return TCL_ERROR;
|
||||
@@ -2845,8 +2851,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 = (int *)TclStackAlloc(interp, sizeof(int) * numHandlers);
|
||||
optionVarIndices = (int *)TclStackAlloc(interp, sizeof(int) * numHandlers);
|
||||
resultVarIndices = (Tcl_Size *)TclStackAlloc(interp, sizeof(Tcl_Size) * numHandlers);
|
||||
optionVarIndices = (Tcl_Size *)TclStackAlloc(interp, sizeof(Tcl_Size) * numHandlers);
|
||||
|
||||
for (i=0 ; i<numHandlers ; i++) {
|
||||
Tcl_Obj *tmpObj, **objv;
|
||||
@@ -3039,19 +3045,19 @@ IssueTryClausesInstructions(
|
||||
Tcl_Interp *interp,
|
||||
CompileEnv *envPtr,
|
||||
Tcl_Token *bodyToken,
|
||||
int numHandlers,
|
||||
Tcl_Size numHandlers,
|
||||
int *matchCodes,
|
||||
Tcl_Obj **matchClauses,
|
||||
int *resultVars,
|
||||
int *optionVars,
|
||||
Tcl_Size *resultVars,
|
||||
Tcl_Size *optionVars,
|
||||
Tcl_Token **handlerTokens)
|
||||
{
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
int range, resultVar, optionsVar;
|
||||
int i, j, forwardsNeedFixing = 0, trapZero = 0, afterBody = 0;
|
||||
Tcl_Size slen, len;
|
||||
int *addrsToFix, *forwardsToFix, notCodeJumpSource, notECJumpSource;
|
||||
int *noError;
|
||||
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;
|
||||
char buf[TCL_INTEGER_SPACE];
|
||||
|
||||
resultVar = AnonymousLocal(envPtr);
|
||||
@@ -3111,9 +3117,9 @@ IssueTryClausesInstructions(
|
||||
* Slight overallocation, but reduces size of this function.
|
||||
*/
|
||||
|
||||
addrsToFix = (int *)TclStackAlloc(interp, sizeof(int)*numHandlers);
|
||||
forwardsToFix = (int *)TclStackAlloc(interp, sizeof(int)*numHandlers);
|
||||
noError = (int *)TclStackAlloc(interp, sizeof(int)*numHandlers);
|
||||
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);
|
||||
|
||||
for (i=0 ; i<numHandlers ; i++) {
|
||||
noError[i] = -1;
|
||||
@@ -3165,7 +3171,7 @@ IssueTryClausesInstructions(
|
||||
JUMP4( JUMP, forwardsToFix[i]);
|
||||
TclAdjustStackDepth(1, envPtr);
|
||||
} else {
|
||||
int dontChangeOptions;
|
||||
Tcl_Size dontChangeOptions;
|
||||
|
||||
forwardsToFix[i] = -1;
|
||||
if (forwardsNeedFixing) {
|
||||
@@ -3250,18 +3256,20 @@ IssueTryClausesFinallyInstructions(
|
||||
Tcl_Interp *interp,
|
||||
CompileEnv *envPtr,
|
||||
Tcl_Token *bodyToken,
|
||||
int numHandlers,
|
||||
Tcl_Size numHandlers,
|
||||
int *matchCodes,
|
||||
Tcl_Obj **matchClauses,
|
||||
int *resultVars,
|
||||
int *optionVars,
|
||||
Tcl_Size *resultVars,
|
||||
Tcl_Size *optionVars,
|
||||
Tcl_Token **handlerTokens,
|
||||
Tcl_Token *finallyToken) /* Not NULL */
|
||||
{
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
int range, resultVar, optionsVar, i, j, forwardsNeedFixing = 0;
|
||||
int trapZero = 0, afterBody = 0, finalOK, finalError, noFinalError;
|
||||
int *addrsToFix, *forwardsToFix, notCodeJumpSource, notECJumpSource;
|
||||
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;
|
||||
char buf[TCL_INTEGER_SPACE];
|
||||
Tcl_Size slen, len;
|
||||
|
||||
@@ -3323,11 +3331,11 @@ IssueTryClausesFinallyInstructions(
|
||||
* Slight overallocation, but reduces size of this function.
|
||||
*/
|
||||
|
||||
addrsToFix = (int *)TclStackAlloc(interp, sizeof(int)*numHandlers);
|
||||
forwardsToFix = (int *)TclStackAlloc(interp, sizeof(int)*numHandlers);
|
||||
addrsToFix = (Tcl_Size *)TclStackAlloc(interp, sizeof(Tcl_Size)*numHandlers);
|
||||
forwardsToFix = (Tcl_Size *)TclStackAlloc(interp, sizeof(Tcl_Size)*numHandlers);
|
||||
|
||||
for (i=0 ; i<numHandlers ; i++) {
|
||||
int noTrapError, trapError;
|
||||
Tcl_Size noTrapError, trapError;
|
||||
const char *p;
|
||||
|
||||
snprintf(buf, sizeof(buf), "%d", matchCodes[i]);
|
||||
@@ -3546,7 +3554,8 @@ IssueTryFinallyInstructions(
|
||||
Tcl_Token *finallyToken)
|
||||
{
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
int range, jumpOK, jumpSplice;
|
||||
Tcl_Size range;
|
||||
Tcl_Size jumpOK, jumpSplice;
|
||||
|
||||
/*
|
||||
* Note that this one is simple enough that we can issue it without
|
||||
@@ -3624,7 +3633,8 @@ TclCompileUnsetCmd(
|
||||
{
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
Tcl_Token *varTokenPtr;
|
||||
int isScalar, localIndex, flags = 1, i, varCount = 0, haveFlags = 0;
|
||||
int isScalar, flags = 1;
|
||||
Tcl_Size i, localIndex, haveFlags = 0, varCount = 0;
|
||||
|
||||
/* TODO: Consider support for compiling expanded args. */
|
||||
|
||||
@@ -3634,7 +3644,7 @@ TclCompileUnsetCmd(
|
||||
* push/rotate. [Bug 3970f54c4e]
|
||||
*/
|
||||
|
||||
for (i=1,varTokenPtr=parsePtr->tokenPtr ; i<(int)parsePtr->numWords ; i++) {
|
||||
for (i=1,varTokenPtr=parsePtr->tokenPtr ; i<parsePtr->numWords ; i++) {
|
||||
Tcl_Obj *leadingWord;
|
||||
|
||||
TclNewObj(leadingWord);
|
||||
@@ -3698,7 +3708,7 @@ TclCompileUnsetCmd(
|
||||
for (i=0; i<haveFlags;i++) {
|
||||
varTokenPtr = TokenAfter(varTokenPtr);
|
||||
}
|
||||
for (i=1+haveFlags ; i<(int)parsePtr->numWords ; i++) {
|
||||
for (i=1+haveFlags ; i<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
|
||||
@@ -3763,7 +3773,8 @@ TclCompileWhileCmd(
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
Tcl_Token *testTokenPtr, *bodyTokenPtr;
|
||||
JumpFixup jumpEvalCondFixup;
|
||||
int testCodeOffset, bodyCodeOffset, jumpDist, range, code, boolVal;
|
||||
int code, boolVal;
|
||||
Tcl_Size bodyCodeOffset, testCodeOffset, range, jumpDist;
|
||||
int loopMayEnd = 1; /* This is set to 0 if it is recognized as an
|
||||
* infinite loop. */
|
||||
Tcl_Obj *boolObj;
|
||||
@@ -3981,14 +3992,14 @@ TclCompileYieldToCmd(
|
||||
{
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
Tcl_Token *tokenPtr = TokenAfter(parsePtr->tokenPtr);
|
||||
int i;
|
||||
Tcl_Size i;
|
||||
|
||||
if ((int)parsePtr->numWords < 2) {
|
||||
return TCL_ERROR;
|
||||
}
|
||||
|
||||
OP( NS_CURRENT);
|
||||
for (i = 1 ; i < (int)parsePtr->numWords ; i++) {
|
||||
for (i = 1 ; i < parsePtr->numWords ; i++) {
|
||||
CompileWord(envPtr, tokenPtr, interp, i);
|
||||
tokenPtr = TokenAfter(tokenPtr);
|
||||
}
|
||||
@@ -4153,7 +4164,7 @@ CompileComparisonOpCmd(
|
||||
Tcl_Token *tokenPtr;
|
||||
|
||||
/* TODO: Consider support for compiling expanded args. */
|
||||
if ((int)parsePtr->numWords < 3) {
|
||||
if (parsePtr->numWords < 3) {
|
||||
PUSH("1");
|
||||
} else if (parsePtr->numWords == 3) {
|
||||
tokenPtr = TokenAfter(parsePtr->tokenPtr);
|
||||
@@ -4168,7 +4179,7 @@ CompileComparisonOpCmd(
|
||||
|
||||
return TCL_ERROR;
|
||||
} else {
|
||||
int tmpIndex = AnonymousLocal(envPtr);
|
||||
Tcl_Size tmpIndex = AnonymousLocal(envPtr);
|
||||
Tcl_Size words;
|
||||
|
||||
tokenPtr = TokenAfter(parsePtr->tokenPtr);
|
||||
|
||||
@@ -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
|
||||
*/
|
||||
|
||||
int scanned2 = scanned;
|
||||
Tcl_Size scanned2 = scanned;
|
||||
do {
|
||||
scanned2 += TclParseAllWhiteSpace(
|
||||
start + scanned2, numBytes - scanned2);
|
||||
@@ -842,7 +842,7 @@ ParseExpr(
|
||||
|
||||
Tcl_Token *tokenPtr;
|
||||
const char *end = start;
|
||||
int wordIndex;
|
||||
Tcl_Size wordIndex;
|
||||
int code = TCL_OK;
|
||||
|
||||
/*
|
||||
@@ -1504,13 +1504,13 @@ ConvertTreeToTokens(
|
||||
Tcl_Token *tokenPtr,
|
||||
Tcl_Parse *parsePtr)
|
||||
{
|
||||
int subExprTokenIdx = 0;
|
||||
Tcl_Size subExprTokenIdx = 0;
|
||||
OpNode *nodePtr = nodes;
|
||||
int next = nodePtr->right;
|
||||
|
||||
while (1) {
|
||||
Tcl_Token *subExprTokenPtr;
|
||||
int scanned, parentIdx;
|
||||
Tcl_Size scanned, parentIdx;
|
||||
unsigned char lexeme;
|
||||
|
||||
/*
|
||||
@@ -1577,7 +1577,7 @@ ConvertTreeToTokens(
|
||||
* do better.
|
||||
*/
|
||||
|
||||
int toCopy = tokenPtr->numComponents + 1;
|
||||
Tcl_Size toCopy = tokenPtr->numComponents + 1;
|
||||
|
||||
if (tokenPtr->numComponents == tokenPtr[1].numComponents + 1) {
|
||||
/*
|
||||
@@ -2386,7 +2386,7 @@ CompileExprTree(
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
int pc1, pc2, target;
|
||||
Tcl_Size pc1, pc2, target;
|
||||
|
||||
switch (nodePtr->lexeme) {
|
||||
case START:
|
||||
|
||||
+73
-71
@@ -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, Tcl_Size line,
|
||||
Tcl_Size *clNext, Tcl_Size **lines,
|
||||
Tcl_Size numWords, int line,
|
||||
Tcl_Size *clNext, int **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 */
|
||||
int word) /* Index of the word in that context getting
|
||||
Tcl_Size 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. */
|
||||
{
|
||||
int numComponents = tokenPtr->numComponents;
|
||||
Tcl_Size 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,
|
||||
size_t numWords)
|
||||
Tcl_Size numWords)
|
||||
{
|
||||
/* Determine whether any words of the command require expansion */
|
||||
while (numWords--) {
|
||||
@@ -1840,7 +1840,7 @@ TclCompileInvocation(
|
||||
{
|
||||
DefineLineInformation;
|
||||
size_t wordIdx = 0;
|
||||
int depth = TclGetStackDepth(envPtr);
|
||||
Tcl_Size depth = TclGetStackDepth(envPtr);
|
||||
|
||||
if (cmdObj) {
|
||||
CompileCmdLiteral(interp, cmdObj, envPtr);
|
||||
@@ -1880,12 +1880,12 @@ CompileExpanded(
|
||||
Tcl_Interp *interp,
|
||||
Tcl_Token *tokenPtr,
|
||||
Tcl_Obj *cmdObj,
|
||||
int numWords,
|
||||
Tcl_Size numWords,
|
||||
CompileEnv *envPtr)
|
||||
{
|
||||
DefineLineInformation;
|
||||
int wordIdx = 0;
|
||||
int depth = TclGetStackDepth(envPtr);
|
||||
Tcl_Size wordIdx = 0;
|
||||
Tcl_Size depth = TclGetStackDepth(envPtr);
|
||||
|
||||
StartExpanding(envPtr);
|
||||
if (cmdObj) {
|
||||
@@ -1945,7 +1945,7 @@ CompileCmdCompileProc(
|
||||
DefineLineInformation;
|
||||
int unwind = 0;
|
||||
Tcl_Size incrOffset = -1;
|
||||
int depth = TclGetStackDepth(envPtr);
|
||||
Tcl_Size 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 int
|
||||
static Tcl_Size
|
||||
CompileCommandTokens(
|
||||
Tcl_Interp *interp,
|
||||
Tcl_Parse *parsePtr,
|
||||
@@ -2031,14 +2031,15 @@ CompileCommandTokens(
|
||||
Command *cmdPtr = NULL;
|
||||
int code = TCL_ERROR;
|
||||
int cmdKnown, expand = -1;
|
||||
Tcl_Size *wlines, wlineat;
|
||||
int *wlines;
|
||||
Tcl_Size wlineat;
|
||||
Tcl_Size cmdLine = envPtr->line;
|
||||
Tcl_Size *clNext = envPtr->clNext;
|
||||
Tcl_Size cmdIdx = envPtr->numCommands;
|
||||
Tcl_Size startCodeOffset = envPtr->codeNext - envPtr->codeStart;
|
||||
int depth = TclGetStackDepth(envPtr);
|
||||
Tcl_Size depth = TclGetStackDepth(envPtr);
|
||||
|
||||
assert ((int)parsePtr->numWords > 0);
|
||||
assert (parsePtr->numWords > 0);
|
||||
|
||||
/* Precompile */
|
||||
|
||||
@@ -2083,7 +2084,7 @@ CompileCommandTokens(
|
||||
}
|
||||
}
|
||||
if (cmdPtr && !(cmdPtr->flags & CMD_COMPILES_EXPANDED)) {
|
||||
expand = ExpandRequested(parsePtr->tokenPtr, (int)parsePtr->numWords);
|
||||
expand = ExpandRequested(parsePtr->tokenPtr, parsePtr->numWords);
|
||||
if (expand) {
|
||||
/* We need to expand, but compileProc cannot. */
|
||||
cmdPtr = NULL;
|
||||
@@ -2098,15 +2099,15 @@ CompileCommandTokens(
|
||||
|
||||
if (code == TCL_ERROR) {
|
||||
if (expand < 0) {
|
||||
expand = ExpandRequested(parsePtr->tokenPtr, (int)parsePtr->numWords);
|
||||
expand = ExpandRequested(parsePtr->tokenPtr, parsePtr->numWords);
|
||||
}
|
||||
|
||||
if (expand) {
|
||||
CompileExpanded(interp, parsePtr->tokenPtr,
|
||||
cmdKnown ? cmdObj : NULL, (int)parsePtr->numWords, envPtr);
|
||||
cmdKnown ? cmdObj : NULL, parsePtr->numWords, envPtr);
|
||||
} else {
|
||||
TclCompileInvocation(interp, parsePtr->tokenPtr,
|
||||
cmdKnown ? cmdObj : NULL, (int)parsePtr->numWords, envPtr);
|
||||
cmdKnown ? cmdObj : NULL, parsePtr->numWords, envPtr);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2144,12 +2145,12 @@ TclCompileScript(
|
||||
* first null character. */
|
||||
CompileEnv *envPtr) /* Holds resulting instructions. */
|
||||
{
|
||||
int lastCmdIdx = -1; /* Index into envPtr->cmdMapPtr of the last
|
||||
Tcl_Size 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. */
|
||||
int depth = TclGetStackDepth(envPtr);
|
||||
Tcl_Size depth = TclGetStackDepth(envPtr);
|
||||
Interp *iPtr = (Interp *) interp;
|
||||
|
||||
if (envPtr->iPtr == NULL) {
|
||||
@@ -2258,7 +2259,7 @@ TclCompileScript(
|
||||
* Tcl_FreeParse() to do.
|
||||
*
|
||||
* The advantage of this shortcut is that CompileCommandTokens()
|
||||
* can be written with an assumption that (int)parsePtr->numWords > 0, with
|
||||
* can be written with an assumption that parsePtr->numWords > 0, with
|
||||
* the implication the CCT() always generates bytecode.
|
||||
*/
|
||||
continue;
|
||||
@@ -2420,13 +2421,13 @@ TclCompileTokens(
|
||||
* TCL_TOKEN_TEXT, TCL_TOKEN_BS tokens. */
|
||||
char buffer[4] = "";
|
||||
Tcl_Size i, numObjsToConcat, adjust;
|
||||
int length;
|
||||
Tcl_Size length;
|
||||
unsigned char *entryCodeNext = envPtr->codeNext;
|
||||
#define NUM_STATIC_POS 20
|
||||
int isLiteral;
|
||||
Tcl_Size maxNumCL, numCL;
|
||||
Tcl_Size *clPosition = NULL;
|
||||
int depth = TclGetStackDepth(envPtr);
|
||||
Tcl_Size depth = TclGetStackDepth(envPtr);
|
||||
|
||||
/*
|
||||
* If this is actually a literal, handle continuation lines by
|
||||
@@ -2490,7 +2491,7 @@ TclCompileTokens(
|
||||
if ((length == 1) && (buffer[0] == ' ') &&
|
||||
(tokenPtr->start[1] == '\n')) {
|
||||
if (isLiteral) {
|
||||
int clPos = Tcl_DStringLength(&textBuffer);
|
||||
Tcl_Size clPos = Tcl_DStringLength(&textBuffer);
|
||||
|
||||
if (numCL >= maxNumCL) {
|
||||
maxNumCL *= 2;
|
||||
@@ -2679,14 +2680,13 @@ 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 numWords1, /* Number of word tokens starting at tokenPtr.
|
||||
size_t numWords, /* 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;
|
||||
int i, concatItems;
|
||||
int numWords = numWords1;
|
||||
size_t i, concatItems;
|
||||
|
||||
/*
|
||||
* 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 < (numWords - 1)) {
|
||||
if (i + 1 < numWords) {
|
||||
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,15 +3318,17 @@ EnterCmdWordData(
|
||||
Tcl_Token *tokenPtr,
|
||||
const char *cmd,
|
||||
Tcl_Size numWords,
|
||||
Tcl_Size line,
|
||||
int line,
|
||||
Tcl_Size *clNext,
|
||||
Tcl_Size **wlines,
|
||||
int **wlines,
|
||||
CompileEnv *envPtr)
|
||||
{
|
||||
ECL *ePtr;
|
||||
const char *last;
|
||||
Tcl_Size wordIdx, wordLine;
|
||||
Tcl_Size *wwlines, *wordNext;
|
||||
Tcl_Size wordIdx;
|
||||
int wordLine;
|
||||
int *wwlines;
|
||||
Tcl_Size *wordNext;
|
||||
|
||||
if (eclPtr->nuloc >= eclPtr->nloc) {
|
||||
/*
|
||||
@@ -3345,10 +3347,10 @@ EnterCmdWordData(
|
||||
|
||||
ePtr = &eclPtr->loc[eclPtr->nuloc];
|
||||
ePtr->srcOffset = srcOffset;
|
||||
ePtr->line = (Tcl_Size *)Tcl_Alloc(numWords * sizeof(Tcl_Size));
|
||||
ePtr->line = (int *)Tcl_Alloc(numWords * sizeof(int));
|
||||
ePtr->next = (Tcl_Size **)Tcl_Alloc(numWords * sizeof(Tcl_Size *));
|
||||
ePtr->nline = numWords;
|
||||
wwlines = (Tcl_Size *)Tcl_Alloc(numWords * sizeof(Tcl_Size));
|
||||
wwlines = (int *)Tcl_Alloc(numWords * sizeof(int));
|
||||
|
||||
last = cmd;
|
||||
wordLine = line;
|
||||
@@ -3487,9 +3489,9 @@ TclGetInnermostExceptionRange(
|
||||
while (i > 0) {
|
||||
rangePtr--; i--;
|
||||
|
||||
if (CurrentOffset(envPtr) >= (int)rangePtr->codeOffset &&
|
||||
if (CurrentOffset(envPtr) >= rangePtr->codeOffset &&
|
||||
(rangePtr->numCodeBytes == TCL_INDEX_NONE || CurrentOffset(envPtr) <
|
||||
(int)rangePtr->codeOffset+(int)rangePtr->numCodeBytes) &&
|
||||
rangePtr->codeOffset+rangePtr->numCodeBytes) &&
|
||||
(returnCode != TCL_CONTINUE ||
|
||||
envPtr->exceptAuxArrayPtr[i].supportsContinue)) {
|
||||
|
||||
@@ -3520,7 +3522,7 @@ TclAddLoopBreakFixup(
|
||||
CompileEnv *envPtr,
|
||||
ExceptionAux *auxPtr)
|
||||
{
|
||||
int range = auxPtr - envPtr->exceptAuxArrayPtr;
|
||||
Tcl_Size range = auxPtr - envPtr->exceptAuxArrayPtr;
|
||||
|
||||
if (envPtr->exceptArrayPtr[range].type != LOOP_EXCEPTION_RANGE) {
|
||||
Tcl_Panic("trying to add 'break' fixup to full exception range");
|
||||
@@ -3546,7 +3548,7 @@ TclAddLoopContinueFixup(
|
||||
CompileEnv *envPtr,
|
||||
ExceptionAux *auxPtr)
|
||||
{
|
||||
int range = auxPtr - envPtr->exceptAuxArrayPtr;
|
||||
Tcl_Size range = auxPtr - envPtr->exceptAuxArrayPtr;
|
||||
|
||||
if (envPtr->exceptArrayPtr[range].type != LOOP_EXCEPTION_RANGE) {
|
||||
Tcl_Panic("trying to add 'continue' fixup to full exception range");
|
||||
@@ -3586,13 +3588,13 @@ TclCleanupStackForBreakContinue(
|
||||
ExceptionAux *auxPtr)
|
||||
{
|
||||
size_t savedStackDepth = envPtr->currStackDepth;
|
||||
int toPop = envPtr->expandCount - auxPtr->expandTarget;
|
||||
Tcl_Size toPop = envPtr->expandCount - auxPtr->expandTarget;
|
||||
|
||||
if (toPop > 0) {
|
||||
while (toPop --> 0) {
|
||||
TclEmitOpcode(INST_EXPAND_DROP, envPtr);
|
||||
}
|
||||
TclAdjustStackDepth((int)(auxPtr->expandTargetDepth - envPtr->currStackDepth),
|
||||
TclAdjustStackDepth((auxPtr->expandTargetDepth - envPtr->currStackDepth),
|
||||
envPtr);
|
||||
envPtr->currStackDepth = auxPtr->expandTargetDepth;
|
||||
}
|
||||
@@ -3619,7 +3621,7 @@ static void
|
||||
StartExpanding(
|
||||
CompileEnv *envPtr)
|
||||
{
|
||||
int i;
|
||||
Tcl_Size i;
|
||||
|
||||
TclEmitOpcode(INST_EXPAND_START, envPtr);
|
||||
|
||||
@@ -3628,7 +3630,7 @@ StartExpanding(
|
||||
* where this expansion started.
|
||||
*/
|
||||
|
||||
for (i=0 ; i<(int)envPtr->exceptArrayNext ; i++) {
|
||||
for (i=0 ; i<envPtr->exceptArrayNext ; i++) {
|
||||
ExceptionRange *rangePtr = &envPtr->exceptArrayPtr[i];
|
||||
ExceptionAux *auxPtr = &envPtr->exceptAuxArrayPtr[i];
|
||||
|
||||
@@ -3636,7 +3638,7 @@ StartExpanding(
|
||||
* Ignore loops unless they're still being built.
|
||||
*/
|
||||
|
||||
if ((int)rangePtr->codeOffset > CurrentOffset(envPtr)) {
|
||||
if (rangePtr->codeOffset > CurrentOffset(envPtr)) {
|
||||
continue;
|
||||
}
|
||||
if (rangePtr->numCodeBytes != TCL_INDEX_NONE) {
|
||||
@@ -3676,11 +3678,11 @@ StartExpanding(
|
||||
void
|
||||
TclFinalizeLoopExceptionRange(
|
||||
CompileEnv *envPtr,
|
||||
int range)
|
||||
Tcl_Size range)
|
||||
{
|
||||
ExceptionRange *rangePtr = &envPtr->exceptArrayPtr[range];
|
||||
ExceptionAux *auxPtr = &envPtr->exceptAuxArrayPtr[range];
|
||||
int i, offset;
|
||||
Tcl_Size i, offset;
|
||||
unsigned char *site;
|
||||
|
||||
if (rangePtr->type != LOOP_EXCEPTION_RANGE) {
|
||||
@@ -3692,7 +3694,7 @@ TclFinalizeLoopExceptionRange(
|
||||
* there is no need to fuss around with updating code offsets.
|
||||
*/
|
||||
|
||||
for (i=0 ; i<(int)auxPtr->numBreakTargets ; i++) {
|
||||
for (i=0 ; i<auxPtr->numBreakTargets ; i++) {
|
||||
site = envPtr->codeStart + auxPtr->breakTargets[i];
|
||||
offset = rangePtr->breakOffset - auxPtr->breakTargets[i];
|
||||
TclUpdateInstInt4AtPc(INST_JUMP4, offset, site);
|
||||
@@ -3754,11 +3756,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. */
|
||||
@@ -3952,9 +3954,9 @@ TclEmitForwardJump(
|
||||
*/
|
||||
|
||||
jumpFixupPtr->jumpType = jumpType;
|
||||
jumpFixupPtr->codeOffset = envPtr->codeNext - envPtr->codeStart;
|
||||
jumpFixupPtr->cmdIndex = envPtr->numCommands;
|
||||
jumpFixupPtr->exceptIndex = envPtr->exceptArrayNext;
|
||||
jumpFixupPtr->codeOffset = (unsigned int)(envPtr->codeNext - envPtr->codeStart);
|
||||
jumpFixupPtr->cmdIndex = (int)envPtr->numCommands;
|
||||
jumpFixupPtr->exceptIndex = (int)envPtr->exceptArrayNext;
|
||||
|
||||
switch (jumpType) {
|
||||
case TCL_UNCONDITIONAL_JUMP:
|
||||
@@ -4002,12 +4004,12 @@ TclFixupForwardJump(
|
||||
* holds the resulting instruction. */
|
||||
JumpFixup *jumpFixupPtr, /* Points to the JumpFixup structure that
|
||||
* describes the forward jump. */
|
||||
int jumpDist, /* Jump distance to set in jump instr. */
|
||||
int distThreshold) /* Maximum distance before the two byte jump
|
||||
Tcl_Size jumpDist, /* Jump distance to set in jump instr. */
|
||||
Tcl_Size distThreshold) /* Maximum distance before the two byte jump
|
||||
* is grown to five bytes. */
|
||||
{
|
||||
unsigned char *jumpPc, *p;
|
||||
int firstCmd, lastCmd, firstRange, lastRange, k;
|
||||
Tcl_Size firstCmd, lastCmd, firstRange, lastRange, k;
|
||||
size_t numBytes;
|
||||
|
||||
if (jumpDist <= distThreshold) {
|
||||
@@ -4092,14 +4094,14 @@ TclFixupForwardJump(
|
||||
|
||||
for (k = 0 ; k < (int)envPtr->exceptArrayNext ; k++) {
|
||||
ExceptionAux *auxPtr = &envPtr->exceptAuxArrayPtr[k];
|
||||
int i;
|
||||
Tcl_Size i;
|
||||
|
||||
for (i=0 ; i<(int)auxPtr->numBreakTargets ; i++) {
|
||||
for (i=0 ; i<auxPtr->numBreakTargets ; i++) {
|
||||
if (jumpFixupPtr->codeOffset < auxPtr->breakTargets[i]) {
|
||||
auxPtr->breakTargets[i] += 3;
|
||||
}
|
||||
}
|
||||
for (i=0 ; i<(int)auxPtr->numContinueTargets ; i++) {
|
||||
for (i=0 ; i<auxPtr->numContinueTargets ; i++) {
|
||||
if (jumpFixupPtr->codeOffset < auxPtr->continueTargets[i]) {
|
||||
auxPtr->continueTargets[i] += 3;
|
||||
}
|
||||
@@ -4139,9 +4141,9 @@ TclEmitInvoke(
|
||||
va_list argList;
|
||||
ExceptionRange *rangePtr;
|
||||
ExceptionAux *auxBreakPtr, *auxContinuePtr;
|
||||
int arg1, arg2, wordCount = 0, expandCount = 0;
|
||||
int loopRange = 0, breakRange = 0, continueRange = 0;
|
||||
int cleanup, depth = TclGetStackDepth(envPtr);
|
||||
Tcl_Size arg1, arg2, wordCount = 0, expandCount = 0;
|
||||
Tcl_Size loopRange = 0, breakRange = 0, continueRange = 0;
|
||||
Tcl_Size cleanup, depth = TclGetStackDepth(envPtr);
|
||||
|
||||
/*
|
||||
* Parse the arguments.
|
||||
@@ -4350,13 +4352,13 @@ GetCmdLocEncodingSize(
|
||||
* encode. */
|
||||
{
|
||||
CmdLocation *mapPtr = envPtr->cmdMapPtr;
|
||||
int numCmds = envPtr->numCommands;
|
||||
int codeDelta, codeLen, srcDelta, srcLen;
|
||||
Tcl_Size numCmds = envPtr->numCommands;
|
||||
Tcl_Size 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. */
|
||||
int prevCodeOffset, prevSrcOffset, i;
|
||||
Tcl_Size prevCodeOffset, prevSrcOffset, i;
|
||||
|
||||
codeDeltaNext = codeLengthNext = srcDeltaNext = srcLengthNext = 0;
|
||||
prevCodeOffset = prevSrcOffset = 0;
|
||||
@@ -4437,7 +4439,7 @@ EncodeCmdLocMap(
|
||||
Tcl_Size i, codeDelta, codeLen, srcLen, prevOffset;
|
||||
Tcl_Size numCmds = envPtr->numCommands;
|
||||
unsigned char *p = startPtr;
|
||||
int srcDelta;
|
||||
Tcl_Size srcDelta;
|
||||
|
||||
/*
|
||||
* Encode the code offset for each command as a sequence of deltas.
|
||||
|
||||
+27
-36
@@ -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. */
|
||||
TCL_HASH_TYPE *breakTargets;/* The offsets of the INST_JUMP4 instructions
|
||||
size_t *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. */
|
||||
TCL_HASH_TYPE *continueTargets;
|
||||
size_t *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 */
|
||||
Tcl_Size *line; /* Line information for all words in the
|
||||
int *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,
|
||||
TCL_HASH_TYPE pcOffset);
|
||||
size_t pcOffset);
|
||||
|
||||
/*
|
||||
* We define a separate AuxDataType struct to hold type-related information
|
||||
@@ -320,10 +320,8 @@ 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. */
|
||||
@@ -339,9 +337,6 @@ 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
|
||||
@@ -354,19 +349,14 @@ 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];
|
||||
@@ -383,7 +373,7 @@ typedef struct CompileEnv {
|
||||
/* TIP #280 */
|
||||
ExtCmdLoc *extCmdMapPtr; /* Extended command location information for
|
||||
* 'info frame'. */
|
||||
Tcl_Size line; /* First line of the script, based on the
|
||||
int 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
|
||||
@@ -1072,7 +1062,6 @@ typedef struct {
|
||||
*----------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#if TCL_MAJOR_VERSION > 8
|
||||
MODULE_SCOPE Tcl_ObjCmdProc TclNRInterpCoroutine;
|
||||
|
||||
/*
|
||||
@@ -1082,7 +1071,7 @@ MODULE_SCOPE Tcl_ObjCmdProc TclNRInterpCoroutine;
|
||||
*/
|
||||
|
||||
MODULE_SCOPE ByteCode * TclCompileObj(Tcl_Interp *interp, Tcl_Obj *objPtr,
|
||||
const CmdFrame *invoker, int word);
|
||||
const CmdFrame *invoker, Tcl_Size word);
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------
|
||||
@@ -1141,8 +1130,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, int jumpDist,
|
||||
int distThreshold);
|
||||
JumpFixup *jumpFixupPtr, Tcl_Size jumpDist,
|
||||
Tcl_Size distThreshold);
|
||||
MODULE_SCOPE void TclFreeCompileEnv(CompileEnv *envPtr);
|
||||
MODULE_SCOPE void TclFreeJumpFixupArray(JumpFixupArray *fixupArrayPtr);
|
||||
MODULE_SCOPE int TclGetIndexFromToken(Tcl_Token *tokenPtr,
|
||||
@@ -1152,7 +1141,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, int word);
|
||||
size_t numBytes, const CmdFrame *invoker, Tcl_Size word);
|
||||
MODULE_SCOPE void TclInitJumpFixupArray(JumpFixupArray *fixupArrayPtr);
|
||||
MODULE_SCOPE void TclInitLiteralTable(LiteralTable *tablePtr);
|
||||
MODULE_SCOPE ExceptionRange *TclGetInnermostExceptionRange(CompileEnv *envPtr,
|
||||
@@ -1162,14 +1151,14 @@ MODULE_SCOPE void TclAddLoopBreakFixup(CompileEnv *envPtr,
|
||||
MODULE_SCOPE void TclAddLoopContinueFixup(CompileEnv *envPtr,
|
||||
ExceptionAux *auxPtr);
|
||||
MODULE_SCOPE void TclFinalizeLoopExceptionRange(CompileEnv *envPtr,
|
||||
int range);
|
||||
Tcl_Size range);
|
||||
#ifdef TCL_COMPILE_STATS
|
||||
MODULE_SCOPE char * TclLiteralStats(LiteralTable *tablePtr);
|
||||
MODULE_SCOPE int TclLog2(long long value);
|
||||
#endif
|
||||
MODULE_SCOPE size_t TclLocalScalar(const char *bytes, size_t numBytes,
|
||||
MODULE_SCOPE Tcl_Size TclLocalScalar(const char *bytes, size_t numBytes,
|
||||
CompileEnv *envPtr);
|
||||
MODULE_SCOPE size_t TclLocalScalarFromToken(Tcl_Token *tokenPtr,
|
||||
MODULE_SCOPE Tcl_Size TclLocalScalarFromToken(Tcl_Token *tokenPtr,
|
||||
CompileEnv *envPtr);
|
||||
MODULE_SCOPE void TclOptimizeBytecode(void *envPtr);
|
||||
#ifdef TCL_COMPILE_DEBUG
|
||||
@@ -1185,7 +1174,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, int *localIndexPtr,
|
||||
int flags, Tcl_Size *localIndexPtr,
|
||||
int *isScalarPtr);
|
||||
MODULE_SCOPE void TclPreserveByteCode(ByteCode *codePtr);
|
||||
MODULE_SCOPE void TclReleaseByteCode(ByteCode *codePtr);
|
||||
@@ -1212,7 +1201,6 @@ 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 */
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------
|
||||
@@ -1224,7 +1212,7 @@ MODULE_SCOPE int TclPushProcCallFrame(void *clientData,
|
||||
/*
|
||||
* Simplified form to access AuxData.
|
||||
*
|
||||
* void *TclFetchAuxData(CompileEng *envPtr, int index);
|
||||
* void *TclFetchAuxData(CompileEng *envPtr, Tcl_Size index);
|
||||
*/
|
||||
|
||||
#define TclFetchAuxData(envPtr, index) \
|
||||
@@ -1241,11 +1229,11 @@ MODULE_SCOPE int TclPushProcCallFrame(void *clientData,
|
||||
*/
|
||||
static inline void
|
||||
TclAdjustStackDepth(
|
||||
int delta,
|
||||
Tcl_Size delta,
|
||||
CompileEnv *envPtr)
|
||||
{
|
||||
if (delta < 0) {
|
||||
if ((int) envPtr->maxStackDepth < (int) envPtr->currStackDepth) {
|
||||
if (envPtr->maxStackDepth < envPtr->currStackDepth) {
|
||||
envPtr->maxStackDepth = envPtr->currStackDepth;
|
||||
}
|
||||
}
|
||||
@@ -1284,13 +1272,16 @@ TclCheckStackDepth(
|
||||
static inline void
|
||||
TclUpdateStackReqs(
|
||||
unsigned char op,
|
||||
int i,
|
||||
Tcl_Size i,
|
||||
CompileEnv *envPtr)
|
||||
{
|
||||
int delta = tclInstructionTable[op].stackEffect;
|
||||
if (delta) {
|
||||
if (delta == INT_MIN) {
|
||||
delta = 1 - i;
|
||||
if (i > INT_MAX || i < INT_MIN+2) {
|
||||
Tcl_Panic("%s: stack effect too big", "TclUpdateStackReqs");
|
||||
}
|
||||
delta = 1 - (int)i;
|
||||
}
|
||||
TclAdjustStackDepth(delta, envPtr);
|
||||
}
|
||||
@@ -1321,8 +1312,8 @@ TclUpdateStackReqs(
|
||||
TclExpandCodeArray(envPtr); \
|
||||
} \
|
||||
*(envPtr)->codeNext++ = (unsigned char) (op); \
|
||||
TclUpdateAtCmdStart(op, envPtr); \
|
||||
TclUpdateStackReqs(op, 0, envPtr); \
|
||||
TclUpdateAtCmdStart((unsigned char)op, envPtr); \
|
||||
TclUpdateStackReqs((unsigned char)op, 0, envPtr); \
|
||||
} while (0)
|
||||
|
||||
/*
|
||||
@@ -1461,12 +1452,12 @@ TclUpdateStackReqs(
|
||||
* "prototypes" for this macro is:
|
||||
*
|
||||
* int TclFixupForwardJumpToHere(CompileEnv *envPtr, JumpFixup *fixupPtr,
|
||||
* int threshold);
|
||||
* Tcl_Size threshold);
|
||||
*/
|
||||
|
||||
#define TclFixupForwardJumpToHere(envPtr, fixupPtr, threshold) \
|
||||
TclFixupForwardJump((envPtr), (fixupPtr), \
|
||||
(envPtr)->codeNext-(envPtr)->codeStart-(int)(fixupPtr)->codeOffset, \
|
||||
(envPtr)->codeNext-(envPtr)->codeStart-(fixupPtr)->codeOffset, \
|
||||
(threshold))
|
||||
|
||||
/*
|
||||
@@ -1527,7 +1518,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, int word);
|
||||
* static void BODY(Tcl_Token *tokenPtr, Tcl_Size word);
|
||||
*/
|
||||
|
||||
#define BODY(tokenPtr, word) \
|
||||
@@ -1627,7 +1618,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, int word);
|
||||
* Tcl_Interp *interp, Tcl_Size word);
|
||||
*/
|
||||
|
||||
#define CompileWord(envPtr, tokenPtr, interp, word) \
|
||||
|
||||
+1
-1
@@ -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);
|
||||
|
||||
+62
-145
@@ -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(TCL_HASH_TYPE size);
|
||||
EXTERN void * Tcl_Alloc(size_t size);
|
||||
/* 4 */
|
||||
EXTERN void Tcl_Free(void *ptr);
|
||||
/* 5 */
|
||||
EXTERN void * Tcl_Realloc(void *ptr, TCL_HASH_TYPE size);
|
||||
EXTERN void * Tcl_Realloc(void *ptr, size_t size);
|
||||
/* 6 */
|
||||
EXTERN void * Tcl_DbCkalloc(TCL_HASH_TYPE size, const char *file,
|
||||
EXTERN void * Tcl_DbCkalloc(size_t 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, TCL_HASH_TYPE size,
|
||||
EXTERN void * Tcl_DbCkrealloc(void *ptr, size_t size,
|
||||
const char *file, int line);
|
||||
/* 9 */
|
||||
EXTERN void Tcl_CreateFileHandler(int fd, int mask,
|
||||
@@ -128,15 +128,9 @@ EXTERN Tcl_Obj * Tcl_DbNewStringObj(const char *bytes,
|
||||
EXTERN Tcl_Obj * Tcl_DuplicateObj(Tcl_Obj *objPtr);
|
||||
/* 30 */
|
||||
EXTERN void TclFreeObj(Tcl_Obj *objPtr);
|
||||
/* 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);
|
||||
/* Slot 31 is reserved */
|
||||
/* Slot 32 is reserved */
|
||||
/* Slot 33 is reserved */
|
||||
/* 34 */
|
||||
EXTERN int Tcl_GetDouble(Tcl_Interp *interp, const char *src,
|
||||
double *doublePtr);
|
||||
@@ -247,8 +241,7 @@ EXTERN void Tcl_CallWhenDeleted(Tcl_Interp *interp,
|
||||
/* 80 */
|
||||
EXTERN void Tcl_CancelIdleCall(Tcl_IdleProc *idleProc,
|
||||
void *clientData);
|
||||
/* 81 */
|
||||
EXTERN int Tcl_Close(Tcl_Interp *interp, Tcl_Channel chan);
|
||||
/* Slot 81 is reserved */
|
||||
/* 82 */
|
||||
EXTERN int Tcl_CommandComplete(const char *cmd);
|
||||
/* 83 */
|
||||
@@ -1036,7 +1029,7 @@ EXTERN void Tcl_MutexFinalize(Tcl_Mutex *mutex);
|
||||
/* 393 */
|
||||
EXTERN int Tcl_CreateThread(Tcl_ThreadId *idPtr,
|
||||
Tcl_ThreadCreateProc *proc, void *clientData,
|
||||
TCL_HASH_TYPE stackSize, int flags);
|
||||
size_t stackSize, int flags);
|
||||
/* 394 */
|
||||
EXTERN Tcl_Size Tcl_ReadRaw(Tcl_Channel chan, char *dst,
|
||||
Tcl_Size bytesToRead);
|
||||
@@ -1122,14 +1115,14 @@ EXTERN void Tcl_UntraceCommand(Tcl_Interp *interp,
|
||||
const char *varName, int flags,
|
||||
Tcl_CommandTraceProc *proc, void *clientData);
|
||||
/* 428 */
|
||||
EXTERN void * Tcl_AttemptAlloc(TCL_HASH_TYPE size);
|
||||
EXTERN void * Tcl_AttemptAlloc(size_t size);
|
||||
/* 429 */
|
||||
EXTERN void * Tcl_AttemptDbCkalloc(TCL_HASH_TYPE size,
|
||||
const char *file, int line);
|
||||
EXTERN void * Tcl_AttemptDbCkalloc(size_t size, const char *file,
|
||||
int line);
|
||||
/* 430 */
|
||||
EXTERN void * Tcl_AttemptRealloc(void *ptr, TCL_HASH_TYPE size);
|
||||
EXTERN void * Tcl_AttemptRealloc(void *ptr, size_t size);
|
||||
/* 431 */
|
||||
EXTERN void * Tcl_AttemptDbCkrealloc(void *ptr, TCL_HASH_TYPE size,
|
||||
EXTERN void * Tcl_AttemptDbCkrealloc(void *ptr, size_t size,
|
||||
const char *file, int line);
|
||||
/* 432 */
|
||||
EXTERN int Tcl_AttemptSetObjLength(Tcl_Obj *objPtr,
|
||||
@@ -1408,7 +1401,7 @@ EXTERN void Tcl_LimitTypeSet(Tcl_Interp *interp, int type);
|
||||
/* 531 */
|
||||
EXTERN void Tcl_LimitTypeReset(Tcl_Interp *interp, int type);
|
||||
/* 532 */
|
||||
EXTERN int Tcl_LimitGetCommands(Tcl_Interp *interp);
|
||||
EXTERN Tcl_Size Tcl_LimitGetCommands(Tcl_Interp *interp);
|
||||
/* 533 */
|
||||
EXTERN void Tcl_LimitGetTime(Tcl_Interp *interp,
|
||||
Tcl_Time *timeLimitPtr);
|
||||
@@ -1711,7 +1704,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,
|
||||
TCL_HASH_TYPE numBytes);
|
||||
size_t numBytes);
|
||||
/* 638 */
|
||||
EXTERN Tcl_ObjInternalRep * Tcl_FetchInternalRep(Tcl_Obj *objPtr,
|
||||
const Tcl_ObjType *typePtr);
|
||||
@@ -1874,6 +1867,8 @@ 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 {
|
||||
@@ -1889,12 +1884,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) (TCL_HASH_TYPE size); /* 3 */
|
||||
void * (*tcl_Alloc) (size_t size); /* 3 */
|
||||
void (*tcl_Free) (void *ptr); /* 4 */
|
||||
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_Realloc) (void *ptr, size_t size); /* 5 */
|
||||
void * (*tcl_DbCkalloc) (size_t size, const char *file, int line); /* 6 */
|
||||
void (*tcl_DbCkfree) (void *ptr, const char *file, int line); /* 7 */
|
||||
void * (*tcl_DbCkrealloc) (void *ptr, TCL_HASH_TYPE size, const char *file, int line); /* 8 */
|
||||
void * (*tcl_DbCkrealloc) (void *ptr, size_t 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 */
|
||||
@@ -1917,9 +1912,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 */
|
||||
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 */
|
||||
void (*reserved31)(void);
|
||||
void (*reserved32)(void);
|
||||
void (*reserved33)(void);
|
||||
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);
|
||||
@@ -1967,7 +1962,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 */
|
||||
int (*tcl_Close) (Tcl_Interp *interp, Tcl_Channel chan); /* 81 */
|
||||
void (*reserved81)(void);
|
||||
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 */
|
||||
@@ -2279,7 +2274,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, TCL_HASH_TYPE stackSize, int flags); /* 393 */
|
||||
int (*tcl_CreateThread) (Tcl_ThreadId *idPtr, Tcl_ThreadCreateProc *proc, void *clientData, size_t 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 */
|
||||
@@ -2314,10 +2309,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) (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 */
|
||||
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 */
|
||||
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 */
|
||||
@@ -2418,7 +2413,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 */
|
||||
int (*tcl_LimitGetCommands) (Tcl_Interp *interp); /* 532 */
|
||||
Tcl_Size (*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 */
|
||||
@@ -2523,7 +2518,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, TCL_HASH_TYPE numBytes); /* 637 */
|
||||
char * (*tcl_InitStringRep) (Tcl_Obj *objPtr, const char *bytes, size_t 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 */
|
||||
@@ -2576,7 +2571,8 @@ 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 */
|
||||
void (*tclUnusedStubEntry) (void); /* 690 */
|
||||
int (*tcl_IsEmpty) (Tcl_Obj *obj); /* 690 */
|
||||
void (*tclUnusedStubEntry) (void); /* 691 */
|
||||
} TclStubs;
|
||||
|
||||
extern const TclStubs *tclStubsPtr;
|
||||
@@ -2651,12 +2647,9 @@ extern const TclStubs *tclStubsPtr;
|
||||
(tclStubsPtr->tcl_DuplicateObj) /* 29 */
|
||||
#define TclFreeObj \
|
||||
(tclStubsPtr->tclFreeObj) /* 30 */
|
||||
#define Tcl_GetBoolean \
|
||||
(tclStubsPtr->tcl_GetBoolean) /* 31 */
|
||||
#define Tcl_GetBooleanFromObj \
|
||||
(tclStubsPtr->tcl_GetBooleanFromObj) /* 32 */
|
||||
#define Tcl_GetByteArrayFromObj \
|
||||
(tclStubsPtr->tcl_GetByteArrayFromObj) /* 33 */
|
||||
/* Slot 31 is reserved */
|
||||
/* Slot 32 is reserved */
|
||||
/* Slot 33 is reserved */
|
||||
#define Tcl_GetDouble \
|
||||
(tclStubsPtr->tcl_GetDouble) /* 34 */
|
||||
#define Tcl_GetDoubleFromObj \
|
||||
@@ -2740,8 +2733,7 @@ extern const TclStubs *tclStubsPtr;
|
||||
(tclStubsPtr->tcl_CallWhenDeleted) /* 79 */
|
||||
#define Tcl_CancelIdleCall \
|
||||
(tclStubsPtr->tcl_CancelIdleCall) /* 80 */
|
||||
#define Tcl_Close \
|
||||
(tclStubsPtr->tcl_Close) /* 81 */
|
||||
/* Slot 81 is reserved */
|
||||
#define Tcl_CommandComplete \
|
||||
(tclStubsPtr->tcl_CommandComplete) /* 82 */
|
||||
#define Tcl_Concat \
|
||||
@@ -3909,8 +3901,10 @@ 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) /* 690 */
|
||||
(tclStubsPtr->tclUnusedStubEntry) /* 691 */
|
||||
|
||||
#endif /* defined(USE_TCL_STUBS) */
|
||||
|
||||
@@ -3980,23 +3974,6 @@ 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
|
||||
@@ -4049,26 +4026,22 @@ 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_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)))
|
||||
#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))
|
||||
#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_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)))
|
||||
#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))
|
||||
#endif
|
||||
|
||||
#ifdef TCL_MEM_DEBUG
|
||||
@@ -4165,11 +4138,7 @@ extern const TclStubs *tclStubsPtr;
|
||||
Tcl_EvalObjEx(interp, objPtr, 0)
|
||||
#define Tcl_GlobalEvalObj(interp, objPtr) \
|
||||
Tcl_EvalObjEx(interp, objPtr, TCL_EVAL_GLOBAL)
|
||||
|
||||
#if TCL_MAJOR_VERSION > 8
|
||||
# undef Tcl_Close
|
||||
# define Tcl_Close(interp, chan) Tcl_CloseEx(interp, chan, 0)
|
||||
#endif
|
||||
#define Tcl_Close(interp, chan) Tcl_CloseEx(interp, chan, 0)
|
||||
|
||||
#undef TclUtfCharComplete
|
||||
#undef TclUtfNext
|
||||
@@ -4193,55 +4162,7 @@ extern const TclStubs *tclStubsPtr;
|
||||
#undef TclParseArgsObjv
|
||||
#undef TclGetAliasObj
|
||||
|
||||
#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
|
||||
#if defined(TCL_8_API)
|
||||
# undef Tcl_GetBytesFromObj
|
||||
# undef Tcl_GetStringFromObj
|
||||
# undef Tcl_GetUnicodeFromObj
|
||||
@@ -4254,9 +4175,6 @@ 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)))
|
||||
@@ -4291,9 +4209,6 @@ 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)))
|
||||
@@ -4328,10 +4243,12 @@ 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 */
|
||||
|
||||
+11
-8
@@ -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,7 +546,9 @@ UpdateStringOfDict(
|
||||
dst = Tcl_InitStringRep(dictPtr, NULL, bytesNeeded - 1);
|
||||
TclOOM(dst, bytesNeeded);
|
||||
for (i=0,cPtr=dict->entryChainHead; i<numElems; i+=2,cPtr=cPtr->nextPtr) {
|
||||
flagPtr[i] |= ( i ? TCL_DONT_QUOTE_HASH : 0 );
|
||||
if (i) {
|
||||
flagPtr[i] |= TCL_DONT_QUOTE_HASH;
|
||||
}
|
||||
keyPtr = (Tcl_Obj *)Tcl_GetHashKey(&dict->table, &cPtr->entry);
|
||||
elem = TclGetStringFromObj(keyPtr, &length);
|
||||
dst += TclConvertElement(elem, length, dst, flagPtr[i]);
|
||||
@@ -1265,7 +1267,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;
|
||||
|
||||
@@ -1967,8 +1969,8 @@ DictMergeCmd(
|
||||
Tcl_Obj *const *objv)
|
||||
{
|
||||
Tcl_Obj *targetObj, *keyObj = NULL, *valueObj = NULL;
|
||||
int allocatedDict = 0;
|
||||
int i, done;
|
||||
int done, allocatedDict = 0;
|
||||
int i;
|
||||
Tcl_DictSearch search;
|
||||
|
||||
if (objc == 1) {
|
||||
@@ -2493,7 +2495,8 @@ DictLappendCmd(
|
||||
Tcl_Obj *const *objv)
|
||||
{
|
||||
Tcl_Obj *dictPtr, *valuePtr, *resultPtr;
|
||||
int i, allocatedDict = 0, allocatedValue = 0;
|
||||
int allocatedDict = 0, allocatedValue = 0;
|
||||
int i;
|
||||
|
||||
if (objc < 3) {
|
||||
Tcl_WrongNumArgs(interp, 1, objv, "dictVarName key ?value ...?");
|
||||
@@ -3855,10 +3858,10 @@ TclDictWithFinish(
|
||||
* parameter is >= 0 */
|
||||
Tcl_Obj *part2Ptr, /* If non-NULL, gives the name of an element
|
||||
* in the array part1. */
|
||||
int index, /* Index into the local variable table of the
|
||||
Tcl_Size index, /* Index into the local variable table of the
|
||||
* variable, or -1. Only used when part1Ptr is
|
||||
* NULL. */
|
||||
int pathc, /* The number of elements in the path into the
|
||||
Tcl_Size 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
|
||||
|
||||
@@ -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)) {
|
||||
|
||||
@@ -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, int objc,
|
||||
Tcl_Command token, Tcl_Size 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. */
|
||||
int objc, /* The count of option-related arguments. */
|
||||
Tcl_Size objc, /* The count of option-related arguments. */
|
||||
Tcl_Obj *const objv[]) /* Option-related arguments. */
|
||||
{
|
||||
Tcl_Size len;
|
||||
@@ -1578,7 +1578,8 @@ TclMakeEnsemble(
|
||||
const char **nameParts = NULL;
|
||||
const char *cmdName = NULL;
|
||||
Tcl_Size i, nameCount = 0;
|
||||
int ensembleFlags = 0, hiddenLen;
|
||||
int ensembleFlags = 0;
|
||||
Tcl_Size hiddenLen;
|
||||
|
||||
/*
|
||||
* Construct the path for the ensemble namespace and create it.
|
||||
|
||||
+1
-1
@@ -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
@@ -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);
|
||||
|
||||
+18
-18
@@ -943,8 +943,8 @@ wordSkip(
|
||||
void *ptr)
|
||||
{
|
||||
int mask = TCL_ALLOCALIGN-1;
|
||||
int base = PTR2INT(ptr) & mask;
|
||||
return (TCL_ALLOCALIGN - base)/sizeof(Tcl_Obj *);
|
||||
int base = (int)PTR2INT(ptr) & mask;
|
||||
return (TCL_ALLOCALIGN - base)/(int)sizeof(Tcl_Obj *);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1556,7 +1556,7 @@ TclCompileObj(
|
||||
Tcl_Interp *interp,
|
||||
Tcl_Obj *objPtr,
|
||||
const CmdFrame *invoker,
|
||||
int word)
|
||||
Tcl_Size word)
|
||||
{
|
||||
Interp *iPtr = (Interp *) interp;
|
||||
ByteCode *codePtr; /* Tcl Internal type of bytecode. */
|
||||
@@ -2031,7 +2031,7 @@ TEBCresume(
|
||||
* executing an instruction.
|
||||
*/
|
||||
|
||||
int cleanup = PTR2INT(data[2]);
|
||||
Tcl_Size 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 +4224,7 @@ TEBCresume(
|
||||
case INST_JUMP4:
|
||||
opnd = TclGetInt4AtPtr(pc+1);
|
||||
TRACE(("%d => new pc %" TCL_Z_MODIFIER "u\n", opnd,
|
||||
(size_t)(pc + opnd - codePtr->codeStart)));
|
||||
(pc + opnd - codePtr->codeStart)));
|
||||
NEXT_INST_F(opnd, 0, 0);
|
||||
|
||||
{
|
||||
@@ -4266,8 +4266,8 @@ TEBCresume(
|
||||
#ifdef TCL_COMPILE_DEBUG
|
||||
if (b) {
|
||||
if ((*pc == INST_JUMP_TRUE1) || (*pc == INST_JUMP_TRUE4)) {
|
||||
TRACE_APPEND(("%.20s true, new pc %" TCL_Z_MODIFIER "u\n", O2S(valuePtr),
|
||||
(size_t)(pc + jmpOffset[1] - codePtr->codeStart)));
|
||||
TRACE_APPEND(("%.20s true, new pc %" TCL_T_MODIFIER "u\n", O2S(valuePtr),
|
||||
(pc + jmpOffset[1] - codePtr->codeStart)));
|
||||
} else {
|
||||
TRACE_APPEND(("%.20s true\n", O2S(valuePtr)));
|
||||
}
|
||||
@@ -4275,8 +4275,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_Z_MODIFIER "u\n", O2S(valuePtr),
|
||||
(size_t)(pc + jmpOffset[0] - codePtr->codeStart)));
|
||||
TRACE_APPEND(("%.20s false, new pc %" TCL_T_MODIFIER "u\n", O2S(valuePtr),
|
||||
(pc + jmpOffset[0] - codePtr->codeStart)));
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -4301,7 +4301,7 @@ TEBCresume(
|
||||
Tcl_Size jumpOffset = PTR2INT(Tcl_GetHashValue(hPtr));
|
||||
|
||||
TRACE_APPEND(("found in table, new pc %" TCL_Z_MODIFIER "u\n",
|
||||
(size_t)(pc - codePtr->codeStart + jumpOffset)));
|
||||
(pc - codePtr->codeStart + jumpOffset)));
|
||||
NEXT_INST_F(jumpOffset, 1, 0);
|
||||
} else {
|
||||
TRACE_APPEND(("not found in table\n"));
|
||||
@@ -4338,12 +4338,12 @@ TEBCresume(
|
||||
NEXT_INST_F(1, 0, 1);
|
||||
break;
|
||||
case INST_INFO_LEVEL_ARGS: {
|
||||
int level;
|
||||
Tcl_WideInt level;
|
||||
CallFrame *framePtr = iPtr->varFramePtr;
|
||||
CallFrame *rootFramePtr = iPtr->rootFramePtr;
|
||||
|
||||
TRACE(("\"%.30s\" => ", O2S(OBJ_AT_TOS)));
|
||||
if (TclGetIntFromObj(interp, OBJ_AT_TOS, &level) != TCL_OK) {
|
||||
if (TclGetWideIntFromObj(interp, OBJ_AT_TOS, &level) != TCL_OK) {
|
||||
TRACE_ERROR(interp);
|
||||
goto gotError;
|
||||
}
|
||||
@@ -4495,7 +4495,7 @@ TEBCresume(
|
||||
} else {
|
||||
fprintf(stdout, "%" TCL_SIZE_MODIFIER "d: (%" TCL_T_MODIFIER "d) invoking ",
|
||||
iPtr->numLevels,
|
||||
(size_t)(pc - codePtr->codeStart));
|
||||
(pc - codePtr->codeStart));
|
||||
}
|
||||
for (i = 0; i < opnd; i++) {
|
||||
TclPrintObject(stdout, objv[i], 15);
|
||||
@@ -5015,7 +5015,7 @@ TEBCresume(
|
||||
TRACE_APPEND(("\"%.30s\"", O2S(objResultPtr)));
|
||||
NEXT_INST_F(9, 1, 1);
|
||||
}
|
||||
toIdx = TclIndexDecode(toIdx, objc - 1);
|
||||
toIdx = TclIndexDecode((int)toIdx, objc - 1);
|
||||
if (toIdx == TCL_INDEX_NONE) {
|
||||
goto emptyList;
|
||||
} else if (toIdx >= objc) {
|
||||
@@ -5032,7 +5032,7 @@ TEBCresume(
|
||||
fromIdx = TCL_INDEX_START;
|
||||
}
|
||||
|
||||
fromIdx = TclIndexDecode(fromIdx, objc - 1);
|
||||
fromIdx = TclIndexDecode((int)fromIdx, objc - 1);
|
||||
|
||||
DECACHE_STACK_INFO();
|
||||
if (TclObjTypeHasProc(valuePtr, sliceProc)) {
|
||||
@@ -5438,8 +5438,8 @@ TEBCresume(
|
||||
|
||||
/* Decode index operands. */
|
||||
|
||||
toIdx = TclIndexDecode(toIdx, slength - 1);
|
||||
fromIdx = TclIndexDecode(fromIdx, slength - 1);
|
||||
toIdx = TclIndexDecode((int)toIdx, slength - 1);
|
||||
fromIdx = TclIndexDecode((int)fromIdx, slength - 1);
|
||||
if (toIdx == TCL_INDEX_NONE) {
|
||||
TclNewObj(objResultPtr);
|
||||
} else {
|
||||
@@ -9341,7 +9341,7 @@ GetSrcInfoForPc(
|
||||
break;
|
||||
}
|
||||
if (pcOffset <= codeEnd) { /* This cmd's code encloses pc */
|
||||
int dist = (pcOffset - codeOffset);
|
||||
Tcl_Size dist = (pcOffset - codeOffset);
|
||||
|
||||
if (dist <= bestDist) {
|
||||
bestDist = dist;
|
||||
|
||||
+1
-1
@@ -603,7 +603,7 @@ CopyRenameOneFile(
|
||||
|
||||
{
|
||||
Tcl_Obj *perm;
|
||||
int index;
|
||||
Tcl_Size index;
|
||||
|
||||
TclNewLiteralStringObj(perm, "u+w");
|
||||
Tcl_IncrRefCount(perm);
|
||||
|
||||
+4
-6
@@ -104,8 +104,7 @@ 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
|
||||
@@ -142,8 +141,7 @@ 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,
|
||||
@@ -623,9 +621,9 @@ Tcl_HashStats(
|
||||
} else {
|
||||
overflow++;
|
||||
}
|
||||
tmp = j;
|
||||
tmp = (double)j;
|
||||
if (tablePtr->numEntries != 0) {
|
||||
average += (tmp+1.0)*(tmp/tablePtr->numEntries)/2.0;
|
||||
average += (tmp+1.0)*(tmp/(double)tablePtr->numEntries)/2.0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+36
-25
@@ -69,7 +69,7 @@ typedef struct GetsState {
|
||||
char **dstPtr; /* Pointer into objPtr's string rep where
|
||||
* next character should be stored. */
|
||||
Tcl_Encoding encoding; /* The encoding to use to convert raw bytes
|
||||
* to UTF-8. */
|
||||
* to UTF-8. */
|
||||
ChannelBuffer *bufPtr; /* The current buffer of raw bytes being
|
||||
* emptied. */
|
||||
Tcl_EncodingState state; /* The encoding state just before the last
|
||||
@@ -336,27 +336,27 @@ static void FreeChannelInternalRep(Tcl_Obj *objPtr);
|
||||
|
||||
static const Tcl_ObjType chanObjType = {
|
||||
"channel", /* name for this type */
|
||||
FreeChannelInternalRep, /* freeIntRepProc */
|
||||
DupChannelInternalRep, /* dupIntRepProc */
|
||||
FreeChannelInternalRep, /* freeIntRepProc */
|
||||
DupChannelInternalRep, /* dupIntRepProc */
|
||||
NULL, /* updateStringProc */
|
||||
NULL, /* setFromAnyProc */
|
||||
TCL_OBJTYPE_V0
|
||||
};
|
||||
|
||||
#define ChanSetInternalRep(objPtr, resPtr) \
|
||||
#define ChanSetInternalRep(objPtr, resPtr) \
|
||||
do { \
|
||||
Tcl_ObjInternalRep ir; \
|
||||
(resPtr)->refCount++; \
|
||||
ir.twoPtrValue.ptr1 = (resPtr); \
|
||||
ir.twoPtrValue.ptr2 = NULL; \
|
||||
Tcl_StoreInternalRep((objPtr), &chanObjType, &ir); \
|
||||
Tcl_StoreInternalRep((objPtr), &chanObjType, &ir); \
|
||||
} while (0)
|
||||
|
||||
#define ChanGetInternalRep(objPtr, resPtr) \
|
||||
#define ChanGetInternalRep(objPtr, resPtr) \
|
||||
do { \
|
||||
const Tcl_ObjInternalRep *irPtr; \
|
||||
const Tcl_ObjInternalRep *irPtr; \
|
||||
irPtr = TclFetchInternalRep((objPtr), &chanObjType); \
|
||||
(resPtr) = irPtr ? (ResolvedChanName *)irPtr->twoPtrValue.ptr1 : NULL; \
|
||||
(resPtr) = irPtr ? (ResolvedChanName *)irPtr->twoPtrValue.ptr1 : NULL; \
|
||||
} while (0)
|
||||
|
||||
#define BUSY_STATE(st, fl) \
|
||||
@@ -847,7 +847,7 @@ Tcl_CreateCloseHandler(
|
||||
* callback. */
|
||||
Tcl_CloseProc *proc, /* The callback routine to call when the
|
||||
* channel will be closed. */
|
||||
void *clientData) /* Arbitrary data to pass to the close
|
||||
void *clientData) /* Arbitrary data to pass to the close
|
||||
* callback. */
|
||||
{
|
||||
ChannelState *statePtr = ((Channel *) chan)->state;
|
||||
@@ -885,7 +885,7 @@ Tcl_DeleteCloseHandler(
|
||||
* callback. */
|
||||
Tcl_CloseProc *proc, /* The procedure for the callback to
|
||||
* remove. */
|
||||
void *clientData) /* The callback data for the callback to
|
||||
void *clientData) /* The callback data for the callback to
|
||||
* remove. */
|
||||
{
|
||||
ChannelState *statePtr = ((Channel *) chan)->state;
|
||||
@@ -984,7 +984,7 @@ GetChannelTable(
|
||||
|
||||
static void
|
||||
DeleteChannelTable(
|
||||
void *clientData, /* The per-interpreter data structure. */
|
||||
void *clientData, /* The per-interpreter data structure. */
|
||||
Tcl_Interp *interp) /* The interpreter being deleted. */
|
||||
{
|
||||
Tcl_HashTable *hTblPtr; /* The hash table. */
|
||||
@@ -2493,7 +2493,7 @@ Tcl_RemoveChannelMode(
|
||||
|
||||
static ChannelBuffer *
|
||||
AllocChannelBuffer(
|
||||
Tcl_Size length) /* Desired length of channel buffer. */
|
||||
Tcl_Size length) /* Desired length of channel buffer. */
|
||||
{
|
||||
ChannelBuffer *bufPtr;
|
||||
Tcl_Size n;
|
||||
@@ -4062,7 +4062,7 @@ Tcl_Size
|
||||
Tcl_Write(
|
||||
Tcl_Channel chan, /* The channel to buffer output for. */
|
||||
const char *src, /* Data to queue in output buffer. */
|
||||
Tcl_Size srcLen) /* Length of data in bytes, or TCL_INDEX_NONE for
|
||||
Tcl_Size srcLen) /* Length of data in bytes, or TCL_INDEX_NONE for
|
||||
* strlen(). */
|
||||
{
|
||||
/*
|
||||
@@ -4174,7 +4174,7 @@ Tcl_WriteChars(
|
||||
Tcl_Channel chan, /* The channel to buffer output for. */
|
||||
const char *src, /* UTF-8 characters to queue in output
|
||||
* buffer. */
|
||||
Tcl_Size len) /* Length of string in bytes, or TCL_INDEX_NONE for
|
||||
Tcl_Size len) /* Length of string in bytes, or TCL_INDEX_NONE for
|
||||
* strlen(). */
|
||||
{
|
||||
Channel *chanPtr = (Channel *) chan;
|
||||
@@ -4352,7 +4352,7 @@ static Tcl_Size
|
||||
Write(
|
||||
Channel *chanPtr, /* The channel to buffer output for. */
|
||||
const char *src, /* UTF-8 string to write. */
|
||||
Tcl_Size srcLen, /* Length of UTF-8 string in bytes. */
|
||||
Tcl_Size srcLen, /* Length of UTF-8 string in bytes. */
|
||||
Tcl_Encoding encoding)
|
||||
{
|
||||
ChannelState *statePtr = chanPtr->state;
|
||||
@@ -5715,7 +5715,7 @@ Tcl_Size
|
||||
Tcl_Read(
|
||||
Tcl_Channel chan, /* The channel from which to read. */
|
||||
char *dst, /* Where to store input read. */
|
||||
Tcl_Size bytesToRead) /* Maximum number of bytes to read. */
|
||||
Tcl_Size bytesToRead) /* Maximum number of bytes to read. */
|
||||
{
|
||||
Channel *chanPtr = (Channel *) chan;
|
||||
ChannelState *statePtr = chanPtr->state;
|
||||
@@ -5760,7 +5760,7 @@ Tcl_Size
|
||||
Tcl_ReadRaw(
|
||||
Tcl_Channel chan, /* The channel from which to read. */
|
||||
char *readBuf, /* Where to store input read. */
|
||||
Tcl_Size bytesToRead) /* Maximum number of bytes to read. */
|
||||
Tcl_Size bytesToRead) /* Maximum number of bytes to read. */
|
||||
{
|
||||
Channel *chanPtr = (Channel *) chan;
|
||||
ChannelState *statePtr = chanPtr->state;
|
||||
@@ -6063,10 +6063,21 @@ DoReadChars(
|
||||
}
|
||||
|
||||
if (copiedNow < 0) {
|
||||
if (GotFlag(statePtr, CHANNEL_EOF) ||
|
||||
GotFlag(statePtr, CHANNEL_ENCODING_ERROR)) {
|
||||
/*
|
||||
* copiedNow < 0 => no characters decoded in this iteration *AND*
|
||||
* no source bytes consumed. This can happen if additional data
|
||||
* needed to decode the next character or an invalid byte sequence
|
||||
* is encountered before any data was successfully decoded.
|
||||
* If at EOF, no additional data is available. If an encoding
|
||||
* error is present, no progress can be made even if more data
|
||||
* is available (Bug 73bb42fb3f). Either way need to break out
|
||||
* of the loop.
|
||||
*/
|
||||
if (GotFlag(statePtr, CHANNEL_EOF)
|
||||
|| GotFlag(statePtr, CHANNEL_ENCODING_ERROR)) {
|
||||
break;
|
||||
}
|
||||
|
||||
if ((GotFlag(statePtr, CHANNEL_NONBLOCKING) || allowShortReads)
|
||||
&& GotFlag(statePtr, CHANNEL_BLOCKED)) {
|
||||
break;
|
||||
@@ -6823,7 +6834,7 @@ Tcl_Size
|
||||
Tcl_Ungets(
|
||||
Tcl_Channel chan, /* The channel for which to add the input. */
|
||||
const char *str, /* The input itself. */
|
||||
Tcl_Size len, /* The length of the input. */
|
||||
Tcl_Size len, /* The length of the input. */
|
||||
int atEnd) /* If non-zero, add at end of queue; otherwise
|
||||
* add at head of queue. */
|
||||
{
|
||||
@@ -7796,7 +7807,7 @@ Tcl_ChannelBuffered(
|
||||
void
|
||||
Tcl_SetChannelBufferSize(
|
||||
Tcl_Channel chan, /* The channel whose buffer size to set. */
|
||||
Tcl_Size sz) /* The size to set. */
|
||||
Tcl_Size sz) /* The size to set. */
|
||||
{
|
||||
ChannelState *statePtr; /* State of real channel structure. */
|
||||
|
||||
@@ -8870,7 +8881,7 @@ Tcl_CreateChannelHandler(
|
||||
* handler. */
|
||||
Tcl_ChannelProc *proc, /* Procedure to call for each selected
|
||||
* event. */
|
||||
void *clientData) /* Arbitrary data to pass to proc. */
|
||||
void *clientData) /* Arbitrary data to pass to proc. */
|
||||
{
|
||||
ChannelHandler *chPtr;
|
||||
Channel *chanPtr = (Channel *) chan;
|
||||
@@ -8942,7 +8953,7 @@ Tcl_DeleteChannelHandler(
|
||||
Tcl_Channel chan, /* The channel for which to remove the
|
||||
* callback. */
|
||||
Tcl_ChannelProc *proc, /* The procedure in the callback to delete. */
|
||||
void *clientData) /* The client data in the callback to
|
||||
void *clientData) /* The client data in the callback to
|
||||
* delete. */
|
||||
{
|
||||
ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey);
|
||||
@@ -9148,7 +9159,7 @@ CreateScriptRecord(
|
||||
|
||||
void
|
||||
TclChannelEventScriptInvoker(
|
||||
void *clientData, /* The script+interp record. */
|
||||
void *clientData, /* The script+interp record. */
|
||||
TCL_UNUSED(int) /*mask*/)
|
||||
{
|
||||
EventScriptRecord *esPtr = (EventScriptRecord *)clientData;
|
||||
@@ -10064,7 +10075,7 @@ static Tcl_Size
|
||||
DoRead(
|
||||
Channel *chanPtr, /* The channel from which to read. */
|
||||
char *dst, /* Where to store input read. */
|
||||
Tcl_Size bytesToRead, /* Maximum number of bytes to read. */
|
||||
Tcl_Size bytesToRead, /* Maximum number of bytes to read. */
|
||||
int allowShortReads) /* Allow half-blocking (pipes,sockets) */
|
||||
{
|
||||
ChannelState *statePtr = chanPtr->state;
|
||||
|
||||
+1
-6
@@ -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,11 +158,6 @@ 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
@@ -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;
|
||||
int scanned = TclParseAllWhiteSpace(permString, -1);
|
||||
Tcl_Size 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;
|
||||
|
||||
+10
-9
@@ -56,7 +56,7 @@ typedef struct TransformChannelData TransformChannelData;
|
||||
|
||||
static int ExecuteCallback(TransformChannelData *ctrl,
|
||||
Tcl_Interp *interp, unsigned char *op,
|
||||
unsigned char *buf, int bufLen, int transmit,
|
||||
unsigned char *buf, Tcl_Size 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. */
|
||||
int bufLen, /* And its length. */
|
||||
Tcl_Size 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,7 +637,8 @@ TransformInputProc(
|
||||
int *errorCodePtr)
|
||||
{
|
||||
TransformChannelData *dataPtr = (TransformChannelData *)instanceData;
|
||||
int gotBytes, read, copied;
|
||||
int gotBytes, copied;
|
||||
Tcl_Size read;
|
||||
Tcl_Channel downChan;
|
||||
|
||||
/*
|
||||
@@ -1013,7 +1014,7 @@ TransformGetOptionProc(
|
||||
|
||||
static void
|
||||
TransformWatchProc(
|
||||
void *instanceData, /* Channel to watch. */
|
||||
void *instanceData, /* Channel to watch. */
|
||||
int mask) /* Events of interest. */
|
||||
{
|
||||
TransformChannelData *dataPtr = (TransformChannelData *)instanceData;
|
||||
@@ -1091,9 +1092,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;
|
||||
|
||||
@@ -1125,7 +1126,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. */
|
||||
{
|
||||
@@ -1170,7 +1171,7 @@ TransformNotifyProc(
|
||||
|
||||
static void
|
||||
TransformChannelHandlerTimer(
|
||||
void *clientData) /* Transformation to query. */
|
||||
void *clientData) /* Transformation to query. */
|
||||
{
|
||||
TransformChannelData *dataPtr = (TransformChannelData *)clientData;
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
@@ -208,8 +208,8 @@ TCL_DECLARE_MUTEX(filesystemMutex)
|
||||
* A files-system indepent sense of the current directory.
|
||||
*/
|
||||
|
||||
static Tcl_Obj *cwdPathPtr = NULL;
|
||||
static size_t cwdPathEpoch = 0; /* The pathname of the current directory */
|
||||
static Tcl_Obj *cwdPathPtr = NULL; /* The pathname of the current directory */
|
||||
static size_t cwdPathEpoch = 0;
|
||||
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. */
|
||||
int *indexPtr) /* A place to store the result. */
|
||||
Tcl_Size *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(
|
||||
*/
|
||||
|
||||
{
|
||||
int index;
|
||||
Tcl_Size 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();
|
||||
|
||||
+13
-13
@@ -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 = index;
|
||||
*(uint16_t *)indexPtr = (uint16_t)index;
|
||||
return TCL_OK;
|
||||
} else if (flags == (int)(sizeof(uint8_t)<<1)) {
|
||||
*(uint8_t *)indexPtr = index;
|
||||
*(uint8_t *)indexPtr = (uint8_t)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 = index;
|
||||
*(int32_t *)indexPtr = (int32_t)index;
|
||||
return TCL_OK;
|
||||
}
|
||||
}
|
||||
*(int *)indexPtr = index;
|
||||
*(int *)indexPtr = (int)index;
|
||||
}
|
||||
return TCL_OK;
|
||||
|
||||
@@ -806,7 +806,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 +1009,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 +1107,7 @@ Tcl_ParseArgsObjv(
|
||||
infoPtr = matchPtr;
|
||||
switch (infoPtr->type) {
|
||||
case TCL_ARGV_CONSTANT:
|
||||
*((int *) infoPtr->dstPtr) = PTR2INT(infoPtr->srcPtr);
|
||||
*((int *)infoPtr->dstPtr) = (int)PTR2INT(infoPtr->srcPtr);
|
||||
break;
|
||||
case TCL_ARGV_INT:
|
||||
if (objc == 0) {
|
||||
@@ -1139,7 +1139,7 @@ Tcl_ParseArgsObjv(
|
||||
*/
|
||||
|
||||
if (infoPtr->dstPtr != NULL) {
|
||||
*((int *) infoPtr->dstPtr) = dstIndex;
|
||||
*((int *)infoPtr->dstPtr) = (int)dstIndex;
|
||||
}
|
||||
goto argsDone;
|
||||
case TCL_ARGV_FLOAT:
|
||||
@@ -1147,7 +1147,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 +1268,7 @@ PrintUsage(
|
||||
* descriptions. */
|
||||
{
|
||||
const Tcl_ArgvInfo *infoPtr;
|
||||
int width, numSpaces;
|
||||
Tcl_Size width, numSpaces;
|
||||
#define NUM_SPACES 20
|
||||
static const char spaces[] = " ";
|
||||
Tcl_Obj *msg;
|
||||
|
||||
@@ -158,17 +158,12 @@ 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(TCL_HASH_TYPE size)
|
||||
void *TclpAlloc(size_t size)
|
||||
}
|
||||
declare 74 {
|
||||
void TclpFree(void *ptr)
|
||||
@@ -184,7 +179,7 @@ declare 76 {
|
||||
# void TclpGetTime(Tcl_Time *time)
|
||||
#}
|
||||
declare 81 {
|
||||
void *TclpRealloc(void *ptr, TCL_HASH_TYPE size)
|
||||
void *TclpRealloc(void *ptr, size_t size)
|
||||
}
|
||||
# Removed in 9.0:
|
||||
#declare 88 {
|
||||
@@ -465,7 +460,7 @@ declare 214 {
|
||||
void TclSetObjNameOfExecutable(Tcl_Obj *name, Tcl_Encoding encoding)
|
||||
}
|
||||
declare 215 {
|
||||
void *TclStackAlloc(Tcl_Interp *interp, TCL_HASH_TYPE numBytes)
|
||||
void *TclStackAlloc(Tcl_Interp *interp, size_t numBytes)
|
||||
}
|
||||
declare 216 {
|
||||
void TclStackFree(Tcl_Interp *interp, void *freePtr)
|
||||
|
||||
+36
-86
@@ -218,10 +218,8 @@ 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;
|
||||
|
||||
/*
|
||||
@@ -264,11 +262,7 @@ 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
|
||||
@@ -967,9 +961,6 @@ 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. */
|
||||
@@ -980,12 +971,10 @@ 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
|
||||
@@ -1043,11 +1032,7 @@ 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
|
||||
@@ -1091,7 +1076,6 @@ 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))) ? \
|
||||
@@ -1193,7 +1177,6 @@ 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
|
||||
@@ -1337,7 +1320,7 @@ typedef struct CmdFrame {
|
||||
int type; /* Values see below. */
|
||||
int level; /* Number of frames in stack, prevent O(n)
|
||||
* scan of list. */
|
||||
Tcl_Size *line; /* Lines the words of the command start on. */
|
||||
int *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. */
|
||||
@@ -1432,7 +1415,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
|
||||
@@ -1688,13 +1671,13 @@ typedef struct LiteralTable {
|
||||
LiteralEntry *staticBuckets[TCL_SMALL_HASH_TABLE];
|
||||
/* Bucket array used for small tables to avoid
|
||||
* mallocs and frees. */
|
||||
TCL_HASH_TYPE numBuckets; /* Total number of buckets allocated at
|
||||
size_t numBuckets; /* Total number of buckets allocated at
|
||||
* **buckets. */
|
||||
TCL_HASH_TYPE numEntries; /* Total number of entries present in
|
||||
size_t numEntries; /* Total number of entries present in
|
||||
* table. */
|
||||
TCL_HASH_TYPE rebuildSize; /* Enlarge table when numEntries gets to be
|
||||
size_t rebuildSize; /* Enlarge table when numEntries gets to be
|
||||
* this large. */
|
||||
TCL_HASH_TYPE mask; /* Mask value used in hashing function. */
|
||||
size_t mask; /* Mask value used in hashing function. */
|
||||
} LiteralTable;
|
||||
|
||||
/*
|
||||
@@ -1988,20 +1971,9 @@ 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.
|
||||
@@ -2030,11 +2002,6 @@ 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.
|
||||
@@ -2058,9 +2025,6 @@ 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
|
||||
@@ -2097,9 +2061,6 @@ 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. */
|
||||
@@ -2207,7 +2168,7 @@ typedef struct Interp {
|
||||
* invoking context of the bytecode compiler.
|
||||
* NULL when the byte code compiler is not
|
||||
* active. */
|
||||
int invokeWord; /* Index of the word in the command which
|
||||
Tcl_Size 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
|
||||
@@ -2467,7 +2428,7 @@ typedef struct Interp {
|
||||
#if defined(__APPLE__)
|
||||
#define TCL_ALLOCALIGN 16
|
||||
#else
|
||||
#define TCL_ALLOCALIGN (2*sizeof(void *))
|
||||
#define TCL_ALLOCALIGN (2*(int)sizeof(void *))
|
||||
#endif
|
||||
|
||||
/*
|
||||
@@ -2763,20 +2724,11 @@ 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) \
|
||||
@@ -2914,7 +2866,7 @@ typedef Tcl_Channel (TclOpenFileChannelProc_)(Tcl_Interp *interp,
|
||||
*/
|
||||
|
||||
typedef void (TclInitProcessGlobalValueProc)(char **valuePtr,
|
||||
TCL_HASH_TYPE *lengthPtr,
|
||||
size_t *lengthPtr,
|
||||
Tcl_Encoding *encodingPtr);
|
||||
|
||||
#ifdef _WIN32
|
||||
@@ -2936,7 +2888,7 @@ typedef void (TclInitProcessGlobalValueProc)(char **valuePtr,
|
||||
typedef struct ProcessGlobalValue {
|
||||
Tcl_Size epoch; /* Epoch counter to detect changes in the
|
||||
* global value. */
|
||||
TCL_HASH_TYPE numBytes; /* Length of the global string. */
|
||||
size_t numBytes; /* Length of the global string. */
|
||||
char *value; /* The global string value. */
|
||||
Tcl_Encoding encoding; /* system encoding when global string was
|
||||
* initialized. */
|
||||
@@ -3276,10 +3228,9 @@ struct Tcl_LoadHandle_ {
|
||||
*----------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#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,
|
||||
MODULE_SCOPE void TclAdvanceContinuations(int *line, Tcl_Size **next,
|
||||
Tcl_Size loc);
|
||||
MODULE_SCOPE void TclAdvanceLines(int *line, const char *start,
|
||||
const char *end);
|
||||
MODULE_SCOPE void TclAppendBytesToByteArray(Tcl_Obj *objPtr,
|
||||
const unsigned char *bytes, Tcl_Size len);
|
||||
@@ -3309,7 +3260,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, int index);
|
||||
Var *arrayPtr, Tcl_Obj *name, Tcl_Size index);
|
||||
MODULE_SCOPE int TclCheckEmptyString(Tcl_Obj *objPtr);
|
||||
MODULE_SCOPE int TclChanCaughtErrorBypass(Tcl_Interp *interp,
|
||||
Tcl_Channel chan);
|
||||
@@ -3352,7 +3303,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, Tcl_Size line,
|
||||
Tcl_Size numBytes, int flags, int line,
|
||||
Tcl_Size *clNextOuter, const char *outerScript);
|
||||
MODULE_SCOPE Tcl_ObjCmdProc TclFileAttrsCmd;
|
||||
MODULE_SCOPE Tcl_ObjCmdProc TclFileCopyCmd;
|
||||
@@ -3404,7 +3355,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, int *indexPtr);
|
||||
const char *attributeName, Tcl_Size *indexPtr);
|
||||
MODULE_SCOPE Tcl_Command TclNRCreateCommandInNs(Tcl_Interp *interp,
|
||||
const char *cmdName, Tcl_Namespace *nsPtr,
|
||||
Tcl_ObjCmdProc *proc, Tcl_ObjCmdProc *nreProc,
|
||||
@@ -3472,8 +3423,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, Tcl_Size line, Tcl_Size n,
|
||||
Tcl_Size *lines, Tcl_Obj *const *elems);
|
||||
MODULE_SCOPE void TclListLines(Tcl_Obj *listObj, int line, Tcl_Size n,
|
||||
int *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,
|
||||
@@ -3489,7 +3440,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, int objc,
|
||||
MODULE_SCOPE int TclMergeReturnOptions(Tcl_Interp *interp, Tcl_Size objc,
|
||||
Tcl_Obj *const objv[], Tcl_Obj **optionsPtrPtr,
|
||||
int *codePtr, int *levelPtr);
|
||||
MODULE_SCOPE Tcl_Obj * TclNoErrorStack(Tcl_Interp *interp, Tcl_Obj *options);
|
||||
@@ -3498,13 +3449,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, int index);
|
||||
const char *reason, Tcl_Size 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 int TclParseBackslash(const char *src,
|
||||
MODULE_SCOPE Tcl_Size 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,
|
||||
@@ -3551,10 +3502,10 @@ MODULE_SCOPE int TclCreateSocketAddress(Tcl_Interp *interp,
|
||||
const char **errorMsgPtr);
|
||||
MODULE_SCOPE int TclpThreadCreate(Tcl_ThreadId *idPtr,
|
||||
Tcl_ThreadCreateProc *proc, void *clientData,
|
||||
TCL_HASH_TYPE stackSize, int flags);
|
||||
size_t stackSize, int flags);
|
||||
MODULE_SCOPE Tcl_Size TclpFindVariable(const char *name, Tcl_Size *lengthPtr);
|
||||
MODULE_SCOPE void TclpInitLibraryPath(char **valuePtr,
|
||||
TCL_HASH_TYPE *lengthPtr, Tcl_Encoding *encodingPtr);
|
||||
size_t *lengthPtr, Tcl_Encoding *encodingPtr);
|
||||
MODULE_SCOPE void TclpInitLock(void);
|
||||
MODULE_SCOPE void * TclpInitNotifier(void);
|
||||
MODULE_SCOPE void TclpInitPlatform(void);
|
||||
@@ -3618,7 +3569,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,
|
||||
TCL_HASH_TYPE numBytes);
|
||||
size_t 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);
|
||||
@@ -3627,7 +3578,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, Tcl_Size line,
|
||||
Tcl_Size numBytes, int flags, int line,
|
||||
struct CompileEnv *envPtr);
|
||||
MODULE_SCOPE int TclSubstOptions(Tcl_Interp *interp, Tcl_Size numOpts,
|
||||
Tcl_Obj *const opts[], int *flagPtr);
|
||||
@@ -3635,7 +3586,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, int *tokensLeftPtr, Tcl_Size line,
|
||||
Tcl_Size count, Tcl_Size *tokensLeftPtr, int line,
|
||||
Tcl_Size *clNextOuter, const char *outerScript);
|
||||
MODULE_SCOPE Tcl_Size TclTrim(const char *bytes, Tcl_Size numBytes,
|
||||
const char *trim, Tcl_Size numTrim,
|
||||
@@ -3739,7 +3690,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, int index, int pathc,
|
||||
Tcl_Obj *part2Ptr, Tcl_Size index, Tcl_Size 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[]);
|
||||
@@ -4030,25 +3981,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, int index);
|
||||
Var *arrayPtr, Tcl_Size index);
|
||||
MODULE_SCOPE Tcl_Obj * TclPtrGetVarIdx(Tcl_Interp *interp,
|
||||
Var *varPtr, Var *arrayPtr, Tcl_Obj *part1Ptr,
|
||||
Tcl_Obj *part2Ptr, int flags, int index);
|
||||
Tcl_Obj *part2Ptr, int flags, Tcl_Size index);
|
||||
MODULE_SCOPE Tcl_Obj * TclPtrSetVarIdx(Tcl_Interp *interp,
|
||||
Var *varPtr, Var *arrayPtr, Tcl_Obj *part1Ptr,
|
||||
Tcl_Obj *part2Ptr, Tcl_Obj *newValuePtr,
|
||||
int flags, int index);
|
||||
int flags, Tcl_Size index);
|
||||
MODULE_SCOPE Tcl_Obj * TclPtrIncrObjVarIdx(Tcl_Interp *interp,
|
||||
Var *varPtr, Var *arrayPtr, Tcl_Obj *part1Ptr,
|
||||
Tcl_Obj *part2Ptr, Tcl_Obj *incrPtr,
|
||||
int flags, int index);
|
||||
int flags, Tcl_Size index);
|
||||
MODULE_SCOPE int TclPtrObjMakeUpvarIdx(Tcl_Interp *interp,
|
||||
Var *otherPtr, Tcl_Obj *myNamePtr, int myFlags,
|
||||
int index);
|
||||
Tcl_Size index);
|
||||
MODULE_SCOPE int TclPtrUnsetVarIdx(Tcl_Interp *interp, Var *varPtr,
|
||||
Var *arrayPtr, Tcl_Obj *part1Ptr,
|
||||
Tcl_Obj *part2Ptr, int flags,
|
||||
int index);
|
||||
Tcl_Size index);
|
||||
MODULE_SCOPE void TclInvalidateNsPath(Namespace *nsPtr);
|
||||
MODULE_SCOPE void TclFindArrayPtrElements(Var *arrayPtr,
|
||||
Tcl_HashTable *tablePtr);
|
||||
@@ -4059,7 +4010,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, int index);
|
||||
int flags, int leaveErrMsg, Tcl_Size index);
|
||||
|
||||
/*
|
||||
* So tclObj.c and tclDictObj.c can share these implementations.
|
||||
@@ -4067,7 +4018,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 TCL_HASH_TYPE TclHashObjKey(Tcl_HashTable *tablePtr, void *keyPtr);
|
||||
MODULE_SCOPE size_t TclHashObjKey(Tcl_HashTable *tablePtr, void *keyPtr);
|
||||
|
||||
MODULE_SCOPE int TclFullFinalizationRequested(void);
|
||||
|
||||
@@ -4143,7 +4094,6 @@ 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)
|
||||
@@ -4546,7 +4496,7 @@ MODULE_SCOPE const TclFileAttrProcs tclpFileAttrProcs[];
|
||||
do { \
|
||||
Tcl_Obj *bignumObj = (objPtr); \
|
||||
int bignumPayload = \
|
||||
PTR2INT(bignumObj->internalRep.twoPtrValue.ptr2); \
|
||||
(int)PTR2INT(bignumObj->internalRep.twoPtrValue.ptr2); \
|
||||
if (bignumPayload == -1) { \
|
||||
(bignum) = *((mp_int *) bignumObj->internalRep.twoPtrValue.ptr1); \
|
||||
} else { \
|
||||
|
||||
+6
-18
@@ -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(TCL_HASH_TYPE size);
|
||||
EXTERN void * TclpAlloc(size_t 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, TCL_HASH_TYPE size);
|
||||
EXTERN void * TclpRealloc(void *ptr, size_t size);
|
||||
/* Slot 82 is reserved */
|
||||
/* Slot 83 is reserved */
|
||||
/* Slot 84 is reserved */
|
||||
@@ -440,8 +440,7 @@ EXTERN Tcl_Obj * TclGetObjNameOfExecutable(void);
|
||||
EXTERN void TclSetObjNameOfExecutable(Tcl_Obj *name,
|
||||
Tcl_Encoding encoding);
|
||||
/* 215 */
|
||||
EXTERN void * TclStackAlloc(Tcl_Interp *interp,
|
||||
TCL_HASH_TYPE numBytes);
|
||||
EXTERN void * TclStackAlloc(Tcl_Interp *interp, size_t numBytes);
|
||||
/* 216 */
|
||||
EXTERN void TclStackFree(Tcl_Interp *interp, void *freePtr);
|
||||
/* 217 */
|
||||
@@ -649,7 +648,7 @@ typedef struct TclIntStubs {
|
||||
void (*reserved66)(void);
|
||||
void (*reserved67)(void);
|
||||
void (*reserved68)(void);
|
||||
void * (*tclpAlloc) (TCL_HASH_TYPE size); /* 69 */
|
||||
void * (*tclpAlloc) (size_t size); /* 69 */
|
||||
void (*reserved70)(void);
|
||||
void (*reserved71)(void);
|
||||
void (*reserved72)(void);
|
||||
@@ -661,7 +660,7 @@ typedef struct TclIntStubs {
|
||||
void (*reserved78)(void);
|
||||
void (*reserved79)(void);
|
||||
void (*reserved80)(void);
|
||||
void * (*tclpRealloc) (void *ptr, TCL_HASH_TYPE size); /* 81 */
|
||||
void * (*tclpRealloc) (void *ptr, size_t size); /* 81 */
|
||||
void (*reserved82)(void);
|
||||
void (*reserved83)(void);
|
||||
void (*reserved84)(void);
|
||||
@@ -795,7 +794,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, TCL_HASH_TYPE numBytes); /* 215 */
|
||||
void * (*tclStackAlloc) (Tcl_Interp *interp, size_t 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 */
|
||||
@@ -1269,17 +1268,6 @@ 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()
|
||||
|
||||
@@ -30,492 +30,6 @@
|
||||
* 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
|
||||
@@ -688,7 +202,6 @@ 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
|
||||
|
||||
+4
-4
@@ -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 PkgName {
|
||||
struct PkgName *nextPtr;/* Next in list of package names being
|
||||
typedef struct PkgNameStruct {
|
||||
struct PkgNameStruct *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(
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
int
|
||||
Tcl_Size
|
||||
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, keyPtr->type,
|
||||
Tcl_LimitRemoveHandler(keyPtr->interp, (int)keyPtr->type,
|
||||
CallScriptLimitCallback, Tcl_GetHashValue(hashPtr));
|
||||
hashPtr = Tcl_NextHashEntry(&search);
|
||||
}
|
||||
|
||||
+2
-2
@@ -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*/,
|
||||
|
||||
+30
-28
@@ -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;
|
||||
|
||||
@@ -2727,7 +2727,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 +2784,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 +3157,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,7 +3550,9 @@ UpdateStringOfList(
|
||||
start = dst = Tcl_InitStringRep(listObj, NULL, bytesNeeded);
|
||||
TclOOM(dst, bytesNeeded);
|
||||
for (i = 0; i < numElems; i++) {
|
||||
flagPtr[i] |= (i ? TCL_DONT_QUOTE_HASH : 0);
|
||||
if (i) {
|
||||
flagPtr[i] |= TCL_DONT_QUOTE_HASH;
|
||||
}
|
||||
elem = TclGetStringFromObj(elemPtrs[i], &length);
|
||||
dst += TclConvertElement(elem, length, dst, flagPtr[i]);
|
||||
*dst++ = ' ';
|
||||
|
||||
+17
-19
@@ -29,9 +29,9 @@
|
||||
*/
|
||||
|
||||
static size_t AddLocalLiteralEntry(CompileEnv *envPtr,
|
||||
Tcl_Obj *objPtr, int localHash);
|
||||
Tcl_Obj *objPtr, size_t localHash);
|
||||
static void ExpandLocalLiteralArray(CompileEnv *envPtr);
|
||||
static size_t HashString(const char *string, size_t length);
|
||||
static size_t HashString(const char *string, Tcl_Size length);
|
||||
#ifdef TCL_COMPILE_DEBUG
|
||||
static LiteralEntry * LookupLiteralEntry(Tcl_Interp *interp,
|
||||
Tcl_Obj *objPtr);
|
||||
@@ -58,8 +58,7 @@ 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)
|
||||
@@ -176,11 +175,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,
|
||||
@@ -389,12 +388,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
|
||||
@@ -440,7 +439,7 @@ TclRegisterLiteral(
|
||||
if (objIndex > INT_MAX) {
|
||||
Tcl_Panic("Literal table index too large. Cannot be handled by TclEmitPush");
|
||||
}
|
||||
return objIndex;
|
||||
return (int)objIndex;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -482,7 +481,7 @@ TclRegisterLiteral(
|
||||
Tcl_Panic(
|
||||
"Literal table index too large. Cannot be handled by TclEmitPush");
|
||||
}
|
||||
return objIndex;
|
||||
return (int)objIndex;
|
||||
}
|
||||
|
||||
#ifdef TCL_COMPILE_DEBUG
|
||||
@@ -647,7 +646,7 @@ TclAddLiteralObj(
|
||||
*litPtrPtr = lPtr;
|
||||
}
|
||||
|
||||
return objIndex;
|
||||
return (int)objIndex;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -673,7 +672,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. */
|
||||
int localHash) /* Hash value for the literal's string. */
|
||||
size_t localHash) /* Hash value for the literal's string. */
|
||||
{
|
||||
LiteralTable *localTablePtr = &envPtr->localLitTable;
|
||||
LiteralEntry *localPtr;
|
||||
@@ -911,8 +910,8 @@ TclReleaseLiteral(
|
||||
|
||||
static size_t
|
||||
HashString(
|
||||
const char *string, /* String for which to compute hash value. */
|
||||
size_t length) /* Number of bytes in the string. */
|
||||
const char *string, /* String for which to compute hash value. */
|
||||
Tcl_Size length) /* Number of bytes in the string. */
|
||||
{
|
||||
size_t result = 0;
|
||||
|
||||
@@ -975,8 +974,7 @@ 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;
|
||||
|
||||
+2
-1
@@ -132,7 +132,8 @@ Tcl_LoadObjCmd(
|
||||
Tcl_DString pfx, tmp, initName, safeInitName;
|
||||
Tcl_DString unloadName, safeUnloadName;
|
||||
InterpLibrary *ipFirstPtr, *ipPtr;
|
||||
int code, namesMatch, filesMatch, offset;
|
||||
int code, namesMatch, filesMatch;
|
||||
Tcl_Size offset;
|
||||
const char *symbols[2];
|
||||
Tcl_LibraryInitProc *initProc;
|
||||
const char *p, *fullFileName, *prefix;
|
||||
|
||||
+2
-2
@@ -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
@@ -2028,8 +2028,7 @@ 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) {
|
||||
@@ -2302,7 +2301,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. */
|
||||
@@ -3744,7 +3743,8 @@ NamespaceForgetCmd(
|
||||
Tcl_Obj *const objv[]) /* Argument objects. */
|
||||
{
|
||||
const char *pattern;
|
||||
int i, result;
|
||||
int i;
|
||||
int 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, result;
|
||||
int firstArg;
|
||||
int i, firstArg;
|
||||
int result;
|
||||
|
||||
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
@@ -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);
|
||||
|
||||
@@ -62,12 +62,8 @@ 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);
|
||||
@@ -98,7 +94,6 @@ 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
|
||||
@@ -115,9 +110,6 @@ 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
@@ -437,7 +437,7 @@ FinalizeMethodRefs(
|
||||
* ----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
int
|
||||
Tcl_Size
|
||||
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) {
|
||||
int isWanted = PTR2INT(Tcl_GetHashValue(hPtr));
|
||||
Tcl_Size isWanted = PTR2INT(Tcl_GetHashValue(hPtr));
|
||||
|
||||
isWanted &= ~NO_IMPLEMENTATION;
|
||||
Tcl_SetHashValue(hPtr, INT2PTR(isWanted));
|
||||
|
||||
@@ -270,14 +270,4 @@ 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 */
|
||||
|
||||
@@ -180,7 +180,7 @@ static const DeclaredSlot slots[] = {
|
||||
* used with Tcl_ObjPrintf().
|
||||
*/
|
||||
|
||||
#define PRIVATE_VARIABLE_PATTERN "%d : %s"
|
||||
#define PRIVATE_VARIABLE_PATTERN "%" TCL_Z_MODIFIER "d : %s"
|
||||
|
||||
/*
|
||||
* ----------------------------------------------------------------------
|
||||
@@ -620,7 +620,7 @@ InstallPrivateVariableMapping(
|
||||
PrivateVariableList *pvlPtr,
|
||||
Tcl_Size varc,
|
||||
Tcl_Obj *const *varv,
|
||||
int creationEpoch)
|
||||
Tcl_Size creationEpoch)
|
||||
{
|
||||
PrivateVariableMapping *privatePtr;
|
||||
Tcl_Size i, n;
|
||||
@@ -2497,7 +2497,6 @@ ClassMixin_Get(
|
||||
}
|
||||
Tcl_SetObjResult(interp, resultObj);
|
||||
return TCL_OK;
|
||||
|
||||
}
|
||||
|
||||
static int
|
||||
@@ -3122,7 +3121,7 @@ ResolveClass(
|
||||
int objc,
|
||||
Tcl_Obj *const *objv)
|
||||
{
|
||||
int idx = Tcl_ObjectContextSkippedArgs(context);
|
||||
Tcl_Size idx = Tcl_ObjectContextSkippedArgs(context);
|
||||
Object *oPtr = (Object *) TclOOGetDefineCmdContext(interp);
|
||||
Class *clsPtr;
|
||||
|
||||
|
||||
+8
-8
@@ -202,7 +202,7 @@ struct PropertyStorage {
|
||||
* exposed by this object or class (in its
|
||||
* stereotypical instances). Contains a sorted
|
||||
* unique list if not NULL. */
|
||||
int epoch; /* The epoch that the caches are valid for. */
|
||||
Tcl_Size 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 int TclOOGetSortedMethodList(Object *oPtr,
|
||||
MODULE_SCOPE Tcl_Size 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))
|
||||
|
||||
|
||||
@@ -561,7 +561,7 @@ InitCmdFrame(
|
||||
|
||||
cfPtr->level = -1;
|
||||
cfPtr->type = context.type;
|
||||
cfPtr->line = (Tcl_Size *) Tcl_Alloc(sizeof(Tcl_Size));
|
||||
cfPtr->line = (int *) Tcl_Alloc(sizeof(int));
|
||||
cfPtr->line[0] = context.line[context.nline - 1];
|
||||
cfPtr->nline = 1;
|
||||
cfPtr->framePtr = NULL;
|
||||
|
||||
+65
-74
@@ -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 = result;
|
||||
*(short *)charPtr = (short)result;
|
||||
return TCL_OK;
|
||||
} else {
|
||||
Tcl_Panic("Wrong bool var for %s", "Tcl_GetBoolFromObj");
|
||||
}
|
||||
}
|
||||
*charPtr = result;
|
||||
*charPtr = (char)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,8 +2814,7 @@ 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);
|
||||
@@ -2825,8 +2824,7 @@ 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;
|
||||
@@ -2854,8 +2852,7 @@ 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;
|
||||
@@ -2900,8 +2897,7 @@ 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. */
|
||||
@@ -2919,8 +2915,7 @@ 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*/)
|
||||
@@ -2949,9 +2944,8 @@ 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)) {
|
||||
@@ -2981,9 +2975,8 @@ 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)) {
|
||||
@@ -3024,10 +3017,9 @@ 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 {
|
||||
@@ -3125,10 +3117,9 @@ 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)) {
|
||||
@@ -3210,9 +3201,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)) {
|
||||
@@ -3274,9 +3265,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);
|
||||
@@ -3586,7 +3577,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);
|
||||
}
|
||||
@@ -3621,7 +3612,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);
|
||||
}
|
||||
@@ -3646,7 +3637,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;
|
||||
@@ -3938,7 +3929,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. */
|
||||
@@ -4011,7 +4002,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. */
|
||||
@@ -4088,16 +4079,17 @@ 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) {
|
||||
@@ -4165,8 +4157,7 @@ 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,
|
||||
|
||||
+10
-13
@@ -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 int ParseHex(const char *src, Tcl_Size numBytes,
|
||||
static Tcl_Size ParseHex(const char *src, Tcl_Size numBytes,
|
||||
int *resultPtr);
|
||||
|
||||
/*
|
||||
@@ -205,8 +205,7 @@ 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. */
|
||||
{
|
||||
@@ -725,7 +724,7 @@ TclParseAllWhiteSpace(
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
int
|
||||
Tcl_Size
|
||||
ParseHex(
|
||||
const char *src, /* First character to parse. */
|
||||
Tcl_Size numBytes, /* Max number of byes to scan */
|
||||
@@ -780,7 +779,7 @@ ParseHex(
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
int
|
||||
Tcl_Size
|
||||
TclParseBackslash(
|
||||
const char *src, /* Points to the backslash character of a
|
||||
* backslash sequence. */
|
||||
@@ -1330,7 +1329,7 @@ Tcl_ParseVarName(
|
||||
{
|
||||
Tcl_Token *tokenPtr;
|
||||
const char *src;
|
||||
int varIndex;
|
||||
Tcl_Size varIndex;
|
||||
unsigned array;
|
||||
|
||||
if (numBytes < 0 && start) {
|
||||
@@ -1619,8 +1618,7 @@ 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
|
||||
@@ -1820,8 +1818,7 @@ 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
|
||||
@@ -2099,10 +2096,10 @@ TclSubstTokens(
|
||||
* evaluate and concatenate. */
|
||||
Tcl_Size count, /* Number of tokens to consider at tokenPtr.
|
||||
* Must be at least 1. */
|
||||
int *tokensLeftPtr, /* If not NULL, points to memory where an
|
||||
Tcl_Size *tokensLeftPtr, /* If not NULL, points to memory where an
|
||||
* integer representing the number of tokens
|
||||
* left to be substituted will be written */
|
||||
Tcl_Size line, /* The line the script starts on. */
|
||||
int 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
|
||||
@@ -2169,7 +2166,7 @@ TclSubstTokens(
|
||||
for (; count>0 && code==TCL_OK ; count--, tokenPtr++) {
|
||||
Tcl_Obj *appendObj = NULL;
|
||||
const char *append = NULL;
|
||||
int appendByteLength = 0;
|
||||
Tcl_Size appendByteLength = 0;
|
||||
char utfCharBytes[4] = "";
|
||||
|
||||
switch (tokenPtr->type) {
|
||||
|
||||
+16
-16
@@ -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;
|
||||
|
||||
+1
-2
@@ -194,7 +194,6 @@ Tcl_DetachPids(
|
||||
detList = detPtr;
|
||||
}
|
||||
Tcl_MutexUnlock(&pipeMutex);
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -330,7 +329,7 @@ TclCleanupChildren(
|
||||
*/
|
||||
|
||||
if (interp != NULL) {
|
||||
int count;
|
||||
Tcl_Size count;
|
||||
Tcl_Obj *objPtr;
|
||||
|
||||
Tcl_Seek(errorChan, 0, SEEK_SET);
|
||||
|
||||
+10
-10
@@ -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, int reqc,
|
||||
static int CheckAllRequirements(Tcl_Interp *interp, Tcl_Size reqc,
|
||||
Tcl_Obj *const reqv[]);
|
||||
static int RequirementSatisfied(char *havei, const char *req);
|
||||
static int SomeRequirementSatisfied(char *havei, int reqc,
|
||||
static int SomeRequirementSatisfied(char *havei, Tcl_Size reqc,
|
||||
Tcl_Obj *const reqv[]);
|
||||
static void AddRequirementsToResult(Tcl_Interp *interp, int reqc,
|
||||
static void AddRequirementsToResult(Tcl_Interp *interp, Tcl_Size 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];
|
||||
int reqc = (int)PTR2INT(data[1]), satisfies;
|
||||
Tcl_Size reqc = 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];
|
||||
int reqc = (int)PTR2INT(data[1]);
|
||||
Tcl_Size reqc = 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,
|
||||
int reqc, /* Requirements to check. */
|
||||
Tcl_Size reqc, /* Requirements to check. */
|
||||
Tcl_Obj *const reqv[])
|
||||
{
|
||||
int i;
|
||||
Tcl_Size 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,
|
||||
int reqc, /* Requirements constraining the desired
|
||||
Tcl_Size 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. */
|
||||
int reqc, /* Requirements constraining the desired
|
||||
Tcl_Size reqc, /* Requirements constraining the desired
|
||||
* version. */
|
||||
Tcl_Obj *const reqv[]) /* 0 means to use the latest version
|
||||
* available. */
|
||||
{
|
||||
int i;
|
||||
Tcl_Size i;
|
||||
|
||||
for (i = 0; i < reqc; i++) {
|
||||
if (RequirementSatisfied(availVersionI, TclGetString(reqv[i]))) {
|
||||
|
||||
@@ -48,94 +48,6 @@
|
||||
# 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
|
||||
@@ -193,8 +105,6 @@ 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)
|
||||
@@ -213,8 +123,6 @@ 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
|
||||
@@ -223,6 +131,5 @@ extern const TclPlatStubs *tclPlatStubsPtr;
|
||||
#define Tcl_WinTCharToUtf(string, len, dsPtr) (Tcl_DStringInit(dsPtr), \
|
||||
(char *)Tcl_Char16ToUtfDString((const unsigned short *)(string), ((((len) + 2) >> 1) - 1), (dsPtr)))
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif /* _TCLPLATDECLS */
|
||||
|
||||
+6
-5
@@ -272,7 +272,7 @@ Tcl_ProcObjCmd(
|
||||
|
||||
cfPtr->level = -1;
|
||||
cfPtr->type = contextPtr->type;
|
||||
cfPtr->line = (Tcl_Size *)Tcl_Alloc(sizeof(Tcl_Size));
|
||||
cfPtr->line = (int *)Tcl_Alloc(sizeof(int));
|
||||
cfPtr->line[0] = contextPtr->line[3];
|
||||
cfPtr->nline = 1;
|
||||
cfPtr->framePtr = NULL;
|
||||
@@ -777,7 +777,8 @@ TclObjGetFrame(
|
||||
* global frame indicated). */
|
||||
{
|
||||
Interp *iPtr = (Interp *) interp;
|
||||
int curLevel, level, result;
|
||||
int curLevel;
|
||||
int result, level;
|
||||
const Tcl_ObjInternalRep *irPtr;
|
||||
const char *name = NULL;
|
||||
Tcl_WideInt w;
|
||||
@@ -1645,7 +1646,7 @@ TclNRInterpProc(
|
||||
}
|
||||
return TclNRInterpProcCore(interp, objv[0], 1, &MakeProcError);
|
||||
}
|
||||
|
||||
|
||||
static int
|
||||
NRInterpProc(
|
||||
void *clientData, /* Record describing procedure to be
|
||||
@@ -2559,7 +2560,7 @@ SetLambdaFromAny(
|
||||
|
||||
if (contextPtr->line
|
||||
&& (contextPtr->nline >= 2) && (contextPtr->line[1] >= 0)) {
|
||||
Tcl_Size buf[2];
|
||||
int buf[2];
|
||||
|
||||
/*
|
||||
* Move from approximation (line of list cmd word) to actual
|
||||
@@ -2571,7 +2572,7 @@ SetLambdaFromAny(
|
||||
|
||||
cfPtr->level = -1;
|
||||
cfPtr->type = contextPtr->type;
|
||||
cfPtr->line = (Tcl_Size *)Tcl_Alloc(sizeof(Tcl_Size));
|
||||
cfPtr->line = (int *)Tcl_Alloc(sizeof(int));
|
||||
cfPtr->line[0] = buf[1];
|
||||
cfPtr->nline = 1;
|
||||
cfPtr->framePtr = NULL;
|
||||
|
||||
@@ -26,7 +26,7 @@ static int autopurge = 1; /* Autopurge flag. */
|
||||
|
||||
typedef struct ProcessInfo {
|
||||
Tcl_Pid pid; /* Process id. */
|
||||
int resolvedPid; /* Resolved process id. */
|
||||
Tcl_Size resolvedPid; /* Resolved process id. */
|
||||
int purge; /* Purge eventualy. */
|
||||
TclProcessWaitStatus status;/* Process status. */
|
||||
int code; /* Error code, exit status or signal
|
||||
|
||||
+2
-1
@@ -863,7 +863,8 @@ CompileRegexp(
|
||||
{
|
||||
TclRegexp *regexpPtr;
|
||||
const Tcl_UniChar *uniString;
|
||||
int numChars, status, i, exact;
|
||||
int status, i, exact;
|
||||
Tcl_Size numChars;
|
||||
Tcl_DString stringBuf;
|
||||
ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey);
|
||||
|
||||
|
||||
@@ -65,7 +65,7 @@ Tcl_AddInterpResolvers(
|
||||
{
|
||||
Interp *iPtr = (Interp *) interp;
|
||||
ResolverScheme *resPtr;
|
||||
unsigned len;
|
||||
size_t len;
|
||||
|
||||
/*
|
||||
* Since we're adding a new name resolution scheme, we must force all code
|
||||
|
||||
+2
-2
@@ -807,7 +807,7 @@ TclProcessReturn(
|
||||
int
|
||||
TclMergeReturnOptions(
|
||||
Tcl_Interp *interp, /* Current interpreter. */
|
||||
int objc, /* Number of arguments. */
|
||||
Tcl_Size 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
|
||||
@@ -1034,7 +1034,7 @@ Tcl_GetReturnOptions(
|
||||
|
||||
if (result == TCL_ERROR) {
|
||||
if (!iPtr->errorInfo) {
|
||||
/*
|
||||
/*
|
||||
* No errorLine without errorInfo, e. g. (re)thrown only message,
|
||||
* this shall also avoid transfer of errorLine (if goes to child
|
||||
* interp), because we have anyway nothing excepting message
|
||||
|
||||
+46
-3
@@ -724,7 +724,7 @@ Tcl_GetRange(
|
||||
Tcl_Size last) /* Last index of the range. */
|
||||
{
|
||||
Tcl_Obj *newObjPtr; /* The Tcl object to return that is the new
|
||||
* range. */
|
||||
* range. */
|
||||
String *stringPtr;
|
||||
Tcl_Size length = 0;
|
||||
|
||||
@@ -803,8 +803,8 @@ TclGetRange(
|
||||
Tcl_Size first, /* First index of the range. */
|
||||
Tcl_Size last) /* Last index of the range. */
|
||||
{
|
||||
Tcl_Obj *newObjPtr; /* The Tcl object to return that is the new
|
||||
* range. */
|
||||
Tcl_Obj *newObjPtr; /* The Tcl object to return that is the new
|
||||
* range. */
|
||||
Tcl_Size length = 0;
|
||||
|
||||
if (first < 0) {
|
||||
@@ -4364,6 +4364,49 @@ 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;
|
||||
}
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -850,9 +850,9 @@ const TclStubs tclStubs = {
|
||||
Tcl_DbNewStringObj, /* 28 */
|
||||
Tcl_DuplicateObj, /* 29 */
|
||||
TclFreeObj, /* 30 */
|
||||
Tcl_GetBoolean, /* 31 */
|
||||
Tcl_GetBooleanFromObj, /* 32 */
|
||||
Tcl_GetByteArrayFromObj, /* 33 */
|
||||
0, /* 31 */
|
||||
0, /* 32 */
|
||||
0, /* 33 */
|
||||
Tcl_GetDouble, /* 34 */
|
||||
Tcl_GetDoubleFromObj, /* 35 */
|
||||
0, /* 36 */
|
||||
@@ -900,7 +900,7 @@ const TclStubs tclStubs = {
|
||||
Tcl_BadChannelOption, /* 78 */
|
||||
Tcl_CallWhenDeleted, /* 79 */
|
||||
Tcl_CancelIdleCall, /* 80 */
|
||||
Tcl_Close, /* 81 */
|
||||
0, /* 81 */
|
||||
Tcl_CommandComplete, /* 82 */
|
||||
Tcl_Concat, /* 83 */
|
||||
Tcl_ConvertElement, /* 84 */
|
||||
@@ -1509,7 +1509,8 @@ const TclStubs tclStubs = {
|
||||
Tcl_UtfNcasecmp, /* 687 */
|
||||
Tcl_NewWideUIntObj, /* 688 */
|
||||
Tcl_SetWideUIntObj, /* 689 */
|
||||
TclUnusedStubEntry, /* 690 */
|
||||
Tcl_IsEmpty, /* 690 */
|
||||
TclUnusedStubEntry, /* 691 */
|
||||
};
|
||||
|
||||
/* !END!: Do not edit above this line. */
|
||||
|
||||
+62
-69
@@ -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 = PTR2INT(clientData);
|
||||
int id = (int)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 = PTR2INT(clientData);
|
||||
int id = (int)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 = PTR2INT(clientData);
|
||||
int id = (int)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,12 +2039,8 @@ TestdstringCmd(
|
||||
*/
|
||||
|
||||
static void SpecialFree(
|
||||
#if TCL_MAJOR_VERSION > 8
|
||||
void *blockPtr /* Block to free. */
|
||||
#else
|
||||
char *blockPtr /* Block to free. */
|
||||
#endif
|
||||
) {
|
||||
void *blockPtr) /* Block to free. */
|
||||
{
|
||||
Tcl_Free(((char *)blockPtr) - 16);
|
||||
}
|
||||
|
||||
@@ -2182,11 +2178,10 @@ 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) {
|
||||
@@ -2376,7 +2371,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*/,
|
||||
@@ -2408,7 +2403,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*/,
|
||||
@@ -2440,7 +2435,7 @@ EncodingFromUtfProc(
|
||||
|
||||
static void
|
||||
EncodingFreeProc(
|
||||
void *clientData) /* ClientData associated with type. */
|
||||
void *clientData) /* ClientData associated with type. */
|
||||
{
|
||||
TclEncoding *encodingPtr = (TclEncoding *)clientData;
|
||||
|
||||
@@ -2699,7 +2694,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 */
|
||||
@@ -2772,7 +2767,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;
|
||||
@@ -2786,7 +2781,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;
|
||||
@@ -2989,7 +2984,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");
|
||||
@@ -3661,9 +3656,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
|
||||
@@ -3780,9 +3775,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[] = {
|
||||
@@ -3994,7 +3989,7 @@ TestlocaleCmd(
|
||||
|
||||
static void
|
||||
CleanupTestSetassocdataTests(
|
||||
void *clientData, /* Data to be released. */
|
||||
void *clientData, /* Data to be released. */
|
||||
TCL_UNUSED(Tcl_Interp *))
|
||||
{
|
||||
Tcl_Free(clientData);
|
||||
@@ -4635,8 +4630,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 */
|
||||
{
|
||||
@@ -5798,12 +5793,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 = PTR2INT(data);
|
||||
int flags = (int)PTR2INT(data);
|
||||
const char *value;
|
||||
|
||||
if (objc == 2) {
|
||||
@@ -5829,12 +5824,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 = PTR2INT(data);
|
||||
int flags = (int)PTR2INT(data);
|
||||
const char *value;
|
||||
|
||||
if (objc == 3) {
|
||||
@@ -5879,7 +5874,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)
|
||||
{
|
||||
@@ -6008,7 +6003,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 */
|
||||
@@ -6708,7 +6703,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..?");
|
||||
@@ -6823,7 +6818,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;
|
||||
@@ -7604,8 +7599,7 @@ 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 ;
|
||||
@@ -8347,11 +8341,9 @@ 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)
|
||||
*
|
||||
@@ -8433,7 +8425,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;
|
||||
@@ -8595,10 +8587,11 @@ 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];
|
||||
|
||||
+15
-15
@@ -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;
|
||||
int bytesNeeded = 0;
|
||||
int llen, i;
|
||||
Tcl_Size bytesNeeded = 0;
|
||||
Tcl_Size 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;
|
||||
|
||||
/*
|
||||
|
||||
+44
-17
@@ -46,6 +46,7 @@ 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
|
||||
@@ -133,6 +134,8 @@ 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);
|
||||
@@ -590,7 +593,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;
|
||||
|
||||
@@ -918,8 +921,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;
|
||||
|
||||
@@ -1079,13 +1082,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
|
||||
};
|
||||
|
||||
@@ -1490,7 +1493,7 @@ TeststringobjCmd(
|
||||
}
|
||||
Tcl_SetWideIntObj(Tcl_GetObjResult(interp), length);
|
||||
break;
|
||||
case 10: { /* range */
|
||||
case 10: { /* range */
|
||||
Tcl_Size first, last;
|
||||
if (objc != 5) {
|
||||
goto wrongNumArgs;
|
||||
@@ -1564,7 +1567,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;
|
||||
@@ -1610,9 +1613,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
|
||||
@@ -1667,7 +1670,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' + (i % PATTERN_LEN);
|
||||
s[i] = '0' + (char)(i % PATTERN_LEN);
|
||||
}
|
||||
if (split >= 0) {
|
||||
assert(split < len);
|
||||
@@ -1679,7 +1682,7 @@ TestbigdataCmd (
|
||||
objPtr = Tcl_NewByteArrayObj(NULL, len);
|
||||
p = Tcl_GetByteArrayFromObj(objPtr, &len);
|
||||
for (i = 0; i < len; ++i) {
|
||||
p[i] = '0' + (i % PATTERN_LEN);
|
||||
p[i] = (char)('0' + (i % PATTERN_LEN));
|
||||
}
|
||||
if (split >= 0) {
|
||||
assert(split < len);
|
||||
@@ -1828,6 +1831,30 @@ 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
|
||||
|
||||
@@ -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;
|
||||
|
||||
+3
-4
@@ -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,7 +109,6 @@ Tcl_GetThreadData(
|
||||
void *
|
||||
TclThreadDataKeyGet(
|
||||
Tcl_ThreadDataKey *keyPtr) /* Identifier for the data chunk. */
|
||||
|
||||
{
|
||||
#if TCL_THREADS
|
||||
return TclThreadStorageKeyGet(keyPtr);
|
||||
|
||||
@@ -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;
|
||||
|
||||
/*
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -101,7 +101,6 @@ typedef struct ThreadEventResult {
|
||||
struct ThreadEvent *eventPtr; /* Back pointer */
|
||||
struct ThreadEventResult *nextPtr; /* List for cleanup */
|
||||
struct ThreadEventResult *prevPtr;
|
||||
|
||||
} ThreadEventResult;
|
||||
|
||||
static ThreadEventResult *resultList;
|
||||
|
||||
+9
-9
@@ -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 = strtoul(cmdString, &end, 10);
|
||||
id = (int)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
@@ -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))) {
|
||||
unsigned len = strlen(command) + 1;
|
||||
size_t 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) {
|
||||
if (objc > INT_MAX || objc < 0) {
|
||||
objc = -1; /* Signal Tcl_CmdObjTraceProc that objc is out of range */
|
||||
}
|
||||
return info->proc(info->clientData, interp, (int)level, command, commandInfo, objc, objv);
|
||||
return info->proc(info->clientData, interp, (int)level, command, commandInfo, (int)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, level, (char *) command,
|
||||
cmdPtr->proc, cmdPtr->clientData, objc, argv);
|
||||
data->proc(data->clientData, interp, (int)level, (char *) command,
|
||||
cmdPtr->proc, cmdPtr->clientData, (int)objc, argv);
|
||||
TclStackFree(interp, (void *) argv);
|
||||
|
||||
return TCL_OK;
|
||||
@@ -2393,7 +2393,7 @@ TclCheckArrayTraces(
|
||||
Var *varPtr,
|
||||
Var *arrayPtr,
|
||||
Tcl_Obj *name,
|
||||
int index)
|
||||
Tcl_Size 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. */
|
||||
int index) /* Index into the local variable table of the
|
||||
Tcl_Size 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 == ')') {
|
||||
int offset = (openParen - part1);
|
||||
Tcl_Size 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
@@ -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 = ((src[1] & 0x0F) << 6) + (src[2] & 0x3F) + 0xDC00;
|
||||
*chPtr = (unsigned short)(((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 = 0xD800 + high;
|
||||
*chPtr = (unsigned short)(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 = Tcl_UniCharToLower(ch1);
|
||||
ch2 = Tcl_UniCharToLower(ch2);
|
||||
ch1 = (unsigned short)Tcl_UniCharToLower(ch1);
|
||||
ch2 = (unsigned short)Tcl_UniCharToLower(ch2);
|
||||
if (ch1 != ch2) {
|
||||
return (ch1 - ch2);
|
||||
}
|
||||
|
||||
+59
-57
@@ -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,7 +1627,9 @@ Tcl_Merge(
|
||||
result = (char *)Tcl_Alloc(bytesNeeded);
|
||||
dst = result;
|
||||
for (i = 0; i < argc; i++) {
|
||||
flagPtr[i] |= ( i ? DONT_QUOTE_HASH : 0 );
|
||||
if (i) {
|
||||
flagPtr[i] |= DONT_QUOTE_HASH;
|
||||
}
|
||||
dst += TclConvertElement(argv[i], TCL_INDEX_NONE, dst, flagPtr[i]);
|
||||
*dst = ' ';
|
||||
dst++;
|
||||
@@ -1659,14 +1661,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;
|
||||
@@ -1738,14 +1740,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;
|
||||
@@ -1812,14 +1814,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;
|
||||
@@ -1874,7 +1876,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;
|
||||
@@ -2121,8 +2123,8 @@ Tcl_StringCaseMatch(
|
||||
* characters. */
|
||||
int nocase) /* 0 for case sensitive, 1 for insensitive */
|
||||
{
|
||||
int p, charLen;
|
||||
int ch1 = 0, ch2 = 0;
|
||||
Tcl_Size charLen;
|
||||
int p, ch1 = 0, ch2 = 0;
|
||||
|
||||
while (1) {
|
||||
p = *pattern;
|
||||
@@ -2352,11 +2354,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;
|
||||
@@ -2770,7 +2772,7 @@ Tcl_DStringAppendElement(
|
||||
memcpy(newString, dsPtr->string, dsPtr->length);
|
||||
dsPtr->string = newString;
|
||||
} else {
|
||||
int offset = -1;
|
||||
Tcl_Size offset = -1;
|
||||
|
||||
/* See [16896d49fd] */
|
||||
if (element >= dsPtr->string
|
||||
@@ -2824,7 +2826,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;
|
||||
|
||||
@@ -3313,7 +3315,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;
|
||||
@@ -3375,14 +3377,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;
|
||||
@@ -3510,10 +3512,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;
|
||||
@@ -3809,11 +3811,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;
|
||||
@@ -3896,7 +3898,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
|
||||
@@ -3955,8 +3957,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;
|
||||
@@ -3985,8 +3987,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) {
|
||||
|
||||
+23
-19
@@ -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, int index);
|
||||
Var *varPtr, int flags, Tcl_Size 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, int index);
|
||||
Tcl_Obj *myNamePtr, int myFlags, Tcl_Size 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, int index);
|
||||
Tcl_Obj *part2Ptr, int flags, Tcl_Size 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, int *indexPtr);
|
||||
const char **errMsgPtr, Tcl_Size *indexPtr);
|
||||
|
||||
static Tcl_DupInternalRepProc DupLocalVarName;
|
||||
static Tcl_FreeInternalRepProc FreeLocalVarName;
|
||||
@@ -607,7 +607,8 @@ TclObjLookupVarEx(
|
||||
Var *varPtr; /* Points to the variable's in-frame Var
|
||||
* structure. */
|
||||
const char *errMsg = NULL;
|
||||
int index, parsed = 0;
|
||||
Tcl_Size index;
|
||||
int parsed = 0;
|
||||
|
||||
Tcl_Size localIndex;
|
||||
Tcl_Obj *namePtr, *arrayPtr, *elem;
|
||||
@@ -831,7 +832,7 @@ TclLookupSimpleVar(
|
||||
* if it doesn't already exist. If 0, return
|
||||
* error if it doesn't exist. */
|
||||
const char **errMsgPtr,
|
||||
int *indexPtr)
|
||||
Tcl_Size *indexPtr)
|
||||
{
|
||||
Interp *iPtr = (Interp *) interp;
|
||||
CallFrame *varFramePtr = iPtr->varFramePtr;
|
||||
@@ -1072,7 +1073,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. */
|
||||
int index) /* If >=0, the index of the local array. */
|
||||
Tcl_Size index) /* If >=0, the index of the local array. */
|
||||
{
|
||||
int isNew;
|
||||
Var *varPtr;
|
||||
@@ -1384,7 +1385,7 @@ TclPtrGetVarIdx(
|
||||
* in the array part1. */
|
||||
int flags, /* OR-ed combination of TCL_GLOBAL_ONLY, and
|
||||
* TCL_LEAVE_ERR_MSG bits. */
|
||||
int index) /* Index into the local variable table of the
|
||||
Tcl_Size index) /* Index into the local variable table of the
|
||||
* variable, or -1. Only used when part1Ptr is
|
||||
* NULL. */
|
||||
{
|
||||
@@ -1912,7 +1913,7 @@ TclPtrSetVarIdx(
|
||||
Tcl_Obj *newValuePtr, /* New value for variable. */
|
||||
int flags, /* OR-ed combination of TCL_GLOBAL_ONLY, and
|
||||
* TCL_LEAVE_ERR_MSG bits. */
|
||||
int index) /* Index of local var where part1 is to be
|
||||
Tcl_Size index) /* Index of local var where part1 is to be
|
||||
* found. */
|
||||
{
|
||||
Interp *iPtr = (Interp *) interp;
|
||||
@@ -2229,7 +2230,7 @@ TclPtrIncrObjVarIdx(
|
||||
* any of TCL_GLOBAL_ONLY, TCL_NAMESPACE_ONLY,
|
||||
* TCL_APPEND_VALUE, TCL_LIST_ELEMENT,
|
||||
* TCL_LEAVE_ERR_MSG. */
|
||||
int index) /* Index into the local variable table of the
|
||||
Tcl_Size index) /* Index into the local variable table of the
|
||||
* variable, or -1. Only used when part1Ptr is
|
||||
* NULL. */
|
||||
{
|
||||
@@ -2464,7 +2465,7 @@ TclPtrUnsetVarIdx(
|
||||
int flags, /* OR-ed combination of any of
|
||||
* TCL_GLOBAL_ONLY, TCL_NAMESPACE_ONLY,
|
||||
* TCL_LEAVE_ERR_MSG. */
|
||||
int index) /* Index into the local variable table of the
|
||||
Tcl_Size index) /* Index into the local variable table of the
|
||||
* variable, or -1. Only used when part1Ptr is
|
||||
* NULL. */
|
||||
{
|
||||
@@ -2550,7 +2551,7 @@ UnsetVarStruct(
|
||||
Tcl_Obj *part1Ptr,
|
||||
Tcl_Obj *part2Ptr,
|
||||
int flags,
|
||||
int index)
|
||||
Tcl_Size index)
|
||||
{
|
||||
Var dummyVar;
|
||||
int traced = TclIsVarTraced(varPtr)
|
||||
@@ -2735,7 +2736,8 @@ Tcl_UnsetObjCmd(
|
||||
int objc, /* Number of arguments. */
|
||||
Tcl_Obj *const objv[]) /* Argument objects. */
|
||||
{
|
||||
int i, flags = TCL_LEAVE_ERR_MSG;
|
||||
int i;
|
||||
int flags = TCL_LEAVE_ERR_MSG;
|
||||
const char *name;
|
||||
|
||||
if (objc == 1) {
|
||||
@@ -4486,7 +4488,7 @@ ObjMakeUpvar(
|
||||
* otherP1/otherP2. Must be a scalar. */
|
||||
int myFlags, /* 0, TCL_GLOBAL_ONLY or TCL_NAMESPACE_ONLY:
|
||||
* indicates scope of myName. */
|
||||
int index) /* If the variable to be linked is an indexed
|
||||
Tcl_Size index) /* If the variable to be linked is an indexed
|
||||
* scalar, this is its index. Otherwise, -1 */
|
||||
{
|
||||
Interp *iPtr = (Interp *) interp;
|
||||
@@ -4616,7 +4618,7 @@ TclPtrObjMakeUpvarIdx(
|
||||
* otherP1/otherP2. Must be a scalar. */
|
||||
int myFlags, /* 0, TCL_GLOBAL_ONLY or TCL_NAMESPACE_ONLY:
|
||||
* indicates scope of myName. */
|
||||
int index) /* If the variable to be linked is an indexed
|
||||
Tcl_Size index) /* If the variable to be linked is an indexed
|
||||
* scalar, this is its index. Otherwise, -1 */
|
||||
{
|
||||
Interp *iPtr = (Interp *) interp;
|
||||
@@ -4944,7 +4946,8 @@ Tcl_GlobalObjCmd(
|
||||
Tcl_Obj *objPtr, *tailPtr;
|
||||
const char *varName;
|
||||
const char *tail;
|
||||
int result, i;
|
||||
int result;
|
||||
int i;
|
||||
|
||||
/*
|
||||
* If we are not executing inside a Tcl procedure, just return.
|
||||
@@ -5048,7 +5051,8 @@ Tcl_VariableObjCmd(
|
||||
const char *varName, *tail, *cp;
|
||||
Var *varPtr, *arrayPtr;
|
||||
Tcl_Obj *varValuePtr;
|
||||
int i, result;
|
||||
int i;
|
||||
int result;
|
||||
Tcl_Obj *varNamePtr, *tailPtr;
|
||||
|
||||
for (i=1 ; i<objc ; i+=2) {
|
||||
@@ -5577,7 +5581,7 @@ DeleteArray(
|
||||
int flags, /* Flags to pass to TclCallVarTraces:
|
||||
* TCL_TRACE_UNSETS and sometimes
|
||||
* TCL_NAMESPACE_ONLY or TCL_GLOBAL_ONLY. */
|
||||
int index)
|
||||
Tcl_Size index)
|
||||
{
|
||||
Tcl_HashSearch search;
|
||||
Tcl_HashEntry *tPtr;
|
||||
@@ -5694,7 +5698,7 @@ TclObjVarErrMsg(
|
||||
const char *operation, /* String describing operation that failed,
|
||||
* e.g. "read", "set", or "unset". */
|
||||
const char *reason, /* String describing why operation failed. */
|
||||
int index) /* Index into the local variable table of the
|
||||
Tcl_Size index) /* Index into the local variable table of the
|
||||
* variable, or -1. Only used when part1Ptr is
|
||||
* NULL. */
|
||||
{
|
||||
|
||||
+2
-3
@@ -3883,8 +3883,7 @@ 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
|
||||
@@ -5634,7 +5633,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;
|
||||
|
||||
@@ -1,12 +1,5 @@
|
||||
if {![package vsatisfies [package provide Tcl] 9.0-]} return
|
||||
if {[info sharedlibextension] != ".dll"} return
|
||||
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]
|
||||
}
|
||||
package ifneeded dde 1.5a0 \
|
||||
[list load [file join $dir tcl9dde15.dll] Dde]
|
||||
|
||||
|
||||
+1
-1
@@ -15,7 +15,7 @@
|
||||
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
#
|
||||
|
||||
package require -exact tcl 9.0.2
|
||||
package require -exact tcl 9.1a0
|
||||
|
||||
# Compute the auto path to use in this interpreter.
|
||||
# The values on the path come from several locations:
|
||||
|
||||
@@ -1,9 +1,4 @@
|
||||
if {![package vsatisfies [package provide Tcl] 8.5-]} return
|
||||
if {![package vsatisfies [package provide Tcl] 9.0-]} return
|
||||
if {[info sharedlibextension] != ".dll"} return
|
||||
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]
|
||||
}
|
||||
package ifneeded registry 1.4a0 \
|
||||
[list load [file join $dir tcl9registry14.dll] Registry]
|
||||
|
||||
+2
-2
@@ -92,9 +92,9 @@ Detailed Instructions for building with macosx/GNUmakefile
|
||||
- Unpack the Tcl source release archive.
|
||||
|
||||
- The following instructions assume the Tcl source tree is named "tcl${ver}",
|
||||
(where ${ver} is a shell variable containing the Tcl version number e.g. '9.0').
|
||||
(where ${ver} is a shell variable containing the Tcl version number e.g. '9.1').
|
||||
Setup this shell variable as follows:
|
||||
ver="9.0"
|
||||
ver="9.1"
|
||||
|
||||
- Setup environment variables as desired, e.g. for a universal build on 10.9:
|
||||
CFLAGS="-arch x86_64 -arch arm64 -mmacosx-version-min=10.9"
|
||||
|
||||
@@ -70,11 +70,11 @@ static int SetOSTypeFromAny(Tcl_Interp *interp, Tcl_Obj *objPtr);
|
||||
static void UpdateStringOfOSType(Tcl_Obj *objPtr);
|
||||
|
||||
static const Tcl_ObjType tclOSTypeType = {
|
||||
"osType", /* name */
|
||||
NULL, /* freeIntRepProc */
|
||||
NULL, /* dupIntRepProc */
|
||||
UpdateStringOfOSType, /* updateStringProc */
|
||||
SetOSTypeFromAny, /* setFromAnyProc */
|
||||
"osType", /* name */
|
||||
NULL, /* freeIntRepProc */
|
||||
NULL, /* dupIntRepProc */
|
||||
UpdateStringOfOSType, /* updateStringProc */
|
||||
SetOSTypeFromAny, /* setFromAnyProc */
|
||||
TCL_OBJTYPE_V0
|
||||
};
|
||||
|
||||
@@ -118,10 +118,10 @@ typedef struct {
|
||||
|
||||
int
|
||||
TclMacOSXGetFileAttribute(
|
||||
Tcl_Interp *interp, /* The interp we are using for errors. */
|
||||
int objIndex, /* The index of the attribute. */
|
||||
Tcl_Obj *fileName, /* The name of the file (UTF-8). */
|
||||
Tcl_Obj **attributePtrPtr) /* A pointer to return the object with. */
|
||||
Tcl_Interp *interp, /* The interp we are using for errors. */
|
||||
int objIndex, /* The index of the attribute. */
|
||||
Tcl_Obj *fileName, /* The name of the file (UTF-8). */
|
||||
Tcl_Obj **attributePtrPtr) /* A pointer to return the object with. */
|
||||
{
|
||||
#ifdef HAVE_GETATTRLIST
|
||||
int result;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user