Compare commits

..
658 Commits
Author SHA1 Message Date
dkf dd45c8be9d Merge 8.7 2020-11-08 17:31:38 +00:00
dkf 40b3d4d5dd TIP 582: Comments in Expressions 2020-11-08 17:21:09 +00:00
dkf 25c115b5a8 Added badges to README 2020-11-08 13:38:20 +00:00
dkf d4ef5a261a Added experimental Windows CI build instructions 2020-11-08 13:34:03 +00:00
dkf 81a445ad46 Updated arrangement 2020-11-08 12:08:01 +00:00
dkf ca9f2d6210 Updated README 2020-11-07 14:29:06 +00:00
dkf 0b56647743 Updated workflow name 2020-11-07 14:21:15 +00:00
dkf f827fd2a9d Added basic github action starter 2020-11-07 14:14:17 +00:00
jan.nijtmans d60bc321ce Merge 8.6 2020-11-06 17:33:22 +00:00
jan.nijtmans 4404292972 Add MSVC "StaticPackage" build to travis. Fix another bug in winDde.test which didn't account for statically loaded dde package. 2020-11-06 17:17:41 +00:00
jan.nijtmans 82ffc550db Merge jn-module-names. Sorry Don, but this is 100% compatible! 2020-11-06 16:11:58 +00:00
jan.nijtmans 89e3b6811b Deprecate the (internal) functions TclGuessPackageName/TclGetLoadedPackages functions, since they turn out to be useless. The can be removed in 9.0 2020-11-06 14:43:48 +00:00
jan.nijtmans 3c53be5e75 Correct casing of "packageName" argument in Tcl_StaticPackage() call and "load" command (which - actually - is not a packageName at all ...)
UPDATE: I am moving this to a feature branch.  Changing the arguments passed to Tcl_StaticPackage will be an incompatible break for any scripts currently searching the [info loaded] list for "dde" or "registry".  Not a change we should put in a patchlevel without at least a ticket to record the explanation and a (POTENTIAL INCOMPATIBILITY) warning.
2020-11-06 13:32:39 +00:00
dkf b7efdfe9bc Merge 8.7 2020-11-01 14:25:49 +00:00
jan.nijtmans 3b0ee42270 Merge 8.6 2020-10-30 14:05:26 +00:00
jan.nijtmans f163c24b4c Simplify testcases using "incr" 2020-10-30 13:56:15 +00:00
jan.nijtmans 8f3e8012b1 Merge 8.6 2020-10-30 13:37:42 +00:00
jan.nijtmans 076a7e2839 Add "{}" around many "expr" commands in testcases. Also in doc/expr.n 2020-10-30 13:27:52 +00:00
jan.nijtmans cfe53b8870 Merge 8.6 2020-10-29 11:18:19 +00:00
jan.nijtmans 9efaa4d7f1 Fix implib filenames (adapted from Mingw2's 006-proper-implib-name.mingw.patch)
3 new testcases
2020-10-29 10:04:24 +00:00
jan.nijtmans dc84eca339 3 new testcases 2020-10-29 09:42:42 +00:00
jan.nijtmans f15717bcda Update TZ info to tzdata2020d. 2020-10-29 09:25:55 +00:00
jan.nijtmans ff316586bc Fix implib filenames (adapted from Mingw2's 006-proper-implib-name.mingw.patch) 2020-10-29 08:56:17 +00:00
jan.nijtmans 109828f090 Slight tweak to previous commit: Move definition of __USE_MINGW_ANSI_STDIO to the Makefile 2020-10-29 07:47:08 +00:00
dgp 0df05b3515 [11229bad5f] Fix the bytecode compiler for [string insert]. 2020-10-27 20:27:19 +00:00
dgp 84623a09f2 Use TCL_ERROR to signal inability to compile. 2020-10-27 20:24:13 +00:00
dgp 1c0ca80fe5 [11229bad5f] New test to demonstrate the bug. 2020-10-27 20:09:37 +00:00
jan.nijtmans 17211d39a0 Merge 8.6 2020-10-26 23:00:59 +00:00
jan.nijtmans 37d6f90099 Revert changes in previous commit to clock.n and lassign.n 2020-10-26 22:58:22 +00:00
José Ignacio Marín 32d6283561 Update TZ info to tzdata2020d (via merge). 2020-10-26 20:32:46 +00:00
José Ignacio Marín b0654427ca Update TZ info to tzdata2020d. 2020-10-26 20:32:16 +00:00
jan.nijtmans 6e6d624ec3 Merge 8.6 2020-10-26 16:15:30 +00:00
jan.nijtmans 34d3750e3c Fix [48898ab5f6a0d957]: Too few is better than not enough? (Inconsistent error messages) 2020-10-26 15:07:03 +00:00
jan.nijtmans 63855497af Merge 8.7 2020-10-24 14:50:11 +00:00
jan.nijtmans 48d0827130 Merge 8.6 2020-10-23 15:46:20 +00:00
jan.nijtmans 1c788e178d Fix warning: /home/jboss/workspace/tcl8.7/generic/tclIO.c:9997:27: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
9997 |   RemovePoint(nextPtr)[0] = '\r';
      |                           ^
2020-10-23 15:36:16 +00:00
jan.nijtmans be83197ee5 TIP #587: One place more where TCL_CFGVAL_ENCODING should fall back to utf-8 2020-10-22 10:52:11 +00:00
jan.nijtmans 33918a2b0b TIP #587: Default utf-8 for source command 2020-10-22 10:30:05 +00:00
jan.nijtmans 6459a50433 Merge 8.6 2020-10-22 10:23:31 +00:00
jan.nijtmans cac264cd19 Merge 8.5 (rename internal TCL_I_MODIFIER -> TCL_Z_MODIFIER) 2020-10-22 09:56:19 +00:00
jan.nijtmans c41f605368 (cherry-pick): Fix [c975939973]: Usage of gnu_printf in latest mingw-w64.
Change (internal, windows-only) TCL_I_MODIFIER to TCL_Z_MODIFIER, since that's how it's called in Tcl 8.7 and up
2020-10-22 09:23:49 +00:00
culler fb10e693b2 When building a subframework for macOS use a build directory in the staging directory. 2020-10-21 18:02:31 +00:00
jan.nijtmans 8514e60248 Merge 8.6 2020-10-21 08:51:44 +00:00
jan.nijtmans fd9662ee1c Fix [c975939973]: Usage of gnu_printf in latest mingw-w64 2020-10-21 07:48:31 +00:00
José Ignacio Marín 28e7632fe6 Update TZ info to tzdata2020c. 2020-10-20 20:39:49 +00:00
José Ignacio Marín 7f986a59bf Update TZ info to tzdata2020c. 2020-10-20 20:35:59 +00:00
culler ad823f4eb1 Add a make variable to GNUmakefile for building the Tcl.framework for use as a subframework 2020-10-19 19:22:39 +00:00
jan.nijtmans 4cecb91655 Merge 8.6.
Restore "install-strip" target to what it was in Tcl 8.6. Just don't use it any more on MacOS, since that's the only platform it doesn't work well.
2020-10-19 13:06:15 +00:00
jan.nijtmans 40c3ec35ee Improve comment in install-sh, regarding Tcl-specific change 2020-10-19 07:25:23 +00:00
jan.nijtmans 0b669eacf8 Fix [cb458261c3]: Strip comme il faut (without really doing 'il faut' ....). Update 'install-sh' to latest upstream version, but re-add this commit: [b269db5d3e97b67c] 2020-10-19 07:21:45 +00:00
jan.nijtmans 8ce6115cf5 3 times -1 -> TCL_INDEX_NONE 2020-10-18 16:24:41 +00:00
jan.nijtmans 81060c0741 Merge 8.6 2020-10-16 16:24:20 +00:00
jan.nijtmans 71b64b8e1c Still troubles with GIT on Travis 2020-10-16 16:21:29 +00:00
jan.nijtmans dd306f5b8f Merge 8.6 2020-10-16 16:02:35 +00:00
jan.nijtmans 69875ee99d Fix env.test when running under wine on Linux.
Mark other tests with "notWine", which fail currently under wine
2020-10-16 15:03:08 +00:00
jan.nijtmans 546165585c Remove use of CFG_ENCODING from rules.vc/makefile.vc: It will become obsolete with TIP #587. In stead, move the default handling to tclPkgConfig.c for now 2020-10-15 13:05:20 +00:00
jan.nijtmans fd320780c7 Merge 8.6 2020-10-15 11:06:01 +00:00
jan.nijtmans 59a788a6c4 Fix [53d5155335]: Typo in interp.n 2020-10-15 11:02:21 +00:00
jan.nijtmans e51ff962f0 Merge 8.6 2020-10-15 09:24:27 +00:00
jan.nijtmans f3ae2684eb Something strange going on on Travis with (long-gone) safe-stock86.test 2020-10-15 09:19:29 +00:00
jan.nijtmans e3f7f1bad8 Fix MSVC++ 6.0 build 2020-10-14 06:55:03 +00:00
jan.nijtmans f70e1f98b3 Merge 8.6 2020-10-13 15:45:26 +00:00
jan.nijtmans 3fc1392c92 More usage of TclNewObj() in stead of Tcl_NewObj() and TclNewIntObj() in stead of Tcl_NewIntObj() 2020-10-13 14:59:43 +00:00
jan.nijtmans fe00b6dcf6 Merge 8.6 Eliminate some (correct but actually harmless) warnings only happening on win64 2020-10-13 09:07:58 +00:00
jan.nijtmans 81e7623b78 Fix warning, doing a static build on Windows 2020-10-13 08:48:22 +00:00
José Ignacio Marín ceb9567874 Update TZ info to tzdata2020b. 2020-10-10 20:36:33 +00:00
José Ignacio Marín 579cd0b138 Update TZ info to tzdata2020b. 2020-10-10 20:34:58 +00:00
jan.nijtmans cd1fc2183e Merge 8.6. Don't inline functions which are too big to be inlined (according to the -Winline compiler flag) 2020-10-09 12:53:47 +00:00
jan.nijtmans 208927f009 Merge 8.5 2020-10-09 07:42:21 +00:00
jan.nijtmans e250b6f551 (cherry-pick): Fix [014ade1d44]: Misleading error message when using "-path" multiple times with "glob".
Also fix a few (harmless) -Wundef warnings
2020-10-09 07:10:22 +00:00
jan.nijtmans 7bf5af5c22 Make everything compile warning-free with -Wundef. Put enum ASSEM_DICT_GET_DEF last in TalInstType, so it's binary compatible with Tcl 8.6 2020-10-08 13:33:11 +00:00
jan.nijtmans 4a3369807b Eliminate warnings when compiling with -Wundef 2020-10-08 12:11:11 +00:00
jan.nijtmans 92bd8b3a3f Merge 8.6 2020-10-08 09:33:28 +00:00
jan.nijtmans 5039e7ce17 Fix [014ade1d44]: Misleading error message when using "-path" multiple times with "glob" 2020-10-08 09:13:57 +00:00
jan.nijtmans 5c9a145403 Merge 8.5 2020-10-08 09:07:54 +00:00
jan.nijtmans e53cbf77bf xcode12 -> xcode12.2. Prevent build warning about generic/tclStubInit.c 2020-10-07 16:34:57 +00:00
jan.nijtmans ec01eef200 merge-mark 2020-10-06 13:29:54 +00:00
jan.nijtmans a9405cc253 (cherry-pick): HAVE_TM_GMTOFF detection doesn't work if CFLAGS contains -Werror. Here's the fix. 2020-10-06 13:28:24 +00:00
jan.nijtmans 17b3cb8739 Fix (possible) gcc warnings in unix/dltest/*.c 2020-10-06 13:26:07 +00:00
jan.nijtmans 4dfeb77d2e HAVE_TM_GMTOFF detection doesn't work if CFLAGS contains -Werror. Here's the fix. 2020-10-06 13:20:42 +00:00
jan.nijtmans f7bdf7cfb1 Adapt function signatures in compat/string.h to what's normal nowadays 2020-10-06 08:44:15 +00:00
jan.nijtmans b7c4b811ec Fix -Wshadow warnings, when compiling with a C++ compiler 2020-10-02 16:28:09 +00:00
jan.nijtmans 09fd21b65b Merge 8.7 2020-10-01 12:38:14 +00:00
jan.nijtmans cb6ae54424 Merge 8.6 2020-09-30 14:54:30 +00:00
jan.nijtmans 1f4f47ccf5 (slightly) better error-message for invalid http -headers option. This works for plain 8.6 too 2020-09-30 14:49:15 +00:00
jan.nijtmans 195ea285da TIP #581 tweak: Don't report "slaves" as valid option for "interp" 2020-09-30 14:29:16 +00:00
oehhar 20d206c4c2 Ticket [0063cbcada]: From tcl 8.7 on, use "string is dict" instead "string is list" & length %2 == 0 to check for a valid dict 2020-09-30 12:19:53 +00:00
oehhar 98a93d4ca7 Ticket [0063cbcada]: check http::geturl -headers parameter to be a dict 2020-09-29 16:21:53 +00:00
oehhar accd2800ec Ticket [0063cbcada]: check http::geturl -headers parameter to be a dict 2020-09-29 16:16:27 +00:00
oehhar 2b01204e41 Remove wrong copy of test case http-3.2 2020-09-29 16:12:12 +00:00
oehhar 43e27f10a5 Ticket [0063cbcada]: check http::geturl -headers parameter to be a dict. 2020-09-29 08:15:32 +00:00
jan.nijtmans 2342babe99 Add -Wshadow flag to the compiler, so we will be notified when (accidently) shadowing variable names 2020-09-29 07:14:00 +00:00
jan.nijtmans 6ac6380f7a Merge-mark 2020-09-28 15:02:33 +00:00
jan.nijtmans 38b30033c8 Update internal zlib channel type from TCL_CHANNEL_VERSION_3 to TCL_CHANNEL_VERSION_5. Not actually a change, since supported procs are the same. So all internal channels have the same type 2020-09-28 15:00:02 +00:00
dgp 2a48060425 Restore change with correction. 2020-09-28 13:34:57 +00:00
dgp 8e25003fbd Revert change that made test expr-20.2 fail. 2020-09-28 13:02:46 +00:00
jan.nijtmans 947369a720 Merge 8.6 2020-09-28 10:39:50 +00:00
jan.nijtmans f6bf85fb67 Make Tcl compile warning-free using -Wshadow 2020-09-28 10:13:51 +00:00
jan.nijtmans 94a0658bc2 Merge 8.6 2020-09-26 18:38:01 +00:00
jan.nijtmans 866a79313b Merge 8.5 2020-09-26 18:32:06 +00:00
jan.nijtmans 636e4d4826 Tweak xcode labels for Travis build 2020-09-26 18:25:56 +00:00
jan.nijtmans e6b8f92493 Build Travis with Xcode 12 and 12u (Universal Apps) 2020-09-25 15:17:06 +00:00
jan.nijtmans 194cfb5382 Merge 8.7 2020-09-25 14:26:42 +00:00
jan.nijtmans 9a01f0fa35 Merge 8.6 2020-09-25 14:25:05 +00:00
jan.nijtmans 67f864dc65 It's "utf-8", not "utf8" or "UTF8" 2020-09-25 14:24:24 +00:00
jan.nijtmans 29577449a1 Use utf-8 as default encoding for configuration information 2020-09-25 14:17:14 +00:00
jan.nijtmans 21b10cef38 Merge 8.7 2020-09-25 12:16:48 +00:00
jan.nijtmans 26bb60bef7 merge-mark 2020-09-25 12:12:47 +00:00
jan.nijtmans 167555e6ab Merge 8.6 2020-09-25 11:21:05 +00:00
jan.nijtmans 00a4f18c38 When sourcing script files (even when simulating that through open|read), always set -eofchar \032 just like the source command does.
Possible security issue: this could make it possible to evaluate hidden content at the end of pkgIndex files.
2020-09-25 11:15:48 +00:00
jan.nijtmans 8f0b94f037 Merge 8.5 2020-09-25 11:13:11 +00:00
jan.nijtmans 9d34b872ce When sourcing script files (even when simulating that through open|read), always set -eofchar \032 just like the source command does.
Possible security issue: this could make it possible to evaluate hidden content at the end of pkgIndex files.
2020-09-25 11:09:08 +00:00
jan.nijtmans b8b008ad84 TIP #587 for Tcl 8.7 2020-09-25 10:57:35 +00:00
jan.nijtmans abc23e6723 TCL_CFGVAL_ENCODING now defaults to "utf-8" as well.
No explicit "-encoding utf-8" for "source" any more, since that's the default
2020-09-24 12:54:15 +00:00
jan.nijtmans e4fcd7152b Add gcc-10 build to Travis 2020-09-24 06:41:04 +00:00
jan.nijtmans 3ee0402bd5 Let's see if we can recover from an occasional hickup like happened here: [https://travis-ci.org/github/tcltk/tcl/jobs/729226819] 2020-09-23 05:57:35 +00:00
jan.nijtmans 3fcb054f91 Merge trunk. Use utf-8 explicitly when reading/writing script files 2020-09-22 12:25:15 +00:00
jan.nijtmans 5189ce8eae Merge 8.7 2020-09-22 12:20:14 +00:00
jan.nijtmans a9ba2a08b5 When writing script files (like pkgIndex.tcl), always use -translation lf, so they don't cause problems on non-windows.
When reading script files, always use  -eofchar \032, as this might be left by Windows editors.
2020-09-22 12:18:17 +00:00
jan.nijtmans 768db27d4c Merge 8.7 2020-09-20 21:44:53 +00:00
jan.nijtmans ebb520a849 Merge 8.6 2020-09-20 21:39:02 +00:00
jan.nijtmans 9e43cbb973 Improve TclInvalidateStringRep() macro such that (objPtr) is only evaluated once. Addation brackets in TclHasStringRep() macro 2020-09-20 21:32:35 +00:00
dgp a9fc439a35 merge 8.7 2020-09-20 16:06:03 +00:00
dgp 7f917c56f7 Merge 8.6 2020-09-20 15:58:58 +00:00
dgp 7a56ff406f Silence compiler warning -- fix safety of macro. 2020-09-20 15:53:37 +00:00
jan.nijtmans fb77f1148f Default utf-8 for source command 2020-09-20 11:17:56 +00:00
pooryorick 107d130ce3 Make the check to avoid generating a string representation in [uplevel] a little less intrusive. 2020-09-20 10:38:41 +00:00
jan.nijtmans 0266195479 Merge 8.7 2020-09-20 10:27:01 +00:00
jan.nijtmans bddd146942 Merge 8.6 2020-09-20 10:24:06 +00:00
jan.nijtmans e42885732a Merge 8.5 2020-09-20 10:21:07 +00:00
jan.nijtmans 1a94f57ab6 Backport many (formatting) changes in tools/*. Nothing functional.
testest.tcl: Use more uppercase hex.
2020-09-20 10:14:44 +00:00
jan.nijtmans 516be1cd2e Fix [9ffffcbeee]: compiler warnings in regcomp.c 2020-09-20 09:05:38 +00:00
jan.nijtmans 7b7d6e2116 Fix [bf58b04202]: compiler warning in tclEnv.c 2020-09-20 08:59:39 +00:00
dgp bfbfb2e5d3 merge 8.7 2020-09-19 17:21:08 +00:00
dgp 249c689f2d merge mark (safety) 2020-09-19 16:48:29 +00:00
pooryorick ac45c8d851 Fix for [b9ecf3ce98], [uplevel] unnecessarily generates string representation. 2020-09-19 14:33:24 +00:00
pooryorick 8da77a52ef Fix for [b9ecf3ce98], [uplevel] unnecessarily generates string representation. 2020-09-19 14:10:44 +00:00
jan.nijtmans 57849b86a1 Fix gcc warnings, compiling on 32-bit Linux 2020-09-18 23:05:34 +00:00
jan.nijtmans f0ab6a724c New macro TclNewIndexObj() which does the same as TclNewWideIntObjFromSize() but optimized the same way as TclNewIntObj(). 2020-09-18 08:33:51 +00:00
jan.nijtmans be275081a1 Merge 8.7 2020-09-17 14:12:55 +00:00
jan.nijtmans 733b7a43a4 Eliminate many usages of Tcl_NewObj (-> TclNewObj) and Tcl_NewIntObj (-> TclNewIntObj or Tcl_NewWideIntObj) 2020-09-17 13:48:12 +00:00
jan.nijtmans 0a36b1187d Merge 8.7 2020-09-17 09:31:16 +00:00
jan.nijtmans bc10bf6d03 Change version number of http package from 2.9.5 -> 2.10.0a1, since it's different from the 2.9.5 version in Tcl 8.6.x.
Use "$idx >= 0" check in stead of "$idx > -1" everywhere.
2020-09-17 09:27:44 +00:00
jan.nijtmans e14285c3a1 Tcl 8.6 should not be tested with "package prefer latest" any more: All included packages are supposed to be stable. Not to be merged to 8.7 (which still contains unstable packages) 2020-09-17 08:37:09 +00:00
jan.nijtmans 32975bd346 Merge 8.6 2020-09-17 08:12:40 +00:00
jan.nijtmans 76e4a71917 Fix [835c93c000]: TIP #525 only implemented for non-singleproc case 2020-09-17 07:58:14 +00:00
jan.nijtmans 23520a7648 Fix [835c93c000]: TIP #525 only implemented for non-singleproc case 2020-09-17 07:47:24 +00:00
jan.nijtmans 1dc3124160 Proposed solution for [835c93c000]: TIP #525 only implemented for non-singleproc case 2020-09-16 12:17:54 +00:00
jan.nijtmans c11add7a17 Merge 8.7 2020-09-16 07:03:27 +00:00
jan.nijtmans 929fdafe13 Little tweak to makeHeader.tcl, not depending on lsearch returning -1 any more 2020-09-16 06:51:36 +00:00
dgp 93124d77a6 one more test 2020-09-15 15:52:44 +00:00
dgp 2238887c08 Add test for [string replace] troubles. 2020-09-15 15:51:00 +00:00
jan.nijtmans 5758c119f8 Merge 8.7 2020-09-15 15:07:44 +00:00
jan.nijtmans 245a63f491 Fix [b5777d3d32]: Crash corner-case in TIP #502 implementation 2020-09-15 14:48:49 +00:00
jan.nijtmans 39aec08fb0 Merge 8.7 2020-09-14 13:25:16 +00:00
jan.nijtmans 66798b2c01 Merge 8.6 2020-09-14 13:04:55 +00:00
jan.nijtmans 52f93c85fd Unbreak winFCmd-1.38 testcase on Windows 2020-09-14 12:58:26 +00:00
jan.nijtmans fa3cf75311 Add .bmp to .gitattributes. Simplify .fossil-settings/binary-glob 2020-09-14 12:48:10 +00:00
jan.nijtmans 262b6297ea Eliminate many "register" keywords (which do nothing with modern compilers)
Eliminate many unnecessary type-casts to (unsigned)
2020-09-14 12:31:56 +00:00
jan.nijtmans d0cfe30a0d Merge 8.6 2020-09-14 09:39:09 +00:00
jan.nijtmans f0ec68f072 Prevent the usage of the term safe/unsafe child. Suggested by Keith Nash. Thanks!
More usage of $index<0 in stead of $index==-1 consistantly
2020-09-14 09:22:18 +00:00
jan.nijtmans 5bef31d2da Prevent the usage of the term safe/unsafe child. Suggested by Keith Nash. Thanks! 2020-09-14 08:52:27 +00:00
fvogel f073bc7484 Merge implementation of TIP #585 (Promote the INDEX_TEMP_TABLE flag of Tcl_GetIndexFromObj*() to the public interface) after positive vote from the TCT. Fix conflict due to Tcl_GetIndexFromObj() having been replaced by a macro in [4d8ee0f939]. 2020-09-13 20:46:12 +00:00
fvogel e89503a925 Merge implementation of TIP #585 (Promote the INDEX_TEMP_TABLE flag of Tcl_GetIndexFromObj*() to the public interface) after positive vote from the TCT. 2020-09-13 20:28:02 +00:00
jan.nijtmans 278837f261 More usage for TclNewWideIntObjFromSize(), TCL_IO_FAILURE -> TCL_INDEX_NONE where appropriate 2020-09-11 14:23:14 +00:00
jan.nijtmans d16f803f15 Merge 8.7 2020-09-11 14:11:49 +00:00
jan.nijtmans 779b664e54 Merge 8.6 2020-09-11 13:59:11 +00:00
jan.nijtmans 6e44927248 Folow-up to previous commit: ExecStack is a FLEXARRAY too 2020-09-11 13:43:49 +00:00
jan.nijtmans aa4c91c838 Merge 8.7 2020-09-11 13:20:59 +00:00
jan.nijtmans 524b1d9fb2 Merge 8.6. Remove tests/safe-stock86.test for win builds too (GIT, what are you doing ...!) 2020-09-11 12:56:29 +00:00
jan.nijtmans 7f62b76887 Fix [https://core.tcl-lang.org/tk/tktview?name=3bc0f44ef3|3bc0f44ef3]: UBSan complains about body.chars[] usage.
(Yes, I know, this one is for Tk, but Tcl was using the same construct too ....)
2020-09-11 12:31:48 +00:00
jan.nijtmans 0715d88019 Use $index<0 in stead of $index==-1 consistantly 2020-09-11 08:09:20 +00:00
jan.nijtmans f796d62367 Use $index<0 in stead of $index==-1 consistantly 2020-09-11 07:28:14 +00:00
jan.nijtmans 2061afedcc Merge 8.7 2020-09-10 16:58:26 +00:00
jan.nijtmans f5ac592def Somehow GIT cannot remove tests/safe-stock86.test from (earlier) core-8-6-branch, so we do it. 2020-09-10 16:47:30 +00:00
jan.nijtmans 06d15abf35 Merge 8.6 2020-09-10 11:33:25 +00:00
jan.nijtmans 2592b1e93b Don't use sizeof() for structs containing a flexible array as last element. Lesson from [https://core.tcl-lang.org/tk/info/3bc0f44ef3|3bc0f44ef3]. Use TclOffset in stead. 2020-09-10 10:28:46 +00:00
jan.nijtmans 1699143ae3 Merge 8.7 2020-09-09 06:57:05 +00:00
jan.nijtmans 0e0be8492f Merge 8.6 2020-09-09 06:45:57 +00:00
jan.nijtmans f4d0f6366c Rename safe-stock86.test to safe-stock.test 2020-09-09 06:37:45 +00:00
jan.nijtmans 049f2bdf3e Merge-mark 2020-09-07 15:18:05 +00:00
jan.nijtmans 60fde1d90f Fix "make install" on MacOSX: interp: make-manpage-section: ignoring .VS "TIP 581" after .TP 2020-09-07 15:11:19 +00:00
jan.nijtmans 5cf272491e Merge 8.7 2020-09-07 13:40:43 +00:00
jan.nijtmans 45e00e9df8 Merge-mark 2020-09-07 11:58:34 +00:00
jan.nijtmans a7f1b76ad2 Backport genStubs.tcl from 8.7. This adds support for MP_WUR, not actually used by Tcl. But could be used in (libtommath-related) extensions 2020-09-07 11:56:51 +00:00
jan.nijtmans 76b326ce86 Re-apply fix for [c1a376375e0e6488], as the build-problems originated elsewhere 2020-09-06 14:36:52 +00:00
jan.nijtmans 264c574c23 ckfree -> Tcl_Free 2020-09-05 22:10:31 +00:00
jan.nijtmans 230f0601cc Merge core-8-branch 2020-09-05 21:59:34 +00:00
jan.nijtmans 0d66de6c27 New bug-c1a376375e0e6488 branch with (up to now) failing solutions. Please make sure Travis builds OK before merging to core-8-branch 2020-09-05 21:37:18 +00:00
jan.nijtmans 618c49af4d Backout [c1a376375e0e6488]: imported namespace ensemble command name distorted during deletion trace on the import.
According to Travis, there's a memory leak which needs to be fixed first.
2020-09-05 21:33:49 +00:00
jan.nijtmans 87b0db4d91 Merge-mark 2020-09-05 20:58:31 +00:00
jan.nijtmans 66dd14a480 TIP #581: Last possible master/slave -> parent/child changes, without affecting anything serious 2020-09-05 20:45:04 +00:00
jan.nijtmans ff741e8b29 Merge 8.7 2020-09-04 16:45:51 +00:00
jan.nijtmans 0aaf6122a5 Merge 8.6 2020-09-04 16:44:00 +00:00
jan.nijtmans f2963d15d0 Let all test-cases load the "tcltest" package the same way. Depend on tcltest 2.5, since we never test with earlier tcltest versions 2020-09-04 15:48:08 +00:00
jan.nijtmans 1674055d7a Merge 8.7 2020-09-04 07:59:10 +00:00
jan.nijtmans fd253d8677 Merge 8.6 2020-09-04 07:50:41 +00:00
jan.nijtmans a4abf50c23 TIP #581: Mainly documentation and some testcases 2020-09-04 07:28:20 +00:00
jan.nijtmans db325590a7 Protect INST_STR_REPLACE too 2020-09-04 06:04:47 +00:00
dgp 9f309d56cc Tests string-12.2[45].* and fixes to INST_STRING_RANGE. 2020-09-02 20:50:43 +00:00
dgp 712f88bef7 Fix for test lindex-18.0 2020-09-02 20:22:15 +00:00
dgp ee7073e468 Test lindex-18.0 demonstrates same issue with INST_LIST_INDEX 2020-09-02 19:50:32 +00:00
dgp de2793025f Different fix where existing protection tools for nesting bytecode execution
calls are used.  This solution suggests there may be many more places needing
protection. Any routine that gets passed "interp" is a possibility.
2020-09-02 16:20:20 +00:00
jan.nijtmans a9843e57c2 Merge 8.7 2020-09-01 10:51:52 +00:00
jan.nijtmans 0468c659f5 Merge 8.7 2020-08-31 09:37:17 +00:00
jan.nijtmans 0cb06ba3ca Merge 8.7 2020-08-30 21:31:49 +00:00
jan.nijtmans 532db685f4 Merge 8.7 2020-08-26 14:56:50 +00:00
jan.nijtmans 7cb8eb7218 Add test-case util-9.59, which demonstrates bug [b5777d3d32] 2020-08-25 16:09:04 +00:00
jan.nijtmans fcab027ea1 Merge 8.7 2020-08-25 10:50:49 +00:00
dkf fe94c1d6c4 Tricky case in function calls. 2020-08-24 13:31:00 +00:00
dkf 1192757fb7 Added two test cases 2020-08-24 08:56:34 +00:00
dkf c76cad8a92 Added documentation 2020-08-22 14:24:31 +00:00
dkf 42a34d459e Implementation of TIP 582: comments in expressions 2020-08-22 14:14:05 +00:00
jan.nijtmans f78ef1eea2 Fix [43b434812a]: Tcl 9.0 uses stat64() but not struct stat64 on Linux i686 2020-08-21 12:28:26 +00:00
jan.nijtmans 430924da25 Merge 8.7 2020-08-19 12:56:29 +00:00
jan.nijtmans 7aa1b00468 Merge 8.7 2020-08-13 14:24:31 +00:00
jan.nijtmans 91c115082e Merge 8.7 2020-08-12 10:37:05 +00:00
jan.nijtmans e299458ad5 Merge 8.7 2020-08-12 07:04:44 +00:00
jan.nijtmans dfcc8ce6e5 Merge 8.7 2020-08-11 13:47:04 +00:00
jan.nijtmans 1ba4ad76b3 Merge 8.7 2020-08-11 06:40:52 +00:00
jan.nijtmans 33c3374723 Merge 8.7 2020-07-26 16:52:06 +00:00
jan.nijtmans 05f25dff9f Merge 8.7 2020-07-21 12:30:32 +00:00
jan.nijtmans f9c196e0e6 Merge 8.7 2020-07-21 07:54:20 +00:00
jan.nijtmans a13bb8b0ca Merge 8.7 2020-07-15 18:59:14 +00:00
jan.nijtmans a812785399 Merge 8.7 2020-07-15 09:10:37 +00:00
jan.nijtmans 326725ae5d Merge 8.7 2020-07-14 10:21:21 +00:00
jan.nijtmans 1994f539c3 Merge 8.7 2020-07-09 08:11:03 +00:00
jan.nijtmans 80b6a1a464 Merge 8.7 2020-07-07 14:38:46 +00:00
andy 326bd29be7 Clarify index order 2020-07-06 00:22:26 +00:00
jan.nijtmans 418d81804c Merge 8.7 2020-07-03 10:21:14 +00:00
jan.nijtmans cd166c904c Merge 8.7 2020-06-29 13:18:56 +00:00
jan.nijtmans 9c113f21c0 Merge 8.7 2020-06-29 10:38:54 +00:00
jan.nijtmans 498a9bf1f9 Merge 8.7 2020-06-28 15:20:14 +00:00
jan.nijtmans 2232bed6d6 Merge 8.7 2020-06-25 13:02:52 +00:00
jan.nijtmans 2cede8bf26 Merge 8.7 2020-06-25 11:31:05 +00:00
sebres a4d1a762c2 merge 8.7 2020-06-24 16:23:53 +00:00
jan.nijtmans ca6983f6f2 Merge 8.7 2020-06-23 09:38:50 +00:00
jan.nijtmans 1acb4994ab Merge 8.7 2020-06-23 06:19:08 +00:00
jan.nijtmans b63a473177 Merge 8.7 2020-06-22 12:49:30 +00:00
jan.nijtmans 0076acc80a Merge 8.7 2020-06-22 12:27:11 +00:00
jan.nijtmans e599140047 Merge 8.7 2020-06-22 12:00:01 +00:00
jan.nijtmans 730530baba Merge 8.7 2020-06-22 10:24:09 +00:00
jan.nijtmans 7231e548e3 Merge 8.7 2020-06-21 15:57:01 +00:00
andy 97399b2494 Correct man page per [ad8df845fef2c76d95b9f1aaa4815f3b23d4c472] 2020-06-19 06:06:07 +00:00
jan.nijtmans 4dc8aea827 Merge 8.7 2020-06-16 12:43:01 +00:00
jan.nijtmans 5b449103dc Merge 8.7 2020-06-12 14:56:17 +00:00
jan.nijtmans b3e1525f8a Merge 8.7 2020-06-12 14:15:55 +00:00
jan.nijtmans f2b9098a94 Still ... need to disable C4305 on Win32 (32-bit only) 2020-06-08 20:02:28 +00:00
jan.nijtmans 630bd308da Merge 8.7. This makes disabling Microsoft warning C4307 no longer necessary: It appears this warning was good for something after all. 2020-06-07 19:35:25 +00:00
jan.nijtmans fb50a7f7b5 Fix Travis build for Windows in debug mode. 2020-06-06 21:19:17 +00:00
José Ignacio Marín 4c7dc5ff2d Update TZ info to tzdata2020a. 2020-06-06 08:02:04 +00:00
jan.nijtmans 5680e6571d Merge 8.7. Change TclListObjRange() signature, using size_t for index arguments (even though lists itself cannot be larger than INT_MAX elements, but indices still might be larger than that. We don't want modulo behavior here). 2020-06-05 11:34:49 +00:00
jan.nijtmans efa3f20107 Merge 8.7. Use more TCL_INDEX_NONE in documentation/headers/code. 2020-06-04 15:15:17 +00:00
jan.nijtmans 654d14d706 Merge 8.7 2020-05-31 20:29:48 +00:00
griffin f857db0e8e tip-551 implementation. 2020-05-31 00:37:01 +00:00
jan.nijtmans 0f48821995 Merge 8.7 2020-05-28 09:49:10 +00:00
jan.nijtmans b8e14e3802 Merge 8.7 2020-05-27 06:35:35 +00:00
jan.nijtmans ec76fbd070 Merge 8.7 2020-05-26 22:42:19 +00:00
jan.nijtmans c856a8931e Merge 8.7 2020-05-25 09:46:54 +00:00
jan.nijtmans c54b77dd74 Merge 8.7 2020-05-20 19:12:25 +00:00
jan.nijtmans 3715125afc Merge 8.7 2020-05-18 12:48:11 +00:00
jan.nijtmans 549548bacf Merge 8.7 2020-05-14 10:27:26 +00:00
jan.nijtmans 7d5a69fb31 Merge 8.7 2020-05-13 20:12:17 +00:00
jan.nijtmans bc8811c498 Merge 8.7 2020-05-13 09:17:24 +00:00
jan.nijtmans 2c687a4d1d Merge 8.7 2020-05-12 21:22:22 +00:00
jan.nijtmans e47d494335 Merge 8.7 2020-05-12 19:47:06 +00:00
jan.nijtmans d2d5ffc3b6 Merge 8.7 2020-05-11 11:26:27 +00:00
jan.nijtmans 5320364a0d Merge 8.7 2020-05-11 07:42:32 +00:00
jan.nijtmans 27b62f923f Merge 8.7 2020-05-10 20:15:13 +00:00
jan.nijtmans 0b4d13b85c Merge 8.7 2020-05-08 14:38:48 +00:00
jan.nijtmans aca8877841 Merge 8.7 2020-05-08 08:15:13 +00:00
dgp fd87c6a4bb merge 8.7 2020-05-07 22:06:00 +00:00
jan.nijtmans 38a609f39c Merge 8.7 2020-05-07 14:47:56 +00:00
jan.nijtmans cd2794b2d3 Merge 8.7 2020-05-07 11:18:37 +00:00
jan.nijtmans f198eb8b6b Merge 8.7 2020-05-07 11:09:27 +00:00
dgp 22f9794cfd merge 8.7 2020-05-06 21:59:16 +00:00
dgp 446d76d5f3 merge 8.7 2020-05-06 19:55:19 +00:00
jan.nijtmans b17f64a406 Merge 8.7 2020-05-06 13:31:29 +00:00
jan.nijtmans 10d25a2209 Merge 8.7 2020-05-06 09:28:59 +00:00
jan.nijtmans e288cc94fa Merge 8.7 2020-05-05 16:31:14 +00:00
jan.nijtmans 9392c28ed8 Merge 8.7 2020-05-05 11:54:58 +00:00
jan.nijtmans 22274089f5 Merge 8.7 2020-05-05 09:51:32 +00:00
jan.nijtmans e137127ae3 Merge 8.7 2020-05-02 23:05:49 +00:00
jan.nijtmans d8fdcffdf7 Merge 8.7 2020-05-01 22:23:37 +00:00
jan.nijtmans 889df48bf0 Merge 8.7 2020-05-01 15:07:39 +00:00
jan.nijtmans afba02fe04 Merge 8.7 2020-05-01 14:44:31 +00:00
dgp 77a25a222a merge 8.7 2020-04-30 21:09:40 +00:00
dgp a8c52ddb7d merge 8.7 2020-04-30 19:25:27 +00:00
jan.nijtmans 22ab1b1e6c Merge 8.7 2020-04-30 14:20:43 +00:00
jan.nijtmans e42d35507c Merge 8.7 2020-04-30 11:24:53 +00:00
dgp 69a1133f21 Merge 8.7. Still knownBug (for TUM=3) 2020-04-29 22:18:32 +00:00
jan.nijtmans edceb04b1f Merge 8.7 2020-04-29 19:23:43 +00:00
dgp 606fa23238 merge 8.7 2020-04-28 21:33:16 +00:00
jan.nijtmans 924a7fca6b Merge 8.7 2020-04-28 21:17:02 +00:00
dgp eb2fa54e32 merge 8.7 2020-04-28 21:05:21 +00:00
jan.nijtmans 0e5cda3a47 Merge 8.7 2020-04-28 20:46:29 +00:00
jan.nijtmans 731ea18a69 Merge 8.7 2020-04-28 07:43:02 +00:00
dgp be98f67f6a merge 8.7 2020-04-27 19:29:34 +00:00
dgp 2e67393129 [a444889cbe] Quick fix to satisfy Travis. Might revise later. 2020-04-27 16:10:54 +00:00
dgp 97e600c877 merge 8.6 2020-04-27 16:07:45 +00:00
dgp aa386ba8fc merge 8.7 2020-04-27 13:44:38 +00:00
dgp d9e077b2fa merge 8.7 2020-04-27 12:59:06 +00:00
dgp 9a08654b23 merge 8.7 2020-04-26 22:14:45 +00:00
dgp 3dce3e5685 merge 8,7 2020-04-26 21:32:03 +00:00
dgp 99a9e5c7c5 merge 8.7 2020-04-26 21:18:49 +00:00
dgp d438ca171b merge 8.7 2020-04-26 20:38:06 +00:00
jan.nijtmans 4a86cf8b00 Since Tcl_NumUtfChars() now can return a value of more that 32 bits .... 2020-04-26 15:30:12 +00:00
jan.nijtmans d2444449ec Merge 8.7 2020-04-26 15:21:21 +00:00
jan.nijtmans 0f01f464de Merge 8.7 2020-04-25 22:50:39 +00:00
jan.nijtmans 5fe38b57ea Merge 8.7 2020-04-24 21:44:28 +00:00
jan.nijtmans c202c057b1 Merge 8.7 2020-04-24 13:32:47 +00:00
jan.nijtmans f4072f4ef7 Merge 8.7 2020-04-24 10:49:28 +00:00
jan.nijtmans 666cf1c887 Merge 8.7 2020-04-23 12:58:46 +00:00
jan.nijtmans 4bd7d54291 Merge 8.7 2020-04-22 08:10:35 +00:00
jan.nijtmans b002a51274 Merge 8.7 2020-04-21 10:24:45 +00:00
jan.nijtmans 1e6e700682 Merge 8.7 2020-04-20 22:00:46 +00:00
jan.nijtmans fc7ca4202e Change a few variables from type "int" to "size_t". Always test TCL_UTF_MAX for <= 3 or > 3, because that's the only 2 flavours we really have. 2020-04-20 21:07:35 +00:00
jan.nijtmans 68c30819ad Merge 8.7 2020-04-20 20:46:50 +00:00
jan.nijtmans fa2ae66dcd Merge 8.7 2020-04-19 09:17:35 +00:00
jan.nijtmans 8ddd5fea3c Merge 8.7 2020-04-18 20:30:08 +00:00
jan.nijtmans 980bcbfdbf Merge 8.7 2020-04-17 12:32:42 +00:00
jan.nijtmans 14abfaa3d0 Merge 8.7 2020-04-16 14:54:21 +00:00
jan.nijtmans d296c39c60 Merge 8.7 2020-04-15 20:22:03 +00:00
jan.nijtmans 54e3729e91 Merge 8.7 2020-04-15 20:03:38 +00:00
dgp 8f8f9400f5 merge 8.7 2020-04-14 18:06:31 +00:00
jan.nijtmans 0103777046 Merge 8.7 2020-04-14 16:47:32 +00:00
jan.nijtmans d20e8e7e25 Merge 8.7 2020-04-14 16:16:48 +00:00
dgp 3a2ad288ca Remove test not suitable for Tcl 9. 2020-04-14 15:57:08 +00:00
dgp 6c1d8e4d62 merge 8.7 2020-04-14 15:38:08 +00:00
jan.nijtmans 5edd5f235f Merge 8.7 2020-04-14 14:50:29 +00:00
jan.nijtmans 6a0b66fc79 Merge 8.7 2020-04-14 14:30:35 +00:00
jan.nijtmans 527a481e1a Merge 8.7 2020-04-13 09:25:35 +00:00
jan.nijtmans 1e0c16c4db merge-mark 2020-04-10 21:00:44 +00:00
jan.nijtmans a763531949 Merge 8.7 2020-04-10 15:22:40 +00:00
jan.nijtmans 54adbbe05c Merge 8.7 2020-04-08 08:11:04 +00:00
jan.nijtmans 9848eb222d Merge-mark 8.7. Also fix 2 executable flags, which shouldn't have been set. 2020-04-07 16:28:27 +00:00
jan.nijtmans 6e89d3d433 Merge 8.7 2020-04-06 20:50:10 +00:00
jan.nijtmans f47fbe763a Fix build with --enable-symbols=mem 2020-04-06 13:24:34 +00:00
jan.nijtmans fc83e1302a Merge 8.7 2020-04-06 09:34:42 +00:00
jan.nijtmans 2fa58f1e9f Merge 8.7 2020-04-05 20:46:06 +00:00
dgp 401fb4fe4f merge 8.7 2020-04-03 14:31:54 +00:00
jan.nijtmans b586e6742c Merge 8.7 2020-04-03 09:14:38 +00:00
jan.nijtmans 5bd35202c0 Merge 8.7 2020-04-03 07:39:22 +00:00
dgp b804844729 merge 8.7 2020-04-02 23:26:47 +00:00
sebres a9032c6dac merge 8.7 2020-04-02 14:41:45 +00:00
dgp f8715bf730 merge 8.7 2020-04-01 20:20:49 +00:00
dgp 6bce59a249 merge 8.7 2020-04-01 19:22:59 +00:00
jan.nijtmans 47e4246d76 Merge 8.7 2020-04-01 13:47:43 +00:00
dgp 8ab2c9cf62 merge 8.7 2020-04-01 12:37:52 +00:00
jan.nijtmans 6a1a8526f1 Merge 8.7 2020-03-31 20:29:07 +00:00
dgp e266daa43e close fork 2020-03-31 16:22:22 +00:00
dgp 6e29f3da25 Missed one int -> size_t in the merge. 2020-03-31 16:21:11 +00:00
jan.nijtmans 50737b35c5 Merge 8.7 2020-03-31 16:19:08 +00:00
dgp 449b68a777 merge 8.7 2020-03-31 16:09:38 +00:00
jan.nijtmans f3056f720b Merge 8.7 2020-03-31 11:02:57 +00:00
jan.nijtmans 998384d149 Internal API simplifications: Don't use types like HINSTANCE/HMODULE any more, just void*. Has effect only on Win32 and Cygwin. 2020-03-31 07:09:46 +00:00
dgp c578a1e4fa merge 8.7 2020-03-30 16:08:17 +00:00
jan.nijtmans c0fc8c6aad Merge 8.7 2020-03-30 13:01:26 +00:00
jan.nijtmans ddd4c15594 Merge 8.7 2020-03-30 12:04:49 +00:00
jan.nijtmans 958d0d8617 Merge 8.7 2020-03-30 10:32:16 +00:00
dgp 9e82ddc739 Adjustments for easier merging. 2020-03-30 03:23:26 +00:00
dgp 2a007ddb50 Change of variables. 2020-03-29 22:10:28 +00:00
dgp ce51daca48 Let the private, internal TclGetBytesFromObj handle size_t lengths 2020-03-29 21:47:12 +00:00
dgp 5da270361f merge 8.7 2020-03-28 19:59:18 +00:00
dgp 08d3728b1d merge 8.7 2020-03-28 16:42:05 +00:00
jan.nijtmans d58bfaf6f3 Merge 8.7 2020-03-27 21:07:58 +00:00
jan.nijtmans c3948aeea7 Merge 8.7 2020-03-27 16:28:50 +00:00
jan.nijtmans 8c16a043c1 Merge 8.7 2020-03-27 12:07:00 +00:00
jan.nijtmans 6eaa73e23c Merge 8.7 2020-03-25 17:07:30 +00:00
jan.nijtmans b6f9e488f5 Fix for windows build (Windows doesn't have "%z" printf modifier) 2020-03-25 15:37:25 +00:00
jan.nijtmans a514fc0bbb Merge 8.7 2020-03-25 15:15:22 +00:00
jan.nijtmans f00ce28128 Merge 8.7 2020-03-24 13:40:10 +00:00
jan.nijtmans fa618f393f Merge 8.7.
Remove Tcl_MacOSXOpenBundleResources() completely.
2020-03-24 11:13:27 +00:00
jan.nijtmans ac5b43b095 Merge 8.7 2020-03-22 21:28:01 +00:00
jan.nijtmans a2aaaad84a Merge 8.7 2020-03-20 17:17:06 +00:00
dgp 39b03cdb38 merge 8.7 2020-03-18 22:03:17 +00:00
jan.nijtmans d7364d1f4b Merge 8.7 2020-03-18 14:06:17 +00:00
jan.nijtmans 303fbfc4be Merge 8.7 2020-03-17 16:48:07 +00:00
dgp 77bbf50dd0 merge 8.7 2020-03-17 01:20:01 +00:00
jan.nijtmans 9c405af577 Merge 8.7 2020-03-15 12:21:21 +00:00
jan.nijtmans 2632f2d529 merge-mark 2020-03-14 22:08:33 +00:00
jan.nijtmans a98d79021f Merge 8.7 2020-03-14 22:02:00 +00:00
jan.nijtmans 49b167a388 Merge 8.7 2020-03-13 11:12:33 +00:00
sebres 2ded4dcac5 merge 8.7 (lpop SF fix) 2020-03-11 15:55:31 +00:00
jan.nijtmans 72f5a0b42f Put back dummy Tcl_DriverCloseProc/Tcl_DriverSeekProc (just defined as "void"). Needed to make Tk compile with C++ against 9.0 headers. 2020-03-11 10:20:51 +00:00
jan.nijtmans 745e45d119 Merge 8.7 2020-03-10 13:58:07 +00:00
dgp f336629f65 merge 8.7 2020-03-09 16:34:46 +00:00
jan.nijtmans 254b4fa35f Merge 8.7 2020-03-09 13:08:33 +00:00
jan.nijtmans 24cfa12d40 Merge 8.7 2020-03-07 18:31:45 +00:00
jan.nijtmans 2c34ced219 Merge 8.7 2020-03-07 16:03:16 +00:00
dgp c4a1ea568e merge 8.7 2020-03-06 21:33:24 +00:00
dgp 1e155ca669 merge 8.7 2020-03-05 19:22:45 +00:00
jan.nijtmans 2a68cc554f Merge 8.7 2020-03-05 14:44:51 +00:00
jan.nijtmans 7f9190f5db Merge 8.7 2020-03-05 11:56:24 +00:00
dgp 2328e4a58e merge 8.7 2020-03-04 21:05:02 +00:00
jan.nijtmans d9f1c65e5b Merge 8.7 2020-03-04 16:18:04 +00:00
jan.nijtmans cf1d1dfbd9 Merge 8.7 2020-03-04 15:56:32 +00:00
jan.nijtmans 026ddaafb8 Merge 8.7.
Remove documentation and typedefs related to old channel types.
2020-03-04 14:33:19 +00:00
jan.nijtmans c3d90415a2 merge-mark 2020-03-02 11:31:06 +00:00
jan.nijtmans f4a42dff01 re-generate configure script (option -Wc++-compat was still missing) 2020-03-01 12:35:04 +00:00
jan.nijtmans 0846f65993 Merge 8.7 2020-02-29 21:44:11 +00:00
jan.nijtmans f30e9cfd65 Merge-mark 2020-02-28 14:24:30 +00:00
jan.nijtmans 35cf0ba42a Merge 8.7 2020-02-28 14:07:17 +00:00
jan.nijtmans 4a07460db0 Implement TIP #497: Full support for Unicode planes 1-16. 2020-02-28 12:58:54 +00:00
jan.nijtmans 4af90e27e5 Merge 8.7 2020-02-28 12:46:42 +00:00
jan.nijtmans 63994a73e3 Merge 8.7 2020-02-26 14:16:49 +00:00
jan.nijtmans 86d269ab0a Merge 8.7 2020-02-26 08:14:56 +00:00
jan.nijtmans 912dd9a997 Merge 8.7 2020-02-24 12:19:29 +00:00
jan.nijtmans 2cce06805f Merge 8.7 2020-02-21 08:55:02 +00:00
jan.nijtmans 3929a73ee0 Merge trunk 2020-02-13 22:24:07 +00:00
jan.nijtmans 30c32418f6 Merge 8.7 2020-02-12 13:19:35 +00:00
jan.nijtmans 802d340dad Merge 8.7 2020-02-04 11:05:57 +00:00
jan.nijtmans 33f3ebf7ec Merge 8.7 2020-02-04 08:28:49 +00:00
jan.nijtmans 7c18228900 merge-mark 2020-02-02 16:30:35 +00:00
jan.nijtmans 108d222378 Merge 8.7 2020-02-02 15:27:13 +00:00
jan.nijtmans d6e3843b5a Merge 8.7 2020-01-31 07:56:03 +00:00
sebres 58232a8750 merge 8.7 2020-01-30 15:47:12 +00:00
jan.nijtmans 7fa698c624 Merge 8.7 2020-01-30 13:54:51 +00:00
jan.nijtmans 29b9dd2e6f Merge 8.7 2020-01-30 13:27:57 +00:00
jan.nijtmans 9d8c640e00 Merge 8.7 2020-01-29 13:03:20 +00:00
jan.nijtmans 2a7ba6468e Merge 8.7 2020-01-27 10:33:49 +00:00
jan.nijtmans 0ebc58865f merge-mark 2020-01-25 14:53:02 +00:00
dgp a9fd991fe6 Implement TIP 559 2020-01-24 16:53:13 +00:00
jan.nijtmans 5570417141 Merge trunk 2020-01-24 11:00:58 +00:00
apnadkarni dc9dbe5998 Fix See also links in list commands 2020-01-23 15:42:59 +00:00
jan.nijtmans a3f11a86e9 Merge 8.7 2020-01-23 13:15:51 +00:00
jan.nijtmans 2c19ef85ed Merge 8.7 2020-01-23 10:41:38 +00:00
jan.nijtmans 5bf4816c29 merge-mark 2020-01-23 09:47:38 +00:00
dgp 5f9514bba4 Implement TIp 543. 2020-01-21 22:14:55 +00:00
jan.nijtmans c48019496e Merge trunk 2020-01-21 09:39:21 +00:00
jan.nijtmans b77246e08b Enable test-cases stringObj-15.[5-8]: "nodep" restriction doesn't work in 9.0. 2020-01-21 09:21:30 +00:00
jan.nijtmans a3fdbe449b Merge trunk 2020-01-20 16:43:54 +00:00
jan.nijtmans 4b7066e5b3 Merge 8.7. Add TclAppendUnicodeToObj() to internal stubs, since it is needed in tclTestObj.c 2020-01-20 15:16:22 +00:00
jan.nijtmans 8ff40f7d46 Merge 8.7 2020-01-20 14:19:47 +00:00
sebres 041d53289b merge 8.7 2020-01-17 18:37:40 +00:00
jan.nijtmans a72376335b Merge 8.7 2020-01-15 10:22:25 +00:00
dgp fc63e758a4 Implement TIP 559 2020-01-13 16:49:42 +00:00
jan.nijtmans 54beae13a7 Merge 8.7 2020-01-13 15:21:38 +00:00
jan.nijtmans c32336ef0e Merge 8.7 2020-01-13 12:48:05 +00:00
jan.nijtmans 86052f5003 Merge 8.7 2020-01-13 12:11:10 +00:00
dgp 5953233f3b merge trunk 2020-01-10 17:40:55 +00:00
jan.nijtmans 034fad8f6a Merge 8.7 2020-01-10 15:27:49 +00:00
jan.nijtmans 01db149e3c Merge 8.7 2020-01-09 09:28:34 +00:00
dgp 1afc0833ed merge 8.7 2020-01-08 22:32:16 +00:00
dgp 7c1facbfb4 merge 8.7 2020-01-08 21:40:42 +00:00
dgp d7e1a76e06 merge 8.7 2020-01-08 21:10:50 +00:00
jan.nijtmans 7d716898d7 Merge 8.7 2020-01-08 13:19:09 +00:00
jan.nijtmans 3b9e37ced8 Merge 9.0 2020-01-07 15:58:30 +00:00
jan.nijtmans 6776429ba1 Merge 8.7 2020-01-07 14:50:44 +00:00
jan.nijtmans 631c17942e Merge 8.7 2020-01-07 09:45:47 +00:00
jan.nijtmans 98496f3c16 Merge 8.7 2020-01-07 08:45:45 +00:00
dgp 1b9f0a138d merge 8.7 2020-01-06 20:26:34 +00:00
dgp 889b9a832f merge 8.7 2020-01-06 18:08:58 +00:00
dgp 99c687177a merge 8.7 2020-01-06 17:27:10 +00:00
jan.nijtmans 162b310610 Merge 8.7 2020-01-06 11:02:56 +00:00
jan.nijtmans a315170269 Merge 8.7 2020-01-06 10:41:57 +00:00
fvogel ff7ff08f29 merge core-8-branch, restore the build by providing a copysign replacement for old MSVC versions. 2020-01-02 21:01:37 +00:00
dgp fd4b052c0d merge trunk 2019-12-30 21:29:09 +00:00
dgp f5a8aaadf8 Remove TclInitCompiledLocals(), internal routine marked deprecated in 8.5+. 2019-12-30 21:00:09 +00:00
Kevin B Kenny 329faccfd5 Merge Tcl 8.7 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:34:51 +00:00
jan.nijtmans 8d0c814716 Merge 8.7 2019-12-24 15:05:50 +00:00
jan.nijtmans d326c63806 Merge 8.7 2019-12-24 13:52:54 +00:00
jan.nijtmans 3ae5ed3dfc Merge 8.7 2019-12-24 10:06:37 +00:00
jan.nijtmans 89890a88e6 Merge 8.7 2019-12-23 13:43:49 +00:00
jan.nijtmans 5074a34663 Merge 8.7 2019-12-23 11:28:29 +00:00
jan.nijtmans 32a3c1d678 Merge 8.7 2019-12-22 15:10:25 +00:00
jan.nijtmans 1d52808a73 Merge 8.7 2019-12-19 22:16:09 +00:00
jan.nijtmans de7ebc2ea1 Merge 8.7 2019-12-14 17:45:04 +00:00
jan.nijtmans e9fb22cfeb Merge trunk 2019-12-14 14:12:41 +00:00
jan.nijtmans a91c7a019d Merge 8.7 2019-12-13 22:20:03 +00:00
jan.nijtmans 676312d822 Merge 8.7 2019-12-13 21:22:11 +00:00
jan.nijtmans be44843404 Fix [435acb846c]: libtommath - missing declarations 2019-12-13 20:35:56 +00:00
jan.nijtmans 9118bcfb5f More tweaks to libtommath functions signatures: No need any more to stay binary compatible with Tcl 8.x, so we can use the mp_digit type now. 2019-12-13 15:09:59 +00:00
jan.nijtmans 8f533db35f Remove deprecated libtommath stub entries 2019-12-13 13:33:33 +00:00
jan.nijtmans 077504f676 Merge 8.7 2019-12-13 13:06:34 +00:00
jan.nijtmans d0ff8f4a0d Merge 8.7 2019-12-12 21:43:08 +00:00
jan.nijtmans 43b7af15a7 Merge trunk 2019-12-11 15:37:09 +00:00
jan.nijtmans d1a4083e3f Merge 8.7 2019-12-11 08:54:47 +00:00
jan.nijtmans ac849b98ed Merge 8.7 2019-12-10 13:43:32 +00:00
sebres beb5137192 merge 8.7 2019-12-10 13:19:56 +00:00
jan.nijtmans 4c162a421c Merge 8.7 2019-12-09 22:55:01 +00:00
sebres de8a9991af merge 8.7 2019-12-09 11:44:27 +00:00
jan.nijtmans 0e4f559e7f Merge 8.7 2019-12-09 11:32:07 +00:00
jan.nijtmans fe32483d5c Merge 8.7 2019-12-08 16:52:00 +00:00
dgp f3b259c158 merge 8.7 2019-12-06 16:02:01 +00:00
jan.nijtmans 8ed389c37a Merge 8.7 2019-12-04 13:30:22 +00:00
jan.nijtmans 3fc1c2a172 Merge 8.7 2019-12-03 19:31:48 +00:00
jan.nijtmans 8d6601013e Merge 9.0 2019-12-03 16:16:52 +00:00
jan.nijtmans f00afc4fdd Merge 8.7 2019-12-03 13:22:18 +00:00
jan.nijtmans 5a66f39637 Merge 8.7 2019-12-03 12:59:47 +00:00
jan.nijtmans 87baa32396 Merge 8.7 2019-12-02 20:51:41 +00:00
dgp 38160dc3cc Bump to 9.0a2 to distinguish development from 9.0a1 release. 2019-12-02 18:25:35 +00:00
jan.nijtmans 9be1e807d6 Merge 8.7 2019-12-02 13:35:28 +00:00
jan.nijtmans b6a51d3251 Merge 8.7 2019-12-02 11:50:26 +00:00
jan.nijtmans 332c5aadfa Merge 8.7 2019-12-01 21:26:11 +00:00
jan.nijtmans bf9226489d Fix executable flag 2019-12-01 17:53:26 +00:00
jan.nijtmans 3ea27f399f Merge 8.7 2019-12-01 17:00:20 +00:00
jan.nijtmans 5fc479ca03 Merge 8.7 2019-11-29 09:55:01 +00:00
jan.nijtmans 8e51252be8 Merge 8.7 2019-11-28 13:45:50 +00:00
jan.nijtmans f67e946a67 Merge 8.7 2019-11-27 22:25:05 +00:00
jan.nijtmans 389e7e96e5 Merge 8.7 2019-11-27 20:17:51 +00:00
jan.nijtmans dfdf436fb2 Merge 8.7 2019-11-27 14:27:26 +00:00
jan.nijtmans 93246519da Merge 8.7 2019-11-27 11:10:55 +00:00
jan.nijtmans 405b29cd1b Merge 8.7 2019-11-26 21:40:36 +00:00
dgp 8f7d32c7dd merge release 2019-11-26 18:26:42 +00:00
dgp 43550ce1fa merge trunk 2019-11-26 17:57:56 +00:00
dgp d8127f5c3a merge 8.7 2019-11-26 17:55:38 +00:00
dgp 41381425e6 merge mark 2019-11-25 17:01:23 +00:00
jan.nijtmans a9fd02e864 Merge 8.7 2019-11-25 16:41:25 +00:00
dgp 18e4f3d635 complete changes 2019-11-22 21:26:09 +00:00
dgp 5a7c86fa32 Start record of the changes only in Tcl 9. 2019-11-22 21:08:12 +00:00
dgp 69aedf8b17 reset changes baseline 2019-11-22 21:01:36 +00:00
dgp 9d9fcdf383 merge trunk 2019-11-22 20:59:12 +00:00
dgp d7e26630c0 merge 8.7 2019-11-22 15:36:45 +00:00
sebres 06bbb3d47b merge 8.7 2019-11-21 19:19:06 +00:00
jan.nijtmans 5d4efa2510 Merge 8.7 2019-11-18 20:42:22 +00:00
jan.nijtmans 1b8114cd71 Merge 9.0 2019-11-17 20:12:21 +00:00
dgp 7ff0cfd5b7 merge trunk 2019-11-15 20:32:35 +00:00
dgp 13ebaf6ca3 merge 8.7 2019-11-15 20:20:42 +00:00
jan.nijtmans c44fa310d2 Merge 8.7 2019-11-15 14:45:28 +00:00
jan.nijtmans f3c5988996 Merge 8.7 2019-11-15 13:18:03 +00:00
jan.nijtmans b28beee0fc Merge 8.7 2019-11-15 12:17:42 +00:00
sebres 7e79827ba3 merge 8.7 2019-11-14 20:13:05 +00:00
jan.nijtmans 33632b0955 Merge 8.7 2019-11-14 14:50:41 +00:00
jan.nijtmans d085d8f0bb Merge 8.7 2019-11-13 16:03:18 +00:00
jan.nijtmans 27fd2bbb61 Merge 8.7 2019-11-13 13:50:19 +00:00
jan.nijtmans 9ec6e380ed Merge 8.7 2019-11-13 09:24:00 +00:00
jan.nijtmans 8f3c64a7cd Merge 8.7 2019-11-11 20:52:10 +00:00
jan.nijtmans 1acefe17b1 Merge 8.7 2019-11-09 20:04:53 +00:00
jan.nijtmans a3bdd051a3 Merge 8.7 2019-11-08 11:44:37 +00:00
jan.nijtmans 79b3f448c0 Merge 8.7 2019-11-07 14:37:14 +00:00
jan.nijtmans 8665d61608 Silence MSVC C4090 warnings when using ckrealloc(). Also make sure that Tcl itself doesn't use ckalloc() and friends any more. 2019-11-07 08:41:17 +00:00
jan.nijtmans cbeadca761 Silence MSVC C4090 warnings when using ckfree() in certain situations. Problem reported by fvogel. 2019-11-06 22:30:07 +00:00
jan.nijtmans 6802d4740c Twice ckfree() -> Tcl_Free() 2019-11-06 22:18:37 +00:00
dgp 22abf1ffa4 merge trunk 2019-11-06 14:58:51 +00:00
dgp cda283c652 merge 8.7 2019-11-06 14:52:26 +00:00
dgp 16ee735e92 Bump to version 9.0a1 for release. 2019-11-05 22:05:21 +00:00
dgp 0d8a34fe68 merge 8.7 2019-11-05 21:35:37 +00:00
jan.nijtmans b3b2c76fdc Merge 8.7 2019-10-31 11:16:54 +00:00
jan.nijtmans 1813f87d9a Merge 8.7 2019-10-31 10:59:53 +00:00
jan.nijtmans 1e1530a566 Merge 8.7 2019-10-30 21:40:01 +00:00
jan.nijtmans af55df92b4 Merge 8.7 2019-10-29 12:58:19 +00:00
jan.nijtmans 275904f8cb Merge 8.7 2019-10-28 16:42:52 +00:00
jan.nijtmans d85bcdef8b Merge 8.7 2019-10-28 16:22:21 +00:00
jan.nijtmans b89e3d8c83 Merge 8.7 2019-10-28 09:10:32 +00:00
jan.nijtmans fb040138c9 Close fork, Merge 8.7 2019-10-28 08:50:57 +00:00
Kevin Walzer 56f2abbf89 further refinement of configure to remove /System 2019-10-27 22:22:50 +00:00
Kevin Walzer 2cd7aa2260 Remove /System from auto_path on macOS; change seems to have been overwritten by other merge 2019-10-27 22:14:41 +00:00
jan.nijtmans bf1382a38f Merge trunk 2019-10-25 20:45:45 +00:00
jan.nijtmans 6362d5ced5 Merge 8.7 2019-10-25 20:09:13 +00:00
pooryorick 2d699b3818 If NO_REALPATH is defined, raise an error instead of building a broken Tcl. 2019-10-25 13:17:28 +00:00
Kevin Walzer e9121854f9 Remove /System from auto_path on macOS because Apple has deprecated its own ancient installation of Tcl/Tk 2019-10-25 01:16:54 +00:00
jan.nijtmans 1a5b1241db Merge 8.7 2019-10-24 19:55:34 +00:00
jan.nijtmans 065fc14cc4 Merge 8.7 2019-10-24 15:41:32 +00:00
jan.nijtmans 8f3937588f Merge 8.7 2019-10-24 08:45:23 +00:00
jan.nijtmans d068a54395 Merge 8.7. But - in stead - remove all deprecated API from libtommath 1.2.0: Starting with Tcl 9.0 we don't support libtommath's deprecated API any more. 2019-10-23 14:33:58 +00:00
jan.nijtmans 52f3af0bcf Merge 8.7 2019-10-23 11:11:58 +00:00
jan.nijtmans 4958363608 merge-mark 2019-10-22 21:56:05 +00:00
jan.nijtmans 8726aabade Merge 8.7 2019-10-22 21:36:21 +00:00
jan.nijtmans d14ab39047 Merge 8.7 2019-10-22 12:54:46 +00:00
jan.nijtmans 7f35785b2f Merge 8.7 2019-10-14 21:18:02 +00:00
jan.nijtmans 17993c4a6f Merge 8.7 2019-10-11 12:47:21 +00:00
jan.nijtmans c358ee8f78 Merge 8.7 2019-10-10 19:19:38 +00:00
jan.nijtmans 152c7b4944 Merge trunk 2019-10-06 20:42:36 +00:00
jan.nijtmans 24a1b4e94f Merge 8.7 2019-10-05 20:45:31 +00:00
jan.nijtmans 35c793de5f Merge 8.7 2019-10-02 11:39:44 +00:00
jan.nijtmans 6e4833d8fd Merge 8.7 2019-09-29 15:51:07 +00:00
jan.nijtmans ae65a0ee04 Merge 8.7 2019-09-29 12:18:11 +00:00
jan.nijtmans 80a7abf7e5 Adapt test-case to full-utf correct behaviour 2019-09-27 13:02:39 +00:00
jan.nijtmans d9415749f8 Merge trunk 2019-09-25 13:18:11 +00:00
jan.nijtmans 82947d7ebf Merge 8.7 2019-09-25 13:17:09 +00:00
jan.nijtmans 0153d6f564 Make Tcl_WinUtfToTChar/Tcl_WinTCharToUtf really deprecate in 9.0 (now that no battery-extensions use it any more)
Remove two functions which are not used any more (they changed to macro's earlier)
2019-09-25 11:51:41 +00:00
jan.nijtmans e75152402a Merge trunk 2019-09-20 21:37:21 +00:00
jan.nijtmans fe0c007b96 Merge 8.7 2019-09-20 21:21:14 +00:00
jan.nijtmans 1e8a4963fc Merge trunk 2019-09-20 15:07:11 +00:00
jan.nijtmans 2912ca25d8 Merge 8.7 2019-09-20 15:04:09 +00:00
jan.nijtmans ce1a26acf5 Merge trunk 2019-09-19 15:42:22 +00:00
jan.nijtmans dc6c385849 Merge 8.7 2019-09-19 15:36:11 +00:00
jan.nijtmans 52e96157d2 Merge 8.7 2019-09-18 09:39:53 +00:00
jan.nijtmans 1d9a058eae Merge 8.7 2019-09-17 13:03:11 +00:00
jan.nijtmans 11aba21de9 Merge 8.7 2019-09-17 10:47:21 +00:00
jan.nijtmans 86273355c2 Merge trunk 2019-09-17 09:23:29 +00:00
jan.nijtmans 632946bbe0 Merge 8.7 2019-09-17 07:12:57 +00:00
jan.nijtmans b765d541e6 Merge 8.7 2019-09-16 21:41:26 +00:00
jan.nijtmans 1583d8b4ef Merge 8.7 2019-09-16 19:16:07 +00:00
jan.nijtmans 556c0dbc24 Two paces where TCL_AUTO_LENGTH should be used 2019-09-14 13:11:55 +00:00
jan.nijtmans fc77f0dda4 Merge 8.7 2019-09-14 13:07:19 +00:00
jan.nijtmans 4396d37f6f Merge 8.7 2019-09-14 12:37:13 +00:00
jan.nijtmans 3f40916f38 Merge 8.7 2019-09-13 09:12:20 +00:00
jan.nijtmans bd089b3935 Merge 8.7 2019-09-13 07:58:13 +00:00
sebres 5d5451c6da merge 8.7 2019-09-12 20:51:24 +00:00
jan.nijtmans a6c66ef755 Merge 8.7 2019-09-12 14:49:37 +00:00
dgp e3967b9754 merge 8.7 2019-09-11 19:28:35 +00:00
dgp ae9073b853 merge 8.7 2019-09-11 16:06:19 +00:00
jan.nijtmans 810e5a0f69 Merge 8.7 2019-09-11 11:37:02 +00:00
jan.nijtmans a142b502a9 Merge 8.7 2019-09-10 13:34:39 +00:00
jan.nijtmans 1224ff3e01 merge-mark 2019-09-09 09:24:47 +00:00
jan.nijtmans a9f4dacf81 Merge 8.7 2019-09-09 09:05:16 +00:00
jan.nijtmans f1d0940b8e Merge 8.7 2019-09-08 13:39:24 +00:00
jan.nijtmans c6ad528613 Merge 8.7 2019-09-07 14:09:08 +00:00
jan.nijtmans 3f58909d20 Merge 8.7 2019-09-06 14:53:09 +00:00
jan.nijtmans dec6843491 Merge 8.7 2019-09-06 12:38:41 +00:00
jan.nijtmans b0bd304e08 merge-mark 2019-09-05 21:26:35 +00:00
jan.nijtmans cef22b73ee previous commit should not have been a merge-mark ... 2019-09-05 07:17:54 +00:00
jan.nijtmans bbdcf41e95 merge-mark 2019-09-05 06:59:00 +00:00
jan.nijtmans eeff0f5146 Merge 8.7 2019-09-04 11:03:10 +00:00
jan.nijtmans 0625bbefb4 Merge 8.7 2019-09-03 10:57:09 +00:00
jan.nijtmans dbdb35e20e Merge 8.7 2019-09-02 11:35:12 +00:00
apnadkarni f5daf73202 Merge from core-8-branch. nmake bug fix [889065786b] for extension stubs. 2019-08-29 10:39:02 +00:00
jan.nijtmans b7f809ade5 Merge 8.7 2019-08-28 11:45:42 +00:00
jan.nijtmans fa1cc2cd3f Merge 8.7 2019-08-27 11:59:38 +00:00
jan.nijtmans 276049980e Merge 8.7 2019-08-26 14:09:50 +00:00
jan.nijtmans 3721613126 Merge 8.7 2019-08-26 09:03:11 +00:00
jan.nijtmans 21ec4f64b2 Merge 8.7 2019-08-23 09:07:33 +00:00
sebres 136bf8d460 merge 8.7: fixes [40d5ff2a0e], etc 2019-08-19 19:29:55 +00:00
jan.nijtmans 69a117efbe Merge 8.7 2019-08-15 15:32:20 +00:00
jan.nijtmans ab449cd1d2 Merge 8.7 2019-08-15 08:10:11 +00:00
jan.nijtmans be3995f91a Merge 8.7 2019-08-14 07:04:09 +00:00
jan.nijtmans e05045246f Merge 8.7 2019-08-13 20:09:42 +00:00
jan.nijtmans 6ba55114e2 Fix handling of length (size_t)-1 in tclMain.c. This should fix handling of command-line arguments with TCL_UTF_MAX=6, necessary to make tclsh run at all ... 2019-08-11 21:17:35 +00:00
jan.nijtmans 9888ccda67 Fix signature of TclWCharToUtfDString for TCL_UTF_MAX=6, and handling of length -1 2019-08-05 20:15:15 +00:00
jan.nijtmans 3558c04970 merge-mark 8.7 2019-08-04 19:39:29 +00:00
jan.nijtmans e0e662b6cd Merge 8.7 2019-08-04 18:24:09 +00:00
jan.nijtmans fe381e2b84 Merge 8.7 2019-08-02 14:35:52 +00:00
jan.nijtmans 84da3c8113 Merge 8.7 2019-08-02 14:26:47 +00:00
jan.nijtmans 4def430d27 Merge 8.7 2019-08-02 12:48:29 +00:00
jan.nijtmans 9367d3491b merge-mark 2019-08-02 08:10:10 +00:00
jan.nijtmans a4cdc92947 Merge 8.7 2019-08-01 16:05:35 +00:00
jan.nijtmans 0f58a5ca73 Merge 8.7 2019-08-01 09:20:38 +00:00
jan.nijtmans 75b8ba1fa3 Merge 8.7 2019-08-01 08:37:53 +00:00
jan.nijtmans 62c64586b6 Merge 8.7 2019-07-25 09:01:05 +00:00
jan.nijtmans 810eeec19d Merge 8.7 2019-07-24 08:29:25 +00:00
jan.nijtmans 737c82426b Merge 8.7 2019-07-17 11:28:47 +00:00
jan.nijtmans a3853cafd1 Merge 8.7 2019-07-16 09:56:23 +00:00
jan.nijtmans bcd1623533 Merge 8.7 2019-07-16 09:25:44 +00:00
jan.nijtmans 73788579a1 Merge 8.7 2019-07-13 17:18:03 +00:00
sebres 44952e7c43 restore test-cases covering bug-4718b41c56 (partially revert last checkin, cherrypick from 8.7), set constraint time64bit to 1 (always valid in 9.0) 2019-07-12 14:32:39 +00:00
sebres 15b8ba49c1 merge point only (no changes, since time_t in 9.0 is always 64-bits and fix of branch bug-4718b41c56 unwanted here) 2019-07-12 12:24:06 +00:00
jan.nijtmans cd1e068061 Merge 8.7 2019-07-12 12:16:43 +00:00
jan.nijtmans ba1938b59e Merge 8.7
Don't build with TCL_NO_DEPRECATED, since we didn't deprecate anything in 9.0 yet
2019-07-05 23:08:15 +00:00
jan.nijtmans 4864626e88 Fix [4718b41c56d8c135] for win32. Now timestamps on Win32 can be > 19 january 2038.
Caveat: Now Tcl MUST be compiled with VS2005+, or any other compiler which has C headers compatible with VC2005+ (latest mingw-w64 is OK too!)
Tcl on Win32 is now no longer compiled with _USE_32BIT_TIME_T, so this is (potentially) binary incompatible.
2019-07-05 13:34:24 +00:00
jan.nijtmans 7e70c52009 Merge 8.7 2019-07-05 12:12:13 +00:00
jan.nijtmans dc2e004dcb Merge 8.7 2019-07-03 15:29:35 +00:00
José Ignacio Marín 91661a7da0 Update TZ info to tzdata2019b. 2019-07-02 07:25:33 +00:00
dgp 25dac72093 merge 8.7 2019-07-01 19:31:18 +00:00
jan.nijtmans 9884b5887e Merge 8.7 2019-06-30 09:21:58 +00:00
jan.nijtmans 91407fd3d6 Merge 8.7 2019-06-29 21:35:38 +00:00
jan.nijtmans 658e03b4d7 Merge 8.7 2019-06-29 13:59:11 +00:00
jan.nijtmans 121c6e30ab Merge 8.7 2019-06-28 22:43:10 +00:00
jan.nijtmans 9f89b782ef Merge 8.7 2019-06-28 22:38:28 +00:00
dgp 2298ba7ed7 merge 8.7 2019-06-28 12:43:50 +00:00
dgp 8265ea67d6 Convert deprecation to elimination for Tcl 9. 2019-05-11 15:04:57 +00:00
dgp 800ce1bfa2 Start TIP 543 for Tcl 9. 2019-05-11 14:56:34 +00:00
jan.nijtmans dae5abca60 Merge trunk. Further WIP for TIP #497, far from finished .... 2019-03-08 23:54:08 +00:00
jan.nijtmans cd2d12e256 Merge 9.0 2018-10-23 19:42:47 +00:00
jan.nijtmans dc465cd88f merge trunk 2018-10-19 19:21:09 +00:00
jan.nijtmans bedeed1c1b Merge trunk 2018-10-09 18:52:44 +00:00
jan.nijtmans f61c3bdb28 Start implementing TIP #497. regexp's now are >BMP-aware. WIP 2018-05-01 19:02:32 +00:00
321 changed files with 2864 additions and 2397 deletions
-17
View File
@@ -1,20 +1,3 @@
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
+1
View File
@@ -27,6 +27,7 @@
# Denote all files that are truly binary and should not be modified.
*.a binary
*.bmp binary
*.dll binary
*.exe binary
*.gif binary
+37
View File
@@ -0,0 +1,37 @@
name: Linux Build and Test
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Configure
working-directory: unix
run: |
mkdir "${HOME}/install dir"
./configure ${CFGOPT} "--prefix=$HOME/install dir" || (cat config.log && exit 1)
- name: Build
working-directory: unix
run: |
make all
- name: Build Test Harness
working-directory: unix
run: |
make tcltest
- name: Run Tests
working-directory: unix
run: |
make test
- name: Test-Drive Installation
working-directory: unix
run: |
make install
- name: Create Distribution Package
working-directory: unix
run: |
make dist
- name: Convert Documentation to HTML
working-directory: unix
run: |
make html-tcl
+37
View File
@@ -0,0 +1,37 @@
name: Linux Build and Test
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Configure
working-directory: unix
run: |
mkdir "${HOME}/install dir"
./configure ${CFGOPT} "--prefix=$HOME/install dir" || (cat config.log && exit 1)
- name: Build
working-directory: unix
run: |
make all
- name: Build Test Harness
working-directory: unix
run: |
make tcltest
- name: Run Tests
working-directory: unix
run: |
make test
- name: Test-Drive Installation
working-directory: unix
run: |
make install
- name: Create Distribution Package
working-directory: unix
run: |
make dist
- name: Convert Documentation to HTML
working-directory: unix
run: |
make html-tcl
+22
View File
@@ -0,0 +1,22 @@
name: Windows Build and Test
on: [push]
jobs:
build:
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Init MSVC
uses: ilammy/msvc-dev-cmd@v1
- name: Build
working-directory: win
run: |
nmake -f makefile.vc all
- name: Build Test Harness
working-directory: win
run: |
nmake -f makefile.vc tcltest
- name: Run Tests
working-directory: win
run: |
nmake -f makefile.vc test
+15
View File
@@ -5,7 +5,22 @@
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name>
<triggers>clean,full,incremental,</triggers>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name>
<triggers>full,incremental,</triggers>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.cdt.core.cnature</nature>
<nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>
<nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
</natures>
</projectDescription>
+44 -34
View File
@@ -1,6 +1,8 @@
language: c
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- binutils-mingw-w64-i686
- binutils-mingw-w64-x86-64
@@ -11,7 +13,7 @@ addons:
- gcc-multilib
jobs:
include:
# Testing on Linux with various compilers
# Testing on Linux GCC
- name: "Linux/GCC/Shared"
os: linux
dist: focal
@@ -61,29 +63,15 @@ jobs:
env:
- BUILD_DIR=unix
- CFGOPT="CC=g++ CFLAGS=-Dregister=dont+use+register"
# Older versions of GCC...
- name: "Linux/GCC 7/Shared"
# Newer/Older versions of GCC
- name: "Linux/GCC 10/Shared"
os: linux
dist: focal
compiler: gcc-7
compiler: gcc-10
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-7
env:
- BUILD_DIR=unix
- name: "Linux/GCC 6/Shared"
os: linux
dist: bionic
compiler: gcc-6
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-6
- g++-10
env:
- BUILD_DIR=unix
- name: "Linux/GCC 5/Shared"
@@ -92,13 +80,11 @@ jobs:
compiler: gcc-5
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-5
env:
- BUILD_DIR=unix
# Clang
# Testing on Linux Clang
- name: "Linux/Clang/Shared"
os: linux
dist: focal
@@ -134,9 +120,9 @@ jobs:
- BUILD_DIR=unix
- CFGOPT="--enable-symbols=mem"
# Testing on Mac, various styles
- name: "macOS/Clang/Xcode 11.7/Shared"
- name: "macOS/Clang/Xcode 12/Shared"
os: osx
osx_image: xcode11.7
osx_image: xcode12.2
env:
- BUILD_DIR=macosx
install: []
@@ -144,14 +130,15 @@ jobs:
- make all
# The styles=develop avoids some weird problems on OSX
- make test styles=develop
- name: "macOS/Clang/Xcode 11.7/Shared/Unix-like"
- name: "macOS/Clang/Xcode 12/Shared/Unix-like"
os: osx
osx_image: xcode11.7
osx_image: xcode12.2
env:
- BUILD_DIR=unix
- name: "macOS/Clang/Xcode 11.7/Shared/libtommath"
- CFGOPT="--enable-dtrace"
- name: "macOS/Clang/Xcode 12/Shared/libtommath"
os: osx
osx_image: xcode11.7
osx_image: xcode12.2
env:
- BUILD_DIR=macosx
install: []
@@ -160,18 +147,26 @@ jobs:
homebrew:
packages:
- libtommath
- name: "macOS/Clang++/Xcode 11.7/Shared"
- name: "macOS/Clang++/Xcode 12/Shared"
os: osx
osx_image: xcode11.7
osx_image: xcode12.2
env:
- BUILD_DIR=unix
- CFGOPT="CC=clang++ --enable-framework CFLAGS=-Dregister=dont+use+register CPPFLAGS=-D__private_extern__=extern"
- CFGOPT="CC=clang++ --enable-framework --enable-dtrace CFLAGS=-Dregister=dont+use+register CPPFLAGS=-D__private_extern__=extern"
script:
- make all tcltest
# Newer MacOS versions
- name: "macOS/Clang/Xcode 12/Universal Apps/Shared"
os: osx
osx_image: xcode12u
env:
- BUILD_DIR=macosx
install: []
script: *mactest
# Older MacOS versions
- name: "macOS/Clang/Xcode 11/Shared"
os: osx
osx_image: xcode11
osx_image: xcode11.7
env:
- BUILD_DIR=macosx
install: []
@@ -185,7 +180,7 @@ jobs:
script: *mactest
- name: "macOS/Clang/Xcode 9/Shared"
os: osx
osx_image: xcode9.2
osx_image: xcode9.4
env:
- BUILD_DIR=macosx
install: []
@@ -229,6 +224,8 @@ jobs:
- BUILD_DIR=win
- VCDIR="/C/Program Files (x86)/Microsoft Visual Studio/2017/BuildTools/VC/Auxiliary/Build"
before_install: &vcpreinst
- rm -rf tests/safe-stock8*.test
- touch generic/tclStubInit.c generic/tclOOStubInit.c generic/tclOOScript.h
- PATH="$PATH:$VCDIR"
- cd ${BUILD_DIR}
install: []
@@ -262,6 +259,15 @@ jobs:
script:
- 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/StaticPackage"
os: windows
compiler: cl
env: *vcenv
before_install: *vcpreinst
install: []
script:
- cmd.exe //C vcvarsall.bat x64 '&&' nmake 'OPTS=static,staticpkg,msvcrt' '-f' makefile.vc all tcltest
- cmd.exe //C vcvarsall.bat x64 '&&' nmake 'OPTS=static,staticpkg,msvcrt' '-f' makefile.vc test
- name: "Windows/MSVC/Debug"
os: windows
compiler: cl
@@ -343,6 +349,8 @@ jobs:
- BUILD_DIR=win
- CFGOPT="--enable-64bit"
before_install: &makepreinst
- rm -rf tests/safe-stock8*.test
- touch generic/tclStubInit.c generic/tclOOStubInit.c generic/tclOOScript.h
- choco install -y make zip
- cd ${BUILD_DIR}
- name: "Windows/GCC/Shared: UTF_MAX=4"
@@ -450,6 +458,8 @@ jobs:
script:
- make dist
before_install:
- rm -rf tests/safe-stock8*.test
- touch generic/tclStubInit.c generic/tclOOStubInit.c generic/tclOOScript.h
- cd ${BUILD_DIR}
install:
- mkdir "$HOME/install dir"
@@ -457,6 +467,6 @@ install:
before_script:
- export ERROR_ON_FAILURES=1
script:
- make all tcltest
- make all tcltest || echo "Something wrong, maybe a hickup, let's try again"
- make test
- make install
+2 -2
View File
@@ -351,7 +351,7 @@
* mac/tclMacFile.c: fixed bug in permission checking code
* mac/tclMacLoad.c: corrected utf8 handling, comparison of package
* mac/tclMacLoad.c: corrected utf-8 handling, comparison of package
names to code fragment names changed to only match on the length of
package name, this allows for fragment names with version numbers
appended.
@@ -3525,7 +3525,7 @@
* generic/tclVar.c (Tcl_UnsetObjCmd): Rewrote argument parser to avoid
a read off the end of the argument array that could occur when
executing something like [unset -nocomplain] was executed. Improved
the error message given when too few arguments are given (-nocomplain
the error message given when not enough arguments are given (-nocomplain
should obviously be *before* --, not after it) and also modified the
test suite to take account of that and the documentation to use the
same improvement. [Bug 405769]
+1 -1
View File
@@ -1753,7 +1753,7 @@
2002-07-05 Reinhard Max <max@suse.de>
* generic/tclClock.c (FormatClock): Convert the format string to UTF8
* generic/tclClock.c (FormatClock): Convert the format string to utf-8
before calling TclpStrftime, so that non-ASCII characters don't get
mangled when the result string is being converted back.
* tests/clock.test: Added a test for that.
+2 -2
View File
@@ -2302,7 +2302,7 @@
934511].
* doc/CrtCommand.3: Added note that the arguments given to the command
proc of a Tcl_CreateCommand are in utf8 since Tcl 8.1. Closing [Patch
proc of a Tcl_CreateCommand are in utf-8 since Tcl 8.1. Closing [Patch
414778].
* doc/ChnlStack.3: Removed the declaration that the interp argument to
@@ -2873,7 +2873,7 @@
2004-06-02 Jeff Hobbs <jeffh@ActiveState.com>
* win/tclWinFile.c (TclpFindExecutable): when using GetModuleFileNameA
(Win9x), convert from CP_ACP to WCHAR then convert back to utf8.
(Win9x), convert from CP_ACP to WCHAR then convert back to utf-8.
Adjunct to 2004-04-07 fix.
2004-06-02 David Gravereaux <davygrvy@pobox.com>
+11 -1
View File
@@ -5,7 +5,17 @@ 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/).
[![Build Status](https://travis-ci.org/tcltk/tcl.svg?branch=core-8-branch)](https://travis-ci.org/tcltk/tcl)
8.6.10
[![Build Status](https://github.com/tcltk/tcl/workflows/Linux%20Build%20and%20Test/badge.svg?branch=core-8-6-branch)](https://github.com/tcltk/tcl/actions?query=workflow%3A%22Linux+Build+and+Test%22+branch%3Acore-8-6-branch)
[![Build Status](https://github.com/tcltk/tcl/workflows/Windows%20Build%20and%20Test/badge.svg?branch=core-8-6-branch)](https://github.com/tcltk/tcl/actions?query=workflow%3A%22Windows+Build+and+Test%22+branch%3Acore-8-6-branch)
<br>
8.7a4
[![Build Status](https://github.com/tcltk/tcl/workflows/Linux%20Build%20and%20Test/badge.svg?branch=core-8-branch)](https://github.com/tcltk/tcl/actions?query=workflow%3A%22Linux+Build+and+Test%22+branch%3Acore-8-branch)
[![Build Status](https://github.com/tcltk/tcl/workflows/Windows%20Build%20and%20Test/badge.svg?branch=core-8-branch)](https://github.com/tcltk/tcl/actions?query=workflow%3A%22Windows+Build+and+Test%22+branch%3Acore-8-branch)
<br>
9.0a2
[![Build Status](https://github.com/tcltk/tcl/workflows/Linux%20Build%20and%20Test/badge.svg?branch=main)](https://github.com/tcltk/tcl/actions?query=workflow%3A%22Linux+Build+and+Test%22+branch%3Amain)
[![Build Status](https://github.com/tcltk/tcl/workflows/Windows%20Build%20and%20Test/badge.svg?branch=main)](https://github.com/tcltk/tcl/actions?query=workflow%3A%22Windows+Build+and+Test%22+branch%3Amain)
## Contents
1. [Introduction](#intro)
+2 -6
View File
@@ -21,19 +21,15 @@
#include <sys/types.h>
#ifdef __APPLE__
extern void * memchr(const void *s, int c, size_t n);
#else
extern char * memchr(const void *s, int c, size_t n);
#endif
extern int memcmp(const void *s1, const void *s2, size_t n);
extern char * memcpy(void *t, const void *f, size_t n);
extern void * memcpy(void *t, const void *f, size_t n);
#ifdef NO_MEMMOVE
#define memmove(d,s,n) (bcopy((s), (d), (n)))
#else
extern char * memmove(void *t, const void *f, size_t n);
#endif
extern char * memset(void *s, int c, size_t n);
extern void * memset(void *s, int c, size_t n);
extern int strcasecmp(const char *s1, const char *s2);
extern char * strcat(char *dst, const char *src);
+4 -4
View File
@@ -414,7 +414,7 @@ caller (with a reference count of 0).
the encoding identified by \fIencodingName\fR and evaluates
its contents as a Tcl script. It returns the same information as
\fBTcl_EvalObjEx\fR.
If \fIencodingName\fR is NULL, the system encoding is used for
If \fIencodingName\fR is NULL, the utf-8 encoding is used for
reading the file contents.
If the file could not be read then a Tcl error is returned to describe
why the file could not be read.
@@ -430,7 +430,7 @@ or
which will be safely substituted by the Tcl interpreter into
.QW ^Z .
\fBTcl_FSEvalFile\fR is a simpler version of
\fBTcl_FSEvalFileEx\fR that always uses the system encoding
\fBTcl_FSEvalFileEx\fR that always uses the utf-8 encoding
when reading the file.
.PP
\fBTcl_FSLoadFile\fR dynamically loads a binary code file into memory and
@@ -1340,11 +1340,11 @@ is considered to be owned by the filesystem (not by Tcl's core), but
should be given a reference count for Tcl. Tcl will use the contents of the
list and then decrement that reference count. This allows filesystems to
choose whether they actually want to retain a
.QW "main list"
.QW "global list"
of volumes
or not (if not, they generate the list on the fly and pass it to Tcl
with a reference count of 1 and then forget about the list, if yes, then
they simply increment the reference count of their main list and pass it
they simply increment the reference count of their global list and pass it
to Tcl which will copy the contents and then decrement the count back
to where it was).
.PP
+1 -1
View File
@@ -116,7 +116,7 @@ execution of the callbacks is unspecified) execution in the limited
interpreter is stopped by raising an error and setting a flag that
prevents the \fBcatch\fR command in that interpreter from trapping
that error. It is up to the context that started execution in that
interpreter (typically a parent interpreter) to handle the error.
interpreter (typically the main interpreter) to handle the error.
.SH "LIMIT CHECKING API"
.PP
To check the resource limits for an interpreter, call
+6 -6
View File
@@ -79,7 +79,7 @@ against the standard Tcl library. Extensions (stub-enabled or
not) are not intended to call \fBTcl_Main\fR.
.PP
\fBTcl_Main\fR is not thread-safe. It should only be called by
a single thread of a multi-threaded application. This
a single main thread of a multi-threaded application. This
restriction is not a problem with normal use described above.
.PP
\fBTcl_Main\fR and therefore all applications based upon it, like
@@ -112,7 +112,7 @@ The file name and encoding values managed by the routines
\fBTcl_SetStartupScript\fR and \fBTcl_GetStartupScript\fR
are stored per-thread. Although the storage and retrieval
functions of these routines work in any thread, only those
calls in the same thread as \fBTcl_Main\fR can have
calls in the same main thread as \fBTcl_Main\fR can have
any influence on it.
.PP
The caller of \fBTcl_Main\fR may call \fBTcl_SetStartupScript\fR
@@ -126,7 +126,7 @@ a \fIstartup script\fR, and \fIname\fR is taken to be the name
of the encoding of the contents of that file. \fBTcl_Main\fR
then calls \fBTcl_SetStartupScript\fR with these values.
.PP
\fBTcl_Main\fR then defines in its interpreter
\fBTcl_Main\fR then defines in its main interpreter
the Tcl variables \fIargc\fR, \fIargv\fR, \fIargv0\fR, and
\fItcl_interactive\fR, as described in the documentation for \fBtclsh\fR.
.PP
@@ -154,9 +154,9 @@ When the \fIappInitProc\fR is finished, \fBTcl_Main\fR calls
been requested, if any. If a startup script has been provided,
\fBTcl_Main\fR attempts to evaluate it. Otherwise, interactive
mode begins with examination of the variable \fItcl_rcFileName\fR
in the interpreter. If that variable exists and holds the
in the main interpreter. If that variable exists and holds the
name of a readable file, the contents of that file are evaluated
in the interpreter. Then interactive operations begin,
in the main interpreter. Then interactive operations begin,
with prompts and command evaluation results written to the standard
output channel, and commands read from the standard input channel
and then evaluated. The prompts written to the standard output
@@ -164,7 +164,7 @@ channel may be customized by defining the Tcl variables \fItcl_prompt1\fR
and \fItcl_prompt2\fR as described in the documentation for \fBtclsh\fR.
The prompts and command evaluation results are written to the standard
output channel only if the Tcl variable \fItcl_interactive\fR in the
interpreter holds a non-zero integer value.
main interpreter holds a non-zero integer value.
.PP
\fBTcl_SetMainLoop\fR allows setting an event loop procedure to be run.
This allows, for example, Tk to be dynamically loaded and set its event
+1 -1
View File
@@ -772,7 +772,7 @@ set offset 0
\fI# Search for string "FOOBAR" in the file\fR
while {[\fBchan gets\fR $f line] >= 0} {
set idx [string first FOOBAR $line]
if {$idx > -1} {
if {$idx >= 0} {
\fI# Found it; rewrite line\fR
\fBchan seek\fR $f [expr {$offset + $idx}]
+13 -4
View File
@@ -41,6 +41,12 @@ When an expression evaluates to an integer, the value is the decimal form of
the integer, and when an expression evaluates to a floating-point number, the
value is the form produced by the \fB%g\fR format specifier of Tcl's
\fBformat\fR command.
.PP
.VS "TIP 582"
You can use \fB#\fR at any point in the expression (except inside double
quotes or braces) to start a comment. Comments last to the end of the line or
the end of the expression, whichever comes first.
.VE "TIP 582"
.SS OPERANDS
.PP
An expression consists of a combination of operands, operators, parentheses and
@@ -82,9 +88,9 @@ produces the value on the right side.
.PP
.CS
.ta 9c
\fBexpr\fR 3.1 + $a \fI6.1\fR
\fBexpr\fR 2 + "$a.$b" \fI5.6\fR
\fBexpr\fR 4*[llength "6 2"] \fI8\fR
\fBexpr\fR {3.1 + $a} \fI6.1\fR
\fBexpr\fR {2 + "$a.$b"} \fI5.6\fR
\fBexpr\fR {4*[llength "6 2"]} \fI8\fR
\fBexpr\fR {{word one} < "word $a"} \fI0\fR
.CE
.PP
@@ -270,7 +276,7 @@ which means that operands are not evaluated if they are
not needed to determine the outcome. For example, in
.PP
.CS
\fBexpr\fR {$v ? [a] : [b]}
\fBexpr\fR {$v?[a]:[b]}
.CE
.PP
only one of \fB[a]\fR or \fB[b]\fR is evaluated,
@@ -487,7 +493,9 @@ value of true:
.PP
.CS
set isTrue [\fBexpr\fR {
# Does the environment variable exist, and...
[info exists ::env(SOME_ENV_VAR)] &&
# ...does it contain a proper true value?
[string is true -strict $::env(SOME_ENV_VAR)]
}]
.CE
@@ -510,4 +518,5 @@ Copyright \(co 2005 by Kevin B. Kenny <kennykb@acm.org>. All rights reserved.
.fi
'\" Local Variables:
'\" mode: nroff
'\" fill-column: 78
'\" End:
+5 -5
View File
@@ -58,7 +58,7 @@ kernel call) between a child interpreter and its parent.
See \fBALIAS INVOCATION\fR, below, for more details
on how the alias mechanism works.
.PP
A qualified interpreter name is a proper Tcl lists containing a subset of its
A qualified interpreter name is a proper Tcl list containing a subset of its
ancestors in the interpreter hierarchy, terminated by the string naming the
interpreter in its immediate parent. Interpreter names are relative to the
interpreter in which they are used. For example, if
@@ -663,9 +663,9 @@ including itself.
.SH "ALIAS INVOCATION"
.PP
The alias mechanism has been carefully designed so that it can
be used safely when an untrusted script is executing
in a safe child and the target of the alias is a trusted
parent. The most important thing in guaranteeing safety is to
be used safely in an untrusted script which is being executed in a
safe interpreter even if the target of the alias is not a safe
interpreter. The most important thing in guaranteeing safety is to
ensure that information passed from the child to the parent is
never evaluated or substituted in the parent; if this were to
occur, it would enable an evil script in the child to invoke
@@ -747,7 +747,7 @@ To help avoid this problem, no substitutions or evaluations are
applied to arguments of \fBinterp invokehidden\fR.
.PP
Safe interpreters are not allowed to invoke hidden commands in themselves
or in their descendants. This prevents safe children from gaining access to
or in their descendants. This prevents them from gaining access to
hidden functionality in themselves or their descendants.
.PP
The set of hidden commands in an interpreter can be manipulated by a trusted
+1 -1
View File
@@ -47,7 +47,7 @@ A leading BOM (Byte order mark) contained in the file is ignored for unicode enc
.PP
The \fB\-encoding\fR option is used to specify the encoding of
the data stored in \fIfileName\fR. When the \fB\-encoding\fR option
is omitted, the system encoding is assumed.
is omitted, the utf-8 encoding is assumed.
.SH EXAMPLE
.PP
Run the script in the file \fBfoo.tcl\fR and then the script in the
+3 -3
View File
@@ -1145,7 +1145,7 @@ Here is a sketch of a sample test file illustrating those points:
.RS
.PP
.CS
package require tcltest 2.2
package require tcltest 2.5
eval \fB::tcltest::configure\fR $argv
package require example
namespace eval ::example::test {
@@ -1179,8 +1179,8 @@ Here is a sketch of a sample test suite main script:
.RS
.PP
.CS
package require Tcl 8.4
package require tcltest 2.2
package require Tcl 8.6
package require tcltest 2.5
package require example
\fB::tcltest::configure\fR -testdir \e
[file dirname [file normalize [info script]]]
+16 -16
View File
@@ -56,7 +56,7 @@ static const chr *scanplain(struct vars *);
static void onechr(struct vars *, pchr, struct state *, struct state *);
static void dovec(struct vars *, struct cvec *, struct state *, struct state *);
static void wordchrs(struct vars *);
static struct subre *subre(struct vars *, int, int, struct state *, struct state *);
static struct subre *sub_re(struct vars *, int, int, struct state *, struct state *);
static void freesubre(struct vars *, struct subre *);
static void freesrnode(struct vars *, struct subre *);
static int numst(struct subre *, int);
@@ -663,7 +663,7 @@ parse(
assert(stopper == ')' || stopper == EOS);
branches = subre(v, '|', LONGER, init, final);
branches = sub_re(v, '|', LONGER, init, final);
NOERRN();
branch = branches;
firstbranch = 1;
@@ -673,7 +673,7 @@ parse(
* Need a place to hang the branch.
*/
branch->right = subre(v, '|', LONGER, init, final);
branch->right = sub_re(v, '|', LONGER, init, final);
NOERRN();
branch = branch->right;
}
@@ -744,7 +744,7 @@ parsebranch(
lp = left;
seencontent = 0;
t = subre(v, '=', 0, left, right); /* op '=' is tentative */
t = sub_re(v, '=', 0, left, right); /* op '=' is tentative */
NOERRN();
while (!SEE('|') && !SEE(stopper) && !SEE(EOS)) {
if (seencontent) { /* implicit concat operator */
@@ -977,7 +977,7 @@ parseqatom(
NOERR();
if (cap) {
v->subs[subno] = atom;
t = subre(v, '(', atom->flags|CAP, lp, rp);
t = sub_re(v, '(', atom->flags|CAP, lp, rp);
NOERR();
t->subno = subno;
t->left = atom;
@@ -995,7 +995,7 @@ parseqatom(
INSIST(v->subs[v->nextvalue] != NULL, REG_ESUBREG);
NOERR();
assert(v->nextvalue > 0);
atom = subre(v, 'b', BACKR, lp, rp);
atom = sub_re(v, 'b', BACKR, lp, rp);
NOERR();
subno = v->nextvalue;
atom->subno = subno;
@@ -1110,7 +1110,7 @@ parseqatom(
*/
if (atom == NULL) {
atom = subre(v, '=', 0, lp, rp);
atom = sub_re(v, '=', 0, lp, rp);
NOERR();
}
@@ -1147,7 +1147,7 @@ parseqatom(
* Break remaining subRE into x{...} and what follows.
*/
t = subre(v, '.', COMBINE(qprefer, atom->flags), lp, rp);
t = sub_re(v, '.', COMBINE(qprefer, atom->flags), lp, rp);
NOERR();
t->left = atom;
atomp = &t->left;
@@ -1161,7 +1161,7 @@ parseqatom(
*/
assert(top->op == '=' && top->left == NULL && top->right == NULL);
top->left = subre(v, '=', top->flags, top->begin, lp);
top->left = sub_re(v, '=', top->flags, top->begin, lp);
NOERR();
top->op = '.';
top->right = t;
@@ -1230,9 +1230,9 @@ parseqatom(
assert(m >= 1 && m != DUPINF && n >= 1);
repeat(v, s, atom->begin, m-1, (n == DUPINF) ? n : n-1);
f = COMBINE(qprefer, atom->flags);
t = subre(v, '.', f, s, atom->end); /* prefix and atom */
t = sub_re(v, '.', f, s, atom->end); /* prefix and atom */
NOERR();
t->left = subre(v, '=', PREF(f), s, atom->begin);
t->left = sub_re(v, '=', PREF(f), s, atom->begin);
NOERR();
t->right = atom;
*atomp = t;
@@ -1247,7 +1247,7 @@ parseqatom(
dupnfa(v->nfa, atom->begin, atom->end, s, s2);
repeat(v, s, s2, m, n);
f = COMBINE(qprefer, atom->flags);
t = subre(v, '*', f, s, s2);
t = sub_re(v, '*', f, s, s2);
NOERR();
t->min = (short) m;
t->max = (short) n;
@@ -1265,7 +1265,7 @@ parseqatom(
t->right = parsebranch(v, stopper, type, s2, rp, 1);
} else {
EMPTYARC(s2, rp);
t->right = subre(v, '=', 0, s2, rp);
t->right = sub_re(v, '=', 0, s2, rp);
}
NOERR();
assert(SEE('|') || SEE(stopper) || SEE(EOS));
@@ -1717,12 +1717,12 @@ wordchrs(
}
/*
- subre - allocate a subre
^ static struct subre *subre(struct vars *, int, int, struct state *,
- sub_re - allocate a subre
^ static struct subre *sub_re(struct vars *, int, int, struct state *,
^ struct state *);
*/
static struct subre *
subre(
sub_re(
struct vars *v,
int op,
int flags,
+2 -2
View File
@@ -361,7 +361,7 @@ typedef long LONG;
*/
#if !defined(TCL_WIDE_INT_TYPE)&&!defined(TCL_WIDE_INT_IS_LONG)
# if defined(_MSC_VER) || defined(_WIN32)
# if defined(_WIN32) && (!defined(__USE_MINGW_ANSI_STDIO) || !__USE_MINGW_ANSI_STDIO)
# define TCL_WIDE_INT_TYPE __int64
# define TCL_LL_MODIFIER "I64"
# if defined(_WIN64)
@@ -2479,7 +2479,7 @@ EXTERN int TclZipfs_AppHook(int *argc, char ***argv);
# define Tcl_DecrRefCount(objPtr) \
do { \
Tcl_Obj *_objPtr = (objPtr); \
if ((_objPtr)->refCount-- <= 1) { \
if (_objPtr->refCount-- <= 1) { \
TclFreeObj(_objPtr); \
} \
} while(0)
+1 -1
View File
@@ -24,7 +24,7 @@
#include "tclInt.h"
#if !TCL_THREADS || !defined(USE_THREAD_ALLOC)
#if USE_TCLALLOC
#if defined(USE_TCLALLOC) && USE_TCLALLOC
/*
* We should really make use of AC_CHECK_TYPE(caddr_t) here, but it can wait
+9 -8
View File
@@ -131,7 +131,7 @@ enum BasicBlockFlags {
* Source instruction type recognized by the assembler.
*/
typedef enum TalInstType {
typedef enum {
ASSEM_1BYTE, /* Fixed arity, 1-byte instruction */
ASSEM_BEGIN_CATCH, /* Begin catch: one 4-byte jump offset to be
* converted to appropriate exception
@@ -145,8 +145,6 @@ typedef enum TalInstType {
* 1 */
ASSEM_DICT_GET, /* 'dict get' and related - consumes N+1
* operands, produces 1, N > 0 */
ASSEM_DICT_GET_DEF, /* 'dict getwithdefault' - consumes N+2
* operands, produces 1, N > 0 */
ASSEM_DICT_SET, /* specifies key count and LVT index, consumes
* N+1 operands, produces 1, N > 0 */
ASSEM_DICT_UNSET, /* specifies key count and LVT index, consumes
@@ -189,8 +187,10 @@ typedef enum TalInstType {
* produces N */
ASSEM_SINT1, /* One 1-byte signed-integer operand
* (INCR_STK_IMM) */
ASSEM_SINT4_LVT4 /* Signed 4-byte integer operand followed by
ASSEM_SINT4_LVT4, /* Signed 4-byte integer operand followed by
* LVT entry. Fixed arity */
ASSEM_DICT_GET_DEF /* 'dict getwithdefault' - consumes N+2
* operands, produces 1, N > 0 */
} TalInstType;
/*
@@ -815,7 +815,7 @@ TclNRAssembleObjCmd(
Tcl_AddErrorInfo(interp, "\n (\"");
Tcl_AppendObjToErrorInfo(interp, objv[0]);
Tcl_AddErrorInfo(interp, "\" body, line ");
backtrace = Tcl_NewWideIntObj(Tcl_GetErrorLine(interp));
TclNewIntObj(backtrace, Tcl_GetErrorLine(interp));
Tcl_AppendObjToErrorInfo(interp, backtrace);
Tcl_AddErrorInfo(interp, ")");
return TCL_ERROR;
@@ -1266,7 +1266,7 @@ AssembleOneLine(
Tcl_Obj* instNameObj; /* Name of the instruction */
int tblIdx; /* Index in TalInstructionTable of the
* instruction */
enum TalInstType instType; /* Type of the instruction */
TalInstType instType; /* Type of the instruction */
Tcl_Obj* operand1Obj = NULL;
/* First operand to the instruction */
const char* operand1; /* String rep of the operand */
@@ -2098,8 +2098,9 @@ GetNextOperand(
* with \-substitutions done. */
{
Tcl_Interp* interp = (Tcl_Interp*) assemEnvPtr->envPtr->iPtr;
Tcl_Obj* operandObj = Tcl_NewObj();
Tcl_Obj* operandObj;
TclNewObj(operandObj);
if (!TclWordKnownAtCompileTime(*tokenPtrPtr, operandObj)) {
Tcl_DecrRefCount(operandObj);
if (assemEnvPtr->flags & TCL_EVAL_DIRECT) {
@@ -4269,7 +4270,7 @@ AddBasicBlockRangeToErrorInfo(
Tcl_Obj* lineNo; /* Line number in the source */
Tcl_AddErrorInfo(interp, "\n in assembly code between lines ");
lineNo = Tcl_NewWideIntObj(bbPtr->startLine);
TclNewIntObj(lineNo, bbPtr->startLine);
Tcl_IncrRefCount(lineNo);
Tcl_AppendObjToErrorInfo(interp, lineNo);
Tcl_AddErrorInfo(interp, " and ");
+9 -10
View File
@@ -708,7 +708,7 @@ Tcl_CreateInterp(void)
#endif
iPtr->freeProc = NULL;
iPtr->errorLine = 0;
iPtr->objResultPtr = Tcl_NewObj();
TclNewObj(iPtr->objResultPtr);
Tcl_IncrRefCount(iPtr->objResultPtr);
iPtr->handle = TclHandleCreate(iPtr);
iPtr->globalNsPtr = NULL;
@@ -796,8 +796,7 @@ Tcl_CreateInterp(void)
iPtr->activeInterpTracePtr = NULL;
iPtr->assocData = NULL;
iPtr->execEnvPtr = NULL; /* Set after namespaces initialized. */
iPtr->emptyObjPtr = Tcl_NewObj();
/* Another empty object. */
TclNewObj(iPtr->emptyObjPtr); /* Another empty object. */
Tcl_IncrRefCount(iPtr->emptyObjPtr);
#ifndef TCL_NO_DEPRECATED
iPtr->resultSpace[0] = 0;
@@ -863,7 +862,7 @@ Tcl_CreateInterp(void)
* TIP #285, Script cancellation support.
*/
iPtr->asyncCancelMsg = Tcl_NewObj();
TclNewObj(iPtr->asyncCancelMsg);
cancelInfo = (CancelInfo *)ckalloc(sizeof(CancelInfo));
cancelInfo->interp = interp;
@@ -2990,7 +2989,7 @@ TclRenameCommand(
}
cmdNsPtr = cmdPtr->nsPtr;
oldFullName = Tcl_NewObj();
TclNewObj(oldFullName);
Tcl_IncrRefCount(oldFullName);
Tcl_GetCommandFullName(interp, cmd, oldFullName);
@@ -4043,7 +4042,7 @@ OldMathFuncProc(
if (funcResult.type == TCL_INT) {
TclNewIntObj(valuePtr, funcResult.intValue);
} else if (funcResult.type == TCL_WIDE_INT) {
valuePtr = Tcl_NewWideIntObj(funcResult.wideValue);
TclNewIntObj(valuePtr, funcResult.wideValue);
} else {
return CheckDoubleResult(interp, funcResult.doubleValue);
}
@@ -4202,7 +4201,7 @@ Tcl_ListMathFuncs(
if (TCL_OK == Tcl_EvalObjEx(interp, script, 0)) {
result = Tcl_DuplicateObj(Tcl_GetObjResult(interp));
} else {
result = Tcl_NewObj();
TclNewObj(result);
}
Tcl_DecrRefCount(script);
Tcl_RestoreInterpState(interp, state);
@@ -8791,8 +8790,8 @@ MathFuncWrongNumArgs(
}
}
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"too %s arguments for math function \"%s\"",
(found < expected ? "few" : "many"), name));
"%s arguments for math function \"%s\"",
(found < expected ? "not enough" : "too many"), name));
Tcl_SetErrorCode(interp, "TCL", "WRONGARGS", NULL);
}
@@ -9961,7 +9960,7 @@ InjectHandler(
* I don't think this is reachable...
*/
Tcl_ListObjAppendElement(NULL, listPtr, Tcl_NewIntObj(nargs));
Tcl_ListObjAppendElement(NULL, listPtr, Tcl_NewWideIntObj(nargs));
}
Tcl_ListObjAppendElement(NULL, listPtr, Tcl_GetObjResult(interp));
}
+9 -8
View File
@@ -274,7 +274,7 @@ typedef struct ByteArray {
* array. */
unsigned int allocated; /* The amount of space actually allocated
* minus 1 byte. */
unsigned char bytes[1]; /* The array of bytes. The actual size of this
unsigned char bytes[TCLFLEXARRAY]; /* The array of bytes. The actual size of this
* field depends on the 'allocated' field
* above. */
} ByteArray;
@@ -1163,7 +1163,7 @@ BinaryFormatCmd(
* bytes and filling with nulls.
*/
resultPtr = Tcl_NewObj();
TclNewObj(resultPtr);
buffer = Tcl_SetByteArrayLength(resultPtr, length);
memset(buffer, 0, length);
@@ -1595,7 +1595,7 @@ BinaryScanCmd(
}
}
src = buffer + offset;
valuePtr = Tcl_NewObj();
TclNewObj(valuePtr);
Tcl_SetObjLength(valuePtr, count);
dest = TclGetString(valuePtr);
@@ -1650,7 +1650,7 @@ BinaryScanCmd(
}
}
src = buffer + offset;
valuePtr = Tcl_NewObj();
TclNewObj(valuePtr);
Tcl_SetObjLength(valuePtr, count);
dest = TclGetString(valuePtr);
@@ -1734,7 +1734,7 @@ BinaryScanCmd(
if ((length - offset) < (count * size)) {
goto done;
}
valuePtr = Tcl_NewObj();
TclNewObj(valuePtr);
src = buffer + offset;
for (i = 0; i < count; i++) {
elementPtr = ScanNumber(src, cmd, flags, &numberCachePtr);
@@ -2376,8 +2376,9 @@ ScanNumber(
return (Tcl_Obj *)Tcl_GetHashValue(hPtr);
}
if (tablePtr->numEntries <= BINARY_SCAN_MAX_CACHE) {
Tcl_Obj *objPtr = Tcl_NewWideIntObj(value);
Tcl_Obj *objPtr;
TclNewIntObj(objPtr, value);
Tcl_IncrRefCount(objPtr);
Tcl_SetHashValue(hPtr, objPtr);
return objPtr;
@@ -2761,7 +2762,7 @@ BinaryEncode64(
maxlen = 0;
}
resultObj = Tcl_NewObj();
TclNewObj(resultObj);
data = Tcl_GetByteArrayFromObj(objv[objc - 1], &count);
if (count > 0) {
unsigned char *cursor = NULL;
@@ -2913,7 +2914,7 @@ BinaryEncodeUu(
* enough".
*/
resultObj = Tcl_NewObj();
TclNewObj(resultObj);
offset = 0;
data = Tcl_GetByteArrayFromObj(objv[objc - 1], &count);
rawLength = (lineLength - 1) * 3 / 4;
+1 -1
View File
@@ -1288,7 +1288,7 @@ TclFinalizeMemorySubsystem(void)
Tcl_MutexUnlock(ckallocMutexPtr);
#endif
#if USE_TCLALLOC
#if defined(USE_TCLALLOC) && USE_TCLALLOC
TclFinalizeAllocSubsystem();
#endif
}
+2 -2
View File
@@ -59,7 +59,7 @@ static int GetStatBuf(Tcl_Interp *interp, Tcl_Obj *pathPtr,
static const char * GetTypeFromMode(int mode);
static int StoreStatData(Tcl_Interp *interp, Tcl_Obj *varName,
Tcl_StatBuf *statPtr);
static inline int EachloopCmd(Tcl_Interp *interp, int collect,
static int EachloopCmd(Tcl_Interp *interp, int collect,
int objc, Tcl_Obj *const objv[]);
static Tcl_NRPostProc CatchObjCmdCallback;
static Tcl_NRPostProc ExprCallback;
@@ -2599,7 +2599,7 @@ TclNRLmapCmd(
return EachloopCmd(interp, TCL_EACH_COLLECT, objc, objv);
}
static inline int
static int
EachloopCmd(
Tcl_Interp *interp, /* Our context for variables and script
* evaluation. */
+28 -22
View File
@@ -383,7 +383,7 @@ Tcl_IncrObjCmd(
if (objc == 3) {
incrPtr = objv[2];
} else {
incrPtr = Tcl_NewWideIntObj(1);
TclNewIntObj(incrPtr, 1);
}
Tcl_IncrRefCount(incrPtr);
newValuePtr = TclIncrObjVar2(interp, objv[1], NULL,
@@ -691,7 +691,7 @@ InfoCommandsCmd(
if (entryPtr != NULL) {
if (specificNsInPattern) {
cmd = (Tcl_Command)Tcl_GetHashValue(entryPtr);
elemObjPtr = Tcl_NewObj();
TclNewObj(elemObjPtr);
Tcl_GetCommandFullName(interp, cmd, elemObjPtr);
} else {
cmdName = (const char *)Tcl_GetHashKey(&nsPtr->cmdTable, entryPtr);
@@ -742,7 +742,7 @@ InfoCommandsCmd(
|| Tcl_StringMatch(cmdName, simplePattern)) {
if (specificNsInPattern) {
cmd = (Tcl_Command)Tcl_GetHashValue(entryPtr);
elemObjPtr = Tcl_NewObj();
TclNewObj(elemObjPtr);
Tcl_GetCommandFullName(interp, cmd, elemObjPtr);
} else {
elemObjPtr = Tcl_NewStringObj(cmdName, -1);
@@ -969,8 +969,9 @@ InfoDefaultCmd(
}
Tcl_SetObjResult(interp, Tcl_NewWideIntObj(1));
} else {
Tcl_Obj *nullObjPtr = Tcl_NewObj();
Tcl_Obj *nullObjPtr;
TclNewObj(nullObjPtr);
valueObjPtr = Tcl_ObjSetVar2(interp, objv[3], NULL,
nullObjPtr, TCL_LEAVE_ERR_MSG);
if (valueObjPtr == NULL) {
@@ -1885,7 +1886,7 @@ InfoProcsCmd(
} else {
simpleProcOK:
if (specificNsInPattern) {
elemObjPtr = Tcl_NewObj();
TclNewObj(elemObjPtr);
Tcl_GetCommandFullName(interp, (Tcl_Command) cmdPtr,
elemObjPtr);
} else {
@@ -1906,15 +1907,15 @@ InfoProcsCmd(
if (!TclIsProc(cmdPtr)) {
realCmdPtr = (Command *)
TclGetOriginalCommand((Tcl_Command) cmdPtr);
TclGetOriginalCommand((Tcl_Command)cmdPtr);
if (realCmdPtr != NULL && TclIsProc(realCmdPtr)) {
goto procOK;
}
} else {
procOK:
if (specificNsInPattern) {
elemObjPtr = Tcl_NewObj();
Tcl_GetCommandFullName(interp, (Tcl_Command) cmdPtr,
TclNewObj(elemObjPtr);
Tcl_GetCommandFullName(interp, (Tcl_Command)cmdPtr,
elemObjPtr);
} else {
elemObjPtr = Tcl_NewStringObj(cmdName, -1);
@@ -2142,7 +2143,7 @@ InfoCmdTypeCmd(
}
/*
* There's one special case: safe child interpreters can't see aliases as
* There's one special case: safe interpreters can't see aliases as
* aliases as they're part of the security mechanisms.
*/
@@ -2217,7 +2218,7 @@ Tcl_JoinObjCmd(
} else {
int i;
resObjPtr = Tcl_NewObj();
TclNewObj(resObjPtr);
for (i = 0; i < listLen; i++) {
if (i > 0) {
@@ -3156,7 +3157,7 @@ Tcl_LsearchObjCmd(
"-real", "-regexp", "-sorted", "-start", "-stride",
"-subindices", NULL
};
enum options {
enum lsearchoptions {
LSEARCH_ALL, LSEARCH_ASCII, LSEARCH_BISECT, LSEARCH_DECREASING,
LSEARCH_DICTIONARY, LSEARCH_EXACT, LSEARCH_GLOB, LSEARCH_INCREASING,
LSEARCH_INDEX, LSEARCH_INLINE, LSEARCH_INTEGER, LSEARCH_NOCASE,
@@ -3204,7 +3205,7 @@ Tcl_LsearchObjCmd(
result = TCL_ERROR;
goto done;
}
switch ((enum options) index) {
switch ((enum lsearchoptions) index) {
case LSEARCH_ALL: /* -all */
allMatches = 1;
break;
@@ -3513,7 +3514,8 @@ Tcl_LsearchObjCmd(
if (allMatches || inlineReturn) {
Tcl_ResetResult(interp);
} else {
Tcl_SetObjResult(interp, Tcl_NewWideIntObj(-1));
TclNewIntObj(itemPtr, TCL_INDEX_NONE);
Tcl_SetObjResult(interp, itemPtr);
}
goto done;
}
@@ -3802,10 +3804,11 @@ Tcl_LsearchObjCmd(
} else if (returnSubindices) {
int j;
itemPtr = Tcl_NewWideIntObj(i+groupOffset);
TclNewIntObj(itemPtr, i+groupOffset);
for (j=0 ; j<sortInfo.indexc ; j++) {
Tcl_ListObjAppendElement(interp, itemPtr, Tcl_NewWideIntObj(
TclIndexDecode(sortInfo.indexv[j], listc)));
Tcl_Obj *elObj;
TclNewIntObj(elObj, TclIndexDecode(sortInfo.indexv[j], listc));
Tcl_ListObjAppendElement(interp, itemPtr, elObj);
}
Tcl_ListObjAppendElement(interp, listPtr, itemPtr);
} else {
@@ -3824,14 +3827,17 @@ Tcl_LsearchObjCmd(
if (returnSubindices) {
int j;
itemPtr = Tcl_NewWideIntObj(index+groupOffset);
TclNewIntObj(itemPtr, index+groupOffset);
for (j=0 ; j<sortInfo.indexc ; j++) {
Tcl_ListObjAppendElement(interp, itemPtr, Tcl_NewWideIntObj(
TclIndexDecode(sortInfo.indexv[j], listc)));
Tcl_Obj *elObj;
TclNewIntObj(elObj, TclIndexDecode(sortInfo.indexv[j], listc));
Tcl_ListObjAppendElement(interp, itemPtr, elObj);
}
Tcl_SetObjResult(interp, itemPtr);
} else {
Tcl_SetObjResult(interp, Tcl_NewWideIntObj(index));
Tcl_Obj *elObj;
TclNewIntObj(elObj, index);
Tcl_SetObjResult(interp, elObj);
}
} else if (index < 0) {
/*
@@ -4414,7 +4420,7 @@ Tcl_LsortObjCmd(
idx = elementPtr->payload.index;
for (j = 0; j < groupSize; j++) {
if (indices) {
objPtr = Tcl_NewWideIntObj(idx + j - groupOffset);
TclNewIntObj(objPtr, idx + j - groupOffset);
newArray[i++] = objPtr;
Tcl_IncrRefCount(objPtr);
} else {
@@ -4426,7 +4432,7 @@ Tcl_LsortObjCmd(
}
} else if (indices) {
for (i=0; elementPtr != NULL ; elementPtr = elementPtr->nextPtr) {
objPtr = Tcl_NewWideIntObj(elementPtr->payload.index);
TclNewIntObj(objPtr, elementPtr->payload.index);
newArray[i++] = objPtr;
Tcl_IncrRefCount(objPtr);
}
+42 -33
View File
@@ -137,7 +137,7 @@ Tcl_RegexpObjCmd(
"-expanded", "-line", "-linestop", "-lineanchor",
"-nocase", "-start", "--", NULL
};
enum options {
enum regexpoptions {
REGEXP_ALL, REGEXP_ABOUT, REGEXP_INDICES, REGEXP_INLINE,
REGEXP_EXPANDED,REGEXP_LINE, REGEXP_LINESTOP,REGEXP_LINEANCHOR,
REGEXP_NOCASE, REGEXP_START, REGEXP_LAST
@@ -162,7 +162,7 @@ Tcl_RegexpObjCmd(
&index) != TCL_OK) {
goto optionError;
}
switch ((enum options) index) {
switch ((enum regexpoptions) index) {
case REGEXP_ALL:
all = 1;
break;
@@ -357,7 +357,7 @@ Tcl_RegexpObjCmd(
objc = info.nsubs + 1;
if (all <= 1) {
resultPtr = Tcl_NewObj();
TclNewObj(resultPtr);
}
}
for (i = 0; i < objc; i++) {
@@ -389,8 +389,8 @@ Tcl_RegexpObjCmd(
end = -1;
}
objs[0] = Tcl_NewWideIntObj(start);
objs[1] = Tcl_NewWideIntObj(end);
TclNewIntObj(objs[0], start);
TclNewIntObj(objs[1], end);
newPtr = Tcl_NewListObj(2, objs);
} else {
@@ -399,7 +399,7 @@ Tcl_RegexpObjCmd(
offset + info.matches[i].start,
offset + info.matches[i].end - 1);
} else {
newPtr = Tcl_NewObj();
TclNewObj(newPtr);
}
}
if (doinline) {
@@ -499,7 +499,7 @@ Tcl_RegsubObjCmd(
"-linestop", "-lineanchor", "-nocase", "-start",
"--", NULL
};
enum options {
enum regsubobjoptions {
REGSUB_ALL, REGSUB_COMMAND, REGSUB_EXPANDED, REGSUB_LINE,
REGSUB_LINESTOP, REGSUB_LINEANCHOR, REGSUB_NOCASE, REGSUB_START,
REGSUB_LAST
@@ -523,7 +523,7 @@ Tcl_RegsubObjCmd(
TCL_EXACT, &index) != TCL_OK) {
goto optionError;
}
switch ((enum options) index) {
switch ((enum regsubobjoptions) index) {
case REGSUB_ALL:
all = 1;
break;
@@ -788,7 +788,7 @@ Tcl_RegsubObjCmd(
args[idx + numParts] = Tcl_NewUnicodeObj(
wstring + offset + subStart, subEnd - subStart);
} else {
args[idx + numParts] = Tcl_NewObj();
TclNewObj(args[idx + numParts]);
}
Tcl_IncrRefCount(args[idx + numParts]);
}
@@ -1194,7 +1194,7 @@ Tcl_SplitObjCmd(
stringPtr = TclGetStringFromObj(objv[1], &stringLen);
end = stringPtr + stringLen;
listPtr = Tcl_NewObj();
TclNewObj(listPtr);
if (stringLen == 0) {
/*
@@ -1536,7 +1536,7 @@ StringIsCmd(
"space", "true", "upper", "wideinteger",
"wordchar", "xdigit", NULL
};
enum isClasses {
enum isClassesEnum {
STR_IS_ALNUM, STR_IS_ALPHA, STR_IS_ASCII, STR_IS_CONTROL,
STR_IS_BOOL, STR_IS_DICT, STR_IS_DIGIT, STR_IS_DOUBLE,
STR_IS_ENTIER, STR_IS_FALSE, STR_IS_GRAPH, STR_IS_INT,
@@ -1547,7 +1547,7 @@ StringIsCmd(
static const char *const isOptions[] = {
"-strict", "-failindex", NULL
};
enum isOptions {
enum isOptionsEnum {
OPT_STRICT, OPT_FAILIDX
};
@@ -1569,7 +1569,7 @@ StringIsCmd(
&idx2) != TCL_OK) {
return TCL_ERROR;
}
switch ((enum isOptions) idx2) {
switch ((enum isOptionsEnum) idx2) {
case OPT_STRICT:
strict = 1;
break;
@@ -1598,7 +1598,7 @@ StringIsCmd(
* When entering here, result == 1 and failat == 0.
*/
switch ((enum isClasses) index) {
switch ((enum isClassesEnum) index) {
case STR_IS_ALNUM:
chcomp = Tcl_UniCharIsAlnum;
break;
@@ -1906,10 +1906,11 @@ StringIsCmd(
*/
str_is_done:
if ((result == 0) && (failVarObj != NULL) &&
Tcl_ObjSetVar2(interp, failVarObj, NULL, Tcl_NewWideIntObj(failat),
TCL_LEAVE_ERR_MSG) == NULL) {
return TCL_ERROR;
if ((result == 0) && (failVarObj != NULL)) {
TclNewIntObj(objPtr, failat);
if (Tcl_ObjSetVar2(interp, failVarObj, NULL, objPtr, TCL_LEAVE_ERR_MSG) == NULL) {
return TCL_ERROR;
}
}
Tcl_SetObjResult(interp, Tcl_NewBooleanObj(result));
return TCL_OK;
@@ -2501,6 +2502,7 @@ StringStartCmd(
int ch;
const char *p, *string;
int cur, index, length, numChars;
Tcl_Obj *obj;
if (objc != 3) {
Tcl_WrongNumArgs(interp, 1, objv, "string index");
@@ -2540,7 +2542,8 @@ StringStartCmd(
cur += 1;
}
}
Tcl_SetObjResult(interp, Tcl_NewWideIntObj(cur));
TclNewIntObj(obj, cur);
Tcl_SetObjResult(interp, obj);
return TCL_OK;
}
@@ -2571,6 +2574,7 @@ StringEndCmd(
int ch;
const char *p, *end, *string;
int cur, index, length, numChars;
Tcl_Obj *obj;
if (objc != 3) {
Tcl_WrongNumArgs(interp, 1, objv, "string index");
@@ -2601,7 +2605,8 @@ StringEndCmd(
} else {
cur = numChars;
}
Tcl_SetObjResult(interp, Tcl_NewWideIntObj(cur));
TclNewIntObj(obj, cur);
Tcl_SetObjResult(interp, obj);
return TCL_OK;
}
@@ -3479,7 +3484,7 @@ TclNRSwitchObjCmd(
"-exact", "-glob", "-indexvar", "-matchvar", "-nocase", "-regexp",
"--", NULL
};
enum options {
enum switchOptionsEnum {
OPT_EXACT, OPT_GLOB, OPT_INDEXV, OPT_MATCHV, OPT_NOCASE, OPT_REGEXP,
OPT_LAST
};
@@ -3500,7 +3505,7 @@ TclNRSwitchObjCmd(
&index) != TCL_OK) {
return TCL_ERROR;
}
switch ((enum options) index) {
switch ((enum switchOptionsEnum) index) {
/*
* General options.
*/
@@ -3770,10 +3775,11 @@ TclNRSwitchObjCmd(
Tcl_Obj *rangeObjAry[2];
if (info.matches[j].end > 0) {
rangeObjAry[0] = Tcl_NewWideIntObj(info.matches[j].start);
rangeObjAry[1] = Tcl_NewWideIntObj(info.matches[j].end-1);
TclNewIntObj(rangeObjAry[0], info.matches[j].start);
TclNewIntObj(rangeObjAry[1], info.matches[j].end-1);
} else {
rangeObjAry[0] = rangeObjAry[1] = Tcl_NewWideIntObj(-1);
TclNewIntObj(rangeObjAry[1], TCL_INDEX_NONE);
rangeObjAry[0] = rangeObjAry[1];
}
/*
@@ -4165,7 +4171,7 @@ Tcl_TimeRateObjCmd(
static const char *const options[] = {
"-direct", "-overhead", "-calibrate", "--", NULL
};
enum options {
enum timeRateOptionsEnum {
TMRT_EV_DIRECT, TMRT_OVERHEAD, TMRT_CALIBRATE, TMRT_LAST
};
NRE_callback *rootPtr;
@@ -4182,7 +4188,7 @@ Tcl_TimeRateObjCmd(
i++;
break;
}
switch (index) {
switch ((enum timeRateOptionsEnum)index) {
case TMRT_EV_DIRECT:
direct = objv[i];
break;
@@ -4197,6 +4203,8 @@ Tcl_TimeRateObjCmd(
case TMRT_CALIBRATE:
calibrate = objv[i];
break;
case TMRT_LAST:
break;
}
}
@@ -4542,7 +4550,8 @@ Tcl_TimeRateObjCmd(
#endif /* TCL_WIDE_CLICKS */
if (!count) { /* no iterations - avoid divide by zero */
objs[0] = objs[2] = objs[4] = Tcl_NewWideIntObj(0);
TclNewIntObj(objs[4], 0);
objs[0] = objs[2] = objs[4];
goto retRes;
}
@@ -4583,7 +4592,7 @@ Tcl_TimeRateObjCmd(
val = usec / count; /* microsecs per iteration */
if (val >= 1000000) {
objs[0] = Tcl_NewWideIntObj(val);
TclNewIntObj(objs[0], val);
} else {
if (val < 10) {
digits = 6;
@@ -4599,7 +4608,7 @@ Tcl_TimeRateObjCmd(
objs[0] = Tcl_ObjPrintf("%.*f", digits, ((double) usec)/count);
}
objs[2] = Tcl_NewWideIntObj(count); /* iterations */
TclNewIntObj(objs[2], count); /* iterations */
/*
* Calculate speed as rate (count) per sec
@@ -4621,7 +4630,7 @@ Tcl_TimeRateObjCmd(
objs[4] = Tcl_ObjPrintf("%.*f",
digits, ((double) (count * 1000000)) / usec);
} else {
objs[4] = Tcl_NewWideIntObj(val);
TclNewIntObj(objs[4], val);
}
} else {
objs[4] = Tcl_NewWideIntObj((count / usec) * 1000000);
@@ -4636,7 +4645,7 @@ Tcl_TimeRateObjCmd(
if (usec >= 1) {
objs[6] = Tcl_ObjPrintf("%.3f", (double)usec / 1000);
} else {
objs[6] = Tcl_NewWideIntObj(0);
TclNewIntObj(objs[6], 0);
}
TclNewLiteralStringObj(objs[7], "net-ms");
}
@@ -4714,7 +4723,7 @@ TclNRTryObjCmd(
return TCL_ERROR;
}
bodyObj = objv[1];
handlersObj = Tcl_NewObj();
TclNewObj(handlersObj);
bodyShared = 0;
haveHandlers = 0;
for (i=2 ; i<objc ; i++) {
+34 -33
View File
@@ -298,7 +298,7 @@ TclCompileArraySetCmd(
varTokenPtr = TokenAfter(parsePtr->tokenPtr);
dataTokenPtr = TokenAfter(varTokenPtr);
literalObj = Tcl_NewObj();
TclNewObj(literalObj);
isDataLiteral = TclWordKnownAtCompileTime(dataTokenPtr, literalObj);
isDataValid = (isDataLiteral
&& Tcl_ListObjLength(NULL, literalObj, &len) == TCL_OK);
@@ -390,9 +390,9 @@ TclCompileArraySetCmd(
keyVar = AnonymousLocal(envPtr);
valVar = AnonymousLocal(envPtr);
infoPtr = (ForeachInfo *)ckalloc(sizeof(ForeachInfo));
infoPtr = (ForeachInfo *)ckalloc(offsetof(ForeachInfo, varLists) + sizeof(ForeachVarList *));
infoPtr->numLists = 1;
infoPtr->varLists[0] = (ForeachVarList *)ckalloc(sizeof(ForeachVarList) + sizeof(int));
infoPtr->varLists[0] = (ForeachVarList *)ckalloc(offsetof(ForeachVarList, varIndexes) + 2 * sizeof(int));
infoPtr->varLists[0]->numVars = 2;
infoPtr->varLists[0]->varIndexes[0] = keyVar;
infoPtr->varLists[0]->varIndexes[1] = valVar;
@@ -875,10 +875,10 @@ TclCompileConcatCmd(
* implement with a simple push.
*/
listObj = Tcl_NewObj();
TclNewObj(listObj);
for (i = 1, tokenPtr = parsePtr->tokenPtr; i < parsePtr->numWords; i++) {
tokenPtr = TokenAfter(tokenPtr);
objPtr = Tcl_NewObj();
TclNewObj(objPtr);
if (!TclWordKnownAtCompileTime(tokenPtr, objPtr)) {
Tcl_DecrRefCount(objPtr);
Tcl_DecrRefCount(listObj);
@@ -1301,10 +1301,10 @@ TclCompileDictCreateCmd(
*/
tokenPtr = TokenAfter(parsePtr->tokenPtr);
dictObj = Tcl_NewObj();
TclNewObj(dictObj);
Tcl_IncrRefCount(dictObj);
for (i=1 ; i<parsePtr->numWords ; i+=2) {
keyObj = Tcl_NewObj();
TclNewObj(keyObj);
Tcl_IncrRefCount(keyObj);
if (!TclWordKnownAtCompileTime(tokenPtr, keyObj)) {
Tcl_DecrRefCount(keyObj);
@@ -1312,7 +1312,7 @@ TclCompileDictCreateCmd(
goto nonConstant;
}
tokenPtr = TokenAfter(tokenPtr);
valueObj = Tcl_NewObj();
TclNewObj(valueObj);
Tcl_IncrRefCount(valueObj);
if (!TclWordKnownAtCompileTime(tokenPtr, valueObj)) {
Tcl_DecrRefCount(keyObj);
@@ -1789,7 +1789,7 @@ TclCompileDictUpdateCmd(
* that are to be used.
*/
duiPtr = (DictUpdateInfo *)ckalloc(sizeof(DictUpdateInfo) + sizeof(int) * (numVars - 1));
duiPtr = (DictUpdateInfo *)ckalloc(offsetof(DictUpdateInfo, varIndices) + sizeof(int) * numVars);
duiPtr->length = numVars;
keyTokenPtrs = (Tcl_Token **)TclStackAlloc(interp, sizeof(Tcl_Token *) * numVars);
tokenPtr = TokenAfter(dictVarTokenPtr);
@@ -2271,7 +2271,7 @@ DupDictUpdateInfo(
size_t len;
dui1Ptr = (DictUpdateInfo *)clientData;
len = sizeof(DictUpdateInfo) + sizeof(int) * (dui1Ptr->length - 1);
len = offsetof(DictUpdateInfo, varIndices) + sizeof(int) * dui1Ptr->length;
dui2Ptr = (DictUpdateInfo *)ckalloc(len);
memcpy(dui2Ptr, dui1Ptr, len);
return dui2Ptr;
@@ -2311,11 +2311,12 @@ DisassembleDictUpdateInfo(
{
DictUpdateInfo *duiPtr = (DictUpdateInfo *)clientData;
int i;
Tcl_Obj *variables = Tcl_NewObj();
Tcl_Obj *variables;
TclNewObj(variables);
for (i=0 ; i<duiPtr->length ; i++) {
Tcl_ListObjAppendElement(NULL, variables,
Tcl_NewIntObj(duiPtr->varIndices[i]));
Tcl_NewWideIntObj(duiPtr->varIndices[i]));
}
Tcl_DictObjPut(NULL, dictObj, Tcl_NewStringObj("variables", -1),
variables);
@@ -2721,8 +2722,8 @@ CompileEachloopCmd(
*/
numLists = (numWords - 2)/2;
infoPtr = (ForeachInfo *)ckalloc(sizeof(ForeachInfo)
+ (numLists - 1) * sizeof(ForeachVarList *));
infoPtr = (ForeachInfo *)ckalloc(offsetof(ForeachInfo, varLists)
+ numLists * sizeof(ForeachVarList *));
infoPtr->numLists = 0; /* Count this up as we go */
/*
@@ -2731,7 +2732,7 @@ CompileEachloopCmd(
* a scalar, or if any var list needs substitutions.
*/
varListObj = Tcl_NewObj();
TclNewObj(varListObj);
for (i = 0, tokenPtr = parsePtr->tokenPtr;
i < numWords-1;
i++, tokenPtr = TokenAfter(tokenPtr)) {
@@ -2755,8 +2756,8 @@ CompileEachloopCmd(
goto done;
}
varListPtr = (ForeachVarList *)ckalloc(sizeof(ForeachVarList)
+ (numVars - 1) * sizeof(int));
varListPtr = (ForeachVarList *)ckalloc(offsetof(ForeachVarList, varIndexes)
+ numVars * sizeof(int));
varListPtr->numVars = numVars;
infoPtr->varLists[i/2] = varListPtr;
infoPtr->numLists++;
@@ -2891,7 +2892,7 @@ DupForeachInfo(
ForeachVarList *srcListPtr, *dupListPtr;
int numVars, i, j, numLists = srcPtr->numLists;
dupPtr = (ForeachInfo *)ckalloc(sizeof(ForeachInfo)
dupPtr = (ForeachInfo *)ckalloc(offsetof(ForeachInfo, varLists)
+ numLists * sizeof(ForeachVarList *));
dupPtr->numLists = numLists;
dupPtr->firstValueTemp = srcPtr->firstValueTemp;
@@ -2900,7 +2901,7 @@ DupForeachInfo(
for (i = 0; i < numLists; i++) {
srcListPtr = srcPtr->varLists[i];
numVars = srcListPtr->numVars;
dupListPtr = (ForeachVarList *)ckalloc(sizeof(ForeachVarList)
dupListPtr = (ForeachVarList *)ckalloc(offsetof(ForeachVarList, varIndexes)
+ numVars * sizeof(int));
dupListPtr->numVars = numVars;
for (j = 0; j < numVars; j++) {
@@ -3050,10 +3051,10 @@ DisassembleForeachInfo(
* Data stores.
*/
objPtr = Tcl_NewObj();
TclNewObj(objPtr);
for (i=0 ; i<infoPtr->numLists ; i++) {
Tcl_ListObjAppendElement(NULL, objPtr,
Tcl_NewIntObj(infoPtr->firstValueTemp + i));
Tcl_NewWideIntObj(infoPtr->firstValueTemp + i));
}
Tcl_DictObjPut(NULL, dictObj, Tcl_NewStringObj("data", -1), objPtr);
@@ -3062,19 +3063,19 @@ DisassembleForeachInfo(
*/
Tcl_DictObjPut(NULL, dictObj, Tcl_NewStringObj("loop", -1),
Tcl_NewIntObj(infoPtr->loopCtTemp));
Tcl_NewWideIntObj(infoPtr->loopCtTemp));
/*
* Assignment targets.
*/
objPtr = Tcl_NewObj();
TclNewObj(objPtr);
for (i=0 ; i<infoPtr->numLists ; i++) {
innerPtr = Tcl_NewObj();
TclNewObj(innerPtr);
varsPtr = infoPtr->varLists[i];
for (j=0 ; j<varsPtr->numVars ; j++) {
Tcl_ListObjAppendElement(NULL, innerPtr,
Tcl_NewIntObj(varsPtr->varIndexes[j]));
Tcl_NewWideIntObj(varsPtr->varIndexes[j]));
}
Tcl_ListObjAppendElement(NULL, objPtr, innerPtr);
}
@@ -3098,19 +3099,19 @@ DisassembleNewForeachInfo(
*/
Tcl_DictObjPut(NULL, dictObj, Tcl_NewStringObj("jumpOffset", -1),
Tcl_NewIntObj(infoPtr->loopCtTemp));
Tcl_NewWideIntObj(infoPtr->loopCtTemp));
/*
* Assignment targets.
*/
objPtr = Tcl_NewObj();
TclNewObj(objPtr);
for (i=0 ; i<infoPtr->numLists ; i++) {
innerPtr = Tcl_NewObj();
TclNewObj(innerPtr);
varsPtr = infoPtr->varLists[i];
for (j=0 ; j<varsPtr->numVars ; j++) {
Tcl_ListObjAppendElement(NULL, innerPtr,
Tcl_NewIntObj(varsPtr->varIndexes[j]));
Tcl_NewWideIntObj(varsPtr->varIndexes[j]));
}
Tcl_ListObjAppendElement(NULL, objPtr, innerPtr);
}
@@ -3163,7 +3164,7 @@ TclCompileFormatCmd(
* a case we can handle by compiling to a constant.
*/
formatObj = Tcl_NewObj();
TclNewObj(formatObj);
Tcl_IncrRefCount(formatObj);
tokenPtr = TokenAfter(tokenPtr);
if (!TclWordKnownAtCompileTime(tokenPtr, formatObj)) {
@@ -3174,7 +3175,7 @@ TclCompileFormatCmd(
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();
TclNewObj(objv[i]);
Tcl_IncrRefCount(objv[i]);
if (!TclWordKnownAtCompileTime(tokenPtr, objv[i])) {
goto checkForStringConcatCase;
@@ -3266,7 +3267,7 @@ TclCompileFormatCmd(
start = Tcl_GetString(formatObj);
/* The start of the currently-scanned literal
* in the format string. */
tmpObj = Tcl_NewObj(); /* The buffer used to accumulate the literal
TclNewObj(tmpObj); /* The buffer used to accumulate the literal
* being built. */
for (bytes = start ; *bytes ; bytes++) {
if (*bytes == '%') {
@@ -3284,7 +3285,7 @@ TclCompileFormatCmd(
if (len > 0) {
PushLiteral(envPtr, b, len);
Tcl_DecrRefCount(tmpObj);
tmpObj = Tcl_NewObj();
TclNewObj(tmpObj);
i++;
}
+12 -11
View File
@@ -53,9 +53,10 @@ TclGetIndexFromToken(
int after,
int *indexPtr)
{
Tcl_Obj *tmpObj = Tcl_NewObj();
Tcl_Obj *tmpObj;
int result = TCL_ERROR;
TclNewObj(tmpObj);
if (TclWordKnownAtCompileTime(tokenPtr, tmpObj)) {
result = TclIndexEncode(NULL, tmpObj, before, after, indexPtr);
}
@@ -598,7 +599,7 @@ TclCompileInfoCommandsCmd(
return TCL_ERROR;
}
tokenPtr = TokenAfter(parsePtr->tokenPtr);
objPtr = Tcl_NewObj();
TclNewObj(objPtr);
Tcl_IncrRefCount(objPtr);
if (!TclWordKnownAtCompileTime(tokenPtr, objPtr)) {
goto notCompilable;
@@ -873,7 +874,7 @@ TclCompileLappendCmd(
*/
if (numWords > 2) {
Tcl_Token *valueTokenPtr = TokenAfter(varTokenPtr);
valueTokenPtr = TokenAfter(varTokenPtr);
CompileWord(envPtr, valueTokenPtr, interp, 2);
}
@@ -1063,7 +1064,7 @@ TclCompileLindexCmd(
int i, idx, numWords = parsePtr->numWords;
/*
* Quit if too few args.
* Quit if not enough args.
*/
/* TODO: Consider support for compiling expanded args. */
@@ -1169,9 +1170,9 @@ TclCompileListCmd(
numWords = parsePtr->numWords;
valueTokenPtr = TokenAfter(parsePtr->tokenPtr);
listObj = Tcl_NewObj();
TclNewObj(listObj);
for (i = 1; i < numWords && listObj != NULL; i++) {
objPtr = Tcl_NewObj();
TclNewObj(objPtr);
if (TclWordKnownAtCompileTime(valueTokenPtr, objPtr)) {
(void) Tcl_ListObjAppendElement(NULL, listObj, objPtr);
} else {
@@ -2264,7 +2265,7 @@ TclCompileRegsubCmd(
Tcl_DStringInit(&pattern);
tokenPtr = TokenAfter(tokenPtr);
patternObj = Tcl_NewObj();
TclNewObj(patternObj);
if (!TclWordKnownAtCompileTime(tokenPtr, patternObj)) {
goto done;
}
@@ -2275,7 +2276,7 @@ TclCompileRegsubCmd(
}
tokenPtr = TokenAfter(tokenPtr);
Tcl_DecrRefCount(patternObj);
patternObj = Tcl_NewObj();
TclNewObj(patternObj);
if (!TclWordKnownAtCompileTime(tokenPtr, patternObj)) {
goto done;
}
@@ -2290,7 +2291,7 @@ TclCompileRegsubCmd(
stringTokenPtr = TokenAfter(tokenPtr);
tokenPtr = TokenAfter(stringTokenPtr);
replacementObj = Tcl_NewObj();
TclNewObj(replacementObj);
if (!TclWordKnownAtCompileTime(tokenPtr, replacementObj)) {
goto done;
}
@@ -2440,7 +2441,7 @@ TclCompileReturnCmd(
*/
for (objc = 0; objc < numOptionWords; objc++) {
objv[objc] = Tcl_NewObj();
TclNewObj(objv[objc]);
Tcl_IncrRefCount(objv[objc]);
if (!TclWordKnownAtCompileTime(wordTokenPtr, objv[objc])) {
/*
@@ -2659,7 +2660,7 @@ TclCompileUpvarCmd(
* Push the frame index if it is known at compile time
*/
objPtr = Tcl_NewObj();
TclNewObj(objPtr);
tokenPtr = TokenAfter(parsePtr->tokenPtr);
if (TclWordKnownAtCompileTime(tokenPtr, objPtr)) {
CallFrame *framePtr;
+13 -11
View File
@@ -241,7 +241,7 @@ TclCompileStringCatCmd(
folded = NULL;
wordTokenPtr = TokenAfter(parsePtr->tokenPtr);
for (i = 1; i < numWords; i++) {
obj = Tcl_NewObj();
TclNewObj(obj);
if (TclWordKnownAtCompileTime(wordTokenPtr, obj)) {
if (folded) {
Tcl_AppendObjToObj(folded, obj);
@@ -462,7 +462,7 @@ TclCompileStringInsertCmd(
TCL_INDEX_END, &idx)) {
/* Nothing useful knowable - cease compile; let it direct eval */
return TCL_OK;
return TCL_ERROR;
}
/* Compute and push the string to be inserted */
@@ -511,7 +511,7 @@ TclCompileStringIsCmd(
"true", "upper", "wideinteger", "wordchar",
"xdigit", NULL
};
enum isClasses {
enum isClassesEnum {
STR_IS_ALNUM, STR_IS_ALPHA, STR_IS_ASCII, STR_IS_CONTROL,
STR_IS_BOOL, STR_IS_DICT, STR_IS_DIGIT, STR_IS_DOUBLE, STR_IS_ENTIER,
STR_IS_FALSE, STR_IS_GRAPH, STR_IS_INT, STR_IS_LIST,
@@ -526,7 +526,7 @@ TclCompileStringIsCmd(
if (parsePtr->numWords < 3 || parsePtr->numWords > 6) {
return TCL_ERROR;
}
isClass = Tcl_NewObj();
TclNewObj(isClass);
if (!TclWordKnownAtCompileTime(tokenPtr, isClass)) {
Tcl_DecrRefCount(isClass);
return TCL_ERROR;
@@ -575,7 +575,7 @@ TclCompileStringIsCmd(
CompileWord(envPtr, tokenPtr, interp, parsePtr->numWords-1);
switch ((enum isClasses) t) {
switch ((enum isClassesEnum) t) {
case STR_IS_ALNUM:
strClassType = STR_CLASS_ALNUM;
goto compileStrClass;
@@ -930,7 +930,7 @@ TclCompileStringMapCmd(
}
mapTokenPtr = TokenAfter(parsePtr->tokenPtr);
stringTokenPtr = TokenAfter(mapTokenPtr);
mapObj = Tcl_NewObj();
TclNewObj(mapObj);
Tcl_IncrRefCount(mapObj);
if (!TclWordKnownAtCompileTime(mapTokenPtr, mapObj)) {
Tcl_DecrRefCount(mapObj);
@@ -1461,7 +1461,7 @@ TclCompileSubstCmd(
objv = (Tcl_Obj **)TclStackAlloc(interp, /*numArgs*/ numOpts * sizeof(Tcl_Obj *));
for (objc = 0; objc < /*numArgs*/ numOpts; objc++) {
objv[objc] = Tcl_NewObj();
TclNewObj(objv[objc]);
Tcl_IncrRefCount(objv[objc]);
if (!TclWordKnownAtCompileTime(wordTokenPtr, objv[objc])) {
objc++;
@@ -2610,18 +2610,19 @@ DisassembleJumptableInfo(
TCL_UNUSED(unsigned int))
{
JumptableInfo *jtPtr = (JumptableInfo *)clientData;
Tcl_Obj *mapping = Tcl_NewObj();
Tcl_Obj *mapping;
Tcl_HashEntry *hPtr;
Tcl_HashSearch search;
const char *keyPtr;
int offset;
size_t offset;
TclNewObj(mapping);
hPtr = Tcl_FirstHashEntry(&jtPtr->hashTable, &search);
for (; hPtr ; hPtr = Tcl_NextHashEntry(&search)) {
keyPtr = (const char *)Tcl_GetHashKey(&jtPtr->hashTable, hPtr);
offset = PTR2INT(Tcl_GetHashValue(hPtr));
Tcl_DictObjPut(NULL, mapping, Tcl_NewStringObj(keyPtr, -1),
Tcl_NewIntObj(offset));
Tcl_NewWideIntObj(offset));
}
Tcl_DictObjPut(NULL, dictObj, Tcl_NewStringObj("mapping", -1), mapping);
}
@@ -3623,8 +3624,9 @@ TclCompileUnsetCmd(
*/
for (i=1,varTokenPtr=parsePtr->tokenPtr ; i<parsePtr->numWords ; i++) {
Tcl_Obj *leadingWord = Tcl_NewObj();
Tcl_Obj *leadingWord;
TclNewObj(leadingWord);
varTokenPtr = TokenAfter(varTokenPtr);
if (!TclWordKnownAtCompileTime(varTokenPtr, leadingWord)) {
TclDecrRefCount(leadingWord);
+69 -21
View File
@@ -164,6 +164,8 @@ enum Marks {
* "=" is encountered. */
#define INVALID 5 /* A parse error. Used when any punctuation
* appears that's not a supported operator. */
#define COMMENT 6 /* Comment. Lasts to end of line or end of
* expression, whichever comes first. */
/* Leaf lexemes */
@@ -462,7 +464,7 @@ static const unsigned char Lexeme[] = {
INVALID /* FS */, INVALID /* GS */,
INVALID /* RS */, INVALID /* US */,
INVALID /* SPACE */, 0 /* ! or != */,
QUOTED /* " */, INVALID /* # */,
QUOTED /* " */, 0 /* # */,
VARIABLE /* $ */, MOD /* % */,
0 /* & or && */, INVALID /* ' */,
OPEN_PAREN /* ( */, CLOSE_PAREN /* ) */,
@@ -674,9 +676,10 @@ ParseExpr(
OpNode *newPtr = NULL;
do {
if (size <= UINT_MAX/sizeof(OpNode)) {
newPtr = (OpNode *)attemptckrealloc(nodes, size * sizeof(OpNode));
}
if (size <= UINT_MAX/sizeof(OpNode)) {
newPtr = (OpNode *) attemptckrealloc(nodes,
size * sizeof(OpNode));
}
} while ((newPtr == NULL)
&& ((size -= (size - nodesUsed) / 2) > nodesUsed));
if (newPtr == NULL) {
@@ -708,6 +711,10 @@ ParseExpr(
int b;
switch (lexeme) {
case COMMENT:
start += scanned;
numBytes -= scanned;
continue;
case INVALID:
msg = Tcl_ObjPrintf("invalid character \"%.*s\"",
scanned, start);
@@ -742,6 +749,32 @@ ParseExpr(
} else if (Tcl_GetBooleanFromObj(NULL,literal,&b) == TCL_OK) {
lexeme = BOOLEAN;
} else {
/*
* Tricky case: see test expr-62.10
*/
int scanned2 = scanned;
do {
scanned2 += TclParseAllWhiteSpace(
start + scanned2, numBytes - scanned2);
scanned2 += ParseLexeme(
start + scanned2, numBytes - scanned2, &lexeme,
NULL);
} while (lexeme == COMMENT);
if (lexeme == OPEN_PAREN) {
/*
* Actually a function call, but with obscuring
* comments. Skip to the start of the parentheses.
* Note that we assume that open parentheses are one
* byte long.
*/
lexeme = FUNCTION;
Tcl_ListObjAppendElement(NULL, funcList, literal);
scanned = scanned2 - 1;
break;
}
Tcl_DecrRefCount(literal);
msg = Tcl_ObjPrintf("invalid bareword \"%.*s%s\"",
(scanned < limit) ? scanned : limit - 3, start,
@@ -1009,7 +1042,7 @@ ParseExpr(
* later.
*/
literal = Tcl_NewObj();
TclNewObj(literal);
if (TclWordKnownAtCompileTime(tokenPtr, literal)) {
Tcl_ListObjAppendElement(NULL, litList, literal);
complete = lastParsed = OT_LITERAL;
@@ -1836,11 +1869,13 @@ Tcl_ParseExpr(
{
int code;
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_Obj *litList; /* List to hold the literals. */
Tcl_Obj *funcList; /* List to hold the functon names. */
Tcl_Parse *exprParsePtr = (Tcl_Parse *)TclStackAlloc(interp, sizeof(Tcl_Parse));
/* Holds the Tcl_Tokens of substitutions. */
TclNewObj(litList);
TclNewObj(funcList);
if (numBytes < 0) {
numBytes = (start ? strlen(start) : 0);
}
@@ -1892,7 +1927,7 @@ ParseLexeme(
storage, if non-NULL. */
{
const char *end;
int scanned;
int scanned, size;
Tcl_UniChar ch = 0;
Tcl_Obj *literal = NULL;
unsigned char byte;
@@ -1907,6 +1942,16 @@ ParseLexeme(
return 1;
}
switch (byte) {
case '#':
/*
* Scan forward over the comment contents.
*/
for (size = 0; byte != '\n' && byte != 0 && size < numBytes; size++) {
byte = UCHAR(start[size]);
}
*lexemePtr = COMMENT;
return size - (byte == '\n');
case '*':
if ((numBytes > 1) && (start[1] == '*')) {
*lexemePtr = EXPON;
@@ -2040,7 +2085,7 @@ ParseLexeme(
break;
}
literal = Tcl_NewObj();
TclNewObj(literal);
if (TclParseNumber(NULL, literal, NULL, start, numBytes, &end,
TCL_PARSE_NO_WHITESPACE) == TCL_OK) {
if (end < start + numBytes && !TclIsBareword(*end)) {
@@ -2154,12 +2199,15 @@ TclCompileExpr(
int optimize) /* 0 for one-off expressions. */
{
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_Obj *litList; /* List to hold the literals */
Tcl_Obj *funcList; /* List to hold the functon names*/
Tcl_Parse *parsePtr = (Tcl_Parse *)TclStackAlloc(interp, sizeof(Tcl_Parse));
/* Holds the Tcl_Tokens of substitutions */
int code;
int code = ParseExpr(interp, script, numBytes, &opTree, litList,
TclNewObj(litList);
TclNewObj(funcList);
code = ParseExpr(interp, script, numBytes, &opTree, litList,
funcList, parsePtr, 0 /* parseOnly */);
if (code == TCL_OK) {
@@ -2458,8 +2506,8 @@ CompileExprTree(
if (optimize) {
int length;
const char *bytes = TclGetStringFromObj(literal, &length);
int index = TclRegisterLiteral(envPtr, bytes, length, 0);
Tcl_Obj *objPtr = TclFetchLiteral(envPtr, index);
int idx = TclRegisterLiteral(envPtr, bytes, length, 0);
Tcl_Obj *objPtr = TclFetchLiteral(envPtr, idx);
if ((objPtr->typePtr == NULL) && (literal->typePtr != NULL)) {
/*
@@ -2479,7 +2527,7 @@ CompileExprTree(
objPtr->internalRep = literal->internalRep;
literal->typePtr = NULL;
}
TclEmitPush(index, envPtr);
TclEmitPush(idx, envPtr);
} else {
/*
* When optimize==0, we know the expression is a one-off and
@@ -2505,7 +2553,7 @@ CompileExprTree(
if (ExecConstantExprTree(interp, nodes, next, litObjvPtr)
== TCL_OK) {
int index;
int idx;
Tcl_Obj *objPtr = Tcl_GetObjResult(interp);
/*
@@ -2519,8 +2567,8 @@ CompileExprTree(
const char *bytes
= Tcl_GetStringFromObj(objPtr, &numBytes);
index = TclRegisterLiteral(envPtr, bytes, numBytes, 0);
tableValue = TclFetchLiteral(envPtr, index);
idx = TclRegisterLiteral(envPtr, bytes, numBytes, 0);
tableValue = TclFetchLiteral(envPtr, idx);
if ((tableValue->typePtr == NULL) &&
(objPtr->typePtr != NULL)) {
/*
@@ -2532,9 +2580,9 @@ CompileExprTree(
objPtr->typePtr = NULL;
}
} else {
index = TclAddLiteralObj(envPtr, objPtr, NULL);
idx = TclAddLiteralObj(envPtr, objPtr, NULL);
}
TclEmitPush(index, envPtr);
TclEmitPush(idx, envPtr);
} else {
TclCompileSyntaxError(interp, envPtr);
}
@@ -2711,7 +2759,7 @@ TclVariadicOpCmd(
int code;
if (objc < 2) {
Tcl_SetObjResult(interp, Tcl_NewIntObj(occdPtr->i.identity));
Tcl_SetObjResult(interp, Tcl_NewWideIntObj(occdPtr->i.identity));
return TCL_OK;
}
+3 -2
View File
@@ -1746,7 +1746,7 @@ TclWordKnownAtCompileTime(
}
tokenPtr++;
if (valuePtr != NULL) {
tempPtr = Tcl_NewObj();
TclNewObj(tempPtr);
Tcl_IncrRefCount(tempPtr);
}
while (numComponents--) {
@@ -2035,7 +2035,7 @@ CompileCommandTokens(
Interp *iPtr = (Interp *) interp;
Tcl_Token *tokenPtr = parsePtr->tokenPtr;
ExtCmdLoc *eclPtr = envPtr->extCmdMapPtr;
Tcl_Obj *cmdObj = Tcl_NewObj();
Tcl_Obj *cmdObj;
Command *cmdPtr = NULL;
int code = TCL_ERROR;
int cmdKnown, expand = -1;
@@ -2050,6 +2050,7 @@ CompileCommandTokens(
/* Pre-Compile */
TclNewObj(cmdObj);
envPtr->numCommands++;
EnterCmdStartData(envPtr, cmdIdx,
parsePtr->commandStart - envPtr->source, startCodeOffset);
+3 -3
View File
@@ -991,7 +991,7 @@ typedef struct JumpFixupArray {
typedef struct ForeachVarList {
int numVars; /* The number of variables in the list. */
int varIndexes[1]; /* An array of the indexes ("slot numbers")
int varIndexes[TCLFLEXARRAY];/* An array of the indexes ("slot numbers")
* for each variable in the procedure's array
* of local variables. Only scalar variables
* are supported. The actual size of this
@@ -1015,7 +1015,7 @@ typedef struct ForeachInfo {
* the loop's iteration count. Used to
* determine next value list element to assign
* each loop var. */
ForeachVarList *varLists[1];/* An array of pointers to ForeachVarList
ForeachVarList *varLists[TCLFLEXARRAY];/* An array of pointers to ForeachVarList
* structures describing each var list. The
* actual size of this field will be large
* enough to numVars indexes. THIS MUST BE THE
@@ -1046,7 +1046,7 @@ MODULE_SCOPE const AuxDataType tclJumptableInfoType;
typedef struct {
int length; /* Size of array */
int varIndices[1]; /* Array of variable indices to manage when
int varIndices[TCLFLEXARRAY]; /* Array of variable indices to manage when
* processing the start and end of a [dict
* update]. There is really more than one
* entry, and the structure is allocated to
+7 -7
View File
@@ -2787,7 +2787,7 @@ TclClockOldscanObjCmd(
yyHaveRel = 0;
yyRelMonth = 0; yyRelDay = 0; yyRelSeconds = 0; yyRelPointer = NULL;
dateInfo.messages = Tcl_NewObj();
TclNewObj(dateInfo.messages);
dateInfo.separatrix = "";
Tcl_IncrRefCount(dateInfo.messages);
@@ -2844,8 +2844,8 @@ TclClockOldscanObjCmd(
return TCL_ERROR;
}
result = Tcl_NewObj();
resultElement = Tcl_NewObj();
TclNewObj(result);
TclNewObj(resultElement);
if (yyHaveDate) {
Tcl_ListObjAppendElement(interp, resultElement,
Tcl_NewIntObj((int) yyYear));
@@ -2863,7 +2863,7 @@ TclClockOldscanObjCmd(
Tcl_ListObjAppendElement(interp, result, Tcl_NewObj());
}
resultElement = Tcl_NewObj();
TclNewObj(resultElement);
if (yyHaveZone) {
Tcl_ListObjAppendElement(interp, resultElement,
Tcl_NewIntObj((int) -yyTimezone));
@@ -2872,7 +2872,7 @@ TclClockOldscanObjCmd(
}
Tcl_ListObjAppendElement(interp, result, resultElement);
resultElement = Tcl_NewObj();
TclNewObj(resultElement);
if (yyHaveRel) {
Tcl_ListObjAppendElement(interp, resultElement,
Tcl_NewIntObj((int) yyRelMonth));
@@ -2883,7 +2883,7 @@ TclClockOldscanObjCmd(
}
Tcl_ListObjAppendElement(interp, result, resultElement);
resultElement = Tcl_NewObj();
TclNewObj(resultElement);
if (yyHaveDay && !yyHaveDate) {
Tcl_ListObjAppendElement(interp, resultElement,
Tcl_NewIntObj((int) yyDayOrdinal));
@@ -2892,7 +2892,7 @@ TclClockOldscanObjCmd(
}
Tcl_ListObjAppendElement(interp, result, resultElement);
resultElement = Tcl_NewObj();
TclNewObj(resultElement);
if (yyHaveOrdinalMonth) {
Tcl_ListObjAppendElement(interp, resultElement,
Tcl_NewIntObj((int) yyMonthOrdinal));
+4 -3
View File
@@ -2037,7 +2037,7 @@ DictSizeCmd(
}
result = Tcl_DictObjSize(interp, objv[1], &size);
if (result == TCL_OK) {
Tcl_SetObjResult(interp, Tcl_NewIntObj(size));
Tcl_SetObjResult(interp, Tcl_NewWideIntObj(size));
}
return result;
}
@@ -2212,7 +2212,7 @@ DictIncrCmd(
Tcl_DictObjPut(NULL, dictPtr, objv[2], objv[3]);
}
} else {
Tcl_DictObjPut(NULL, dictPtr, objv[2], Tcl_NewIntObj(1));
Tcl_DictObjPut(NULL, dictPtr, objv[2], Tcl_NewWideIntObj(1));
}
} else {
/*
@@ -2226,8 +2226,9 @@ DictIncrCmd(
if (objc == 4) {
code = TclIncrObj(interp, valuePtr, objv[3]);
} else {
Tcl_Obj *incrPtr = Tcl_NewIntObj(1);
Tcl_Obj *incrPtr;
TclNewIntObj(incrPtr, 1);
Tcl_IncrRefCount(incrPtr);
code = TclIncrObj(interp, valuePtr, incrPtr);
TclDecrRefCount(incrPtr);
+27 -24
View File
@@ -284,7 +284,7 @@ DisassembleByteCodeObj(
PrintSourceToObj(bufferObj, codePtr->source,
TclMin(codePtr->numSrcBytes, 55));
GetLocationInformation(codePtr->procPtr, &fileObj, &line);
if (line > -1 && fileObj != NULL) {
if (line >= 0 && fileObj != NULL) {
Tcl_AppendPrintfToObj(bufferObj, "\n File \"%s\" Line %d",
Tcl_GetString(fileObj), line);
}
@@ -804,8 +804,9 @@ Tcl_Obj *
TclNewInstNameObj(
unsigned char inst)
{
Tcl_Obj *objPtr = Tcl_NewObj();
Tcl_Obj *objPtr;
TclNewObj(objPtr);
TclInvalidateStringRep(objPtr);
InstNameSetIntRep(objPtr, (long) inst);
@@ -950,7 +951,7 @@ DisassembleByteCodeAsDicts(
* Get the literals from the bytecode.
*/
literals = Tcl_NewObj();
TclNewObj(literals);
for (i=0 ; i<codePtr->numLitObjects ; i++) {
Tcl_ListObjAppendElement(NULL, literals, codePtr->objArrayPtr[i]);
}
@@ -959,7 +960,7 @@ DisassembleByteCodeAsDicts(
* Get the variables from the bytecode.
*/
variables = Tcl_NewObj();
TclNewObj(variables);
if (codePtr->procPtr) {
int localCount = codePtr->procPtr->numCompiledLocals;
CompiledLocal *localPtr = codePtr->procPtr->firstLocalPtr;
@@ -967,7 +968,7 @@ DisassembleByteCodeAsDicts(
for (i=0 ; i<localCount ; i++,localPtr=localPtr->nextPtr) {
Tcl_Obj *descriptor[2];
descriptor[0] = Tcl_NewObj();
TclNewObj(descriptor[0]);
if (!(localPtr->flags & (VAR_ARRAY|VAR_LINK))) {
Tcl_ListObjAppendElement(NULL, descriptor[0],
Tcl_NewStringObj("scalar", -1));
@@ -1007,12 +1008,12 @@ DisassembleByteCodeAsDicts(
* Get the instructions from the bytecode.
*/
instructions = Tcl_NewObj();
TclNewObj(instructions);
for (pc=codePtr->codeStart; pc<codePtr->codeStart+codePtr->numCodeBytes;){
const InstructionDesc *instDesc = &tclInstructionTable[*pc];
int address = pc - codePtr->codeStart;
inst = Tcl_NewObj();
TclNewObj(inst);
Tcl_ListObjAppendElement(NULL, inst, Tcl_NewStringObj(
instDesc->name, -1));
opnd = pc + 1;
@@ -1034,7 +1035,7 @@ DisassembleByteCodeAsDicts(
val = TclGetUInt4AtPtr(opnd);
opnd += 4;
formatNumber:
Tcl_ListObjAppendElement(NULL, inst, Tcl_NewIntObj(val));
Tcl_ListObjAppendElement(NULL, inst, Tcl_NewWideIntObj(val));
break;
case OPERAND_OFFSET1:
@@ -1102,7 +1103,7 @@ DisassembleByteCodeAsDicts(
Tcl_Panic("opcode %d with more than zero 'no' operands", *pc);
}
}
Tcl_DictObjPut(NULL, instructions, Tcl_NewIntObj(address), inst);
Tcl_DictObjPut(NULL, instructions, Tcl_NewWideIntObj(address), inst);
pc += instDesc->numBytes;
}
@@ -1110,21 +1111,23 @@ DisassembleByteCodeAsDicts(
* Get the auxiliary data from the bytecode.
*/
aux = Tcl_NewObj();
TclNewObj(aux);
for (i=0 ; i<codePtr->numAuxDataItems ; i++) {
AuxData *auxData = &codePtr->auxDataArrayPtr[i];
Tcl_Obj *auxDesc = Tcl_NewStringObj(auxData->type->name, -1);
if (auxData->type->disassembleProc) {
Tcl_Obj *desc = Tcl_NewObj();
Tcl_Obj *desc;
TclNewObj(desc);
Tcl_DictObjPut(NULL, desc, Tcl_NewStringObj("name", -1), auxDesc);
auxDesc = desc;
auxData->type->disassembleProc(auxData->clientData, auxDesc,
codePtr, 0);
} else if (auxData->type->printProc) {
Tcl_Obj *desc = Tcl_NewObj();
Tcl_Obj *desc;
TclNewObj(desc);
auxData->type->printProc(auxData->clientData, desc, codePtr, 0);
Tcl_ListObjAppendElement(NULL, auxDesc, desc);
}
@@ -1135,7 +1138,7 @@ DisassembleByteCodeAsDicts(
* Get the exception ranges from the bytecode.
*/
exn = Tcl_NewObj();
TclNewObj(exn);
for (i=0 ; i<codePtr->numExceptRanges ; i++) {
ExceptionRange *rangePtr = &codePtr->exceptArrayPtr[i];
@@ -1170,7 +1173,7 @@ DisassembleByteCodeAsDicts(
? ((ptr)+=5 , TclGetInt4AtPtr((ptr)-4)) \
: ((ptr)+=1 , TclGetInt1AtPtr((ptr)-1)))
commands = Tcl_NewObj();
TclNewObj(commands);
codeOffPtr = codePtr->codeDeltaStart;
codeLenPtr = codePtr->codeLengthStart;
srcOffPtr = codePtr->srcDeltaStart;
@@ -1183,11 +1186,11 @@ DisassembleByteCodeAsDicts(
codeLength = Decode(codeLenPtr);
sourceOffset += Decode(srcOffPtr);
sourceLength = Decode(srcLenPtr);
cmd = Tcl_NewObj();
TclNewObj(cmd);
Tcl_DictObjPut(NULL, cmd, Tcl_NewStringObj("codefrom", -1),
Tcl_NewIntObj(codeOffset));
Tcl_NewWideIntObj(codeOffset));
Tcl_DictObjPut(NULL, cmd, Tcl_NewStringObj("codeto", -1),
Tcl_NewIntObj(codeOffset + codeLength - 1));
Tcl_NewWideIntObj(codeOffset + codeLength - 1));
/*
* Convert byte offsets to character offsets; important if multibyte
@@ -1195,10 +1198,10 @@ DisassembleByteCodeAsDicts(
*/
Tcl_DictObjPut(NULL, cmd, Tcl_NewStringObj("scriptfrom", -1),
Tcl_NewIntObj(Tcl_NumUtfChars(codePtr->source,
Tcl_NewWideIntObj(Tcl_NumUtfChars(codePtr->source,
sourceOffset)));
Tcl_DictObjPut(NULL, cmd, Tcl_NewStringObj("scriptto", -1),
Tcl_NewIntObj(Tcl_NumUtfChars(codePtr->source,
Tcl_NewWideIntObj(Tcl_NumUtfChars(codePtr->source,
sourceOffset + sourceLength - 1)));
Tcl_DictObjPut(NULL, cmd, Tcl_NewStringObj("script", -1),
Tcl_NewStringObj(codePtr->source+sourceOffset, sourceLength));
@@ -1218,7 +1221,7 @@ DisassembleByteCodeAsDicts(
* Build the overall result.
*/
description = Tcl_NewObj();
TclNewObj(description);
Tcl_DictObjPut(NULL, description, Tcl_NewStringObj("literals", -1),
literals);
Tcl_DictObjPut(NULL, description, Tcl_NewStringObj("variables", -1),
@@ -1234,13 +1237,13 @@ DisassembleByteCodeAsDicts(
Tcl_DictObjPut(NULL, description, Tcl_NewStringObj("namespace", -1),
Tcl_NewStringObj(codePtr->nsPtr->fullName, -1));
Tcl_DictObjPut(NULL, description, Tcl_NewStringObj("stackdepth", -1),
Tcl_NewIntObj(codePtr->maxStackDepth));
Tcl_NewWideIntObj(codePtr->maxStackDepth));
Tcl_DictObjPut(NULL, description, Tcl_NewStringObj("exceptdepth", -1),
Tcl_NewIntObj(codePtr->maxExceptDepth));
if (line > -1) {
Tcl_NewWideIntObj(codePtr->maxExceptDepth));
if (line >= 0) {
Tcl_DictObjPut(NULL, description,
Tcl_NewStringObj("initiallinenumber", -1),
Tcl_NewIntObj(line));
Tcl_NewWideIntObj(line));
}
if (file) {
Tcl_DictObjPut(NULL, description,
+6 -4
View File
@@ -116,7 +116,7 @@ typedef struct {
* entry in this array is 1, otherwise it is
* 0. */
int numSubTables; /* Length of following array. */
EscapeSubTable subTables[1];/* Information about each EscapeSubTable used
EscapeSubTable subTables[TCLFLEXARRAY];/* Information about each EscapeSubTable used
* by this encoding type. The actual size is
* as large as necessary to hold all
* EscapeSubTables. */
@@ -469,12 +469,13 @@ FillEncodingFileMap(void)
*/
int j, numFiles;
Tcl_Obj *directory, *matchFileList = Tcl_NewObj();
Tcl_Obj *directory, *matchFileList;
Tcl_Obj **filev;
Tcl_GlobTypeData readableFiles = {
TCL_GLOB_TYPE_FILE, TCL_GLOB_PERM_R, NULL, NULL
};
TclNewObj(matchFileList);
Tcl_ListObjIndex(NULL, searchPath, i, &directory);
Tcl_IncrRefCount(directory);
Tcl_IncrRefCount(matchFileList);
@@ -915,10 +916,11 @@ Tcl_GetEncodingNames(
Tcl_HashTable table;
Tcl_HashSearch search;
Tcl_HashEntry *hPtr;
Tcl_Obj *map, *name, *result = Tcl_NewObj();
Tcl_Obj *map, *name, *result;
Tcl_DictSearch mapSearch;
int dummy, done = 0;
TclNewObj(result);
Tcl_InitObjHashTable(&table);
/*
@@ -2053,7 +2055,7 @@ LoadEscapeEncoding(
Tcl_DStringFree(&lineString);
}
size = sizeof(EscapeEncodingData) - sizeof(EscapeSubTable)
size = offsetof(EscapeEncodingData, subTables)
+ Tcl_DStringLength(&escapeData);
dataPtr = (EscapeEncodingData *)ckalloc(size);
dataPtr->initLen = strlen(init);
+5 -3
View File
@@ -2909,7 +2909,7 @@ TclCompileEnsemble(
DefineLineInformation;
Tcl_Token *tokenPtr = TokenAfter(parsePtr->tokenPtr);
Tcl_Obj *mapObj, *subcmdObj, *targetCmdObj, *listObj, **elems;
Tcl_Obj *replaced = Tcl_NewObj(), *replacement;
Tcl_Obj *replaced, *replacement;
Tcl_Command ensemble = (Tcl_Command) cmdPtr;
Command *oldCmdPtr = cmdPtr, *newCmdPtr;
int len, result, flags = 0, i, depth = 1, invokeAnyway = 0;
@@ -2917,6 +2917,7 @@ TclCompileEnsemble(
unsigned numBytes;
const char *word;
TclNewObj(replaced);
Tcl_IncrRefCount(replaced);
if (parsePtr->numWords < depth + 1) {
goto failed;
@@ -3420,7 +3421,7 @@ CompileToInvokedCommand(
* the implementation.
*/
objPtr = Tcl_NewObj();
TclNewObj(objPtr);
Tcl_GetCommandFullName(interp, (Tcl_Command) cmdPtr, objPtr);
bytes = TclGetString(objPtr);
if ((cmdPtr != NULL) && (cmdPtr->flags & CMD_VIA_RESOLVER)) {
@@ -3459,8 +3460,9 @@ CompileBasicNArgCommand(
* compiled. */
CompileEnv *envPtr) /* Holds resulting instructions. */
{
Tcl_Obj *objPtr = Tcl_NewObj();
Tcl_Obj *objPtr;
TclNewObj(objPtr);
Tcl_IncrRefCount(objPtr);
Tcl_GetCommandFullName(interp, (Tcl_Command) cmdPtr, objPtr);
TclCompileInvocation(interp, parsePtr->tokenPtr, objPtr,
+3 -3
View File
@@ -1048,7 +1048,7 @@ Tcl_InitSubsystems(void)
TclInitThreadStorage(); /* Creates hash table for
* thread local storage */
#if USE_TCLALLOC
#if defined(USE_TCLALLOC) && USE_TCLALLOC
TclInitAlloc(); /* Process wide mutex init */
#endif
#if TCL_THREADS && defined(USE_THREAD_ALLOC)
@@ -1502,7 +1502,7 @@ Tcl_UpdateObjCmd(
int optionIndex;
int flags = 0; /* Initialized to avoid compiler warning. */
static const char *const updateOptions[] = {"idletasks", NULL};
enum updateOptions {OPT_IDLETASKS};
enum updateOptionsEnum {OPT_IDLETASKS};
if (objc == 1) {
flags = TCL_ALL_EVENTS|TCL_DONT_WAIT;
@@ -1511,7 +1511,7 @@ Tcl_UpdateObjCmd(
"option", 0, &optionIndex) != TCL_OK) {
return TCL_ERROR;
}
switch ((enum updateOptions) optionIndex) {
switch ((enum updateOptionsEnum) optionIndex) {
case OPT_IDLETASKS:
flags = TCL_WINDOW_EVENTS|TCL_IDLE_EVENTS|TCL_DONT_WAIT;
break;
+44 -24
View File
@@ -855,8 +855,8 @@ TclCreateExecEnv(
* [sizeof(Tcl_Obj*)] */
{
ExecEnv *eePtr = (ExecEnv *)ckalloc(sizeof(ExecEnv));
ExecStack *esPtr = (ExecStack *)ckalloc(sizeof(ExecStack)
+ (size_t) (size-1) * sizeof(Tcl_Obj *));
ExecStack *esPtr = (ExecStack *)ckalloc(offsetof(ExecStack, stackWords)
+ size * sizeof(Tcl_Obj *));
eePtr->execStackPtr = esPtr;
TclNewIntObj(eePtr->constants[0], 0);
@@ -1121,7 +1121,7 @@ GrowEvaluationStack(
newElems = needed;
#endif
newBytes = sizeof(ExecStack) + (newElems-1) * sizeof(Tcl_Obj *);
newBytes = offsetof(ExecStack, stackWords) + newElems * sizeof(Tcl_Obj *);
oldPtr = esPtr;
esPtr = (ExecStack *)ckalloc(newBytes);
@@ -3736,7 +3736,7 @@ TEBCresume(
TRACE(("%u %ld => ", opnd, increment));
if (Tcl_IsShared(objPtr)) {
objPtr->refCount--; /* We know it's shared. */
objResultPtr = Tcl_NewWideIntObj(w+increment);
TclNewIntObj(objResultPtr, w + increment);
Tcl_IncrRefCount(objResultPtr);
varPtr->value.objPtr = objResultPtr;
} else {
@@ -4529,7 +4529,7 @@ TEBCresume(
origCmd = TclGetOriginalCommand(cmd);
if (origCmd == NULL) {
origCmd = cmd;
}
}
TclNewObj(objResultPtr);
Tcl_GetCommandFullName(interp, origCmd, objResultPtr);
@@ -4863,13 +4863,19 @@ TEBCresume(
*/
if ((TclListObjGetElements(interp, valuePtr, &objc, &objv) == TCL_OK)
&& !TclHasIntRep(value2Ptr, &tclListType)
&& (TclGetIntForIndexM(NULL, value2Ptr, objc-1,
&index) == TCL_OK)) {
TclDecrRefCount(value2Ptr);
tosPtr--;
pcAdjustment = 1;
goto lindexFastPath;
&& !TclHasIntRep(value2Ptr, &tclListType)) {
int code;
DECACHE_STACK_INFO();
code = TclGetIntForIndexM(interp, value2Ptr, objc-1, &index);
CACHE_STACK_INFO();
if (code == TCL_OK) {
TclDecrRefCount(value2Ptr);
tosPtr--;
pcAdjustment = 1;
goto lindexFastPath;
}
Tcl_ResetResult(interp);
}
objResultPtr = TclLindexList(interp, valuePtr, value2Ptr);
@@ -5070,7 +5076,7 @@ TEBCresume(
if (toIdx == TCL_INDEX_NONE) {
emptyList:
objResultPtr = Tcl_NewObj();
TclNewObj(objResultPtr);
TRACE_APPEND(("\"%.30s\"", O2S(objResultPtr)));
NEXT_INST_F(9, 1, 1);
}
@@ -5304,10 +5310,13 @@ TEBCresume(
*/
length = Tcl_GetCharLength(valuePtr);
DECACHE_STACK_INFO();
if (TclGetIntForIndexM(interp, value2Ptr, length-1, &index)!=TCL_OK) {
CACHE_STACK_INFO();
TRACE_ERROR(interp);
goto gotError;
}
CACHE_STACK_INFO();
if ((index < 0) || (index >= length)) {
TclNewObj(objResultPtr);
@@ -5327,7 +5336,7 @@ TEBCresume(
* practical use.
*/
if (ch == -1) {
objResultPtr = Tcl_NewObj();
TclNewObj(objResultPtr);
} else {
length = Tcl_UniCharToUtf(ch, buf);
if ((ch >= 0xD800) && (length < 3)) {
@@ -5344,13 +5353,21 @@ TEBCresume(
TRACE(("\"%.20s\" %.20s %.20s =>",
O2S(OBJ_AT_DEPTH(2)), O2S(OBJ_UNDER_TOS), O2S(OBJ_AT_TOS)));
length = Tcl_GetCharLength(OBJ_AT_DEPTH(2)) - 1;
DECACHE_STACK_INFO();
if (TclGetIntForIndexM(interp, OBJ_UNDER_TOS, length,
&fromIdx) != TCL_OK
|| TclGetIntForIndexM(interp, OBJ_AT_TOS, length,
&toIdx) != TCL_OK) {
&fromIdx) != TCL_OK) {
CACHE_STACK_INFO();
TRACE_ERROR(interp);
goto gotError;
}
if (TclGetIntForIndexM(interp, OBJ_AT_TOS, length,
&toIdx) != TCL_OK) {
CACHE_STACK_INFO();
TRACE_ERROR(interp);
goto gotError;
}
CACHE_STACK_INFO();
if (fromIdx < 0) {
fromIdx = 0;
@@ -5433,14 +5450,17 @@ TEBCresume(
endIdx = Tcl_GetCharLength(valuePtr) - 1;
TRACE(("\"%.20s\" %s %s \"%.20s\" => ", O2S(valuePtr),
O2S(OBJ_UNDER_TOS), O2S(OBJ_AT_TOS), O2S(value3Ptr)));
DECACHE_STACK_INFO();
if (TclGetIntForIndexM(interp, OBJ_UNDER_TOS, endIdx,
&fromIdx) != TCL_OK
|| TclGetIntForIndexM(interp, OBJ_AT_TOS, endIdx,
&toIdx) != TCL_OK) {
CACHE_STACK_INFO();
TclDecrRefCount(value3Ptr);
TRACE_ERROR(interp);
goto gotError;
}
CACHE_STACK_INFO();
TclDecrRefCount(OBJ_AT_TOS);
(void) POP_OBJECT();
TclDecrRefCount(OBJ_AT_TOS);
@@ -6136,7 +6156,7 @@ TEBCresume(
wideResultOfArithmetic:
TRACE(("%s %s => ", O2S(valuePtr), O2S(value2Ptr)));
if (Tcl_IsShared(valuePtr)) {
objResultPtr = Tcl_NewWideIntObj(wResult);
TclNewIntObj(objResultPtr, wResult);
TRACE(("%s\n", O2S(objResultPtr)));
NEXT_INST_F(1, 2, 1);
}
@@ -6407,8 +6427,8 @@ TEBCresume(
if (TclHasIntRep(valuePtr, &tclBooleanType)) {
objResultPtr = TCONST(1);
} else {
int result = (TclSetBooleanFromAny(NULL, valuePtr) == TCL_OK);
objResultPtr = TCONST(result);
int res = (TclSetBooleanFromAny(NULL, valuePtr) == TCL_OK);
objResultPtr = TCONST(res);
}
TRACE_WITH_OBJ(("\"%.30s\" => ", O2S(valuePtr)), objResultPtr);
NEXT_INST_F(1, 0, 1);
@@ -6602,7 +6622,7 @@ TEBCresume(
}
{
ForeachInfo *infoPtr;
Tcl_Obj *listPtr, **elements, *tmpPtr;
Tcl_Obj *listPtr, **elements;
ForeachVarList *varListPtr;
int numLists, listLen, numVars;
int listTmpDepth;
@@ -7026,7 +7046,7 @@ TEBCresume(
break;
}
if (valuePtr == NULL) {
Tcl_DictObjPut(NULL, dictPtr, OBJ_AT_TOS,Tcl_NewIntObj(opnd));
Tcl_DictObjPut(NULL, dictPtr, OBJ_AT_TOS, Tcl_NewWideIntObj(opnd));
} else {
TclNewIntObj(value2Ptr, opnd);
Tcl_IncrRefCount(value2Ptr);
@@ -7544,7 +7564,7 @@ TEBCresume(
default:
Tcl_Panic("clockRead instruction with unknown clock#");
}
objResultPtr = Tcl_NewWideIntObj(wval);
TclNewIntObj(objResultPtr, wval);
TRACE_WITH_OBJ(("=> "), objResultPtr);
NEXT_INST_F(2, 0, 1);
}
@@ -9699,7 +9719,7 @@ EvalStatsCmd(
#define Percent(a,b) ((a) * 100.0 / (b))
objPtr = Tcl_NewObj();
TclNewObj(objPtr);
Tcl_IncrRefCount(objPtr);
numInstructions = 0.0;
+1 -1
View File
@@ -904,7 +904,7 @@ FileBasename(
}
}
if (resultPtr == NULL) {
resultPtr = Tcl_NewObj();
TclNewObj(resultPtr);
}
Tcl_IncrRefCount(resultPtr);
Tcl_DecrRefCount(splitPtr);
+18 -8
View File
@@ -587,7 +587,8 @@ Tcl_SplitPath(
* plus the argv pointers and the terminating NULL pointer.
*/
*argvPtr = (const char **)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
@@ -644,12 +645,13 @@ SplitUnixPath(
{
int length;
const char *origPath = path, *elementStart;
Tcl_Obj *result = Tcl_NewObj();
Tcl_Obj *result;
/*
* Deal with the root directory as a special case.
*/
TclNewObj(result);
if (*path == '/') {
Tcl_Obj *rootElt;
++path;
@@ -735,9 +737,10 @@ SplitWinPath(
const char *p, *elementStart;
Tcl_PathType type = TCL_PATH_ABSOLUTE;
Tcl_DString buf;
Tcl_Obj *result = Tcl_NewObj();
Tcl_Obj *result;
Tcl_DStringInit(&buf);
TclNewObj(result);
p = ExtractWinRoot(path, &buf, 0, &type);
/*
@@ -977,7 +980,7 @@ Tcl_JoinPath(
Tcl_DString *resultPtr) /* Pointer to previously initialized DString */
{
int i, len;
Tcl_Obj *listObj = Tcl_NewObj();
Tcl_Obj *listObj;
Tcl_Obj *resultObj;
const char *resultStr;
@@ -985,6 +988,7 @@ Tcl_JoinPath(
* Build the list of paths.
*/
TclNewObj(listObj);
for (i = 0; i < argc; i++) {
Tcl_ListObjAppendElement(NULL, listObj,
Tcl_NewStringObj(argv[i], -1));
@@ -1234,7 +1238,7 @@ Tcl_GlobObjCmd(
"-directory", "-join", "-nocomplain", "-path", "-tails",
"-types", "--", NULL
};
enum options {
enum globOptionsEnum {
GLOB_DIR, GLOB_JOIN, GLOB_NOCOMPLAIN, GLOB_PATH, GLOB_TAILS,
GLOB_TYPE, GLOB_LAST
};
@@ -1267,7 +1271,7 @@ Tcl_GlobObjCmd(
}
}
switch (index) {
switch ((enum globOptionsEnum) index) {
case GLOB_NOCOMPLAIN: /* -nocomplain */
globFlags |= TCL_GLOBMODE_NO_COMPLAIN;
break;
@@ -1280,7 +1284,10 @@ Tcl_GlobObjCmd(
}
if (dir != PATH_NONE) {
Tcl_SetObjResult(interp, Tcl_NewStringObj(
"\"-directory\" cannot be used with \"-path\"", -1));
dir == PATH_DIR
? "\"-directory\" may only be used once"
: "\"-directory\" cannot be used with \"-path\"",
-1));
Tcl_SetErrorCode(interp, "TCL", "OPERATION", "GLOB",
"BADOPTIONCOMBINATION", NULL);
return TCL_ERROR;
@@ -1305,7 +1312,10 @@ Tcl_GlobObjCmd(
}
if (dir != PATH_NONE) {
Tcl_SetObjResult(interp, Tcl_NewStringObj(
"\"-path\" cannot be used with \"-directory\"", -1));
dir == PATH_GENERAL
? "\"-path\" may only be used once"
: "\"-path\" cannot be used with \"-dictionary\"",
-1));
Tcl_SetErrorCode(interp, "TCL", "OPERATION", "GLOB",
"BADOPTIONCOMBINATION", NULL);
return TCL_ERROR;
+7 -7
View File
@@ -1002,7 +1002,7 @@ TclClockOldscanObjCmd(
yyHaveRel = 0;
yyRelMonth = 0; yyRelDay = 0; yyRelSeconds = 0; yyRelPointer = NULL;
dateInfo.messages = Tcl_NewObj();
TclNewObj(dateInfo.messages);
dateInfo.separatrix = "";
Tcl_IncrRefCount(dateInfo.messages);
@@ -1059,8 +1059,8 @@ TclClockOldscanObjCmd(
return TCL_ERROR;
}
result = Tcl_NewObj();
resultElement = Tcl_NewObj();
TclNewObj(result);
TclNewObj(resultElement);
if (yyHaveDate) {
Tcl_ListObjAppendElement(interp, resultElement,
Tcl_NewIntObj((int) yyYear));
@@ -1078,7 +1078,7 @@ TclClockOldscanObjCmd(
Tcl_ListObjAppendElement(interp, result, Tcl_NewObj());
}
resultElement = Tcl_NewObj();
TclNewObj(resultElement);
if (yyHaveZone) {
Tcl_ListObjAppendElement(interp, resultElement,
Tcl_NewIntObj((int) -yyTimezone));
@@ -1087,7 +1087,7 @@ TclClockOldscanObjCmd(
}
Tcl_ListObjAppendElement(interp, result, resultElement);
resultElement = Tcl_NewObj();
TclNewObj(resultElement);
if (yyHaveRel) {
Tcl_ListObjAppendElement(interp, resultElement,
Tcl_NewIntObj((int) yyRelMonth));
@@ -1098,7 +1098,7 @@ TclClockOldscanObjCmd(
}
Tcl_ListObjAppendElement(interp, result, resultElement);
resultElement = Tcl_NewObj();
TcNewObj(resultElement);
if (yyHaveDay && !yyHaveDate) {
Tcl_ListObjAppendElement(interp, resultElement,
Tcl_NewIntObj((int) yyDayOrdinal));
@@ -1107,7 +1107,7 @@ TclClockOldscanObjCmd(
}
Tcl_ListObjAppendElement(interp, result, resultElement);
resultElement = Tcl_NewObj();
TclNewObj(resultElement);
if (yyHaveOrdinalMonth) {
Tcl_ListObjAppendElement(interp, resultElement,
Tcl_NewIntObj((int) yyMonthOrdinal));
+4 -4
View File
@@ -287,9 +287,9 @@ static int WillRead(Channel *chanPtr);
#define IsBufferOverflowing(bufPtr) ((bufPtr)->nextAdded>(bufPtr)->bufLength)
#define InsertPoint(bufPtr) ((bufPtr)->buf + (bufPtr)->nextAdded)
#define InsertPoint(bufPtr) (&(bufPtr)->buf[(bufPtr)->nextAdded])
#define RemovePoint(bufPtr) ((bufPtr)->buf + (bufPtr)->nextRemoved)
#define RemovePoint(bufPtr) (&(bufPtr)->buf[(bufPtr)->nextRemoved])
/*
* For working with channel state flag bits.
@@ -11130,7 +11130,7 @@ FixLevelCode(
if (0 == strcmp(TclGetString(lv[i]), "-level")) {
if (newlevel >= 0) {
lvn[j++] = lv[i];
lvn[j++] = Tcl_NewIntObj(newlevel);
lvn[j++] = Tcl_NewWideIntObj(newlevel);
newlevel = -1;
lignore = 1;
continue;
@@ -11140,7 +11140,7 @@ FixLevelCode(
} else if (0 == strcmp(TclGetString(lv[i]), "-code")) {
if (newcode >= 0) {
lvn[j++] = lv[i];
lvn[j++] = Tcl_NewIntObj(newcode);
lvn[j++] = Tcl_NewWideIntObj(newcode);
newcode = -1;
cignore = 1;
continue;
+1 -1
View File
@@ -44,7 +44,7 @@ typedef struct ChannelBuffer {
int bufLength; /* How big is the buffer? */
struct ChannelBuffer *nextPtr;
/* Next buffer in chain. */
char buf[1]; /* Placeholder for real buffer. The real
char buf[TCLFLEXARRAY]; /* Placeholder for real buffer. The real
* buffer occuppies this space + bufSize-1
* bytes. This must be the last field in the
* structure. */
+15 -15
View File
@@ -314,7 +314,7 @@ Tcl_GetsObjCmd(
}
TclChannelPreserve(chan);
linePtr = Tcl_NewObj();
TclNewObj(linePtr);
lineLen = Tcl_GetsObj(chan, linePtr);
if (lineLen < 0) {
if (!Tcl_Eof(chan) && !Tcl_InputBlocked(chan)) {
@@ -343,7 +343,7 @@ Tcl_GetsObjCmd(
code = TCL_ERROR;
goto done;
}
Tcl_SetObjResult(interp, Tcl_NewIntObj(lineLen));
Tcl_SetObjResult(interp, Tcl_NewWideIntObj(lineLen));
} else {
Tcl_SetObjResult(interp, linePtr);
}
@@ -453,7 +453,7 @@ Tcl_ReadObjCmd(
}
}
resultPtr = Tcl_NewObj();
TclNewObj(resultPtr);
Tcl_IncrRefCount(resultPtr);
TclChannelPreserve(chan);
charactersRead = Tcl_ReadChars(chan, resultPtr, toRead, 0);
@@ -888,7 +888,7 @@ Tcl_ExecObjCmd(
static const char *const options[] = {
"-ignorestderr", "-keepnewline", "--", NULL
};
enum options {
enum execOptionsEnum {
EXEC_IGNORESTDERR, EXEC_KEEPNEWLINE, EXEC_LAST
};
@@ -975,7 +975,7 @@ Tcl_ExecObjCmd(
return TCL_OK;
}
resultPtr = Tcl_NewObj();
TclNewObj(resultPtr);
if (Tcl_GetChannelHandle(chan, TCL_READABLE, NULL) == TCL_OK) {
if (Tcl_ReadChars(chan, resultPtr, -1, 0) == TCL_IO_FAILURE) {
/*
@@ -1363,7 +1363,7 @@ AcceptCallbackProc(
Tcl_ListObjAppendElement(NULL, objv[1], Tcl_NewStringObj(
Tcl_GetChannelName(chan), -1));
Tcl_ListObjAppendElement(NULL, objv[1], Tcl_NewStringObj(address, -1));
Tcl_ListObjAppendElement(NULL, objv[1], Tcl_NewIntObj(port));
Tcl_ListObjAppendElement(NULL, objv[1], Tcl_NewWideIntObj(port));
script = Tcl_ConcatObj(2, objv);
Tcl_IncrRefCount(script);
@@ -1470,7 +1470,7 @@ Tcl_SocketObjCmd(
"-async", "-myaddr", "-myport", "-reuseaddr", "-reuseport", "-server",
NULL
};
enum socketOptions {
enum socketOptionsEnum {
SKT_ASYNC, SKT_MYADDR, SKT_MYPORT, SKT_REUSEADDR, SKT_REUSEPORT,
SKT_SERVER
};
@@ -1495,7 +1495,7 @@ Tcl_SocketObjCmd(
TCL_EXACT, &optionIndex) != TCL_OK) {
return TCL_ERROR;
}
switch ((enum socketOptions) optionIndex) {
switch ((enum socketOptionsEnum) optionIndex) {
case SKT_ASYNC:
if (server == 1) {
Tcl_SetObjResult(interp, Tcl_NewStringObj(
@@ -1806,7 +1806,7 @@ ChanPendingObjCmd(
Tcl_Channel chan;
int index, mode;
static const char *const options[] = {"input", "output", NULL};
enum options {PENDING_INPUT, PENDING_OUTPUT};
enum pendingOptionsEnum {PENDING_INPUT, PENDING_OUTPUT};
if (objc != 3) {
Tcl_WrongNumArgs(interp, 1, objv, "mode channelId");
@@ -1822,19 +1822,19 @@ ChanPendingObjCmd(
return TCL_ERROR;
}
switch ((enum options) index) {
switch ((enum pendingOptionsEnum) index) {
case PENDING_INPUT:
if (!(mode & TCL_READABLE)) {
Tcl_SetObjResult(interp, Tcl_NewIntObj(-1));
Tcl_SetObjResult(interp, Tcl_NewWideIntObj(-1));
} else {
Tcl_SetObjResult(interp, Tcl_NewIntObj(Tcl_InputBuffered(chan)));
Tcl_SetObjResult(interp, Tcl_NewWideIntObj(Tcl_InputBuffered(chan)));
}
break;
case PENDING_OUTPUT:
if (!(mode & TCL_WRITABLE)) {
Tcl_SetObjResult(interp, Tcl_NewIntObj(-1));
Tcl_SetObjResult(interp, Tcl_NewWideIntObj(-1));
} else {
Tcl_SetObjResult(interp, Tcl_NewIntObj(Tcl_OutputBuffered(chan)));
Tcl_SetObjResult(interp, Tcl_NewWideIntObj(Tcl_OutputBuffered(chan)));
}
break;
}
@@ -1954,7 +1954,7 @@ ChanPipeObjCmd(
channelNames[0] = Tcl_GetChannelName(rchan);
channelNames[1] = Tcl_GetChannelName(wchan);
resultPtr = Tcl_NewObj();
TclNewObj(resultPtr);
Tcl_ListObjAppendElement(NULL, resultPtr,
Tcl_NewStringObj(channelNames[0], -1));
Tcl_ListObjAppendElement(NULL, resultPtr,
+12 -9
View File
@@ -1591,7 +1591,7 @@ ReflectSeekWide(
Tcl_Preserve(rcPtr);
offObj = Tcl_NewWideIntObj(offset);
TclNewIntObj(offObj, offset);
baseObj = Tcl_NewStringObj(
(seekMode == SEEK_SET) ? "start" :
(seekMode == SEEK_CUR) ? "current" : "end", -1);
@@ -3052,7 +3052,7 @@ ForwardProc(
TclNewIntObj(toReadObj, paramPtr->input.toRead);
Tcl_IncrRefCount(toReadObj);
Tcl_Preserve(rcPtr);
Tcl_Preserve(rcPtr);
if (InvokeTclMethod(rcPtr, METH_READ, toReadObj, NULL, &resObj)!=TCL_OK){
int code = ErrnoReturn(rcPtr, resObj);
@@ -3127,15 +3127,18 @@ ForwardProc(
}
case ForwardedSeek: {
Tcl_Obj *offObj = Tcl_NewWideIntObj(paramPtr->seek.offset);
Tcl_Obj *baseObj = Tcl_NewStringObj(
(paramPtr->seek.seekMode==SEEK_SET) ? "start" :
(paramPtr->seek.seekMode==SEEK_CUR) ? "current" : "end", -1);
Tcl_Obj *offObj;
Tcl_Obj *baseObj;
Tcl_IncrRefCount(offObj);
Tcl_IncrRefCount(baseObj);
TclNewIntObj(offObj, paramPtr->seek.offset);
baseObj = Tcl_NewStringObj(
(paramPtr->seek.seekMode==SEEK_SET) ? "start" :
(paramPtr->seek.seekMode==SEEK_CUR) ? "current" : "end", -1);
Tcl_Preserve(rcPtr);
Tcl_IncrRefCount(offObj);
Tcl_IncrRefCount(baseObj);
Tcl_Preserve(rcPtr);
if (InvokeTclMethod(rcPtr, METH_SEEK, offObj, baseObj, &resObj)!=TCL_OK){
ForwardSetObjError(paramPtr, resObj);
paramPtr->seek.offset = -1;
+1 -1
View File
@@ -1219,7 +1219,7 @@ ReflectInput(
}
if (Tcl_IsShared(bufObj)) {
Tcl_DecrRefCount(bufObj);
bufObj = Tcl_NewObj();
TclNewObj(bufObj);
Tcl_IncrRefCount(bufObj);
}
Tcl_SetByteArrayLength(bufObj, 0);
+25 -24
View File
@@ -1684,7 +1684,7 @@ Tcl_FSEvalFileEx(
* Tilde-substitution is performed on this
* pathname. */
const char *encodingName) /* Either the name of an encoding or NULL to
use the system encoding. */
use the utf-8 encoding. */
{
int length, result = TCL_ERROR;
Tcl_StatBuf statBuf;
@@ -1722,19 +1722,19 @@ Tcl_FSEvalFileEx(
/*
* If the encoding is specified, set the channel to that encoding.
* Otherwise don't touch it, leaving things up to the system encoding. If
* the encoding is unknown report an error.
* Otherwise use utf-8. If the encoding is unknown report an error.
*/
if (encodingName != NULL) {
if (Tcl_SetChannelOption(interp, chan, "-encoding", encodingName)
!= TCL_OK) {
Tcl_Close(interp,chan);
return result;
}
if (encodingName == NULL) {
encodingName = "utf-8";
}
if (Tcl_SetChannelOption(interp, chan, "-encoding", encodingName)
!= TCL_OK) {
Tcl_Close(interp,chan);
return result;
}
objPtr = Tcl_NewObj();
TclNewObj(objPtr);
Tcl_IncrRefCount(objPtr);
/*
@@ -1821,7 +1821,7 @@ TclNREvalFile(
* evaluate. Tilde-substitution is performed on
* this pathname. */
const char *encodingName) /* The name of an encoding to use, or NULL to
* use the system encoding. */
* use the utf-8 encoding. */
{
Tcl_StatBuf statBuf;
Tcl_Obj *oldScriptFile, *objPtr;
@@ -1858,19 +1858,19 @@ TclNREvalFile(
/*
* If the encoding is specified, set the channel to that encoding.
* Otherwise don't touch it, leaving things up to the system encoding. If
* the encoding is unknown report an error.
* Otherwise use utf-8. If the encoding is unknown report an error.
*/
if (encodingName != NULL) {
if (Tcl_SetChannelOption(interp, chan, "-encoding", encodingName)
!= TCL_OK) {
Tcl_Close(interp,chan);
return TCL_ERROR;
}
if (encodingName == NULL) {
encodingName = "utf-8";
}
if (Tcl_SetChannelOption(interp, chan, "-encoding", encodingName)
!= TCL_OK) {
Tcl_Close(interp, chan);
return TCL_ERROR;
}
objPtr = Tcl_NewObj();
TclNewObj(objPtr);
Tcl_IncrRefCount(objPtr);
/*
@@ -3173,7 +3173,7 @@ Tcl_LoadFile(
}
if (fsPtr->loadFileProc != NULL) {
int retVal = ((Tcl_FSLoadFileProc2 *)(void *)(fsPtr->loadFileProc))
retVal = ((Tcl_FSLoadFileProc2 *)(void *)(fsPtr->loadFileProc))
(interp, pathPtr, handlePtr, &unloadProcPtr, flags);
if (retVal == TCL_OK) {
@@ -3765,7 +3765,7 @@ Tcl_Obj *
Tcl_FSListVolumes(void)
{
FilesystemRecord *fsRecPtr;
Tcl_Obj *resultPtr = Tcl_NewObj();
Tcl_Obj *resultPtr;
/*
* Call each "listVolumes" function of each registered filesystem in
@@ -3773,6 +3773,7 @@ Tcl_FSListVolumes(void)
* has succeeded.
*/
TclNewObj(resultPtr);
fsRecPtr = FsGetFirstFilesystem();
Claim();
while (fsRecPtr != NULL) {
@@ -3832,7 +3833,7 @@ FsListMounts(
if (fsRecPtr->fsPtr != &tclNativeFilesystem &&
fsRecPtr->fsPtr->matchInDirectoryProc != NULL) {
if (resultPtr == NULL) {
resultPtr = Tcl_NewObj();
TclNewObj(resultPtr);
}
fsRecPtr->fsPtr->matchInDirectoryProc(NULL, resultPtr, pathPtr,
pattern, &mountsOnly);
@@ -3903,7 +3904,7 @@ Tcl_FSSplitPath(
* For example, 'ftp://' is a valid drive name.
*/
result = Tcl_NewObj();
TclNewObj(result);
p = Tcl_GetString(pathPtr);
Tcl_ListObjAppendElement(NULL, result,
Tcl_NewStringObj(p, driveNameLength));
+3 -3
View File
@@ -553,7 +553,7 @@ PrefixMatchObjCmd(
static const char *const matchOptions[] = {
"-error", "-exact", "-message", NULL
};
enum matchOptions {
enum matchOptionsEnum {
PRFMATCH_ERROR, PRFMATCH_EXACT, PRFMATCH_MESSAGE
};
@@ -567,7 +567,7 @@ PrefixMatchObjCmd(
&index) != TCL_OK) {
return TCL_ERROR;
}
switch ((enum matchOptions) index) {
switch ((enum matchOptionsEnum) index) {
case PRFMATCH_EXACT:
flags |= TCL_EXACT;
break;
@@ -633,7 +633,7 @@ PrefixMatchObjCmd(
}
Tcl_ListObjAppendElement(interp, errorPtr,
Tcl_NewStringObj("-code", 5));
Tcl_ListObjAppendElement(interp, errorPtr, Tcl_NewIntObj(result));
Tcl_ListObjAppendElement(interp, errorPtr, Tcl_NewWideIntObj(result));
return Tcl_SetReturnOptions(interp, errorPtr);
}
+21 -11
View File
@@ -925,6 +925,12 @@ typedef struct VarInHash {
*----------------------------------------------------------------
*/
#if defined(__GNUC__) && (__GNUC__ > 2)
# define TCLFLEXARRAY 0
#else
# define TCLFLEXARRAY 1
#endif
/*
* Forward declaration to prevent an error when the forward reference to
* Command is encountered in the Proc and ImportRef types declared below.
@@ -968,7 +974,7 @@ typedef struct CompiledLocal {
* is marked by a unique tag during
* compilation, and that same tag is used to
* find the variable at runtime. */
char name[1]; /* Name of the local variable starts here. If
char name[TCLFLEXARRAY]; /* Name of the local variable starts here. If
* the name is NULL, this will just be '\0'.
* The actual size of this field will be large
* enough to hold the name. MUST BE THE LAST
@@ -1306,7 +1312,7 @@ typedef struct CFWordBC {
typedef struct ContLineLoc {
int num; /* Number of entries in loc, not counting the
* final -1 marker entry. */
int loc[1]; /* Table of locations, as character offsets.
int loc[TCLFLEXARRAY];/* Table of locations, as character offsets.
* The table is allocated as part of the
* structure, extending behind the nominal end
* of the structure. An entry containing the
@@ -1455,7 +1461,7 @@ typedef struct ExecStack {
Tcl_Obj **markerPtr;
Tcl_Obj **endPtr;
Tcl_Obj **tosPtr;
Tcl_Obj *stackWords[1];
Tcl_Obj *stackWords[TCLFLEXARRAY];
} ExecStack;
/*
@@ -4512,12 +4518,15 @@ MODULE_SCOPE void TclDbInitNewObj(Tcl_Obj *objPtr, const char *file,
*/
#define TclInvalidateStringRep(objPtr) \
if ((objPtr)->bytes != NULL) { \
if ((objPtr)->bytes != &tclEmptyString) { \
ckfree((objPtr)->bytes); \
do { \
Tcl_Obj *_isobjPtr = (Tcl_Obj *)(objPtr); \
if (_isobjPtr->bytes != NULL) { \
if (_isobjPtr->bytes != &tclEmptyString) { \
ckfree((char *)_isobjPtr->bytes); \
} \
_isobjPtr->bytes = NULL; \
} \
(objPtr)->bytes = NULL; \
}
} while (0)
/*
* These form part of the native filesystem support. They are needed here
@@ -4544,7 +4553,8 @@ MODULE_SCOPE const TclFileAttrProcs tclpFileAttrProcs[];
*----------------------------------------------------------------
*/
#define TclHasStringRep(objPtr) ((objPtr)->bytes != NULL)
#define TclHasStringRep(objPtr) \
((objPtr)->bytes != NULL)
/*
*----------------------------------------------------------------
@@ -4926,7 +4936,7 @@ MODULE_SCOPE Tcl_PackageInitProc Procbodytest_SafeInit;
* Computes number of bytes from beginning of structure to a given field.
*/
#ifndef TCL_NO_DEPRECATED
#if !defined(TCL_NO_DEPRECATED) && !defined(BUILD_tcl)
# define TclOffset(type, field) ((int) offsetof(type, field))
#endif
/* Workaround for platforms missing offsetof(), e.g. VC++ 6.0 */
@@ -4971,7 +4981,7 @@ MODULE_SCOPE Tcl_PackageInitProc Procbodytest_SafeInit;
} \
(location) = (cmdPtr); \
} while (0)
#define TclRoutineHasName(cmdPtr) \
((cmdPtr)->hPtr != NULL)
+5
View File
@@ -1413,4 +1413,9 @@ extern const TclIntStubs *tclIntStubsPtr;
# define Tcl_StaticPackage (tclIntStubsPtr->tclStaticPackage)
#endif
#undef TclGuessPackageName
#ifndef TCL_NO_DEPRECATED
# define TclGuessPackageName(fileName, pkgName) ((void)fileName,(void)pkgName,0)
#endif
#endif /* _TCLINTDECLS */
+1 -1
View File
@@ -602,7 +602,7 @@ extern const TclIntPlatStubs *tclIntPlatStubsPtr;
# endif /* TCL_NO_DEPRECATED */
#else
# undef TclpGetPid
# define TclpGetPid(pid) ((unsigned long) (pid))
# define TclpGetPid(pid) ((int)(size_t)(pid))
#endif
#endif /* _TCLINTPLATDECLS */
+33 -20
View File
@@ -123,7 +123,7 @@ typedef struct Target {
*
* NB: the flags field in the interp structure, used with SAFE_INTERP mask
* denotes whether the interpreter is safe or not. Safe interpreters have
* restricted functionality, can only create safe child interpreters and can
* restricted functionality, can only create safe interpreters and can
* only load safe extensions.
*/
@@ -619,32 +619,43 @@ NRInterpCmd(
Tcl_Interp *childInterp;
int index;
static const char *const options[] = {
"alias", "aliases", "bgerror", "cancel",
"children", "create", "debug", "delete",
"eval", "exists", "expose", "hide",
"hidden", "issafe", "invokehidden",
"limit", "marktrusted", "recursionlimit",
"share", "slaves", "target", "transfer",
NULL
};
static const char *const optionsNoSlaves[] = {
"alias", "aliases", "bgerror", "cancel",
"children", "create", "debug", "delete",
"eval", "exists", "expose",
"hide", "hidden", "issafe",
"invokehidden", "limit", "marktrusted", "recursionlimit",
"slaves", "share", "target", "transfer",
NULL
"share", "target", "transfer", NULL
};
enum option {
enum interpOptionEnum {
OPT_ALIAS, OPT_ALIASES, OPT_BGERROR, OPT_CANCEL,
OPT_CHILDREN, OPT_CREATE, OPT_DEBUG, OPT_DELETE,
OPT_EVAL, OPT_EXISTS, OPT_EXPOSE,
OPT_HIDE, OPT_HIDDEN, OPT_ISSAFE,
OPT_INVOKEHID, OPT_LIMIT, OPT_MARKTRUSTED,OPT_RECLIMIT,
OPT_SLAVES, OPT_SHARE, OPT_TARGET, OPT_TRANSFER
OPT_EVAL, OPT_EXISTS, OPT_EXPOSE, OPT_HIDE,
OPT_HIDDEN, OPT_ISSAFE, OPT_INVOKEHID,
OPT_LIMIT, OPT_MARKTRUSTED,OPT_RECLIMIT,
OPT_SHARE, OPT_SLAVES, OPT_TARGET, OPT_TRANSFER
};
if (objc < 2) {
Tcl_WrongNumArgs(interp, 1, objv, "cmd ?arg ...?");
return TCL_ERROR;
}
if (Tcl_GetIndexFromObj(interp, objv[1], options, "option", 0,
&index) != TCL_OK) {
if (Tcl_GetIndexFromObj(NULL, objv[1], options,
"option", 0, &index) != TCL_OK) {
/* Don't report the "slaves" option as possibility */
Tcl_GetIndexFromObj(interp, objv[1], optionsNoSlaves,
"option", 0, &index);
return TCL_ERROR;
}
switch ((enum option) index) {
switch ((enum interpOptionEnum)index) {
case OPT_ALIAS: {
Tcl_Interp *parentInterp;
@@ -697,7 +708,7 @@ NRInterpCmd(
static const char *const cancelOptions[] = {
"-unwind", "--", NULL
};
enum option {
enum optionCancelEnum {
OPT_UNWIND, OPT_LAST
};
@@ -712,7 +723,7 @@ NRInterpCmd(
return TCL_ERROR;
}
switch ((enum option) index) {
switch ((enum optionCancelEnum) index) {
case OPT_UNWIND:
/*
* The evaluation stack in the target interp is to be unwound.
@@ -1030,7 +1041,7 @@ NRInterpCmd(
return TCL_ERROR;
}
iiPtr = (InterpInfo *) ((Interp *) childInterp)->interpInfo;
resultPtr = Tcl_NewObj();
TclNewObj(resultPtr);
hPtr = Tcl_FirstHashEntry(&iiPtr->parent.childTable, &hashSearch);
for ( ; hPtr != NULL; hPtr = Tcl_NextHashEntry(&hashSearch)) {
string = (char *)Tcl_GetHashKey(&iiPtr->parent.childTable, hPtr);
@@ -1757,10 +1768,11 @@ AliasList(
{
Tcl_HashEntry *entryPtr;
Tcl_HashSearch hashSearch;
Tcl_Obj *resultPtr = Tcl_NewObj();
Tcl_Obj *resultPtr;
Alias *aliasPtr;
Child *childPtr;
TclNewObj(resultPtr);
childPtr = &((InterpInfo *) ((Interp *) childInterp)->interpInfo)->child;
entryPtr = Tcl_FirstHashEntry(&childPtr->aliasTable, &hashSearch);
@@ -2550,7 +2562,7 @@ NRChildCmd(
"issafe", "invokehidden", "limit", "marktrusted",
"recursionlimit", NULL
};
enum options {
enum childCmdOptionsEnum {
OPT_ALIAS, OPT_ALIASES, OPT_BGERROR, OPT_DEBUG,
OPT_EVAL, OPT_EXPOSE, OPT_HIDE, OPT_HIDDEN,
OPT_ISSAFE, OPT_INVOKEHIDDEN, OPT_LIMIT, OPT_MARKTRUSTED,
@@ -2570,7 +2582,7 @@ NRChildCmd(
return TCL_ERROR;
}
switch ((enum options) index) {
switch ((enum childCmdOptionsEnum) index) {
case OPT_ALIAS:
if (objc > 2) {
if (objc == 3) {
@@ -2806,7 +2818,7 @@ ChildDebugCmd(
iPtr = (Interp *) childInterp;
if (objc == 0) {
resultPtr = Tcl_NewObj();
TclNewObj(resultPtr);
Tcl_ListObjAppendElement(NULL, resultPtr,
Tcl_NewStringObj("-frame", -1));
Tcl_ListObjAppendElement(NULL, resultPtr,
@@ -3075,11 +3087,12 @@ ChildHidden(
Tcl_Interp *interp, /* Interp for data return. */
Tcl_Interp *childInterp) /* Interp whose hidden commands to query. */
{
Tcl_Obj *listObjPtr = Tcl_NewObj(); /* Local object pointer. */
Tcl_Obj *listObjPtr; /* Local object pointer. */
Tcl_HashTable *hTblPtr; /* For local searches. */
Tcl_HashEntry *hPtr; /* For local searches. */
Tcl_HashSearch hSearch; /* For local searches. */
TclNewObj(listObjPtr);
hTblPtr = ((Interp *) childInterp)->hiddenCmdTablePtr;
if (hTblPtr != NULL) {
for (hPtr = Tcl_FirstHashEntry(hTblPtr, &hSearch);
@@ -3286,7 +3299,7 @@ Tcl_MakeSafe(
*/
/*
* No env array in a safe child.
* No env array in a safe interpreter.
*/
Tcl_UnsetVar2(interp, "env", NULL, TCL_GLOBAL_ONLY);
+10 -10
View File
@@ -1303,13 +1303,13 @@ ObjValue(
return resultObj;
}
linkPtr->lastValue.i = LinkedVar(int);
return Tcl_NewIntObj(linkPtr->lastValue.i);
return Tcl_NewWideIntObj(linkPtr->lastValue.i);
case TCL_LINK_WIDE_INT:
if (linkPtr->flags & LINK_ALLOC_LAST) {
memcpy(linkPtr->lastValue.aryPtr, linkPtr->addr, linkPtr->bytes);
objv = (Tcl_Obj **)ckalloc(linkPtr->numElems * sizeof(Tcl_Obj *));
for (i=0; i < linkPtr->numElems; i++) {
objv[i] = Tcl_NewWideIntObj(linkPtr->lastValue.wPtr[i]);
TclNewIntObj(objv[i], linkPtr->lastValue.wPtr[i]);
}
resultObj = Tcl_NewListObj(linkPtr->numElems, objv);
ckfree(objv);
@@ -1355,7 +1355,7 @@ ObjValue(
return resultObj;
}
linkPtr->lastValue.c = LinkedVar(char);
return Tcl_NewIntObj(linkPtr->lastValue.c);
return Tcl_NewWideIntObj(linkPtr->lastValue.c);
case TCL_LINK_UCHAR:
if (linkPtr->flags & LINK_ALLOC_LAST) {
memcpy(linkPtr->lastValue.aryPtr, linkPtr->addr, linkPtr->bytes);
@@ -1368,7 +1368,7 @@ ObjValue(
return resultObj;
}
linkPtr->lastValue.uc = LinkedVar(unsigned char);
return Tcl_NewIntObj(linkPtr->lastValue.uc);
return Tcl_NewWideIntObj(linkPtr->lastValue.uc);
case TCL_LINK_SHORT:
if (linkPtr->flags & LINK_ALLOC_LAST) {
memcpy(linkPtr->lastValue.aryPtr, linkPtr->addr, linkPtr->bytes);
@@ -1381,7 +1381,7 @@ ObjValue(
return resultObj;
}
linkPtr->lastValue.s = LinkedVar(short);
return Tcl_NewIntObj(linkPtr->lastValue.s);
return Tcl_NewWideIntObj(linkPtr->lastValue.s);
case TCL_LINK_USHORT:
if (linkPtr->flags & LINK_ALLOC_LAST) {
memcpy(linkPtr->lastValue.aryPtr, linkPtr->addr, linkPtr->bytes);
@@ -1394,13 +1394,13 @@ ObjValue(
return resultObj;
}
linkPtr->lastValue.us = LinkedVar(unsigned short);
return Tcl_NewIntObj(linkPtr->lastValue.us);
return Tcl_NewWideIntObj(linkPtr->lastValue.us);
case TCL_LINK_UINT:
if (linkPtr->flags & LINK_ALLOC_LAST) {
memcpy(linkPtr->lastValue.aryPtr, linkPtr->addr, linkPtr->bytes);
objv = (Tcl_Obj **)ckalloc(linkPtr->numElems * sizeof(Tcl_Obj *));
for (i=0; i < linkPtr->numElems; i++) {
objv[i] = Tcl_NewWideIntObj(linkPtr->lastValue.uiPtr[i]);
TclNewIntObj(objv[i], linkPtr->lastValue.uiPtr[i]);
}
resultObj = Tcl_NewListObj(linkPtr->numElems, objv);
ckfree(objv);
@@ -1414,7 +1414,7 @@ ObjValue(
memcpy(linkPtr->lastValue.aryPtr, linkPtr->addr, linkPtr->bytes);
objv = (Tcl_Obj **)ckalloc(linkPtr->numElems * sizeof(Tcl_Obj *));
for (i=0; i < linkPtr->numElems; i++) {
objv[i] = Tcl_NewWideIntObj(linkPtr->lastValue.lPtr[i]);
TclNewIntObj(objv[i], linkPtr->lastValue.lPtr[i]);
}
resultObj = Tcl_NewListObj(linkPtr->numElems, objv);
ckfree(objv);
@@ -1427,7 +1427,7 @@ ObjValue(
memcpy(linkPtr->lastValue.aryPtr, linkPtr->addr, linkPtr->bytes);
objv = (Tcl_Obj **)ckalloc(linkPtr->numElems * sizeof(Tcl_Obj *));
for (i=0; i < linkPtr->numElems; i++) {
objv[i] = Tcl_NewWideIntObj(linkPtr->lastValue.ulPtr[i]);
TclNewIntObj(objv[i], linkPtr->lastValue.ulPtr[i]);
}
resultObj = Tcl_NewListObj(linkPtr->numElems, objv);
ckfree(objv);
@@ -1454,7 +1454,7 @@ ObjValue(
memcpy(linkPtr->lastValue.aryPtr, linkPtr->addr, linkPtr->bytes);
objv = (Tcl_Obj **)ckalloc(linkPtr->numElems * sizeof(Tcl_Obj *));
for (i=0; i < linkPtr->numElems; i++) {
objv[i] = Tcl_NewWideIntObj((Tcl_WideInt)
TclNewIntObj(objv[i], (Tcl_WideInt)
linkPtr->lastValue.uwPtr[i]);
}
resultObj = Tcl_NewListObj(linkPtr->numElems, objv);
+5 -3
View File
@@ -479,7 +479,9 @@ TclListObjRange(
toIdx = listLen-1;
}
if (fromIdx > toIdx) {
return Tcl_NewObj();
Tcl_Obj *obj;
TclNewObj(obj);
return obj;
}
newLen = toIdx - fromIdx + 1;
@@ -1379,7 +1381,7 @@ TclLindexFlat(
return NULL;
}
}
listPtr = Tcl_NewObj();
TclNewObj(listPtr);
} else {
/*
* Extract the pointer to the appropriate element.
@@ -1623,7 +1625,7 @@ TclLsetFlat(
if (--indexCount) {
parentList = subListPtr;
if (index == elemCount) {
subListPtr = Tcl_NewObj();
TclNewObj(subListPtr);
} else {
subListPtr = elemPtrs[index];
}
+50 -67
View File
@@ -137,7 +137,7 @@ Tcl_LoadObjCmd(
static const char *const options[] = {
"-global", "-lazy", "--", NULL
};
enum options {
enum loadOptionsEnum {
LOAD_GLOBAL, LOAD_LAZY, LOAD_LAST
};
@@ -150,9 +150,9 @@ Tcl_LoadObjCmd(
return TCL_ERROR;
}
++objv; --objc;
if (LOAD_GLOBAL == (enum options) index) {
if (LOAD_GLOBAL == (enum loadOptionsEnum) index) {
flags |= TCL_LOAD_GLOBAL;
} else if (LOAD_LAZY == (enum options) index) {
} else if (LOAD_LAZY == (enum loadOptionsEnum) index) {
flags |= TCL_LOAD_LAZY;
} else {
break;
@@ -302,60 +302,55 @@ Tcl_LoadObjCmd(
if (packageName != NULL) {
Tcl_DStringAppend(&pkgName, packageName, -1);
} else {
int retc;
Tcl_Obj *splitPtr, *pkgGuessPtr;
int pElements;
const char *pkgGuess;
/*
* Threading note - this call used to be protected by a mutex.
*/
retc = TclGuessPackageName(fullFileName, &pkgName);
if (!retc) {
Tcl_Obj *splitPtr, *pkgGuessPtr;
int pElements;
const char *pkgGuess;
/*
* The platform-specific code couldn't figure out the module
* name. Make a guess by taking the last element of the file
* name, stripping off any leading "lib", and then using all
* of the alphabetic and underline characters that follow
* that.
*/
/*
* The platform-specific code couldn't figure out the module
* name. Make a guess by taking the last element of the file
* name, stripping off any leading "lib", and then using all
* of the alphabetic and underline characters that follow
* that.
*/
splitPtr = Tcl_FSSplitPath(objv[1], &pElements);
Tcl_ListObjIndex(NULL, splitPtr, pElements -1, &pkgGuessPtr);
pkgGuess = Tcl_GetString(pkgGuessPtr);
if ((pkgGuess[0] == 'l') && (pkgGuess[1] == 'i')
&& (pkgGuess[2] == 'b')) {
pkgGuess += 3;
}
#ifdef __CYGWIN__
if ((pkgGuess[0] == 'c') && (pkgGuess[1] == 'y')
&& (pkgGuess[2] == 'g')) {
pkgGuess += 3;
}
#endif /* __CYGWIN__ */
for (p = pkgGuess; *p != 0; p += offset) {
offset = TclUtfToUniChar(p, &ch);
if ((ch > 0x100)
|| !(isalpha(UCHAR(ch)) /* INTL: ISO only */
|| (UCHAR(ch) == '_'))) {
break;
}
}
if (p == pkgGuess) {
Tcl_DecrRefCount(splitPtr);
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"couldn't figure out package name for %s",
fullFileName));
Tcl_SetErrorCode(interp, "TCL", "OPERATION", "LOAD",
"WHATPACKAGE", NULL);
code = TCL_ERROR;
goto done;
}
Tcl_DStringAppend(&pkgName, pkgGuess, p - pkgGuess);
Tcl_DecrRefCount(splitPtr);
splitPtr = Tcl_FSSplitPath(objv[1], &pElements);
Tcl_ListObjIndex(NULL, splitPtr, pElements -1, &pkgGuessPtr);
pkgGuess = Tcl_GetString(pkgGuessPtr);
if ((pkgGuess[0] == 'l') && (pkgGuess[1] == 'i')
&& (pkgGuess[2] == 'b')) {
pkgGuess += 3;
}
#ifdef __CYGWIN__
else if ((pkgGuess[0] == 'c') && (pkgGuess[1] == 'y')
&& (pkgGuess[2] == 'g')) {
pkgGuess += 3;
}
#endif /* __CYGWIN__ */
for (p = pkgGuess; *p != 0; p += offset) {
offset = TclUtfToUniChar(p, &ch);
if ((ch > 0x100)
|| !(isalpha(UCHAR(ch)) /* INTL: ISO only */
|| (UCHAR(ch) == '_'))) {
break;
}
}
if (p == pkgGuess) {
Tcl_DecrRefCount(splitPtr);
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"couldn't figure out package name for %s",
fullFileName));
Tcl_SetErrorCode(interp, "TCL", "OPERATION", "LOAD",
"WHATPACKAGE", NULL);
code = TCL_ERROR;
goto done;
}
Tcl_DStringAppend(&pkgName, pkgGuess, p - pkgGuess);
Tcl_DecrRefCount(splitPtr);
}
/*
@@ -559,7 +554,7 @@ Tcl_UnloadObjCmd(
static const char *const options[] = {
"-nocomplain", "-keeplibrary", "--", NULL
};
enum options {
enum unloadOptionsEnum {
UNLOAD_NOCOMPLAIN, UNLOAD_KEEPLIB, UNLOAD_LAST
};
@@ -584,7 +579,7 @@ Tcl_UnloadObjCmd(
break;
}
}
switch (index) {
switch ((enum unloadOptionsEnum)index) {
case UNLOAD_NOCOMPLAIN: /* -nocomplain */
complain = 0;
break;
@@ -1025,7 +1020,7 @@ Tcl_StaticPackage(
/*
*----------------------------------------------------------------------
*
* TclGetLoadedPackages, TclGetLoadedPackagesEx --
* TclGetLoadedPackagesEx --
*
* This function returns information about all of the files that are
* loaded (either in a particular interpreter, or for all interpreters).
@@ -1043,18 +1038,6 @@ Tcl_StaticPackage(
*----------------------------------------------------------------------
*/
int
TclGetLoadedPackages(
Tcl_Interp *interp, /* Interpreter in which to return information
* or error message. */
const char *targetName) /* Name of target interpreter or NULL. If
* NULL, return info about all interps;
* otherwise, just return info about this
* interpreter. */
{
return TclGetLoadedPackagesEx(interp, targetName, NULL);
}
int
TclGetLoadedPackagesEx(
Tcl_Interp *interp, /* Interpreter in which to return information
@@ -1073,7 +1056,7 @@ TclGetLoadedPackagesEx(
Tcl_Obj *resultObj, *pkgDesc[2];
if (targetName == NULL) {
resultObj = Tcl_NewObj();
TclNewObj(resultObj);
Tcl_MutexLock(&packageMutex);
for (pkgPtr = firstPackagePtr; pkgPtr != NULL;
pkgPtr = pkgPtr->nextPtr) {
@@ -1119,7 +1102,7 @@ TclGetLoadedPackagesEx(
* interpreter.
*/
resultObj = Tcl_NewObj();
TclNewObj(resultObj);
for (; ipPtr != NULL; ipPtr = ipPtr->nextPtr) {
pkgPtr = ipPtr->pkgPtr;
pkgDesc[0] = Tcl_NewStringObj(pkgPtr->fileName, -1);
-30
View File
@@ -53,36 +53,6 @@ TclpDlopen(
return TCL_ERROR;
}
/*
*----------------------------------------------------------------------
*
* TclGuessPackageName --
*
* If the "load" command is invoked without providing a package name,
* this procedure is invoked to try to figure it out.
*
* Results:
* Always returns 0 to indicate that we couldn't figure out a package
* name; generic code will then try to guess the package from the file
* name. A return value of 1 would have meant that we figured out the
* package name and put it in bufPtr.
*
* Side effects:
* None.
*
*----------------------------------------------------------------------
*/
int
TclGuessPackageName(
const char *fileName, /* Name of file containing package (already
* translated to local form if needed). */
Tcl_DString *bufPtr) /* Initialized empty dstring. Append package
* name to this if possible. */
{
return 0;
}
/*
* These functions are fallbacks if we somehow determine that the platform can
* do loading from memory but the user wishes to disable it. They just report
+8 -7
View File
@@ -43,7 +43,7 @@
# define _tcscmp strcmp
#endif
static inline Tcl_Obj *
static Tcl_Obj *
NewNativeObj(
TCHAR *string)
{
@@ -53,7 +53,7 @@ NewNativeObj(
Tcl_DStringInit(&ds);
Tcl_WCharToUtfDString(string, -1, &ds);
#else
Tcl_ExternalToUtfDString(NULL, (char *) string, -1, &ds);
Tcl_ExternalToUtfDString(NULL, (char *)string, -1, &ds);
#endif
return TclDStringToObj(&ds);
}
@@ -307,7 +307,7 @@ Tcl_MainEx(
is.interp = interp;
is.prompt = PROMPT_START;
is.commandPtr = Tcl_NewObj();
TclNewObj(is.commandPtr);
/*
* If the application has not already set a startup script, parse the
@@ -348,7 +348,7 @@ Tcl_MainEx(
argc--;
argv++;
Tcl_SetVar2Ex(interp, "argc", NULL, Tcl_NewIntObj(argc), TCL_GLOBAL_ONLY);
Tcl_SetVar2Ex(interp, "argc", NULL, Tcl_NewWideIntObj(argc), TCL_GLOBAL_ONLY);
argvPtr = Tcl_NewListObj(0, NULL);
while (argc--) {
@@ -362,7 +362,7 @@ Tcl_MainEx(
is.tty = isatty(0);
Tcl_SetVar2Ex(interp, "tcl_interactive", NULL,
Tcl_NewIntObj(!path && is.tty), TCL_GLOBAL_ONLY);
Tcl_NewWideIntObj(!path && is.tty), TCL_GLOBAL_ONLY);
/*
* Invoke application-specific initialization.
@@ -522,7 +522,7 @@ Tcl_MainEx(
TCL_EVAL_GLOBAL);
is.input = Tcl_GetStdChannel(TCL_STDIN);
Tcl_DecrRefCount(is.commandPtr);
is.commandPtr = Tcl_NewObj();
TclNewObj(is.commandPtr);
Tcl_IncrRefCount(is.commandPtr);
if (code != TCL_OK) {
chan = Tcl_GetStdChannel(TCL_STDERR);
@@ -790,7 +790,8 @@ StdinProc(
code = Tcl_RecordAndEvalObj(interp, commandPtr, TCL_EVAL_GLOBAL);
isPtr->input = chan = Tcl_GetStdChannel(TCL_STDIN);
Tcl_DecrRefCount(commandPtr);
isPtr->commandPtr = commandPtr = Tcl_NewObj();
TclNewObj(commandPtr);
isPtr->commandPtr = commandPtr;
Tcl_IncrRefCount(commandPtr);
if (chan != NULL) {
Tcl_CreateChannelHandler(chan, TCL_READABLE, StdinProc, isPtr);
+8 -6
View File
@@ -1770,7 +1770,7 @@ DoImport(
TclInvokeImportedCmd, InvokeImportedNRCmd, dataPtr,
DeleteImportedCmd);
dataPtr->realCmdPtr = cmdPtr;
/* corresponding decrement is in DeleteImportedCmd */
/* corresponding decrement is in DeleteImportedCmd */
cmdPtr->refCount++;
dataPtr->selfPtr = (Command *) importedCmd;
dataPtr->selfPtr->compileProc = cmdPtr->compileProc;
@@ -3546,9 +3546,10 @@ NamespaceExportCmd(
*/
if (objc == 1) {
Tcl_Obj *listPtr = Tcl_NewObj();
Tcl_Obj *listPtr;
(void) Tcl_AppendExportList(interp, NULL, listPtr);
TclNewObj(listPtr);
(void)Tcl_AppendExportList(interp, NULL, listPtr);
Tcl_SetObjResult(interp, listPtr);
return TCL_OK;
}
@@ -3906,7 +3907,7 @@ NamespaceOriginCmd(
origCmd = TclGetOriginalCommand(cmd);
if (origCmd == NULL) {
origCmd = cmd;
}
}
TclNewObj(resultPtr);
Tcl_GetCommandFullName(interp, origCmd, resultPtr);
if (TclCheckEmptyString(resultPtr) == TCL_EMPTYSTRING_YES ) {
@@ -4024,8 +4025,9 @@ NamespacePathCmd(
*/
if (objc == 1) {
Tcl_Obj *resultObj = Tcl_NewObj();
Tcl_Obj *resultObj;
TclNewObj(resultObj);
for (i=0 ; i<nsPtr->commandPathLength ; i++) {
if (nsPtr->commandPathArray[i].nsPtr != NULL) {
Tcl_ListObjAppendElement(NULL, resultObj, Tcl_NewStringObj(
@@ -5018,7 +5020,7 @@ TclLogCommandInfo(
*/
Tcl_ListObjAppendElement(NULL, iPtr->errorStack, iPtr->upLiteral);
Tcl_ListObjAppendElement(NULL, iPtr->errorStack, Tcl_NewIntObj(
Tcl_ListObjAppendElement(NULL, iPtr->errorStack, Tcl_NewWideIntObj(
iPtr->framePtr->level - iPtr->varFramePtr->level));
} else if (iPtr->framePtr != iPtr->rootFramePtr) {
/*
+1 -1
View File
@@ -3035,7 +3035,7 @@ TclOOObjectName(
if (oPtr->cachedNameObj) {
return oPtr->cachedNameObj;
}
namePtr = Tcl_NewObj();
TclNewObj(namePtr);
Tcl_GetCommandFullName(interp, oPtr->command, namePtr);
Tcl_IncrRefCount(namePtr);
oPtr->cachedNameObj = namePtr;
+1 -1
View File
@@ -831,7 +831,7 @@ TclOO_Object_VarName(
* (including traversing variable links), convert back to a name.
*/
varNamePtr = Tcl_NewObj();
TclNewObj(varNamePtr);
if (aryVar != NULL) {
Tcl_GetVariableFullName(interp, (Tcl_Var) aryVar, varNamePtr);
+9 -9
View File
@@ -1050,8 +1050,8 @@ MagicDefinitionInvoke(
* comments above for why these contortions are necessary.
*/
objPtr = Tcl_NewObj();
obj2Ptr = Tcl_NewObj();
TclNewObj(objPtr);
TclNewObj(obj2Ptr);
cmd = FindCommand(interp, objv[cmdIndex], nsPtr);
if (cmd == NULL) {
/*
@@ -2338,7 +2338,7 @@ ClassFilterGet(
return TCL_ERROR;
}
resultObj = Tcl_NewObj();
TclNewObj(resultObj);
FOREACH(filterObj, oPtr->classPtr->filters) {
Tcl_ListObjAppendElement(NULL, resultObj, filterObj);
}
@@ -2419,7 +2419,7 @@ ClassMixinGet(
return TCL_ERROR;
}
resultObj = Tcl_NewObj();
TclNewObj(resultObj);
FOREACH(mixinPtr, oPtr->classPtr->mixins) {
Tcl_ListObjAppendElement(NULL, resultObj,
TclOOObjectName(interp, mixinPtr->thisPtr));
@@ -2525,7 +2525,7 @@ ClassSuperGet(
return TCL_ERROR;
}
resultObj = Tcl_NewObj();
TclNewObj(resultObj);
FOREACH(superPtr, oPtr->classPtr->superclasses) {
Tcl_ListObjAppendElement(NULL, resultObj,
TclOOObjectName(interp, superPtr->thisPtr));
@@ -2691,7 +2691,7 @@ ClassVarsGet(
return TCL_ERROR;
}
resultObj = Tcl_NewObj();
TclNewObj(resultObj);
if (IsPrivateDefine(interp)) {
PrivateVariableMapping *privatePtr;
@@ -2800,7 +2800,7 @@ ObjFilterGet(
return TCL_ERROR;
}
resultObj = Tcl_NewObj();
TclNewObj(resultObj);
FOREACH(filterObj, oPtr->filters) {
Tcl_ListObjAppendElement(NULL, resultObj, filterObj);
}
@@ -2869,7 +2869,7 @@ ObjMixinGet(
return TCL_ERROR;
}
resultObj = Tcl_NewObj();
TclNewObj(resultObj);
FOREACH(mixinPtr, oPtr->mixins) {
if (mixinPtr) {
Tcl_ListObjAppendElement(NULL, resultObj,
@@ -2954,7 +2954,7 @@ ObjVarsGet(
return TCL_ERROR;
}
resultObj = Tcl_NewObj();
TclNewObj(resultObj);
if (IsPrivateDefine(interp)) {
PrivateVariableMapping *privatePtr;
+21 -21
View File
@@ -206,11 +206,11 @@ InfoObjectClassCmd(
continue;
}
if (TclOOIsReachable(o2clsPtr, mixinPtr)) {
Tcl_SetObjResult(interp, Tcl_NewIntObj(1));
Tcl_SetObjResult(interp, Tcl_NewWideIntObj(1));
return TCL_OK;
}
}
Tcl_SetObjResult(interp, Tcl_NewIntObj(
Tcl_SetObjResult(interp, Tcl_NewWideIntObj(
TclOOIsReachable(o2clsPtr, oPtr->selfCls)));
return TCL_OK;
}
@@ -270,13 +270,13 @@ InfoObjectDefnCmd(
return TCL_ERROR;
}
resultObjs[0] = Tcl_NewObj();
TclNewObj(resultObjs[0]);
for (localPtr=procPtr->firstLocalPtr; localPtr!=NULL;
localPtr=localPtr->nextPtr) {
if (TclIsVarArgument(localPtr)) {
Tcl_Obj *argObj;
argObj = Tcl_NewObj();
TclNewObj(argObj);
Tcl_ListObjAppendElement(NULL, argObj,
Tcl_NewStringObj(localPtr->name, -1));
if (localPtr->defValuePtr != NULL) {
@@ -320,7 +320,7 @@ InfoObjectFiltersCmd(
if (oPtr == NULL) {
return TCL_ERROR;
}
resultObj = Tcl_NewObj();
TclNewObj(resultObj);
FOREACH(filterObj, oPtr->filters) {
Tcl_ListObjAppendElement(NULL, resultObj, filterObj);
@@ -601,7 +601,7 @@ InfoObjectMethodsCmd(
}
}
resultObj = Tcl_NewObj();
TclNewObj(resultObj);
if (recurse) {
const char **names;
int i, numNames = TclOOGetSortedMethodList(oPtr, NULL, NULL, flag,
@@ -713,7 +713,7 @@ InfoObjectMixinsCmd(
return TCL_ERROR;
}
resultObj = Tcl_NewObj();
TclNewObj(resultObj);
FOREACH(mixinPtr, oPtr->mixins) {
if (!mixinPtr) {
continue;
@@ -753,7 +753,7 @@ InfoObjectIdCmd(
return TCL_ERROR;
}
Tcl_SetObjResult(interp, Tcl_NewIntObj(oPtr->creationEpoch));
Tcl_SetObjResult(interp, Tcl_NewWideIntObj(oPtr->creationEpoch));
return TCL_OK;
}
@@ -826,7 +826,7 @@ InfoObjectVariablesCmd(
return TCL_ERROR;
}
resultObj = Tcl_NewObj();
TclNewObj(resultObj);
if (isPrivate) {
PrivateVariableMapping *privatePtr;
@@ -878,7 +878,7 @@ InfoObjectVarsCmd(
if (objc == 3) {
pattern = TclGetString(objv[2]);
}
resultObj = Tcl_NewObj();
TclNewObj(resultObj);
/*
* Extract the information we need from the object's namespace's table of
@@ -946,13 +946,13 @@ InfoClassConstrCmd(
return TCL_ERROR;
}
resultObjs[0] = Tcl_NewObj();
TclNewObj(resultObjs[0]);
for (localPtr=procPtr->firstLocalPtr; localPtr!=NULL;
localPtr=localPtr->nextPtr) {
if (TclIsVarArgument(localPtr)) {
Tcl_Obj *argObj;
argObj = Tcl_NewObj();
TclNewObj(argObj);
Tcl_ListObjAppendElement(NULL, argObj,
Tcl_NewStringObj(localPtr->name, -1));
if (localPtr->defValuePtr != NULL) {
@@ -1014,13 +1014,13 @@ InfoClassDefnCmd(
return TCL_ERROR;
}
resultObjs[0] = Tcl_NewObj();
TclNewObj(resultObjs[0]);
for (localPtr=procPtr->firstLocalPtr; localPtr!=NULL;
localPtr=localPtr->nextPtr) {
if (TclIsVarArgument(localPtr)) {
Tcl_Obj *argObj;
argObj = Tcl_NewObj();
TclNewObj(argObj);
Tcl_ListObjAppendElement(NULL, argObj,
Tcl_NewStringObj(localPtr->name, -1));
if (localPtr->defValuePtr != NULL) {
@@ -1158,7 +1158,7 @@ InfoClassFiltersCmd(
return TCL_ERROR;
}
resultObj = Tcl_NewObj();
TclNewObj(resultObj);
FOREACH(filterObj, clsPtr->filters) {
Tcl_ListObjAppendElement(NULL, resultObj, filterObj);
}
@@ -1252,7 +1252,7 @@ InfoClassInstancesCmd(
pattern = TclGetString(objv[2]);
}
resultObj = Tcl_NewObj();
TclNewObj(resultObj);
FOREACH(oPtr, clsPtr->instances) {
Tcl_Obj *tmpObj = TclOOObjectName(interp, oPtr);
@@ -1356,7 +1356,7 @@ InfoClassMethodsCmd(
}
}
resultObj = Tcl_NewObj();
TclNewObj(resultObj);
if (recurse) {
const char **names;
int i, numNames = TclOOGetSortedClassMethodList(clsPtr, flag, &names);
@@ -1463,7 +1463,7 @@ InfoClassMixinsCmd(
return TCL_ERROR;
}
resultObj = Tcl_NewObj();
TclNewObj(resultObj);
FOREACH(mixinPtr, clsPtr->mixins) {
if (!mixinPtr) {
continue;
@@ -1509,7 +1509,7 @@ InfoClassSubsCmd(
pattern = TclGetString(objv[2]);
}
resultObj = Tcl_NewObj();
TclNewObj(resultObj);
FOREACH(subclassPtr, clsPtr->subclasses) {
Tcl_Obj *tmpObj = TclOOObjectName(interp, subclassPtr->thisPtr);
@@ -1560,7 +1560,7 @@ InfoClassSupersCmd(
return TCL_ERROR;
}
resultObj = Tcl_NewObj();
TclNewObj(resultObj);
FOREACH(superPtr, clsPtr->superclasses) {
Tcl_ListObjAppendElement(NULL, resultObj,
TclOOObjectName(interp, superPtr->thisPtr));
@@ -1605,7 +1605,7 @@ InfoClassVariablesCmd(
return TCL_ERROR;
}
resultObj = Tcl_NewObj();
TclNewObj(resultObj);
if (isPrivate) {
PrivateVariableMapping *privatePtr;
+4 -3
View File
@@ -394,7 +394,7 @@ TclOONewProcMethod(
if (argsObj == NULL) {
argsLen = -1;
argsObj = Tcl_NewObj();
TclNewObj(argsObj);
Tcl_IncrRefCount(argsObj);
procName = "<destructor>";
} else if (Tcl_ListObjLength(interp, argsObj, &argsLen) != TCL_OK) {
@@ -1315,12 +1315,13 @@ CloneProcedureMethod(
* Copy the argument list.
*/
argsObj = Tcl_NewObj();
TclNewObj(argsObj);
for (localPtr=pmPtr->procPtr->firstLocalPtr; localPtr!=NULL;
localPtr=localPtr->nextPtr) {
if (TclIsVarArgument(localPtr)) {
Tcl_Obj *argObj = Tcl_NewObj();
Tcl_Obj *argObj;
TclNewObj(argObj);
Tcl_ListObjAppendElement(NULL, argObj,
Tcl_NewStringObj(localPtr->name, -1));
if (localPtr->defValuePtr != NULL) {
+12 -12
View File
@@ -145,12 +145,12 @@ typedef struct PendingObjData {
#define ObjDeletionUnlock(contextPtr) ((contextPtr)->deletionCount--)
#define ObjDeletePending(contextPtr) ((contextPtr)->deletionCount > 0)
#define ObjOnStack(contextPtr) ((contextPtr)->deletionStack != NULL)
#define PushObjToDelete(contextPtr,objPtr) \
#define PushObjToDelete(contextPtr,objPtr) \
/* The string rep is already invalidated so we can use the bytes value \
* for our pointer chain: push onto the head of the stack. */ \
(objPtr)->bytes = (char *) ((contextPtr)->deletionStack); \
(contextPtr)->deletionStack = (objPtr)
#define PopObjToDelete(contextPtr,objPtrVar) \
#define PopObjToDelete(contextPtr,objPtrVar) \
(objPtrVar) = (contextPtr)->deletionStack; \
(contextPtr)->deletionStack = (Tcl_Obj *) (objPtrVar)->bytes
@@ -161,14 +161,14 @@ typedef struct PendingObjData {
static PendingObjData pendingObjData;
#define ObjInitDeletionContext(contextPtr) \
PendingObjData *const contextPtr = &pendingObjData
#elif HAVE_FAST_TSD
#elif defined(HAVE_FAST_TSD)
static __thread PendingObjData pendingObjData;
#define ObjInitDeletionContext(contextPtr) \
PendingObjData *const contextPtr = &pendingObjData
#else
static Tcl_ThreadDataKey pendingObjDataKey;
#define ObjInitDeletionContext(contextPtr) \
PendingObjData *const contextPtr = \
PendingObjData *const contextPtr = \
(PendingObjData *)Tcl_GetThreadData(&pendingObjDataKey, sizeof(PendingObjData))
#endif
@@ -177,15 +177,15 @@ static Tcl_ThreadDataKey pendingObjDataKey;
*/
#define PACK_BIGNUM(bignum, objPtr) \
if ((bignum).used > 0x7FFF) { \
mp_int *temp = (mp_int *) ckalloc(sizeof(mp_int)); \
if ((bignum).used > 0x7FFF) { \
mp_int *temp = (mp_int *)ckalloc(sizeof(mp_int)); \
*temp = bignum; \
(objPtr)->internalRep.twoPtrValue.ptr1 = temp; \
(objPtr)->internalRep.twoPtrValue.ptr2 = INT2PTR(-1); \
(objPtr)->internalRep.twoPtrValue.ptr1 = temp; \
(objPtr)->internalRep.twoPtrValue.ptr2 = INT2PTR(-1); \
} else if (((bignum).alloc <= 0x7FFF) || (mp_shrink(&(bignum))) == MP_OKAY) { \
(objPtr)->internalRep.twoPtrValue.ptr1 = (void *) (bignum).dp; \
(objPtr)->internalRep.twoPtrValue.ptr2 = INT2PTR( ((bignum).sign << 30) \
| ((bignum).alloc << 15) | ((bignum).used)); \
(objPtr)->internalRep.twoPtrValue.ptr1 = (void *)(bignum).dp; \
(objPtr)->internalRep.twoPtrValue.ptr2 = INT2PTR(((bignum).sign << 30) \
| ((bignum).alloc << 15) | ((bignum).used)); \
}
/*
@@ -567,7 +567,7 @@ TclContinuationsEnter(
ThreadSpecificData *tsdPtr = TclGetContLineTable();
Tcl_HashEntry *hPtr =
Tcl_CreateHashEntry(tsdPtr->lineCLPtr, objPtr, &newEntry);
ContLineLoc *clLocPtr = (ContLineLoc *)ckalloc(sizeof(ContLineLoc) + num*sizeof(int));
ContLineLoc *clLocPtr = (ContLineLoc *)ckalloc(offsetof(ContLineLoc, loc) + (num + 1) *sizeof(int));
if (!newEntry) {
/*
+2 -2
View File
@@ -119,7 +119,7 @@ const char tclCharTypeTable[] = {
* Prototypes for local functions defined in this file:
*/
static inline int CommandComplete(const char *script, int numBytes);
static int CommandComplete(const char *script, int numBytes);
static int ParseComment(const char *src, int numBytes,
Tcl_Parse *parsePtr);
static int ParseTokens(const char *src, int numBytes, int mask,
@@ -2396,7 +2396,7 @@ TclSubstTokens(
*----------------------------------------------------------------------
*/
static inline int
static int
CommandComplete(
const char *script, /* Script to check. */
int numBytes) /* Number of bytes in script. */
+4 -4
View File
@@ -722,7 +722,7 @@ TclPathPart(
(Tcl_FSGetPathType(pathPtr) == TCL_PATH_RELATIVE))) {
Tcl_ListObjIndex(NULL, splitPtr, splitElements-1, &resultPtr);
} else {
resultPtr = Tcl_NewObj();
TclNewObj(resultPtr);
}
} else {
/*
@@ -760,7 +760,7 @@ GetExtension(
tail = TclGetString(pathPtr);
extension = TclGetExtension(tail);
if (extension == NULL) {
ret = Tcl_NewObj();
TclNewObj(ret);
} else {
ret = Tcl_NewStringObj(extension, -1);
}
@@ -1036,7 +1036,7 @@ TclJoinPath(
noQuickReturn:
if (res == NULL) {
res = Tcl_NewObj();
TclNewObj(res);
}
ptr = TclGetStringFromObj(res, &length);
@@ -1272,7 +1272,7 @@ TclNewFSPathObj(
return pathPtr;
}
pathPtr = Tcl_NewObj();
TclNewObj(pathPtr);
fsPathPtr = (FsPath *)ckalloc(sizeof(FsPath));
/*
+1 -1
View File
@@ -334,7 +334,7 @@ TclCleanupChildren(
Tcl_Obj *objPtr;
Tcl_Seek(errorChan, 0, SEEK_SET);
objPtr = Tcl_NewObj();
TclNewObj(objPtr);
count = Tcl_ReadChars(errorChan, objPtr, -1, 0);
if (count < 0) {
result = TCL_ERROR;
+8 -7
View File
@@ -285,7 +285,7 @@ TclPkgFileSeen(
Tcl_Obj *list;
if (isNew) {
list = Tcl_NewObj();
TclNewObj(list);
Tcl_SetHashValue(entry, list);
Tcl_IncrRefCount(list);
} else {
@@ -1073,7 +1073,7 @@ TclNRPackageObjCmd(
"present", "provide", "require", "unknown", "vcompare",
"versions", "vsatisfies", NULL
};
enum pkgOptions {
enum pkgOptionsEnum {
PKG_FILES, PKG_FORGET, PKG_IFNEEDED, PKG_NAMES, PKG_PREFER,
PKG_PRESENT, PKG_PROVIDE, PKG_REQUIRE, PKG_UNKNOWN, PKG_VCOMPARE,
PKG_VERSIONS, PKG_VSATISFIES
@@ -1099,7 +1099,7 @@ TclNRPackageObjCmd(
&optionIndex) != TCL_OK) {
return TCL_ERROR;
}
switch ((enum pkgOptions) optionIndex) {
switch ((enum pkgOptionsEnum) optionIndex) {
case PKG_FILES: {
PkgFiles *pkgFiles;
@@ -1241,7 +1241,7 @@ TclNRPackageObjCmd(
} else {
Tcl_Obj *resultObj;
resultObj = Tcl_NewObj();
TclNewObj(resultObj);
tablePtr = &iPtr->packageTable;
for (hPtr = Tcl_FirstHashEntry(tablePtr, &search); hPtr != NULL;
hPtr = Tcl_NextHashEntry(&search)) {
@@ -1368,9 +1368,9 @@ TclNRPackageObjCmd(
newObjvPtr, NULL);
return TCL_OK;
} else {
int i, newobjc = objc-3;
Tcl_Obj *const *newobjv = objv + 3;
newobjc = objc - 3;
if (CheckAllRequirements(interp, objc-3, objv+3) != TCL_OK) {
return TCL_ERROR;
}
@@ -1481,7 +1481,7 @@ TclNRPackageObjCmd(
*/
Tcl_SetObjResult(interp,
Tcl_NewIntObj(CompareVersions(iva, ivb, NULL)));
Tcl_NewWideIntObj(CompareVersions(iva, ivb, NULL)));
ckfree(iva);
ckfree(ivb);
break;
@@ -1490,8 +1490,9 @@ TclNRPackageObjCmd(
Tcl_WrongNumArgs(interp, 2, objv, "package");
return TCL_ERROR;
} else {
Tcl_Obj *resultObj = Tcl_NewObj();
Tcl_Obj *resultObj;
TclNewObj(resultObj);
argv2 = TclGetString(objv[2]);
hPtr = Tcl_FindHashEntry(&iPtr->packageTable, argv2);
if (hPtr != NULL) {
+4
View File
@@ -35,6 +35,10 @@
#include "tclInt.h"
#ifndef TCL_CFGVAL_ENCODING
# define TCL_CFGVAL_ENCODING "utf-8"
#endif
/*
* Use C preprocessor statements to define the various values for the embedded
* configuration information.
+25 -3
View File
@@ -632,7 +632,8 @@ TclCreateProc(
* local variables for the argument.
*/
localPtr = (CompiledLocal *)ckalloc(offsetof(CompiledLocal, name) + fieldValues[0]->length +1);
localPtr = (CompiledLocal *)ckalloc(
offsetof(CompiledLocal, name) + fieldValues[0]->length + 1);
if (procPtr->firstLocalPtr == NULL) {
procPtr->firstLocalPtr = procPtr->lastLocalPtr = localPtr;
} else {
@@ -909,9 +910,28 @@ TclNRUplevelObjCmd(
Tcl_Obj *objPtr;
if (objc < 2) {
/* to do
* simplify things by interpreting the argument as a command when there
* is only one argument. This requires a TIP since currently a single
* argument is interpreted as a level indicator if possible.
*/
uplevelSyntax:
Tcl_WrongNumArgs(interp, 1, objv, "?level? command ?arg ...?");
return TCL_ERROR;
} else if (!TclHasStringRep(objv[1]) && objc == 2) {
int status ,llength;
status = Tcl_ListObjLength(interp, objv[1], &llength);
if (status == TCL_OK && llength > 1) {
/* the first argument can't interpreted as a level. Avoid
* generating a string representation of the script. */
result = TclGetFrame(interp, "1", &framePtr);
if (result == -1) {
return TCL_ERROR;
}
objc -= 1;
objv += 1;
goto havelevel;
}
}
/*
@@ -928,6 +948,8 @@ TclNRUplevelObjCmd(
}
objv += result + 1;
havelevel:
/*
* Modify the interpreter state to execute in the given frame.
*/
@@ -1313,8 +1335,8 @@ InitLocalCache(
* for future calls.
*/
localCachePtr = (LocalCache *)ckalloc(sizeof(LocalCache)
+ (localCt - 1) * sizeof(Tcl_Obj *)
localCachePtr = (LocalCache *)ckalloc(offsetof(LocalCache, varName0)
+ localCt * sizeof(Tcl_Obj *)
+ numArgs * sizeof(Var));
namePtr = &localCachePtr->varName0;
+8 -8
View File
@@ -222,7 +222,7 @@ WaitProcessStatus(
* Get process status.
*/
if (pid == (Tcl_Pid) -1) {
if (pid == (Tcl_Pid)-1) {
/*
* POSIX errName msg
*/
@@ -371,7 +371,7 @@ BuildProcessStatusObj(
* Normal exit, return TCL_OK.
*/
return Tcl_NewIntObj(TCL_OK);
return Tcl_NewWideIntObj(TCL_OK);
}
/*
@@ -427,7 +427,7 @@ ProcessListObjCmd(
entry != NULL; entry = Tcl_NextHashEntry(&search)) {
info = (ProcessInfo *) Tcl_GetHashValue(entry);
Tcl_ListObjAppendElement(interp, list,
Tcl_NewIntObj(info->resolvedPid));
Tcl_NewWideIntObj(info->resolvedPid));
}
Tcl_MutexUnlock(&infoTablesMutex);
Tcl_SetObjResult(interp, list);
@@ -472,7 +472,7 @@ ProcessStatusObjCmd(
static const char *const switches[] = {
"-wait", "--", NULL
};
enum switches {
enum switchesEnum {
STATUS_WAIT, STATUS_LAST
};
@@ -485,7 +485,7 @@ ProcessStatusObjCmd(
return TCL_ERROR;
}
++objv; --objc;
if (STATUS_WAIT == (enum switches) index) {
if (STATUS_WAIT == (enum switchesEnum) index) {
options = 0;
} else {
break;
@@ -523,7 +523,7 @@ ProcessStatusObjCmd(
* Add to result.
*/
Tcl_DictObjPut(interp, dict, Tcl_NewIntObj(info->resolvedPid),
Tcl_DictObjPut(interp, dict, Tcl_NewWideIntObj(info->resolvedPid),
BuildProcessStatusObj(info));
}
}
@@ -573,7 +573,7 @@ ProcessStatusObjCmd(
* Add to result.
*/
Tcl_DictObjPut(interp, dict, Tcl_NewIntObj(info->resolvedPid),
Tcl_DictObjPut(interp, dict, Tcl_NewWideIntObj(info->resolvedPid),
BuildProcessStatusObj(info));
}
}
@@ -834,7 +834,7 @@ TclProcessCreated(
* Allocate and initialize info structure.
*/
info = (ProcessInfo *) ckalloc(sizeof(ProcessInfo));
info = (ProcessInfo *)ckalloc(sizeof(ProcessInfo));
InitProcessInfo(info, pid, resolvedPid);
/*
+3 -3
View File
@@ -676,9 +676,9 @@ TclRegAbout(
* well and Tcl has other limits that constrain things as well...
*/
resultObj = Tcl_NewObj();
Tcl_ListObjAppendElement(NULL, resultObj,
Tcl_NewWideIntObj((Tcl_WideInt) regexpPtr->re.re_nsub));
TclNewObj(resultObj);
TclNewIntObj(infoObj, regexpPtr->re.re_nsub);
Tcl_ListObjAppendElement(NULL, resultObj, infoObj);
/*
* Now append a list of all the bit-flags set for the RE.
+15 -13
View File
@@ -248,7 +248,7 @@ Tcl_SaveResult(
*/
statePtr->objResultPtr = iPtr->objResultPtr;
iPtr->objResultPtr = Tcl_NewObj();
TclNewObj(iPtr->objResultPtr);
Tcl_IncrRefCount(iPtr->objResultPtr);
/*
@@ -841,19 +841,19 @@ SetupAppendBuffer(
totalSpace = newSpace + iPtr->appendUsed;
if (totalSpace >= iPtr->appendAvl) {
char *newSpace;
char *newSpacePtr;
if (totalSpace < 100) {
totalSpace = 200;
} else {
totalSpace *= 2;
}
newSpace = (char *)ckalloc(totalSpace);
strcpy(newSpace, iPtr->result);
newSpacePtr = (char *)ckalloc(totalSpace);
strcpy(newSpacePtr, iPtr->result);
if (iPtr->appendResult != NULL) {
ckfree(iPtr->appendResult);
}
iPtr->appendResult = newSpace;
iPtr->appendResult = newSpacePtr;
iPtr->appendAvl = totalSpace;
} else if (iPtr->result != iPtr->appendResult) {
strcpy(iPtr->appendResult, iPtr->result);
@@ -1036,13 +1036,14 @@ Tcl_SetErrorCodeVA(
Tcl_Interp *interp, /* Interpreter in which to set errorCode */
va_list argList) /* Variable argument list. */
{
Tcl_Obj *errorObj = Tcl_NewObj();
Tcl_Obj *errorObj;
/*
* Scan through the arguments one at a time, appending them to the
* errorCode field as list elements.
*/
TclNewObj(errorObj);
while (1) {
char *elem = va_arg(argList, char *);
@@ -1395,9 +1396,10 @@ TclMergeReturnOptions(
int code = TCL_OK;
int level = 1;
Tcl_Obj *valuePtr;
Tcl_Obj *returnOpts = Tcl_NewObj();
Tcl_Obj *returnOpts;
Tcl_Obj **keys = GetKeys();
TclNewObj(returnOpts);
for (; objc > 1; objv += 2, objc -= 2) {
const char *opt = TclGetString(objv[0]);
const char *compare = TclGetString(keys[KEY_OPTIONS]);
@@ -1591,19 +1593,19 @@ Tcl_GetReturnOptions(
if (iPtr->returnOpts) {
options = Tcl_DuplicateObj(iPtr->returnOpts);
} else {
options = Tcl_NewObj();
TclNewObj(options);
}
if (result == TCL_RETURN) {
Tcl_DictObjPut(NULL, options, keys[KEY_CODE],
Tcl_NewIntObj(iPtr->returnCode));
Tcl_NewWideIntObj(iPtr->returnCode));
Tcl_DictObjPut(NULL, options, keys[KEY_LEVEL],
Tcl_NewIntObj(iPtr->returnLevel));
Tcl_NewWideIntObj(iPtr->returnLevel));
} else {
Tcl_DictObjPut(NULL, options, keys[KEY_CODE],
Tcl_NewIntObj(result));
Tcl_NewWideIntObj(result));
Tcl_DictObjPut(NULL, options, keys[KEY_LEVEL],
Tcl_NewIntObj(0));
Tcl_NewWideIntObj(0));
}
if (result == TCL_ERROR) {
@@ -1616,7 +1618,7 @@ Tcl_GetReturnOptions(
if (iPtr->errorInfo) {
Tcl_DictObjPut(NULL, options, keys[KEY_ERRORINFO], iPtr->errorInfo);
Tcl_DictObjPut(NULL, options, keys[KEY_ERRORLINE],
Tcl_NewIntObj(iPtr->errorLine));
Tcl_NewWideIntObj(iPtr->errorLine));
}
return options;
}
+11 -11
View File
@@ -716,7 +716,7 @@ Tcl_ScanObjCmd(
switch (ch) {
case 'n':
if (!(flags & SCAN_SUPPRESS)) {
objPtr = Tcl_NewWideIntObj(string - baseString);
TclNewIntObj(objPtr, string - baseString);
Tcl_IncrRefCount(objPtr);
CLANG_ASSERT(objs);
objs[objIndex++] = objPtr;
@@ -879,7 +879,7 @@ Tcl_ScanObjCmd(
offset = TclUtfToUCS4(string, &i);
string += offset;
if (!(flags & SCAN_SUPPRESS)) {
objPtr = Tcl_NewWideIntObj(i);
TclNewIntObj(objPtr, i);
Tcl_IncrRefCount(objPtr);
CLANG_ASSERT(objs);
objs[objIndex++] = objPtr;
@@ -890,7 +890,7 @@ Tcl_ScanObjCmd(
/*
* Scan an unsigned or signed integer.
*/
objPtr = Tcl_NewWideIntObj(0);
TclNewIntObj(objPtr, 0);
Tcl_IncrRefCount(objPtr);
if (width == 0) {
width = ~0;
@@ -937,16 +937,16 @@ Tcl_ScanObjCmd(
} else if (flags & SCAN_BIG) {
if (flags & SCAN_UNSIGNED) {
mp_int big;
int code = Tcl_GetBignumFromObj(interp, objPtr, &big);
int res = Tcl_GetBignumFromObj(interp, objPtr, &big);
if (code == TCL_OK) {
if (res == TCL_OK) {
if (mp_isneg(&big)) {
code = TCL_ERROR;
res = TCL_ERROR;
}
mp_clear(&big);
}
if (code == TCL_ERROR) {
if (res == TCL_ERROR) {
if (objs != NULL) {
ckfree(objs);
}
@@ -1068,7 +1068,7 @@ Tcl_ScanObjCmd(
* Here no vars were specified, we want a list returned (inline scan)
*/
objPtr = Tcl_NewObj();
TclNewObj(objPtr);
for (i = 0; i < totalVars; i++) {
if (objs[i] != NULL) {
Tcl_ListObjAppendElement(NULL, objPtr, objs[i]);
@@ -1089,16 +1089,16 @@ Tcl_ScanObjCmd(
if (code == TCL_OK) {
if (underflow && (nconversions == 0)) {
if (numVars) {
objPtr = Tcl_NewWideIntObj(-1);
TclNewIntObj(objPtr, TCL_INDEX_NONE);
} else {
if (objPtr) {
Tcl_SetListObj(objPtr, 0, NULL);
} else {
objPtr = Tcl_NewObj();
TclNewObj(objPtr);
}
}
} else if (numVars) {
objPtr = Tcl_NewWideIntObj(result);
TclNewIntObj(objPtr, result);
}
Tcl_SetObjResult(interp, objPtr);
}
+35 -32
View File
@@ -2133,7 +2133,7 @@ Tcl_AppendFormatToObj(
if (l == (long) 0) gotHash = 0;
}
segment = Tcl_NewObj();
TclNewObj(segment);
allocSegment = 1;
segmentLimit = INT_MAX;
Tcl_IncrRefCount(segment);
@@ -2178,15 +2178,15 @@ Tcl_AppendFormatToObj(
const char *bytes;
if (useShort) {
pure = Tcl_NewWideIntObj(s);
TclNewIntObj(pure, s);
#ifndef TCL_WIDE_INT_IS_LONG
} else if (useWide) {
pure = Tcl_NewWideIntObj(w);
TclNewIntObj(pure, w);
#endif
} else if (useBig) {
pure = Tcl_NewBignumObj(&big);
} else {
pure = Tcl_NewWideIntObj(l);
TclNewIntObj(pure, l);
}
Tcl_IncrRefCount(pure);
bytes = TclGetStringFromObj(pure, &length);
@@ -2308,7 +2308,7 @@ Tcl_AppendFormatToObj(
if (numDigits == 0) {
numDigits = 1;
}
pure = Tcl_NewObj();
TclNewObj(pure);
Tcl_SetObjLength(pure, (int) numDigits);
bytes = TclGetString(pure);
toAppend = length = (int) numDigits;
@@ -2429,7 +2429,7 @@ Tcl_AppendFormatToObj(
*p++ = (char) ch;
*p = '\0';
segment = Tcl_NewObj();
TclNewObj(segment);
allocSegment = 1;
if (!Tcl_AttemptSetObjLength(segment, length)) {
msg = overflow;
@@ -2443,10 +2443,10 @@ Tcl_AppendFormatToObj(
goto errorMsg;
}
if (ch == 'A') {
char *p = TclGetString(segment) + 1;
*p = 'x';
p = strchr(p, 'P');
if (p) *p = 'p';
char *q = TclGetString(segment) + 1;
*q = 'x';
q = strchr(q, 'P');
if (q) *q = 'p';
}
break;
}
@@ -2543,8 +2543,9 @@ Tcl_Format(
Tcl_Obj *const objv[])
{
int result;
Tcl_Obj *objPtr = Tcl_NewObj();
Tcl_Obj *objPtr;
TclNewObj(objPtr);
result = Tcl_AppendFormatToObj(interp, objPtr, format, objc, objv);
if (result != TCL_OK) {
Tcl_DecrRefCount(objPtr);
@@ -2572,9 +2573,10 @@ AppendPrintfToObjVA(
va_list argList)
{
int code, objc;
Tcl_Obj **objv, *list = Tcl_NewObj();
Tcl_Obj **objv, *list;
const char *p;
TclNewObj(list);
p = format;
Tcl_IncrRefCount(list);
while (*p != '\0') {
@@ -2788,8 +2790,9 @@ Tcl_ObjPrintf(
...)
{
va_list argList;
Tcl_Obj *objPtr = Tcl_NewObj();
Tcl_Obj *objPtr;
TclNewObj(objPtr);
va_start(argList, format);
AppendPrintfToObjVA(objPtr, format, argList);
va_end(argList);
@@ -3314,7 +3317,7 @@ TclStringCat(
/* assert ( length > start ) */
TclFreeIntRep(objResultPtr);
} else {
objResultPtr = Tcl_NewObj(); /* PANIC? */
TclNewObj(objResultPtr); /* PANIC? */
if (0 == Tcl_AttemptSetObjLength(objResultPtr, length)) {
Tcl_DecrRefCount(objResultPtr);
if (interp) {
@@ -3410,7 +3413,7 @@ TclStringCmp(
if (nocase) {
s1 = (char *) Tcl_GetUnicodeFromObj(value1Ptr, &s1len);
s2 = (char *) Tcl_GetUnicodeFromObj(value2Ptr, &s2len);
memCmpFn = (memCmpFn_t)Tcl_UniCharNcasecmp;
memCmpFn = (memCmpFn_t)(void *)Tcl_UniCharNcasecmp;
} else {
s1len = Tcl_GetCharLength(value1Ptr);
s2len = Tcl_GetCharLength(value2Ptr);
@@ -3435,7 +3438,7 @@ TclStringCmp(
s1len *= sizeof(Tcl_UniChar);
s2len *= sizeof(Tcl_UniChar);
} else {
memCmpFn = (memCmpFn_t) Tcl_UniCharNcmp;
memCmpFn = (memCmpFn_t)(void *)Tcl_UniCharNcmp;
}
}
}
@@ -3493,11 +3496,11 @@ TclStringCmp(
*/
if ((reqlength < 0) && !nocase) {
memCmpFn = (memCmpFn_t) TclpUtfNcmp2;
memCmpFn = (memCmpFn_t)(void *)TclpUtfNcmp2;
} else {
s1len = Tcl_NumUtfChars(s1, s1len);
s2len = Tcl_NumUtfChars(s2, s2len);
memCmpFn = (memCmpFn_t)
memCmpFn = (memCmpFn_t)(void *)
(nocase ? Tcl_UtfNcasecmp : Tcl_UtfNcmp);
}
}
@@ -3561,7 +3564,7 @@ TclStringFirst(
int lh, ln = Tcl_GetCharLength(needle);
Tcl_Obj *result;
int value = -1;
Tcl_UniChar *check, *end, *uh, *un;
Tcl_UniChar *checkStr, *endStr, *uh, *un;
if (start < 0) {
start = 0;
@@ -3627,12 +3630,12 @@ TclStringFirst(
/* Don't start the loop if there cannot be a valid answer */
goto firstEnd;
}
end = uh + lh;
endStr = uh + lh;
for (check = uh + start; check + ln <= end; check++) {
if ((*check == *un) && (0 ==
memcmp(check + 1, un + 1, (ln-1) * sizeof(Tcl_UniChar)))) {
value = (check - uh);
for (checkStr = uh + start; checkStr + ln <= endStr; checkStr++) {
if ((*checkStr == *un) && (0 ==
memcmp(checkStr + 1, un + 1, (ln-1) * sizeof(Tcl_UniChar)))) {
value = (checkStr - uh);
goto firstEnd;
}
}
@@ -3668,7 +3671,7 @@ TclStringLast(
int lh, ln = Tcl_GetCharLength(needle);
Tcl_Obj *result;
int value = -1;
Tcl_UniChar *check, *uh, *un;
Tcl_UniChar *checkStr, *uh, *un;
if (ln == 0) {
/*
@@ -3714,14 +3717,14 @@ TclStringLast(
/* Don't start the loop if there cannot be a valid answer */
goto lastEnd;
}
check = uh + last + 1 - ln;
while (check >= uh) {
if ((*check == un[0])
&& (0 == memcmp(check+1, un+1, (ln-1)*sizeof(Tcl_UniChar)))) {
value = (check - uh);
checkStr = uh + last + 1 - ln;
while (checkStr >= uh) {
if ((*checkStr == un[0])
&& (0 == memcmp(checkStr+1, un+1, (ln-1)*sizeof(Tcl_UniChar)))) {
value = (checkStr - uh);
goto lastEnd;
}
check--;
checkStr--;
}
lastEnd:
TclNewIntObj(result, value);
@@ -3830,7 +3833,7 @@ TclStringReverse(
char *to, *from = objPtr->bytes;
if (!inPlace || Tcl_IsShared(objPtr)) {
objPtr = Tcl_NewObj();
TclNewObj(objPtr);
Tcl_SetObjLength(objPtr, numBytes);
}
to = objPtr->bytes;
+3 -3
View File
@@ -59,15 +59,15 @@ typedef struct {
* space allocated for the unicode array. */
int hasUnicode; /* Boolean determining whether the string has
* a Unicode representation. */
Tcl_UniChar unicode[1]; /* The array of Unicode chars. The actual size
Tcl_UniChar unicode[TCLFLEXARRAY]; /* The array of Unicode chars. The actual size
* of this field depends on the 'maxChars'
* field above. */
} String;
#define STRING_MAXCHARS \
(int)(((size_t)UINT_MAX - sizeof(String))/sizeof(Tcl_UniChar))
(int)(((size_t)UINT_MAX - 1 - offsetof(String, unicode))/sizeof(Tcl_UniChar))
#define STRING_SIZE(numChars) \
(sizeof(String) + ((numChars) * sizeof(Tcl_UniChar)))
(offsetof(String, unicode) + ((numChars + 1) * sizeof(Tcl_UniChar)))
#define stringCheckLimits(numChars) \
do { \
if ((numChars) < 0 || (numChars) > STRING_MAXCHARS) { \
+23 -1
View File
@@ -67,6 +67,8 @@
#undef TclWinNToHS
#undef TclStaticPackage
#undef Tcl_BackgroundError
#undef TclGuessPackageName
#undef TclGetLoadedPackages
#define TclStaticPackage Tcl_StaticPackage
#undef Tcl_UniCharToUtfDString
#undef Tcl_UtfToUniCharDString
@@ -261,8 +263,28 @@ mp_err TclBN_mp_mul_d(const mp_int *a, unsigned int b, mp_int *c) {
# define Tcl_ChannelCloseProc 0
# define Tcl_Close 0
# define Tcl_MacOSXOpenBundleResources 0
# define TclGuessPackageName 0
# define TclGetLoadedPackages 0
#else
#define TclGuessPackageName guessPackageName
static int TclGuessPackageName(
TCL_UNUSED(const char *),
TCL_UNUSED(Tcl_DString *)) {
return 0;
}
#define TclGetLoadedPackages getLoadedPackages
static int TclGetLoadedPackages(
Tcl_Interp *interp, /* Interpreter in which to return information
* or error message. */
const char *targetName) /* Name of target interpreter or NULL. If
* NULL, return info about all interps;
* otherwise, just return info about this
* interpreter. */
{
return TclGetLoadedPackagesEx(interp, targetName, NULL);
}
mp_err TclBN_mp_div_3(const mp_int *a, mp_int *c, unsigned int *d) {
mp_digit d2;
mp_err result = mp_div_d(a, 3, c, &d2);
@@ -450,7 +472,7 @@ void *TclWinGetTclInstance()
int
TclpGetPid(Tcl_Pid pid)
{
return (int) (size_t) pid;
return (int)(size_t)pid;
}
#if !defined(TCL_NO_DEPRECATED) && TCL_MAJOR_VERSION < 9
+4 -10
View File
@@ -3206,7 +3206,7 @@ TestlinkarrayCmd(
static const char *LinkOption[] = {
"update", "remove", "create", NULL
};
enum LinkOption { LINK_UPDATE, LINK_REMOVE, LINK_CREATE };
enum LinkOptionEnum { LINK_UPDATE, LINK_REMOVE, LINK_CREATE };
static const char *LinkType[] = {
"char", "uchar", "short", "ushort", "int", "uint", "long", "ulong",
"wide", "uwide", "float", "double", "string", "char*", "binary", NULL
@@ -3231,7 +3231,7 @@ TestlinkarrayCmd(
&optionIndex) != TCL_OK) {
return TCL_ERROR;
}
switch ((enum LinkOption) optionIndex) {
switch ((enum LinkOptionEnum) optionIndex) {
case LINK_UPDATE:
for (i=2; i<objc; i++) {
Tcl_UpdateLinkedVar(interp, Tcl_GetString(objv[i]));
@@ -3797,7 +3797,7 @@ TestregexpObjCmd(
"-xflags",
"--", NULL
};
enum options {
enum optionsEnum {
REGEXP_INDICES, REGEXP_NOCASE, REGEXP_ABOUT, REGEXP_EXPANDED,
REGEXP_MULTI, REGEXP_NOCROSS, REGEXP_NEWL,
REGEXP_XFLAGS,
@@ -3822,7 +3822,7 @@ TestregexpObjCmd(
&index) != TCL_OK) {
return TCL_ERROR;
}
switch ((enum options) index) {
switch ((enum optionsEnum) index) {
case REGEXP_INDICES:
indices = 1;
break;
@@ -7488,8 +7488,6 @@ TestconcatobjCmd(
"\n\t* (e) concatObj does not have refCount 0", NULL);
}
if (concatPtr == tmpPtr) {
int len;
result = TCL_ERROR;
Tcl_AppendResult(interp, "\n\t* (e) concatObj is not a new obj ",
NULL);
@@ -7520,8 +7518,6 @@ TestconcatobjCmd(
"\n\t* (f) concatObj does not have refCount 0", NULL);
}
if (concatPtr == tmpPtr) {
int len;
result = TCL_ERROR;
Tcl_AppendResult(interp, "\n\t* (f) concatObj is not a new obj ",
NULL);
@@ -7553,8 +7549,6 @@ TestconcatobjCmd(
"\n\t* (g) concatObj does not have refCount 0", NULL);
}
if (concatPtr == tmpPtr) {
int len;
result = TCL_ERROR;
Tcl_AppendResult(interp, "\n\t* (g) concatObj is not a new obj ",
NULL);
+1 -1
View File
@@ -413,7 +413,7 @@ ThreadObjCmd(
Tcl_WrongNumArgs(interp, 2, objv, NULL);
return TCL_ERROR;
}
Tcl_SetObjResult(interp, Tcl_NewIntObj(
Tcl_SetObjResult(interp, Tcl_NewWideIntObj(
Tcl_DoOneEvent(TCL_ALL_EVENTS | TCL_DONT_WAIT)));
return TCL_OK;
}
+5 -3
View File
@@ -792,7 +792,7 @@ Tcl_AfterObjCmd(
static const char *const afterSubCmds[] = {
"cancel", "idle", "info", NULL
};
enum afterSubCmds {AFTER_CANCEL, AFTER_IDLE, AFTER_INFO};
enum afterSubCmdsEnum {AFTER_CANCEL, AFTER_IDLE, AFTER_INFO};
ThreadSpecificData *tsdPtr = InitTimer();
if (objc < 2) {
@@ -942,8 +942,9 @@ Tcl_AfterObjCmd(
break;
case AFTER_INFO:
if (objc == 2) {
Tcl_Obj *resultObj = Tcl_NewObj();
Tcl_Obj *resultObj;
TclNewObj(resultObj);
for (afterPtr = assocPtr->firstAfterPtr; afterPtr != NULL;
afterPtr = afterPtr->nextPtr) {
if (assocPtr->interp == interp) {
@@ -967,8 +968,9 @@ Tcl_AfterObjCmd(
Tcl_SetErrorCode(interp, "TCL","LOOKUP","EVENT", eventStr, NULL);
return TCL_ERROR;
} else {
Tcl_Obj *resultListPtr = Tcl_NewObj();
Tcl_Obj *resultListPtr;
TclNewObj(resultListPtr);
Tcl_ListObjAppendElement(interp, resultListPtr,
afterPtr->commandPtr);
Tcl_ListObjAppendElement(interp, resultListPtr, Tcl_NewStringObj(
+6 -7
View File
@@ -202,7 +202,7 @@ Tcl_TraceObjCmd(
NULL
};
/* 'OLD' options are pre-Tcl-8.4 style */
enum traceOptions {
enum traceOptionsEnum {
TRACE_ADD, TRACE_INFO, TRACE_REMOVE,
#ifndef TCL_REMOVE_OBSOLETE_TRACES
TRACE_OLD_VARIABLE, TRACE_OLD_VDELETE, TRACE_OLD_VINFO
@@ -218,7 +218,7 @@ Tcl_TraceObjCmd(
&optionIndex) != TCL_OK) {
return TCL_ERROR;
}
switch ((enum traceOptions) optionIndex) {
switch ((enum traceOptionsEnum) optionIndex) {
case TRACE_ADD:
case TRACE_REMOVE: {
/*
@@ -276,7 +276,7 @@ Tcl_TraceObjCmd(
return TCL_ERROR;
}
opsList = Tcl_NewObj();
TclNewObj(opsList);
Tcl_IncrRefCount(opsList);
flagOps = TclGetStringFromObj(objv[3], &numFlags);
if (numFlags == 0) {
@@ -320,7 +320,7 @@ Tcl_TraceObjCmd(
Tcl_WrongNumArgs(interp, 2, objv, "name");
return TCL_ERROR;
}
resultListPtr = Tcl_NewObj();
TclNewObj(resultListPtr);
name = Tcl_GetString(objv[2]);
FOREACH_VAR_TRACE(interp, name, clientData) {
TraceVarInfo *tvarPtr = (TraceVarInfo *)clientData;
@@ -965,7 +965,7 @@ TraceVariableObjCmd(
return TCL_ERROR;
}
resultListPtr = Tcl_NewObj();
TclNewObj(resultListPtr);
name = Tcl_GetString(objv[3]);
FOREACH_VAR_TRACE(interp, name, clientData) {
Tcl_Obj *opObjPtr, *eachTraceObjPtr, *elemObjPtr;
@@ -1177,7 +1177,7 @@ Tcl_UntraceCommand(
CommandTrace *tracePtr;
CommandTrace *prevPtr;
Command *cmdPtr;
Interp *iPtr = (Interp *) interp;
Interp *iPtr = (Interp *)interp;
ActiveCommandTrace *activePtr;
int hasExecTraces = 0;
@@ -1252,7 +1252,6 @@ Tcl_UntraceCommand(
*/
if (cmdPtr->compileProc != NULL) {
Interp *iPtr = (Interp *) interp;
iPtr->compileEpoch++;
}
}
+11 -12
View File
@@ -2040,7 +2040,7 @@ Tcl_ConcatObj(
}
}
if (!resPtr) {
resPtr = Tcl_NewObj();
TclNewObj(resPtr);
}
return resPtr;
}
@@ -3757,7 +3757,7 @@ GetEndOffsetFromObj(
if (*bytes != 'e') {
int numType;
const char *opPtr;
int length, t1 = 0, t2 = 0;
int t1 = 0, t2 = 0;
/* Value doesn't start with "e" */
@@ -3774,7 +3774,7 @@ GetEndOffsetFromObj(
* Quick scan to see if multi-value list is even possible.
* This relies on TclGetString() returning a NUL-terminated string.
*/
if ((TclMaxListLength(TclGetString(objPtr), -1, NULL) > 1)
if ((TclMaxListLength(bytes, -1, NULL) > 1)
/* If it's possible, do the full list parse. */
&& (TCL_OK == Tcl_ListObjLength(NULL, objPtr, &length))
@@ -3817,7 +3817,7 @@ GetEndOffsetFromObj(
if ((t1 == TCL_NUMBER_INT) && (t2 == TCL_NUMBER_INT)) {
/* Both are wide, do wide-integer math */
if (*opPtr == '-') {
if ((w2 == WIDE_MIN) && (interp != NULL)) {
if (w2 == WIDE_MIN) {
goto extreme;
}
w2 = -w2;
@@ -3839,13 +3839,6 @@ GetEndOffsetFromObj(
offset = WIDE_MIN;
}
}
} else if (interp == NULL) {
/*
* We use an interp to do bignum index calculations.
* If we don't get one, call all indices with bignums errors,
* and rely on callers to handle it.
*/
goto parseError;
} else {
/*
* At least one is big, do bignum math. Little reason to
@@ -3856,7 +3849,13 @@ GetEndOffsetFromObj(
Tcl_Obj *sum;
extreme:
Tcl_ExprObj(interp, objPtr, &sum);
if (interp) {
Tcl_ExprObj(interp, objPtr, &sum);
} else {
Tcl_Interp *compute = Tcl_CreateInterp();
Tcl_ExprObj(compute, objPtr, &sum);
Tcl_DeleteInterp(compute);
}
TclGetNumberFromObj(NULL, sum, &cd, &numType);
if (numType == TCL_NUMBER_INT) {
+40 -39
View File
@@ -119,17 +119,17 @@ VarHashNextVar(
* access is denied.
*/
static const char *noSuchVar = "no such variable";
static const char *isArray = "variable is array";
static const char *needArray = "variable isn't array";
static const char *noSuchElement = "no such element in array";
static const char *danglingElement =
static const char NOSUCHVAR[] = "no such variable";
static const char ISARRAY[] = "variable is array";
static const char NEEDARRAY[] = "variable isn't array";
static const char NOSUCHELEMENT[] = "no such element in array";
static const char DANGLINGELEMENT[] =
"upvar refers to element in deleted array";
static const char *danglingVar =
static const char DANGLINGVAR[] =
"upvar refers to variable in deleted namespace";
static const char *badNamespace = "parent namespace doesn't exist";
static const char *missingName = "missing variable name";
static const char *isArrayElement =
static const char BADNAMESPACE[] = "parent namespace doesn't exist";
static const char MISSINGNAME[] = "missing variable name";
static const char ISARRAYELEMENT[] =
"name refers to an element in an array";
/*
@@ -649,7 +649,7 @@ TclObjLookupVarEx(
if (flags & TCL_LEAVE_ERR_MSG) {
TclObjVarErrMsg(interp, part1Ptr, part2Ptr, msg,
noSuchVar, -1);
NOSUCHVAR, -1);
Tcl_SetErrorCode(interp, "TCL", "VALUE", "VARNAME", NULL);
}
return NULL;
@@ -674,7 +674,7 @@ TclObjLookupVarEx(
if (part2Ptr != NULL) {
if (flags & TCL_LEAVE_ERR_MSG) {
TclObjVarErrMsg(interp, part1Ptr, part2Ptr, msg,
needArray, -1);
NEEDARRAY, -1);
Tcl_SetErrorCode(interp, "TCL", "VALUE", "VARNAME",
NULL);
}
@@ -939,7 +939,7 @@ TclLookupSimpleVar(
Tcl_Obj *tailPtr;
if (!create) { /* Var wasn't found and not to create it. */
*errMsgPtr = noSuchVar;
*errMsgPtr = NOSUCHVAR;
return NULL;
}
@@ -950,10 +950,10 @@ TclLookupSimpleVar(
TclGetNamespaceForQualName(interp, varName, cxtNsPtr, flags,
&varNsPtr, &dummy1Ptr, &dummy2Ptr, &tail);
if (varNsPtr == NULL) {
*errMsgPtr = badNamespace;
*errMsgPtr = BADNAMESPACE;
return NULL;
} else if (tail == NULL) {
*errMsgPtr = missingName;
*errMsgPtr = MISSINGNAME;
return NULL;
}
if (tail != varName) {
@@ -1010,7 +1010,7 @@ TclLookupSimpleVar(
varPtr = VarHashFindVar(tablePtr, varNamePtr);
}
if (varPtr == NULL) {
*errMsgPtr = noSuchVar;
*errMsgPtr = NOSUCHVAR;
}
}
}
@@ -1088,7 +1088,7 @@ TclLookupArrayElement(
if (!createArray) {
if (flags & TCL_LEAVE_ERR_MSG) {
TclObjVarErrMsg(interp, arrayNamePtr, elNamePtr, msg,
noSuchVar, index);
NOSUCHVAR, index);
Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "VARNAME",
arrayNamePtr?TclGetString(arrayNamePtr):NULL, NULL);
}
@@ -1103,7 +1103,7 @@ TclLookupArrayElement(
if (TclIsVarDeadHash(arrayPtr)) {
if (flags & TCL_LEAVE_ERR_MSG) {
TclObjVarErrMsg(interp, arrayNamePtr, elNamePtr, msg,
danglingVar, index);
DANGLINGVAR, index);
Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "VARNAME",
arrayNamePtr?TclGetString(arrayNamePtr):NULL, NULL);
}
@@ -1113,7 +1113,7 @@ TclLookupArrayElement(
TclInitArrayVar(arrayPtr);
} else if (!TclIsVarArray(arrayPtr)) {
if (flags & TCL_LEAVE_ERR_MSG) {
TclObjVarErrMsg(interp, arrayNamePtr, elNamePtr, msg, needArray,
TclObjVarErrMsg(interp, arrayNamePtr, elNamePtr, msg, NEEDARRAY,
index);
Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "VARNAME",
arrayNamePtr?TclGetString(arrayNamePtr):NULL, NULL);
@@ -1135,7 +1135,7 @@ TclLookupArrayElement(
if (varPtr == NULL) {
if (flags & TCL_LEAVE_ERR_MSG) {
TclObjVarErrMsg(interp, arrayNamePtr, elNamePtr, msg,
noSuchElement, index);
NOSUCHELEMENT, index);
Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "ELEMENT",
TclGetString(elNamePtr), NULL);
}
@@ -1485,11 +1485,11 @@ TclPtrGetVarIdx(
if (flags & TCL_LEAVE_ERR_MSG) {
if (TclIsVarUndefined(varPtr) && arrayPtr
&& !TclIsVarUndefined(arrayPtr)) {
msg = noSuchElement;
msg = NOSUCHELEMENT;
} else if (TclIsVarArray(varPtr)) {
msg = isArray;
msg = ISARRAY;
} else {
msg = noSuchVar;
msg = NOSUCHVAR;
}
TclObjVarErrMsg(interp, part1Ptr, part2Ptr, "read", msg, index);
}
@@ -2024,11 +2024,11 @@ TclPtrSetVarIdx(
if (flags & TCL_LEAVE_ERR_MSG) {
if (TclIsVarArrayElement(varPtr)) {
TclObjVarErrMsg(interp, part1Ptr, part2Ptr, "set",
danglingElement, index);
DANGLINGELEMENT, index);
Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "ELEMENT", NULL);
} else {
TclObjVarErrMsg(interp, part1Ptr, part2Ptr, "set",
danglingVar, index);
DANGLINGVAR, index);
Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "VARNAME", NULL);
}
}
@@ -2041,7 +2041,7 @@ TclPtrSetVarIdx(
if (TclIsVarArray(varPtr)) {
if (flags & TCL_LEAVE_ERR_MSG) {
TclObjVarErrMsg(interp, part1Ptr, part2Ptr, "set", isArray,index);
TclObjVarErrMsg(interp, part1Ptr, part2Ptr, "set", ISARRAY,index);
Tcl_SetErrorCode(interp, "TCL", "WRITE", "ARRAY", NULL);
}
goto earlyError;
@@ -2609,7 +2609,7 @@ TclPtrUnsetVarIdx(
if (result != TCL_OK) {
if (flags & TCL_LEAVE_ERR_MSG) {
TclObjVarErrMsg(interp, part1Ptr, part2Ptr, "unset",
((arrayPtr == NULL) ? noSuchVar : noSuchElement), index);
((arrayPtr == NULL) ? NOSUCHVAR : NOSUCHELEMENT), index);
Tcl_SetErrorCode(interp, "TCL", "UNSET", "VARNAME", NULL);
}
}
@@ -3917,7 +3917,7 @@ ArrayNamesCmd(
static const char *const options[] = {
"-exact", "-glob", "-regexp", NULL
};
enum options { OPT_EXACT, OPT_GLOB, OPT_REGEXP };
enum arrayNamesOptionsEnum { OPT_EXACT, OPT_GLOB, OPT_REGEXP };
Var *varPtr, *varPtr2;
Tcl_Obj *nameObj, *resultObj, *patternObj;
Tcl_HashSearch search;
@@ -3985,7 +3985,7 @@ ArrayNamesCmd(
const char *name = TclGetString(nameObj);
int matched = 0;
switch ((enum options) mode) {
switch ((enum arrayNamesOptionsEnum) mode) {
case OPT_EXACT:
Tcl_Panic("exact matching shouldn't get here");
case OPT_GLOB:
@@ -4104,7 +4104,7 @@ ArraySetCmd(
}
if (arrayPtr) {
CleanupVar(varPtr, arrayPtr);
TclObjVarErrMsg(interp, arrayNameObj, NULL, "set", needArray, -1);
TclObjVarErrMsg(interp, arrayNameObj, NULL, "set", NEEDARRAY, -1);
Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "VARNAME",
TclGetString(arrayNameObj), NULL);
return TCL_ERROR;
@@ -4223,7 +4223,7 @@ ArraySetCmd(
*/
TclObjVarErrMsg(interp, arrayNameObj, NULL, "array set",
needArray, -1);
NEEDARRAY, -1);
Tcl_SetErrorCode(interp, "TCL", "WRITE", "ARRAY", NULL);
return TCL_ERROR;
}
@@ -4286,7 +4286,7 @@ ArraySizeCmd(
}
}
Tcl_SetObjResult(interp, Tcl_NewIntObj(size));
Tcl_SetObjResult(interp, Tcl_NewWideIntObj(size));
return TCL_OK;
}
@@ -5124,7 +5124,7 @@ Tcl_VariableObjCmd(
*/
TclObjVarErrMsg(interp, varNamePtr, NULL, "define",
isArrayElement, -1);
ISARRAYELEMENT, -1);
Tcl_SetErrorCode(interp, "TCL", "UPVAR", "LOCAL_ELEMENT", NULL);
return TCL_ERROR;
}
@@ -5451,7 +5451,8 @@ TclDeleteNamespaceVars(
for (varPtr = VarHashFirstVar(tablePtr, &search); varPtr != NULL;
varPtr = VarHashFirstVar(tablePtr, &search)) {
Tcl_Obj *objPtr = Tcl_NewObj();
Tcl_Obj *objPtr;
TclNewObj(objPtr);
VarHashRefCount(varPtr)++; /* Make sure we get to remove from
* hash. */
Tcl_GetVariableFullName(interp, (Tcl_Var) varPtr, objPtr);
@@ -6120,7 +6121,7 @@ TclInfoVarsCmd(
if (!TclIsVarUndefined(varPtr)
|| TclIsVarNamespaceVar(varPtr)) {
if (specificNsInPattern) {
elemObjPtr = Tcl_NewObj();
TclNewObj(elemObjPtr);
Tcl_GetVariableFullName(interp, (Tcl_Var) varPtr,
elemObjPtr);
} else {
@@ -6153,7 +6154,7 @@ TclInfoVarsCmd(
if ((simplePattern == NULL)
|| Tcl_StringMatch(varName, simplePattern)) {
if (specificNsInPattern) {
elemObjPtr = Tcl_NewObj();
TclNewObj(elemObjPtr);
Tcl_GetVariableFullName(interp, (Tcl_Var) varPtr,
elemObjPtr);
} else {
@@ -6634,7 +6635,7 @@ ArrayDefaultCmd(
static const char *const options[] = {
"get", "set", "exists", "unset", NULL
};
enum options { OPT_GET, OPT_SET, OPT_EXISTS, OPT_UNSET };
enum arrayDefaultOptionsEnum { OPT_GET, OPT_SET, OPT_EXISTS, OPT_UNSET };
Tcl_Obj *arrayNameObj, *defaultValueObj;
Var *varPtr, *arrayPtr;
int isArray, option;
@@ -6658,7 +6659,7 @@ ArrayDefaultCmd(
return TCL_ERROR;
}
switch (option) {
switch ((enum arrayDefaultOptionsEnum)option) {
case OPT_GET:
if (objc != 3) {
Tcl_WrongNumArgs(interp, 2, objv, "arrayName");
@@ -6701,7 +6702,7 @@ ArrayDefaultCmd(
CleanupVar(varPtr, arrayPtr);
TclObjVarErrMsg(interp, arrayNameObj, NULL, "array default set",
needArray, -1);
NEEDARRAY, -1);
Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "VARNAME",
TclGetString(arrayNameObj), NULL);
return TCL_ERROR;
@@ -6712,7 +6713,7 @@ ArrayDefaultCmd(
*/
TclObjVarErrMsg(interp, arrayNameObj, NULL, "array default set",
needArray, -1);
NEEDARRAY, -1);
Tcl_SetErrorCode(interp, "TCL", "WRITE", "ARRAY", NULL);
return TCL_ERROR;
}
+4 -4
View File
@@ -3238,7 +3238,7 @@ ZipFSTclLibraryObjCmd(
Tcl_Obj *pResult = TclZipfs_TclLibrary();
if (!pResult) {
pResult = Tcl_NewObj();
TclNewObj(pResult);
}
Tcl_SetObjResult(interp, pResult);
}
@@ -4485,13 +4485,13 @@ ZipFSFileAttrsGetProc(
}
switch (index) {
case 0:
*objPtrRef = Tcl_NewWideIntObj(z->numBytes);
TclNewIntObj(*objPtrRef, z->numBytes);
break;
case 1:
*objPtrRef = Tcl_NewWideIntObj(z->numCompressedBytes);
TclNewIntObj(*objPtrRef, z->numCompressedBytes);
break;
case 2:
*objPtrRef = Tcl_NewWideIntObj(z->offset);
TclNewIntObj(*objPtrRef, z->offset);
break;
case 3:
*objPtrRef = Tcl_NewStringObj(z->zipFilePtr->mountPoint,
+13 -12
View File
@@ -354,7 +354,7 @@ ConvertErrorToList(
return Tcl_NewListObj(4, objv);
case Z_NEED_DICT:
TclNewLiteralStringObj(objv[2], "NEED_DICT");
objv[3] = Tcl_NewWideIntObj((Tcl_WideInt) adler);
TclNewIntObj(objv[3], (Tcl_WideInt)adler);
return Tcl_NewListObj(4, objv);
/*
@@ -2162,7 +2162,7 @@ ZlibCmd(
break;
case 1:
headerVarObj = objv[i+1];
headerDictObj = Tcl_NewObj();
TclNewObj(headerDictObj);
break;
}
}
@@ -2398,7 +2398,7 @@ ZlibPushSubcmd(
"-dictionary", "-header", "-level", "-limit", NULL
};
const char *const *pushOptions = pushDecompressOptions;
enum pushOptions {poDictionary, poHeader, poLevel, poLimit};
enum pushOptionsEnum {poDictionary, poHeader, poLevel, poLimit};
Tcl_Obj *headerObj = NULL, *compDictObj = NULL;
int limit = DEFAULT_BUFFER_SIZE, dummy;
@@ -2480,7 +2480,7 @@ ZlibPushSubcmd(
Tcl_SetErrorCode(interp, "TCL", "ZIP", "NOVAL", NULL);
return TCL_ERROR;
}
switch ((enum pushOptions) option) {
switch ((enum pushOptionsEnum) option) {
case poHeader:
headerObj = objv[i];
if (Tcl_DictObjSize(interp, headerObj, &dummy) != TCL_OK) {
@@ -2703,21 +2703,21 @@ ZlibStreamAddCmd(
switch ((enum addOptions) index) {
case ao_flush: /* -flush */
if (flush > -1) {
if (flush >= 0) {
flush = -2;
} else {
flush = Z_SYNC_FLUSH;
}
break;
case ao_fullflush: /* -fullflush */
if (flush > -1) {
if (flush >= 0) {
flush = -2;
} else {
flush = Z_FULL_FLUSH;
}
break;
case ao_finalize: /* -finalize */
if (flush > -1) {
if (flush >= 0) {
flush = -2;
} else {
flush = Z_FINISH;
@@ -2830,21 +2830,21 @@ ZlibStreamPutCmd(
switch ((enum putOptions) index) {
case po_flush: /* -flush */
if (flush > -1) {
if (flush >= 0) {
flush = -2;
} else {
flush = Z_SYNC_FLUSH;
}
break;
case po_fullflush: /* -fullflush */
if (flush > -1) {
if (flush >= 0) {
flush = -2;
} else {
flush = Z_FULL_FLUSH;
}
break;
case po_finalize: /* -finalize */
if (flush > -1) {
if (flush >= 0) {
flush = -2;
} else {
flush = Z_FINISH;
@@ -3484,8 +3484,9 @@ ZlibTransformGetOption(
if ((cd->flags & IN_HEADER) && ((optionName == NULL) ||
(strcmp(optionName, "-header") == 0))) {
Tcl_Obj *tmpObj = Tcl_NewObj();
Tcl_Obj *tmpObj;
TclNewObj(tmpObj);
ExtractHeader(&cd->inHeader.header, tmpObj);
if (optionName == NULL) {
Tcl_DStringAppendElement(dsPtr, "-header");
@@ -3944,7 +3945,7 @@ TclZlibInit(
cfg[0].key = "zlibVersion";
cfg[0].value = zlibVersion();
cfg[1].key = NULL;
Tcl_RegisterConfig(interp, "zlib", cfg, "iso8859-1");
Tcl_RegisterConfig(interp, "zlib", cfg, "utf-8");
/*
* Allow command type introspection to do something sensible with streams.
+4
View File
@@ -265,6 +265,7 @@ proc auto_mkindex {dir args} {
auto_mkindex_parser::cleanup
set fid [open "tclIndex" w]
fconfigure $fid -translation lf
puts -nonewline $fid $index
close $fid
cd $oldDir
@@ -291,6 +292,7 @@ proc auto_mkindex_old {dir args} {
set f ""
set error [catch {
set f [open $file]
fconfigure $f -eofchar \032
while {[gets $f line] >= 0} {
if {[regexp {^proc[ ]+([^ ]*)} $line match procName]} {
set procName [lindex [auto_qualify $procName "::"] 0]
@@ -309,6 +311,7 @@ proc auto_mkindex_old {dir args} {
set f ""
set error [catch {
set f [open tclIndex w]
fconfigure $f -translation lf
puts -nonewline $f $index
close $f
cd $oldDir
@@ -401,6 +404,7 @@ proc auto_mkindex_parser::mkindex {file} {
set scriptFile $file
set fid [open $file]
fconfigure $fid -eofchar \032
set contents [read $fid]
close $fid
+1 -1
View File
@@ -3314,7 +3314,7 @@ proc ::tcl::clock::LoadTimeZoneFile { fileName } {
"time zone \":$fileName\" not valid"
}
try {
source -encoding utf-8 [file join $DataDir $fileName]
source [file join $DataDir $fileName]
} on error {} {
return -code error \
-errorcode [list CLOCK badTimeZone :$fileName] \
+1 -1
View File
@@ -1,3 +1,3 @@
if {![package vsatisfies [package provide Tcl] 8.5-]} return
if {[info sharedlibextension] != ".dll"} return
package ifneeded dde 1.4.3 [list load [file join $dir tcldde14.dll] dde]
package ifneeded dde 1.4.3 [list load [file join $dir tcldde14.dll] Dde]
+7 -7
View File
@@ -11,7 +11,7 @@
package require Tcl 8.6-
# Keep this in sync with pkgIndex.tcl and with the install directories in
# Makefiles
package provide http 2.9.5
package provide http 2.10.0a1
namespace eval http {
# Allow resourcing to not clobber existing data
@@ -544,7 +544,7 @@ proc http::CloseSocket {s {token {}}} {
} else {
set map [array get socketMapping]
set ndx [lsearch -exact $map $s]
if {$ndx != -1} {
if {$ndx >= 0} {
incr ndx -1
set connId [lindex $map $ndx]
}
@@ -746,6 +746,7 @@ proc http::geturl {url args} {
-strict boolean
-timeout integer
-validate boolean
-headers dict
}
set state(charset) $defaultCharset
set options {
@@ -759,9 +760,8 @@ proc http::geturl {url args} {
foreach {flag value} $args {
if {[regexp -- $pat $flag]} {
# Validate numbers
if {
[info exists type($flag)] &&
![string is $type($flag) -strict $value]
if {($flag eq "-headers") ? [catch {dict size $value}] :
([info exists type($flag)] && ![string is $type($flag) -strict $value])
} {
unset $token
return -code error \
@@ -2791,7 +2791,7 @@ proc http::Event {sock token} {
# scan any list for "close".
if {$tmpHeader in {close keep-alive}} {
# The common cases, continue.
} elseif {[string first , $tmpHeader] == -1} {
} elseif {[string first , $tmpHeader] < 0} {
# Not a comma-separated list, not "close",
# therefore "keep-alive".
set tmpHeader keep-alive
@@ -3244,7 +3244,7 @@ proc http::BlockingGets {sock} {
while 1 {
set count [gets $sock line]
set eof [eof $sock]
if {$count > -1 || $eof} {
if {$count >= 0 || $eof} {
return $line
} else {
yield
+1 -1
View File
@@ -1,2 +1,2 @@
if {![package vsatisfies [package provide Tcl] 8.6-]} {return}
package ifneeded http 2.9.5 [list tclPkgSetup $dir http 2.9.5 {{http.tcl source {::http::config ::http::formatQuery ::http::geturl ::http::reset ::http::wait ::http::register ::http::unregister ::http::mapReply}}}]
package ifneeded http 2.10.0a1 [list tclPkgSetup $dir http 2.10.0a1 {{http.tcl source {::http::config ::http::formatQuery ::http::geturl ::http::reset ::http::wait ::http::register ::http::unregister ::http::mapReply}}}]
+4 -3
View File
@@ -112,7 +112,7 @@ if {[interp issafe]} {
foreach cmd {add format scan} {
proc ::tcl::clock::$cmd args {
variable TclLibDir
source -encoding utf-8 [file join $TclLibDir clock.tcl]
source [file join $TclLibDir clock.tcl]
return [uplevel 1 [info level 0]]
}
}
@@ -245,7 +245,7 @@ proc unknown args {
set errInfo [string range $errInfo 0 $last-1]
set tail "\"$cinfo\""
set last [string last $tail $errInfo]
if {$last + [string length $tail] != [string length $errInfo]} {
if {$last < 0 || $last + [string length $tail] != [string length $errInfo]} {
return -code error -errorcode $errCode \
-errorinfo $errInfo $msg
}
@@ -442,6 +442,7 @@ proc auto_load_index {} {
continue
} else {
set error [catch {
fconfigure $f -eofchar \032
set id [gets $f]
if {$id eq "# Tcl autoload index file, version 2.0"} {
eval [read $f]
@@ -742,7 +743,7 @@ proc tcl::CopyDirectory {action src dest} {
}
}
} else {
if {[string first $nsrc $ndest] != -1} {
if {[string first $nsrc $ndest] >= 0} {
set srclen [expr {[llength [file split $nsrc]] - 1}]
set ndest [lindex [file split $ndest] $srclen]
if {$ndest eq [file tail $nsrc]} {
+3
View File
@@ -35,6 +35,7 @@ proc ::practcl::_pkgindex_directory {path} {
# Read the file, and override assumptions as needed
###
set fin [open $file r]
fconfigure $fin -eofchar \032
set dat [read $fin]
close $fin
# Look for a teapot style Package statement
@@ -58,6 +59,7 @@ proc ::practcl::_pkgindex_directory {path} {
foreach file [glob -nocomplain $path/*.tcl] {
if { [file tail $file] == "version_info.tcl" } continue
set fin [open $file r]
fconfigure $fin -eofchar \032
set dat [read $fin]
close $fin
if {![regexp "package provide" $dat]} continue
@@ -77,6 +79,7 @@ proc ::practcl::_pkgindex_directory {path} {
return $buffer
}
set fin [open $pkgidxfile r]
fconfigure $fin -eofchar \032
set dat [read $fin]
close $fin
set trace 0
+1 -1
View File
@@ -5,7 +5,7 @@ apply {{dir} {
set ::test [info script]
set isafe [interp issafe]
foreach {safe package version file} {
0 http 2.9.5 {http http.tcl}
0 http 2.10.0a1 {http http.tcl}
1 msgcat 1.7.1 {msgcat msgcat.tcl}
1 opt 0.4.8 {opt optparse.tcl}
0 cookiejar 0.2.0 {cookiejar cookiejar.tcl}
+1
View File
@@ -409,6 +409,7 @@ proc pkg_mkIndex {args} {
}
set f [open [file join $dir pkgIndex.tcl] w]
fconfigure $f -translation lf
puts $f $index
close $f
}
+1 -1
View File
@@ -1,4 +1,4 @@
if {![package vsatisfies [package provide Tcl] 8.5-]} return
if {[info sharedlibextension] != ".dll"} return
package ifneeded registry 1.3.5 \
[list load [file join $dir tclreg13.dll] registry]
[list load [file join $dir tclreg13.dll] Registry]

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