Compare commits

...
Author SHA1 Message Date
jan.nijtmans 24a416ad38 Merge 8.7 2020-02-26 10:58:01 +00:00
jan.nijtmans 5c61b2bbdc Merge 8.6 2020-02-26 08:04:34 +00:00
jan.nijtmans 14276a3feb Make tclWinDde.c compilable with C++ compiler. dde -> 1.4.3
Make tclWinReg.c compilable with C++ compiler. registry -> 1.3.5
2020-02-26 07:58:38 +00:00
jan.nijtmans 9eeda3feb2 Make tclWinDde.c compilable with C++ compiler. dde -> 1.4.3
Make tclWinReg.c compilable with C++ compiler. registry -> 1.3.5
2020-02-26 07:51:52 +00:00
dkf 1eeefb073a Ensure that we release the correct references when an error occurs during setting a class's superclasses 2020-02-25 15:07:51 +00:00
jan.nijtmans f0ead2e309 merge-mark 2020-02-24 13:16:53 +00:00
jan.nijtmans 0c37363fff Correct ANSI prototype of TclNokia770Doubles() 2020-02-24 13:07:13 +00:00
jan.nijtmans c7814dd59f Merge 8.6 2020-02-24 12:18:31 +00:00
jan.nijtmans 730152b608 Merge 8.5 2020-02-24 12:01:04 +00:00
jan.nijtmans 904ba06b0a Add -Wpointer-arith warning to C-compile. Fix gcc(-9) warning. 2020-02-24 11:07:18 +00:00
dkf fc3487d2b2 typo fix 2020-02-22 12:34:14 +00:00
jan.nijtmans 5eb39e3973 Fix [da235271f1]: [info hostname] on Windows is limited to max NetBIOS name length 2020-02-21 09:25:03 +00:00
jan.nijtmans 5c1a56d36b Merge 8.6 2020-02-21 08:52:54 +00:00
jan.nijtmans 1fb8e115c4 Restore compatibility with older (mingw) Makefiles. Fix for [4b5deacc70]: undefined reference to `Tcl_SetStartupScript'. 2020-02-21 08:46:15 +00:00
sebres e2bcebca79 merge 8.5 2020-02-17 14:52:54 +00:00
sebres 471091f55a windows: avoid create of legacy error-vars on init phase (in fresh created interpreter) - no tcl_pkgPath variable on windows 2020-02-17 14:50:45 +00:00
jan.nijtmans 958180f361 Merge-mark 2020-02-14 09:23:42 +00:00
jan.nijtmans 5c380477df (cherry-pick): Fix travis build, due to the change of Windows image. 2020-02-14 09:21:44 +00:00
jan.nijtmans 8c3eb78cf7 Merge 8.7 2020-02-13 22:06:10 +00:00
jan.nijtmans 73cc9cd62f Merge 8.6 2020-02-12 13:18:27 +00:00
jan.nijtmans c11eec4d5d Fix travis build, due to the change of Windows image. 2020-02-12 13:12:08 +00:00
jan.nijtmans 0f3e54cedb Move build from xenial to bionic. Add Xcode11.3 build for MacOS (now that we are on it anyway) 2020-02-11 16:38:45 +00:00
jan.nijtmans 2a89abd783 Attempt to fix travis build. See: [https://travis-ci.community/t/vcvarsall-bat-freezes-on-new-1809-based-windows-images/7098] 2020-02-11 15:59:38 +00:00
jan.nijtmans 55b841549a merge-mark 2020-02-05 16:41:25 +00:00
jan.nijtmans b1791f0b92 (cherry-pick): It appears that inttypes.h was introduced in Visual Studio 2013 2020-02-05 16:40:19 +00:00
jan.nijtmans 517974e23b Merge 8.6 2020-02-04 11:04:28 +00:00
jan.nijtmans 6f55ec4986 Clean up some usage of DBGX: It isn't used any more on UNIX 2020-02-04 11:03:12 +00:00
jan.nijtmans 225b4e7cc0 It appears that inttypes.h was introduced in Visual Studio 2013 2020-02-04 08:28:07 +00:00
jan.nijtmans 4ee1ddaeaa TclInitBignumFromWide(U)Int is not used any more. 2020-02-02 16:26:36 +00:00
jan.nijtmans f06c1e0ba4 Fix conflict between (unpatched) tommath.h and tcl.h. See also [https://github.com/libtom/libtommath/pull/473] 2020-02-02 15:24:58 +00:00
jan.nijtmans cac60f04fc Add 64-bit seek to the ZipChannel 2020-01-31 07:54:59 +00:00
sebres 944694962a merge 8.6 2020-01-30 15:44:23 +00:00
sebres 61962d02f5 merge 8.5 2020-01-30 15:39:56 +00:00
sebres f05d9af86d introduces new command and constraint testWithLimit (as include tests/internals.tcl) that can be used to test a code under restricted circumstances (e.g. limited address space) 2020-01-30 15:32:51 +00:00
jan.nijtmans c8c1298bb3 Merge 8.6 2020-01-30 13:54:01 +00:00
jan.nijtmans f58b90fb02 Reset WSAGetLastError()/errno always, even when this error is not reported due to the earlier error. 2020-01-30 13:52:58 +00:00
jan.nijtmans 64fdac4aec Merge 8.6 2020-01-30 13:21:38 +00:00
jan.nijtmans ee66478056 Simplify the use of HaveVersion() in Channel handling. Nothing functional, only code clean-up. 2020-01-30 13:04:12 +00:00
jan.nijtmans 56f2fc4f04 According to the [https://core.tcl-lang.org/tcl/artifact?udc=1&ln=469-471&name=5ac7827cd282bbda|documentation], close2Proc(...., 0) should operate the same as closeProc(). Fix the UNIX/Windows socket channels to behave like that. 2020-01-30 13:00:12 +00:00
sebres 782689d5eb small amend (comments only) 2020-01-29 17:02:16 +00:00
sebres 57321fa4a4 better test covering [5d989f9ba3] - limiting AS considers normal memory usage of process;
prepared for new common test-facility (test-with-limit) for resticted execution
2020-01-29 16:50:56 +00:00
jan.nijtmans 667676a551 Fix compiler warnings on Cygwin when using -DTCL_NO_DEPRECATED
Use TCL_CHANNEL_VERSION_5 in stead of TCL_CHANNEL_VERSION_3 in tclZlib.c
2020-01-29 13:02:06 +00:00
jan.nijtmans 7c48658c9f Fix install-libraries-zipfs-static target: On Windows INSTALL_DATA makes no sense. Reported by René Zaumseil. Thanks! 2020-01-27 10:31:36 +00:00
jan.nijtmans bfed58b030 TIP #559 follow-up: Make sure that if Tcl_FreeResult() is used in an extension compiled with -DTCL_NO_DEPRECATED, this results in a link error.
Do the same with deprecated funcions from other TIP's.
2020-01-25 14:51:08 +00:00
dgp e6800a165c Implement TIP 559 2020-01-24 16:44:25 +00:00
apnadkarni b20939682d Fix See also links in list commands 2020-01-23 15:40:08 +00:00
jan.nijtmans 05776cbb41 Merge 8.6 2020-01-23 13:14:09 +00:00
jan.nijtmans 92c8a53689 Better error-handling in some libtommath calls. 2020-01-23 12:55:41 +00:00
jan.nijtmans c15121ae96 Add error-handling to all libtommath function calls. Most likely not perfect (open for further improvements/review), but for sure better than no error-handling at all. 2020-01-23 10:33:37 +00:00
jan.nijtmans b9f442e8b2 Merge 8.6 2020-01-23 09:46:18 +00:00
jan.nijtmans ff928c6450 Merge 8.5 2020-01-23 08:33:22 +00:00
jan.nijtmans ad096310ec Last unused internal stub entry from 258 to 259. 2020-01-23 08:29:26 +00:00
jan.nijtmans e03aa95407 Merge 8.7. All calls using MP_WUR handled now. 2020-01-22 09:26:00 +00:00
dgp 5dab8a0c6b Implement TIP 543 2020-01-21 22:00:20 +00:00
jan.nijtmans 05ed23d325 Merge 8.7, more WIP 2020-01-21 16:05:02 +00:00
jan.nijtmans 220ee76c14 merge-mark 2020-01-21 08:49:21 +00:00
jan.nijtmans 0f71efe445 Don't run stack-3.1 test on OSX, it fail regulary. Don't really bother for Tcl 8.5 any more. 2020-01-21 08:48:17 +00:00
jan.nijtmans 7eeeb51309 Merge-mark 2020-01-20 15:28:38 +00:00
jan.nijtmans e403afa147 Now that TIP #538 is integrated, make rules.vc work for both 8.6 and 8.7 without changes. 2020-01-20 15:27:47 +00:00
jan.nijtmans a3906f4953 Don't deprecate Tcl_NewUnicodeObj/Tcl_SetUnicodeObj/Tcl_GetUnicodeFromObj, since that's not according to TIP #542. (Those are only deprecated when using TCL_UTF_MAX=4, not in the general case) 2020-01-20 14:35:25 +00:00
jan.nijtmans 12d3b15f30 Implementation of TIP #542: Support for switchable Full Unicode support 2020-01-20 12:18:34 +00:00
sebres 668c35bfc2 merge 8.6 2020-01-17 17:15:37 +00:00
sebres 33c6ac50b3 merge 8.5 (closes [5d989f9ba3]: avoid segfault by OOM if too many items to sort) 2020-01-17 17:08:18 +00:00
sebres a3728e6d82 small amend (skip messages, avoid output on interactive shell) 2020-01-17 16:40:37 +00:00
sebres 35ec25a6cf closes [5d989f9ba3]: avoid segfault by OOM if too many items to sort (would throw an error instead, and use system alloc for long elementArray due to size_t);
added test cases covering that (in child process with limited address space, if "prlimit" available)
2020-01-17 16:12:06 +00:00
dgp eb5163d9e8 merge 8.7 2020-01-17 15:37:22 +00:00
jan.nijtmans 3262fa4d4e Merge 8.7, more WIP 2020-01-17 10:43:44 +00:00
jan.nijtmans 37ad5db296 Merge 8.6 2020-01-17 08:54:21 +00:00
jan.nijtmans 9169847966 Fix [8cd2fe7474]: "unload" command Bug (when handling multiple libs) 2020-01-17 08:53:29 +00:00
jan.nijtmans eb08a10e38 Fix [8cd2fe7474]: "unload" command Bug (when handling multiple libs) 2020-01-17 08:51:38 +00:00
jan.nijtmans d59509dee2 Proposed fix for [8cd2fe7474]: "unload" command Bug (when handling multiple libs) 2020-01-16 14:16:48 +00:00
jan.nijtmans e446f6c309 Merge 8.7 2020-01-15 15:29:54 +00:00
jan.nijtmans 3101fc1da1 Merge-mark 8.6. Remove a few "break"'s added in the previous commit, because they are redundant. 2020-01-15 10:21:02 +00:00
jan.nijtmans 9a78221b8d A few more "break" statements, so any compiler knows these are no FALLTHROUGH situations. 2020-01-15 10:07:46 +00:00
jan.nijtmans 939c35f568 A few more "break" statements, so any compiler knows these are no FALLTHROUGH situations. 2020-01-14 09:09:50 +00:00
jan.nijtmans c6135def08 Attempt to resolve a conflict between (unmodified) tommath.h and tcl.h in the definition of mp_int. See: [https://github.com/libtom/libtommath/pull/473] 2020-01-13 21:46:18 +00:00
dgp 9b0b0dc37d Implement TIP 559 (deprecation part). 2020-01-13 17:00:21 +00:00
jan.nijtmans 41e035d59b Merge 8.6 2020-01-13 15:20:03 +00:00
jan.nijtmans 46a6094df7 Fix [cff53cf7d0]: Failed test oo-0.9 in file oo.test in Tcl8.6.10 2020-01-13 15:19:08 +00:00
jan.nijtmans a8e3a2a3a8 Merge 8.6 2020-01-13 12:47:13 +00:00
jan.nijtmans 6a4eb9df57 Add ${LDFLAGS} to MAKE_LIB. This handles the possibility of adding LDFLAGS=?? on the "configure" commandline. Suggested by Pietro Cerutti. Thanks! 2020-01-13 12:17:09 +00:00
jan.nijtmans f468073bd5 Merge 8.6 2020-01-13 10:44:25 +00:00
jan.nijtmans 997e0f3505 Fix [0b9332722a]: Support utf-8 on Windows console 2020-01-13 10:01:30 +00:00
jan.nijtmans f3070aa2fc Silence some gcc-9 compiler warnings. 2020-01-13 10:00:03 +00:00
dgp 31f988f9c8 merge 8.7 2020-01-10 17:40:34 +00:00
jan.nijtmans 8c3314fad9 More WIP 2020-01-10 16:00:03 +00:00
jan.nijtmans 2d27c96b7e tommath_private.h : Remove special C4146 handling: already done in tclWinPort.h too.
tcl.pc.in:  Make sure that libtommath >= 1.2.0
2020-01-10 15:18:36 +00:00
jan.nijtmans f608fa90db Put "-ltommath" in $MATH_LIBS in stead of $LIBS, so it won't be used by other checks in the configure script. Suggested by Pietro Cerutti. 2020-01-09 09:27:09 +00:00
jan.nijtmans 07829dc8b9 Put "-ltommath" in $MATH_LIBS in stead of $LIBS, so it won't be used by other checks in the configure script. Suggested by Pietro Cerutti. 2020-01-09 09:25:56 +00:00
jan.nijtmans cc211af4ea Start handling WUR (Warn Unused Result) in all tommath calls. WIP, not complete yet. 2020-01-09 09:20:57 +00:00
dgp f7076c6ce8 merge 8.7 2020-01-08 23:00:06 +00:00
dgp 8ef7bd41b6 Improvements to doc changes from TIPs 422 and 512. 2020-01-08 22:25:36 +00:00
dgp 0d799f84b3 s/in stead/instead/ 2020-01-08 21:40:10 +00:00
dgp d1f6dc44aa s/in stead/instead/ 2020-01-08 21:39:12 +00:00
dgp 6804338322 merge 8.6 2020-01-08 21:10:10 +00:00
dgp 780f439396 Remove another mention of interp->result. 2020-01-08 16:53:25 +00:00
dgp 0215962576 Revise documentation that refers to direct access to interp->result. 2020-01-08 14:23:06 +00:00
jan.nijtmans 0c195b760a Merge 8.6 2020-01-08 13:16:49 +00:00
jan.nijtmans 0df818c01f Use _copysign on Windows always (available from float.h). Use mp_iszero() whenever appropriate. 2020-01-08 12:51:29 +00:00
jan.nijtmans 3b3abe0ce1 Code cleanup (mostly comments, backported from 8.6). 2020-01-08 11:53:03 +00:00
jan.nijtmans 4afa382971 Merge 8.7 2020-01-07 15:44:16 +00:00
jan.nijtmans 0ba9e042a2 Merge 8.7 2020-01-07 15:22:06 +00:00
jan.nijtmans 14b5289e4a Merge 8.7 2020-01-07 15:20:49 +00:00
jan.nijtmans 49a7184962 Don't use "operator" as variable name, as it is a keyword in C++.
Add some break statements, so Tcl can be compiled warning-free with gcc-7's -Wimplicit-fallthrough
A few better indications of unused (dummy) functions parameters.
2020-01-07 14:42:15 +00:00
jan.nijtmans 7c23c57789 Some eol whitespace eliminations 2020-01-07 14:32:16 +00:00
jan.nijtmans 7d90738e3a One more place where the (deprecated) "unicode" encoding was still used. 2020-01-07 12:18:51 +00:00
jan.nijtmans d92cffaa0c Remove type-casts in many Tcl_LinkVar() calls, which is no longer necessary since 8.7.
Small missing piece in Tcl_LinkArray() implementation, handling (unsigned) longs on 64-bit platforms.
2020-01-07 09:24:19 +00:00
jan.nijtmans 0bf39185fb Fix test encoding-28.0, adapting for the correct number of available encodings 2020-01-07 08:35:34 +00:00
dgp 1923110631 one more 2020-01-06 20:24:25 +00:00
dgp c187695b61 Bring docs up to date with TIP 330 and TIP 336 changes already in Tcl 8.7 2020-01-06 20:12:32 +00:00
dgp edcdd9afe1 Missing bit of interp->result deprecation. 2020-01-06 18:07:43 +00:00
dgp f140e958c5 Remove "new in 8.6" marks from the docs in the 8.7 branch. 2020-01-06 17:26:05 +00:00
dgp b0db0ad956 remove 'new in 8.5' marks in docs 2020-01-06 17:17:58 +00:00
dgp 6dcb4cb65c Remove the "new in 8.5" markings from the 8.6 branch of docs. 2020-01-06 17:17:11 +00:00
jan.nijtmans 4c14bc7964 Fix typo: "==" -> "=" 2020-01-06 11:02:12 +00:00
jan.nijtmans b81709b80a Merge 8.7.
Don't think that ${LDFLAGS} should be part of MATH_LIBS: that should be arranged correctly in the Makefile by providing both LDFLAGS and MATH_LIBS to the command line.
2020-01-06 10:57:58 +00:00
jan.nijtmans 16deae9be1 Merge-mark 2020-01-06 10:50:18 +00:00
jan.nijtmans 8d01cecc9a (cherry-pick): Fix issue [9128866ec8448752] by adding Line Feed character to tis-620.enc. 2020-01-06 10:48:04 +00:00
jan.nijtmans 4bea353255 Merge 8.6 2020-01-06 10:40:14 +00:00
jan.nijtmans 2595be3dfe Merge 8.5 2020-01-06 10:34:16 +00:00
jan.nijtmans 1ccdd5f186 Don't assume/set LDFLAGS being "", it could be set on the "configure" command-line.
Remove "test-packages" test-target (which doesn't exist), but add "test-tcl" being the same as "test".
2020-01-06 10:28:28 +00:00
dgp b60f173c37 Tcl_TransferResult was new in 8.6, so mark the man page with that version. 2020-01-05 19:41:04 +00:00
dgp 3dae54c810 formatting typo and rewrite 2020-01-05 19:18:30 +00:00
dgp 5f46a6c4a7 Rewrite: lead paragraph with name of documented routine. 2020-01-05 19:16:33 +00:00
dgp a75f6ac8ce Fix documentation, comments, and argument names of Tcl_TransferResult(). 2020-01-05 19:03:12 +00:00
pooryorick ac2be8e353 Add a test for issue [9128866ec8], encoding fails to load 2020-01-04 17:21:53 +00:00
pooryorick 0cd25f6ca2 merge 8.6 2020-01-04 14:51:40 +00:00
pooryorick b873f56401 Fix issue [9128866ec8448752] by adding Line Feed character to tis-620.enc. 2020-01-04 14:34:36 +00:00
fvogel 0188ad7082 Restore the build by providing a copysign replacement for old MSVC versions. 2020-01-02 21:00:22 +00:00
fvogel 019eea55c0 Restore the build by providing a copysign replacement for old MSVC versions. 2020-01-02 20:56:46 +00:00
fvogel 158c112e03 Restore the build by providing a copysign replacement for old MSVC versions. 2020-01-02 20:56:20 +00:00
dgp 341619118a merge 8.7 2019-12-30 21:25:43 +00:00
dkf 30d15963da Fixed index line 2019-12-30 16:24:29 +00:00
gahr c24a2bec01 Regenerate configure 2019-12-30 13:49:39 +00:00
gahr 54e9b9d2b3 Fix equality check, reported by Emiliano 2019-12-30 13:48:44 +00:00
gahr 61ddd431ca Include LDFLAGS in TCL_LIB, since that's where MATH_LIBS come in 2019-12-27 12:53:48 +00:00
gahr a5fd8b5d9c Regenerate configure 2019-12-27 12:13:15 +00:00
gahr 70b0310ff7 Make sure LDFLAGS are propagated to MAKE_LIB 2019-12-27 12:12:15 +00:00
gahr 54aabbf053 Use AC_CHECK_LIB and put ltommath in MATH_LIBS to avoid polluting LIBS 2019-12-27 12:11:38 +00:00
Kevin B Kenny ccc57bc577 Merge Tcl 8.6 changes to deal with integer overflow in the exponent, and floating point overflow in the significand, of floating point input conversion (Bug [1de6b0629e] 2019-12-27 00:23:49 +00:00
Kevin B Kenny 8140d238ea Merge Tcl 8.5 changes to deal with integer overflow in the exponent, and floating point overflow in the significand, of floating point input conversion (Bug [1de6b0629e] 2019-12-27 00:12:58 +00:00
Kevin B Kenny f7d1daa7fd Merge changes to deal with integer overflow in the exponent, and floating point overflow in the significand, of floating point input conversion (Bug [1de6b0629e] 2019-12-27 00:03:41 +00:00
Kevin B Kenny ba0a3a3dd2 Add test cases that used to cause floating point overflow in computing the correction term in floating point input conversion. Fix exponent overflow in floating point input conversion, and floating-point overflow in the significand in input conversion. 2019-12-26 23:54:03 +00:00
jan.nijtmans 032451725b Add FALLTHRU markers, eliminating gcc warning using -Wextra 2019-12-24 15:04:57 +00:00
jan.nijtmans 3254602d80 Attempt to improve support for external libtommath 2019-12-24 14:23:42 +00:00
jan.nijtmans 51bf99fdf5 More progress in making clang build on Cygwin warning-free 2019-12-24 13:52:05 +00:00
jan.nijtmans 0f7dc05b52 Make definition of struct mp_int EXACTLY the same as the one in the (modified) tommath.h 2019-12-24 13:51:22 +00:00
jan.nijtmans 2d00a8c17e Put our own included (-I) directories before directories coming in though CFLAGS, so building with external libraries (like libtommath) doesn't possibly corrupt our own build. Reported by Pietro Cerutti 2019-12-24 10:05:40 +00:00
jan.nijtmans cf8d2f27eb Merge 8.6 2019-12-23 13:42:55 +00:00
jan.nijtmans 86e6d287a0 Fix for building Cygwin using Clang. 2019-12-23 13:38:20 +00:00
jan.nijtmans ce2dc4a07d Merge 8.6 2019-12-23 11:27:22 +00:00
jan.nijtmans 1e7fb75229 Workaround for [ce3b9f2b04]: compilation errors with clang (windows msys2) 2019-12-23 11:26:31 +00:00
dgp 63253bc07d Fix parsing bug when (numSigDigs == 0). 2019-12-23 00:54:44 +00:00
dgp 38d9207627 Assign a double literal to a double variable. No point in requiring conversion. 2019-12-22 23:48:00 +00:00
dgp e52a22ff57 Tests for another parsing bug. 2019-12-22 18:44:45 +00:00
jan.nijtmans 7b099b30d8 Merge 8.6 2019-12-22 14:55:25 +00:00
jan.nijtmans 834ee2dd0d Minor optimization in TclFormatInt: No need to check for "0" as special value. No need to include final NULL-byte in character-reversion operation, as we already known the NULL-byte will come last. 2019-12-22 14:52:33 +00:00
dgp 1f81e5eb51 Tests demonstrating the number parsing overflow bugs. 2019-12-21 14:19:08 +00:00
jan.nijtmans f3e5dd7a04 Prevent double definition of MODULE_SCOPE on Darwin 2019-12-20 16:13:36 +00:00
jan.nijtmans bb09dba8c0 Fix 2 unused arguments with USE_DTRACE 2019-12-20 16:11:54 +00:00
jan.nijtmans 8e18ac6cf7 Update travis build fro xcode11 to xcode11.3 as highest platform 2019-12-20 15:23:26 +00:00
jan.nijtmans 4f37c25271 Two more unused arguments.
Merge 8.7
2019-12-20 14:23:11 +00:00
jan.nijtmans 14a974e2d0 Merge 8.7. Exclude 4 test-cases in TCL_NO_DEPRECATED mode, because they are not supposed to work then 2019-12-19 22:26:37 +00:00
jan.nijtmans 2a08be49c2 Merge 8.6 2019-12-19 22:12:19 +00:00
jan.nijtmans 588a92ec6b Merge 8.5 2019-12-19 22:11:01 +00:00
jan.nijtmans 6fa04d74e0 Add type-cast, making sure that the unary minus is handled correctly on any compiler 2019-12-19 22:09:46 +00:00
jan.nijtmans 2c3a603e13 Merge 8.6 2019-12-19 22:04:09 +00:00
jan.nijtmans a0f11eae42 Merge 8.5 2019-12-19 21:31:05 +00:00
jan.nijtmans 88e4842dfe Put back 4 test-cases as they were in core-8-branch, but only for TCL_UTF_MAX=3 2019-12-17 23:14:53 +00:00
jan.nijtmans 3a7b07be0d Better fix for [3390638]: making the intVal variable unsigned prevents the need for using sprintf() altogether. 2019-12-16 10:09:40 +00:00
jan.nijtmans dbd3d4eff0 Only use OPTS=msvcrt in combination with "static", otherwise it's a NOOP. Disable pragma warning:C4146 (backported from 8.6), since it only gives misleading warnings. 2019-12-16 10:08:07 +00:00
jan.nijtmans 899310175d Merge 8.7 2019-12-14 17:46:34 +00:00
jan.nijtmans 4e6d44d0e6 Merge 8.6 2019-12-14 17:43:22 +00:00
jan.nijtmans ea5ed28162 Make win/configure work with CC=g++ (doesn't actually work with Tcl and Tk yet) 2019-12-14 17:36:09 +00:00
jan.nijtmans 72b3895d8b Merge 8.7 2019-12-14 14:08:54 +00:00
jan.nijtmans 112bcf743a merge-mark 2019-12-13 22:20:32 +00:00
jan.nijtmans 59f4600ec3 One #undef too much 2019-12-13 22:18:40 +00:00
jan.nijtmans 89e6e17872 Merge 8.7 and (hopefully) fix Travis build with C++ 2019-12-13 22:12:32 +00:00
jan.nijtmans de326e5c5e Don't export mp_sqr() directly from libtcl 2019-12-13 21:48:15 +00:00
jan.nijtmans 230886d1fe Merge 8.7 2019-12-13 21:27:52 +00:00
jan.nijtmans 9eeefad066 Optimize mp_mul for the case a==b 2019-12-13 21:16:44 +00:00
jan.nijtmans 8ddd0ca822 Merge 8.7 2019-12-13 15:41:16 +00:00
jan.nijtmans e438829082 Merge 8.7 2019-12-13 15:39:23 +00:00
jan.nijtmans 4cef9fbbe2 merge-mark 2019-12-13 15:13:15 +00:00
jan.nijtmans 3fb9396959 Fix Travis build for MSVC Debug mode 2019-12-13 15:12:29 +00:00
jan.nijtmans 6fdc83ae14 Implement TIP's #538: Externalize libtommath 2019-12-13 11:05:43 +00:00
jan.nijtmans db35fe50e9 Little code tweaks, regarding the use of TCL_UTF_MAX or wchar_t. 2019-12-12 21:38:46 +00:00
jan.nijtmans 9ef936369e merge-mark 2019-12-12 21:05:16 +00:00
jan.nijtmans 3701dc242d Add 3 (libtommath) functions to the stub table. Will be added to 8.7 too, through TIP #538 2019-12-12 21:02:48 +00:00
jan.nijtmans 94e8f63367 Merge 8.7. Add C++ entries for Windows to Travis build. 2019-12-12 16:14:05 +00:00
jan.nijtmans f70589ae3e Add many missing constraints 2019-12-12 13:12:29 +00:00
jan.nijtmans 368faf4c43 Update win/tcl.m4, for use with C++ 2019-12-12 13:11:09 +00:00
jan.nijtmans e3f42b0c1a Little doc tweak 2019-12-12 08:23:58 +00:00
jan.nijtmans 74f50a92f3 Merge 8.7 2019-12-11 15:53:07 +00:00
jan.nijtmans f8474f319c Implement "panic" as described in the TIP 2019-12-11 12:41:00 +00:00
jan.nijtmans 81d54e6432 Merge 8.7 2019-12-11 08:55:48 +00:00
jan.nijtmans 1d6a94f9f8 Fix bug in tclEncoding.c, only manifesting in testcase encoding-15.4 for TCL_UTF_MAX=6. (knownBug, fixed now) 2019-12-11 08:52:58 +00:00
jan.nijtmans 86c130f239 Merge 8.6 2019-12-10 13:42:52 +00:00
jan.nijtmans db4a693d72 Fix [5f236bc67a]: valgrind report for Tcl_UniCharToUtf. Also add test-cases for more corner-cases. 2019-12-10 13:16:48 +00:00
sebres 4a214309b2 merge 8.6 2019-12-10 13:15:48 +00:00
sebres 5caaa0f557 amend to [2cf1202807]: find the hooks in tcltest namespace only 2019-12-10 12:45:09 +00:00
jan.nijtmans a7212b0557 Undo accidental change in [343273c9de4fd4f1] 2019-12-09 22:48:56 +00:00
jan.nijtmans 216a1d1937 Attempt to fix [5f236bc67a]: valgrind report for Tcl_UniCharToUtf 2019-12-09 19:36:21 +00:00
sebres 19e564ab89 remove unneeded import (for >= 8.7) 2019-12-09 11:42:57 +00:00
jan.nijtmans 54b0e77083 Merge 8.6 2019-12-09 11:31:25 +00:00
sebres c66173309f merge 8.5 (timing issue avoidance, skip test in runtime feature) 2019-12-09 10:40:04 +00:00
sebres f9490c56c6 small amend (whitespace, no functional) 2019-12-09 10:30:19 +00:00
sebres c8634b0b9e tcltest: hook enhancements rewritten backwards compatible now, reverts [0067db1bbf], [0f3d6f90f0], [b8be012969], [375a566d22] 2019-12-09 10:26:23 +00:00
jan.nijtmans 37f6a196c5 Fix [abd4abedd2]: Failed to build tk 8.6.10 with cross compile 2019-12-09 10:02:20 +00:00
jan.nijtmans fea9c41d92 Add special handling of lower surrogate to UtfToUtfProc(), so valgrind should't complain in that situation. With new test-cases covering that. 2019-12-09 09:59:02 +00:00
jan.nijtmans 1121106257 Merge 8.7 2019-12-08 16:58:26 +00:00
jan.nijtmans 743e03cf5e Merge 8.7 2019-12-08 16:55:03 +00:00
jan.nijtmans 39bf69006a Merge 8.6Merge 8.6 2019-12-08 16:49:34 +00:00
jan.nijtmans d67affb100 Fix Valgrind problem reported as follow-up in [fc4393e9b0]. Since it happens only for TCL_UTF_MAX>3 it's not actully a 'bug' in 8.6, but it might be a corner-case not handled well in 8.7 2019-12-08 16:33:18 +00:00
jan.nijtmans 6d5473da30 merge-mark 2019-12-07 18:25:58 +00:00
jan.nijtmans bf4f51ce78 Fix 2 test-cases, which were failing when TCL_UTF_MAX=6. Add UTF_MAX=6 UNIX build to Travis as proof that now all test-cases pass for UTF_MAX=6 (still not officially supported) 2019-12-07 18:23:41 +00:00
sebres 74b0c7c91a rewrite of [dff608952b]: skip tests if there is really a timing issue (and implements new feature ::tcltest::Skip which allows conditionally skipping of tests at runtime) 2019-12-06 16:42:19 +00:00
jan.nijtmans 364ba5e8b9 Exclude some test-cases with possible timing problems on Windows. Double ;; in generic/tclTimer.c 2019-12-06 14:51:39 +00:00
jan.nijtmans 5aef84d1f4 Merge 8.6 2019-12-06 14:38:28 +00:00
jan.nijtmans f67bef714e Unnecessary double ;; in tclTimer.c. Update compat/zlib to exactly the same content as in the core-8-branch branch. 2019-12-06 14:35:10 +00:00
jan.nijtmans e2ecc3c090 merge-mark 2019-12-06 13:47:34 +00:00
jan.nijtmans a84aa656ee Fix some test-cases when Tcl is compiled with -DTCL_UTF_MAX=6. Not officially supported but used by Androwish. The test-cases prove that "unicode" should be UTF-16 actually for all TCL_UTF_MAX values. 2019-12-06 13:43:25 +00:00
jan.nijtmans 7d17ab9a13 Merge 8.6 2019-12-04 13:26:53 +00:00
jan.nijtmans 0acc700234 Add builds using TCL_UTF_MAX=4 on Windows. Not officially supported, but used by Androwish. Also alphabetise some options in win/makefile.vc and win/rules.vc 2019-12-04 12:54:39 +00:00
jan.nijtmans d02ab64fa2 Use the right encoding when converting (Unicode) messages regarding socket errors on Windows. Some code cleanup in win/tclWinfile.c. 2019-12-04 12:53:25 +00:00
jan.nijtmans 29b775c36a Remove Travis's Clang builds using TCL_UTF_MAX!=4. Too little difference with the corresponding GCC builds to be useful. 2019-12-03 19:30:19 +00:00
jan.nijtmans 40938f72a2 Add build using gcc and TCL_UTF_MAX=4 to Travis build. Not officially supported but used by Androwish. Remove "threads" designator on Windows, since it's already default. 2019-12-03 19:24:05 +00:00
jan.nijtmans 4a5f73e338 Merge 8.7 2019-12-03 16:13:29 +00:00
jan.nijtmans d8fd9552b5 Merge 8.7 2019-12-03 16:12:14 +00:00
jan.nijtmans 28d5df364e Merge 8.6 2019-12-03 13:21:32 +00:00
jan.nijtmans 678d2103f9 Fix encoding-15.6 testacase for TCL_UTF_MAX=6, due to changes escape sequences for upper/lower surrogate combination. 2019-12-03 13:20:47 +00:00
jan.nijtmans c4990c8bf6 Merge 8.6 2019-12-03 12:58:25 +00:00
jan.nijtmans 9e0083e9f0 Fix [3cd9bea1e6]: check-in [43032d7ba3] potential problems. Also don't allow surrogates in \U?????? syntax. 2019-12-03 12:27:42 +00:00
pooryorick 3c7bb58fb9 merge 8.6 2019-12-02 22:07:33 +00:00
pooryorick 36f4518f89 Add tcltest::CleanupTest to make it easier to customize behaviour. 2019-12-02 22:04:41 +00:00
jan.nijtmans cfb43a5a2c Merge 8.6 2019-12-02 20:48:35 +00:00
jan.nijtmans 4f6ea8aef9 If TCL_UTF_MAX>=4, make Tcl_ParseBackslash combine two surrogates so they appear as one 4-byte UTF-8 byte sequence from the start. Add test-case for this. 2019-12-02 20:26:58 +00:00
dgp a42ecfa12e Bump to 8.7a4 to distinguish development from 8.7a3 release. 2019-12-02 18:15:07 +00:00
jan.nijtmans eadbf37f4e Fix [a46a49b90f]: tests http-cookiejar-1.[12] fail 2019-12-02 13:28:46 +00:00
jan.nijtmans 8e1f9bb6d1 Eliminate excess eol-spacing 2019-12-02 10:58:19 +00:00
jan.nijtmans a86677ebd5 Merge 8.6 2019-12-02 10:52:45 +00:00
jan.nijtmans 90493b4012 Renumber tcltest from 2.5.1 -> 2.5.2, already for next release. 2019-12-02 10:49:11 +00:00
jan.nijtmans d6a3244d18 More eol-spacing 2019-12-02 10:48:01 +00:00
jan.nijtmans f7e46677b5 Eliminate unneccessary eol-spacing from documentation. 2019-12-02 10:47:00 +00:00
jan.nijtmans db669f381b Fix make install on Ubuntu (and - most likely - other platforms) 2019-12-01 21:25:32 +00:00
jan.nijtmans 6cc489aa4f Merge 8.7 2019-12-01 20:04:10 +00:00
pooryorick 506589f483 Add tcltest::EvalTest to make it easier to customize behaviour. 2019-12-01 19:45:54 +00:00
jan.nijtmans bd7870ec5f Fix executable flag 2019-12-01 17:52:17 +00:00
pooryorick 7363d850a9 merge 8.6 2019-12-01 13:52:06 +00:00
pooryorick d138d28133 Fix tcltest::SetupTest added in previous commit. 2019-12-01 13:48:48 +00:00
pooryorick af1ecf410e merge 8.6 2019-12-01 12:16:04 +00:00
pooryorick 3435c9713f add tcltest::SetupTest to make it easier to customize the -setup step of a test 2019-12-01 11:59:41 +00:00
jan.nijtmans 09abed41d6 merge-mark 2019-11-29 12:29:18 +00:00
jan.nijtmans 332401e645 Add some new test-cases involving e.g. Unicode 11. Backported from Tcl 8.7a3 2019-11-29 12:27:00 +00:00
jan.nijtmans 17a9125415 Merge 8.7 2019-11-29 09:52:54 +00:00
jan.nijtmans 800a3f62b3 Fix one failing testcase (thanks, Travis!) 2019-11-29 09:52:09 +00:00
jan.nijtmans e4704dda2f Merge 8.7 2019-11-28 14:14:29 +00:00
jan.nijtmans a5162e47d5 Merge 8.6 2019-11-28 13:15:44 +00:00
jan.nijtmans 122bb72a66 Enhance rules.vc like already done in other configure scripts: Determine HAVE_STDINT_H/HAVE_INTTYPES_H/HAVE_STDBOOL_H/MP_NO_STDINT the simple way, just by compiler version. 2019-11-28 12:53:38 +00:00
jan.nijtmans bc00595941 Give cookiejar en tcl::idna a 3-part version number. Use 0.2.0 for cookiejar and 1.0.1 for tcl::idna.
"make install" and "make install-libraries" should now (finally) work fine for all platforms, both with configure/make and nmake.
2019-11-28 12:36:22 +00:00
jan.nijtmans 7c405f2e81 Merge 8.5 (Update opt package from 0.4.6 to 0.4.7).
Also fix installation of opt0.4 as done by makefile.vc, which never worked in Tcl 8.6.
2019-11-28 11:35:51 +00:00
jan.nijtmans d473f1507c Update "opt" from version 0.4.5 to 0.4.7, backported from Tcl 8.7a3. 2019-11-28 10:54:21 +00:00
jan.nijtmans 0e57f61ede (hopefully) fix installation on Windows 2019-11-27 22:20:48 +00:00
jan.nijtmans 4ab699dc03 Merge 8.7. Tweak makefile.vc for detection of stdint.h/inttypes.h/stdbool.h 2019-11-27 21:09:36 +00:00
jan.nijtmans 0c50d57d08 Another minor tweak: No need to include manifest.txt in the vfs zip-file, since it's renamed to pkgIndex.tcl 2019-11-27 20:15:50 +00:00
jan.nijtmans 38e41ac6ef Merge 8.7, and take over some fixes for VC++ 6.0 from Sebres. 2019-11-27 14:41:11 +00:00
jan.nijtmans 9a80393d63 Minor tweak: Don't include the "dde" and "reg" directory in the zip-file on UNIX 2019-11-27 14:25:47 +00:00
sergey.brester 87934d6db3 merge digit-bit-60 2019-11-27 13:43:36 +00:00
sergey.brester dd334ec3d0 fixes compile errors for old VC versions, as well as tommath include path, there are two files with this name and wrapper "generic/tommath.h" gets included, but "libtommath/tommath.h" is never included, because did not addressed directly with this name (first from path wins). 2019-11-27 13:38:37 +00:00
jan.nijtmans f5464908a6 Move check for stdbool.h from SC_MISSING_POSIX_HEADERS to SC_CONFIG_CFLAGS, since it's not POSIX. 2019-11-27 12:14:57 +00:00
jan.nijtmans 37a548351b Merge 8.6 2019-11-27 11:09:33 +00:00
dkf d9f8a23002 Proposed Windows installation code for cookiejar package 2019-11-27 11:01:38 +00:00
jan.nijtmans 1b760ca1a5 Merge 8.5 2019-11-27 10:25:49 +00:00
jan.nijtmans 627fe239a5 Don't bother paths of 64-bit SDK any more: This was Visual Studio 2008-specific and doesn't work with other Visual Studio versions. 2019-11-27 09:44:17 +00:00
jan.nijtmans 9eaa827e59 Merge 8.7 2019-11-26 22:49:05 +00:00
jan.nijtmans 94206b30ff Merge 8.7 2019-11-26 22:42:59 +00:00
jan.nijtmans d8a1ef0827 Fix installation of cookiejar on UNIX, and add same pieces to windows as well. Also modify manifext.txt accordingly, for the zipfile vfs. 2019-11-26 21:35:52 +00:00
dgp e5e3156e56 merge release 2019-11-26 17:35:08 +00:00
dgp 5d1722aaf1 Accept repackaging and distribution of http::cookiejar for Tcl 8.7a3. 2019-11-26 16:29:12 +00:00
jan.nijtmans e92bcc6be3 Merge 8.7a3 2019-11-26 08:11:37 +00:00
dgp cf9edc4a1d merge 8.7 2019-11-25 18:08:50 +00:00
jan.nijtmans a5549e4cd2 Tweak visibility of some libtommath symbols and add --with-system-libtommath configure option (as requested by Pietro Cerutti) 2019-11-25 16:34:20 +00:00
jan.nijtmans b7e4a9f65b Merge 8.7 rc branch 2019-11-23 20:49:55 +00:00
dgp 20ce24d285 merge 8.7 2019-11-22 15:18:54 +00:00
jan.nijtmans 76f04364e3 Undo minor tweak, no longer necessary 2019-11-22 13:33:53 +00:00
jan.nijtmans 3a1186689a Merge 8.7, and update to latest libtommath (support/1.x branch) 2019-11-22 13:26:30 +00:00
jan.nijtmans 9c4252f295 Fix typo in tclTestObj.c 2019-11-20 13:32:00 +00:00
jan.nijtmans b39f1c56d5 Merge 8.7. ignore MP_WUR for mp_neg() calls with equal arguments (even though MP_WUR is not enabled yet) 2019-11-18 21:41:18 +00:00
jan.nijtmans 377a4e24ed Formatting 2019-11-18 15:56:11 +00:00
jan.nijtmans 29db2a6761 Some code cleanup. Build with zlib dll on Win32 when using makefile.vc (shared-build only) 2019-11-18 14:40:54 +00:00
jan.nijtmans 37e202ac7d Update makefile.vc and rules.vc for using libtommath.dll/zlib1.dll in stead of statically linking libtommath, whenever possible. 2019-11-18 12:58:55 +00:00
jan.nijtmans f02189588a Merge 8.7. Unbreak travis build with TCL_UTF_MAX=3 2019-11-17 13:39:46 +00:00
dgp 16135b4d33 update changes 2019-11-16 19:57:03 +00:00
dgp 85f552fa8a merge 8.7 2019-11-15 20:20:33 +00:00
dgp 20685407f3 merge 8.7; update changes 2019-11-15 20:01:16 +00:00
jan.nijtmans 84987939c7 Merge 8.7 2019-11-15 15:19:56 +00:00
jan.nijtmans 3ce435c137 Merge 8.7 2019-11-15 14:53:21 +00:00
jan.nijtmans ce1e21eb7c Merge 8.7 2019-11-15 14:20:45 +00:00
dgp c2e61fa00e merge 8.7 2019-11-13 18:24:06 +00:00
dgp 21c4caf8e1 More work on changes. 2019-11-13 17:32:26 +00:00
jan.nijtmans e9559b5cc0 Merge 8.7 2019-11-13 16:11:37 +00:00
jan.nijtmans 9e9a51f3cb Merge 8.7 2019-11-13 16:10:12 +00:00
jan.nijtmans 863dfac9d9 try to install libtommath 1.2.0 through homebrew on MacOS 2019-11-12 22:06:09 +00:00
jan.nijtmans 41e4211a15 Merge 8.7. Finish implementation. 2019-11-12 12:11:05 +00:00
jan.nijtmans 6ce8973116 Merge 8.7 2019-11-11 16:19:46 +00:00
jan.nijtmans e512564f36 Merge 8.7 2019-11-11 14:26:50 +00:00
jan.nijtmans d33f396b99 Merge 8.7 2019-11-09 20:39:06 +00:00
jan.nijtmans 99cce0ea11 Fix travis build win32, 32-bit mingw 2019-11-08 20:09:46 +00:00
dgp 3b028ddc03 Start updates to changes 2019-11-08 15:11:42 +00:00
jan.nijtmans d6d77a73be Merge 8.7 2019-11-07 15:39:37 +00:00
dgp b82082f321 merge 8.7 2019-11-07 15:09:23 +00:00
dgp 245f333d52 Merge 8.7. Add files missing from distribution. 2019-11-06 14:35:24 +00:00
jan.nijtmans 9348f23012 Fix tclScan.c, not generating a string representation any more with unsigned wideints 2019-11-06 12:34:27 +00:00
dgp 7f6aa30c40 Bump release date 2019-11-05 17:52:33 +00:00
dgp 2ac91d1f8e merge 8.7 2019-11-05 17:51:55 +00:00
jan.nijtmans d010f7c348 More WIP: All makefile builds appear to work fine, makefile.vc build still to be done. 2019-11-05 16:37:52 +00:00
jan.nijtmans 2b84291424 Merge 8.7 2019-11-04 12:10:54 +00:00
jan.nijtmans 55e2ef9b31 Merge 8.7 2019-11-04 12:10:19 +00:00
jan.nijtmans c848a8872a Add compat/stdint.h, upgrade to libtommath 1.2.0, adapt as much as possible accordingly (still WIP) 2019-11-01 16:15:49 +00:00
jan.nijtmans 01c6f7705f Re-base to core-8-branch 2019-11-01 11:25:03 +00:00
dgp 7732a55113 merge 8.7 2019-10-30 14:27:57 +00:00
jan.nijtmans c8444b192d Merge 8.7 2019-10-28 16:49:32 +00:00
dgp d48eb0305d merge 8.7 2019-10-28 15:37:47 +00:00
jan.nijtmans efe1dce70b Merge 8.7 2019-10-25 20:32:26 +00:00
jan.nijtmans 25eedf811a Merge 8.7 2019-10-24 15:34:30 +00:00
dgp 9b08b0169a merge 8.7 2019-10-21 13:13:52 +00:00
jan.nijtmans f73034b8e3 Merge 8.7 2019-10-06 20:39:03 +00:00
jan.nijtmans 3d55f5f6f0 Merge 8.7 2019-10-02 21:40:45 +00:00
dgp b73c0aa0aa merge 8.7 2019-10-02 15:45:36 +00:00
jan.nijtmans c4606765eb Merge 8.7 2019-10-01 19:32:32 +00:00
jan.nijtmans 97294cb6f5 Merge 8.7 2019-09-25 15:06:25 +00:00
dgp 22d8a012ca merge 8.7 2019-09-25 15:03:42 +00:00
jan.nijtmans 2c327304a1 Merge 8.7 2019-09-25 13:42:11 +00:00
jan.nijtmans e1febe2aac merge-mark 2019-09-20 21:28:03 +00:00
jan.nijtmans 865ea5e678 More Win32 API impovals. 2019-09-20 13:53:39 +00:00
dgp 75bd963079 merge 8.7 2019-09-20 13:28:34 +00:00
jan.nijtmans 775e9aac00 Merge 8.7 2019-09-19 18:27:06 +00:00
dgp 11fdd10d9e merge 8.7 2019-09-18 16:31:13 +00:00
jan.nijtmans 0ff016021c Make less dependent on UNICODE definition 2019-09-18 09:33:43 +00:00
jan.nijtmans d8577f3bd9 Merge 8.7 2019-09-17 11:39:21 +00:00
dgp 2ff1a19af2 merge 8.7 2019-09-16 14:50:38 +00:00
jan.nijtmans c9396a84a8 Merge 8.7 2019-09-14 21:52:20 +00:00
dgp 663240b26f merge 8.7 2019-09-13 12:27:17 +00:00
dgp 2975cfd589 merge 8.7 2019-09-11 16:10:10 +00:00
jan.nijtmans 96c82a32e1 Mark more function paramaters as unused. Now Tcl compiles fully (on UNIX and Windows) without -Wunused-parameters warnings 2019-09-05 15:14:29 +00:00
jan.nijtmans 2d7fb3bc20 interp is not dummy any-more 2019-09-04 22:11:48 +00:00
jan.nijtmans 2cd19c4e6b Bring back Tcl_UntraceVar 2019-09-04 22:08:23 +00:00
jan.nijtmans ed985943f3 Handle "Unload" as well 2019-09-04 21:19:59 +00:00
jan.nijtmans 6506055954 (experiment) Allow C++ symbols to be found in loaded extensions 2019-09-04 20:51:06 +00:00
jan.nijtmans 8c60b1157a Mark more unused parameters 2019-09-03 20:32:33 +00:00
jan.nijtmans 97cf6a1aff Merge tip-548 2019-09-03 14:55:19 +00:00
jan.nijtmans b5f118d875 Merge tip-548. A few more fixes, trying to make the Travis build work (finally) 2019-09-02 12:27:10 +00:00
jan.nijtmans 876a5d6782 Let's try a real C++ build with Travis on Linux 2019-08-30 15:21:28 +00:00
jan.nijtmans 4187ab8e37 Merge tip-548 2019-08-29 13:28:32 +00:00
dgp 6f8793bff8 merge 8.7 2019-08-28 12:57:14 +00:00
dgp 278477fcd7 merge 8.7 2019-08-26 16:10:24 +00:00
jan.nijtmans 4796062aab Merge tip-548 2019-08-15 15:20:29 +00:00
jan.nijtmans 261bde3156 Eliminate dependency in test-suite on Unicode functions. Merge tip-548. Fix build with -DTCL_NO_DEPRECATED 2019-08-13 21:00:28 +00:00
jan.nijtmans 4b48c76e1c default TCL_UTF_MAX should still be 3 2019-08-12 20:49:50 +00:00
jan.nijtmans 92c04315ff Forgot some changes from tip-548 2019-08-12 20:47:01 +00:00
jan.nijtmans 8ddf96d852 Merge branch tip-548. No longer define addtional stub-entries for functions that will be removed (because of deprecation) anyway 2019-08-12 20:38:09 +00:00
jan.nijtmans 7934f521d7 Merge tip-548 2019-08-11 21:33:32 +00:00
jan.nijtmans ee3826893d Merge tip-548 (since using the *WChar* functions leads to less type-casts in c++)
Als finish implementaton for MacOSX
2019-08-03 20:25:14 +00:00
jan.nijtmans 2b096ec26d Merge tip-548 2019-08-02 15:03:45 +00:00
jan.nijtmans 474d95712e Merge 8.7. Continue implementation for win32 2019-08-02 12:15:23 +00:00
jan.nijtmans 972ac8cc9d Protect Tcl_AToB() functions against NULL input 2019-08-01 21:55:52 +00:00
jan.nijtmans 203f7657fe wrong length in tclMain.c, and wrong #endif 2019-08-01 21:47:01 +00:00
jan.nijtmans 5c8bbdd6d9 Merge tip-548 2019-08-01 21:35:37 +00:00
jan.nijtmans 74f9c831ac Merge tip-548 2019-08-01 11:55:40 +00:00
jan.nijtmans 2a3d586a79 Merge 8.7, and continue implementation. Almost done 2019-07-10 05:51:56 +00:00
jan.nijtmans d409a29e57 Experiment: compile Tcl with C++ compiler. WIP 2019-07-04 06:54:24 +00:00
jan.nijtmans a2d61902c5 Merge tip-548 2019-06-29 14:35:51 +00:00
jan.nijtmans 3d185e117d Merge tip-548 2019-06-29 07:19:50 +00:00
dgp eb64fc3dac merge 8.7 2019-06-27 13:08:45 +00:00
jan.nijtmans 379b57abd7 Merge tip-548 2019-06-27 10:49:29 +00:00
jan.nijtmans 218593d964 Merge tip-548 2019-06-26 21:25:54 +00:00
dgp fe44a8d5e9 merge 8.7 2019-06-17 18:28:39 +00:00
dgp 1fea6044ed merge 8.7 2019-06-12 18:58:35 +00:00
jan.nijtmans d64f20cebe Merge tip-548 2019-06-09 21:18:35 +00:00
jan.nijtmans e2abfe30a7 Merge tip-548 branch. 2019-06-03 21:20:07 +00:00
jan.nijtmans 83661bdca4 Merge tip-547 2019-05-31 23:35:20 +00:00
dgp 9b8f76b445 merge 8.7 2019-05-30 12:14:57 +00:00
jan.nijtmans 58260d444e More simplifications, taking deprecations into account 2019-05-22 21:50:14 +00:00
jan.nijtmans ea5190faaa Merge 8.7 2019-05-22 07:33:13 +00:00
jan.nijtmans d063a23455 More WIP: eliminate all usage of (platform-specific) Tcl_WinTCharToUtf()/Tcl_WinUtfToTChar() to its proposed portable replacements: Tcl_Utf16ToUtfDString()/Tcl_UtfToUtf16DString()
This allows for Tcl_WinTCharToUtf()/Tcl_WinUtfToTChar() to be declared deprecated.
2019-05-22 07:32:37 +00:00
dgp 28cc8c889e merge 8.7 2019-05-17 14:42:44 +00:00
jan.nijtmans f51c5464dc Merge 8.7 2019-05-17 14:22:50 +00:00
jan.nijtmans 3a37a573a2 Merge 8.7 2019-05-13 21:55:28 +00:00
dgp 7278c6fb2c Complete doc changes for TIP 543 in Tcl 8.7 2019-05-11 14:43:06 +00:00
dgp 0c863ddec8 Start of TIP 543 implementation. 2019-05-10 20:30:41 +00:00
jan.nijtmans 7b90ffbb48 merge 8.7 2019-05-10 07:46:32 +00:00
jan.nijtmans d5c3b7ac25 Complete implementation for MSVC (even building minigzip) 2019-04-10 19:53:39 +00:00
jan.nijtmans fbf45e053a Merge 8.7. Complete implementation for MSVC and for UNIX. 2019-04-09 19:21:38 +00:00
jan.nijtmans bb3ef94985 Merge 8.7. Intended operation completed for mingw-w64 (but not yet for other compilers/platforms) 2019-04-08 19:06:57 +00:00
jan.nijtmans 4865914200 Merge 8.7. Add checks for libtommath library to configure script (experimental) 2019-04-06 20:41:21 +00:00
jan.nijtmans 889e874282 Merge 8.7
Undo Tcl-specific changes in bn_mp_sqrt.c, and re-enable the two disabled test-cases: This proves the observed crash with DIBIT_BIT=60 is caused by those Tcl-specific changes!
2019-04-04 21:31:01 +00:00
jan.nijtmans f9eb1833d2 Merge 8.7 2019-04-03 19:52:38 +00:00
jan.nijtmans 7d8a7adc9f (temporary workaround): Mark expr-47.12 and expr-47.13 as nonPortable: Those are the test-cases failing with DIGIT_BIT=60 on MacOSX but not on other platforms. To be investigated further! 2019-03-31 20:45:46 +00:00
jan.nijtmans d1a1ae5194 Merge 8.7 2019-03-28 22:49:59 +00:00
jan.nijtmans 3664f127cd More complete typedef for mp_word, for MP_8BIT and MP_16BIT as well. 2019-03-28 22:42:56 +00:00
jan.nijtmans b3664a2eaa Experiment: On platforms which support it (gcc), compiled libtommath with DIGIT_BIT=60 2019-03-28 21:44:39 +00:00
jan.nijtmans 388ed8fba7 Merge 8.7 2019-03-24 13:05:07 +00:00
jan.nijtmans ebd469c2a8 Merge 8.7. Also fix invalid reference to TclUtfToWChar, causing build failure 2019-03-21 20:28:49 +00:00
jan.nijtmans d8c1fbed81 Merge 8.7 2019-03-20 22:54:13 +00:00
jan.nijtmans 301062d3fb Add 4 new encodings, and add documentation. 2019-03-18 20:07:15 +00:00
jan.nijtmans 6d0e92b89e More WIP. Seems to be *almost* working. 2019-03-17 22:01:42 +00:00
jan.nijtmans bc2c8431fc Merge 8.7
Move up some stub entries related to Tcl_UniChar
Use TCL_UTF_MAX=4 for full Unicode in stead of TCL_UTF_MAX=6 (TCL_UTF_MAX: 3 is default)
2019-03-16 21:10:20 +00:00
jan.nijtmans 842878d2d0 Merge 8.7.
Fix 2 test-cases which were failing for TCL_UTF_MAX=6
2019-03-14 20:59:28 +00:00
jan.nijtmans da96c53041 Even better support for -DTCL_UTF_MAX=6. Ongoing improvements (TIP being planned) 2019-03-12 20:39:42 +00:00
dgp 03405163b7 merge 8.7 2019-02-25 17:46:36 +00:00
dgp 995a8579cf merge 8.7 2018-12-14 21:33:25 +00:00
dgp e32b5b3f8a merge 8.7 2018-11-19 16:13:52 +00:00
dgp b0122226ed merge 8.7 2018-11-15 18:07:47 +00:00
dgp e326690201 Bump to version 8.7a3 for release. 2018-11-14 17:52:35 +00:00
270 changed files with 7678 additions and 5667 deletions
+18
View File
@@ -1,4 +1,22 @@
compat/zlib/win32/zdll.lib
compat/zlib/win32/zlib1.dll
compat/zlib/win64/zdll.lib
compat/zlib/win64/zlib1.dll
compat/zlib/win64/libz.dll.a
compat/zlib/zlib.3.pdf
compat/zlib/win32/zdll.lib
compat/zlib/win32/zlib1.dll
compat/zlib/win64/zdll.lib
compat/zlib/win64/zlib1.dll
compat/zlib/win64/libz.dll.a
compat/zlib/zlib.3.pdf
libtommath/win32/tommath.lib
libtommath/win32/libtommath.dll
libtommath/win64/tommath.lib
libtommath/win64/libtommath.dll
libtommath/win64/libtommath.dll.a
*.a
*.bmp
*.dll
*.exe
*.gif
+95 -93
View File
@@ -6,49 +6,50 @@ matrix:
# Testing on Linux with various compilers
- name: "Linux/GCC/Shared"
os: linux
dist: xenial
dist: bionic
compiler: gcc
env:
- BUILD_DIR=unix
- name: "Linux/GCC/Shared: UTF_MAX=6"
- name: "Linux/GCC/Shared: UTF_MAX=4"
os: linux
dist: xenial
dist: bionic
compiler: gcc
env:
- BUILD_DIR=unix
- CFGOPT=CFLAGS=-DTCL_UTF_MAX=6
- name: "Linux/GCC/Shared: UTF_MAX=3"
os: linux
dist: xenial
compiler: gcc
env:
- BUILD_DIR=unix
- CFGOPT=CFLAGS=-DTCL_UTF_MAX=3
- CFGOPT=CFLAGS=-DTCL_UTF_MAX=4
- name: "Linux/GCC/Shared: NO_DEPRECATED"
os: linux
dist: xenial
dist: bionic
compiler: gcc
env:
- BUILD_DIR=unix
- CFGOPT="CFLAGS=-DTCL_NO_DEPRECATED=1"
- name: "Linux/GCC/Static"
os: linux
dist: xenial
dist: bionic
compiler: gcc
env:
- CFGOPT="--disable-shared"
- BUILD_DIR=unix
- name: "Linux/GCC/Debug"
os: linux
dist: xenial
dist: bionic
compiler: gcc
env:
- BUILD_DIR=unix
- CFGOPT="--enable-symbols"
# C++ build.
- name: "Linux/G++/Shared"
os: linux
dist: bionic
compiler: g++
env:
- BUILD_DIR=unix
- CFGOPT="CC=g++ CFLAGS=-Dregister=dont+use+register"
# Older versions of GCC...
- name: "Linux/GCC 7/Shared"
os: linux
dist: xenial
dist: bionic
compiler: gcc-7
addons:
apt:
@@ -60,7 +61,7 @@ matrix:
- BUILD_DIR=unix
- name: "Linux/GCC 6/Shared"
os: linux
dist: xenial
dist: bionic
compiler: gcc-6
addons:
apt:
@@ -72,7 +73,7 @@ matrix:
- BUILD_DIR=unix
- name: "Linux/GCC 5/Shared"
os: linux
dist: xenial
dist: bionic
compiler: gcc-5
addons:
apt:
@@ -82,39 +83,13 @@ matrix:
- g++-5
env:
- BUILD_DIR=unix
- name: "Linux/GCC 4.9/Shared"
os: linux
dist: xenial
compiler: gcc-4.9
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-4.9
env:
- BUILD_DIR=unix
# Clang
- name: "Linux/Clang/Shared"
os: linux
dist: xenial
dist: bionic
compiler: clang
env:
- BUILD_DIR=unix
- name: "Linux/Clang/Shared: UTF_MAX=6"
os: linux
dist: xenial
compiler: clang
env:
- BUILD_DIR=unix
- CFGOPT=CFLAGS=-DTCL_UTF_MAX=6
- name: "Linux/Clang/Shared: UTF_MAX=3"
os: linux
dist: xenial
compiler: clang
env:
- BUILD_DIR=unix
- CFGOPT=CFLAGS=-DTCL_UTF_MAX=3
- name: "Linux/Clang/Shared:NO_DEPRECATED"
os: linux
dist: xenial
@@ -124,27 +99,27 @@ matrix:
- CFGOPT="CFLAGS=-DTCL_NO_DEPRECATED=1"
- name: "Linux/Clang/Static"
os: linux
dist: xenial
dist: bionic
compiler: clang
env:
- CFGOPT="--disable-shared"
- BUILD_DIR=unix
- name: "Linux/Clang/Debug"
os: linux
dist: xenial
dist: bionic
compiler: clang
env:
- BUILD_DIR=unix
- CFGOPT="--enable-symbols"
# Testing on Mac, various styles
- name: "macOS/Xcode 11/Shared/Unix-like"
- name: "macOS/Xcode 11.3/Shared/Unix-like"
os: osx
osx_image: xcode11
osx_image: xcode11.3
env:
- BUILD_DIR=unix
- name: "macOS/Xcode 11/Shared"
- name: "macOS/Xcode 11.3/Shared"
os: osx
osx_image: xcode11
osx_image: xcode11.3
env:
- BUILD_DIR=macosx
install: []
@@ -152,6 +127,17 @@ matrix:
- make all
# The styles=develop avoids some weird problems on OSX
- make test styles=develop
addons:
homebrew:
packages:
- libtommath
- name: "macOS/Xcode 11/Shared"
os: osx
osx_image: xcode11
env:
- BUILD_DIR=macosx
install: []
script: *mactest
- name: "macOS/Xcode 10/Shared"
os: osx
osx_image: xcode10.3
@@ -159,6 +145,10 @@ matrix:
- BUILD_DIR=macosx
install: []
script: *mactest
addons:
homebrew:
packages:
- libtommath
- name: "macOS/Xcode 9/Shared"
os: osx
osx_image: xcode9
@@ -166,6 +156,10 @@ matrix:
- BUILD_DIR=macosx
install: []
script: *mactest
addons:
homebrew:
packages:
- libtommath
- name: "macOS/Xcode 8/Shared"
os: osx
osx_image: xcode8
@@ -173,11 +167,15 @@ matrix:
- BUILD_DIR=macosx
install: []
script: *mactest
addons:
homebrew:
packages:
- libtommath
# Test with mingw-w64 cross-compile
# Doesn't run tests because wine is only an imperfect Windows emulation
- name: "Linux-cross-Windows/GCC/Shared/no test"
os: linux
dist: xenial
dist: bionic
compiler: x86_64-w64-mingw32-gcc
addons:
apt:
@@ -198,7 +196,7 @@ matrix:
# Doesn't run tests because wine is only an imperfect Windows emulation
- name: "Linux-cross-Windows-32/GCC/Shared/no test"
os: linux
dist: xenial
dist: bionic
compiler: i686-w64-mingw32-gcc
addons:
apt:
@@ -224,17 +222,17 @@ matrix:
- cd ${BUILD_DIR}
install: []
script:
- cmd.exe /C 'vcvarsall.bat x64 && nmake -f makefile.vc all tcltest'
- cmd.exe /C 'vcvarsall.bat x64 && nmake -f makefile.vc test'
- name: "Windows/MSVC/Shared: UTF_MAX=6"
- cmd.exe //C vcvarsall.bat x64 '&&' nmake '-f' makefile.vc all tcltest
- cmd.exe //C vcvarsall.bat x64 '&&' nmake '-f' makefile.vc test
- name: "Windows/MSVC/Shared: UTF_MAX=4"
os: windows
compiler: cl
env: *vcenv
before_install: *vcpreinst
install: []
script:
- cmd.exe /C 'vcvarsall.bat x64 && nmake OPTS=utfmax -f makefile.vc all tcltest'
- cmd.exe /C 'vcvarsall.bat x64 && nmake OPTS=utfmax -f makefile.vc test'
- cmd.exe //C vcvarsall.bat x64 '&&' nmake 'OPTS=utfmax' '-f' makefile.vc all tcltest
- cmd.exe //C vcvarsall.bat x64 '&&' nmake 'OPTS=utfmax' '-f' makefile.vc test
- name: "Windows/MSVC/Shared: NO_DEPRECATED"
os: windows
compiler: cl
@@ -242,8 +240,8 @@ matrix:
before_install: *vcpreinst
install: []
script:
- cmd.exe /C 'vcvarsall.bat x64 && nmake OPTS=nodep -f makefile.vc all tcltest'
- cmd.exe /C 'vcvarsall.bat x64 && nmake OPTS=nodep -f makefile.vc test'
- cmd.exe //C vcvarsall.bat x64 '&&' nmake 'OPTS=nodep' '-f' makefile.vc all tcltest
- cmd.exe //C vcvarsall.bat x64 '&&' nmake 'OPTS=nodep' '-f' makefile.vc test
- name: "Windows/MSVC/Static"
os: windows
compiler: cl
@@ -251,8 +249,8 @@ matrix:
before_install: *vcpreinst
install: []
script:
- cmd.exe /C 'vcvarsall.bat x64 && nmake OPTS=static -f makefile.vc all tcltest'
- cmd.exe /C 'vcvarsall.bat x64 && nmake OPTS=static -f makefile.vc test'
- cmd.exe //C vcvarsall.bat x64 '&&' nmake 'OPTS=static,msvcrt' '-f' makefile.vc all tcltest
- cmd.exe //C vcvarsall.bat x64 '&&' nmake 'OPTS=static,msvcrt' '-f' makefile.vc test
- name: "Windows/MSVC/Debug"
os: windows
compiler: cl
@@ -260,8 +258,8 @@ matrix:
before_install: *vcpreinst
install: []
script:
- cmd.exe /C 'vcvarsall.bat x64 && nmake OPTS=symbols -f makefile.vc all tcltest'
- cmd.exe /C 'vcvarsall.bat x64 && nmake OPTS=symbols -f makefile.vc test'
- cmd.exe //C vcvarsall.bat x64 '&&' nmake 'OPTS=symbols' '-f' makefile.vc all tcltest
- cmd.exe //C vcvarsall.bat x64 '&&' nmake 'OPTS=symbols' '-f' makefile.vc test
# Test on Windows with MSVC native (32-bit)
- name: "Windows/MSVC-x86/Shared"
os: windows
@@ -270,17 +268,17 @@ matrix:
before_install: *vcpreinst
install: []
script:
- cmd.exe /C 'vcvarsall.bat x86 && nmake -f makefile.vc all tcltest'
- cmd.exe /C 'vcvarsall.bat x86 && nmake -f makefile.vc test'
- name: "Windows/MSVC-x86/Shared: UTF_MAX=6"
- cmd.exe //C vcvarsall.bat x86 '&&' nmake '-f' makefile.vc all tcltest
- cmd.exe //C vcvarsall.bat x86 '&&' nmake '-f' makefile.vc test
- name: "Windows/MSVC-x86/Shared: UTF_MAX=4"
os: windows
compiler: cl
env: *vcenv
before_install: *vcpreinst
install: []
script:
- cmd.exe /C 'vcvarsall.bat x86 && nmake OPTS=utfmax -f makefile.vc all tcltest'
- cmd.exe /C 'vcvarsall.bat x86 && nmake OPTS=utfmax -f makefile.vc test'
- cmd.exe //C vcvarsall.bat x86 '&&' nmake 'OPTS=utfmax' '-f' makefile.vc all tcltest
- cmd.exe //C vcvarsall.bat x86 '&&' nmake 'OPTS=utfmax' '-f' makefile.vc test
- name: "Windows/MSVC-x86/Shared: NO_DEPRECATED"
os: windows
compiler: cl
@@ -288,8 +286,8 @@ matrix:
before_install: *vcpreinst
install: []
script:
- cmd.exe /C 'vcvarsall.bat x86 && nmake OPTS=nodep -f makefile.vc all tcltest'
- cmd.exe /C 'vcvarsall.bat x86 && nmake OPTS=nodep -f makefile.vc test'
- cmd.exe //C vcvarsall.bat x86 '&&' nmake 'OPTS=nodep' '-f' makefile.vc all tcltest
- cmd.exe //C vcvarsall.bat x86 '&&' nmake 'OPTS=nodep' '-f' makefile.vc test
- name: "Windows/MSVC-x86/Static"
os: windows
compiler: cl
@@ -297,8 +295,8 @@ matrix:
before_install: *vcpreinst
install: []
script:
- cmd.exe /C 'vcvarsall.bat x86 && nmake OPTS=static -f makefile.vc all tcltest'
- cmd.exe /C 'vcvarsall.bat x86 && nmake OPTS=static -f makefile.vc test'
- cmd.exe //C vcvarsall.bat x86 '&&' nmake 'OPTS=static,msvcrt' '-f' makefile.vc all tcltest
- cmd.exe //C vcvarsall.bat x86 '&&' nmake 'OPTS=static,msvcrt' '-f' makefile.vc test
- name: "Windows/MSVC-x86/Debug"
os: windows
compiler: cl
@@ -306,8 +304,8 @@ matrix:
before_install: *vcpreinst
install: []
script:
- cmd.exe /C 'vcvarsall.bat x86 && nmake OPTS=symbols -f makefile.vc all tcltest'
- cmd.exe /C 'vcvarsall.bat x86 && nmake OPTS=symbols -f makefile.vc test'
- cmd.exe //C vcvarsall.bat x86 '&&' nmake 'OPTS=symbols' '-f' makefile.vc all tcltest
- cmd.exe //C vcvarsall.bat x86 '&&' nmake 'OPTS=symbols' '-f' makefile.vc test
# Test on Windows with GCC native
- name: "Windows/GCC/Shared"
os: windows
@@ -316,21 +314,14 @@ matrix:
- BUILD_DIR=win
- CFGOPT="--enable-64bit"
before_install: &makepreinst
- choco install make
- choco install -y make zip
- cd ${BUILD_DIR}
- name: "Windows/GCC/Shared: UTF_MAX=6"
- name: "Windows/GCC/Shared: UTF_MAX=4"
os: windows
compiler: gcc
env:
- BUILD_DIR=win
- CFGOPT="--enable-64bit CFLAGS=-DTCL_UTF_MAX=6"
before_install: *makepreinst
- name: "Windows/GCC/Shared: UTF_MAX=3"
os: windows
compiler: gcc
env:
- BUILD_DIR=win
- CFGOPT="--enable-64bit CFLAGS=-DTCL_UTF_MAX=3"
- CFGOPT="--enable-64bit CFLAGS=-DTCL_UTF_MAX=4"
before_install: *makepreinst
- name: "Windows/GCC/Shared: NO_DEPRECATED"
os: windows
@@ -339,6 +330,15 @@ matrix:
- BUILD_DIR=win
- CFGOPT="--enable-64bit CFLAGS=-DTCL_NO_DEPRECATED=1"
before_install: *makepreinst
- name: "Windows/G++/Shared"
os: windows
compiler: g++
env:
- BUILD_DIR=win
- CFGOPT="CC=g++ --enable-64bit"
before_install: *makepreinst
script:
- make all tcltest
- name: "Windows/GCC/Static"
os: windows
compiler: gcc
@@ -360,19 +360,12 @@ matrix:
env:
- BUILD_DIR=win
before_install: *makepreinst
- name: "Windows/GCC-x86/Shared: UTF_MAX=6"
- name: "Windows/GCC-x86/Shared: UTF_MAX=4"
os: windows
compiler: gcc
env:
- BUILD_DIR=win
- CFGOPT="CFLAGS=-DTCL_UTF_MAX=6"
before_install: *makepreinst
- name: "Windows/GCC-x86/Shared: UTF_MAX=3"
os: windows
compiler: gcc
env:
- BUILD_DIR=win
- CFGOPT="CFLAGS=-DTCL_UTF_MAX=3"
- CFGOPT="CFLAGS=-DTCL_UTF_MAX=4"
before_install: *makepreinst
- name: "Windows/GCC-x86/Shared: NO_DEPRECATED"
os: windows
@@ -381,6 +374,15 @@ matrix:
- BUILD_DIR=win
- CFGOPT="CFLAGS=-DTCL_NO_DEPRECATED=1"
before_install: *makepreinst
- name: "Windows/G++-x86/Shared"
os: windows
compiler: g++
env:
- BUILD_DIR=win
- CFGOPT="CC=g++"
before_install: *makepreinst
script:
- make all tcltest
- name: "Windows/GCC-x86/Static"
os: windows
compiler: gcc
+1 -1
View File
@@ -1,6 +1,6 @@
# README: Tcl
This is the **Tcl 8.7a2** source distribution.
This is the **Tcl 8.7a4** source distribution.
You can get any source release of Tcl from [our distribution
site](https://sourceforge.net/projects/tcl/files/Tcl/).
+202 -32
View File
@@ -8796,6 +8796,55 @@ improvements to regexp engine from Postgres (lane,porter,fellows,seltenreich)
--- Released 8.6.7, August 9, 2017 --- https://core.tcl-lang.org/tcl/ for details
Changes to 8.7a1 include all changes to the 8.6 line through 8.6.7,
plus the following, which focuses on the high-level feature changes
in this changeset (new minor version) rather than bug fixes:
2016-03-17 (bug)[0b8c38] socket accept callbacks always in global ns (porter)
*** POTENTIAL INCOMPATIBILITY ***
2016-07-01 Hack accommodations for legacy Itcl 3 disabled (porter)
2016-07-12 Make TCL_HASH_TYPE build-time configurable (nijtmans)
2016-07-19 (bug)[0363f0] Partial array search ID reform (porter)
2016-07-19 (feature removed) Tcl_ObjType "array search" unregistered (porter)
*** POTENTIAL INCOMPATIBILITY for Tcl_GetObjType("array search") ***
2016-10-04 Server socket on port 0 chooses port supporting IPv4 * IPv6 (max)
2016-11-25 [array names -regexp] supports backrefs (goth)
2017-01-04 (TIP 456) New routine Tcl_OpenTcpServerEx() (limeboy)
2017-01-04 (TIP 459) New subcommand [package files] (nijtmans)
2017-01-16 threaded allocator initialization repair (vasiljevic,nijtmans)
2017-01-30 Add to Win shell builtins: assoc ftype move (ashok)
2017-03-31 TCL_MEM_DEBUG facilities better support 64-bit memory (nijtmans)
2017-04-13 \u escaped content in msg files converted to true utf-8 (nijtmans)
2017-05-18 (TIP 458) New epoll or kqueue notifiers are default (alborboz)
2017-05-31 Purge build support for SunOS-4.* (stu)
2017-06-22 (TIP 463) New option [regsub ... -command ...] (fellows)
2017-06-22 (TIP 470) Tcl_GetDefineContextObject();[oo::define [self]] (fellows)
=> TclOO 1.2.0
2017-06-23 (TIP 472) Support 0d as prefix of decimal numbers (iyer,griffin)
2017-08-31 (bug)[2a9465] http state 100 continue handling broken (oehlmann)
2017-09-02 (bug)[0e4d88] replace command, delete trace kills namespace (porter)
--- Released 8.7a1, September 8, 2017 --- http://core.tcl.tk/tcl/ for details
2017-08-10 [array names -regexp] supports backrefs (goth)
2017-08-10 Fix gcc build failures due to #pragma placement (cassoff,fellows)
@@ -8895,58 +8944,179 @@ improvements to regexp engine from Postgres (lane,porter,fellows,seltenreich)
- Released 8.6.9, November 16, 2018 - details at http://core.tcl-lang.org/tcl/ -
Changes to 8.7a1 include all changes to the 8.6 line through 8.6.7,
2018-11-22 (bug)[7a9dc5] [file normalize ~/~foo] segfault (sebres)
2018-12-30 (bug)[3cf3a9] variable 'timezone' deprecated in vc2017 (nijtmans)
2019-01-09 (bug)[cc1e91] [list [list {*}[set a " "]]] regression (sebres)
2019-02-01 (bug)[e3f481] tests var-1.2[01] (sebres)
2019-03-01 (new) Update to Unicode 12.0 (nijtmans)
2019-03-05 (new)[TIP 527] New command [timerate] (sebres)
2019-03-08 (bug)[39fed4] [package require] memory validity (hume,porter)
2019-04-23 (new) New command tcl::unsupported::corotype (fellows)
2019-05-04 (bug) memlink when namespace deletion kills linked var (porter)
2019-05-28 (new) README file converted to README.md in Markdown (nijtmans)
2019-06-17 (bug)[8b9854] [info level 0] regression with ensembles (porter)
2019-06-20 (bug)[6bdadf] crash multi-arg write-traced [lappend] (fellows,porter)
2019-06-21 (bug)[f8a33c] crash Tcl_Exit before init (brooks,sebres)
2019-08-27 (bug)[fa6bf3] Bytecode fails epoch recovery at numLevel=0 (sebres)
2019-08-29 (bug)[fec0c1] C stack overflow compiling bytecode (ade,sebres)
2019-09-12 tzdata updated to Olson's tzdata2019c (jima)
2019-09-20 (new) registry/dde no longer need -DUNICODE (nijtmans)
=> registry 1.3.4
=> dde 1.4.2
2019-10-02 (bug)[16768d] Fix [info hostname] on NetBSD (rytaro)
2019-10-23 (new) libtommath updated to release 1.2.0 (nijtmans)
2019-10-25 OSX: system Tcl deprecated. End default use of its packages. (walzer)
2019-10-28 (bug)[bcd100] bad fs cache when system encoding changes (coulter)
2019-11-15 (bug)[135804] segfault in [next] after destroy (coulter,sebres)
- Released 8.6.10, Nov 21, 2019 - details at http://core.tcl-lang.org/tcl/ -
Changes to 8.7a3 include all changes to the 8.6 line through 8.6.10,
plus the following, which focuses on the high-level feature changes
in this changeset (new minor version) rather than bug fixes:
2016-03-17 (bug)[0b8c38] socket accept callbacks always in global ns (porter)
*** POTENTIAL INCOMPATIBILITY ***
2017-11-01 (bug)[3c32a3] crash deleting class mixed into instance (coulter)
2016-07-01 Hack accommodations for legacy Itcl 3 disabled (porter)
2017-11-03 [TIP 345] eliminate the encoding 'identity' (porter)
2016-07-12 Make TCL_HASH_TYPE build-time configurable (nijtmans)
2017-11-04 (bug)[0d902e] [string first] on ASCII stored as Unicode (fellows)
2016-07-19 (bug)[0363f0] Partial array search ID reform (porter)
2017-11-17 [TIP 422] Mark all Tcl_*VA() routines deprecated. (nijtmans)
2016-07-19 (feature removed) Tcl_ObjType "array search" unregistered (porter)
*** POTENTIAL INCOMPATIBILITY for Tcl_GetObjType("array search") ***
2017-11-20 (support) Ended use of the obsolete values.h header (culler)
2016-10-04 Server socket on port 0 chooses port supporting IPv4 * IPv6 (max)
2017-11-30 (bug)[8e1e31] [lsort] ordering of U+0000 (nijtmans)
2016-11-25 [array names -regexp] supports backrefs (goth)
2017-12-07 [TIP 487] Terminate support for pre-XP Windows (nijtmans)
2017-01-04 (TIP 456) New routine Tcl_OpenTcpServerEx() (limeboy)
2017-12-08 [TIP 477] Reform of nmake build (nadkarni)
2017-01-04 (TIP 459) New subcommand [package files] (nijtmans)
2017-12-20 (bug)[ba1419] Crash: complex ensemble delete, namespace-7.8 (coulter)
2017-01-16 threaded allocator initialization repair (vasiljevic,nijtmans)
2018-01-17 [TIP 485] Removal of many deprecated features (nijtmans)
2017-01-30 Add to Win shell builtins: assoc ftype move (ashok)
2018-01-27 (bug) Crash in [join $l $l], join-4.1 (porter)
2017-03-31 TCL_MEM_DEBUG facilities better support 64-bit memory (nijtmans)
2018-02-06 [TIP 493] Cease Distribution of http 1.0 (porter)
2017-04-13 \u escaped content in msg files converted to true utf-8 (nijtmans)
2018-02-06 [TIP 484] internal rep for native ints are all 64-bit (nijtmans)
2017-05-18 (TIP 458) New epoll or kqueue notifiers are default (alborboz)
2018-02-14 [TIP 476] Scan/Printf consistency (nijtmans)
2017-05-31 Purge build support for SunOS-4.* (stu)
2018-03-05 [TIP 351] [lsearch] striding
2017-06-22 (TIP 463) New option [regsub ... -command ...] (fellows)
2018-03-05 [TIPs 330,336] tighten access to Interp fields (porter)
2017-06-22 (TIP 470) Tcl_GetDefineContextObject();[oo::define [self]] (fellows)
=> TclOO 1.2.0
2018-03-12 [TIP 462] [::tcl::process]
2017-06-23 (TIP 472) Support 0d as prefix of decimal numbers (iyer,griffin)
2018-03-12 [TIP 490] add oo support for msgcat => msgcat 1.7.0 (oehlmann)
2017-08-31 (bug)[2a9465] http state 100 continue handling broken (oehlmann)
2017-09-02 (bug)[0e4d88] replace command, delete trace kills namespace (porter)
--- Released 8.7a1, September 8, 2017 --- http://core.tcl.tk/tcl/ for details
2018-03-12 (TIP 490) add oo support for msgcat => msgcat 1.7.0 (oehlmann)
2018-03-12 (TIP 499) custom locale preference list (oehlmann)
2018-03-12 [TIP 499] custom locale preference list (oehlmann)
=> msgcat 1.7.0
- Released 8.7a3, Nov 30, 2018 --- http://core.tcl-lang.org/tcl/ for details -
2018-03-20 [TIP 503] End CONST84 support for Tcl 8.3 (porter)
2018-03-30 Refactored [lrange] (spjuth)
2018-04-20 [TIP 389] Unicode beyond BMP (nijtmans)
2018-04-20 [TIP 421] [array for]
2018-05-11 [TIP 425] Windows panic callback use of UTF-8
2018-05-17 [TIP 491] Phase out --disable-threads support
2018-06-03 [TIP 500] TclOO Private Methods and Variables
2018-07-26 (bug)[ba921a] [string cat] of bytearrays (coulter,porter)
2018-09-02 [TIP 478] Many new features in TclOO (lester,fellows)
2018-09-04 (bug)[540bed] [binary format w] from bignum (nijtmans)
2018-09-12 [TIP 430] zipfs and embedded script library (woods)
2018-09-26 [TIP 508] [array default] (bonnet,fellows)
2018-09-27 [TIP 515] level value reform (nijtmans)
2018-09-27 [TIP 516] More OO slot operations (fellows)
2018-09-27 [TIP 426] [info cmdtype] (fellows)
2018-09-28 [TIP 509] Cross platform reentrant mutex
2018-10-08 [TIP 514] native integers are 64-bit
2018-10-12 [TIP 502] index value reform (porter)
2018-11-06 [TIP 406] http cookies (fellows)
2018-11-06 [TIP 445] Tcl_ObjType utilities (migrate to Tcl 9) (porter)
2018-11-06 [TIP 501] [string is dict]
2018-11-06 [TIP 519] inline export/unexport option for [oo::define]
2018-11-06 [TIP 523] [lpop]
2018-11-06 [TIP 524] TclOO custom dialects
2018-11-06 [TIP 506] Tcl_(Incr|Decr)RefCount macros -> functions (porter)
2018-11-15 [TIP 512] No stub for Tcl_SetExitProc()
2019-04-08 (bug)[45b9fa] crash in [try] (coulter)
2019-04-14 [TIP 160] terminal and serial channel controls
2019-04-14 [TIP 312] more types for Tcl_LinkVar
2019-04-14 [TIP 367] [lremove]
2019-04-14 [TIP 504] [string insert]
2019-04-16 [TIP 342] [dict getwithdefault]
2019-05-25 [TIP 431] [file tempdir]
2019-05-25 [TIP 383] [coroinject], [coroprobe]
2019-05-31 [TIP 544] Tcl_GetIntForIndex()
2019-06-12 Replace TclOffset() with offsetof()
2019-06-15 [TIP 461] string compare operators for [expr]
2019-06-16 [TIP 521] floating point classification functions for [expr]
2019-06-20 (bug)[6bdadf] crash multi-arg traced [lappend] (fellows)
2019-06-28 [TIP 547] New encodings utf-16, ucs-2
2019-09-14 [TIP 414] Tcl_InitSubsystems()
2019-09-14 [TIP 548] wchar_t conversion functions
- Released 8.7a3, Nov 21, 2019 --- http://core.tcl-lang.org/tcl/ for details -
+919
View File
@@ -0,0 +1,919 @@
/* A portable stdint.h
****************************************************************************
* BSD License:
****************************************************************************
*
* Copyright (c) 2005-2016 Paul Hsieh
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
****************************************************************************
*
* Version 0.1.16.0
*
* The ANSI C standard committee, for the C99 standard, specified the
* inclusion of a new standard include file called stdint.h. This is
* a very useful and long desired include file which contains several
* very precise definitions for integer scalar types that is critically
* important for making several classes of applications portable
* including cryptography, hashing, variable length integer libraries
* and so on. But for most developers its likely useful just for
* programming sanity.
*
* The problem is that some compiler vendors chose to ignore the C99
* standard and some older compilers have no opportunity to be updated.
* Because of this situation, simply including stdint.h in your code
* makes it unportable.
*
* So that's what this file is all about. It's an attempt to build a
* single universal include file that works on as many platforms as
* possible to deliver what stdint.h is supposed to. Even compilers
* that already come with stdint.h can use this file instead without
* any loss of functionality. A few things that should be noted about
* this file:
*
* 1) It is not guaranteed to be portable and/or present an identical
* interface on all platforms. The extreme variability of the
* ANSI C standard makes this an impossibility right from the
* very get go. Its really only meant to be useful for the vast
* majority of platforms that possess the capability of
* implementing usefully and precisely defined, standard sized
* integer scalars. Systems which are not intrinsically 2s
* complement may produce invalid constants.
*
* 2) There is an unavoidable use of non-reserved symbols.
*
* 3) Other standard include files are invoked.
*
* 4) This file may come in conflict with future platforms that do
* include stdint.h. The hope is that one or the other can be
* used with no real difference.
*
* 5) In the current version, if your platform can't represent
* int32_t, int16_t and int8_t, it just dumps out with a compiler
* error.
*
* 6) 64 bit integers may or may not be defined. Test for their
* presence with the test: #ifdef INT64_MAX or #ifdef UINT64_MAX.
* Note that this is different from the C99 specification which
* requires the existence of 64 bit support in the compiler. If
* this is not defined for your platform, yet it is capable of
* dealing with 64 bits then it is because this file has not yet
* been extended to cover all of your system's capabilities.
*
* 7) (u)intptr_t may or may not be defined. Test for its presence
* with the test: #ifdef PTRDIFF_MAX. If this is not defined
* for your platform, then it is because this file has not yet
* been extended to cover all of your system's capabilities, not
* because its optional.
*
* 8) The following might not been defined even if your platform is
* capable of defining it:
*
* WCHAR_MIN
* WCHAR_MAX
* (u)int64_t
* PTRDIFF_MIN
* PTRDIFF_MAX
* (u)intptr_t
*
* 9) The following have not been defined:
*
* WINT_MIN
* WINT_MAX
*
* 10) The criteria for defining (u)int_least(*)_t isn't clear,
* except for systems which don't have a type that precisely
* defined 8, 16, or 32 bit types (which this include file does
* not support anyways). Default definitions have been given.
*
* 11) The criteria for defining (u)int_fast(*)_t isn't something I
* would trust to any particular compiler vendor or the ANSI C
* committee. It is well known that "compatible systems" are
* commonly created that have very different performance
* characteristics from the systems they are compatible with,
* especially those whose vendors make both the compiler and the
* system. Default definitions have been given, but its strongly
* recommended that users never use these definitions for any
* reason (they do *NOT* deliver any serious guarantee of
* improved performance -- not in this file, nor any vendor's
* stdint.h).
*
* 12) The following macros:
*
* PRINTF_INTMAX_MODIFIER
* PRINTF_INT64_MODIFIER
* PRINTF_INT32_MODIFIER
* PRINTF_INT16_MODIFIER
* PRINTF_LEAST64_MODIFIER
* PRINTF_LEAST32_MODIFIER
* PRINTF_LEAST16_MODIFIER
* PRINTF_INTPTR_MODIFIER
*
* are strings which have been defined as the modifiers required
* for the "d", "u" and "x" printf formats to correctly output
* (u)intmax_t, (u)int64_t, (u)int32_t, (u)int16_t, (u)least64_t,
* (u)least32_t, (u)least16_t and (u)intptr_t types respectively.
* PRINTF_INTPTR_MODIFIER is not defined for some systems which
* provide their own stdint.h. PRINTF_INT64_MODIFIER is not
* defined if INT64_MAX is not defined. These are an extension
* beyond what C99 specifies must be in stdint.h.
*
* In addition, the following macros are defined:
*
* PRINTF_INTMAX_HEX_WIDTH
* PRINTF_INT64_HEX_WIDTH
* PRINTF_INT32_HEX_WIDTH
* PRINTF_INT16_HEX_WIDTH
* PRINTF_INT8_HEX_WIDTH
* PRINTF_INTMAX_DEC_WIDTH
* PRINTF_INT64_DEC_WIDTH
* PRINTF_INT32_DEC_WIDTH
* PRINTF_INT16_DEC_WIDTH
* PRINTF_UINT8_DEC_WIDTH
* PRINTF_UINTMAX_DEC_WIDTH
* PRINTF_UINT64_DEC_WIDTH
* PRINTF_UINT32_DEC_WIDTH
* PRINTF_UINT16_DEC_WIDTH
* PRINTF_UINT8_DEC_WIDTH
*
* Which specifies the maximum number of characters required to
* print the number of that type in either hexadecimal or decimal.
* These are an extension beyond what C99 specifies must be in
* stdint.h.
*
* Compilers tested (all with 0 warnings at their highest respective
* settings): Borland Turbo C 2.0, WATCOM C/C++ 11.0 (16 bits and 32
* bits), Microsoft Visual C++ 6.0 (32 bit), Microsoft Visual Studio
* .net (VC7), Intel C++ 4.0, GNU gcc v3.3.3
*
* This file should be considered a work in progress. Suggestions for
* improvements, especially those which increase coverage are strongly
* encouraged.
*
* Acknowledgements
*
* The following people have made significant contributions to the
* development and testing of this file:
*
* Chris Howie
* John Steele Scott
* Dave Thorup
* John Dill
* Florian Wobbe
* Christopher Sean Morrison
* Mikkel Fahnoe Jorgensen
*
*/
#include <stddef.h>
#include <limits.h>
#include <signal.h>
/*
* For gcc with _STDINT_H, fill in the PRINTF_INT*_MODIFIER macros, and
* do nothing else. On the Mac OS X version of gcc this is _STDINT_H_.
*/
#if ((defined(__SUNPRO_C) && __SUNPRO_C >= 0x570) || (defined(_MSC_VER) && _MSC_VER >= 1600) || (defined(__STDC__) && __STDC__ && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || (defined (__WATCOMC__) && (defined (_STDINT_H_INCLUDED) || __WATCOMC__ >= 1250)) || (defined(__GNUC__) && (__GNUC__ > 3 || defined(_STDINT_H) || defined(_STDINT_H_) || defined (__UINT_FAST64_TYPE__)) )) && !defined (_PSTDINT_H_INCLUDED)
#include <stdint.h>
#define _PSTDINT_H_INCLUDED
# if defined(__GNUC__) && (defined(__x86_64__) || defined(__ppc64__)) && !(defined(__APPLE__) && defined(__MACH__))
# ifndef PRINTF_INT64_MODIFIER
# define PRINTF_INT64_MODIFIER "l"
# endif
# ifndef PRINTF_INT32_MODIFIER
# define PRINTF_INT32_MODIFIER ""
# endif
# else
# ifndef PRINTF_INT64_MODIFIER
# define PRINTF_INT64_MODIFIER "ll"
# endif
# ifndef PRINTF_INT32_MODIFIER
# if (UINT_MAX == UINT32_MAX)
# define PRINTF_INT32_MODIFIER ""
# else
# define PRINTF_INT32_MODIFIER "l"
# endif
# endif
# endif
# ifndef PRINTF_INT16_MODIFIER
# define PRINTF_INT16_MODIFIER "h"
# endif
# ifndef PRINTF_INTMAX_MODIFIER
# define PRINTF_INTMAX_MODIFIER PRINTF_INT64_MODIFIER
# endif
# ifndef PRINTF_INT64_HEX_WIDTH
# define PRINTF_INT64_HEX_WIDTH "16"
# endif
# ifndef PRINTF_UINT64_HEX_WIDTH
# define PRINTF_UINT64_HEX_WIDTH "16"
# endif
# ifndef PRINTF_INT32_HEX_WIDTH
# define PRINTF_INT32_HEX_WIDTH "8"
# endif
# ifndef PRINTF_UINT32_HEX_WIDTH
# define PRINTF_UINT32_HEX_WIDTH "8"
# endif
# ifndef PRINTF_INT16_HEX_WIDTH
# define PRINTF_INT16_HEX_WIDTH "4"
# endif
# ifndef PRINTF_UINT16_HEX_WIDTH
# define PRINTF_UINT16_HEX_WIDTH "4"
# endif
# ifndef PRINTF_INT8_HEX_WIDTH
# define PRINTF_INT8_HEX_WIDTH "2"
# endif
# ifndef PRINTF_UINT8_HEX_WIDTH
# define PRINTF_UINT8_HEX_WIDTH "2"
# endif
# ifndef PRINTF_INT64_DEC_WIDTH
# define PRINTF_INT64_DEC_WIDTH "19"
# endif
# ifndef PRINTF_UINT64_DEC_WIDTH
# define PRINTF_UINT64_DEC_WIDTH "20"
# endif
# ifndef PRINTF_INT32_DEC_WIDTH
# define PRINTF_INT32_DEC_WIDTH "10"
# endif
# ifndef PRINTF_UINT32_DEC_WIDTH
# define PRINTF_UINT32_DEC_WIDTH "10"
# endif
# ifndef PRINTF_INT16_DEC_WIDTH
# define PRINTF_INT16_DEC_WIDTH "5"
# endif
# ifndef PRINTF_UINT16_DEC_WIDTH
# define PRINTF_UINT16_DEC_WIDTH "5"
# endif
# ifndef PRINTF_INT8_DEC_WIDTH
# define PRINTF_INT8_DEC_WIDTH "3"
# endif
# ifndef PRINTF_UINT8_DEC_WIDTH
# define PRINTF_UINT8_DEC_WIDTH "3"
# endif
# ifndef PRINTF_INTMAX_HEX_WIDTH
# define PRINTF_INTMAX_HEX_WIDTH PRINTF_UINT64_HEX_WIDTH
# endif
# ifndef PRINTF_UINTMAX_HEX_WIDTH
# define PRINTF_UINTMAX_HEX_WIDTH PRINTF_UINT64_HEX_WIDTH
# endif
# ifndef PRINTF_INTMAX_DEC_WIDTH
# define PRINTF_INTMAX_DEC_WIDTH PRINTF_UINT64_DEC_WIDTH
# endif
# ifndef PRINTF_UINTMAX_DEC_WIDTH
# define PRINTF_UINTMAX_DEC_WIDTH PRINTF_UINT64_DEC_WIDTH
# endif
/*
* Something really weird is going on with Open Watcom. Just pull some of
* these duplicated definitions from Open Watcom's stdint.h file for now.
*/
# if defined (__WATCOMC__) && __WATCOMC__ >= 1250
# if !defined (INT64_C)
# define INT64_C(x) (x + (INT64_MAX - INT64_MAX))
# endif
# if !defined (UINT64_C)
# define UINT64_C(x) (x + (UINT64_MAX - UINT64_MAX))
# endif
# if !defined (INT32_C)
# define INT32_C(x) (x + (INT32_MAX - INT32_MAX))
# endif
# if !defined (UINT32_C)
# define UINT32_C(x) (x + (UINT32_MAX - UINT32_MAX))
# endif
# if !defined (INT16_C)
# define INT16_C(x) (x)
# endif
# if !defined (UINT16_C)
# define UINT16_C(x) (x)
# endif
# if !defined (INT8_C)
# define INT8_C(x) (x)
# endif
# if !defined (UINT8_C)
# define UINT8_C(x) (x)
# endif
# if !defined (UINT64_MAX)
# define UINT64_MAX 18446744073709551615ULL
# endif
# if !defined (INT64_MAX)
# define INT64_MAX 9223372036854775807LL
# endif
# if !defined (UINT32_MAX)
# define UINT32_MAX 4294967295UL
# endif
# if !defined (INT32_MAX)
# define INT32_MAX 2147483647L
# endif
# if !defined (INTMAX_MAX)
# define INTMAX_MAX INT64_MAX
# endif
# if !defined (INTMAX_MIN)
# define INTMAX_MIN INT64_MIN
# endif
# endif
#endif
/*
* I have no idea what is the truly correct thing to do on older Solaris.
* From some online discussions, this seems to be what is being
* recommended. For people who actually are developing on older Solaris,
* what I would like to know is, does this define all of the relevant
* macros of a complete stdint.h? Remember, in pstdint.h 64 bit is
* considered optional.
*/
#if (defined(__SUNPRO_C) && __SUNPRO_C >= 0x420) && !defined(_PSTDINT_H_INCLUDED)
#include <sys/inttypes.h>
#define _PSTDINT_H_INCLUDED
#endif
#ifndef _PSTDINT_H_INCLUDED
#define _PSTDINT_H_INCLUDED
#ifndef SIZE_MAX
# define SIZE_MAX ((size_t)-1)
#endif
/*
* Deduce the type assignments from limits.h under the assumption that
* integer sizes in bits are powers of 2, and follow the ANSI
* definitions.
*/
#ifndef UINT8_MAX
# define UINT8_MAX 0xff
#endif
#if !defined(uint8_t) && !defined(_UINT8_T) && !defined(vxWorks)
# if (UCHAR_MAX == UINT8_MAX) || defined (S_SPLINT_S)
typedef unsigned char uint8_t;
# define UINT8_C(v) ((uint8_t) v)
# else
# error "Platform not supported"
# endif
#endif
#ifndef INT8_MAX
# define INT8_MAX 0x7f
#endif
#ifndef INT8_MIN
# define INT8_MIN INT8_C(0x80)
#endif
#if !defined(int8_t) && !defined(_INT8_T) && !defined(vxWorks)
# if (SCHAR_MAX == INT8_MAX) || defined (S_SPLINT_S)
typedef signed char int8_t;
# define INT8_C(v) ((int8_t) v)
# else
# error "Platform not supported"
# endif
#endif
#ifndef UINT16_MAX
# define UINT16_MAX 0xffff
#endif
#if !defined(uint16_t) && !defined(_UINT16_T) && !defined(vxWorks)
#if (UINT_MAX == UINT16_MAX) || defined (S_SPLINT_S)
typedef unsigned int uint16_t;
# ifndef PRINTF_INT16_MODIFIER
# define PRINTF_INT16_MODIFIER ""
# endif
# define UINT16_C(v) ((uint16_t) (v))
#elif (USHRT_MAX == UINT16_MAX)
typedef unsigned short uint16_t;
# define UINT16_C(v) ((uint16_t) (v))
# ifndef PRINTF_INT16_MODIFIER
# define PRINTF_INT16_MODIFIER "h"
# endif
#else
#error "Platform not supported"
#endif
#endif
#ifndef INT16_MAX
# define INT16_MAX 0x7fff
#endif
#ifndef INT16_MIN
# define INT16_MIN INT16_C(0x8000)
#endif
#if !defined(int16_t) && !defined(_INT16_T) && !defined(vxWorks)
#if (INT_MAX == INT16_MAX) || defined (S_SPLINT_S)
typedef signed int int16_t;
# define INT16_C(v) ((int16_t) (v))
# ifndef PRINTF_INT16_MODIFIER
# define PRINTF_INT16_MODIFIER ""
# endif
#elif (SHRT_MAX == INT16_MAX)
typedef signed short int16_t;
# define INT16_C(v) ((int16_t) (v))
# ifndef PRINTF_INT16_MODIFIER
# define PRINTF_INT16_MODIFIER "h"
# endif
#else
#error "Platform not supported"
#endif
#endif
#ifndef UINT32_MAX
# define UINT32_MAX (0xffffffffUL)
#endif
#if !defined(uint32_t) && !defined(_UINT32_T) && !defined(vxWorks)
#if (ULONG_MAX == UINT32_MAX) || defined (S_SPLINT_S)
typedef unsigned long uint32_t;
# define UINT32_C(v) v ## UL
# ifndef PRINTF_INT32_MODIFIER
# define PRINTF_INT32_MODIFIER "l"
# endif
#elif (UINT_MAX == UINT32_MAX)
typedef unsigned int uint32_t;
# ifndef PRINTF_INT32_MODIFIER
# define PRINTF_INT32_MODIFIER ""
# endif
# define UINT32_C(v) v ## U
#elif (USHRT_MAX == UINT32_MAX)
typedef unsigned short uint32_t;
# define UINT32_C(v) ((unsigned short) (v))
# ifndef PRINTF_INT32_MODIFIER
# define PRINTF_INT32_MODIFIER ""
# endif
#else
#error "Platform not supported"
#endif
#endif
#ifndef INT32_MAX
# define INT32_MAX (0x7fffffffL)
#endif
#ifndef INT32_MIN
# define INT32_MIN INT32_C(0x80000000)
#endif
#if !defined(int32_t) && !defined(_INT32_T) && !defined(vxWorks)
#if (LONG_MAX == INT32_MAX) || defined (S_SPLINT_S)
typedef signed long int32_t;
# define INT32_C(v) v ## L
# ifndef PRINTF_INT32_MODIFIER
# define PRINTF_INT32_MODIFIER "l"
# endif
#elif (INT_MAX == INT32_MAX)
typedef signed int int32_t;
# define INT32_C(v) v
# ifndef PRINTF_INT32_MODIFIER
# define PRINTF_INT32_MODIFIER ""
# endif
#elif (SHRT_MAX == INT32_MAX)
typedef signed short int32_t;
# define INT32_C(v) ((short) (v))
# ifndef PRINTF_INT32_MODIFIER
# define PRINTF_INT32_MODIFIER ""
# endif
#else
#error "Platform not supported"
#endif
#endif
/*
* The macro stdint_int64_defined is temporarily used to record
* whether or not 64 integer support is available. It must be
* defined for any 64 integer extensions for new platforms that are
* added.
*/
#undef stdint_int64_defined
#if (defined(__STDC__) && defined(__STDC_VERSION__)) || defined (S_SPLINT_S)
# if (__STDC__ && __STDC_VERSION__ >= 199901L) || defined (S_SPLINT_S)
# define stdint_int64_defined
typedef long long int64_t;
typedef unsigned long long uint64_t;
# define UINT64_C(v) v ## ULL
# define INT64_C(v) v ## LL
# ifndef PRINTF_INT64_MODIFIER
# define PRINTF_INT64_MODIFIER "ll"
# endif
# endif
#endif
#if !defined (stdint_int64_defined)
# if defined(__GNUC__) && !defined(vxWorks)
# define stdint_int64_defined
__extension__ typedef long long int64_t;
__extension__ typedef unsigned long long uint64_t;
# define UINT64_C(v) v ## ULL
# define INT64_C(v) v ## LL
# ifndef PRINTF_INT64_MODIFIER
# define PRINTF_INT64_MODIFIER "ll"
# endif
# elif defined(__MWERKS__) || defined (__SUNPRO_C) || defined (__SUNPRO_CC) || defined (__APPLE_CC__) || defined (_LONG_LONG) || defined (_CRAYC) || defined (S_SPLINT_S)
# define stdint_int64_defined
typedef long long int64_t;
typedef unsigned long long uint64_t;
# define UINT64_C(v) v ## ULL
# define INT64_C(v) v ## LL
# ifndef PRINTF_INT64_MODIFIER
# define PRINTF_INT64_MODIFIER "ll"
# endif
# elif (defined(__WATCOMC__) && defined(__WATCOM_INT64__)) || (defined(_MSC_VER) && _INTEGRAL_MAX_BITS >= 64) || (defined (__BORLANDC__) && __BORLANDC__ > 0x460) || defined (__alpha) || defined (__DECC)
# define stdint_int64_defined
typedef __int64 int64_t;
typedef unsigned __int64 uint64_t;
# define UINT64_C(v) v ## UI64
# define INT64_C(v) v ## I64
# ifndef PRINTF_INT64_MODIFIER
# define PRINTF_INT64_MODIFIER "I64"
# endif
# endif
#endif
#if !defined (LONG_LONG_MAX) && defined (INT64_C)
# define LONG_LONG_MAX INT64_C (9223372036854775807)
#endif
#ifndef ULONG_LONG_MAX
# define ULONG_LONG_MAX UINT64_C (18446744073709551615)
#endif
#if !defined (INT64_MAX) && defined (INT64_C)
# define INT64_MAX INT64_C (9223372036854775807)
#endif
#if !defined (INT64_MIN) && defined (INT64_C)
# define INT64_MIN INT64_C (-9223372036854775808)
#endif
#if !defined (UINT64_MAX) && defined (INT64_C)
# define UINT64_MAX UINT64_C (18446744073709551615)
#endif
/*
* Width of hexadecimal for number field.
*/
#ifndef PRINTF_INT64_HEX_WIDTH
# define PRINTF_INT64_HEX_WIDTH "16"
#endif
#ifndef PRINTF_INT32_HEX_WIDTH
# define PRINTF_INT32_HEX_WIDTH "8"
#endif
#ifndef PRINTF_INT16_HEX_WIDTH
# define PRINTF_INT16_HEX_WIDTH "4"
#endif
#ifndef PRINTF_INT8_HEX_WIDTH
# define PRINTF_INT8_HEX_WIDTH "2"
#endif
#ifndef PRINTF_INT64_DEC_WIDTH
# define PRINTF_INT64_DEC_WIDTH "19"
#endif
#ifndef PRINTF_INT32_DEC_WIDTH
# define PRINTF_INT32_DEC_WIDTH "10"
#endif
#ifndef PRINTF_INT16_DEC_WIDTH
# define PRINTF_INT16_DEC_WIDTH "5"
#endif
#ifndef PRINTF_INT8_DEC_WIDTH
# define PRINTF_INT8_DEC_WIDTH "3"
#endif
#ifndef PRINTF_UINT64_DEC_WIDTH
# define PRINTF_UINT64_DEC_WIDTH "20"
#endif
#ifndef PRINTF_UINT32_DEC_WIDTH
# define PRINTF_UINT32_DEC_WIDTH "10"
#endif
#ifndef PRINTF_UINT16_DEC_WIDTH
# define PRINTF_UINT16_DEC_WIDTH "5"
#endif
#ifndef PRINTF_UINT8_DEC_WIDTH
# define PRINTF_UINT8_DEC_WIDTH "3"
#endif
/*
* Ok, lets not worry about 128 bit integers for now. Moore's law says
* we don't need to worry about that until about 2040 at which point
* we'll have bigger things to worry about.
*/
#ifdef stdint_int64_defined
typedef int64_t intmax_t;
typedef uint64_t uintmax_t;
# define INTMAX_MAX INT64_MAX
# define INTMAX_MIN INT64_MIN
# define UINTMAX_MAX UINT64_MAX
# define UINTMAX_C(v) UINT64_C(v)
# define INTMAX_C(v) INT64_C(v)
# ifndef PRINTF_INTMAX_MODIFIER
# define PRINTF_INTMAX_MODIFIER PRINTF_INT64_MODIFIER
# endif
# ifndef PRINTF_INTMAX_HEX_WIDTH
# define PRINTF_INTMAX_HEX_WIDTH PRINTF_INT64_HEX_WIDTH
# endif
# ifndef PRINTF_INTMAX_DEC_WIDTH
# define PRINTF_INTMAX_DEC_WIDTH PRINTF_INT64_DEC_WIDTH
# endif
#else
typedef int32_t intmax_t;
typedef uint32_t uintmax_t;
# define INTMAX_MAX INT32_MAX
# define UINTMAX_MAX UINT32_MAX
# define UINTMAX_C(v) UINT32_C(v)
# define INTMAX_C(v) INT32_C(v)
# ifndef PRINTF_INTMAX_MODIFIER
# define PRINTF_INTMAX_MODIFIER PRINTF_INT32_MODIFIER
# endif
# ifndef PRINTF_INTMAX_HEX_WIDTH
# define PRINTF_INTMAX_HEX_WIDTH PRINTF_INT32_HEX_WIDTH
# endif
# ifndef PRINTF_INTMAX_DEC_WIDTH
# define PRINTF_INTMAX_DEC_WIDTH PRINTF_INT32_DEC_WIDTH
# endif
#endif
/*
* Because this file currently only supports platforms which have
* precise powers of 2 as bit sizes for the default integers, the
* least definitions are all trivial. Its possible that a future
* version of this file could have different definitions.
*/
#ifndef stdint_least_defined
typedef int8_t int_least8_t;
typedef uint8_t uint_least8_t;
typedef int16_t int_least16_t;
typedef uint16_t uint_least16_t;
typedef int32_t int_least32_t;
typedef uint32_t uint_least32_t;
# define PRINTF_LEAST32_MODIFIER PRINTF_INT32_MODIFIER
# define PRINTF_LEAST16_MODIFIER PRINTF_INT16_MODIFIER
# define UINT_LEAST8_MAX UINT8_MAX
# define INT_LEAST8_MAX INT8_MAX
# define UINT_LEAST16_MAX UINT16_MAX
# define INT_LEAST16_MAX INT16_MAX
# define UINT_LEAST32_MAX UINT32_MAX
# define INT_LEAST32_MAX INT32_MAX
# define INT_LEAST8_MIN INT8_MIN
# define INT_LEAST16_MIN INT16_MIN
# define INT_LEAST32_MIN INT32_MIN
# ifdef stdint_int64_defined
typedef int64_t int_least64_t;
typedef uint64_t uint_least64_t;
# define PRINTF_LEAST64_MODIFIER PRINTF_INT64_MODIFIER
# define UINT_LEAST64_MAX UINT64_MAX
# define INT_LEAST64_MAX INT64_MAX
# define INT_LEAST64_MIN INT64_MIN
# endif
#endif
#undef stdint_least_defined
/*
* The ANSI C committee has defined *int*_fast*_t types as well. This,
* of course, defies rationality -- you can't know what will be fast
* just from the type itself. Even for a given architecture, compatible
* implementations might have different performance characteristics.
* Developers are warned to stay away from these types when using this
* or any other stdint.h.
*/
typedef int_least8_t int_fast8_t;
typedef uint_least8_t uint_fast8_t;
typedef int_least16_t int_fast16_t;
typedef uint_least16_t uint_fast16_t;
typedef int_least32_t int_fast32_t;
typedef uint_least32_t uint_fast32_t;
#define UINT_FAST8_MAX UINT_LEAST8_MAX
#define INT_FAST8_MAX INT_LEAST8_MAX
#define UINT_FAST16_MAX UINT_LEAST16_MAX
#define INT_FAST16_MAX INT_LEAST16_MAX
#define UINT_FAST32_MAX UINT_LEAST32_MAX
#define INT_FAST32_MAX INT_LEAST32_MAX
#define INT_FAST8_MIN INT_LEAST8_MIN
#define INT_FAST16_MIN INT_LEAST16_MIN
#define INT_FAST32_MIN INT_LEAST32_MIN
#ifdef stdint_int64_defined
typedef int_least64_t int_fast64_t;
typedef uint_least64_t uint_fast64_t;
# define UINT_FAST64_MAX UINT_LEAST64_MAX
# define INT_FAST64_MAX INT_LEAST64_MAX
# define INT_FAST64_MIN INT_LEAST64_MIN
#endif
#undef stdint_int64_defined
/*
* Whatever piecemeal, per compiler thing we can do about the wchar_t
* type limits.
*/
#if defined(__WATCOMC__) || defined(_MSC_VER) || defined (__GNUC__) && !defined(vxWorks)
# include <wchar.h>
# ifndef WCHAR_MIN
# define WCHAR_MIN 0
# endif
# ifndef WCHAR_MAX
# define WCHAR_MAX ((wchar_t)-1)
# endif
#endif
/*
* Whatever piecemeal, per compiler/platform thing we can do about the
* (u)intptr_t types and limits.
*/
#if (defined (_MSC_VER) && defined (_UINTPTR_T_DEFINED)) || defined (_UINTPTR_T)
# define STDINT_H_UINTPTR_T_DEFINED
#endif
#ifndef STDINT_H_UINTPTR_T_DEFINED
# if defined (__alpha__) || defined (__ia64__) || defined (__x86_64__) || defined (_WIN64) || defined (__ppc64__)
# define stdint_intptr_bits 64
# elif defined (__WATCOMC__) || defined (__TURBOC__)
# if defined(__TINY__) || defined(__SMALL__) || defined(__MEDIUM__)
# define stdint_intptr_bits 16
# else
# define stdint_intptr_bits 32
# endif
# elif defined (__i386__) || defined (_WIN32) || defined (WIN32) || defined (__ppc64__)
# define stdint_intptr_bits 32
# elif defined (__INTEL_COMPILER)
/* TODO -- what did Intel do about x86-64? */
# else
/* #error "This platform might not be supported yet" */
# endif
# ifdef stdint_intptr_bits
# define stdint_intptr_glue3_i(a,b,c) a##b##c
# define stdint_intptr_glue3(a,b,c) stdint_intptr_glue3_i(a,b,c)
# ifndef PRINTF_INTPTR_MODIFIER
# define PRINTF_INTPTR_MODIFIER stdint_intptr_glue3(PRINTF_INT,stdint_intptr_bits,_MODIFIER)
# endif
# ifndef PTRDIFF_MAX
# define PTRDIFF_MAX stdint_intptr_glue3(INT,stdint_intptr_bits,_MAX)
# endif
# ifndef PTRDIFF_MIN
# define PTRDIFF_MIN stdint_intptr_glue3(INT,stdint_intptr_bits,_MIN)
# endif
# ifndef UINTPTR_MAX
# define UINTPTR_MAX stdint_intptr_glue3(UINT,stdint_intptr_bits,_MAX)
# endif
# ifndef INTPTR_MAX
# define INTPTR_MAX stdint_intptr_glue3(INT,stdint_intptr_bits,_MAX)
# endif
# ifndef INTPTR_MIN
# define INTPTR_MIN stdint_intptr_glue3(INT,stdint_intptr_bits,_MIN)
# endif
# ifndef INTPTR_C
# define INTPTR_C(x) stdint_intptr_glue3(INT,stdint_intptr_bits,_C)(x)
# endif
# ifndef UINTPTR_C
# define UINTPTR_C(x) stdint_intptr_glue3(UINT,stdint_intptr_bits,_C)(x)
# endif
typedef stdint_intptr_glue3(uint,stdint_intptr_bits,_t) uintptr_t;
typedef stdint_intptr_glue3( int,stdint_intptr_bits,_t) intptr_t;
# else
/* TODO -- This following is likely wrong for some platforms, and does
nothing for the definition of uintptr_t. */
typedef ptrdiff_t intptr_t;
# endif
# define STDINT_H_UINTPTR_T_DEFINED
#endif
/*
* Assumes sig_atomic_t is signed and we have a 2s complement machine.
*/
#ifndef SIG_ATOMIC_MAX
# define SIG_ATOMIC_MAX ((((sig_atomic_t) 1) << (sizeof (sig_atomic_t)*CHAR_BIT-1)) - 1)
#endif
#endif
#if defined (__TEST_PSTDINT_FOR_CORRECTNESS)
/*
* Please compile with the maximum warning settings to make sure macros are
* not defined more than once.
*/
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#define glue3_aux(x,y,z) x ## y ## z
#define glue3(x,y,z) glue3_aux(x,y,z)
#define DECLU(bits) glue3(uint,bits,_t) glue3(u,bits,) = glue3(UINT,bits,_C) (0);
#define DECLI(bits) glue3(int,bits,_t) glue3(i,bits,) = glue3(INT,bits,_C) (0);
#define DECL(us,bits) glue3(DECL,us,) (bits)
#define TESTUMAX(bits) glue3(u,bits,) = ~glue3(u,bits,); if (glue3(UINT,bits,_MAX) != glue3(u,bits,)) printf ("Something wrong with UINT%d_MAX\n", bits)
#define REPORTERROR(msg) { err_n++; if (err_first <= 0) err_first = __LINE__; printf msg; }
#define X_SIZE_MAX ((size_t)-1)
int main () {
int err_n = 0;
int err_first = 0;
DECL(I,8)
DECL(U,8)
DECL(I,16)
DECL(U,16)
DECL(I,32)
DECL(U,32)
#ifdef INT64_MAX
DECL(I,64)
DECL(U,64)
#endif
intmax_t imax = INTMAX_C(0);
uintmax_t umax = UINTMAX_C(0);
char str0[256], str1[256];
sprintf (str0, "%" PRINTF_INT32_MODIFIER "d", INT32_C(2147483647));
if (0 != strcmp (str0, "2147483647")) REPORTERROR (("Something wrong with PRINTF_INT32_MODIFIER : %s\n", str0));
if (atoi(PRINTF_INT32_DEC_WIDTH) != (int) strlen(str0)) REPORTERROR (("Something wrong with PRINTF_INT32_DEC_WIDTH : %s\n", PRINTF_INT32_DEC_WIDTH));
sprintf (str0, "%" PRINTF_INT32_MODIFIER "u", UINT32_C(4294967295));
if (0 != strcmp (str0, "4294967295")) REPORTERROR (("Something wrong with PRINTF_INT32_MODIFIER : %s\n", str0));
if (atoi(PRINTF_UINT32_DEC_WIDTH) != (int) strlen(str0)) REPORTERROR (("Something wrong with PRINTF_UINT32_DEC_WIDTH : %s\n", PRINTF_UINT32_DEC_WIDTH));
#ifdef INT64_MAX
sprintf (str1, "%" PRINTF_INT64_MODIFIER "d", INT64_C(9223372036854775807));
if (0 != strcmp (str1, "9223372036854775807")) REPORTERROR (("Something wrong with PRINTF_INT32_MODIFIER : %s\n", str1));
if (atoi(PRINTF_INT64_DEC_WIDTH) != (int) strlen(str1)) REPORTERROR (("Something wrong with PRINTF_INT64_DEC_WIDTH : %s, %d\n", PRINTF_INT64_DEC_WIDTH, (int) strlen(str1)));
sprintf (str1, "%" PRINTF_INT64_MODIFIER "u", UINT64_C(18446744073709550591));
if (0 != strcmp (str1, "18446744073709550591")) REPORTERROR (("Something wrong with PRINTF_INT32_MODIFIER : %s\n", str1));
if (atoi(PRINTF_UINT64_DEC_WIDTH) != (int) strlen(str1)) REPORTERROR (("Something wrong with PRINTF_UINT64_DEC_WIDTH : %s, %d\n", PRINTF_UINT64_DEC_WIDTH, (int) strlen(str1)));
#endif
sprintf (str0, "%d %x\n", 0, ~0);
sprintf (str1, "%d %x\n", i8, ~0);
if (0 != strcmp (str0, str1)) REPORTERROR (("Something wrong with i8 : %s\n", str1));
sprintf (str1, "%u %x\n", u8, ~0);
if (0 != strcmp (str0, str1)) REPORTERROR (("Something wrong with u8 : %s\n", str1));
sprintf (str1, "%d %x\n", i16, ~0);
if (0 != strcmp (str0, str1)) REPORTERROR (("Something wrong with i16 : %s\n", str1));
sprintf (str1, "%u %x\n", u16, ~0);
if (0 != strcmp (str0, str1)) REPORTERROR (("Something wrong with u16 : %s\n", str1));
sprintf (str1, "%" PRINTF_INT32_MODIFIER "d %x\n", i32, ~0);
if (0 != strcmp (str0, str1)) REPORTERROR (("Something wrong with i32 : %s\n", str1));
sprintf (str1, "%" PRINTF_INT32_MODIFIER "u %x\n", u32, ~0);
if (0 != strcmp (str0, str1)) REPORTERROR (("Something wrong with u32 : %s\n", str1));
#ifdef INT64_MAX
sprintf (str1, "%" PRINTF_INT64_MODIFIER "d %x\n", i64, ~0);
if (0 != strcmp (str0, str1)) REPORTERROR (("Something wrong with i64 : %s\n", str1));
#endif
sprintf (str1, "%" PRINTF_INTMAX_MODIFIER "d %x\n", imax, ~0);
if (0 != strcmp (str0, str1)) REPORTERROR (("Something wrong with imax : %s\n", str1));
sprintf (str1, "%" PRINTF_INTMAX_MODIFIER "u %x\n", umax, ~0);
if (0 != strcmp (str0, str1)) REPORTERROR (("Something wrong with umax : %s\n", str1));
TESTUMAX(8);
TESTUMAX(16);
TESTUMAX(32);
#ifdef INT64_MAX
TESTUMAX(64);
#endif
#define STR(v) #v
#define Q(v) printf ("sizeof " STR(v) " = %u\n", (unsigned) sizeof (v));
if (err_n) {
printf ("pstdint.h is not correct. Please use sizes below to correct it:\n");
}
Q(int)
Q(unsigned)
Q(long int)
Q(short int)
Q(int8_t)
Q(int16_t)
Q(int32_t)
#ifdef INT64_MAX
Q(int64_t)
#endif
#if UINT_MAX < X_SIZE_MAX
printf ("UINT_MAX < X_SIZE_MAX\n");
#else
printf ("UINT_MAX >= X_SIZE_MAX\n");
#endif
printf ("%" PRINTF_INT64_MODIFIER "u vs %" PRINTF_INT64_MODIFIER "u\n", UINT_MAX, X_SIZE_MAX);
return EXIT_SUCCESS;
}
#endif
+1 -1
View File
@@ -53,7 +53,7 @@ strtol(
*/
p = string;
while (TclIsSpaceProc(*p)) {
while (isspace(UCHAR(*p))) {
p += 1;
}
+1 -1
View File
@@ -74,7 +74,7 @@ strtoul(
*/
p = string;
while (TclIsSpaceProc(*p)) {
while (isspace(UCHAR(*p))) {
p += 1;
}
if (*p == '-') {
+1
View File
@@ -43,6 +43,7 @@ static int decrypt_byte(unsigned long* pkeys, const z_crc_t* pcrc_32_tab)
unsigned temp; /* POTENTIAL BUG: temp*(temp^1) may overflow in an
* unpredictable manner on 16-bit systems; not a problem
* with any known compiler so far, though */
(void)pcrc_32_tab;
temp = ((unsigned)(*(pkeys+2)) & 0xffff) | 2;
return (int)(((temp * (temp ^ 1)) >> 8) & 0xff);
+3
View File
@@ -247,6 +247,9 @@ record instead of a value. Otherwise, it is similar to
.PP
\fBTcl_SetErrorCodeVA\fR is the same as \fBTcl_SetErrorCode\fR except that
instead of taking a variable number of arguments it takes an argument list.
Interfaces using argument lists have been found to be nonportable in practice.
This function is deprecated and will be removed in Tcl 9.0.
.PP
The procedure \fBTcl_GetErrorLine\fR is used to read the integer value
of the \fB\-errorline\fR return option without the overhead of a full
+2 -2
View File
@@ -648,8 +648,8 @@ It should call \fBTcl_BadChannelOption\fR which itself returns
unrecognized.
If \fInewValue\fR specifies a value for the option that
is not supported or if a system call error occurs,
the function should leave an error message in the
\fIresult\fR field of \fIinterp\fR if \fIinterp\fR is not NULL. The
the function should leave an error message in the result
of \fIinterp\fR if \fIinterp\fR is not NULL. The
function should also call \fBTcl_SetErrno\fR to store an appropriate POSIX
error code.
.PP
-6
View File
@@ -22,10 +22,8 @@ Tcl_Interp *
int
\fBTcl_InterpDeleted\fR(\fIinterp\fR)
.sp
.VS 8.6
int
\fBTcl_InterpActive\fR(\fIinterp\fR)
.VE 8.6
.SH ARGUMENTS
.AS Tcl_Interp *interp
.AP Tcl_Interp *interp in
@@ -70,14 +68,12 @@ deleted and when the whole interpreter is being deleted. In the former case
the callback may recreate the data being deleted, but this would lead to an
infinite loop if the interpreter were being deleted.
.PP
.VS 8.6
\fBTcl_InterpActive\fR is useful for determining whether there is any
execution of scripts ongoing in an interpreter, which is a useful piece of
information when Tcl is embedded in a garbage-collected environment and it
becomes necessary to determine whether the interpreter is a candidate for
deletion. The function returns a true value if the interpreter has at least
one active execution running inside it, and a false value otherwise.
.VE 8.6
.SH "INTERPRETERS AND MEMORY MANAGEMENT"
.PP
\fBTcl_DeleteInterp\fR can be called at any time on an interpreter that may
@@ -138,12 +134,10 @@ All uses of interpreters in Tcl and Tk have already been protected.
Extension writers should ensure that their code also properly protects any
additional interpreters used, as described above.
.PP
.VS 8.6
Note that the protection mechanisms do not work well with conventional garbage
collection systems. When in such a managed environment, \fBTcl_InterpActive\fR
should be used to determine when an interpreter is a candidate for deletion
due to inactivity.
.VE 8.6
.SH "SEE ALSO"
Tcl_Preserve(3), Tcl_Release(3)
.SH KEYWORDS
+17 -17
View File
@@ -119,7 +119,7 @@ in a hierarchical relationship, and the management of aliases, commands
that when invoked in one interpreter execute a command in another
interpreter. The return value for those procedures that return an \fBint\fR
is either \fBTCL_OK\fR or \fBTCL_ERROR\fR. If \fBTCL_ERROR\fR is returned
then the \fBresult\fR field of the interpreter contains an error message.
then the interpreter's result contains an error message.
.PP
\fBTcl_CreateSlave\fR creates a new interpreter as a slave of \fIinterp\fR.
It also creates a slave command named \fIslaveName\fR in \fIinterp\fR which
@@ -158,12 +158,12 @@ If no such slave interpreter exists, \fBNULL\fR is returned.
\fIinterp\fR. If \fIinterp\fR has no master (it is a
top-level interpreter) then \fBNULL\fR is returned.
.PP
\fBTcl_GetInterpPath\fR sets the \fIresult\fR field in \fIaskingInterp\fR
to the relative path between \fIaskingInterp\fR and \fIslaveInterp\fR;
\fBTcl_GetInterpPath\fR stores in the result of \fIaskingInterp\fR
the relative path between \fIaskingInterp\fR and \fIslaveInterp\fR;
\fIslaveInterp\fR must be a slave of \fIaskingInterp\fR. If the computation
of the relative path succeeds, \fBTCL_OK\fR is returned, else
\fBTCL_ERROR\fR is returned and the \fIresult\fR field in
\fIaskingInterp\fR contains the error message.
\fBTCL_ERROR\fR is returned and an error message is stored as the
result of \fIaskingInterp\fR.
.PP
\fBTcl_CreateAlias\fR creates a command named \fIslaveCmd\fR in
\fIslaveInterp\fR that when invoked, will cause the command \fItargetCmd\fR
@@ -198,33 +198,33 @@ the set of hidden commands to the set of exposed commands, putting
it under the name
\fIcmdName\fR.
\fIHiddenCmdName\fR must be the name of an existing hidden
command, or the operation will return \fBTCL_ERROR\fR and leave an error
message in the \fIresult\fR field in \fIinterp\fR.
command, or the operation will return \fBTCL_ERROR\fR and
leave an error message as the result of \fIinterp\fR.
If an exposed command named \fIcmdName\fR already exists,
the operation returns \fBTCL_ERROR\fR and leaves an error message in the
value result of \fIinterp\fR.
the operation returns \fBTCL_ERROR\fR and leaves an error message as
the result of \fIinterp\fR.
If the operation succeeds, it returns \fBTCL_OK\fR.
After executing this command, attempts to use \fIcmdName\fR in a call to
\fBTcl_Eval\fR or with the Tcl \fBeval\fR command will again succeed.
After executing this command, attempts to use \fIcmdName\fR in any
script evaluation mechanism will again succeed.
.PP
\fBTcl_HideCommand\fR moves the command named \fIcmdName\fR from the set of
exposed commands to the set of hidden commands, under the name
\fIhiddenCmdName\fR.
\fICmdName\fR must be the name of an existing exposed
command, or the operation will return \fBTCL_ERROR\fR and leave an error
message in the value result of \fIinterp\fR.
message as the result of \fIinterp\fR.
Currently both \fIcmdName\fR and \fIhiddenCmdName\fR must not contain
namespace qualifiers, or the operation will return \fBTCL_ERROR\fR and
leave an error message in the value result of \fIinterp\fR.
leave an error message as the result of \fIinterp\fR.
The \fICmdName\fR will be looked up in the global namespace, and not
relative to the current namespace, even if the current namespace is not the
global one.
If a hidden command whose name is \fIhiddenCmdName\fR already
exists, the operation also returns \fBTCL_ERROR\fR and the \fIresult\fR
field in \fIinterp\fR contains an error message.
exists, the operation also returns \fBTCL_ERROR\fR and an error
message is left as the result of \fIinterp\fR.
If the operation succeeds, it returns \fBTCL_OK\fR.
After executing this command, attempts to use \fIcmdName\fR in a call to
\fBTcl_Eval\fR or with the Tcl \fBeval\fR command will fail.
After executing this command, attempts to use \fIcmdName\fR in
any script evaluation mechanism will fail.
.PP
For a description of the Tcl interface to multiple interpreters, see
\fIinterp(n)\fR.
-4
View File
@@ -36,13 +36,11 @@ int
int
\fBTcl_SetEnsembleMappingDict\fR(\fIinterp, token, dictObj\fR)
.sp
.VS 8.6
int
\fBTcl_GetEnsembleParameterList\fR(\fIinterp, token, listObjPtr\fR)
.sp
int
\fBTcl_SetEnsembleParameterList\fR(\fIinterp, token, listObj\fR)
.VE 8.6
.sp
int
\fBTcl_GetEnsembleSubcommandList\fR(\fIinterp, token, listObjPtr\fR)
@@ -163,7 +161,6 @@ All command names in prefixes set via \fBTcl_SetEnsembleMappingDict\fR
must be fully qualified.
.TP
\fBformal pre-subcommand parameter list\fR (read-write)
.VS 8.6
A list of formal parameter names (the names only being used when generating
error messages) that come at invocation of the ensemble between the name of
the ensemble and the subcommand argument. NULL (the default) is equivalent to
@@ -174,7 +171,6 @@ respectively. The result of both of those functions is a Tcl result code
ensemble) and the
dictionary obtained from \fBTcl_GetEnsembleParameterList\fR should always be
treated as immutable even if it is unshared.
.VE 8.6
.TP
\fBsubcommand list\fR (read-write)
.
+3 -2
View File
@@ -150,13 +150,14 @@ equivalent to using the \fBTCL_EVAL_GLOBAL\fR flag (see below).
of any length, concatenates them into a single string,
then calls \fBTcl_Eval\fR to execute that string as a Tcl command.
It returns the result of the command and also modifies
\fIinterp->result\fR in the same way as \fBTcl_Eval\fR.
the interpreter result in the same way as \fBTcl_Eval\fR.
The last argument to \fBTcl_VarEval\fR must be NULL to indicate the end
of arguments. \fBTcl_VarEval\fR is now deprecated.
.PP
\fBTcl_VarEvalVA\fR is the same as \fBTcl_VarEval\fR except that
instead of taking a variable number of arguments it takes an argument
list. Like \fBTcl_VarEval\fR, \fBTcl_VarEvalVA\fR is deprecated.
list. Interfaces using argument lists have been found to be nonportable
in practice. This function is deprecated and will be removed in Tcl 9.0.
.SH "FLAG BITS"
.PP
-10
View File
@@ -63,10 +63,8 @@ int
\fBTcl_FSLoadFile\fR(\fIinterp, pathPtr, sym1, sym2, proc1Ptr, proc2Ptr,
loadHandlePtr, unloadProcPtr\fR)
.sp
.VS 8.6
int
\fBTcl_FSUnloadFile\fR(\fIinterp, loadHandle\fR)
.VE 8.6
.sp
int
\fBTcl_FSMatchInDirectory\fR(\fIinterp, resultPtr, pathPtr, pattern, types\fR)
@@ -146,7 +144,6 @@ Tcl_Obj *
Tcl_StatBuf *
\fBTcl_AllocStatBuf\fR()
.sp
.VS 8.6
Tcl_WideInt
\fBTcl_GetAccessTimeFromStat\fR(\fIstatPtr\fR)
.sp
@@ -185,7 +182,6 @@ Tcl_WideUInt
.sp
int
\fBTcl_GetUserIdFromStat\fR(\fIstatPtr\fR)
.VE 8.6
.SH ARGUMENTS
.AS Tcl_GlobTypeData **srcPathPtr out
.AP "const Tcl_Filesystem" *fsPtr in
@@ -444,20 +440,16 @@ belongs will be called. If that filesystem does not implement this
function (most virtual filesystems will not, because of OS limitations
in dynamically loading binary code), Tcl will attempt to copy the file
to a temporary directory and load that temporary file.
.VS 8.6
\fBTcl_FSUnloadFile\fR reverses the operation, asking for the library
indicated by the \fIloadHandle\fR to be removed from the process. Note that,
unlike with the \fBunload\fR command, this does not give the library any
opportunity to clean up.
.VE 8.6
.PP
Both the above functions return a standard Tcl completion code. If an error
occurs, an error message is left in the \fIinterp\fR's result.
.PP
.VS 8.6
The token provided via the variable indicated by \fIloadHandlePtr\fR may be
used with \fBTcl_FindSymbol\fR.
.VE 8.6
.PP
\fBTcl_FSMatchInDirectory\fR is used by the globbing code to search a
directory for all files which match a given pattern. The appropriate
@@ -795,7 +787,6 @@ may be deallocated by being passed to \fBckfree\fR). This allows extensions to
invoke \fBTcl_FSStat\fR and \fBTcl_FSLstat\fR without being dependent on the
size of the buffer. That in turn depends on the flags used to build Tcl.
.PP
.VS 8.6
The portable fields of a \fITcl_StatBuf\fR may be read using the following
functions, each of which returns the value of the corresponding field listed
in the table below. Note that on some platforms there may be other fields in
@@ -819,7 +810,6 @@ for a full description of these fields.
\fBTcl_GetBlocksFromStat\fR st_blocks
\fBTcl_GetBlockSizeFromStat\fR st_blksize
.DE
.VE 8.6
.SH "THE VIRTUAL FILESYSTEM API"
.PP
A filesystem provides a \fBTcl_Filesystem\fR structure that contains
+13 -106
View File
@@ -5,7 +5,7 @@
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
.TH Tcl_Interp 3 7.5 Tcl "Tcl Library Procedures"
.TH Tcl_Interp 3 8.7 Tcl "Tcl Library Procedures"
.so man.macros
.BS
.SH NAME
@@ -15,9 +15,9 @@ Tcl_Interp \- client-visible fields of interpreter structures
\fB#include <tcl.h>\fR
.sp
typedef struct {
char *\fIresult\fR;
Tcl_FreeProc *\fIfreeProc\fR;
int \fIerrorLine\fR;
char *\fIresult\fR; /* NO LONGER AVAILABLE */
Tcl_FreeProc *\fIfreeProc\fR; /* NO LONGER AVAILABLE */
int \fIerrorLine\fR; /* NO LONGER AVAILABLE */
} \fBTcl_Interp\fR;
typedef void \fBTcl_FreeProc\fR(
@@ -25,110 +25,17 @@ typedef void \fBTcl_FreeProc\fR(
.BE
.SH DESCRIPTION
.PP
The \fBTcl_CreateInterp\fR procedure returns a pointer to a Tcl_Interp
The \fBTcl_CreateInterp\fR procedure returns a pointer to a \fBTcl_Interp\fR
structure. Callers of \fBTcl_CreateInterp\fR should use this pointer
as an opaque token, suitable for nothing other than passing back to
other routines in the Tcl interface. Accessing fields directly through
the pointer as described below is no longer supported. The supported
public routines \fBTcl_SetResult\fR, \fBTcl_GetResult\fR,
\fBTcl_SetErrorLine\fR, \fBTcl_GetErrorLine\fR must be used instead.
other routines in the Tcl interface from the same thread that called
\fBTcl_CreateInterp\fR. The \fBTcl_Interp\fR struct no longer has any
supported client-visible fields. Supported public routines such as
\fBTcl_SetResult\fR, \fBTcl_GetResult\fR, \fBTcl_SetErrorLine\fR,
\fBTcl_GetErrorLine\fR must be used instead.
.PP
For legacy programs and extensions no longer being maintained, compiles
against the Tcl 8.6 header files are only possible with the compiler
directives
.CS
#define USE_INTERP_RESULT
.CE
and/or
.CS
#define USE_INTERP_ERRORLINE
.CE
depending on which fields of the \fBTcl_Interp\fR struct are accessed.
These directives may be embedded in code or supplied via compiler options.
.PP
The \fIresult\fR and \fIfreeProc\fR fields are used to return
results or error messages from commands.
This information is returned by command procedures back to \fBTcl_Eval\fR,
and by \fBTcl_Eval\fR back to its callers.
The \fIresult\fR field points to the string that represents the
result or error message, and the \fIfreeProc\fR field tells how
to dispose of the storage for the string when it is not needed anymore.
The easiest way for command procedures to manipulate these
fields is to call procedures like \fBTcl_SetResult\fR
or \fBTcl_AppendResult\fR; they
will hide all the details of managing the fields.
The description below is for those procedures that manipulate the
fields directly.
.PP
Whenever a command procedure returns, it must ensure
that the \fIresult\fR field of its interpreter points to the string
being returned by the command.
The \fIresult\fR field must always point to a valid string.
If a command wishes to return no result then \fIinterp->result\fR
should point to an empty string.
Normally, results are assumed to be statically allocated,
which means that the contents will not change before the next time
\fBTcl_Eval\fR is called or some other command procedure is invoked.
In this case, the \fIfreeProc\fR field must be zero.
Alternatively, a command procedure may dynamically
allocate its return value (e.g. using \fBTcl_Alloc\fR)
and store a pointer to it in \fIinterp->result\fR.
In this case, the command procedure must also set \fIinterp->freeProc\fR
to the address of a procedure that can free the value, or \fBTCL_DYNAMIC\fR
if the storage was allocated directly by Tcl or by a call to
\fBTcl_Alloc\fR.
If \fIinterp->freeProc\fR is non-zero, then Tcl will call \fIfreeProc\fR
to free the space pointed to by \fIinterp->result\fR before it
invokes the next command.
If a client procedure overwrites \fIinterp->result\fR when
\fIinterp->freeProc\fR is non-zero, then it is responsible for calling
\fIfreeProc\fR to free the old \fIinterp->result\fR (the \fBTcl_FreeResult\fR
macro should be used for this purpose).
.PP
\fIFreeProc\fR should have arguments and result that match the
\fBTcl_FreeProc\fR declaration above: it receives a single
argument which is a pointer to the result value to free.
In most applications \fBTCL_DYNAMIC\fR is the only non-zero value ever
used for \fIfreeProc\fR.
However, an application may store a different procedure address
in \fIfreeProc\fR in order to use an alternate memory allocator
or in order to do other cleanup when the result memory is freed.
.PP
As part of processing each command, \fBTcl_Eval\fR initializes
\fIinterp->result\fR
and \fIinterp->freeProc\fR just before calling the command procedure for
the command. The \fIfreeProc\fR field will be initialized to zero,
and \fIinterp->result\fR will point to an empty string. Commands that
do not return any value can simply leave the fields alone.
Furthermore, the empty string pointed to by \fIresult\fR is actually
part of an array of approximately 200 characters.
If a command wishes to return a short string, it can simply copy
it to the area pointed to by \fIinterp->result\fR. Or, it can use
the sprintf procedure to generate a short result string at the location
pointed to by \fIinterp->result\fR.
.PP
It is a general convention in Tcl-based applications that the result
of an interpreter is normally in the initialized state described
in the previous paragraph.
Procedures that manipulate an interpreter's result (e.g. by
returning an error) will generally assume that the result
has been initialized when the procedure is called.
If such a procedure is to be called after the result has been
changed, then \fBTcl_ResetResult\fR should be called first to
reset the result to its initialized state. The direct use of
\fIinterp->result\fR is strongly deprecated (see \fBTcl_SetResult\fR).
.PP
The \fIerrorLine\fR
field is valid only after \fBTcl_Eval\fR returns
a \fBTCL_ERROR\fR return code. In this situation the \fIerrorLine\fR
field identifies the line number of the command being executed when
the error occurred. The line numbers are relative to the command
being executed: 1 means the first line of the command passed to
\fBTcl_Eval\fR, 2 means the second line, and so on.
The \fIerrorLine\fR field is typically used in conjunction with
\fBTcl_AddErrorInfo\fR to report information about where an error
occurred.
\fIErrorLine\fR should not normally be modified except by \fBTcl_Eval\fR.
Any legacy programs and extensions trying to access the fields above
in their source code will need conversion to compile for Tcl 8.7 and later.
.SH KEYWORDS
free, initialized, interpreter, malloc, result
interpreter, result
+12 -12
View File
@@ -96,7 +96,7 @@ Any value written into the Tcl variable must have a proper integer
form acceptable to \fBTcl_GetIntFromObj\fR; attempts to write
non-integer values into \fIvarName\fR will be rejected with
Tcl errors. Incomplete integer representations (like the empty
string, '+', '-' or the hex/octal/binary prefix) are accepted
string, '+', '-' or the hex/octal/decimal/binary prefix) are accepted
as if they are valid too.
.TP
\fBTCL_LINK_UINT\fR
@@ -107,7 +107,7 @@ integer form acceptable to \fBTcl_GetWideIntFromObj\fR and in the
platform's defined range for the \fBunsigned int\fR type; attempts to
write non-integer values (or values outside the range) into
\fIvarName\fR will be rejected with Tcl errors. Incomplete integer
representations (like the empty string, '+', '-' or the hex/octal/binary
representations (like the empty string, '+', '-' or the hex/octal/decimal/binary
prefix) are accepted as if they are valid too.
.TP
\fBTCL_LINK_CHAR\fR
@@ -118,7 +118,7 @@ form acceptable to \fBTcl_GetIntFromObj\fR and be in the range of the
\fBchar\fR datatype; attempts to write non-integer or out-of-range
values into \fIvarName\fR will be rejected with Tcl errors. Incomplete
integer representations (like the empty string, '+', '-' or the
hex/octal/binary prefix) are accepted as if they are valid too.
hex/octal/decimal/binary prefix) are accepted as if they are valid too.
.RS
.PP
.VS "TIP 312"
@@ -141,7 +141,7 @@ integer form acceptable to \fBTcl_GetIntFromObj\fR and in the
platform's defined range for the \fBunsigned char\fR type; attempts to
write non-integer values (or values outside the range) into
\fIvarName\fR will be rejected with Tcl errors. Incomplete integer
representations (like the empty string, '+', '-' or the hex/octal/binary
representations (like the empty string, '+', '-' or the hex/octal/decimal/binary
prefix) are accepted as if they are valid too.
.RS
.PP
@@ -166,7 +166,7 @@ form acceptable to \fBTcl_GetIntFromObj\fR and be in the range of the
\fBshort\fR datatype; attempts to write non-integer or out-of-range
values into \fIvarName\fR will be rejected with Tcl errors. Incomplete
integer representations (like the empty string, '+', '-' or the
hex/octal/binary prefix) are accepted as if they are valid too.
hex/octal/decimal/binary prefix) are accepted as if they are valid too.
.TP
\fBTCL_LINK_USHORT\fR
.
@@ -176,7 +176,7 @@ integer form acceptable to \fBTcl_GetIntFromObj\fR and in the
platform's defined range for the \fBunsigned short\fR type; attempts to
write non-integer values (or values outside the range) into
\fIvarName\fR will be rejected with Tcl errors. Incomplete integer
representations (like the empty string, '+', '-' or the hex/octal/binary
representations (like the empty string, '+', '-' or the hex/octal/decimal/binary
prefix) are accepted as if they are valid too.
.TP
\fBTCL_LINK_LONG\fR
@@ -187,7 +187,7 @@ form acceptable to \fBTcl_GetLongFromObj\fR; attempts to write
non-integer or out-of-range
values into \fIvarName\fR will be rejected with Tcl errors. Incomplete
integer representations (like the empty string, '+', '-' or the
hex/octal/binary prefix) are accepted as if they are valid too.
hex/octal/decimal/binary prefix) are accepted as if they are valid too.
.TP
\fBTCL_LINK_ULONG\fR
.
@@ -197,7 +197,7 @@ integer form acceptable to \fBTcl_GetWideIntFromObj\fR and in the
platform's defined range for the \fBunsigned long\fR type; attempts to
write non-integer values (or values outside the range) into
\fIvarName\fR will be rejected with Tcl errors. Incomplete integer
representations (like the empty string, '+', '-' or the hex/octal/binary
representations (like the empty string, '+', '-' or the hex/octal/decimal/binary
prefix) are accepted as if they are valid too.
.TP
\fBTCL_LINK_DOUBLE\fR
@@ -207,7 +207,7 @@ Any value written into the Tcl variable must have a proper real
form acceptable to \fBTcl_GetDoubleFromObj\fR; attempts to write
non-real values into \fIvarName\fR will be rejected with
Tcl errors. Incomplete integer or real representations (like the
empty string, '.', '+', '-' or the hex/octal/binary prefix) are
empty string, '.', '+', '-' or the hex/octal/decimal/binary prefix) are
accepted as if they are valid too.
.TP
\fBTCL_LINK_FLOAT\fR
@@ -219,7 +219,7 @@ range acceptable for a \fBfloat\fR; attempts to
write non-real values (or values outside the range) into
\fIvarName\fR will be rejected with Tcl errors. Incomplete integer
or real representations (like the empty string, '.', '+', '-' or
the hex/octal/binary prefix) are accepted as if they are valid too.
the hex/octal/decimal/binary prefix) are accepted as if they are valid too.
.TP
\fBTCL_LINK_WIDE_INT\fR
.
@@ -230,7 +230,7 @@ Any value written into the Tcl variable must have a proper integer
form acceptable to \fBTcl_GetWideIntFromObj\fR; attempts to write
non-integer values into \fIvarName\fR will be rejected with
Tcl errors. Incomplete integer representations (like the empty
string, '+', '-' or the hex/octal/binary prefix) are accepted
string, '+', '-' or the hex/octal/decimal/binary prefix) are accepted
as if they are valid too.
.TP
\fBTCL_LINK_WIDE_UINT\fR
@@ -244,7 +244,7 @@ cast to unsigned);
.\" FIXME! Use bignums instead.
attempts to write non-integer values into \fIvarName\fR will be
rejected with Tcl errors. Incomplete integer representations (like
the empty string, '+', '-' or the hex/octal/binary prefix) are accepted
the empty string, '+', '-' or the hex/octal/decimal/binary prefix) are accepted
as if they are valid too.
.TP
\fBTCL_LINK_BOOLEAN\fR
-2
View File
@@ -85,14 +85,12 @@ unless \fIinterp\fR is NULL.
Otherwise, it returns \fBTCL_OK\fR.
Passing a NULL \fIinterp\fR allows this procedure to be used
as a test whether the conversion can be done (and in fact was done).
.VS 8.5
.PP
In many cases, the \fItypePtr->setFromAnyProc\fR routine will
set \fIobjPtr->typePtr\fR to the argument value \fItypePtr\fR,
but that is no longer guaranteed. The \fIsetFromAnyProc\fR is
free to set the internal representation for \fIobjPtr\fR to make
use of another related Tcl_ObjType, if it sees fit.
.VE 8.5
.SH "THE TCL_OBJTYPE STRUCTURE"
.PP
Extension writers can define new value types by defining four
+7 -6
View File
@@ -53,13 +53,13 @@ In a freshly loaded Tcl library, \fBTcl_Panic\fR prints the formatted
error message to the standard error file of the process, and then
calls \fBabort\fR to terminate the process. \fBTcl_Panic\fR does not
return. On Windows, when a debugger is running, the formatted error
message is sent to the debugger in stead. If the windows executable
message is sent to the debugger instead. If the windows executable
does not have a stderr channel (e.g. \fBwish.exe\fR), then a
system dialog box is used to display the panic message.
.PP
If your application doesn't use \fBTcl_Main\fR or \fBTk_Main\fR
and you want to implicitly use the stderr channel of your
application's C runtime (in stead of the stderr channel of the
application's C runtime (instead of the stderr channel of the
C runtime used by Tcl), you can call \fBTcl_SetPanicProc\fR
with \fBTcl_ConsolePanic\fR as its argument. On platforms which
only have one C runtime (almost all platforms except Windows)
@@ -86,6 +86,9 @@ The typical use of \fBTcl_SetPanicProc\fR arranges for the error message
to be displayed or reported in a manner more suitable for the
application or the platform.
.PP
\fBTcl_SetPanicProc\fR can not be used in stub-enabled extensions. Its symbol
entry in the stub table is deprecated and it will be removed in Tcl 9.0.
.PP
Although the primary callers of \fBTcl_Panic\fR are the procedures of
the Tcl library, \fBTcl_Panic\fR is a public function and may be called
by any extension or application that wishes to abort the process and
@@ -93,11 +96,9 @@ have a panic message displayed the same way that panic messages from Tcl
will be displayed.
.PP
\fBTcl_PanicVA\fR is the same as \fBTcl_Panic\fR except that instead of
taking a variable number of arguments it takes an argument list. This
taking a variable number of arguments it takes an argument list. Interfaces
using argument lists have been found to be nonportable in practice. This
function is deprecated and will be removed in Tcl 9.0.
.PP
This function can not be used in stub-enabled extensions. Its symbol
entry in the stub table is deprecated and it will be removed in Tcl 9.0.
.SH "SEE ALSO"
abort(3), printf(3), exec(n), format(n)
.SH KEYWORDS
+19 -28
View File
@@ -5,7 +5,7 @@
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
.TH Tcl_SetResult 3 8.0 Tcl "Tcl Library Procedures"
.TH Tcl_SetResult 3 8.7 Tcl "Tcl Library Procedures"
.so man.macros
.BS
.SH NAME
@@ -30,9 +30,7 @@ const char *
.sp
\fBTcl_ResetResult\fR(\fIinterp\fR)
.sp
.VS 8.6
\fBTcl_TransferResult\fR(\fIsourceInterp, result, targetInterp\fR)
.VE 8.6
\fBTcl_TransferResult\fR(\fIsourceInterp, code, targetInterp\fR)
.sp
\fBTcl_AppendElement\fR(\fIinterp, element\fR)
.sp
@@ -57,18 +55,11 @@ Address of procedure to call to release storage at
An argument list which must have been initialized using
\fBva_start\fR, and cleared using \fBva_end\fR.
.AP Tcl_Interp *sourceInterp in
.VS 8.6
Interpreter that the result and error information should be copied from.
.VE 8.6
Interpreter that the result and return options should be transferred from.
.AP Tcl_Interp *targetInterp in
.VS 8.6
Interpreter that the result and error information should be copied to.
.VE 8.6
.AP int result in
.VS 8.6
If \fBTCL_OK\fR, only copy the result. If \fBTCL_ERROR\fR, copy the error
information as well.
.VE 8.6
Interpreter that the result and return options should be transferred to.
.AP int code in
Return code value that controls transfer of return options.
.BE
.SH DESCRIPTION
.PP
@@ -154,13 +145,17 @@ call; the last argument in the list must be a NULL pointer.
.PP
\fBTcl_AppendResultVA\fR is the same as \fBTcl_AppendResult\fR except that
instead of taking a variable number of arguments it takes an argument list.
Interfaces using argument lists have been found to be nonportable in practice.
This function is deprecated and will be removed in Tcl 9.0.
.PP
.VS 8.6
\fBTcl_TransferResult\fR moves a result from one interpreter to another,
optionally (dependent on the \fIresult\fR parameter) including the error
information dictionary as well. The interpreters must be in the same thread.
The source interpreter will have its result reset by this operation.
.VE 8.6
\fBTcl_TransferResult\fR transfers interpreter state from \fIsourceInterp\fR
to \fItargetInterp\fR. The two interpreters must have been created in the
same thread. If \fIsourceInterp\fR and \fItargetInterp\fR are the same,
nothing is done. Otherwise, \fBTcl_TransferResult\fR moves the result
from \fIsourceInterp\fR to \fItargetInterp\fR, and resets the result
in \fIsourceInterp\fR. It also moves the return options dictionary as
controlled by the return code value \fIcode\fR in the same manner
as \fBTcl_GetReturnOptions\fR.
.SH "DEPRECATED INTERFACES"
.SS "OLD STRING PROCEDURES"
.PP
@@ -202,14 +197,9 @@ is about to replace one result value with another.
It used to be legal for programs to
directly read and write \fIinterp->result\fR
to manipulate the interpreter result. The Tcl headers no longer
permit this access by default, and C code still doing this must
permit this access. C code still doing this must
be updated to use supported routines \fBTcl_GetObjResult\fR,
\fBTcl_GetStringResult\fR, \fBTcl_SetObjResult\fR, and \fBTcl_SetResult\fR.
As a migration aid, access can be restored with the compiler directive
.CS
#define USE_INTERP_RESULT
.CE
but this is meant only to offer life support to otherwise dead code.
.SH "THE TCL_FREEPROC ARGUMENT TO TCL_SETRESULT"
.PP
\fBTcl_SetResult\fR's \fIfreeProc\fR argument specifies how
@@ -250,6 +240,7 @@ typedef void \fBTcl_FreeProc\fR(
When \fIfreeProc\fR is called, its \fIblockPtr\fR will be set to
the value of \fIresult\fR passed to \fBTcl_SetResult\fR.
.SH "SEE ALSO"
Tcl_AddErrorInfo, Tcl_CreateObjCommand, Tcl_SetErrorCode, Tcl_Interp
Tcl_AddErrorInfo, Tcl_CreateObjCommand, Tcl_SetErrorCode, Tcl_Interp,
Tcl_GetReturnOptions
.SH KEYWORDS
append, command, element, list, value, result, return value, interpreter
+1 -1
View File
@@ -65,7 +65,7 @@ error message. The result or error from the initialization procedure will
be returned as the result of the \fBload\fR command that caused the
initialization procedure to be invoked.
.PP
This function can not be used in stub-enabled extensions. Its symbol
\fBTcl_StaticPackage\fR can not be used in stub-enabled extensions. Its symbol
entry in the stub table is deprecated and it will be removed in Tcl 9.0.
.SH KEYWORDS
initialization procedure, package, static linking
+3 -1
View File
@@ -249,7 +249,9 @@ must be a NULL pointer to indicate the end of the list.
.PP
\fBTcl_AppendStringsToObjVA\fR is the same as \fBTcl_AppendStringsToObj\fR
except that instead of taking a variable number of arguments it takes an
argument list.
argument list. Interfaces using argument lists have been found to be
nonportable in practice. This function is deprecated and will be removed
in Tcl 9.0.
.PP
\fBTcl_AppendLimitedToObj\fR is similar to \fBTcl_AppendToObj\fR
except that it imposes a limit on how many bytes are appended.
+1 -1
View File
@@ -190,7 +190,7 @@ procedure (if any) returns. In non-interactive mode, after
procedure (if any) returns, \fBTcl_Main\fR will also evaluate
the \fBexit\fR command.
.PP
This function can not be used in stub-enabled extensions.
\fBTcl_Main\fR can not be used in stub-enabled extensions.
.SH "SEE ALSO"
tclsh(1), Tcl_GetStdChannel(3), Tcl_StandardChannels(3), Tcl_AppInit(3),
exit(n), encoding(n)
+11 -22
View File
@@ -5,7 +5,7 @@
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
.TH Tcl_TraceVar 3 7.4 Tcl "Tcl Library Procedures"
.TH Tcl_TraceVar 3 8.7 Tcl "Tcl Library Procedures"
.so man.macros
.BS
.SH NAME
@@ -95,7 +95,7 @@ Invoke \fIproc\fR whenever an attempt is made to modify the variable.
Invoke \fIproc\fR whenever the variable is unset.
A variable may be unset either explicitly by an \fBunset\fR command,
or implicitly when a procedure returns (its local variables are
automatically unset) or when the interpreter is deleted (all
automatically unset) or when the interpreter or namespace is deleted (all
variables are automatically unset).
.TP
\fBTCL_TRACE_ARRAY\fR
@@ -160,10 +160,6 @@ The bit \fBTCL_TRACE_DESTROYED\fR will be set in \fIflags\fR if the trace is
about to be destroyed; this information may be useful to \fIproc\fR
so that it can clean up its own internal data structures (see
the section \fBTCL_TRACE_DESTROYED\fR below for more details).
Lastly, the bit \fBTCL_INTERP_DESTROYED\fR will be set if the entire
interpreter is being destroyed.
When this bit is set, \fIproc\fR must be especially careful in
the things it does (see the section \fBTCL_INTERP_DESTROYED\fR below).
The trace procedure's return value should normally be NULL; see
\fBERROR RETURNS\fR below for information on other possibilities.
.PP
@@ -330,6 +326,15 @@ During unset traces, the return value is ignored and all relevant
trace procedures will always be invoked.
.SH "RESTRICTIONS"
.PP
Because operations on variables may take place as part of the deletion
of the interp that contains them, \fIproc\fR must be careful about checking
what the \fIinterp\fR parameter can be used to do.
The routine \fBTcl_InterpDeleted\fR is an important tool for this.
When \fBTcl_InterpDeleted\fR returns 1, \fIproc\fR will not be able
to invoke any scripts in \fIinterp\fR. You may encounter old code using
a deprecated flag value \fBTCL_INTERP_DESTROYED\fR to signal this
condition, but any supported code should be converted to stop using it.
.PP
A trace procedure can be called at any time, even when there
are partially formed results stored in the interpreter. If
the trace procedure does anything that could damage this result (such
@@ -354,24 +359,8 @@ Traces on a variable are always removed whenever the variable
is deleted; the only time \fBTCL_TRACE_DESTROYED\fR is not set is for
a whole-array trace invoked when only a single element of an
array is unset.
.SH "TCL_INTERP_DESTROYED"
.PP
When an interpreter is destroyed, unset traces are called for
all of its variables.
The \fBTCL_INTERP_DESTROYED\fR bit will be set in the \fIflags\fR
argument passed to the trace procedures.
Trace procedures must be extremely careful in what they do if
the \fBTCL_INTERP_DESTROYED\fR bit is set.
It is not safe for the procedures to invoke any Tcl procedures
on the interpreter, since its state is partially deleted.
All that trace procedures should do under these circumstances is
to clean up and free their own internal data structures.
.SH BUGS
.PP
Tcl does not do any error checking to prevent trace procedures
from misusing the interpreter during traces with \fBTCL_INTERP_DESTROYED\fR
set.
.PP
Array traces are not yet integrated with the Tcl \fBinfo exists\fR command,
nor is there Tcl-level access to array traces.
.SH "SEE ALSO"
+10 -4
View File
@@ -8,7 +8,7 @@
.so man.macros
.BS
.SH NAME
Tcl_UniChar, Tcl_UniCharToUtf, Tcl_UtfToUniChar, Tcl_UtfToChar16, Tcl_UtfToWChar, Tcl_UniCharToUtfDString, Tcl_UtfToUniCharDString, Tcl_WCharToUtfDString, Tcl_UtfToWCharDString, Tcl_Char16ToUtfDString, Tcl_UtfToChar16DString, Tcl_UniCharLen, Tcl_UniCharNcmp, Tcl_UniCharNcasecmp, Tcl_UniCharCaseMatch, Tcl_UtfNcmp, Tcl_UtfNcasecmp, Tcl_UtfCharComplete, Tcl_NumUtfChars, Tcl_UtfFindFirst, Tcl_UtfFindLast, Tcl_UtfNext, Tcl_UtfPrev, Tcl_UniCharAtIndex, Tcl_UtfAtIndex, Tcl_UtfBackslash \- routines for manipulating UTF-8 strings
Tcl_UniChar, Tcl_UniCharToUtf, Tcl_UtfToUniChar, Tcl_UtfToChar16, Tcl_UtfToWChar, Tcl_UniCharToUtfDString, Tcl_UtfToUniCharDString, Tcl_Char16ToUtfDString, Tcl_UtfToWCharDString, Tcl_UtfToChar16DString, Tcl_UniCharLen, Tcl_UniCharNcmp, Tcl_UniCharNcasecmp, Tcl_UniCharCaseMatch, Tcl_UtfNcmp, Tcl_UtfNcasecmp, Tcl_UtfCharComplete, Tcl_NumUtfChars, Tcl_UtfFindFirst, Tcl_UtfFindLast, Tcl_UtfNext, Tcl_UtfPrev, Tcl_UniCharAtIndex, Tcl_UtfAtIndex, Tcl_UtfBackslash \- routines for manipulating UTF-8 strings
.SH SYNOPSIS
.nf
\fB#include <tcl.h>\fR
@@ -120,6 +120,12 @@ A null-terminated Unicode string.
A null-terminated UTF-16 string.
.AP "const wchar_t" *wStr in
A null-terminated wchar_t string.
.AP "const unsigned short" *utf16s in
A null-terminated utf-16 string.
.AP "const unsigned short" *utf16t in
A null-terminated utf-16 string.
.AP "const unsigned short" *utf16Pattern in
A null-terminated utf-16 string.
.AP int length in
The length of the UTF-8 string in bytes (not UTF-8 characters). If
negative, all bytes up to the first null byte are used.
@@ -148,11 +154,11 @@ case-insensitive (1).
.PP
These routines convert between UTF-8 strings and Unicode/Utf-16 characters.
A UTF-8 character is a Unicode character represented as a varying-length
sequence of up to \fBTCL_UTF_MAX\fR bytes. A multibyte UTF-8 sequence
sequence of up to \fB4\fR bytes. A multibyte UTF-8 sequence
consists of a lead byte followed by some number of trail bytes.
.PP
\fBTCL_UTF_MAX\fR is the maximum number of bytes that it takes to
represent one Unicode character in the UTF-8 representation.
\fBTCL_UTF_MAX\fR is the maximum number of bytes that \fBTcl_UtfToUniChar\fR
can consume in a single call.
.PP
\fBTcl_UniCharToUtf\fR stores the character \fIch\fR as a UTF-8 string
in starting at \fIbuf\fR. The return value is the number of bytes stored
-6
View File
@@ -56,9 +56,7 @@ When the return code from evaluation of \fIscript\fR is
\fBTCL_ERROR\fR, four additional entries are defined in the dictionary
of return options stored in \fIoptionsVarName\fR: \fB\-errorinfo\fR,
\fB\-errorcode\fR, \fB\-errorline\fR, and
.VS 8.6
\fB\-errorstack\fR.
.VE 8.6
The value of the \fB\-errorinfo\fR entry is a formatted stack trace containing
more information about the context in which the error happened. The formatted
stack trace is meant to be read by a person. The value of the
@@ -67,7 +65,6 @@ list. The \fB\-errorcode\fR value is meant to be further processed by
programs, and may not be particularly readable by people. The value of the
\fB\-errorline\fR entry is an integer indicating which line of \fIscript\fR
was being evaluated when the error occurred.
.VS 8.6
The value of the \fB\-errorstack\fR entry is an
even-sized list made of token-parameter pairs accumulated while
unwinding the stack. The token may be
@@ -87,14 +84,11 @@ the static text of the calling sites, and
.IP [3]
it is coarser-grained, with only one element per stack frame (like procs; no
separate elements for \fBforeach\fR constructs for example).
.VE 8.6
.PP
The values of the \fB\-errorinfo\fR and \fB\-errorcode\fR entries of
the most recent error are also available as values of the global
variables \fB::errorInfo\fR and \fB::errorCode\fR respectively.
.VS 8.6
The value of the \fB\-errorstack\fR entry surfaces as \fBinfo errorstack\fR.
.VE 8.6
.PP
Tcl packages may provide commands that set other entries in the
dictionary of return options, and the \fBreturn\fR command may be
-10
View File
@@ -35,7 +35,6 @@ turned on by default.
.
Close and destroy the channel called \fIchannelId\fR. Note that this
deletes all existing file-events registered on the channel.
.VS 8.6
If the \fIdirection\fR argument (which must be \fBread\fR or \fBwrite\fR or
any unique abbreviation of them) is present, the channel will only be
half-closed, so that it can go from being read-write to write-only or
@@ -45,7 +44,6 @@ write-only channels. Without the \fIdirection\fR argument, the channel is
closed for both reading and writing (but only if those directions are
currently open). It is an error to close a read-only channel for writing, or a
write-only channel for reading.
.VE 8.6
.RS
.PP
As part of closing the channel, all buffered output is flushed to the
@@ -83,12 +81,10 @@ an error occurs while flushing output. If a command in a command
pipeline created with \fBopen\fR returns an error, \fBchan close\fR
generates an error (similar to the \fBexec\fR command.)
.PP
.VS 8.6
Note that half-closes of sockets and command pipelines can have important side
effects because they result in a shutdown() or close() of the underlying
system resource, which can change how other processes or systems respond to
the Tcl program.
.VE 8.6
.RE
.TP
\fBchan configure \fIchannelId\fR ?\fIoptionName\fR? ?\fIvalue\fR? ?\fIoptionName value\fR?...
@@ -540,7 +536,6 @@ an extremely long line that exceeds the available memory to buffer it).
Returns -1 if the channel was not opened for the mode in question.
.TP
\fBchan pipe\fR
.VS 8.6
Creates a standalone pipe whose read- and write-side channels are
returned as a 2-element list, the first element being the read side and
the second the write side. Can be useful e.g. to redirect
@@ -561,16 +556,13 @@ is most likely to show up when using pipelines for testing; care should be
taken to ensure that deadlocks do not occur and that potential short reads are
allowed for.
.RE
.VE 8.6
.TP
\fBchan pop \fIchannelId\fR
.VS 8.6
Removes the topmost transformation from the channel \fIchannelId\fR, if there
is any. If there are no transformations added to \fIchannelId\fR, this is
equivalent to \fBchan close\fR of that channel. The result is normally the
empty string, but can be an error in some situations (i.e. where the
underlying system stream is closed and that results in an error).
.VE 8.6
.TP
\fBchan postevent \fIchannelId eventSpec\fR
.
@@ -609,7 +601,6 @@ executed in the interpreter that set them up.
.RE
.TP
\fBchan push \fIchannelId cmdPrefix\fR
.VS 8.6
Adds a new transformation on top of the channel \fIchannelId\fR. The
\fIcmdPrefix\fR argument describes a list of one or more words which represent
a handler that will be used to implement the transformation. The command
@@ -618,7 +609,6 @@ The result of this subcommand is a handle to the transformation. Note that it
is important to make sure that the transformation is capable of supporting the
channel mode that it is used with or this can make the channel neither
readable nor writable.
.VE 8.6
.TP
\fBchan puts\fR ?\fB\-nonewline\fR? ?\fIchannelId\fR? \fIstring\fR
.
-4
View File
@@ -49,16 +49,13 @@ When the last interpreter in which the channel is registered invokes
.PP
Channels are automatically closed when an interpreter is destroyed and
when the process exits.
.VS 8.6
From 8.6 on (TIP#398), nonblocking channels are no longer switched to blocking mode when exiting; this guarantees a timely exit even when the peer or a communication channel is stalled. To ensure proper flushing of stalled nonblocking channels on exit, one must now either (a) actively switch them back to blocking or (b) use the environment variable TCL_FLUSH_NONBLOCKING_ON_EXIT, which when set and not equal to "0" restores the previous behavior.
.VE 8.6
.PP
The command returns an empty string, and may generate an error if
an error occurs while flushing output. If a command in a command
pipeline created with \fBopen\fR returns an error, \fBclose\fR
generates an error (similar to the \fBexec\fR command.)
.PP
.VS 8.6
The two-argument form is a
.QW "half-close" :
given a bidirectional channel like a
@@ -80,7 +77,6 @@ abnormal exit error.
.PP
Currently only sockets and command pipelines support half-close. A future
extension will allow reflected and stacked channels to do so.
.VE 8.6
.SH EXAMPLE
.PP
This illustrates how you can use Tcl to ensure that files get closed
+1 -1
View File
@@ -9,7 +9,7 @@
.BS
'\" Note: do not modify the .SH NAME line immediately below!
.SH NAME
coroutine, yield, yieldto \- Create and produce values from coroutines
coroutine, yield, yieldto, coroinject, coroprobe \- Create and produce values from coroutines
.SH SYNOPSIS
.nf
\fBcoroutine \fIname command\fR ?\fIarg...\fR?
-6
View File
@@ -17,11 +17,9 @@ dde \- Execute a Dynamic Data Exchange command
.sp
\fBdde servername\fR ?\fB\-force\fR? ?\fB\-handler \fIproc\fR? ?\fB\-\|\-\fR? ?\fItopic\fR?
.sp
.VS 8.6
\fBdde execute\fR ?\fB\-async\fR? ?\fB\-binary\fR? \fIservice topic data\fR
.sp
\fBdde poke\fR ?\fB\-binary\fR? \fIservice topic item data\fR
.VE 8.6
.sp
\fBdde request\fR ?\fB\-binary\fR? \fIservice topic item\fR
.sp
@@ -82,13 +80,11 @@ script is run in the application. The \fB\-async\fR option requests
asynchronous invocation. The command returns an error message if the
script did not run, unless the \fB\-async\fR flag was used, in which case
the command returns immediately with no error.
.VS 8.6
Without the \fB\-binary\fR option all data will be sent in unicode. For
dde clients which don't implement the CF_UNICODE clipboard format, this
will automatically be translated to the system encoding. You can use
the \fB\-binary\fR option in combination with the result of
\fBencoding convertto\fR to send data in any other encoding.
.VE 8.6
.TP
\fBdde poke\fR ?\fB\-binary\fR? \fIservice topic item data\fR
.
@@ -99,13 +95,11 @@ specific but can be a command to the server or the name of a file to work
on. The \fIitem\fR is also application specific and is often not used, but
it must always be non-null. The \fIdata\fR field is given to the remote
application.
.VS 8.6
Without the \fB\-binary\fR option all data will be sent in unicode. For
dde clients which don't implement the CF_UNICODE clipboard format, this
will automatically be translated to the system encoding. You can use
the \fB\-binary\fR option in combination with the result of
\fBencoding convertto\fR to send data in any other encoding.
.VE 8.6
.TP
\fBdde request\fR ?\fB\-binary\fR? \fIservice topic item\fR
.
-4
View File
@@ -54,10 +54,8 @@ type (which may be abbreviated.) Supported filter types are:
.RS
.TP
\fBdict filter \fIdictionaryValue \fBkey\fR ?\fIglobPattern ...\fR?
.VS 8.6
The key rule only matches those key/value pairs whose keys match any
of the given patterns (in the style of \fBstring match\fR.)
.VE 8.6
.TP
\fBdict filter \fIdictionaryValue \fBscript {\fIkeyVariable valueVariable\fB} \fIscript\fR
.
@@ -74,10 +72,8 @@ result. The key/value pairs are tested in the order in which the keys
were inserted into the dictionary.
.TP
\fBdict filter \fIdictionaryValue \fBvalue \fR?\fIglobPattern ...\fR?
.VS 8.6
The value rule only matches those key/value pairs whose values match any
of the given patterns (in the style of \fBstring match\fR.)
.VE 8.6
.RE
.TP
\fBdict for {\fIkeyVariable valueVariable\fB} \fIdictionaryValue body\fR
-2
View File
@@ -338,7 +338,6 @@ if {[catch {\fBexec\fR grep foo bar.txt} results options]} {
}
}
.CE
.VS 8.6
.PP
This is more easily written using the \fBtry\fR command, as that makes
it simpler to trap specific types of errors. This is
@@ -352,7 +351,6 @@ try {
set status [lindex [dict get $options -errorcode] 2]
}
.CE
.VE 8.6
.SS "WORKING WITH QUOTED ARGUMENTS"
.PP
When translating a command from a Unix shell invocation, care should
-2
View File
@@ -465,7 +465,6 @@ between platforms:
.TP
\fBfile tempfile\fR ?\fInameVar\fR? ?\fItemplate\fR?
'\" TIP #210
.VS 8.6
Creates a temporary file and returns a read-write channel opened on that file.
If the \fInameVar\fR is given, it specifies a variable that the name of the
temporary file will be written into; if absent, Tcl will attempt to arrange
@@ -480,7 +479,6 @@ Note that temporary files are \fIonly\fR ever created on the native
filesystem. As such, they can be relied upon to be used with operating-system
native APIs and external programs that require a filename.
.RE
.VE 8.6
.TP
\fBfile type \fIname\fR
.
-2
View File
@@ -154,7 +154,6 @@ what to set the interpreter's background exception handler to. See the
\fBBACKGROUND EXCEPTION HANDLING\fR section for more details.
.TP
\fBinterp\fR \fBcancel \fR?\fB\-unwind\fR? ?\fB\-\|\-\fR? ?\fIpath\fR? ?\fIresult\fR?
.VS 8.6
Cancels the script being evaluated in the interpreter identified by
\fIpath\fR. Without the \fB\-unwind\fR switch the evaluation stack for
the interpreter is unwound until an enclosing catch command is found or
@@ -167,7 +166,6 @@ switches; it may be needed if \fIpath\fR is an unusual value such
as \fB\-safe\fR. If \fIresult\fR is present, it will be used as the
error message string; otherwise, a default error message string will be
used.
.VE 8.6
.TP
\fBinterp\fR \fBcreate \fR?\fB\-safe\fR? ?\fB\-\|\-\fR? ?\fIpath\fR?
.
+3 -2
View File
@@ -49,8 +49,9 @@ Using \fBlappend\fR to build up a list of numbers.
1 2 3 4 5
.CE
.SH "SEE ALSO"
list(n), lindex(n), linsert(n), llength(n), lset(n),
lsort(n), lrange(n)
list(n), lassign(n), lindex(n), linsert(n), llength(n),
lmap(n), lpop(n), lrange(n), lremove(n), lrepeat(n), lreplace(n),
lreverse(n), lsearch(n), lset(n), lsort(n)
.SH KEYWORDS
append, element, list, variable
.\" Local variables:
+3 -1
View File
@@ -52,7 +52,9 @@ command in many shell languages like this:
set ::argv [\fBlassign\fR $::argv argumentToReadOff]
.CE
.SH "SEE ALSO"
lindex(n), list(n), lrange(n), lset(n), set(n)
list(n), lappend(n), lindex(n), linsert(n), llength(n),
lmap(n), lpop(n), lrange(n), lremove(n), lrepeat(n), lreplace(n),
lreverse(n), lsearch(n), lset(n), lsort(n)
.SH KEYWORDS
assign, element, list, multiple, set, variable
'\"Local Variables:
+3 -2
View File
@@ -115,8 +115,9 @@ set idx 3
\fI\(-> f\fR
.CE
.SH "SEE ALSO"
list(n), lappend(n), linsert(n), llength(n), lsearch(n),
lset(n), lsort(n), lrange(n), lreplace(n),
list(n), lappend(n), lassign(n), linsert(n), llength(n),
lmap(n), lpop(n), lrange(n), lremove(n), lrepeat(n), lreplace(n),
lreverse(n), lsearch(n), lset(n), lsort(n),
string(n)
.SH KEYWORDS
element, index, list
+3 -2
View File
@@ -45,8 +45,9 @@ set newList [\fBlinsert\fR $midList end-1 lazy]
set newerList [\fBlinsert\fR [\fBlinsert\fR $oldList end-1 quick] 1 lazy]
.CE
.SH "SEE ALSO"
list(n), lappend(n), lindex(n), llength(n), lsearch(n),
lset(n), lsort(n), lrange(n), lreplace(n),
list(n), lappend(n), lassign(n), lindex(n), llength(n),
lmap(n), lpop(n), lrange(n), lremove(n), lrepeat(n), lreplace(n),
lreverse(n), lsearch(n), lset(n), lsort(n),
string(n)
.SH KEYWORDS
element, insert, list
+3 -3
View File
@@ -46,9 +46,9 @@ while \fBconcat\fR with the same arguments will return
\fBa b c d e f {g h}\fR
.CE
.SH "SEE ALSO"
lappend(n), lindex(n), linsert(n), llength(n), lrange(n),
lrepeat(n),
lreplace(n), lsearch(n), lset(n), lsort(n)
lappend(n), lassign(n), lindex(n), linsert(n), llength(n),
lmap(n), lpop(n), lrange(n), lremove(n), lrepeat(n), lreplace(n),
lreverse(n), lsearch(n), lset(n), lsort(n)
.SH KEYWORDS
element, list, quoting
'\"Local Variables:
+3 -2
View File
@@ -49,8 +49,9 @@ An empty list is not necessarily an empty string:
1,0
.CE
.SH "SEE ALSO"
list(n), lappend(n), lindex(n), linsert(n), lsearch(n),
lset(n), lsort(n), lrange(n), lreplace(n)
list(n), lappend(n), lassign(n), lindex(n), linsert(n),
lmap(n), lpop(n), lrange(n), lremove(n), lrepeat(n), lreplace(n),
lreverse(n), lsearch(n), lset(n), lsort(n)
.SH KEYWORDS
element, list, length
'\" Local Variables:
+4 -1
View File
@@ -77,7 +77,10 @@ set prefix [\fBlmap\fR x $values {expr {
# The value of prefix is "8 7 6 5 4"
.CE
.SH "SEE ALSO"
break(n), continue(n), for(n), foreach(n), while(n)
break(n), continue(n), for(n), foreach(n), while(n),
list(n), lappend(n), lassign(n), lindex(n), linsert(n), llength(n),
lpop(n), lrange(n), lremove(n), lrepeat(n), lreplace(n),
lreverse(n), lsearch(n), lset(n), lsort(n)
.SH KEYWORDS
foreach, iteration, list, loop, map
'\" Local Variables:
+3 -2
View File
@@ -86,8 +86,9 @@ The indicated value becomes the new value of \fIx\fR.
\fI\(-> {{a b} {c d}} {{e f} h}\fR
.CE
.SH "SEE ALSO"
list(n), lappend(n), lindex(n), linsert(n), llength(n), lsearch(n),
lsort(n), lrange(n), lreplace(n), lset(n)
list(n), lappend(n), lassign(n), lindex(n), linsert(n), llength(n),
lmap(n), lrange(n), lremove(n), lrepeat(n), lreplace(n),
lreverse(n), lsearch(n), lset(n), lsort(n),
string(n)
.SH KEYWORDS
element, index, list, remove, pop, stack, queue
+3 -2
View File
@@ -71,8 +71,9 @@ elements to
{elements to}
.CE
.SH "SEE ALSO"
list(n), lappend(n), lindex(n), linsert(n), llength(n), lsearch(n),
lset(n), lremove(n), lreplace(n), lsort(n),
list(n), lappend(n), lassign(n), lindex(n), linsert(n), llength(n),
lmap(n), lpop(n), lremove(n), lrepeat(n), lreplace(n),
lreverse(n), lsearch(n), lset(n), lsort(n),
string(n)
.SH KEYWORDS
element, list, range, sublist
+3 -1
View File
@@ -46,7 +46,9 @@ Removing the same element indicated in two different ways:
a b d e
.CE
.SH "SEE ALSO"
list(n), lrange(n), lsearch(n), lsearch(n)
list(n), lappend(n), lassign(n), lindex(n), linsert(n), llength(n),
lmap(n), lpop(n), lrange(n), lrepeat(n), lreplace(n),
lreverse(n), lsearch(n), lset(n), lsort(n)
.SH KEYWORDS
element, list, remove
.\" Local variables:
+3 -1
View File
@@ -32,7 +32,9 @@ is identical to \fBlist element ...\fR.
\fI\(-> {a a} b c {a a} b c {a a} b c\fR
.CE
.SH "SEE ALSO"
list(n), lappend(n), linsert(n), llength(n), lset(n)
list(n), lappend(n), lassign(n), lindex(n), linsert(n), llength(n),
lmap(n), lpop(n), lrange(n), lremove(n), lreplace(n),
lreverse(n), lsearch(n), lset(n), lsort(n)
.SH KEYWORDS
element, index, list
'\" Local Variables:
+3 -2
View File
@@ -95,8 +95,9 @@ a b c d e f g h i
.CE
.VE TIP505
.SH "SEE ALSO"
list(n), lappend(n), lindex(n), linsert(n), llength(n), lsearch(n),
lset(n), lrange(n), lremove(n), lsort(n),
list(n), lappend(n), lassign(n), lindex(n), linsert(n), llength(n),
lmap(n), lpop(n), lrange(n), lremove(n), lrepeat(n),
lreverse(n), lsearch(n), lset(n), lsort(n),
string(n)
.SH KEYWORDS
element, list, replace
+3 -2
View File
@@ -25,8 +25,9 @@ input list, \fIlist\fR, except with the elements in the reverse order.
\fI\(-> f e {c d} b a\fR
.CE
.SH "SEE ALSO"
list(n), lsearch(n), lsort(n)
list(n), lappend(n), lassign(n), lindex(n), linsert(n), llength(n),
lmap(n), lpop(n), lrange(n), lremove(n), lrepeat(n), lreplace(n),
lsearch(n), lset(n), lsort(n)
.SH KEYWORDS
element, list, reverse
'\" Local Variables:
+4 -4
View File
@@ -134,7 +134,6 @@ The list elements are sorted in increasing order. This option is only
meaningful when used with \fB\-sorted\fR.
.TP
\fB\-bisect\fR
.VS 8.6
Inexact search when the list elements are in sorted order. For an increasing
list the last index where the element is less than or equal to the pattern
is returned. For a decreasing list the last index where the element is greater
@@ -142,7 +141,6 @@ than or equal to the pattern is returned. If the pattern is before the first
element or the list is empty, -1 is returned.
This option implies \fB\-sorted\fR and cannot be used with either \fB\-all\fR
or \fB\-not\fR.
.VE 8.6
.SS "NESTED LIST OPTIONS"
.PP
These options are used to search lists of lists. They may be used
@@ -229,8 +227,10 @@ The same thing for a flattened list:
\fI\(-> {a abc b bcd}\fR
.CE
.SH "SEE ALSO"
foreach(n), list(n), lappend(n), lindex(n), linsert(n), llength(n),
lset(n), lsort(n), lrange(n), lreplace(n),
foreach(n),
list(n), lappend(n), lassign(n), lindex(n), linsert(n), llength(n),
lmap(n), lpop(n), lrange(n), lremove(n), lrepeat(n), lreplace(n),
lreverse(n), lset(n), lsort(n),
string(n)
.SH KEYWORDS
binary search, linear search,
+3 -2
View File
@@ -136,8 +136,9 @@ The indicated return value also becomes the new value of \fIx\fR.
\fI\(-> {{a b} {c d}} {{e f} {j h}}\fR
.CE
.SH "SEE ALSO"
list(n), lappend(n), lindex(n), linsert(n), llength(n), lsearch(n),
lsort(n), lrange(n), lreplace(n),
list(n), lappend(n), lassign(n), lindex(n), linsert(n), llength(n),
lmap(n), lpop(n), lrange(n), lremove(n), lrepeat(n), lreplace(n),
lreverse(n), lsearch(n), lsort(n)
string(n)
.SH KEYWORDS
element, index, list, replace, set
+3 -4
View File
@@ -221,7 +221,6 @@ Sorting using indices:
{e 1} {d 2} { c 3} {b 4} {a 5}
.CE
.PP
.VS 8.6
Sorting a dictionary:
.PP
.CS
@@ -239,7 +238,6 @@ Sorting using striding and multiple indices:
{{Bob Smith} 25 Audi {Jane Doe} 40 Ford}
{{Jane Doe} 40 Ford {Bob Smith} 25 Audi}
.CE
.VE 8.6
.PP
Stripping duplicate values using sorting:
.PP
@@ -266,8 +264,9 @@ More complex sorting using a comparison function:
{1 dingo} {2 banana} {0x2 carrot} {3 apple}
.CE
.SH "SEE ALSO"
list(n), lappend(n), lindex(n), linsert(n), llength(n), lsearch(n),
lset(n), lrange(n), lreplace(n)
list(n), lappend(n), lassign(n), lindex(n), linsert(n), llength(n),
lmap(n), lpop(n), lrange(n), lremove(n), lrepeat(n), lreplace(n),
lreverse(n), lsearch(n), lset(n)
.SH KEYWORDS
element, list, order, sort
'\" Local Variables:
+1 -1
View File
@@ -23,7 +23,7 @@ package require TclOO
The \fBmy\fR command is used to allow methods of objects to invoke methods
of the object (or its class),
.VS TIP478
and he \fBmyclass\fR command is used to allow methods of objects to invoke
and the \fBmyclass\fR command is used to allow methods of objects to invoke
methods of the current class of the object \fIas an object\fR.
.VE TIP478
In particular, the set of valid values for
-4
View File
@@ -788,12 +788,10 @@ name. Note that when this option is non-empty and the
will be exactly those words that have mappings in the dictionary.
.TP
\fB\-parameters\fR
.VS 8.6
This option gives a list of named arguments (the names being used during
generation of error messages) that are passed by the caller of the ensemble
between the name of the ensemble and the subcommand argument. By default, it
is the empty list.
.VE 8.6
.TP
\fB\-prefixes\fR
.
@@ -943,7 +941,6 @@ Remove all imported commands from the current namespace:
namespace forget {*}[namespace import]
.CE
.PP
.VS 8.6
Create an ensemble for simple working with numbers, using the
\fB\-parameters\fR option to allow the operator to be put between the first
and second arguments.
@@ -959,7 +956,6 @@ and second arguments.
# In use, the ensemble works like this:
puts [do 1 plus [do 9 minus 7]]
.CE
.VE 8.6
.SH "SEE ALSO"
interp(n), upvar(n), variable(n)
.SH KEYWORDS
-2
View File
@@ -44,13 +44,11 @@ one of \fBHKEY_LOCAL_MACHINE\fR, \fBHKEY_USERS\fR,
\fBHKEY_DYN_DATA\fR. The \fIkeypath\fR can be one or more
registry key names separated by backslash (\fB\e\fR) characters.
.PP
.VS 8.6
The optional \fI\-mode\fR argument indicates which registry to work
with; when it is \fB\-32bit\fR the 32-bit registry will be used, and
when it is \fB\-64bit\fR the 64-bit registry will be used. If this
argument is omitted, the system's default registry will be the subject
of the requested operation.
.VE 8.6
.PP
\fIOption\fR indicates what to do with the registry key name. Any
unique abbreviation for \fIoption\fR is acceptable. The valid options
-2
View File
@@ -137,7 +137,6 @@ by the \fBcatch\fR command (or from the copy of that information
stored in the global variable \fBerrorInfo\fR).
.TP
\fB\-errorstack \fIlist\fR
.VS 8.6
The \fB\-errorstack\fR option receives special treatment only when the value
of the \fB\-code\fR option is \fBTCL_ERROR\fR. Then \fIlist\fR is the initial
error stack, recording actual argument values passed to each proc level. The error stack will
@@ -152,7 +151,6 @@ the procedure. Typically the \fIlist\fR value is supplied from
the value of \fB\-errorstack\fR in a return options dictionary captured
by the \fBcatch\fR command (or from the copy of that information from
\fBinfo errorstack\fR).
.VE 8.6
.TP
\fB\-level \fIlevel\fR
.
-2
View File
@@ -322,11 +322,9 @@ The version number for the operating system running on this machine.
On UNIX machines, this is the value returned by \fBuname -r\fR.
.TP
\fBpathSeparator\fR
.VS 8.6
'\" Defined by TIP #315
The character that should be used to \fBsplit\fR PATH-like environment
variables into their corresponding list of directory names.
.VE 8.6
.TP
\fBplatform\fR
.
+1 -1
View File
@@ -83,7 +83,7 @@ example, the Tcl 8.7.2 release would be searched for in a file
\fBlibtcl_8_7_2.zip\fR.) That archive, if located, is also mounted read-only.
.PP
On Windows, \fBTclZipfs_AppHook\fR has a slightly different signature, since
it uses WCHAR in stead of char. As a result, it requires your application to
it uses WCHAR instead of char. As a result, it requires your application to
be compiled with the UNICODE preprocessor symbol defined (e.g., via the
\fB-DUNICODE\fR compiler flag).
.PP
+1 -1
View File
@@ -88,7 +88,7 @@ typedef int celt; /* Type to hold chr, or NOCELT */
#define NOCELT (-1) /* Celt value which is not valid chr */
#define CHR(c) (UCHAR(c)) /* Turn char literal into chr literal */
#define DIGITVAL(c) ((c)-'0') /* Turn chr digit into its value */
#if TCL_UTF_MAX > 4
#if TCL_UTF_MAX > 3
#define CHRBITS 32 /* Bits in a chr; must not use sizeof */
#define CHR_MIN 0x00000000 /* Smallest and largest chr; the value */
#define CHR_MAX 0x10ffff /* CHR_MAX-CHR_MIN+1 should fit in uchr */
+13 -13
View File
@@ -523,7 +523,7 @@ declare 145 {
declare 146 {
int Tcl_Flush(Tcl_Channel chan)
}
declare 147 {
declare 147 {deprecated {see TIP #559. Use Tcl_ResetResult}} {
void Tcl_FreeResult(Tcl_Interp *interp)
}
declare 148 {
@@ -1244,10 +1244,10 @@ declare 350 {
declare 351 {
int Tcl_UniCharIsWordChar(int ch)
}
declare 352 {
declare 352 {deprecated {Use Tcl_GetCharLength}} {
int Tcl_UniCharLen(const Tcl_UniChar *uniStr)
}
declare 353 {
declare 353 {deprecated {Use Tcl_UtfNcmp}} {
int Tcl_UniCharNcmp(const Tcl_UniChar *ucs, const Tcl_UniChar *uct,
unsigned long numChars)
}
@@ -1356,7 +1356,7 @@ declare 382 {deprecated {No longer in use, changed to macro}} {
declare 383 {
Tcl_Obj *Tcl_GetRange(Tcl_Obj *objPtr, int first, int last)
}
declare 384 {
declare 384 {deprecated {Use Tcl_AppendStringsToObj}} {
void Tcl_AppendUnicodeToObj(Tcl_Obj *objPtr, const Tcl_UniChar *unicode,
int length)
}
@@ -1482,11 +1482,11 @@ declare 417 {
declare 418 {
int Tcl_IsChannelExisting(const char *channelName)
}
declare 419 {
declare 419 {deprecated {Use Tcl_UtfNcasecmp}} {
int Tcl_UniCharNcasecmp(const Tcl_UniChar *ucs, const Tcl_UniChar *uct,
unsigned long numChars)
}
declare 420 {
declare 420 {deprecated {Use Tcl_StringCaseMatch}} {
int Tcl_UniCharCaseMatch(const Tcl_UniChar *uniStr,
const Tcl_UniChar *uniPattern, int nocase)
}
@@ -2009,19 +2009,19 @@ declare 554 {
# TIP#237 (arbitrary-precision integers) kbk
declare 555 {
Tcl_Obj *Tcl_NewBignumObj(mp_int *value)
Tcl_Obj *Tcl_NewBignumObj(void *value)
}
declare 556 {
Tcl_Obj *Tcl_DbNewBignumObj(mp_int *value, const char *file, int line)
Tcl_Obj *Tcl_DbNewBignumObj(void *value, const char *file, int line)
}
declare 557 {
void Tcl_SetBignumObj(Tcl_Obj *obj, mp_int *value)
void Tcl_SetBignumObj(Tcl_Obj *obj, void *value)
}
declare 558 {
int Tcl_GetBignumFromObj(Tcl_Interp *interp, Tcl_Obj *obj, mp_int *value)
int Tcl_GetBignumFromObj(Tcl_Interp *interp, Tcl_Obj *obj, void *value)
}
declare 559 {
int Tcl_TakeBignumFromObj(Tcl_Interp *interp, Tcl_Obj *obj, mp_int *value)
int Tcl_TakeBignumFromObj(Tcl_Interp *interp, Tcl_Obj *obj, void *value)
}
# TIP #208 ('chan' command) jeffh
@@ -2050,7 +2050,7 @@ declare 565 {
# TIP #237 (additional conversion functions for bignum support) kbk/dgp
declare 566 {
int Tcl_InitBignumFromDouble(Tcl_Interp *interp, double initval,
mp_int *toInit)
void *toInit)
}
# TIP#181 (namespace unknown command) dgp for Neil Madden
@@ -2221,7 +2221,7 @@ declare 606 {
# TIP#307 (move results between interpreters) dkf
declare 607 {
void Tcl_TransferResult(Tcl_Interp *sourceInterp, int result,
void Tcl_TransferResult(Tcl_Interp *sourceInterp, int code,
Tcl_Interp *targetInterp)
}
+31 -21
View File
@@ -51,10 +51,10 @@ extern "C" {
#define TCL_MAJOR_VERSION 8
#define TCL_MINOR_VERSION 7
#define TCL_RELEASE_LEVEL TCL_ALPHA_RELEASE
#define TCL_RELEASE_SERIAL 2
#define TCL_RELEASE_SERIAL 4
#define TCL_VERSION "8.7"
#define TCL_PATCH_LEVEL "8.7a2"
#define TCL_PATCH_LEVEL "8.7a4"
#if !defined(TCL_NO_DEPRECATED) || defined(RC_INVOKED)
/*
@@ -361,7 +361,7 @@ typedef long LONG;
*/
#if !defined(TCL_WIDE_INT_TYPE)&&!defined(TCL_WIDE_INT_IS_LONG)
# if defined(_WIN32)
# if defined(_MSC_VER) || defined(_WIN32)
# define TCL_WIDE_INT_TYPE __int64
# define TCL_LL_MODIFIER "I64"
# if defined(_WIN64)
@@ -1031,7 +1031,11 @@ typedef struct Tcl_DString {
#define TCL_TRACE_WRITES 0x20
#define TCL_TRACE_UNSETS 0x40
#define TCL_TRACE_DESTROYED 0x80
#if !defined(TCL_NO_DEPRECATED) && TCL_MAJOR_VERSION < 9
#define TCL_INTERP_DESTROYED 0x100
#endif
#define TCL_LEAVE_ERR_MSG 0x200
#define TCL_TRACE_ARRAY 0x800
#ifndef TCL_REMOVE_OBSOLETE_TRACES
@@ -1729,7 +1733,7 @@ typedef struct Tcl_Filesystem {
* arbitrary additional data to files in a
* filesystem. */
Tcl_FSFileAttrsGetProc *fileAttrsGetProc;
/* Called by 'Tcl_FSFileAttrsGet()' and by
/* Called by 'Tcl_FSFileAttrsGet()' and by
* 'file attributes'. */
Tcl_FSFileAttrsSetProc *fileAttrsSetProc;
/* Called by 'Tcl_FSFileAttrsSet()' and by
@@ -2106,16 +2110,15 @@ typedef struct Tcl_EncodingType {
/*
* The maximum number of bytes that are necessary to represent a single
* Unicode character in UTF-8. The valid values are 4 and 6
* (or perhaps 1 if we want to support a non-unicode enabled core). If 4,
* then Tcl_UniChar must be 2-bytes in size (UCS-2) (the default). If 6,
* Unicode character in UTF-8. The valid values are 3 and 4
* (or perhaps 1 if we want to support a non-unicode enabled core). If 3,
* then Tcl_UniChar must be 2-bytes in size (UCS-2) (the default). If > 3,
* then Tcl_UniChar must be 4-bytes in size (UCS-4). At this time UCS-2 mode
* is the default and recommended mode. UCS-4 is experimental and not
* recommended. It works for the core, but most extensions expect UCS-2.
* is the default and recommended mode.
*/
#ifndef TCL_UTF_MAX
#define TCL_UTF_MAX 4
#define TCL_UTF_MAX 3
#endif
/*
@@ -2123,15 +2126,11 @@ typedef struct Tcl_EncodingType {
* reflected in regcustom.h.
*/
#if TCL_UTF_MAX > 4
#if TCL_UTF_MAX > 3
/*
* int isn't 100% accurate as it should be a strict 4-byte value
* (perhaps wchar_t). 64-bit systems may have troubles. The size of this
* value must be reflected correctly in regcustom.h and
* in tclEncoding.c.
* XXX: Tcl is currently UCS-2 and planning UTF-16 for the Unicode
* XXX: string rep that Tcl_UniChar represents. Changing the size
* XXX: of Tcl_UniChar is /not/ supported.
* (perhaps wchar_t). ILP64/SILP64 systems may have troubles. The
* size of this value must be reflected correctly in regcustom.h.
*/
typedef int Tcl_UniChar;
#else
@@ -2168,13 +2167,24 @@ typedef struct Tcl_Config {
typedef void (Tcl_LimitHandlerProc) (ClientData clientData, Tcl_Interp *interp);
typedef void (Tcl_LimitHandlerDeleteProc) (ClientData clientData);
#if 0
/*
*----------------------------------------------------------------------------
* Override definitions for libtommath.
* We would like to provide an anonymous structure "mp_int" here, which is
* compatible with libtommath's "mp_int", but without duplicating anything
* from <tommath.h> or including <tommath.h> here. But the libtommath project
* didn't honor our request. See: <https://github.com/libtom/libtommath/pull/473>
*
* That's why this part is commented out, and we are using (void *) in
* various API's in stead of the more correct (mp_int *).
*/
typedef struct mp_int mp_int;
#ifndef MP_INT_DECLARED
#define MP_INT_DECLARED
typedef struct mp_int mp_int;
#endif
#endif
/*
*----------------------------------------------------------------------------
@@ -2309,10 +2319,10 @@ typedef int (Tcl_NRPostProc) (ClientData data[], Tcl_Interp *interp,
/*
*----------------------------------------------------------------------------
* The following constant is used to test for older versions of Tcl in the
* stubs tables. If TCL_UTF_MAX>4 use a different value.
* stubs tables.
*/
#define TCL_STUB_MAGIC ((int) 0xFCA3BACF + (TCL_UTF_MAX>4))
#define TCL_STUB_MAGIC ((int) 0xFCA3BACF)
/*
* The following function is required to be defined in all stubs aware
+2 -2
View File
@@ -772,7 +772,7 @@ BBEmitInst1or4(
int
Tcl_AssembleObjCmd(
ClientData dummy, /* Not used. */
ClientData clientData, /* clientData */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
@@ -782,7 +782,7 @@ Tcl_AssembleObjCmd(
* because there needs to be one in place to execute bytecode.
*/
return Tcl_NRCallObjProc(interp, TclNRAssembleObjCmd, dummy, objc, objv);
return Tcl_NRCallObjProc(interp, TclNRAssembleObjCmd, clientData, objc, objv);
}
int
+244 -173
View File
File diff suppressed because it is too large Load Diff
+39 -30
View File
@@ -12,7 +12,7 @@
*/
#include "tclInt.h"
#include "tommath.h"
#include "tclTomMath.h"
#include <math.h>
#include <assert.h>
@@ -370,6 +370,8 @@ Tcl_DbNewByteArrayObj(
Tcl_SetByteArrayObj(objPtr, bytes, length);
return objPtr;
#else /* if not TCL_MEM_DEBUG */
(void)file;
(void)line;
return Tcl_NewByteArrayObj(bytes, length);
#endif /* TCL_MEM_DEBUG */
}
@@ -411,7 +413,7 @@ Tcl_SetByteArrayObj(
if (length < 0) {
length = 0;
}
byteArrayPtr = ckalloc(BYTEARRAY_SIZE(length));
byteArrayPtr = (ByteArray *)ckalloc(BYTEARRAY_SIZE(length));
byteArrayPtr->used = length;
byteArrayPtr->allocated = length;
@@ -520,7 +522,7 @@ Tcl_SetByteArrayLength(
byteArrayPtr = GET_BYTEARRAY(irPtr);
if (newLength > byteArrayPtr->allocated) {
byteArrayPtr = ckrealloc(byteArrayPtr, BYTEARRAY_SIZE(newLength));
byteArrayPtr = (ByteArray *)ckrealloc(byteArrayPtr, BYTEARRAY_SIZE(newLength));
byteArrayPtr->allocated = newLength;
SET_BYTEARRAY(irPtr, byteArrayPtr);
}
@@ -547,7 +549,7 @@ Tcl_SetByteArrayLength(
static int
SetByteArrayFromAny(
Tcl_Interp *interp, /* Not used. */
Tcl_Interp *dummy, /* Not used. */
Tcl_Obj *objPtr) /* The object to convert to type ByteArray. */
{
size_t length;
@@ -557,6 +559,7 @@ SetByteArrayFromAny(
Tcl_UniChar ch = 0;
ByteArray *byteArrayPtr;
Tcl_ObjIntRep ir;
(void)dummy;
if (TclHasIntRep(objPtr, &properByteArrayType)) {
return TCL_OK;
@@ -569,7 +572,7 @@ SetByteArrayFromAny(
length = objPtr->length;
srcEnd = src + length;
byteArrayPtr = ckalloc(BYTEARRAY_SIZE(length));
byteArrayPtr = (ByteArray *)ckalloc(BYTEARRAY_SIZE(length));
for (dst = byteArrayPtr->bytes; src < srcEnd; ) {
src += TclUtfToUniChar(src, &ch);
improper = improper || (ch > 255);
@@ -645,7 +648,7 @@ DupByteArrayInternalRep(
srcArrayPtr = GET_BYTEARRAY(TclFetchIntRep(srcPtr, &tclByteArrayType));
length = srcArrayPtr->used;
copyArrayPtr = ckalloc(BYTEARRAY_SIZE(length));
copyArrayPtr = (ByteArray *)ckalloc(BYTEARRAY_SIZE(length));
copyArrayPtr->used = length;
copyArrayPtr->allocated = length;
memcpy(copyArrayPtr->bytes, srcArrayPtr->bytes, length);
@@ -666,7 +669,7 @@ DupProperByteArrayInternalRep(
srcArrayPtr = GET_BYTEARRAY(TclFetchIntRep(srcPtr, &properByteArrayType));
length = srcArrayPtr->used;
copyArrayPtr = ckalloc(BYTEARRAY_SIZE(length));
copyArrayPtr = (ByteArray *)ckalloc(BYTEARRAY_SIZE(length));
copyArrayPtr->used = length;
copyArrayPtr->allocated = length;
memcpy(copyArrayPtr->bytes, srcArrayPtr->bytes, length);
@@ -809,7 +812,7 @@ TclAppendBytesToByteArray(
*/
attempt = 2 * needed;
ptr = attemptckrealloc(byteArrayPtr, BYTEARRAY_SIZE(attempt));
ptr = (ByteArray *)attemptckrealloc(byteArrayPtr, BYTEARRAY_SIZE(attempt));
}
if (ptr == NULL) {
/*
@@ -821,7 +824,7 @@ TclAppendBytesToByteArray(
int growth = (int) ((extra > limit) ? limit : extra);
attempt = needed + growth;
ptr = attemptckrealloc(byteArrayPtr, BYTEARRAY_SIZE(attempt));
ptr = (ByteArray *)attemptckrealloc(byteArrayPtr, BYTEARRAY_SIZE(attempt));
}
if (ptr == NULL) {
/*
@@ -829,7 +832,7 @@ TclAppendBytesToByteArray(
*/
attempt = needed;
ptr = ckrealloc(byteArrayPtr, BYTEARRAY_SIZE(attempt));
ptr = (ByteArray *)ckrealloc(byteArrayPtr, BYTEARRAY_SIZE(attempt));
}
byteArrayPtr = ptr;
byteArrayPtr->allocated = attempt;
@@ -912,6 +915,7 @@ BinaryFormatCmd(
const char *errorString;
const char *errorValue, *str;
int offset, size, length;
(void)dummy;
if (objc < 2) {
Tcl_WrongNumArgs(interp, 1, objv, "formatString ?arg ...?");
@@ -1363,7 +1367,7 @@ BinaryFormatCmd(
badField:
{
Tcl_UniChar ch = 0;
char buf[TCL_UTF_MAX + 1] = "";
char buf[5] = "";
TclUtfToUniChar(errorString, &ch);
buf[Tcl_UniCharToUtf(ch, buf)] = '\0';
@@ -1413,12 +1417,12 @@ BinaryScanCmd(
unsigned char *buffer; /* Start of result buffer. */
const char *errorString;
const char *str;
int offset, size, length;
int offset, size, length, i;
int i;
Tcl_Obj *valuePtr, *elementPtr;
Tcl_HashTable numberCacheHash;
Tcl_HashTable *numberCachePtr;
(void)dummy;
if (objc < 3) {
Tcl_WrongNumArgs(interp, 1, objv,
@@ -1733,7 +1737,7 @@ BinaryScanCmd(
badField:
{
Tcl_UniChar ch = 0;
char buf[TCL_UTF_MAX + 1] = "";
char buf[5] = "";
TclUtfToUniChar(errorString, &ch);
buf[Tcl_UniCharToUtf(ch, buf)] = '\0';
@@ -1946,8 +1950,8 @@ CopyNumber(
memcpy(to, from, length);
break;
case 1: {
const unsigned char *fromPtr = from;
unsigned char *toPtr = to;
const unsigned char *fromPtr = (const unsigned char *)from;
unsigned char *toPtr = (unsigned char *)to;
switch (length) {
case 4:
@@ -1970,8 +1974,8 @@ CopyNumber(
break;
}
case 2: {
const unsigned char *fromPtr = from;
unsigned char *toPtr = to;
const unsigned char *fromPtr = (const unsigned char *)from;
unsigned char *toPtr = (unsigned char *)to;
toPtr[0] = fromPtr[4];
toPtr[1] = fromPtr[5];
@@ -1984,8 +1988,8 @@ CopyNumber(
break;
}
case 3: {
const unsigned char *fromPtr = from;
unsigned char *toPtr = to;
const unsigned char *fromPtr = (const unsigned char *)from;
unsigned char *toPtr = (unsigned char *)to;
toPtr[0] = fromPtr[3];
toPtr[1] = fromPtr[2];
@@ -2294,7 +2298,7 @@ ScanNumber(
hPtr = Tcl_CreateHashEntry(tablePtr, INT2PTR(value), &isNew);
if (!isNew) {
return Tcl_GetHashValue(hPtr);
return (Tcl_Obj *)Tcl_GetHashValue(hPtr);
}
if (tablePtr->numEntries <= BINARY_SCAN_MAX_CACHE) {
Tcl_Obj *objPtr = Tcl_NewWideIntObj(value);
@@ -2349,8 +2353,7 @@ ScanNumber(
Tcl_Obj *bigObj = NULL;
mp_int big;
if (mp_init(&big) == MP_OKAY) {
mp_set_ull(&big, uwvalue);
if (mp_init_u64(&big, uwvalue) == MP_OKAY) {
bigObj = Tcl_NewBignumObj(&big);
}
return bigObj;
@@ -2418,7 +2421,7 @@ DeleteScanNumberCache(
hEntry = Tcl_FirstHashEntry(numberCachePtr, &search);
while (hEntry != NULL) {
Tcl_Obj *value = Tcl_GetHashValue(hEntry);
Tcl_Obj *value = (Tcl_Obj *)Tcl_GetHashValue(hEntry);
if (value != NULL) {
Tcl_DecrRefCount(value);
@@ -2464,7 +2467,7 @@ DeleteScanNumberCache(
static int
BinaryEncodeHex(
ClientData clientData,
ClientData dummy,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
@@ -2473,6 +2476,7 @@ BinaryEncodeHex(
unsigned char *data = NULL;
unsigned char *cursor = NULL;
int offset = 0, count = 0;
(void)dummy;
if (objc != 2) {
Tcl_WrongNumArgs(interp, 1, objv, "data");
@@ -2508,7 +2512,7 @@ BinaryEncodeHex(
static int
BinaryDecodeHex(
ClientData clientData,
ClientData dummy,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
@@ -2519,6 +2523,7 @@ BinaryDecodeHex(
int i, index, value, size, count = 0, cut = 0, strict = 0;
enum {OPT_STRICT };
static const char *const optStrings[] = { "-strict", NULL };
(void)dummy;
if (objc < 2 || objc > 3) {
Tcl_WrongNumArgs(interp, 1, objv, "?options? data");
@@ -2627,7 +2632,7 @@ BinaryDecodeHex(
static int
BinaryEncode64(
ClientData clientData,
ClientData dummy,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
@@ -2640,6 +2645,7 @@ BinaryEncode64(
int offset, i, index, size, outindex = 0, count = 0;
enum { OPT_MAXLEN, OPT_WRAPCHAR };
static const char *const optStrings[] = { "-maxlen", "-wrapchar", NULL };
(void)dummy;
if (objc < 2 || objc % 2 != 0) {
Tcl_WrongNumArgs(interp, 1, objv,
@@ -2733,7 +2739,7 @@ BinaryEncode64(
static int
BinaryEncodeUu(
ClientData clientData,
ClientData dummy,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
@@ -2747,6 +2753,7 @@ BinaryEncodeUu(
int wrapcharlen = sizeof(SingleNewline);
enum { OPT_MAXLEN, OPT_WRAPCHAR };
static const char *const optStrings[] = { "-maxlen", "-wrapchar", NULL };
(void)dummy;
if (objc < 2 || objc % 2 != 0) {
Tcl_WrongNumArgs(interp, 1, objv,
@@ -2850,7 +2857,7 @@ BinaryEncodeUu(
static int
BinaryDecodeUu(
ClientData clientData,
ClientData dummy,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
@@ -2862,6 +2869,7 @@ BinaryDecodeUu(
unsigned char c;
enum { OPT_STRICT };
static const char *const optStrings[] = { "-strict", NULL };
(void)dummy;
if (objc < 2 || objc > 3) {
Tcl_WrongNumArgs(interp, 1, objv, "?options? data");
@@ -3013,7 +3021,7 @@ BinaryDecodeUu(
static int
BinaryDecode64(
ClientData clientData,
ClientData dummy,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
@@ -3026,6 +3034,7 @@ BinaryDecode64(
int i, index, size, cut = 0, count = 0;
enum { OPT_STRICT };
static const char *const optStrings[] = { "-strict", NULL };
(void)dummy;
if (objc < 2 || objc > 3) {
Tcl_WrongNumArgs(interp, 1, objv, "?options? data");
+30 -30
View File
@@ -109,7 +109,7 @@ typedef struct TclDateFields {
* Greenwich */
Tcl_Obj *tzName; /* Time zone name */
int julianDay; /* Julian Day Number in local time zone */
enum {BCE=1, CE=0} era; /* Era */
int isBce; /* 1 if BCE */
int gregorian; /* Flag == 1 if the date is Gregorian */
int year; /* Year of the era */
int dayOfYear; /* Day of the year (1 January == 1) */
@@ -275,9 +275,9 @@ TclClockInit(
* Create the client data, which is a refcounted literal pool.
*/
data = ckalloc(sizeof(ClockClientData));
data = (ClockClientData *)ckalloc(sizeof(ClockClientData));
data->refCount = 0;
data->literals = ckalloc(LIT__END * sizeof(Tcl_Obj*));
data->literals = (Tcl_Obj **)ckalloc(LIT__END * sizeof(Tcl_Obj*));
for (i = 0; i < LIT__END; ++i) {
data->literals[i] = Tcl_NewStringObj(literals[i], -1);
Tcl_IncrRefCount(data->literals[i]);
@@ -336,7 +336,7 @@ ClockConvertlocaltoutcObjCmd(
int objc, /* Parameter count */
Tcl_Obj *const *objv) /* Parameter vector */
{
ClockClientData *data = clientData;
ClockClientData *data = (ClockClientData *)clientData;
Tcl_Obj *const *literals = data->literals;
Tcl_Obj *secondsObj;
Tcl_Obj *dict;
@@ -430,7 +430,7 @@ ClockGetdatefieldsObjCmd(
{
TclDateFields fields;
Tcl_Obj *dict;
ClockClientData *data = clientData;
ClockClientData *data = (ClockClientData *)clientData;
Tcl_Obj *const *literals = data->literals;
int changeover;
@@ -494,7 +494,7 @@ ClockGetdatefieldsObjCmd(
Tcl_DictObjPut(NULL, dict, literals[LIT_GREGORIAN],
Tcl_NewWideIntObj(fields.gregorian));
Tcl_DictObjPut(NULL, dict, literals[LIT_ERA],
literals[fields.era ? LIT_BCE : LIT_CE]);
literals[fields.isBce ? LIT_BCE : LIT_CE]);
Tcl_DictObjPut(NULL, dict, literals[LIT_YEAR],
Tcl_NewWideIntObj(fields.year));
Tcl_DictObjPut(NULL, dict, literals[LIT_DAYOFYEAR],
@@ -584,12 +584,12 @@ ClockGetjuliandayfromerayearmonthdayObjCmd(
{
TclDateFields fields;
Tcl_Obj *dict;
ClockClientData *data = clientData;
ClockClientData *data = (ClockClientData *)clientData;
Tcl_Obj *const *literals = data->literals;
int changeover;
int copied = 0;
int status;
int era = 0;
int isBce = 0;
/*
* Check params.
@@ -600,7 +600,7 @@ ClockGetjuliandayfromerayearmonthdayObjCmd(
return TCL_ERROR;
}
dict = objv[1];
if (FetchEraField(interp, dict, literals[LIT_ERA], &era) != TCL_OK
if (FetchEraField(interp, dict, literals[LIT_ERA], &isBce) != TCL_OK
|| FetchIntField(interp, dict, literals[LIT_YEAR], &fields.year)
!= TCL_OK
|| FetchIntField(interp, dict, literals[LIT_MONTH], &fields.month)
@@ -610,7 +610,7 @@ ClockGetjuliandayfromerayearmonthdayObjCmd(
|| TclGetIntFromObj(interp, objv[2], &changeover) != TCL_OK) {
return TCL_ERROR;
}
fields.era = era;
fields.isBce = isBce;
/*
* Get Julian day.
@@ -668,12 +668,12 @@ ClockGetjuliandayfromerayearweekdayObjCmd(
{
TclDateFields fields;
Tcl_Obj *dict;
ClockClientData *data = clientData;
ClockClientData *data = (ClockClientData *)clientData;
Tcl_Obj *const *literals = data->literals;
int changeover;
int copied = 0;
int status;
int era = 0;
int isBce = 0;
/*
* Check params.
@@ -684,7 +684,7 @@ ClockGetjuliandayfromerayearweekdayObjCmd(
return TCL_ERROR;
}
dict = objv[1];
if (FetchEraField(interp, dict, literals[LIT_ERA], &era) != TCL_OK
if (FetchEraField(interp, dict, literals[LIT_ERA], &isBce) != TCL_OK
|| FetchIntField(interp, dict, literals[LIT_ISO8601YEAR],
&fields.iso8601Year) != TCL_OK
|| FetchIntField(interp, dict, literals[LIT_ISO8601WEEK],
@@ -694,7 +694,7 @@ ClockGetjuliandayfromerayearweekdayObjCmd(
|| TclGetIntFromObj(interp, objv[2], &changeover) != TCL_OK) {
return TCL_ERROR;
}
fields.era = era;
fields.isBce = isBce;
/*
* Get Julian day.
@@ -1052,7 +1052,7 @@ ConvertUTCToLocalUsingC(
time_t tock;
struct tm *timeVal; /* Time after conversion */
int diff; /* Time zone diff local-Greenwich */
char buffer[8]; /* Buffer for time zone name */
char buffer[16]; /* Buffer for time zone name */
/*
* Use 'localtime' to determine local year, month, day, time of day.
@@ -1079,7 +1079,7 @@ ConvertUTCToLocalUsingC(
* Fill in the date in 'fields' and use it to derive Julian Day.
*/
fields->era = CE;
fields->isBce = 0;
fields->year = timeVal->tm_year + 1900;
fields->month = timeVal->tm_mon + 1;
fields->dayOfMonth = timeVal->tm_mday;
@@ -1217,7 +1217,7 @@ GetYearWeekDay(
temp.julianDay = fields->julianDay - 3;
GetGregorianEraYearDay(&temp, changeover);
if (temp.era == BCE) {
if (temp.isBce) {
temp.iso8601Year = temp.year - 1;
} else {
temp.iso8601Year = temp.year + 1;
@@ -1233,7 +1233,7 @@ GetYearWeekDay(
*/
if (fields->julianDay < temp.julianDay) {
if (temp.era == BCE) {
if (temp.isBce) {
temp.iso8601Year += 1;
} else {
temp.iso8601Year -= 1;
@@ -1359,10 +1359,10 @@ GetGregorianEraYearDay(
*/
if (year <= 0) {
fields->era = BCE;
fields->isBce = 1;
fields->year = 1 - year;
} else {
fields->era = CE;
fields->isBce = 0;
fields->year = year;
}
fields->dayOfYear = day + 1;
@@ -1430,7 +1430,7 @@ GetJulianDayFromEraYearWeekDay(
* Find January 4 in the ISO8601 year, which will always be in week 1.
*/
firstWeek.era = fields->era;
firstWeek.isBce = fields->isBce;
firstWeek.year = fields->iso8601Year;
firstWeek.month = 1;
firstWeek.dayOfMonth = 4;
@@ -1474,7 +1474,7 @@ GetJulianDayFromEraYearMonthDay(
{
int year, ym1, month, mm1, q, r, ym1o4, ym1o100, ym1o400;
if (fields->era == BCE) {
if (fields->isBce) {
year = 1 - fields->year;
} else {
year = fields->year;
@@ -1502,10 +1502,10 @@ GetJulianDayFromEraYearMonthDay(
fields->gregorian = 1;
if (year < 1) {
fields->era = BCE;
fields->isBce = 1;
fields->year = 1-year;
} else {
fields->era = CE;
fields->isBce = 0;
fields->year = year;
}
@@ -1580,7 +1580,7 @@ IsGregorianLeapYear(
{
int year = fields->year;
if (fields->era == BCE) {
if (fields->isBce) {
year = 1 - year;
}
if (year%4 != 0) {
@@ -1693,7 +1693,7 @@ ThreadSafeLocalTime(
* Get a thread-local buffer to hold the returned time.
*/
struct tm *tmPtr = Tcl_GetThreadData(&tmKey, sizeof(struct tm));
struct tm *tmPtr = (struct tm *)Tcl_GetThreadData(&tmKey, sizeof(struct tm));
#ifdef HAVE_LOCALTIME_R
localtime_r(timePtr, tmPtr);
#else
@@ -1879,7 +1879,7 @@ ClockParseformatargsObjCmd(
int objc, /* Parameter count */
Tcl_Obj *const objv[]) /* Parameter vector */
{
ClockClientData *dataPtr = clientData;
ClockClientData *dataPtr = (ClockClientData *)clientData;
Tcl_Obj **litPtr = dataPtr->literals;
Tcl_Obj *results[3]; /* Format, locale and timezone */
#define formatObj results[0]
@@ -2029,7 +2029,7 @@ ClockSecondsObjCmd(
static void
TzsetIfNecessary(void)
{
static char* tzWas = INT2PTR(-1); /* Previous value of TZ, protected by
static char* tzWas = (char *)INT2PTR(-1); /* Previous value of TZ, protected by
* clockMutex. */
const char *tzIsNow; /* Current value of TZ */
@@ -2041,7 +2041,7 @@ TzsetIfNecessary(void)
if (tzWas != NULL && tzWas != INT2PTR(-1)) {
ckfree(tzWas);
}
tzWas = ckalloc(strlen(tzIsNow) + 1);
tzWas = (char *)ckalloc(strlen(tzIsNow) + 1);
strcpy(tzWas, tzIsNow);
} else if (tzIsNow == NULL && tzWas != NULL) {
tzset();
@@ -2069,7 +2069,7 @@ static void
ClockDeleteCmdProc(
ClientData clientData) /* Opaque pointer to the client data */
{
ClockClientData *data = clientData;
ClockClientData *data = (ClockClientData *)clientData;
int i;
if (data->refCount-- <= 1) {
+101 -40
View File
@@ -135,6 +135,8 @@ Tcl_BreakObjCmd(
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
{
(void)dummy;
if (objc != 1) {
Tcl_WrongNumArgs(interp, 1, objv, NULL);
return TCL_ERROR;
@@ -173,6 +175,7 @@ Tcl_CaseObjCmd(
const char *stringPtr, *arg;
Tcl_Obj *const *caseObjv;
Tcl_Obj *armPtr;
(void)dummy;
if (objc < 3) {
Tcl_WrongNumArgs(interp, 1, objv,
@@ -317,6 +320,7 @@ TclNRCatchObjCmd(
Tcl_Obj *varNamePtr = NULL;
Tcl_Obj *optionVarNamePtr = NULL;
Interp *iPtr = (Interp *) interp;
(void)dummy;
if ((objc < 2) || (objc > 4)) {
Tcl_WrongNumArgs(interp, 1, objv,
@@ -349,8 +353,8 @@ CatchObjCmdCallback(
{
Interp *iPtr = (Interp *) interp;
int objc = PTR2INT(data[0]);
Tcl_Obj *varNamePtr = data[1];
Tcl_Obj *optionVarNamePtr = data[2];
Tcl_Obj *varNamePtr = (Tcl_Obj *)data[1];
Tcl_Obj *optionVarNamePtr = (Tcl_Obj *)data[2];
int rewind = iPtr->execEnvPtr->rewind;
/*
@@ -412,6 +416,7 @@ Tcl_CdObjCmd(
{
Tcl_Obj *dir;
int result;
(void)dummy;
if (objc > 2) {
Tcl_WrongNumArgs(interp, 1, objv, "?dirName?");
@@ -466,6 +471,8 @@ Tcl_ConcatObjCmd(
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
{
(void)dummy;
if (objc >= 2) {
Tcl_SetObjResult(interp, Tcl_ConcatObj(objc-1, objv+1));
}
@@ -501,6 +508,8 @@ Tcl_ContinueObjCmd(
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
{
(void)dummy;
if (objc != 1) {
Tcl_WrongNumArgs(interp, 1, objv, NULL);
return TCL_ERROR;
@@ -566,6 +575,7 @@ EncodingConvertfromObjCmd(
Tcl_Encoding encoding; /* Encoding to use */
int length; /* Length of the byte array being converted */
const char *bytesPtr; /* Pointer to the first byte of the array */
(void)dummy;
if (objc == 2) {
encoding = Tcl_GetEncoding(interp, NULL);
@@ -628,6 +638,7 @@ EncodingConverttoObjCmd(
Tcl_Encoding encoding; /* Encoding to use */
int length; /* Length of the string being converted */
const char *stringPtr; /* Pointer to the first byte of the string */
(void)dummy;
/* TODO - ADJUST OBJ INDICES WHEN ENSEMBLIFYING THIS */
@@ -688,6 +699,7 @@ EncodingDirsObjCmd(
Tcl_Obj *const objv[]) /* Argument objects. */
{
Tcl_Obj *dirListObj;
(void)dummy;
if (objc > 2) {
Tcl_WrongNumArgs(interp, 1, objv, "?dirList?");
@@ -725,11 +737,14 @@ EncodingDirsObjCmd(
*/
int
EncodingNamesObjCmd(ClientData dummy, /* Unused */
EncodingNamesObjCmd(
ClientData dummy, /* Not used. */
Tcl_Interp* interp, /* Tcl interpreter */
int objc, /* Number of command line args */
Tcl_Obj* const objv[]) /* Vector of command line args */
{
(void)dummy;
if (objc > 1) {
Tcl_WrongNumArgs(interp, 1, objv, NULL);
return TCL_ERROR;
@@ -755,11 +770,14 @@ EncodingNamesObjCmd(ClientData dummy, /* Unused */
*/
int
EncodingSystemObjCmd(ClientData dummy, /* Unused */
EncodingSystemObjCmd(
ClientData dummy, /* Not used. */
Tcl_Interp* interp, /* Tcl interpreter */
int objc, /* Number of command line args */
Tcl_Obj* const objv[]) /* Vector of command line args */
{
(void)dummy;
if (objc > 2) {
Tcl_WrongNumArgs(interp, 1, objv, "?encoding?");
return TCL_ERROR;
@@ -799,6 +817,7 @@ Tcl_ErrorObjCmd(
Tcl_Obj *const objv[]) /* Argument objects. */
{
Tcl_Obj *options, *optName;
(void)dummy;
if ((objc < 2) || (objc > 4)) {
Tcl_WrongNumArgs(interp, 1, objv, "message ?errorInfo? ?errorCode?");
@@ -843,10 +862,12 @@ Tcl_ErrorObjCmd(
/* ARGSUSED */
static int
EvalCmdErrMsg(
ClientData data[],
ClientData dummy[],
Tcl_Interp *interp,
int result)
{
(void)dummy;
if (result == TCL_ERROR) {
Tcl_AppendObjToErrorInfo(interp, Tcl_ObjPrintf(
"\n (\"eval\" body line %d)", Tcl_GetErrorLine(interp)));
@@ -875,6 +896,7 @@ TclNREvalObjCmd(
Interp *iPtr = (Interp *) interp;
CmdFrame *invoker = NULL;
int word = 0;
(void)dummy;
if (objc < 2) {
Tcl_WrongNumArgs(interp, 1, objv, "arg ?arg ...?");
@@ -932,6 +954,7 @@ Tcl_ExitObjCmd(
Tcl_Obj *const objv[]) /* Argument objects. */
{
Tcl_WideInt value;
(void)dummy;
if ((objc != 1) && (objc != 2)) {
Tcl_WrongNumArgs(interp, 1, objv, "?returnCode?");
@@ -991,6 +1014,7 @@ TclNRExprObjCmd(
Tcl_Obj *const objv[]) /* Argument objects. */
{
Tcl_Obj *resultPtr, *objPtr;
(void)dummy;
if (objc < 2) {
Tcl_WrongNumArgs(interp, 1, objv, "arg ?arg ...?");
@@ -1016,8 +1040,8 @@ ExprCallback(
Tcl_Interp *interp,
int result)
{
Tcl_Obj *resultPtr = data[0];
Tcl_Obj *objPtr = data[1];
Tcl_Obj *resultPtr = (Tcl_Obj *)data[0];
Tcl_Obj *objPtr = (Tcl_Obj *)data[1];
if (objPtr != NULL) {
Tcl_DecrRefCount(objPtr);
@@ -1121,13 +1145,14 @@ TclInitFileCmd(
static int
FileAttrAccessTimeCmd(
ClientData clientData,
ClientData dummy,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
{
Tcl_StatBuf buf;
struct utimbuf tval;
(void)dummy;
if (objc < 2 || objc > 3) {
Tcl_WrongNumArgs(interp, 1, objv, "name ?time?");
@@ -1203,13 +1228,14 @@ FileAttrAccessTimeCmd(
static int
FileAttrModifyTimeCmd(
ClientData clientData,
ClientData dummy,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
{
Tcl_StatBuf buf;
struct utimbuf tval;
(void)dummy;
if (objc < 2 || objc > 3) {
Tcl_WrongNumArgs(interp, 1, objv, "name ?time?");
@@ -1282,12 +1308,13 @@ FileAttrModifyTimeCmd(
static int
FileAttrLinkStatCmd(
ClientData clientData,
ClientData dummy,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
{
Tcl_StatBuf buf;
(void)dummy;
if (objc != 3) {
Tcl_WrongNumArgs(interp, 1, objv, "name varName");
@@ -1318,12 +1345,13 @@ FileAttrLinkStatCmd(
static int
FileAttrStatCmd(
ClientData clientData,
ClientData dummy,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
{
Tcl_StatBuf buf;
(void)dummy;
if (objc != 3) {
Tcl_WrongNumArgs(interp, 1, objv, "name varName");
@@ -1354,12 +1382,13 @@ FileAttrStatCmd(
static int
FileAttrTypeCmd(
ClientData clientData,
ClientData dummy,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
{
Tcl_StatBuf buf;
(void)dummy;
if (objc != 2) {
Tcl_WrongNumArgs(interp, 1, objv, "name");
@@ -1392,12 +1421,13 @@ FileAttrTypeCmd(
static int
FileAttrSizeCmd(
ClientData clientData,
ClientData dummy,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
{
Tcl_StatBuf buf;
(void)dummy;
if (objc != 2) {
Tcl_WrongNumArgs(interp, 1, objv, "name");
@@ -1429,13 +1459,14 @@ FileAttrSizeCmd(
static int
FileAttrIsDirectoryCmd(
ClientData clientData,
ClientData dummy,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
{
Tcl_StatBuf buf;
int value = 0;
(void)dummy;
if (objc != 2) {
Tcl_WrongNumArgs(interp, 1, objv, "name");
@@ -1467,11 +1498,13 @@ FileAttrIsDirectoryCmd(
static int
FileAttrIsExecutableCmd(
ClientData clientData,
ClientData dummy,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
{
(void)dummy;
if (objc != 2) {
Tcl_WrongNumArgs(interp, 1, objv, "name");
return TCL_ERROR;
@@ -1498,11 +1531,13 @@ FileAttrIsExecutableCmd(
static int
FileAttrIsExistingCmd(
ClientData clientData,
ClientData dummy,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
{
(void)dummy;
if (objc != 2) {
Tcl_WrongNumArgs(interp, 1, objv, "name");
return TCL_ERROR;
@@ -1529,13 +1564,14 @@ FileAttrIsExistingCmd(
static int
FileAttrIsFileCmd(
ClientData clientData,
ClientData dummy,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
{
Tcl_StatBuf buf;
int value = 0;
(void)dummy;
if (objc != 2) {
Tcl_WrongNumArgs(interp, 1, objv, "name");
@@ -1567,7 +1603,7 @@ FileAttrIsFileCmd(
static int
FileAttrIsOwnedCmd(
ClientData clientData,
ClientData dummy,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
@@ -1579,6 +1615,7 @@ FileAttrIsOwnedCmd(
Tcl_StatBuf buf;
#endif
int value = 0;
(void)dummy;
if (objc != 2) {
Tcl_WrongNumArgs(interp, 1, objv, "name");
@@ -1614,11 +1651,13 @@ FileAttrIsOwnedCmd(
static int
FileAttrIsReadableCmd(
ClientData clientData,
ClientData dummy,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
{
(void)dummy;
if (objc != 2) {
Tcl_WrongNumArgs(interp, 1, objv, "name");
return TCL_ERROR;
@@ -1645,11 +1684,13 @@ FileAttrIsReadableCmd(
static int
FileAttrIsWritableCmd(
ClientData clientData,
ClientData dummy,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
{
(void)dummy;
if (objc != 2) {
Tcl_WrongNumArgs(interp, 1, objv, "name");
return TCL_ERROR;
@@ -1676,12 +1717,13 @@ FileAttrIsWritableCmd(
static int
PathDirNameCmd(
ClientData clientData,
ClientData dummy,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
{
Tcl_Obj *dirPtr;
(void)dummy;
if (objc != 2) {
Tcl_WrongNumArgs(interp, 1, objv, "name");
@@ -1715,12 +1757,13 @@ PathDirNameCmd(
static int
PathExtensionCmd(
ClientData clientData,
ClientData dummy,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
{
Tcl_Obj *dirPtr;
(void)dummy;
if (objc != 2) {
Tcl_WrongNumArgs(interp, 1, objv, "name");
@@ -1754,12 +1797,13 @@ PathExtensionCmd(
static int
PathRootNameCmd(
ClientData clientData,
ClientData dummy,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
{
Tcl_Obj *dirPtr;
(void)dummy;
if (objc != 2) {
Tcl_WrongNumArgs(interp, 1, objv, "name");
@@ -1793,12 +1837,13 @@ PathRootNameCmd(
static int
PathTailCmd(
ClientData clientData,
ClientData dummy,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
{
Tcl_Obj *dirPtr;
(void)dummy;
if (objc != 2) {
Tcl_WrongNumArgs(interp, 1, objv, "name");
@@ -1832,12 +1877,13 @@ PathTailCmd(
static int
PathFilesystemCmd(
ClientData clientData,
ClientData dummy,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
{
Tcl_Obj *fsInfo;
(void)dummy;
if (objc != 2) {
Tcl_WrongNumArgs(interp, 1, objv, "name");
@@ -1873,11 +1919,13 @@ PathFilesystemCmd(
static int
PathJoinCmd(
ClientData clientData,
ClientData dummy,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
{
(void)dummy;
if (objc < 2) {
Tcl_WrongNumArgs(interp, 1, objv, "name ?name ...?");
return TCL_ERROR;
@@ -1905,12 +1953,13 @@ PathJoinCmd(
static int
PathNativeNameCmd(
ClientData clientData,
ClientData dummy,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
{
Tcl_DString ds;
(void)dummy;
if (objc != 2) {
Tcl_WrongNumArgs(interp, 1, objv, "name");
@@ -1942,12 +1991,13 @@ PathNativeNameCmd(
static int
PathNormalizeCmd(
ClientData clientData,
ClientData dummy,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
{
Tcl_Obj *fileName;
(void)dummy;
if (objc != 2) {
Tcl_WrongNumArgs(interp, 1, objv, "name");
@@ -1980,12 +2030,13 @@ PathNormalizeCmd(
static int
PathSplitCmd(
ClientData clientData,
ClientData dummy,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
{
Tcl_Obj *res;
(void)dummy;
if (objc != 2) {
Tcl_WrongNumArgs(interp, 1, objv, "name");
@@ -2023,12 +2074,13 @@ PathSplitCmd(
static int
PathTypeCmd(
ClientData clientData,
ClientData dummy,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
{
Tcl_Obj *typeName;
(void)dummy;
if (objc != 2) {
Tcl_WrongNumArgs(interp, 1, objv, "name");
@@ -2071,11 +2123,13 @@ PathTypeCmd(
static int
FilesystemSeparatorCmd(
ClientData clientData,
ClientData dummy,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
{
(void)dummy;
if (objc < 1 || objc > 2) {
Tcl_WrongNumArgs(interp, 1, objv, "?name?");
return TCL_ERROR;
@@ -2126,11 +2180,13 @@ FilesystemSeparatorCmd(
static int
FilesystemVolumesCmd(
ClientData clientData,
ClientData dummy,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
{
(void)dummy;
if (objc != 1) {
Tcl_WrongNumArgs(interp, 1, objv, NULL);
return TCL_ERROR;
@@ -2404,6 +2460,7 @@ TclNRForObjCmd(
{
Interp *iPtr = (Interp *) interp;
ForIterData *iterPtr;
(void)dummy;
if (objc != 5) {
Tcl_WrongNumArgs(interp, 1, objv, "start test next command");
@@ -2432,7 +2489,7 @@ ForSetupCallback(
Tcl_Interp *interp,
int result)
{
ForIterData *iterPtr = data[0];
ForIterData *iterPtr = (ForIterData *)data[0];
if (result != TCL_OK) {
if (result == TCL_ERROR) {
@@ -2451,7 +2508,7 @@ TclNRForIterCallback(
Tcl_Interp *interp,
int result)
{
ForIterData *iterPtr = data[0];
ForIterData *iterPtr = (ForIterData *)data[0];
Tcl_Obj *boolObj;
switch (result) {
@@ -2487,8 +2544,8 @@ ForCondCallback(
int result)
{
Interp *iPtr = (Interp *) interp;
ForIterData *iterPtr = data[0];
Tcl_Obj *boolObj = data[1];
ForIterData *iterPtr = (ForIterData *)data[0];
Tcl_Obj *boolObj = (Tcl_Obj *)data[1];
int value;
if (result != TCL_OK) {
@@ -2525,7 +2582,7 @@ ForNextCallback(
int result)
{
Interp *iPtr = (Interp *) interp;
ForIterData *iterPtr = data[0];
ForIterData *iterPtr = (ForIterData *)data[0];
Tcl_Obj *next = iterPtr->next;
if ((result == TCL_OK) || (result == TCL_CONTINUE)) {
@@ -2549,7 +2606,7 @@ ForPostNextCallback(
Tcl_Interp *interp,
int result)
{
ForIterData *iterPtr = data[0];
ForIterData *iterPtr = (ForIterData *)data[0];
if ((result != TCL_BREAK) && (result != TCL_OK)) {
if (result == TCL_ERROR) {
@@ -2597,6 +2654,8 @@ TclNRForeachCmd(
int objc,
Tcl_Obj *const objv[])
{
(void)dummy;
return EachloopCmd(interp, TCL_EACH_KEEP_NONE, objc, objv);
}
@@ -2617,6 +2676,7 @@ TclNRLmapCmd(
int objc,
Tcl_Obj *const objv[])
{
(void)dummy;
return EachloopCmd(interp, TCL_EACH_COLLECT, objc, objv);
}
@@ -2654,7 +2714,7 @@ EachloopCmd(
* allocation for better performance.
*/
statePtr = TclStackAlloc(interp,
statePtr = (struct ForeachState *)TclStackAlloc(interp,
sizeof(struct ForeachState) + 3 * numLists * sizeof(int)
+ 2 * numLists * (sizeof(Tcl_Obj **) + sizeof(Tcl_Obj *)));
memset(statePtr, 0,
@@ -2755,7 +2815,7 @@ ForeachLoopStep(
Tcl_Interp *interp,
int result)
{
struct ForeachState *statePtr = data[0];
struct ForeachState *statePtr = (struct ForeachState *)data[0];
/*
* Process the result code from this run of the [foreach] body. Note that
@@ -2906,6 +2966,7 @@ Tcl_FormatObjCmd(
Tcl_Obj *const objv[]) /* Argument objects. */
{
Tcl_Obj *resultPtr; /* Where result is stored finally. */
(void)dummy;
if (objc < 2) {
Tcl_WrongNumArgs(interp, 1, objv, "formatString ?arg ...?");
+91 -32
View File
@@ -222,6 +222,7 @@ TclNRIfObjCmd(
Tcl_Obj *const objv[]) /* Argument objects. */
{
Tcl_Obj *boolObj;
(void)dummy;
if (objc <= 1) {
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
@@ -251,9 +252,9 @@ IfConditionCallback(
{
Interp *iPtr = (Interp *) interp;
int objc = PTR2INT(data[0]);
Tcl_Obj *const *objv = data[1];
Tcl_Obj *const *objv = (Tcl_Obj *const *)data[1];
int i = PTR2INT(data[2]);
Tcl_Obj *boolObj = data[3];
Tcl_Obj *boolObj = (Tcl_Obj *)data[3];
int value, thenScriptIndex = 0;
const char *clause;
@@ -395,6 +396,7 @@ Tcl_IncrObjCmd(
Tcl_Obj *const objv[]) /* Argument objects. */
{
Tcl_Obj *newValuePtr, *incrPtr;
(void)dummy;
if ((objc != 2) && (objc != 3)) {
Tcl_WrongNumArgs(interp, 1, objv, "varName ?increment?");
@@ -480,6 +482,7 @@ InfoArgsCmd(
Proc *procPtr;
CompiledLocal *localPtr;
Tcl_Obj *listObjPtr;
(void)dummy;
if (objc != 2) {
Tcl_WrongNumArgs(interp, 1, objv, "procname");
@@ -542,6 +545,7 @@ InfoBodyCmd(
const char *name, *bytes;
Proc *procPtr;
int numBytes;
(void)dummy;
if (objc != 2) {
Tcl_WrongNumArgs(interp, 1, objv, "procname");
@@ -600,6 +604,7 @@ InfoCmdCountCmd(
Tcl_Obj *const objv[]) /* Argument objects. */
{
Interp *iPtr = (Interp *) interp;
(void)dummy;
if (objc != 1) {
Tcl_WrongNumArgs(interp, 1, objv, NULL);
@@ -652,6 +657,7 @@ InfoCommandsCmd(
int specificNsInPattern = 0;/* Init. to avoid compiler warning. */
Tcl_Command cmd;
int i;
(void)dummy;
/*
* Get the pattern and find the "effective namespace" in which to list
@@ -711,11 +717,11 @@ InfoCommandsCmd(
entryPtr = Tcl_FindHashEntry(&nsPtr->cmdTable, simplePattern);
if (entryPtr != NULL) {
if (specificNsInPattern) {
cmd = Tcl_GetHashValue(entryPtr);
cmd = (Tcl_Command)Tcl_GetHashValue(entryPtr);
elemObjPtr = Tcl_NewObj();
Tcl_GetCommandFullName(interp, cmd, elemObjPtr);
} else {
cmdName = Tcl_GetHashKey(&nsPtr->cmdTable, entryPtr);
cmdName = (const char *)Tcl_GetHashKey(&nsPtr->cmdTable, entryPtr);
elemObjPtr = Tcl_NewStringObj(cmdName, -1);
}
Tcl_ListObjAppendElement(interp, listPtr, elemObjPtr);
@@ -742,7 +748,7 @@ InfoCommandsCmd(
entryPtr = Tcl_FindHashEntry(tablePtr, simplePattern);
}
if (entryPtr != NULL) {
cmdName = Tcl_GetHashKey(tablePtr, entryPtr);
cmdName = (const char *)Tcl_GetHashKey(tablePtr, entryPtr);
Tcl_ListObjAppendElement(interp, listPtr,
Tcl_NewStringObj(cmdName, -1));
Tcl_SetObjResult(interp, listPtr);
@@ -758,11 +764,11 @@ InfoCommandsCmd(
entryPtr = Tcl_FirstHashEntry(&nsPtr->cmdTable, &search);
while (entryPtr != NULL) {
cmdName = Tcl_GetHashKey(&nsPtr->cmdTable, entryPtr);
cmdName = (const char *)Tcl_GetHashKey(&nsPtr->cmdTable, entryPtr);
if ((simplePattern == NULL)
|| Tcl_StringMatch(cmdName, simplePattern)) {
if (specificNsInPattern) {
cmd = Tcl_GetHashValue(entryPtr);
cmd = (Tcl_Command)Tcl_GetHashValue(entryPtr);
elemObjPtr = Tcl_NewObj();
Tcl_GetCommandFullName(interp, cmd, elemObjPtr);
} else {
@@ -784,7 +790,7 @@ InfoCommandsCmd(
if ((nsPtr != globalNsPtr) && !specificNsInPattern) {
entryPtr = Tcl_FirstHashEntry(&globalNsPtr->cmdTable, &search);
while (entryPtr != NULL) {
cmdName = Tcl_GetHashKey(&globalNsPtr->cmdTable, entryPtr);
cmdName = (const char *)Tcl_GetHashKey(&globalNsPtr->cmdTable, entryPtr);
if ((simplePattern == NULL)
|| Tcl_StringMatch(cmdName, simplePattern)) {
if (Tcl_FindHashEntry(&nsPtr->cmdTable,cmdName) == NULL) {
@@ -815,7 +821,7 @@ InfoCommandsCmd(
entryPtr = Tcl_FirstHashEntry(&nsPtr->cmdTable, &search);
while (entryPtr != NULL) {
cmdName = Tcl_GetHashKey(&nsPtr->cmdTable, entryPtr);
cmdName = (const char *)Tcl_GetHashKey(&nsPtr->cmdTable, entryPtr);
if ((simplePattern == NULL)
|| Tcl_StringMatch(cmdName, simplePattern)) {
elemObjPtr = Tcl_NewStringObj(cmdName, -1);
@@ -841,7 +847,7 @@ InfoCommandsCmd(
}
entryPtr = Tcl_FirstHashEntry(&pathNsPtr->cmdTable, &search);
while (entryPtr != NULL) {
cmdName = Tcl_GetHashKey(&pathNsPtr->cmdTable, entryPtr);
cmdName = (const char *)Tcl_GetHashKey(&pathNsPtr->cmdTable, entryPtr);
if ((simplePattern == NULL)
|| Tcl_StringMatch(cmdName, simplePattern)) {
elemObjPtr = Tcl_NewStringObj(cmdName, -1);
@@ -868,7 +874,7 @@ InfoCommandsCmd(
if (!foundGlobal) {
entryPtr = Tcl_FirstHashEntry(&globalNsPtr->cmdTable, &search);
while (entryPtr != NULL) {
cmdName = Tcl_GetHashKey(&globalNsPtr->cmdTable, entryPtr);
cmdName = (const char *)Tcl_GetHashKey(&globalNsPtr->cmdTable, entryPtr);
if ((simplePattern == NULL)
|| Tcl_StringMatch(cmdName, simplePattern)) {
elemObjPtr = Tcl_NewStringObj(cmdName, -1);
@@ -918,6 +924,8 @@ InfoCompleteCmd(
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
{
(void)dummy;
if (objc != 2) {
Tcl_WrongNumArgs(interp, 1, objv, "command");
return TCL_ERROR;
@@ -960,6 +968,7 @@ InfoDefaultCmd(
Proc *procPtr;
CompiledLocal *localPtr;
Tcl_Obj *valueObjPtr;
(void)dummy;
if (objc != 4) {
Tcl_WrongNumArgs(interp, 1, objv, "procname arg varname");
@@ -1039,6 +1048,7 @@ InfoErrorStackCmd(
{
Tcl_Interp *target;
Interp *iPtr;
(void)dummy;
if ((objc != 1) && (objc != 2)) {
Tcl_WrongNumArgs(interp, 1, objv, "?interp?");
@@ -1088,6 +1098,7 @@ TclInfoExistsCmd(
{
const char *varName;
Var *varPtr;
(void)dummy;
if (objc != 2) {
Tcl_WrongNumArgs(interp, 1, objv, "varName");
@@ -1136,6 +1147,7 @@ InfoFrameCmd(
CmdFrame *framePtr, **cmdFramePtrPtr = &iPtr->cmdFramePtr;
CoroutineData *corPtr = iPtr->execEnvPtr->corPtr;
int topLevel = 0;
(void)dummy;
if (objc > 2) {
Tcl_WrongNumArgs(interp, 1, objv, "?number?");
@@ -1313,7 +1325,7 @@ TclInfoFrame(
* Execution of bytecode. Talk to the BC engine to fill out the frame.
*/
CmdFrame *fPtr = TclStackAlloc(interp, sizeof(CmdFrame));
CmdFrame *fPtr = (CmdFrame *)TclStackAlloc(interp, sizeof(CmdFrame));
*fPtr = *framePtr;
@@ -1395,7 +1407,7 @@ TclInfoFrame(
procNameObj);
ADD_PAIR("proc", procNameObj);
} else if (procPtr->cmdPtr->clientData) {
ExtraFrameInfo *efiPtr = procPtr->cmdPtr->clientData;
ExtraFrameInfo *efiPtr = (ExtraFrameInfo *)procPtr->cmdPtr->clientData;
int i;
/*
@@ -1409,7 +1421,7 @@ TclInfoFrame(
lv[lc++] =
efiPtr->fields[i].proc(efiPtr->fields[i].clientData);
} else {
lv[lc++] = efiPtr->fields[i].clientData;
lv[lc++] = (Tcl_Obj *)efiPtr->fields[i].clientData;
}
}
}
@@ -1473,6 +1485,7 @@ InfoFunctionsCmd(
{
Tcl_Obj *script;
int code;
(void)dummy;
if (objc > 2) {
Tcl_WrongNumArgs(interp, 1, objv, "?pattern?");
@@ -1537,6 +1550,7 @@ InfoHostnameCmd(
Tcl_Obj *const objv[]) /* Argument objects. */
{
const char *name;
(void)dummy;
if (objc != 1) {
Tcl_WrongNumArgs(interp, 1, objv, NULL);
@@ -1583,6 +1597,7 @@ InfoLevelCmd(
Tcl_Obj *const objv[]) /* Argument objects. */
{
Interp *iPtr = (Interp *) interp;
(void)dummy;
if (objc == 1) { /* Just "info level" */
Tcl_SetObjResult(interp, Tcl_NewWideIntObj(iPtr->varFramePtr->level));
@@ -1657,6 +1672,7 @@ InfoLibraryCmd(
Tcl_Obj *const objv[]) /* Argument objects. */
{
const char *libDirName;
(void)dummy;
if (objc != 1) {
Tcl_WrongNumArgs(interp, 1, objv, NULL);
@@ -1704,6 +1720,7 @@ InfoLoadedCmd(
Tcl_Obj *const objv[]) /* Argument objects. */
{
const char *interpName, *packageName;
(void)dummy;
if (objc > 3) {
Tcl_WrongNumArgs(interp, 1, objv, "?interp? ?packageName?");
@@ -1751,6 +1768,8 @@ InfoNameOfExecutableCmd(
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
{
(void)dummy;
if (objc != 1) {
Tcl_WrongNumArgs(interp, 1, objv, NULL);
return TCL_ERROR;
@@ -1788,6 +1807,7 @@ InfoPatchLevelCmd(
Tcl_Obj *const objv[]) /* Argument objects. */
{
const char *patchlevel;
(void)dummy;
if (objc != 1) {
Tcl_WrongNumArgs(interp, 1, objv, NULL);
@@ -1846,6 +1866,7 @@ InfoProcsCmd(
Tcl_HashEntry *entryPtr;
Tcl_HashSearch search;
Command *cmdPtr, *realCmdPtr;
(void)dummy;
/*
* Get the pattern and find the "effective namespace" in which to list
@@ -1895,7 +1916,7 @@ InfoProcsCmd(
if (simplePattern != NULL && TclMatchIsTrivial(simplePattern)) {
entryPtr = Tcl_FindHashEntry(&nsPtr->cmdTable, simplePattern);
if (entryPtr != NULL) {
cmdPtr = Tcl_GetHashValue(entryPtr);
cmdPtr = (Command *)Tcl_GetHashValue(entryPtr);
if (!TclIsProc(cmdPtr)) {
realCmdPtr = (Command *)
@@ -1920,10 +1941,10 @@ InfoProcsCmd(
{
entryPtr = Tcl_FirstHashEntry(&nsPtr->cmdTable, &search);
while (entryPtr != NULL) {
cmdName = Tcl_GetHashKey(&nsPtr->cmdTable, entryPtr);
cmdName = (const char *)Tcl_GetHashKey(&nsPtr->cmdTable, entryPtr);
if ((simplePattern == NULL)
|| Tcl_StringMatch(cmdName, simplePattern)) {
cmdPtr = Tcl_GetHashValue(entryPtr);
cmdPtr = (Command *)Tcl_GetHashValue(entryPtr);
if (!TclIsProc(cmdPtr)) {
realCmdPtr = (Command *)
@@ -1966,11 +1987,11 @@ InfoProcsCmd(
if ((nsPtr != globalNsPtr) && !specificNsInPattern) {
entryPtr = Tcl_FirstHashEntry(&globalNsPtr->cmdTable, &search);
while (entryPtr != NULL) {
cmdName = Tcl_GetHashKey(&globalNsPtr->cmdTable, entryPtr);
cmdName = (const char *)Tcl_GetHashKey(&globalNsPtr->cmdTable, entryPtr);
if ((simplePattern == NULL)
|| Tcl_StringMatch(cmdName, simplePattern)) {
if (Tcl_FindHashEntry(&nsPtr->cmdTable,cmdName) == NULL) {
cmdPtr = Tcl_GetHashValue(entryPtr);
cmdPtr = (Command *)Tcl_GetHashValue(entryPtr);
realCmdPtr = (Command *) TclGetOriginalCommand(
(Tcl_Command) cmdPtr);
@@ -2022,6 +2043,8 @@ InfoScriptCmd(
Tcl_Obj *const objv[]) /* Argument objects. */
{
Interp *iPtr = (Interp *) interp;
(void)dummy;
if ((objc != 1) && (objc != 2)) {
Tcl_WrongNumArgs(interp, 1, objv, "?filename?");
return TCL_ERROR;
@@ -2068,6 +2091,8 @@ InfoSharedlibCmd(
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
{
(void)dummy;
if (objc != 1) {
Tcl_WrongNumArgs(interp, 1, objv, NULL);
return TCL_ERROR;
@@ -2107,6 +2132,7 @@ InfoTclVersionCmd(
Tcl_Obj *const objv[]) /* Argument objects. */
{
Tcl_Obj *version;
(void)dummy;
if (objc != 1) {
Tcl_WrongNumArgs(interp, 1, objv, NULL);
@@ -2150,6 +2176,7 @@ InfoCmdTypeCmd(
Tcl_Obj *const objv[]) /* Argument objects. */
{
Tcl_Command command;
(void)dummy;
if (objc != 2) {
Tcl_WrongNumArgs(interp, 1, objv, "commandName");
@@ -2202,6 +2229,7 @@ Tcl_JoinObjCmd(
{
int length, listLen;
Tcl_Obj *resObjPtr = NULL, *joinObjPtr, **elemPtrs;
(void)dummy;
if ((objc < 2) || (objc > 3)) {
Tcl_WrongNumArgs(interp, 1, objv, "list ?joinString?");
@@ -2289,6 +2317,7 @@ Tcl_LassignObjCmd(
Tcl_Obj **listObjv; /* The contents of the list. */
int listObjc; /* The length of the list. */
int code = TCL_OK;
(void)dummy;
if (objc < 2) {
Tcl_WrongNumArgs(interp, 1, objv, "list ?varName ...?");
@@ -2359,8 +2388,8 @@ Tcl_LindexObjCmd(
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
{
Tcl_Obj *elemPtr; /* Pointer to the element being extracted. */
(void)dummy;
if (objc < 2) {
Tcl_WrongNumArgs(interp, 1, objv, "list ?index ...?");
@@ -2420,6 +2449,7 @@ Tcl_LinsertObjCmd(
{
Tcl_Obj *listPtr;
int index, len, result;
(void)dummy;
if (objc < 3) {
Tcl_WrongNumArgs(interp, 1, objv, "list index ?element ...?");
@@ -2501,6 +2531,7 @@ Tcl_ListObjCmd(
Tcl_Obj *const objv[])
/* The argument objects. */
{
(void)dummy;
/*
* If there are no list elements, the result is an empty object.
* Otherwise set the interpreter's result object to be a list object.
@@ -2538,6 +2569,7 @@ Tcl_LlengthObjCmd(
/* Argument objects. */
{
int listLen, result;
(void)dummy;
if (objc != 2) {
Tcl_WrongNumArgs(interp, 1, objv, "list");
@@ -2577,7 +2609,7 @@ Tcl_LlengthObjCmd(
int
Tcl_LpopObjCmd(
ClientData notUsed, /* Not used. */
ClientData dummy, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[])
@@ -2586,6 +2618,7 @@ Tcl_LpopObjCmd(
int listLen, result;
Tcl_Obj *elemPtr, *stored;
Tcl_Obj *listPtr, **elemPtrs;
(void)dummy;
if (objc < 2) {
Tcl_WrongNumArgs(interp, 1, objv, "listvar ?index?");
@@ -2670,13 +2703,14 @@ Tcl_LpopObjCmd(
int
Tcl_LrangeObjCmd(
ClientData notUsed, /* Not used. */
ClientData dummy, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[])
/* Argument objects. */
{
int listLen, first, last, result;
(void)dummy;
if (objc != 4) {
Tcl_WrongNumArgs(interp, 1, objv, "list first last");
@@ -2738,7 +2772,7 @@ LremoveIndexCompare(
int
Tcl_LremoveObjCmd(
ClientData notUsed, /* Not used. */
ClientData dummy, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
@@ -2746,6 +2780,7 @@ Tcl_LremoveObjCmd(
int i, idxc;
int listLen, *idxv, prevIdx, first, num;
Tcl_Obj *listObj;
(void)dummy;
/*
* Parse the arguments.
@@ -2766,7 +2801,7 @@ Tcl_LremoveObjCmd(
Tcl_SetObjResult(interp, listObj);
return TCL_OK;
}
idxv = ckalloc((objc - 2) * sizeof(int));
idxv = (int *)ckalloc((objc - 2) * sizeof(int));
for (i = 2; i < objc; i++) {
if (TclGetIntForIndexM(interp, objv[i], /*endValue*/ listLen - 1,
&idxv[i - 2]) != TCL_OK) {
@@ -2865,6 +2900,7 @@ Tcl_LrepeatObjCmd(
{
int elementCount, i, totalElems;
Tcl_Obj *listPtr, **dataArray = NULL;
(void)dummy;
/*
* Check arguments for legality:
@@ -2973,6 +3009,7 @@ Tcl_LreplaceObjCmd(
{
Tcl_Obj *listPtr;
int first, last, listLen, numToDelete, result;
(void)dummy;
if (objc < 4) {
Tcl_WrongNumArgs(interp, 1, objv,
@@ -3067,13 +3104,14 @@ Tcl_LreplaceObjCmd(
int
Tcl_LreverseObjCmd(
ClientData clientData, /* Not used. */
ClientData dummy, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument values. */
{
Tcl_Obj **elemv;
int elemc, i, j;
(void)dummy;
if (objc != 2) {
Tcl_WrongNumArgs(interp, 1, objv, "list");
@@ -3146,7 +3184,7 @@ Tcl_LreverseObjCmd(
int
Tcl_LsearchObjCmd(
ClientData clientData, /* Not used. */
ClientData dummy, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument values. */
@@ -3183,6 +3221,7 @@ Tcl_LsearchObjCmd(
EXACT, GLOB, REGEXP, SORTED
};
enum modes mode;
(void)dummy;
mode = GLOB;
dataType = ASCII;
@@ -3362,7 +3401,7 @@ Tcl_LsearchObjCmd(
sortInfo.indexv = &sortInfo.singleIndex;
break;
default:
sortInfo.indexv =
sortInfo.indexv = (int *)
TclStackAlloc(interp, sizeof(int) * sortInfo.indexc);
allocatedIndexVector = 1; /* Cannot use indexc field, as it
* might be decreased by 1 later. */
@@ -3898,13 +3937,14 @@ Tcl_LsearchObjCmd(
int
Tcl_LsetObjCmd(
ClientData clientData, /* Not used. */
ClientData dummy, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument values. */
{
Tcl_Obj *listPtr; /* Pointer to the list being altered. */
Tcl_Obj *finalValuePtr; /* Value finally assigned to the variable. */
(void)dummy;
/*
* Check parameter count.
@@ -3983,7 +4023,7 @@ Tcl_LsetObjCmd(
int
Tcl_LsortObjCmd(
ClientData clientData, /* Not used. */
ClientData dummy, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument values. */
@@ -3992,9 +4032,11 @@ Tcl_LsortObjCmd(
int sortMode = SORTMODE_ASCII;
int group, groupSize, groupOffset, idx, allocatedIndexVector = 0;
Tcl_Obj *resultPtr, *cmdPtr, **listObjPtrs, *listObj, *indexPtr;
size_t elmArrSize;
SortElement *elementArray = NULL, *elementPtr;
SortInfo sortInfo; /* Information about this sort that needs to
* be passed to the comparison function. */
# define MAXCALLOC 1024000
# define NUM_LISTS 30
SortElement *subList[NUM_LISTS+1];
/* This array holds pointers to temporary
@@ -4011,6 +4053,7 @@ Tcl_LsortObjCmd(
LSORT_INCREASING, LSORT_INDEX, LSORT_INDICES, LSORT_INTEGER,
LSORT_NOCASE, LSORT_REAL, LSORT_STRIDE, LSORT_UNIQUE
};
(void)dummy;
if (objc < 2) {
Tcl_WrongNumArgs(interp, 1, objv, "?-option value ...? list");
@@ -4179,7 +4222,7 @@ Tcl_LsortObjCmd(
sortInfo.indexv = &sortInfo.singleIndex;
break;
default:
sortInfo.indexv =
sortInfo.indexv = (int *)
TclStackAlloc(interp, sizeof(int) * sortInfo.indexc);
allocatedIndexVector = 1; /* Cannot use indexc field, as it
* might be decreased by 1 later. */
@@ -4317,7 +4360,19 @@ Tcl_LsortObjCmd(
* begins sorting it into the sublists as it appears.
*/
elementArray = ckalloc(length * sizeof(SortElement));
elmArrSize = length * sizeof(SortElement);
if (elmArrSize <= MAXCALLOC) {
elementArray = (SortElement *)ckalloc(elmArrSize);
} else {
elementArray = (SortElement *)malloc(elmArrSize);
}
if (!elementArray) {
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"no enough memory to proccess sort of %d items", length));
Tcl_SetErrorCode(interp, "TCL", "MEMORY", NULL);
sortInfo.resultCode = TCL_ERROR;
goto done;
}
for (i=0; i < length; i++) {
idx = groupSize * i + groupOffset;
@@ -4450,7 +4505,11 @@ Tcl_LsortObjCmd(
TclStackFree(interp, sortInfo.indexv);
}
if (elementArray) {
ckfree(elementArray);
if (elmArrSize <= MAXCALLOC) {
ckfree((char *)elementArray);
} else {
free((char *)elementArray);
}
}
return sortInfo.resultCode;
}
+65 -25
View File
@@ -88,6 +88,7 @@ Tcl_PwdObjCmd(
Tcl_Obj *const objv[]) /* Argument objects. */
{
Tcl_Obj *retVal;
(void)dummy;
if (objc != 1) {
Tcl_WrongNumArgs(interp, 1, objv, NULL);
@@ -142,6 +143,7 @@ Tcl_RegexpObjCmd(
REGEXP_EXPANDED,REGEXP_LINE, REGEXP_LINESTOP,REGEXP_LINEANCHOR,
REGEXP_NOCASE, REGEXP_START, REGEXP_LAST
};
(void)dummy;
indices = 0;
about = 0;
@@ -504,6 +506,7 @@ Tcl_RegsubObjCmd(
REGSUB_LINESTOP, REGSUB_LINEANCHOR, REGSUB_NOCASE, REGSUB_START,
REGSUB_LAST
};
(void)dummy;
cflags = TCL_REG_ADVANCED;
all = 0;
@@ -778,7 +781,7 @@ Tcl_RegsubObjCmd(
Tcl_ListObjGetElements(interp, subPtr, &numParts, &parts);
numArgs = numParts + info.nsubs + 1;
args = ckalloc(sizeof(Tcl_Obj*) * numArgs);
args = (Tcl_Obj **)ckalloc(sizeof(Tcl_Obj*) * numArgs);
memcpy(args, parts, sizeof(Tcl_Obj*) * numParts);
for (idx = 0 ; idx <= info.nsubs ; idx++) {
@@ -1002,12 +1005,13 @@ Tcl_RegsubObjCmd(
int
Tcl_RenameObjCmd(
ClientData dummy, /* Arbitrary value passed to the command. */
ClientData dummy, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
{
const char *oldName, *newName;
(void)dummy;
if (objc != 3) {
Tcl_WrongNumArgs(interp, 1, objv, "oldName newName");
@@ -1053,6 +1057,7 @@ Tcl_ReturnObjCmd(
int explicitResult = (0 == (objc % 2));
int numOptionWords = objc - 1 - explicitResult;
(void)dummy;
if (TCL_ERROR == TclMergeReturnOptions(interp, numOptionWords, objv+1,
&returnOpts, &code, &level)) {
@@ -1105,6 +1110,7 @@ TclNRSourceObjCmd(
int result;
void **pkgFiles = NULL;
void *names = NULL;
(void)dummy;
if (objc < 2 || objc > 4) {
Tcl_WrongNumArgs(interp, 1, objv, "?-encoding name? fileName");
@@ -1136,7 +1142,7 @@ TclNRSourceObjCmd(
"option", TCL_EXACT, &index)) {
return TCL_ERROR;
}
pkgFiles = Tcl_GetAssocData(interp, "tclPkgFiles", NULL);
pkgFiles = (void **)Tcl_GetAssocData(interp, "tclPkgFiles", NULL);
/* Make sure that during the following TclNREvalFile no filenames
* are recorded for inclusion in the "package files" command */
names = *pkgFiles;
@@ -1181,6 +1187,7 @@ Tcl_SplitObjCmd(
const char *end;
int splitCharLen, stringLen;
Tcl_Obj *listPtr, *objPtr;
(void)dummy;
if (objc == 2) {
splitChars = " \n\t\r";
@@ -1221,7 +1228,7 @@ Tcl_SplitObjCmd(
len = TclUtfToUniChar(stringPtr, &ch);
fullchar = ch;
#if TCL_UTF_MAX <= 4
#if TCL_UTF_MAX <= 3
if ((ch >= 0xD800) && (len < 3)) {
len += TclUtfToUniChar(stringPtr + len, &ch);
fullchar = (((fullchar & 0x3ff) << 10) | (ch & 0x3ff)) + 0x10000;
@@ -1243,14 +1250,14 @@ Tcl_SplitObjCmd(
Tcl_SetHashValue(hPtr, objPtr);
} else {
objPtr = Tcl_GetHashValue(hPtr);
objPtr = (Tcl_Obj *)Tcl_GetHashValue(hPtr);
}
Tcl_ListObjAppendElement(NULL, listPtr, objPtr);
}
Tcl_DeleteHashTable(&charReuseTable);
} else if (splitCharLen == 1) {
char *p;
const char *p;
/*
* Handle the special case of splitting on a single character. This is
@@ -1323,6 +1330,7 @@ StringFirstCmd(
Tcl_Obj *const objv[]) /* Argument objects. */
{
int start = 0;
(void)dummy;
if (objc < 3 || objc > 4) {
Tcl_WrongNumArgs(interp, 1, objv,
@@ -1368,6 +1376,7 @@ StringLastCmd(
Tcl_Obj *const objv[]) /* Argument objects. */
{
int last = INT_MAX - 1;
(void)dummy;
if (objc < 3 || objc > 4) {
Tcl_WrongNumArgs(interp, 1, objv,
@@ -1413,6 +1422,7 @@ StringIndexCmd(
Tcl_Obj *const objv[]) /* Argument objects. */
{
int length, index;
(void)dummy;
if (objc != 3) {
Tcl_WrongNumArgs(interp, 1, objv, "string charIndex");
@@ -1485,6 +1495,7 @@ StringInsertCmd(
int length; /* String length */
int index; /* Insert index */
Tcl_Obj *outObj; /* Output object */
(void)dummy;
if (objc != 4) {
Tcl_WrongNumArgs(interp, 1, objv, "string index insertString");
@@ -1568,6 +1579,7 @@ StringIsCmd(
enum isOptions {
OPT_STRICT, OPT_FAILIDX
};
(void)dummy;
if (objc < 3 || objc > 6) {
Tcl_WrongNumArgs(interp, 1, objv,
@@ -1911,7 +1923,7 @@ StringIsCmd(
int fullchar;
length2 = TclUtfToUniChar(string1, &ch);
fullchar = ch;
#if TCL_UTF_MAX <= 4
#if TCL_UTF_MAX <= 3
if ((ch >= 0xD800) && (length2 < 3)) {
length2 += TclUtfToUniChar(string1 + length2, &ch);
fullchar = (((fullchar & 0x3ff) << 10) | (ch & 0x3ff)) + 0x10000;
@@ -1983,6 +1995,7 @@ StringMapCmd(
Tcl_Obj **mapElemv, *sourceObj, *resultPtr;
Tcl_UniChar *ustring1, *ustring2, *p, *end;
int (*strCmpFn)(const Tcl_UniChar*, const Tcl_UniChar*, unsigned long);
(void)dummy;
if (objc < 3 || objc > 4) {
Tcl_WrongNumArgs(interp, 1, objv, "?-nocase? charMap string");
@@ -2037,7 +2050,7 @@ StringMapCmd(
* adapt this code...
*/
mapElemv = TclStackAlloc(interp, sizeof(Tcl_Obj *) * mapElemc);
mapElemv = (Tcl_Obj **)TclStackAlloc(interp, sizeof(Tcl_Obj *) * mapElemc);
Tcl_DictObjFirst(interp, objv[objc-2], &search, mapElemv+0,
mapElemv+1, &done);
for (i=2 ; i<mapElemc ; i+=2) {
@@ -2148,10 +2161,10 @@ StringMapCmd(
* case.
*/
mapStrings = TclStackAlloc(interp, mapElemc*2*sizeof(Tcl_UniChar *));
mapLens = TclStackAlloc(interp, mapElemc * 2 * sizeof(int));
mapStrings = (Tcl_UniChar **)TclStackAlloc(interp, mapElemc*2*sizeof(Tcl_UniChar *));
mapLens = (int *)TclStackAlloc(interp, mapElemc * 2 * sizeof(int));
if (nocase) {
u2lc = TclStackAlloc(interp, mapElemc * sizeof(int));
u2lc = (int *)TclStackAlloc(interp, mapElemc * sizeof(int));
}
for (index = 0; index < mapElemc; index++) {
mapStrings[index] = Tcl_GetUnicodeFromObj(mapElemv[index],
@@ -2250,6 +2263,7 @@ StringMatchCmd(
Tcl_Obj *const objv[]) /* Argument objects. */
{
int nocase = 0;
(void)dummy;
if (objc < 3 || objc > 4) {
Tcl_WrongNumArgs(interp, 1, objv, "?-nocase? pattern string");
@@ -2302,6 +2316,7 @@ StringRangeCmd(
Tcl_Obj *const objv[]) /* Argument objects. */
{
int length, first, last;
(void)dummy;
if (objc != 4) {
Tcl_WrongNumArgs(interp, 1, objv, "string first last");
@@ -2359,6 +2374,7 @@ StringReptCmd(
{
int count;
Tcl_Obj *resultPtr;
(void)dummy;
if (objc != 3) {
Tcl_WrongNumArgs(interp, 1, objv, "string count");
@@ -2414,6 +2430,7 @@ StringRplcCmd(
Tcl_Obj *const objv[]) /* Argument objects. */
{
int first, last, length, end;
(void)dummy;
if (objc < 4 || objc > 5) {
Tcl_WrongNumArgs(interp, 1, objv, "string first last ?string?");
@@ -2489,6 +2506,8 @@ StringRevCmd(
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
{
(void)dummy;
if (objc != 2) {
Tcl_WrongNumArgs(interp, 1, objv, "string");
return TCL_ERROR;
@@ -2527,6 +2546,7 @@ StringStartCmd(
Tcl_UniChar ch = 0;
const char *p, *string;
int cur, index, length, numChars;
(void)dummy;
if (objc != 3) {
Tcl_WrongNumArgs(interp, 1, objv, "string index");
@@ -2588,6 +2608,7 @@ StringEndCmd(
Tcl_UniChar ch = 0;
const char *p, *end, *string;
int cur, index, length, numChars;
(void)dummy;
if (objc != 3) {
Tcl_WrongNumArgs(interp, 1, objv, "string index");
@@ -2655,6 +2676,7 @@ StringEqualCmd(
const char *string2;
int length, i, match, nocase = 0, reqlength = -1;
(void)dummy;
if (objc < 3 || objc > 6) {
str_cmp_args:
@@ -2729,6 +2751,7 @@ StringCmpCmd(
*/
int match, nocase, reqlength, status;
(void)dummy;
status = TclStringCmpOpts(interp, objc, objv, &nocase, &reqlength);
if (status != TCL_OK) {
@@ -2811,6 +2834,7 @@ StringCatCmd(
Tcl_Obj *const objv[]) /* Argument objects. */
{
Tcl_Obj *objResultPtr;
(void)dummy;
if (objc < 2) {
/*
@@ -2856,6 +2880,7 @@ StringBytesCmd(
Tcl_Obj *const objv[]) /* Argument objects. */
{
int length;
(void)dummy;
if (objc != 2) {
Tcl_WrongNumArgs(interp, 1, objv, "string");
@@ -2892,6 +2917,8 @@ StringLenCmd(
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
{
(void)dummy;
if (objc != 2) {
Tcl_WrongNumArgs(interp, 1, objv, "string");
return TCL_ERROR;
@@ -2929,6 +2956,7 @@ StringLowerCmd(
int length1, length2;
const char *string1;
char *string2;
(void)dummy;
if (objc < 2 || objc > 4) {
Tcl_WrongNumArgs(interp, 1, objv, "string ?first? ?last?");
@@ -3014,6 +3042,7 @@ StringUpperCmd(
int length1, length2;
const char *string1;
char *string2;
(void)dummy;
if (objc < 2 || objc > 4) {
Tcl_WrongNumArgs(interp, 1, objv, "string ?first? ?last?");
@@ -3099,6 +3128,7 @@ StringTitleCmd(
int length1, length2;
const char *string1;
char *string2;
(void)dummy;
if (objc < 2 || objc > 4) {
Tcl_WrongNumArgs(interp, 1, objv, "string ?first? ?last?");
@@ -3183,6 +3213,7 @@ StringTrimCmd(
{
const char *string1, *string2;
int triml, trimr, length1, length2;
(void)dummy;
if (objc == 3) {
string2 = TclGetStringFromObj(objv[2], &length2);
@@ -3230,6 +3261,7 @@ StringTrimLCmd(
{
const char *string1, *string2;
int trim, length1, length2;
(void)dummy;
if (objc == 3) {
string2 = TclGetStringFromObj(objv[2], &length2);
@@ -3276,6 +3308,7 @@ StringTrimRCmd(
{
const char *string1, *string2;
int trim, length1, length2;
(void)dummy;
if (objc == 3) {
string2 = TclGetStringFromObj(objv[2], &length2);
@@ -3428,6 +3461,7 @@ TclNRSubstObjCmd(
Tcl_Obj *const objv[]) /* Argument objects. */
{
int flags;
(void)dummy;
if (objc < 2) {
Tcl_WrongNumArgs(interp, 1, objv,
@@ -3502,6 +3536,7 @@ TclNRSwitchObjCmd(
};
typedef int (*strCmpFn_t)(const char *, const char *);
strCmpFn_t strCmpFn = TclUtfCmp;
(void)dummy;
mode = OPT_EXACT;
foundmode = 0;
@@ -3852,7 +3887,7 @@ TclNRSwitchObjCmd(
*/
matchFound:
ctxPtr = TclStackAlloc(interp, sizeof(CmdFrame));
ctxPtr = (CmdFrame *)TclStackAlloc(interp, sizeof(CmdFrame));
*ctxPtr = *iPtr->cmdFramePtr;
if (splitObjs) {
@@ -3882,7 +3917,7 @@ TclNRSwitchObjCmd(
if (ctxPtr->type == TCL_LOCATION_SOURCE && ctxPtr->line[bidx] >= 0) {
int bline = ctxPtr->line[bidx];
ctxPtr->line = ckalloc(objc * sizeof(int));
ctxPtr->line = (int *)ckalloc(objc * sizeof(int));
ctxPtr->nline = objc;
TclListLines(blist, bline, objc, ctxPtr->line, objv);
} else {
@@ -3896,7 +3931,7 @@ TclNRSwitchObjCmd(
int k;
ctxPtr->line = ckalloc(objc * sizeof(int));
ctxPtr->line = (int *)ckalloc(objc * sizeof(int));
ctxPtr->nline = objc;
for (k=0; k < objc; k++) {
ctxPtr->line[k] = -1;
@@ -3936,9 +3971,9 @@ SwitchPostProc(
/* Unpack the preserved data */
int splitObjs = PTR2INT(data[0]);
CmdFrame *ctxPtr = data[1];
CmdFrame *ctxPtr = (CmdFrame *)data[1];
int pc = PTR2INT(data[2]);
const char *pattern = data[3];
const char *pattern = (const char *)data[3];
int patternLength = strlen(pattern);
/*
@@ -4000,6 +4035,7 @@ Tcl_ThrowObjCmd(
{
Tcl_Obj *options;
int len;
(void)dummy;
if (objc != 3) {
Tcl_WrongNumArgs(interp, 1, objv, "type message");
@@ -4070,6 +4106,7 @@ Tcl_TimeObjCmd(
#else
Tcl_WideInt start, stop;
#endif
(void)dummy;
if (objc == 2) {
count = 1;
@@ -4188,6 +4225,7 @@ Tcl_TimeRateObjCmd(
};
NRE_callback *rootPtr;
ByteCode *codePtr = NULL;
(void)dummy;
for (i = 1; i < objc - 1; i++) {
int index;
@@ -4719,6 +4757,7 @@ TclNRTryObjCmd(
enum Handlers {
TryFinally, TryOn, TryTrap
};
(void)clientData;
/*
* Parse the arguments. The handlers are passed to subsequent callbacks as
@@ -4912,9 +4951,9 @@ TryPostBody(
int i, dummy, code, objc;
int numHandlers = 0;
handlersObj = data[0];
finallyObj = data[1];
objv = data[2];
handlersObj = (Tcl_Obj *)data[0];
finallyObj = (Tcl_Obj *)data[1];
objv = (Tcl_Obj **)data[2];
objc = PTR2INT(data[3]);
cmdObj = objv[0];
@@ -5127,9 +5166,9 @@ TryPostHandler(
Tcl_Obj *finallyObj;
int finally;
objv = data[0];
options = data[1];
handlerKindObj = data[2];
objv = (Tcl_Obj **)data[0];
options = (Tcl_Obj *)data[1];
handlerKindObj = (Tcl_Obj *)data[2];
finally = PTR2INT(data[3]);
cmdObj = objv[0];
@@ -5211,9 +5250,9 @@ TryPostFinal(
{
Tcl_Obj *resultObj, *options, *cmdObj;
resultObj = data[0];
options = data[1];
cmdObj = data[2];
resultObj = (Tcl_Obj *)data[0];
options = (Tcl_Obj *)data[1];
cmdObj = (Tcl_Obj *)data[2];
/*
* If the result wasn't OK, we need to adjust the result options.
@@ -5288,6 +5327,7 @@ TclNRWhileObjCmd(
Tcl_Obj *const objv[]) /* Argument objects. */
{
ForIterData *iterPtr;
(void)dummy;
if (objc != 3) {
Tcl_WrongNumArgs(interp, 1, objv, "test command");
+58 -26
View File
@@ -267,6 +267,7 @@ TclCompileArrayExistsCmd(
DefineLineInformation; /* TIP #280 */
Tcl_Token *tokenPtr;
int isScalar, localIndex;
(void)cmdPtr;
if (parsePtr->numWords != 2) {
return TCL_ERROR;
@@ -403,9 +404,9 @@ TclCompileArraySetCmd(
keyVar = AnonymousLocal(envPtr);
valVar = AnonymousLocal(envPtr);
infoPtr = ckalloc(sizeof(ForeachInfo));
infoPtr = (ForeachInfo *)ckalloc(sizeof(ForeachInfo));
infoPtr->numLists = 1;
infoPtr->varLists[0] = ckalloc(sizeof(ForeachVarList) + sizeof(int));
infoPtr->varLists[0] = (ForeachVarList *)ckalloc(sizeof(ForeachVarList) + sizeof(int));
infoPtr->varLists[0]->numVars = 2;
infoPtr->varLists[0]->varIndexes[0] = keyVar;
infoPtr->varLists[0]->varIndexes[1] = valVar;
@@ -522,7 +523,7 @@ TclCompileArrayUnsetCmd(
int
TclCompileBreakCmd(
Tcl_Interp *interp, /* Used for error reporting. */
Tcl_Interp *dummy, /* Used for error reporting. */
Tcl_Parse *parsePtr, /* Points to a parse structure for the command
* created by Tcl_ParseCommand. */
Command *cmdPtr, /* Points to defintion of command being
@@ -531,6 +532,8 @@ TclCompileBreakCmd(
{
ExceptionRange *rangePtr;
ExceptionAux *auxPtr;
(void)dummy;
(void)cmdPtr;
if (parsePtr->numWords != 1) {
return TCL_ERROR;
@@ -592,6 +595,7 @@ TclCompileCatchCmd(
int resultIndex, optsIndex, range, dropScript = 0;
DefineLineInformation; /* TIP #280 */
int depth = TclGetStackDepth(envPtr);
(void)cmdPtr;
/*
* If syntax does not match what we expect for [catch], do not compile.
@@ -765,7 +769,7 @@ TclCompileCatchCmd(
int
TclCompileClockClicksCmd(
Tcl_Interp* interp, /* Tcl interpreter */
Tcl_Interp* dummy, /* Tcl interpreter */
Tcl_Parse *parsePtr, /* Points to a parse structure for the command
* created by Tcl_ParseCommand. */
Command *cmdPtr, /* Points to defintion of command being
@@ -773,6 +777,8 @@ TclCompileClockClicksCmd(
CompileEnv *envPtr) /* Holds resulting instructions. */
{
Tcl_Token* tokenPtr;
(void)dummy;
(void)cmdPtr;
switch (parsePtr->numWords) {
case 1:
@@ -829,13 +835,15 @@ TclCompileClockClicksCmd(
int
TclCompileClockReadingCmd(
Tcl_Interp* interp, /* Tcl interpreter */
Tcl_Interp* dummy, /* Tcl interpreter */
Tcl_Parse *parsePtr, /* Points to a parse structure for the command
* created by Tcl_ParseCommand. */
Command *cmdPtr, /* Points to defintion of command being
* compiled. */
CompileEnv *envPtr) /* Holds resulting instructions. */
{
(void)dummy;
if (parsePtr->numWords != 1) {
return TCL_ERROR;
}
@@ -876,6 +884,7 @@ TclCompileConcatCmd(
Tcl_Obj *objPtr, *listObj;
Tcl_Token *tokenPtr;
int i;
(void)cmdPtr;
/* TODO: Consider compiling expansion case. */
if (parsePtr->numWords == 1) {
@@ -952,7 +961,7 @@ TclCompileConcatCmd(
int
TclCompileContinueCmd(
Tcl_Interp *interp, /* Used for error reporting. */
Tcl_Interp *dummy, /* Used for error reporting. */
Tcl_Parse *parsePtr, /* Points to a parse structure for the command
* created by Tcl_ParseCommand. */
Command *cmdPtr, /* Points to defintion of command being
@@ -961,6 +970,8 @@ TclCompileContinueCmd(
{
ExceptionRange *rangePtr;
ExceptionAux *auxPtr;
(void)dummy;
(void)cmdPtr;
/*
* There should be no argument after the "continue".
@@ -1026,6 +1037,7 @@ TclCompileDictSetCmd(
int i, dictVarIndex;
DefineLineInformation; /* TIP #280 */
Tcl_Token *varTokenPtr;
(void)cmdPtr;
/*
* There must be at least one argument after the command.
@@ -1151,6 +1163,7 @@ TclCompileDictGetCmd(
Tcl_Token *tokenPtr;
int i;
DefineLineInformation; /* TIP #280 */
(void)cmdPtr;
/*
* There must be at least two arguments after the command (the single-arg
@@ -1188,6 +1201,7 @@ TclCompileDictGetWithDefaultCmd(
Tcl_Token *tokenPtr;
int i;
DefineLineInformation; /* TIP #280 */
(void)cmdPtr;
/*
* There must be at least three arguments after the command.
@@ -1220,6 +1234,7 @@ TclCompileDictExistsCmd(
Tcl_Token *tokenPtr;
int i;
DefineLineInformation; /* TIP #280 */
(void)cmdPtr;
/*
* There must be at least two arguments after the command (the single-arg
@@ -1811,9 +1826,9 @@ TclCompileDictUpdateCmd(
* that are to be used.
*/
duiPtr = ckalloc(sizeof(DictUpdateInfo) + sizeof(int) * (numVars - 1));
duiPtr = (DictUpdateInfo *)ckalloc(sizeof(DictUpdateInfo) + sizeof(int) * (numVars - 1));
duiPtr->length = numVars;
keyTokenPtrs = TclStackAlloc(interp, sizeof(Tcl_Token *) * numVars);
keyTokenPtrs = (Tcl_Token **)TclStackAlloc(interp, sizeof(Tcl_Token *) * numVars);
tokenPtr = TokenAfter(dictVarTokenPtr);
for (i=0 ; i<numVars ; i++) {
@@ -2290,11 +2305,11 @@ DupDictUpdateInfo(
ClientData clientData)
{
DictUpdateInfo *dui1Ptr, *dui2Ptr;
unsigned len;
size_t len;
dui1Ptr = clientData;
dui1Ptr = (DictUpdateInfo *)clientData;
len = sizeof(DictUpdateInfo) + sizeof(int) * (dui1Ptr->length - 1);
dui2Ptr = ckalloc(len);
dui2Ptr = (DictUpdateInfo *)ckalloc(len);
memcpy(dui2Ptr, dui1Ptr, len);
return dui2Ptr;
}
@@ -2313,8 +2328,10 @@ PrintDictUpdateInfo(
ByteCode *codePtr,
unsigned int pcOffset)
{
DictUpdateInfo *duiPtr = clientData;
DictUpdateInfo *duiPtr = (DictUpdateInfo *)clientData;
int i;
(void)codePtr;
(void)pcOffset;
for (i=0 ; i<duiPtr->length ; i++) {
if (i) {
@@ -2331,9 +2348,11 @@ DisassembleDictUpdateInfo(
ByteCode *codePtr,
unsigned int pcOffset)
{
DictUpdateInfo *duiPtr = clientData;
DictUpdateInfo *duiPtr = (DictUpdateInfo *)clientData;
int i;
Tcl_Obj *variables = Tcl_NewObj();
(void)codePtr;
(void)pcOffset;
for (i=0 ; i<duiPtr->length ; i++) {
Tcl_ListObjAppendElement(NULL, variables,
@@ -2376,6 +2395,7 @@ TclCompileErrorCmd(
Tcl_Token *tokenPtr;
DefineLineInformation; /* TIP #280 */
(void)cmdPtr;
if (parsePtr->numWords < 2 || parsePtr->numWords > 4) {
return TCL_ERROR;
@@ -2445,6 +2465,7 @@ TclCompileExprCmd(
CompileEnv *envPtr) /* Holds resulting instructions. */
{
Tcl_Token *firstWordPtr;
(void)cmdPtr;
if (parsePtr->numWords == 1) {
return TCL_ERROR;
@@ -2494,6 +2515,7 @@ TclCompileForCmd(
int bodyCodeOffset, nextCodeOffset, jumpDist;
int bodyRange, nextRange;
DefineLineInformation; /* TIP #280 */
(void)cmdPtr;
if (parsePtr->numWords != 5) {
return TCL_ERROR;
@@ -2712,6 +2734,7 @@ CompileEachloopCmd(
int numWords, numLists, i, j, code = TCL_OK;
Tcl_Obj *varListObj = NULL;
DefineLineInformation; /* TIP #280 */
(void)cmdPtr;
/*
* If the foreach command isn't in a procedure, don't compile it inline:
@@ -2747,7 +2770,7 @@ CompileEachloopCmd(
*/
numLists = (numWords - 2)/2;
infoPtr = ckalloc(sizeof(ForeachInfo)
infoPtr = (ForeachInfo *)ckalloc(sizeof(ForeachInfo)
+ (numLists - 1) * sizeof(ForeachVarList *));
infoPtr->numLists = 0; /* Count this up as we go */
@@ -2781,7 +2804,7 @@ CompileEachloopCmd(
goto done;
}
varListPtr = ckalloc(sizeof(ForeachVarList)
varListPtr = (ForeachVarList *)ckalloc(sizeof(ForeachVarList)
+ (numVars - 1) * sizeof(int));
varListPtr->numVars = numVars;
infoPtr->varLists[i/2] = varListPtr;
@@ -2912,12 +2935,12 @@ DupForeachInfo(
ClientData clientData) /* The foreach command's compilation auxiliary
* data to duplicate. */
{
ForeachInfo *srcPtr = clientData;
ForeachInfo *srcPtr = (ForeachInfo *)clientData;
ForeachInfo *dupPtr;
ForeachVarList *srcListPtr, *dupListPtr;
int numVars, i, j, numLists = srcPtr->numLists;
dupPtr = ckalloc(sizeof(ForeachInfo)
dupPtr = (ForeachInfo *)ckalloc(sizeof(ForeachInfo)
+ numLists * sizeof(ForeachVarList *));
dupPtr->numLists = numLists;
dupPtr->firstValueTemp = srcPtr->firstValueTemp;
@@ -2926,7 +2949,7 @@ DupForeachInfo(
for (i = 0; i < numLists; i++) {
srcListPtr = srcPtr->varLists[i];
numVars = srcListPtr->numVars;
dupListPtr = ckalloc(sizeof(ForeachVarList)
dupListPtr = (ForeachVarList *)ckalloc(sizeof(ForeachVarList)
+ numVars * sizeof(int));
dupListPtr->numVars = numVars;
for (j = 0; j < numVars; j++) {
@@ -2961,7 +2984,7 @@ FreeForeachInfo(
ClientData clientData) /* The foreach command's compilation auxiliary
* data to free. */
{
ForeachInfo *infoPtr = clientData;
ForeachInfo *infoPtr = (ForeachInfo *)clientData;
ForeachVarList *listPtr;
int numLists = infoPtr->numLists;
int i;
@@ -2997,9 +3020,11 @@ PrintForeachInfo(
ByteCode *codePtr,
unsigned int pcOffset)
{
ForeachInfo *infoPtr = clientData;
ForeachInfo *infoPtr = (ForeachInfo *)clientData;
ForeachVarList *varsPtr;
int i, j;
(void)codePtr;
(void)pcOffset;
Tcl_AppendToObj(appendObj, "data=[", -1);
@@ -3037,9 +3062,11 @@ PrintNewForeachInfo(
ByteCode *codePtr,
unsigned int pcOffset)
{
ForeachInfo *infoPtr = clientData;
ForeachInfo *infoPtr = (ForeachInfo *)clientData;
ForeachVarList *varsPtr;
int i, j;
(void)codePtr;
(void)pcOffset;
Tcl_AppendPrintfToObj(appendObj, "jumpOffset=%+d, vars=",
infoPtr->loopCtTemp);
@@ -3067,10 +3094,12 @@ DisassembleForeachInfo(
ByteCode *codePtr,
unsigned int pcOffset)
{
ForeachInfo *infoPtr = clientData;
ForeachInfo *infoPtr = (ForeachInfo *)clientData;
ForeachVarList *varsPtr;
int i, j;
Tcl_Obj *objPtr, *innerPtr;
(void)codePtr;
(void)pcOffset;
/*
* Data stores.
@@ -3114,10 +3143,12 @@ DisassembleNewForeachInfo(
ByteCode *codePtr,
unsigned int pcOffset)
{
ForeachInfo *infoPtr = clientData;
ForeachInfo *infoPtr = (ForeachInfo *)clientData;
ForeachVarList *varsPtr;
int i, j;
Tcl_Obj *objPtr, *innerPtr;
(void)codePtr;
(void)pcOffset;
/*
* Jump offset.
@@ -3176,6 +3207,7 @@ TclCompileFormatCmd(
Tcl_Obj **objv, *formatObj, *tmpObj;
const char *bytes, *start;
int i, j, len;
(void)cmdPtr;
/*
* Don't handle any guaranteed-error cases.
@@ -3198,7 +3230,7 @@ TclCompileFormatCmd(
return TCL_ERROR;
}
objv = ckalloc((parsePtr->numWords-2) * sizeof(Tcl_Obj *));
objv = (Tcl_Obj **)ckalloc((parsePtr->numWords-2) * sizeof(Tcl_Obj *));
for (i=0 ; i+2 < parsePtr->numWords ; i++) {
tokenPtr = TokenAfter(tokenPtr);
objv[i] = Tcl_NewObj();
@@ -3492,7 +3524,7 @@ TclPushVarName(
* assemble the corresponding token.
*/
elemTokenPtr = TclStackAlloc(interp, sizeof(Tcl_Token));
elemTokenPtr = (Tcl_Token *)TclStackAlloc(interp, sizeof(Tcl_Token));
allocedTokens = 1;
elemTokenPtr->type = TCL_TOKEN_TEXT;
elemTokenPtr->start = elName;
@@ -3547,7 +3579,7 @@ TclPushVarName(
* token.
*/
elemTokenPtr = TclStackAlloc(interp, n * sizeof(Tcl_Token));
elemTokenPtr = (Tcl_Token *)TclStackAlloc(interp, n * sizeof(Tcl_Token));
allocedTokens = 1;
elemTokenPtr->type = TCL_TOKEN_TEXT;
elemTokenPtr->start = elName;
+42 -5
View File
@@ -93,6 +93,7 @@ TclCompileGlobalCmd(
Tcl_Token *varTokenPtr;
int localIndex, numWords, i;
DefineLineInformation; /* TIP #280 */
(void)cmdPtr;
/* TODO: Consider support for compiling expanded args. */
numWords = parsePtr->numWords;
@@ -188,6 +189,7 @@ TclCompileIfCmd(
int boolVal; /* Value of static condition. */
int compileScripts = 1;
DefineLineInformation; /* TIP #280 */
(void)cmdPtr;
/*
* Only compile the "if" command if all arguments are simple words, in
@@ -478,6 +480,7 @@ TclCompileIncrCmd(
Tcl_Token *varTokenPtr, *incrTokenPtr;
int isScalar, localIndex, haveImmValue, immValue;
DefineLineInformation; /* TIP #280 */
(void)cmdPtr;
if ((parsePtr->numWords != 2) && (parsePtr->numWords != 3)) {
return TCL_ERROR;
@@ -640,13 +643,15 @@ TclCompileInfoCommandsCmd(
int
TclCompileInfoCoroutineCmd(
Tcl_Interp *interp, /* Used for error reporting. */
Tcl_Interp *dummy, /* Used for error reporting. */
Tcl_Parse *parsePtr, /* Points to a parse structure for the command
* created by Tcl_ParseCommand. */
Command *cmdPtr, /* Points to defintion of command being
* compiled. */
CompileEnv *envPtr) /* Holds resulting instructions. */
{
(void)dummy;
(void)cmdPtr;
/*
* Only compile [info coroutine] without arguments.
*/
@@ -675,6 +680,7 @@ TclCompileInfoExistsCmd(
Tcl_Token *tokenPtr;
int isScalar, localIndex;
DefineLineInformation; /* TIP #280 */
(void)cmdPtr;
if (parsePtr->numWords != 2) {
return TCL_ERROR;
@@ -721,6 +727,7 @@ TclCompileInfoLevelCmd(
* compiled. */
CompileEnv *envPtr) /* Holds resulting instructions. */
{
(void)cmdPtr;
/*
* Only compile [info level] without arguments or with a single argument.
*/
@@ -758,6 +765,7 @@ TclCompileInfoObjectClassCmd(
{
DefineLineInformation; /* TIP #280 */
Tcl_Token *tokenPtr = TokenAfter(parsePtr->tokenPtr);
(void)cmdPtr;
if (parsePtr->numWords != 2) {
return TCL_ERROR;
@@ -778,6 +786,7 @@ TclCompileInfoObjectIsACmd(
{
DefineLineInformation; /* TIP #280 */
Tcl_Token *tokenPtr = TokenAfter(parsePtr->tokenPtr);
(void)cmdPtr;
/*
* We only handle [info object isa object <somevalue>]. The first three
@@ -814,6 +823,7 @@ TclCompileInfoObjectNamespaceCmd(
{
DefineLineInformation; /* TIP #280 */
Tcl_Token *tokenPtr = TokenAfter(parsePtr->tokenPtr);
(void)cmdPtr;
if (parsePtr->numWords != 2) {
return TCL_ERROR;
@@ -853,6 +863,7 @@ TclCompileLappendCmd(
Tcl_Token *varTokenPtr, *valueTokenPtr;
int isScalar, localIndex, numWords, i;
DefineLineInformation; /* TIP #280 */
(void)cmdPtr;
/* TODO: Consider support for compiling expanded args. */
numWords = parsePtr->numWords;
@@ -969,6 +980,7 @@ TclCompileLassignCmd(
Tcl_Token *tokenPtr;
int isScalar, localIndex, numWords, idx;
DefineLineInformation; /* TIP #280 */
(void)cmdPtr;
numWords = parsePtr->numWords;
@@ -1073,6 +1085,7 @@ TclCompileLindexCmd(
Tcl_Token *idxTokenPtr, *valTokenPtr;
int i, idx, numWords = parsePtr->numWords;
DefineLineInformation; /* TIP #280 */
(void)cmdPtr;
/*
* Quit if too few args.
@@ -1165,6 +1178,7 @@ TclCompileListCmd(
Tcl_Token *valueTokenPtr;
int i, numWords, concat, build;
Tcl_Obj *listObj, *objPtr;
(void)cmdPtr;
if (parsePtr->numWords == 1) {
/*
@@ -1277,6 +1291,7 @@ TclCompileLlengthCmd(
{
Tcl_Token *varTokenPtr;
DefineLineInformation; /* TIP #280 */
(void)cmdPtr;
if (parsePtr->numWords != 2) {
return TCL_ERROR;
@@ -1311,6 +1326,7 @@ TclCompileLrangeCmd(
Tcl_Token *tokenPtr, *listTokenPtr;
DefineLineInformation; /* TIP #280 */
int idx1, idx2;
(void)cmdPtr;
if (parsePtr->numWords != 4) {
return TCL_ERROR;
@@ -1372,6 +1388,7 @@ TclCompileLinsertCmd(
Tcl_Token *tokenPtr, *listTokenPtr;
DefineLineInformation; /* TIP #280 */
int idx, i;
(void)cmdPtr;
if (parsePtr->numWords < 3) {
return TCL_ERROR;
@@ -1476,6 +1493,7 @@ TclCompileLreplaceCmd(
DefineLineInformation; /* TIP #280 */
int idx1, idx2, i;
int emptyPrefix=1, suffixStart = 0;
(void)cmdPtr;
if (parsePtr->numWords < 4) {
return TCL_ERROR;
@@ -1644,6 +1662,7 @@ TclCompileLsetCmd(
int isScalar; /* Flag == 1 if scalar, 0 if array. */
int i;
DefineLineInformation; /* TIP #280 */
(void)cmdPtr;
/*
* Check argument count.
@@ -1776,13 +1795,15 @@ TclCompileLsetCmd(
int
TclCompileNamespaceCurrentCmd(
Tcl_Interp *interp, /* Used for error reporting. */
Tcl_Interp *dummy, /* Used for error reporting. */
Tcl_Parse *parsePtr, /* Points to a parse structure for the command
* created by Tcl_ParseCommand. */
Command *cmdPtr, /* Points to defintion of command being
* compiled. */
CompileEnv *envPtr) /* Holds resulting instructions. */
{
(void)dummy;
(void)cmdPtr;
/*
* Only compile [namespace current] without arguments.
*/
@@ -1810,6 +1831,7 @@ TclCompileNamespaceCodeCmd(
{
Tcl_Token *tokenPtr;
DefineLineInformation; /* TIP #280 */
(void)cmdPtr;
if (parsePtr->numWords != 2) {
return TCL_ERROR;
@@ -1860,6 +1882,7 @@ TclCompileNamespaceOriginCmd(
{
Tcl_Token *tokenPtr;
DefineLineInformation; /* TIP #280 */
(void)cmdPtr;
if (parsePtr->numWords != 2) {
return TCL_ERROR;
@@ -1883,6 +1906,7 @@ TclCompileNamespaceQualifiersCmd(
Tcl_Token *tokenPtr = TokenAfter(parsePtr->tokenPtr);
DefineLineInformation; /* TIP #280 */
int off;
(void)cmdPtr;
if (parsePtr->numWords != 2) {
return TCL_ERROR;
@@ -1919,6 +1943,7 @@ TclCompileNamespaceTailCmd(
Tcl_Token *tokenPtr = TokenAfter(parsePtr->tokenPtr);
DefineLineInformation; /* TIP #280 */
JumpFixup jumpFixup;
(void)cmdPtr;
if (parsePtr->numWords != 2) {
return TCL_ERROR;
@@ -1956,6 +1981,7 @@ TclCompileNamespaceUpvarCmd(
Tcl_Token *tokenPtr, *otherTokenPtr, *localTokenPtr;
int localIndex, numWords, i;
DefineLineInformation; /* TIP #280 */
(void)cmdPtr;
if (envPtr->procPtr == NULL) {
return TCL_ERROR;
@@ -2017,6 +2043,7 @@ TclCompileNamespaceWhichCmd(
DefineLineInformation; /* TIP #280 */
Tcl_Token *tokenPtr, *opt;
int idx;
(void)cmdPtr;
if (parsePtr->numWords < 2 || parsePtr->numWords > 3) {
return TCL_ERROR;
@@ -2083,6 +2110,7 @@ TclCompileRegexpCmd(
int i, len, nocase, exact, sawLast, simple;
const char *str;
DefineLineInformation; /* TIP #280 */
(void)cmdPtr;
/*
* We are only interested in compiling simple regexp cases. Currently
@@ -2269,6 +2297,7 @@ TclCompileRegsubCmd(
Tcl_DString pattern;
const char *bytes;
int len, exact, quantified, result = TCL_ERROR;
(void)cmdPtr;
if (parsePtr->numWords < 5 || parsePtr->numWords > 6) {
return TCL_ERROR;
@@ -2429,6 +2458,7 @@ TclCompileReturnCmd(
Tcl_Obj *returnOpts, **objv;
Tcl_Token *wordTokenPtr = TokenAfter(parsePtr->tokenPtr);
DefineLineInformation; /* TIP #280 */
(void)cmdPtr;
/*
* Check for special case which can always be compiled:
@@ -2455,7 +2485,7 @@ TclCompileReturnCmd(
* Allocate some working space.
*/
objv = TclStackAlloc(interp, numOptionWords * sizeof(Tcl_Obj *));
objv = (Tcl_Obj **)TclStackAlloc(interp, numOptionWords * sizeof(Tcl_Obj *));
/*
* Scan through the return options. If any are unknown at compile time,
@@ -2674,6 +2704,7 @@ TclCompileUpvarCmd(
int localIndex, numWords, i;
DefineLineInformation; /* TIP #280 */
Tcl_Obj *objPtr;
(void)cmdPtr;
if (envPtr->procPtr == NULL) {
return TCL_ERROR;
@@ -2780,6 +2811,7 @@ TclCompileVariableCmd(
Tcl_Token *varTokenPtr, *valueTokenPtr;
int localIndex, numWords, i;
DefineLineInformation; /* TIP #280 */
(void)cmdPtr;
numWords = parsePtr->numWords;
if (numWords < 2) {
@@ -2855,7 +2887,7 @@ TclCompileVariableCmd(
static int
IndexTailVarIfKnown(
Tcl_Interp *interp,
Tcl_Interp *dummy,
Tcl_Token *varTokenPtr, /* Token representing the variable name */
CompileEnv *envPtr) /* Holds resulting instructions. */
{
@@ -2864,6 +2896,7 @@ IndexTailVarIfKnown(
int len, n = varTokenPtr->numComponents;
Tcl_Token *lastTokenPtr;
int full, localIndex;
(void)dummy;
/*
* Determine if the tail is (a) known at compile time, and (b) not an
@@ -2954,6 +2987,7 @@ TclCompileObjectNextCmd(
DefineLineInformation; /* TIP #280 */
Tcl_Token *tokenPtr = parsePtr->tokenPtr;
int i;
(void)cmdPtr;
if (parsePtr->numWords > 255) {
return TCL_ERROR;
@@ -2979,6 +3013,7 @@ TclCompileObjectNextToCmd(
DefineLineInformation; /* TIP #280 */
Tcl_Token *tokenPtr = parsePtr->tokenPtr;
int i;
(void)cmdPtr;
if (parsePtr->numWords < 2 || parsePtr->numWords > 255) {
return TCL_ERROR;
@@ -2994,13 +3029,15 @@ TclCompileObjectNextToCmd(
int
TclCompileObjectSelfCmd(
Tcl_Interp *interp, /* Used for error reporting. */
Tcl_Interp *dummy, /* Used for error reporting. */
Tcl_Parse *parsePtr, /* Points to a parse structure for the command
* created by Tcl_ParseCommand. */
Command *cmdPtr, /* Points to defintion of command being
* compiled. */
CompileEnv *envPtr) /* Holds resulting instructions. */
{
(void)dummy;
(void)cmdPtr;
/*
* We only handle [self] and [self object] (which is the same operation).
* These are the only very common operations on [self] for which
+91 -39
View File
@@ -45,13 +45,12 @@ static int CompileUnaryOpCmd(Tcl_Interp *interp,
CompileEnv *envPtr);
static void IssueSwitchChainedTests(Tcl_Interp *interp,
CompileEnv *envPtr, int mode, int noCase,
int valueIndex, int numWords,
Tcl_Token **bodyToken, int *bodyLines,
int **bodyNext);
static void IssueSwitchJumpTable(Tcl_Interp *interp,
CompileEnv *envPtr, int valueIndex,
int numWords, Tcl_Token **bodyToken,
int *bodyLines, int **bodyContLines);
int *bodyLines, int **bodyNext);
static void IssueSwitchJumpTable(Tcl_Interp *interp,
CompileEnv *envPtr, int numWords,
Tcl_Token **bodyToken, int *bodyLines,
int **bodyContLines);
static int IssueTryClausesInstructions(Tcl_Interp *interp,
CompileEnv *envPtr, Tcl_Token *bodyToken,
int numHandlers, int *matchCodes,
@@ -138,6 +137,7 @@ TclCompileSetCmd(
Tcl_Token *varTokenPtr, *valueTokenPtr;
int isAssignment, isScalar, localIndex, numWords;
DefineLineInformation; /* TIP #280 */
(void)cmdPtr;
numWords = parsePtr->numWords;
if ((numWords != 2) && (numWords != 3)) {
@@ -233,6 +233,7 @@ TclCompileStringCatCmd(
Tcl_Token *wordTokenPtr;
Tcl_Obj *obj, *folded;
DefineLineInformation; /* TIP #280 */
(void)cmdPtr;
/* Trivial case, no arg */
@@ -303,6 +304,7 @@ TclCompileStringCmpCmd(
{
DefineLineInformation; /* TIP #280 */
Tcl_Token *tokenPtr;
(void)cmdPtr;
/*
* We don't support any flags; the bytecode isn't that sophisticated.
@@ -335,6 +337,7 @@ TclCompileStringEqualCmd(
{
DefineLineInformation; /* TIP #280 */
Tcl_Token *tokenPtr;
(void)cmdPtr;
/*
* We don't support any flags; the bytecode isn't that sophisticated.
@@ -367,6 +370,7 @@ TclCompileStringFirstCmd(
{
DefineLineInformation; /* TIP #280 */
Tcl_Token *tokenPtr;
(void)cmdPtr;
/*
* We don't support any flags; the bytecode isn't that sophisticated.
@@ -399,6 +403,7 @@ TclCompileStringLastCmd(
{
DefineLineInformation; /* TIP #280 */
Tcl_Token *tokenPtr;
(void)cmdPtr;
/*
* We don't support any flags; the bytecode isn't that sophisticated.
@@ -431,6 +436,7 @@ TclCompileStringIndexCmd(
{
DefineLineInformation; /* TIP #280 */
Tcl_Token *tokenPtr;
(void)cmdPtr;
if (parsePtr->numWords != 3) {
return TCL_ERROR;
@@ -460,6 +466,7 @@ TclCompileStringInsertCmd(
Tcl_Token *tokenPtr;
DefineLineInformation; /* TIP #280 */
int idx;
(void)cmdPtr;
if (parsePtr->numWords != 4) {
return TCL_ERROR;
@@ -694,6 +701,7 @@ TclCompileStringIsCmd(
OP( LNOT);
return TCL_OK;
}
break;
case STR_IS_DOUBLE: {
int satisfied, isEmpty;
@@ -885,6 +893,7 @@ TclCompileStringLenCmd(
DefineLineInformation; /* TIP #280 */
Tcl_Token *tokenPtr;
Tcl_Obj *objPtr;
(void)cmdPtr;
if (parsePtr->numWords != 2) {
return TCL_ERROR;
@@ -988,6 +997,7 @@ TclCompileStringRangeCmd(
DefineLineInformation; /* TIP #280 */
Tcl_Token *stringTokenPtr, *fromTokenPtr, *toTokenPtr;
int idx1, idx2;
(void)cmdPtr;
if (parsePtr->numWords != 4) {
return TCL_ERROR;
@@ -1064,6 +1074,7 @@ TclCompileStringReplaceCmd(
Tcl_Token *tokenPtr, *valueTokenPtr;
DefineLineInformation; /* TIP #280 */
int first, last;
(void)cmdPtr;
if (parsePtr->numWords < 4 || parsePtr->numWords > 5) {
return TCL_ERROR;
@@ -1262,6 +1273,7 @@ TclCompileStringTrimLCmd(
{
DefineLineInformation; /* TIP #280 */
Tcl_Token *tokenPtr;
(void)cmdPtr;
if (parsePtr->numWords != 2 && parsePtr->numWords != 3) {
return TCL_ERROR;
@@ -1290,6 +1302,7 @@ TclCompileStringTrimRCmd(
{
DefineLineInformation; /* TIP #280 */
Tcl_Token *tokenPtr;
(void)cmdPtr;
if (parsePtr->numWords != 2 && parsePtr->numWords != 3) {
return TCL_ERROR;
@@ -1318,6 +1331,7 @@ TclCompileStringTrimCmd(
{
DefineLineInformation; /* TIP #280 */
Tcl_Token *tokenPtr;
(void)cmdPtr;
if (parsePtr->numWords != 2 && parsePtr->numWords != 3) {
return TCL_ERROR;
@@ -1472,12 +1486,13 @@ TclCompileSubstCmd(
Tcl_Token *wordTokenPtr = TokenAfter(parsePtr->tokenPtr);
int code = TCL_ERROR;
DefineLineInformation; /* TIP #280 */
(void)cmdPtr;
if (numArgs == 0) {
return TCL_ERROR;
}
objv = TclStackAlloc(interp, /*numArgs*/ numOpts * sizeof(Tcl_Obj *));
objv = (Tcl_Obj **)TclStackAlloc(interp, /*numArgs*/ numOpts * sizeof(Tcl_Obj *));
for (objc = 0; objc < /*numArgs*/ numOpts; objc++) {
objv[objc] = Tcl_NewObj();
@@ -1816,6 +1831,7 @@ TclCompileSwitchCmd(
int result = TCL_ERROR;
DefineLineInformation; /* TIP #280 */
int *clNext = envPtr->clNext;
(void)cmdPtr;
/*
* Only handle the following versions:
@@ -1970,10 +1986,10 @@ TclCompileSwitchCmd(
if (maxLen < 2) {
return TCL_ERROR;
}
bodyTokenArray = ckalloc(sizeof(Tcl_Token) * maxLen);
bodyToken = ckalloc(sizeof(Tcl_Token *) * maxLen);
bodyLines = ckalloc(sizeof(int) * maxLen);
bodyContLines = ckalloc(sizeof(int*) * maxLen);
bodyTokenArray = (Tcl_Token *)ckalloc(sizeof(Tcl_Token) * maxLen);
bodyToken = (Tcl_Token **)ckalloc(sizeof(Tcl_Token *) * maxLen);
bodyLines = (int *)ckalloc(sizeof(int) * maxLen);
bodyContLines = (int **)ckalloc(sizeof(int*) * maxLen);
bline = mapPtr->loc[eclIndex].line[valueIndex+1];
numWords = 0;
@@ -2032,9 +2048,9 @@ TclCompileSwitchCmd(
* Multi-word definition of patterns & actions.
*/
bodyToken = ckalloc(sizeof(Tcl_Token *) * numWords);
bodyLines = ckalloc(sizeof(int) * numWords);
bodyContLines = ckalloc(sizeof(int*) * numWords);
bodyToken = (Tcl_Token **)ckalloc(sizeof(Tcl_Token *) * numWords);
bodyLines = (int *)ckalloc(sizeof(int) * numWords);
bodyContLines = (int **)ckalloc(sizeof(int*) * numWords);
bodyTokenArray = NULL;
for (i=0 ; i<numWords ; i++) {
/*
@@ -2080,10 +2096,10 @@ TclCompileSwitchCmd(
CompileWord(envPtr, valueTokenPtr, interp, valueIndex);
if (mode == Switch_Exact) {
IssueSwitchJumpTable(interp, envPtr, valueIndex, numWords, bodyToken,
IssueSwitchJumpTable(interp, envPtr, numWords, bodyToken,
bodyLines, bodyContLines);
} else {
IssueSwitchChainedTests(interp, envPtr, mode, noCase, valueIndex,
IssueSwitchChainedTests(interp, envPtr, mode, noCase,
numWords, bodyToken, bodyLines, bodyContLines);
}
result = TCL_OK;
@@ -2124,7 +2140,6 @@ IssueSwitchChainedTests(
CompileEnv *envPtr, /* Holds resulting instructions. */
int mode, /* Exact, Glob or Regexp */
int noCase, /* Case-insensitivity flag. */
int valueIndex, /* The value to match against. */
int numBodyTokens, /* Number of tokens describing things the
* switch can match against and bodies to
* execute when the match succeeds. */
@@ -2154,8 +2169,8 @@ IssueSwitchChainedTests(
contFixIndex = -1;
contFixCount = 0;
fixupArray = TclStackAlloc(interp, sizeof(JumpFixup) * numBodyTokens);
fixupTargetArray = TclStackAlloc(interp, sizeof(int) * numBodyTokens);
fixupArray = (JumpFixup *)TclStackAlloc(interp, sizeof(JumpFixup) * numBodyTokens);
fixupTargetArray = (unsigned int *)TclStackAlloc(interp, sizeof(int) * numBodyTokens);
memset(fixupTargetArray, 0, numBodyTokens * sizeof(int));
fixupCount = 0;
foundDefault = 0;
@@ -2373,7 +2388,6 @@ static void
IssueSwitchJumpTable(
Tcl_Interp *interp, /* Context for compiling script bodies. */
CompileEnv *envPtr, /* Holds resulting instructions. */
int valueIndex, /* The value to match against. */
int numBodyTokens, /* Number of tokens describing things the
* switch can match against and bodies to
* execute when the match succeeds. */
@@ -2398,10 +2412,10 @@ IssueSwitchJumpTable(
* Start by allocating the jump table itself, plus some workspace.
*/
jtPtr = ckalloc(sizeof(JumptableInfo));
jtPtr = (JumptableInfo *)ckalloc(sizeof(JumptableInfo));
Tcl_InitHashTable(&jtPtr->hashTable, TCL_STRING_KEYS);
infoIndex = TclCreateAuxData(jtPtr, &tclJumptableInfoType, envPtr);
finalFixups = TclStackAlloc(interp, sizeof(int) * (numBodyTokens/2));
finalFixups = (int *)TclStackAlloc(interp, sizeof(int) * (numBodyTokens/2));
foundDefault = 0;
mustGenerate = 1;
@@ -2569,8 +2583,8 @@ static ClientData
DupJumptableInfo(
ClientData clientData)
{
JumptableInfo *jtPtr = clientData;
JumptableInfo *newJtPtr = ckalloc(sizeof(JumptableInfo));
JumptableInfo *jtPtr = (JumptableInfo *)clientData;
JumptableInfo *newJtPtr = (JumptableInfo *)ckalloc(sizeof(JumptableInfo));
Tcl_HashEntry *hPtr, *newHPtr;
Tcl_HashSearch search;
int isNew;
@@ -2589,7 +2603,7 @@ static void
FreeJumptableInfo(
ClientData clientData)
{
JumptableInfo *jtPtr = clientData;
JumptableInfo *jtPtr = (JumptableInfo *)clientData;
Tcl_DeleteHashTable(&jtPtr->hashTable);
ckfree(jtPtr);
@@ -2602,15 +2616,16 @@ PrintJumptableInfo(
ByteCode *codePtr,
unsigned int pcOffset)
{
JumptableInfo *jtPtr = clientData;
JumptableInfo *jtPtr = (JumptableInfo *)clientData;
Tcl_HashEntry *hPtr;
Tcl_HashSearch search;
const char *keyPtr;
int offset, i = 0;
(void)codePtr;
hPtr = Tcl_FirstHashEntry(&jtPtr->hashTable, &search);
for (; hPtr ; hPtr = Tcl_NextHashEntry(&search)) {
keyPtr = Tcl_GetHashKey(&jtPtr->hashTable, hPtr);
keyPtr = (const char *)Tcl_GetHashKey(&jtPtr->hashTable, hPtr);
offset = PTR2INT(Tcl_GetHashValue(hPtr));
if (i++) {
@@ -2631,16 +2646,18 @@ DisassembleJumptableInfo(
ByteCode *codePtr,
unsigned int pcOffset)
{
JumptableInfo *jtPtr = clientData;
JumptableInfo *jtPtr = (JumptableInfo *)clientData;
Tcl_Obj *mapping = Tcl_NewObj();
Tcl_HashEntry *hPtr;
Tcl_HashSearch search;
const char *keyPtr;
int offset;
(void)codePtr;
(void)pcOffset;
hPtr = Tcl_FirstHashEntry(&jtPtr->hashTable, &search);
for (; hPtr ; hPtr = Tcl_NextHashEntry(&search)) {
keyPtr = Tcl_GetHashKey(&jtPtr->hashTable, hPtr);
keyPtr = (const char *)Tcl_GetHashKey(&jtPtr->hashTable, hPtr);
offset = PTR2INT(Tcl_GetHashValue(hPtr));
Tcl_DictObjPut(NULL, mapping, Tcl_NewStringObj(keyPtr, -1),
Tcl_NewIntObj(offset));
@@ -2678,6 +2695,7 @@ TclCompileTailcallCmd(
DefineLineInformation; /* TIP #280 */
Tcl_Token *tokenPtr = parsePtr->tokenPtr;
int i;
(void)cmdPtr;
if (parsePtr->numWords < 2 || parsePtr->numWords > 256
|| envPtr->procPtr == NULL) {
@@ -2727,6 +2745,7 @@ TclCompileThrowCmd(
Tcl_Token *codeToken, *msgToken;
Tcl_Obj *objPtr;
int codeKnown, codeIsList, codeIsValid, len;
(void)cmdPtr;
if (numWords != 3) {
return TCL_ERROR;
@@ -2832,6 +2851,7 @@ TclCompileTryCmd(
Tcl_Obj **matchClauses = NULL;
int *matchCodes=NULL, *resultVarIndices=NULL, *optionVarIndices=NULL;
int i;
(void)cmdPtr;
if (numWords < 2) {
return TCL_ERROR;
@@ -2859,12 +2879,12 @@ TclCompileTryCmd(
numHandlers = numWords >> 2;
numWords -= numHandlers * 4;
if (numHandlers > 0) {
handlerTokens = TclStackAlloc(interp, sizeof(Tcl_Token*)*numHandlers);
matchClauses = TclStackAlloc(interp, sizeof(Tcl_Obj *) * numHandlers);
handlerTokens = (Tcl_Token**)TclStackAlloc(interp, sizeof(Tcl_Token*)*numHandlers);
matchClauses = (Tcl_Obj **)TclStackAlloc(interp, sizeof(Tcl_Obj *) * numHandlers);
memset(matchClauses, 0, sizeof(Tcl_Obj *) * numHandlers);
matchCodes = TclStackAlloc(interp, sizeof(int) * numHandlers);
resultVarIndices = TclStackAlloc(interp, sizeof(int) * numHandlers);
optionVarIndices = TclStackAlloc(interp, sizeof(int) * numHandlers);
matchCodes = (int *)TclStackAlloc(interp, sizeof(int) * numHandlers);
resultVarIndices = (int *)TclStackAlloc(interp, sizeof(int) * numHandlers);
optionVarIndices = (int *)TclStackAlloc(interp, sizeof(int) * numHandlers);
for (i=0 ; i<numHandlers ; i++) {
Tcl_Obj *tmpObj, **objv;
@@ -3125,9 +3145,9 @@ IssueTryClausesInstructions(
* Slight overallocation, but reduces size of this function.
*/
addrsToFix = TclStackAlloc(interp, sizeof(int)*numHandlers);
forwardsToFix = TclStackAlloc(interp, sizeof(int)*numHandlers);
noError = TclStackAlloc(interp, sizeof(int)*numHandlers);
addrsToFix = (int *)TclStackAlloc(interp, sizeof(int)*numHandlers);
forwardsToFix = (int *)TclStackAlloc(interp, sizeof(int)*numHandlers);
noError = (int *)TclStackAlloc(interp, sizeof(int)*numHandlers);
for (i=0 ; i<numHandlers ; i++) {
noError[i] = -1;
@@ -3336,8 +3356,8 @@ IssueTryClausesFinallyInstructions(
* Slight overallocation, but reduces size of this function.
*/
addrsToFix = TclStackAlloc(interp, sizeof(int)*numHandlers);
forwardsToFix = TclStackAlloc(interp, sizeof(int)*numHandlers);
addrsToFix = (int *)TclStackAlloc(interp, sizeof(int)*numHandlers);
forwardsToFix = (int *)TclStackAlloc(interp, sizeof(int)*numHandlers);
for (i=0 ; i<numHandlers ; i++) {
int noTrapError, trapError;
@@ -3639,6 +3659,7 @@ TclCompileUnsetCmd(
Tcl_Token *varTokenPtr;
int isScalar, localIndex, flags = 1, i, varCount = 0, haveFlags = 0;
DefineLineInformation; /* TIP #280 */
(void)cmdPtr;
/* TODO: Consider support for compiling expanded args. */
@@ -3781,6 +3802,7 @@ TclCompileWhileCmd(
* infinite loop. */
Tcl_Obj *boolObj;
DefineLineInformation; /* TIP #280 */
(void)cmdPtr;
if (parsePtr->numWords != 3) {
return TCL_ERROR;
@@ -3952,6 +3974,8 @@ TclCompileYieldCmd(
* compiled. */
CompileEnv *envPtr) /* Holds resulting instructions. */
{
(void)cmdPtr;
if (parsePtr->numWords < 1 || parsePtr->numWords > 2) {
return TCL_ERROR;
}
@@ -3998,6 +4022,7 @@ TclCompileYieldToCmd(
DefineLineInformation; /* TIP #280 */
Tcl_Token *tokenPtr = TokenAfter(parsePtr->tokenPtr);
int i;
(void)cmdPtr;
if (parsePtr->numWords < 2) {
return TCL_ERROR;
@@ -4245,6 +4270,7 @@ TclCompileInvertOpCmd(
* compiled. */
CompileEnv *envPtr)
{
(void)cmdPtr;
return CompileUnaryOpCmd(interp, parsePtr, INST_BITNOT, envPtr);
}
@@ -4256,6 +4282,7 @@ TclCompileNotOpCmd(
* compiled. */
CompileEnv *envPtr)
{
(void)cmdPtr;
return CompileUnaryOpCmd(interp, parsePtr, INST_LNOT, envPtr);
}
@@ -4267,6 +4294,7 @@ TclCompileAddOpCmd(
* compiled. */
CompileEnv *envPtr)
{
(void)cmdPtr;
return CompileAssociativeBinaryOpCmd(interp, parsePtr, "0", INST_ADD,
envPtr);
}
@@ -4279,6 +4307,7 @@ TclCompileMulOpCmd(
* compiled. */
CompileEnv *envPtr)
{
(void)cmdPtr;
return CompileAssociativeBinaryOpCmd(interp, parsePtr, "1", INST_MULT,
envPtr);
}
@@ -4291,6 +4320,7 @@ TclCompileAndOpCmd(
* compiled. */
CompileEnv *envPtr)
{
(void)cmdPtr;
return CompileAssociativeBinaryOpCmd(interp, parsePtr, "-1", INST_BITAND,
envPtr);
}
@@ -4303,6 +4333,7 @@ TclCompileOrOpCmd(
* compiled. */
CompileEnv *envPtr)
{
(void)cmdPtr;
return CompileAssociativeBinaryOpCmd(interp, parsePtr, "0", INST_BITOR,
envPtr);
}
@@ -4315,6 +4346,7 @@ TclCompileXorOpCmd(
* compiled. */
CompileEnv *envPtr)
{
(void)cmdPtr;
return CompileAssociativeBinaryOpCmd(interp, parsePtr, "0", INST_BITXOR,
envPtr);
}
@@ -4335,6 +4367,7 @@ TclCompilePowOpCmd(
Tcl_Token *tokenPtr = parsePtr->tokenPtr;
DefineLineInformation; /* TIP #280 */
int words;
(void)cmdPtr;
for (words=1 ; words<parsePtr->numWords ; words++) {
tokenPtr = TokenAfter(tokenPtr);
@@ -4358,6 +4391,7 @@ TclCompileLshiftOpCmd(
* compiled. */
CompileEnv *envPtr)
{
(void)cmdPtr;
return CompileStrictlyBinaryOpCmd(interp, parsePtr, INST_LSHIFT, envPtr);
}
@@ -4369,6 +4403,7 @@ TclCompileRshiftOpCmd(
* compiled. */
CompileEnv *envPtr)
{
(void)cmdPtr;
return CompileStrictlyBinaryOpCmd(interp, parsePtr, INST_RSHIFT, envPtr);
}
@@ -4380,6 +4415,7 @@ TclCompileModOpCmd(
* compiled. */
CompileEnv *envPtr)
{
(void)cmdPtr;
return CompileStrictlyBinaryOpCmd(interp, parsePtr, INST_MOD, envPtr);
}
@@ -4391,6 +4427,7 @@ TclCompileNeqOpCmd(
* compiled. */
CompileEnv *envPtr)
{
(void)cmdPtr;
return CompileStrictlyBinaryOpCmd(interp, parsePtr, INST_NEQ, envPtr);
}
@@ -4402,6 +4439,7 @@ TclCompileStrneqOpCmd(
* compiled. */
CompileEnv *envPtr)
{
(void)cmdPtr;
return CompileStrictlyBinaryOpCmd(interp, parsePtr, INST_STR_NEQ, envPtr);
}
@@ -4413,6 +4451,7 @@ TclCompileInOpCmd(
* compiled. */
CompileEnv *envPtr)
{
(void)cmdPtr;
return CompileStrictlyBinaryOpCmd(interp, parsePtr, INST_LIST_IN, envPtr);
}
@@ -4424,6 +4463,7 @@ TclCompileNiOpCmd(
* compiled. */
CompileEnv *envPtr)
{
(void)cmdPtr;
return CompileStrictlyBinaryOpCmd(interp, parsePtr, INST_LIST_NOT_IN,
envPtr);
}
@@ -4436,6 +4476,7 @@ TclCompileLessOpCmd(
* compiled. */
CompileEnv *envPtr)
{
(void)cmdPtr;
return CompileComparisonOpCmd(interp, parsePtr, INST_LT, envPtr);
}
@@ -4447,6 +4488,7 @@ TclCompileLeqOpCmd(
* compiled. */
CompileEnv *envPtr)
{
(void)cmdPtr;
return CompileComparisonOpCmd(interp, parsePtr, INST_LE, envPtr);
}
@@ -4458,6 +4500,7 @@ TclCompileGreaterOpCmd(
* compiled. */
CompileEnv *envPtr)
{
(void)cmdPtr;
return CompileComparisonOpCmd(interp, parsePtr, INST_GT, envPtr);
}
@@ -4469,6 +4512,7 @@ TclCompileGeqOpCmd(
* compiled. */
CompileEnv *envPtr)
{
(void)cmdPtr;
return CompileComparisonOpCmd(interp, parsePtr, INST_GE, envPtr);
}
@@ -4480,6 +4524,7 @@ TclCompileEqOpCmd(
* compiled. */
CompileEnv *envPtr)
{
(void)cmdPtr;
return CompileComparisonOpCmd(interp, parsePtr, INST_EQ, envPtr);
}
@@ -4491,6 +4536,7 @@ TclCompileStreqOpCmd(
* compiled. */
CompileEnv *envPtr)
{
(void)cmdPtr;
return CompileComparisonOpCmd(interp, parsePtr, INST_STR_EQ, envPtr);
}
@@ -4502,6 +4548,7 @@ TclCompileStrLtOpCmd(
* compiled. */
CompileEnv *envPtr)
{
(void)cmdPtr;
return CompileComparisonOpCmd(interp, parsePtr, INST_STR_LT, envPtr);
}
@@ -4513,6 +4560,7 @@ TclCompileStrLeOpCmd(
* compiled. */
CompileEnv *envPtr)
{
(void)cmdPtr;
return CompileComparisonOpCmd(interp, parsePtr, INST_STR_LE, envPtr);
}
@@ -4524,6 +4572,7 @@ TclCompileStrGtOpCmd(
* compiled. */
CompileEnv *envPtr)
{
(void)cmdPtr;
return CompileComparisonOpCmd(interp, parsePtr, INST_STR_GT, envPtr);
}
@@ -4535,6 +4584,7 @@ TclCompileStrGeOpCmd(
* compiled. */
CompileEnv *envPtr)
{
(void)cmdPtr;
return CompileComparisonOpCmd(interp, parsePtr, INST_STR_GE, envPtr);
}
@@ -4549,6 +4599,7 @@ TclCompileMinusOpCmd(
Tcl_Token *tokenPtr = parsePtr->tokenPtr;
DefineLineInformation; /* TIP #280 */
int words;
(void)cmdPtr;
/* TODO: Consider support for compiling expanded args. */
if (parsePtr->numWords == 1) {
@@ -4595,6 +4646,7 @@ TclCompileDivOpCmd(
Tcl_Token *tokenPtr = parsePtr->tokenPtr;
DefineLineInformation; /* TIP #280 */
int words;
(void)cmdPtr;
/* TODO: Consider support for compiling expanded args. */
if (parsePtr->numWords == 1) {
+16 -16
View File
@@ -631,7 +631,7 @@ ParseExpr(
TclParseInit(interp, start, numBytes, parsePtr);
nodes = attemptckalloc(nodesAvailable * sizeof(OpNode));
nodes = (OpNode *)attemptckalloc(nodesAvailable * sizeof(OpNode));
if (nodes == NULL) {
TclNewLiteralStringObj(msg, "not enough memory to parse expression");
errCode = "NOMEM";
@@ -675,7 +675,7 @@ ParseExpr(
do {
if (size <= UINT_MAX/sizeof(OpNode)) {
newPtr = attemptckrealloc(nodes, size * sizeof(OpNode));
newPtr = (OpNode *)attemptckrealloc(nodes, size * sizeof(OpNode));
}
} while ((newPtr == NULL)
&& ((size -= (size - nodesUsed) / 2) > nodesUsed));
@@ -919,7 +919,7 @@ ParseExpr(
break;
case SCRIPT: {
Tcl_Parse *nestedPtr =
Tcl_Parse *nestedPtr = (Tcl_Parse *)
TclStackAlloc(interp, sizeof(Tcl_Parse));
tokenPtr = parsePtr->tokenPtr + parsePtr->numTokens;
@@ -1838,7 +1838,7 @@ Tcl_ParseExpr(
OpNode *opTree = NULL; /* Will point to the tree of operators. */
Tcl_Obj *litList = Tcl_NewObj(); /* List to hold the literals. */
Tcl_Obj *funcList = Tcl_NewObj(); /* List to hold the functon names. */
Tcl_Parse *exprParsePtr = TclStackAlloc(interp, sizeof(Tcl_Parse));
Tcl_Parse *exprParsePtr = (Tcl_Parse *)TclStackAlloc(interp, sizeof(Tcl_Parse));
/* Holds the Tcl_Tokens of substitutions. */
if (numBytes < 0) {
@@ -2156,7 +2156,7 @@ TclCompileExpr(
OpNode *opTree = NULL; /* Will point to the tree of operators */
Tcl_Obj *litList = Tcl_NewObj(); /* List to hold the literals */
Tcl_Obj *funcList = Tcl_NewObj(); /* List to hold the functon names*/
Tcl_Parse *parsePtr = TclStackAlloc(interp, sizeof(Tcl_Parse));
Tcl_Parse *parsePtr = (Tcl_Parse *)TclStackAlloc(interp, sizeof(Tcl_Parse));
/* Holds the Tcl_Tokens of substitutions */
int code = ParseExpr(interp, script, numBytes, &opTree, litList,
@@ -2226,7 +2226,7 @@ ExecConstantExprTree(
* bytecode, so there's no need to tend to TIP 280 issues.
*/
envPtr = TclStackAlloc(interp, sizeof(CompileEnv));
envPtr = (CompileEnv *)TclStackAlloc(interp, sizeof(CompileEnv));
TclInitCompileEnv(interp, envPtr, NULL, 0, NULL, 0);
CompileExprTree(interp, nodes, index, litObjvPtr, NULL, NULL, envPtr,
0 /* optimize */);
@@ -2321,13 +2321,13 @@ CompileExprTree(
break;
}
case QUESTION:
newJump = TclStackAlloc(interp, sizeof(JumpList));
newJump = (JumpList *)TclStackAlloc(interp, sizeof(JumpList));
newJump->next = jumpPtr;
jumpPtr = newJump;
TclEmitForwardJump(envPtr, TCL_FALSE_JUMP, &jumpPtr->jump);
break;
case COLON:
newJump = TclStackAlloc(interp, sizeof(JumpList));
newJump = (JumpList *)TclStackAlloc(interp, sizeof(JumpList));
newJump->next = jumpPtr;
jumpPtr = newJump;
TclEmitForwardJump(envPtr, TCL_UNCONDITIONAL_JUMP,
@@ -2340,7 +2340,7 @@ CompileExprTree(
break;
case AND:
case OR:
newJump = TclStackAlloc(interp, sizeof(JumpList));
newJump = (JumpList *)TclStackAlloc(interp, sizeof(JumpList));
newJump->next = jumpPtr;
jumpPtr = newJump;
TclEmitForwardJump(envPtr, (nodePtr->lexeme == AND)
@@ -2573,7 +2573,7 @@ TclSingleOpCmd(
int objc,
Tcl_Obj *const objv[])
{
TclOpCmdClientData *occdPtr = clientData;
TclOpCmdClientData *occdPtr = (TclOpCmdClientData *)clientData;
unsigned char lexeme;
OpNode nodes[2];
Tcl_Obj *const *litObjv = objv + 1;
@@ -2631,10 +2631,10 @@ TclSortingOpCmd(
if (objc < 3) {
Tcl_SetObjResult(interp, Tcl_NewBooleanObj(1));
} else {
TclOpCmdClientData *occdPtr = clientData;
Tcl_Obj **litObjv = TclStackAlloc(interp,
TclOpCmdClientData *occdPtr = (TclOpCmdClientData *)clientData;
Tcl_Obj **litObjv = (Tcl_Obj **)TclStackAlloc(interp,
2 * (objc-2) * sizeof(Tcl_Obj *));
OpNode *nodes = TclStackAlloc(interp, 2 * (objc-2) * sizeof(OpNode));
OpNode *nodes = (OpNode *)TclStackAlloc(interp, 2 * (objc-2) * sizeof(OpNode));
unsigned char lexeme;
int i, lastAnd = 1;
Tcl_Obj *const *litObjPtrPtr = litObjv;
@@ -2706,7 +2706,7 @@ TclVariadicOpCmd(
int objc,
Tcl_Obj *const objv[])
{
TclOpCmdClientData *occdPtr = clientData;
TclOpCmdClientData *occdPtr = (TclOpCmdClientData *)clientData;
unsigned char lexeme;
int code;
@@ -2761,7 +2761,7 @@ TclVariadicOpCmd(
return code;
} else {
Tcl_Obj *const *litObjv = objv + 1;
OpNode *nodes = TclStackAlloc(interp, (objc-1) * sizeof(OpNode));
OpNode *nodes = (OpNode *)TclStackAlloc(interp, (objc-1) * sizeof(OpNode));
int i, lastOp = OT_LITERAL;
nodes[0].lexeme = START;
@@ -2825,7 +2825,7 @@ TclNoIdentOpCmd(
int objc,
Tcl_Obj *const objv[])
{
TclOpCmdClientData *occdPtr = clientData;
TclOpCmdClientData *occdPtr = (TclOpCmdClientData *)clientData;
if (objc < 2) {
Tcl_WrongNumArgs(interp, 1, objv, occdPtr->expected);
+37 -34
View File
@@ -712,7 +712,7 @@ static void StartExpanding(CompileEnv *envPtr);
* commands.
*/
static void EnterCmdWordData(ExtCmdLoc *eclPtr, int srcOffset,
Tcl_Token *tokenPtr, const char *cmd, int len,
Tcl_Token *tokenPtr, const char *cmd,
int numWords, int line, int *clNext, int **lines,
CompileEnv *envPtr);
static void ReleaseCmdWordData(ExtCmdLoc *eclPtr);
@@ -797,7 +797,7 @@ TclSetByteCodeFromAny(
#ifdef TCL_COMPILE_DEBUG
if (!traceInitialized) {
if (Tcl_LinkVar(interp, "tcl_traceCompile",
(char *) &tclTraceCompile, TCL_LINK_INT) != TCL_OK) {
&tclTraceCompile, TCL_LINK_INT) != TCL_OK) {
Tcl_Panic("SetByteCodeFromAny: unable to create link for tcl_traceCompile variable");
}
traceInitialized = 1;
@@ -965,6 +965,8 @@ DupByteCodeInternalRep(
Tcl_Obj *srcPtr, /* Object with internal rep to copy. */
Tcl_Obj *copyPtr) /* Object with internal rep to set. */
{
(void)srcPtr;
(void)copyPtr;
return;
}
@@ -1148,7 +1150,7 @@ CleanupByteCode(
(char *) codePtr);
if (hePtr) {
ReleaseCmdWordData(Tcl_GetHashValue(hePtr));
ReleaseCmdWordData((ExtCmdLoc *)Tcl_GetHashValue(hePtr));
Tcl_DeleteHashEntry(hePtr);
}
}
@@ -1174,11 +1176,12 @@ CleanupByteCode(
static int
IsCompactibleCompileEnv(
Tcl_Interp *interp,
Tcl_Interp *dummy,
CompileEnv *envPtr)
{
unsigned char *pc;
int size;
(void)dummy;
/*
* Special: procedures in the '::tcl' namespace (or its children) are
@@ -1498,7 +1501,7 @@ TclInitCompileEnv(
* non-compiling evaluator
*/
envPtr->extCmdMapPtr = ckalloc(sizeof(ExtCmdLoc));
envPtr->extCmdMapPtr = (ExtCmdLoc *)ckalloc(sizeof(ExtCmdLoc));
envPtr->extCmdMapPtr->loc = NULL;
envPtr->extCmdMapPtr->nloc = 0;
envPtr->extCmdMapPtr->nuloc = 0;
@@ -1554,7 +1557,7 @@ TclInitCompileEnv(
* ...) which may make change the type as well.
*/
CmdFrame *ctxPtr = TclStackAlloc(interp, sizeof(CmdFrame));
CmdFrame *ctxPtr = (CmdFrame *)TclStackAlloc(interp, sizeof(CmdFrame));
int pc = 0;
*ctxPtr = *invoker;
@@ -2065,7 +2068,7 @@ CompileCommandTokens(
EnterCmdWordData(eclPtr, parsePtr->commandStart - envPtr->source,
parsePtr->tokenPtr, parsePtr->commandStart,
parsePtr->commandSize, parsePtr->numWords, cmdLine,
parsePtr->numWords, cmdLine,
clNext, &wlines, envPtr);
wlineat = eclPtr->nuloc - 1;
@@ -2187,7 +2190,7 @@ TclCompileScript(
* many nested compilations (body enclosed in body) can cause abnormal
* program termination with a stack overflow exception, bug [fec0c17d39].
*/
Tcl_Parse *parsePtr = ckalloc(sizeof(Tcl_Parse));
Tcl_Parse *parsePtr = (Tcl_Parse *)ckalloc(sizeof(Tcl_Parse));
do {
const char *next;
@@ -2445,7 +2448,7 @@ TclCompileTokens(
if (isLiteral) {
maxNumCL = NUM_STATIC_POS;
clPosition = ckalloc(maxNumCL * sizeof(int));
clPosition = (int *)ckalloc(maxNumCL * sizeof(int));
}
adjust = 0;
@@ -2486,7 +2489,7 @@ TclCompileTokens(
if (numCL >= maxNumCL) {
maxNumCL *= 2;
clPosition = ckrealloc(clPosition,
clPosition = (int *)ckrealloc(clPosition,
maxNumCL * sizeof(int));
}
clPosition[numCL] = clPos;
@@ -2743,6 +2746,7 @@ TclCompileNoOp(
{
Tcl_Token *tokenPtr;
int i;
(void)cmdPtr;
tokenPtr = parsePtr->tokenPtr;
for (i = 1; i < parsePtr->numWords; i++) {
@@ -2860,7 +2864,7 @@ TclInitByteCode(
namespacePtr = envPtr->iPtr->globalNsPtr;
}
p = ckalloc(structureSize);
p = (unsigned char *)ckalloc(structureSize);
codePtr = (ByteCode *) p;
codePtr->interpHandle = TclHandlePreserve(iPtr->handle);
codePtr->compileEpoch = iPtr->compileEpoch;
@@ -3073,7 +3077,7 @@ TclFindCompiledLocal(
if (create || (name == NULL)) {
localVar = procPtr->numCompiledLocals;
localPtr = ckalloc(offsetof(CompiledLocal, name) + nameBytes + 1);
localPtr = (CompiledLocal *)ckalloc(offsetof(CompiledLocal, name) + nameBytes + 1);
if (procPtr->firstLocalPtr == NULL) {
procPtr->firstLocalPtr = procPtr->lastLocalPtr = localPtr;
} else {
@@ -3123,7 +3127,7 @@ TclExpandCodeArray(
void *envArgPtr) /* Points to the CompileEnv whose code array
* must be enlarged. */
{
CompileEnv *envPtr = envArgPtr;
CompileEnv *envPtr = (CompileEnv *)envArgPtr;
/* The CompileEnv containing the code array to
* be doubled in size. */
@@ -3137,14 +3141,14 @@ TclExpandCodeArray(
size_t newBytes = 2 * (envPtr->codeEnd - envPtr->codeStart);
if (envPtr->mallocedCodeArray) {
envPtr->codeStart = ckrealloc(envPtr->codeStart, newBytes);
envPtr->codeStart = (unsigned char *)ckrealloc(envPtr->codeStart, newBytes);
} else {
/*
* envPtr->codeStart isn't a ckalloc'd pointer, so we must code a
* ckrealloc equivalent for ourselves.
*/
unsigned char *newPtr = ckalloc(newBytes);
unsigned char *newPtr = (unsigned char *)ckalloc(newBytes);
memcpy(newPtr, envPtr->codeStart, currBytes);
envPtr->codeStart = newPtr;
@@ -3204,14 +3208,14 @@ EnterCmdStartData(
size_t newBytes = newElems * sizeof(CmdLocation);
if (envPtr->mallocedCmdMap) {
envPtr->cmdMapPtr = ckrealloc(envPtr->cmdMapPtr, newBytes);
envPtr->cmdMapPtr = (CmdLocation *)ckrealloc(envPtr->cmdMapPtr, newBytes);
} else {
/*
* envPtr->cmdMapPtr isn't a ckalloc'd pointer, so we must code a
* ckrealloc equivalent for ourselves.
*/
CmdLocation *newPtr = ckalloc(newBytes);
CmdLocation *newPtr = (CmdLocation *)ckalloc(newBytes);
memcpy(newPtr, envPtr->cmdMapPtr, currBytes);
envPtr->cmdMapPtr = newPtr;
@@ -3308,7 +3312,6 @@ EnterCmdWordData(
int srcOffset, /* Offset of first char of the command. */
Tcl_Token *tokenPtr,
const char *cmd,
int len,
int numWords,
int line,
int *clNext,
@@ -3330,16 +3333,16 @@ EnterCmdWordData(
size_t newElems = (currElems ? 2*currElems : 1);
size_t newBytes = newElems * sizeof(ECL);
eclPtr->loc = ckrealloc(eclPtr->loc, newBytes);
eclPtr->loc = (ECL *)ckrealloc(eclPtr->loc, newBytes);
eclPtr->nloc = newElems;
}
ePtr = &eclPtr->loc[eclPtr->nuloc];
ePtr->srcOffset = srcOffset;
ePtr->line = ckalloc(numWords * sizeof(int));
ePtr->next = ckalloc(numWords * sizeof(int *));
ePtr->line = (int *)ckalloc(numWords * sizeof(int));
ePtr->next = (int **)ckalloc(numWords * sizeof(int *));
ePtr->nline = numWords;
wwlines = ckalloc(numWords * sizeof(int));
wwlines = (int *)ckalloc(numWords * sizeof(int));
last = cmd;
wordLine = line;
@@ -3408,17 +3411,17 @@ TclCreateExceptRange(
if (envPtr->mallocedExceptArray) {
envPtr->exceptArrayPtr =
ckrealloc(envPtr->exceptArrayPtr, newBytes);
(ExceptionRange *)ckrealloc(envPtr->exceptArrayPtr, newBytes);
envPtr->exceptAuxArrayPtr =
ckrealloc(envPtr->exceptAuxArrayPtr, newBytes2);
(ExceptionAux *)ckrealloc(envPtr->exceptAuxArrayPtr, newBytes2);
} else {
/*
* envPtr->exceptArrayPtr isn't a ckalloc'd pointer, so we must
* code a ckrealloc equivalent for ourselves.
*/
ExceptionRange *newPtr = ckalloc(newBytes);
ExceptionAux *newPtr2 = ckalloc(newBytes2);
ExceptionRange *newPtr = (ExceptionRange *)ckalloc(newBytes);
ExceptionAux *newPtr2 = (ExceptionAux *)ckalloc(newBytes2);
memcpy(newPtr, envPtr->exceptArrayPtr, currBytes);
memcpy(newPtr2, envPtr->exceptAuxArrayPtr, currBytes2);
@@ -3521,11 +3524,11 @@ TclAddLoopBreakFixup(
auxPtr->allocBreakTargets *= 2;
auxPtr->allocBreakTargets += 2;
if (auxPtr->breakTargets) {
auxPtr->breakTargets = ckrealloc(auxPtr->breakTargets,
auxPtr->breakTargets = (unsigned int *)ckrealloc(auxPtr->breakTargets,
sizeof(int) * auxPtr->allocBreakTargets);
} else {
auxPtr->breakTargets =
ckalloc(sizeof(int) * auxPtr->allocBreakTargets);
(unsigned int *)ckalloc(sizeof(int) * auxPtr->allocBreakTargets);
}
}
auxPtr->breakTargets[auxPtr->numBreakTargets - 1] = CurrentOffset(envPtr);
@@ -3547,11 +3550,11 @@ TclAddLoopContinueFixup(
auxPtr->allocContinueTargets *= 2;
auxPtr->allocContinueTargets += 2;
if (auxPtr->continueTargets) {
auxPtr->continueTargets = ckrealloc(auxPtr->continueTargets,
auxPtr->continueTargets = (unsigned int *)ckrealloc(auxPtr->continueTargets,
sizeof(int) * auxPtr->allocContinueTargets);
} else {
auxPtr->continueTargets =
ckalloc(sizeof(int) * auxPtr->allocContinueTargets);
(unsigned int *)ckalloc(sizeof(int) * auxPtr->allocContinueTargets);
}
}
auxPtr->continueTargets[auxPtr->numContinueTargets - 1] =
@@ -3774,14 +3777,14 @@ TclCreateAuxData(
if (envPtr->mallocedAuxDataArray) {
envPtr->auxDataArrayPtr =
ckrealloc(envPtr->auxDataArrayPtr, newBytes);
(AuxData *)ckrealloc(envPtr->auxDataArrayPtr, newBytes);
} else {
/*
* envPtr->auxDataArrayPtr isn't a ckalloc'd pointer, so we must
* code a ckrealloc equivalent for ourselves.
*/
AuxData *newPtr = ckalloc(newBytes);
AuxData *newPtr = (AuxData *)ckalloc(newBytes);
memcpy(newPtr, envPtr->auxDataArrayPtr, currBytes);
envPtr->auxDataArrayPtr = newPtr;
@@ -3863,14 +3866,14 @@ TclExpandJumpFixupArray(
size_t newBytes = newElems * sizeof(JumpFixup);
if (fixupArrayPtr->mallocedArray) {
fixupArrayPtr->fixup = ckrealloc(fixupArrayPtr->fixup, newBytes);
fixupArrayPtr->fixup = (JumpFixup *)ckrealloc(fixupArrayPtr->fixup, newBytes);
} else {
/*
* fixupArrayPtr->fixup isn't a ckalloc'd pointer, so we must code a
* ckrealloc equivalent for ourselves.
*/
JumpFixup *newPtr = ckalloc(newBytes);
JumpFixup *newPtr = (JumpFixup *)ckalloc(newBytes);
memcpy(newPtr, fixupArrayPtr->fixup, currBytes);
fixupArrayPtr->fixup = newPtr;
+8 -7
View File
@@ -79,11 +79,11 @@ Tcl_RegisterConfig(
Tcl_Obj *pDB, *pkgDict;
Tcl_DString cmdName;
const Tcl_Config *cfg;
QCCD *cdPtr = ckalloc(sizeof(QCCD));
QCCD *cdPtr = (QCCD *)ckalloc(sizeof(QCCD));
cdPtr->interp = interp;
if (valEncoding) {
cdPtr->encoding = ckalloc(strlen(valEncoding)+1);
cdPtr->encoding = (char *)ckalloc(strlen(valEncoding)+1);
strcpy(cdPtr->encoding, valEncoding);
} else {
cdPtr->encoding = NULL;
@@ -199,7 +199,7 @@ QueryConfigObjCmd(
int objc,
struct Tcl_Obj *const *objv)
{
QCCD *cdPtr = clientData;
QCCD *cdPtr = (QCCD *)clientData;
Tcl_Obj *pkgName = cdPtr->pkg;
Tcl_Obj *pDB, *pkgDict, *val, *listPtr;
int n, index;
@@ -326,7 +326,7 @@ static void
QueryConfigDelete(
ClientData clientData)
{
QCCD *cdPtr = clientData;
QCCD *cdPtr = (QCCD *)clientData;
Tcl_Obj *pkgName = cdPtr->pkg;
Tcl_Obj *pDB = GetConfigDict(cdPtr->interp);
@@ -359,7 +359,7 @@ static Tcl_Obj *
GetConfigDict(
Tcl_Interp *interp)
{
Tcl_Obj *pDB = Tcl_GetAssocData(interp, ASSOC_KEY, NULL);
Tcl_Obj *pDB = (Tcl_Obj *)Tcl_GetAssocData(interp, ASSOC_KEY, NULL);
if (pDB == NULL) {
pDB = Tcl_NewDictObj();
@@ -392,9 +392,10 @@ GetConfigDict(
static void
ConfigDictDeleteProc(
ClientData clientData, /* Pointer to Tcl_Obj. */
Tcl_Interp *interp) /* Interpreter being deleted. */
Tcl_Interp *dummy) /* Interpreter being deleted. */
{
Tcl_Obj *pDB = clientData;
Tcl_Obj *pDB = (Tcl_Obj *)clientData;
(void)dummy;
Tcl_DecrRefCount(pDB);
}
+3 -2
View File
@@ -2744,7 +2744,7 @@ TclDatelex(
int
TclClockOldscanObjCmd(
void *clientData, /* Unused */
void *dummy, /* Unused */
Tcl_Interp *interp, /* Tcl interpreter */
int objc, /* Count of paraneters */
Tcl_Obj *const *objv) /* Parameters */
@@ -2754,6 +2754,7 @@ TclClockOldscanObjCmd(
DateInfo dateInfo;
DateInfo* info = &dateInfo;
int status;
(void)dummy;
if (objc != 5) {
Tcl_WrongNumArgs(interp, 1, objv,
@@ -2858,7 +2859,7 @@ TclClockOldscanObjCmd(
if (yyHaveTime) {
Tcl_ListObjAppendElement(interp, result, Tcl_NewIntObj((int)
ToSeconds(yyHour, yyMinutes, yySeconds, yyMeridian)));
ToSeconds(yyHour, yyMinutes, yySeconds, (MERIDIAN)yyMeridian)));
} else {
Tcl_ListObjAppendElement(interp, result, Tcl_NewObj());
}
+51 -30
View File
@@ -478,7 +478,8 @@ EXTERN Tcl_HashEntry * Tcl_FirstHashEntry(Tcl_HashTable *tablePtr,
/* 146 */
EXTERN int Tcl_Flush(Tcl_Channel chan);
/* 147 */
EXTERN void Tcl_FreeResult(Tcl_Interp *interp);
TCL_DEPRECATED("see TIP #559. Use Tcl_ResetResult")
void Tcl_FreeResult(Tcl_Interp *interp);
/* 148 */
EXTERN int Tcl_GetAlias(Tcl_Interp *interp,
const char *slaveCmd,
@@ -1063,9 +1064,11 @@ EXTERN int Tcl_UniCharIsUpper(int ch);
/* 351 */
EXTERN int Tcl_UniCharIsWordChar(int ch);
/* 352 */
EXTERN int Tcl_UniCharLen(const Tcl_UniChar *uniStr);
TCL_DEPRECATED("Use Tcl_GetCharLength")
int Tcl_UniCharLen(const Tcl_UniChar *uniStr);
/* 353 */
EXTERN int Tcl_UniCharNcmp(const Tcl_UniChar *ucs,
TCL_DEPRECATED("Use Tcl_UtfNcmp")
int Tcl_UniCharNcmp(const Tcl_UniChar *ucs,
const Tcl_UniChar *uct,
unsigned long numChars);
/* 354 */
@@ -1156,7 +1159,8 @@ Tcl_UniChar * Tcl_GetUnicode(Tcl_Obj *objPtr);
/* 383 */
EXTERN Tcl_Obj * Tcl_GetRange(Tcl_Obj *objPtr, int first, int last);
/* 384 */
EXTERN void Tcl_AppendUnicodeToObj(Tcl_Obj *objPtr,
TCL_DEPRECATED("Use Tcl_AppendStringsToObj")
void Tcl_AppendUnicodeToObj(Tcl_Obj *objPtr,
const Tcl_UniChar *unicode, int length);
/* 385 */
EXTERN int Tcl_RegExpMatchObj(Tcl_Interp *interp,
@@ -1250,11 +1254,13 @@ EXTERN void Tcl_ClearChannelHandlers(Tcl_Channel channel);
/* 418 */
EXTERN int Tcl_IsChannelExisting(const char *channelName);
/* 419 */
EXTERN int Tcl_UniCharNcasecmp(const Tcl_UniChar *ucs,
TCL_DEPRECATED("Use Tcl_UtfNcasecmp")
int Tcl_UniCharNcasecmp(const Tcl_UniChar *ucs,
const Tcl_UniChar *uct,
unsigned long numChars);
/* 420 */
EXTERN int Tcl_UniCharCaseMatch(const Tcl_UniChar *uniStr,
TCL_DEPRECATED("Use Tcl_StringCaseMatch")
int Tcl_UniCharCaseMatch(const Tcl_UniChar *uniStr,
const Tcl_UniChar *uniPattern, int nocase);
/* 421 */
EXTERN Tcl_HashEntry * Tcl_FindHashEntry(Tcl_HashTable *tablePtr,
@@ -1644,18 +1650,18 @@ EXTERN void Tcl_QueryTimeProc(Tcl_GetTimeProc **getProc,
EXTERN Tcl_DriverThreadActionProc * Tcl_ChannelThreadActionProc(
const Tcl_ChannelType *chanTypePtr);
/* 555 */
EXTERN Tcl_Obj * Tcl_NewBignumObj(mp_int *value);
EXTERN Tcl_Obj * Tcl_NewBignumObj(void *value);
/* 556 */
EXTERN Tcl_Obj * Tcl_DbNewBignumObj(mp_int *value, const char *file,
EXTERN Tcl_Obj * Tcl_DbNewBignumObj(void *value, const char *file,
int line);
/* 557 */
EXTERN void Tcl_SetBignumObj(Tcl_Obj *obj, mp_int *value);
EXTERN void Tcl_SetBignumObj(Tcl_Obj *obj, void *value);
/* 558 */
EXTERN int Tcl_GetBignumFromObj(Tcl_Interp *interp,
Tcl_Obj *obj, mp_int *value);
Tcl_Obj *obj, void *value);
/* 559 */
EXTERN int Tcl_TakeBignumFromObj(Tcl_Interp *interp,
Tcl_Obj *obj, mp_int *value);
Tcl_Obj *obj, void *value);
/* 560 */
EXTERN int Tcl_TruncateChannel(Tcl_Channel chan,
Tcl_WideInt length);
@@ -1674,7 +1680,7 @@ EXTERN void Tcl_SetChannelError(Tcl_Channel chan, Tcl_Obj *msg);
EXTERN void Tcl_GetChannelError(Tcl_Channel chan, Tcl_Obj **msg);
/* 566 */
EXTERN int Tcl_InitBignumFromDouble(Tcl_Interp *interp,
double initval, mp_int *toInit);
double initval, void *toInit);
/* 567 */
EXTERN Tcl_Obj * Tcl_GetNamespaceUnknownHandler(Tcl_Interp *interp,
Tcl_Namespace *nsPtr);
@@ -1792,7 +1798,7 @@ EXTERN int Tcl_GetErrorLine(Tcl_Interp *interp);
EXTERN void Tcl_SetErrorLine(Tcl_Interp *interp, int lineNum);
/* 607 */
EXTERN void Tcl_TransferResult(Tcl_Interp *sourceInterp,
int result, Tcl_Interp *targetInterp);
int code, Tcl_Interp *targetInterp);
/* 608 */
EXTERN int Tcl_InterpActive(Tcl_Interp *interp);
/* 609 */
@@ -2087,7 +2093,7 @@ typedef struct TclStubs {
TCL_DEPRECATED_API("Don't use this function in a stub-enabled extension") void (*tcl_FindExecutable) (const char *argv0); /* 144 */
Tcl_HashEntry * (*tcl_FirstHashEntry) (Tcl_HashTable *tablePtr, Tcl_HashSearch *searchPtr); /* 145 */
int (*tcl_Flush) (Tcl_Channel chan); /* 146 */
void (*tcl_FreeResult) (Tcl_Interp *interp); /* 147 */
TCL_DEPRECATED_API("see TIP #559. Use Tcl_ResetResult") void (*tcl_FreeResult) (Tcl_Interp *interp); /* 147 */
int (*tcl_GetAlias) (Tcl_Interp *interp, const char *slaveCmd, Tcl_Interp **targetInterpPtr, const char **targetCmdPtr, int *argcPtr, const char ***argvPtr); /* 148 */
int (*tcl_GetAliasObj) (Tcl_Interp *interp, const char *slaveCmd, Tcl_Interp **targetInterpPtr, const char **targetCmdPtr, int *objcPtr, Tcl_Obj ***objv); /* 149 */
ClientData (*tcl_GetAssocData) (Tcl_Interp *interp, const char *name, Tcl_InterpDeleteProc **procPtr); /* 150 */
@@ -2300,8 +2306,8 @@ typedef struct TclStubs {
int (*tcl_UniCharIsSpace) (int ch); /* 349 */
int (*tcl_UniCharIsUpper) (int ch); /* 350 */
int (*tcl_UniCharIsWordChar) (int ch); /* 351 */
int (*tcl_UniCharLen) (const Tcl_UniChar *uniStr); /* 352 */
int (*tcl_UniCharNcmp) (const Tcl_UniChar *ucs, const Tcl_UniChar *uct, unsigned long numChars); /* 353 */
TCL_DEPRECATED_API("Use Tcl_GetCharLength") int (*tcl_UniCharLen) (const Tcl_UniChar *uniStr); /* 352 */
TCL_DEPRECATED_API("Use Tcl_UtfNcmp") int (*tcl_UniCharNcmp) (const Tcl_UniChar *ucs, const Tcl_UniChar *uct, unsigned long numChars); /* 353 */
char * (*tcl_Char16ToUtfDString) (const unsigned short *uniStr, int uniLength, Tcl_DString *dsPtr); /* 354 */
unsigned short * (*tcl_UtfToChar16DString) (const char *src, int length, Tcl_DString *dsPtr); /* 355 */
Tcl_RegExp (*tcl_GetRegExpFromObj) (Tcl_Interp *interp, Tcl_Obj *patObj, int flags); /* 356 */
@@ -2332,7 +2338,7 @@ typedef struct TclStubs {
int (*tcl_GetUniChar) (Tcl_Obj *objPtr, int index); /* 381 */
TCL_DEPRECATED_API("No longer in use, changed to macro") Tcl_UniChar * (*tcl_GetUnicode) (Tcl_Obj *objPtr); /* 382 */
Tcl_Obj * (*tcl_GetRange) (Tcl_Obj *objPtr, int first, int last); /* 383 */
void (*tcl_AppendUnicodeToObj) (Tcl_Obj *objPtr, const Tcl_UniChar *unicode, int length); /* 384 */
TCL_DEPRECATED_API("Use Tcl_AppendStringsToObj") void (*tcl_AppendUnicodeToObj) (Tcl_Obj *objPtr, const Tcl_UniChar *unicode, int length); /* 384 */
int (*tcl_RegExpMatchObj) (Tcl_Interp *interp, Tcl_Obj *textObj, Tcl_Obj *patternObj); /* 385 */
void (*tcl_SetNotifier) (Tcl_NotifierProcs *notifierProcPtr); /* 386 */
Tcl_Mutex * (*tcl_GetAllocMutex) (void); /* 387 */
@@ -2367,8 +2373,8 @@ typedef struct TclStubs {
void (*tcl_SpliceChannel) (Tcl_Channel channel); /* 416 */
void (*tcl_ClearChannelHandlers) (Tcl_Channel channel); /* 417 */
int (*tcl_IsChannelExisting) (const char *channelName); /* 418 */
int (*tcl_UniCharNcasecmp) (const Tcl_UniChar *ucs, const Tcl_UniChar *uct, unsigned long numChars); /* 419 */
int (*tcl_UniCharCaseMatch) (const Tcl_UniChar *uniStr, const Tcl_UniChar *uniPattern, int nocase); /* 420 */
TCL_DEPRECATED_API("Use Tcl_UtfNcasecmp") int (*tcl_UniCharNcasecmp) (const Tcl_UniChar *ucs, const Tcl_UniChar *uct, unsigned long numChars); /* 419 */
TCL_DEPRECATED_API("Use Tcl_StringCaseMatch") int (*tcl_UniCharCaseMatch) (const Tcl_UniChar *uniStr, const Tcl_UniChar *uniPattern, int nocase); /* 420 */
Tcl_HashEntry * (*tcl_FindHashEntry) (Tcl_HashTable *tablePtr, const void *key); /* 421 */
Tcl_HashEntry * (*tcl_CreateHashEntry) (Tcl_HashTable *tablePtr, const void *key, int *newPtr); /* 422 */
void (*tcl_InitCustomHashTable) (Tcl_HashTable *tablePtr, int keyType, const Tcl_HashKeyType *typePtr); /* 423 */
@@ -2503,18 +2509,18 @@ typedef struct TclStubs {
void (*tcl_SetTimeProc) (Tcl_GetTimeProc *getProc, Tcl_ScaleTimeProc *scaleProc, ClientData clientData); /* 552 */
void (*tcl_QueryTimeProc) (Tcl_GetTimeProc **getProc, Tcl_ScaleTimeProc **scaleProc, ClientData *clientData); /* 553 */
Tcl_DriverThreadActionProc * (*tcl_ChannelThreadActionProc) (const Tcl_ChannelType *chanTypePtr); /* 554 */
Tcl_Obj * (*tcl_NewBignumObj) (mp_int *value); /* 555 */
Tcl_Obj * (*tcl_DbNewBignumObj) (mp_int *value, const char *file, int line); /* 556 */
void (*tcl_SetBignumObj) (Tcl_Obj *obj, mp_int *value); /* 557 */
int (*tcl_GetBignumFromObj) (Tcl_Interp *interp, Tcl_Obj *obj, mp_int *value); /* 558 */
int (*tcl_TakeBignumFromObj) (Tcl_Interp *interp, Tcl_Obj *obj, mp_int *value); /* 559 */
Tcl_Obj * (*tcl_NewBignumObj) (void *value); /* 555 */
Tcl_Obj * (*tcl_DbNewBignumObj) (void *value, const char *file, int line); /* 556 */
void (*tcl_SetBignumObj) (Tcl_Obj *obj, void *value); /* 557 */
int (*tcl_GetBignumFromObj) (Tcl_Interp *interp, Tcl_Obj *obj, void *value); /* 558 */
int (*tcl_TakeBignumFromObj) (Tcl_Interp *interp, Tcl_Obj *obj, void *value); /* 559 */
int (*tcl_TruncateChannel) (Tcl_Channel chan, Tcl_WideInt length); /* 560 */
Tcl_DriverTruncateProc * (*tcl_ChannelTruncateProc) (const Tcl_ChannelType *chanTypePtr); /* 561 */
void (*tcl_SetChannelErrorInterp) (Tcl_Interp *interp, Tcl_Obj *msg); /* 562 */
void (*tcl_GetChannelErrorInterp) (Tcl_Interp *interp, Tcl_Obj **msg); /* 563 */
void (*tcl_SetChannelError) (Tcl_Channel chan, Tcl_Obj *msg); /* 564 */
void (*tcl_GetChannelError) (Tcl_Channel chan, Tcl_Obj **msg); /* 565 */
int (*tcl_InitBignumFromDouble) (Tcl_Interp *interp, double initval, mp_int *toInit); /* 566 */
int (*tcl_InitBignumFromDouble) (Tcl_Interp *interp, double initval, void *toInit); /* 566 */
Tcl_Obj * (*tcl_GetNamespaceUnknownHandler) (Tcl_Interp *interp, Tcl_Namespace *nsPtr); /* 567 */
int (*tcl_SetNamespaceUnknownHandler) (Tcl_Interp *interp, Tcl_Namespace *nsPtr, Tcl_Obj *handlerPtr); /* 568 */
int (*tcl_GetEncodingFromObj) (Tcl_Interp *interp, Tcl_Obj *objPtr, Tcl_Encoding *encodingPtr); /* 569 */
@@ -2555,7 +2561,7 @@ typedef struct TclStubs {
int (*tcl_ParseArgsObjv) (Tcl_Interp *interp, const Tcl_ArgvInfo *argTable, int *objcPtr, Tcl_Obj *const *objv, Tcl_Obj ***remObjv); /* 604 */
int (*tcl_GetErrorLine) (Tcl_Interp *interp); /* 605 */
void (*tcl_SetErrorLine) (Tcl_Interp *interp, int lineNum); /* 606 */
void (*tcl_TransferResult) (Tcl_Interp *sourceInterp, int result, Tcl_Interp *targetInterp); /* 607 */
void (*tcl_TransferResult) (Tcl_Interp *sourceInterp, int code, Tcl_Interp *targetInterp); /* 607 */
int (*tcl_InterpActive) (Tcl_Interp *interp); /* 608 */
void (*tcl_BackgroundException) (Tcl_Interp *interp, int code); /* 609 */
int (*tcl_ZlibDeflate) (Tcl_Interp *interp, int format, Tcl_Obj *data, int level, Tcl_Obj *gzipHeaderDictObj); /* 610 */
@@ -4009,7 +4015,22 @@ extern const TclStubs *tclStubsPtr;
#define Tcl_AddObjErrorInfo(interp, message, length) \
Tcl_AppendObjToErrorInfo(interp, Tcl_NewStringObj(message, length))
#ifdef TCL_NO_DEPRECATED
#undef Tcl_FreeResult
#undef Tcl_AppendResultVA
#undef Tcl_AppendStringsToObjVA
#undef Tcl_SetErrorCodeVA
#undef Tcl_VarEvalVA
#undef Tcl_PanicVA
#undef Tcl_GetStringResult
#undef Tcl_GetDefaultEncodingDir
#undef Tcl_SetDefaultEncodingDir
#undef Tcl_UniCharLen
#undef Tcl_UniCharNcmp
#undef Tcl_EvalTokens
#undef Tcl_UniCharNcasecmp
#undef Tcl_UniCharCaseMatch
#undef Tcl_GetMathFuncInfo
#undef Tcl_ListMathFuncs
#define Tcl_GetStringResult(interp) Tcl_GetString(Tcl_GetObjResult(interp))
#undef Tcl_Eval
#define Tcl_Eval(interp, objPtr) \
@@ -4037,14 +4058,14 @@ extern const TclStubs *tclStubsPtr;
#undef Tcl_SetResult
#define Tcl_SetResult(interp, result, freeProc) \
do { \
char *__result = result; \
const char *__result = result; \
Tcl_FreeProc *__freeProc = freeProc; \
Tcl_SetObjResult(interp, Tcl_NewStringObj(__result, -1)); \
if (__result != NULL && __freeProc != NULL && __freeProc != TCL_VOLATILE) { \
if (__freeProc == TCL_DYNAMIC) { \
ckfree(__result); \
ckfree((char *)__result); \
} else { \
(*__freeProc)(__result); \
(*__freeProc)((char *)__result); \
} \
} \
} while(0)
@@ -4109,7 +4130,7 @@ extern const TclStubs *tclStubsPtr;
#undef Tcl_StringMatch
#define Tcl_StringMatch(str, pattern) Tcl_StringCaseMatch((str), (pattern), 0)
#if TCL_UTF_MAX <= 4
#if TCL_UTF_MAX <= 3
# undef Tcl_UniCharToUtfDString
# define Tcl_UniCharToUtfDString Tcl_Char16ToUtfDString
# undef Tcl_UtfToUniCharDString
+84 -60
View File
@@ -11,7 +11,7 @@
*/
#include "tclInt.h"
#include "tommath.h"
#include "tclTomMath.h"
#include <assert.h>
/*
@@ -179,7 +179,7 @@ const Tcl_ObjType tclDictType = {
do { \
const Tcl_ObjIntRep *irPtr; \
irPtr = TclFetchIntRep((objPtr), &tclDictType); \
(dictRepPtr) = irPtr ? irPtr->twoPtrValue.ptr1 : NULL; \
(dictRepPtr) = irPtr ? (Dict *)irPtr->twoPtrValue.ptr1 : NULL; \
} while (0)
/*
@@ -243,10 +243,11 @@ AllocChainEntry(
Tcl_HashTable *tablePtr,
void *keyPtr)
{
Tcl_Obj *objPtr = keyPtr;
Tcl_Obj *objPtr = (Tcl_Obj *)keyPtr;
ChainEntry *cPtr;
(void)tablePtr;
cPtr = ckalloc(sizeof(ChainEntry));
cPtr = (ChainEntry *)ckalloc(sizeof(ChainEntry));
cPtr->entry.key.objPtr = objPtr;
Tcl_IncrRefCount(objPtr);
cPtr->entry.clientData = NULL;
@@ -279,7 +280,7 @@ DeleteChainTable(
ChainEntry *cPtr;
for (cPtr=dict->entryChainHead ; cPtr!=NULL ; cPtr=cPtr->nextPtr) {
Tcl_Obj *valuePtr = Tcl_GetHashValue(&cPtr->entry);
Tcl_Obj *valuePtr = (Tcl_Obj *)Tcl_GetHashValue(&cPtr->entry);
TclDecrRefCount(valuePtr);
}
@@ -326,7 +327,7 @@ DeleteChainEntry(
if (cPtr == NULL) {
return 0;
} else {
Tcl_Obj *valuePtr = Tcl_GetHashValue(&cPtr->entry);
Tcl_Obj *valuePtr = (Tcl_Obj *)Tcl_GetHashValue(&cPtr->entry);
TclDecrRefCount(valuePtr);
}
@@ -377,7 +378,7 @@ DupDictInternalRep(
Tcl_Obj *srcPtr,
Tcl_Obj *copyPtr)
{
Dict *oldDict, *newDict = ckalloc(sizeof(Dict));
Dict *oldDict, *newDict = (Dict *)ckalloc(sizeof(Dict));
ChainEntry *cPtr;
DictGetIntRep(srcPtr, oldDict);
@@ -388,8 +389,8 @@ DupDictInternalRep(
InitChainTable(newDict);
for (cPtr=oldDict->entryChainHead ; cPtr!=NULL ; cPtr=cPtr->nextPtr) {
Tcl_Obj *key = Tcl_GetHashKey(&oldDict->table, &cPtr->entry);
Tcl_Obj *valuePtr = Tcl_GetHashValue(&cPtr->entry);
Tcl_Obj *key = (Tcl_Obj *)Tcl_GetHashKey(&oldDict->table, &cPtr->entry);
Tcl_Obj *valuePtr = (Tcl_Obj *)Tcl_GetHashValue(&cPtr->entry);
int n;
Tcl_HashEntry *hPtr = CreateChainEntry(newDict, key, &n);
@@ -536,7 +537,7 @@ UpdateStringOfDict(
if (numElems <= LOCAL_SIZE) {
flagPtr = localFlags;
} else {
flagPtr = ckalloc(numElems);
flagPtr = (char *)ckalloc(numElems);
}
for (i=0,cPtr=dict->entryChainHead; i<numElems; i+=2,cPtr=cPtr->nextPtr) {
/*
@@ -545,7 +546,7 @@ UpdateStringOfDict(
*/
flagPtr[i] = ( i ? TCL_DONT_QUOTE_HASH : 0 );
keyPtr = Tcl_GetHashKey(&dict->table, &cPtr->entry);
keyPtr = (Tcl_Obj *)Tcl_GetHashKey(&dict->table, &cPtr->entry);
elem = TclGetStringFromObj(keyPtr, &length);
bytesNeeded += TclScanElement(elem, length, flagPtr+i);
if (bytesNeeded < 0) {
@@ -553,7 +554,7 @@ UpdateStringOfDict(
}
flagPtr[i+1] = TCL_DONT_QUOTE_HASH;
valuePtr = Tcl_GetHashValue(&cPtr->entry);
valuePtr = (Tcl_Obj *)Tcl_GetHashValue(&cPtr->entry);
elem = TclGetStringFromObj(valuePtr, &length);
bytesNeeded += TclScanElement(elem, length, flagPtr+i+1);
if (bytesNeeded < 0) {
@@ -573,13 +574,13 @@ UpdateStringOfDict(
TclOOM(dst, bytesNeeded);
for (i=0,cPtr=dict->entryChainHead; i<numElems; i+=2,cPtr=cPtr->nextPtr) {
flagPtr[i] |= ( i ? TCL_DONT_QUOTE_HASH : 0 );
keyPtr = Tcl_GetHashKey(&dict->table, &cPtr->entry);
keyPtr = (Tcl_Obj *)Tcl_GetHashKey(&dict->table, &cPtr->entry);
elem = TclGetStringFromObj(keyPtr, &length);
dst += TclConvertElement(elem, length, dst, flagPtr[i]);
*dst++ = ' ';
flagPtr[i+1] |= TCL_DONT_QUOTE_HASH;
valuePtr = Tcl_GetHashValue(&cPtr->entry);
valuePtr = (Tcl_Obj *)Tcl_GetHashValue(&cPtr->entry);
elem = TclGetStringFromObj(valuePtr, &length);
dst += TclConvertElement(elem, length, dst, flagPtr[i+1]);
*dst++ = ' ';
@@ -618,7 +619,7 @@ SetDictFromAny(
{
Tcl_HashEntry *hPtr;
int isNew;
Dict *dict = ckalloc(sizeof(Dict));
Dict *dict = (Dict *)ckalloc(sizeof(Dict));
InitChainTable(dict);
@@ -643,7 +644,7 @@ SetDictFromAny(
/* Store key and value in the hash table we're building. */
hPtr = CreateChainEntry(dict, objv[i], &isNew);
if (!isNew) {
Tcl_Obj *discardedValue = Tcl_GetHashValue(hPtr);
Tcl_Obj *discardedValue = (Tcl_Obj *)Tcl_GetHashValue(hPtr);
/*
* Not really a well-formed dictionary as there are duplicate
@@ -716,7 +717,7 @@ SetDictFromAny(
/* Store key and value in the hash table we're building. */
hPtr = CreateChainEntry(dict, keyPtr, &isNew);
if (!isNew) {
Tcl_Obj *discardedValue = Tcl_GetHashValue(hPtr);
Tcl_Obj *discardedValue = (Tcl_Obj *)Tcl_GetHashValue(hPtr);
TclDecrRefCount(keyPtr);
TclDecrRefCount(discardedValue);
@@ -851,7 +852,7 @@ TclTraceDictPath(
Tcl_IncrRefCount(tmpObj);
Tcl_SetHashValue(hPtr, tmpObj);
} else {
tmpObj = Tcl_GetHashValue(hPtr);
tmpObj = (Tcl_Obj *)Tcl_GetHashValue(hPtr);
DictGetIntRep(tmpObj, newDict);
@@ -972,7 +973,7 @@ Tcl_DictObjPut(
DictSetIntRep(dictPtr, dict);
Tcl_IncrRefCount(valuePtr);
if (!isNew) {
Tcl_Obj *oldValuePtr = Tcl_GetHashValue(hPtr);
Tcl_Obj *oldValuePtr = (Tcl_Obj *)Tcl_GetHashValue(hPtr);
TclDecrRefCount(oldValuePtr);
}
@@ -1021,7 +1022,7 @@ Tcl_DictObjGet(
if (hPtr == NULL) {
*valuePtrPtr = NULL;
} else {
*valuePtrPtr = Tcl_GetHashValue(hPtr);
*valuePtrPtr = (Tcl_Obj *)Tcl_GetHashValue(hPtr);
}
return TCL_OK;
}
@@ -1162,10 +1163,10 @@ Tcl_DictObjFirst(
searchPtr->next = cPtr->nextPtr;
dict->refCount++;
if (keyPtrPtr != NULL) {
*keyPtrPtr = Tcl_GetHashKey(&dict->table, &cPtr->entry);
*keyPtrPtr = (Tcl_Obj *)Tcl_GetHashKey(&dict->table, &cPtr->entry);
}
if (valuePtrPtr != NULL) {
*valuePtrPtr = Tcl_GetHashValue(&cPtr->entry);
*valuePtrPtr = (Tcl_Obj *)Tcl_GetHashValue(&cPtr->entry);
}
}
return TCL_OK;
@@ -1228,7 +1229,7 @@ Tcl_DictObjNext(
Tcl_Panic("concurrent dictionary modification and search");
}
cPtr = searchPtr->next;
cPtr = (ChainEntry *)searchPtr->next;
if (cPtr == NULL) {
Tcl_DictObjDone(searchPtr);
*donePtr = 1;
@@ -1238,11 +1239,11 @@ Tcl_DictObjNext(
searchPtr->next = cPtr->nextPtr;
*donePtr = 0;
if (keyPtrPtr != NULL) {
*keyPtrPtr = Tcl_GetHashKey(
*keyPtrPtr = (Tcl_Obj *)Tcl_GetHashKey(
&((Dict *)searchPtr->dictionaryPtr)->table, &cPtr->entry);
}
if (valuePtrPtr != NULL) {
*valuePtrPtr = Tcl_GetHashValue(&cPtr->entry);
*valuePtrPtr = (Tcl_Obj *)Tcl_GetHashValue(&cPtr->entry);
}
}
@@ -1329,7 +1330,7 @@ Tcl_DictObjPutKeyList(
hPtr = CreateChainEntry(dict, keyv[keyc-1], &isNew);
Tcl_IncrRefCount(valuePtr);
if (!isNew) {
Tcl_Obj *oldValuePtr = Tcl_GetHashValue(hPtr);
Tcl_Obj *oldValuePtr = (Tcl_Obj *)Tcl_GetHashValue(hPtr);
TclDecrRefCount(oldValuePtr);
}
@@ -1424,7 +1425,7 @@ Tcl_NewDictObj(void)
TclNewObj(dictPtr);
TclInvalidateStringRep(dictPtr);
dict = ckalloc(sizeof(Dict));
dict = (Dict *)ckalloc(sizeof(Dict));
InitChainTable(dict);
dict->epoch = 1;
dict->chain = NULL;
@@ -1472,7 +1473,7 @@ Tcl_DbNewDictObj(
TclDbNewObj(dictPtr, file, line);
TclInvalidateStringRep(dictPtr);
dict = ckalloc(sizeof(Dict));
dict = (Dict *)ckalloc(sizeof(Dict));
InitChainTable(dict);
dict->epoch = 1;
dict->chain = NULL;
@@ -1480,6 +1481,8 @@ Tcl_DbNewDictObj(
DictSetIntRep(dictPtr, dict);
return dictPtr;
#else /* !TCL_MEM_DEBUG */
(void)file;
(void)line;
return Tcl_NewDictObj();
#endif
}
@@ -1506,13 +1509,14 @@ Tcl_DbNewDictObj(
static int
DictCreateCmd(
ClientData dummy,
ClientData dummy, /* Not used. */
Tcl_Interp *interp,
int objc,
Tcl_Obj *const *objv)
{
Tcl_Obj *dictObj;
int i;
(void)dummy;
/*
* Must have an even number of arguments; note that number of preceding
@@ -1556,13 +1560,14 @@ DictCreateCmd(
static int
DictGetCmd(
ClientData dummy,
ClientData dummy, /* Not used. */
Tcl_Interp *interp,
int objc,
Tcl_Obj *const *objv)
{
Tcl_Obj *dictPtr, *valuePtr = NULL;
int result;
(void)dummy;
if (objc < 2) {
Tcl_WrongNumArgs(interp, 1, objv, "dictionary ?key ...?");
@@ -1649,7 +1654,7 @@ DictGetCmd(
static int
DictGetDefCmd(
ClientData dummy,
ClientData dummy, /* Not used. */
Tcl_Interp *interp,
int objc,
Tcl_Obj *const *objv)
@@ -1657,6 +1662,7 @@ DictGetDefCmd(
Tcl_Obj *dictPtr, *keyPtr, *valuePtr, *defaultPtr;
Tcl_Obj *const *keyPath;
int numKeys;
(void)dummy;
if (objc < 4) {
Tcl_WrongNumArgs(interp, 1, objv, "dictionary ?key ...? key default");
@@ -1714,13 +1720,14 @@ DictGetDefCmd(
static int
DictReplaceCmd(
ClientData dummy,
ClientData dummy, /* Not used. */
Tcl_Interp *interp,
int objc,
Tcl_Obj *const *objv)
{
Tcl_Obj *dictPtr;
int i;
(void)dummy;
if ((objc < 2) || (objc & 1)) {
Tcl_WrongNumArgs(interp, 1, objv, "dictionary ?key value ...?");
@@ -1762,13 +1769,14 @@ DictReplaceCmd(
static int
DictRemoveCmd(
ClientData dummy,
ClientData dummy, /* Not used. */
Tcl_Interp *interp,
int objc,
Tcl_Obj *const *objv)
{
Tcl_Obj *dictPtr;
int i;
(void)dummy;
if (objc < 2) {
Tcl_WrongNumArgs(interp, 1, objv, "dictionary ?key ...?");
@@ -1810,7 +1818,7 @@ DictRemoveCmd(
static int
DictMergeCmd(
ClientData dummy,
ClientData dummy, /* Not used. */
Tcl_Interp *interp,
int objc,
Tcl_Obj *const *objv)
@@ -1819,6 +1827,7 @@ DictMergeCmd(
int allocatedDict = 0;
int i, done;
Tcl_DictSearch search;
(void)dummy;
if (objc == 1) {
/*
@@ -1897,13 +1906,14 @@ DictMergeCmd(
static int
DictKeysCmd(
ClientData dummy,
ClientData dummy, /* Not used. */
Tcl_Interp *interp,
int objc,
Tcl_Obj *const *objv)
{
Tcl_Obj *listPtr;
const char *pattern = NULL;
(void)dummy;
if (objc!=2 && objc!=3) {
Tcl_WrongNumArgs(interp, 1, objv, "dictionary ?pattern?");
@@ -1976,7 +1986,7 @@ DictKeysCmd(
static int
DictValuesCmd(
ClientData dummy,
ClientData dummy, /* Not used. */
Tcl_Interp *interp,
int objc,
Tcl_Obj *const *objv)
@@ -1985,6 +1995,7 @@ DictValuesCmd(
Tcl_DictSearch search;
int done;
const char *pattern;
(void)dummy;
if (objc!=2 && objc!=3) {
Tcl_WrongNumArgs(interp, 1, objv, "dictionary ?pattern?");
@@ -2036,12 +2047,13 @@ DictValuesCmd(
static int
DictSizeCmd(
ClientData dummy,
ClientData dummy, /* Not used. */
Tcl_Interp *interp,
int objc,
Tcl_Obj *const *objv)
{
int result, size;
(void)dummy;
if (objc != 2) {
Tcl_WrongNumArgs(interp, 1, objv, "dictionary");
@@ -2074,12 +2086,13 @@ DictSizeCmd(
static int
DictExistsCmd(
ClientData dummy,
ClientData dummy, /* Not used. */
Tcl_Interp *interp,
int objc,
Tcl_Obj *const *objv)
{
Tcl_Obj *dictPtr, *valuePtr;
(void)dummy;
if (objc < 3) {
Tcl_WrongNumArgs(interp, 1, objv, "dictionary key ?key ...?");
@@ -2116,13 +2129,14 @@ DictExistsCmd(
static int
DictInfoCmd(
ClientData dummy,
ClientData dummy, /* Not used. */
Tcl_Interp *interp,
int objc,
Tcl_Obj *const *objv)
{
Dict *dict;
char *statsStr;
(void)dummy;
if (objc != 2) {
Tcl_WrongNumArgs(interp, 1, objv, "dictionary");
@@ -2160,13 +2174,14 @@ DictInfoCmd(
static int
DictIncrCmd(
ClientData dummy,
ClientData dummy, /* Not used. */
Tcl_Interp *interp,
int objc,
Tcl_Obj *const *objv)
{
int code = TCL_OK;
Tcl_Obj *dictPtr, *valuePtr = NULL;
(void)dummy;
if (objc < 3 || objc > 4) {
Tcl_WrongNumArgs(interp, 1, objv, "dictVarName key ?increment?");
@@ -2280,13 +2295,14 @@ DictIncrCmd(
static int
DictLappendCmd(
ClientData dummy,
ClientData dummy, /* Not used. */
Tcl_Interp *interp,
int objc,
Tcl_Obj *const *objv)
{
Tcl_Obj *dictPtr, *valuePtr, *resultPtr;
int i, allocatedDict = 0, allocatedValue = 0;
(void)dummy;
if (objc < 3) {
Tcl_WrongNumArgs(interp, 1, objv, "dictVarName key ?value ...?");
@@ -2367,13 +2383,14 @@ DictLappendCmd(
static int
DictAppendCmd(
ClientData dummy,
ClientData dummy, /* Not used. */
Tcl_Interp *interp,
int objc,
Tcl_Obj *const *objv)
{
Tcl_Obj *dictPtr, *valuePtr, *resultPtr;
int allocatedDict = 0;
(void)dummy;
if (objc < 3) {
Tcl_WrongNumArgs(interp, 1, objv, "dictVarName key ?value ...?");
@@ -2469,7 +2486,7 @@ DictAppendCmd(
static int
DictForNRCmd(
ClientData dummy,
ClientData dummy, /* Not used. */
Tcl_Interp *interp,
int objc,
Tcl_Obj *const *objv)
@@ -2479,6 +2496,7 @@ DictForNRCmd(
Tcl_Obj **varv, *keyObj, *valueObj;
Tcl_DictSearch *searchPtr;
int varc, done;
(void)dummy;
if (objc != 4) {
Tcl_WrongNumArgs(interp, 1, objv,
@@ -2499,7 +2517,7 @@ DictForNRCmd(
Tcl_SetErrorCode(interp, "TCL", "SYNTAX", "dict", "for", NULL);
return TCL_ERROR;
}
searchPtr = TclStackAlloc(interp, sizeof(Tcl_DictSearch));
searchPtr = (Tcl_DictSearch *)TclStackAlloc(interp, sizeof(Tcl_DictSearch));
if (Tcl_DictObjFirst(interp, objv[2], searchPtr, &keyObj, &valueObj,
&done) != TCL_OK) {
TclStackFree(interp, searchPtr);
@@ -2569,10 +2587,10 @@ DictForLoopCallback(
int result)
{
Interp *iPtr = (Interp *) interp;
Tcl_DictSearch *searchPtr = data[0];
Tcl_Obj *keyVarObj = data[1];
Tcl_Obj *valueVarObj = data[2];
Tcl_Obj *scriptObj = data[3];
Tcl_DictSearch *searchPtr = (Tcl_DictSearch *)data[0];
Tcl_Obj *keyVarObj = (Tcl_Obj *)data[1];
Tcl_Obj *valueVarObj = (Tcl_Obj *)data[2];
Tcl_Obj *scriptObj = (Tcl_Obj *)data[3];
Tcl_Obj *keyObj, *valueObj;
int done;
@@ -2664,7 +2682,7 @@ DictForLoopCallback(
static int
DictMapNRCmd(
ClientData dummy,
ClientData dummy, /* Not used. */
Tcl_Interp *interp,
int objc,
Tcl_Obj *const *objv)
@@ -2673,6 +2691,7 @@ DictMapNRCmd(
Tcl_Obj **varv, *keyObj, *valueObj;
DictMapStorage *storagePtr;
int varc, done;
(void)dummy;
if (objc != 4) {
Tcl_WrongNumArgs(interp, 1, objv,
@@ -2693,7 +2712,7 @@ DictMapNRCmd(
Tcl_SetErrorCode(interp, "TCL", "SYNTAX", "dict", "map", NULL);
return TCL_ERROR;
}
storagePtr = TclStackAlloc(interp, sizeof(DictMapStorage));
storagePtr = (DictMapStorage *)TclStackAlloc(interp, sizeof(DictMapStorage));
if (Tcl_DictObjFirst(interp, objv[2], &storagePtr->search, &keyObj,
&valueObj, &done) != TCL_OK) {
TclStackFree(interp, storagePtr);
@@ -2773,7 +2792,7 @@ DictMapLoopCallback(
int result)
{
Interp *iPtr = (Interp *) interp;
DictMapStorage *storagePtr = data[0];
DictMapStorage *storagePtr = (DictMapStorage *)data[0];
Tcl_Obj *keyObj, *valueObj;
int done;
@@ -2876,13 +2895,14 @@ DictMapLoopCallback(
static int
DictSetCmd(
ClientData dummy,
ClientData dummy, /* Not used. */
Tcl_Interp *interp,
int objc,
Tcl_Obj *const *objv)
{
Tcl_Obj *dictPtr, *resultPtr;
int result, allocatedDict = 0;
(void)dummy;
if (objc < 4) {
Tcl_WrongNumArgs(interp, 1, objv, "dictVarName key ?key ...? value");
@@ -2936,13 +2956,14 @@ DictSetCmd(
static int
DictUnsetCmd(
ClientData dummy,
ClientData dummy, /* Not used. */
Tcl_Interp *interp,
int objc,
Tcl_Obj *const *objv)
{
Tcl_Obj *dictPtr, *resultPtr;
int result, allocatedDict = 0;
(void)dummy;
if (objc < 3) {
Tcl_WrongNumArgs(interp, 1, objv, "dictVarName key ?key ...?");
@@ -2995,7 +3016,7 @@ DictUnsetCmd(
static int
DictFilterCmd(
ClientData dummy,
ClientData dummy, /* Not used. */
Tcl_Interp *interp,
int objc,
Tcl_Obj *const *objv)
@@ -3012,6 +3033,7 @@ DictFilterCmd(
Tcl_DictSearch search;
int index, varc, done, result, satisfied;
const char *pattern;
(void)dummy;
if (objc < 3) {
Tcl_WrongNumArgs(interp, 1, objv, "dictionary filterType ?arg ...?");
@@ -3288,6 +3310,7 @@ DictUpdateCmd(
Interp *iPtr = (Interp *) interp;
Tcl_Obj *dictPtr, *objPtr;
int i, dummy;
(void)clientData;
if (objc < 5 || !(objc & 1)) {
Tcl_WrongNumArgs(interp, 1, objv,
@@ -3341,8 +3364,8 @@ FinalizeDictUpdate(
Tcl_Obj *dictPtr, *objPtr, **objv;
Tcl_InterpState state;
int i, objc;
Tcl_Obj *varName = data[0];
Tcl_Obj *argsObj = data[1];
Tcl_Obj *varName = (Tcl_Obj *)data[0];
Tcl_Obj *argsObj = (Tcl_Obj *)data[1];
/*
* ErrorInfo handling.
@@ -3438,13 +3461,14 @@ FinalizeDictUpdate(
static int
DictWithCmd(
ClientData dummy,
ClientData dummy, /* Not used. */
Tcl_Interp *interp,
int objc,
Tcl_Obj *const *objv)
{
Interp *iPtr = (Interp *) interp;
Tcl_Obj *dictPtr, *keysPtr, *pathPtr;
(void)dummy;
if (objc < 3) {
Tcl_WrongNumArgs(interp, 1, objv, "dictVarName ?key ...? script");
@@ -3492,9 +3516,9 @@ FinalizeDictWith(
Tcl_Obj **pathv;
int pathc;
Tcl_InterpState state;
Tcl_Obj *varName = data[0];
Tcl_Obj *keysPtr = data[1];
Tcl_Obj *pathPtr = data[2];
Tcl_Obj *varName = (Tcl_Obj *)data[0];
Tcl_Obj *keysPtr = (Tcl_Obj *)data[1];
Tcl_Obj *pathPtr = (Tcl_Obj *)data[2];
Var *varPtr, *arrayPtr;
if (result == TCL_ERROR) {
+7 -9
View File
@@ -23,8 +23,7 @@
static Tcl_Obj * DisassembleByteCodeAsDicts(Tcl_Interp *interp,
Tcl_Obj *objPtr);
static Tcl_Obj * DisassembleByteCodeObj(Tcl_Interp *interp,
Tcl_Obj *objPtr);
static Tcl_Obj * DisassembleByteCodeObj(Tcl_Obj *objPtr);
static int FormatInstruction(ByteCode *codePtr,
const unsigned char *pc, Tcl_Obj *bufferObj);
static void GetLocationInformation(Proc *procPtr,
@@ -135,7 +134,7 @@ TclPrintByteCodeObj(
Tcl_Interp *interp, /* Used only for getting location info. */
Tcl_Obj *objPtr) /* The bytecode object to disassemble. */
{
Tcl_Obj *bufPtr = DisassembleByteCodeObj(interp, objPtr);
Tcl_Obj *bufPtr = DisassembleByteCodeObj(objPtr);
fprintf(stdout, "\n%s", TclGetString(bufPtr));
Tcl_DecrRefCount(bufPtr);
@@ -251,7 +250,6 @@ TclPrintSource(
static Tcl_Obj *
DisassembleByteCodeObj(
Tcl_Interp *interp,
Tcl_Obj *objPtr) /* The bytecode object to disassemble. */
{
ByteCode *codePtr;
@@ -903,7 +901,7 @@ PrintSourceToObj(
i += 2;
continue;
default:
#if TCL_UTF_MAX > 4
#if TCL_UTF_MAX > 3
if (ch > 0xffff) {
Tcl_AppendPrintfToObj(appendObj, "\\U%08x", ch);
i += 10;
@@ -952,8 +950,7 @@ PrintSourceToObj(
static Tcl_Obj *
DisassembleByteCodeAsDicts(
Tcl_Interp *interp, /* Used for looking up the CmdFrame for the
* procedure, if one exists. */
Tcl_Interp *dummy, /* Not used. */
Tcl_Obj *objPtr) /* The bytecode-holding value to take apart */
{
ByteCode *codePtr;
@@ -962,6 +959,7 @@ DisassembleByteCodeAsDicts(
unsigned char *pc, *opnd, *codeOffPtr, *codeLenPtr, *srcOffPtr, *srcLenPtr;
int codeOffset, codeLength, sourceOffset, sourceLength;
int i, val, line;
(void)dummy;
ByteCodeGetIntRep(objPtr, &tclByteCodeType, codePtr);
@@ -1577,7 +1575,7 @@ Tcl_DisassembleObjCmd(
TclGetString(objv[3]), NULL);
return TCL_ERROR;
}
procPtr = TclOOGetProcFromMethod(Tcl_GetHashValue(hPtr));
procPtr = TclOOGetProcFromMethod((Method *)Tcl_GetHashValue(hPtr));
if (procPtr == NULL) {
Tcl_SetObjResult(interp, Tcl_NewStringObj(
"body not available for this kind of method", -1));
@@ -1627,7 +1625,7 @@ Tcl_DisassembleObjCmd(
DisassembleByteCodeAsDicts(interp, codeObjPtr));
} else {
Tcl_SetObjResult(interp,
DisassembleByteCodeObj(interp, codeObjPtr));
DisassembleByteCodeObj(codeObjPtr));
}
return TCL_OK;
}
+60 -48
View File
@@ -296,7 +296,7 @@ static const Tcl_ObjType encodingType = {
do { \
const Tcl_ObjIntRep *irPtr; \
irPtr = TclFetchIntRep ((objPtr), &encodingType); \
(encoding) = irPtr ? irPtr->twoPtrValue.ptr1 : NULL; \
(encoding) = irPtr ? (Tcl_Encoding)irPtr->twoPtrValue.ptr1 : NULL; \
} while (0)
@@ -622,13 +622,13 @@ TclInitEncodingSubsystem(void)
type.freeProc = NULL;
type.nullSize = 2;
type.encodingName = "utf-16le";
type.clientData = INT2PTR(1);;
type.clientData = INT2PTR(1);
Tcl_CreateEncoding(&type);
type.encodingName = "utf-16be";
type.clientData = INT2PTR(0);
Tcl_CreateEncoding(&type);
type.encodingName = "utf-16";
type.clientData = INT2PTR(isLe.c);;
type.clientData = INT2PTR(isLe.c);
Tcl_CreateEncoding(&type);
#ifndef TCL_NO_DEPRECATED
@@ -643,14 +643,14 @@ TclInitEncodingSubsystem(void)
* code to duplicate the structure of a table encoding here.
*/
dataPtr = ckalloc(sizeof(TableEncodingData));
dataPtr = (TableEncodingData *)ckalloc(sizeof(TableEncodingData));
memset(dataPtr, 0, sizeof(TableEncodingData));
dataPtr->fallback = '?';
size = 256*(sizeof(unsigned short *) + sizeof(unsigned short));
dataPtr->toUnicode = ckalloc(size);
dataPtr->toUnicode = (unsigned short **)ckalloc(size);
memset(dataPtr->toUnicode, 0, size);
dataPtr->fromUnicode = ckalloc(size);
dataPtr->fromUnicode = (unsigned short **)ckalloc(size);
memset(dataPtr->fromUnicode, 0, size);
dataPtr->toUnicode[0] = (unsigned short *) (dataPtr->toUnicode + 256);
@@ -716,7 +716,7 @@ TclFinalizeEncodingSubsystem(void)
* cleaned up.
*/
FreeEncoding(Tcl_GetHashValue(hPtr));
FreeEncoding((Tcl_Encoding)Tcl_GetHashValue(hPtr));
hPtr = Tcl_FirstHashEntry(&encodingTable, &search);
}
@@ -827,7 +827,7 @@ Tcl_GetEncoding(
hPtr = Tcl_FindHashEntry(&encodingTable, name);
if (hPtr != NULL) {
encodingPtr = Tcl_GetHashValue(hPtr);
encodingPtr = (Encoding *)Tcl_GetHashValue(hPtr);
encodingPtr->refCount++;
Tcl_MutexUnlock(&encodingMutex);
return (Tcl_Encoding) encodingPtr;
@@ -972,7 +972,7 @@ Tcl_GetEncodingNames(
Tcl_MutexLock(&encodingMutex);
for (hPtr = Tcl_FirstHashEntry(&encodingTable, &search); hPtr != NULL;
hPtr = Tcl_NextHashEntry(&search)) {
Encoding *encodingPtr = Tcl_GetHashValue(hPtr);
Encoding *encodingPtr = (Encoding *)Tcl_GetHashValue(hPtr);
Tcl_CreateHashEntry(&table,
Tcl_NewStringObj(encodingPtr->name, -1), &dummy);
@@ -1089,7 +1089,7 @@ Tcl_CreateEncoding(
const Tcl_EncodingType *typePtr)
/* The encoding type. */
{
Encoding *encodingPtr = ckalloc(sizeof(Encoding));
Encoding *encodingPtr = (Encoding *)ckalloc(sizeof(Encoding));
encodingPtr->name = NULL;
encodingPtr->toUtfProc = typePtr->toUtfProc;
encodingPtr->fromUtfProc = typePtr->fromUtfProc;
@@ -1117,11 +1117,11 @@ Tcl_CreateEncoding(
* reference goes away.
*/
Encoding *replaceMe = Tcl_GetHashValue(hPtr);
Encoding *replaceMe = (Encoding *)Tcl_GetHashValue(hPtr);
replaceMe->hPtr = NULL;
}
name = ckalloc(strlen(typePtr->encodingName) + 1);
name = (char *)ckalloc(strlen(typePtr->encodingName) + 1);
encodingPtr->name = strcpy(name, typePtr->encodingName);
encodingPtr->hPtr = hPtr;
Tcl_SetHashValue(hPtr, encodingPtr);
@@ -1226,7 +1226,7 @@ Tcl_ExternalToUtfDString(
int
Tcl_ExternalToUtf(
Tcl_Interp *interp, /* Interp for error return, if not NULL. */
Tcl_Interp *dummy, /* Interp for error return, if not NULL. */
Tcl_Encoding encoding, /* The encoding for the source string, or NULL
* for the default system encoding. */
const char *src, /* Source string in specified encoding. */
@@ -1260,6 +1260,7 @@ Tcl_ExternalToUtf(
int charLimited = (flags & TCL_ENCODING_CHAR_LIMIT) && dstCharsPtr;
int maxChars = INT_MAX;
Tcl_EncodingState state;
(void)dummy;
if (encoding == NULL) {
encoding = systemEncoding;
@@ -1417,7 +1418,7 @@ Tcl_UtfToExternalDString(
int
Tcl_UtfToExternal(
Tcl_Interp *interp, /* Interp for error return, if not NULL. */
Tcl_Interp *dummy, /* Interp for error return, if not NULL. */
Tcl_Encoding encoding, /* The encoding for the converted string, or
* NULL for the default system encoding. */
const char *src, /* Source string in UTF-8. */
@@ -1448,6 +1449,7 @@ Tcl_UtfToExternal(
const Encoding *encodingPtr;
int result, srcRead, dstWrote, dstChars;
Tcl_EncodingState state;
(void)dummy;
if (encoding == NULL) {
encoding = systemEncoding;
@@ -1721,7 +1723,7 @@ LoadEncodingFile(
* not be created because the file contained invalid data.
*
* Side effects:
* See Tcl_CreateEncoding().
* See Tcl_CreateEncoding().
*
*-------------------------------------------------------------------------
*/
@@ -1788,7 +1790,7 @@ LoadTableEncoding(
#undef PAGESIZE
#define PAGESIZE (256 * sizeof(unsigned short))
dataPtr = ckalloc(sizeof(TableEncodingData));
dataPtr = (TableEncodingData *)ckalloc(sizeof(TableEncodingData));
memset(dataPtr, 0, sizeof(TableEncodingData));
dataPtr->fallback = fallback;
@@ -1800,7 +1802,7 @@ LoadTableEncoding(
*/
size = 256 * sizeof(unsigned short *) + numPages * PAGESIZE;
dataPtr->toUnicode = ckalloc(size);
dataPtr->toUnicode = (unsigned short **)ckalloc(size);
memset(dataPtr->toUnicode, 0, size);
pageMemPtr = (unsigned short *) (dataPtr->toUnicode + 256);
@@ -1861,7 +1863,7 @@ LoadTableEncoding(
}
}
size = 256 * sizeof(unsigned short *) + numPages * PAGESIZE;
dataPtr->fromUnicode = ckalloc(size);
dataPtr->fromUnicode = (unsigned short **)ckalloc(size);
memset(dataPtr->fromUnicode, 0, size);
pageMemPtr = (unsigned short *) (dataPtr->fromUnicode + 256);
@@ -1893,8 +1895,8 @@ LoadTableEncoding(
*/
if (dataPtr->fromUnicode[0] != NULL) {
if (dataPtr->fromUnicode[0]['\\'] == '\0') {
dataPtr->fromUnicode[0]['\\'] = '\\';
if (dataPtr->fromUnicode[0][(int)'\\'] == '\0') {
dataPtr->fromUnicode[0][(int)'\\'] = '\\';
}
}
}
@@ -2099,7 +2101,7 @@ LoadEscapeEncoding(
size = sizeof(EscapeEncodingData) - sizeof(EscapeSubTable)
+ Tcl_DStringLength(&escapeData);
dataPtr = ckalloc(size);
dataPtr = (EscapeEncodingData *)ckalloc(size);
dataPtr->initLen = strlen(init);
memcpy(dataPtr->init, init, dataPtr->initLen + 1);
dataPtr->finalLen = strlen(final);
@@ -2178,6 +2180,8 @@ BinaryProc(
* output buffer. */
{
int result;
(void)clientData;
(void)statePtr;
result = TCL_OK;
dstLen -= TCL_UTF_MAX - 1;
@@ -2349,6 +2353,7 @@ UtfToUtfProc(
const char *dstStart, *dstEnd;
int result, numChars, charLimit = INT_MAX;
Tcl_UniChar *chPtr = (Tcl_UniChar *) statePtr;
(void)clientData;
if (flags & TCL_ENCODING_START) {
*statePtr = 0;
@@ -2409,18 +2414,19 @@ UtfToUtfProc(
dst += Tcl_UniCharToUtf(*chPtr, dst);
} else {
src += TclUtfToUniChar(src, chPtr);
if ((*chPtr & 0xFC00) == 0xD800) {
/* A high surrogate character is detected, handle especially */
if ((*chPtr | 0x7FF) == 0xDFFF) {
/* A surrogate character is detected, handle especially */
Tcl_UniChar low = *chPtr;
if (src <= srcEnd-3) {
Tcl_UtfToUniChar(src, &low);
}
if ((low & 0xFC00) != 0xDC00) {
size_t len = (src <= srcEnd-3) ? Tcl_UtfToUniChar(src, &low) : 0;
if (((low | 0x3FF) != 0xDFFF) || (*chPtr & 0x400)) {
*dst++ = (char) (((*chPtr >> 12) | 0xE0) & 0xEF);
*dst++ = (char) (((*chPtr >> 6) | 0x80) & 0xBF);
*dst++ = (char) ((*chPtr | 0x80) & 0xBF);
continue;
}
src += len;
dst += Tcl_UniCharToUtf(*chPtr, dst);
*chPtr = low;
}
dst += Tcl_UniCharToUtf(*chPtr, dst);
}
@@ -2479,6 +2485,7 @@ Utf16ToUtfProc(
const char *dstEnd, *dstStart;
int result, numChars, charLimit = INT_MAX;
unsigned short ch;
(void)statePtr;
if (flags & TCL_ENCODING_CHAR_LIMIT) {
charLimit = *dstCharsPtr;
@@ -2614,7 +2621,7 @@ UtfToUtf16Proc(
*/
if (clientData) {
#if TCL_UTF_MAX > 4
#if TCL_UTF_MAX > 3
if (*chPtr <= 0xFFFF) {
*dst++ = (*chPtr & 0xFF);
*dst++ = (*chPtr >> 8);
@@ -2629,7 +2636,7 @@ UtfToUtf16Proc(
*dst++ = (*chPtr >> 8);
#endif
} else {
#if TCL_UTF_MAX > 4
#if TCL_UTF_MAX > 3
if (*chPtr <= 0xFFFF) {
*dst++ = (*chPtr >> 8);
*dst++ = (*chPtr & 0xFF);
@@ -2696,10 +2703,11 @@ UtfToUcs2Proc(
{
const char *srcStart, *srcEnd, *srcClose, *dstStart, *dstEnd;
int result, numChars;
#if TCL_UTF_MAX <= 4
#if TCL_UTF_MAX <= 3
int len;
#endif
Tcl_UniChar ch = 0;
(void)statePtr;
srcStart = src;
srcEnd = src + srcLen;
@@ -2726,7 +2734,7 @@ UtfToUcs2Proc(
result = TCL_CONVERT_NOSPACE;
break;
}
#if TCL_UTF_MAX <= 4
#if TCL_UTF_MAX <= 3
src += (len = TclUtfToUniChar(src, &ch));
if ((ch >= 0xD800) && (len < 3)) {
src += TclUtfToUniChar(src, &ch);
@@ -2809,7 +2817,8 @@ TableToUtfProc(
Tcl_UniChar ch = 0;
const unsigned short *const *toUnicode;
const unsigned short *pageZero;
TableEncodingData *dataPtr = clientData;
TableEncodingData *dataPtr = (TableEncodingData *)clientData;
(void)statePtr;
if (flags & TCL_ENCODING_CHAR_LIMIT) {
charLimit = *dstCharsPtr;
@@ -2920,8 +2929,9 @@ TableFromUtfProc(
const char *dstStart, *dstEnd, *prefixBytes;
Tcl_UniChar ch = 0;
int result, len, word, numChars;
TableEncodingData *dataPtr = clientData;
TableEncodingData *dataPtr = (TableEncodingData *)clientData;
const unsigned short *const *fromUnicode;
(void)statePtr;
result = TCL_OK;
@@ -2950,7 +2960,7 @@ TableFromUtfProc(
}
len = TclUtfToUniChar(src, &ch);
#if TCL_UTF_MAX > 4
#if TCL_UTF_MAX > 3
/*
* This prevents a crash condition. More evaluation is required for
* full support of int Tcl_UniChar. [Bug 1004065]
@@ -3044,6 +3054,8 @@ Iso88591ToUtfProc(
const char *srcStart, *srcEnd;
const char *dstEnd, *dstStart;
int result, numChars, charLimit = INT_MAX;
(void)clientData;
(void)statePtr;
if (flags & TCL_ENCODING_CHAR_LIMIT) {
charLimit = *dstCharsPtr;
@@ -3127,10 +3139,10 @@ Iso88591FromUtfProc(
{
const char *srcStart, *srcEnd, *srcClose;
const char *dstStart, *dstEnd;
int result, numChars;
int result = TCL_OK, numChars;
Tcl_UniChar ch = 0;
result = TCL_OK;
(void)clientData;
(void)statePtr;
srcStart = src;
srcEnd = src + srcLen;
@@ -3161,7 +3173,7 @@ Iso88591FromUtfProc(
*/
if (ch > 0xff
#if TCL_UTF_MAX <= 4
#if TCL_UTF_MAX <= 3
|| ((ch >= 0xD800) && (len < 3))
#endif
) {
@@ -3169,7 +3181,7 @@ Iso88591FromUtfProc(
result = TCL_CONVERT_UNKNOWN;
break;
}
#if TCL_UTF_MAX <= 4
#if TCL_UTF_MAX <= 3
if ((ch >= 0xD800) && (len < 3)) len = 4;
#endif
/*
@@ -3215,7 +3227,7 @@ TableFreeProc(
ClientData clientData) /* TableEncodingData that specifies
* encoding. */
{
TableEncodingData *dataPtr = clientData;
TableEncodingData *dataPtr = (TableEncodingData *)clientData;
/*
* Make sure we aren't freeing twice on shutdown. [Bug 219314]
@@ -3273,7 +3285,7 @@ EscapeToUtfProc(
* correspond to the bytes stored in the
* output buffer. */
{
EscapeEncodingData *dataPtr = clientData;
EscapeEncodingData *dataPtr = (EscapeEncodingData *)clientData;
const char *prefixBytes, *tablePrefixBytes, *srcStart, *srcEnd;
const unsigned short *const *tableToUnicode;
const Encoding *encodingPtr;
@@ -3409,7 +3421,7 @@ EscapeToUtfProc(
TableEncodingData *tableDataPtr;
encodingPtr = GetTableEncoding(dataPtr, state);
tableDataPtr = encodingPtr->clientData;
tableDataPtr = (TableEncodingData *)encodingPtr->clientData;
tablePrefixBytes = tableDataPtr->prefixBytes;
tableToUnicode = (const unsigned short *const*)
tableDataPtr->toUnicode;
@@ -3487,7 +3499,7 @@ EscapeFromUtfProc(
* correspond to the bytes stored in the
* output buffer. */
{
EscapeEncodingData *dataPtr = clientData;
EscapeEncodingData *dataPtr = (EscapeEncodingData *)clientData;
const Encoding *encodingPtr;
const char *srcStart, *srcEnd, *srcClose;
const char *dstStart, *dstEnd;
@@ -3528,7 +3540,7 @@ EscapeFromUtfProc(
}
encodingPtr = GetTableEncoding(dataPtr, state);
tableDataPtr = encodingPtr->clientData;
tableDataPtr = (const TableEncodingData *)encodingPtr->clientData;
tablePrefixBytes = tableDataPtr->prefixBytes;
tableFromUnicode = (const unsigned short *const *)
tableDataPtr->fromUnicode;
@@ -3556,7 +3568,7 @@ EscapeFromUtfProc(
oldState = state;
for (state = 0; state < dataPtr->numSubTables; state++) {
encodingPtr = GetTableEncoding(dataPtr, state);
tableDataPtr = encodingPtr->clientData;
tableDataPtr = (const TableEncodingData *)encodingPtr->clientData;
word = tableDataPtr->fromUnicode[(ch >> 8)][ch & 0xff];
if (word != 0) {
break;
@@ -3570,7 +3582,7 @@ EscapeFromUtfProc(
break;
}
encodingPtr = GetTableEncoding(dataPtr, state);
tableDataPtr = encodingPtr->clientData;
tableDataPtr = (const TableEncodingData *)encodingPtr->clientData;
word = tableDataPtr->fallback;
}
@@ -3676,7 +3688,7 @@ EscapeFreeProc(
ClientData clientData) /* EscapeEncodingData that specifies
* encoding. */
{
EscapeEncodingData *dataPtr = clientData;
EscapeEncodingData *dataPtr = (EscapeEncodingData *)clientData;
EscapeSubTable *subTablePtr;
int i;
@@ -3841,7 +3853,7 @@ InitializeEncodingSearchPath(
bytes = TclGetString(searchPathObj);
*lengthPtr = searchPathObj->length;
*valuePtr = ckalloc(*lengthPtr + 1);
*valuePtr = (char *)ckalloc(*lengthPtr + 1);
memcpy(*valuePtr, bytes, *lengthPtr + 1);
Tcl_DecrRefCount(searchPathObj);
}
+32 -29
View File
@@ -96,7 +96,7 @@ static const Tcl_ObjType ensembleCmdType = {
do { \
const Tcl_ObjIntRep *irPtr; \
irPtr = TclFetchIntRep((objPtr), &ensembleCmdType); \
(ecRepPtr) = irPtr ? irPtr->twoPtrValue.ptr1 : NULL; \
(ecRepPtr) = irPtr ? (EnsembleCmdRep *)irPtr->twoPtrValue.ptr1 : NULL; \
} while (0)
/*
@@ -151,7 +151,7 @@ NewNsObj(
int
TclNamespaceEnsembleCmd(
ClientData dummy,
ClientData dummy, /* Not used. */
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
@@ -164,6 +164,7 @@ TclNamespaceEnsembleCmd(
Tcl_Obj *listObj;
const char *simpleName;
int index, done;
(void)dummy;
if (nsPtr == NULL || nsPtr->flags & NS_DYING) {
if (!Tcl_InterpDeleted(interp)) {
@@ -675,7 +676,7 @@ TclCreateEnsembleInNs(
EnsembleConfig *ensemblePtr;
Tcl_Command token;
ensemblePtr = ckalloc(sizeof(EnsembleConfig));
ensemblePtr = (EnsembleConfig *)ckalloc(sizeof(EnsembleConfig));
token = TclNRCreateCommandInNs(interp, name,
(Tcl_Namespace *) nameNsPtr, TclEnsembleImplementationCmd,
NsEnsembleImplementationCmdNR, ensemblePtr, DeleteEnsembleConfig);
@@ -798,7 +799,7 @@ Tcl_SetEnsembleSubcommandList(
}
}
ensemblePtr = cmdPtr->objClientData;
ensemblePtr = (EnsembleConfig *)cmdPtr->objClientData;
oldList = ensemblePtr->subcmdList;
ensemblePtr->subcmdList = subcmdList;
if (subcmdList != NULL) {
@@ -874,7 +875,7 @@ Tcl_SetEnsembleParameterList(
}
}
ensemblePtr = cmdPtr->objClientData;
ensemblePtr = (EnsembleConfig *)cmdPtr->objClientData;
oldList = ensemblePtr->parameterList;
ensemblePtr->parameterList = paramList;
if (paramList != NULL) {
@@ -974,7 +975,7 @@ Tcl_SetEnsembleMappingDict(
}
}
ensemblePtr = cmdPtr->objClientData;
ensemblePtr = (EnsembleConfig *)cmdPtr->objClientData;
oldDict = ensemblePtr->subcommandDict;
ensemblePtr->subcommandDict = mapDict;
if (mapDict != NULL) {
@@ -1049,7 +1050,7 @@ Tcl_SetEnsembleUnknownHandler(
}
}
ensemblePtr = cmdPtr->objClientData;
ensemblePtr = (EnsembleConfig *)cmdPtr->objClientData;
oldList = ensemblePtr->unknownHandler;
ensemblePtr->unknownHandler = unknownList;
if (unknownList != NULL) {
@@ -1105,7 +1106,7 @@ Tcl_SetEnsembleFlags(
return TCL_ERROR;
}
ensemblePtr = cmdPtr->objClientData;
ensemblePtr = (EnsembleConfig *)cmdPtr->objClientData;
wasCompiled = ensemblePtr->flags & ENSEMBLE_COMPILE;
/*
@@ -1183,7 +1184,7 @@ Tcl_GetEnsembleSubcommandList(
return TCL_ERROR;
}
ensemblePtr = cmdPtr->objClientData;
ensemblePtr = (EnsembleConfig *)cmdPtr->objClientData;
*subcmdListPtr = ensemblePtr->subcmdList;
return TCL_OK;
}
@@ -1225,7 +1226,7 @@ Tcl_GetEnsembleParameterList(
return TCL_ERROR;
}
ensemblePtr = cmdPtr->objClientData;
ensemblePtr = (EnsembleConfig *)cmdPtr->objClientData;
*paramListPtr = ensemblePtr->parameterList;
return TCL_OK;
}
@@ -1267,7 +1268,7 @@ Tcl_GetEnsembleMappingDict(
return TCL_ERROR;
}
ensemblePtr = cmdPtr->objClientData;
ensemblePtr = (EnsembleConfig *)cmdPtr->objClientData;
*mapDictPtr = ensemblePtr->subcommandDict;
return TCL_OK;
}
@@ -1308,7 +1309,7 @@ Tcl_GetEnsembleUnknownHandler(
return TCL_ERROR;
}
ensemblePtr = cmdPtr->objClientData;
ensemblePtr = (EnsembleConfig *)cmdPtr->objClientData;
*unknownListPtr = ensemblePtr->unknownHandler;
return TCL_OK;
}
@@ -1349,7 +1350,7 @@ Tcl_GetEnsembleFlags(
return TCL_ERROR;
}
ensemblePtr = cmdPtr->objClientData;
ensemblePtr = (EnsembleConfig *)cmdPtr->objClientData;
*flagsPtr = ensemblePtr->flags;
return TCL_OK;
}
@@ -1390,7 +1391,7 @@ Tcl_GetEnsembleNamespace(
return TCL_ERROR;
}
ensemblePtr = cmdPtr->objClientData;
ensemblePtr = (EnsembleConfig *)cmdPtr->objClientData;
*namespacePtrPtr = (Tcl_Namespace *) ensemblePtr->nsPtr;
return TCL_OK;
}
@@ -1690,7 +1691,7 @@ NsEnsembleImplementationCmdNR(
int objc,
Tcl_Obj *const objv[])
{
EnsembleConfig *ensemblePtr = clientData;
EnsembleConfig *ensemblePtr = (EnsembleConfig *)clientData;
/* The ensemble itself. */
Tcl_Obj *prefixObj; /* An object containing the prefix words of
* the command that implements the
@@ -1763,7 +1764,7 @@ NsEnsembleImplementationCmdNR(
if (ensembleCmd) {
if (ensembleCmd->epoch == ensemblePtr->epoch &&
ensembleCmd->token == (Command *)ensemblePtr->token) {
prefixObj = Tcl_GetHashValue(ensembleCmd->hPtr);
prefixObj = (Tcl_Obj *)Tcl_GetHashValue(ensembleCmd->hPtr);
Tcl_IncrRefCount(prefixObj);
if (ensembleCmd->fix) {
TclSpellFix(interp, objv, objc, subIdx, subObj, ensembleCmd->fix);
@@ -1866,7 +1867,7 @@ NsEnsembleImplementationCmdNR(
TclSpellFix(interp, objv, objc, subIdx, subObj, fix);
}
prefixObj = Tcl_GetHashValue(hPtr);
prefixObj = (Tcl_Obj *)Tcl_GetHashValue(hPtr);
Tcl_IncrRefCount(prefixObj);
runResultingSubcommand:
@@ -1987,10 +1988,11 @@ NsEnsembleImplementationCmdNR(
int
TclClearRootEnsemble(
ClientData data[],
ClientData dummy[],
Tcl_Interp *interp,
int result)
{
(void)dummy;
TclResetRewriteEnsemble(interp, 1);
return result;
}
@@ -2094,11 +2096,12 @@ TclResetRewriteEnsemble(
static int
FreeER(
ClientData data[],
Tcl_Interp *interp,
Tcl_Interp *dummy,
int result)
{
Tcl_Obj **tmp = (Tcl_Obj **) data[0];
Tcl_Obj **store = (Tcl_Obj **) data[1];
(void)dummy;
ckfree(store);
ckfree(tmp);
@@ -2176,9 +2179,9 @@ TclSpellFix(
if (search[0] == NULL) {
store = (Tcl_Obj **) search[2];
} else {
Tcl_Obj **tmp = ckalloc(3 * sizeof(Tcl_Obj *));
Tcl_Obj **tmp = (Tcl_Obj **)ckalloc(3 * sizeof(Tcl_Obj *));
store = ckalloc(size * sizeof(Tcl_Obj *));
store = (Tcl_Obj **)ckalloc(size * sizeof(Tcl_Obj *));
memcpy(store, iPtr->ensembleRewrite.sourceObjs,
size * sizeof(Tcl_Obj *));
@@ -2418,7 +2421,7 @@ MakeCachedEnsembleCommand(
* our own.
*/
ensembleCmd = ckalloc(sizeof(EnsembleCmdRep));
ensembleCmd = (EnsembleCmdRep *)ckalloc(sizeof(EnsembleCmdRep));
ECRSetIntRep(objPtr, ensembleCmd);
}
@@ -2467,7 +2470,7 @@ ClearTable(
Tcl_HashEntry *hPtr = Tcl_FirstHashEntry(hash, &search);
while (hPtr != NULL) {
Tcl_Obj *prefixObj = Tcl_GetHashValue(hPtr);
Tcl_Obj *prefixObj = (Tcl_Obj *)Tcl_GetHashValue(hPtr);
Tcl_DecrRefCount(prefixObj);
hPtr = Tcl_NextHashEntry(&search);
}
@@ -2480,7 +2483,7 @@ static void
DeleteEnsembleConfig(
ClientData clientData)
{
EnsembleConfig *ensemblePtr = clientData;
EnsembleConfig *ensemblePtr = (EnsembleConfig *)clientData;
Namespace *nsPtr = ensemblePtr->nsPtr;
/*
@@ -2691,7 +2694,7 @@ BuildEnsembleConfig(
hPtr = Tcl_FirstHashEntry(&ensemblePtr->nsPtr->cmdTable, &search);
for (; hPtr!= NULL ; hPtr=Tcl_NextHashEntry(&search)) {
char *nsCmdName = /* Name of command in namespace. */
Tcl_GetHashKey(&ensemblePtr->nsPtr->cmdTable, hPtr);
(char *)Tcl_GetHashKey(&ensemblePtr->nsPtr->cmdTable, hPtr);
for (i=0 ; i<ensemblePtr->nsPtr->numExportPatterns ; i++) {
if (Tcl_StringMatch(nsCmdName,
@@ -2740,7 +2743,7 @@ BuildEnsembleConfig(
*/
ensemblePtr->subcommandArrayPtr =
ckalloc(sizeof(char *) * hash->numEntries);
(char **)ckalloc(sizeof(char *) * hash->numEntries);
/*
* Fill array from both ends as this makes us less likely to end up with
@@ -2764,12 +2767,12 @@ BuildEnsembleConfig(
j = hash->numEntries;
hPtr = Tcl_FirstHashEntry(hash, &search);
while (hPtr != NULL) {
ensemblePtr->subcommandArrayPtr[i++] = Tcl_GetHashKey(hash, hPtr);
ensemblePtr->subcommandArrayPtr[i++] = (char *)Tcl_GetHashKey(hash, hPtr);
hPtr = Tcl_NextHashEntry(&search);
if (hPtr == NULL) {
break;
}
ensemblePtr->subcommandArrayPtr[--j] = Tcl_GetHashKey(hash, hPtr);
ensemblePtr->subcommandArrayPtr[--j] = (char *)Tcl_GetHashKey(hash, hPtr);
hPtr = Tcl_NextHashEntry(&search);
}
if (hash->numEntries > 1) {
@@ -2861,7 +2864,7 @@ DupEnsembleCmdRep(
Tcl_Obj *copyPtr)
{
EnsembleCmdRep *ensembleCmd;
EnsembleCmdRep *ensembleCopy = ckalloc(sizeof(EnsembleCmdRep));
EnsembleCmdRep *ensembleCopy = (EnsembleCmdRep *)ckalloc(sizeof(EnsembleCmdRep));
ECRGetIntRep(objPtr, ensembleCmd);
ECRSetIntRep(copyPtr, ensembleCopy);
+12 -11
View File
@@ -123,7 +123,7 @@ TclSetupEnv(
char *p2;
p1 = Tcl_ExternalToUtfDString(NULL, environ[i], -1, &envString);
p2 = strchr(p1, '=');
p2 = (char *)strchr(p1, '=');
if (p2 == NULL) {
/*
* This condition seem to happen occasionally under some
@@ -172,7 +172,7 @@ TclSetupEnv(
for (hPtr=Tcl_FirstHashEntry(&namesHash, &search); hPtr!=NULL;
hPtr=Tcl_NextHashEntry(&search)) {
Tcl_Obj *elemName = Tcl_GetHashValue(hPtr);
Tcl_Obj *elemName = (Tcl_Obj *)Tcl_GetHashValue(hPtr);
TclObjUnsetVar2(interp, varNamePtr, elemName, TCL_GLOBAL_ONLY);
}
@@ -239,7 +239,7 @@ TclSetEnv(
*/
if ((env.ourEnviron != environ) || (length+2 > env.ourEnvironSize)) {
char **newEnviron = ckalloc((length + 5) * sizeof(char *));
char **newEnviron = (char **)ckalloc((length + 5) * sizeof(char *));
memcpy(newEnviron, environ, length * sizeof(char *));
if ((env.ourEnvironSize != 0) && (env.ourEnviron != NULL)) {
@@ -283,7 +283,7 @@ TclSetEnv(
*/
valueLength = strlen(value);
p = ckalloc(nameLength + valueLength + 2);
p = (char *)ckalloc(nameLength + valueLength + 2);
memcpy(p, name, nameLength);
p[nameLength] = '=';
memcpy(p+nameLength+1, value, valueLength+1);
@@ -293,7 +293,7 @@ TclSetEnv(
* Copy the native string to heap memory.
*/
p = ckrealloc(p, Tcl_DStringLength(&envString) + 1);
p = (char *)ckrealloc(p, Tcl_DStringLength(&envString) + 1);
memcpy(p, p2, Tcl_DStringLength(&envString) + 1);
Tcl_DStringFree(&envString);
@@ -379,7 +379,7 @@ Tcl_PutEnv(
*/
name = Tcl_ExternalToUtfDString(NULL, assignment, -1, &nameString);
value = strchr(name, '=');
value = (char *)strchr(name, '=');
if ((value != NULL) && (value != name)) {
value[0] = '\0';
@@ -454,18 +454,18 @@ TclUnsetEnv(
*/
#if defined(_WIN32)
string = ckalloc(length + 2);
string = (char *)ckalloc(length + 2);
memcpy(string, name, length);
string[length] = '=';
string[length+1] = '\0';
#else
string = ckalloc(length + 1);
string = (char *)ckalloc(length + 1);
memcpy(string, name, length);
string[length] = '\0';
#endif /* _WIN32 */
Tcl_UtfToExternalDString(NULL, string, -1, &envString);
string = ckrealloc(string, Tcl_DStringLength(&envString) + 1);
string = (char *)ckrealloc(string, Tcl_DStringLength(&envString) + 1);
memcpy(string, Tcl_DStringValue(&envString),
Tcl_DStringLength(&envString)+1);
Tcl_DStringFree(&envString);
@@ -579,7 +579,7 @@ TclGetEnv(
/* ARGSUSED */
static char *
EnvTraceProc(
ClientData clientData, /* Not used. */
ClientData dummy, /* Not used. */
Tcl_Interp *interp, /* Interpreter whose "env" variable is being
* modified. */
const char *name1, /* Better be "env". */
@@ -587,6 +587,7 @@ EnvTraceProc(
* whole array is being deleted (UTF-8). */
int flags) /* Indicates what's happening. */
{
(void)dummy;
/*
* For array traces, let TclSetupEnv do all the work.
*/
@@ -701,7 +702,7 @@ ReplaceString(
const int growth = 5;
env.cache = ckrealloc(env.cache,
env.cache = (char **)ckrealloc(env.cache,
(env.cacheSize + growth) * sizeof(char *));
env.cache[env.cacheSize] = newStr;
(void) memset(env.cache+env.cacheSize+1, 0,
+45 -40
View File
@@ -55,7 +55,7 @@ typedef struct {
typedef struct ExitHandler {
Tcl_ExitProc *proc; /* Function to call when process exits. */
ClientData 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;
@@ -103,19 +103,19 @@ static Tcl_ThreadDataKey dataKey;
#if TCL_THREADS
typedef struct {
Tcl_ThreadCreateProc *proc; /* Main() function of the thread */
ClientData clientData; /* The one argument to Main() */
void *clientData; /* The one argument to Main() */
} ThreadClientData;
static Tcl_ThreadCreateType NewThreadProc(ClientData clientData);
static Tcl_ThreadCreateType NewThreadProc(void *clientData);
#endif /* TCL_THREADS */
/*
* Prototypes for functions referenced only in this file:
*/
static void BgErrorDeleteProc(ClientData clientData,
static void BgErrorDeleteProc(void *clientData,
Tcl_Interp *interp);
static void HandleBgErrors(ClientData clientData);
static char * VwaitVarProc(ClientData clientData,
static void HandleBgErrors(void *clientData);
static char * VwaitVarProc(void *clientData,
Tcl_Interp *interp, const char *name1,
const char *name2, int flags);
static void InvokeExitHandlers(void);
@@ -163,7 +163,7 @@ Tcl_BackgroundException(
return;
}
errPtr = ckalloc(sizeof(BgError));
errPtr = (BgError*)ckalloc(sizeof(BgError));
errPtr->errorMsg = Tcl_GetObjResult(interp);
Tcl_IncrRefCount(errPtr->errorMsg);
errPtr->returnOpts = Tcl_GetReturnOptions(interp, code);
@@ -171,7 +171,7 @@ Tcl_BackgroundException(
errPtr->nextPtr = NULL;
(void) TclGetBgErrorHandler(interp);
assocPtr = Tcl_GetAssocData(interp, "tclBgError", NULL);
assocPtr = (ErrAssocData *)Tcl_GetAssocData(interp, "tclBgError", NULL);
if (assocPtr->firstBgPtr == NULL) {
assocPtr->firstBgPtr = errPtr;
Tcl_DoWhenIdle(HandleBgErrors, assocPtr);
@@ -201,9 +201,9 @@ Tcl_BackgroundException(
static void
HandleBgErrors(
ClientData clientData) /* Pointer to ErrAssocData structure. */
void *clientData) /* Pointer to ErrAssocData structure. */
{
ErrAssocData *assocPtr = clientData;
ErrAssocData *assocPtr = (ErrAssocData *)clientData;
Tcl_Interp *interp = assocPtr->interp;
BgError *errPtr;
@@ -230,7 +230,7 @@ HandleBgErrors(
errPtr = assocPtr->firstBgPtr;
Tcl_ListObjGetElements(NULL, copyObj, &prefixObjc, &prefixObjv);
tempObjv = ckalloc((prefixObjc+2) * sizeof(Tcl_Obj *));
tempObjv = (Tcl_Obj**)ckalloc((prefixObjc+2) * sizeof(Tcl_Obj *));
memcpy(tempObjv, prefixObjv, prefixObjc*sizeof(Tcl_Obj *));
tempObjv[prefixObjc] = errPtr->errorMsg;
tempObjv[prefixObjc+1] = errPtr->returnOpts;
@@ -311,7 +311,7 @@ HandleBgErrors(
int
TclDefaultBgErrorHandlerObjCmd(
ClientData dummy, /* Not used. */
void *dummy, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
@@ -320,6 +320,7 @@ TclDefaultBgErrorHandlerObjCmd(
Tcl_Obj *tempObjv[2];
int result, code, level;
Tcl_InterpState saved;
(void)dummy;
if (objc != 3) {
Tcl_WrongNumArgs(interp, 1, objv, "msg options");
@@ -518,7 +519,7 @@ TclSetBgErrorHandler(
Tcl_Interp *interp,
Tcl_Obj *cmdPrefix)
{
ErrAssocData *assocPtr = Tcl_GetAssocData(interp, "tclBgError", NULL);
ErrAssocData *assocPtr = (ErrAssocData *)Tcl_GetAssocData(interp, "tclBgError", NULL);
if (cmdPrefix == NULL) {
Tcl_Panic("TclSetBgErrorHandler: NULL cmdPrefix argument");
@@ -528,7 +529,7 @@ TclSetBgErrorHandler(
* First access: initialize.
*/
assocPtr = ckalloc(sizeof(ErrAssocData));
assocPtr = (ErrAssocData*)ckalloc(sizeof(ErrAssocData));
assocPtr->interp = interp;
assocPtr->cmdPrefix = NULL;
assocPtr->firstBgPtr = NULL;
@@ -563,14 +564,14 @@ Tcl_Obj *
TclGetBgErrorHandler(
Tcl_Interp *interp)
{
ErrAssocData *assocPtr = Tcl_GetAssocData(interp, "tclBgError", NULL);
ErrAssocData *assocPtr = (ErrAssocData *)Tcl_GetAssocData(interp, "tclBgError", NULL);
if (assocPtr == NULL) {
Tcl_Obj *bgerrorObj;
TclNewLiteralStringObj(bgerrorObj, "::tcl::Bgerror");
TclSetBgErrorHandler(interp, bgerrorObj);
assocPtr = Tcl_GetAssocData(interp, "tclBgError", NULL);
assocPtr = (ErrAssocData *)Tcl_GetAssocData(interp, "tclBgError", NULL);
}
return assocPtr->cmdPrefix;
}
@@ -596,11 +597,12 @@ TclGetBgErrorHandler(
static void
BgErrorDeleteProc(
ClientData clientData, /* Pointer to ErrAssocData structure. */
Tcl_Interp *interp) /* Interpreter being deleted. */
void *clientData, /* Pointer to ErrAssocData structure. */
Tcl_Interp *dummy) /* Interpreter being deleted. */
{
ErrAssocData *assocPtr = clientData;
ErrAssocData *assocPtr = (ErrAssocData *)clientData;
BgError *errPtr;
(void)dummy;
while (assocPtr->firstBgPtr != NULL) {
errPtr = assocPtr->firstBgPtr;
@@ -635,9 +637,9 @@ BgErrorDeleteProc(
void
Tcl_CreateExitHandler(
Tcl_ExitProc *proc, /* Function to invoke. */
ClientData clientData) /* Arbitrary value to pass to proc. */
void *clientData) /* Arbitrary value to pass to proc. */
{
ExitHandler *exitPtr = ckalloc(sizeof(ExitHandler));
ExitHandler *exitPtr = (ExitHandler*)ckalloc(sizeof(ExitHandler));
exitPtr->proc = proc;
exitPtr->clientData = clientData;
@@ -668,9 +670,9 @@ Tcl_CreateExitHandler(
void
TclCreateLateExitHandler(
Tcl_ExitProc *proc, /* Function to invoke. */
ClientData clientData) /* Arbitrary value to pass to proc. */
void *clientData) /* Arbitrary value to pass to proc. */
{
ExitHandler *exitPtr = ckalloc(sizeof(ExitHandler));
ExitHandler *exitPtr = (ExitHandler*)ckalloc(sizeof(ExitHandler));
exitPtr->proc = proc;
exitPtr->clientData = clientData;
@@ -701,7 +703,7 @@ TclCreateLateExitHandler(
void
Tcl_DeleteExitHandler(
Tcl_ExitProc *proc, /* Function that was previously registered. */
ClientData clientData) /* Arbitrary value to pass to proc. */
void *clientData) /* Arbitrary value to pass to proc. */
{
ExitHandler *exitPtr, *prevPtr;
@@ -744,7 +746,7 @@ Tcl_DeleteExitHandler(
void
TclDeleteLateExitHandler(
Tcl_ExitProc *proc, /* Function that was previously registered. */
ClientData clientData) /* Arbitrary value to pass to proc. */
void *clientData) /* Arbitrary value to pass to proc. */
{
ExitHandler *exitPtr, *prevPtr;
@@ -787,12 +789,12 @@ TclDeleteLateExitHandler(
void
Tcl_CreateThreadExitHandler(
Tcl_ExitProc *proc, /* Function to invoke. */
ClientData clientData) /* Arbitrary value to pass to proc. */
void *clientData) /* Arbitrary value to pass to proc. */
{
ExitHandler *exitPtr;
ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey);
exitPtr = ckalloc(sizeof(ExitHandler));
exitPtr = (ExitHandler*)ckalloc(sizeof(ExitHandler));
exitPtr->proc = proc;
exitPtr->clientData = clientData;
exitPtr->nextPtr = tsdPtr->firstExitPtr;
@@ -820,7 +822,7 @@ Tcl_CreateThreadExitHandler(
void
Tcl_DeleteThreadExitHandler(
Tcl_ExitProc *proc, /* Function that was previously registered. */
ClientData clientData) /* Arbitrary value to pass to proc. */
void *clientData) /* Arbitrary value to pass to proc. */
{
ExitHandler *exitPtr, *prevPtr;
ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey);
@@ -1296,7 +1298,7 @@ FinalizeThread(
* initialized already.
*/
tsdPtr = TclThreadDataKeyGet(&dataKey);
tsdPtr = (ThreadSpecificData*)TclThreadDataKeyGet(&dataKey);
if (tsdPtr != NULL) {
tsdPtr->inExit = 1;
@@ -1371,7 +1373,7 @@ TclInExit(void)
int
TclInThreadExit(void)
{
ThreadSpecificData *tsdPtr = TclThreadDataKeyGet(&dataKey);
ThreadSpecificData *tsdPtr = (ThreadSpecificData *)TclThreadDataKeyGet(&dataKey);
if (tsdPtr == NULL) {
return 0;
@@ -1399,13 +1401,14 @@ TclInThreadExit(void)
/* ARGSUSED */
int
Tcl_VwaitObjCmd(
ClientData clientData, /* Not used. */
void *dummy, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
{
int done, foundEvent;
const char *nameString;
(void)dummy;
if (objc != 2) {
Tcl_WrongNumArgs(interp, 1, objv, "name");
@@ -1463,16 +1466,17 @@ Tcl_VwaitObjCmd(
/* ARGSUSED */
static char *
VwaitVarProc(
ClientData clientData, /* Pointer to integer to set to 1. */
void *clientData, /* Pointer to integer to set to 1. */
Tcl_Interp *interp, /* Interpreter containing variable. */
const char *name1, /* Name of variable. */
const char *name2, /* Second part of variable name. */
int flags) /* Information about what happened. */
{
int *donePtr = clientData;
int *donePtr = (int *)clientData;
(void)flags;
*donePtr = 1;
Tcl_UntraceVar(interp, name1, TCL_TRACE_WRITES|TCL_TRACE_UNSETS,
Tcl_UntraceVar2(interp, name1, name2, TCL_TRACE_WRITES|TCL_TRACE_UNSETS,
VwaitVarProc, clientData);
return NULL;
}
@@ -1497,7 +1501,7 @@ VwaitVarProc(
/* ARGSUSED */
int
Tcl_UpdateObjCmd(
ClientData clientData, /* Not used. */
void *dummy, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
@@ -1506,6 +1510,7 @@ Tcl_UpdateObjCmd(
int flags = 0; /* Initialized to avoid compiler warning. */
static const char *const updateOptions[] = {"idletasks", NULL};
enum updateOptions {OPT_IDLETASKS};
(void)dummy;
if (objc == 1) {
flags = TCL_ALL_EVENTS|TCL_DONT_WAIT;
@@ -1565,10 +1570,10 @@ Tcl_UpdateObjCmd(
static Tcl_ThreadCreateType
NewThreadProc(
ClientData clientData)
void *clientData)
{
ThreadClientData *cdPtr = clientData;
ClientData threadClientData;
ThreadClientData *cdPtr = (ThreadClientData *)clientData;
void *threadClientData;
Tcl_ThreadCreateProc *threadProc;
threadProc = cdPtr->proc;
@@ -1604,13 +1609,13 @@ int
Tcl_CreateThread(
Tcl_ThreadId *idPtr, /* Return, the ID of the thread */
Tcl_ThreadCreateProc *proc, /* Main() function of the thread */
ClientData clientData, /* The one argument to Main() */
void *clientData, /* The one argument to Main() */
int stackSize, /* Size of stack for the new thread */
int flags) /* Flags controlling behaviour of the new
* thread. */
{
#if TCL_THREADS
ThreadClientData *cdPtr = ckalloc(sizeof(ThreadClientData));
ThreadClientData *cdPtr = (ThreadClientData *)ckalloc(sizeof(ThreadClientData));
int result;
cdPtr->proc = proc;
+214 -101
View File
@@ -18,7 +18,7 @@
#include "tclInt.h"
#include "tclCompile.h"
#include "tclOOInt.h"
#include "tommath.h"
#include "tclTomMath.h"
#include <math.h>
#include <assert.h>
@@ -202,7 +202,7 @@ typedef struct TEBCdata {
#define POP_TAUX_OBJ() \
do { \
tmpPtr = auxObjList; \
auxObjList = tmpPtr->internalRep.twoPtrValue.ptr1; \
auxObjList = (Tcl_Obj *)tmpPtr->internalRep.twoPtrValue.ptr1; \
Tcl_DecrRefCount(tmpPtr); \
} while (0)
@@ -317,12 +317,16 @@ VarHashCreateVar(
switch (*pc) { \
case INST_JUMP_FALSE1: \
NEXT_INST_F(((condition)? 2 : TclGetInt1AtPtr(pc+1)), (cleanup), 0); \
break; \
case INST_JUMP_TRUE1: \
NEXT_INST_F(((condition)? TclGetInt1AtPtr(pc+1) : 2), (cleanup), 0); \
break; \
case INST_JUMP_FALSE4: \
NEXT_INST_F(((condition)? 5 : TclGetInt4AtPtr(pc+1)), (cleanup), 0); \
break; \
case INST_JUMP_TRUE4: \
NEXT_INST_F(((condition)? TclGetInt4AtPtr(pc+1) : 5), (cleanup), 0); \
break; \
default: \
if ((condition) < 0) { \
TclNewIntObj(objResultPtr, -1); \
@@ -330,6 +334,7 @@ VarHashCreateVar(
objResultPtr = TCONST((condition) > 0); \
} \
NEXT_INST_F(0, (cleanup), 1); \
break; \
} \
} while (0)
#define JUMP_PEEPHOLE_V(condition, pcAdjustment, cleanup) \
@@ -338,12 +343,16 @@ VarHashCreateVar(
switch (*pc) { \
case INST_JUMP_FALSE1: \
NEXT_INST_V(((condition)? 2 : TclGetInt1AtPtr(pc+1)), (cleanup), 0); \
break; \
case INST_JUMP_TRUE1: \
NEXT_INST_V(((condition)? TclGetInt1AtPtr(pc+1) : 2), (cleanup), 0); \
break; \
case INST_JUMP_FALSE4: \
NEXT_INST_V(((condition)? 5 : TclGetInt4AtPtr(pc+1)), (cleanup), 0); \
break; \
case INST_JUMP_TRUE4: \
NEXT_INST_V(((condition)? TclGetInt4AtPtr(pc+1) : 5), (cleanup), 0); \
break; \
default: \
if ((condition) < 0) { \
TclNewIntObj(objResultPtr, -1); \
@@ -351,6 +360,7 @@ VarHashCreateVar(
objResultPtr = TCONST((condition) > 0); \
} \
NEXT_INST_V(0, (cleanup), 1); \
break; \
} \
} while (0)
#else /* TCL_COMPILE_DEBUG */
@@ -652,6 +662,7 @@ static const size_t Exp64ValueSize = sizeof(Exp64Value) / sizeof(Tcl_WideInt);
#define DIVIDED_BY_ZERO ((Tcl_Obj *) -1)
#define EXPONENT_OF_ZERO ((Tcl_Obj *) -2)
#define GENERAL_ARITHMETIC_ERROR ((Tcl_Obj *) -3)
#define OUT_OF_MEMORY ((Tcl_Obj *) -4)
/*
* Declarations for local procedures to this file:
@@ -758,11 +769,11 @@ ReleaseDictIterator(
* that we were holding.
*/
searchPtr = irPtr->twoPtrValue.ptr1;
searchPtr = (Tcl_DictSearch *)irPtr->twoPtrValue.ptr1;
Tcl_DictObjDone(searchPtr);
ckfree(searchPtr);
dictPtr = irPtr->twoPtrValue.ptr2;
dictPtr = (Tcl_Obj *)irPtr->twoPtrValue.ptr2;
TclDecrRefCount(dictPtr);
}
@@ -794,12 +805,14 @@ InitByteCodeExecution(
* instruction tracing. */
{
#ifdef TCL_COMPILE_DEBUG
if (Tcl_LinkVar(interp, "tcl_traceExec", (char *) &tclTraceExec,
if (Tcl_LinkVar(interp, "tcl_traceExec", &tclTraceExec,
TCL_LINK_INT) != TCL_OK) {
Tcl_Panic("InitByteCodeExecution: can't create link for tcl_traceExec variable");
}
#endif
#ifdef TCL_COMPILE_STATS
#ifndef TCL_COMPILE_STATS
(void)interp;
#else
Tcl_CreateObjCommand(interp, "evalstats", EvalStatsCmd, NULL, NULL);
#endif /* TCL_COMPILE_STATS */
}
@@ -833,8 +846,8 @@ TclCreateExecEnv(
int size) /* The initial stack size, in number of words
* [sizeof(Tcl_Obj*)] */
{
ExecEnv *eePtr = ckalloc(sizeof(ExecEnv));
ExecStack *esPtr = ckalloc(sizeof(ExecStack)
ExecEnv *eePtr = (ExecEnv *)ckalloc(sizeof(ExecEnv));
ExecStack *esPtr = (ExecStack *)ckalloc(sizeof(ExecStack)
+ (size_t) (size-1) * sizeof(Tcl_Obj *));
eePtr->execStackPtr = esPtr;
@@ -1103,7 +1116,7 @@ GrowEvaluationStack(
newBytes = sizeof(ExecStack) + (newElems-1) * sizeof(Tcl_Obj *);
oldPtr = esPtr;
esPtr = ckalloc(newBytes);
esPtr = (ExecStack *)ckalloc(newBytes);
oldPtr->nextPtr = esPtr;
esPtr->prevPtr = oldPtr;
@@ -1345,11 +1358,13 @@ Tcl_ExprObj(
static int
CopyCallback(
ClientData data[],
Tcl_Interp *interp,
Tcl_Interp *dummy,
int result)
{
Tcl_Obj **resultPtrPtr = data[0];
Tcl_Obj *resultPtr = data[1];
Tcl_Obj **resultPtrPtr = (Tcl_Obj **)data[0];
Tcl_Obj *resultPtr = (Tcl_Obj *)data[1];
(void)dummy;
(void)dummy;
if (result == TCL_OK) {
*resultPtrPtr = resultPtr;
@@ -1406,8 +1421,8 @@ ExprObjCallback(
Tcl_Interp *interp,
int result)
{
Tcl_InterpState state = data[0];
Tcl_Obj *resultPtr = data[1];
Tcl_InterpState state = (Tcl_InterpState)data[0];
Tcl_Obj *resultPtr = (Tcl_Obj *)data[1];
if (result == TCL_OK) {
TclSetDuplicateObj(resultPtr, Tcl_GetObjResult(interp));
@@ -1543,6 +1558,8 @@ DupExprCodeInternalRep(
Tcl_Obj *srcPtr,
Tcl_Obj *copyPtr)
{
(void)srcPtr;
(void)copyPtr;
return;
}
@@ -1693,9 +1710,9 @@ TclCompileObj(
return codePtr;
}
eclPtr = Tcl_GetHashValue(hePtr);
eclPtr = (ExtCmdLoc *)Tcl_GetHashValue(hePtr);
redo = 0;
ctxCopyPtr = TclStackAlloc(interp, sizeof(CmdFrame));
ctxCopyPtr = (CmdFrame *)TclStackAlloc(interp, sizeof(CmdFrame));
*ctxCopyPtr = *invoker;
if (invoker->type == TCL_LOCATION_BC) {
@@ -1791,6 +1808,7 @@ TclIncrObj(
ClientData ptr1, ptr2;
int type1, type2;
mp_int value, incr;
mp_err err;
if (Tcl_IsShared(valuePtr)) {
Tcl_Panic("%s called with shared object", "TclIncrObj");
@@ -1849,8 +1867,11 @@ TclIncrObj(
Tcl_TakeBignumFromObj(interp, valuePtr, &value);
Tcl_GetBignumFromObj(interp, incrPtr, &incr);
mp_add(&value, &incr, &value);
err = mp_add(&value, &incr, &value);
mp_clear(&incr);
if (err != MP_OKAY) {
return TCL_ERROR;
}
Tcl_SetBignumObj(valuePtr, &value);
return TCL_OK;
}
@@ -2046,7 +2067,7 @@ TEBCresume(
* used too frequently
*/
TEBCdata *TD = data[0];
TEBCdata *TD = (TEBCdata *)data[0];
#define auxObjList (TD->auxObjList)
#define catchTop (TD->catchTop)
#define codePtr (TD->codePtr)
@@ -2058,7 +2079,7 @@ TEBCresume(
Tcl_Obj **tosPtr; /* Cached pointer to top of evaluation
* stack. */
const unsigned char *pc = data[1];
const unsigned char *pc = (const unsigned char *)data[1];
/* The current program counter. */
unsigned char inst; /* The currently running instruction */
@@ -2571,23 +2592,27 @@ TEBCresume(
objResultPtr = codePtr->objArrayPtr[TclGetUInt4AtPtr(pc+1)];
TRACE_WITH_OBJ(("%u => ", TclGetUInt4AtPtr(pc+1)), objResultPtr);
NEXT_INST_F(5, 0, 1);
break;
case INST_POP:
TRACE_WITH_OBJ(("=> discarding "), OBJ_AT_TOS);
objPtr = POP_OBJECT();
TclDecrRefCount(objPtr);
NEXT_INST_F(1, 0, 0);
break;
case INST_DUP:
objResultPtr = OBJ_AT_TOS;
TRACE_WITH_OBJ(("=> "), objResultPtr);
NEXT_INST_F(1, 0, 1);
break;
case INST_OVER:
opnd = TclGetUInt4AtPtr(pc+1);
objResultPtr = OBJ_AT_DEPTH(opnd);
TRACE_WITH_OBJ(("%u => ", opnd), objResultPtr);
NEXT_INST_F(5, 0, 1);
break;
case INST_REVERSE: {
Tcl_Obj **a, **b;
@@ -2604,6 +2629,7 @@ TEBCresume(
TRACE(("%u => OK\n", opnd));
NEXT_INST_F(5, 0, 0);
}
break;
case INST_STR_CONCAT1:
@@ -2617,6 +2643,7 @@ TEBCresume(
TRACE_WITH_OBJ(("%u => ", opnd), objResultPtr);
NEXT_INST_V(2, opnd, 1);
break;
case INST_CONCAT_STK:
/*
@@ -2628,6 +2655,7 @@ TEBCresume(
objResultPtr = Tcl_ConcatObj(opnd, &OBJ_AT_DEPTH(opnd-1));
TRACE_WITH_OBJ(("%u => ", opnd), objResultPtr);
NEXT_INST_V(5, opnd, 1);
break;
case INST_EXPAND_START:
/*
@@ -2649,6 +2677,7 @@ TEBCresume(
PUSH_TAUX_OBJ(objPtr);
TRACE(("=> mark depth as %d\n", (int) CURR_DEPTH));
NEXT_INST_F(1, 0, 0);
break;
case INST_EXPAND_DROP:
/*
@@ -2727,6 +2756,7 @@ TEBCresume(
Tcl_DecrRefCount(objPtr);
NEXT_INST_F(5, 0, 0);
}
break;
case INST_EXPR_STK: {
ByteCode *newCodePtr;
@@ -2774,6 +2804,7 @@ TEBCresume(
TclNewObj(objResultPtr);
NEXT_INST_F(1, 0, 1);
break;
case INST_INVOKE_STK4:
objc = TclGetUInt4AtPtr(pc+1);
@@ -4025,6 +4056,7 @@ TEBCresume(
}
NEXT_INST_F(5, 0, 0);
}
break;
/*
* End of INST_UNSET instructions.
@@ -4242,6 +4274,7 @@ TEBCresume(
TRACE_APPEND(("link made\n"));
NEXT_INST_F(5, 1, 0);
}
break;
/*
* End of variable linking instructions.
@@ -4253,6 +4286,7 @@ TEBCresume(
TRACE(("%d => new pc %u\n", opnd,
(unsigned)(pc + opnd - codePtr->codeStart)));
NEXT_INST_F(opnd, 0, 0);
break;
case INST_JUMP4:
opnd = TclGetInt4AtPtr(pc+1);
@@ -4315,6 +4349,7 @@ TEBCresume(
#endif
NEXT_INST_F(jmpOffset[b], 1, 0);
}
break;
case INST_JUMP_TABLE: {
Tcl_HashEntry *hPtr;
@@ -4340,6 +4375,7 @@ TEBCresume(
NEXT_INST_F(5, 1, 0);
}
}
break;
/*
* These two instructions are now redundant: the complete logic of the LOR
@@ -4384,6 +4420,7 @@ TEBCresume(
TRACE(("%.20s %.20s => %d\n", O2S(valuePtr),O2S(value2Ptr),iResult));
NEXT_INST_F(1, 2, 1);
}
break;
/*
* -----------------------------------------------------------------
@@ -4402,6 +4439,7 @@ TEBCresume(
TRACE_WITH_OBJ(("=> "), objResultPtr);
NEXT_INST_F(1, 0, 1);
}
break;
case INST_COROUTINE_NAME: {
CoroutineData *corPtr = iPtr->execEnvPtr->corPtr;
@@ -4413,10 +4451,12 @@ TEBCresume(
TRACE_WITH_OBJ(("=> "), objResultPtr);
NEXT_INST_F(1, 0, 1);
}
break;
case INST_INFO_LEVEL_NUM:
TclNewIntObj(objResultPtr, iPtr->varFramePtr->level);
TRACE_WITH_OBJ(("=> "), objResultPtr);
NEXT_INST_F(1, 0, 1);
break;
case INST_INFO_LEVEL_ARGS: {
int level;
CallFrame *framePtr = iPtr->varFramePtr;
@@ -4507,7 +4547,7 @@ TEBCresume(
CACHE_STACK_INFO();
goto gotError;
}
contextPtr = framePtr->clientData;
contextPtr = (CallContext *)framePtr->clientData;
/*
* Call out to get the name; it's expensive to compute but cached.
@@ -4535,7 +4575,7 @@ TEBCresume(
CACHE_STACK_INFO();
goto gotError;
}
contextPtr = framePtr->clientData;
contextPtr = (CallContext *)framePtr->clientData;
oPtr = (Object *) Tcl_GetObjectFromObj(interp, valuePtr);
if (oPtr == NULL) {
@@ -4634,7 +4674,7 @@ TEBCresume(
CACHE_STACK_INFO();
goto gotError;
}
contextPtr = framePtr->clientData;
contextPtr = (CallContext *)framePtr->clientData;
newDepth = contextPtr->index + 1;
if (newDepth >= contextPtr->callPtr->numChain) {
@@ -5838,6 +5878,7 @@ TEBCresume(
wResult = w1 - w2*wResult;
goto wideResultOfArithmetic;
}
break;
case INST_RSHIFT:
if (w2 < 0) {
@@ -5886,6 +5927,7 @@ TEBCresume(
wResult = w1 >> ((int) w2);
goto wideResultOfArithmetic;
}
break;
case INST_LSHIFT:
if (w2 < 0) {
@@ -6075,6 +6117,7 @@ TEBCresume(
TclSetIntObj(valuePtr, wResult);
TRACE(("%s\n", O2S(valuePtr)));
NEXT_INST_F(1, 1, 0);
break;
case INST_DIV:
if (w2 == 0) {
@@ -6132,6 +6175,9 @@ TEBCresume(
} else if (objResultPtr == GENERAL_ARITHMETIC_ERROR) {
TRACE_ERROR(interp);
goto gotError;
} else if (objResultPtr == OUT_OF_MEMORY) {
TRACE_APPEND(("OUT OF MEMORY\n"));
goto outOfMemory;
} else if (objResultPtr == NULL) {
TRACE_APPEND(("%s\n", O2S(valuePtr)));
NEXT_INST_F(1, 1, 0);
@@ -6214,6 +6260,7 @@ TEBCresume(
/* -NaN => NaN */
TRACE_APPEND(("%s\n", O2S(valuePtr)));
NEXT_INST_F(1, 0, 0);
break;
case TCL_NUMBER_INT:
w1 = *((const Tcl_WideInt *) ptr1);
if (w1 != WIDE_MIN) {
@@ -6322,6 +6369,7 @@ TEBCresume(
TRACE_APPEND(("numeric, same Tcl_Obj\n"));
NEXT_INST_F(1, 0, 0);
}
break;
/*
* End of numeric operator instructions.
@@ -6338,6 +6386,7 @@ TEBCresume(
}
TRACE_WITH_OBJ(("\"%.30s\" => ", O2S(valuePtr)), objResultPtr);
NEXT_INST_F(1, 0, 1);
break;
case INST_BREAK:
/*
@@ -6378,7 +6427,7 @@ TEBCresume(
*/
opnd = TclGetUInt4AtPtr(pc+1);
infoPtr = codePtr->auxDataArrayPtr[opnd].clientData;
infoPtr = (ForeachInfo *)codePtr->auxDataArrayPtr[opnd].clientData;
iterTmpIndex = infoPtr->loopCtTemp;
iterVarPtr = LOCAL(iterTmpIndex);
oldValuePtr = iterVarPtr->value.objPtr;
@@ -6412,7 +6461,7 @@ TEBCresume(
opnd = TclGetUInt4AtPtr(pc+1);
TRACE(("%u => ", opnd));
infoPtr = codePtr->auxDataArrayPtr[opnd].clientData;
infoPtr = (ForeachInfo *)codePtr->auxDataArrayPtr[opnd].clientData;
numLists = infoPtr->numLists;
/*
@@ -6542,7 +6591,7 @@ TEBCresume(
*/
opnd = TclGetUInt4AtPtr(pc+1);
infoPtr = codePtr->auxDataArrayPtr[opnd].clientData;
infoPtr = (ForeachInfo *)codePtr->auxDataArrayPtr[opnd].clientData;
numLists = infoPtr->numLists;
TRACE(("%u => ", opnd));
@@ -6610,7 +6659,7 @@ TEBCresume(
*/
tmpPtr = OBJ_AT_TOS;
infoPtr = tmpPtr->internalRep.twoPtrValue.ptr1;
infoPtr = (ForeachInfo *)tmpPtr->internalRep.twoPtrValue.ptr1;
numLists = infoPtr->numLists;
TRACE(("=> "));
@@ -6694,7 +6743,7 @@ TEBCresume(
case INST_FOREACH_END:
/* THIS INSTRUCTION IS ONLY CALLED AS A BREAK TARGET */
tmpPtr = OBJ_AT_TOS;
infoPtr = tmpPtr->internalRep.twoPtrValue.ptr1;
infoPtr = (ForeachInfo *)tmpPtr->internalRep.twoPtrValue.ptr1;
numLists = infoPtr->numLists;
TRACE(("=> loop terminated\n"));
NEXT_INST_V(1, numLists+2, 0);
@@ -6711,7 +6760,7 @@ TEBCresume(
*/
tmpPtr = OBJ_AT_DEPTH(1);
infoPtr = tmpPtr->internalRep.twoPtrValue.ptr1;
infoPtr = (ForeachInfo *)tmpPtr->internalRep.twoPtrValue.ptr1;
numLists = infoPtr->numLists;
TRACE_APPEND(("=> appending to list at depth %d\n", 3 + numLists));
@@ -6719,6 +6768,7 @@ TEBCresume(
Tcl_ListObjAppendElement(NULL, objPtr, OBJ_AT_TOS);
NEXT_INST_F(1, 1, 0);
}
break;
case INST_BEGIN_CATCH4:
/*
@@ -6732,6 +6782,7 @@ TEBCresume(
TclGetUInt4AtPtr(pc+1), (int) (catchTop - initCatchTop - 1),
(int) CURR_DEPTH));
NEXT_INST_F(5, 0, 0);
break;
case INST_END_CATCH:
catchTop--;
@@ -6741,6 +6792,7 @@ TEBCresume(
result = TCL_OK;
TRACE(("=> catchTop=%d\n", (int) (catchTop - initCatchTop - 1)));
NEXT_INST_F(1, 0, 0);
break;
case INST_PUSH_RESULT:
objResultPtr = Tcl_GetObjResult(interp);
@@ -6754,11 +6806,13 @@ TEBCresume(
Tcl_IncrRefCount(objPtr);
iPtr->objResultPtr = objPtr;
NEXT_INST_F(1, 0, -1);
break;
case INST_PUSH_RETURN_CODE:
TclNewIntObj(objResultPtr, result);
TRACE(("=> %u\n", result));
NEXT_INST_F(1, 0, 1);
break;
case INST_PUSH_RETURN_OPTIONS:
DECACHE_STACK_INFO();
@@ -6766,6 +6820,7 @@ TEBCresume(
CACHE_STACK_INFO();
TRACE_WITH_OBJ(("=> "), objResultPtr);
NEXT_INST_F(1, 0, 1);
break;
case INST_RETURN_CODE_BRANCH: {
int code;
@@ -6805,6 +6860,7 @@ TEBCresume(
}
TRACE_APPEND(("OK\n"));
NEXT_INST_F(1, 1, 0);
break;
case INST_DICT_EXISTS: {
int found;
@@ -7151,7 +7207,7 @@ TEBCresume(
opnd = TclGetUInt4AtPtr(pc+1);
TRACE(("%u => ", opnd));
dictPtr = POP_OBJECT();
searchPtr = ckalloc(sizeof(Tcl_DictSearch));
searchPtr = (Tcl_DictSearch *)ckalloc(sizeof(Tcl_DictSearch));
if (Tcl_DictObjFirst(interp, dictPtr, searchPtr, &keyPtr,
&valuePtr, &done) != TCL_OK) {
@@ -7193,7 +7249,7 @@ TEBCresume(
if (statePtr &&
(irPtr = TclFetchIntRep(statePtr, &dictIteratorType))) {
searchPtr = irPtr->twoPtrValue.ptr1;
searchPtr = (Tcl_DictSearch *)irPtr->twoPtrValue.ptr1;
Tcl_DictObjNext(searchPtr, &keyPtr, &valuePtr, &done);
} else {
Tcl_Panic("mis-issued dictNext!");
@@ -7225,7 +7281,7 @@ TEBCresume(
opnd2 = TclGetUInt4AtPtr(pc+5);
TRACE(("%u => ", opnd));
varPtr = LOCAL(opnd);
duiPtr = codePtr->auxDataArrayPtr[opnd2].clientData;
duiPtr = (DictUpdateInfo *)codePtr->auxDataArrayPtr[opnd2].clientData;
while (TclIsVarLink(varPtr)) {
varPtr = varPtr->value.linkPtr;
}
@@ -7285,7 +7341,7 @@ TEBCresume(
opnd2 = TclGetUInt4AtPtr(pc+5);
TRACE(("%u => ", opnd));
varPtr = LOCAL(opnd);
duiPtr = codePtr->auxDataArrayPtr[opnd2].clientData;
duiPtr = (DictUpdateInfo *)codePtr->auxDataArrayPtr[opnd2].clientData;
while (TclIsVarLink(varPtr)) {
varPtr = varPtr->value.linkPtr;
}
@@ -7428,6 +7484,7 @@ TEBCresume(
TRACE_APPEND(("OK\n"));
NEXT_INST_F(5, 2, 0);
}
break;
/*
* End of dictionary-related instructions.
@@ -7465,6 +7522,7 @@ TEBCresume(
TRACE_WITH_OBJ(("=> "), objResultPtr);
NEXT_INST_F(2, 0, 1);
}
break;
default:
Tcl_Panic("TclNRExecuteByteCode: unrecognized opCode %u", *pc);
@@ -7572,6 +7630,13 @@ TEBCresume(
CACHE_STACK_INFO();
goto gotError;
outOfMemory:
Tcl_SetObjResult(interp, Tcl_NewStringObj("out of memory", -1));
DECACHE_STACK_INFO();
Tcl_SetErrorCode(interp, "ARITH", "OUTOFMEMORY", "out of memory", NULL);
CACHE_STACK_INFO();
goto gotError;
/*
* Exponentiation of zero by negative number in an expression. Control
* only reaches this point by "goto exponOfZero".
@@ -7817,13 +7882,13 @@ FinalizeOONext(
int result)
{
Interp *iPtr = (Interp *) interp;
CallContext *contextPtr = data[1];
CallContext *contextPtr = (CallContext *)data[1];
/*
* Reset the variable lookup frame.
*/
iPtr->varFramePtr = data[0];
iPtr->varFramePtr = (CallFrame *)data[0];
/*
* Restore the call chain context index as we've finished the inner invoke
@@ -7843,13 +7908,13 @@ FinalizeOONextFilter(
int result)
{
Interp *iPtr = (Interp *) interp;
CallContext *contextPtr = data[1];
CallContext *contextPtr = (CallContext *)data[1];
/*
* Reset the variable lookup frame.
*/
iPtr->varFramePtr = data[0];
iPtr->varFramePtr = (CallFrame *)data[0];
/*
* Restore the call chain context index as we've finished the inner invoke
@@ -8011,6 +8076,7 @@ ExecuteExtendedBinaryMathOp(
Tcl_Obj *objResultPtr;
int invalid, zero;
long shift;
mp_err err;
(void) GetNumberFromObj(NULL, valuePtr, &ptr1, &type1);
(void) GetNumberFromObj(NULL, value2Ptr, &ptr2, &type2);
@@ -8072,9 +8138,14 @@ ExecuteExtendedBinaryMathOp(
* Arguments are opposite sign; remainder is sum.
*/
mp_init_ll(&big1, w1);
mp_add(&big2, &big1, &big2);
mp_clear(&big1);
err = mp_init_i64(&big1, w1);
if (err == MP_OKAY) {
err = mp_add(&big2, &big1, &big2);
mp_clear(&big1);
}
if (err != MP_OKAY) {
return OUT_OF_MEMORY;
}
BIG_RESULT(&big2);
}
@@ -8087,21 +8158,27 @@ ExecuteExtendedBinaryMathOp(
}
Tcl_GetBignumFromObj(NULL, valuePtr, &big1);
Tcl_GetBignumFromObj(NULL, value2Ptr, &big2);
mp_init(&bigResult);
mp_init(&bigRemainder);
mp_div(&big1, &big2, &bigResult, &bigRemainder);
if ((bigRemainder.used != 0) && (bigRemainder.sign != big2.sign)) {
err = mp_init_multi(&bigResult, &bigRemainder, NULL);
if (err == MP_OKAY) {
err = mp_div(&big1, &big2, &bigResult, &bigRemainder);
}
if ((err == MP_OKAY) && !mp_iszero(&bigRemainder) && (bigRemainder.sign != big2.sign)) {
/*
* Convert to Tcl's integer division rules.
*/
mp_sub_d(&bigResult, 1, &bigResult);
mp_add(&bigRemainder, &big2, &bigRemainder);
if ((mp_sub_d(&bigResult, 1, &bigResult) != MP_OKAY)
|| (mp_add(&bigRemainder, &big2, &bigRemainder) != MP_OKAY)) {
return OUT_OF_MEMORY;
}
}
mp_copy(&bigRemainder, &bigResult);
err = mp_copy(&bigRemainder, &bigResult);
mp_clear(&bigRemainder);
mp_clear(&big1);
mp_clear(&big2);
if (err != MP_OKAY) {
return OUT_OF_MEMORY;
}
BIG_RESULT(&bigResult);
case INST_LSHIFT:
@@ -8227,11 +8304,16 @@ ExecuteExtendedBinaryMathOp(
Tcl_TakeBignumFromObj(NULL, valuePtr, &big1);
mp_init(&bigResult);
if (opcode == INST_LSHIFT) {
mp_mul_2d(&big1, shift, &bigResult);
} else {
mp_signed_rsh(&big1, shift, &bigResult);
err = mp_init(&bigResult);
if (err == MP_OKAY) {
if (opcode == INST_LSHIFT) {
err = mp_mul_2d(&big1, shift, &bigResult);
} else {
err = mp_signed_rsh(&big1, shift, &bigResult);
}
}
if (err != MP_OKAY) {
return OUT_OF_MEMORY;
}
mp_clear(&big1);
BIG_RESULT(&bigResult);
@@ -8244,20 +8326,25 @@ ExecuteExtendedBinaryMathOp(
Tcl_TakeBignumFromObj(NULL, valuePtr, &big1);
Tcl_TakeBignumFromObj(NULL, value2Ptr, &big2);
mp_init(&bigResult);
err = mp_init(&bigResult);
switch (opcode) {
case INST_BITAND:
mp_and(&big1, &big2, &bigResult);
break;
if (err == MP_OKAY) {
switch (opcode) {
case INST_BITAND:
err = mp_and(&big1, &big2, &bigResult);
break;
case INST_BITOR:
mp_or(&big1, &big2, &bigResult);
break;
case INST_BITOR:
err = mp_or(&big1, &big2, &bigResult);
break;
case INST_BITXOR:
mp_xor(&big1, &big2, &bigResult);
break;
case INST_BITXOR:
err = mp_xor(&big1, &big2, &bigResult);
break;
}
}
if (err != MP_OKAY) {
return OUT_OF_MEMORY;
}
mp_clear(&big1);
@@ -8320,8 +8407,8 @@ ExecuteExtendedBinaryMathOp(
} else {
Tcl_TakeBignumFromObj(NULL, value2Ptr, &big2);
negativeExponent = mp_isneg(&big2);
mp_mod_2d(&big2, 1, &big2);
oddExponent = big2.used != 0;
err = mp_mod_2d(&big2, 1, &big2);
oddExponent = (err == MP_OKAY) && !mp_iszero(&big2);
mp_clear(&big2);
}
@@ -8478,8 +8565,13 @@ ExecuteExtendedBinaryMathOp(
return GENERAL_ARITHMETIC_ERROR;
}
Tcl_TakeBignumFromObj(NULL, valuePtr, &big1);
mp_init(&bigResult);
mp_expt_u32(&big1, (unsigned int)w2, &bigResult);
err = mp_init(&bigResult);
if (err == MP_OKAY) {
err = mp_expt_u32(&big1, (unsigned int)w2, &bigResult);
}
if (err != MP_OKAY) {
return OUT_OF_MEMORY;
}
mp_clear(&big1);
BIG_RESULT(&bigResult);
}
@@ -8626,38 +8718,44 @@ ExecuteExtendedBinaryMathOp(
overflowBasic:
Tcl_TakeBignumFromObj(NULL, valuePtr, &big1);
Tcl_TakeBignumFromObj(NULL, value2Ptr, &big2);
mp_init(&bigResult);
err = mp_init(&bigResult);
if (err == MP_OKAY) {
switch (opcode) {
case INST_ADD:
mp_add(&big1, &big2, &bigResult);
break;
err = mp_add(&big1, &big2, &bigResult);
break;
case INST_SUB:
mp_sub(&big1, &big2, &bigResult);
break;
err = mp_sub(&big1, &big2, &bigResult);
break;
case INST_MULT:
mp_mul(&big1, &big2, &bigResult);
break;
err = mp_mul(&big1, &big2, &bigResult);
break;
case INST_DIV:
if (big2.used == 0) {
mp_clear(&big1);
mp_clear(&big2);
mp_clear(&bigResult);
return DIVIDED_BY_ZERO;
}
mp_init(&bigRemainder);
mp_div(&big1, &big2, &bigResult, &bigRemainder);
/* TODO: internals intrusion */
if ((bigRemainder.used != 0)
&& (bigRemainder.sign != big2.sign)) {
/*
* Convert to Tcl's integer division rules.
*/
if (mp_iszero(&big2)) {
mp_clear(&big1);
mp_clear(&big2);
mp_clear(&bigResult);
return DIVIDED_BY_ZERO;
}
err = mp_init(&bigRemainder);
if (err == MP_OKAY) {
err = mp_div(&big1, &big2, &bigResult, &bigRemainder);
}
/* TODO: internals intrusion */
if (!mp_iszero(&bigRemainder)
&& (bigRemainder.sign != big2.sign)) {
/*
* Convert to Tcl's integer division rules.
*/
mp_sub_d(&bigResult, 1, &bigResult);
mp_add(&bigRemainder, &big2, &bigRemainder);
err = mp_sub_d(&bigResult, 1, &bigResult);
if (err == MP_OKAY) {
err = mp_add(&bigRemainder, &big2, &bigRemainder);
}
}
mp_clear(&bigRemainder);
break;
}
mp_clear(&bigRemainder);
break;
}
mp_clear(&big1);
mp_clear(&big2);
@@ -8678,6 +8776,7 @@ ExecuteExtendedUnaryMathOp(
Tcl_WideInt w;
mp_int big;
Tcl_Obj *objResultPtr;
mp_err err = MP_OKAY;
(void) GetNumberFromObj(NULL, valuePtr, &ptr, &type);
@@ -8689,8 +8788,13 @@ ExecuteExtendedUnaryMathOp(
}
Tcl_TakeBignumFromObj(NULL, valuePtr, &big);
/* ~a = - a - 1 */
mp_neg(&big, &big);
mp_sub_d(&big, 1, &big);
err = mp_neg(&big, &big);
if (err == MP_OKAY) {
err = mp_sub_d(&big, 1, &big);
}
if (err != MP_OKAY) {
return OUT_OF_MEMORY;
}
BIG_RESULT(&big);
case INST_UMINUS:
switch (type) {
@@ -8701,12 +8805,18 @@ ExecuteExtendedUnaryMathOp(
if (w != WIDE_MIN) {
WIDE_RESULT(-w);
}
mp_init_ll(&big, w);
err = mp_init_i64(&big, w);
if (err != MP_OKAY) {
return OUT_OF_MEMORY;
}
break;
default:
Tcl_TakeBignumFromObj(NULL, valuePtr, &big);
}
mp_neg(&big, &big);
err = mp_neg(&big, &big);
if (err != MP_OKAY) {
return OUT_OF_MEMORY;
}
BIG_RESULT(&big);
}
@@ -8802,6 +8912,7 @@ TclCompareTwoNumbers(
mp_clear(&big2);
return compare;
}
break;
case TCL_NUMBER_DOUBLE:
d1 = *((const double *)ptr1);
@@ -8848,6 +8959,7 @@ TclCompareTwoNumbers(
Tcl_InitBignumFromDouble(NULL, d1, &big1);
goto bigCompare;
}
break;
case TCL_NUMBER_BIG:
Tcl_TakeBignumFromObj(NULL, valuePtr, &big1);
@@ -8884,10 +8996,11 @@ TclCompareTwoNumbers(
mp_clear(&big2);
return compare;
}
break;
default:
Tcl_Panic("unexpected number type");
return TCL_ERROR;
}
return TCL_ERROR;
}
#ifdef TCL_COMPILE_DEBUG
@@ -9056,12 +9169,12 @@ IllegalExprOperandType(
ClientData ptr;
int type;
const unsigned char opcode = *pc;
const char *description, *operator = "unknown";
const char *description, *op = "unknown";
if (opcode == INST_EXPON) {
operator = "**";
op = "**";
} else if (opcode <= INST_LNOT) {
operator = operatorStrings[opcode - INST_LOR];
op = operatorStrings[opcode - INST_LOR];
}
if (GetNumberFromObj(NULL, opndPtr, &ptr, &type) != TCL_OK) {
@@ -9085,7 +9198,7 @@ IllegalExprOperandType(
}
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"can't use %s as operand of \"%s\"", description, operator));
"can't use %s as operand of \"%s\"", description, op));
Tcl_SetErrorCode(interp, "ARITH", "DOMAIN", description, NULL);
}
@@ -9172,7 +9285,7 @@ TclGetSrcInfoForPc(
}
srcOffset = cfPtr->cmd - codePtr->source;
eclPtr = Tcl_GetHashValue(hePtr);
eclPtr = (ExtCmdLoc *)Tcl_GetHashValue(hePtr);
for (i=0; i < eclPtr->nuloc; i++) {
if (eclPtr->loc[i].srcOffset == srcOffset) {
+18 -9
View File
@@ -47,12 +47,13 @@ static int FileForceOption(Tcl_Interp *interp,
int
TclFileRenameCmd(
ClientData clientData, /* Unused */
ClientData dummy, /* Unused */
Tcl_Interp *interp, /* Interp for error reporting or recursive
* calls in the case of a tricky rename. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument strings passed to Tcl_FileCmd. */
{
(void)dummy;
return FileCopyRename(interp, objc, objv, 0);
}
@@ -76,12 +77,13 @@ TclFileRenameCmd(
int
TclFileCopyCmd(
ClientData clientData, /* Unused */
ClientData dummy, /* Unused */
Tcl_Interp *interp, /* Used for error reporting or recursive calls
* in the case of a tricky copy. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument strings passed to Tcl_FileCmd. */
{
(void)dummy;
return FileCopyRename(interp, objc, objv, 1);
}
@@ -214,7 +216,7 @@ FileCopyRename(
int
TclFileMakeDirsCmd(
ClientData clientData, /* Unused */
ClientData dummy, /* Unused */
Tcl_Interp *interp, /* Used for error reporting. */
int objc, /* Number of arguments */
Tcl_Obj *const objv[]) /* Argument strings passed to Tcl_FileCmd. */
@@ -224,6 +226,7 @@ TclFileMakeDirsCmd(
Tcl_Obj *split = NULL;
Tcl_Obj *target = NULL;
Tcl_StatBuf statBuf;
(void)dummy;
result = TCL_OK;
for (i = 1; i < objc; i++) {
@@ -338,7 +341,7 @@ TclFileMakeDirsCmd(
int
TclFileDeleteCmd(
ClientData clientData, /* Unused */
ClientData dummy, /* Unused */
Tcl_Interp *interp, /* Used for error reporting */
int objc, /* Number of arguments */
Tcl_Obj *const objv[]) /* Argument strings passed to Tcl_FileCmd. */
@@ -346,6 +349,7 @@ TclFileDeleteCmd(
int i, force, result;
Tcl_Obj *errfile;
Tcl_Obj *errorBuffer = NULL;
(void)dummy;
i = FileForceOption(interp, objc - 1, objv + 1, &force);
if (i < 0) {
@@ -946,7 +950,7 @@ FileBasename(
int
TclFileAttrsCmd(
ClientData clientData, /* Unused */
ClientData dummy, /* Unused */
Tcl_Interp *interp, /* The interpreter for error reporting. */
int objc, /* Number of command line arguments. */
Tcl_Obj *const objv[]) /* The command line objects. */
@@ -957,6 +961,7 @@ TclFileAttrsCmd(
Tcl_Obj *objStrings = NULL;
int numObjStrings = -1;
Tcl_Obj *filePtr;
(void)dummy;
if (objc < 2) {
Tcl_WrongNumArgs(interp, 1, objv, "name ?-option value ...?");
@@ -1162,13 +1167,14 @@ TclFileAttrsCmd(
int
TclFileLinkCmd(
ClientData clientData,
ClientData dummy,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
{
Tcl_Obj *contents;
int index;
(void)dummy;
if (objc < 2 || objc > 4) {
Tcl_WrongNumArgs(interp, 1, objv, "?-linktype? linkname ?target?");
@@ -1313,12 +1319,13 @@ TclFileLinkCmd(
int
TclFileReadLinkCmd(
ClientData clientData,
ClientData dummy,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
{
Tcl_Obj *contents;
(void)dummy;
if (objc != 2) {
Tcl_WrongNumArgs(interp, 1, objv, "name");
@@ -1364,7 +1371,7 @@ TclFileReadLinkCmd(
int
TclFileTemporaryCmd(
ClientData clientData,
ClientData dummy,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
@@ -1378,6 +1385,7 @@ TclFileTemporaryCmd(
/* Pieces of template. Each piece is NULL if
* it is omitted. The platform temporary file
* engine might ignore some pieces. */
(void)dummy;
if (objc < 1 || objc > 3) {
Tcl_WrongNumArgs(interp, 1, objv, "?nameVar? ?template?");
@@ -1523,7 +1531,7 @@ TclFileTemporaryCmd(
int
TclFileTempDirCmd(
ClientData clientData,
ClientData dummy,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
@@ -1534,6 +1542,7 @@ TclFileTempDirCmd(
/* Pieces of template. Each piece is NULL if
* it is omitted. The platform temporary file
* engine might ignore some pieces. */
(void)dummy;
if (objc < 1 || objc > 2) {
Tcl_WrongNumArgs(interp, 1, objv, "?template?");
+6 -4
View File
@@ -587,7 +587,7 @@ Tcl_SplitPath(
* plus the argv pointers and the terminating NULL pointer.
*/
*argvPtr = ckalloc((((*argcPtr) + 1) * sizeof(char *)) + size);
*argvPtr = (const char **)ckalloc((((*argcPtr) + 1) * sizeof(char *)) + size);
/*
* Position p after the last argv pointer and copy the contents of the
@@ -821,7 +821,7 @@ Tcl_FSJoinToPath(
return TclJoinPath(2, pair, 0);
} else {
int elemc = objc + 1;
Tcl_Obj *ret, **elemv = ckalloc(elemc*sizeof(Tcl_Obj *));
Tcl_Obj *ret, **elemv = (Tcl_Obj**)ckalloc(elemc*sizeof(Tcl_Obj *));
elemv[0] = pathPtr;
memcpy(elemv+1, objv, objc*sizeof(Tcl_Obj *));
@@ -1241,6 +1241,7 @@ Tcl_GlobObjCmd(
};
enum pathDirOptions {PATH_NONE = -1 , PATH_GENERAL = 0, PATH_DIR = 1};
Tcl_GlobTypeData *globTypes = NULL;
(void)dummy;
globFlags = 0;
join = 0;
@@ -1449,7 +1450,7 @@ Tcl_GlobObjCmd(
if (length <= 0) {
goto skipTypes;
}
globTypes = TclStackAlloc(interp, sizeof(Tcl_GlobTypeData));
globTypes = (Tcl_GlobTypeData *)TclStackAlloc(interp, sizeof(Tcl_GlobTypeData));
globTypes->type = 0;
globTypes->perm = 0;
globTypes->macType = NULL;
@@ -2522,7 +2523,7 @@ DoGlob(
Tcl_StatBuf *
Tcl_AllocStatBuf(void)
{
return ckalloc(sizeof(Tcl_StatBuf));
return (Tcl_StatBuf *)ckalloc(sizeof(Tcl_StatBuf));
}
/*
@@ -2640,6 +2641,7 @@ Tcl_GetBlockSizeFromStat(
#ifdef HAVE_STRUCT_STAT_ST_BLKSIZE
return statPtr->st_blksize;
#else
(void)statPtr;
/*
* Not a great guess, but will do...
*/
+3 -2
View File
@@ -960,7 +960,7 @@ TclDatelex(
int
TclClockOldscanObjCmd(
void *clientData, /* Unused */
void *dummy, /* Unused */
Tcl_Interp *interp, /* Tcl interpreter */
int objc, /* Count of paraneters */
Tcl_Obj *const *objv) /* Parameters */
@@ -970,6 +970,7 @@ TclClockOldscanObjCmd(
DateInfo dateInfo;
DateInfo* info = &dateInfo;
int status;
(void)dummy;
if (objc != 5) {
Tcl_WrongNumArgs(interp, 1, objv,
@@ -1074,7 +1075,7 @@ TclClockOldscanObjCmd(
if (yyHaveTime) {
Tcl_ListObjAppendElement(interp, result, Tcl_NewIntObj((int)
ToSeconds(yyHour, yyMinutes, yySeconds, yyMeridian)));
ToSeconds(yyHour, yyMinutes, yySeconds, (MERIDIAN)yyMeridian)));
} else {
Tcl_ListObjAppendElement(interp, result, Tcl_NewObj());
}
+20 -13
View File
@@ -219,7 +219,7 @@ Tcl_FindHashEntry(
Tcl_HashTable *tablePtr, /* Table in which to lookup entry. */
const void *key) /* Key to use to find matching entry. */
{
return (*((tablePtr)->findProc))(tablePtr, key);
return (*((tablePtr)->findProc))(tablePtr, (const char *)key);
}
static Tcl_HashEntry *
@@ -260,7 +260,7 @@ Tcl_CreateHashEntry(
int *newPtr) /* Store info here telling whether a new entry
* was created. */
{
return (*((tablePtr)->createProc))(tablePtr, key, newPtr);
return (*((tablePtr)->createProc))(tablePtr, (const char *)key, newPtr);
}
static Tcl_HashEntry *
@@ -348,7 +348,7 @@ CreateHashEntry(
if (typePtr->allocEntryProc) {
hPtr = typePtr->allocEntryProc(tablePtr, (void *) key);
} else {
hPtr = ckalloc(sizeof(Tcl_HashEntry));
hPtr = (Tcl_HashEntry *)ckalloc(sizeof(Tcl_HashEntry));
hPtr->key.oneWordValue = (char *) key;
hPtr->clientData = 0;
}
@@ -648,7 +648,7 @@ Tcl_HashStats(
* Print out the histogram and a few other pieces of information.
*/
result = ckalloc((NUM_COUNTERS * 60) + 300);
result = (char *)ckalloc((NUM_COUNTERS * 60) + 300);
sprintf(result, "%d entries in table, %d buckets\n",
tablePtr->numEntries, tablePtr->numBuckets);
p = result + strlen(result);
@@ -697,7 +697,7 @@ AllocArrayEntry(
if (size < sizeof(Tcl_HashEntry)) {
size = sizeof(Tcl_HashEntry);
}
hPtr = ckalloc(size);
hPtr = (Tcl_HashEntry *)ckalloc(size);
for (iPtr1 = array, iPtr2 = hPtr->key.words;
count > 0; count--, iPtr1++, iPtr2++) {
@@ -770,14 +770,14 @@ HashArrayKey(
void *keyPtr) /* Key from which to compute hash value. */
{
const int *array = (const int *) keyPtr;
unsigned int result;
TCL_HASH_TYPE result;
int count;
for (result = 0, count = tablePtr->keyType; count > 0;
count--, array++) {
result += *array;
}
return (TCL_HASH_TYPE) result;
return result;
}
/*
@@ -803,13 +803,14 @@ AllocStringEntry(
{
const char *string = (const char *) keyPtr;
Tcl_HashEntry *hPtr;
unsigned int size, allocsize;
size_t size, allocsize;
(void)tablePtr;
allocsize = size = strlen(string) + 1;
if (size < sizeof(hPtr->key)) {
allocsize = sizeof(hPtr->key);
}
hPtr = ckalloc(offsetof(Tcl_HashEntry, key) + allocsize);
hPtr = (Tcl_HashEntry *)ckalloc(offsetof(Tcl_HashEntry, key) + allocsize);
memset(hPtr, 0, sizeof(Tcl_HashEntry) + allocsize - sizeof(hPtr->key));
memcpy(hPtr->key.string, string, size);
hPtr->clientData = 0;
@@ -866,9 +867,10 @@ HashStringKey(
Tcl_HashTable *tablePtr, /* Hash table. */
void *keyPtr) /* Key from which to compute hash value. */
{
const char *string = keyPtr;
unsigned int result;
const char *string = (const char *)keyPtr;
TCL_HASH_TYPE result;
char c;
(void)tablePtr;
/*
* I tried a zillion different hash functions and asked many other people
@@ -907,7 +909,7 @@ HashStringKey(
result += (result << 3) + UCHAR(c);
}
}
return (TCL_HASH_TYPE) result;
return result;
}
/*
@@ -933,6 +935,8 @@ BogusFind(
Tcl_HashTable *tablePtr, /* Table in which to lookup entry. */
const char *key) /* Key to use to find matching entry. */
{
(void)tablePtr;
(void)key;
Tcl_Panic("called %s on deleted table", "Tcl_FindHashEntry");
return NULL;
}
@@ -963,6 +967,9 @@ BogusCreate(
int *newPtr) /* Store info here telling whether a new entry
* was created. */
{
(void)tablePtr;
(void)key;
(void)newPtr;
Tcl_Panic("called %s on deleted table", "Tcl_CreateHashEntry");
return NULL;
}
@@ -1023,7 +1030,7 @@ RebuildTable(
tablePtr->numBuckets * sizeof(Tcl_HashEntry *), 0);
} else {
tablePtr->buckets =
ckalloc(tablePtr->numBuckets * sizeof(Tcl_HashEntry *));
(Tcl_HashEntry **)ckalloc(tablePtr->numBuckets * sizeof(Tcl_HashEntry *));
}
for (count = tablePtr->numBuckets, newChainPtr = tablePtr->buckets;
count > 0; count--, newChainPtr++) {
+5 -4
View File
@@ -130,14 +130,14 @@ Tcl_RecordAndEvalObj(
int result, call = 1;
Tcl_CmdInfo info;
HistoryObjs *histObjsPtr =
Tcl_GetAssocData(interp, HISTORY_OBJS_KEY, NULL);
(HistoryObjs *)Tcl_GetAssocData(interp, HISTORY_OBJS_KEY, NULL);
/*
* Create the references to the [::history add] command if necessary.
*/
if (histObjsPtr == NULL) {
histObjsPtr = ckalloc(sizeof(HistoryObjs));
histObjsPtr = (HistoryObjs *)ckalloc(sizeof(HistoryObjs));
TclNewLiteralStringObj(histObjsPtr->historyObj, "::history");
TclNewLiteralStringObj(histObjsPtr->addObj, "add");
Tcl_IncrRefCount(histObjsPtr->historyObj);
@@ -211,9 +211,10 @@ Tcl_RecordAndEvalObj(
static void
DeleteHistoryObjs(
ClientData clientData,
Tcl_Interp *interp)
Tcl_Interp *dummy)
{
HistoryObjs *histObjsPtr = clientData;
HistoryObjs *histObjsPtr = (HistoryObjs *)clientData;
(void)dummy;
TclDecrRefCount(histObjsPtr->historyObj);
TclDecrRefCount(histObjsPtr->addObj);
+69 -104
View File
@@ -200,12 +200,10 @@ static int FilterInputBytes(Channel *chanPtr,
static int FlushChannel(Tcl_Interp *interp, Channel *chanPtr,
int calledFromAsyncFlush);
static int TclGetsObjBinary(Tcl_Channel chan, Tcl_Obj *objPtr);
static Tcl_Encoding GetBinaryEncoding();
static Tcl_Encoding GetBinaryEncoding(void);
static void FreeBinaryEncoding(ClientData clientData);
static Tcl_HashTable * GetChannelTable(Tcl_Interp *interp);
static int GetInput(Channel *chanPtr);
static int HaveVersion(const Tcl_ChannelType *typePtr,
Tcl_ChannelTypeVersion minimumVersion);
static void PeekAhead(Channel *chanPtr, char **dstEndPtr,
GetsState *gsPtr);
static int ReadBytes(ChannelState *statePtr, Tcl_Obj *objPtr,
@@ -350,7 +348,7 @@ static const Tcl_ObjType chanObjType = {
do { \
const Tcl_ObjIntRep *irPtr; \
irPtr = TclFetchIntRep((objPtr), &chanObjType); \
(resPtr) = irPtr ? irPtr->twoPtrValue.ptr1 : NULL; \
(resPtr) = irPtr ? (ResolvedChanName *)irPtr->twoPtrValue.ptr1 : NULL; \
} while (0)
#define BUSY_STATE(st, fl) \
@@ -492,9 +490,8 @@ ChanSeek(
* type and non-NULL.
*/
if (HaveVersion(chanPtr->typePtr, TCL_CHANNEL_VERSION_3) &&
chanPtr->typePtr->wideSeekProc != NULL) {
return chanPtr->typePtr->wideSeekProc(chanPtr->instanceData,
if (Tcl_ChannelWideSeekProc(chanPtr->typePtr) != NULL) {
return Tcl_ChannelWideSeekProc(chanPtr->typePtr)(chanPtr->instanceData,
offset, mode, errnoPtr);
}
@@ -503,7 +500,7 @@ ChanSeek(
return -1;
}
return chanPtr->typePtr->seekProc(chanPtr->instanceData,
return Tcl_ChannelSeekProc(chanPtr->typePtr)(chanPtr->instanceData,
offset, mode, errnoPtr);
}
@@ -860,7 +857,7 @@ Tcl_CreateCloseHandler(
ChannelState *statePtr = ((Channel *) chan)->state;
CloseCallback *cbPtr;
cbPtr = ckalloc(sizeof(CloseCallback));
cbPtr = (CloseCallback *)ckalloc(sizeof(CloseCallback));
cbPtr->proc = proc;
cbPtr->clientData = clientData;
@@ -939,9 +936,9 @@ GetChannelTable(
Tcl_HashTable *hTblPtr; /* Hash table of channels. */
Tcl_Channel stdinChan, stdoutChan, stderrChan;
hTblPtr = Tcl_GetAssocData(interp, "tclIO", NULL);
hTblPtr = (Tcl_HashTable *)Tcl_GetAssocData(interp, "tclIO", NULL);
if (hTblPtr == NULL) {
hTblPtr = ckalloc(sizeof(Tcl_HashTable));
hTblPtr = (Tcl_HashTable *)ckalloc(sizeof(Tcl_HashTable));
Tcl_InitHashTable(hTblPtr, TCL_STRING_KEYS);
Tcl_SetAssocData(interp, "tclIO",
(Tcl_InterpDeleteProc *) DeleteChannelTable, hTblPtr);
@@ -1009,10 +1006,10 @@ DeleteChannelTable(
* refcount reaches zero.
*/
hTblPtr = clientData;
hTblPtr = (Tcl_HashTable *)clientData;
for (hPtr = Tcl_FirstHashEntry(hTblPtr, &hSearch); hPtr != NULL;
hPtr = Tcl_FirstHashEntry(hTblPtr, &hSearch)) {
chanPtr = Tcl_GetHashValue(hPtr);
chanPtr = (Channel *)Tcl_GetHashValue(hPtr);
statePtr = chanPtr->state;
/*
@@ -1379,7 +1376,7 @@ DetachChannel(
statePtr = chanPtr->state;
if (interp != NULL) {
hTblPtr = Tcl_GetAssocData(interp, "tclIO", NULL);
hTblPtr = (Tcl_HashTable *)Tcl_GetAssocData(interp, "tclIO", NULL);
if (hTblPtr == NULL) {
return TCL_ERROR;
}
@@ -1482,7 +1479,7 @@ Tcl_GetChannel(
* compensate where necessary to retrieve the topmost channel again.
*/
chanPtr = Tcl_GetHashValue(hPtr);
chanPtr = (Channel *)Tcl_GetHashValue(hPtr);
chanPtr = chanPtr->state->bottomChanPtr;
if (modePtr != NULL) {
*modePtr = chanPtr->state->flags & (TCL_READABLE|TCL_WRITABLE);
@@ -1526,6 +1523,7 @@ TclGetChannelFromObj(
ChannelState *statePtr;
ResolvedChanName *resPtr = NULL;
Tcl_Channel chan;
(void)flags;
if (interp == NULL) {
return TCL_ERROR;
@@ -1649,8 +1647,8 @@ Tcl_CreateChannel(
* assignments to 0/NULL below.
*/
chanPtr = ckalloc(sizeof(Channel));
statePtr = ckalloc(sizeof(ChannelState));
chanPtr = (Channel *)ckalloc(sizeof(Channel));
statePtr = (ChannelState *)ckalloc(sizeof(ChannelState));
chanPtr->state = statePtr;
chanPtr->instanceData = instanceData;
@@ -1669,10 +1667,10 @@ Tcl_CreateChannel(
* later.
*/
tmp = ckalloc((len < 7) ? 7 : len);
tmp = (char *)ckalloc((len < 7) ? 7 : len);
strcpy(tmp, chanName);
} else {
tmp = ckalloc(7);
tmp = (char *)ckalloc(7);
tmp[0] = '\0';
}
statePtr->channelName = tmp;
@@ -1945,7 +1943,7 @@ Tcl_StackChannel(
statePtr->inQueueTail = NULL;
}
chanPtr = ckalloc(sizeof(Channel));
chanPtr = (Channel *)ckalloc(sizeof(Channel));
/*
* Save some of the current state into the new structure, reinitialize the
@@ -2474,7 +2472,7 @@ AllocChannelBuffer(
int n;
n = length + CHANNELBUFFER_HEADER_SIZE + BUFFER_PADDING + BUFFER_PADDING;
bufPtr = ckalloc(n);
bufPtr = (ChannelBuffer *)ckalloc(n);
bufPtr->nextAdded = BUFFER_PADDING;
bufPtr->nextRemoved = BUFFER_PADDING;
bufPtr->bufLength = length + BUFFER_PADDING;
@@ -4215,7 +4213,7 @@ WillWrite(
{
int inputBuffered;
if ((chanPtr->typePtr->seekProc != NULL) &&
if ((Tcl_ChannelSeekProc(chanPtr->typePtr) != NULL) &&
((inputBuffered = Tcl_InputBuffered((Tcl_Channel) chanPtr)) > 0)){
int ignore;
@@ -4237,7 +4235,7 @@ WillRead(
Tcl_SetErrno(EINVAL);
return -1;
}
if ((chanPtr->typePtr->seekProc != NULL)
if ((Tcl_ChannelSeekProc(chanPtr->typePtr) != NULL)
&& (Tcl_OutputBuffered((Tcl_Channel) chanPtr) > 0)) {
/*
* CAVEAT - The assumption here is that FlushChannel() will push out
@@ -4301,7 +4299,7 @@ Write(
if (GotFlag(statePtr, CHANNEL_LINEBUFFERED)
|| (statePtr->outputTranslation != TCL_TRANSLATE_LF)) {
nextNewLine = memchr(src, '\n', srcLen);
nextNewLine = (char *)memchr(src, '\n', srcLen);
}
while (srcLen + saved + endEncoding > 0) {
@@ -4399,7 +4397,7 @@ Write(
total += dstWrote;
dst += dstWrote;
dstLen -= dstWrote;
nextNewLine = memchr(src, '\n', srcLen);
nextNewLine = (char *)memchr(src, '\n', srcLen);
needNlFlush = 1;
}
@@ -4712,14 +4710,14 @@ Tcl_GetsObj(
* Skip the raw bytes that make up the '\n'.
*/
char tmp[TCL_UTF_MAX];
int rawRead;
char tmp[TCL_UTF_MAX];
bufPtr = gs.bufPtr;
Tcl_ExternalToUtf(NULL, gs.encoding, RemovePoint(bufPtr),
gs.rawRead, statePtr->inputEncodingFlags
| TCL_ENCODING_NO_TERMINATE, &gs.state, tmp,
TCL_UTF_MAX, &rawRead, NULL, NULL);
sizeof(tmp), &rawRead, NULL, NULL);
bufPtr->nextRemoved += rawRead;
gs.rawRead -= rawRead;
gs.bytesWrote--;
@@ -5201,6 +5199,7 @@ FreeBinaryEncoding(
ClientData dummy) /* Not used */
{
ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey);
(void)dummy;
if (tsdPtr->binaryEncoding != NULL) {
Tcl_FreeEncoding(tsdPtr->binaryEncoding);
@@ -6265,8 +6264,8 @@ ReadChars(
*/
if (code != TCL_OK) {
char buffer[TCL_UTF_MAX + 1];
int read, decoded, count;
char buffer[TCL_UTF_MAX + 1];
/*
* Didn't get everything the buffer could offer
@@ -6282,7 +6281,7 @@ ReadChars(
Tcl_ExternalToUtf(NULL, encoding, src, srcLen,
(statePtr->inputEncodingFlags | TCL_ENCODING_NO_TERMINATE),
&statePtr->inputEncodingState, buffer, TCL_UTF_MAX + 1,
&statePtr->inputEncodingState, buffer, sizeof(buffer),
&read, &decoded, &count);
if (count == 2) {
@@ -6506,7 +6505,7 @@ TranslateInputEOL(
* created by the presence of the input eof char.
*/
if ((eof = memchr(srcStart, inEofChar, srcLen))) {
if ((eof = (const char *)memchr(srcStart, inEofChar, srcLen))) {
srcLen = eof - srcStart;
}
}
@@ -6521,7 +6520,7 @@ TranslateInputEOL(
char *dst = dstStart;
char *dstEnd = dstStart + srcLen;
while ((dst = memchr(dst, '\r', dstEnd - dst))) {
while ((dst = (char *)memchr(dst, '\r', dstEnd - dst))) {
*dst++ = '\n';
}
}
@@ -6532,7 +6531,7 @@ TranslateInputEOL(
char *dst = dstStart;
int lesser = (dstLen < srcLen) ? dstLen : srcLen;
while ((crFound = memchr(src, '\r', lesser))) {
while ((crFound = (const char *)memchr(src, '\r', lesser))) {
int numBytes = crFound - src;
memmove(dst, src, numBytes);
@@ -6572,7 +6571,7 @@ TranslateInputEOL(
ResetFlag(statePtr, INPUT_SAW_CR);
}
lesser = (dstLen < srcLen) ? dstLen : srcLen;
while ((crFound = memchr(src, '\r', lesser))) {
while ((crFound = (const char *)memchr(src, '\r', lesser))) {
int numBytes = crFound - src;
memmove(dst, src, numBytes);
@@ -6997,7 +6996,7 @@ Tcl_Seek(
* defined. This means that the channel does not support seeking.
*/
if (chanPtr->typePtr->seekProc == NULL) {
if (Tcl_ChannelSeekProc(chanPtr->typePtr) == NULL) {
Tcl_SetErrno(EINVAL);
return -1;
}
@@ -7161,7 +7160,7 @@ Tcl_Tell(
* defined. This means that the channel does not support seeking.
*/
if (chanPtr->typePtr->seekProc == NULL) {
if (Tcl_ChannelSeekProc(chanPtr->typePtr) == NULL) {
Tcl_SetErrno(EINVAL);
return -1;
}
@@ -8544,7 +8543,7 @@ static void
ChannelTimerProc(
ClientData clientData)
{
Channel *chanPtr = clientData;
Channel *chanPtr = (Channel *)clientData;
ChannelState *statePtr = chanPtr->state;
/* State info for channel */
@@ -8632,7 +8631,7 @@ Tcl_CreateChannelHandler(
}
}
if (chPtr == NULL) {
chPtr = ckalloc(sizeof(ChannelHandler));
chPtr = (ChannelHandler *)ckalloc(sizeof(ChannelHandler));
chPtr->mask = 0;
chPtr->proc = proc;
chPtr->clientData = clientData;
@@ -8844,7 +8843,7 @@ CreateScriptRecord(
makeCH = (esPtr == NULL);
if (makeCH) {
esPtr = ckalloc(sizeof(EventScriptRecord));
esPtr = (EventScriptRecord *)ckalloc(sizeof(EventScriptRecord));
}
/*
@@ -8900,7 +8899,7 @@ TclChannelEventScriptInvoker(
* in. */
int result; /* Result of call to eval script. */
esPtr = clientData;
esPtr = (EventScriptRecord *)clientData;
chanPtr = esPtr->chanPtr;
mask = esPtr->mask;
interp = esPtr->interp;
@@ -8955,7 +8954,7 @@ TclChannelEventScriptInvoker(
/* ARGSUSED */
int
Tcl_FileEventObjCmd(
ClientData clientData, /* Not used. */
ClientData dummy, /* Not used. */
Tcl_Interp *interp, /* Interpreter in which the channel for which
* to create the handler is found. */
int objc, /* Number of arguments. */
@@ -8969,6 +8968,7 @@ Tcl_FileEventObjCmd(
int mask;
static const char *const modeOptions[] = {"readable", "writable", NULL};
static const int maskArray[] = {TCL_READABLE, TCL_WRITABLE};
(void)dummy;
if ((objc != 3) && (objc != 4)) {
Tcl_WrongNumArgs(interp, 1, objv, "channelId event ?script?");
@@ -9054,7 +9054,7 @@ ZeroTransferTimerProc(
/* calling CopyData with mask==0 still implies immediate invocation of the
* -command callback, and completion of the fcopy.
*/
CopyData(clientData, 0);
CopyData((CopyState *)clientData, 0);
}
/*
@@ -9174,7 +9174,7 @@ TclCopyChannel(
* completed.
*/
csPtr = ckalloc(sizeof(CopyState) + !moveBytes * inStatePtr->bufSize);
csPtr = (CopyState *)ckalloc(sizeof(CopyState) + !moveBytes * inStatePtr->bufSize);
csPtr->bufSize = !moveBytes * inStatePtr->bufSize;
csPtr->readPtr = inPtr;
csPtr->writePtr = outPtr;
@@ -10032,7 +10032,7 @@ CopyEventProc(
ClientData clientData,
int mask)
{
(void) CopyData(clientData, mask);
(void) CopyData((CopyState *)clientData, mask);
}
/*
@@ -10365,7 +10365,7 @@ Tcl_IsChannelRegistered(
chanPtr = ((Channel *) chan)->state->bottomChanPtr;
statePtr = chanPtr->state;
hTblPtr = Tcl_GetAssocData(interp, "tclIO", NULL);
hTblPtr = (Tcl_HashTable *)Tcl_GetAssocData(interp, "tclIO", NULL);
if (hTblPtr == NULL) {
return 0;
}
@@ -10499,49 +10499,15 @@ Tcl_ChannelVersion(
const Tcl_ChannelType *chanTypePtr)
/* Pointer to channel type. */
{
if (chanTypePtr->version == TCL_CHANNEL_VERSION_2) {
return TCL_CHANNEL_VERSION_2;
} else if (chanTypePtr->version == TCL_CHANNEL_VERSION_3) {
return TCL_CHANNEL_VERSION_3;
} else if (chanTypePtr->version == TCL_CHANNEL_VERSION_4) {
return TCL_CHANNEL_VERSION_4;
} else if (chanTypePtr->version == TCL_CHANNEL_VERSION_5) {
return TCL_CHANNEL_VERSION_5;
} else {
if ((chanTypePtr->version < TCL_CHANNEL_VERSION_2)
|| (chanTypePtr->version > TCL_CHANNEL_VERSION_5)) {
/*
* In <v2 channel versions, the version field is occupied by the
* Tcl_DriverBlockModeProc
*/
return TCL_CHANNEL_VERSION_1;
}
}
/*
*----------------------------------------------------------------------
*
* HaveVersion --
*
* Return whether a channel type is (at least) of a given version.
*
* Results:
* True if the minimum version is exceeded by the version actually
* present.
*
* Side effects:
* None.
*
*----------------------------------------------------------------------
*/
static int
HaveVersion(
const Tcl_ChannelType *chanTypePtr,
Tcl_ChannelTypeVersion minimumVersion)
{
Tcl_ChannelTypeVersion actualVersion = Tcl_ChannelVersion(chanTypePtr);
return (PTR2INT(actualVersion)) >= (PTR2INT(minimumVersion));
return chanTypePtr->version;
}
/*
@@ -10564,15 +10530,14 @@ Tcl_ChannelBlockModeProc(
const Tcl_ChannelType *chanTypePtr)
/* Pointer to channel type. */
{
if (HaveVersion(chanTypePtr, TCL_CHANNEL_VERSION_2)) {
return chanTypePtr->blockModeProc;
if (Tcl_ChannelVersion(chanTypePtr) < TCL_CHANNEL_VERSION_2) {
/*
* The v1 structure had the blockModeProc in a different place.
*/
return (Tcl_DriverBlockModeProc *) chanTypePtr->version;
}
/*
* The v1 structure had the blockModeProc in a different place.
*/
return (Tcl_DriverBlockModeProc *) chanTypePtr->version;
return chanTypePtr->blockModeProc;
}
/*
@@ -10812,10 +10777,10 @@ Tcl_ChannelFlushProc(
const Tcl_ChannelType *chanTypePtr)
/* Pointer to channel type. */
{
if (HaveVersion(chanTypePtr, TCL_CHANNEL_VERSION_2)) {
return chanTypePtr->flushProc;
if (Tcl_ChannelVersion(chanTypePtr) < TCL_CHANNEL_VERSION_2) {
return NULL;
}
return NULL;
return chanTypePtr->flushProc;
}
/*
@@ -10839,10 +10804,10 @@ Tcl_ChannelHandlerProc(
const Tcl_ChannelType *chanTypePtr)
/* Pointer to channel type. */
{
if (HaveVersion(chanTypePtr, TCL_CHANNEL_VERSION_2)) {
return chanTypePtr->handlerProc;
if (Tcl_ChannelVersion(chanTypePtr) < TCL_CHANNEL_VERSION_2) {
return NULL;
}
return NULL;
return chanTypePtr->handlerProc;
}
/*
@@ -10866,10 +10831,10 @@ Tcl_ChannelWideSeekProc(
const Tcl_ChannelType *chanTypePtr)
/* Pointer to channel type. */
{
if (HaveVersion(chanTypePtr, TCL_CHANNEL_VERSION_3)) {
return chanTypePtr->wideSeekProc;
if (Tcl_ChannelVersion(chanTypePtr) < TCL_CHANNEL_VERSION_3) {
return NULL;
}
return NULL;
return chanTypePtr->wideSeekProc;
}
/*
@@ -10894,10 +10859,10 @@ Tcl_ChannelThreadActionProc(
const Tcl_ChannelType *chanTypePtr)
/* Pointer to channel type. */
{
if (HaveVersion(chanTypePtr, TCL_CHANNEL_VERSION_4)) {
return chanTypePtr->threadActionProc;
if (Tcl_ChannelVersion(chanTypePtr) < TCL_CHANNEL_VERSION_4) {
return NULL;
}
return NULL;
return chanTypePtr->threadActionProc;
}
/*
@@ -11074,7 +11039,7 @@ FixLevelCode(
lcn += 2;
}
lvn = ckalloc(lcn * sizeof(Tcl_Obj *));
lvn = (Tcl_Obj **)ckalloc(lcn * sizeof(Tcl_Obj *));
/*
* New level/code information is spliced into the first occurence of
@@ -11209,10 +11174,10 @@ Tcl_ChannelTruncateProc(
const Tcl_ChannelType *chanTypePtr)
/* Pointer to channel type. */
{
if (HaveVersion(chanTypePtr, TCL_CHANNEL_VERSION_5)) {
return chanTypePtr->truncateProc;
if (Tcl_ChannelVersion(chanTypePtr) < TCL_CHANNEL_VERSION_5) {
return NULL;
}
return NULL;
return chanTypePtr->truncateProc;
}
/*
+42 -22
View File
@@ -71,9 +71,10 @@ static void UnregisterTcpServerInterpCleanupProc(
static void
FinalizeIOCmdTSD(
ClientData clientData) /* Not used. */
ClientData dummy) /* Not used. */
{
ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey);
(void)dummy;
if (tsdPtr->stdoutObjPtr != NULL) {
Tcl_DecrRefCount(tsdPtr->stdoutObjPtr);
@@ -113,6 +114,7 @@ Tcl_PutsObjCmd(
int newline; /* Add a newline at end? */
int result; /* Result of puts operation. */
int mode; /* Mode in which channel is opened. */
(void)dummy;
switch (objc) {
case 2: /* [puts $x] */
@@ -237,6 +239,7 @@ Tcl_FlushObjCmd(
Tcl_Obj *chanObjPtr;
Tcl_Channel chan; /* The channel to flush on. */
int mode;
(void)dummy;
if (objc != 2) {
Tcl_WrongNumArgs(interp, 1, objv, "channelId");
@@ -304,6 +307,7 @@ Tcl_GetsObjCmd(
int mode; /* Mode in which channel is opened. */
Tcl_Obj *linePtr, *chanObjPtr;
int code = TCL_OK;
(void)dummy;
if ((objc != 2) && (objc != 3)) {
Tcl_WrongNumArgs(interp, 1, objv, "channelId ?varName?");
@@ -390,6 +394,7 @@ Tcl_ReadObjCmd(
int charactersRead; /* How many characters were read? */
int mode; /* Mode in which channel is opened. */
Tcl_Obj *resultPtr, *chanObjPtr;
(void)dummy;
if ((objc != 2) && (objc != 3)) {
Interp *iPtr;
@@ -523,7 +528,7 @@ Tcl_ReadObjCmd(
/* ARGSUSED */
int
Tcl_SeekObjCmd(
ClientData clientData, /* Not used. */
ClientData dummy, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
@@ -537,6 +542,7 @@ Tcl_SeekObjCmd(
"start", "current", "end", NULL
};
static const int modeArray[] = {SEEK_SET, SEEK_CUR, SEEK_END};
(void)dummy;
if ((objc != 3) && (objc != 4)) {
Tcl_WrongNumArgs(interp, 1, objv, "channelId offset ?origin?");
@@ -599,7 +605,7 @@ Tcl_SeekObjCmd(
/* ARGSUSED */
int
Tcl_TellObjCmd(
ClientData clientData, /* Not used. */
ClientData dummy, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
@@ -607,6 +613,7 @@ Tcl_TellObjCmd(
Tcl_Channel chan; /* The channel to tell on. */
Tcl_WideInt newLoc;
int code;
(void)dummy;
if (objc != 2) {
Tcl_WrongNumArgs(interp, 1, objv, "channelId");
@@ -662,7 +669,7 @@ Tcl_TellObjCmd(
/* ARGSUSED */
int
Tcl_CloseObjCmd(
ClientData clientData, /* Not used. */
ClientData dummy, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
@@ -672,6 +679,7 @@ Tcl_CloseObjCmd(
"read", "write", NULL
};
static const int dirArray[] = {TCL_CLOSE_READ, TCL_CLOSE_WRITE};
(void)dummy;
if ((objc != 2) && (objc != 3)) {
Tcl_WrongNumArgs(interp, 1, objv, "channelId ?direction?");
@@ -711,7 +719,7 @@ Tcl_CloseObjCmd(
/*
* Special handling is needed if and only if the channel mode supports
* more than the direction to close. Because if the close the last
* direction suppported we can and will go through the regular
* direction supported we can and will go through the regular
* process.
*/
@@ -771,7 +779,7 @@ Tcl_CloseObjCmd(
/* ARGSUSED */
int
Tcl_FconfigureObjCmd(
ClientData clientData, /* Not used. */
ClientData dummy, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
@@ -779,6 +787,7 @@ Tcl_FconfigureObjCmd(
const char *optionName, *valueName;
Tcl_Channel chan; /* The channel to set a mode on. */
int i; /* Iterate over arg-value pairs. */
(void)dummy;
if ((objc < 2) || (((objc % 2) == 1) && (objc != 3))) {
Tcl_WrongNumArgs(interp, 1, objv, "channelId ?-option value ...?");
@@ -847,12 +856,13 @@ Tcl_FconfigureObjCmd(
/* ARGSUSED */
int
Tcl_EofObjCmd(
ClientData unused, /* Not used. */
ClientData dummy, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
{
Tcl_Channel chan;
(void)dummy;
if (objc != 2) {
Tcl_WrongNumArgs(interp, 1, objv, "channelId");
@@ -905,6 +915,7 @@ Tcl_ExecObjCmd(
enum options {
EXEC_IGNORESTDERR, EXEC_KEEPNEWLINE, EXEC_LAST
};
(void)dummy;
/*
* Check for any leading option arguments.
@@ -952,7 +963,7 @@ Tcl_ExecObjCmd(
*/
argc = objc - skip;
argv = TclStackAlloc(interp, (argc + 1) * sizeof(char *));
argv = (const char **)TclStackAlloc(interp, (argc + 1) * sizeof(char *));
/*
* Copy the string conversions of each (post option) object into the
@@ -1055,13 +1066,14 @@ Tcl_ExecObjCmd(
/* ARGSUSED */
int
Tcl_FblockedObjCmd(
ClientData unused, /* Not used. */
ClientData dummy, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
{
Tcl_Channel chan;
int mode;
(void)dummy;
if (objc != 2) {
Tcl_WrongNumArgs(interp, 1, objv, "channelId");
@@ -1102,7 +1114,7 @@ Tcl_FblockedObjCmd(
/* ARGSUSED */
int
Tcl_OpenObjCmd(
ClientData notUsed, /* Not used. */
ClientData dummy, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
@@ -1110,6 +1122,7 @@ Tcl_OpenObjCmd(
int pipeline, prot;
const char *modeString, *what;
Tcl_Channel chan;
(void)dummy;
if ((objc < 2) || (objc > 4)) {
Tcl_WrongNumArgs(interp, 1, objv, "fileName ?access? ?permissions?");
@@ -1228,15 +1241,16 @@ static void
TcpAcceptCallbacksDeleteProc(
ClientData clientData, /* Data which was passed when the assocdata
* was registered. */
Tcl_Interp *interp) /* Interpreter being deleted - not used. */
Tcl_Interp *dummy) /* Interpreter being deleted - not used. */
{
Tcl_HashTable *hTblPtr = clientData;
Tcl_HashTable *hTblPtr = (Tcl_HashTable *)clientData;
Tcl_HashEntry *hPtr;
Tcl_HashSearch hSearch;
(void)dummy;
for (hPtr = Tcl_FirstHashEntry(hTblPtr, &hSearch);
hPtr != NULL; hPtr = Tcl_NextHashEntry(&hSearch)) {
AcceptCallback *acceptCallbackPtr = Tcl_GetHashValue(hPtr);
AcceptCallback *acceptCallbackPtr = (AcceptCallback *)Tcl_GetHashValue(hPtr);
acceptCallbackPtr->interp = NULL;
}
@@ -1278,10 +1292,10 @@ RegisterTcpServerInterpCleanup(
Tcl_HashEntry *hPtr; /* Entry for this record. */
int isNew; /* Is the entry new? */
hTblPtr = Tcl_GetAssocData(interp, "tclTCPAcceptCallbacks", NULL);
hTblPtr = (Tcl_HashTable *)Tcl_GetAssocData(interp, "tclTCPAcceptCallbacks", NULL);
if (hTblPtr == NULL) {
hTblPtr = ckalloc(sizeof(Tcl_HashTable));
hTblPtr = (Tcl_HashTable *)ckalloc(sizeof(Tcl_HashTable));
Tcl_InitHashTable(hTblPtr, TCL_ONE_WORD_KEYS);
Tcl_SetAssocData(interp, "tclTCPAcceptCallbacks",
TcpAcceptCallbacksDeleteProc, hTblPtr);
@@ -1324,7 +1338,7 @@ UnregisterTcpServerInterpCleanupProc(
Tcl_HashTable *hTblPtr;
Tcl_HashEntry *hPtr;
hTblPtr = Tcl_GetAssocData(interp, "tclTCPAcceptCallbacks", NULL);
hTblPtr = (Tcl_HashTable *)Tcl_GetAssocData(interp, "tclTCPAcceptCallbacks", NULL);
if (hTblPtr == NULL) {
return;
}
@@ -1362,7 +1376,7 @@ AcceptCallbackProc(
char *address, /* Address of client that was accepted. */
int port) /* Port of client that was accepted. */
{
AcceptCallback *acceptCallbackPtr = callbackData;
AcceptCallback *acceptCallbackPtr = (AcceptCallback *)callbackData;
/*
* Check if the callback is still valid; the interpreter may have gone
@@ -1448,7 +1462,7 @@ TcpServerCloseProc(
ClientData callbackData) /* The data passed in the call to
* Tcl_CreateCloseHandler. */
{
AcceptCallback *acceptCallbackPtr = callbackData;
AcceptCallback *acceptCallbackPtr = (AcceptCallback *)callbackData;
/* The actual data. */
if (acceptCallbackPtr->interp != NULL) {
@@ -1478,7 +1492,7 @@ TcpServerCloseProc(
int
Tcl_SocketObjCmd(
ClientData notUsed, /* Not used. */
ClientData dummy, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
@@ -1497,6 +1511,7 @@ Tcl_SocketObjCmd(
const char *host, *port, *myaddr = NULL;
Tcl_Obj *script = NULL;
Tcl_Channel chan;
(void)dummy;
if (TclpHasSockets(interp) != TCL_OK) {
return TCL_ERROR;
@@ -1652,7 +1667,7 @@ Tcl_SocketObjCmd(
port = TclGetString(objv[a]);
if (server) {
AcceptCallback *acceptCallbackPtr = ckalloc(sizeof(AcceptCallback));
AcceptCallback *acceptCallbackPtr = (AcceptCallback *)ckalloc(sizeof(AcceptCallback));
Tcl_IncrRefCount(script);
acceptCallbackPtr->script = script;
@@ -1731,6 +1746,7 @@ Tcl_FcopyObjCmd(
Tcl_Obj *cmdPtr;
static const char *const switches[] = { "-size", "-command", NULL };
enum { FcopySize, FcopyCommand };
(void)dummy;
if ((objc < 3) || (objc > 7) || (objc == 4) || (objc == 6)) {
Tcl_WrongNumArgs(interp, 1, objv,
@@ -1816,7 +1832,7 @@ Tcl_FcopyObjCmd(
/* ARGSUSED */
static int
ChanPendingObjCmd(
ClientData unused, /* Not used. */
ClientData dummy, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
@@ -1825,6 +1841,7 @@ ChanPendingObjCmd(
int index, mode;
static const char *const options[] = {"input", "output", NULL};
enum options {PENDING_INPUT, PENDING_OUTPUT};
(void)dummy;
if (objc != 3) {
Tcl_WrongNumArgs(interp, 1, objv, "mode channelId");
@@ -1885,6 +1902,7 @@ ChanTruncateObjCmd(
{
Tcl_Channel chan;
Tcl_WideInt length;
(void)dummy;
if ((objc < 2) || (objc > 3)) {
Tcl_WrongNumArgs(interp, 1, objv, "channelId ?length?");
@@ -1959,6 +1977,7 @@ ChanPipeObjCmd(
Tcl_Channel rchan, wchan;
const char *channelNames[2];
Tcl_Obj *resultPtr;
(void)dummy;
if (objc != 1) {
Tcl_WrongNumArgs(interp, 1, objv, "");
@@ -2002,11 +2021,12 @@ ChanPipeObjCmd(
int
TclChannelNamesCmd(
ClientData clientData,
ClientData dummy,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
{
(void)dummy;
if (objc < 1 || objc > 2) {
Tcl_WrongNumArgs(interp, 1, objv, "?pattern?");
return TCL_ERROR;
+15 -15
View File
@@ -287,7 +287,7 @@ TclChannelTransform(
* regime of the underlying channel and to use the same for us too.
*/
dataPtr = ckalloc(sizeof(TransformChannelData));
dataPtr = (TransformChannelData *)ckalloc(sizeof(TransformChannelData));
dataPtr->refCount = 1;
Tcl_DStringInit(&ds);
@@ -503,7 +503,7 @@ TransformBlockModeProc(
ClientData instanceData, /* State of transformation. */
int mode) /* New blocking mode. */
{
TransformChannelData *dataPtr = instanceData;
TransformChannelData *dataPtr = (TransformChannelData *)instanceData;
if (mode == TCL_MODE_NONBLOCKING) {
dataPtr->flags |= CHANNEL_ASYNC;
@@ -535,7 +535,7 @@ TransformCloseProc(
ClientData instanceData,
Tcl_Interp *interp)
{
TransformChannelData *dataPtr = instanceData;
TransformChannelData *dataPtr = (TransformChannelData *)instanceData;
/*
* Important: In this procedure 'dataPtr->self' already points to the
@@ -616,7 +616,7 @@ TransformInputProc(
int toRead,
int *errorCodePtr)
{
TransformChannelData *dataPtr = instanceData;
TransformChannelData *dataPtr = (TransformChannelData *)instanceData;
int gotBytes, read, copied;
Tcl_Channel downChan;
@@ -783,7 +783,7 @@ TransformOutputProc(
int toWrite,
int *errorCodePtr)
{
TransformChannelData *dataPtr = instanceData;
TransformChannelData *dataPtr = (TransformChannelData *)instanceData;
/*
* Should assert(dataPtr->mode & TCL_WRITABLE);
@@ -835,7 +835,7 @@ TransformSeekProc(
int mode, /* How to move. */
int *errorCodePtr) /* Location of error flag. */
{
TransformChannelData *dataPtr = instanceData;
TransformChannelData *dataPtr = (TransformChannelData *)instanceData;
Tcl_Channel parent = Tcl_GetStackedChannel(dataPtr->self);
const Tcl_ChannelType *parentType = Tcl_GetChannelType(parent);
Tcl_DriverSeekProc *parentSeekProc = Tcl_ChannelSeekProc(parentType);
@@ -902,7 +902,7 @@ TransformWideSeekProc(
int mode, /* How to move. */
int *errorCodePtr) /* Location of error flag. */
{
TransformChannelData *dataPtr = instanceData;
TransformChannelData *dataPtr = (TransformChannelData *)instanceData;
Tcl_Channel parent = Tcl_GetStackedChannel(dataPtr->self);
const Tcl_ChannelType *parentType = Tcl_GetChannelType(parent);
Tcl_DriverSeekProc *parentSeekProc = Tcl_ChannelSeekProc(parentType);
@@ -994,7 +994,7 @@ TransformSetOptionProc(
const char *optionName,
const char *value)
{
TransformChannelData *dataPtr = instanceData;
TransformChannelData *dataPtr = (TransformChannelData *)instanceData;
Tcl_Channel downChan = Tcl_GetStackedChannel(dataPtr->self);
Tcl_DriverSetOptionProc *setOptionProc;
@@ -1032,7 +1032,7 @@ TransformGetOptionProc(
const char *optionName,
Tcl_DString *dsPtr)
{
TransformChannelData *dataPtr = instanceData;
TransformChannelData *dataPtr = (TransformChannelData *)instanceData;
Tcl_Channel downChan = Tcl_GetStackedChannel(dataPtr->self);
Tcl_DriverGetOptionProc *getOptionProc;
@@ -1078,7 +1078,7 @@ TransformWatchProc(
ClientData instanceData, /* Channel to watch. */
int mask) /* Events of interest. */
{
TransformChannelData *dataPtr = instanceData;
TransformChannelData *dataPtr = (TransformChannelData *)instanceData;
Tcl_Channel downChan;
/*
@@ -1157,7 +1157,7 @@ TransformGetFileHandleProc(
int direction, /* Direction of interest. */
ClientData *handlePtr) /* Place to store the handle into. */
{
TransformChannelData *dataPtr = instanceData;
TransformChannelData *dataPtr = (TransformChannelData *)instanceData;
/*
* Return the handle belonging to parent channel. IOW, pass the request
@@ -1191,7 +1191,7 @@ TransformNotifyProc(
* transformation. */
int mask) /* The mask of occuring events. */
{
TransformChannelData *dataPtr = clientData;
TransformChannelData *dataPtr = (TransformChannelData *)clientData;
/*
* An event occured in the underlying channel. This transformation doesn't
@@ -1234,7 +1234,7 @@ static void
TransformChannelHandlerTimer(
ClientData clientData) /* Transformation to query. */
{
TransformChannelData *dataPtr = clientData;
TransformChannelData *dataPtr = (TransformChannelData *)clientData;
dataPtr->timer = NULL;
if (!(dataPtr->watchMask&TCL_READABLE) || ResultEmpty(&dataPtr->result)) {
@@ -1416,10 +1416,10 @@ ResultAdd(
if (r->allocated == 0) {
r->allocated = toWrite + INCREMENT;
r->buf = ckalloc(r->allocated);
r->buf = (unsigned char *)ckalloc(r->allocated);
} else {
r->allocated += toWrite + INCREMENT;
r->buf = ckrealloc(r->buf, r->allocated);
r->buf = (unsigned char *)ckrealloc(r->buf, r->allocated);
}
}
+41 -36
View File
@@ -492,7 +492,7 @@ static const char *msg_dstlost = "-code 1 -level 0 -errorcode NONE -errorinfo
int
TclChanCreateObjCmd(
ClientData clientData,
ClientData dummy,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const *objv)
@@ -518,6 +518,7 @@ TclChanCreateObjCmd(
* this interp. */
Tcl_HashEntry *hPtr; /* Entry in the above map */
int isNew; /* Placeholder. */
(void)dummy;
/*
* Syntax: chan create MODE CMDPREFIX
@@ -681,7 +682,7 @@ TclChanCreateObjCmd(
* as the actual channel type.
*/
Tcl_ChannelType *clonePtr = ckalloc(sizeof(Tcl_ChannelType));
Tcl_ChannelType *clonePtr = (Tcl_ChannelType *)ckalloc(sizeof(Tcl_ChannelType));
memcpy(clonePtr, &tclRChannelType, sizeof(Tcl_ChannelType));
@@ -781,6 +782,7 @@ ReflectEventRun(
*/
ReflectEvent *e = (ReflectEvent *) ev;
(void)flags;
Tcl_NotifyChannel(e->rcPtr->chan, e->events);
return 1;
@@ -809,7 +811,7 @@ ReflectEventDelete(
int
TclChanPostEventObjCmd(
ClientData clientData,
ClientData dummy,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const *objv)
@@ -838,6 +840,7 @@ TclChanPostEventObjCmd(
ReflectedChannelMap *rcmPtr;/* Map of reflected channels with handlers in
* this interp. */
Tcl_HashEntry *hPtr; /* Entry in the above map */
(void)dummy;
/*
* Number of arguments...
@@ -882,7 +885,7 @@ TclChanPostEventObjCmd(
* have gone seriously haywire.
*/
chan = Tcl_GetHashValue(hPtr);
chan = (Tcl_Channel)Tcl_GetHashValue(hPtr);
chanTypePtr = Tcl_GetChannelType(chan);
/*
@@ -898,7 +901,7 @@ TclChanPostEventObjCmd(
Tcl_Panic("TclChanPostEventObjCmd: channel is not a reflected channel");
}
rcPtr = Tcl_GetChannelInstanceData(chan);
rcPtr = (ReflectedChannel *)Tcl_GetChannelInstanceData(chan);
if (rcPtr->interp != interp) {
Tcl_Panic("TclChanPostEventObjCmd: postevent accepted for call from outside interpreter");
@@ -945,7 +948,7 @@ TclChanPostEventObjCmd(
}
#if TCL_THREADS
} else {
ReflectEvent *ev = ckalloc(sizeof(ReflectEvent));
ReflectEvent *ev = (ReflectEvent *)ckalloc(sizeof(ReflectEvent));
ev->header.proc = ReflectEventRun;
ev->events = events;
@@ -994,7 +997,7 @@ static void
TimerRunRead(
ClientData clientData)
{
ReflectedChannel *rcPtr = clientData;
ReflectedChannel *rcPtr = (ReflectedChannel *)clientData;
rcPtr->readTimer = NULL;
Tcl_NotifyChannel(rcPtr->chan, TCL_READABLE);
}
@@ -1003,7 +1006,7 @@ static void
TimerRunWrite(
ClientData clientData)
{
ReflectedChannel *rcPtr = clientData;
ReflectedChannel *rcPtr = (ReflectedChannel *)clientData;
rcPtr->writeTimer = NULL;
Tcl_NotifyChannel(rcPtr->chan, TCL_WRITABLE);
}
@@ -1152,7 +1155,7 @@ ReflectClose(
ClientData clientData,
Tcl_Interp *interp)
{
ReflectedChannel *rcPtr = clientData;
ReflectedChannel *rcPtr = (ReflectedChannel *)clientData;
int result; /* Result code for 'close' */
Tcl_Obj *resObj; /* Result data for 'close' */
ReflectedChannelMap *rcmPtr;/* Map of reflected channels with handlers in
@@ -1309,7 +1312,7 @@ ReflectInput(
int toRead,
int *errorCodePtr)
{
ReflectedChannel *rcPtr = clientData;
ReflectedChannel *rcPtr = (ReflectedChannel *)clientData;
Tcl_Obj *toReadObj;
int bytec; /* Number of returned bytes */
unsigned char *bytev; /* Array of returned bytes */
@@ -1416,7 +1419,7 @@ ReflectOutput(
int toWrite,
int *errorCodePtr)
{
ReflectedChannel *rcPtr = clientData;
ReflectedChannel *rcPtr = (ReflectedChannel *)clientData;
Tcl_Obj *bufObj;
Tcl_Obj *resObj; /* Result data for 'write' */
int written;
@@ -1545,7 +1548,7 @@ ReflectSeekWide(
int seekMode,
int *errorCodePtr)
{
ReflectedChannel *rcPtr = clientData;
ReflectedChannel *rcPtr = (ReflectedChannel *)clientData;
Tcl_Obj *offObj, *baseObj;
Tcl_Obj *resObj; /* Result for 'seek' */
Tcl_WideInt newLoc;
@@ -1654,7 +1657,7 @@ ReflectWatch(
ClientData clientData,
int mask)
{
ReflectedChannel *rcPtr = clientData;
ReflectedChannel *rcPtr = (ReflectedChannel *)clientData;
Tcl_Obj *maskObj;
/*
@@ -1726,7 +1729,7 @@ ReflectBlock(
ClientData clientData,
int nonblocking)
{
ReflectedChannel *rcPtr = clientData;
ReflectedChannel *rcPtr = (ReflectedChannel *)clientData;
Tcl_Obj *blockObj;
int errorNum; /* EINVAL or EOK (success). */
Tcl_Obj *resObj; /* Result data for 'blocking' */
@@ -1793,7 +1796,7 @@ ReflectThread(
ClientData clientData,
int action)
{
ReflectedChannel *rcPtr = clientData;
ReflectedChannel *rcPtr = (ReflectedChannel *)clientData;
switch (action) {
case TCL_CHANNEL_THREAD_INSERT:
@@ -1832,7 +1835,7 @@ ReflectSetOption(
const char *optionName, /* Name of requested option */
const char *newValue) /* The new value */
{
ReflectedChannel *rcPtr = clientData;
ReflectedChannel *rcPtr = (ReflectedChannel *)clientData;
Tcl_Obj *optionObj, *valueObj;
int result; /* Result code for 'configure' */
Tcl_Obj *resObj; /* Result data for 'configure' */
@@ -1909,7 +1912,7 @@ ReflectGetOption(
* The bypass functions are not required.
*/
ReflectedChannel *rcPtr = clientData;
ReflectedChannel *rcPtr = (ReflectedChannel *)clientData;
Tcl_Obj *optionObj;
Tcl_Obj *resObj; /* Result data for 'configure' */
int listc, result = TCL_OK;
@@ -1922,7 +1925,7 @@ ReflectGetOption(
#if TCL_THREADS
if (rcPtr->thread != Tcl_GetCurrentThread()) {
int opcode;
ForwardedOperation opcode;
ForwardParam p;
p.getOpt.name = optionName;
@@ -2174,9 +2177,9 @@ NewReflectedChannel(
Tcl_Obj *handleObj)
{
ReflectedChannel *rcPtr;
MethodName mn = METH_BLOCKING;
int mn = 0;
rcPtr = ckalloc(sizeof(ReflectedChannel));
rcPtr = (ReflectedChannel *)ckalloc(sizeof(ReflectedChannel));
/* rcPtr->chan: Assigned by caller. Dummy data here. */
@@ -2195,7 +2198,7 @@ NewReflectedChannel(
rcPtr->cmd = TclListObjCopy(NULL, cmdpfxObj);
Tcl_IncrRefCount(rcPtr->cmd);
rcPtr->methods = Tcl_NewListObj(METH_WRITE + 1, NULL);
while (mn <= METH_WRITE) {
while (mn <= (int)METH_WRITE) {
Tcl_ListObjAppendElement(NULL, rcPtr->methods,
Tcl_NewStringObj(methodNames[mn++], -1));
}
@@ -2496,10 +2499,10 @@ static ReflectedChannelMap *
GetReflectedChannelMap(
Tcl_Interp *interp)
{
ReflectedChannelMap *rcmPtr = Tcl_GetAssocData(interp, RCMKEY, NULL);
ReflectedChannelMap *rcmPtr = (ReflectedChannelMap *)Tcl_GetAssocData(interp, RCMKEY, NULL);
if (rcmPtr == NULL) {
rcmPtr = ckalloc(sizeof(ReflectedChannelMap));
rcmPtr = (ReflectedChannelMap *)ckalloc(sizeof(ReflectedChannelMap));
Tcl_InitHashTable(&rcmPtr->map, TCL_STRING_KEYS);
Tcl_SetAssocData(interp, RCMKEY,
(Tcl_InterpDeleteProc *) DeleteReflectedChannelMap, rcmPtr);
@@ -2554,7 +2557,7 @@ DeleteReflectedChannelMap(
ClientData clientData, /* The per-interpreter data structure. */
Tcl_Interp *interp) /* The interpreter being deleted. */
{
ReflectedChannelMap *rcmPtr = clientData;
ReflectedChannelMap *rcmPtr = (ReflectedChannelMap *)clientData;
/* The map */
Tcl_HashSearch hSearch; /* Search variable. */
Tcl_HashEntry *hPtr; /* Search variable. */
@@ -2581,8 +2584,8 @@ DeleteReflectedChannelMap(
for (hPtr = Tcl_FirstHashEntry(&rcmPtr->map, &hSearch);
hPtr != NULL;
hPtr = Tcl_FirstHashEntry(&rcmPtr->map, &hSearch)) {
chan = Tcl_GetHashValue(hPtr);
rcPtr = Tcl_GetChannelInstanceData(chan);
chan = (Tcl_Channel)Tcl_GetHashValue(hPtr);
rcPtr = (ReflectedChannel *)Tcl_GetChannelInstanceData(chan);
MarkDead(rcPtr);
Tcl_DeleteHashEntry(hPtr);
@@ -2659,8 +2662,8 @@ DeleteReflectedChannelMap(
for (hPtr = Tcl_FirstHashEntry(&rcmPtr->map, &hSearch);
hPtr != NULL;
hPtr = Tcl_NextHashEntry(&hSearch)) {
chan = Tcl_GetHashValue(hPtr);
rcPtr = Tcl_GetChannelInstanceData(chan);
chan = (Tcl_Channel)Tcl_GetHashValue(hPtr);
rcPtr = (ReflectedChannel *)Tcl_GetChannelInstanceData(chan);
if (rcPtr->interp != interp) {
/*
@@ -2700,7 +2703,7 @@ GetThreadReflectedChannelMap(void)
ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey);
if (!tsdPtr->rcmPtr) {
tsdPtr->rcmPtr = ckalloc(sizeof(ReflectedChannelMap));
tsdPtr->rcmPtr = (ReflectedChannelMap *)ckalloc(sizeof(ReflectedChannelMap));
Tcl_InitHashTable(&tsdPtr->rcmPtr->map, TCL_STRING_KEYS);
Tcl_CreateThreadExitHandler(DeleteThreadReflectedChannelMap, NULL);
}
@@ -2728,13 +2731,14 @@ GetThreadReflectedChannelMap(void)
static void
DeleteThreadReflectedChannelMap(
ClientData clientData) /* The per-thread data structure. */
ClientData dummy) /* The per-thread data structure. */
{
Tcl_HashSearch hSearch; /* Search variable. */
Tcl_HashEntry *hPtr; /* Search variable. */
Tcl_ThreadId self = Tcl_GetCurrentThread();
ReflectedChannelMap *rcmPtr; /* The map */
ForwardingResult *resultPtr;
(void)dummy;
/*
* The origin thread for one or more reflected channels is gone.
@@ -2817,8 +2821,8 @@ DeleteThreadReflectedChannelMap(
for (hPtr = Tcl_FirstHashEntry(&rcmPtr->map, &hSearch);
hPtr != NULL;
hPtr = Tcl_FirstHashEntry(&rcmPtr->map, &hSearch)) {
Tcl_Channel chan = Tcl_GetHashValue(hPtr);
ReflectedChannel *rcPtr = Tcl_GetChannelInstanceData(chan);
Tcl_Channel chan = (Tcl_Channel)Tcl_GetHashValue(hPtr);
ReflectedChannel *rcPtr = (ReflectedChannel *)Tcl_GetChannelInstanceData(chan);
MarkDead(rcPtr);
Tcl_DeleteHashEntry(hPtr);
@@ -2863,8 +2867,8 @@ ForwardOpToHandlerThread(
* Create and initialize the event and data structures.
*/
evPtr = ckalloc(sizeof(ForwardingEvent));
resultPtr = ckalloc(sizeof(ForwardingResult));
evPtr = (ForwardingEvent *)ckalloc(sizeof(ForwardingEvent));
resultPtr = (ForwardingResult *)ckalloc(sizeof(ForwardingResult));
evPtr->event.proc = ForwardProc;
evPtr->resultPtr = resultPtr;
@@ -2981,6 +2985,7 @@ ForwardProc(
ReflectedChannelMap *rcmPtr;/* Map of reflected channels with handlers in
* this interp. */
Tcl_HashEntry *hPtr; /* Entry in the above map */
(void)mask;
/*
* Ignore the event if no one is waiting for its result anymore.
@@ -3241,7 +3246,7 @@ ForwardProc(
* Odd number of elements is wrong. [x].
*/
char *buf = ckalloc(200);
char *buf = (char *)ckalloc(200);
sprintf(buf,
"{Expected list with even number of elements, got %d %s instead}",
listc, (listc == 1 ? "element" : "elements"));
@@ -3298,7 +3303,7 @@ static void
SrcExitProc(
ClientData clientData)
{
ForwardingEvent *evPtr = clientData;
ForwardingEvent *evPtr = (ForwardingEvent *)clientData;
ForwardingResult *resultPtr;
ForwardParam *paramPtr;
+38 -65
View File
@@ -27,10 +27,6 @@
#define EOK 0
#endif
/* DUPLICATE of HaveVersion() in tclIO.c // TODO - MODULE_SCOPE */
static int HaveVersion(const Tcl_ChannelType *typePtr,
Tcl_ChannelTypeVersion minimumVersion);
/*
* Signatures of all functions used in the C layer of the reflection.
*/
@@ -501,7 +497,7 @@ static int TransformLimit(ReflectedTransform *rtPtr,
int
TclChanPushObjCmd(
ClientData clientData,
ClientData dummy,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const *objv)
@@ -528,6 +524,7 @@ TclChanPushObjCmd(
* in this interp. */
Tcl_HashEntry *hPtr; /* Entry in the above map */
int isNew; /* Placeholder. */
(void)dummy;
/*
* Syntax: chan push CHANNEL CMDPREFIX
@@ -746,7 +743,7 @@ TclChanPushObjCmd(
int
TclChanPopObjCmd(
ClientData clientData,
ClientData dummy,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const *objv)
@@ -764,6 +761,7 @@ TclChanPopObjCmd(
const char *chanId; /* Tcl level channel handle */
Tcl_Channel chan; /* Channel associated to the handle */
int mode; /* Channel r/w mode */
(void)dummy;
/*
* Number of arguments...
@@ -885,7 +883,7 @@ ReflectClose(
ClientData clientData,
Tcl_Interp *interp)
{
ReflectedTransform *rtPtr = clientData;
ReflectedTransform *rtPtr = (ReflectedTransform *)clientData;
int errorCode, errorCodeSet = 0;
int result = TCL_OK; /* Result code for 'close' */
Tcl_Obj *resObj; /* Result data for 'close' */
@@ -1061,7 +1059,7 @@ ReflectInput(
int toRead,
int *errorCodePtr)
{
ReflectedTransform *rtPtr = clientData;
ReflectedTransform *rtPtr = (ReflectedTransform *)clientData;
int gotBytes, copied, readBytes;
Tcl_Obj *bufObj;
@@ -1254,7 +1252,7 @@ ReflectOutput(
int toWrite,
int *errorCodePtr)
{
ReflectedTransform *rtPtr = clientData;
ReflectedTransform *rtPtr = (ReflectedTransform *)clientData;
/*
* The following check can be done before thread redirection, because we
@@ -1327,7 +1325,7 @@ ReflectSeekWide(
int seekMode,
int *errorCodePtr)
{
ReflectedTransform *rtPtr = clientData;
ReflectedTransform *rtPtr = (ReflectedTransform *)clientData;
Channel *parent = (Channel *) rtPtr->parent;
Tcl_WideInt curPos; /* Position on the device. */
@@ -1386,15 +1384,14 @@ ReflectSeekWide(
* non-NULL...
*/
if (HaveVersion(parent->typePtr, TCL_CHANNEL_VERSION_3) &&
parent->typePtr->wideSeekProc != NULL) {
curPos = parent->typePtr->wideSeekProc(parent->instanceData, offset,
if (Tcl_ChannelWideSeekProc(parent->typePtr) != NULL) {
curPos = Tcl_ChannelWideSeekProc(parent->typePtr)(parent->instanceData, offset,
seekMode, errorCodePtr);
} else if (offset < LONG_MIN || offset > LONG_MAX) {
*errorCodePtr = EOVERFLOW;
curPos = -1;
} else {
curPos = parent->typePtr->seekProc(
curPos = Tcl_ChannelSeekProc(parent->typePtr)(
parent->instanceData, offset, seekMode,
errorCodePtr);
}
@@ -1447,7 +1444,7 @@ ReflectWatch(
ClientData clientData,
int mask)
{
ReflectedTransform *rtPtr = clientData;
ReflectedTransform *rtPtr = (ReflectedTransform *)clientData;
Tcl_DriverWatchProc *watchProc;
watchProc = Tcl_ChannelWatchProc(Tcl_GetChannelType(rtPtr->parent));
@@ -1498,7 +1495,7 @@ ReflectBlock(
ClientData clientData,
int nonblocking)
{
ReflectedTransform *rtPtr = clientData;
ReflectedTransform *rtPtr = (ReflectedTransform *)clientData;
/*
* Transformations simply record the blocking mode in their C level
@@ -1533,7 +1530,7 @@ ReflectSetOption(
const char *optionName, /* Name of requested option */
const char *newValue) /* The new value */
{
ReflectedTransform *rtPtr = clientData;
ReflectedTransform *rtPtr = (ReflectedTransform *)clientData;
/*
* Transformations have no options. Thus the call is passed down unchanged
@@ -1575,7 +1572,7 @@ ReflectGetOption(
const char *optionName, /* Name of reuqested option */
Tcl_DString *dsPtr) /* String to place the result into */
{
ReflectedTransform *rtPtr = clientData;
ReflectedTransform *rtPtr = (ReflectedTransform *)clientData;
/*
* Transformations have no options. Thus the call is passed down unchanged
@@ -1623,7 +1620,7 @@ ReflectHandle(
int direction,
ClientData *handlePtr)
{
ReflectedTransform *rtPtr = clientData;
ReflectedTransform *rtPtr = (ReflectedTransform *)clientData;
/*
* Transformations have no handle of their own. As such we simply query
@@ -1658,7 +1655,7 @@ ReflectNotify(
ClientData clientData,
int mask)
{
ReflectedTransform *rtPtr = clientData;
ReflectedTransform *rtPtr = (ReflectedTransform *)clientData;
/*
* An event occured in the underlying channel.
@@ -1758,8 +1755,9 @@ NewReflectedTransform(
int listc;
Tcl_Obj **listv;
int i;
(void)mode;
rtPtr = ckalloc(sizeof(ReflectedTransform));
rtPtr = (ReflectedTransform *)ckalloc(sizeof(ReflectedTransform));
/* rtPtr->chan: Assigned by caller. Dummy data here. */
/* rtPtr->methods: Assigned by caller. Dummy data here. */
@@ -1806,7 +1804,7 @@ NewReflectedTransform(
*/
rtPtr->argc = listc + 2;
rtPtr->argv = ckalloc(sizeof(Tcl_Obj *) * (listc+4));
rtPtr->argv = (Tcl_Obj **)ckalloc(sizeof(Tcl_Obj *) * (listc+4));
/*
* Duplicate object references.
@@ -2111,10 +2109,10 @@ static ReflectedTransformMap *
GetReflectedTransformMap(
Tcl_Interp *interp)
{
ReflectedTransformMap *rtmPtr = Tcl_GetAssocData(interp, RTMKEY, NULL);
ReflectedTransformMap *rtmPtr = (ReflectedTransformMap *)Tcl_GetAssocData(interp, RTMKEY, NULL);
if (rtmPtr == NULL) {
rtmPtr = ckalloc(sizeof(ReflectedTransformMap));
rtmPtr = (ReflectedTransformMap *)ckalloc(sizeof(ReflectedTransformMap));
Tcl_InitHashTable(&rtmPtr->map, TCL_STRING_KEYS);
Tcl_SetAssocData(interp, RTMKEY,
(Tcl_InterpDeleteProc *) DeleteReflectedTransformMap, rtmPtr);
@@ -2169,11 +2167,11 @@ DeleteReflectedTransformMap(
* this interp.
*/
rtmPtr = clientData;
rtmPtr = (ReflectedTransformMap *)clientData;
for (hPtr = Tcl_FirstHashEntry(&rtmPtr->map, &hSearch);
hPtr != NULL;
hPtr = Tcl_FirstHashEntry(&rtmPtr->map, &hSearch)) {
rtPtr = Tcl_GetHashValue(hPtr);
rtPtr = (ReflectedTransform *)Tcl_GetHashValue(hPtr);
rtPtr->dead = 1;
Tcl_DeleteHashEntry(hPtr);
@@ -2197,7 +2195,7 @@ DeleteReflectedTransformMap(
for (hPtr = Tcl_FirstHashEntry(&rtmPtr->map, &hSearch);
hPtr != NULL;
hPtr = Tcl_NextHashEntry(&hSearch)) {
rtPtr = Tcl_GetHashValue(hPtr);
rtPtr = (ReflectedTransform *)Tcl_GetHashValue(hPtr);
if (rtPtr->interp != interp) {
/*
@@ -2277,7 +2275,7 @@ GetThreadReflectedTransformMap(void)
ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey);
if (!tsdPtr->rtmPtr) {
tsdPtr->rtmPtr = ckalloc(sizeof(ReflectedTransformMap));
tsdPtr->rtmPtr = (ReflectedTransformMap *)ckalloc(sizeof(ReflectedTransformMap));
Tcl_InitHashTable(&tsdPtr->rtmPtr->map, TCL_STRING_KEYS);
Tcl_CreateThreadExitHandler(DeleteThreadReflectedTransformMap, NULL);
}
@@ -2305,13 +2303,14 @@ GetThreadReflectedTransformMap(void)
static void
DeleteThreadReflectedTransformMap(
ClientData clientData) /* The per-thread data structure. */
ClientData dummy) /* The per-thread data structure. */
{
Tcl_HashSearch hSearch; /* Search variable. */
Tcl_HashEntry *hPtr; /* Search variable. */
Tcl_ThreadId self = Tcl_GetCurrentThread();
ReflectedTransformMap *rtmPtr; /* The map */
ForwardingResult *resultPtr;
(void)dummy;
/*
* The origin thread for one or more reflected channels is gone.
@@ -2329,7 +2328,7 @@ DeleteThreadReflectedTransformMap(
for (hPtr = Tcl_FirstHashEntry(&rtmPtr->map, &hSearch);
hPtr != NULL;
hPtr = Tcl_FirstHashEntry(&rtmPtr->map, &hSearch)) {
ReflectedTransform *rtPtr = Tcl_GetHashValue(hPtr);
ReflectedTransform *rtPtr = (ReflectedTransform *)Tcl_GetHashValue(hPtr);
rtPtr->dead = 1;
FreeReflectedTransformArgs(rtPtr);
@@ -2412,8 +2411,8 @@ ForwardOpToOwnerThread(
* Create and initialize the event and data structures.
*/
evPtr = ckalloc(sizeof(ForwardingEvent));
resultPtr = ckalloc(sizeof(ForwardingResult));
evPtr = (ForwardingEvent *)ckalloc(sizeof(ForwardingEvent));
resultPtr = (ForwardingResult *)ckalloc(sizeof(ForwardingResult));
evPtr->event.proc = ForwardProc;
evPtr->resultPtr = resultPtr;
@@ -2524,6 +2523,7 @@ ForwardProc(
/* Map of reflected channels with handlers in
* this interp. */
Tcl_HashEntry *hPtr; /* Entry in the above map */
(void)mask;
/*
* Ignore the event if no one is waiting for its result anymore.
@@ -2606,7 +2606,7 @@ ForwardProc(
paramPtr->transform.size = bytec;
if (bytec > 0) {
paramPtr->transform.buf = ckalloc(bytec);
paramPtr->transform.buf = (char *)ckalloc(bytec);
memcpy(paramPtr->transform.buf, bytev, bytec);
} else {
paramPtr->transform.buf = NULL;
@@ -2640,7 +2640,7 @@ ForwardProc(
paramPtr->transform.size = bytec;
if (bytec > 0) {
paramPtr->transform.buf = ckalloc(bytec);
paramPtr->transform.buf = (char *)ckalloc(bytec);
memcpy(paramPtr->transform.buf, bytev, bytec);
} else {
paramPtr->transform.buf = NULL;
@@ -2669,7 +2669,7 @@ ForwardProc(
paramPtr->transform.size = bytec;
if (bytec > 0) {
paramPtr->transform.buf = ckalloc(bytec);
paramPtr->transform.buf = (char *)ckalloc(bytec);
memcpy(paramPtr->transform.buf, bytev, bytec);
} else {
paramPtr->transform.buf = NULL;
@@ -2696,7 +2696,7 @@ ForwardProc(
paramPtr->transform.size = bytec;
if (bytec > 0) {
paramPtr->transform.buf = ckalloc(bytec);
paramPtr->transform.buf = (char *)ckalloc(bytec);
memcpy(paramPtr->transform.buf, bytev, bytec);
} else {
paramPtr->transform.buf = NULL;
@@ -2756,7 +2756,7 @@ static void
SrcExitProc(
ClientData clientData)
{
ForwardingEvent *evPtr = clientData;
ForwardingEvent *evPtr = (ForwardingEvent *)clientData;
ForwardingResult *resultPtr;
ForwardParam *paramPtr;
@@ -2896,7 +2896,7 @@ static void
TimerRun(
ClientData clientData)
{
ReflectedTransform *rtPtr = clientData;
ReflectedTransform *rtPtr = (ReflectedTransform *)clientData;
rtPtr->timer = NULL;
Tcl_NotifyChannel(rtPtr->chan, TCL_READABLE);
@@ -3390,33 +3390,6 @@ TransformLimit(
return 1;
}
/* DUPLICATE of HaveVersion() in tclIO.c
*----------------------------------------------------------------------
*
* HaveVersion --
*
* Return whether a channel type is (at least) of a given version.
*
* Results:
* True if the minimum version is exceeded by the version actually
* present.
*
* Side effects:
* None.
*
*----------------------------------------------------------------------
*/
static int
HaveVersion(
const Tcl_ChannelType *chanTypePtr,
Tcl_ChannelTypeVersion minimumVersion)
{
Tcl_ChannelTypeVersion actualVersion = Tcl_ChannelVersion(chanTypePtr);
return PTR2INT(actualVersion) >= PTR2INT(minimumVersion);
}
/*
* Local Variables:
* mode: c
+39 -33
View File
@@ -82,7 +82,6 @@ static void Disclaim(void);
static void * DivertFindSymbol(Tcl_Interp *interp,
Tcl_LoadHandle loadHandle, const char *symbol);
static void DivertUnloadFile(Tcl_LoadHandle loadHandle);
/*
* Functions that provide native filesystem support. They are private and
@@ -171,7 +170,7 @@ const Tcl_Filesystem tclNativeFilesystem = {
TclpObjCopyDirectory,
TclpObjLstat,
/* Needs casts since we're using version_2. */
(Tcl_FSLoadFileProc *) TclpDlopen,
(Tcl_FSLoadFileProc *)(void *) TclpDlopen,
(Tcl_FSGetCwdProc *) TclpGetNativeCwd,
TclpObjChdir
};
@@ -417,7 +416,7 @@ static void
FsThrExitProc(
ClientData cd)
{
ThreadSpecificData *tsdPtr = cd;
ThreadSpecificData *tsdPtr = (ThreadSpecificData *)cd;
FilesystemRecord *fsRecPtr = NULL, *tmpFsRecPtr = NULL;
/*
@@ -579,7 +578,7 @@ FsRecacheFilesystemList(void)
list = NULL;
fsRecPtr = tmpFsRecPtr;
while (fsRecPtr != NULL) {
tmpFsRecPtr = ckalloc(sizeof(FilesystemRecord));
tmpFsRecPtr = (FilesystemRecord *)ckalloc(sizeof(FilesystemRecord));
*tmpFsRecPtr = *fsRecPtr;
tmpFsRecPtr->nextPtr = list;
tmpFsRecPtr->prevPtr = NULL;
@@ -620,7 +619,7 @@ FsGetFirstFilesystem(void)
}
/*
* The epoch can is changed when a filesystems is added or removed, when
* The epoch can is changed when a filesystems is added or removed, when
* "system encoding" changes, and when env(HOME) changes.
*/
@@ -853,7 +852,7 @@ Tcl_FSRegister(
return TCL_ERROR;
}
newFilesystemPtr = ckalloc(sizeof(FilesystemRecord));
newFilesystemPtr = (FilesystemRecord *)ckalloc(sizeof(FilesystemRecord));
newFilesystemPtr->clientData = clientData;
newFilesystemPtr->fsPtr = fsPtr;
@@ -959,7 +958,7 @@ Tcl_FSUnregister(
* Search in the given pathname for files matching the given pattern.
* Used by [glob]. Processes just one pattern for one directory. Callers
* such as TclGlob and DoGlob implement manage the searching of multiple
* directories in cases such as
* directories in cases such as
* glob -dir $dir -join * pkgIndex.tcl
*
* Results:
@@ -1222,7 +1221,7 @@ FsAddMountsToGlobResult(
*
* The reason for the exception in 2,3 for the native filesystem is that
* the native filesystem claims every file without determining whether
* whether the file exists, or even whether the pathname makes sense.
* whether the file exists, or even whether the pathname makes sense.
*
*----------------------------------------------------------------------
*/
@@ -1240,7 +1239,7 @@ Tcl_FSMountsChanged(
/*
* Increment the filesystem epoch to invalidate every existing cached
* internal representation.
* internal representation.
*/
Tcl_MutexLock(&filesystemMutex);
@@ -1475,7 +1474,7 @@ TclGetOpenModeEx(
const char *modeString, /* Mode string, e.g. "r+" or "RDONLY CREAT" */
int *seekFlagPtr, /* Sets this to 1 to tell the the caller to seek to
* EOF after opening the file, and 0 otherwise. */
int *binaryPtr) /* Sets this to 1 to tell the caller to
int *binaryPtr) /* Sets this to 1 to tell the caller to
* configure the channel for binary
* operations after opening the file. */
{
@@ -1718,7 +1717,7 @@ Tcl_FSEvalFileEx(
}
/*
* The eof character is \32 (^Z). This is standard on Windows, and Tcl
* The eof character is \32 (^Z). This is standard on Windows, and Tcl
* uses it on every platform to allow for scripted documents. [Bug: 2040]
*/
@@ -1854,7 +1853,7 @@ TclNREvalFile(
TclPkgFileSeen(interp, Tcl_GetString(pathPtr));
/*
* The eof character is \32 (^Z). This is standard on Windows, and Tcl
* The eof character is \32 (^Z). This is standard on Windows, and Tcl
* uses it on every platform to allow for scripted documents. [Bug: 2040]
*/
@@ -1933,9 +1932,9 @@ EvalFileCallback(
int result)
{
Interp *iPtr = (Interp *) interp;
Tcl_Obj *oldScriptFile = data[0];
Tcl_Obj *pathPtr = data[1];
Tcl_Obj *objPtr = data[2];
Tcl_Obj *oldScriptFile = (Tcl_Obj *)data[0];
Tcl_Obj *pathPtr = (Tcl_Obj *)data[1];
Tcl_Obj *objPtr = (Tcl_Obj *)data[2];
/*
* Restore the original iPtr->scriptFile value, but because the value may
@@ -2064,7 +2063,7 @@ Tcl_PosixError(
*----------------------------------------------------------------------
*
* Tcl_FSStat --
* Calls 'statProc' of the filesystem corresponding to pathPtr.
* Calls 'statProc' of the filesystem corresponding to pathPtr.
*
* Replaces the standard library routines stat.
*
@@ -2098,7 +2097,7 @@ Tcl_FSStat(
*----------------------------------------------------------------------
*
* Tcl_FSLstat --
* Calls the 'lstatProc' of the filesystem corresponding to pathPtr.
* Calls the 'lstatProc' of the filesystem corresponding to pathPtr.
*
* Replaces the library version of lstat. If the filesystem doesn't
* provide lstatProc but does provide statProc, Tcl falls back to
@@ -2198,7 +2197,7 @@ Tcl_FSOpenFileChannel(
if (Tcl_FSGetNormalizedPath(interp, pathPtr) == NULL) {
/*
* Return the correct error message.
* Return the correct error message.
*/
return NULL;
}
@@ -2318,6 +2317,8 @@ NativeFileAttrStrings(
Tcl_Obj *pathPtr,
Tcl_Obj **objPtrRef)
{
(void)pathPtr;
(void)objPtrRef;
return tclpFileAttrStrings;
}
@@ -2650,7 +2651,7 @@ Tcl_FSGetCwd(
norm = TclFSNormalizeAbsolutePath(interp,retVal);
if (norm != NULL) {
/*
* Assign to global storage the pathname of the current directory
* Assign to global storage the pathname of the current directory
* and copy it into thread-local storage as well.
*
* At system startup multiple threads could in principle
@@ -2953,7 +2954,7 @@ Tcl_FSChdir(
*/
FsUpdateCwd(normDirName, cd);
}
}
} else {
/*
* Tcl_FSGetCwd() synchronizes the file-global cwdPathPtr if
@@ -3017,7 +3018,7 @@ Tcl_FSLoadFile(
/* Places to store pointers to the functions
* named by sym1 and sym2. */
Tcl_LoadHandle *handlePtr, /* A place to store the token for the loaded
* object. Can be passed to
* object. Can be passed to
* (*unloadProcPtr)() to unload the file. */
Tcl_FSUnloadFileProc **unloadProcPtr)
/* A place to store a pointer to the function
@@ -3026,6 +3027,7 @@ Tcl_FSLoadFile(
const char *symbols[3];
void *procPtrs[2];
int res;
(void)unloadProcPtr;
symbols[0] = sym1;
symbols[1] = sym2;
@@ -3049,7 +3051,7 @@ Tcl_FSLoadFile(
*
* Load a dynamic shared object by calling 'loadFileProc' of the
* filesystem corresponding to the given pathname, and then finds within
* the loaded object the functions named in symbols[].
* the loaded object the functions named in symbols[].
*
* The given pathname is passed unmodified to `loadFileProc`, which
* decides how to resolve it. On POSIX systems the native filesystem
@@ -3101,6 +3103,7 @@ skipUnlink(
#ifdef hpux
(void)shlibFile;
return 1;
#else
char *skipstr = getenv("TCL_TEMPLOAD_NO_UNLINK");
@@ -3109,7 +3112,9 @@ skipUnlink(
return atoi(skipstr);
}
#ifdef TCL_TEMPLOAD_NO_UNLINK
#ifndef TCL_TEMPLOAD_NO_UNLINK
(void)shlibFile;
#else
/* At built time TCL_TEMPLOAD_NO_UNLINK can be set manually to control whether
* this automatic overriding of unlink is included.
*/
@@ -3176,7 +3181,7 @@ Tcl_LoadFile(
}
if (fsPtr->loadFileProc != NULL) {
int retVal = ((Tcl_FSLoadFileProc2 *)(fsPtr->loadFileProc))
int retVal = ((Tcl_FSLoadFileProc2 *)(void *)(fsPtr->loadFileProc))
(interp, pathPtr, handlePtr, &unloadProcPtr, flags);
if (retVal == TCL_OK) {
@@ -3194,7 +3199,7 @@ Tcl_LoadFile(
}
/*
* The filesystem doesn't support 'load'. Fall to the following:
* The filesystem doesn't support 'load'. Fall to the following:
*/
/*
@@ -3245,7 +3250,7 @@ Tcl_LoadFile(
Tcl_Close(interp, data);
goto mustCopyToTempAnyway;
}
ret = Tcl_Read(data, buffer, size);
ret = Tcl_Read(data, (char *)buffer, size);
Tcl_Close(interp, data);
ret = TclpLoadMemory(interp, buffer, size, ret, handlePtr,
&unloadProcPtr, flags);
@@ -3360,7 +3365,7 @@ Tcl_LoadFile(
* Divert the unloading in order to unload and cleanup the temporary file.
*/
tvdlPtr = ckalloc(sizeof(FsDivertLoad));
tvdlPtr = (FsDivertLoad *)ckalloc(sizeof(FsDivertLoad));
/*
* Remember three pieces of information in order to clean up the diverted
@@ -3377,7 +3382,7 @@ Tcl_LoadFile(
/*
* This is the filesystem for the temporary file the object was loaded
* from. A reference to copyToPtr is already stored in
* tvdlPtr->divertedFile, so need need to increment the refCount again.
* tvdlPtr->divertedFile, so need need to increment the refCount again.
*/
tvdlPtr->divertedFilesystem = copyFsPtr;
@@ -3401,7 +3406,7 @@ Tcl_LoadFile(
copyToPtr = NULL;
divertedLoadHandle = ckalloc(sizeof(struct Tcl_LoadHandle_));
divertedLoadHandle = (Tcl_LoadHandle)ckalloc(sizeof(struct Tcl_LoadHandle_));
divertedLoadHandle->clientData = tvdlPtr;
divertedLoadHandle->findSymbolProcPtr = DivertFindSymbol;
divertedLoadHandle->unloadFileProcPtr = DivertUnloadFile;
@@ -3720,7 +3725,7 @@ TclFSUnloadTempFile(
Tcl_Obj *
Tcl_FSLink(
Tcl_Obj *pathPtr, /* Pathaname of file. */
Tcl_Obj *toPtr, /*
Tcl_Obj *toPtr, /*
* NULL or the pathname of a file to link to.
*/
int linkAction) /* Action to perform. */
@@ -3803,7 +3808,7 @@ Tcl_FSListVolumes(void)
*
* FsListMounts --
*
* Lists the mounts mathing the given pattern in the given directory.
* Lists the mounts mathing the given pattern in the given directory.
*
* Results:
* A list, having a refCount of 0, of the matching mounts, or NULL if no
@@ -4208,7 +4213,7 @@ Tcl_FSCopyFile(
* TclCrossFilesystemCopy --
*
* Helper for Tcl_FSCopyFile and Tcl_FSLoadFile. Copies a file from one
* filesystem to another, overwiting any file that already exists.
* filesystem to another, overwiting any file that already exists.
*
* Results:
* A standard Tcl return code.
@@ -4513,7 +4518,7 @@ Tcl_FSGetFileSystemForPath(
/*
* Call each of the "pathInFilesystem" functions in succession until the
* corresponding filesystem is found.
*/
*/
for (; fsRecPtr!=NULL ; fsRecPtr=fsRecPtr->nextPtr) {
ClientData clientData = NULL;
@@ -4684,6 +4689,7 @@ NativeFilesystemSeparator(
Tcl_Obj *pathPtr)
{
const char *separator = NULL; /* lint */
(void)pathPtr;
switch (tclPlatform) {
case TCL_PLATFORM_UNIX:
+22 -18
View File
@@ -126,7 +126,7 @@ Tcl_GetIndexFromObj(
const Tcl_ObjIntRep *irPtr = TclFetchIntRep(objPtr, &indexType);
if (irPtr) {
IndexRep *indexRep = irPtr->twoPtrValue.ptr1;
IndexRep *indexRep = (IndexRep *)irPtr->twoPtrValue.ptr1;
/*
* Here's hoping we don't get hit by unfortunate packing constraints
@@ -200,7 +200,7 @@ GetIndexFromObjList(
* Build a string table from the list.
*/
tablePtr = ckalloc((objc + 1) * sizeof(char *));
tablePtr = (const char **)ckalloc((objc + 1) * sizeof(char *));
for (t = 0; t < objc; t++) {
if (objv[t] == objPtr) {
/*
@@ -284,7 +284,7 @@ Tcl_GetIndexFromObjStruct(
if (!(flags & INDEX_TEMP_TABLE)) {
irPtr = TclFetchIntRep(objPtr, &indexType);
if (irPtr) {
indexRep = irPtr->twoPtrValue.ptr1;
indexRep = (IndexRep *)irPtr->twoPtrValue.ptr1;
if (indexRep->tablePtr==tablePtr && indexRep->offset==offset) {
*indexPtr = indexRep->index;
return TCL_OK;
@@ -308,7 +308,7 @@ Tcl_GetIndexFromObjStruct(
* - Several abbreviations (never allowed, but overridden by exact match)
*/
for (entryPtr = tablePtr, idx = 0; *entryPtr != NULL;
for (entryPtr = (const char* const*)tablePtr, idx = 0; *entryPtr != NULL;
entryPtr = NEXT_ENTRY(entryPtr, offset), idx++) {
for (p1 = key, p2 = *entryPtr; *p1 == *p2; p1++, p2++) {
if (*p1 == '\0') {
@@ -348,11 +348,11 @@ Tcl_GetIndexFromObjStruct(
if (!(flags & INDEX_TEMP_TABLE)) {
irPtr = TclFetchIntRep(objPtr, &indexType);
if (irPtr) {
indexRep = irPtr->twoPtrValue.ptr1;
indexRep = (IndexRep *)irPtr->twoPtrValue.ptr1;
} else {
Tcl_ObjIntRep ir;
indexRep = ckalloc(sizeof(IndexRep));
indexRep = (IndexRep*)ckalloc(sizeof(IndexRep));
ir.twoPtrValue.ptr1 = indexRep;
Tcl_StoreIntRep(objPtr, &indexType, &ir);
}
@@ -373,7 +373,7 @@ Tcl_GetIndexFromObjStruct(
int count = 0;
TclNewObj(resultPtr);
entryPtr = tablePtr;
entryPtr = (const char* const *)tablePtr;
while ((*entryPtr != NULL) && !**entryPtr) {
entryPtr = NEXT_ENTRY(entryPtr, offset);
}
@@ -428,6 +428,7 @@ SetIndexFromAny(
Tcl_Interp *interp, /* Used for error reporting if not NULL. */
Tcl_Obj *objPtr) /* The object to convert. */
{
(void)objPtr;
if (interp) {
Tcl_SetObjResult(interp, Tcl_NewStringObj(
"can't convert value to index except via Tcl_GetIndexFromObj API",
@@ -457,7 +458,7 @@ static void
UpdateStringOfIndex(
Tcl_Obj *objPtr)
{
IndexRep *indexRep = TclFetchIntRep(objPtr, &indexType)->twoPtrValue.ptr1;
IndexRep *indexRep = (IndexRep *)TclFetchIntRep(objPtr, &indexType)->twoPtrValue.ptr1;
const char *indexStr = EXPAND_OF(indexRep);
Tcl_InitStringRep(objPtr, indexStr, strlen(indexStr));
@@ -487,7 +488,7 @@ DupIndex(
Tcl_Obj *dupPtr)
{
Tcl_ObjIntRep ir;
IndexRep *dupIndexRep = ckalloc(sizeof(IndexRep));
IndexRep *dupIndexRep = (IndexRep *)ckalloc(sizeof(IndexRep));
memcpy(dupIndexRep, TclFetchIntRep(srcPtr, &indexType)->twoPtrValue.ptr1,
sizeof(IndexRep));
@@ -574,7 +575,7 @@ TclInitPrefixCmd(
static int
PrefixMatchObjCmd(
ClientData clientData, /* Not used. */
ClientData dummy, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
@@ -590,6 +591,7 @@ PrefixMatchObjCmd(
enum matchOptions {
PRFMATCH_ERROR, PRFMATCH_EXACT, PRFMATCH_MESSAGE
};
(void)dummy;
if (objc < 3) {
Tcl_WrongNumArgs(interp, 1, objv, "?options? table string");
@@ -698,7 +700,7 @@ PrefixMatchObjCmd(
static int
PrefixAllObjCmd(
ClientData clientData, /* Not used. */
ClientData dummy, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
@@ -706,6 +708,7 @@ PrefixAllObjCmd(
int tableObjc, result, t, length, elemLength;
const char *string, *elemString;
Tcl_Obj **tableObjv, *resultPtr;
(void)dummy;
if (objc != 3) {
Tcl_WrongNumArgs(interp, 1, objv, "table string");
@@ -755,7 +758,7 @@ PrefixAllObjCmd(
static int
PrefixLongestObjCmd(
ClientData clientData, /* Not used. */
ClientData dummy, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
@@ -763,6 +766,7 @@ PrefixLongestObjCmd(
int tableObjc, result, i, t, length, elemLength, resultLength;
const char *string, *elemString, *resultString;
Tcl_Obj **tableObjv;
(void)dummy;
if (objc != 3) {
Tcl_WrongNumArgs(interp, 1, objv, "table string");
@@ -967,7 +971,7 @@ Tcl_WrongNumArgs(
const Tcl_ObjIntRep *irPtr;
if ((irPtr = TclFetchIntRep(origObjv[i], &indexType))) {
IndexRep *indexRep = irPtr->twoPtrValue.ptr1;
IndexRep *indexRep = (IndexRep *)irPtr->twoPtrValue.ptr1;
elementStr = EXPAND_OF(indexRep);
elemLen = strlen(elementStr);
@@ -978,7 +982,7 @@ Tcl_WrongNumArgs(
len = TclScanElement(elementStr, elemLen, &flags);
if (MAY_QUOTE_WORD && len != elemLen) {
char *quotedElementStr = TclStackAlloc(interp, len + 1);
char *quotedElementStr = (char *)TclStackAlloc(interp, len + 1);
len = TclConvertElement(elementStr, elemLen,
quotedElementStr, flags);
@@ -1016,7 +1020,7 @@ Tcl_WrongNumArgs(
const Tcl_ObjIntRep *irPtr;
if ((irPtr = TclFetchIntRep(objv[i], &indexType))) {
IndexRep *indexRep = irPtr->twoPtrValue.ptr1;
IndexRep *indexRep = (IndexRep *)irPtr->twoPtrValue.ptr1;
Tcl_AppendStringsToObj(objPtr, EXPAND_OF(indexRep), NULL);
} else {
@@ -1029,7 +1033,7 @@ Tcl_WrongNumArgs(
len = TclScanElement(elementStr, elemLen, &flags);
if (MAY_QUOTE_WORD && len != elemLen) {
char *quotedElementStr = TclStackAlloc(interp, len + 1);
char *quotedElementStr = (char *)TclStackAlloc(interp, len + 1);
len = TclConvertElement(elementStr, elemLen,
quotedElementStr, flags);
@@ -1135,7 +1139,7 @@ Tcl_ParseArgsObjv(
*/
nrem = 1;
leftovers = ckalloc((1 + *objcPtr) * sizeof(Tcl_Obj *));
leftovers = (Tcl_Obj **)ckalloc((1 + *objcPtr) * sizeof(Tcl_Obj *));
leftovers[0] = objv[0];
} else {
nrem = 0;
@@ -1319,7 +1323,7 @@ Tcl_ParseArgsObjv(
}
leftovers[nrem] = NULL;
*objcPtr = nrem++;
*remObjv = ckrealloc(leftovers, nrem * sizeof(Tcl_Obj *));
*remObjv = (Tcl_Obj **)ckrealloc(leftovers, nrem * sizeof(Tcl_Obj *));
return TCL_OK;
/*
+8 -4
View File
@@ -380,7 +380,7 @@ declare 93 {
}
# Removed in 8.5:
#declare 94 {
# int TclProcInterpProc(ClientData clientData, Tcl_Interp *interp,
# int TclProcInterpProc(void *clientData, Tcl_Interp *interp,
# int argc, const char **argv)
#}
# Replaced by Tcl_FSStat in 8.4:
@@ -553,7 +553,7 @@ declare 138 {
#declare 139 {
# int TclpLoadFile(Tcl_Interp *interp, char *fileName, char *sym1,
# char *sym2, Tcl_PackageInitProc **proc1Ptr,
# Tcl_PackageInitProc **proc2Ptr, ClientData *clientDataPtr)
# Tcl_PackageInitProc **proc2Ptr, void **clientDataPtr)
#}
#declare 140 {
# int TclLooksLikeInt(const char *bytes, int length)
@@ -608,11 +608,11 @@ declare 153 {
# moved to tclTest.c (static) in 8.3.2/8.4a2
#declare 154 {
# int TclTestChannelCmd(ClientData clientData,
# int TclTestChannelCmd(void *clientData,
# Tcl_Interp *interp, int argc, char **argv)
#}
#declare 155 {
# int TclTestChannelEventCmd(ClientData clientData,
# int TclTestChannelEventCmd(void *clientData,
# Tcl_Interp *interp, int argc, char **argv)
#}
@@ -1034,6 +1034,10 @@ declare 258 {
Tcl_Obj *TclpCreateTemporaryDirectory(Tcl_Obj *dirObj,
Tcl_Obj *basenameObj)
}
declare 259 {
void TclUnusedStubEntry(void)
}
##############################################################################
+24 -12
View File
@@ -2914,11 +2914,11 @@ MODULE_SCOPE void TclArgumentBCRelease(Tcl_Interp *interp,
CmdFrame *cfPtr);
MODULE_SCOPE void TclArgumentGet(Tcl_Interp *interp, Tcl_Obj *obj,
CmdFrame **cfPtrPtr, int *wordPtr);
MODULE_SCOPE double TclBignumToDouble(const mp_int *bignum);
MODULE_SCOPE double TclBignumToDouble(const void *bignum);
MODULE_SCOPE int TclByteArrayMatch(const unsigned char *string,
int strLen, const unsigned char *pattern,
int ptnLen, int flags);
MODULE_SCOPE double TclCeil(const mp_int *a);
MODULE_SCOPE double TclCeil(const void *a);
MODULE_SCOPE void TclChannelPreserve(Tcl_Channel chan);
MODULE_SCOPE void TclChannelRelease(Tcl_Channel chan);
MODULE_SCOPE int TclCheckArrayTraces(Tcl_Interp *interp, Var *varPtr,
@@ -3001,7 +3001,7 @@ MODULE_SCOPE void TclFinalizeThreadAlloc(void);
MODULE_SCOPE void TclFinalizeThreadAllocThread(void);
MODULE_SCOPE void TclFinalizeThreadData(int quick);
MODULE_SCOPE void TclFinalizeThreadObjects(void);
MODULE_SCOPE double TclFloor(const mp_int *a);
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);
@@ -3058,8 +3058,6 @@ MODULE_SCOPE int TclInfoLocalsCmd(ClientData dummy, Tcl_Interp *interp,
MODULE_SCOPE int TclInfoVarsCmd(ClientData dummy, Tcl_Interp *interp,
int objc, Tcl_Obj *const objv[]);
MODULE_SCOPE void TclInitAlloc(void);
MODULE_SCOPE void TclInitBignumFromWideInt(mp_int *, Tcl_WideInt);
MODULE_SCOPE void TclInitBignumFromWideUInt(mp_int *, Tcl_WideUInt);
MODULE_SCOPE void TclInitDbCkalloc(void);
MODULE_SCOPE void TclInitDoubleConversion(void);
MODULE_SCOPE void TclInitEmbeddedConfigurationInformation(
@@ -3194,7 +3192,7 @@ MODULE_SCOPE int TclScanElement(const char *string, int length,
MODULE_SCOPE void TclSetBgErrorHandler(Tcl_Interp *interp,
Tcl_Obj *cmdPrefix);
MODULE_SCOPE void TclSetBignumIntRep(Tcl_Obj *objPtr,
mp_int *bignumValue);
void *bignumValue);
MODULE_SCOPE int TclSetBooleanFromAny(Tcl_Interp *interp,
Tcl_Obj *objPtr);
MODULE_SCOPE void TclSetCmdNameObj(Tcl_Interp *interp, Tcl_Obj *objPtr,
@@ -4334,7 +4332,7 @@ MODULE_SCOPE void TclpFreeAllocCache(void *);
(objPtr) = TclThreadAllocObj(); \
} else { \
(objPtr) = cachePtr->firstObjPtr; \
cachePtr->firstObjPtr = (objPtr)->internalRep.twoPtrValue.ptr1; \
cachePtr->firstObjPtr = (Tcl_Obj *)(objPtr)->internalRep.twoPtrValue.ptr1; \
--cachePtr->numObjects; \
} \
} while (0)
@@ -4495,6 +4493,21 @@ MODULE_SCOPE void TclDbInitNewObj(Tcl_Obj *objPtr, const char *file,
(objPtr)->bytes = NULL; \
}
/*
* These form part of the native filesystem support. They are needed here
* because we have a few native filesystem functions (which are the same for
* win/unix) in this file.
*/
#ifdef __cplusplus
extern "C" {
#endif
MODULE_SCOPE const char *const tclpFileAttrStrings[];
MODULE_SCOPE const TclFileAttrProcs tclpFileAttrProcs[];
#ifdef __cplusplus
}
#endif
/*
*----------------------------------------------------------------
* Macro used by the Tcl core to test whether an object has a
@@ -4525,7 +4538,7 @@ MODULE_SCOPE void TclDbInitNewObj(Tcl_Obj *objPtr, const char *file,
if (bignumPayload == -1) { \
(bignum) = *((mp_int *) bignumObj->internalRep.twoPtrValue.ptr1); \
} else { \
(bignum).dp = bignumObj->internalRep.twoPtrValue.ptr1; \
(bignum).dp = (mp_digit *)bignumObj->internalRep.twoPtrValue.ptr1; \
(bignum).sign = bignumPayload >> 30; \
(bignum).alloc = (bignumPayload >> 15) & 0x7fff; \
(bignum).used = bignumPayload & 0x7fff; \
@@ -4615,7 +4628,7 @@ MODULE_SCOPE void TclDbInitNewObj(Tcl_Obj *objPtr, const char *file,
*----------------------------------------------------------------
*/
#if TCL_UTF_MAX > 4
#if TCL_UTF_MAX > 3
#define TclUtfToUniChar(str, chPtr) \
((((unsigned char) *(str)) < 0x80) ? \
((*(chPtr) = (unsigned char) *(str)), 1) \
@@ -4973,7 +4986,7 @@ MODULE_SCOPE Tcl_PackageInitProc Procbodytest_SafeInit;
TCL_CT_ASSERT((nbytes)<=sizeof(Tcl_Obj)); \
TclIncrObjsAllocated(); \
TclAllocObjStorageEx((interp), (_objPtr)); \
memPtr = (ClientData) (_objPtr); \
*(void **)&memPtr = (void *) (_objPtr); \
} while (0)
#define TclSmallFreeEx(interp, memPtr) \
@@ -4988,7 +5001,7 @@ MODULE_SCOPE Tcl_PackageInitProc Procbodytest_SafeInit;
Tcl_Obj *_objPtr; \
TCL_CT_ASSERT((nbytes)<=sizeof(Tcl_Obj)); \
TclNewObj(_objPtr); \
memPtr = (ClientData) _objPtr; \
*(void **)memPtr = (void *) _objPtr; \
} while (0)
#define TclSmallFreeEx(interp, memPtr) \
@@ -5078,7 +5091,6 @@ typedef struct NRE_callback {
#include "tclIntDecls.h"
#include "tclIntPlatDecls.h"
#include "tclTomMathDecls.h"
#if !defined(USE_TCL_STUBS) && !defined(TCL_MEM_DEBUG)
#define Tcl_AttemptAlloc(size) TclpAlloc(size)
+5
View File
@@ -658,6 +658,8 @@ EXTERN void TclStaticPackage(Tcl_Interp *interp,
/* 258 */
EXTERN Tcl_Obj * TclpCreateTemporaryDirectory(Tcl_Obj *dirObj,
Tcl_Obj *basenameObj);
/* 259 */
EXTERN void TclUnusedStubEntry(void);
typedef struct TclIntStubs {
int magic;
@@ -922,6 +924,7 @@ typedef struct TclIntStubs {
int (*tclPtrUnsetVar) (Tcl_Interp *interp, Tcl_Var varPtr, Tcl_Var arrayPtr, Tcl_Obj *part1Ptr, Tcl_Obj *part2Ptr, const int flags); /* 256 */
void (*tclStaticPackage) (Tcl_Interp *interp, const char *pkgName, Tcl_PackageInitProc *initProc, Tcl_PackageInitProc *safeInitProc); /* 257 */
Tcl_Obj * (*tclpCreateTemporaryDirectory) (Tcl_Obj *dirObj, Tcl_Obj *basenameObj); /* 258 */
void (*tclUnusedStubEntry) (void); /* 259 */
} TclIntStubs;
extern const TclIntStubs *tclIntStubsPtr;
@@ -1367,6 +1370,8 @@ extern const TclIntStubs *tclIntStubsPtr;
(tclIntStubsPtr->tclStaticPackage) /* 257 */
#define TclpCreateTemporaryDirectory \
(tclIntStubsPtr->tclpCreateTemporaryDirectory) /* 258 */
#define TclUnusedStubEntry \
(tclIntStubsPtr->tclUnusedStubEntry) /* 259 */
#endif /* defined(USE_TCL_STUBS) */
+45 -40
View File
@@ -336,7 +336,7 @@ Tcl_Init(
Tcl_Interp *interp) /* Interpreter to initialize. */
{
PkgName pkgName = {NULL, "Tcl"};
PkgName **names = TclInitPkgFiles(interp);
PkgName **names = (PkgName **)TclInitPkgFiles(interp);
int result = TCL_ERROR;
pkgName.nextPtr = *names;
@@ -485,7 +485,7 @@ TclInterpInit(
Master *masterPtr;
Slave *slavePtr;
interpInfoPtr = ckalloc(sizeof(InterpInfo));
interpInfoPtr = (InterpInfo *)ckalloc(sizeof(InterpInfo));
((Interp *) interp)->interpInfo = interpInfoPtr;
masterPtr = &interpInfoPtr->master;
@@ -525,7 +525,7 @@ TclInterpInit(
static void
InterpInfoDeleteProc(
ClientData clientData, /* Ignored. */
ClientData dummy, /* Ignored. */
Tcl_Interp *interp) /* Interp being deleted. All commands for
* slave interps should already be deleted. */
{
@@ -533,6 +533,7 @@ InterpInfoDeleteProc(
Slave *slavePtr;
Master *masterPtr;
Target *targetPtr;
(void)dummy;
interpInfoPtr = (InterpInfo *) ((Interp *) interp)->interpInfo;
@@ -614,7 +615,7 @@ Tcl_InterpObjCmd(
static int
NRInterpCmd(
ClientData clientData, /* Unused. */
ClientData dummy, /* Unused. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
@@ -638,6 +639,7 @@ NRInterpCmd(
OPT_INVOKEHID, OPT_LIMIT, OPT_MARKTRUSTED,OPT_RECLIMIT,
OPT_SLAVES, OPT_SHARE, OPT_TARGET, OPT_TRANSFER
};
(void)dummy;
if (objc < 2) {
Tcl_WrongNumArgs(interp, 1, objv, "cmd ?arg ...?");
@@ -999,6 +1001,7 @@ NRInterpCmd(
return SlaveTimeLimitCmd(interp, slaveInterp, 4, objc, objv);
}
}
break;
case OPT_MARKTRUSTED:
if (objc != 3) {
Tcl_WrongNumArgs(interp, 2, objv, "path");
@@ -1034,7 +1037,7 @@ NRInterpCmd(
resultPtr = Tcl_NewObj();
hPtr = Tcl_FirstHashEntry(&iiPtr->master.slaveTable, &hashSearch);
for ( ; hPtr != NULL; hPtr = Tcl_NextHashEntry(&hashSearch)) {
string = Tcl_GetHashKey(&iiPtr->master.slaveTable, hPtr);
string = (char *)Tcl_GetHashKey(&iiPtr->master.slaveTable, hPtr);
Tcl_ListObjAppendElement(NULL, resultPtr,
Tcl_NewStringObj(string, -1));
}
@@ -1105,7 +1108,7 @@ NRInterpCmd(
NULL);
return TCL_ERROR;
}
aliasPtr = Tcl_GetHashValue(hPtr);
aliasPtr = (Alias *)Tcl_GetHashValue(hPtr);
if (Tcl_GetInterpPath(interp, aliasPtr->targetInterp) != TCL_OK) {
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"target interpreter for alias \"%s\" in path \"%s\" is "
@@ -1188,7 +1191,7 @@ Tcl_CreateAlias(
int i;
int result;
objv = TclStackAlloc(slaveInterp, sizeof(Tcl_Obj *) * argc);
objv = (Tcl_Obj **)TclStackAlloc(slaveInterp, sizeof(Tcl_Obj *) * argc);
for (i = 0; i < argc; i++) {
objv[i] = Tcl_NewStringObj(argv[i], -1);
Tcl_IncrRefCount(objv[i]);
@@ -1294,7 +1297,7 @@ Tcl_GetAlias(
Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "ALIAS", aliasName, NULL);
return TCL_ERROR;
}
aliasPtr = Tcl_GetHashValue(hPtr);
aliasPtr = (Alias *)Tcl_GetHashValue(hPtr);
objc = aliasPtr->objc;
objv = &aliasPtr->objPtr;
@@ -1356,7 +1359,7 @@ Tcl_GetAliasObj(
Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "ALIAS", aliasName, NULL);
return TCL_ERROR;
}
aliasPtr = Tcl_GetHashValue(hPtr);
aliasPtr = (Alias *)Tcl_GetHashValue(hPtr);
objc = aliasPtr->objc;
objv = &aliasPtr->objPtr;
@@ -1425,7 +1428,7 @@ TclPreventAliasLoop(
* chain then we have a loop.
*/
aliasPtr = cmdPtr->objClientData;
aliasPtr = (Alias *)cmdPtr->objClientData;
nextAliasPtr = aliasPtr;
while (1) {
Tcl_Obj *cmdNamePtr;
@@ -1474,7 +1477,7 @@ TclPreventAliasLoop(
&& aliasCmdPtr->objProc != TclLocalAliasObjCmd) {
return TCL_OK;
}
nextAliasPtr = aliasCmdPtr->objClientData;
nextAliasPtr = (Alias *)aliasCmdPtr->objClientData;
}
/* NOTREACHED */
@@ -1517,7 +1520,7 @@ AliasCreate(
Tcl_Obj **prefv;
int isNew, i;
aliasPtr = ckalloc(sizeof(Alias) + objc * sizeof(Tcl_Obj *));
aliasPtr = (Alias *)ckalloc(sizeof(Alias) + objc * sizeof(Tcl_Obj *));
aliasPtr->token = namePtr;
Tcl_IncrRefCount(aliasPtr->token);
aliasPtr->targetInterp = masterInterp;
@@ -1625,7 +1628,7 @@ AliasCreate(
* interp alias {} foo {} zop # Now recreate "foo"...
*/
targetPtr = ckalloc(sizeof(Target));
targetPtr = (Target *)ckalloc(sizeof(Target));
targetPtr->slaveCmd = aliasPtr->slaveCmd;
targetPtr->slaveInterp = slaveInterp;
@@ -1686,7 +1689,7 @@ AliasDelete(
TclGetString(namePtr), NULL);
return TCL_ERROR;
}
aliasPtr = Tcl_GetHashValue(hPtr);
aliasPtr = (Alias *)Tcl_GetHashValue(hPtr);
Tcl_DeleteCommandFromToken(slaveInterp, aliasPtr->slaveCmd);
return TCL_OK;
}
@@ -1731,7 +1734,7 @@ AliasDescribe(
if (hPtr == NULL) {
return TCL_OK;
}
aliasPtr = Tcl_GetHashValue(hPtr);
aliasPtr = (Alias *)Tcl_GetHashValue(hPtr);
prefixPtr = Tcl_NewListObj(aliasPtr->objc, &aliasPtr->objPtr);
Tcl_SetObjResult(interp, prefixPtr);
return TCL_OK;
@@ -1768,7 +1771,7 @@ AliasList(
entryPtr = Tcl_FirstHashEntry(&slavePtr->aliasTable, &hashSearch);
for ( ; entryPtr != NULL; entryPtr = Tcl_NextHashEntry(&hashSearch)) {
aliasPtr = Tcl_GetHashValue(entryPtr);
aliasPtr = (Alias *)Tcl_GetHashValue(entryPtr);
Tcl_ListObjAppendElement(NULL, resultPtr, aliasPtr->token);
}
Tcl_SetObjResult(interp, resultPtr);
@@ -1809,7 +1812,7 @@ AliasNRCmd(
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument vector. */
{
Alias *aliasPtr = clientData;
Alias *aliasPtr = (Alias *)clientData;
int prefc, cmdc, i;
Tcl_Obj **prefv, **cmdv;
Tcl_Obj *listPtr;
@@ -1858,7 +1861,7 @@ TclAliasObjCmd(
Tcl_Obj *const objv[]) /* Argument vector. */
{
#define ALIAS_CMDV_PREALLOC 10
Alias *aliasPtr = clientData;
Alias *aliasPtr = (Alias *)clientData;
Tcl_Interp *targetInterp = aliasPtr->targetInterp;
int result, prefc, cmdc, i;
Tcl_Obj **prefv, **cmdv;
@@ -1877,7 +1880,7 @@ TclAliasObjCmd(
if (cmdc <= ALIAS_CMDV_PREALLOC) {
cmdv = cmdArr;
} else {
cmdv = TclStackAlloc(interp, cmdc * sizeof(Tcl_Obj *));
cmdv = (Tcl_Obj **)TclStackAlloc(interp, cmdc * sizeof(Tcl_Obj *));
}
memcpy(cmdv, prefv, prefc * sizeof(Tcl_Obj *));
@@ -1949,7 +1952,7 @@ TclLocalAliasObjCmd(
Tcl_Obj *const objv[]) /* Argument vector. */
{
#define ALIAS_CMDV_PREALLOC 10
Alias *aliasPtr = clientData;
Alias *aliasPtr = (Alias *)clientData;
int result, prefc, cmdc, i;
Tcl_Obj **prefv, **cmdv;
Tcl_Obj *cmdArr[ALIAS_CMDV_PREALLOC];
@@ -1967,7 +1970,7 @@ TclLocalAliasObjCmd(
if (cmdc <= ALIAS_CMDV_PREALLOC) {
cmdv = cmdArr;
} else {
cmdv = TclStackAlloc(interp, cmdc * sizeof(Tcl_Obj *));
cmdv = (Tcl_Obj **)TclStackAlloc(interp, cmdc * sizeof(Tcl_Obj *));
}
memcpy(cmdv, prefv, prefc * sizeof(Tcl_Obj *));
@@ -2030,7 +2033,7 @@ static void
AliasObjCmdDeleteProc(
ClientData clientData) /* The alias record for this alias. */
{
Alias *aliasPtr = clientData;
Alias *aliasPtr = (Alias *)clientData;
Target *targetPtr;
int i;
Tcl_Obj **objv;
@@ -2206,7 +2209,7 @@ TclSetSlaveCancelFlags(
hPtr = Tcl_FirstHashEntry(&masterPtr->slaveTable, &hashSearch);
for ( ; hPtr != NULL; hPtr = Tcl_NextHashEntry(&hashSearch)) {
slavePtr = Tcl_GetHashValue(hPtr);
slavePtr = (Slave *)Tcl_GetHashValue(hPtr);
iPtr = (Interp *) slavePtr->slaveInterp;
if (iPtr == NULL) {
@@ -2271,7 +2274,7 @@ Tcl_GetInterpPath(
return TCL_ERROR;
}
Tcl_ListObjAppendElement(NULL, Tcl_GetObjResult(askingInterp),
Tcl_NewStringObj(Tcl_GetHashKey(&iiPtr->master.slaveTable,
Tcl_NewStringObj((const char *)Tcl_GetHashKey(&iiPtr->master.slaveTable,
iiPtr->slave.slaveEntryPtr), -1));
return TCL_OK;
}
@@ -2319,7 +2322,7 @@ GetInterp(
searchInterp = NULL;
break;
}
slavePtr = Tcl_GetHashValue(hPtr);
slavePtr = (Slave *)Tcl_GetHashValue(hPtr);
searchInterp = slavePtr->slaveInterp;
if (searchInterp == NULL) {
break;
@@ -2545,7 +2548,7 @@ NRSlaveCmd(
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
{
Tcl_Interp *slaveInterp = clientData;
Tcl_Interp *slaveInterp = (Tcl_Interp *)clientData;
int index;
static const char *const options[] = {
"alias", "aliases", "bgerror", "debug",
@@ -2707,6 +2710,7 @@ NRSlaveCmd(
return SlaveTimeLimitCmd(interp, slaveInterp, 3, objc, objv);
}
}
break;
case OPT_MARKTRUSTED:
if (objc != 2) {
Tcl_WrongNumArgs(interp, 2, objv, NULL);
@@ -2748,7 +2752,7 @@ SlaveObjCmdDeleteProc(
ClientData clientData) /* The SlaveRecord for the command. */
{
Slave *slavePtr; /* Interim storage for Slave record. */
Tcl_Interp *slaveInterp = clientData;
Tcl_Interp *slaveInterp = (Tcl_Interp *)clientData;
/* And for a slave interp. */
slavePtr = &((InterpInfo *) ((Interp *) slaveInterp)->interpInfo)->slave;
@@ -3088,7 +3092,7 @@ SlaveHidden(
hPtr != NULL;
hPtr = Tcl_NextHashEntry(&hSearch)) {
Tcl_ListObjAppendElement(NULL, listObjPtr,
Tcl_NewStringObj(Tcl_GetHashKey(hTblPtr, hPtr), -1));
Tcl_NewStringObj((const char *)Tcl_GetHashKey(hTblPtr, hPtr), -1));
}
}
Tcl_SetObjResult(interp, listObjPtr);
@@ -3604,7 +3608,7 @@ Tcl_LimitAddHandler(
* Allocate a handler record.
*/
handlerPtr = ckalloc(sizeof(LimitHandler));
handlerPtr = (LimitHandler *)ckalloc(sizeof(LimitHandler));
handlerPtr->flags = 0;
handlerPtr->handlerProc = handlerProc;
handlerPtr->clientData = clientData;
@@ -4061,8 +4065,8 @@ static void
TimeLimitCallback(
ClientData clientData)
{
Tcl_Interp *interp = clientData;
Interp *iPtr = clientData;
Tcl_Interp *interp = (Tcl_Interp *)clientData;
Interp *iPtr = (Interp *)clientData;
int code;
Tcl_Preserve(interp);
@@ -4205,7 +4209,7 @@ static void
DeleteScriptLimitCallback(
ClientData clientData)
{
ScriptLimitCallback *limitCBPtr = clientData;
ScriptLimitCallback *limitCBPtr = (ScriptLimitCallback *)clientData;
Tcl_DecrRefCount(limitCBPtr->scriptObj);
if (limitCBPtr->entryPtr != NULL) {
@@ -4235,10 +4239,11 @@ DeleteScriptLimitCallback(
static void
CallScriptLimitCallback(
ClientData clientData,
Tcl_Interp *interp) /* Interpreter which failed the limit */
Tcl_Interp *dummy) /* Interpreter which failed the limit */
{
ScriptLimitCallback *limitCBPtr = clientData;
ScriptLimitCallback *limitCBPtr = (ScriptLimitCallback *)clientData;
int code;
(void)dummy;
if (Tcl_InterpDeleted(limitCBPtr->interp)) {
return;
@@ -4305,13 +4310,13 @@ SetScriptLimitCallback(
hashPtr = Tcl_CreateHashEntry(&iPtr->limit.callbacks, &key,
&isNew);
if (!isNew) {
limitCBPtr = Tcl_GetHashValue(hashPtr);
limitCBPtr = (ScriptLimitCallback *)Tcl_GetHashValue(hashPtr);
limitCBPtr->entryPtr = NULL;
Tcl_LimitRemoveHandler(targetInterp, type, CallScriptLimitCallback,
limitCBPtr);
}
limitCBPtr = ckalloc(sizeof(ScriptLimitCallback));
limitCBPtr = (ScriptLimitCallback *)ckalloc(sizeof(ScriptLimitCallback));
limitCBPtr->interp = interp;
limitCBPtr->scriptObj = scriptObj;
limitCBPtr->entryPtr = hashPtr;
@@ -4500,7 +4505,7 @@ SlaveCommandLimitCmd(
key.type = TCL_LIMIT_COMMANDS;
hPtr = Tcl_FindHashEntry(&iPtr->limit.callbacks, (char *) &key);
if (hPtr != NULL) {
limitCBPtr = Tcl_GetHashValue(hPtr);
limitCBPtr = (ScriptLimitCallback *)Tcl_GetHashValue(hPtr);
if (limitCBPtr != NULL && limitCBPtr->scriptObj != NULL) {
Tcl_DictObjPut(NULL, dictPtr, Tcl_NewStringObj(options[0], -1),
limitCBPtr->scriptObj);
@@ -4542,7 +4547,7 @@ SlaveCommandLimitCmd(
key.type = TCL_LIMIT_COMMANDS;
hPtr = Tcl_FindHashEntry(&iPtr->limit.callbacks, (char *) &key);
if (hPtr != NULL) {
limitCBPtr = Tcl_GetHashValue(hPtr);
limitCBPtr = (ScriptLimitCallback *)Tcl_GetHashValue(hPtr);
if (limitCBPtr != NULL && limitCBPtr->scriptObj != NULL) {
Tcl_SetObjResult(interp, limitCBPtr->scriptObj);
}
@@ -4688,7 +4693,7 @@ SlaveTimeLimitCmd(
key.type = TCL_LIMIT_TIME;
hPtr = Tcl_FindHashEntry(&iPtr->limit.callbacks, (char *) &key);
if (hPtr != NULL) {
limitCBPtr = Tcl_GetHashValue(hPtr);
limitCBPtr = (ScriptLimitCallback *)Tcl_GetHashValue(hPtr);
if (limitCBPtr != NULL && limitCBPtr->scriptObj != NULL) {
Tcl_DictObjPut(NULL, dictPtr, Tcl_NewStringObj(options[0], -1),
limitCBPtr->scriptObj);
@@ -4736,7 +4741,7 @@ SlaveTimeLimitCmd(
key.type = TCL_LIMIT_TIME;
hPtr = Tcl_FindHashEntry(&iPtr->limit.callbacks, (char *) &key);
if (hPtr != NULL) {
limitCBPtr = Tcl_GetHashValue(hPtr);
limitCBPtr = (ScriptLimitCallback *)Tcl_GetHashValue(hPtr);
if (limitCBPtr != NULL && limitCBPtr->scriptObj != NULL) {
Tcl_SetObjResult(interp, limitCBPtr->scriptObj);
}
+32 -21
View File
@@ -16,7 +16,7 @@
*/
#include "tclInt.h"
#include "tommath.h"
#include "tclTomMath.h"
#include <math.h>
/*
@@ -164,14 +164,14 @@ Tcl_LinkVar(
int code;
linkPtr = (Link *) Tcl_VarTraceInfo2(interp, varName, NULL,
TCL_GLOBAL_ONLY, LinkTraceProc, (ClientData) NULL);
TCL_GLOBAL_ONLY, LinkTraceProc, NULL);
if (linkPtr != NULL) {
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"variable '%s' is already linked", varName));
return TCL_ERROR;
}
linkPtr = ckalloc(sizeof(Link));
linkPtr = (Link *)ckalloc(sizeof(Link));
linkPtr->interp = interp;
linkPtr->nsPtr = NULL;
linkPtr->varName = Tcl_NewStringObj(varName, -1);
@@ -259,8 +259,16 @@ Tcl_LinkArray(
return TCL_ERROR;
}
linkPtr = ckalloc(sizeof(Link));
linkPtr = (Link *)ckalloc(sizeof(Link));
linkPtr->type = type & ~TCL_LINK_READ_ONLY;
#if !defined(TCL_NO_DEPRECATED) && (defined(TCL_WIDE_INT_IS_LONG) \
|| defined(_WIN32) || defined(__CYGWIN__))
if (linkPtr->type == 11 /* legacy TCL_LINK_LONG */) {
linkPtr->type = TCL_LINK_LONG;
} else if (linkPtr->type == 12 /* legacy TCL_LINK_ULONG */) {
linkPtr->type = TCL_LINK_ULONG;
}
#endif
linkPtr->numElems = size;
if (type & TCL_LINK_READ_ONLY) {
linkPtr->flags = LINK_READ_ONLY;
@@ -527,7 +535,7 @@ GetUWide(
*widePtr = *((const Tcl_WideInt *) clientData);
return (*widePtr < 0);
} else if (type == TCL_NUMBER_BIG) {
mp_int *numPtr = clientData;
mp_int *numPtr = (mp_int *)clientData;
Tcl_WideUInt value = 0;
union {
Tcl_WideUInt value;
@@ -620,11 +628,12 @@ IsSpecial(
static int
SetInvalidRealFromAny(
Tcl_Interp *interp,
Tcl_Interp *dummy,
Tcl_Obj *objPtr)
{
const char *str;
const char *endPtr;
(void)dummy;
str = TclGetString(objPtr);
if ((objPtr->length == 1) && (str[0] == '.')) {
@@ -741,7 +750,7 @@ LinkTraceProc(
const char *name2, /* Second part of variable name. */
int flags) /* Miscellaneous additional information. */
{
Link *linkPtr = clientData;
Link *linkPtr = (Link *)clientData;
int changed;
int valueLength;
const char *value;
@@ -754,6 +763,8 @@ LinkTraceProc(
int objc;
Tcl_Obj **objv;
int i;
(void)name1;
(void)name2;
/*
* If the variable is being unset, then just re-create it (with a trace)
@@ -889,7 +900,7 @@ LinkTraceProc(
valueLength = valueObj->length + 1;
pp = (char **) linkPtr->addr;
*pp = ckrealloc(*pp, valueLength);
*pp = (char *)ckrealloc(*pp, valueLength);
memcpy(*pp, value, valueLength);
return NULL;
@@ -1283,7 +1294,7 @@ ObjValue(
case TCL_LINK_INT:
if (linkPtr->flags & LINK_ALLOC_LAST) {
memcpy(linkPtr->lastValue.aryPtr, linkPtr->addr, linkPtr->bytes);
objv = ckalloc(linkPtr->numElems * sizeof(Tcl_Obj *));
objv = (Tcl_Obj **)ckalloc(linkPtr->numElems * sizeof(Tcl_Obj *));
for (i=0; i < linkPtr->numElems; i++) {
objv[i] = Tcl_NewIntObj(linkPtr->lastValue.iPtr[i]);
}
@@ -1296,7 +1307,7 @@ ObjValue(
case TCL_LINK_WIDE_INT:
if (linkPtr->flags & LINK_ALLOC_LAST) {
memcpy(linkPtr->lastValue.aryPtr, linkPtr->addr, linkPtr->bytes);
objv = ckalloc(linkPtr->numElems * sizeof(Tcl_Obj *));
objv = (Tcl_Obj **)ckalloc(linkPtr->numElems * sizeof(Tcl_Obj *));
for (i=0; i < linkPtr->numElems; i++) {
objv[i] = Tcl_NewWideIntObj(linkPtr->lastValue.wPtr[i]);
}
@@ -1309,7 +1320,7 @@ ObjValue(
case TCL_LINK_DOUBLE:
if (linkPtr->flags & LINK_ALLOC_LAST) {
memcpy(linkPtr->lastValue.aryPtr, linkPtr->addr, linkPtr->bytes);
objv = ckalloc(linkPtr->numElems * sizeof(Tcl_Obj *));
objv = (Tcl_Obj **)ckalloc(linkPtr->numElems * sizeof(Tcl_Obj *));
for (i=0; i < linkPtr->numElems; i++) {
objv[i] = Tcl_NewDoubleObj(linkPtr->lastValue.dPtr[i]);
}
@@ -1322,7 +1333,7 @@ ObjValue(
case TCL_LINK_BOOLEAN:
if (linkPtr->flags & LINK_ALLOC_LAST) {
memcpy(linkPtr->lastValue.aryPtr, linkPtr->addr, linkPtr->bytes);
objv = ckalloc(linkPtr->numElems * sizeof(Tcl_Obj *));
objv = (Tcl_Obj **)ckalloc(linkPtr->numElems * sizeof(Tcl_Obj *));
for (i=0; i < linkPtr->numElems; i++) {
objv[i] = Tcl_NewBooleanObj(linkPtr->lastValue.iPtr[i] != 0);
}
@@ -1335,7 +1346,7 @@ ObjValue(
case TCL_LINK_CHAR:
if (linkPtr->flags & LINK_ALLOC_LAST) {
memcpy(linkPtr->lastValue.aryPtr, linkPtr->addr, linkPtr->bytes);
objv = ckalloc(linkPtr->numElems * sizeof(Tcl_Obj *));
objv = (Tcl_Obj **)ckalloc(linkPtr->numElems * sizeof(Tcl_Obj *));
for (i=0; i < linkPtr->numElems; i++) {
objv[i] = Tcl_NewIntObj(linkPtr->lastValue.cPtr[i]);
}
@@ -1348,7 +1359,7 @@ ObjValue(
case TCL_LINK_UCHAR:
if (linkPtr->flags & LINK_ALLOC_LAST) {
memcpy(linkPtr->lastValue.aryPtr, linkPtr->addr, linkPtr->bytes);
objv = ckalloc(linkPtr->numElems * sizeof(Tcl_Obj *));
objv = (Tcl_Obj **)ckalloc(linkPtr->numElems * sizeof(Tcl_Obj *));
for (i=0; i < linkPtr->numElems; i++) {
objv[i] = Tcl_NewIntObj(linkPtr->lastValue.ucPtr[i]);
}
@@ -1361,7 +1372,7 @@ ObjValue(
case TCL_LINK_SHORT:
if (linkPtr->flags & LINK_ALLOC_LAST) {
memcpy(linkPtr->lastValue.aryPtr, linkPtr->addr, linkPtr->bytes);
objv = ckalloc(linkPtr->numElems * sizeof(Tcl_Obj *));
objv = (Tcl_Obj **)ckalloc(linkPtr->numElems * sizeof(Tcl_Obj *));
for (i=0; i < linkPtr->numElems; i++) {
objv[i] = Tcl_NewIntObj(linkPtr->lastValue.sPtr[i]);
}
@@ -1374,7 +1385,7 @@ ObjValue(
case TCL_LINK_USHORT:
if (linkPtr->flags & LINK_ALLOC_LAST) {
memcpy(linkPtr->lastValue.aryPtr, linkPtr->addr, linkPtr->bytes);
objv = ckalloc(linkPtr->numElems * sizeof(Tcl_Obj *));
objv = (Tcl_Obj **)ckalloc(linkPtr->numElems * sizeof(Tcl_Obj *));
for (i=0; i < linkPtr->numElems; i++) {
objv[i] = Tcl_NewIntObj(linkPtr->lastValue.usPtr[i]);
}
@@ -1387,7 +1398,7 @@ ObjValue(
case TCL_LINK_UINT:
if (linkPtr->flags & LINK_ALLOC_LAST) {
memcpy(linkPtr->lastValue.aryPtr, linkPtr->addr, linkPtr->bytes);
objv = ckalloc(linkPtr->numElems * sizeof(Tcl_Obj *));
objv = (Tcl_Obj **)ckalloc(linkPtr->numElems * sizeof(Tcl_Obj *));
for (i=0; i < linkPtr->numElems; i++) {
objv[i] = Tcl_NewWideIntObj(linkPtr->lastValue.uiPtr[i]);
}
@@ -1401,7 +1412,7 @@ ObjValue(
case TCL_LINK_LONG:
if (linkPtr->flags & LINK_ALLOC_LAST) {
memcpy(linkPtr->lastValue.aryPtr, linkPtr->addr, linkPtr->bytes);
objv = ckalloc(linkPtr->numElems * sizeof(Tcl_Obj *));
objv = (Tcl_Obj **)ckalloc(linkPtr->numElems * sizeof(Tcl_Obj *));
for (i=0; i < linkPtr->numElems; i++) {
objv[i] = Tcl_NewWideIntObj(linkPtr->lastValue.lPtr[i]);
}
@@ -1414,7 +1425,7 @@ ObjValue(
case TCL_LINK_ULONG:
if (linkPtr->flags & LINK_ALLOC_LAST) {
memcpy(linkPtr->lastValue.aryPtr, linkPtr->addr, linkPtr->bytes);
objv = ckalloc(linkPtr->numElems * sizeof(Tcl_Obj *));
objv = (Tcl_Obj **)ckalloc(linkPtr->numElems * sizeof(Tcl_Obj *));
for (i=0; i < linkPtr->numElems; i++) {
objv[i] = Tcl_NewWideIntObj(linkPtr->lastValue.ulPtr[i]);
}
@@ -1428,7 +1439,7 @@ ObjValue(
case TCL_LINK_FLOAT:
if (linkPtr->flags & LINK_ALLOC_LAST) {
memcpy(linkPtr->lastValue.aryPtr, linkPtr->addr, linkPtr->bytes);
objv = ckalloc(linkPtr->numElems * sizeof(Tcl_Obj *));
objv = (Tcl_Obj **)ckalloc(linkPtr->numElems * sizeof(Tcl_Obj *));
for (i=0; i < linkPtr->numElems; i++) {
objv[i] = Tcl_NewDoubleObj(linkPtr->lastValue.fPtr[i]);
}
@@ -1441,7 +1452,7 @@ ObjValue(
case TCL_LINK_WIDE_UINT:
if (linkPtr->flags & LINK_ALLOC_LAST) {
memcpy(linkPtr->lastValue.aryPtr, linkPtr->addr, linkPtr->bytes);
objv = ckalloc(linkPtr->numElems * sizeof(Tcl_Obj *));
objv = (Tcl_Obj **)ckalloc(linkPtr->numElems * sizeof(Tcl_Obj *));
for (i=0; i < linkPtr->numElems; i++) {
objv[i] = Tcl_NewWideIntObj((Tcl_WideInt)
linkPtr->lastValue.uwPtr[i]);
+13 -11
View File
@@ -62,7 +62,7 @@ const Tcl_ObjType tclListType = {
do { \
const Tcl_ObjIntRep *irPtr; \
irPtr = TclFetchIntRep((objPtr), &tclListType); \
(listRepPtr) = irPtr ? irPtr->twoPtrValue.ptr1 : NULL; \
(listRepPtr) = irPtr ? (List *)irPtr->twoPtrValue.ptr1 : NULL; \
} while (0)
#define ListResetIntRep(objPtr, listRepPtr) \
@@ -122,7 +122,7 @@ NewListIntRep(
return NULL;
}
listRepPtr = attemptckalloc(LIST_SIZE(objc));
listRepPtr = (List *)attemptckalloc(LIST_SIZE(objc));
if (listRepPtr == NULL) {
if (p) {
Tcl_Panic("list creation failed: unable to alloc %u bytes",
@@ -341,6 +341,8 @@ Tcl_DbNewListObj(
int line) /* Line number in the source file; used for
* debugging. */
{
(void)file;
(void)line;
return Tcl_NewListObj(objc, objv);
}
#endif /* TCL_MEM_DEBUG */
@@ -718,18 +720,18 @@ Tcl_ListObjAppendElement(
attempt = 2 * numRequired;
if (attempt <= LIST_MAX) {
newPtr = attemptckrealloc(listRepPtr, LIST_SIZE(attempt));
newPtr = (List *)attemptckrealloc(listRepPtr, LIST_SIZE(attempt));
}
if (newPtr == NULL) {
attempt = numRequired + 1 + TCL_MIN_ELEMENT_GROWTH;
if (attempt > LIST_MAX) {
attempt = LIST_MAX;
}
newPtr = attemptckrealloc(listRepPtr, LIST_SIZE(attempt));
newPtr = (List *)attemptckrealloc(listRepPtr, LIST_SIZE(attempt));
}
if (newPtr == NULL) {
attempt = numRequired;
newPtr = attemptckrealloc(listRepPtr, LIST_SIZE(attempt));
newPtr = (List *)attemptckrealloc(listRepPtr, LIST_SIZE(attempt));
}
if (newPtr) {
listRepPtr = newPtr;
@@ -1047,18 +1049,18 @@ Tcl_ListObjReplace(
List *newPtr = NULL;
int attempt = 2 * numRequired;
if (attempt <= LIST_MAX) {
newPtr = attemptckrealloc(listRepPtr, LIST_SIZE(attempt));
newPtr = (List *)attemptckrealloc(listRepPtr, LIST_SIZE(attempt));
}
if (newPtr == NULL) {
attempt = numRequired + 1 + TCL_MIN_ELEMENT_GROWTH;
if (attempt > LIST_MAX) {
attempt = LIST_MAX;
}
newPtr = attemptckrealloc(listRepPtr, LIST_SIZE(attempt));
newPtr = (List *)attemptckrealloc(listRepPtr, LIST_SIZE(attempt));
}
if (newPtr == NULL) {
attempt = numRequired;
newPtr = attemptckrealloc(listRepPtr, LIST_SIZE(attempt));
newPtr = (List *)attemptckrealloc(listRepPtr, LIST_SIZE(attempt));
}
if (newPtr) {
listRepPtr = newPtr;
@@ -1689,8 +1691,8 @@ TclLsetFlat(
*/
irPtr = TclFetchIntRep(objPtr, &tclListType);
listRepPtr = irPtr->twoPtrValue.ptr1;
chainPtr = irPtr->twoPtrValue.ptr2;
listRepPtr = (List *)irPtr->twoPtrValue.ptr1;
chainPtr = (Tcl_Obj *)irPtr->twoPtrValue.ptr2;
if (result == TCL_OK) {
@@ -2171,7 +2173,7 @@ UpdateStringOfList(
* We know numElems <= LIST_MAX, so this is safe.
*/
flagPtr = ckalloc(numElems);
flagPtr = (char *)ckalloc(numElems);
}
elemPtrs = &listRepPtr->elements;
for (i = 0; i < numElems; i++) {
+8 -6
View File
@@ -114,6 +114,8 @@ TclDeleteLiteralTable(
#ifdef TCL_COMPILE_DEBUG
TclVerifyGlobalLiteralTable((Interp *) interp);
#else
(void)interp;
#endif /*TCL_COMPILE_DEBUG*/
/*
@@ -276,7 +278,7 @@ TclCreateLiteral(
}
#endif
globalPtr = ckalloc(sizeof(LiteralEntry));
globalPtr = (LiteralEntry *)ckalloc(sizeof(LiteralEntry));
globalPtr->objPtr = objPtr;
Tcl_IncrRefCount(objPtr);
globalPtr->refCount = 1;
@@ -401,7 +403,7 @@ TclRegisterLiteral(
* the literal should not be shared accross
* namespaces. */
{
CompileEnv *envPtr = ePtr;
CompileEnv *envPtr = (CompileEnv *)ePtr;
Interp *iPtr = envPtr->iPtr;
LiteralTable *localTablePtr = &envPtr->localLitTable;
LiteralEntry *globalPtr, *localPtr;
@@ -758,14 +760,14 @@ ExpandLocalLiteralArray(
}
if (envPtr->mallocedLiteralArray) {
newArrayPtr = ckrealloc(currArrayPtr, newSize);
newArrayPtr = (LiteralEntry *)ckrealloc(currArrayPtr, newSize);
} else {
/*
* envPtr->literalArrayPtr isn't a ckalloc'd pointer, so we must
* code a ckrealloc equivalent for ourselves.
*/
newArrayPtr = ckalloc(newSize);
newArrayPtr = (LiteralEntry *)ckalloc(newSize);
memcpy(newArrayPtr, currArrayPtr, currBytes);
envPtr->mallocedLiteralArray = 1;
}
@@ -992,7 +994,7 @@ RebuildLiteralTable(
}
tablePtr->numBuckets *= 4;
tablePtr->buckets = ckalloc(tablePtr->numBuckets * sizeof(LiteralEntry*));
tablePtr->buckets = (LiteralEntry **)ckalloc(tablePtr->numBuckets * sizeof(LiteralEntry*));
for (count=tablePtr->numBuckets, newChainPtr=tablePtr->buckets;
count>0 ; count--, newChainPtr++) {
*newChainPtr = NULL;
@@ -1130,7 +1132,7 @@ TclLiteralStats(
* Print out the histogram and a few other pieces of information.
*/
result = ckalloc(NUM_COUNTERS*60 + 300);
result = (char *)ckalloc(NUM_COUNTERS*60 + 300);
sprintf(result, "%d entries in table, %d buckets\n",
tablePtr->numEntries, tablePtr->numBuckets);
p = result + strlen(result);

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