Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
24a416ad38 | ||
|
|
5c61b2bbdc | ||
|
|
14276a3feb | ||
|
|
9eeda3feb2 | ||
|
|
1eeefb073a | ||
|
|
f0ead2e309 | ||
|
|
0c37363fff | ||
|
|
c7814dd59f | ||
|
|
730152b608 | ||
|
|
904ba06b0a | ||
|
|
fc3487d2b2 | ||
|
|
5eb39e3973 | ||
|
|
5c1a56d36b | ||
|
|
1fb8e115c4 | ||
|
|
e2bcebca79 | ||
|
|
471091f55a | ||
|
|
958180f361 | ||
|
|
5c380477df | ||
|
|
8c3eb78cf7 | ||
|
|
73cc9cd62f | ||
|
|
c11eec4d5d | ||
|
|
0f3e54cedb | ||
|
|
2a89abd783 | ||
|
|
55b841549a | ||
|
|
b1791f0b92 | ||
|
|
517974e23b | ||
|
|
6f55ec4986 | ||
|
|
225b4e7cc0 | ||
|
|
4ee1ddaeaa | ||
|
|
f06c1e0ba4 | ||
|
|
cac60f04fc | ||
|
|
944694962a | ||
|
|
61962d02f5 | ||
|
|
f05d9af86d | ||
|
|
c8c1298bb3 | ||
|
|
f58b90fb02 | ||
|
|
64fdac4aec | ||
|
|
ee66478056 | ||
|
|
56f2fc4f04 | ||
|
|
782689d5eb | ||
|
|
57321fa4a4 | ||
|
|
667676a551 | ||
|
|
7c48658c9f | ||
|
|
bfed58b030 | ||
|
|
e6800a165c | ||
|
|
b20939682d | ||
|
|
05776cbb41 | ||
|
|
92c8a53689 | ||
|
|
c15121ae96 | ||
|
|
b9f442e8b2 | ||
|
|
ff928c6450 | ||
|
|
ad096310ec | ||
|
|
e03aa95407 | ||
|
|
5dab8a0c6b | ||
|
|
05ed23d325 | ||
|
|
220ee76c14 | ||
|
|
0f71efe445 | ||
|
|
7eeeb51309 | ||
|
|
e403afa147 | ||
|
|
a3906f4953 | ||
|
|
12d3b15f30 | ||
|
|
668c35bfc2 | ||
|
|
33c6ac50b3 | ||
|
|
a3728e6d82 | ||
|
|
35ec25a6cf | ||
|
|
eb5163d9e8 | ||
|
|
3262fa4d4e | ||
|
|
37ad5db296 | ||
|
|
9169847966 | ||
|
|
eb08a10e38 | ||
|
|
d59509dee2 | ||
|
|
e446f6c309 | ||
|
|
3101fc1da1 | ||
|
|
9a78221b8d | ||
|
|
939c35f568 | ||
|
|
c6135def08 | ||
|
|
9b0b0dc37d | ||
|
|
41e035d59b | ||
|
|
46a6094df7 | ||
|
|
a8e3a2a3a8 | ||
|
|
6a4eb9df57 | ||
|
|
f468073bd5 | ||
|
|
997e0f3505 | ||
|
|
f3070aa2fc | ||
|
|
31f988f9c8 | ||
|
|
8c3314fad9 | ||
|
|
2d27c96b7e | ||
|
|
f608fa90db | ||
|
|
07829dc8b9 | ||
|
|
cc211af4ea | ||
|
|
f7076c6ce8 | ||
|
|
8ef7bd41b6 | ||
|
|
0d799f84b3 | ||
|
|
d1f6dc44aa | ||
|
|
6804338322 | ||
|
|
780f439396 | ||
|
|
0215962576 | ||
|
|
0c195b760a | ||
|
|
0df818c01f | ||
|
|
3b3abe0ce1 | ||
|
|
4afa382971 | ||
|
|
0ba9e042a2 | ||
|
|
14b5289e4a | ||
|
|
49a7184962 | ||
|
|
7c23c57789 | ||
|
|
7d90738e3a | ||
|
|
d92cffaa0c | ||
|
|
0bf39185fb | ||
|
|
1923110631 | ||
|
|
c187695b61 | ||
|
|
edcdd9afe1 | ||
|
|
f140e958c5 | ||
|
|
b0db0ad956 | ||
|
|
6dcb4cb65c | ||
|
|
4c14bc7964 | ||
|
|
b81709b80a | ||
|
|
16deae9be1 | ||
|
|
8d01cecc9a | ||
|
|
4bea353255 | ||
|
|
2595be3dfe | ||
|
|
1ccdd5f186 | ||
|
|
b60f173c37 | ||
|
|
3dae54c810 | ||
|
|
5f46a6c4a7 | ||
|
|
a75f6ac8ce | ||
|
|
ac2be8e353 | ||
|
|
0cd25f6ca2 | ||
|
|
b873f56401 | ||
|
|
0188ad7082 | ||
|
|
019eea55c0 | ||
|
|
158c112e03 | ||
|
|
341619118a | ||
|
|
30d15963da | ||
|
|
c24a2bec01 | ||
|
|
54e9b9d2b3 | ||
|
|
61ddd431ca | ||
|
|
a5fd8b5d9c | ||
|
|
70b0310ff7 | ||
|
|
54aabbf053 | ||
|
|
ccc57bc577 | ||
|
|
8140d238ea | ||
|
|
f7d1daa7fd | ||
|
|
ba0a3a3dd2 | ||
|
|
032451725b | ||
|
|
3254602d80 | ||
|
|
51bf99fdf5 | ||
|
|
0f7dc05b52 | ||
|
|
2d00a8c17e | ||
|
|
cf8d2f27eb | ||
|
|
86e6d287a0 | ||
|
|
ce2dc4a07d | ||
|
|
1e7fb75229 | ||
|
|
63253bc07d | ||
|
|
38d9207627 | ||
|
|
e52a22ff57 | ||
|
|
7b099b30d8 | ||
|
|
834ee2dd0d | ||
|
|
1f81e5eb51 | ||
|
|
f3e5dd7a04 | ||
|
|
bb09dba8c0 | ||
|
|
8e18ac6cf7 | ||
|
|
4f37c25271 | ||
|
|
14a974e2d0 | ||
|
|
2a08be49c2 | ||
|
|
588a92ec6b | ||
|
|
6fa04d74e0 | ||
|
|
2c3a603e13 | ||
|
|
a0f11eae42 | ||
|
|
88e4842dfe | ||
|
|
3a7b07be0d | ||
|
|
dbd3d4eff0 | ||
|
|
899310175d | ||
|
|
4e6d44d0e6 | ||
|
|
ea5ed28162 | ||
|
|
72b3895d8b | ||
|
|
112bcf743a | ||
|
|
59f4600ec3 | ||
|
|
89e6e17872 | ||
|
|
de326e5c5e | ||
|
|
230886d1fe | ||
|
|
9eeefad066 | ||
|
|
8ddd0ca822 | ||
|
|
e438829082 | ||
|
|
4cef9fbbe2 | ||
|
|
3fb9396959 | ||
|
|
6fdc83ae14 | ||
|
|
db35fe50e9 | ||
|
|
9ef936369e | ||
|
|
3701dc242d | ||
|
|
94e8f63367 | ||
|
|
f70589ae3e | ||
|
|
368faf4c43 | ||
|
|
e3f42b0c1a | ||
|
|
74f50a92f3 | ||
|
|
f8474f319c | ||
|
|
81d54e6432 | ||
|
|
1d6a94f9f8 | ||
|
|
86c130f239 | ||
|
|
db4a693d72 | ||
|
|
4a214309b2 | ||
|
|
5caaa0f557 | ||
|
|
a7212b0557 | ||
|
|
216a1d1937 | ||
|
|
19e564ab89 | ||
|
|
54b0e77083 | ||
|
|
c66173309f | ||
|
|
f9490c56c6 | ||
|
|
c8634b0b9e | ||
|
|
37f6a196c5 | ||
|
|
fea9c41d92 | ||
|
|
1121106257 | ||
|
|
743e03cf5e | ||
|
|
39bf69006a | ||
|
|
d67affb100 | ||
|
|
6d5473da30 | ||
|
|
bf4f51ce78 | ||
|
|
74b0c7c91a | ||
|
|
364ba5e8b9 | ||
|
|
5aef84d1f4 | ||
|
|
f67bef714e | ||
|
|
e2ecc3c090 | ||
|
|
a84aa656ee | ||
|
|
7d17ab9a13 | ||
|
|
0acc700234 | ||
|
|
d02ab64fa2 | ||
|
|
29b775c36a | ||
|
|
40938f72a2 | ||
|
|
4a5f73e338 | ||
|
|
d8fd9552b5 | ||
|
|
28d5df364e | ||
|
|
678d2103f9 | ||
|
|
c4990c8bf6 | ||
|
|
9e0083e9f0 | ||
|
|
3c7bb58fb9 | ||
|
|
36f4518f89 | ||
|
|
cfb43a5a2c | ||
|
|
4f6ea8aef9 | ||
|
|
a42ecfa12e | ||
|
|
eadbf37f4e | ||
|
|
8e1f9bb6d1 | ||
|
|
a86677ebd5 | ||
|
|
90493b4012 | ||
|
|
d6a3244d18 | ||
|
|
f7e46677b5 | ||
|
|
db669f381b | ||
|
|
6cc489aa4f | ||
|
|
506589f483 | ||
|
|
bd7870ec5f | ||
|
|
7363d850a9 | ||
|
|
d138d28133 | ||
|
|
af1ecf410e | ||
|
|
3435c9713f | ||
|
|
09abed41d6 | ||
|
|
332401e645 | ||
|
|
17a9125415 | ||
|
|
800a3f62b3 | ||
|
|
e4704dda2f | ||
|
|
a5162e47d5 | ||
|
|
122bb72a66 | ||
|
|
bc00595941 | ||
|
|
7c405f2e81 | ||
|
|
d473f1507c | ||
|
|
0e57f61ede | ||
|
|
4ab699dc03 | ||
|
|
0c50d57d08 | ||
|
|
38e41ac6ef | ||
|
|
9a80393d63 | ||
|
|
87934d6db3 | ||
|
|
dd334ec3d0 | ||
|
|
f5464908a6 | ||
|
|
37a548351b | ||
|
|
d9f8a23002 | ||
|
|
1b760ca1a5 | ||
|
|
627fe239a5 | ||
|
|
9eaa827e59 | ||
|
|
94206b30ff | ||
|
|
d8a1ef0827 | ||
|
|
e5e3156e56 | ||
|
|
5d1722aaf1 | ||
|
|
582196abb8 | ||
|
|
e92bcc6be3 | ||
|
|
cf9edc4a1d | ||
|
|
76414db5a3 | ||
|
|
b5b74f1c5b | ||
|
|
b427bd59d0 | ||
|
|
91a9b97aa6 | ||
|
|
a5549e4cd2 | ||
|
|
b7e4a9f65b | ||
|
|
20ce24d285 | ||
|
|
7172d12a3f | ||
|
|
98fe12ee6d | ||
|
|
76f04364e3 | ||
|
|
3a1186689a | ||
|
|
44bc67ccd6 | ||
|
|
931120cefe | ||
|
|
58a383b2f0 | ||
|
|
f19d3d1f63 | ||
|
|
c26994f746 | ||
|
|
e722bb7121 | ||
|
|
8afc392129 | ||
|
|
9c4252f295 | ||
|
|
b39f1c56d5 | ||
|
|
25d746ccdb | ||
|
|
c53c54cec4 | ||
|
|
cf11c42355 | ||
|
|
5997f60c9a | ||
|
|
377a4e24ed | ||
|
|
29db2a6761 | ||
|
|
37e202ac7d | ||
|
|
f02189588a | ||
|
|
16135b4d33 | ||
|
|
85f552fa8a | ||
|
|
fc5da6d413 | ||
|
|
20685407f3 | ||
|
|
bab811ce01 | ||
|
|
12a2241641 | ||
|
|
88e67d27d8 | ||
|
|
84987939c7 | ||
|
|
3ce435c137 | ||
|
|
521b33f6ec | ||
|
|
ce1e21eb7c | ||
|
|
e404d07959 | ||
|
|
e2e22061b0 | ||
|
|
b99314020d | ||
|
|
e5b1e20b49 | ||
|
|
e00ef49560 | ||
|
|
c28a047f8a | ||
|
|
4a0d55e4c9 | ||
|
|
bb1eeada78 | ||
|
|
b350e6ad91 | ||
|
|
434361c3c6 | ||
|
|
05b4cb2080 | ||
|
|
b098fb3279 | ||
|
|
f00d9f9d02 | ||
|
|
0cb2dc120b | ||
|
|
3707688157 | ||
|
|
c2e61fa00e | ||
|
|
2ab36cc28a | ||
|
|
21c4caf8e1 | ||
|
|
e9559b5cc0 | ||
|
|
9e9a51f3cb | ||
|
|
8126172c86 | ||
|
|
ed907ec2d1 | ||
|
|
db160493de | ||
|
|
3b32ee24fb | ||
|
|
d3315530e8 | ||
|
|
f502b57f5d | ||
|
|
3181ee9123 | ||
|
|
de04d595fa | ||
|
|
863dfac9d9 | ||
|
|
41e4211a15 | ||
|
|
34714bcefa | ||
|
|
589c6b9de8 | ||
|
|
e85c33074d | ||
|
|
6ce8973116 | ||
|
|
e512564f36 | ||
|
|
d33f396b99 | ||
|
|
ac7ef03d8e | ||
|
|
3160edd841 | ||
|
|
99cce0ea11 | ||
|
|
89dd0dcb93 | ||
|
|
c1f8c02900 | ||
|
|
3b028ddc03 | ||
|
|
5de9b738d3 | ||
|
|
65946d3f86 | ||
|
|
2325ddede0 | ||
|
|
52e0f14369 | ||
|
|
d6d77a73be | ||
|
|
b82082f321 | ||
|
|
09776ae196 | ||
|
|
22c56e716c | ||
|
|
208e4fd87b | ||
|
|
dd8793f10d | ||
|
|
1a379fa961 | ||
|
|
bdf8f9cc31 | ||
|
|
41cd7b2754 | ||
|
|
a93db0866a | ||
|
|
245f333d52 | ||
|
|
1e151782fc | ||
|
|
0bddea7ffe | ||
|
|
ae33d6bbf6 | ||
|
|
9348f23012 | ||
|
|
7f6aa30c40 | ||
|
|
2ac91d1f8e | ||
|
|
d010f7c348 | ||
|
|
f8d95ed6e3 | ||
|
|
2b84291424 | ||
|
|
55e2ef9b31 | ||
|
|
25091201d6 | ||
|
|
bbbc406887 | ||
|
|
0db44b0516 | ||
|
|
8bc7833ed3 | ||
|
|
0125995766 | ||
|
|
c848a8872a | ||
|
|
01c6f7705f | ||
|
|
493585e802 | ||
|
|
92be9569b8 | ||
|
|
ac8455a022 | ||
|
|
e415aee138 | ||
|
|
22b17a9836 | ||
|
|
9094a7483e | ||
|
|
939e6b3a1a | ||
|
|
4ba2b4fbdf | ||
|
|
c4da7631c0 | ||
|
|
84ba09182d | ||
|
|
757964d7fa | ||
|
|
0f43a76273 | ||
|
|
5ae87ec20d | ||
|
|
e52ace05d3 | ||
|
|
7732a55113 | ||
|
|
d06eced64d | ||
|
|
92428a1045 | ||
|
|
95d0649165 | ||
|
|
24a5107484 | ||
|
|
75fd364ccf | ||
|
|
f594ed900c | ||
|
|
00a23c159d | ||
|
|
c8444b192d | ||
|
|
e0afc4ae97 | ||
|
|
047122995d | ||
|
|
ba1f0d37e1 | ||
|
|
7b7cb95a11 | ||
|
|
d48eb0305d | ||
|
|
4bcbf9fc65 | ||
|
|
6e88a50771 | ||
|
|
1370648058 | ||
|
|
4f6ff8445f | ||
|
|
507395df2c | ||
|
|
6926f5bdc9 | ||
|
|
a2796ccf0a | ||
|
|
4b994916bd | ||
|
|
c5aa761ded | ||
|
|
71c3d83e9d | ||
|
|
efe1dce70b | ||
|
|
0c8bc1d8c2 | ||
|
|
44f5f557ef | ||
|
|
d31b63df9c | ||
|
|
6ca9f62bb5 | ||
|
|
0d122fd177 | ||
|
|
1d042a78a8 | ||
|
|
e22b6eb9ab | ||
|
|
94ef14f2fe | ||
|
|
d0345abbf6 | ||
|
|
25eedf811a | ||
|
|
846e8f4c80 | ||
|
|
c3353d5a64 | ||
|
|
5837fdc42c | ||
|
|
07f720d567 | ||
|
|
710734302b | ||
|
|
a1e06f4b0a | ||
|
|
d6513e05a7 | ||
|
|
b986f31385 | ||
|
|
6b002a2d06 | ||
|
|
9f1a598fc1 | ||
|
|
01498c5ecd | ||
|
|
2df6f12a99 | ||
|
|
481c3a3fd5 | ||
|
|
76da15f7bc | ||
|
|
566db2779b | ||
|
|
1ce018ea85 | ||
|
|
ab6fc07f69 | ||
|
|
03475f0648 | ||
|
|
13e2682646 | ||
|
|
539ae1750f | ||
|
|
5de6de238c | ||
|
|
18c563f161 | ||
|
|
2922b99f62 | ||
|
|
9943a8a579 | ||
|
|
783d209ab7 | ||
|
|
fe24e890ab | ||
|
|
9b08b0169a | ||
|
|
414826083b | ||
|
|
c2a49a6f27 | ||
|
|
49c58637ba | ||
|
|
b03d00e307 | ||
|
|
9ac86b7c6c | ||
|
|
601e71d7fc | ||
|
|
4da52405ca | ||
|
|
12c8a0c839 | ||
|
|
6c9ba2c3e1 | ||
|
|
f58aaebc26 | ||
|
|
e70b0460ea | ||
|
|
357548f682 | ||
|
|
6893ec40c9 | ||
|
|
6dd152f040 | ||
|
|
39a95d7e52 | ||
|
|
6e9d74fa78 | ||
|
|
c9d50be3b9 | ||
|
|
76e2b0d613 | ||
|
|
62cba4649f | ||
|
|
37b044ce72 | ||
|
|
d7304e379d | ||
|
|
fafaee2a19 | ||
|
|
9b9ef79f51 | ||
|
|
ddbba194c5 | ||
|
|
4edaedf1b0 | ||
|
|
2e674796fc | ||
|
|
180d5e31c9 | ||
|
|
16a6b9c3c1 | ||
|
|
1e29c4f4ad | ||
|
|
f73034b8e3 | ||
|
|
e53ea0c452 | ||
|
|
dd3033a0ce | ||
|
|
92816a0c35 | ||
|
|
3d55f5f6f0 | ||
|
|
b73c0aa0aa | ||
|
|
1b0be70377 | ||
|
|
67e037520d | ||
|
|
aaa0152aeb | ||
|
|
dc81b2efaf | ||
|
|
f512f6d8d5 | ||
|
|
c4606765eb | ||
|
|
53c93039f6 | ||
|
|
0e525ab237 | ||
|
|
07493eeb9d | ||
|
|
f96662305e | ||
|
|
2b53ba06dc | ||
|
|
e0087267df | ||
|
|
052144cb1f | ||
|
|
f1550da616 | ||
|
|
a2bc74984c | ||
|
|
db3ee6681b | ||
|
|
ead525956c | ||
|
|
97294cb6f5 | ||
|
|
22d8a012ca | ||
|
|
c3d5218595 | ||
|
|
2c327304a1 | ||
|
|
13f90df659 | ||
|
|
81bf9a7925 | ||
|
|
988da40f48 | ||
|
|
55d9c007c0 | ||
|
|
03dea312bd | ||
|
|
ee57084f05 | ||
|
|
1e9e53cfec | ||
|
|
e1febe2aac | ||
|
|
b776295fc0 | ||
|
|
0a6728c33d | ||
|
|
6178928e34 | ||
|
|
2137118693 | ||
|
|
1ed3c75ba4 | ||
|
|
865ea5e678 | ||
|
|
75bd963079 | ||
|
|
379c5166ff | ||
|
|
775e9aac00 | ||
|
|
39795a1da4 | ||
|
|
3147adf346 | ||
|
|
91258f5572 | ||
|
|
52f7f8443d | ||
|
|
ddd29dbbd3 | ||
|
|
63660abb4f | ||
|
|
11fdd10d9e | ||
|
|
9fd52465aa | ||
|
|
3a94aaa6cb | ||
|
|
bb14939c64 | ||
|
|
0ff016021c | ||
|
|
fa67ca104b | ||
|
|
f2f4614f5c | ||
|
|
d8577f3bd9 | ||
|
|
1ff9f7ba97 | ||
|
|
898b17c6b4 | ||
|
|
6d451c02f2 | ||
|
|
caa904131a | ||
|
|
fab75817f4 | ||
|
|
746ce9535f | ||
|
|
21ad94030a | ||
|
|
906d03c8cb | ||
|
|
2ff1a19af2 | ||
|
|
19eb51a4cb | ||
|
|
e10b32c27a | ||
|
|
c9396a84a8 | ||
|
|
93022718af | ||
|
|
5406b20772 | ||
|
|
ef1b90ad7a | ||
|
|
facb6a3102 | ||
|
|
7d5b0dc33c | ||
|
|
71342a5742 | ||
|
|
663240b26f | ||
|
|
f38c8594fb | ||
|
|
2975cfd589 | ||
|
|
791a16b48e | ||
|
|
01634e6c3b | ||
|
|
3d2df2eae1 | ||
|
|
c939eccf4a | ||
|
|
e5f0aa5009 | ||
|
|
96c82a32e1 | ||
|
|
2d7fb3bc20 | ||
|
|
2cd19c4e6b | ||
|
|
ed985943f3 | ||
|
|
6506055954 | ||
|
|
8c60b1157a | ||
|
|
97cf6a1aff | ||
|
|
b5f118d875 | ||
|
|
876a5d6782 | ||
|
|
4187ab8e37 | ||
|
|
6f8793bff8 | ||
|
|
df6c6b5747 | ||
|
|
278477fcd7 | ||
|
|
9b14adeeea | ||
|
|
3bdae3d946 | ||
|
|
4796062aab | ||
|
|
c299d96628 | ||
|
|
261bde3156 | ||
|
|
4b48c76e1c | ||
|
|
92c04315ff | ||
|
|
8ddf96d852 | ||
|
|
7934f521d7 | ||
|
|
ee3826893d | ||
|
|
2b096ec26d | ||
|
|
474d95712e | ||
|
|
972ac8cc9d | ||
|
|
203f7657fe | ||
|
|
5c8bbdd6d9 | ||
|
|
74f9c831ac | ||
|
|
adee2e475d | ||
|
|
e5c5cd920b | ||
|
|
1cb1fee6ed | ||
|
|
c5da22ebff | ||
|
|
2a3d586a79 | ||
|
|
fbf9737123 | ||
|
|
c7329913d9 | ||
|
|
42dff1d622 | ||
|
|
508e022fa9 | ||
|
|
d409a29e57 | ||
|
|
459aa94020 | ||
|
|
93c913d132 | ||
|
|
722cda78a9 | ||
|
|
e06dc8eb8d | ||
|
|
3f2b427970 | ||
|
|
ce1a0a923b | ||
|
|
a2d61902c5 | ||
|
|
3d185e117d | ||
|
|
65e3c9b74d | ||
|
|
eb64fc3dac | ||
|
|
8884cc7dae | ||
|
|
379b57abd7 | ||
|
|
218593d964 | ||
|
|
bd858e0017 | ||
|
|
c3c72d902f | ||
|
|
fe44a8d5e9 | ||
|
|
15e17d01d5 | ||
|
|
db7fa65dce | ||
|
|
505f963287 | ||
|
|
1fea6044ed | ||
|
|
d64f20cebe | ||
|
|
e2abfe30a7 | ||
|
|
83661bdca4 | ||
|
|
9b8f76b445 | ||
|
|
58260d444e | ||
|
|
ea5190faaa | ||
|
|
d063a23455 | ||
|
|
28cc8c889e | ||
|
|
f51c5464dc | ||
|
|
3a37a573a2 | ||
|
|
7278c6fb2c | ||
|
|
0c863ddec8 | ||
|
|
8ffde10c06 | ||
|
|
7b90ffbb48 | ||
|
|
233d558b1e | ||
|
|
d5c3b7ac25 | ||
|
|
fbf45e053a | ||
|
|
bb3ef94985 | ||
|
|
4865914200 | ||
|
|
889e874282 | ||
|
|
f9eb1833d2 | ||
|
|
7d8a7adc9f | ||
|
|
d1a1ae5194 | ||
|
|
3664f127cd | ||
|
|
b3664a2eaa | ||
|
|
388ed8fba7 | ||
|
|
ebd469c2a8 | ||
|
|
d8c1fbed81 | ||
|
|
301062d3fb | ||
|
|
6d0e92b89e | ||
|
|
bc2c8431fc | ||
|
|
842878d2d0 | ||
|
|
da96c53041 | ||
|
|
03405163b7 | ||
|
|
d50da922b1 | ||
|
|
995a8579cf | ||
|
|
795fcf4f08 | ||
|
|
e32b5b3f8a | ||
|
|
b0122226ed | ||
|
|
e326690201 | ||
|
|
b5fe898956 | ||
|
|
0b6248c50a | ||
|
|
441aa364da | ||
|
|
f6fb514688 | ||
|
|
1489bcfe34 | ||
|
|
9e929c12d5 | ||
|
|
fe4ff7a3fb | ||
|
|
d2ef001c49 | ||
|
|
b4b8dd8fff | ||
|
|
6a438c4be4 | ||
|
|
507739c16e | ||
|
|
26472fc645 | ||
|
|
5e0f0ee61a | ||
|
|
332f11d646 | ||
|
|
0aa1749495 | ||
|
|
8c8d7776cd | ||
|
|
5ef0b5263e | ||
|
|
f6ed765b4a | ||
|
|
948876257f | ||
|
|
0db50478bc | ||
|
|
3ff5e13b09 |
@@ -1,4 +1,22 @@
|
||||
compat/zlib/win32/zdll.lib
|
||||
compat/zlib/win32/zlib1.dll
|
||||
compat/zlib/win64/zdll.lib
|
||||
compat/zlib/win64/zlib1.dll
|
||||
compat/zlib/win64/libz.dll.a
|
||||
compat/zlib/zlib.3.pdf
|
||||
compat/zlib/win32/zdll.lib
|
||||
compat/zlib/win32/zlib1.dll
|
||||
compat/zlib/win64/zdll.lib
|
||||
compat/zlib/win64/zlib1.dll
|
||||
compat/zlib/win64/libz.dll.a
|
||||
compat/zlib/zlib.3.pdf
|
||||
libtommath/win32/tommath.lib
|
||||
libtommath/win32/libtommath.dll
|
||||
libtommath/win64/tommath.lib
|
||||
libtommath/win64/libtommath.dll
|
||||
libtommath/win64/libtommath.dll.a
|
||||
*.a
|
||||
*.bmp
|
||||
*.dll
|
||||
*.exe
|
||||
*.gif
|
||||
|
||||
@@ -3,7 +3,9 @@
|
||||
*.dylib
|
||||
*.exe
|
||||
*.exp
|
||||
*.la
|
||||
*.lib
|
||||
*.lo
|
||||
*.o
|
||||
*.obj
|
||||
*.pdb
|
||||
@@ -28,7 +30,7 @@ libtommath/pretty.build
|
||||
libtommath/tommath.src
|
||||
libtommath/*.log
|
||||
libtommath/*.pdf
|
||||
libtommath/*.pl
|
||||
libtommath/gen.pl
|
||||
libtommath/*.sh
|
||||
libtommath/doc/*
|
||||
libtommath/tombc/*
|
||||
@@ -47,6 +49,7 @@ unix/tclIndex
|
||||
unix/pkgs/*
|
||||
win/Debug*
|
||||
win/Release*
|
||||
win/*.manifest
|
||||
win/pkgs/*
|
||||
win/coffbase.txt
|
||||
win/tcl.hpj
|
||||
|
||||
Executable → Regular
Executable → Regular
+4
@@ -19,6 +19,8 @@
|
||||
*/tcltest*
|
||||
*/versions.vc
|
||||
*/version.vc
|
||||
*/libtcl.vfs
|
||||
*/libtcl_*.zip
|
||||
html
|
||||
libtommath/bn.ilg
|
||||
libtommath/bn.ind
|
||||
@@ -45,6 +47,8 @@ unix/tclIndex
|
||||
unix/pkgs/*
|
||||
win/Debug*
|
||||
win/Release*
|
||||
win/*.manifest
|
||||
win/pkgs/*
|
||||
win/coffbase.txt
|
||||
win/tcl.hpj
|
||||
win/nmhlp-out.txt
|
||||
|
||||
+190
-187
@@ -6,52 +6,50 @@ matrix:
|
||||
# Testing on Linux with various compilers
|
||||
- name: "Linux/GCC/Shared"
|
||||
os: linux
|
||||
dist: xenial
|
||||
dist: bionic
|
||||
compiler: gcc
|
||||
env:
|
||||
- BUILD_DIR=unix
|
||||
- name: "Linux/GCC/Static"
|
||||
- name: "Linux/GCC/Shared: UTF_MAX=4"
|
||||
os: linux
|
||||
dist: xenial
|
||||
compiler: gcc
|
||||
env:
|
||||
- CFGOPT=--disable-shared
|
||||
- BUILD_DIR=unix
|
||||
- name: "Linux/GCC/Shared: UTF_MAX=6"
|
||||
os: linux
|
||||
dist: xenial
|
||||
dist: bionic
|
||||
compiler: gcc
|
||||
env:
|
||||
- BUILD_DIR=unix
|
||||
- CFGOPT=CFLAGS=-DTCL_UTF_MAX=6
|
||||
- name: "Linux/GCC/Shared: UTF_MAX=3"
|
||||
os: linux
|
||||
dist: xenial
|
||||
compiler: gcc
|
||||
env:
|
||||
- BUILD_DIR=unix
|
||||
- CFGOPT=CFLAGS=-DTCL_UTF_MAX=3
|
||||
- CFGOPT=CFLAGS=-DTCL_UTF_MAX=4
|
||||
- name: "Linux/GCC/Shared: NO_DEPRECATED"
|
||||
os: linux
|
||||
dist: xenial
|
||||
dist: bionic
|
||||
compiler: gcc
|
||||
env:
|
||||
- BUILD_DIR=unix
|
||||
- CFGOPT=CFLAGS=-DTCL_NO_DEPRECATED=1
|
||||
# Debug build. Running test-cases disabled, because it is currently failing.
|
||||
- name: "Linux/GCC/Debug/no test"
|
||||
- CFGOPT="CFLAGS=-DTCL_NO_DEPRECATED=1"
|
||||
- name: "Linux/GCC/Static"
|
||||
os: linux
|
||||
dist: xenial
|
||||
dist: bionic
|
||||
compiler: gcc
|
||||
env:
|
||||
- CFGOPT="--disable-shared"
|
||||
- BUILD_DIR=unix
|
||||
- name: "Linux/GCC/Debug"
|
||||
os: linux
|
||||
dist: bionic
|
||||
compiler: gcc
|
||||
env:
|
||||
- BUILD_DIR=unix
|
||||
- CFGOPT=--enable-symbols=all
|
||||
script:
|
||||
- make all tcltest
|
||||
- CFGOPT="--enable-symbols"
|
||||
# C++ build.
|
||||
- name: "Linux/G++/Shared"
|
||||
os: linux
|
||||
dist: bionic
|
||||
compiler: g++
|
||||
env:
|
||||
- BUILD_DIR=unix
|
||||
- CFGOPT="CC=g++ CFLAGS=-Dregister=dont+use+register"
|
||||
# Older versions of GCC...
|
||||
- name: "Linux/GCC 7/Shared"
|
||||
os: linux
|
||||
dist: xenial
|
||||
dist: bionic
|
||||
compiler: gcc-7
|
||||
addons:
|
||||
apt:
|
||||
@@ -63,7 +61,7 @@ matrix:
|
||||
- BUILD_DIR=unix
|
||||
- name: "Linux/GCC 6/Shared"
|
||||
os: linux
|
||||
dist: xenial
|
||||
dist: bionic
|
||||
compiler: gcc-6
|
||||
addons:
|
||||
apt:
|
||||
@@ -75,7 +73,7 @@ matrix:
|
||||
- BUILD_DIR=unix
|
||||
- name: "Linux/GCC 5/Shared"
|
||||
os: linux
|
||||
dist: xenial
|
||||
dist: bionic
|
||||
compiler: gcc-5
|
||||
addons:
|
||||
apt:
|
||||
@@ -85,51 +83,43 @@ matrix:
|
||||
- g++-5
|
||||
env:
|
||||
- BUILD_DIR=unix
|
||||
- name: "Linux/GCC 4.9/Shared"
|
||||
os: linux
|
||||
dist: xenial
|
||||
compiler: gcc-4.9
|
||||
addons:
|
||||
apt:
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
packages:
|
||||
- g++-4.9
|
||||
env:
|
||||
- BUILD_DIR=unix
|
||||
# Clang
|
||||
- name: "Linux/Clang/Shared"
|
||||
os: linux
|
||||
dist: bionic
|
||||
compiler: clang
|
||||
env:
|
||||
- BUILD_DIR=unix
|
||||
- name: "Linux/Clang/Shared:NO_DEPRECATED"
|
||||
os: linux
|
||||
dist: xenial
|
||||
compiler: clang
|
||||
env:
|
||||
- BUILD_DIR=unix
|
||||
- CFGOPT="CFLAGS=-DTCL_NO_DEPRECATED=1"
|
||||
- name: "Linux/Clang/Static"
|
||||
os: linux
|
||||
dist: xenial
|
||||
dist: bionic
|
||||
compiler: clang
|
||||
env:
|
||||
- CFGOPT=--disable-shared
|
||||
- CFGOPT="--disable-shared"
|
||||
- BUILD_DIR=unix
|
||||
# Debug build. Running test-cases disabled, because it is currently failing.
|
||||
- name: "Linux/Clang/Debug/no test"
|
||||
- name: "Linux/Clang/Debug"
|
||||
os: linux
|
||||
dist: xenial
|
||||
dist: bionic
|
||||
compiler: clang
|
||||
env:
|
||||
- BUILD_DIR=unix
|
||||
- CFGOPT=--enable-symbols=all
|
||||
script:
|
||||
- make all tcltest
|
||||
- CFGOPT="--enable-symbols"
|
||||
# Testing on Mac, various styles
|
||||
- name: "macOS/Xcode 11/Shared/Unix-like"
|
||||
- name: "macOS/Xcode 11.3/Shared/Unix-like"
|
||||
os: osx
|
||||
osx_image: xcode11
|
||||
osx_image: xcode11.3
|
||||
env:
|
||||
- BUILD_DIR=unix
|
||||
- name: "macOS/Xcode 11/Shared"
|
||||
- name: "macOS/Xcode 11.3/Shared"
|
||||
os: osx
|
||||
osx_image: xcode11
|
||||
osx_image: xcode11.3
|
||||
env:
|
||||
- BUILD_DIR=macosx
|
||||
install: []
|
||||
@@ -137,13 +127,28 @@ matrix:
|
||||
- make all
|
||||
# The styles=develop avoids some weird problems on OSX
|
||||
- make test styles=develop
|
||||
- name: "macOS/Xcode 10/Shared"
|
||||
addons:
|
||||
homebrew:
|
||||
packages:
|
||||
- libtommath
|
||||
- name: "macOS/Xcode 11/Shared"
|
||||
os: osx
|
||||
osx_image: xcode10.2
|
||||
osx_image: xcode11
|
||||
env:
|
||||
- BUILD_DIR=macosx
|
||||
install: []
|
||||
script: *mactest
|
||||
- name: "macOS/Xcode 10/Shared"
|
||||
os: osx
|
||||
osx_image: xcode10.3
|
||||
env:
|
||||
- BUILD_DIR=macosx
|
||||
install: []
|
||||
script: *mactest
|
||||
addons:
|
||||
homebrew:
|
||||
packages:
|
||||
- libtommath
|
||||
- name: "macOS/Xcode 9/Shared"
|
||||
os: osx
|
||||
osx_image: xcode9
|
||||
@@ -151,6 +156,10 @@ matrix:
|
||||
- BUILD_DIR=macosx
|
||||
install: []
|
||||
script: *mactest
|
||||
addons:
|
||||
homebrew:
|
||||
packages:
|
||||
- libtommath
|
||||
- name: "macOS/Xcode 8/Shared"
|
||||
os: osx
|
||||
osx_image: xcode8
|
||||
@@ -158,20 +167,23 @@ matrix:
|
||||
- BUILD_DIR=macosx
|
||||
install: []
|
||||
script: *mactest
|
||||
addons:
|
||||
homebrew:
|
||||
packages:
|
||||
- libtommath
|
||||
# Test with mingw-w64 cross-compile
|
||||
# Doesn't run tests because wine is only an imperfect Windows emulation
|
||||
- name: "Linux-cross-Windows/GCC/Shared/no test"
|
||||
os: linux
|
||||
dist: xenial
|
||||
dist: bionic
|
||||
compiler: x86_64-w64-mingw32-gcc
|
||||
addons: &mingw64
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- gcc-mingw-w64-base
|
||||
- binutils-mingw-w64-x86-64
|
||||
- gcc-mingw-w64-x86-64
|
||||
- gcc-mingw-w64
|
||||
- wine
|
||||
env:
|
||||
- BUILD_DIR=win
|
||||
- CFGOPT="--host=x86_64-w64-mingw32 --enable-64bit"
|
||||
@@ -180,58 +192,13 @@ matrix:
|
||||
# Include a high visibility marker that tests are skipped outright
|
||||
- >
|
||||
echo "`tput setaf 3`SKIPPED TEST: CROSS COMPILING`tput sgr0`"
|
||||
- name: "Linux-cross-Windows/GCC/Static/no test"
|
||||
os: linux
|
||||
dist: xenial
|
||||
compiler: x86_64-w64-mingw32-gcc
|
||||
addons: *mingw64
|
||||
env:
|
||||
- BUILD_DIR=win
|
||||
- CFGOPT="--host=x86_64-w64-mingw32 --enable-64bit --disable-shared"
|
||||
script: *crosstest
|
||||
- name: "Linux-cross-Windows/GCC/Shared/no test: UTF_MAX=6"
|
||||
os: linux
|
||||
dist: xenial
|
||||
compiler: x86_64-w64-mingw32-gcc
|
||||
addons: *mingw64
|
||||
env:
|
||||
- BUILD_DIR=win
|
||||
- CFGOPT="--host=x86_64-w64-mingw32 --enable-64bit CFLAGS=-DTCL_UTF_MAX=6"
|
||||
script: *crosstest
|
||||
- name: "Linux-cross-Windows/GCC/Shared/no test: UTF_MAX=3"
|
||||
os: linux
|
||||
dist: xenial
|
||||
compiler: x86_64-w64-mingw32-gcc
|
||||
addons: *mingw64
|
||||
env:
|
||||
- BUILD_DIR=win
|
||||
- CFGOPT="--host=x86_64-w64-mingw32 --enable-64bit CFLAGS=-DTCL_UTF_MAX=3"
|
||||
script: *crosstest
|
||||
- name: "Linux-cross-Windows/GCC/Shared/no test: NO_DEPRECATED"
|
||||
os: linux
|
||||
dist: xenial
|
||||
compiler: x86_64-w64-mingw32-gcc
|
||||
addons: *mingw64
|
||||
env:
|
||||
- BUILD_DIR=win
|
||||
- CFGOPT="--host=x86_64-w64-mingw32 --enable-64bit CFLAGS=-DTCL_NO_DEPRECATED=1"
|
||||
script: *crosstest
|
||||
- name: "Linux-cross-Windows/GCC/Debug/no test"
|
||||
os: linux
|
||||
dist: xenial
|
||||
compiler: x86_64-w64-mingw32-gcc
|
||||
addons: *mingw64
|
||||
env:
|
||||
- BUILD_DIR=win
|
||||
- CFGOPT="--host=x86_64-w64-mingw32 --enable-64bit --enable-symbols"
|
||||
script: *crosstest
|
||||
# Test with mingw-w64 (32 bit) cross-compile
|
||||
# Doesn't run tests because wine is only an imperfect Windows emulation
|
||||
- name: "Linux-cross-Windows-32/GCC/Shared/no test"
|
||||
os: linux
|
||||
dist: xenial
|
||||
dist: bionic
|
||||
compiler: i686-w64-mingw32-gcc
|
||||
addons: &mingw32
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- gcc-mingw-w64-base
|
||||
@@ -239,56 +206,10 @@ matrix:
|
||||
- gcc-mingw-w64-i686
|
||||
- gcc-mingw-w64
|
||||
- gcc-multilib
|
||||
- wine
|
||||
env:
|
||||
- BUILD_DIR=win
|
||||
- CFGOPT=--host=i686-w64-mingw32
|
||||
script: *crosstest
|
||||
- name: "Linux-cross-Windows-32/GCC/Static/no test"
|
||||
os: linux
|
||||
dist: xenial
|
||||
compiler: i686-w64-mingw32-gcc
|
||||
addons: *mingw32
|
||||
env:
|
||||
- BUILD_DIR=win
|
||||
- CFGOPT="--host=i686-w64-mingw32 --disable-shared"
|
||||
script: *crosstest
|
||||
- name: "Linux-cross-Windows-32/GCC/Shared/no test: UTF_MAX=6"
|
||||
os: linux
|
||||
dist: xenial
|
||||
compiler: i686-w64-mingw32-gcc
|
||||
addons: *mingw32
|
||||
env:
|
||||
- BUILD_DIR=win
|
||||
- CFGOPT="--host=i686-w64-mingw32 CFLAGS=-DTCL_UTF_MAX=6"
|
||||
script: *crosstest
|
||||
- name: "Linux-cross-Windows-32/GCC/Shared/no test: UTF_MAX=3"
|
||||
os: linux
|
||||
dist: xenial
|
||||
compiler: i686-w64-mingw32-gcc
|
||||
addons: *mingw32
|
||||
env:
|
||||
- BUILD_DIR=win
|
||||
- CFGOPT="--host=i686-w64-mingw32 CFLAGS=-DTCL_UTF_MAX=3"
|
||||
script: *crosstest
|
||||
- name: "Linux-cross-Windows-32/GCC/Shared/no test: NO_DEPRECATED"
|
||||
os: linux
|
||||
dist: xenial
|
||||
compiler: i686-w64-mingw32-gcc
|
||||
addons: *mingw32
|
||||
env:
|
||||
- BUILD_DIR=win
|
||||
- CFGOPT="--host=i686-w64-mingw32 CFLAGS=-DTCL_NO_DEPRECATED=1"
|
||||
script: *crosstest
|
||||
- name: "Linux-cross-Windows-32/GCC/Debug/no test"
|
||||
os: linux
|
||||
dist: xenial
|
||||
compiler: i686-w64-mingw32-gcc
|
||||
addons: *mingw32
|
||||
env:
|
||||
- BUILD_DIR=win
|
||||
- CFGOPT="--host=i686-w64-mingw32 --enable-symbols"
|
||||
script: *crosstest
|
||||
# Test on Windows with MSVC native
|
||||
- name: "Windows/MSVC/Shared"
|
||||
os: windows
|
||||
@@ -301,17 +222,17 @@ matrix:
|
||||
- cd ${BUILD_DIR}
|
||||
install: []
|
||||
script:
|
||||
- cmd.exe /C 'vcvarsall.bat x64 && nmake -f makefile.vc all tcltest'
|
||||
- cmd.exe /C 'vcvarsall.bat x64 && nmake -f makefile.vc test'
|
||||
- name: "Windows/MSVC/Shared: UTF_MAX=6"
|
||||
- cmd.exe //C vcvarsall.bat x64 '&&' nmake '-f' makefile.vc all tcltest
|
||||
- cmd.exe //C vcvarsall.bat x64 '&&' nmake '-f' makefile.vc test
|
||||
- name: "Windows/MSVC/Shared: UTF_MAX=4"
|
||||
os: windows
|
||||
compiler: cl
|
||||
env: *vcenv
|
||||
before_install: *vcpreinst
|
||||
install: []
|
||||
script:
|
||||
- cmd.exe /C 'vcvarsall.bat x64 && nmake OPTS=utfmax -f makefile.vc all tcltest'
|
||||
- cmd.exe /C 'vcvarsall.bat x64 && nmake OPTS=utfmax -f makefile.vc test'
|
||||
- cmd.exe //C vcvarsall.bat x64 '&&' nmake 'OPTS=utfmax' '-f' makefile.vc all tcltest
|
||||
- cmd.exe //C vcvarsall.bat x64 '&&' nmake 'OPTS=utfmax' '-f' makefile.vc test
|
||||
- name: "Windows/MSVC/Shared: NO_DEPRECATED"
|
||||
os: windows
|
||||
compiler: cl
|
||||
@@ -319,8 +240,8 @@ matrix:
|
||||
before_install: *vcpreinst
|
||||
install: []
|
||||
script:
|
||||
- cmd.exe /C 'vcvarsall.bat x64 && nmake OPTS=nodep -f makefile.vc all tcltest'
|
||||
- cmd.exe /C 'vcvarsall.bat x64 && nmake OPTS=nodep -f makefile.vc test'
|
||||
- cmd.exe //C vcvarsall.bat x64 '&&' nmake 'OPTS=nodep' '-f' makefile.vc all tcltest
|
||||
- cmd.exe //C vcvarsall.bat x64 '&&' nmake 'OPTS=nodep' '-f' makefile.vc test
|
||||
- name: "Windows/MSVC/Static"
|
||||
os: windows
|
||||
compiler: cl
|
||||
@@ -328,8 +249,8 @@ matrix:
|
||||
before_install: *vcpreinst
|
||||
install: []
|
||||
script:
|
||||
- cmd.exe /C 'vcvarsall.bat x64 && nmake OPTS=static -f makefile.vc all tcltest'
|
||||
- cmd.exe /C 'vcvarsall.bat x64 && nmake OPTS=static -f makefile.vc test'
|
||||
- cmd.exe //C vcvarsall.bat x64 '&&' nmake 'OPTS=static,msvcrt' '-f' makefile.vc all tcltest
|
||||
- cmd.exe //C vcvarsall.bat x64 '&&' nmake 'OPTS=static,msvcrt' '-f' makefile.vc test
|
||||
- name: "Windows/MSVC/Debug"
|
||||
os: windows
|
||||
compiler: cl
|
||||
@@ -337,8 +258,54 @@ matrix:
|
||||
before_install: *vcpreinst
|
||||
install: []
|
||||
script:
|
||||
- cmd.exe /C 'vcvarsall.bat x64 && nmake OPTS=symbols -f makefile.vc all tcltest'
|
||||
- cmd.exe /C 'vcvarsall.bat x64 && nmake OPTS=symbols -f makefile.vc test'
|
||||
- cmd.exe //C vcvarsall.bat x64 '&&' nmake 'OPTS=symbols' '-f' makefile.vc all tcltest
|
||||
- cmd.exe //C vcvarsall.bat x64 '&&' nmake 'OPTS=symbols' '-f' makefile.vc test
|
||||
# Test on Windows with MSVC native (32-bit)
|
||||
- name: "Windows/MSVC-x86/Shared"
|
||||
os: windows
|
||||
compiler: cl
|
||||
env: *vcenv
|
||||
before_install: *vcpreinst
|
||||
install: []
|
||||
script:
|
||||
- cmd.exe //C vcvarsall.bat x86 '&&' nmake '-f' makefile.vc all tcltest
|
||||
- cmd.exe //C vcvarsall.bat x86 '&&' nmake '-f' makefile.vc test
|
||||
- name: "Windows/MSVC-x86/Shared: UTF_MAX=4"
|
||||
os: windows
|
||||
compiler: cl
|
||||
env: *vcenv
|
||||
before_install: *vcpreinst
|
||||
install: []
|
||||
script:
|
||||
- cmd.exe //C vcvarsall.bat x86 '&&' nmake 'OPTS=utfmax' '-f' makefile.vc all tcltest
|
||||
- cmd.exe //C vcvarsall.bat x86 '&&' nmake 'OPTS=utfmax' '-f' makefile.vc test
|
||||
- name: "Windows/MSVC-x86/Shared: NO_DEPRECATED"
|
||||
os: windows
|
||||
compiler: cl
|
||||
env: *vcenv
|
||||
before_install: *vcpreinst
|
||||
install: []
|
||||
script:
|
||||
- cmd.exe //C vcvarsall.bat x86 '&&' nmake 'OPTS=nodep' '-f' makefile.vc all tcltest
|
||||
- cmd.exe //C vcvarsall.bat x86 '&&' nmake 'OPTS=nodep' '-f' makefile.vc test
|
||||
- name: "Windows/MSVC-x86/Static"
|
||||
os: windows
|
||||
compiler: cl
|
||||
env: *vcenv
|
||||
before_install: *vcpreinst
|
||||
install: []
|
||||
script:
|
||||
- cmd.exe //C vcvarsall.bat x86 '&&' nmake 'OPTS=static,msvcrt' '-f' makefile.vc all tcltest
|
||||
- cmd.exe //C vcvarsall.bat x86 '&&' nmake 'OPTS=static,msvcrt' '-f' makefile.vc test
|
||||
- name: "Windows/MSVC-x86/Debug"
|
||||
os: windows
|
||||
compiler: cl
|
||||
env: *vcenv
|
||||
before_install: *vcpreinst
|
||||
install: []
|
||||
script:
|
||||
- cmd.exe //C vcvarsall.bat x86 '&&' nmake 'OPTS=symbols' '-f' makefile.vc all tcltest
|
||||
- cmd.exe //C vcvarsall.bat x86 '&&' nmake 'OPTS=symbols' '-f' makefile.vc test
|
||||
# Test on Windows with GCC native
|
||||
- name: "Windows/GCC/Shared"
|
||||
os: windows
|
||||
@@ -346,54 +313,90 @@ matrix:
|
||||
env:
|
||||
- BUILD_DIR=win
|
||||
- CFGOPT="--enable-64bit"
|
||||
before_install:
|
||||
- choco install make
|
||||
before_install: &makepreinst
|
||||
- choco install -y make zip
|
||||
- cd ${BUILD_DIR}
|
||||
- name: "Windows/GCC/Shared: UTF_MAX=6"
|
||||
- name: "Windows/GCC/Shared: UTF_MAX=4"
|
||||
os: windows
|
||||
compiler: gcc
|
||||
env:
|
||||
- BUILD_DIR=win
|
||||
- CFGOPT="--enable-64bit CFLAGS=-DTCL_UTF_MAX=6"
|
||||
before_install:
|
||||
- choco install make
|
||||
- cd ${BUILD_DIR}
|
||||
- name: "Windows/GCC/Shared: UTF_MAX=3"
|
||||
os: windows
|
||||
compiler: gcc
|
||||
env:
|
||||
- BUILD_DIR=win
|
||||
- CFGOPT="--enable-64bit CFLAGS=-DTCL_UTF_MAX=3"
|
||||
before_install:
|
||||
- choco install make
|
||||
- cd ${BUILD_DIR}
|
||||
- CFGOPT="--enable-64bit CFLAGS=-DTCL_UTF_MAX=4"
|
||||
before_install: *makepreinst
|
||||
- name: "Windows/GCC/Shared: NO_DEPRECATED"
|
||||
os: windows
|
||||
compiler: gcc
|
||||
env:
|
||||
- BUILD_DIR=win
|
||||
- CFGOPT="--enable-64bit CFLAGS=-DTCL_NO_DEPRECATED=1"
|
||||
before_install:
|
||||
- choco install make
|
||||
- cd ${BUILD_DIR}
|
||||
before_install: *makepreinst
|
||||
- name: "Windows/G++/Shared"
|
||||
os: windows
|
||||
compiler: g++
|
||||
env:
|
||||
- BUILD_DIR=win
|
||||
- CFGOPT="CC=g++ --enable-64bit"
|
||||
before_install: *makepreinst
|
||||
script:
|
||||
- make all tcltest
|
||||
- name: "Windows/GCC/Static"
|
||||
os: windows
|
||||
compiler: gcc
|
||||
env:
|
||||
- BUILD_DIR=win
|
||||
- CFGOPT="--enable-64bit --disable-shared"
|
||||
before_install:
|
||||
- choco install make
|
||||
- cd ${BUILD_DIR}
|
||||
before_install: *makepreinst
|
||||
- name: "Windows/GCC/Debug"
|
||||
os: windows
|
||||
compiler: gcc
|
||||
env:
|
||||
- BUILD_DIR=win
|
||||
- CFGOPT="--enable-64bit --enable-symbols"
|
||||
before_install:
|
||||
- choco install make
|
||||
- cd ${BUILD_DIR}
|
||||
before_install: *makepreinst
|
||||
# Test on Windows with GCC native (32-bit)
|
||||
- name: "Windows/GCC-x86/Shared"
|
||||
os: windows
|
||||
compiler: gcc
|
||||
env:
|
||||
- BUILD_DIR=win
|
||||
before_install: *makepreinst
|
||||
- name: "Windows/GCC-x86/Shared: UTF_MAX=4"
|
||||
os: windows
|
||||
compiler: gcc
|
||||
env:
|
||||
- BUILD_DIR=win
|
||||
- CFGOPT="CFLAGS=-DTCL_UTF_MAX=4"
|
||||
before_install: *makepreinst
|
||||
- name: "Windows/GCC-x86/Shared: NO_DEPRECATED"
|
||||
os: windows
|
||||
compiler: gcc
|
||||
env:
|
||||
- BUILD_DIR=win
|
||||
- CFGOPT="CFLAGS=-DTCL_NO_DEPRECATED=1"
|
||||
before_install: *makepreinst
|
||||
- name: "Windows/G++-x86/Shared"
|
||||
os: windows
|
||||
compiler: g++
|
||||
env:
|
||||
- BUILD_DIR=win
|
||||
- CFGOPT="CC=g++"
|
||||
before_install: *makepreinst
|
||||
script:
|
||||
- make all tcltest
|
||||
- name: "Windows/GCC-x86/Static"
|
||||
os: windows
|
||||
compiler: gcc
|
||||
env:
|
||||
- BUILD_DIR=win
|
||||
- CFGOPT="--disable-shared"
|
||||
before_install: *makepreinst
|
||||
- name: "Windows/GCC-x86/Debug"
|
||||
os: windows
|
||||
compiler: gcc
|
||||
env:
|
||||
- BUILD_DIR=win
|
||||
- CFGOPT="--enable-symbols"
|
||||
before_install: *makepreinst
|
||||
before_install:
|
||||
- cd ${BUILD_DIR}
|
||||
install:
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# README: Tcl
|
||||
|
||||
This is the **Tcl 8.7a2** source distribution.
|
||||
This is the **Tcl 8.7a4** source distribution.
|
||||
|
||||
You can get any source release of Tcl from [our distribution
|
||||
site](https://sourceforge.net/projects/tcl/files/Tcl/).
|
||||
|
||||
@@ -8303,7 +8303,7 @@ reported usage of large expressions (porter)
|
||||
|
||||
Many optmizations, improvements, and tightened stack management in bytecode.
|
||||
|
||||
--- Released 8.6.1, September 20, 2013 --- http://core.tcl.tk/tcl/ for details
|
||||
--- Released 8.6.1, September 20, 2013 --- https://core.tcl-lang.org/tcl/ for details
|
||||
|
||||
2013-09-27 (enhancement) improved ::env synchronization (fellows)
|
||||
|
||||
@@ -8451,7 +8451,7 @@ include ::oo::class (fellows)
|
||||
|
||||
2014-08-25 (TIP 429) New command [string cat] (leitgeb,ferrieux)
|
||||
|
||||
--- Released 8.6.2, August 27, 2014 --- http://core.tcl.tk/tcl/ for details
|
||||
--- Released 8.6.2, August 27, 2014 --- https://core.tcl-lang.org/tcl/ for details
|
||||
|
||||
2014-08-28 (bug)[b9e1a3] Correct Method Search Order (nadkarni,fellows)
|
||||
=> TclOO 1.0.3
|
||||
@@ -8491,7 +8491,7 @@ include ::oo::class (fellows)
|
||||
|
||||
2014-11-06 (bug)[5adc35] Stop forcing EOF to be permanent (porter)
|
||||
|
||||
--- Released 8.6.3, November 12, 2014 --- http://core.tcl.tk/tcl/ for details
|
||||
--- Released 8.6.3, November 12, 2014 --- https://core.tcl-lang.org/tcl/ for details
|
||||
|
||||
2014-11-21 (bug)[743338] Win: socket error encoding (ladayaroslav,nijtmans)
|
||||
|
||||
@@ -8527,7 +8527,7 @@ include ::oo::class (fellows)
|
||||
2015-03-10 (enhancement) Revise OS X notifier for better Cocoa (walzer)
|
||||
*** POTENTIAL INCOMPATIBILITY ***
|
||||
|
||||
--- Released 8.6.4, March 12, 2015 --- http://core.tcl.tk/tcl/ for details
|
||||
--- Released 8.6.4, March 12, 2015 --- https://core.tcl-lang.org/tcl/ for details
|
||||
|
||||
2015-03-19 (bug)[e66e44] Win: Ctrl-C/Ctrl-Break in console not EOF (nadkarni)
|
||||
|
||||
@@ -8623,7 +8623,7 @@ improvements to regexp engine from Postgres (lane,porter,fellows,seltenreich)
|
||||
|
||||
2016-02-22 (bug)[9b4702] [info exists env(missing)] kills trace (nijtmans)
|
||||
|
||||
--- Released 8.6.5, February 29, 2016 --- http://core.tcl.tk/tcl/ for details
|
||||
--- Released 8.6.5, February 29, 2016 --- https://core.tcl-lang.org/tcl/ for details
|
||||
|
||||
2016-03-01 (bug)[803042] mem leak due to reference cycle (porter)
|
||||
|
||||
@@ -8697,7 +8697,7 @@ improvements to regexp engine from Postgres (lane,porter,fellows,seltenreich)
|
||||
|
||||
2016-07-20 tzdata updated to Olson's tzdata2016f (venkat)
|
||||
|
||||
--- Released 8.6.6, July 27, 2016 --- http://core.tcl.tk/tcl/ for details
|
||||
--- Released 8.6.6, July 27, 2016 --- https://core.tcl-lang.org/tcl/ for details
|
||||
|
||||
2016-09-07 (bug)[c09edf] Bad caching with custom resolver (neumann,nijtmans)
|
||||
|
||||
@@ -8794,7 +8794,56 @@ improvements to regexp engine from Postgres (lane,porter,fellows,seltenreich)
|
||||
|
||||
2017-07-17 (bug)[fb2208] Repeatable tclIndex generation (wiedemann,nijtmans)
|
||||
|
||||
--- Released 8.6.7, August 9, 2017 --- http://core.tcl.tk/tcl/ for details
|
||||
--- Released 8.6.7, August 9, 2017 --- https://core.tcl-lang.org/tcl/ for details
|
||||
|
||||
Changes to 8.7a1 include all changes to the 8.6 line through 8.6.7,
|
||||
plus the following, which focuses on the high-level feature changes
|
||||
in this changeset (new minor version) rather than bug fixes:
|
||||
|
||||
2016-03-17 (bug)[0b8c38] socket accept callbacks always in global ns (porter)
|
||||
*** POTENTIAL INCOMPATIBILITY ***
|
||||
|
||||
2016-07-01 Hack accommodations for legacy Itcl 3 disabled (porter)
|
||||
|
||||
2016-07-12 Make TCL_HASH_TYPE build-time configurable (nijtmans)
|
||||
|
||||
2016-07-19 (bug)[0363f0] Partial array search ID reform (porter)
|
||||
|
||||
2016-07-19 (feature removed) Tcl_ObjType "array search" unregistered (porter)
|
||||
*** POTENTIAL INCOMPATIBILITY for Tcl_GetObjType("array search") ***
|
||||
|
||||
2016-10-04 Server socket on port 0 chooses port supporting IPv4 * IPv6 (max)
|
||||
|
||||
2016-11-25 [array names -regexp] supports backrefs (goth)
|
||||
|
||||
2017-01-04 (TIP 456) New routine Tcl_OpenTcpServerEx() (limeboy)
|
||||
|
||||
2017-01-04 (TIP 459) New subcommand [package files] (nijtmans)
|
||||
|
||||
2017-01-16 threaded allocator initialization repair (vasiljevic,nijtmans)
|
||||
|
||||
2017-01-30 Add to Win shell builtins: assoc ftype move (ashok)
|
||||
|
||||
2017-03-31 TCL_MEM_DEBUG facilities better support 64-bit memory (nijtmans)
|
||||
|
||||
2017-04-13 \u escaped content in msg files converted to true utf-8 (nijtmans)
|
||||
|
||||
2017-05-18 (TIP 458) New epoll or kqueue notifiers are default (alborboz)
|
||||
|
||||
2017-05-31 Purge build support for SunOS-4.* (stu)
|
||||
|
||||
2017-06-22 (TIP 463) New option [regsub ... -command ...] (fellows)
|
||||
|
||||
2017-06-22 (TIP 470) Tcl_GetDefineContextObject();[oo::define [self]] (fellows)
|
||||
=> TclOO 1.2.0
|
||||
|
||||
2017-06-23 (TIP 472) Support 0d as prefix of decimal numbers (iyer,griffin)
|
||||
|
||||
2017-08-31 (bug)[2a9465] http state 100 continue handling broken (oehlmann)
|
||||
|
||||
2017-09-02 (bug)[0e4d88] replace command, delete trace kills namespace (porter)
|
||||
|
||||
--- Released 8.7a1, September 8, 2017 --- http://core.tcl.tk/tcl/ for details
|
||||
|
||||
2017-08-10 [array names -regexp] supports backrefs (goth)
|
||||
|
||||
@@ -8829,7 +8878,7 @@ improvements to regexp engine from Postgres (lane,porter,fellows,seltenreich)
|
||||
|
||||
2017-12-19 (bug)[586e71] EvalObjv exception handling at level #0 (sebres,porter)
|
||||
|
||||
--- Released 8.6.8, December 22, 2017 --- http://core.tcl.tk/tcl/ for details
|
||||
--- Released 8.6.8, December 22, 2017 --- https://core.tcl-lang.org/tcl/ for details
|
||||
|
||||
2018-02-11 (enhance) stop blocking conversion of object to/from class (coulter)
|
||||
|
||||
@@ -8895,58 +8944,179 @@ improvements to regexp engine from Postgres (lane,porter,fellows,seltenreich)
|
||||
|
||||
- Released 8.6.9, November 16, 2018 - details at http://core.tcl-lang.org/tcl/ -
|
||||
|
||||
Changes to 8.7a1 include all changes to the 8.6 line through 8.6.7,
|
||||
2018-11-22 (bug)[7a9dc5] [file normalize ~/~foo] segfault (sebres)
|
||||
|
||||
2018-12-30 (bug)[3cf3a9] variable 'timezone' deprecated in vc2017 (nijtmans)
|
||||
|
||||
2019-01-09 (bug)[cc1e91] [list [list {*}[set a " "]]] regression (sebres)
|
||||
|
||||
2019-02-01 (bug)[e3f481] tests var-1.2[01] (sebres)
|
||||
|
||||
2019-03-01 (new) Update to Unicode 12.0 (nijtmans)
|
||||
|
||||
2019-03-05 (new)[TIP 527] New command [timerate] (sebres)
|
||||
|
||||
2019-03-08 (bug)[39fed4] [package require] memory validity (hume,porter)
|
||||
|
||||
2019-04-23 (new) New command tcl::unsupported::corotype (fellows)
|
||||
|
||||
2019-05-04 (bug) memlink when namespace deletion kills linked var (porter)
|
||||
|
||||
2019-05-28 (new) README file converted to README.md in Markdown (nijtmans)
|
||||
|
||||
2019-06-17 (bug)[8b9854] [info level 0] regression with ensembles (porter)
|
||||
|
||||
2019-06-20 (bug)[6bdadf] crash multi-arg write-traced [lappend] (fellows,porter)
|
||||
|
||||
2019-06-21 (bug)[f8a33c] crash Tcl_Exit before init (brooks,sebres)
|
||||
|
||||
2019-08-27 (bug)[fa6bf3] Bytecode fails epoch recovery at numLevel=0 (sebres)
|
||||
|
||||
2019-08-29 (bug)[fec0c1] C stack overflow compiling bytecode (ade,sebres)
|
||||
|
||||
2019-09-12 tzdata updated to Olson's tzdata2019c (jima)
|
||||
|
||||
2019-09-20 (new) registry/dde no longer need -DUNICODE (nijtmans)
|
||||
=> registry 1.3.4
|
||||
=> dde 1.4.2
|
||||
|
||||
2019-10-02 (bug)[16768d] Fix [info hostname] on NetBSD (rytaro)
|
||||
|
||||
2019-10-23 (new) libtommath updated to release 1.2.0 (nijtmans)
|
||||
|
||||
2019-10-25 OSX: system Tcl deprecated. End default use of its packages. (walzer)
|
||||
|
||||
2019-10-28 (bug)[bcd100] bad fs cache when system encoding changes (coulter)
|
||||
|
||||
2019-11-15 (bug)[135804] segfault in [next] after destroy (coulter,sebres)
|
||||
|
||||
- Released 8.6.10, Nov 21, 2019 - details at http://core.tcl-lang.org/tcl/ -
|
||||
|
||||
Changes to 8.7a3 include all changes to the 8.6 line through 8.6.10,
|
||||
plus the following, which focuses on the high-level feature changes
|
||||
in this changeset (new minor version) rather than bug fixes:
|
||||
|
||||
2016-03-17 (bug)[0b8c38] socket accept callbacks always in global ns (porter)
|
||||
*** POTENTIAL INCOMPATIBILITY ***
|
||||
2017-11-01 (bug)[3c32a3] crash deleting class mixed into instance (coulter)
|
||||
|
||||
2016-07-01 Hack accommodations for legacy Itcl 3 disabled (porter)
|
||||
2017-11-03 [TIP 345] eliminate the encoding 'identity' (porter)
|
||||
|
||||
2016-07-12 Make TCL_HASH_TYPE build-time configurable (nijtmans)
|
||||
2017-11-04 (bug)[0d902e] [string first] on ASCII stored as Unicode (fellows)
|
||||
|
||||
2016-07-19 (bug)[0363f0] Partial array search ID reform (porter)
|
||||
2017-11-17 [TIP 422] Mark all Tcl_*VA() routines deprecated. (nijtmans)
|
||||
|
||||
2016-07-19 (feature removed) Tcl_ObjType "array search" unregistered (porter)
|
||||
*** POTENTIAL INCOMPATIBILITY for Tcl_GetObjType("array search") ***
|
||||
2017-11-20 (support) Ended use of the obsolete values.h header (culler)
|
||||
|
||||
2016-10-04 Server socket on port 0 chooses port supporting IPv4 * IPv6 (max)
|
||||
2017-11-30 (bug)[8e1e31] [lsort] ordering of U+0000 (nijtmans)
|
||||
|
||||
2016-11-25 [array names -regexp] supports backrefs (goth)
|
||||
2017-12-07 [TIP 487] Terminate support for pre-XP Windows (nijtmans)
|
||||
|
||||
2017-01-04 (TIP 456) New routine Tcl_OpenTcpServerEx() (limeboy)
|
||||
2017-12-08 [TIP 477] Reform of nmake build (nadkarni)
|
||||
|
||||
2017-01-04 (TIP 459) New subcommand [package files] (nijtmans)
|
||||
2017-12-20 (bug)[ba1419] Crash: complex ensemble delete, namespace-7.8 (coulter)
|
||||
|
||||
2017-01-16 threaded allocator initialization repair (vasiljevic,nijtmans)
|
||||
2018-01-17 [TIP 485] Removal of many deprecated features (nijtmans)
|
||||
|
||||
2017-01-30 Add to Win shell builtins: assoc ftype move (ashok)
|
||||
2018-01-27 (bug) Crash in [join $l $l], join-4.1 (porter)
|
||||
|
||||
2017-03-31 TCL_MEM_DEBUG facilities better support 64-bit memory (nijtmans)
|
||||
2018-02-06 [TIP 493] Cease Distribution of http 1.0 (porter)
|
||||
|
||||
2017-04-13 \u escaped content in msg files converted to true utf-8 (nijtmans)
|
||||
2018-02-06 [TIP 484] internal rep for native ints are all 64-bit (nijtmans)
|
||||
|
||||
2017-05-18 (TIP 458) New epoll or kqueue notifiers are default (alborboz)
|
||||
2018-02-14 [TIP 476] Scan/Printf consistency (nijtmans)
|
||||
|
||||
2017-05-31 Purge build support for SunOS-4.* (stu)
|
||||
2018-03-05 [TIP 351] [lsearch] striding
|
||||
|
||||
2017-06-22 (TIP 463) New option [regsub ... -command ...] (fellows)
|
||||
2018-03-05 [TIPs 330,336] tighten access to Interp fields (porter)
|
||||
|
||||
2017-06-22 (TIP 470) Tcl_GetDefineContextObject();[oo::define [self]] (fellows)
|
||||
=> TclOO 1.2.0
|
||||
2018-03-12 [TIP 462] [::tcl::process]
|
||||
|
||||
2017-06-23 (TIP 472) Support 0d as prefix of decimal numbers (iyer,griffin)
|
||||
2018-03-12 [TIP 490] add oo support for msgcat => msgcat 1.7.0 (oehlmann)
|
||||
|
||||
2017-08-31 (bug)[2a9465] http state 100 continue handling broken (oehlmann)
|
||||
|
||||
2017-09-02 (bug)[0e4d88] replace command, delete trace kills namespace (porter)
|
||||
|
||||
--- Released 8.7a1, September 8, 2017 --- http://core.tcl.tk/tcl/ for details
|
||||
|
||||
2018-03-12 (TIP 490) add oo support for msgcat => msgcat 1.7.0 (oehlmann)
|
||||
|
||||
2018-03-12 (TIP 499) custom locale preference list (oehlmann)
|
||||
2018-03-12 [TIP 499] custom locale preference list (oehlmann)
|
||||
=> msgcat 1.7.0
|
||||
|
||||
- Released 8.7a3, Nov 30, 2018 --- http://core.tcl-lang.org/tcl/ for details -
|
||||
2018-03-20 [TIP 503] End CONST84 support for Tcl 8.3 (porter)
|
||||
|
||||
2018-03-30 Refactored [lrange] (spjuth)
|
||||
|
||||
2018-04-20 [TIP 389] Unicode beyond BMP (nijtmans)
|
||||
|
||||
2018-04-20 [TIP 421] [array for]
|
||||
|
||||
2018-05-11 [TIP 425] Windows panic callback use of UTF-8
|
||||
|
||||
2018-05-17 [TIP 491] Phase out --disable-threads support
|
||||
|
||||
2018-06-03 [TIP 500] TclOO Private Methods and Variables
|
||||
|
||||
2018-07-26 (bug)[ba921a] [string cat] of bytearrays (coulter,porter)
|
||||
|
||||
2018-09-02 [TIP 478] Many new features in TclOO (lester,fellows)
|
||||
|
||||
2018-09-04 (bug)[540bed] [binary format w] from bignum (nijtmans)
|
||||
|
||||
2018-09-12 [TIP 430] zipfs and embedded script library (woods)
|
||||
|
||||
2018-09-26 [TIP 508] [array default] (bonnet,fellows)
|
||||
|
||||
2018-09-27 [TIP 515] level value reform (nijtmans)
|
||||
|
||||
2018-09-27 [TIP 516] More OO slot operations (fellows)
|
||||
|
||||
2018-09-27 [TIP 426] [info cmdtype] (fellows)
|
||||
|
||||
2018-09-28 [TIP 509] Cross platform reentrant mutex
|
||||
|
||||
2018-10-08 [TIP 514] native integers are 64-bit
|
||||
|
||||
2018-10-12 [TIP 502] index value reform (porter)
|
||||
|
||||
2018-11-06 [TIP 406] http cookies (fellows)
|
||||
|
||||
2018-11-06 [TIP 445] Tcl_ObjType utilities (migrate to Tcl 9) (porter)
|
||||
|
||||
2018-11-06 [TIP 501] [string is dict]
|
||||
|
||||
2018-11-06 [TIP 519] inline export/unexport option for [oo::define]
|
||||
|
||||
2018-11-06 [TIP 523] [lpop]
|
||||
|
||||
2018-11-06 [TIP 524] TclOO custom dialects
|
||||
|
||||
2018-11-06 [TIP 506] Tcl_(Incr|Decr)RefCount macros -> functions (porter)
|
||||
|
||||
2018-11-15 [TIP 512] No stub for Tcl_SetExitProc()
|
||||
|
||||
2019-04-08 (bug)[45b9fa] crash in [try] (coulter)
|
||||
|
||||
2019-04-14 [TIP 160] terminal and serial channel controls
|
||||
|
||||
2019-04-14 [TIP 312] more types for Tcl_LinkVar
|
||||
|
||||
2019-04-14 [TIP 367] [lremove]
|
||||
|
||||
2019-04-14 [TIP 504] [string insert]
|
||||
|
||||
2019-04-16 [TIP 342] [dict getwithdefault]
|
||||
|
||||
2019-05-25 [TIP 431] [file tempdir]
|
||||
|
||||
2019-05-25 [TIP 383] [coroinject], [coroprobe]
|
||||
|
||||
2019-05-31 [TIP 544] Tcl_GetIntForIndex()
|
||||
|
||||
2019-06-12 Replace TclOffset() with offsetof()
|
||||
|
||||
2019-06-15 [TIP 461] string compare operators for [expr]
|
||||
|
||||
2019-06-16 [TIP 521] floating point classification functions for [expr]
|
||||
|
||||
2019-06-20 (bug)[6bdadf] crash multi-arg traced [lappend] (fellows)
|
||||
|
||||
2019-06-28 [TIP 547] New encodings utf-16, ucs-2
|
||||
|
||||
2019-09-14 [TIP 414] Tcl_InitSubsystems()
|
||||
|
||||
2019-09-14 [TIP 548] wchar_t conversion functions
|
||||
|
||||
- Released 8.7a3, Nov 21, 2019 --- http://core.tcl-lang.org/tcl/ for details -
|
||||
|
||||
+919
@@ -0,0 +1,919 @@
|
||||
/* A portable stdint.h
|
||||
****************************************************************************
|
||||
* BSD License:
|
||||
****************************************************************************
|
||||
*
|
||||
* Copyright (c) 2005-2016 Paul Hsieh
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. The name of the author may not be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
||||
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
****************************************************************************
|
||||
*
|
||||
* Version 0.1.16.0
|
||||
*
|
||||
* The ANSI C standard committee, for the C99 standard, specified the
|
||||
* inclusion of a new standard include file called stdint.h. This is
|
||||
* a very useful and long desired include file which contains several
|
||||
* very precise definitions for integer scalar types that is critically
|
||||
* important for making several classes of applications portable
|
||||
* including cryptography, hashing, variable length integer libraries
|
||||
* and so on. But for most developers its likely useful just for
|
||||
* programming sanity.
|
||||
*
|
||||
* The problem is that some compiler vendors chose to ignore the C99
|
||||
* standard and some older compilers have no opportunity to be updated.
|
||||
* Because of this situation, simply including stdint.h in your code
|
||||
* makes it unportable.
|
||||
*
|
||||
* So that's what this file is all about. It's an attempt to build a
|
||||
* single universal include file that works on as many platforms as
|
||||
* possible to deliver what stdint.h is supposed to. Even compilers
|
||||
* that already come with stdint.h can use this file instead without
|
||||
* any loss of functionality. A few things that should be noted about
|
||||
* this file:
|
||||
*
|
||||
* 1) It is not guaranteed to be portable and/or present an identical
|
||||
* interface on all platforms. The extreme variability of the
|
||||
* ANSI C standard makes this an impossibility right from the
|
||||
* very get go. Its really only meant to be useful for the vast
|
||||
* majority of platforms that possess the capability of
|
||||
* implementing usefully and precisely defined, standard sized
|
||||
* integer scalars. Systems which are not intrinsically 2s
|
||||
* complement may produce invalid constants.
|
||||
*
|
||||
* 2) There is an unavoidable use of non-reserved symbols.
|
||||
*
|
||||
* 3) Other standard include files are invoked.
|
||||
*
|
||||
* 4) This file may come in conflict with future platforms that do
|
||||
* include stdint.h. The hope is that one or the other can be
|
||||
* used with no real difference.
|
||||
*
|
||||
* 5) In the current version, if your platform can't represent
|
||||
* int32_t, int16_t and int8_t, it just dumps out with a compiler
|
||||
* error.
|
||||
*
|
||||
* 6) 64 bit integers may or may not be defined. Test for their
|
||||
* presence with the test: #ifdef INT64_MAX or #ifdef UINT64_MAX.
|
||||
* Note that this is different from the C99 specification which
|
||||
* requires the existence of 64 bit support in the compiler. If
|
||||
* this is not defined for your platform, yet it is capable of
|
||||
* dealing with 64 bits then it is because this file has not yet
|
||||
* been extended to cover all of your system's capabilities.
|
||||
*
|
||||
* 7) (u)intptr_t may or may not be defined. Test for its presence
|
||||
* with the test: #ifdef PTRDIFF_MAX. If this is not defined
|
||||
* for your platform, then it is because this file has not yet
|
||||
* been extended to cover all of your system's capabilities, not
|
||||
* because its optional.
|
||||
*
|
||||
* 8) The following might not been defined even if your platform is
|
||||
* capable of defining it:
|
||||
*
|
||||
* WCHAR_MIN
|
||||
* WCHAR_MAX
|
||||
* (u)int64_t
|
||||
* PTRDIFF_MIN
|
||||
* PTRDIFF_MAX
|
||||
* (u)intptr_t
|
||||
*
|
||||
* 9) The following have not been defined:
|
||||
*
|
||||
* WINT_MIN
|
||||
* WINT_MAX
|
||||
*
|
||||
* 10) The criteria for defining (u)int_least(*)_t isn't clear,
|
||||
* except for systems which don't have a type that precisely
|
||||
* defined 8, 16, or 32 bit types (which this include file does
|
||||
* not support anyways). Default definitions have been given.
|
||||
*
|
||||
* 11) The criteria for defining (u)int_fast(*)_t isn't something I
|
||||
* would trust to any particular compiler vendor or the ANSI C
|
||||
* committee. It is well known that "compatible systems" are
|
||||
* commonly created that have very different performance
|
||||
* characteristics from the systems they are compatible with,
|
||||
* especially those whose vendors make both the compiler and the
|
||||
* system. Default definitions have been given, but its strongly
|
||||
* recommended that users never use these definitions for any
|
||||
* reason (they do *NOT* deliver any serious guarantee of
|
||||
* improved performance -- not in this file, nor any vendor's
|
||||
* stdint.h).
|
||||
*
|
||||
* 12) The following macros:
|
||||
*
|
||||
* PRINTF_INTMAX_MODIFIER
|
||||
* PRINTF_INT64_MODIFIER
|
||||
* PRINTF_INT32_MODIFIER
|
||||
* PRINTF_INT16_MODIFIER
|
||||
* PRINTF_LEAST64_MODIFIER
|
||||
* PRINTF_LEAST32_MODIFIER
|
||||
* PRINTF_LEAST16_MODIFIER
|
||||
* PRINTF_INTPTR_MODIFIER
|
||||
*
|
||||
* are strings which have been defined as the modifiers required
|
||||
* for the "d", "u" and "x" printf formats to correctly output
|
||||
* (u)intmax_t, (u)int64_t, (u)int32_t, (u)int16_t, (u)least64_t,
|
||||
* (u)least32_t, (u)least16_t and (u)intptr_t types respectively.
|
||||
* PRINTF_INTPTR_MODIFIER is not defined for some systems which
|
||||
* provide their own stdint.h. PRINTF_INT64_MODIFIER is not
|
||||
* defined if INT64_MAX is not defined. These are an extension
|
||||
* beyond what C99 specifies must be in stdint.h.
|
||||
*
|
||||
* In addition, the following macros are defined:
|
||||
*
|
||||
* PRINTF_INTMAX_HEX_WIDTH
|
||||
* PRINTF_INT64_HEX_WIDTH
|
||||
* PRINTF_INT32_HEX_WIDTH
|
||||
* PRINTF_INT16_HEX_WIDTH
|
||||
* PRINTF_INT8_HEX_WIDTH
|
||||
* PRINTF_INTMAX_DEC_WIDTH
|
||||
* PRINTF_INT64_DEC_WIDTH
|
||||
* PRINTF_INT32_DEC_WIDTH
|
||||
* PRINTF_INT16_DEC_WIDTH
|
||||
* PRINTF_UINT8_DEC_WIDTH
|
||||
* PRINTF_UINTMAX_DEC_WIDTH
|
||||
* PRINTF_UINT64_DEC_WIDTH
|
||||
* PRINTF_UINT32_DEC_WIDTH
|
||||
* PRINTF_UINT16_DEC_WIDTH
|
||||
* PRINTF_UINT8_DEC_WIDTH
|
||||
*
|
||||
* Which specifies the maximum number of characters required to
|
||||
* print the number of that type in either hexadecimal or decimal.
|
||||
* These are an extension beyond what C99 specifies must be in
|
||||
* stdint.h.
|
||||
*
|
||||
* Compilers tested (all with 0 warnings at their highest respective
|
||||
* settings): Borland Turbo C 2.0, WATCOM C/C++ 11.0 (16 bits and 32
|
||||
* bits), Microsoft Visual C++ 6.0 (32 bit), Microsoft Visual Studio
|
||||
* .net (VC7), Intel C++ 4.0, GNU gcc v3.3.3
|
||||
*
|
||||
* This file should be considered a work in progress. Suggestions for
|
||||
* improvements, especially those which increase coverage are strongly
|
||||
* encouraged.
|
||||
*
|
||||
* Acknowledgements
|
||||
*
|
||||
* The following people have made significant contributions to the
|
||||
* development and testing of this file:
|
||||
*
|
||||
* Chris Howie
|
||||
* John Steele Scott
|
||||
* Dave Thorup
|
||||
* John Dill
|
||||
* Florian Wobbe
|
||||
* Christopher Sean Morrison
|
||||
* Mikkel Fahnoe Jorgensen
|
||||
*
|
||||
*/
|
||||
|
||||
#include <stddef.h>
|
||||
#include <limits.h>
|
||||
#include <signal.h>
|
||||
|
||||
/*
|
||||
* For gcc with _STDINT_H, fill in the PRINTF_INT*_MODIFIER macros, and
|
||||
* do nothing else. On the Mac OS X version of gcc this is _STDINT_H_.
|
||||
*/
|
||||
|
||||
#if ((defined(__SUNPRO_C) && __SUNPRO_C >= 0x570) || (defined(_MSC_VER) && _MSC_VER >= 1600) || (defined(__STDC__) && __STDC__ && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || (defined (__WATCOMC__) && (defined (_STDINT_H_INCLUDED) || __WATCOMC__ >= 1250)) || (defined(__GNUC__) && (__GNUC__ > 3 || defined(_STDINT_H) || defined(_STDINT_H_) || defined (__UINT_FAST64_TYPE__)) )) && !defined (_PSTDINT_H_INCLUDED)
|
||||
#include <stdint.h>
|
||||
#define _PSTDINT_H_INCLUDED
|
||||
# if defined(__GNUC__) && (defined(__x86_64__) || defined(__ppc64__)) && !(defined(__APPLE__) && defined(__MACH__))
|
||||
# ifndef PRINTF_INT64_MODIFIER
|
||||
# define PRINTF_INT64_MODIFIER "l"
|
||||
# endif
|
||||
# ifndef PRINTF_INT32_MODIFIER
|
||||
# define PRINTF_INT32_MODIFIER ""
|
||||
# endif
|
||||
# else
|
||||
# ifndef PRINTF_INT64_MODIFIER
|
||||
# define PRINTF_INT64_MODIFIER "ll"
|
||||
# endif
|
||||
# ifndef PRINTF_INT32_MODIFIER
|
||||
# if (UINT_MAX == UINT32_MAX)
|
||||
# define PRINTF_INT32_MODIFIER ""
|
||||
# else
|
||||
# define PRINTF_INT32_MODIFIER "l"
|
||||
# endif
|
||||
# endif
|
||||
# endif
|
||||
# ifndef PRINTF_INT16_MODIFIER
|
||||
# define PRINTF_INT16_MODIFIER "h"
|
||||
# endif
|
||||
# ifndef PRINTF_INTMAX_MODIFIER
|
||||
# define PRINTF_INTMAX_MODIFIER PRINTF_INT64_MODIFIER
|
||||
# endif
|
||||
# ifndef PRINTF_INT64_HEX_WIDTH
|
||||
# define PRINTF_INT64_HEX_WIDTH "16"
|
||||
# endif
|
||||
# ifndef PRINTF_UINT64_HEX_WIDTH
|
||||
# define PRINTF_UINT64_HEX_WIDTH "16"
|
||||
# endif
|
||||
# ifndef PRINTF_INT32_HEX_WIDTH
|
||||
# define PRINTF_INT32_HEX_WIDTH "8"
|
||||
# endif
|
||||
# ifndef PRINTF_UINT32_HEX_WIDTH
|
||||
# define PRINTF_UINT32_HEX_WIDTH "8"
|
||||
# endif
|
||||
# ifndef PRINTF_INT16_HEX_WIDTH
|
||||
# define PRINTF_INT16_HEX_WIDTH "4"
|
||||
# endif
|
||||
# ifndef PRINTF_UINT16_HEX_WIDTH
|
||||
# define PRINTF_UINT16_HEX_WIDTH "4"
|
||||
# endif
|
||||
# ifndef PRINTF_INT8_HEX_WIDTH
|
||||
# define PRINTF_INT8_HEX_WIDTH "2"
|
||||
# endif
|
||||
# ifndef PRINTF_UINT8_HEX_WIDTH
|
||||
# define PRINTF_UINT8_HEX_WIDTH "2"
|
||||
# endif
|
||||
# ifndef PRINTF_INT64_DEC_WIDTH
|
||||
# define PRINTF_INT64_DEC_WIDTH "19"
|
||||
# endif
|
||||
# ifndef PRINTF_UINT64_DEC_WIDTH
|
||||
# define PRINTF_UINT64_DEC_WIDTH "20"
|
||||
# endif
|
||||
# ifndef PRINTF_INT32_DEC_WIDTH
|
||||
# define PRINTF_INT32_DEC_WIDTH "10"
|
||||
# endif
|
||||
# ifndef PRINTF_UINT32_DEC_WIDTH
|
||||
# define PRINTF_UINT32_DEC_WIDTH "10"
|
||||
# endif
|
||||
# ifndef PRINTF_INT16_DEC_WIDTH
|
||||
# define PRINTF_INT16_DEC_WIDTH "5"
|
||||
# endif
|
||||
# ifndef PRINTF_UINT16_DEC_WIDTH
|
||||
# define PRINTF_UINT16_DEC_WIDTH "5"
|
||||
# endif
|
||||
# ifndef PRINTF_INT8_DEC_WIDTH
|
||||
# define PRINTF_INT8_DEC_WIDTH "3"
|
||||
# endif
|
||||
# ifndef PRINTF_UINT8_DEC_WIDTH
|
||||
# define PRINTF_UINT8_DEC_WIDTH "3"
|
||||
# endif
|
||||
# ifndef PRINTF_INTMAX_HEX_WIDTH
|
||||
# define PRINTF_INTMAX_HEX_WIDTH PRINTF_UINT64_HEX_WIDTH
|
||||
# endif
|
||||
# ifndef PRINTF_UINTMAX_HEX_WIDTH
|
||||
# define PRINTF_UINTMAX_HEX_WIDTH PRINTF_UINT64_HEX_WIDTH
|
||||
# endif
|
||||
# ifndef PRINTF_INTMAX_DEC_WIDTH
|
||||
# define PRINTF_INTMAX_DEC_WIDTH PRINTF_UINT64_DEC_WIDTH
|
||||
# endif
|
||||
# ifndef PRINTF_UINTMAX_DEC_WIDTH
|
||||
# define PRINTF_UINTMAX_DEC_WIDTH PRINTF_UINT64_DEC_WIDTH
|
||||
# endif
|
||||
|
||||
/*
|
||||
* Something really weird is going on with Open Watcom. Just pull some of
|
||||
* these duplicated definitions from Open Watcom's stdint.h file for now.
|
||||
*/
|
||||
|
||||
# if defined (__WATCOMC__) && __WATCOMC__ >= 1250
|
||||
# if !defined (INT64_C)
|
||||
# define INT64_C(x) (x + (INT64_MAX - INT64_MAX))
|
||||
# endif
|
||||
# if !defined (UINT64_C)
|
||||
# define UINT64_C(x) (x + (UINT64_MAX - UINT64_MAX))
|
||||
# endif
|
||||
# if !defined (INT32_C)
|
||||
# define INT32_C(x) (x + (INT32_MAX - INT32_MAX))
|
||||
# endif
|
||||
# if !defined (UINT32_C)
|
||||
# define UINT32_C(x) (x + (UINT32_MAX - UINT32_MAX))
|
||||
# endif
|
||||
# if !defined (INT16_C)
|
||||
# define INT16_C(x) (x)
|
||||
# endif
|
||||
# if !defined (UINT16_C)
|
||||
# define UINT16_C(x) (x)
|
||||
# endif
|
||||
# if !defined (INT8_C)
|
||||
# define INT8_C(x) (x)
|
||||
# endif
|
||||
# if !defined (UINT8_C)
|
||||
# define UINT8_C(x) (x)
|
||||
# endif
|
||||
# if !defined (UINT64_MAX)
|
||||
# define UINT64_MAX 18446744073709551615ULL
|
||||
# endif
|
||||
# if !defined (INT64_MAX)
|
||||
# define INT64_MAX 9223372036854775807LL
|
||||
# endif
|
||||
# if !defined (UINT32_MAX)
|
||||
# define UINT32_MAX 4294967295UL
|
||||
# endif
|
||||
# if !defined (INT32_MAX)
|
||||
# define INT32_MAX 2147483647L
|
||||
# endif
|
||||
# if !defined (INTMAX_MAX)
|
||||
# define INTMAX_MAX INT64_MAX
|
||||
# endif
|
||||
# if !defined (INTMAX_MIN)
|
||||
# define INTMAX_MIN INT64_MIN
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* I have no idea what is the truly correct thing to do on older Solaris.
|
||||
* From some online discussions, this seems to be what is being
|
||||
* recommended. For people who actually are developing on older Solaris,
|
||||
* what I would like to know is, does this define all of the relevant
|
||||
* macros of a complete stdint.h? Remember, in pstdint.h 64 bit is
|
||||
* considered optional.
|
||||
*/
|
||||
|
||||
#if (defined(__SUNPRO_C) && __SUNPRO_C >= 0x420) && !defined(_PSTDINT_H_INCLUDED)
|
||||
#include <sys/inttypes.h>
|
||||
#define _PSTDINT_H_INCLUDED
|
||||
#endif
|
||||
|
||||
#ifndef _PSTDINT_H_INCLUDED
|
||||
#define _PSTDINT_H_INCLUDED
|
||||
|
||||
#ifndef SIZE_MAX
|
||||
# define SIZE_MAX ((size_t)-1)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Deduce the type assignments from limits.h under the assumption that
|
||||
* integer sizes in bits are powers of 2, and follow the ANSI
|
||||
* definitions.
|
||||
*/
|
||||
|
||||
#ifndef UINT8_MAX
|
||||
# define UINT8_MAX 0xff
|
||||
#endif
|
||||
#if !defined(uint8_t) && !defined(_UINT8_T) && !defined(vxWorks)
|
||||
# if (UCHAR_MAX == UINT8_MAX) || defined (S_SPLINT_S)
|
||||
typedef unsigned char uint8_t;
|
||||
# define UINT8_C(v) ((uint8_t) v)
|
||||
# else
|
||||
# error "Platform not supported"
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifndef INT8_MAX
|
||||
# define INT8_MAX 0x7f
|
||||
#endif
|
||||
#ifndef INT8_MIN
|
||||
# define INT8_MIN INT8_C(0x80)
|
||||
#endif
|
||||
#if !defined(int8_t) && !defined(_INT8_T) && !defined(vxWorks)
|
||||
# if (SCHAR_MAX == INT8_MAX) || defined (S_SPLINT_S)
|
||||
typedef signed char int8_t;
|
||||
# define INT8_C(v) ((int8_t) v)
|
||||
# else
|
||||
# error "Platform not supported"
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifndef UINT16_MAX
|
||||
# define UINT16_MAX 0xffff
|
||||
#endif
|
||||
#if !defined(uint16_t) && !defined(_UINT16_T) && !defined(vxWorks)
|
||||
#if (UINT_MAX == UINT16_MAX) || defined (S_SPLINT_S)
|
||||
typedef unsigned int uint16_t;
|
||||
# ifndef PRINTF_INT16_MODIFIER
|
||||
# define PRINTF_INT16_MODIFIER ""
|
||||
# endif
|
||||
# define UINT16_C(v) ((uint16_t) (v))
|
||||
#elif (USHRT_MAX == UINT16_MAX)
|
||||
typedef unsigned short uint16_t;
|
||||
# define UINT16_C(v) ((uint16_t) (v))
|
||||
# ifndef PRINTF_INT16_MODIFIER
|
||||
# define PRINTF_INT16_MODIFIER "h"
|
||||
# endif
|
||||
#else
|
||||
#error "Platform not supported"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef INT16_MAX
|
||||
# define INT16_MAX 0x7fff
|
||||
#endif
|
||||
#ifndef INT16_MIN
|
||||
# define INT16_MIN INT16_C(0x8000)
|
||||
#endif
|
||||
#if !defined(int16_t) && !defined(_INT16_T) && !defined(vxWorks)
|
||||
#if (INT_MAX == INT16_MAX) || defined (S_SPLINT_S)
|
||||
typedef signed int int16_t;
|
||||
# define INT16_C(v) ((int16_t) (v))
|
||||
# ifndef PRINTF_INT16_MODIFIER
|
||||
# define PRINTF_INT16_MODIFIER ""
|
||||
# endif
|
||||
#elif (SHRT_MAX == INT16_MAX)
|
||||
typedef signed short int16_t;
|
||||
# define INT16_C(v) ((int16_t) (v))
|
||||
# ifndef PRINTF_INT16_MODIFIER
|
||||
# define PRINTF_INT16_MODIFIER "h"
|
||||
# endif
|
||||
#else
|
||||
#error "Platform not supported"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef UINT32_MAX
|
||||
# define UINT32_MAX (0xffffffffUL)
|
||||
#endif
|
||||
#if !defined(uint32_t) && !defined(_UINT32_T) && !defined(vxWorks)
|
||||
#if (ULONG_MAX == UINT32_MAX) || defined (S_SPLINT_S)
|
||||
typedef unsigned long uint32_t;
|
||||
# define UINT32_C(v) v ## UL
|
||||
# ifndef PRINTF_INT32_MODIFIER
|
||||
# define PRINTF_INT32_MODIFIER "l"
|
||||
# endif
|
||||
#elif (UINT_MAX == UINT32_MAX)
|
||||
typedef unsigned int uint32_t;
|
||||
# ifndef PRINTF_INT32_MODIFIER
|
||||
# define PRINTF_INT32_MODIFIER ""
|
||||
# endif
|
||||
# define UINT32_C(v) v ## U
|
||||
#elif (USHRT_MAX == UINT32_MAX)
|
||||
typedef unsigned short uint32_t;
|
||||
# define UINT32_C(v) ((unsigned short) (v))
|
||||
# ifndef PRINTF_INT32_MODIFIER
|
||||
# define PRINTF_INT32_MODIFIER ""
|
||||
# endif
|
||||
#else
|
||||
#error "Platform not supported"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef INT32_MAX
|
||||
# define INT32_MAX (0x7fffffffL)
|
||||
#endif
|
||||
#ifndef INT32_MIN
|
||||
# define INT32_MIN INT32_C(0x80000000)
|
||||
#endif
|
||||
#if !defined(int32_t) && !defined(_INT32_T) && !defined(vxWorks)
|
||||
#if (LONG_MAX == INT32_MAX) || defined (S_SPLINT_S)
|
||||
typedef signed long int32_t;
|
||||
# define INT32_C(v) v ## L
|
||||
# ifndef PRINTF_INT32_MODIFIER
|
||||
# define PRINTF_INT32_MODIFIER "l"
|
||||
# endif
|
||||
#elif (INT_MAX == INT32_MAX)
|
||||
typedef signed int int32_t;
|
||||
# define INT32_C(v) v
|
||||
# ifndef PRINTF_INT32_MODIFIER
|
||||
# define PRINTF_INT32_MODIFIER ""
|
||||
# endif
|
||||
#elif (SHRT_MAX == INT32_MAX)
|
||||
typedef signed short int32_t;
|
||||
# define INT32_C(v) ((short) (v))
|
||||
# ifndef PRINTF_INT32_MODIFIER
|
||||
# define PRINTF_INT32_MODIFIER ""
|
||||
# endif
|
||||
#else
|
||||
#error "Platform not supported"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* The macro stdint_int64_defined is temporarily used to record
|
||||
* whether or not 64 integer support is available. It must be
|
||||
* defined for any 64 integer extensions for new platforms that are
|
||||
* added.
|
||||
*/
|
||||
|
||||
#undef stdint_int64_defined
|
||||
#if (defined(__STDC__) && defined(__STDC_VERSION__)) || defined (S_SPLINT_S)
|
||||
# if (__STDC__ && __STDC_VERSION__ >= 199901L) || defined (S_SPLINT_S)
|
||||
# define stdint_int64_defined
|
||||
typedef long long int64_t;
|
||||
typedef unsigned long long uint64_t;
|
||||
# define UINT64_C(v) v ## ULL
|
||||
# define INT64_C(v) v ## LL
|
||||
# ifndef PRINTF_INT64_MODIFIER
|
||||
# define PRINTF_INT64_MODIFIER "ll"
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if !defined (stdint_int64_defined)
|
||||
# if defined(__GNUC__) && !defined(vxWorks)
|
||||
# define stdint_int64_defined
|
||||
__extension__ typedef long long int64_t;
|
||||
__extension__ typedef unsigned long long uint64_t;
|
||||
# define UINT64_C(v) v ## ULL
|
||||
# define INT64_C(v) v ## LL
|
||||
# ifndef PRINTF_INT64_MODIFIER
|
||||
# define PRINTF_INT64_MODIFIER "ll"
|
||||
# endif
|
||||
# elif defined(__MWERKS__) || defined (__SUNPRO_C) || defined (__SUNPRO_CC) || defined (__APPLE_CC__) || defined (_LONG_LONG) || defined (_CRAYC) || defined (S_SPLINT_S)
|
||||
# define stdint_int64_defined
|
||||
typedef long long int64_t;
|
||||
typedef unsigned long long uint64_t;
|
||||
# define UINT64_C(v) v ## ULL
|
||||
# define INT64_C(v) v ## LL
|
||||
# ifndef PRINTF_INT64_MODIFIER
|
||||
# define PRINTF_INT64_MODIFIER "ll"
|
||||
# endif
|
||||
# elif (defined(__WATCOMC__) && defined(__WATCOM_INT64__)) || (defined(_MSC_VER) && _INTEGRAL_MAX_BITS >= 64) || (defined (__BORLANDC__) && __BORLANDC__ > 0x460) || defined (__alpha) || defined (__DECC)
|
||||
# define stdint_int64_defined
|
||||
typedef __int64 int64_t;
|
||||
typedef unsigned __int64 uint64_t;
|
||||
# define UINT64_C(v) v ## UI64
|
||||
# define INT64_C(v) v ## I64
|
||||
# ifndef PRINTF_INT64_MODIFIER
|
||||
# define PRINTF_INT64_MODIFIER "I64"
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if !defined (LONG_LONG_MAX) && defined (INT64_C)
|
||||
# define LONG_LONG_MAX INT64_C (9223372036854775807)
|
||||
#endif
|
||||
#ifndef ULONG_LONG_MAX
|
||||
# define ULONG_LONG_MAX UINT64_C (18446744073709551615)
|
||||
#endif
|
||||
|
||||
#if !defined (INT64_MAX) && defined (INT64_C)
|
||||
# define INT64_MAX INT64_C (9223372036854775807)
|
||||
#endif
|
||||
#if !defined (INT64_MIN) && defined (INT64_C)
|
||||
# define INT64_MIN INT64_C (-9223372036854775808)
|
||||
#endif
|
||||
#if !defined (UINT64_MAX) && defined (INT64_C)
|
||||
# define UINT64_MAX UINT64_C (18446744073709551615)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Width of hexadecimal for number field.
|
||||
*/
|
||||
|
||||
#ifndef PRINTF_INT64_HEX_WIDTH
|
||||
# define PRINTF_INT64_HEX_WIDTH "16"
|
||||
#endif
|
||||
#ifndef PRINTF_INT32_HEX_WIDTH
|
||||
# define PRINTF_INT32_HEX_WIDTH "8"
|
||||
#endif
|
||||
#ifndef PRINTF_INT16_HEX_WIDTH
|
||||
# define PRINTF_INT16_HEX_WIDTH "4"
|
||||
#endif
|
||||
#ifndef PRINTF_INT8_HEX_WIDTH
|
||||
# define PRINTF_INT8_HEX_WIDTH "2"
|
||||
#endif
|
||||
#ifndef PRINTF_INT64_DEC_WIDTH
|
||||
# define PRINTF_INT64_DEC_WIDTH "19"
|
||||
#endif
|
||||
#ifndef PRINTF_INT32_DEC_WIDTH
|
||||
# define PRINTF_INT32_DEC_WIDTH "10"
|
||||
#endif
|
||||
#ifndef PRINTF_INT16_DEC_WIDTH
|
||||
# define PRINTF_INT16_DEC_WIDTH "5"
|
||||
#endif
|
||||
#ifndef PRINTF_INT8_DEC_WIDTH
|
||||
# define PRINTF_INT8_DEC_WIDTH "3"
|
||||
#endif
|
||||
#ifndef PRINTF_UINT64_DEC_WIDTH
|
||||
# define PRINTF_UINT64_DEC_WIDTH "20"
|
||||
#endif
|
||||
#ifndef PRINTF_UINT32_DEC_WIDTH
|
||||
# define PRINTF_UINT32_DEC_WIDTH "10"
|
||||
#endif
|
||||
#ifndef PRINTF_UINT16_DEC_WIDTH
|
||||
# define PRINTF_UINT16_DEC_WIDTH "5"
|
||||
#endif
|
||||
#ifndef PRINTF_UINT8_DEC_WIDTH
|
||||
# define PRINTF_UINT8_DEC_WIDTH "3"
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Ok, lets not worry about 128 bit integers for now. Moore's law says
|
||||
* we don't need to worry about that until about 2040 at which point
|
||||
* we'll have bigger things to worry about.
|
||||
*/
|
||||
|
||||
#ifdef stdint_int64_defined
|
||||
typedef int64_t intmax_t;
|
||||
typedef uint64_t uintmax_t;
|
||||
# define INTMAX_MAX INT64_MAX
|
||||
# define INTMAX_MIN INT64_MIN
|
||||
# define UINTMAX_MAX UINT64_MAX
|
||||
# define UINTMAX_C(v) UINT64_C(v)
|
||||
# define INTMAX_C(v) INT64_C(v)
|
||||
# ifndef PRINTF_INTMAX_MODIFIER
|
||||
# define PRINTF_INTMAX_MODIFIER PRINTF_INT64_MODIFIER
|
||||
# endif
|
||||
# ifndef PRINTF_INTMAX_HEX_WIDTH
|
||||
# define PRINTF_INTMAX_HEX_WIDTH PRINTF_INT64_HEX_WIDTH
|
||||
# endif
|
||||
# ifndef PRINTF_INTMAX_DEC_WIDTH
|
||||
# define PRINTF_INTMAX_DEC_WIDTH PRINTF_INT64_DEC_WIDTH
|
||||
# endif
|
||||
#else
|
||||
typedef int32_t intmax_t;
|
||||
typedef uint32_t uintmax_t;
|
||||
# define INTMAX_MAX INT32_MAX
|
||||
# define UINTMAX_MAX UINT32_MAX
|
||||
# define UINTMAX_C(v) UINT32_C(v)
|
||||
# define INTMAX_C(v) INT32_C(v)
|
||||
# ifndef PRINTF_INTMAX_MODIFIER
|
||||
# define PRINTF_INTMAX_MODIFIER PRINTF_INT32_MODIFIER
|
||||
# endif
|
||||
# ifndef PRINTF_INTMAX_HEX_WIDTH
|
||||
# define PRINTF_INTMAX_HEX_WIDTH PRINTF_INT32_HEX_WIDTH
|
||||
# endif
|
||||
# ifndef PRINTF_INTMAX_DEC_WIDTH
|
||||
# define PRINTF_INTMAX_DEC_WIDTH PRINTF_INT32_DEC_WIDTH
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Because this file currently only supports platforms which have
|
||||
* precise powers of 2 as bit sizes for the default integers, the
|
||||
* least definitions are all trivial. Its possible that a future
|
||||
* version of this file could have different definitions.
|
||||
*/
|
||||
|
||||
#ifndef stdint_least_defined
|
||||
typedef int8_t int_least8_t;
|
||||
typedef uint8_t uint_least8_t;
|
||||
typedef int16_t int_least16_t;
|
||||
typedef uint16_t uint_least16_t;
|
||||
typedef int32_t int_least32_t;
|
||||
typedef uint32_t uint_least32_t;
|
||||
# define PRINTF_LEAST32_MODIFIER PRINTF_INT32_MODIFIER
|
||||
# define PRINTF_LEAST16_MODIFIER PRINTF_INT16_MODIFIER
|
||||
# define UINT_LEAST8_MAX UINT8_MAX
|
||||
# define INT_LEAST8_MAX INT8_MAX
|
||||
# define UINT_LEAST16_MAX UINT16_MAX
|
||||
# define INT_LEAST16_MAX INT16_MAX
|
||||
# define UINT_LEAST32_MAX UINT32_MAX
|
||||
# define INT_LEAST32_MAX INT32_MAX
|
||||
# define INT_LEAST8_MIN INT8_MIN
|
||||
# define INT_LEAST16_MIN INT16_MIN
|
||||
# define INT_LEAST32_MIN INT32_MIN
|
||||
# ifdef stdint_int64_defined
|
||||
typedef int64_t int_least64_t;
|
||||
typedef uint64_t uint_least64_t;
|
||||
# define PRINTF_LEAST64_MODIFIER PRINTF_INT64_MODIFIER
|
||||
# define UINT_LEAST64_MAX UINT64_MAX
|
||||
# define INT_LEAST64_MAX INT64_MAX
|
||||
# define INT_LEAST64_MIN INT64_MIN
|
||||
# endif
|
||||
#endif
|
||||
#undef stdint_least_defined
|
||||
|
||||
/*
|
||||
* The ANSI C committee has defined *int*_fast*_t types as well. This,
|
||||
* of course, defies rationality -- you can't know what will be fast
|
||||
* just from the type itself. Even for a given architecture, compatible
|
||||
* implementations might have different performance characteristics.
|
||||
* Developers are warned to stay away from these types when using this
|
||||
* or any other stdint.h.
|
||||
*/
|
||||
|
||||
typedef int_least8_t int_fast8_t;
|
||||
typedef uint_least8_t uint_fast8_t;
|
||||
typedef int_least16_t int_fast16_t;
|
||||
typedef uint_least16_t uint_fast16_t;
|
||||
typedef int_least32_t int_fast32_t;
|
||||
typedef uint_least32_t uint_fast32_t;
|
||||
#define UINT_FAST8_MAX UINT_LEAST8_MAX
|
||||
#define INT_FAST8_MAX INT_LEAST8_MAX
|
||||
#define UINT_FAST16_MAX UINT_LEAST16_MAX
|
||||
#define INT_FAST16_MAX INT_LEAST16_MAX
|
||||
#define UINT_FAST32_MAX UINT_LEAST32_MAX
|
||||
#define INT_FAST32_MAX INT_LEAST32_MAX
|
||||
#define INT_FAST8_MIN INT_LEAST8_MIN
|
||||
#define INT_FAST16_MIN INT_LEAST16_MIN
|
||||
#define INT_FAST32_MIN INT_LEAST32_MIN
|
||||
#ifdef stdint_int64_defined
|
||||
typedef int_least64_t int_fast64_t;
|
||||
typedef uint_least64_t uint_fast64_t;
|
||||
# define UINT_FAST64_MAX UINT_LEAST64_MAX
|
||||
# define INT_FAST64_MAX INT_LEAST64_MAX
|
||||
# define INT_FAST64_MIN INT_LEAST64_MIN
|
||||
#endif
|
||||
|
||||
#undef stdint_int64_defined
|
||||
|
||||
/*
|
||||
* Whatever piecemeal, per compiler thing we can do about the wchar_t
|
||||
* type limits.
|
||||
*/
|
||||
|
||||
#if defined(__WATCOMC__) || defined(_MSC_VER) || defined (__GNUC__) && !defined(vxWorks)
|
||||
# include <wchar.h>
|
||||
# ifndef WCHAR_MIN
|
||||
# define WCHAR_MIN 0
|
||||
# endif
|
||||
# ifndef WCHAR_MAX
|
||||
# define WCHAR_MAX ((wchar_t)-1)
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Whatever piecemeal, per compiler/platform thing we can do about the
|
||||
* (u)intptr_t types and limits.
|
||||
*/
|
||||
|
||||
#if (defined (_MSC_VER) && defined (_UINTPTR_T_DEFINED)) || defined (_UINTPTR_T)
|
||||
# define STDINT_H_UINTPTR_T_DEFINED
|
||||
#endif
|
||||
|
||||
#ifndef STDINT_H_UINTPTR_T_DEFINED
|
||||
# if defined (__alpha__) || defined (__ia64__) || defined (__x86_64__) || defined (_WIN64) || defined (__ppc64__)
|
||||
# define stdint_intptr_bits 64
|
||||
# elif defined (__WATCOMC__) || defined (__TURBOC__)
|
||||
# if defined(__TINY__) || defined(__SMALL__) || defined(__MEDIUM__)
|
||||
# define stdint_intptr_bits 16
|
||||
# else
|
||||
# define stdint_intptr_bits 32
|
||||
# endif
|
||||
# elif defined (__i386__) || defined (_WIN32) || defined (WIN32) || defined (__ppc64__)
|
||||
# define stdint_intptr_bits 32
|
||||
# elif defined (__INTEL_COMPILER)
|
||||
/* TODO -- what did Intel do about x86-64? */
|
||||
# else
|
||||
/* #error "This platform might not be supported yet" */
|
||||
# endif
|
||||
|
||||
# ifdef stdint_intptr_bits
|
||||
# define stdint_intptr_glue3_i(a,b,c) a##b##c
|
||||
# define stdint_intptr_glue3(a,b,c) stdint_intptr_glue3_i(a,b,c)
|
||||
# ifndef PRINTF_INTPTR_MODIFIER
|
||||
# define PRINTF_INTPTR_MODIFIER stdint_intptr_glue3(PRINTF_INT,stdint_intptr_bits,_MODIFIER)
|
||||
# endif
|
||||
# ifndef PTRDIFF_MAX
|
||||
# define PTRDIFF_MAX stdint_intptr_glue3(INT,stdint_intptr_bits,_MAX)
|
||||
# endif
|
||||
# ifndef PTRDIFF_MIN
|
||||
# define PTRDIFF_MIN stdint_intptr_glue3(INT,stdint_intptr_bits,_MIN)
|
||||
# endif
|
||||
# ifndef UINTPTR_MAX
|
||||
# define UINTPTR_MAX stdint_intptr_glue3(UINT,stdint_intptr_bits,_MAX)
|
||||
# endif
|
||||
# ifndef INTPTR_MAX
|
||||
# define INTPTR_MAX stdint_intptr_glue3(INT,stdint_intptr_bits,_MAX)
|
||||
# endif
|
||||
# ifndef INTPTR_MIN
|
||||
# define INTPTR_MIN stdint_intptr_glue3(INT,stdint_intptr_bits,_MIN)
|
||||
# endif
|
||||
# ifndef INTPTR_C
|
||||
# define INTPTR_C(x) stdint_intptr_glue3(INT,stdint_intptr_bits,_C)(x)
|
||||
# endif
|
||||
# ifndef UINTPTR_C
|
||||
# define UINTPTR_C(x) stdint_intptr_glue3(UINT,stdint_intptr_bits,_C)(x)
|
||||
# endif
|
||||
typedef stdint_intptr_glue3(uint,stdint_intptr_bits,_t) uintptr_t;
|
||||
typedef stdint_intptr_glue3( int,stdint_intptr_bits,_t) intptr_t;
|
||||
# else
|
||||
/* TODO -- This following is likely wrong for some platforms, and does
|
||||
nothing for the definition of uintptr_t. */
|
||||
typedef ptrdiff_t intptr_t;
|
||||
# endif
|
||||
# define STDINT_H_UINTPTR_T_DEFINED
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Assumes sig_atomic_t is signed and we have a 2s complement machine.
|
||||
*/
|
||||
|
||||
#ifndef SIG_ATOMIC_MAX
|
||||
# define SIG_ATOMIC_MAX ((((sig_atomic_t) 1) << (sizeof (sig_atomic_t)*CHAR_BIT-1)) - 1)
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#if defined (__TEST_PSTDINT_FOR_CORRECTNESS)
|
||||
|
||||
/*
|
||||
* Please compile with the maximum warning settings to make sure macros are
|
||||
* not defined more than once.
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#define glue3_aux(x,y,z) x ## y ## z
|
||||
#define glue3(x,y,z) glue3_aux(x,y,z)
|
||||
|
||||
#define DECLU(bits) glue3(uint,bits,_t) glue3(u,bits,) = glue3(UINT,bits,_C) (0);
|
||||
#define DECLI(bits) glue3(int,bits,_t) glue3(i,bits,) = glue3(INT,bits,_C) (0);
|
||||
|
||||
#define DECL(us,bits) glue3(DECL,us,) (bits)
|
||||
|
||||
#define TESTUMAX(bits) glue3(u,bits,) = ~glue3(u,bits,); if (glue3(UINT,bits,_MAX) != glue3(u,bits,)) printf ("Something wrong with UINT%d_MAX\n", bits)
|
||||
|
||||
#define REPORTERROR(msg) { err_n++; if (err_first <= 0) err_first = __LINE__; printf msg; }
|
||||
|
||||
#define X_SIZE_MAX ((size_t)-1)
|
||||
|
||||
int main () {
|
||||
int err_n = 0;
|
||||
int err_first = 0;
|
||||
DECL(I,8)
|
||||
DECL(U,8)
|
||||
DECL(I,16)
|
||||
DECL(U,16)
|
||||
DECL(I,32)
|
||||
DECL(U,32)
|
||||
#ifdef INT64_MAX
|
||||
DECL(I,64)
|
||||
DECL(U,64)
|
||||
#endif
|
||||
intmax_t imax = INTMAX_C(0);
|
||||
uintmax_t umax = UINTMAX_C(0);
|
||||
char str0[256], str1[256];
|
||||
|
||||
sprintf (str0, "%" PRINTF_INT32_MODIFIER "d", INT32_C(2147483647));
|
||||
if (0 != strcmp (str0, "2147483647")) REPORTERROR (("Something wrong with PRINTF_INT32_MODIFIER : %s\n", str0));
|
||||
if (atoi(PRINTF_INT32_DEC_WIDTH) != (int) strlen(str0)) REPORTERROR (("Something wrong with PRINTF_INT32_DEC_WIDTH : %s\n", PRINTF_INT32_DEC_WIDTH));
|
||||
sprintf (str0, "%" PRINTF_INT32_MODIFIER "u", UINT32_C(4294967295));
|
||||
if (0 != strcmp (str0, "4294967295")) REPORTERROR (("Something wrong with PRINTF_INT32_MODIFIER : %s\n", str0));
|
||||
if (atoi(PRINTF_UINT32_DEC_WIDTH) != (int) strlen(str0)) REPORTERROR (("Something wrong with PRINTF_UINT32_DEC_WIDTH : %s\n", PRINTF_UINT32_DEC_WIDTH));
|
||||
#ifdef INT64_MAX
|
||||
sprintf (str1, "%" PRINTF_INT64_MODIFIER "d", INT64_C(9223372036854775807));
|
||||
if (0 != strcmp (str1, "9223372036854775807")) REPORTERROR (("Something wrong with PRINTF_INT32_MODIFIER : %s\n", str1));
|
||||
if (atoi(PRINTF_INT64_DEC_WIDTH) != (int) strlen(str1)) REPORTERROR (("Something wrong with PRINTF_INT64_DEC_WIDTH : %s, %d\n", PRINTF_INT64_DEC_WIDTH, (int) strlen(str1)));
|
||||
sprintf (str1, "%" PRINTF_INT64_MODIFIER "u", UINT64_C(18446744073709550591));
|
||||
if (0 != strcmp (str1, "18446744073709550591")) REPORTERROR (("Something wrong with PRINTF_INT32_MODIFIER : %s\n", str1));
|
||||
if (atoi(PRINTF_UINT64_DEC_WIDTH) != (int) strlen(str1)) REPORTERROR (("Something wrong with PRINTF_UINT64_DEC_WIDTH : %s, %d\n", PRINTF_UINT64_DEC_WIDTH, (int) strlen(str1)));
|
||||
#endif
|
||||
|
||||
sprintf (str0, "%d %x\n", 0, ~0);
|
||||
|
||||
sprintf (str1, "%d %x\n", i8, ~0);
|
||||
if (0 != strcmp (str0, str1)) REPORTERROR (("Something wrong with i8 : %s\n", str1));
|
||||
sprintf (str1, "%u %x\n", u8, ~0);
|
||||
if (0 != strcmp (str0, str1)) REPORTERROR (("Something wrong with u8 : %s\n", str1));
|
||||
sprintf (str1, "%d %x\n", i16, ~0);
|
||||
if (0 != strcmp (str0, str1)) REPORTERROR (("Something wrong with i16 : %s\n", str1));
|
||||
sprintf (str1, "%u %x\n", u16, ~0);
|
||||
if (0 != strcmp (str0, str1)) REPORTERROR (("Something wrong with u16 : %s\n", str1));
|
||||
sprintf (str1, "%" PRINTF_INT32_MODIFIER "d %x\n", i32, ~0);
|
||||
if (0 != strcmp (str0, str1)) REPORTERROR (("Something wrong with i32 : %s\n", str1));
|
||||
sprintf (str1, "%" PRINTF_INT32_MODIFIER "u %x\n", u32, ~0);
|
||||
if (0 != strcmp (str0, str1)) REPORTERROR (("Something wrong with u32 : %s\n", str1));
|
||||
#ifdef INT64_MAX
|
||||
sprintf (str1, "%" PRINTF_INT64_MODIFIER "d %x\n", i64, ~0);
|
||||
if (0 != strcmp (str0, str1)) REPORTERROR (("Something wrong with i64 : %s\n", str1));
|
||||
#endif
|
||||
sprintf (str1, "%" PRINTF_INTMAX_MODIFIER "d %x\n", imax, ~0);
|
||||
if (0 != strcmp (str0, str1)) REPORTERROR (("Something wrong with imax : %s\n", str1));
|
||||
sprintf (str1, "%" PRINTF_INTMAX_MODIFIER "u %x\n", umax, ~0);
|
||||
if (0 != strcmp (str0, str1)) REPORTERROR (("Something wrong with umax : %s\n", str1));
|
||||
|
||||
TESTUMAX(8);
|
||||
TESTUMAX(16);
|
||||
TESTUMAX(32);
|
||||
#ifdef INT64_MAX
|
||||
TESTUMAX(64);
|
||||
#endif
|
||||
|
||||
#define STR(v) #v
|
||||
#define Q(v) printf ("sizeof " STR(v) " = %u\n", (unsigned) sizeof (v));
|
||||
if (err_n) {
|
||||
printf ("pstdint.h is not correct. Please use sizes below to correct it:\n");
|
||||
}
|
||||
|
||||
Q(int)
|
||||
Q(unsigned)
|
||||
Q(long int)
|
||||
Q(short int)
|
||||
Q(int8_t)
|
||||
Q(int16_t)
|
||||
Q(int32_t)
|
||||
#ifdef INT64_MAX
|
||||
Q(int64_t)
|
||||
#endif
|
||||
|
||||
#if UINT_MAX < X_SIZE_MAX
|
||||
printf ("UINT_MAX < X_SIZE_MAX\n");
|
||||
#else
|
||||
printf ("UINT_MAX >= X_SIZE_MAX\n");
|
||||
#endif
|
||||
printf ("%" PRINTF_INT64_MODIFIER "u vs %" PRINTF_INT64_MODIFIER "u\n", UINT_MAX, X_SIZE_MAX);
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
#endif
|
||||
+1
-1
@@ -53,7 +53,7 @@ strtol(
|
||||
*/
|
||||
|
||||
p = string;
|
||||
while (TclIsSpaceProc(*p)) {
|
||||
while (isspace(UCHAR(*p))) {
|
||||
p += 1;
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -74,7 +74,7 @@ strtoul(
|
||||
*/
|
||||
|
||||
p = string;
|
||||
while (TclIsSpaceProc(*p)) {
|
||||
while (isspace(UCHAR(*p))) {
|
||||
p += 1;
|
||||
}
|
||||
if (*p == '-') {
|
||||
|
||||
@@ -43,6 +43,7 @@ static int decrypt_byte(unsigned long* pkeys, const z_crc_t* pcrc_32_tab)
|
||||
unsigned temp; /* POTENTIAL BUG: temp*(temp^1) may overflow in an
|
||||
* unpredictable manner on 16-bit systems; not a problem
|
||||
* with any known compiler so far, though */
|
||||
(void)pcrc_32_tab;
|
||||
|
||||
temp = ((unsigned)(*(pkeys+2)) & 0xffff) | 2;
|
||||
return (int)(((temp * (temp ^ 1)) >> 8) & 0xff);
|
||||
|
||||
@@ -14,7 +14,11 @@
|
||||
#define _CRT_SECURE_NO_WARNINGS
|
||||
#endif
|
||||
|
||||
#if defined(__APPLE__) || defined(IOAPI_NO_64)
|
||||
#if defined(_WIN32)
|
||||
#define FOPEN_FUNC(filename, mode) fopen(filename, mode)
|
||||
#define FTELLO_FUNC(stream) _ftelli64(stream)
|
||||
#define FSEEKO_FUNC(stream, offset, origin) _fseeki64(stream, offset, origin)
|
||||
#elif defined(__APPLE__) || defined(IOAPI_NO_64)
|
||||
// In darwin and perhaps other BSD variants off_t is a 64 bit value, hence no need for specific 64 bit functions
|
||||
#define FOPEN_FUNC(filename, mode) fopen(filename, mode)
|
||||
#define FTELLO_FUNC(stream) ftello(stream)
|
||||
|
||||
@@ -27,7 +27,11 @@
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(__APPLE__) || defined(IOAPI_NO_64)
|
||||
#if defined(_WIN32)
|
||||
#define FOPEN_FUNC(filename, mode) fopen(filename, mode)
|
||||
#define FTELLO_FUNC(stream) _ftelli64(stream)
|
||||
#define FSEEKO_FUNC(stream, offset, origin) _fseeki64(stream, offset, origin)
|
||||
#elif defined(__APPLE__) || defined(IOAPI_NO_64)
|
||||
// In darwin and perhaps other BSD variants off_t is a 64 bit value, hence no need for specific 64 bit functions
|
||||
#define FOPEN_FUNC(filename, mode) fopen(filename, mode)
|
||||
#define FTELLO_FUNC(stream) ftello(stream)
|
||||
|
||||
@@ -247,6 +247,9 @@ record instead of a value. Otherwise, it is similar to
|
||||
.PP
|
||||
\fBTcl_SetErrorCodeVA\fR is the same as \fBTcl_SetErrorCode\fR except that
|
||||
instead of taking a variable number of arguments it takes an argument list.
|
||||
Interfaces using argument lists have been found to be nonportable in practice.
|
||||
This function is deprecated and will be removed in Tcl 9.0.
|
||||
|
||||
.PP
|
||||
The procedure \fBTcl_GetErrorLine\fR is used to read the integer value
|
||||
of the \fB\-errorline\fR return option without the overhead of a full
|
||||
|
||||
+2
-2
@@ -648,8 +648,8 @@ It should call \fBTcl_BadChannelOption\fR which itself returns
|
||||
unrecognized.
|
||||
If \fInewValue\fR specifies a value for the option that
|
||||
is not supported or if a system call error occurs,
|
||||
the function should leave an error message in the
|
||||
\fIresult\fR field of \fIinterp\fR if \fIinterp\fR is not NULL. The
|
||||
the function should leave an error message in the result
|
||||
of \fIinterp\fR if \fIinterp\fR is not NULL. The
|
||||
function should also call \fBTcl_SetErrno\fR to store an appropriate POSIX
|
||||
error code.
|
||||
.PP
|
||||
|
||||
@@ -22,10 +22,8 @@ Tcl_Interp *
|
||||
int
|
||||
\fBTcl_InterpDeleted\fR(\fIinterp\fR)
|
||||
.sp
|
||||
.VS 8.6
|
||||
int
|
||||
\fBTcl_InterpActive\fR(\fIinterp\fR)
|
||||
.VE 8.6
|
||||
.SH ARGUMENTS
|
||||
.AS Tcl_Interp *interp
|
||||
.AP Tcl_Interp *interp in
|
||||
@@ -70,14 +68,12 @@ deleted and when the whole interpreter is being deleted. In the former case
|
||||
the callback may recreate the data being deleted, but this would lead to an
|
||||
infinite loop if the interpreter were being deleted.
|
||||
.PP
|
||||
.VS 8.6
|
||||
\fBTcl_InterpActive\fR is useful for determining whether there is any
|
||||
execution of scripts ongoing in an interpreter, which is a useful piece of
|
||||
information when Tcl is embedded in a garbage-collected environment and it
|
||||
becomes necessary to determine whether the interpreter is a candidate for
|
||||
deletion. The function returns a true value if the interpreter has at least
|
||||
one active execution running inside it, and a false value otherwise.
|
||||
.VE 8.6
|
||||
.SH "INTERPRETERS AND MEMORY MANAGEMENT"
|
||||
.PP
|
||||
\fBTcl_DeleteInterp\fR can be called at any time on an interpreter that may
|
||||
@@ -138,12 +134,10 @@ All uses of interpreters in Tcl and Tk have already been protected.
|
||||
Extension writers should ensure that their code also properly protects any
|
||||
additional interpreters used, as described above.
|
||||
.PP
|
||||
.VS 8.6
|
||||
Note that the protection mechanisms do not work well with conventional garbage
|
||||
collection systems. When in such a managed environment, \fBTcl_InterpActive\fR
|
||||
should be used to determine when an interpreter is a candidate for deletion
|
||||
due to inactivity.
|
||||
.VE 8.6
|
||||
.SH "SEE ALSO"
|
||||
Tcl_Preserve(3), Tcl_Release(3)
|
||||
.SH KEYWORDS
|
||||
|
||||
+17
-17
@@ -119,7 +119,7 @@ in a hierarchical relationship, and the management of aliases, commands
|
||||
that when invoked in one interpreter execute a command in another
|
||||
interpreter. The return value for those procedures that return an \fBint\fR
|
||||
is either \fBTCL_OK\fR or \fBTCL_ERROR\fR. If \fBTCL_ERROR\fR is returned
|
||||
then the \fBresult\fR field of the interpreter contains an error message.
|
||||
then the interpreter's result contains an error message.
|
||||
.PP
|
||||
\fBTcl_CreateSlave\fR creates a new interpreter as a slave of \fIinterp\fR.
|
||||
It also creates a slave command named \fIslaveName\fR in \fIinterp\fR which
|
||||
@@ -158,12 +158,12 @@ If no such slave interpreter exists, \fBNULL\fR is returned.
|
||||
\fIinterp\fR. If \fIinterp\fR has no master (it is a
|
||||
top-level interpreter) then \fBNULL\fR is returned.
|
||||
.PP
|
||||
\fBTcl_GetInterpPath\fR sets the \fIresult\fR field in \fIaskingInterp\fR
|
||||
to the relative path between \fIaskingInterp\fR and \fIslaveInterp\fR;
|
||||
\fBTcl_GetInterpPath\fR stores in the result of \fIaskingInterp\fR
|
||||
the relative path between \fIaskingInterp\fR and \fIslaveInterp\fR;
|
||||
\fIslaveInterp\fR must be a slave of \fIaskingInterp\fR. If the computation
|
||||
of the relative path succeeds, \fBTCL_OK\fR is returned, else
|
||||
\fBTCL_ERROR\fR is returned and the \fIresult\fR field in
|
||||
\fIaskingInterp\fR contains the error message.
|
||||
\fBTCL_ERROR\fR is returned and an error message is stored as the
|
||||
result of \fIaskingInterp\fR.
|
||||
.PP
|
||||
\fBTcl_CreateAlias\fR creates a command named \fIslaveCmd\fR in
|
||||
\fIslaveInterp\fR that when invoked, will cause the command \fItargetCmd\fR
|
||||
@@ -198,33 +198,33 @@ the set of hidden commands to the set of exposed commands, putting
|
||||
it under the name
|
||||
\fIcmdName\fR.
|
||||
\fIHiddenCmdName\fR must be the name of an existing hidden
|
||||
command, or the operation will return \fBTCL_ERROR\fR and leave an error
|
||||
message in the \fIresult\fR field in \fIinterp\fR.
|
||||
command, or the operation will return \fBTCL_ERROR\fR and
|
||||
leave an error message as the result of \fIinterp\fR.
|
||||
If an exposed command named \fIcmdName\fR already exists,
|
||||
the operation returns \fBTCL_ERROR\fR and leaves an error message in the
|
||||
value result of \fIinterp\fR.
|
||||
the operation returns \fBTCL_ERROR\fR and leaves an error message as
|
||||
the result of \fIinterp\fR.
|
||||
If the operation succeeds, it returns \fBTCL_OK\fR.
|
||||
After executing this command, attempts to use \fIcmdName\fR in a call to
|
||||
\fBTcl_Eval\fR or with the Tcl \fBeval\fR command will again succeed.
|
||||
After executing this command, attempts to use \fIcmdName\fR in any
|
||||
script evaluation mechanism will again succeed.
|
||||
.PP
|
||||
\fBTcl_HideCommand\fR moves the command named \fIcmdName\fR from the set of
|
||||
exposed commands to the set of hidden commands, under the name
|
||||
\fIhiddenCmdName\fR.
|
||||
\fICmdName\fR must be the name of an existing exposed
|
||||
command, or the operation will return \fBTCL_ERROR\fR and leave an error
|
||||
message in the value result of \fIinterp\fR.
|
||||
message as the result of \fIinterp\fR.
|
||||
Currently both \fIcmdName\fR and \fIhiddenCmdName\fR must not contain
|
||||
namespace qualifiers, or the operation will return \fBTCL_ERROR\fR and
|
||||
leave an error message in the value result of \fIinterp\fR.
|
||||
leave an error message as the result of \fIinterp\fR.
|
||||
The \fICmdName\fR will be looked up in the global namespace, and not
|
||||
relative to the current namespace, even if the current namespace is not the
|
||||
global one.
|
||||
If a hidden command whose name is \fIhiddenCmdName\fR already
|
||||
exists, the operation also returns \fBTCL_ERROR\fR and the \fIresult\fR
|
||||
field in \fIinterp\fR contains an error message.
|
||||
exists, the operation also returns \fBTCL_ERROR\fR and an error
|
||||
message is left as the result of \fIinterp\fR.
|
||||
If the operation succeeds, it returns \fBTCL_OK\fR.
|
||||
After executing this command, attempts to use \fIcmdName\fR in a call to
|
||||
\fBTcl_Eval\fR or with the Tcl \fBeval\fR command will fail.
|
||||
After executing this command, attempts to use \fIcmdName\fR in
|
||||
any script evaluation mechanism will fail.
|
||||
.PP
|
||||
For a description of the Tcl interface to multiple interpreters, see
|
||||
\fIinterp(n)\fR.
|
||||
|
||||
@@ -36,13 +36,11 @@ int
|
||||
int
|
||||
\fBTcl_SetEnsembleMappingDict\fR(\fIinterp, token, dictObj\fR)
|
||||
.sp
|
||||
.VS 8.6
|
||||
int
|
||||
\fBTcl_GetEnsembleParameterList\fR(\fIinterp, token, listObjPtr\fR)
|
||||
.sp
|
||||
int
|
||||
\fBTcl_SetEnsembleParameterList\fR(\fIinterp, token, listObj\fR)
|
||||
.VE 8.6
|
||||
.sp
|
||||
int
|
||||
\fBTcl_GetEnsembleSubcommandList\fR(\fIinterp, token, listObjPtr\fR)
|
||||
@@ -163,7 +161,6 @@ All command names in prefixes set via \fBTcl_SetEnsembleMappingDict\fR
|
||||
must be fully qualified.
|
||||
.TP
|
||||
\fBformal pre-subcommand parameter list\fR (read-write)
|
||||
.VS 8.6
|
||||
A list of formal parameter names (the names only being used when generating
|
||||
error messages) that come at invocation of the ensemble between the name of
|
||||
the ensemble and the subcommand argument. NULL (the default) is equivalent to
|
||||
@@ -174,7 +171,6 @@ respectively. The result of both of those functions is a Tcl result code
|
||||
ensemble) and the
|
||||
dictionary obtained from \fBTcl_GetEnsembleParameterList\fR should always be
|
||||
treated as immutable even if it is unshared.
|
||||
.VE 8.6
|
||||
.TP
|
||||
\fBsubcommand list\fR (read-write)
|
||||
.
|
||||
|
||||
+3
-2
@@ -150,13 +150,14 @@ equivalent to using the \fBTCL_EVAL_GLOBAL\fR flag (see below).
|
||||
of any length, concatenates them into a single string,
|
||||
then calls \fBTcl_Eval\fR to execute that string as a Tcl command.
|
||||
It returns the result of the command and also modifies
|
||||
\fIinterp->result\fR in the same way as \fBTcl_Eval\fR.
|
||||
the interpreter result in the same way as \fBTcl_Eval\fR.
|
||||
The last argument to \fBTcl_VarEval\fR must be NULL to indicate the end
|
||||
of arguments. \fBTcl_VarEval\fR is now deprecated.
|
||||
.PP
|
||||
\fBTcl_VarEvalVA\fR is the same as \fBTcl_VarEval\fR except that
|
||||
instead of taking a variable number of arguments it takes an argument
|
||||
list. Like \fBTcl_VarEval\fR, \fBTcl_VarEvalVA\fR is deprecated.
|
||||
list. Interfaces using argument lists have been found to be nonportable
|
||||
in practice. This function is deprecated and will be removed in Tcl 9.0.
|
||||
|
||||
.SH "FLAG BITS"
|
||||
.PP
|
||||
|
||||
@@ -63,10 +63,8 @@ int
|
||||
\fBTcl_FSLoadFile\fR(\fIinterp, pathPtr, sym1, sym2, proc1Ptr, proc2Ptr,
|
||||
loadHandlePtr, unloadProcPtr\fR)
|
||||
.sp
|
||||
.VS 8.6
|
||||
int
|
||||
\fBTcl_FSUnloadFile\fR(\fIinterp, loadHandle\fR)
|
||||
.VE 8.6
|
||||
.sp
|
||||
int
|
||||
\fBTcl_FSMatchInDirectory\fR(\fIinterp, resultPtr, pathPtr, pattern, types\fR)
|
||||
@@ -146,7 +144,6 @@ Tcl_Obj *
|
||||
Tcl_StatBuf *
|
||||
\fBTcl_AllocStatBuf\fR()
|
||||
.sp
|
||||
.VS 8.6
|
||||
Tcl_WideInt
|
||||
\fBTcl_GetAccessTimeFromStat\fR(\fIstatPtr\fR)
|
||||
.sp
|
||||
@@ -185,7 +182,6 @@ Tcl_WideUInt
|
||||
.sp
|
||||
int
|
||||
\fBTcl_GetUserIdFromStat\fR(\fIstatPtr\fR)
|
||||
.VE 8.6
|
||||
.SH ARGUMENTS
|
||||
.AS Tcl_GlobTypeData **srcPathPtr out
|
||||
.AP "const Tcl_Filesystem" *fsPtr in
|
||||
@@ -444,20 +440,16 @@ belongs will be called. If that filesystem does not implement this
|
||||
function (most virtual filesystems will not, because of OS limitations
|
||||
in dynamically loading binary code), Tcl will attempt to copy the file
|
||||
to a temporary directory and load that temporary file.
|
||||
.VS 8.6
|
||||
\fBTcl_FSUnloadFile\fR reverses the operation, asking for the library
|
||||
indicated by the \fIloadHandle\fR to be removed from the process. Note that,
|
||||
unlike with the \fBunload\fR command, this does not give the library any
|
||||
opportunity to clean up.
|
||||
.VE 8.6
|
||||
.PP
|
||||
Both the above functions return a standard Tcl completion code. If an error
|
||||
occurs, an error message is left in the \fIinterp\fR's result.
|
||||
.PP
|
||||
.VS 8.6
|
||||
The token provided via the variable indicated by \fIloadHandlePtr\fR may be
|
||||
used with \fBTcl_FindSymbol\fR.
|
||||
.VE 8.6
|
||||
.PP
|
||||
\fBTcl_FSMatchInDirectory\fR is used by the globbing code to search a
|
||||
directory for all files which match a given pattern. The appropriate
|
||||
@@ -795,7 +787,6 @@ may be deallocated by being passed to \fBckfree\fR). This allows extensions to
|
||||
invoke \fBTcl_FSStat\fR and \fBTcl_FSLstat\fR without being dependent on the
|
||||
size of the buffer. That in turn depends on the flags used to build Tcl.
|
||||
.PP
|
||||
.VS 8.6
|
||||
The portable fields of a \fITcl_StatBuf\fR may be read using the following
|
||||
functions, each of which returns the value of the corresponding field listed
|
||||
in the table below. Note that on some platforms there may be other fields in
|
||||
@@ -819,7 +810,6 @@ for a full description of these fields.
|
||||
\fBTcl_GetBlocksFromStat\fR st_blocks
|
||||
\fBTcl_GetBlockSizeFromStat\fR st_blksize
|
||||
.DE
|
||||
.VE 8.6
|
||||
.SH "THE VIRTUAL FILESYSTEM API"
|
||||
.PP
|
||||
A filesystem provides a \fBTcl_Filesystem\fR structure that contains
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
'\"
|
||||
'\" Copyright (c) 2018 Tcl Core Team
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
.so man.macros
|
||||
.TH Tcl_InitSubsystems 3 8.7 Tcl "Tcl Library Procedures"
|
||||
.BS
|
||||
.SH NAME
|
||||
Tcl_InitSubsystems \- initialize the Tcl library.
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
\fB#include <tcl.h>\fR
|
||||
.sp
|
||||
void
|
||||
\fBTcl_InitSubsystems\fR(\fIvoid\fR)
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
The \fBTcl_InitSubsystems\fR procedure initializes the Tcl
|
||||
library. This procedure is typically invoked as the very
|
||||
first thing in the application's main program.
|
||||
.PP
|
||||
\fBTcl_InitSubsystems\fR is very similar in use to
|
||||
\fBTcl_FindExecutable\fR. It can be used when Tcl is
|
||||
used as utility library, no other encodings than utf8,
|
||||
iso8859-1 or unicode are used, and no interest exists in the
|
||||
value of \fBinfo nameofexecutable\fR. The system encoding will not
|
||||
be extracted from the environment, but falls back to iso8859-1.
|
||||
.SH KEYWORDS
|
||||
binary, executable file
|
||||
+13
-106
@@ -5,7 +5,7 @@
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
.TH Tcl_Interp 3 7.5 Tcl "Tcl Library Procedures"
|
||||
.TH Tcl_Interp 3 8.7 Tcl "Tcl Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
.SH NAME
|
||||
@@ -15,9 +15,9 @@ Tcl_Interp \- client-visible fields of interpreter structures
|
||||
\fB#include <tcl.h>\fR
|
||||
.sp
|
||||
typedef struct {
|
||||
char *\fIresult\fR;
|
||||
Tcl_FreeProc *\fIfreeProc\fR;
|
||||
int \fIerrorLine\fR;
|
||||
char *\fIresult\fR; /* NO LONGER AVAILABLE */
|
||||
Tcl_FreeProc *\fIfreeProc\fR; /* NO LONGER AVAILABLE */
|
||||
int \fIerrorLine\fR; /* NO LONGER AVAILABLE */
|
||||
} \fBTcl_Interp\fR;
|
||||
|
||||
typedef void \fBTcl_FreeProc\fR(
|
||||
@@ -25,110 +25,17 @@ typedef void \fBTcl_FreeProc\fR(
|
||||
.BE
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
The \fBTcl_CreateInterp\fR procedure returns a pointer to a Tcl_Interp
|
||||
The \fBTcl_CreateInterp\fR procedure returns a pointer to a \fBTcl_Interp\fR
|
||||
structure. Callers of \fBTcl_CreateInterp\fR should use this pointer
|
||||
as an opaque token, suitable for nothing other than passing back to
|
||||
other routines in the Tcl interface. Accessing fields directly through
|
||||
the pointer as described below is no longer supported. The supported
|
||||
public routines \fBTcl_SetResult\fR, \fBTcl_GetResult\fR,
|
||||
\fBTcl_SetErrorLine\fR, \fBTcl_GetErrorLine\fR must be used instead.
|
||||
other routines in the Tcl interface from the same thread that called
|
||||
\fBTcl_CreateInterp\fR. The \fBTcl_Interp\fR struct no longer has any
|
||||
supported client-visible fields. Supported public routines such as
|
||||
\fBTcl_SetResult\fR, \fBTcl_GetResult\fR, \fBTcl_SetErrorLine\fR,
|
||||
\fBTcl_GetErrorLine\fR must be used instead.
|
||||
.PP
|
||||
For legacy programs and extensions no longer being maintained, compiles
|
||||
against the Tcl 8.6 header files are only possible with the compiler
|
||||
directives
|
||||
.CS
|
||||
#define USE_INTERP_RESULT
|
||||
.CE
|
||||
and/or
|
||||
.CS
|
||||
#define USE_INTERP_ERRORLINE
|
||||
.CE
|
||||
depending on which fields of the \fBTcl_Interp\fR struct are accessed.
|
||||
These directives may be embedded in code or supplied via compiler options.
|
||||
.PP
|
||||
The \fIresult\fR and \fIfreeProc\fR fields are used to return
|
||||
results or error messages from commands.
|
||||
This information is returned by command procedures back to \fBTcl_Eval\fR,
|
||||
and by \fBTcl_Eval\fR back to its callers.
|
||||
The \fIresult\fR field points to the string that represents the
|
||||
result or error message, and the \fIfreeProc\fR field tells how
|
||||
to dispose of the storage for the string when it is not needed anymore.
|
||||
The easiest way for command procedures to manipulate these
|
||||
fields is to call procedures like \fBTcl_SetResult\fR
|
||||
or \fBTcl_AppendResult\fR; they
|
||||
will hide all the details of managing the fields.
|
||||
The description below is for those procedures that manipulate the
|
||||
fields directly.
|
||||
.PP
|
||||
Whenever a command procedure returns, it must ensure
|
||||
that the \fIresult\fR field of its interpreter points to the string
|
||||
being returned by the command.
|
||||
The \fIresult\fR field must always point to a valid string.
|
||||
If a command wishes to return no result then \fIinterp->result\fR
|
||||
should point to an empty string.
|
||||
Normally, results are assumed to be statically allocated,
|
||||
which means that the contents will not change before the next time
|
||||
\fBTcl_Eval\fR is called or some other command procedure is invoked.
|
||||
In this case, the \fIfreeProc\fR field must be zero.
|
||||
Alternatively, a command procedure may dynamically
|
||||
allocate its return value (e.g. using \fBTcl_Alloc\fR)
|
||||
and store a pointer to it in \fIinterp->result\fR.
|
||||
In this case, the command procedure must also set \fIinterp->freeProc\fR
|
||||
to the address of a procedure that can free the value, or \fBTCL_DYNAMIC\fR
|
||||
if the storage was allocated directly by Tcl or by a call to
|
||||
\fBTcl_Alloc\fR.
|
||||
If \fIinterp->freeProc\fR is non-zero, then Tcl will call \fIfreeProc\fR
|
||||
to free the space pointed to by \fIinterp->result\fR before it
|
||||
invokes the next command.
|
||||
If a client procedure overwrites \fIinterp->result\fR when
|
||||
\fIinterp->freeProc\fR is non-zero, then it is responsible for calling
|
||||
\fIfreeProc\fR to free the old \fIinterp->result\fR (the \fBTcl_FreeResult\fR
|
||||
macro should be used for this purpose).
|
||||
.PP
|
||||
\fIFreeProc\fR should have arguments and result that match the
|
||||
\fBTcl_FreeProc\fR declaration above: it receives a single
|
||||
argument which is a pointer to the result value to free.
|
||||
In most applications \fBTCL_DYNAMIC\fR is the only non-zero value ever
|
||||
used for \fIfreeProc\fR.
|
||||
However, an application may store a different procedure address
|
||||
in \fIfreeProc\fR in order to use an alternate memory allocator
|
||||
or in order to do other cleanup when the result memory is freed.
|
||||
.PP
|
||||
As part of processing each command, \fBTcl_Eval\fR initializes
|
||||
\fIinterp->result\fR
|
||||
and \fIinterp->freeProc\fR just before calling the command procedure for
|
||||
the command. The \fIfreeProc\fR field will be initialized to zero,
|
||||
and \fIinterp->result\fR will point to an empty string. Commands that
|
||||
do not return any value can simply leave the fields alone.
|
||||
Furthermore, the empty string pointed to by \fIresult\fR is actually
|
||||
part of an array of approximately 200 characters.
|
||||
If a command wishes to return a short string, it can simply copy
|
||||
it to the area pointed to by \fIinterp->result\fR. Or, it can use
|
||||
the sprintf procedure to generate a short result string at the location
|
||||
pointed to by \fIinterp->result\fR.
|
||||
.PP
|
||||
It is a general convention in Tcl-based applications that the result
|
||||
of an interpreter is normally in the initialized state described
|
||||
in the previous paragraph.
|
||||
Procedures that manipulate an interpreter's result (e.g. by
|
||||
returning an error) will generally assume that the result
|
||||
has been initialized when the procedure is called.
|
||||
If such a procedure is to be called after the result has been
|
||||
changed, then \fBTcl_ResetResult\fR should be called first to
|
||||
reset the result to its initialized state. The direct use of
|
||||
\fIinterp->result\fR is strongly deprecated (see \fBTcl_SetResult\fR).
|
||||
.PP
|
||||
The \fIerrorLine\fR
|
||||
field is valid only after \fBTcl_Eval\fR returns
|
||||
a \fBTCL_ERROR\fR return code. In this situation the \fIerrorLine\fR
|
||||
field identifies the line number of the command being executed when
|
||||
the error occurred. The line numbers are relative to the command
|
||||
being executed: 1 means the first line of the command passed to
|
||||
\fBTcl_Eval\fR, 2 means the second line, and so on.
|
||||
The \fIerrorLine\fR field is typically used in conjunction with
|
||||
\fBTcl_AddErrorInfo\fR to report information about where an error
|
||||
occurred.
|
||||
\fIErrorLine\fR should not normally be modified except by \fBTcl_Eval\fR.
|
||||
Any legacy programs and extensions trying to access the fields above
|
||||
in their source code will need conversion to compile for Tcl 8.7 and later.
|
||||
|
||||
.SH KEYWORDS
|
||||
free, initialized, interpreter, malloc, result
|
||||
interpreter, result
|
||||
|
||||
+12
-12
@@ -96,7 +96,7 @@ Any value written into the Tcl variable must have a proper integer
|
||||
form acceptable to \fBTcl_GetIntFromObj\fR; attempts to write
|
||||
non-integer values into \fIvarName\fR will be rejected with
|
||||
Tcl errors. Incomplete integer representations (like the empty
|
||||
string, '+', '-' or the hex/octal/binary prefix) are accepted
|
||||
string, '+', '-' or the hex/octal/decimal/binary prefix) are accepted
|
||||
as if they are valid too.
|
||||
.TP
|
||||
\fBTCL_LINK_UINT\fR
|
||||
@@ -107,7 +107,7 @@ integer form acceptable to \fBTcl_GetWideIntFromObj\fR and in the
|
||||
platform's defined range for the \fBunsigned int\fR type; attempts to
|
||||
write non-integer values (or values outside the range) into
|
||||
\fIvarName\fR will be rejected with Tcl errors. Incomplete integer
|
||||
representations (like the empty string, '+', '-' or the hex/octal/binary
|
||||
representations (like the empty string, '+', '-' or the hex/octal/decimal/binary
|
||||
prefix) are accepted as if they are valid too.
|
||||
.TP
|
||||
\fBTCL_LINK_CHAR\fR
|
||||
@@ -118,7 +118,7 @@ form acceptable to \fBTcl_GetIntFromObj\fR and be in the range of the
|
||||
\fBchar\fR datatype; attempts to write non-integer or out-of-range
|
||||
values into \fIvarName\fR will be rejected with Tcl errors. Incomplete
|
||||
integer representations (like the empty string, '+', '-' or the
|
||||
hex/octal/binary prefix) are accepted as if they are valid too.
|
||||
hex/octal/decimal/binary prefix) are accepted as if they are valid too.
|
||||
.RS
|
||||
.PP
|
||||
.VS "TIP 312"
|
||||
@@ -141,7 +141,7 @@ integer form acceptable to \fBTcl_GetIntFromObj\fR and in the
|
||||
platform's defined range for the \fBunsigned char\fR type; attempts to
|
||||
write non-integer values (or values outside the range) into
|
||||
\fIvarName\fR will be rejected with Tcl errors. Incomplete integer
|
||||
representations (like the empty string, '+', '-' or the hex/octal/binary
|
||||
representations (like the empty string, '+', '-' or the hex/octal/decimal/binary
|
||||
prefix) are accepted as if they are valid too.
|
||||
.RS
|
||||
.PP
|
||||
@@ -166,7 +166,7 @@ form acceptable to \fBTcl_GetIntFromObj\fR and be in the range of the
|
||||
\fBshort\fR datatype; attempts to write non-integer or out-of-range
|
||||
values into \fIvarName\fR will be rejected with Tcl errors. Incomplete
|
||||
integer representations (like the empty string, '+', '-' or the
|
||||
hex/octal/binary prefix) are accepted as if they are valid too.
|
||||
hex/octal/decimal/binary prefix) are accepted as if they are valid too.
|
||||
.TP
|
||||
\fBTCL_LINK_USHORT\fR
|
||||
.
|
||||
@@ -176,7 +176,7 @@ integer form acceptable to \fBTcl_GetIntFromObj\fR and in the
|
||||
platform's defined range for the \fBunsigned short\fR type; attempts to
|
||||
write non-integer values (or values outside the range) into
|
||||
\fIvarName\fR will be rejected with Tcl errors. Incomplete integer
|
||||
representations (like the empty string, '+', '-' or the hex/octal/binary
|
||||
representations (like the empty string, '+', '-' or the hex/octal/decimal/binary
|
||||
prefix) are accepted as if they are valid too.
|
||||
.TP
|
||||
\fBTCL_LINK_LONG\fR
|
||||
@@ -187,7 +187,7 @@ form acceptable to \fBTcl_GetLongFromObj\fR; attempts to write
|
||||
non-integer or out-of-range
|
||||
values into \fIvarName\fR will be rejected with Tcl errors. Incomplete
|
||||
integer representations (like the empty string, '+', '-' or the
|
||||
hex/octal/binary prefix) are accepted as if they are valid too.
|
||||
hex/octal/decimal/binary prefix) are accepted as if they are valid too.
|
||||
.TP
|
||||
\fBTCL_LINK_ULONG\fR
|
||||
.
|
||||
@@ -197,7 +197,7 @@ integer form acceptable to \fBTcl_GetWideIntFromObj\fR and in the
|
||||
platform's defined range for the \fBunsigned long\fR type; attempts to
|
||||
write non-integer values (or values outside the range) into
|
||||
\fIvarName\fR will be rejected with Tcl errors. Incomplete integer
|
||||
representations (like the empty string, '+', '-' or the hex/octal/binary
|
||||
representations (like the empty string, '+', '-' or the hex/octal/decimal/binary
|
||||
prefix) are accepted as if they are valid too.
|
||||
.TP
|
||||
\fBTCL_LINK_DOUBLE\fR
|
||||
@@ -207,7 +207,7 @@ Any value written into the Tcl variable must have a proper real
|
||||
form acceptable to \fBTcl_GetDoubleFromObj\fR; attempts to write
|
||||
non-real values into \fIvarName\fR will be rejected with
|
||||
Tcl errors. Incomplete integer or real representations (like the
|
||||
empty string, '.', '+', '-' or the hex/octal/binary prefix) are
|
||||
empty string, '.', '+', '-' or the hex/octal/decimal/binary prefix) are
|
||||
accepted as if they are valid too.
|
||||
.TP
|
||||
\fBTCL_LINK_FLOAT\fR
|
||||
@@ -219,7 +219,7 @@ range acceptable for a \fBfloat\fR; attempts to
|
||||
write non-real values (or values outside the range) into
|
||||
\fIvarName\fR will be rejected with Tcl errors. Incomplete integer
|
||||
or real representations (like the empty string, '.', '+', '-' or
|
||||
the hex/octal/binary prefix) are accepted as if they are valid too.
|
||||
the hex/octal/decimal/binary prefix) are accepted as if they are valid too.
|
||||
.TP
|
||||
\fBTCL_LINK_WIDE_INT\fR
|
||||
.
|
||||
@@ -230,7 +230,7 @@ Any value written into the Tcl variable must have a proper integer
|
||||
form acceptable to \fBTcl_GetWideIntFromObj\fR; attempts to write
|
||||
non-integer values into \fIvarName\fR will be rejected with
|
||||
Tcl errors. Incomplete integer representations (like the empty
|
||||
string, '+', '-' or the hex/octal/binary prefix) are accepted
|
||||
string, '+', '-' or the hex/octal/decimal/binary prefix) are accepted
|
||||
as if they are valid too.
|
||||
.TP
|
||||
\fBTCL_LINK_WIDE_UINT\fR
|
||||
@@ -244,7 +244,7 @@ cast to unsigned);
|
||||
.\" FIXME! Use bignums instead.
|
||||
attempts to write non-integer values into \fIvarName\fR will be
|
||||
rejected with Tcl errors. Incomplete integer representations (like
|
||||
the empty string, '+', '-' or the hex/octal/binary prefix) are accepted
|
||||
the empty string, '+', '-' or the hex/octal/decimal/binary prefix) are accepted
|
||||
as if they are valid too.
|
||||
.TP
|
||||
\fBTCL_LINK_BOOLEAN\fR
|
||||
|
||||
@@ -85,14 +85,12 @@ unless \fIinterp\fR is NULL.
|
||||
Otherwise, it returns \fBTCL_OK\fR.
|
||||
Passing a NULL \fIinterp\fR allows this procedure to be used
|
||||
as a test whether the conversion can be done (and in fact was done).
|
||||
.VS 8.5
|
||||
.PP
|
||||
In many cases, the \fItypePtr->setFromAnyProc\fR routine will
|
||||
set \fIobjPtr->typePtr\fR to the argument value \fItypePtr\fR,
|
||||
but that is no longer guaranteed. The \fIsetFromAnyProc\fR is
|
||||
free to set the internal representation for \fIobjPtr\fR to make
|
||||
use of another related Tcl_ObjType, if it sees fit.
|
||||
.VE 8.5
|
||||
.SH "THE TCL_OBJTYPE STRUCTURE"
|
||||
.PP
|
||||
Extension writers can define new value types by defining four
|
||||
|
||||
+7
-6
@@ -53,13 +53,13 @@ In a freshly loaded Tcl library, \fBTcl_Panic\fR prints the formatted
|
||||
error message to the standard error file of the process, and then
|
||||
calls \fBabort\fR to terminate the process. \fBTcl_Panic\fR does not
|
||||
return. On Windows, when a debugger is running, the formatted error
|
||||
message is sent to the debugger in stead. If the windows executable
|
||||
message is sent to the debugger instead. If the windows executable
|
||||
does not have a stderr channel (e.g. \fBwish.exe\fR), then a
|
||||
system dialog box is used to display the panic message.
|
||||
.PP
|
||||
If your application doesn't use \fBTcl_Main\fR or \fBTk_Main\fR
|
||||
and you want to implicitly use the stderr channel of your
|
||||
application's C runtime (in stead of the stderr channel of the
|
||||
application's C runtime (instead of the stderr channel of the
|
||||
C runtime used by Tcl), you can call \fBTcl_SetPanicProc\fR
|
||||
with \fBTcl_ConsolePanic\fR as its argument. On platforms which
|
||||
only have one C runtime (almost all platforms except Windows)
|
||||
@@ -86,6 +86,9 @@ The typical use of \fBTcl_SetPanicProc\fR arranges for the error message
|
||||
to be displayed or reported in a manner more suitable for the
|
||||
application or the platform.
|
||||
.PP
|
||||
\fBTcl_SetPanicProc\fR can not be used in stub-enabled extensions. Its symbol
|
||||
entry in the stub table is deprecated and it will be removed in Tcl 9.0.
|
||||
.PP
|
||||
Although the primary callers of \fBTcl_Panic\fR are the procedures of
|
||||
the Tcl library, \fBTcl_Panic\fR is a public function and may be called
|
||||
by any extension or application that wishes to abort the process and
|
||||
@@ -93,11 +96,9 @@ have a panic message displayed the same way that panic messages from Tcl
|
||||
will be displayed.
|
||||
.PP
|
||||
\fBTcl_PanicVA\fR is the same as \fBTcl_Panic\fR except that instead of
|
||||
taking a variable number of arguments it takes an argument list. This
|
||||
taking a variable number of arguments it takes an argument list. Interfaces
|
||||
using argument lists have been found to be nonportable in practice. This
|
||||
function is deprecated and will be removed in Tcl 9.0.
|
||||
.PP
|
||||
This function can not be used in stub-enabled extensions. Its symbol
|
||||
entry in the stub table is deprecated and it will be removed in Tcl 9.0.
|
||||
.SH "SEE ALSO"
|
||||
abort(3), printf(3), exec(n), format(n)
|
||||
.SH KEYWORDS
|
||||
|
||||
+1
-1
@@ -103,7 +103,7 @@ the argument's value. The following values are acceptable values for
|
||||
\fBTCL_ARGV_CONSTANT\fR
|
||||
.
|
||||
The argument does not take any following value argument. If this argument is
|
||||
present, the \fIsrcPtr\fR field (casted to \fIint\fR) is copied to the variable
|
||||
present, the (integer) value of the \fIsrcPtr\fR field is copied to the variable
|
||||
pointed to by the \fIdstPtr\fR field. The \fIclientData\fR field is ignored.
|
||||
.TP
|
||||
\fBTCL_ARGV_END\fR
|
||||
|
||||
+19
-28
@@ -5,7 +5,7 @@
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
.TH Tcl_SetResult 3 8.0 Tcl "Tcl Library Procedures"
|
||||
.TH Tcl_SetResult 3 8.7 Tcl "Tcl Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
.SH NAME
|
||||
@@ -30,9 +30,7 @@ const char *
|
||||
.sp
|
||||
\fBTcl_ResetResult\fR(\fIinterp\fR)
|
||||
.sp
|
||||
.VS 8.6
|
||||
\fBTcl_TransferResult\fR(\fIsourceInterp, result, targetInterp\fR)
|
||||
.VE 8.6
|
||||
\fBTcl_TransferResult\fR(\fIsourceInterp, code, targetInterp\fR)
|
||||
.sp
|
||||
\fBTcl_AppendElement\fR(\fIinterp, element\fR)
|
||||
.sp
|
||||
@@ -57,18 +55,11 @@ Address of procedure to call to release storage at
|
||||
An argument list which must have been initialized using
|
||||
\fBva_start\fR, and cleared using \fBva_end\fR.
|
||||
.AP Tcl_Interp *sourceInterp in
|
||||
.VS 8.6
|
||||
Interpreter that the result and error information should be copied from.
|
||||
.VE 8.6
|
||||
Interpreter that the result and return options should be transferred from.
|
||||
.AP Tcl_Interp *targetInterp in
|
||||
.VS 8.6
|
||||
Interpreter that the result and error information should be copied to.
|
||||
.VE 8.6
|
||||
.AP int result in
|
||||
.VS 8.6
|
||||
If \fBTCL_OK\fR, only copy the result. If \fBTCL_ERROR\fR, copy the error
|
||||
information as well.
|
||||
.VE 8.6
|
||||
Interpreter that the result and return options should be transferred to.
|
||||
.AP int code in
|
||||
Return code value that controls transfer of return options.
|
||||
.BE
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
@@ -154,13 +145,17 @@ call; the last argument in the list must be a NULL pointer.
|
||||
.PP
|
||||
\fBTcl_AppendResultVA\fR is the same as \fBTcl_AppendResult\fR except that
|
||||
instead of taking a variable number of arguments it takes an argument list.
|
||||
Interfaces using argument lists have been found to be nonportable in practice.
|
||||
This function is deprecated and will be removed in Tcl 9.0.
|
||||
.PP
|
||||
.VS 8.6
|
||||
\fBTcl_TransferResult\fR moves a result from one interpreter to another,
|
||||
optionally (dependent on the \fIresult\fR parameter) including the error
|
||||
information dictionary as well. The interpreters must be in the same thread.
|
||||
The source interpreter will have its result reset by this operation.
|
||||
.VE 8.6
|
||||
\fBTcl_TransferResult\fR transfers interpreter state from \fIsourceInterp\fR
|
||||
to \fItargetInterp\fR. The two interpreters must have been created in the
|
||||
same thread. If \fIsourceInterp\fR and \fItargetInterp\fR are the same,
|
||||
nothing is done. Otherwise, \fBTcl_TransferResult\fR moves the result
|
||||
from \fIsourceInterp\fR to \fItargetInterp\fR, and resets the result
|
||||
in \fIsourceInterp\fR. It also moves the return options dictionary as
|
||||
controlled by the return code value \fIcode\fR in the same manner
|
||||
as \fBTcl_GetReturnOptions\fR.
|
||||
.SH "DEPRECATED INTERFACES"
|
||||
.SS "OLD STRING PROCEDURES"
|
||||
.PP
|
||||
@@ -202,14 +197,9 @@ is about to replace one result value with another.
|
||||
It used to be legal for programs to
|
||||
directly read and write \fIinterp->result\fR
|
||||
to manipulate the interpreter result. The Tcl headers no longer
|
||||
permit this access by default, and C code still doing this must
|
||||
permit this access. C code still doing this must
|
||||
be updated to use supported routines \fBTcl_GetObjResult\fR,
|
||||
\fBTcl_GetStringResult\fR, \fBTcl_SetObjResult\fR, and \fBTcl_SetResult\fR.
|
||||
As a migration aid, access can be restored with the compiler directive
|
||||
.CS
|
||||
#define USE_INTERP_RESULT
|
||||
.CE
|
||||
but this is meant only to offer life support to otherwise dead code.
|
||||
.SH "THE TCL_FREEPROC ARGUMENT TO TCL_SETRESULT"
|
||||
.PP
|
||||
\fBTcl_SetResult\fR's \fIfreeProc\fR argument specifies how
|
||||
@@ -250,6 +240,7 @@ typedef void \fBTcl_FreeProc\fR(
|
||||
When \fIfreeProc\fR is called, its \fIblockPtr\fR will be set to
|
||||
the value of \fIresult\fR passed to \fBTcl_SetResult\fR.
|
||||
.SH "SEE ALSO"
|
||||
Tcl_AddErrorInfo, Tcl_CreateObjCommand, Tcl_SetErrorCode, Tcl_Interp
|
||||
Tcl_AddErrorInfo, Tcl_CreateObjCommand, Tcl_SetErrorCode, Tcl_Interp,
|
||||
Tcl_GetReturnOptions
|
||||
.SH KEYWORDS
|
||||
append, command, element, list, value, result, return value, interpreter
|
||||
|
||||
+1
-1
@@ -65,7 +65,7 @@ error message. The result or error from the initialization procedure will
|
||||
be returned as the result of the \fBload\fR command that caused the
|
||||
initialization procedure to be invoked.
|
||||
.PP
|
||||
This function can not be used in stub-enabled extensions. Its symbol
|
||||
\fBTcl_StaticPackage\fR can not be used in stub-enabled extensions. Its symbol
|
||||
entry in the stub table is deprecated and it will be removed in Tcl 9.0.
|
||||
.SH KEYWORDS
|
||||
initialization procedure, package, static linking
|
||||
|
||||
+3
-1
@@ -249,7 +249,9 @@ must be a NULL pointer to indicate the end of the list.
|
||||
.PP
|
||||
\fBTcl_AppendStringsToObjVA\fR is the same as \fBTcl_AppendStringsToObj\fR
|
||||
except that instead of taking a variable number of arguments it takes an
|
||||
argument list.
|
||||
argument list. Interfaces using argument lists have been found to be
|
||||
nonportable in practice. This function is deprecated and will be removed
|
||||
in Tcl 9.0.
|
||||
.PP
|
||||
\fBTcl_AppendLimitedToObj\fR is similar to \fBTcl_AppendToObj\fR
|
||||
except that it imposes a limit on how many bytes are appended.
|
||||
|
||||
+1
-1
@@ -190,7 +190,7 @@ procedure (if any) returns. In non-interactive mode, after
|
||||
procedure (if any) returns, \fBTcl_Main\fR will also evaluate
|
||||
the \fBexit\fR command.
|
||||
.PP
|
||||
This function can not be used in stub-enabled extensions.
|
||||
\fBTcl_Main\fR can not be used in stub-enabled extensions.
|
||||
.SH "SEE ALSO"
|
||||
tclsh(1), Tcl_GetStdChannel(3), Tcl_StandardChannels(3), Tcl_AppInit(3),
|
||||
exit(n), encoding(n)
|
||||
|
||||
+11
-22
@@ -5,7 +5,7 @@
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
.TH Tcl_TraceVar 3 7.4 Tcl "Tcl Library Procedures"
|
||||
.TH Tcl_TraceVar 3 8.7 Tcl "Tcl Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
.SH NAME
|
||||
@@ -95,7 +95,7 @@ Invoke \fIproc\fR whenever an attempt is made to modify the variable.
|
||||
Invoke \fIproc\fR whenever the variable is unset.
|
||||
A variable may be unset either explicitly by an \fBunset\fR command,
|
||||
or implicitly when a procedure returns (its local variables are
|
||||
automatically unset) or when the interpreter is deleted (all
|
||||
automatically unset) or when the interpreter or namespace is deleted (all
|
||||
variables are automatically unset).
|
||||
.TP
|
||||
\fBTCL_TRACE_ARRAY\fR
|
||||
@@ -160,10 +160,6 @@ The bit \fBTCL_TRACE_DESTROYED\fR will be set in \fIflags\fR if the trace is
|
||||
about to be destroyed; this information may be useful to \fIproc\fR
|
||||
so that it can clean up its own internal data structures (see
|
||||
the section \fBTCL_TRACE_DESTROYED\fR below for more details).
|
||||
Lastly, the bit \fBTCL_INTERP_DESTROYED\fR will be set if the entire
|
||||
interpreter is being destroyed.
|
||||
When this bit is set, \fIproc\fR must be especially careful in
|
||||
the things it does (see the section \fBTCL_INTERP_DESTROYED\fR below).
|
||||
The trace procedure's return value should normally be NULL; see
|
||||
\fBERROR RETURNS\fR below for information on other possibilities.
|
||||
.PP
|
||||
@@ -330,6 +326,15 @@ During unset traces, the return value is ignored and all relevant
|
||||
trace procedures will always be invoked.
|
||||
.SH "RESTRICTIONS"
|
||||
.PP
|
||||
Because operations on variables may take place as part of the deletion
|
||||
of the interp that contains them, \fIproc\fR must be careful about checking
|
||||
what the \fIinterp\fR parameter can be used to do.
|
||||
The routine \fBTcl_InterpDeleted\fR is an important tool for this.
|
||||
When \fBTcl_InterpDeleted\fR returns 1, \fIproc\fR will not be able
|
||||
to invoke any scripts in \fIinterp\fR. You may encounter old code using
|
||||
a deprecated flag value \fBTCL_INTERP_DESTROYED\fR to signal this
|
||||
condition, but any supported code should be converted to stop using it.
|
||||
.PP
|
||||
A trace procedure can be called at any time, even when there
|
||||
are partially formed results stored in the interpreter. If
|
||||
the trace procedure does anything that could damage this result (such
|
||||
@@ -354,24 +359,8 @@ Traces on a variable are always removed whenever the variable
|
||||
is deleted; the only time \fBTCL_TRACE_DESTROYED\fR is not set is for
|
||||
a whole-array trace invoked when only a single element of an
|
||||
array is unset.
|
||||
.SH "TCL_INTERP_DESTROYED"
|
||||
.PP
|
||||
When an interpreter is destroyed, unset traces are called for
|
||||
all of its variables.
|
||||
The \fBTCL_INTERP_DESTROYED\fR bit will be set in the \fIflags\fR
|
||||
argument passed to the trace procedures.
|
||||
Trace procedures must be extremely careful in what they do if
|
||||
the \fBTCL_INTERP_DESTROYED\fR bit is set.
|
||||
It is not safe for the procedures to invoke any Tcl procedures
|
||||
on the interpreter, since its state is partially deleted.
|
||||
All that trace procedures should do under these circumstances is
|
||||
to clean up and free their own internal data structures.
|
||||
.SH BUGS
|
||||
.PP
|
||||
Tcl does not do any error checking to prevent trace procedures
|
||||
from misusing the interpreter during traces with \fBTCL_INTERP_DESTROYED\fR
|
||||
set.
|
||||
.PP
|
||||
Array traces are not yet integrated with the Tcl \fBinfo exists\fR command,
|
||||
nor is there Tcl-level access to array traces.
|
||||
.SH "SEE ALSO"
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
.so man.macros
|
||||
.BS
|
||||
.SH NAME
|
||||
Tcl_UniChar, Tcl_UniCharToUtf, Tcl_UtfToUniChar, Tcl_UtfToChar16, Tcl_UtfToWChar, Tcl_UniCharToUtfDString, Tcl_UtfToUniCharDString, Tcl_WCharToUtfDString, Tcl_UtfToWCharDString, Tcl_Char16ToUtfDString, Tcl_UtfToChar16DString, Tcl_UniCharLen, Tcl_UniCharNcmp, Tcl_UniCharNcasecmp, Tcl_UniCharCaseMatch, Tcl_UtfNcmp, Tcl_UtfNcasecmp, Tcl_UtfCharComplete, Tcl_NumUtfChars, Tcl_UtfFindFirst, Tcl_UtfFindLast, Tcl_UtfNext, Tcl_UtfPrev, Tcl_UniCharAtIndex, Tcl_UtfAtIndex, Tcl_UtfBackslash \- routines for manipulating UTF-8 strings
|
||||
Tcl_UniChar, Tcl_UniCharToUtf, Tcl_UtfToUniChar, Tcl_UtfToChar16, Tcl_UtfToWChar, Tcl_UniCharToUtfDString, Tcl_UtfToUniCharDString, Tcl_Char16ToUtfDString, Tcl_UtfToWCharDString, Tcl_UtfToChar16DString, Tcl_UniCharLen, Tcl_UniCharNcmp, Tcl_UniCharNcasecmp, Tcl_UniCharCaseMatch, Tcl_UtfNcmp, Tcl_UtfNcasecmp, Tcl_UtfCharComplete, Tcl_NumUtfChars, Tcl_UtfFindFirst, Tcl_UtfFindLast, Tcl_UtfNext, Tcl_UtfPrev, Tcl_UniCharAtIndex, Tcl_UtfAtIndex, Tcl_UtfBackslash \- routines for manipulating UTF-8 strings
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
\fB#include <tcl.h>\fR
|
||||
@@ -120,6 +120,12 @@ A null-terminated Unicode string.
|
||||
A null-terminated UTF-16 string.
|
||||
.AP "const wchar_t" *wStr in
|
||||
A null-terminated wchar_t string.
|
||||
.AP "const unsigned short" *utf16s in
|
||||
A null-terminated utf-16 string.
|
||||
.AP "const unsigned short" *utf16t in
|
||||
A null-terminated utf-16 string.
|
||||
.AP "const unsigned short" *utf16Pattern in
|
||||
A null-terminated utf-16 string.
|
||||
.AP int length in
|
||||
The length of the UTF-8 string in bytes (not UTF-8 characters). If
|
||||
negative, all bytes up to the first null byte are used.
|
||||
@@ -148,11 +154,11 @@ case-insensitive (1).
|
||||
.PP
|
||||
These routines convert between UTF-8 strings and Unicode/Utf-16 characters.
|
||||
A UTF-8 character is a Unicode character represented as a varying-length
|
||||
sequence of up to \fBTCL_UTF_MAX\fR bytes. A multibyte UTF-8 sequence
|
||||
sequence of up to \fB4\fR bytes. A multibyte UTF-8 sequence
|
||||
consists of a lead byte followed by some number of trail bytes.
|
||||
.PP
|
||||
\fBTCL_UTF_MAX\fR is the maximum number of bytes that it takes to
|
||||
represent one Unicode character in the UTF-8 representation.
|
||||
\fBTCL_UTF_MAX\fR is the maximum number of bytes that \fBTcl_UtfToUniChar\fR
|
||||
can consume in a single call.
|
||||
.PP
|
||||
\fBTcl_UniCharToUtf\fR stores the character \fIch\fR as a UTF-8 string
|
||||
in starting at \fIbuf\fR. The return value is the number of bytes stored
|
||||
|
||||
@@ -56,9 +56,7 @@ When the return code from evaluation of \fIscript\fR is
|
||||
\fBTCL_ERROR\fR, four additional entries are defined in the dictionary
|
||||
of return options stored in \fIoptionsVarName\fR: \fB\-errorinfo\fR,
|
||||
\fB\-errorcode\fR, \fB\-errorline\fR, and
|
||||
.VS 8.6
|
||||
\fB\-errorstack\fR.
|
||||
.VE 8.6
|
||||
The value of the \fB\-errorinfo\fR entry is a formatted stack trace containing
|
||||
more information about the context in which the error happened. The formatted
|
||||
stack trace is meant to be read by a person. The value of the
|
||||
@@ -67,7 +65,6 @@ list. The \fB\-errorcode\fR value is meant to be further processed by
|
||||
programs, and may not be particularly readable by people. The value of the
|
||||
\fB\-errorline\fR entry is an integer indicating which line of \fIscript\fR
|
||||
was being evaluated when the error occurred.
|
||||
.VS 8.6
|
||||
The value of the \fB\-errorstack\fR entry is an
|
||||
even-sized list made of token-parameter pairs accumulated while
|
||||
unwinding the stack. The token may be
|
||||
@@ -87,14 +84,11 @@ the static text of the calling sites, and
|
||||
.IP [3]
|
||||
it is coarser-grained, with only one element per stack frame (like procs; no
|
||||
separate elements for \fBforeach\fR constructs for example).
|
||||
.VE 8.6
|
||||
.PP
|
||||
The values of the \fB\-errorinfo\fR and \fB\-errorcode\fR entries of
|
||||
the most recent error are also available as values of the global
|
||||
variables \fB::errorInfo\fR and \fB::errorCode\fR respectively.
|
||||
.VS 8.6
|
||||
The value of the \fB\-errorstack\fR entry surfaces as \fBinfo errorstack\fR.
|
||||
.VE 8.6
|
||||
.PP
|
||||
Tcl packages may provide commands that set other entries in the
|
||||
dictionary of return options, and the \fBreturn\fR command may be
|
||||
|
||||
-10
@@ -35,7 +35,6 @@ turned on by default.
|
||||
.
|
||||
Close and destroy the channel called \fIchannelId\fR. Note that this
|
||||
deletes all existing file-events registered on the channel.
|
||||
.VS 8.6
|
||||
If the \fIdirection\fR argument (which must be \fBread\fR or \fBwrite\fR or
|
||||
any unique abbreviation of them) is present, the channel will only be
|
||||
half-closed, so that it can go from being read-write to write-only or
|
||||
@@ -45,7 +44,6 @@ write-only channels. Without the \fIdirection\fR argument, the channel is
|
||||
closed for both reading and writing (but only if those directions are
|
||||
currently open). It is an error to close a read-only channel for writing, or a
|
||||
write-only channel for reading.
|
||||
.VE 8.6
|
||||
.RS
|
||||
.PP
|
||||
As part of closing the channel, all buffered output is flushed to the
|
||||
@@ -83,12 +81,10 @@ an error occurs while flushing output. If a command in a command
|
||||
pipeline created with \fBopen\fR returns an error, \fBchan close\fR
|
||||
generates an error (similar to the \fBexec\fR command.)
|
||||
.PP
|
||||
.VS 8.6
|
||||
Note that half-closes of sockets and command pipelines can have important side
|
||||
effects because they result in a shutdown() or close() of the underlying
|
||||
system resource, which can change how other processes or systems respond to
|
||||
the Tcl program.
|
||||
.VE 8.6
|
||||
.RE
|
||||
.TP
|
||||
\fBchan configure \fIchannelId\fR ?\fIoptionName\fR? ?\fIvalue\fR? ?\fIoptionName value\fR?...
|
||||
@@ -540,7 +536,6 @@ an extremely long line that exceeds the available memory to buffer it).
|
||||
Returns -1 if the channel was not opened for the mode in question.
|
||||
.TP
|
||||
\fBchan pipe\fR
|
||||
.VS 8.6
|
||||
Creates a standalone pipe whose read- and write-side channels are
|
||||
returned as a 2-element list, the first element being the read side and
|
||||
the second the write side. Can be useful e.g. to redirect
|
||||
@@ -561,16 +556,13 @@ is most likely to show up when using pipelines for testing; care should be
|
||||
taken to ensure that deadlocks do not occur and that potential short reads are
|
||||
allowed for.
|
||||
.RE
|
||||
.VE 8.6
|
||||
.TP
|
||||
\fBchan pop \fIchannelId\fR
|
||||
.VS 8.6
|
||||
Removes the topmost transformation from the channel \fIchannelId\fR, if there
|
||||
is any. If there are no transformations added to \fIchannelId\fR, this is
|
||||
equivalent to \fBchan close\fR of that channel. The result is normally the
|
||||
empty string, but can be an error in some situations (i.e. where the
|
||||
underlying system stream is closed and that results in an error).
|
||||
.VE 8.6
|
||||
.TP
|
||||
\fBchan postevent \fIchannelId eventSpec\fR
|
||||
.
|
||||
@@ -609,7 +601,6 @@ executed in the interpreter that set them up.
|
||||
.RE
|
||||
.TP
|
||||
\fBchan push \fIchannelId cmdPrefix\fR
|
||||
.VS 8.6
|
||||
Adds a new transformation on top of the channel \fIchannelId\fR. The
|
||||
\fIcmdPrefix\fR argument describes a list of one or more words which represent
|
||||
a handler that will be used to implement the transformation. The command
|
||||
@@ -618,7 +609,6 @@ The result of this subcommand is a handle to the transformation. Note that it
|
||||
is important to make sure that the transformation is capable of supporting the
|
||||
channel mode that it is used with or this can make the channel neither
|
||||
readable nor writable.
|
||||
.VE 8.6
|
||||
.TP
|
||||
\fBchan puts\fR ?\fB\-nonewline\fR? ?\fIchannelId\fR? \fIstring\fR
|
||||
.
|
||||
|
||||
@@ -49,16 +49,13 @@ When the last interpreter in which the channel is registered invokes
|
||||
.PP
|
||||
Channels are automatically closed when an interpreter is destroyed and
|
||||
when the process exits.
|
||||
.VS 8.6
|
||||
From 8.6 on (TIP#398), nonblocking channels are no longer switched to blocking mode when exiting; this guarantees a timely exit even when the peer or a communication channel is stalled. To ensure proper flushing of stalled nonblocking channels on exit, one must now either (a) actively switch them back to blocking or (b) use the environment variable TCL_FLUSH_NONBLOCKING_ON_EXIT, which when set and not equal to "0" restores the previous behavior.
|
||||
.VE 8.6
|
||||
.PP
|
||||
The command returns an empty string, and may generate an error if
|
||||
an error occurs while flushing output. If a command in a command
|
||||
pipeline created with \fBopen\fR returns an error, \fBclose\fR
|
||||
generates an error (similar to the \fBexec\fR command.)
|
||||
.PP
|
||||
.VS 8.6
|
||||
The two-argument form is a
|
||||
.QW "half-close" :
|
||||
given a bidirectional channel like a
|
||||
@@ -80,7 +77,6 @@ abnormal exit error.
|
||||
.PP
|
||||
Currently only sockets and command pipelines support half-close. A future
|
||||
extension will allow reflected and stacked channels to do so.
|
||||
.VE 8.6
|
||||
.SH EXAMPLE
|
||||
.PP
|
||||
This illustrates how you can use Tcl to ensure that files get closed
|
||||
|
||||
+1
-1
@@ -9,7 +9,7 @@
|
||||
.BS
|
||||
'\" Note: do not modify the .SH NAME line immediately below!
|
||||
.SH NAME
|
||||
coroutine, yield, yieldto \- Create and produce values from coroutines
|
||||
coroutine, yield, yieldto, coroinject, coroprobe \- Create and produce values from coroutines
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
\fBcoroutine \fIname command\fR ?\fIarg...\fR?
|
||||
|
||||
@@ -17,11 +17,9 @@ dde \- Execute a Dynamic Data Exchange command
|
||||
.sp
|
||||
\fBdde servername\fR ?\fB\-force\fR? ?\fB\-handler \fIproc\fR? ?\fB\-\|\-\fR? ?\fItopic\fR?
|
||||
.sp
|
||||
.VS 8.6
|
||||
\fBdde execute\fR ?\fB\-async\fR? ?\fB\-binary\fR? \fIservice topic data\fR
|
||||
.sp
|
||||
\fBdde poke\fR ?\fB\-binary\fR? \fIservice topic item data\fR
|
||||
.VE 8.6
|
||||
.sp
|
||||
\fBdde request\fR ?\fB\-binary\fR? \fIservice topic item\fR
|
||||
.sp
|
||||
@@ -82,13 +80,11 @@ script is run in the application. The \fB\-async\fR option requests
|
||||
asynchronous invocation. The command returns an error message if the
|
||||
script did not run, unless the \fB\-async\fR flag was used, in which case
|
||||
the command returns immediately with no error.
|
||||
.VS 8.6
|
||||
Without the \fB\-binary\fR option all data will be sent in unicode. For
|
||||
dde clients which don't implement the CF_UNICODE clipboard format, this
|
||||
will automatically be translated to the system encoding. You can use
|
||||
the \fB\-binary\fR option in combination with the result of
|
||||
\fBencoding convertto\fR to send data in any other encoding.
|
||||
.VE 8.6
|
||||
.TP
|
||||
\fBdde poke\fR ?\fB\-binary\fR? \fIservice topic item data\fR
|
||||
.
|
||||
@@ -99,13 +95,11 @@ specific but can be a command to the server or the name of a file to work
|
||||
on. The \fIitem\fR is also application specific and is often not used, but
|
||||
it must always be non-null. The \fIdata\fR field is given to the remote
|
||||
application.
|
||||
.VS 8.6
|
||||
Without the \fB\-binary\fR option all data will be sent in unicode. For
|
||||
dde clients which don't implement the CF_UNICODE clipboard format, this
|
||||
will automatically be translated to the system encoding. You can use
|
||||
the \fB\-binary\fR option in combination with the result of
|
||||
\fBencoding convertto\fR to send data in any other encoding.
|
||||
.VE 8.6
|
||||
.TP
|
||||
\fBdde request\fR ?\fB\-binary\fR? \fIservice topic item\fR
|
||||
.
|
||||
|
||||
@@ -54,10 +54,8 @@ type (which may be abbreviated.) Supported filter types are:
|
||||
.RS
|
||||
.TP
|
||||
\fBdict filter \fIdictionaryValue \fBkey\fR ?\fIglobPattern ...\fR?
|
||||
.VS 8.6
|
||||
The key rule only matches those key/value pairs whose keys match any
|
||||
of the given patterns (in the style of \fBstring match\fR.)
|
||||
.VE 8.6
|
||||
.TP
|
||||
\fBdict filter \fIdictionaryValue \fBscript {\fIkeyVariable valueVariable\fB} \fIscript\fR
|
||||
.
|
||||
@@ -74,10 +72,8 @@ result. The key/value pairs are tested in the order in which the keys
|
||||
were inserted into the dictionary.
|
||||
.TP
|
||||
\fBdict filter \fIdictionaryValue \fBvalue \fR?\fIglobPattern ...\fR?
|
||||
.VS 8.6
|
||||
The value rule only matches those key/value pairs whose values match any
|
||||
of the given patterns (in the style of \fBstring match\fR.)
|
||||
.VE 8.6
|
||||
.RE
|
||||
.TP
|
||||
\fBdict for {\fIkeyVariable valueVariable\fB} \fIdictionaryValue body\fR
|
||||
|
||||
@@ -338,7 +338,6 @@ if {[catch {\fBexec\fR grep foo bar.txt} results options]} {
|
||||
}
|
||||
}
|
||||
.CE
|
||||
.VS 8.6
|
||||
.PP
|
||||
This is more easily written using the \fBtry\fR command, as that makes
|
||||
it simpler to trap specific types of errors. This is
|
||||
@@ -352,7 +351,6 @@ try {
|
||||
set status [lindex [dict get $options -errorcode] 2]
|
||||
}
|
||||
.CE
|
||||
.VE 8.6
|
||||
.SS "WORKING WITH QUOTED ARGUMENTS"
|
||||
.PP
|
||||
When translating a command from a Unix shell invocation, care should
|
||||
|
||||
@@ -465,7 +465,6 @@ between platforms:
|
||||
.TP
|
||||
\fBfile tempfile\fR ?\fInameVar\fR? ?\fItemplate\fR?
|
||||
'\" TIP #210
|
||||
.VS 8.6
|
||||
Creates a temporary file and returns a read-write channel opened on that file.
|
||||
If the \fInameVar\fR is given, it specifies a variable that the name of the
|
||||
temporary file will be written into; if absent, Tcl will attempt to arrange
|
||||
@@ -480,7 +479,6 @@ Note that temporary files are \fIonly\fR ever created on the native
|
||||
filesystem. As such, they can be relied upon to be used with operating-system
|
||||
native APIs and external programs that require a filename.
|
||||
.RE
|
||||
.VE 8.6
|
||||
.TP
|
||||
\fBfile type \fIname\fR
|
||||
.
|
||||
|
||||
@@ -154,7 +154,6 @@ what to set the interpreter's background exception handler to. See the
|
||||
\fBBACKGROUND EXCEPTION HANDLING\fR section for more details.
|
||||
.TP
|
||||
\fBinterp\fR \fBcancel \fR?\fB\-unwind\fR? ?\fB\-\|\-\fR? ?\fIpath\fR? ?\fIresult\fR?
|
||||
.VS 8.6
|
||||
Cancels the script being evaluated in the interpreter identified by
|
||||
\fIpath\fR. Without the \fB\-unwind\fR switch the evaluation stack for
|
||||
the interpreter is unwound until an enclosing catch command is found or
|
||||
@@ -167,7 +166,6 @@ switches; it may be needed if \fIpath\fR is an unusual value such
|
||||
as \fB\-safe\fR. If \fIresult\fR is present, it will be used as the
|
||||
error message string; otherwise, a default error message string will be
|
||||
used.
|
||||
.VE 8.6
|
||||
.TP
|
||||
\fBinterp\fR \fBcreate \fR?\fB\-safe\fR? ?\fB\-\|\-\fR? ?\fIpath\fR?
|
||||
.
|
||||
|
||||
+3
-2
@@ -49,8 +49,9 @@ Using \fBlappend\fR to build up a list of numbers.
|
||||
1 2 3 4 5
|
||||
.CE
|
||||
.SH "SEE ALSO"
|
||||
list(n), lindex(n), linsert(n), llength(n), lset(n),
|
||||
lsort(n), lrange(n)
|
||||
list(n), lassign(n), lindex(n), linsert(n), llength(n),
|
||||
lmap(n), lpop(n), lrange(n), lremove(n), lrepeat(n), lreplace(n),
|
||||
lreverse(n), lsearch(n), lset(n), lsort(n)
|
||||
.SH KEYWORDS
|
||||
append, element, list, variable
|
||||
.\" Local variables:
|
||||
|
||||
+3
-1
@@ -52,7 +52,9 @@ command in many shell languages like this:
|
||||
set ::argv [\fBlassign\fR $::argv argumentToReadOff]
|
||||
.CE
|
||||
.SH "SEE ALSO"
|
||||
lindex(n), list(n), lrange(n), lset(n), set(n)
|
||||
list(n), lappend(n), lindex(n), linsert(n), llength(n),
|
||||
lmap(n), lpop(n), lrange(n), lremove(n), lrepeat(n), lreplace(n),
|
||||
lreverse(n), lsearch(n), lset(n), lsort(n)
|
||||
.SH KEYWORDS
|
||||
assign, element, list, multiple, set, variable
|
||||
'\"Local Variables:
|
||||
|
||||
+3
-2
@@ -115,8 +115,9 @@ set idx 3
|
||||
\fI\(-> f\fR
|
||||
.CE
|
||||
.SH "SEE ALSO"
|
||||
list(n), lappend(n), linsert(n), llength(n), lsearch(n),
|
||||
lset(n), lsort(n), lrange(n), lreplace(n),
|
||||
list(n), lappend(n), lassign(n), linsert(n), llength(n),
|
||||
lmap(n), lpop(n), lrange(n), lremove(n), lrepeat(n), lreplace(n),
|
||||
lreverse(n), lsearch(n), lset(n), lsort(n),
|
||||
string(n)
|
||||
.SH KEYWORDS
|
||||
element, index, list
|
||||
|
||||
+3
-2
@@ -45,8 +45,9 @@ set newList [\fBlinsert\fR $midList end-1 lazy]
|
||||
set newerList [\fBlinsert\fR [\fBlinsert\fR $oldList end-1 quick] 1 lazy]
|
||||
.CE
|
||||
.SH "SEE ALSO"
|
||||
list(n), lappend(n), lindex(n), llength(n), lsearch(n),
|
||||
lset(n), lsort(n), lrange(n), lreplace(n),
|
||||
list(n), lappend(n), lassign(n), lindex(n), llength(n),
|
||||
lmap(n), lpop(n), lrange(n), lremove(n), lrepeat(n), lreplace(n),
|
||||
lreverse(n), lsearch(n), lset(n), lsort(n),
|
||||
string(n)
|
||||
.SH KEYWORDS
|
||||
element, insert, list
|
||||
|
||||
+3
-3
@@ -46,9 +46,9 @@ while \fBconcat\fR with the same arguments will return
|
||||
\fBa b c d e f {g h}\fR
|
||||
.CE
|
||||
.SH "SEE ALSO"
|
||||
lappend(n), lindex(n), linsert(n), llength(n), lrange(n),
|
||||
lrepeat(n),
|
||||
lreplace(n), lsearch(n), lset(n), lsort(n)
|
||||
lappend(n), lassign(n), lindex(n), linsert(n), llength(n),
|
||||
lmap(n), lpop(n), lrange(n), lremove(n), lrepeat(n), lreplace(n),
|
||||
lreverse(n), lsearch(n), lset(n), lsort(n)
|
||||
.SH KEYWORDS
|
||||
element, list, quoting
|
||||
'\"Local Variables:
|
||||
|
||||
+3
-2
@@ -49,8 +49,9 @@ An empty list is not necessarily an empty string:
|
||||
1,0
|
||||
.CE
|
||||
.SH "SEE ALSO"
|
||||
list(n), lappend(n), lindex(n), linsert(n), lsearch(n),
|
||||
lset(n), lsort(n), lrange(n), lreplace(n)
|
||||
list(n), lappend(n), lassign(n), lindex(n), linsert(n),
|
||||
lmap(n), lpop(n), lrange(n), lremove(n), lrepeat(n), lreplace(n),
|
||||
lreverse(n), lsearch(n), lset(n), lsort(n)
|
||||
.SH KEYWORDS
|
||||
element, list, length
|
||||
'\" Local Variables:
|
||||
|
||||
+4
-1
@@ -77,7 +77,10 @@ set prefix [\fBlmap\fR x $values {expr {
|
||||
# The value of prefix is "8 7 6 5 4"
|
||||
.CE
|
||||
.SH "SEE ALSO"
|
||||
break(n), continue(n), for(n), foreach(n), while(n)
|
||||
break(n), continue(n), for(n), foreach(n), while(n),
|
||||
list(n), lappend(n), lassign(n), lindex(n), linsert(n), llength(n),
|
||||
lpop(n), lrange(n), lremove(n), lrepeat(n), lreplace(n),
|
||||
lreverse(n), lsearch(n), lset(n), lsort(n)
|
||||
.SH KEYWORDS
|
||||
foreach, iteration, list, loop, map
|
||||
'\" Local Variables:
|
||||
|
||||
+3
-2
@@ -86,8 +86,9 @@ The indicated value becomes the new value of \fIx\fR.
|
||||
\fI\(-> {{a b} {c d}} {{e f} h}\fR
|
||||
.CE
|
||||
.SH "SEE ALSO"
|
||||
list(n), lappend(n), lindex(n), linsert(n), llength(n), lsearch(n),
|
||||
lsort(n), lrange(n), lreplace(n), lset(n)
|
||||
list(n), lappend(n), lassign(n), lindex(n), linsert(n), llength(n),
|
||||
lmap(n), lrange(n), lremove(n), lrepeat(n), lreplace(n),
|
||||
lreverse(n), lsearch(n), lset(n), lsort(n),
|
||||
string(n)
|
||||
.SH KEYWORDS
|
||||
element, index, list, remove, pop, stack, queue
|
||||
|
||||
+3
-2
@@ -71,8 +71,9 @@ elements to
|
||||
{elements to}
|
||||
.CE
|
||||
.SH "SEE ALSO"
|
||||
list(n), lappend(n), lindex(n), linsert(n), llength(n), lsearch(n),
|
||||
lset(n), lremove(n), lreplace(n), lsort(n),
|
||||
list(n), lappend(n), lassign(n), lindex(n), linsert(n), llength(n),
|
||||
lmap(n), lpop(n), lremove(n), lrepeat(n), lreplace(n),
|
||||
lreverse(n), lsearch(n), lset(n), lsort(n),
|
||||
string(n)
|
||||
.SH KEYWORDS
|
||||
element, list, range, sublist
|
||||
|
||||
+3
-1
@@ -46,7 +46,9 @@ Removing the same element indicated in two different ways:
|
||||
a b d e
|
||||
.CE
|
||||
.SH "SEE ALSO"
|
||||
list(n), lrange(n), lsearch(n), lsearch(n)
|
||||
list(n), lappend(n), lassign(n), lindex(n), linsert(n), llength(n),
|
||||
lmap(n), lpop(n), lrange(n), lrepeat(n), lreplace(n),
|
||||
lreverse(n), lsearch(n), lset(n), lsort(n)
|
||||
.SH KEYWORDS
|
||||
element, list, remove
|
||||
.\" Local variables:
|
||||
|
||||
+3
-1
@@ -32,7 +32,9 @@ is identical to \fBlist element ...\fR.
|
||||
\fI\(-> {a a} b c {a a} b c {a a} b c\fR
|
||||
.CE
|
||||
.SH "SEE ALSO"
|
||||
list(n), lappend(n), linsert(n), llength(n), lset(n)
|
||||
list(n), lappend(n), lassign(n), lindex(n), linsert(n), llength(n),
|
||||
lmap(n), lpop(n), lrange(n), lremove(n), lreplace(n),
|
||||
lreverse(n), lsearch(n), lset(n), lsort(n)
|
||||
.SH KEYWORDS
|
||||
element, index, list
|
||||
'\" Local Variables:
|
||||
|
||||
+3
-2
@@ -95,8 +95,9 @@ a b c d e f g h i
|
||||
.CE
|
||||
.VE TIP505
|
||||
.SH "SEE ALSO"
|
||||
list(n), lappend(n), lindex(n), linsert(n), llength(n), lsearch(n),
|
||||
lset(n), lrange(n), lremove(n), lsort(n),
|
||||
list(n), lappend(n), lassign(n), lindex(n), linsert(n), llength(n),
|
||||
lmap(n), lpop(n), lrange(n), lremove(n), lrepeat(n),
|
||||
lreverse(n), lsearch(n), lset(n), lsort(n),
|
||||
string(n)
|
||||
.SH KEYWORDS
|
||||
element, list, replace
|
||||
|
||||
+3
-2
@@ -25,8 +25,9 @@ input list, \fIlist\fR, except with the elements in the reverse order.
|
||||
\fI\(-> f e {c d} b a\fR
|
||||
.CE
|
||||
.SH "SEE ALSO"
|
||||
list(n), lsearch(n), lsort(n)
|
||||
|
||||
list(n), lappend(n), lassign(n), lindex(n), linsert(n), llength(n),
|
||||
lmap(n), lpop(n), lrange(n), lremove(n), lrepeat(n), lreplace(n),
|
||||
lsearch(n), lset(n), lsort(n)
|
||||
.SH KEYWORDS
|
||||
element, list, reverse
|
||||
'\" Local Variables:
|
||||
|
||||
+4
-4
@@ -134,7 +134,6 @@ The list elements are sorted in increasing order. This option is only
|
||||
meaningful when used with \fB\-sorted\fR.
|
||||
.TP
|
||||
\fB\-bisect\fR
|
||||
.VS 8.6
|
||||
Inexact search when the list elements are in sorted order. For an increasing
|
||||
list the last index where the element is less than or equal to the pattern
|
||||
is returned. For a decreasing list the last index where the element is greater
|
||||
@@ -142,7 +141,6 @@ than or equal to the pattern is returned. If the pattern is before the first
|
||||
element or the list is empty, -1 is returned.
|
||||
This option implies \fB\-sorted\fR and cannot be used with either \fB\-all\fR
|
||||
or \fB\-not\fR.
|
||||
.VE 8.6
|
||||
.SS "NESTED LIST OPTIONS"
|
||||
.PP
|
||||
These options are used to search lists of lists. They may be used
|
||||
@@ -229,8 +227,10 @@ The same thing for a flattened list:
|
||||
\fI\(-> {a abc b bcd}\fR
|
||||
.CE
|
||||
.SH "SEE ALSO"
|
||||
foreach(n), list(n), lappend(n), lindex(n), linsert(n), llength(n),
|
||||
lset(n), lsort(n), lrange(n), lreplace(n),
|
||||
foreach(n),
|
||||
list(n), lappend(n), lassign(n), lindex(n), linsert(n), llength(n),
|
||||
lmap(n), lpop(n), lrange(n), lremove(n), lrepeat(n), lreplace(n),
|
||||
lreverse(n), lset(n), lsort(n),
|
||||
string(n)
|
||||
.SH KEYWORDS
|
||||
binary search, linear search,
|
||||
|
||||
+3
-2
@@ -136,8 +136,9 @@ The indicated return value also becomes the new value of \fIx\fR.
|
||||
\fI\(-> {{a b} {c d}} {{e f} {j h}}\fR
|
||||
.CE
|
||||
.SH "SEE ALSO"
|
||||
list(n), lappend(n), lindex(n), linsert(n), llength(n), lsearch(n),
|
||||
lsort(n), lrange(n), lreplace(n),
|
||||
list(n), lappend(n), lassign(n), lindex(n), linsert(n), llength(n),
|
||||
lmap(n), lpop(n), lrange(n), lremove(n), lrepeat(n), lreplace(n),
|
||||
lreverse(n), lsearch(n), lsort(n)
|
||||
string(n)
|
||||
.SH KEYWORDS
|
||||
element, index, list, replace, set
|
||||
|
||||
+3
-4
@@ -221,7 +221,6 @@ Sorting using indices:
|
||||
{e 1} {d 2} { c 3} {b 4} {a 5}
|
||||
.CE
|
||||
.PP
|
||||
.VS 8.6
|
||||
Sorting a dictionary:
|
||||
.PP
|
||||
.CS
|
||||
@@ -239,7 +238,6 @@ Sorting using striding and multiple indices:
|
||||
{{Bob Smith} 25 Audi {Jane Doe} 40 Ford}
|
||||
{{Jane Doe} 40 Ford {Bob Smith} 25 Audi}
|
||||
.CE
|
||||
.VE 8.6
|
||||
.PP
|
||||
Stripping duplicate values using sorting:
|
||||
.PP
|
||||
@@ -266,8 +264,9 @@ More complex sorting using a comparison function:
|
||||
{1 dingo} {2 banana} {0x2 carrot} {3 apple}
|
||||
.CE
|
||||
.SH "SEE ALSO"
|
||||
list(n), lappend(n), lindex(n), linsert(n), llength(n), lsearch(n),
|
||||
lset(n), lrange(n), lreplace(n)
|
||||
list(n), lappend(n), lassign(n), lindex(n), linsert(n), llength(n),
|
||||
lmap(n), lpop(n), lrange(n), lremove(n), lrepeat(n), lreplace(n),
|
||||
lreverse(n), lsearch(n), lset(n)
|
||||
.SH KEYWORDS
|
||||
element, list, order, sort
|
||||
'\" Local Variables:
|
||||
|
||||
@@ -23,7 +23,7 @@ package require TclOO
|
||||
The \fBmy\fR command is used to allow methods of objects to invoke methods
|
||||
of the object (or its class),
|
||||
.VS TIP478
|
||||
and he \fBmyclass\fR command is used to allow methods of objects to invoke
|
||||
and the \fBmyclass\fR command is used to allow methods of objects to invoke
|
||||
methods of the current class of the object \fIas an object\fR.
|
||||
.VE TIP478
|
||||
In particular, the set of valid values for
|
||||
|
||||
@@ -788,12 +788,10 @@ name. Note that when this option is non-empty and the
|
||||
will be exactly those words that have mappings in the dictionary.
|
||||
.TP
|
||||
\fB\-parameters\fR
|
||||
.VS 8.6
|
||||
This option gives a list of named arguments (the names being used during
|
||||
generation of error messages) that are passed by the caller of the ensemble
|
||||
between the name of the ensemble and the subcommand argument. By default, it
|
||||
is the empty list.
|
||||
.VE 8.6
|
||||
.TP
|
||||
\fB\-prefixes\fR
|
||||
.
|
||||
@@ -943,7 +941,6 @@ Remove all imported commands from the current namespace:
|
||||
namespace forget {*}[namespace import]
|
||||
.CE
|
||||
.PP
|
||||
.VS 8.6
|
||||
Create an ensemble for simple working with numbers, using the
|
||||
\fB\-parameters\fR option to allow the operator to be put between the first
|
||||
and second arguments.
|
||||
@@ -959,7 +956,6 @@ and second arguments.
|
||||
# In use, the ensemble works like this:
|
||||
puts [do 1 plus [do 9 minus 7]]
|
||||
.CE
|
||||
.VE 8.6
|
||||
.SH "SEE ALSO"
|
||||
interp(n), upvar(n), variable(n)
|
||||
.SH KEYWORDS
|
||||
|
||||
@@ -44,13 +44,11 @@ one of \fBHKEY_LOCAL_MACHINE\fR, \fBHKEY_USERS\fR,
|
||||
\fBHKEY_DYN_DATA\fR. The \fIkeypath\fR can be one or more
|
||||
registry key names separated by backslash (\fB\e\fR) characters.
|
||||
.PP
|
||||
.VS 8.6
|
||||
The optional \fI\-mode\fR argument indicates which registry to work
|
||||
with; when it is \fB\-32bit\fR the 32-bit registry will be used, and
|
||||
when it is \fB\-64bit\fR the 64-bit registry will be used. If this
|
||||
argument is omitted, the system's default registry will be the subject
|
||||
of the requested operation.
|
||||
.VE 8.6
|
||||
.PP
|
||||
\fIOption\fR indicates what to do with the registry key name. Any
|
||||
unique abbreviation for \fIoption\fR is acceptable. The valid options
|
||||
|
||||
@@ -137,7 +137,6 @@ by the \fBcatch\fR command (or from the copy of that information
|
||||
stored in the global variable \fBerrorInfo\fR).
|
||||
.TP
|
||||
\fB\-errorstack \fIlist\fR
|
||||
.VS 8.6
|
||||
The \fB\-errorstack\fR option receives special treatment only when the value
|
||||
of the \fB\-code\fR option is \fBTCL_ERROR\fR. Then \fIlist\fR is the initial
|
||||
error stack, recording actual argument values passed to each proc level. The error stack will
|
||||
@@ -152,7 +151,6 @@ the procedure. Typically the \fIlist\fR value is supplied from
|
||||
the value of \fB\-errorstack\fR in a return options dictionary captured
|
||||
by the \fBcatch\fR command (or from the copy of that information from
|
||||
\fBinfo errorstack\fR).
|
||||
.VE 8.6
|
||||
.TP
|
||||
\fB\-level \fIlevel\fR
|
||||
.
|
||||
|
||||
@@ -322,11 +322,9 @@ The version number for the operating system running on this machine.
|
||||
On UNIX machines, this is the value returned by \fBuname -r\fR.
|
||||
.TP
|
||||
\fBpathSeparator\fR
|
||||
.VS 8.6
|
||||
'\" Defined by TIP #315
|
||||
The character that should be used to \fBsplit\fR PATH-like environment
|
||||
variables into their corresponding list of directory names.
|
||||
.VE 8.6
|
||||
.TP
|
||||
\fBplatform\fR
|
||||
.
|
||||
|
||||
+1
-1
@@ -83,7 +83,7 @@ example, the Tcl 8.7.2 release would be searched for in a file
|
||||
\fBlibtcl_8_7_2.zip\fR.) That archive, if located, is also mounted read-only.
|
||||
.PP
|
||||
On Windows, \fBTclZipfs_AppHook\fR has a slightly different signature, since
|
||||
it uses WCHAR in stead of char. As a result, it requires your application to
|
||||
it uses WCHAR instead of char. As a result, it requires your application to
|
||||
be compiled with the UNICODE preprocessor symbol defined (e.g., via the
|
||||
\fB-DUNICODE\fR compiler flag).
|
||||
.PP
|
||||
|
||||
@@ -243,6 +243,7 @@ struct vars {
|
||||
#define EMPTYARC(x, y) newarc(v->nfa, EMPTY, 0, x, y)
|
||||
|
||||
/* token type codes, some also used as NFA arc types */
|
||||
#undef DIGIT /* prevent conflict with libtommath */
|
||||
#define EMPTY 'n' /* no token present */
|
||||
#define EOS 'e' /* end of string */
|
||||
#define PLAIN 'p' /* ordinary character */
|
||||
|
||||
+1
-1
@@ -88,7 +88,7 @@ typedef int celt; /* Type to hold chr, or NOCELT */
|
||||
#define NOCELT (-1) /* Celt value which is not valid chr */
|
||||
#define CHR(c) (UCHAR(c)) /* Turn char literal into chr literal */
|
||||
#define DIGITVAL(c) ((c)-'0') /* Turn chr digit into its value */
|
||||
#if TCL_UTF_MAX > 4
|
||||
#if TCL_UTF_MAX > 3
|
||||
#define CHRBITS 32 /* Bits in a chr; must not use sizeof */
|
||||
#define CHR_MIN 0x00000000 /* Smallest and largest chr; the value */
|
||||
#define CHR_MAX 0x10ffff /* CHR_MAX-CHR_MIN+1 should fit in uchr */
|
||||
|
||||
+17
-15
@@ -132,9 +132,8 @@ declare 28 {
|
||||
declare 29 {
|
||||
Tcl_Obj *Tcl_DuplicateObj(Tcl_Obj *objPtr)
|
||||
}
|
||||
# Only available as stub-entry, for backwards-compatible stub-enabled extensions
|
||||
declare 30 {
|
||||
void TclOldFreeObj(Tcl_Obj *objPtr)
|
||||
void TclFreeObj(Tcl_Obj *objPtr)
|
||||
}
|
||||
declare 31 {
|
||||
int Tcl_GetBoolean(Tcl_Interp *interp, const char *src, int *boolPtr)
|
||||
@@ -524,7 +523,7 @@ declare 145 {
|
||||
declare 146 {
|
||||
int Tcl_Flush(Tcl_Channel chan)
|
||||
}
|
||||
declare 147 {
|
||||
declare 147 {deprecated {see TIP #559. Use Tcl_ResetResult}} {
|
||||
void Tcl_FreeResult(Tcl_Interp *interp)
|
||||
}
|
||||
declare 148 {
|
||||
@@ -1245,10 +1244,10 @@ declare 350 {
|
||||
declare 351 {
|
||||
int Tcl_UniCharIsWordChar(int ch)
|
||||
}
|
||||
declare 352 {
|
||||
declare 352 {deprecated {Use Tcl_GetCharLength}} {
|
||||
int Tcl_UniCharLen(const Tcl_UniChar *uniStr)
|
||||
}
|
||||
declare 353 {
|
||||
declare 353 {deprecated {Use Tcl_UtfNcmp}} {
|
||||
int Tcl_UniCharNcmp(const Tcl_UniChar *ucs, const Tcl_UniChar *uct,
|
||||
unsigned long numChars)
|
||||
}
|
||||
@@ -1357,7 +1356,7 @@ declare 382 {deprecated {No longer in use, changed to macro}} {
|
||||
declare 383 {
|
||||
Tcl_Obj *Tcl_GetRange(Tcl_Obj *objPtr, int first, int last)
|
||||
}
|
||||
declare 384 {
|
||||
declare 384 {deprecated {Use Tcl_AppendStringsToObj}} {
|
||||
void Tcl_AppendUnicodeToObj(Tcl_Obj *objPtr, const Tcl_UniChar *unicode,
|
||||
int length)
|
||||
}
|
||||
@@ -1483,11 +1482,11 @@ declare 417 {
|
||||
declare 418 {
|
||||
int Tcl_IsChannelExisting(const char *channelName)
|
||||
}
|
||||
declare 419 {
|
||||
declare 419 {deprecated {Use Tcl_UtfNcasecmp}} {
|
||||
int Tcl_UniCharNcasecmp(const Tcl_UniChar *ucs, const Tcl_UniChar *uct,
|
||||
unsigned long numChars)
|
||||
}
|
||||
declare 420 {
|
||||
declare 420 {deprecated {Use Tcl_StringCaseMatch}} {
|
||||
int Tcl_UniCharCaseMatch(const Tcl_UniChar *uniStr,
|
||||
const Tcl_UniChar *uniPattern, int nocase)
|
||||
}
|
||||
@@ -2010,19 +2009,19 @@ declare 554 {
|
||||
|
||||
# TIP#237 (arbitrary-precision integers) kbk
|
||||
declare 555 {
|
||||
Tcl_Obj *Tcl_NewBignumObj(mp_int *value)
|
||||
Tcl_Obj *Tcl_NewBignumObj(void *value)
|
||||
}
|
||||
declare 556 {
|
||||
Tcl_Obj *Tcl_DbNewBignumObj(mp_int *value, const char *file, int line)
|
||||
Tcl_Obj *Tcl_DbNewBignumObj(void *value, const char *file, int line)
|
||||
}
|
||||
declare 557 {
|
||||
void Tcl_SetBignumObj(Tcl_Obj *obj, mp_int *value)
|
||||
void Tcl_SetBignumObj(Tcl_Obj *obj, void *value)
|
||||
}
|
||||
declare 558 {
|
||||
int Tcl_GetBignumFromObj(Tcl_Interp *interp, Tcl_Obj *obj, mp_int *value)
|
||||
int Tcl_GetBignumFromObj(Tcl_Interp *interp, Tcl_Obj *obj, void *value)
|
||||
}
|
||||
declare 559 {
|
||||
int Tcl_TakeBignumFromObj(Tcl_Interp *interp, Tcl_Obj *obj, mp_int *value)
|
||||
int Tcl_TakeBignumFromObj(Tcl_Interp *interp, Tcl_Obj *obj, void *value)
|
||||
}
|
||||
|
||||
# TIP #208 ('chan' command) jeffh
|
||||
@@ -2051,7 +2050,7 @@ declare 565 {
|
||||
# TIP #237 (additional conversion functions for bignum support) kbk/dgp
|
||||
declare 566 {
|
||||
int Tcl_InitBignumFromDouble(Tcl_Interp *interp, double initval,
|
||||
mp_int *toInit)
|
||||
void *toInit)
|
||||
}
|
||||
|
||||
# TIP#181 (namespace unknown command) dgp for Neil Madden
|
||||
@@ -2222,7 +2221,7 @@ declare 606 {
|
||||
|
||||
# TIP#307 (move results between interpreters) dkf
|
||||
declare 607 {
|
||||
void Tcl_TransferResult(Tcl_Interp *sourceInterp, int result,
|
||||
void Tcl_TransferResult(Tcl_Interp *sourceInterp, int code,
|
||||
Tcl_Interp *targetInterp)
|
||||
}
|
||||
|
||||
@@ -2481,6 +2480,9 @@ export {
|
||||
export {
|
||||
void Tcl_GetMemoryInfo(Tcl_DString *dsPtr)
|
||||
}
|
||||
export {
|
||||
void Tcl_InitSubsystems(void)
|
||||
}
|
||||
|
||||
# Local Variables:
|
||||
# mode: tcl
|
||||
|
||||
+155
-182
@@ -51,10 +51,10 @@ extern "C" {
|
||||
#define TCL_MAJOR_VERSION 8
|
||||
#define TCL_MINOR_VERSION 7
|
||||
#define TCL_RELEASE_LEVEL TCL_ALPHA_RELEASE
|
||||
#define TCL_RELEASE_SERIAL 2
|
||||
#define TCL_RELEASE_SERIAL 4
|
||||
|
||||
#define TCL_VERSION "8.7"
|
||||
#define TCL_PATCH_LEVEL "8.7a2"
|
||||
#define TCL_PATCH_LEVEL "8.7a4"
|
||||
|
||||
#if !defined(TCL_NO_DEPRECATED) || defined(RC_INVOKED)
|
||||
/*
|
||||
@@ -361,7 +361,7 @@ typedef long LONG;
|
||||
*/
|
||||
|
||||
#if !defined(TCL_WIDE_INT_TYPE)&&!defined(TCL_WIDE_INT_IS_LONG)
|
||||
# if defined(_WIN32)
|
||||
# if defined(_MSC_VER) || defined(_WIN32)
|
||||
# define TCL_WIDE_INT_TYPE __int64
|
||||
# define TCL_LL_MODIFIER "I64"
|
||||
# if defined(_WIN64)
|
||||
@@ -1031,7 +1031,11 @@ typedef struct Tcl_DString {
|
||||
#define TCL_TRACE_WRITES 0x20
|
||||
#define TCL_TRACE_UNSETS 0x40
|
||||
#define TCL_TRACE_DESTROYED 0x80
|
||||
|
||||
#if !defined(TCL_NO_DEPRECATED) && TCL_MAJOR_VERSION < 9
|
||||
#define TCL_INTERP_DESTROYED 0x100
|
||||
#endif
|
||||
|
||||
#define TCL_LEAVE_ERR_MSG 0x200
|
||||
#define TCL_TRACE_ARRAY 0x800
|
||||
#ifndef TCL_REMOVE_OBSOLETE_TRACES
|
||||
@@ -1653,7 +1657,7 @@ typedef struct Tcl_FSVersion_ *Tcl_FSVersion;
|
||||
* struct Tcl_Filesystem:
|
||||
*
|
||||
* One such structure exists for each type (kind) of filesystem. It collects
|
||||
* together in one place all the functions that are part of the specific
|
||||
* together the functions that form the interface for a particulr the
|
||||
* filesystem. Tcl always accesses the filesystem through one of these
|
||||
* structures.
|
||||
*
|
||||
@@ -1668,147 +1672,119 @@ typedef struct Tcl_Filesystem {
|
||||
* compatibility can be assured. */
|
||||
Tcl_FSVersion version; /* Version of the filesystem type. */
|
||||
Tcl_FSPathInFilesystemProc *pathInFilesystemProc;
|
||||
/* Function to check whether a path is in this
|
||||
/* Determines whether the pathname is in this
|
||||
* filesystem. This is the most important
|
||||
* filesystem function. */
|
||||
Tcl_FSDupInternalRepProc *dupInternalRepProc;
|
||||
/* Function to duplicate internal fs rep. May
|
||||
* be NULL (but then fs is less efficient). */
|
||||
/* Duplicates the internal handle of the node.
|
||||
* If it is NULL, the filesystem is less
|
||||
* performant. */
|
||||
Tcl_FSFreeInternalRepProc *freeInternalRepProc;
|
||||
/* Function to free internal fs rep. Must be
|
||||
* implemented if internal representations
|
||||
* need freeing, otherwise it can be NULL. */
|
||||
/* Frees the internal handle of the node. NULL
|
||||
* only if there is no need to free resources
|
||||
* used for the internal handle. */
|
||||
Tcl_FSInternalToNormalizedProc *internalToNormalizedProc;
|
||||
/* Function to convert internal representation
|
||||
* to a normalized path. Only required if the
|
||||
* fs creates pure path objects with no
|
||||
* string/path representation. */
|
||||
/* Converts the internal handle to a normalized
|
||||
* path. NULL if the filesystem creates nodes
|
||||
* having no pathname. */
|
||||
Tcl_FSCreateInternalRepProc *createInternalRepProc;
|
||||
/* Function to create a filesystem-specific
|
||||
* internal representation. May be NULL if
|
||||
* paths have no internal representation, or
|
||||
* if the Tcl_FSPathInFilesystemProc for this
|
||||
* filesystem always immediately creates an
|
||||
* internal representation for paths it
|
||||
* accepts. */
|
||||
/* Creates an internal handle for a pathname.
|
||||
* May be NULL if pathnames have no internal
|
||||
* handle or if pathInFilesystemProc always
|
||||
* immediately creates an internal
|
||||
* representation for pathnames in the
|
||||
* filesystem. */
|
||||
Tcl_FSNormalizePathProc *normalizePathProc;
|
||||
/* Function to normalize a path. Should be
|
||||
* implemented for all filesystems which can
|
||||
* have multiple string representations for
|
||||
* the same path object. */
|
||||
/* Normalizes a path. Should be implemented if
|
||||
* the filesystems supports multiple paths to
|
||||
* the same node. */
|
||||
Tcl_FSFilesystemPathTypeProc *filesystemPathTypeProc;
|
||||
/* Function to determine the type of a path in
|
||||
* this filesystem. May be NULL. */
|
||||
/* Determines the type of a path in this
|
||||
* filesystem. May be NULL. */
|
||||
Tcl_FSFilesystemSeparatorProc *filesystemSeparatorProc;
|
||||
/* Function to return the separator
|
||||
* character(s) for this filesystem. Must be
|
||||
* implemented. */
|
||||
Tcl_FSStatProc *statProc; /* Function to process a 'Tcl_FSStat()' call.
|
||||
* Must be implemented for any reasonable
|
||||
* filesystem. */
|
||||
Tcl_FSAccessProc *accessProc;
|
||||
/* Function to process a 'Tcl_FSAccess()'
|
||||
* call. Must be implemented for any
|
||||
/* Produces the separator character(s) for this
|
||||
* filesystem. Must not be NULL. */
|
||||
Tcl_FSStatProc *statProc; /* Called by 'Tcl_FSStat()'. Provided by any
|
||||
* reasonable filesystem. */
|
||||
Tcl_FSAccessProc *accessProc;
|
||||
/* Called by 'Tcl_FSAccess()'. Implemented by
|
||||
* any reasonable filesystem. */
|
||||
Tcl_FSOpenFileChannelProc *openFileChannelProc;
|
||||
/* Function to process a
|
||||
* 'Tcl_FSOpenFileChannel()' call. Must be
|
||||
* implemented for any reasonable
|
||||
* filesystem. */
|
||||
/* Called by 'Tcl_FSOpenFileChannel()'.
|
||||
* Provided by any reasonable filesystem. */
|
||||
Tcl_FSMatchInDirectoryProc *matchInDirectoryProc;
|
||||
/* Function to process a
|
||||
* 'Tcl_FSMatchInDirectory()'. If not
|
||||
* implemented, then glob and recursive copy
|
||||
* functionality will be lacking in the
|
||||
* filesystem. */
|
||||
Tcl_FSUtimeProc *utimeProc; /* Function to process a 'Tcl_FSUtime()' call.
|
||||
* Required to allow setting (not reading) of
|
||||
* times with 'file mtime', 'file atime' and
|
||||
* the open-r/open-w/fcopy implementation of
|
||||
* 'file copy'. */
|
||||
Tcl_FSLinkProc *linkProc; /* Function to process a 'Tcl_FSLink()' call.
|
||||
* Should be implemented only if the
|
||||
* filesystem supports links (reading or
|
||||
* creating). */
|
||||
/* Called by 'Tcl_FSMatchInDirectory()'. NULL
|
||||
* if the filesystem does not support glob or
|
||||
* recursive copy. */
|
||||
Tcl_FSUtimeProc *utimeProc; /* Called by 'Tcl_FSUtime()', by 'file
|
||||
* mtime' to set (not read) times, 'file
|
||||
* atime', and the open-r/open-w/fcopy variant
|
||||
* of 'file copy'. */
|
||||
Tcl_FSLinkProc *linkProc; /* Called by 'Tcl_FSLink()'. NULL if reading or
|
||||
* creating links is not supported. */
|
||||
Tcl_FSListVolumesProc *listVolumesProc;
|
||||
/* Function to list any filesystem volumes
|
||||
* added by this filesystem. Should be
|
||||
* implemented only if the filesystem adds
|
||||
* volumes at the head of the filesystem. */
|
||||
/* Lists filesystem volumes added by this
|
||||
* filesystem. NULL if the filesystem does not
|
||||
* use volumes. */
|
||||
Tcl_FSFileAttrStringsProc *fileAttrStringsProc;
|
||||
/* Function to list all attributes strings
|
||||
* which are valid for this filesystem. If not
|
||||
* implemented the filesystem will not support
|
||||
* the 'file attributes' command. This allows
|
||||
* arbitrary additional information to be
|
||||
* attached to files in the filesystem. */
|
||||
Tcl_FSFileAttrsGetProc *fileAttrsGetProc;
|
||||
/* Function to process a
|
||||
* 'Tcl_FSFileAttrsGet()' call, used by 'file
|
||||
* attributes'. */
|
||||
Tcl_FSFileAttrsSetProc *fileAttrsSetProc;
|
||||
/* Function to process a
|
||||
* 'Tcl_FSFileAttrsSet()' call, used by 'file
|
||||
* attributes'. */
|
||||
Tcl_FSCreateDirectoryProc *createDirectoryProc;
|
||||
/* Function to process a
|
||||
* 'Tcl_FSCreateDirectory()' call. Should be
|
||||
* implemented unless the FS is read-only. */
|
||||
Tcl_FSRemoveDirectoryProc *removeDirectoryProc;
|
||||
/* Function to process a
|
||||
* 'Tcl_FSRemoveDirectory()' call. Should be
|
||||
* implemented unless the FS is read-only. */
|
||||
Tcl_FSDeleteFileProc *deleteFileProc;
|
||||
/* Function to process a 'Tcl_FSDeleteFile()'
|
||||
* call. Should be implemented unless the FS
|
||||
* is read-only. */
|
||||
Tcl_FSCopyFileProc *copyFileProc;
|
||||
/* Function to process a 'Tcl_FSCopyFile()'
|
||||
* call. If not implemented Tcl will fall back
|
||||
* on open-r, open-w and fcopy as a copying
|
||||
* mechanism, for copying actions initiated in
|
||||
* Tcl (not C). */
|
||||
Tcl_FSRenameFileProc *renameFileProc;
|
||||
/* Function to process a 'Tcl_FSRenameFile()'
|
||||
* call. If not implemented, Tcl will fall
|
||||
* back on a copy and delete mechanism, for
|
||||
* rename actions initiated in Tcl (not C). */
|
||||
Tcl_FSCopyDirectoryProc *copyDirectoryProc;
|
||||
/* Function to process a
|
||||
* 'Tcl_FSCopyDirectory()' call. If not
|
||||
* implemented, Tcl will fall back on a
|
||||
* recursive create-dir, file copy mechanism,
|
||||
* for copying actions initiated in Tcl (not
|
||||
* C). */
|
||||
Tcl_FSLstatProc *lstatProc; /* Function to process a 'Tcl_FSLstat()' call.
|
||||
* If not implemented, Tcl will attempt to use
|
||||
* the 'statProc' defined above instead. */
|
||||
Tcl_FSLoadFileProc *loadFileProc;
|
||||
/* Function to process a 'Tcl_FSLoadFile()'
|
||||
* call. If not implemented, Tcl will fall
|
||||
* back on a copy to native-temp followed by a
|
||||
* Tcl_FSLoadFile on that temporary copy. */
|
||||
Tcl_FSGetCwdProc *getCwdProc;
|
||||
/* Function to process a 'Tcl_FSGetCwd()'
|
||||
* call. Most filesystems need not implement
|
||||
* this. It will usually only be called once,
|
||||
* if 'getcwd' is called before 'chdir'. May
|
||||
* be NULL. */
|
||||
Tcl_FSChdirProc *chdirProc; /* Function to process a 'Tcl_FSChdir()' call.
|
||||
* If filesystems do not implement this, it
|
||||
* will be emulated by a series of directory
|
||||
* access checks. Otherwise, virtual
|
||||
* filesystems which do implement it need only
|
||||
* respond with a positive return result if
|
||||
* the dirName is a valid directory in their
|
||||
* filesystem. They need not remember the
|
||||
* result, since that will be automatically
|
||||
* remembered for use by GetCwd. Real
|
||||
* filesystems should carry out the correct
|
||||
* action (i.e. call the correct system
|
||||
* 'chdir' api). If not implemented, then 'cd'
|
||||
* and 'pwd' will fail inside the
|
||||
/* List all valid attributes strings. NULL if
|
||||
* the filesystem does not support the 'file
|
||||
* attributes' command. Can be used to attach
|
||||
* arbitrary additional data to files in a
|
||||
* filesystem. */
|
||||
Tcl_FSFileAttrsGetProc *fileAttrsGetProc;
|
||||
/* Called by 'Tcl_FSFileAttrsGet()' and by
|
||||
* 'file attributes'. */
|
||||
Tcl_FSFileAttrsSetProc *fileAttrsSetProc;
|
||||
/* Called by 'Tcl_FSFileAttrsSet()' and by
|
||||
* 'file attributes'. */
|
||||
Tcl_FSCreateDirectoryProc *createDirectoryProc;
|
||||
/* Called by 'Tcl_FSCreateDirectory()'. May be
|
||||
* NULL if the filesystem is read-only. */
|
||||
Tcl_FSRemoveDirectoryProc *removeDirectoryProc;
|
||||
/* Called by 'Tcl_FSRemoveDirectory()'. May be
|
||||
* NULL if the filesystem is read-only. */
|
||||
Tcl_FSDeleteFileProc *deleteFileProc;
|
||||
/* Called by 'Tcl_FSDeleteFile()' May be NULL
|
||||
* if the filesystem is is read-only. */
|
||||
Tcl_FSCopyFileProc *copyFileProc;
|
||||
/* Called by 'Tcl_FSCopyFile()'. If NULL, for
|
||||
* a copy operation at the script level (not
|
||||
* C) Tcl uses open-r, open-w and fcopy. */
|
||||
Tcl_FSRenameFileProc *renameFileProc;
|
||||
/* Called by 'Tcl_FSRenameFile()'. If NULL, for
|
||||
* a rename operation at the script level (not
|
||||
* C) Tcl performs a copy operation followed
|
||||
* by a delete operation. */
|
||||
Tcl_FSCopyDirectoryProc *copyDirectoryProc;
|
||||
/* Called by 'Tcl_FSCopyDirectory()'. If NULL,
|
||||
* for a copy operation at the script level
|
||||
* (not C) Tcl recursively creates directories
|
||||
* and copies files. */
|
||||
Tcl_FSLstatProc *lstatProc; /* Called by 'Tcl_FSLstat()'. If NULL, Tcl
|
||||
* attempts to use 'statProc' instead. */
|
||||
Tcl_FSLoadFileProc *loadFileProc;
|
||||
/* Called by 'Tcl_FSLoadFile()'. If NULL, Tcl
|
||||
* performs a copy to a temporary file in the
|
||||
* native filesystem and then calls
|
||||
* Tcl_FSLoadFile() on that temporary copy. */
|
||||
Tcl_FSGetCwdProc *getCwdProc;
|
||||
/* Called by 'Tcl_FSGetCwd()'. Normally NULL.
|
||||
* Usually only called once: If 'getcwd' is
|
||||
* called before 'chdir' is ever called. */
|
||||
Tcl_FSChdirProc *chdirProc; /* Called by 'Tcl_FSChdir()'. For a virtual
|
||||
* filesystem, chdirProc just returns zero
|
||||
* (success) if the pathname is a valid
|
||||
* directory, and some other value otherwise.
|
||||
* For A real filesystem, chdirProc performs
|
||||
* the correct action, e.g. calls the system
|
||||
* 'chdir' function. If not implemented, then
|
||||
* 'cd' and 'pwd' fail for a pathname in this
|
||||
* filesystem. On success Tcl stores the
|
||||
* pathname for use by GetCwd. If NULL, Tcl
|
||||
* performs records the pathname as the new
|
||||
* current directory if it passes a series of
|
||||
* directory access checks. */
|
||||
} Tcl_Filesystem;
|
||||
|
||||
/*
|
||||
@@ -2069,29 +2045,28 @@ typedef struct Tcl_EncodingType {
|
||||
* reset to an initial state. If the source
|
||||
* buffer contains the entire input stream to be
|
||||
* converted, this flag should be set.
|
||||
* TCL_ENCODING_STOPONERROR - If set, then the converter will return
|
||||
* immediately upon encountering an invalid byte
|
||||
* sequence or a source character that has no
|
||||
* mapping in the target encoding. If clear, then
|
||||
* the converter will skip the problem,
|
||||
* substituting one or more "close" characters in
|
||||
* the destination buffer and then continue to
|
||||
* TCL_ENCODING_STOPONERROR - If set, the converter returns immediately upon
|
||||
* encountering an invalid byte sequence or a
|
||||
* source character that has no mapping in the
|
||||
* target encoding. If clear, the converter
|
||||
* substitues the problematic character(s) with
|
||||
* one or more "close" characters in the
|
||||
* destination buffer and then continues to
|
||||
* convert the source.
|
||||
* TCL_ENCODING_NO_TERMINATE - If set, Tcl_ExternalToUtf will not append a
|
||||
* terminating NUL byte. Knowing that it will
|
||||
* not need space to do so, it will fill all
|
||||
* dstLen bytes with encoded UTF-8 content, as
|
||||
* other circumstances permit. If clear, the
|
||||
* default behavior is to reserve a byte in
|
||||
* the dst space for NUL termination, and to
|
||||
* append the NUL byte.
|
||||
* TCL_ENCODING_NO_TERMINATE - If set, Tcl_ExternalToUtf does not append a
|
||||
* terminating NUL byte. Since it does not need
|
||||
* an extra byte for a terminating NUL, it fills
|
||||
* all dstLen bytes with encoded UTF-8 content if
|
||||
* needed. If clear, a byte is reserved in the
|
||||
* dst space for NUL termination, and a
|
||||
* terminating NUL is appended.
|
||||
* TCL_ENCODING_CHAR_LIMIT - If set and dstCharsPtr is not NULL, then
|
||||
* Tcl_ExternalToUtf takes the initial value
|
||||
* of *dstCharsPtr is taken as a limit of the
|
||||
* maximum number of chars to produce in the
|
||||
* encoded UTF-8 content. Otherwise, the
|
||||
* number of chars produced is controlled only
|
||||
* by other limiting factors.
|
||||
* Tcl_ExternalToUtf takes the initial value of
|
||||
* *dstCharsPtr as a limit of the maximum number
|
||||
* of chars to produce in the encoded UTF-8
|
||||
* content. Otherwise, the number of chars
|
||||
* produced is controlled only by other limiting
|
||||
* factors.
|
||||
*/
|
||||
|
||||
#define TCL_ENCODING_START 0x01
|
||||
@@ -2135,16 +2110,15 @@ typedef struct Tcl_EncodingType {
|
||||
|
||||
/*
|
||||
* The maximum number of bytes that are necessary to represent a single
|
||||
* Unicode character in UTF-8. The valid values are 4 and 6
|
||||
* (or perhaps 1 if we want to support a non-unicode enabled core). If 4,
|
||||
* then Tcl_UniChar must be 2-bytes in size (UCS-2) (the default). If 6,
|
||||
* Unicode character in UTF-8. The valid values are 3 and 4
|
||||
* (or perhaps 1 if we want to support a non-unicode enabled core). If 3,
|
||||
* then Tcl_UniChar must be 2-bytes in size (UCS-2) (the default). If > 3,
|
||||
* then Tcl_UniChar must be 4-bytes in size (UCS-4). At this time UCS-2 mode
|
||||
* is the default and recommended mode. UCS-4 is experimental and not
|
||||
* recommended. It works for the core, but most extensions expect UCS-2.
|
||||
* is the default and recommended mode.
|
||||
*/
|
||||
|
||||
#ifndef TCL_UTF_MAX
|
||||
#define TCL_UTF_MAX 4
|
||||
#define TCL_UTF_MAX 3
|
||||
#endif
|
||||
|
||||
/*
|
||||
@@ -2152,15 +2126,11 @@ typedef struct Tcl_EncodingType {
|
||||
* reflected in regcustom.h.
|
||||
*/
|
||||
|
||||
#if TCL_UTF_MAX > 4
|
||||
#if TCL_UTF_MAX > 3
|
||||
/*
|
||||
* int isn't 100% accurate as it should be a strict 4-byte value
|
||||
* (perhaps wchar_t). 64-bit systems may have troubles. The size of this
|
||||
* value must be reflected correctly in regcustom.h and
|
||||
* in tclEncoding.c.
|
||||
* XXX: Tcl is currently UCS-2 and planning UTF-16 for the Unicode
|
||||
* XXX: string rep that Tcl_UniChar represents. Changing the size
|
||||
* XXX: of Tcl_UniChar is /not/ supported.
|
||||
* (perhaps wchar_t). ILP64/SILP64 systems may have troubles. The
|
||||
* size of this value must be reflected correctly in regcustom.h.
|
||||
*/
|
||||
typedef int Tcl_UniChar;
|
||||
#else
|
||||
@@ -2197,17 +2167,24 @@ typedef struct Tcl_Config {
|
||||
typedef void (Tcl_LimitHandlerProc) (ClientData clientData, Tcl_Interp *interp);
|
||||
typedef void (Tcl_LimitHandlerDeleteProc) (ClientData clientData);
|
||||
|
||||
#if 0
|
||||
/*
|
||||
*----------------------------------------------------------------------------
|
||||
* Override definitions for libtommath.
|
||||
* We would like to provide an anonymous structure "mp_int" here, which is
|
||||
* compatible with libtommath's "mp_int", but without duplicating anything
|
||||
* from <tommath.h> or including <tommath.h> here. But the libtommath project
|
||||
* didn't honor our request. See: <https://github.com/libtom/libtommath/pull/473>
|
||||
*
|
||||
* That's why this part is commented out, and we are using (void *) in
|
||||
* various API's in stead of the more correct (mp_int *).
|
||||
*/
|
||||
|
||||
typedef struct mp_int mp_int;
|
||||
#ifndef MP_INT_DECLARED
|
||||
#define MP_INT_DECLARED
|
||||
typedef unsigned int mp_digit;
|
||||
#define MP_DIGIT_DECLARED
|
||||
typedef unsigned TCL_WIDE_INT_TYPE mp_word;
|
||||
#define MP_WORD_DECLARED
|
||||
typedef struct mp_int mp_int;
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------------
|
||||
@@ -2342,10 +2319,10 @@ typedef int (Tcl_NRPostProc) (ClientData data[], Tcl_Interp *interp,
|
||||
/*
|
||||
*----------------------------------------------------------------------------
|
||||
* The following constant is used to test for older versions of Tcl in the
|
||||
* stubs tables. If TCL_UTF_MAX>4 use a different value.
|
||||
* stubs tables.
|
||||
*/
|
||||
|
||||
#define TCL_STUB_MAGIC ((int) 0xFCA3BACF + (TCL_UTF_MAX>4))
|
||||
#define TCL_STUB_MAGIC ((int) 0xFCA3BACF)
|
||||
|
||||
/*
|
||||
* The following function is required to be defined in all stubs aware
|
||||
@@ -2399,8 +2376,11 @@ EXTERN void Tcl_MainEx(int argc, char **argv,
|
||||
Tcl_AppInitProc *appInitProc, Tcl_Interp *interp);
|
||||
EXTERN const char * Tcl_PkgInitStubsCheck(Tcl_Interp *interp,
|
||||
const char *version, int exact);
|
||||
EXTERN void Tcl_InitSubsystems(void);
|
||||
EXTERN void Tcl_GetMemoryInfo(Tcl_DString *dsPtr);
|
||||
#ifndef _WIN32
|
||||
#ifdef _WIN32
|
||||
EXTERN int TclZipfs_AppHook(int *argc, wchar_t ***argv);
|
||||
#else
|
||||
EXTERN int TclZipfs_AppHook(int *argc, char ***argv);
|
||||
#endif
|
||||
|
||||
@@ -2482,14 +2462,7 @@ EXTERN int TclZipfs_AppHook(int *argc, char ***argv);
|
||||
# undef Tcl_IsShared
|
||||
# define Tcl_IsShared(objPtr) \
|
||||
Tcl_DbIsShared(objPtr, __FILE__, __LINE__)
|
||||
#elif (!defined(TCL_NO_DEPRECATED) && defined(USE_TCL_STUBS))
|
||||
/*
|
||||
* When compiling stub-enabled extensions without -DTCL_NO_DEPRECATED,
|
||||
* those extensions are expected to run fine with Tcl 8.6 as well.
|
||||
* This means we must continue to use macro's for the above 3 functions,
|
||||
* and the old stub entry for TclFreeObj. All other usage of TclFreeObj()
|
||||
* is forbidden now, therefore it is changed to be MODULE_SCOPE internal.
|
||||
*/
|
||||
#else
|
||||
# undef Tcl_IncrRefCount
|
||||
# define Tcl_IncrRefCount(objPtr) \
|
||||
++(objPtr)->refCount
|
||||
@@ -2502,7 +2475,7 @@ EXTERN int TclZipfs_AppHook(int *argc, char ***argv);
|
||||
do { \
|
||||
Tcl_Obj *_objPtr = (objPtr); \
|
||||
if ((_objPtr)->refCount-- <= 1) { \
|
||||
TclOldFreeObj(_objPtr); \
|
||||
TclFreeObj(_objPtr); \
|
||||
} \
|
||||
} while(0)
|
||||
# undef Tcl_IsShared
|
||||
|
||||
@@ -772,7 +772,7 @@ BBEmitInst1or4(
|
||||
|
||||
int
|
||||
Tcl_AssembleObjCmd(
|
||||
ClientData dummy, /* Not used. */
|
||||
ClientData clientData, /* clientData */
|
||||
Tcl_Interp *interp, /* Current interpreter. */
|
||||
int objc, /* Number of arguments. */
|
||||
Tcl_Obj *const objv[]) /* Argument objects. */
|
||||
@@ -782,7 +782,7 @@ Tcl_AssembleObjCmd(
|
||||
* because there needs to be one in place to execute bytecode.
|
||||
*/
|
||||
|
||||
return Tcl_NRCallObjProc(interp, TclNRAssembleObjCmd, dummy, objc, objv);
|
||||
return Tcl_NRCallObjProc(interp, TclNRAssembleObjCmd, clientData, objc, objv);
|
||||
}
|
||||
|
||||
int
|
||||
|
||||
+247
-176
File diff suppressed because it is too large
Load Diff
+41
-30
@@ -12,7 +12,7 @@
|
||||
*/
|
||||
|
||||
#include "tclInt.h"
|
||||
#include "tommath.h"
|
||||
#include "tclTomMath.h"
|
||||
|
||||
#include <math.h>
|
||||
#include <assert.h>
|
||||
@@ -370,6 +370,8 @@ Tcl_DbNewByteArrayObj(
|
||||
Tcl_SetByteArrayObj(objPtr, bytes, length);
|
||||
return objPtr;
|
||||
#else /* if not TCL_MEM_DEBUG */
|
||||
(void)file;
|
||||
(void)line;
|
||||
return Tcl_NewByteArrayObj(bytes, length);
|
||||
#endif /* TCL_MEM_DEBUG */
|
||||
}
|
||||
@@ -411,7 +413,7 @@ Tcl_SetByteArrayObj(
|
||||
if (length < 0) {
|
||||
length = 0;
|
||||
}
|
||||
byteArrayPtr = ckalloc(BYTEARRAY_SIZE(length));
|
||||
byteArrayPtr = (ByteArray *)ckalloc(BYTEARRAY_SIZE(length));
|
||||
byteArrayPtr->used = length;
|
||||
byteArrayPtr->allocated = length;
|
||||
|
||||
@@ -520,7 +522,7 @@ Tcl_SetByteArrayLength(
|
||||
|
||||
byteArrayPtr = GET_BYTEARRAY(irPtr);
|
||||
if (newLength > byteArrayPtr->allocated) {
|
||||
byteArrayPtr = ckrealloc(byteArrayPtr, BYTEARRAY_SIZE(newLength));
|
||||
byteArrayPtr = (ByteArray *)ckrealloc(byteArrayPtr, BYTEARRAY_SIZE(newLength));
|
||||
byteArrayPtr->allocated = newLength;
|
||||
SET_BYTEARRAY(irPtr, byteArrayPtr);
|
||||
}
|
||||
@@ -547,7 +549,7 @@ Tcl_SetByteArrayLength(
|
||||
|
||||
static int
|
||||
SetByteArrayFromAny(
|
||||
Tcl_Interp *interp, /* Not used. */
|
||||
Tcl_Interp *dummy, /* Not used. */
|
||||
Tcl_Obj *objPtr) /* The object to convert to type ByteArray. */
|
||||
{
|
||||
size_t length;
|
||||
@@ -557,6 +559,7 @@ SetByteArrayFromAny(
|
||||
Tcl_UniChar ch = 0;
|
||||
ByteArray *byteArrayPtr;
|
||||
Tcl_ObjIntRep ir;
|
||||
(void)dummy;
|
||||
|
||||
if (TclHasIntRep(objPtr, &properByteArrayType)) {
|
||||
return TCL_OK;
|
||||
@@ -569,7 +572,7 @@ SetByteArrayFromAny(
|
||||
length = objPtr->length;
|
||||
srcEnd = src + length;
|
||||
|
||||
byteArrayPtr = ckalloc(BYTEARRAY_SIZE(length));
|
||||
byteArrayPtr = (ByteArray *)ckalloc(BYTEARRAY_SIZE(length));
|
||||
for (dst = byteArrayPtr->bytes; src < srcEnd; ) {
|
||||
src += TclUtfToUniChar(src, &ch);
|
||||
improper = improper || (ch > 255);
|
||||
@@ -645,7 +648,7 @@ DupByteArrayInternalRep(
|
||||
srcArrayPtr = GET_BYTEARRAY(TclFetchIntRep(srcPtr, &tclByteArrayType));
|
||||
length = srcArrayPtr->used;
|
||||
|
||||
copyArrayPtr = ckalloc(BYTEARRAY_SIZE(length));
|
||||
copyArrayPtr = (ByteArray *)ckalloc(BYTEARRAY_SIZE(length));
|
||||
copyArrayPtr->used = length;
|
||||
copyArrayPtr->allocated = length;
|
||||
memcpy(copyArrayPtr->bytes, srcArrayPtr->bytes, length);
|
||||
@@ -666,7 +669,7 @@ DupProperByteArrayInternalRep(
|
||||
srcArrayPtr = GET_BYTEARRAY(TclFetchIntRep(srcPtr, &properByteArrayType));
|
||||
length = srcArrayPtr->used;
|
||||
|
||||
copyArrayPtr = ckalloc(BYTEARRAY_SIZE(length));
|
||||
copyArrayPtr = (ByteArray *)ckalloc(BYTEARRAY_SIZE(length));
|
||||
copyArrayPtr->used = length;
|
||||
copyArrayPtr->allocated = length;
|
||||
memcpy(copyArrayPtr->bytes, srcArrayPtr->bytes, length);
|
||||
@@ -809,7 +812,7 @@ TclAppendBytesToByteArray(
|
||||
*/
|
||||
|
||||
attempt = 2 * needed;
|
||||
ptr = attemptckrealloc(byteArrayPtr, BYTEARRAY_SIZE(attempt));
|
||||
ptr = (ByteArray *)attemptckrealloc(byteArrayPtr, BYTEARRAY_SIZE(attempt));
|
||||
}
|
||||
if (ptr == NULL) {
|
||||
/*
|
||||
@@ -821,7 +824,7 @@ TclAppendBytesToByteArray(
|
||||
int growth = (int) ((extra > limit) ? limit : extra);
|
||||
|
||||
attempt = needed + growth;
|
||||
ptr = attemptckrealloc(byteArrayPtr, BYTEARRAY_SIZE(attempt));
|
||||
ptr = (ByteArray *)attemptckrealloc(byteArrayPtr, BYTEARRAY_SIZE(attempt));
|
||||
}
|
||||
if (ptr == NULL) {
|
||||
/*
|
||||
@@ -829,7 +832,7 @@ TclAppendBytesToByteArray(
|
||||
*/
|
||||
|
||||
attempt = needed;
|
||||
ptr = ckrealloc(byteArrayPtr, BYTEARRAY_SIZE(attempt));
|
||||
ptr = (ByteArray *)ckrealloc(byteArrayPtr, BYTEARRAY_SIZE(attempt));
|
||||
}
|
||||
byteArrayPtr = ptr;
|
||||
byteArrayPtr->allocated = attempt;
|
||||
@@ -912,6 +915,7 @@ BinaryFormatCmd(
|
||||
const char *errorString;
|
||||
const char *errorValue, *str;
|
||||
int offset, size, length;
|
||||
(void)dummy;
|
||||
|
||||
if (objc < 2) {
|
||||
Tcl_WrongNumArgs(interp, 1, objv, "formatString ?arg ...?");
|
||||
@@ -1363,7 +1367,7 @@ BinaryFormatCmd(
|
||||
badField:
|
||||
{
|
||||
Tcl_UniChar ch = 0;
|
||||
char buf[TCL_UTF_MAX + 1] = "";
|
||||
char buf[5] = "";
|
||||
|
||||
TclUtfToUniChar(errorString, &ch);
|
||||
buf[Tcl_UniCharToUtf(ch, buf)] = '\0';
|
||||
@@ -1413,12 +1417,12 @@ BinaryScanCmd(
|
||||
unsigned char *buffer; /* Start of result buffer. */
|
||||
const char *errorString;
|
||||
const char *str;
|
||||
int offset, size, length;
|
||||
int offset, size, length, i;
|
||||
|
||||
int i;
|
||||
Tcl_Obj *valuePtr, *elementPtr;
|
||||
Tcl_HashTable numberCacheHash;
|
||||
Tcl_HashTable *numberCachePtr;
|
||||
(void)dummy;
|
||||
|
||||
if (objc < 3) {
|
||||
Tcl_WrongNumArgs(interp, 1, objv,
|
||||
@@ -1733,7 +1737,7 @@ BinaryScanCmd(
|
||||
badField:
|
||||
{
|
||||
Tcl_UniChar ch = 0;
|
||||
char buf[TCL_UTF_MAX + 1] = "";
|
||||
char buf[5] = "";
|
||||
|
||||
TclUtfToUniChar(errorString, &ch);
|
||||
buf[Tcl_UniCharToUtf(ch, buf)] = '\0';
|
||||
@@ -1946,8 +1950,8 @@ CopyNumber(
|
||||
memcpy(to, from, length);
|
||||
break;
|
||||
case 1: {
|
||||
const unsigned char *fromPtr = from;
|
||||
unsigned char *toPtr = to;
|
||||
const unsigned char *fromPtr = (const unsigned char *)from;
|
||||
unsigned char *toPtr = (unsigned char *)to;
|
||||
|
||||
switch (length) {
|
||||
case 4:
|
||||
@@ -1970,8 +1974,8 @@ CopyNumber(
|
||||
break;
|
||||
}
|
||||
case 2: {
|
||||
const unsigned char *fromPtr = from;
|
||||
unsigned char *toPtr = to;
|
||||
const unsigned char *fromPtr = (const unsigned char *)from;
|
||||
unsigned char *toPtr = (unsigned char *)to;
|
||||
|
||||
toPtr[0] = fromPtr[4];
|
||||
toPtr[1] = fromPtr[5];
|
||||
@@ -1984,8 +1988,8 @@ CopyNumber(
|
||||
break;
|
||||
}
|
||||
case 3: {
|
||||
const unsigned char *fromPtr = from;
|
||||
unsigned char *toPtr = to;
|
||||
const unsigned char *fromPtr = (const unsigned char *)from;
|
||||
unsigned char *toPtr = (unsigned char *)to;
|
||||
|
||||
toPtr[0] = fromPtr[3];
|
||||
toPtr[1] = fromPtr[2];
|
||||
@@ -2294,7 +2298,7 @@ ScanNumber(
|
||||
|
||||
hPtr = Tcl_CreateHashEntry(tablePtr, INT2PTR(value), &isNew);
|
||||
if (!isNew) {
|
||||
return Tcl_GetHashValue(hPtr);
|
||||
return (Tcl_Obj *)Tcl_GetHashValue(hPtr);
|
||||
}
|
||||
if (tablePtr->numEntries <= BINARY_SCAN_MAX_CACHE) {
|
||||
Tcl_Obj *objPtr = Tcl_NewWideIntObj(value);
|
||||
@@ -2349,8 +2353,9 @@ ScanNumber(
|
||||
Tcl_Obj *bigObj = NULL;
|
||||
mp_int big;
|
||||
|
||||
TclInitBignumFromWideUInt(&big, uwvalue);
|
||||
bigObj = Tcl_NewBignumObj(&big);
|
||||
if (mp_init_u64(&big, uwvalue) == MP_OKAY) {
|
||||
bigObj = Tcl_NewBignumObj(&big);
|
||||
}
|
||||
return bigObj;
|
||||
}
|
||||
return Tcl_NewWideIntObj((Tcl_WideInt) uwvalue);
|
||||
@@ -2416,7 +2421,7 @@ DeleteScanNumberCache(
|
||||
|
||||
hEntry = Tcl_FirstHashEntry(numberCachePtr, &search);
|
||||
while (hEntry != NULL) {
|
||||
Tcl_Obj *value = Tcl_GetHashValue(hEntry);
|
||||
Tcl_Obj *value = (Tcl_Obj *)Tcl_GetHashValue(hEntry);
|
||||
|
||||
if (value != NULL) {
|
||||
Tcl_DecrRefCount(value);
|
||||
@@ -2462,7 +2467,7 @@ DeleteScanNumberCache(
|
||||
|
||||
static int
|
||||
BinaryEncodeHex(
|
||||
ClientData clientData,
|
||||
ClientData dummy,
|
||||
Tcl_Interp *interp,
|
||||
int objc,
|
||||
Tcl_Obj *const objv[])
|
||||
@@ -2471,6 +2476,7 @@ BinaryEncodeHex(
|
||||
unsigned char *data = NULL;
|
||||
unsigned char *cursor = NULL;
|
||||
int offset = 0, count = 0;
|
||||
(void)dummy;
|
||||
|
||||
if (objc != 2) {
|
||||
Tcl_WrongNumArgs(interp, 1, objv, "data");
|
||||
@@ -2506,7 +2512,7 @@ BinaryEncodeHex(
|
||||
|
||||
static int
|
||||
BinaryDecodeHex(
|
||||
ClientData clientData,
|
||||
ClientData dummy,
|
||||
Tcl_Interp *interp,
|
||||
int objc,
|
||||
Tcl_Obj *const objv[])
|
||||
@@ -2517,6 +2523,7 @@ BinaryDecodeHex(
|
||||
int i, index, value, size, count = 0, cut = 0, strict = 0;
|
||||
enum {OPT_STRICT };
|
||||
static const char *const optStrings[] = { "-strict", NULL };
|
||||
(void)dummy;
|
||||
|
||||
if (objc < 2 || objc > 3) {
|
||||
Tcl_WrongNumArgs(interp, 1, objv, "?options? data");
|
||||
@@ -2625,7 +2632,7 @@ BinaryDecodeHex(
|
||||
|
||||
static int
|
||||
BinaryEncode64(
|
||||
ClientData clientData,
|
||||
ClientData dummy,
|
||||
Tcl_Interp *interp,
|
||||
int objc,
|
||||
Tcl_Obj *const objv[])
|
||||
@@ -2638,6 +2645,7 @@ BinaryEncode64(
|
||||
int offset, i, index, size, outindex = 0, count = 0;
|
||||
enum { OPT_MAXLEN, OPT_WRAPCHAR };
|
||||
static const char *const optStrings[] = { "-maxlen", "-wrapchar", NULL };
|
||||
(void)dummy;
|
||||
|
||||
if (objc < 2 || objc % 2 != 0) {
|
||||
Tcl_WrongNumArgs(interp, 1, objv,
|
||||
@@ -2731,7 +2739,7 @@ BinaryEncode64(
|
||||
|
||||
static int
|
||||
BinaryEncodeUu(
|
||||
ClientData clientData,
|
||||
ClientData dummy,
|
||||
Tcl_Interp *interp,
|
||||
int objc,
|
||||
Tcl_Obj *const objv[])
|
||||
@@ -2745,6 +2753,7 @@ BinaryEncodeUu(
|
||||
int wrapcharlen = sizeof(SingleNewline);
|
||||
enum { OPT_MAXLEN, OPT_WRAPCHAR };
|
||||
static const char *const optStrings[] = { "-maxlen", "-wrapchar", NULL };
|
||||
(void)dummy;
|
||||
|
||||
if (objc < 2 || objc % 2 != 0) {
|
||||
Tcl_WrongNumArgs(interp, 1, objv,
|
||||
@@ -2848,7 +2857,7 @@ BinaryEncodeUu(
|
||||
|
||||
static int
|
||||
BinaryDecodeUu(
|
||||
ClientData clientData,
|
||||
ClientData dummy,
|
||||
Tcl_Interp *interp,
|
||||
int objc,
|
||||
Tcl_Obj *const objv[])
|
||||
@@ -2860,6 +2869,7 @@ BinaryDecodeUu(
|
||||
unsigned char c;
|
||||
enum { OPT_STRICT };
|
||||
static const char *const optStrings[] = { "-strict", NULL };
|
||||
(void)dummy;
|
||||
|
||||
if (objc < 2 || objc > 3) {
|
||||
Tcl_WrongNumArgs(interp, 1, objv, "?options? data");
|
||||
@@ -3011,7 +3021,7 @@ BinaryDecodeUu(
|
||||
|
||||
static int
|
||||
BinaryDecode64(
|
||||
ClientData clientData,
|
||||
ClientData dummy,
|
||||
Tcl_Interp *interp,
|
||||
int objc,
|
||||
Tcl_Obj *const objv[])
|
||||
@@ -3024,6 +3034,7 @@ BinaryDecode64(
|
||||
int i, index, size, cut = 0, count = 0;
|
||||
enum { OPT_STRICT };
|
||||
static const char *const optStrings[] = { "-strict", NULL };
|
||||
(void)dummy;
|
||||
|
||||
if (objc < 2 || objc > 3) {
|
||||
Tcl_WrongNumArgs(interp, 1, objv, "?options? data");
|
||||
|
||||
+58
-62
@@ -131,10 +131,12 @@ static int ckallocInit = 0;
|
||||
* Prototypes for procedures defined in this file:
|
||||
*/
|
||||
|
||||
static int CheckmemCmd(ClientData clientData, Tcl_Interp *interp,
|
||||
int argc, const char *argv[]);
|
||||
static int MemoryCmd(ClientData clientData, Tcl_Interp *interp,
|
||||
int argc, const char *argv[]);
|
||||
static int CheckmemCmd(ClientData clientData,
|
||||
Tcl_Interp *interp, int objc,
|
||||
Tcl_Obj *const objv[]);
|
||||
static int MemoryCmd(ClientData clientData,
|
||||
Tcl_Interp *interp, int objc,
|
||||
Tcl_Obj *const objv[]);
|
||||
static void ValidateMemory(struct mem_header *memHeaderP,
|
||||
const char *file, int line, int nukeGuards);
|
||||
|
||||
@@ -145,7 +147,7 @@ static void ValidateMemory(struct mem_header *memHeaderP,
|
||||
*
|
||||
* Initialize the locks used by the allocator. This is only appropriate
|
||||
* to call in a single threaded environment, such as during
|
||||
* TclInitSubsystems.
|
||||
* Tcl_InitSubsystems.
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
@@ -811,8 +813,8 @@ static int
|
||||
MemoryCmd(
|
||||
ClientData clientData,
|
||||
Tcl_Interp *interp,
|
||||
int argc,
|
||||
const char *argv[])
|
||||
int objc, /* Number of arguments. */
|
||||
Tcl_Obj *const objv[]) /* Obj values of arguments. */
|
||||
{
|
||||
const char *fileName;
|
||||
FILE *fileP;
|
||||
@@ -820,20 +822,17 @@ MemoryCmd(
|
||||
int result;
|
||||
size_t len;
|
||||
|
||||
if (argc < 2) {
|
||||
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
|
||||
"wrong # args: should be \"%s option [args..]\"", argv[0]));
|
||||
if (objc < 2) {
|
||||
Tcl_WrongNumArgs(interp, 1, objv, "option [args..]");
|
||||
return TCL_ERROR;
|
||||
}
|
||||
|
||||
if (strcmp(argv[1], "active") == 0 || strcmp(argv[1], "display") == 0) {
|
||||
if (argc != 3) {
|
||||
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
|
||||
"wrong # args: should be \"%s %s file\"",
|
||||
argv[0], argv[1]));
|
||||
if (strcmp(TclGetString(objv[1]), "active") == 0 || strcmp(TclGetString(objv[1]), "display") == 0) {
|
||||
if (objc != 3) {
|
||||
Tcl_WrongNumArgs(interp, 2, objv, "file");
|
||||
return TCL_ERROR;
|
||||
}
|
||||
fileName = Tcl_TranslateFileName(interp, argv[2], &buffer);
|
||||
fileName = Tcl_TranslateFileName(interp, TclGetString(objv[2]), &buffer);
|
||||
if (fileName == NULL) {
|
||||
return TCL_ERROR;
|
||||
}
|
||||
@@ -841,23 +840,23 @@ MemoryCmd(
|
||||
Tcl_DStringFree(&buffer);
|
||||
if (result != TCL_OK) {
|
||||
Tcl_SetObjResult(interp, Tcl_ObjPrintf("error accessing %s: %s",
|
||||
argv[2], Tcl_PosixError(interp)));
|
||||
TclGetString(objv[2]), Tcl_PosixError(interp)));
|
||||
return TCL_ERROR;
|
||||
}
|
||||
return TCL_OK;
|
||||
}
|
||||
if (strcmp(argv[1],"break_on_malloc") == 0) {
|
||||
if (strcmp(TclGetString(objv[1]),"break_on_malloc") == 0) {
|
||||
int value;
|
||||
if (argc != 3) {
|
||||
if (objc != 3) {
|
||||
goto argError;
|
||||
}
|
||||
if (Tcl_GetInt(interp, argv[2], &value) != TCL_OK) {
|
||||
if (Tcl_GetIntFromObj(interp, objv[2], &value) != TCL_OK) {
|
||||
return TCL_ERROR;
|
||||
}
|
||||
break_on_malloc = (unsigned int) value;
|
||||
return TCL_OK;
|
||||
}
|
||||
if (strcmp(argv[1],"info") == 0) {
|
||||
if (strcmp(TclGetString(objv[1]),"info") == 0) {
|
||||
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
|
||||
"%-25s %10u\n%-25s %10u\n%-25s %10u\n%-25s %10" TCL_Z_MODIFIER"u\n%-25s %10u\n%-25s %10" TCL_Z_MODIFIER "u\n",
|
||||
"total mallocs", total_mallocs, "total frees", total_frees,
|
||||
@@ -867,20 +866,19 @@ MemoryCmd(
|
||||
"maximum bytes allocated", maximum_bytes_malloced));
|
||||
return TCL_OK;
|
||||
}
|
||||
if (strcmp(argv[1], "init") == 0) {
|
||||
if (argc != 3) {
|
||||
if (strcmp(TclGetString(objv[1]), "init") == 0) {
|
||||
if (objc != 3) {
|
||||
goto bad_suboption;
|
||||
}
|
||||
init_malloced_bodies = (strcmp(argv[2],"on") == 0);
|
||||
init_malloced_bodies = (strcmp(TclGetString(objv[2]),"on") == 0);
|
||||
return TCL_OK;
|
||||
}
|
||||
if (strcmp(argv[1], "objs") == 0) {
|
||||
if (argc != 3) {
|
||||
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
|
||||
"wrong # args: should be \"%s objs file\"", argv[0]));
|
||||
if (strcmp(TclGetString(objv[1]), "objs") == 0) {
|
||||
if (objc != 3) {
|
||||
Tcl_WrongNumArgs(interp, 2, objv, "file");
|
||||
return TCL_ERROR;
|
||||
}
|
||||
fileName = Tcl_TranslateFileName(interp, argv[2], &buffer);
|
||||
fileName = Tcl_TranslateFileName(interp, TclGetString(objv[2]), &buffer);
|
||||
if (fileName == NULL) {
|
||||
return TCL_ERROR;
|
||||
}
|
||||
@@ -896,13 +894,12 @@ MemoryCmd(
|
||||
Tcl_DStringFree(&buffer);
|
||||
return TCL_OK;
|
||||
}
|
||||
if (strcmp(argv[1],"onexit") == 0) {
|
||||
if (argc != 3) {
|
||||
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
|
||||
"wrong # args: should be \"%s onexit file\"", argv[0]));
|
||||
if (strcmp(TclGetString(objv[1]),"onexit") == 0) {
|
||||
if (objc != 3) {
|
||||
Tcl_WrongNumArgs(interp, 2, objv, "file");
|
||||
return TCL_ERROR;
|
||||
}
|
||||
fileName = Tcl_TranslateFileName(interp, argv[2], &buffer);
|
||||
fileName = Tcl_TranslateFileName(interp, TclGetString(objv[2]), &buffer);
|
||||
if (fileName == NULL) {
|
||||
return TCL_ERROR;
|
||||
}
|
||||
@@ -911,62 +908,59 @@ MemoryCmd(
|
||||
Tcl_DStringFree(&buffer);
|
||||
return TCL_OK;
|
||||
}
|
||||
if (strcmp(argv[1],"tag") == 0) {
|
||||
if (argc != 3) {
|
||||
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
|
||||
"wrong # args: should be \"%s tag string\"", argv[0]));
|
||||
if (strcmp(TclGetString(objv[1]),"tag") == 0) {
|
||||
if (objc != 3) {
|
||||
Tcl_WrongNumArgs(interp, 2, objv, "file");
|
||||
return TCL_ERROR;
|
||||
}
|
||||
if ((curTagPtr != NULL) && (curTagPtr->refCount == 0)) {
|
||||
TclpFree((char *) curTagPtr);
|
||||
}
|
||||
len = strlen(argv[2]);
|
||||
len = strlen(TclGetString(objv[2]));
|
||||
curTagPtr = (MemTag *) TclpAlloc(TAG_SIZE(len));
|
||||
curTagPtr->refCount = 0;
|
||||
memcpy(curTagPtr->string, argv[2], len + 1);
|
||||
memcpy(curTagPtr->string, TclGetString(objv[2]), len + 1);
|
||||
return TCL_OK;
|
||||
}
|
||||
if (strcmp(argv[1],"trace") == 0) {
|
||||
if (argc != 3) {
|
||||
if (strcmp(TclGetString(objv[1]),"trace") == 0) {
|
||||
if (objc != 3) {
|
||||
goto bad_suboption;
|
||||
}
|
||||
alloc_tracing = (strcmp(argv[2],"on") == 0);
|
||||
alloc_tracing = (strcmp(TclGetString(objv[2]),"on") == 0);
|
||||
return TCL_OK;
|
||||
}
|
||||
|
||||
if (strcmp(argv[1],"trace_on_at_malloc") == 0) {
|
||||
if (strcmp(TclGetString(objv[1]),"trace_on_at_malloc") == 0) {
|
||||
int value;
|
||||
if (argc != 3) {
|
||||
if (objc != 3) {
|
||||
goto argError;
|
||||
}
|
||||
if (Tcl_GetInt(interp, argv[2], &value) != TCL_OK) {
|
||||
if (Tcl_GetIntFromObj(interp, objv[2], &value) != TCL_OK) {
|
||||
return TCL_ERROR;
|
||||
}
|
||||
trace_on_at_malloc = value;
|
||||
return TCL_OK;
|
||||
}
|
||||
if (strcmp(argv[1],"validate") == 0) {
|
||||
if (argc != 3) {
|
||||
if (strcmp(TclGetString(objv[1]),"validate") == 0) {
|
||||
if (objc != 3) {
|
||||
goto bad_suboption;
|
||||
}
|
||||
validate_memory = (strcmp(argv[2],"on") == 0);
|
||||
validate_memory = (strcmp(TclGetString(objv[2]),"on") == 0);
|
||||
return TCL_OK;
|
||||
}
|
||||
|
||||
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
|
||||
"bad option \"%s\": should be active, break_on_malloc, info, "
|
||||
"init, objs, onexit, tag, trace, trace_on_at_malloc, or validate",
|
||||
argv[1]));
|
||||
TclGetString(objv[1])));
|
||||
return TCL_ERROR;
|
||||
|
||||
argError:
|
||||
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
|
||||
"wrong # args: should be \"%s %s count\"", argv[0], argv[1]));
|
||||
Tcl_WrongNumArgs(interp, 2, objv, "count");
|
||||
return TCL_ERROR;
|
||||
|
||||
bad_suboption:
|
||||
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
|
||||
"wrong # args: should be \"%s %s on|off\"", argv[0], argv[1]));
|
||||
Tcl_WrongNumArgs(interp, 2, objv, "on|off");
|
||||
return TCL_ERROR;
|
||||
}
|
||||
|
||||
@@ -987,21 +981,23 @@ MemoryCmd(
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
static int CheckmemCmd(ClientData clientData,
|
||||
Tcl_Interp *interp, int objc,
|
||||
Tcl_Obj *const objv[]);
|
||||
|
||||
static int
|
||||
CheckmemCmd(
|
||||
ClientData clientData, /* Not used. */
|
||||
Tcl_Interp *interp, /* Interpreter for evaluation. */
|
||||
int argc, /* Number of arguments. */
|
||||
const char *argv[]) /* String values of arguments. */
|
||||
int objc, /* Number of arguments. */
|
||||
Tcl_Obj *const objv[]) /* Obj values of arguments. */
|
||||
{
|
||||
if (argc != 2) {
|
||||
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
|
||||
"wrong # args: should be \"%s fileName\"", argv[0]));
|
||||
if (objc != 2) {
|
||||
Tcl_WrongNumArgs(interp, 1, objv, "fileName");
|
||||
return TCL_ERROR;
|
||||
}
|
||||
tclMemDumpFileName = dumpFile;
|
||||
strcpy(tclMemDumpFileName, argv[1]);
|
||||
strcpy(tclMemDumpFileName, TclGetString(objv[1]));
|
||||
return TCL_OK;
|
||||
}
|
||||
|
||||
@@ -1027,8 +1023,8 @@ Tcl_InitMemory(
|
||||
* added */
|
||||
{
|
||||
TclInitDbCkalloc();
|
||||
Tcl_CreateCommand(interp, "memory", MemoryCmd, NULL, NULL);
|
||||
Tcl_CreateCommand(interp, "checkmem", CheckmemCmd, NULL, NULL);
|
||||
Tcl_CreateObjCommand(interp, "memory", MemoryCmd, NULL, NULL);
|
||||
Tcl_CreateObjCommand(interp, "checkmem", CheckmemCmd, NULL, NULL);
|
||||
}
|
||||
|
||||
|
||||
|
||||
+31
-31
@@ -109,7 +109,7 @@ typedef struct TclDateFields {
|
||||
* Greenwich */
|
||||
Tcl_Obj *tzName; /* Time zone name */
|
||||
int julianDay; /* Julian Day Number in local time zone */
|
||||
enum {BCE=1, CE=0} era; /* Era */
|
||||
int isBce; /* 1 if BCE */
|
||||
int gregorian; /* Flag == 1 if the date is Gregorian */
|
||||
int year; /* Year of the era */
|
||||
int dayOfYear; /* Day of the year (1 January == 1) */
|
||||
@@ -275,9 +275,9 @@ TclClockInit(
|
||||
* Create the client data, which is a refcounted literal pool.
|
||||
*/
|
||||
|
||||
data = ckalloc(sizeof(ClockClientData));
|
||||
data = (ClockClientData *)ckalloc(sizeof(ClockClientData));
|
||||
data->refCount = 0;
|
||||
data->literals = ckalloc(LIT__END * sizeof(Tcl_Obj*));
|
||||
data->literals = (Tcl_Obj **)ckalloc(LIT__END * sizeof(Tcl_Obj*));
|
||||
for (i = 0; i < LIT__END; ++i) {
|
||||
data->literals[i] = Tcl_NewStringObj(literals[i], -1);
|
||||
Tcl_IncrRefCount(data->literals[i]);
|
||||
@@ -336,7 +336,7 @@ ClockConvertlocaltoutcObjCmd(
|
||||
int objc, /* Parameter count */
|
||||
Tcl_Obj *const *objv) /* Parameter vector */
|
||||
{
|
||||
ClockClientData *data = clientData;
|
||||
ClockClientData *data = (ClockClientData *)clientData;
|
||||
Tcl_Obj *const *literals = data->literals;
|
||||
Tcl_Obj *secondsObj;
|
||||
Tcl_Obj *dict;
|
||||
@@ -430,7 +430,7 @@ ClockGetdatefieldsObjCmd(
|
||||
{
|
||||
TclDateFields fields;
|
||||
Tcl_Obj *dict;
|
||||
ClockClientData *data = clientData;
|
||||
ClockClientData *data = (ClockClientData *)clientData;
|
||||
Tcl_Obj *const *literals = data->literals;
|
||||
int changeover;
|
||||
|
||||
@@ -494,7 +494,7 @@ ClockGetdatefieldsObjCmd(
|
||||
Tcl_DictObjPut(NULL, dict, literals[LIT_GREGORIAN],
|
||||
Tcl_NewWideIntObj(fields.gregorian));
|
||||
Tcl_DictObjPut(NULL, dict, literals[LIT_ERA],
|
||||
literals[fields.era ? LIT_BCE : LIT_CE]);
|
||||
literals[fields.isBce ? LIT_BCE : LIT_CE]);
|
||||
Tcl_DictObjPut(NULL, dict, literals[LIT_YEAR],
|
||||
Tcl_NewWideIntObj(fields.year));
|
||||
Tcl_DictObjPut(NULL, dict, literals[LIT_DAYOFYEAR],
|
||||
@@ -584,12 +584,12 @@ ClockGetjuliandayfromerayearmonthdayObjCmd(
|
||||
{
|
||||
TclDateFields fields;
|
||||
Tcl_Obj *dict;
|
||||
ClockClientData *data = clientData;
|
||||
ClockClientData *data = (ClockClientData *)clientData;
|
||||
Tcl_Obj *const *literals = data->literals;
|
||||
int changeover;
|
||||
int copied = 0;
|
||||
int status;
|
||||
int era = 0;
|
||||
int isBce = 0;
|
||||
|
||||
/*
|
||||
* Check params.
|
||||
@@ -600,7 +600,7 @@ ClockGetjuliandayfromerayearmonthdayObjCmd(
|
||||
return TCL_ERROR;
|
||||
}
|
||||
dict = objv[1];
|
||||
if (FetchEraField(interp, dict, literals[LIT_ERA], &era) != TCL_OK
|
||||
if (FetchEraField(interp, dict, literals[LIT_ERA], &isBce) != TCL_OK
|
||||
|| FetchIntField(interp, dict, literals[LIT_YEAR], &fields.year)
|
||||
!= TCL_OK
|
||||
|| FetchIntField(interp, dict, literals[LIT_MONTH], &fields.month)
|
||||
@@ -610,7 +610,7 @@ ClockGetjuliandayfromerayearmonthdayObjCmd(
|
||||
|| TclGetIntFromObj(interp, objv[2], &changeover) != TCL_OK) {
|
||||
return TCL_ERROR;
|
||||
}
|
||||
fields.era = era;
|
||||
fields.isBce = isBce;
|
||||
|
||||
/*
|
||||
* Get Julian day.
|
||||
@@ -668,12 +668,12 @@ ClockGetjuliandayfromerayearweekdayObjCmd(
|
||||
{
|
||||
TclDateFields fields;
|
||||
Tcl_Obj *dict;
|
||||
ClockClientData *data = clientData;
|
||||
ClockClientData *data = (ClockClientData *)clientData;
|
||||
Tcl_Obj *const *literals = data->literals;
|
||||
int changeover;
|
||||
int copied = 0;
|
||||
int status;
|
||||
int era = 0;
|
||||
int isBce = 0;
|
||||
|
||||
/*
|
||||
* Check params.
|
||||
@@ -684,7 +684,7 @@ ClockGetjuliandayfromerayearweekdayObjCmd(
|
||||
return TCL_ERROR;
|
||||
}
|
||||
dict = objv[1];
|
||||
if (FetchEraField(interp, dict, literals[LIT_ERA], &era) != TCL_OK
|
||||
if (FetchEraField(interp, dict, literals[LIT_ERA], &isBce) != TCL_OK
|
||||
|| FetchIntField(interp, dict, literals[LIT_ISO8601YEAR],
|
||||
&fields.iso8601Year) != TCL_OK
|
||||
|| FetchIntField(interp, dict, literals[LIT_ISO8601WEEK],
|
||||
@@ -694,7 +694,7 @@ ClockGetjuliandayfromerayearweekdayObjCmd(
|
||||
|| TclGetIntFromObj(interp, objv[2], &changeover) != TCL_OK) {
|
||||
return TCL_ERROR;
|
||||
}
|
||||
fields.era = era;
|
||||
fields.isBce = isBce;
|
||||
|
||||
/*
|
||||
* Get Julian day.
|
||||
@@ -1052,7 +1052,7 @@ ConvertUTCToLocalUsingC(
|
||||
time_t tock;
|
||||
struct tm *timeVal; /* Time after conversion */
|
||||
int diff; /* Time zone diff local-Greenwich */
|
||||
char buffer[8]; /* Buffer for time zone name */
|
||||
char buffer[16]; /* Buffer for time zone name */
|
||||
|
||||
/*
|
||||
* Use 'localtime' to determine local year, month, day, time of day.
|
||||
@@ -1079,7 +1079,7 @@ ConvertUTCToLocalUsingC(
|
||||
* Fill in the date in 'fields' and use it to derive Julian Day.
|
||||
*/
|
||||
|
||||
fields->era = CE;
|
||||
fields->isBce = 0;
|
||||
fields->year = timeVal->tm_year + 1900;
|
||||
fields->month = timeVal->tm_mon + 1;
|
||||
fields->dayOfMonth = timeVal->tm_mday;
|
||||
@@ -1217,7 +1217,7 @@ GetYearWeekDay(
|
||||
|
||||
temp.julianDay = fields->julianDay - 3;
|
||||
GetGregorianEraYearDay(&temp, changeover);
|
||||
if (temp.era == BCE) {
|
||||
if (temp.isBce) {
|
||||
temp.iso8601Year = temp.year - 1;
|
||||
} else {
|
||||
temp.iso8601Year = temp.year + 1;
|
||||
@@ -1233,7 +1233,7 @@ GetYearWeekDay(
|
||||
*/
|
||||
|
||||
if (fields->julianDay < temp.julianDay) {
|
||||
if (temp.era == BCE) {
|
||||
if (temp.isBce) {
|
||||
temp.iso8601Year += 1;
|
||||
} else {
|
||||
temp.iso8601Year -= 1;
|
||||
@@ -1359,10 +1359,10 @@ GetGregorianEraYearDay(
|
||||
*/
|
||||
|
||||
if (year <= 0) {
|
||||
fields->era = BCE;
|
||||
fields->isBce = 1;
|
||||
fields->year = 1 - year;
|
||||
} else {
|
||||
fields->era = CE;
|
||||
fields->isBce = 0;
|
||||
fields->year = year;
|
||||
}
|
||||
fields->dayOfYear = day + 1;
|
||||
@@ -1430,7 +1430,7 @@ GetJulianDayFromEraYearWeekDay(
|
||||
* Find January 4 in the ISO8601 year, which will always be in week 1.
|
||||
*/
|
||||
|
||||
firstWeek.era = fields->era;
|
||||
firstWeek.isBce = fields->isBce;
|
||||
firstWeek.year = fields->iso8601Year;
|
||||
firstWeek.month = 1;
|
||||
firstWeek.dayOfMonth = 4;
|
||||
@@ -1474,7 +1474,7 @@ GetJulianDayFromEraYearMonthDay(
|
||||
{
|
||||
int year, ym1, month, mm1, q, r, ym1o4, ym1o100, ym1o400;
|
||||
|
||||
if (fields->era == BCE) {
|
||||
if (fields->isBce) {
|
||||
year = 1 - fields->year;
|
||||
} else {
|
||||
year = fields->year;
|
||||
@@ -1502,10 +1502,10 @@ GetJulianDayFromEraYearMonthDay(
|
||||
|
||||
fields->gregorian = 1;
|
||||
if (year < 1) {
|
||||
fields->era = BCE;
|
||||
fields->isBce = 1;
|
||||
fields->year = 1-year;
|
||||
} else {
|
||||
fields->era = CE;
|
||||
fields->isBce = 0;
|
||||
fields->year = year;
|
||||
}
|
||||
|
||||
@@ -1513,7 +1513,7 @@ GetJulianDayFromEraYearMonthDay(
|
||||
* Try an initial conversion in the Gregorian calendar.
|
||||
*/
|
||||
|
||||
#if 0 /* BUG http://core.tcl.tk/tcl/tktview?name=da340d4f32 */
|
||||
#if 0 /* BUG https://core.tcl-lang.org/tcl/tktview?name=da340d4f32 */
|
||||
ym1o4 = ym1 / 4;
|
||||
#else
|
||||
/*
|
||||
@@ -1580,7 +1580,7 @@ IsGregorianLeapYear(
|
||||
{
|
||||
int year = fields->year;
|
||||
|
||||
if (fields->era == BCE) {
|
||||
if (fields->isBce) {
|
||||
year = 1 - year;
|
||||
}
|
||||
if (year%4 != 0) {
|
||||
@@ -1693,7 +1693,7 @@ ThreadSafeLocalTime(
|
||||
* Get a thread-local buffer to hold the returned time.
|
||||
*/
|
||||
|
||||
struct tm *tmPtr = Tcl_GetThreadData(&tmKey, sizeof(struct tm));
|
||||
struct tm *tmPtr = (struct tm *)Tcl_GetThreadData(&tmKey, sizeof(struct tm));
|
||||
#ifdef HAVE_LOCALTIME_R
|
||||
localtime_r(timePtr, tmPtr);
|
||||
#else
|
||||
@@ -1879,7 +1879,7 @@ ClockParseformatargsObjCmd(
|
||||
int objc, /* Parameter count */
|
||||
Tcl_Obj *const objv[]) /* Parameter vector */
|
||||
{
|
||||
ClockClientData *dataPtr = clientData;
|
||||
ClockClientData *dataPtr = (ClockClientData *)clientData;
|
||||
Tcl_Obj **litPtr = dataPtr->literals;
|
||||
Tcl_Obj *results[3]; /* Format, locale and timezone */
|
||||
#define formatObj results[0]
|
||||
@@ -2029,7 +2029,7 @@ ClockSecondsObjCmd(
|
||||
static void
|
||||
TzsetIfNecessary(void)
|
||||
{
|
||||
static char* tzWas = INT2PTR(-1); /* Previous value of TZ, protected by
|
||||
static char* tzWas = (char *)INT2PTR(-1); /* Previous value of TZ, protected by
|
||||
* clockMutex. */
|
||||
const char *tzIsNow; /* Current value of TZ */
|
||||
|
||||
@@ -2041,7 +2041,7 @@ TzsetIfNecessary(void)
|
||||
if (tzWas != NULL && tzWas != INT2PTR(-1)) {
|
||||
ckfree(tzWas);
|
||||
}
|
||||
tzWas = ckalloc(strlen(tzIsNow) + 1);
|
||||
tzWas = (char *)ckalloc(strlen(tzIsNow) + 1);
|
||||
strcpy(tzWas, tzIsNow);
|
||||
} else if (tzIsNow == NULL && tzWas != NULL) {
|
||||
tzset();
|
||||
@@ -2069,7 +2069,7 @@ static void
|
||||
ClockDeleteCmdProc(
|
||||
ClientData clientData) /* Opaque pointer to the client data */
|
||||
{
|
||||
ClockClientData *data = clientData;
|
||||
ClockClientData *data = (ClockClientData *)clientData;
|
||||
int i;
|
||||
|
||||
if (data->refCount-- <= 1) {
|
||||
|
||||
+101
-40
@@ -135,6 +135,8 @@ Tcl_BreakObjCmd(
|
||||
int objc, /* Number of arguments. */
|
||||
Tcl_Obj *const objv[]) /* Argument objects. */
|
||||
{
|
||||
(void)dummy;
|
||||
|
||||
if (objc != 1) {
|
||||
Tcl_WrongNumArgs(interp, 1, objv, NULL);
|
||||
return TCL_ERROR;
|
||||
@@ -173,6 +175,7 @@ Tcl_CaseObjCmd(
|
||||
const char *stringPtr, *arg;
|
||||
Tcl_Obj *const *caseObjv;
|
||||
Tcl_Obj *armPtr;
|
||||
(void)dummy;
|
||||
|
||||
if (objc < 3) {
|
||||
Tcl_WrongNumArgs(interp, 1, objv,
|
||||
@@ -317,6 +320,7 @@ TclNRCatchObjCmd(
|
||||
Tcl_Obj *varNamePtr = NULL;
|
||||
Tcl_Obj *optionVarNamePtr = NULL;
|
||||
Interp *iPtr = (Interp *) interp;
|
||||
(void)dummy;
|
||||
|
||||
if ((objc < 2) || (objc > 4)) {
|
||||
Tcl_WrongNumArgs(interp, 1, objv,
|
||||
@@ -349,8 +353,8 @@ CatchObjCmdCallback(
|
||||
{
|
||||
Interp *iPtr = (Interp *) interp;
|
||||
int objc = PTR2INT(data[0]);
|
||||
Tcl_Obj *varNamePtr = data[1];
|
||||
Tcl_Obj *optionVarNamePtr = data[2];
|
||||
Tcl_Obj *varNamePtr = (Tcl_Obj *)data[1];
|
||||
Tcl_Obj *optionVarNamePtr = (Tcl_Obj *)data[2];
|
||||
int rewind = iPtr->execEnvPtr->rewind;
|
||||
|
||||
/*
|
||||
@@ -412,6 +416,7 @@ Tcl_CdObjCmd(
|
||||
{
|
||||
Tcl_Obj *dir;
|
||||
int result;
|
||||
(void)dummy;
|
||||
|
||||
if (objc > 2) {
|
||||
Tcl_WrongNumArgs(interp, 1, objv, "?dirName?");
|
||||
@@ -466,6 +471,8 @@ Tcl_ConcatObjCmd(
|
||||
int objc, /* Number of arguments. */
|
||||
Tcl_Obj *const objv[]) /* Argument objects. */
|
||||
{
|
||||
(void)dummy;
|
||||
|
||||
if (objc >= 2) {
|
||||
Tcl_SetObjResult(interp, Tcl_ConcatObj(objc-1, objv+1));
|
||||
}
|
||||
@@ -501,6 +508,8 @@ Tcl_ContinueObjCmd(
|
||||
int objc, /* Number of arguments. */
|
||||
Tcl_Obj *const objv[]) /* Argument objects. */
|
||||
{
|
||||
(void)dummy;
|
||||
|
||||
if (objc != 1) {
|
||||
Tcl_WrongNumArgs(interp, 1, objv, NULL);
|
||||
return TCL_ERROR;
|
||||
@@ -566,6 +575,7 @@ EncodingConvertfromObjCmd(
|
||||
Tcl_Encoding encoding; /* Encoding to use */
|
||||
int length; /* Length of the byte array being converted */
|
||||
const char *bytesPtr; /* Pointer to the first byte of the array */
|
||||
(void)dummy;
|
||||
|
||||
if (objc == 2) {
|
||||
encoding = Tcl_GetEncoding(interp, NULL);
|
||||
@@ -628,6 +638,7 @@ EncodingConverttoObjCmd(
|
||||
Tcl_Encoding encoding; /* Encoding to use */
|
||||
int length; /* Length of the string being converted */
|
||||
const char *stringPtr; /* Pointer to the first byte of the string */
|
||||
(void)dummy;
|
||||
|
||||
/* TODO - ADJUST OBJ INDICES WHEN ENSEMBLIFYING THIS */
|
||||
|
||||
@@ -688,6 +699,7 @@ EncodingDirsObjCmd(
|
||||
Tcl_Obj *const objv[]) /* Argument objects. */
|
||||
{
|
||||
Tcl_Obj *dirListObj;
|
||||
(void)dummy;
|
||||
|
||||
if (objc > 2) {
|
||||
Tcl_WrongNumArgs(interp, 1, objv, "?dirList?");
|
||||
@@ -725,11 +737,14 @@ EncodingDirsObjCmd(
|
||||
*/
|
||||
|
||||
int
|
||||
EncodingNamesObjCmd(ClientData dummy, /* Unused */
|
||||
EncodingNamesObjCmd(
|
||||
ClientData dummy, /* Not used. */
|
||||
Tcl_Interp* interp, /* Tcl interpreter */
|
||||
int objc, /* Number of command line args */
|
||||
Tcl_Obj* const objv[]) /* Vector of command line args */
|
||||
{
|
||||
(void)dummy;
|
||||
|
||||
if (objc > 1) {
|
||||
Tcl_WrongNumArgs(interp, 1, objv, NULL);
|
||||
return TCL_ERROR;
|
||||
@@ -755,11 +770,14 @@ EncodingNamesObjCmd(ClientData dummy, /* Unused */
|
||||
*/
|
||||
|
||||
int
|
||||
EncodingSystemObjCmd(ClientData dummy, /* Unused */
|
||||
EncodingSystemObjCmd(
|
||||
ClientData dummy, /* Not used. */
|
||||
Tcl_Interp* interp, /* Tcl interpreter */
|
||||
int objc, /* Number of command line args */
|
||||
Tcl_Obj* const objv[]) /* Vector of command line args */
|
||||
{
|
||||
(void)dummy;
|
||||
|
||||
if (objc > 2) {
|
||||
Tcl_WrongNumArgs(interp, 1, objv, "?encoding?");
|
||||
return TCL_ERROR;
|
||||
@@ -799,6 +817,7 @@ Tcl_ErrorObjCmd(
|
||||
Tcl_Obj *const objv[]) /* Argument objects. */
|
||||
{
|
||||
Tcl_Obj *options, *optName;
|
||||
(void)dummy;
|
||||
|
||||
if ((objc < 2) || (objc > 4)) {
|
||||
Tcl_WrongNumArgs(interp, 1, objv, "message ?errorInfo? ?errorCode?");
|
||||
@@ -843,10 +862,12 @@ Tcl_ErrorObjCmd(
|
||||
/* ARGSUSED */
|
||||
static int
|
||||
EvalCmdErrMsg(
|
||||
ClientData data[],
|
||||
ClientData dummy[],
|
||||
Tcl_Interp *interp,
|
||||
int result)
|
||||
{
|
||||
(void)dummy;
|
||||
|
||||
if (result == TCL_ERROR) {
|
||||
Tcl_AppendObjToErrorInfo(interp, Tcl_ObjPrintf(
|
||||
"\n (\"eval\" body line %d)", Tcl_GetErrorLine(interp)));
|
||||
@@ -875,6 +896,7 @@ TclNREvalObjCmd(
|
||||
Interp *iPtr = (Interp *) interp;
|
||||
CmdFrame *invoker = NULL;
|
||||
int word = 0;
|
||||
(void)dummy;
|
||||
|
||||
if (objc < 2) {
|
||||
Tcl_WrongNumArgs(interp, 1, objv, "arg ?arg ...?");
|
||||
@@ -932,6 +954,7 @@ Tcl_ExitObjCmd(
|
||||
Tcl_Obj *const objv[]) /* Argument objects. */
|
||||
{
|
||||
Tcl_WideInt value;
|
||||
(void)dummy;
|
||||
|
||||
if ((objc != 1) && (objc != 2)) {
|
||||
Tcl_WrongNumArgs(interp, 1, objv, "?returnCode?");
|
||||
@@ -991,6 +1014,7 @@ TclNRExprObjCmd(
|
||||
Tcl_Obj *const objv[]) /* Argument objects. */
|
||||
{
|
||||
Tcl_Obj *resultPtr, *objPtr;
|
||||
(void)dummy;
|
||||
|
||||
if (objc < 2) {
|
||||
Tcl_WrongNumArgs(interp, 1, objv, "arg ?arg ...?");
|
||||
@@ -1016,8 +1040,8 @@ ExprCallback(
|
||||
Tcl_Interp *interp,
|
||||
int result)
|
||||
{
|
||||
Tcl_Obj *resultPtr = data[0];
|
||||
Tcl_Obj *objPtr = data[1];
|
||||
Tcl_Obj *resultPtr = (Tcl_Obj *)data[0];
|
||||
Tcl_Obj *objPtr = (Tcl_Obj *)data[1];
|
||||
|
||||
if (objPtr != NULL) {
|
||||
Tcl_DecrRefCount(objPtr);
|
||||
@@ -1121,13 +1145,14 @@ TclInitFileCmd(
|
||||
|
||||
static int
|
||||
FileAttrAccessTimeCmd(
|
||||
ClientData clientData,
|
||||
ClientData dummy,
|
||||
Tcl_Interp *interp,
|
||||
int objc,
|
||||
Tcl_Obj *const objv[])
|
||||
{
|
||||
Tcl_StatBuf buf;
|
||||
struct utimbuf tval;
|
||||
(void)dummy;
|
||||
|
||||
if (objc < 2 || objc > 3) {
|
||||
Tcl_WrongNumArgs(interp, 1, objv, "name ?time?");
|
||||
@@ -1203,13 +1228,14 @@ FileAttrAccessTimeCmd(
|
||||
|
||||
static int
|
||||
FileAttrModifyTimeCmd(
|
||||
ClientData clientData,
|
||||
ClientData dummy,
|
||||
Tcl_Interp *interp,
|
||||
int objc,
|
||||
Tcl_Obj *const objv[])
|
||||
{
|
||||
Tcl_StatBuf buf;
|
||||
struct utimbuf tval;
|
||||
(void)dummy;
|
||||
|
||||
if (objc < 2 || objc > 3) {
|
||||
Tcl_WrongNumArgs(interp, 1, objv, "name ?time?");
|
||||
@@ -1282,12 +1308,13 @@ FileAttrModifyTimeCmd(
|
||||
|
||||
static int
|
||||
FileAttrLinkStatCmd(
|
||||
ClientData clientData,
|
||||
ClientData dummy,
|
||||
Tcl_Interp *interp,
|
||||
int objc,
|
||||
Tcl_Obj *const objv[])
|
||||
{
|
||||
Tcl_StatBuf buf;
|
||||
(void)dummy;
|
||||
|
||||
if (objc != 3) {
|
||||
Tcl_WrongNumArgs(interp, 1, objv, "name varName");
|
||||
@@ -1318,12 +1345,13 @@ FileAttrLinkStatCmd(
|
||||
|
||||
static int
|
||||
FileAttrStatCmd(
|
||||
ClientData clientData,
|
||||
ClientData dummy,
|
||||
Tcl_Interp *interp,
|
||||
int objc,
|
||||
Tcl_Obj *const objv[])
|
||||
{
|
||||
Tcl_StatBuf buf;
|
||||
(void)dummy;
|
||||
|
||||
if (objc != 3) {
|
||||
Tcl_WrongNumArgs(interp, 1, objv, "name varName");
|
||||
@@ -1354,12 +1382,13 @@ FileAttrStatCmd(
|
||||
|
||||
static int
|
||||
FileAttrTypeCmd(
|
||||
ClientData clientData,
|
||||
ClientData dummy,
|
||||
Tcl_Interp *interp,
|
||||
int objc,
|
||||
Tcl_Obj *const objv[])
|
||||
{
|
||||
Tcl_StatBuf buf;
|
||||
(void)dummy;
|
||||
|
||||
if (objc != 2) {
|
||||
Tcl_WrongNumArgs(interp, 1, objv, "name");
|
||||
@@ -1392,12 +1421,13 @@ FileAttrTypeCmd(
|
||||
|
||||
static int
|
||||
FileAttrSizeCmd(
|
||||
ClientData clientData,
|
||||
ClientData dummy,
|
||||
Tcl_Interp *interp,
|
||||
int objc,
|
||||
Tcl_Obj *const objv[])
|
||||
{
|
||||
Tcl_StatBuf buf;
|
||||
(void)dummy;
|
||||
|
||||
if (objc != 2) {
|
||||
Tcl_WrongNumArgs(interp, 1, objv, "name");
|
||||
@@ -1429,13 +1459,14 @@ FileAttrSizeCmd(
|
||||
|
||||
static int
|
||||
FileAttrIsDirectoryCmd(
|
||||
ClientData clientData,
|
||||
ClientData dummy,
|
||||
Tcl_Interp *interp,
|
||||
int objc,
|
||||
Tcl_Obj *const objv[])
|
||||
{
|
||||
Tcl_StatBuf buf;
|
||||
int value = 0;
|
||||
(void)dummy;
|
||||
|
||||
if (objc != 2) {
|
||||
Tcl_WrongNumArgs(interp, 1, objv, "name");
|
||||
@@ -1467,11 +1498,13 @@ FileAttrIsDirectoryCmd(
|
||||
|
||||
static int
|
||||
FileAttrIsExecutableCmd(
|
||||
ClientData clientData,
|
||||
ClientData dummy,
|
||||
Tcl_Interp *interp,
|
||||
int objc,
|
||||
Tcl_Obj *const objv[])
|
||||
{
|
||||
(void)dummy;
|
||||
|
||||
if (objc != 2) {
|
||||
Tcl_WrongNumArgs(interp, 1, objv, "name");
|
||||
return TCL_ERROR;
|
||||
@@ -1498,11 +1531,13 @@ FileAttrIsExecutableCmd(
|
||||
|
||||
static int
|
||||
FileAttrIsExistingCmd(
|
||||
ClientData clientData,
|
||||
ClientData dummy,
|
||||
Tcl_Interp *interp,
|
||||
int objc,
|
||||
Tcl_Obj *const objv[])
|
||||
{
|
||||
(void)dummy;
|
||||
|
||||
if (objc != 2) {
|
||||
Tcl_WrongNumArgs(interp, 1, objv, "name");
|
||||
return TCL_ERROR;
|
||||
@@ -1529,13 +1564,14 @@ FileAttrIsExistingCmd(
|
||||
|
||||
static int
|
||||
FileAttrIsFileCmd(
|
||||
ClientData clientData,
|
||||
ClientData dummy,
|
||||
Tcl_Interp *interp,
|
||||
int objc,
|
||||
Tcl_Obj *const objv[])
|
||||
{
|
||||
Tcl_StatBuf buf;
|
||||
int value = 0;
|
||||
(void)dummy;
|
||||
|
||||
if (objc != 2) {
|
||||
Tcl_WrongNumArgs(interp, 1, objv, "name");
|
||||
@@ -1567,7 +1603,7 @@ FileAttrIsFileCmd(
|
||||
|
||||
static int
|
||||
FileAttrIsOwnedCmd(
|
||||
ClientData clientData,
|
||||
ClientData dummy,
|
||||
Tcl_Interp *interp,
|
||||
int objc,
|
||||
Tcl_Obj *const objv[])
|
||||
@@ -1579,6 +1615,7 @@ FileAttrIsOwnedCmd(
|
||||
Tcl_StatBuf buf;
|
||||
#endif
|
||||
int value = 0;
|
||||
(void)dummy;
|
||||
|
||||
if (objc != 2) {
|
||||
Tcl_WrongNumArgs(interp, 1, objv, "name");
|
||||
@@ -1614,11 +1651,13 @@ FileAttrIsOwnedCmd(
|
||||
|
||||
static int
|
||||
FileAttrIsReadableCmd(
|
||||
ClientData clientData,
|
||||
ClientData dummy,
|
||||
Tcl_Interp *interp,
|
||||
int objc,
|
||||
Tcl_Obj *const objv[])
|
||||
{
|
||||
(void)dummy;
|
||||
|
||||
if (objc != 2) {
|
||||
Tcl_WrongNumArgs(interp, 1, objv, "name");
|
||||
return TCL_ERROR;
|
||||
@@ -1645,11 +1684,13 @@ FileAttrIsReadableCmd(
|
||||
|
||||
static int
|
||||
FileAttrIsWritableCmd(
|
||||
ClientData clientData,
|
||||
ClientData dummy,
|
||||
Tcl_Interp *interp,
|
||||
int objc,
|
||||
Tcl_Obj *const objv[])
|
||||
{
|
||||
(void)dummy;
|
||||
|
||||
if (objc != 2) {
|
||||
Tcl_WrongNumArgs(interp, 1, objv, "name");
|
||||
return TCL_ERROR;
|
||||
@@ -1676,12 +1717,13 @@ FileAttrIsWritableCmd(
|
||||
|
||||
static int
|
||||
PathDirNameCmd(
|
||||
ClientData clientData,
|
||||
ClientData dummy,
|
||||
Tcl_Interp *interp,
|
||||
int objc,
|
||||
Tcl_Obj *const objv[])
|
||||
{
|
||||
Tcl_Obj *dirPtr;
|
||||
(void)dummy;
|
||||
|
||||
if (objc != 2) {
|
||||
Tcl_WrongNumArgs(interp, 1, objv, "name");
|
||||
@@ -1715,12 +1757,13 @@ PathDirNameCmd(
|
||||
|
||||
static int
|
||||
PathExtensionCmd(
|
||||
ClientData clientData,
|
||||
ClientData dummy,
|
||||
Tcl_Interp *interp,
|
||||
int objc,
|
||||
Tcl_Obj *const objv[])
|
||||
{
|
||||
Tcl_Obj *dirPtr;
|
||||
(void)dummy;
|
||||
|
||||
if (objc != 2) {
|
||||
Tcl_WrongNumArgs(interp, 1, objv, "name");
|
||||
@@ -1754,12 +1797,13 @@ PathExtensionCmd(
|
||||
|
||||
static int
|
||||
PathRootNameCmd(
|
||||
ClientData clientData,
|
||||
ClientData dummy,
|
||||
Tcl_Interp *interp,
|
||||
int objc,
|
||||
Tcl_Obj *const objv[])
|
||||
{
|
||||
Tcl_Obj *dirPtr;
|
||||
(void)dummy;
|
||||
|
||||
if (objc != 2) {
|
||||
Tcl_WrongNumArgs(interp, 1, objv, "name");
|
||||
@@ -1793,12 +1837,13 @@ PathRootNameCmd(
|
||||
|
||||
static int
|
||||
PathTailCmd(
|
||||
ClientData clientData,
|
||||
ClientData dummy,
|
||||
Tcl_Interp *interp,
|
||||
int objc,
|
||||
Tcl_Obj *const objv[])
|
||||
{
|
||||
Tcl_Obj *dirPtr;
|
||||
(void)dummy;
|
||||
|
||||
if (objc != 2) {
|
||||
Tcl_WrongNumArgs(interp, 1, objv, "name");
|
||||
@@ -1832,12 +1877,13 @@ PathTailCmd(
|
||||
|
||||
static int
|
||||
PathFilesystemCmd(
|
||||
ClientData clientData,
|
||||
ClientData dummy,
|
||||
Tcl_Interp *interp,
|
||||
int objc,
|
||||
Tcl_Obj *const objv[])
|
||||
{
|
||||
Tcl_Obj *fsInfo;
|
||||
(void)dummy;
|
||||
|
||||
if (objc != 2) {
|
||||
Tcl_WrongNumArgs(interp, 1, objv, "name");
|
||||
@@ -1873,11 +1919,13 @@ PathFilesystemCmd(
|
||||
|
||||
static int
|
||||
PathJoinCmd(
|
||||
ClientData clientData,
|
||||
ClientData dummy,
|
||||
Tcl_Interp *interp,
|
||||
int objc,
|
||||
Tcl_Obj *const objv[])
|
||||
{
|
||||
(void)dummy;
|
||||
|
||||
if (objc < 2) {
|
||||
Tcl_WrongNumArgs(interp, 1, objv, "name ?name ...?");
|
||||
return TCL_ERROR;
|
||||
@@ -1905,12 +1953,13 @@ PathJoinCmd(
|
||||
|
||||
static int
|
||||
PathNativeNameCmd(
|
||||
ClientData clientData,
|
||||
ClientData dummy,
|
||||
Tcl_Interp *interp,
|
||||
int objc,
|
||||
Tcl_Obj *const objv[])
|
||||
{
|
||||
Tcl_DString ds;
|
||||
(void)dummy;
|
||||
|
||||
if (objc != 2) {
|
||||
Tcl_WrongNumArgs(interp, 1, objv, "name");
|
||||
@@ -1942,12 +1991,13 @@ PathNativeNameCmd(
|
||||
|
||||
static int
|
||||
PathNormalizeCmd(
|
||||
ClientData clientData,
|
||||
ClientData dummy,
|
||||
Tcl_Interp *interp,
|
||||
int objc,
|
||||
Tcl_Obj *const objv[])
|
||||
{
|
||||
Tcl_Obj *fileName;
|
||||
(void)dummy;
|
||||
|
||||
if (objc != 2) {
|
||||
Tcl_WrongNumArgs(interp, 1, objv, "name");
|
||||
@@ -1980,12 +2030,13 @@ PathNormalizeCmd(
|
||||
|
||||
static int
|
||||
PathSplitCmd(
|
||||
ClientData clientData,
|
||||
ClientData dummy,
|
||||
Tcl_Interp *interp,
|
||||
int objc,
|
||||
Tcl_Obj *const objv[])
|
||||
{
|
||||
Tcl_Obj *res;
|
||||
(void)dummy;
|
||||
|
||||
if (objc != 2) {
|
||||
Tcl_WrongNumArgs(interp, 1, objv, "name");
|
||||
@@ -2023,12 +2074,13 @@ PathSplitCmd(
|
||||
|
||||
static int
|
||||
PathTypeCmd(
|
||||
ClientData clientData,
|
||||
ClientData dummy,
|
||||
Tcl_Interp *interp,
|
||||
int objc,
|
||||
Tcl_Obj *const objv[])
|
||||
{
|
||||
Tcl_Obj *typeName;
|
||||
(void)dummy;
|
||||
|
||||
if (objc != 2) {
|
||||
Tcl_WrongNumArgs(interp, 1, objv, "name");
|
||||
@@ -2071,11 +2123,13 @@ PathTypeCmd(
|
||||
|
||||
static int
|
||||
FilesystemSeparatorCmd(
|
||||
ClientData clientData,
|
||||
ClientData dummy,
|
||||
Tcl_Interp *interp,
|
||||
int objc,
|
||||
Tcl_Obj *const objv[])
|
||||
{
|
||||
(void)dummy;
|
||||
|
||||
if (objc < 1 || objc > 2) {
|
||||
Tcl_WrongNumArgs(interp, 1, objv, "?name?");
|
||||
return TCL_ERROR;
|
||||
@@ -2126,11 +2180,13 @@ FilesystemSeparatorCmd(
|
||||
|
||||
static int
|
||||
FilesystemVolumesCmd(
|
||||
ClientData clientData,
|
||||
ClientData dummy,
|
||||
Tcl_Interp *interp,
|
||||
int objc,
|
||||
Tcl_Obj *const objv[])
|
||||
{
|
||||
(void)dummy;
|
||||
|
||||
if (objc != 1) {
|
||||
Tcl_WrongNumArgs(interp, 1, objv, NULL);
|
||||
return TCL_ERROR;
|
||||
@@ -2404,6 +2460,7 @@ TclNRForObjCmd(
|
||||
{
|
||||
Interp *iPtr = (Interp *) interp;
|
||||
ForIterData *iterPtr;
|
||||
(void)dummy;
|
||||
|
||||
if (objc != 5) {
|
||||
Tcl_WrongNumArgs(interp, 1, objv, "start test next command");
|
||||
@@ -2432,7 +2489,7 @@ ForSetupCallback(
|
||||
Tcl_Interp *interp,
|
||||
int result)
|
||||
{
|
||||
ForIterData *iterPtr = data[0];
|
||||
ForIterData *iterPtr = (ForIterData *)data[0];
|
||||
|
||||
if (result != TCL_OK) {
|
||||
if (result == TCL_ERROR) {
|
||||
@@ -2451,7 +2508,7 @@ TclNRForIterCallback(
|
||||
Tcl_Interp *interp,
|
||||
int result)
|
||||
{
|
||||
ForIterData *iterPtr = data[0];
|
||||
ForIterData *iterPtr = (ForIterData *)data[0];
|
||||
Tcl_Obj *boolObj;
|
||||
|
||||
switch (result) {
|
||||
@@ -2487,8 +2544,8 @@ ForCondCallback(
|
||||
int result)
|
||||
{
|
||||
Interp *iPtr = (Interp *) interp;
|
||||
ForIterData *iterPtr = data[0];
|
||||
Tcl_Obj *boolObj = data[1];
|
||||
ForIterData *iterPtr = (ForIterData *)data[0];
|
||||
Tcl_Obj *boolObj = (Tcl_Obj *)data[1];
|
||||
int value;
|
||||
|
||||
if (result != TCL_OK) {
|
||||
@@ -2525,7 +2582,7 @@ ForNextCallback(
|
||||
int result)
|
||||
{
|
||||
Interp *iPtr = (Interp *) interp;
|
||||
ForIterData *iterPtr = data[0];
|
||||
ForIterData *iterPtr = (ForIterData *)data[0];
|
||||
Tcl_Obj *next = iterPtr->next;
|
||||
|
||||
if ((result == TCL_OK) || (result == TCL_CONTINUE)) {
|
||||
@@ -2549,7 +2606,7 @@ ForPostNextCallback(
|
||||
Tcl_Interp *interp,
|
||||
int result)
|
||||
{
|
||||
ForIterData *iterPtr = data[0];
|
||||
ForIterData *iterPtr = (ForIterData *)data[0];
|
||||
|
||||
if ((result != TCL_BREAK) && (result != TCL_OK)) {
|
||||
if (result == TCL_ERROR) {
|
||||
@@ -2597,6 +2654,8 @@ TclNRForeachCmd(
|
||||
int objc,
|
||||
Tcl_Obj *const objv[])
|
||||
{
|
||||
(void)dummy;
|
||||
|
||||
return EachloopCmd(interp, TCL_EACH_KEEP_NONE, objc, objv);
|
||||
}
|
||||
|
||||
@@ -2617,6 +2676,7 @@ TclNRLmapCmd(
|
||||
int objc,
|
||||
Tcl_Obj *const objv[])
|
||||
{
|
||||
(void)dummy;
|
||||
return EachloopCmd(interp, TCL_EACH_COLLECT, objc, objv);
|
||||
}
|
||||
|
||||
@@ -2654,7 +2714,7 @@ EachloopCmd(
|
||||
* allocation for better performance.
|
||||
*/
|
||||
|
||||
statePtr = TclStackAlloc(interp,
|
||||
statePtr = (struct ForeachState *)TclStackAlloc(interp,
|
||||
sizeof(struct ForeachState) + 3 * numLists * sizeof(int)
|
||||
+ 2 * numLists * (sizeof(Tcl_Obj **) + sizeof(Tcl_Obj *)));
|
||||
memset(statePtr, 0,
|
||||
@@ -2755,7 +2815,7 @@ ForeachLoopStep(
|
||||
Tcl_Interp *interp,
|
||||
int result)
|
||||
{
|
||||
struct ForeachState *statePtr = data[0];
|
||||
struct ForeachState *statePtr = (struct ForeachState *)data[0];
|
||||
|
||||
/*
|
||||
* Process the result code from this run of the [foreach] body. Note that
|
||||
@@ -2906,6 +2966,7 @@ Tcl_FormatObjCmd(
|
||||
Tcl_Obj *const objv[]) /* Argument objects. */
|
||||
{
|
||||
Tcl_Obj *resultPtr; /* Where result is stored finally. */
|
||||
(void)dummy;
|
||||
|
||||
if (objc < 2) {
|
||||
Tcl_WrongNumArgs(interp, 1, objv, "formatString ?arg ...?");
|
||||
|
||||
+91
-32
@@ -222,6 +222,7 @@ TclNRIfObjCmd(
|
||||
Tcl_Obj *const objv[]) /* Argument objects. */
|
||||
{
|
||||
Tcl_Obj *boolObj;
|
||||
(void)dummy;
|
||||
|
||||
if (objc <= 1) {
|
||||
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
|
||||
@@ -251,9 +252,9 @@ IfConditionCallback(
|
||||
{
|
||||
Interp *iPtr = (Interp *) interp;
|
||||
int objc = PTR2INT(data[0]);
|
||||
Tcl_Obj *const *objv = data[1];
|
||||
Tcl_Obj *const *objv = (Tcl_Obj *const *)data[1];
|
||||
int i = PTR2INT(data[2]);
|
||||
Tcl_Obj *boolObj = data[3];
|
||||
Tcl_Obj *boolObj = (Tcl_Obj *)data[3];
|
||||
int value, thenScriptIndex = 0;
|
||||
const char *clause;
|
||||
|
||||
@@ -395,6 +396,7 @@ Tcl_IncrObjCmd(
|
||||
Tcl_Obj *const objv[]) /* Argument objects. */
|
||||
{
|
||||
Tcl_Obj *newValuePtr, *incrPtr;
|
||||
(void)dummy;
|
||||
|
||||
if ((objc != 2) && (objc != 3)) {
|
||||
Tcl_WrongNumArgs(interp, 1, objv, "varName ?increment?");
|
||||
@@ -480,6 +482,7 @@ InfoArgsCmd(
|
||||
Proc *procPtr;
|
||||
CompiledLocal *localPtr;
|
||||
Tcl_Obj *listObjPtr;
|
||||
(void)dummy;
|
||||
|
||||
if (objc != 2) {
|
||||
Tcl_WrongNumArgs(interp, 1, objv, "procname");
|
||||
@@ -542,6 +545,7 @@ InfoBodyCmd(
|
||||
const char *name, *bytes;
|
||||
Proc *procPtr;
|
||||
int numBytes;
|
||||
(void)dummy;
|
||||
|
||||
if (objc != 2) {
|
||||
Tcl_WrongNumArgs(interp, 1, objv, "procname");
|
||||
@@ -600,6 +604,7 @@ InfoCmdCountCmd(
|
||||
Tcl_Obj *const objv[]) /* Argument objects. */
|
||||
{
|
||||
Interp *iPtr = (Interp *) interp;
|
||||
(void)dummy;
|
||||
|
||||
if (objc != 1) {
|
||||
Tcl_WrongNumArgs(interp, 1, objv, NULL);
|
||||
@@ -652,6 +657,7 @@ InfoCommandsCmd(
|
||||
int specificNsInPattern = 0;/* Init. to avoid compiler warning. */
|
||||
Tcl_Command cmd;
|
||||
int i;
|
||||
(void)dummy;
|
||||
|
||||
/*
|
||||
* Get the pattern and find the "effective namespace" in which to list
|
||||
@@ -711,11 +717,11 @@ InfoCommandsCmd(
|
||||
entryPtr = Tcl_FindHashEntry(&nsPtr->cmdTable, simplePattern);
|
||||
if (entryPtr != NULL) {
|
||||
if (specificNsInPattern) {
|
||||
cmd = Tcl_GetHashValue(entryPtr);
|
||||
cmd = (Tcl_Command)Tcl_GetHashValue(entryPtr);
|
||||
elemObjPtr = Tcl_NewObj();
|
||||
Tcl_GetCommandFullName(interp, cmd, elemObjPtr);
|
||||
} else {
|
||||
cmdName = Tcl_GetHashKey(&nsPtr->cmdTable, entryPtr);
|
||||
cmdName = (const char *)Tcl_GetHashKey(&nsPtr->cmdTable, entryPtr);
|
||||
elemObjPtr = Tcl_NewStringObj(cmdName, -1);
|
||||
}
|
||||
Tcl_ListObjAppendElement(interp, listPtr, elemObjPtr);
|
||||
@@ -742,7 +748,7 @@ InfoCommandsCmd(
|
||||
entryPtr = Tcl_FindHashEntry(tablePtr, simplePattern);
|
||||
}
|
||||
if (entryPtr != NULL) {
|
||||
cmdName = Tcl_GetHashKey(tablePtr, entryPtr);
|
||||
cmdName = (const char *)Tcl_GetHashKey(tablePtr, entryPtr);
|
||||
Tcl_ListObjAppendElement(interp, listPtr,
|
||||
Tcl_NewStringObj(cmdName, -1));
|
||||
Tcl_SetObjResult(interp, listPtr);
|
||||
@@ -758,11 +764,11 @@ InfoCommandsCmd(
|
||||
|
||||
entryPtr = Tcl_FirstHashEntry(&nsPtr->cmdTable, &search);
|
||||
while (entryPtr != NULL) {
|
||||
cmdName = Tcl_GetHashKey(&nsPtr->cmdTable, entryPtr);
|
||||
cmdName = (const char *)Tcl_GetHashKey(&nsPtr->cmdTable, entryPtr);
|
||||
if ((simplePattern == NULL)
|
||||
|| Tcl_StringMatch(cmdName, simplePattern)) {
|
||||
if (specificNsInPattern) {
|
||||
cmd = Tcl_GetHashValue(entryPtr);
|
||||
cmd = (Tcl_Command)Tcl_GetHashValue(entryPtr);
|
||||
elemObjPtr = Tcl_NewObj();
|
||||
Tcl_GetCommandFullName(interp, cmd, elemObjPtr);
|
||||
} else {
|
||||
@@ -784,7 +790,7 @@ InfoCommandsCmd(
|
||||
if ((nsPtr != globalNsPtr) && !specificNsInPattern) {
|
||||
entryPtr = Tcl_FirstHashEntry(&globalNsPtr->cmdTable, &search);
|
||||
while (entryPtr != NULL) {
|
||||
cmdName = Tcl_GetHashKey(&globalNsPtr->cmdTable, entryPtr);
|
||||
cmdName = (const char *)Tcl_GetHashKey(&globalNsPtr->cmdTable, entryPtr);
|
||||
if ((simplePattern == NULL)
|
||||
|| Tcl_StringMatch(cmdName, simplePattern)) {
|
||||
if (Tcl_FindHashEntry(&nsPtr->cmdTable,cmdName) == NULL) {
|
||||
@@ -815,7 +821,7 @@ InfoCommandsCmd(
|
||||
|
||||
entryPtr = Tcl_FirstHashEntry(&nsPtr->cmdTable, &search);
|
||||
while (entryPtr != NULL) {
|
||||
cmdName = Tcl_GetHashKey(&nsPtr->cmdTable, entryPtr);
|
||||
cmdName = (const char *)Tcl_GetHashKey(&nsPtr->cmdTable, entryPtr);
|
||||
if ((simplePattern == NULL)
|
||||
|| Tcl_StringMatch(cmdName, simplePattern)) {
|
||||
elemObjPtr = Tcl_NewStringObj(cmdName, -1);
|
||||
@@ -841,7 +847,7 @@ InfoCommandsCmd(
|
||||
}
|
||||
entryPtr = Tcl_FirstHashEntry(&pathNsPtr->cmdTable, &search);
|
||||
while (entryPtr != NULL) {
|
||||
cmdName = Tcl_GetHashKey(&pathNsPtr->cmdTable, entryPtr);
|
||||
cmdName = (const char *)Tcl_GetHashKey(&pathNsPtr->cmdTable, entryPtr);
|
||||
if ((simplePattern == NULL)
|
||||
|| Tcl_StringMatch(cmdName, simplePattern)) {
|
||||
elemObjPtr = Tcl_NewStringObj(cmdName, -1);
|
||||
@@ -868,7 +874,7 @@ InfoCommandsCmd(
|
||||
if (!foundGlobal) {
|
||||
entryPtr = Tcl_FirstHashEntry(&globalNsPtr->cmdTable, &search);
|
||||
while (entryPtr != NULL) {
|
||||
cmdName = Tcl_GetHashKey(&globalNsPtr->cmdTable, entryPtr);
|
||||
cmdName = (const char *)Tcl_GetHashKey(&globalNsPtr->cmdTable, entryPtr);
|
||||
if ((simplePattern == NULL)
|
||||
|| Tcl_StringMatch(cmdName, simplePattern)) {
|
||||
elemObjPtr = Tcl_NewStringObj(cmdName, -1);
|
||||
@@ -918,6 +924,8 @@ InfoCompleteCmd(
|
||||
int objc, /* Number of arguments. */
|
||||
Tcl_Obj *const objv[]) /* Argument objects. */
|
||||
{
|
||||
(void)dummy;
|
||||
|
||||
if (objc != 2) {
|
||||
Tcl_WrongNumArgs(interp, 1, objv, "command");
|
||||
return TCL_ERROR;
|
||||
@@ -960,6 +968,7 @@ InfoDefaultCmd(
|
||||
Proc *procPtr;
|
||||
CompiledLocal *localPtr;
|
||||
Tcl_Obj *valueObjPtr;
|
||||
(void)dummy;
|
||||
|
||||
if (objc != 4) {
|
||||
Tcl_WrongNumArgs(interp, 1, objv, "procname arg varname");
|
||||
@@ -1039,6 +1048,7 @@ InfoErrorStackCmd(
|
||||
{
|
||||
Tcl_Interp *target;
|
||||
Interp *iPtr;
|
||||
(void)dummy;
|
||||
|
||||
if ((objc != 1) && (objc != 2)) {
|
||||
Tcl_WrongNumArgs(interp, 1, objv, "?interp?");
|
||||
@@ -1088,6 +1098,7 @@ TclInfoExistsCmd(
|
||||
{
|
||||
const char *varName;
|
||||
Var *varPtr;
|
||||
(void)dummy;
|
||||
|
||||
if (objc != 2) {
|
||||
Tcl_WrongNumArgs(interp, 1, objv, "varName");
|
||||
@@ -1136,6 +1147,7 @@ InfoFrameCmd(
|
||||
CmdFrame *framePtr, **cmdFramePtrPtr = &iPtr->cmdFramePtr;
|
||||
CoroutineData *corPtr = iPtr->execEnvPtr->corPtr;
|
||||
int topLevel = 0;
|
||||
(void)dummy;
|
||||
|
||||
if (objc > 2) {
|
||||
Tcl_WrongNumArgs(interp, 1, objv, "?number?");
|
||||
@@ -1313,7 +1325,7 @@ TclInfoFrame(
|
||||
* Execution of bytecode. Talk to the BC engine to fill out the frame.
|
||||
*/
|
||||
|
||||
CmdFrame *fPtr = TclStackAlloc(interp, sizeof(CmdFrame));
|
||||
CmdFrame *fPtr = (CmdFrame *)TclStackAlloc(interp, sizeof(CmdFrame));
|
||||
|
||||
*fPtr = *framePtr;
|
||||
|
||||
@@ -1395,7 +1407,7 @@ TclInfoFrame(
|
||||
procNameObj);
|
||||
ADD_PAIR("proc", procNameObj);
|
||||
} else if (procPtr->cmdPtr->clientData) {
|
||||
ExtraFrameInfo *efiPtr = procPtr->cmdPtr->clientData;
|
||||
ExtraFrameInfo *efiPtr = (ExtraFrameInfo *)procPtr->cmdPtr->clientData;
|
||||
int i;
|
||||
|
||||
/*
|
||||
@@ -1409,7 +1421,7 @@ TclInfoFrame(
|
||||
lv[lc++] =
|
||||
efiPtr->fields[i].proc(efiPtr->fields[i].clientData);
|
||||
} else {
|
||||
lv[lc++] = efiPtr->fields[i].clientData;
|
||||
lv[lc++] = (Tcl_Obj *)efiPtr->fields[i].clientData;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1473,6 +1485,7 @@ InfoFunctionsCmd(
|
||||
{
|
||||
Tcl_Obj *script;
|
||||
int code;
|
||||
(void)dummy;
|
||||
|
||||
if (objc > 2) {
|
||||
Tcl_WrongNumArgs(interp, 1, objv, "?pattern?");
|
||||
@@ -1537,6 +1550,7 @@ InfoHostnameCmd(
|
||||
Tcl_Obj *const objv[]) /* Argument objects. */
|
||||
{
|
||||
const char *name;
|
||||
(void)dummy;
|
||||
|
||||
if (objc != 1) {
|
||||
Tcl_WrongNumArgs(interp, 1, objv, NULL);
|
||||
@@ -1583,6 +1597,7 @@ InfoLevelCmd(
|
||||
Tcl_Obj *const objv[]) /* Argument objects. */
|
||||
{
|
||||
Interp *iPtr = (Interp *) interp;
|
||||
(void)dummy;
|
||||
|
||||
if (objc == 1) { /* Just "info level" */
|
||||
Tcl_SetObjResult(interp, Tcl_NewWideIntObj(iPtr->varFramePtr->level));
|
||||
@@ -1657,6 +1672,7 @@ InfoLibraryCmd(
|
||||
Tcl_Obj *const objv[]) /* Argument objects. */
|
||||
{
|
||||
const char *libDirName;
|
||||
(void)dummy;
|
||||
|
||||
if (objc != 1) {
|
||||
Tcl_WrongNumArgs(interp, 1, objv, NULL);
|
||||
@@ -1704,6 +1720,7 @@ InfoLoadedCmd(
|
||||
Tcl_Obj *const objv[]) /* Argument objects. */
|
||||
{
|
||||
const char *interpName, *packageName;
|
||||
(void)dummy;
|
||||
|
||||
if (objc > 3) {
|
||||
Tcl_WrongNumArgs(interp, 1, objv, "?interp? ?packageName?");
|
||||
@@ -1751,6 +1768,8 @@ InfoNameOfExecutableCmd(
|
||||
int objc, /* Number of arguments. */
|
||||
Tcl_Obj *const objv[]) /* Argument objects. */
|
||||
{
|
||||
(void)dummy;
|
||||
|
||||
if (objc != 1) {
|
||||
Tcl_WrongNumArgs(interp, 1, objv, NULL);
|
||||
return TCL_ERROR;
|
||||
@@ -1788,6 +1807,7 @@ InfoPatchLevelCmd(
|
||||
Tcl_Obj *const objv[]) /* Argument objects. */
|
||||
{
|
||||
const char *patchlevel;
|
||||
(void)dummy;
|
||||
|
||||
if (objc != 1) {
|
||||
Tcl_WrongNumArgs(interp, 1, objv, NULL);
|
||||
@@ -1846,6 +1866,7 @@ InfoProcsCmd(
|
||||
Tcl_HashEntry *entryPtr;
|
||||
Tcl_HashSearch search;
|
||||
Command *cmdPtr, *realCmdPtr;
|
||||
(void)dummy;
|
||||
|
||||
/*
|
||||
* Get the pattern and find the "effective namespace" in which to list
|
||||
@@ -1895,7 +1916,7 @@ InfoProcsCmd(
|
||||
if (simplePattern != NULL && TclMatchIsTrivial(simplePattern)) {
|
||||
entryPtr = Tcl_FindHashEntry(&nsPtr->cmdTable, simplePattern);
|
||||
if (entryPtr != NULL) {
|
||||
cmdPtr = Tcl_GetHashValue(entryPtr);
|
||||
cmdPtr = (Command *)Tcl_GetHashValue(entryPtr);
|
||||
|
||||
if (!TclIsProc(cmdPtr)) {
|
||||
realCmdPtr = (Command *)
|
||||
@@ -1920,10 +1941,10 @@ InfoProcsCmd(
|
||||
{
|
||||
entryPtr = Tcl_FirstHashEntry(&nsPtr->cmdTable, &search);
|
||||
while (entryPtr != NULL) {
|
||||
cmdName = Tcl_GetHashKey(&nsPtr->cmdTable, entryPtr);
|
||||
cmdName = (const char *)Tcl_GetHashKey(&nsPtr->cmdTable, entryPtr);
|
||||
if ((simplePattern == NULL)
|
||||
|| Tcl_StringMatch(cmdName, simplePattern)) {
|
||||
cmdPtr = Tcl_GetHashValue(entryPtr);
|
||||
cmdPtr = (Command *)Tcl_GetHashValue(entryPtr);
|
||||
|
||||
if (!TclIsProc(cmdPtr)) {
|
||||
realCmdPtr = (Command *)
|
||||
@@ -1966,11 +1987,11 @@ InfoProcsCmd(
|
||||
if ((nsPtr != globalNsPtr) && !specificNsInPattern) {
|
||||
entryPtr = Tcl_FirstHashEntry(&globalNsPtr->cmdTable, &search);
|
||||
while (entryPtr != NULL) {
|
||||
cmdName = Tcl_GetHashKey(&globalNsPtr->cmdTable, entryPtr);
|
||||
cmdName = (const char *)Tcl_GetHashKey(&globalNsPtr->cmdTable, entryPtr);
|
||||
if ((simplePattern == NULL)
|
||||
|| Tcl_StringMatch(cmdName, simplePattern)) {
|
||||
if (Tcl_FindHashEntry(&nsPtr->cmdTable,cmdName) == NULL) {
|
||||
cmdPtr = Tcl_GetHashValue(entryPtr);
|
||||
cmdPtr = (Command *)Tcl_GetHashValue(entryPtr);
|
||||
realCmdPtr = (Command *) TclGetOriginalCommand(
|
||||
(Tcl_Command) cmdPtr);
|
||||
|
||||
@@ -2022,6 +2043,8 @@ InfoScriptCmd(
|
||||
Tcl_Obj *const objv[]) /* Argument objects. */
|
||||
{
|
||||
Interp *iPtr = (Interp *) interp;
|
||||
(void)dummy;
|
||||
|
||||
if ((objc != 1) && (objc != 2)) {
|
||||
Tcl_WrongNumArgs(interp, 1, objv, "?filename?");
|
||||
return TCL_ERROR;
|
||||
@@ -2068,6 +2091,8 @@ InfoSharedlibCmd(
|
||||
int objc, /* Number of arguments. */
|
||||
Tcl_Obj *const objv[]) /* Argument objects. */
|
||||
{
|
||||
(void)dummy;
|
||||
|
||||
if (objc != 1) {
|
||||
Tcl_WrongNumArgs(interp, 1, objv, NULL);
|
||||
return TCL_ERROR;
|
||||
@@ -2107,6 +2132,7 @@ InfoTclVersionCmd(
|
||||
Tcl_Obj *const objv[]) /* Argument objects. */
|
||||
{
|
||||
Tcl_Obj *version;
|
||||
(void)dummy;
|
||||
|
||||
if (objc != 1) {
|
||||
Tcl_WrongNumArgs(interp, 1, objv, NULL);
|
||||
@@ -2150,6 +2176,7 @@ InfoCmdTypeCmd(
|
||||
Tcl_Obj *const objv[]) /* Argument objects. */
|
||||
{
|
||||
Tcl_Command command;
|
||||
(void)dummy;
|
||||
|
||||
if (objc != 2) {
|
||||
Tcl_WrongNumArgs(interp, 1, objv, "commandName");
|
||||
@@ -2202,6 +2229,7 @@ Tcl_JoinObjCmd(
|
||||
{
|
||||
int length, listLen;
|
||||
Tcl_Obj *resObjPtr = NULL, *joinObjPtr, **elemPtrs;
|
||||
(void)dummy;
|
||||
|
||||
if ((objc < 2) || (objc > 3)) {
|
||||
Tcl_WrongNumArgs(interp, 1, objv, "list ?joinString?");
|
||||
@@ -2289,6 +2317,7 @@ Tcl_LassignObjCmd(
|
||||
Tcl_Obj **listObjv; /* The contents of the list. */
|
||||
int listObjc; /* The length of the list. */
|
||||
int code = TCL_OK;
|
||||
(void)dummy;
|
||||
|
||||
if (objc < 2) {
|
||||
Tcl_WrongNumArgs(interp, 1, objv, "list ?varName ...?");
|
||||
@@ -2359,8 +2388,8 @@ Tcl_LindexObjCmd(
|
||||
int objc, /* Number of arguments. */
|
||||
Tcl_Obj *const objv[]) /* Argument objects. */
|
||||
{
|
||||
|
||||
Tcl_Obj *elemPtr; /* Pointer to the element being extracted. */
|
||||
(void)dummy;
|
||||
|
||||
if (objc < 2) {
|
||||
Tcl_WrongNumArgs(interp, 1, objv, "list ?index ...?");
|
||||
@@ -2420,6 +2449,7 @@ Tcl_LinsertObjCmd(
|
||||
{
|
||||
Tcl_Obj *listPtr;
|
||||
int index, len, result;
|
||||
(void)dummy;
|
||||
|
||||
if (objc < 3) {
|
||||
Tcl_WrongNumArgs(interp, 1, objv, "list index ?element ...?");
|
||||
@@ -2501,6 +2531,7 @@ Tcl_ListObjCmd(
|
||||
Tcl_Obj *const objv[])
|
||||
/* The argument objects. */
|
||||
{
|
||||
(void)dummy;
|
||||
/*
|
||||
* If there are no list elements, the result is an empty object.
|
||||
* Otherwise set the interpreter's result object to be a list object.
|
||||
@@ -2538,6 +2569,7 @@ Tcl_LlengthObjCmd(
|
||||
/* Argument objects. */
|
||||
{
|
||||
int listLen, result;
|
||||
(void)dummy;
|
||||
|
||||
if (objc != 2) {
|
||||
Tcl_WrongNumArgs(interp, 1, objv, "list");
|
||||
@@ -2577,7 +2609,7 @@ Tcl_LlengthObjCmd(
|
||||
|
||||
int
|
||||
Tcl_LpopObjCmd(
|
||||
ClientData notUsed, /* Not used. */
|
||||
ClientData dummy, /* Not used. */
|
||||
Tcl_Interp *interp, /* Current interpreter. */
|
||||
int objc, /* Number of arguments. */
|
||||
Tcl_Obj *const objv[])
|
||||
@@ -2586,6 +2618,7 @@ Tcl_LpopObjCmd(
|
||||
int listLen, result;
|
||||
Tcl_Obj *elemPtr, *stored;
|
||||
Tcl_Obj *listPtr, **elemPtrs;
|
||||
(void)dummy;
|
||||
|
||||
if (objc < 2) {
|
||||
Tcl_WrongNumArgs(interp, 1, objv, "listvar ?index?");
|
||||
@@ -2670,13 +2703,14 @@ Tcl_LpopObjCmd(
|
||||
|
||||
int
|
||||
Tcl_LrangeObjCmd(
|
||||
ClientData notUsed, /* Not used. */
|
||||
ClientData dummy, /* Not used. */
|
||||
Tcl_Interp *interp, /* Current interpreter. */
|
||||
int objc, /* Number of arguments. */
|
||||
Tcl_Obj *const objv[])
|
||||
/* Argument objects. */
|
||||
{
|
||||
int listLen, first, last, result;
|
||||
(void)dummy;
|
||||
|
||||
if (objc != 4) {
|
||||
Tcl_WrongNumArgs(interp, 1, objv, "list first last");
|
||||
@@ -2738,7 +2772,7 @@ LremoveIndexCompare(
|
||||
|
||||
int
|
||||
Tcl_LremoveObjCmd(
|
||||
ClientData notUsed, /* Not used. */
|
||||
ClientData dummy, /* Not used. */
|
||||
Tcl_Interp *interp, /* Current interpreter. */
|
||||
int objc, /* Number of arguments. */
|
||||
Tcl_Obj *const objv[]) /* Argument objects. */
|
||||
@@ -2746,6 +2780,7 @@ Tcl_LremoveObjCmd(
|
||||
int i, idxc;
|
||||
int listLen, *idxv, prevIdx, first, num;
|
||||
Tcl_Obj *listObj;
|
||||
(void)dummy;
|
||||
|
||||
/*
|
||||
* Parse the arguments.
|
||||
@@ -2766,7 +2801,7 @@ Tcl_LremoveObjCmd(
|
||||
Tcl_SetObjResult(interp, listObj);
|
||||
return TCL_OK;
|
||||
}
|
||||
idxv = ckalloc((objc - 2) * sizeof(int));
|
||||
idxv = (int *)ckalloc((objc - 2) * sizeof(int));
|
||||
for (i = 2; i < objc; i++) {
|
||||
if (TclGetIntForIndexM(interp, objv[i], /*endValue*/ listLen - 1,
|
||||
&idxv[i - 2]) != TCL_OK) {
|
||||
@@ -2865,6 +2900,7 @@ Tcl_LrepeatObjCmd(
|
||||
{
|
||||
int elementCount, i, totalElems;
|
||||
Tcl_Obj *listPtr, **dataArray = NULL;
|
||||
(void)dummy;
|
||||
|
||||
/*
|
||||
* Check arguments for legality:
|
||||
@@ -2973,6 +3009,7 @@ Tcl_LreplaceObjCmd(
|
||||
{
|
||||
Tcl_Obj *listPtr;
|
||||
int first, last, listLen, numToDelete, result;
|
||||
(void)dummy;
|
||||
|
||||
if (objc < 4) {
|
||||
Tcl_WrongNumArgs(interp, 1, objv,
|
||||
@@ -3067,13 +3104,14 @@ Tcl_LreplaceObjCmd(
|
||||
|
||||
int
|
||||
Tcl_LreverseObjCmd(
|
||||
ClientData clientData, /* Not used. */
|
||||
ClientData dummy, /* Not used. */
|
||||
Tcl_Interp *interp, /* Current interpreter. */
|
||||
int objc, /* Number of arguments. */
|
||||
Tcl_Obj *const objv[]) /* Argument values. */
|
||||
{
|
||||
Tcl_Obj **elemv;
|
||||
int elemc, i, j;
|
||||
(void)dummy;
|
||||
|
||||
if (objc != 2) {
|
||||
Tcl_WrongNumArgs(interp, 1, objv, "list");
|
||||
@@ -3146,7 +3184,7 @@ Tcl_LreverseObjCmd(
|
||||
|
||||
int
|
||||
Tcl_LsearchObjCmd(
|
||||
ClientData clientData, /* Not used. */
|
||||
ClientData dummy, /* Not used. */
|
||||
Tcl_Interp *interp, /* Current interpreter. */
|
||||
int objc, /* Number of arguments. */
|
||||
Tcl_Obj *const objv[]) /* Argument values. */
|
||||
@@ -3183,6 +3221,7 @@ Tcl_LsearchObjCmd(
|
||||
EXACT, GLOB, REGEXP, SORTED
|
||||
};
|
||||
enum modes mode;
|
||||
(void)dummy;
|
||||
|
||||
mode = GLOB;
|
||||
dataType = ASCII;
|
||||
@@ -3362,7 +3401,7 @@ Tcl_LsearchObjCmd(
|
||||
sortInfo.indexv = &sortInfo.singleIndex;
|
||||
break;
|
||||
default:
|
||||
sortInfo.indexv =
|
||||
sortInfo.indexv = (int *)
|
||||
TclStackAlloc(interp, sizeof(int) * sortInfo.indexc);
|
||||
allocatedIndexVector = 1; /* Cannot use indexc field, as it
|
||||
* might be decreased by 1 later. */
|
||||
@@ -3898,13 +3937,14 @@ Tcl_LsearchObjCmd(
|
||||
|
||||
int
|
||||
Tcl_LsetObjCmd(
|
||||
ClientData clientData, /* Not used. */
|
||||
ClientData dummy, /* Not used. */
|
||||
Tcl_Interp *interp, /* Current interpreter. */
|
||||
int objc, /* Number of arguments. */
|
||||
Tcl_Obj *const objv[]) /* Argument values. */
|
||||
{
|
||||
Tcl_Obj *listPtr; /* Pointer to the list being altered. */
|
||||
Tcl_Obj *finalValuePtr; /* Value finally assigned to the variable. */
|
||||
(void)dummy;
|
||||
|
||||
/*
|
||||
* Check parameter count.
|
||||
@@ -3983,7 +4023,7 @@ Tcl_LsetObjCmd(
|
||||
|
||||
int
|
||||
Tcl_LsortObjCmd(
|
||||
ClientData clientData, /* Not used. */
|
||||
ClientData dummy, /* Not used. */
|
||||
Tcl_Interp *interp, /* Current interpreter. */
|
||||
int objc, /* Number of arguments. */
|
||||
Tcl_Obj *const objv[]) /* Argument values. */
|
||||
@@ -3992,9 +4032,11 @@ Tcl_LsortObjCmd(
|
||||
int sortMode = SORTMODE_ASCII;
|
||||
int group, groupSize, groupOffset, idx, allocatedIndexVector = 0;
|
||||
Tcl_Obj *resultPtr, *cmdPtr, **listObjPtrs, *listObj, *indexPtr;
|
||||
size_t elmArrSize;
|
||||
SortElement *elementArray = NULL, *elementPtr;
|
||||
SortInfo sortInfo; /* Information about this sort that needs to
|
||||
* be passed to the comparison function. */
|
||||
# define MAXCALLOC 1024000
|
||||
# define NUM_LISTS 30
|
||||
SortElement *subList[NUM_LISTS+1];
|
||||
/* This array holds pointers to temporary
|
||||
@@ -4011,6 +4053,7 @@ Tcl_LsortObjCmd(
|
||||
LSORT_INCREASING, LSORT_INDEX, LSORT_INDICES, LSORT_INTEGER,
|
||||
LSORT_NOCASE, LSORT_REAL, LSORT_STRIDE, LSORT_UNIQUE
|
||||
};
|
||||
(void)dummy;
|
||||
|
||||
if (objc < 2) {
|
||||
Tcl_WrongNumArgs(interp, 1, objv, "?-option value ...? list");
|
||||
@@ -4179,7 +4222,7 @@ Tcl_LsortObjCmd(
|
||||
sortInfo.indexv = &sortInfo.singleIndex;
|
||||
break;
|
||||
default:
|
||||
sortInfo.indexv =
|
||||
sortInfo.indexv = (int *)
|
||||
TclStackAlloc(interp, sizeof(int) * sortInfo.indexc);
|
||||
allocatedIndexVector = 1; /* Cannot use indexc field, as it
|
||||
* might be decreased by 1 later. */
|
||||
@@ -4317,7 +4360,19 @@ Tcl_LsortObjCmd(
|
||||
* begins sorting it into the sublists as it appears.
|
||||
*/
|
||||
|
||||
elementArray = ckalloc(length * sizeof(SortElement));
|
||||
elmArrSize = length * sizeof(SortElement);
|
||||
if (elmArrSize <= MAXCALLOC) {
|
||||
elementArray = (SortElement *)ckalloc(elmArrSize);
|
||||
} else {
|
||||
elementArray = (SortElement *)malloc(elmArrSize);
|
||||
}
|
||||
if (!elementArray) {
|
||||
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
|
||||
"no enough memory to proccess sort of %d items", length));
|
||||
Tcl_SetErrorCode(interp, "TCL", "MEMORY", NULL);
|
||||
sortInfo.resultCode = TCL_ERROR;
|
||||
goto done;
|
||||
}
|
||||
|
||||
for (i=0; i < length; i++) {
|
||||
idx = groupSize * i + groupOffset;
|
||||
@@ -4450,7 +4505,11 @@ Tcl_LsortObjCmd(
|
||||
TclStackFree(interp, sortInfo.indexv);
|
||||
}
|
||||
if (elementArray) {
|
||||
ckfree(elementArray);
|
||||
if (elmArrSize <= MAXCALLOC) {
|
||||
ckfree((char *)elementArray);
|
||||
} else {
|
||||
free((char *)elementArray);
|
||||
}
|
||||
}
|
||||
return sortInfo.resultCode;
|
||||
}
|
||||
|
||||
+65
-25
@@ -88,6 +88,7 @@ Tcl_PwdObjCmd(
|
||||
Tcl_Obj *const objv[]) /* Argument objects. */
|
||||
{
|
||||
Tcl_Obj *retVal;
|
||||
(void)dummy;
|
||||
|
||||
if (objc != 1) {
|
||||
Tcl_WrongNumArgs(interp, 1, objv, NULL);
|
||||
@@ -142,6 +143,7 @@ Tcl_RegexpObjCmd(
|
||||
REGEXP_EXPANDED,REGEXP_LINE, REGEXP_LINESTOP,REGEXP_LINEANCHOR,
|
||||
REGEXP_NOCASE, REGEXP_START, REGEXP_LAST
|
||||
};
|
||||
(void)dummy;
|
||||
|
||||
indices = 0;
|
||||
about = 0;
|
||||
@@ -504,6 +506,7 @@ Tcl_RegsubObjCmd(
|
||||
REGSUB_LINESTOP, REGSUB_LINEANCHOR, REGSUB_NOCASE, REGSUB_START,
|
||||
REGSUB_LAST
|
||||
};
|
||||
(void)dummy;
|
||||
|
||||
cflags = TCL_REG_ADVANCED;
|
||||
all = 0;
|
||||
@@ -778,7 +781,7 @@ Tcl_RegsubObjCmd(
|
||||
|
||||
Tcl_ListObjGetElements(interp, subPtr, &numParts, &parts);
|
||||
numArgs = numParts + info.nsubs + 1;
|
||||
args = ckalloc(sizeof(Tcl_Obj*) * numArgs);
|
||||
args = (Tcl_Obj **)ckalloc(sizeof(Tcl_Obj*) * numArgs);
|
||||
memcpy(args, parts, sizeof(Tcl_Obj*) * numParts);
|
||||
|
||||
for (idx = 0 ; idx <= info.nsubs ; idx++) {
|
||||
@@ -1002,12 +1005,13 @@ Tcl_RegsubObjCmd(
|
||||
|
||||
int
|
||||
Tcl_RenameObjCmd(
|
||||
ClientData dummy, /* Arbitrary value passed to the command. */
|
||||
ClientData dummy, /* Not used. */
|
||||
Tcl_Interp *interp, /* Current interpreter. */
|
||||
int objc, /* Number of arguments. */
|
||||
Tcl_Obj *const objv[]) /* Argument objects. */
|
||||
{
|
||||
const char *oldName, *newName;
|
||||
(void)dummy;
|
||||
|
||||
if (objc != 3) {
|
||||
Tcl_WrongNumArgs(interp, 1, objv, "oldName newName");
|
||||
@@ -1053,6 +1057,7 @@ Tcl_ReturnObjCmd(
|
||||
|
||||
int explicitResult = (0 == (objc % 2));
|
||||
int numOptionWords = objc - 1 - explicitResult;
|
||||
(void)dummy;
|
||||
|
||||
if (TCL_ERROR == TclMergeReturnOptions(interp, numOptionWords, objv+1,
|
||||
&returnOpts, &code, &level)) {
|
||||
@@ -1105,6 +1110,7 @@ TclNRSourceObjCmd(
|
||||
int result;
|
||||
void **pkgFiles = NULL;
|
||||
void *names = NULL;
|
||||
(void)dummy;
|
||||
|
||||
if (objc < 2 || objc > 4) {
|
||||
Tcl_WrongNumArgs(interp, 1, objv, "?-encoding name? fileName");
|
||||
@@ -1136,7 +1142,7 @@ TclNRSourceObjCmd(
|
||||
"option", TCL_EXACT, &index)) {
|
||||
return TCL_ERROR;
|
||||
}
|
||||
pkgFiles = Tcl_GetAssocData(interp, "tclPkgFiles", NULL);
|
||||
pkgFiles = (void **)Tcl_GetAssocData(interp, "tclPkgFiles", NULL);
|
||||
/* Make sure that during the following TclNREvalFile no filenames
|
||||
* are recorded for inclusion in the "package files" command */
|
||||
names = *pkgFiles;
|
||||
@@ -1181,6 +1187,7 @@ Tcl_SplitObjCmd(
|
||||
const char *end;
|
||||
int splitCharLen, stringLen;
|
||||
Tcl_Obj *listPtr, *objPtr;
|
||||
(void)dummy;
|
||||
|
||||
if (objc == 2) {
|
||||
splitChars = " \n\t\r";
|
||||
@@ -1221,7 +1228,7 @@ Tcl_SplitObjCmd(
|
||||
len = TclUtfToUniChar(stringPtr, &ch);
|
||||
fullchar = ch;
|
||||
|
||||
#if TCL_UTF_MAX <= 4
|
||||
#if TCL_UTF_MAX <= 3
|
||||
if ((ch >= 0xD800) && (len < 3)) {
|
||||
len += TclUtfToUniChar(stringPtr + len, &ch);
|
||||
fullchar = (((fullchar & 0x3ff) << 10) | (ch & 0x3ff)) + 0x10000;
|
||||
@@ -1243,14 +1250,14 @@ Tcl_SplitObjCmd(
|
||||
|
||||
Tcl_SetHashValue(hPtr, objPtr);
|
||||
} else {
|
||||
objPtr = Tcl_GetHashValue(hPtr);
|
||||
objPtr = (Tcl_Obj *)Tcl_GetHashValue(hPtr);
|
||||
}
|
||||
Tcl_ListObjAppendElement(NULL, listPtr, objPtr);
|
||||
}
|
||||
Tcl_DeleteHashTable(&charReuseTable);
|
||||
|
||||
} else if (splitCharLen == 1) {
|
||||
char *p;
|
||||
const char *p;
|
||||
|
||||
/*
|
||||
* Handle the special case of splitting on a single character. This is
|
||||
@@ -1323,6 +1330,7 @@ StringFirstCmd(
|
||||
Tcl_Obj *const objv[]) /* Argument objects. */
|
||||
{
|
||||
int start = 0;
|
||||
(void)dummy;
|
||||
|
||||
if (objc < 3 || objc > 4) {
|
||||
Tcl_WrongNumArgs(interp, 1, objv,
|
||||
@@ -1368,6 +1376,7 @@ StringLastCmd(
|
||||
Tcl_Obj *const objv[]) /* Argument objects. */
|
||||
{
|
||||
int last = INT_MAX - 1;
|
||||
(void)dummy;
|
||||
|
||||
if (objc < 3 || objc > 4) {
|
||||
Tcl_WrongNumArgs(interp, 1, objv,
|
||||
@@ -1413,6 +1422,7 @@ StringIndexCmd(
|
||||
Tcl_Obj *const objv[]) /* Argument objects. */
|
||||
{
|
||||
int length, index;
|
||||
(void)dummy;
|
||||
|
||||
if (objc != 3) {
|
||||
Tcl_WrongNumArgs(interp, 1, objv, "string charIndex");
|
||||
@@ -1485,6 +1495,7 @@ StringInsertCmd(
|
||||
int length; /* String length */
|
||||
int index; /* Insert index */
|
||||
Tcl_Obj *outObj; /* Output object */
|
||||
(void)dummy;
|
||||
|
||||
if (objc != 4) {
|
||||
Tcl_WrongNumArgs(interp, 1, objv, "string index insertString");
|
||||
@@ -1568,6 +1579,7 @@ StringIsCmd(
|
||||
enum isOptions {
|
||||
OPT_STRICT, OPT_FAILIDX
|
||||
};
|
||||
(void)dummy;
|
||||
|
||||
if (objc < 3 || objc > 6) {
|
||||
Tcl_WrongNumArgs(interp, 1, objv,
|
||||
@@ -1911,7 +1923,7 @@ StringIsCmd(
|
||||
int fullchar;
|
||||
length2 = TclUtfToUniChar(string1, &ch);
|
||||
fullchar = ch;
|
||||
#if TCL_UTF_MAX <= 4
|
||||
#if TCL_UTF_MAX <= 3
|
||||
if ((ch >= 0xD800) && (length2 < 3)) {
|
||||
length2 += TclUtfToUniChar(string1 + length2, &ch);
|
||||
fullchar = (((fullchar & 0x3ff) << 10) | (ch & 0x3ff)) + 0x10000;
|
||||
@@ -1983,6 +1995,7 @@ StringMapCmd(
|
||||
Tcl_Obj **mapElemv, *sourceObj, *resultPtr;
|
||||
Tcl_UniChar *ustring1, *ustring2, *p, *end;
|
||||
int (*strCmpFn)(const Tcl_UniChar*, const Tcl_UniChar*, unsigned long);
|
||||
(void)dummy;
|
||||
|
||||
if (objc < 3 || objc > 4) {
|
||||
Tcl_WrongNumArgs(interp, 1, objv, "?-nocase? charMap string");
|
||||
@@ -2037,7 +2050,7 @@ StringMapCmd(
|
||||
* adapt this code...
|
||||
*/
|
||||
|
||||
mapElemv = TclStackAlloc(interp, sizeof(Tcl_Obj *) * mapElemc);
|
||||
mapElemv = (Tcl_Obj **)TclStackAlloc(interp, sizeof(Tcl_Obj *) * mapElemc);
|
||||
Tcl_DictObjFirst(interp, objv[objc-2], &search, mapElemv+0,
|
||||
mapElemv+1, &done);
|
||||
for (i=2 ; i<mapElemc ; i+=2) {
|
||||
@@ -2148,10 +2161,10 @@ StringMapCmd(
|
||||
* case.
|
||||
*/
|
||||
|
||||
mapStrings = TclStackAlloc(interp, mapElemc*2*sizeof(Tcl_UniChar *));
|
||||
mapLens = TclStackAlloc(interp, mapElemc * 2 * sizeof(int));
|
||||
mapStrings = (Tcl_UniChar **)TclStackAlloc(interp, mapElemc*2*sizeof(Tcl_UniChar *));
|
||||
mapLens = (int *)TclStackAlloc(interp, mapElemc * 2 * sizeof(int));
|
||||
if (nocase) {
|
||||
u2lc = TclStackAlloc(interp, mapElemc * sizeof(int));
|
||||
u2lc = (int *)TclStackAlloc(interp, mapElemc * sizeof(int));
|
||||
}
|
||||
for (index = 0; index < mapElemc; index++) {
|
||||
mapStrings[index] = Tcl_GetUnicodeFromObj(mapElemv[index],
|
||||
@@ -2250,6 +2263,7 @@ StringMatchCmd(
|
||||
Tcl_Obj *const objv[]) /* Argument objects. */
|
||||
{
|
||||
int nocase = 0;
|
||||
(void)dummy;
|
||||
|
||||
if (objc < 3 || objc > 4) {
|
||||
Tcl_WrongNumArgs(interp, 1, objv, "?-nocase? pattern string");
|
||||
@@ -2302,6 +2316,7 @@ StringRangeCmd(
|
||||
Tcl_Obj *const objv[]) /* Argument objects. */
|
||||
{
|
||||
int length, first, last;
|
||||
(void)dummy;
|
||||
|
||||
if (objc != 4) {
|
||||
Tcl_WrongNumArgs(interp, 1, objv, "string first last");
|
||||
@@ -2359,6 +2374,7 @@ StringReptCmd(
|
||||
{
|
||||
int count;
|
||||
Tcl_Obj *resultPtr;
|
||||
(void)dummy;
|
||||
|
||||
if (objc != 3) {
|
||||
Tcl_WrongNumArgs(interp, 1, objv, "string count");
|
||||
@@ -2414,6 +2430,7 @@ StringRplcCmd(
|
||||
Tcl_Obj *const objv[]) /* Argument objects. */
|
||||
{
|
||||
int first, last, length, end;
|
||||
(void)dummy;
|
||||
|
||||
if (objc < 4 || objc > 5) {
|
||||
Tcl_WrongNumArgs(interp, 1, objv, "string first last ?string?");
|
||||
@@ -2489,6 +2506,8 @@ StringRevCmd(
|
||||
int objc, /* Number of arguments. */
|
||||
Tcl_Obj *const objv[]) /* Argument objects. */
|
||||
{
|
||||
(void)dummy;
|
||||
|
||||
if (objc != 2) {
|
||||
Tcl_WrongNumArgs(interp, 1, objv, "string");
|
||||
return TCL_ERROR;
|
||||
@@ -2527,6 +2546,7 @@ StringStartCmd(
|
||||
Tcl_UniChar ch = 0;
|
||||
const char *p, *string;
|
||||
int cur, index, length, numChars;
|
||||
(void)dummy;
|
||||
|
||||
if (objc != 3) {
|
||||
Tcl_WrongNumArgs(interp, 1, objv, "string index");
|
||||
@@ -2588,6 +2608,7 @@ StringEndCmd(
|
||||
Tcl_UniChar ch = 0;
|
||||
const char *p, *end, *string;
|
||||
int cur, index, length, numChars;
|
||||
(void)dummy;
|
||||
|
||||
if (objc != 3) {
|
||||
Tcl_WrongNumArgs(interp, 1, objv, "string index");
|
||||
@@ -2655,6 +2676,7 @@ StringEqualCmd(
|
||||
|
||||
const char *string2;
|
||||
int length, i, match, nocase = 0, reqlength = -1;
|
||||
(void)dummy;
|
||||
|
||||
if (objc < 3 || objc > 6) {
|
||||
str_cmp_args:
|
||||
@@ -2729,6 +2751,7 @@ StringCmpCmd(
|
||||
*/
|
||||
|
||||
int match, nocase, reqlength, status;
|
||||
(void)dummy;
|
||||
|
||||
status = TclStringCmpOpts(interp, objc, objv, &nocase, &reqlength);
|
||||
if (status != TCL_OK) {
|
||||
@@ -2811,6 +2834,7 @@ StringCatCmd(
|
||||
Tcl_Obj *const objv[]) /* Argument objects. */
|
||||
{
|
||||
Tcl_Obj *objResultPtr;
|
||||
(void)dummy;
|
||||
|
||||
if (objc < 2) {
|
||||
/*
|
||||
@@ -2856,6 +2880,7 @@ StringBytesCmd(
|
||||
Tcl_Obj *const objv[]) /* Argument objects. */
|
||||
{
|
||||
int length;
|
||||
(void)dummy;
|
||||
|
||||
if (objc != 2) {
|
||||
Tcl_WrongNumArgs(interp, 1, objv, "string");
|
||||
@@ -2892,6 +2917,8 @@ StringLenCmd(
|
||||
int objc, /* Number of arguments. */
|
||||
Tcl_Obj *const objv[]) /* Argument objects. */
|
||||
{
|
||||
(void)dummy;
|
||||
|
||||
if (objc != 2) {
|
||||
Tcl_WrongNumArgs(interp, 1, objv, "string");
|
||||
return TCL_ERROR;
|
||||
@@ -2929,6 +2956,7 @@ StringLowerCmd(
|
||||
int length1, length2;
|
||||
const char *string1;
|
||||
char *string2;
|
||||
(void)dummy;
|
||||
|
||||
if (objc < 2 || objc > 4) {
|
||||
Tcl_WrongNumArgs(interp, 1, objv, "string ?first? ?last?");
|
||||
@@ -3014,6 +3042,7 @@ StringUpperCmd(
|
||||
int length1, length2;
|
||||
const char *string1;
|
||||
char *string2;
|
||||
(void)dummy;
|
||||
|
||||
if (objc < 2 || objc > 4) {
|
||||
Tcl_WrongNumArgs(interp, 1, objv, "string ?first? ?last?");
|
||||
@@ -3099,6 +3128,7 @@ StringTitleCmd(
|
||||
int length1, length2;
|
||||
const char *string1;
|
||||
char *string2;
|
||||
(void)dummy;
|
||||
|
||||
if (objc < 2 || objc > 4) {
|
||||
Tcl_WrongNumArgs(interp, 1, objv, "string ?first? ?last?");
|
||||
@@ -3183,6 +3213,7 @@ StringTrimCmd(
|
||||
{
|
||||
const char *string1, *string2;
|
||||
int triml, trimr, length1, length2;
|
||||
(void)dummy;
|
||||
|
||||
if (objc == 3) {
|
||||
string2 = TclGetStringFromObj(objv[2], &length2);
|
||||
@@ -3230,6 +3261,7 @@ StringTrimLCmd(
|
||||
{
|
||||
const char *string1, *string2;
|
||||
int trim, length1, length2;
|
||||
(void)dummy;
|
||||
|
||||
if (objc == 3) {
|
||||
string2 = TclGetStringFromObj(objv[2], &length2);
|
||||
@@ -3276,6 +3308,7 @@ StringTrimRCmd(
|
||||
{
|
||||
const char *string1, *string2;
|
||||
int trim, length1, length2;
|
||||
(void)dummy;
|
||||
|
||||
if (objc == 3) {
|
||||
string2 = TclGetStringFromObj(objv[2], &length2);
|
||||
@@ -3428,6 +3461,7 @@ TclNRSubstObjCmd(
|
||||
Tcl_Obj *const objv[]) /* Argument objects. */
|
||||
{
|
||||
int flags;
|
||||
(void)dummy;
|
||||
|
||||
if (objc < 2) {
|
||||
Tcl_WrongNumArgs(interp, 1, objv,
|
||||
@@ -3502,6 +3536,7 @@ TclNRSwitchObjCmd(
|
||||
};
|
||||
typedef int (*strCmpFn_t)(const char *, const char *);
|
||||
strCmpFn_t strCmpFn = TclUtfCmp;
|
||||
(void)dummy;
|
||||
|
||||
mode = OPT_EXACT;
|
||||
foundmode = 0;
|
||||
@@ -3852,7 +3887,7 @@ TclNRSwitchObjCmd(
|
||||
*/
|
||||
|
||||
matchFound:
|
||||
ctxPtr = TclStackAlloc(interp, sizeof(CmdFrame));
|
||||
ctxPtr = (CmdFrame *)TclStackAlloc(interp, sizeof(CmdFrame));
|
||||
*ctxPtr = *iPtr->cmdFramePtr;
|
||||
|
||||
if (splitObjs) {
|
||||
@@ -3882,7 +3917,7 @@ TclNRSwitchObjCmd(
|
||||
if (ctxPtr->type == TCL_LOCATION_SOURCE && ctxPtr->line[bidx] >= 0) {
|
||||
int bline = ctxPtr->line[bidx];
|
||||
|
||||
ctxPtr->line = ckalloc(objc * sizeof(int));
|
||||
ctxPtr->line = (int *)ckalloc(objc * sizeof(int));
|
||||
ctxPtr->nline = objc;
|
||||
TclListLines(blist, bline, objc, ctxPtr->line, objv);
|
||||
} else {
|
||||
@@ -3896,7 +3931,7 @@ TclNRSwitchObjCmd(
|
||||
|
||||
int k;
|
||||
|
||||
ctxPtr->line = ckalloc(objc * sizeof(int));
|
||||
ctxPtr->line = (int *)ckalloc(objc * sizeof(int));
|
||||
ctxPtr->nline = objc;
|
||||
for (k=0; k < objc; k++) {
|
||||
ctxPtr->line[k] = -1;
|
||||
@@ -3936,9 +3971,9 @@ SwitchPostProc(
|
||||
/* Unpack the preserved data */
|
||||
|
||||
int splitObjs = PTR2INT(data[0]);
|
||||
CmdFrame *ctxPtr = data[1];
|
||||
CmdFrame *ctxPtr = (CmdFrame *)data[1];
|
||||
int pc = PTR2INT(data[2]);
|
||||
const char *pattern = data[3];
|
||||
const char *pattern = (const char *)data[3];
|
||||
int patternLength = strlen(pattern);
|
||||
|
||||
/*
|
||||
@@ -4000,6 +4035,7 @@ Tcl_ThrowObjCmd(
|
||||
{
|
||||
Tcl_Obj *options;
|
||||
int len;
|
||||
(void)dummy;
|
||||
|
||||
if (objc != 3) {
|
||||
Tcl_WrongNumArgs(interp, 1, objv, "type message");
|
||||
@@ -4070,6 +4106,7 @@ Tcl_TimeObjCmd(
|
||||
#else
|
||||
Tcl_WideInt start, stop;
|
||||
#endif
|
||||
(void)dummy;
|
||||
|
||||
if (objc == 2) {
|
||||
count = 1;
|
||||
@@ -4188,6 +4225,7 @@ Tcl_TimeRateObjCmd(
|
||||
};
|
||||
NRE_callback *rootPtr;
|
||||
ByteCode *codePtr = NULL;
|
||||
(void)dummy;
|
||||
|
||||
for (i = 1; i < objc - 1; i++) {
|
||||
int index;
|
||||
@@ -4719,6 +4757,7 @@ TclNRTryObjCmd(
|
||||
enum Handlers {
|
||||
TryFinally, TryOn, TryTrap
|
||||
};
|
||||
(void)clientData;
|
||||
|
||||
/*
|
||||
* Parse the arguments. The handlers are passed to subsequent callbacks as
|
||||
@@ -4912,9 +4951,9 @@ TryPostBody(
|
||||
int i, dummy, code, objc;
|
||||
int numHandlers = 0;
|
||||
|
||||
handlersObj = data[0];
|
||||
finallyObj = data[1];
|
||||
objv = data[2];
|
||||
handlersObj = (Tcl_Obj *)data[0];
|
||||
finallyObj = (Tcl_Obj *)data[1];
|
||||
objv = (Tcl_Obj **)data[2];
|
||||
objc = PTR2INT(data[3]);
|
||||
|
||||
cmdObj = objv[0];
|
||||
@@ -5127,9 +5166,9 @@ TryPostHandler(
|
||||
Tcl_Obj *finallyObj;
|
||||
int finally;
|
||||
|
||||
objv = data[0];
|
||||
options = data[1];
|
||||
handlerKindObj = data[2];
|
||||
objv = (Tcl_Obj **)data[0];
|
||||
options = (Tcl_Obj *)data[1];
|
||||
handlerKindObj = (Tcl_Obj *)data[2];
|
||||
finally = PTR2INT(data[3]);
|
||||
|
||||
cmdObj = objv[0];
|
||||
@@ -5211,9 +5250,9 @@ TryPostFinal(
|
||||
{
|
||||
Tcl_Obj *resultObj, *options, *cmdObj;
|
||||
|
||||
resultObj = data[0];
|
||||
options = data[1];
|
||||
cmdObj = data[2];
|
||||
resultObj = (Tcl_Obj *)data[0];
|
||||
options = (Tcl_Obj *)data[1];
|
||||
cmdObj = (Tcl_Obj *)data[2];
|
||||
|
||||
/*
|
||||
* If the result wasn't OK, we need to adjust the result options.
|
||||
@@ -5288,6 +5327,7 @@ TclNRWhileObjCmd(
|
||||
Tcl_Obj *const objv[]) /* Argument objects. */
|
||||
{
|
||||
ForIterData *iterPtr;
|
||||
(void)dummy;
|
||||
|
||||
if (objc != 3) {
|
||||
Tcl_WrongNumArgs(interp, 1, objv, "test command");
|
||||
|
||||
+58
-26
@@ -267,6 +267,7 @@ TclCompileArrayExistsCmd(
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
Tcl_Token *tokenPtr;
|
||||
int isScalar, localIndex;
|
||||
(void)cmdPtr;
|
||||
|
||||
if (parsePtr->numWords != 2) {
|
||||
return TCL_ERROR;
|
||||
@@ -403,9 +404,9 @@ TclCompileArraySetCmd(
|
||||
keyVar = AnonymousLocal(envPtr);
|
||||
valVar = AnonymousLocal(envPtr);
|
||||
|
||||
infoPtr = ckalloc(sizeof(ForeachInfo));
|
||||
infoPtr = (ForeachInfo *)ckalloc(sizeof(ForeachInfo));
|
||||
infoPtr->numLists = 1;
|
||||
infoPtr->varLists[0] = ckalloc(sizeof(ForeachVarList) + sizeof(int));
|
||||
infoPtr->varLists[0] = (ForeachVarList *)ckalloc(sizeof(ForeachVarList) + sizeof(int));
|
||||
infoPtr->varLists[0]->numVars = 2;
|
||||
infoPtr->varLists[0]->varIndexes[0] = keyVar;
|
||||
infoPtr->varLists[0]->varIndexes[1] = valVar;
|
||||
@@ -522,7 +523,7 @@ TclCompileArrayUnsetCmd(
|
||||
|
||||
int
|
||||
TclCompileBreakCmd(
|
||||
Tcl_Interp *interp, /* Used for error reporting. */
|
||||
Tcl_Interp *dummy, /* Used for error reporting. */
|
||||
Tcl_Parse *parsePtr, /* Points to a parse structure for the command
|
||||
* created by Tcl_ParseCommand. */
|
||||
Command *cmdPtr, /* Points to defintion of command being
|
||||
@@ -531,6 +532,8 @@ TclCompileBreakCmd(
|
||||
{
|
||||
ExceptionRange *rangePtr;
|
||||
ExceptionAux *auxPtr;
|
||||
(void)dummy;
|
||||
(void)cmdPtr;
|
||||
|
||||
if (parsePtr->numWords != 1) {
|
||||
return TCL_ERROR;
|
||||
@@ -592,6 +595,7 @@ TclCompileCatchCmd(
|
||||
int resultIndex, optsIndex, range, dropScript = 0;
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
int depth = TclGetStackDepth(envPtr);
|
||||
(void)cmdPtr;
|
||||
|
||||
/*
|
||||
* If syntax does not match what we expect for [catch], do not compile.
|
||||
@@ -765,7 +769,7 @@ TclCompileCatchCmd(
|
||||
|
||||
int
|
||||
TclCompileClockClicksCmd(
|
||||
Tcl_Interp* interp, /* Tcl interpreter */
|
||||
Tcl_Interp* dummy, /* Tcl interpreter */
|
||||
Tcl_Parse *parsePtr, /* Points to a parse structure for the command
|
||||
* created by Tcl_ParseCommand. */
|
||||
Command *cmdPtr, /* Points to defintion of command being
|
||||
@@ -773,6 +777,8 @@ TclCompileClockClicksCmd(
|
||||
CompileEnv *envPtr) /* Holds resulting instructions. */
|
||||
{
|
||||
Tcl_Token* tokenPtr;
|
||||
(void)dummy;
|
||||
(void)cmdPtr;
|
||||
|
||||
switch (parsePtr->numWords) {
|
||||
case 1:
|
||||
@@ -829,13 +835,15 @@ TclCompileClockClicksCmd(
|
||||
|
||||
int
|
||||
TclCompileClockReadingCmd(
|
||||
Tcl_Interp* interp, /* Tcl interpreter */
|
||||
Tcl_Interp* dummy, /* Tcl interpreter */
|
||||
Tcl_Parse *parsePtr, /* Points to a parse structure for the command
|
||||
* created by Tcl_ParseCommand. */
|
||||
Command *cmdPtr, /* Points to defintion of command being
|
||||
* compiled. */
|
||||
CompileEnv *envPtr) /* Holds resulting instructions. */
|
||||
{
|
||||
(void)dummy;
|
||||
|
||||
if (parsePtr->numWords != 1) {
|
||||
return TCL_ERROR;
|
||||
}
|
||||
@@ -876,6 +884,7 @@ TclCompileConcatCmd(
|
||||
Tcl_Obj *objPtr, *listObj;
|
||||
Tcl_Token *tokenPtr;
|
||||
int i;
|
||||
(void)cmdPtr;
|
||||
|
||||
/* TODO: Consider compiling expansion case. */
|
||||
if (parsePtr->numWords == 1) {
|
||||
@@ -952,7 +961,7 @@ TclCompileConcatCmd(
|
||||
|
||||
int
|
||||
TclCompileContinueCmd(
|
||||
Tcl_Interp *interp, /* Used for error reporting. */
|
||||
Tcl_Interp *dummy, /* Used for error reporting. */
|
||||
Tcl_Parse *parsePtr, /* Points to a parse structure for the command
|
||||
* created by Tcl_ParseCommand. */
|
||||
Command *cmdPtr, /* Points to defintion of command being
|
||||
@@ -961,6 +970,8 @@ TclCompileContinueCmd(
|
||||
{
|
||||
ExceptionRange *rangePtr;
|
||||
ExceptionAux *auxPtr;
|
||||
(void)dummy;
|
||||
(void)cmdPtr;
|
||||
|
||||
/*
|
||||
* There should be no argument after the "continue".
|
||||
@@ -1026,6 +1037,7 @@ TclCompileDictSetCmd(
|
||||
int i, dictVarIndex;
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
Tcl_Token *varTokenPtr;
|
||||
(void)cmdPtr;
|
||||
|
||||
/*
|
||||
* There must be at least one argument after the command.
|
||||
@@ -1151,6 +1163,7 @@ TclCompileDictGetCmd(
|
||||
Tcl_Token *tokenPtr;
|
||||
int i;
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
(void)cmdPtr;
|
||||
|
||||
/*
|
||||
* There must be at least two arguments after the command (the single-arg
|
||||
@@ -1188,6 +1201,7 @@ TclCompileDictGetWithDefaultCmd(
|
||||
Tcl_Token *tokenPtr;
|
||||
int i;
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
(void)cmdPtr;
|
||||
|
||||
/*
|
||||
* There must be at least three arguments after the command.
|
||||
@@ -1220,6 +1234,7 @@ TclCompileDictExistsCmd(
|
||||
Tcl_Token *tokenPtr;
|
||||
int i;
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
(void)cmdPtr;
|
||||
|
||||
/*
|
||||
* There must be at least two arguments after the command (the single-arg
|
||||
@@ -1811,9 +1826,9 @@ TclCompileDictUpdateCmd(
|
||||
* that are to be used.
|
||||
*/
|
||||
|
||||
duiPtr = ckalloc(sizeof(DictUpdateInfo) + sizeof(int) * (numVars - 1));
|
||||
duiPtr = (DictUpdateInfo *)ckalloc(sizeof(DictUpdateInfo) + sizeof(int) * (numVars - 1));
|
||||
duiPtr->length = numVars;
|
||||
keyTokenPtrs = TclStackAlloc(interp, sizeof(Tcl_Token *) * numVars);
|
||||
keyTokenPtrs = (Tcl_Token **)TclStackAlloc(interp, sizeof(Tcl_Token *) * numVars);
|
||||
tokenPtr = TokenAfter(dictVarTokenPtr);
|
||||
|
||||
for (i=0 ; i<numVars ; i++) {
|
||||
@@ -2290,11 +2305,11 @@ DupDictUpdateInfo(
|
||||
ClientData clientData)
|
||||
{
|
||||
DictUpdateInfo *dui1Ptr, *dui2Ptr;
|
||||
unsigned len;
|
||||
size_t len;
|
||||
|
||||
dui1Ptr = clientData;
|
||||
dui1Ptr = (DictUpdateInfo *)clientData;
|
||||
len = sizeof(DictUpdateInfo) + sizeof(int) * (dui1Ptr->length - 1);
|
||||
dui2Ptr = ckalloc(len);
|
||||
dui2Ptr = (DictUpdateInfo *)ckalloc(len);
|
||||
memcpy(dui2Ptr, dui1Ptr, len);
|
||||
return dui2Ptr;
|
||||
}
|
||||
@@ -2313,8 +2328,10 @@ PrintDictUpdateInfo(
|
||||
ByteCode *codePtr,
|
||||
unsigned int pcOffset)
|
||||
{
|
||||
DictUpdateInfo *duiPtr = clientData;
|
||||
DictUpdateInfo *duiPtr = (DictUpdateInfo *)clientData;
|
||||
int i;
|
||||
(void)codePtr;
|
||||
(void)pcOffset;
|
||||
|
||||
for (i=0 ; i<duiPtr->length ; i++) {
|
||||
if (i) {
|
||||
@@ -2331,9 +2348,11 @@ DisassembleDictUpdateInfo(
|
||||
ByteCode *codePtr,
|
||||
unsigned int pcOffset)
|
||||
{
|
||||
DictUpdateInfo *duiPtr = clientData;
|
||||
DictUpdateInfo *duiPtr = (DictUpdateInfo *)clientData;
|
||||
int i;
|
||||
Tcl_Obj *variables = Tcl_NewObj();
|
||||
(void)codePtr;
|
||||
(void)pcOffset;
|
||||
|
||||
for (i=0 ; i<duiPtr->length ; i++) {
|
||||
Tcl_ListObjAppendElement(NULL, variables,
|
||||
@@ -2376,6 +2395,7 @@ TclCompileErrorCmd(
|
||||
|
||||
Tcl_Token *tokenPtr;
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
(void)cmdPtr;
|
||||
|
||||
if (parsePtr->numWords < 2 || parsePtr->numWords > 4) {
|
||||
return TCL_ERROR;
|
||||
@@ -2445,6 +2465,7 @@ TclCompileExprCmd(
|
||||
CompileEnv *envPtr) /* Holds resulting instructions. */
|
||||
{
|
||||
Tcl_Token *firstWordPtr;
|
||||
(void)cmdPtr;
|
||||
|
||||
if (parsePtr->numWords == 1) {
|
||||
return TCL_ERROR;
|
||||
@@ -2494,6 +2515,7 @@ TclCompileForCmd(
|
||||
int bodyCodeOffset, nextCodeOffset, jumpDist;
|
||||
int bodyRange, nextRange;
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
(void)cmdPtr;
|
||||
|
||||
if (parsePtr->numWords != 5) {
|
||||
return TCL_ERROR;
|
||||
@@ -2712,6 +2734,7 @@ CompileEachloopCmd(
|
||||
int numWords, numLists, i, j, code = TCL_OK;
|
||||
Tcl_Obj *varListObj = NULL;
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
(void)cmdPtr;
|
||||
|
||||
/*
|
||||
* If the foreach command isn't in a procedure, don't compile it inline:
|
||||
@@ -2747,7 +2770,7 @@ CompileEachloopCmd(
|
||||
*/
|
||||
|
||||
numLists = (numWords - 2)/2;
|
||||
infoPtr = ckalloc(sizeof(ForeachInfo)
|
||||
infoPtr = (ForeachInfo *)ckalloc(sizeof(ForeachInfo)
|
||||
+ (numLists - 1) * sizeof(ForeachVarList *));
|
||||
infoPtr->numLists = 0; /* Count this up as we go */
|
||||
|
||||
@@ -2781,7 +2804,7 @@ CompileEachloopCmd(
|
||||
goto done;
|
||||
}
|
||||
|
||||
varListPtr = ckalloc(sizeof(ForeachVarList)
|
||||
varListPtr = (ForeachVarList *)ckalloc(sizeof(ForeachVarList)
|
||||
+ (numVars - 1) * sizeof(int));
|
||||
varListPtr->numVars = numVars;
|
||||
infoPtr->varLists[i/2] = varListPtr;
|
||||
@@ -2912,12 +2935,12 @@ DupForeachInfo(
|
||||
ClientData clientData) /* The foreach command's compilation auxiliary
|
||||
* data to duplicate. */
|
||||
{
|
||||
ForeachInfo *srcPtr = clientData;
|
||||
ForeachInfo *srcPtr = (ForeachInfo *)clientData;
|
||||
ForeachInfo *dupPtr;
|
||||
ForeachVarList *srcListPtr, *dupListPtr;
|
||||
int numVars, i, j, numLists = srcPtr->numLists;
|
||||
|
||||
dupPtr = ckalloc(sizeof(ForeachInfo)
|
||||
dupPtr = (ForeachInfo *)ckalloc(sizeof(ForeachInfo)
|
||||
+ numLists * sizeof(ForeachVarList *));
|
||||
dupPtr->numLists = numLists;
|
||||
dupPtr->firstValueTemp = srcPtr->firstValueTemp;
|
||||
@@ -2926,7 +2949,7 @@ DupForeachInfo(
|
||||
for (i = 0; i < numLists; i++) {
|
||||
srcListPtr = srcPtr->varLists[i];
|
||||
numVars = srcListPtr->numVars;
|
||||
dupListPtr = ckalloc(sizeof(ForeachVarList)
|
||||
dupListPtr = (ForeachVarList *)ckalloc(sizeof(ForeachVarList)
|
||||
+ numVars * sizeof(int));
|
||||
dupListPtr->numVars = numVars;
|
||||
for (j = 0; j < numVars; j++) {
|
||||
@@ -2961,7 +2984,7 @@ FreeForeachInfo(
|
||||
ClientData clientData) /* The foreach command's compilation auxiliary
|
||||
* data to free. */
|
||||
{
|
||||
ForeachInfo *infoPtr = clientData;
|
||||
ForeachInfo *infoPtr = (ForeachInfo *)clientData;
|
||||
ForeachVarList *listPtr;
|
||||
int numLists = infoPtr->numLists;
|
||||
int i;
|
||||
@@ -2997,9 +3020,11 @@ PrintForeachInfo(
|
||||
ByteCode *codePtr,
|
||||
unsigned int pcOffset)
|
||||
{
|
||||
ForeachInfo *infoPtr = clientData;
|
||||
ForeachInfo *infoPtr = (ForeachInfo *)clientData;
|
||||
ForeachVarList *varsPtr;
|
||||
int i, j;
|
||||
(void)codePtr;
|
||||
(void)pcOffset;
|
||||
|
||||
Tcl_AppendToObj(appendObj, "data=[", -1);
|
||||
|
||||
@@ -3037,9 +3062,11 @@ PrintNewForeachInfo(
|
||||
ByteCode *codePtr,
|
||||
unsigned int pcOffset)
|
||||
{
|
||||
ForeachInfo *infoPtr = clientData;
|
||||
ForeachInfo *infoPtr = (ForeachInfo *)clientData;
|
||||
ForeachVarList *varsPtr;
|
||||
int i, j;
|
||||
(void)codePtr;
|
||||
(void)pcOffset;
|
||||
|
||||
Tcl_AppendPrintfToObj(appendObj, "jumpOffset=%+d, vars=",
|
||||
infoPtr->loopCtTemp);
|
||||
@@ -3067,10 +3094,12 @@ DisassembleForeachInfo(
|
||||
ByteCode *codePtr,
|
||||
unsigned int pcOffset)
|
||||
{
|
||||
ForeachInfo *infoPtr = clientData;
|
||||
ForeachInfo *infoPtr = (ForeachInfo *)clientData;
|
||||
ForeachVarList *varsPtr;
|
||||
int i, j;
|
||||
Tcl_Obj *objPtr, *innerPtr;
|
||||
(void)codePtr;
|
||||
(void)pcOffset;
|
||||
|
||||
/*
|
||||
* Data stores.
|
||||
@@ -3114,10 +3143,12 @@ DisassembleNewForeachInfo(
|
||||
ByteCode *codePtr,
|
||||
unsigned int pcOffset)
|
||||
{
|
||||
ForeachInfo *infoPtr = clientData;
|
||||
ForeachInfo *infoPtr = (ForeachInfo *)clientData;
|
||||
ForeachVarList *varsPtr;
|
||||
int i, j;
|
||||
Tcl_Obj *objPtr, *innerPtr;
|
||||
(void)codePtr;
|
||||
(void)pcOffset;
|
||||
|
||||
/*
|
||||
* Jump offset.
|
||||
@@ -3176,6 +3207,7 @@ TclCompileFormatCmd(
|
||||
Tcl_Obj **objv, *formatObj, *tmpObj;
|
||||
const char *bytes, *start;
|
||||
int i, j, len;
|
||||
(void)cmdPtr;
|
||||
|
||||
/*
|
||||
* Don't handle any guaranteed-error cases.
|
||||
@@ -3198,7 +3230,7 @@ TclCompileFormatCmd(
|
||||
return TCL_ERROR;
|
||||
}
|
||||
|
||||
objv = ckalloc((parsePtr->numWords-2) * sizeof(Tcl_Obj *));
|
||||
objv = (Tcl_Obj **)ckalloc((parsePtr->numWords-2) * sizeof(Tcl_Obj *));
|
||||
for (i=0 ; i+2 < parsePtr->numWords ; i++) {
|
||||
tokenPtr = TokenAfter(tokenPtr);
|
||||
objv[i] = Tcl_NewObj();
|
||||
@@ -3492,7 +3524,7 @@ TclPushVarName(
|
||||
* assemble the corresponding token.
|
||||
*/
|
||||
|
||||
elemTokenPtr = TclStackAlloc(interp, sizeof(Tcl_Token));
|
||||
elemTokenPtr = (Tcl_Token *)TclStackAlloc(interp, sizeof(Tcl_Token));
|
||||
allocedTokens = 1;
|
||||
elemTokenPtr->type = TCL_TOKEN_TEXT;
|
||||
elemTokenPtr->start = elName;
|
||||
@@ -3547,7 +3579,7 @@ TclPushVarName(
|
||||
* token.
|
||||
*/
|
||||
|
||||
elemTokenPtr = TclStackAlloc(interp, n * sizeof(Tcl_Token));
|
||||
elemTokenPtr = (Tcl_Token *)TclStackAlloc(interp, n * sizeof(Tcl_Token));
|
||||
allocedTokens = 1;
|
||||
elemTokenPtr->type = TCL_TOKEN_TEXT;
|
||||
elemTokenPtr->start = elName;
|
||||
|
||||
+42
-5
@@ -93,6 +93,7 @@ TclCompileGlobalCmd(
|
||||
Tcl_Token *varTokenPtr;
|
||||
int localIndex, numWords, i;
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
(void)cmdPtr;
|
||||
|
||||
/* TODO: Consider support for compiling expanded args. */
|
||||
numWords = parsePtr->numWords;
|
||||
@@ -188,6 +189,7 @@ TclCompileIfCmd(
|
||||
int boolVal; /* Value of static condition. */
|
||||
int compileScripts = 1;
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
(void)cmdPtr;
|
||||
|
||||
/*
|
||||
* Only compile the "if" command if all arguments are simple words, in
|
||||
@@ -478,6 +480,7 @@ TclCompileIncrCmd(
|
||||
Tcl_Token *varTokenPtr, *incrTokenPtr;
|
||||
int isScalar, localIndex, haveImmValue, immValue;
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
(void)cmdPtr;
|
||||
|
||||
if ((parsePtr->numWords != 2) && (parsePtr->numWords != 3)) {
|
||||
return TCL_ERROR;
|
||||
@@ -640,13 +643,15 @@ TclCompileInfoCommandsCmd(
|
||||
|
||||
int
|
||||
TclCompileInfoCoroutineCmd(
|
||||
Tcl_Interp *interp, /* Used for error reporting. */
|
||||
Tcl_Interp *dummy, /* Used for error reporting. */
|
||||
Tcl_Parse *parsePtr, /* Points to a parse structure for the command
|
||||
* created by Tcl_ParseCommand. */
|
||||
Command *cmdPtr, /* Points to defintion of command being
|
||||
* compiled. */
|
||||
CompileEnv *envPtr) /* Holds resulting instructions. */
|
||||
{
|
||||
(void)dummy;
|
||||
(void)cmdPtr;
|
||||
/*
|
||||
* Only compile [info coroutine] without arguments.
|
||||
*/
|
||||
@@ -675,6 +680,7 @@ TclCompileInfoExistsCmd(
|
||||
Tcl_Token *tokenPtr;
|
||||
int isScalar, localIndex;
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
(void)cmdPtr;
|
||||
|
||||
if (parsePtr->numWords != 2) {
|
||||
return TCL_ERROR;
|
||||
@@ -721,6 +727,7 @@ TclCompileInfoLevelCmd(
|
||||
* compiled. */
|
||||
CompileEnv *envPtr) /* Holds resulting instructions. */
|
||||
{
|
||||
(void)cmdPtr;
|
||||
/*
|
||||
* Only compile [info level] without arguments or with a single argument.
|
||||
*/
|
||||
@@ -758,6 +765,7 @@ TclCompileInfoObjectClassCmd(
|
||||
{
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
Tcl_Token *tokenPtr = TokenAfter(parsePtr->tokenPtr);
|
||||
(void)cmdPtr;
|
||||
|
||||
if (parsePtr->numWords != 2) {
|
||||
return TCL_ERROR;
|
||||
@@ -778,6 +786,7 @@ TclCompileInfoObjectIsACmd(
|
||||
{
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
Tcl_Token *tokenPtr = TokenAfter(parsePtr->tokenPtr);
|
||||
(void)cmdPtr;
|
||||
|
||||
/*
|
||||
* We only handle [info object isa object <somevalue>]. The first three
|
||||
@@ -814,6 +823,7 @@ TclCompileInfoObjectNamespaceCmd(
|
||||
{
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
Tcl_Token *tokenPtr = TokenAfter(parsePtr->tokenPtr);
|
||||
(void)cmdPtr;
|
||||
|
||||
if (parsePtr->numWords != 2) {
|
||||
return TCL_ERROR;
|
||||
@@ -853,6 +863,7 @@ TclCompileLappendCmd(
|
||||
Tcl_Token *varTokenPtr, *valueTokenPtr;
|
||||
int isScalar, localIndex, numWords, i;
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
(void)cmdPtr;
|
||||
|
||||
/* TODO: Consider support for compiling expanded args. */
|
||||
numWords = parsePtr->numWords;
|
||||
@@ -969,6 +980,7 @@ TclCompileLassignCmd(
|
||||
Tcl_Token *tokenPtr;
|
||||
int isScalar, localIndex, numWords, idx;
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
(void)cmdPtr;
|
||||
|
||||
numWords = parsePtr->numWords;
|
||||
|
||||
@@ -1073,6 +1085,7 @@ TclCompileLindexCmd(
|
||||
Tcl_Token *idxTokenPtr, *valTokenPtr;
|
||||
int i, idx, numWords = parsePtr->numWords;
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
(void)cmdPtr;
|
||||
|
||||
/*
|
||||
* Quit if too few args.
|
||||
@@ -1165,6 +1178,7 @@ TclCompileListCmd(
|
||||
Tcl_Token *valueTokenPtr;
|
||||
int i, numWords, concat, build;
|
||||
Tcl_Obj *listObj, *objPtr;
|
||||
(void)cmdPtr;
|
||||
|
||||
if (parsePtr->numWords == 1) {
|
||||
/*
|
||||
@@ -1277,6 +1291,7 @@ TclCompileLlengthCmd(
|
||||
{
|
||||
Tcl_Token *varTokenPtr;
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
(void)cmdPtr;
|
||||
|
||||
if (parsePtr->numWords != 2) {
|
||||
return TCL_ERROR;
|
||||
@@ -1311,6 +1326,7 @@ TclCompileLrangeCmd(
|
||||
Tcl_Token *tokenPtr, *listTokenPtr;
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
int idx1, idx2;
|
||||
(void)cmdPtr;
|
||||
|
||||
if (parsePtr->numWords != 4) {
|
||||
return TCL_ERROR;
|
||||
@@ -1372,6 +1388,7 @@ TclCompileLinsertCmd(
|
||||
Tcl_Token *tokenPtr, *listTokenPtr;
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
int idx, i;
|
||||
(void)cmdPtr;
|
||||
|
||||
if (parsePtr->numWords < 3) {
|
||||
return TCL_ERROR;
|
||||
@@ -1476,6 +1493,7 @@ TclCompileLreplaceCmd(
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
int idx1, idx2, i;
|
||||
int emptyPrefix=1, suffixStart = 0;
|
||||
(void)cmdPtr;
|
||||
|
||||
if (parsePtr->numWords < 4) {
|
||||
return TCL_ERROR;
|
||||
@@ -1644,6 +1662,7 @@ TclCompileLsetCmd(
|
||||
int isScalar; /* Flag == 1 if scalar, 0 if array. */
|
||||
int i;
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
(void)cmdPtr;
|
||||
|
||||
/*
|
||||
* Check argument count.
|
||||
@@ -1776,13 +1795,15 @@ TclCompileLsetCmd(
|
||||
|
||||
int
|
||||
TclCompileNamespaceCurrentCmd(
|
||||
Tcl_Interp *interp, /* Used for error reporting. */
|
||||
Tcl_Interp *dummy, /* Used for error reporting. */
|
||||
Tcl_Parse *parsePtr, /* Points to a parse structure for the command
|
||||
* created by Tcl_ParseCommand. */
|
||||
Command *cmdPtr, /* Points to defintion of command being
|
||||
* compiled. */
|
||||
CompileEnv *envPtr) /* Holds resulting instructions. */
|
||||
{
|
||||
(void)dummy;
|
||||
(void)cmdPtr;
|
||||
/*
|
||||
* Only compile [namespace current] without arguments.
|
||||
*/
|
||||
@@ -1810,6 +1831,7 @@ TclCompileNamespaceCodeCmd(
|
||||
{
|
||||
Tcl_Token *tokenPtr;
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
(void)cmdPtr;
|
||||
|
||||
if (parsePtr->numWords != 2) {
|
||||
return TCL_ERROR;
|
||||
@@ -1860,6 +1882,7 @@ TclCompileNamespaceOriginCmd(
|
||||
{
|
||||
Tcl_Token *tokenPtr;
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
(void)cmdPtr;
|
||||
|
||||
if (parsePtr->numWords != 2) {
|
||||
return TCL_ERROR;
|
||||
@@ -1883,6 +1906,7 @@ TclCompileNamespaceQualifiersCmd(
|
||||
Tcl_Token *tokenPtr = TokenAfter(parsePtr->tokenPtr);
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
int off;
|
||||
(void)cmdPtr;
|
||||
|
||||
if (parsePtr->numWords != 2) {
|
||||
return TCL_ERROR;
|
||||
@@ -1919,6 +1943,7 @@ TclCompileNamespaceTailCmd(
|
||||
Tcl_Token *tokenPtr = TokenAfter(parsePtr->tokenPtr);
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
JumpFixup jumpFixup;
|
||||
(void)cmdPtr;
|
||||
|
||||
if (parsePtr->numWords != 2) {
|
||||
return TCL_ERROR;
|
||||
@@ -1956,6 +1981,7 @@ TclCompileNamespaceUpvarCmd(
|
||||
Tcl_Token *tokenPtr, *otherTokenPtr, *localTokenPtr;
|
||||
int localIndex, numWords, i;
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
(void)cmdPtr;
|
||||
|
||||
if (envPtr->procPtr == NULL) {
|
||||
return TCL_ERROR;
|
||||
@@ -2017,6 +2043,7 @@ TclCompileNamespaceWhichCmd(
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
Tcl_Token *tokenPtr, *opt;
|
||||
int idx;
|
||||
(void)cmdPtr;
|
||||
|
||||
if (parsePtr->numWords < 2 || parsePtr->numWords > 3) {
|
||||
return TCL_ERROR;
|
||||
@@ -2083,6 +2110,7 @@ TclCompileRegexpCmd(
|
||||
int i, len, nocase, exact, sawLast, simple;
|
||||
const char *str;
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
(void)cmdPtr;
|
||||
|
||||
/*
|
||||
* We are only interested in compiling simple regexp cases. Currently
|
||||
@@ -2269,6 +2297,7 @@ TclCompileRegsubCmd(
|
||||
Tcl_DString pattern;
|
||||
const char *bytes;
|
||||
int len, exact, quantified, result = TCL_ERROR;
|
||||
(void)cmdPtr;
|
||||
|
||||
if (parsePtr->numWords < 5 || parsePtr->numWords > 6) {
|
||||
return TCL_ERROR;
|
||||
@@ -2429,6 +2458,7 @@ TclCompileReturnCmd(
|
||||
Tcl_Obj *returnOpts, **objv;
|
||||
Tcl_Token *wordTokenPtr = TokenAfter(parsePtr->tokenPtr);
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
(void)cmdPtr;
|
||||
|
||||
/*
|
||||
* Check for special case which can always be compiled:
|
||||
@@ -2455,7 +2485,7 @@ TclCompileReturnCmd(
|
||||
* Allocate some working space.
|
||||
*/
|
||||
|
||||
objv = TclStackAlloc(interp, numOptionWords * sizeof(Tcl_Obj *));
|
||||
objv = (Tcl_Obj **)TclStackAlloc(interp, numOptionWords * sizeof(Tcl_Obj *));
|
||||
|
||||
/*
|
||||
* Scan through the return options. If any are unknown at compile time,
|
||||
@@ -2674,6 +2704,7 @@ TclCompileUpvarCmd(
|
||||
int localIndex, numWords, i;
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
Tcl_Obj *objPtr;
|
||||
(void)cmdPtr;
|
||||
|
||||
if (envPtr->procPtr == NULL) {
|
||||
return TCL_ERROR;
|
||||
@@ -2780,6 +2811,7 @@ TclCompileVariableCmd(
|
||||
Tcl_Token *varTokenPtr, *valueTokenPtr;
|
||||
int localIndex, numWords, i;
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
(void)cmdPtr;
|
||||
|
||||
numWords = parsePtr->numWords;
|
||||
if (numWords < 2) {
|
||||
@@ -2855,7 +2887,7 @@ TclCompileVariableCmd(
|
||||
|
||||
static int
|
||||
IndexTailVarIfKnown(
|
||||
Tcl_Interp *interp,
|
||||
Tcl_Interp *dummy,
|
||||
Tcl_Token *varTokenPtr, /* Token representing the variable name */
|
||||
CompileEnv *envPtr) /* Holds resulting instructions. */
|
||||
{
|
||||
@@ -2864,6 +2896,7 @@ IndexTailVarIfKnown(
|
||||
int len, n = varTokenPtr->numComponents;
|
||||
Tcl_Token *lastTokenPtr;
|
||||
int full, localIndex;
|
||||
(void)dummy;
|
||||
|
||||
/*
|
||||
* Determine if the tail is (a) known at compile time, and (b) not an
|
||||
@@ -2954,6 +2987,7 @@ TclCompileObjectNextCmd(
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
Tcl_Token *tokenPtr = parsePtr->tokenPtr;
|
||||
int i;
|
||||
(void)cmdPtr;
|
||||
|
||||
if (parsePtr->numWords > 255) {
|
||||
return TCL_ERROR;
|
||||
@@ -2979,6 +3013,7 @@ TclCompileObjectNextToCmd(
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
Tcl_Token *tokenPtr = parsePtr->tokenPtr;
|
||||
int i;
|
||||
(void)cmdPtr;
|
||||
|
||||
if (parsePtr->numWords < 2 || parsePtr->numWords > 255) {
|
||||
return TCL_ERROR;
|
||||
@@ -2994,13 +3029,15 @@ TclCompileObjectNextToCmd(
|
||||
|
||||
int
|
||||
TclCompileObjectSelfCmd(
|
||||
Tcl_Interp *interp, /* Used for error reporting. */
|
||||
Tcl_Interp *dummy, /* Used for error reporting. */
|
||||
Tcl_Parse *parsePtr, /* Points to a parse structure for the command
|
||||
* created by Tcl_ParseCommand. */
|
||||
Command *cmdPtr, /* Points to defintion of command being
|
||||
* compiled. */
|
||||
CompileEnv *envPtr) /* Holds resulting instructions. */
|
||||
{
|
||||
(void)dummy;
|
||||
(void)cmdPtr;
|
||||
/*
|
||||
* We only handle [self] and [self object] (which is the same operation).
|
||||
* These are the only very common operations on [self] for which
|
||||
|
||||
+91
-39
@@ -45,13 +45,12 @@ static int CompileUnaryOpCmd(Tcl_Interp *interp,
|
||||
CompileEnv *envPtr);
|
||||
static void IssueSwitchChainedTests(Tcl_Interp *interp,
|
||||
CompileEnv *envPtr, int mode, int noCase,
|
||||
int valueIndex, int numWords,
|
||||
Tcl_Token **bodyToken, int *bodyLines,
|
||||
int **bodyNext);
|
||||
static void IssueSwitchJumpTable(Tcl_Interp *interp,
|
||||
CompileEnv *envPtr, int valueIndex,
|
||||
int numWords, Tcl_Token **bodyToken,
|
||||
int *bodyLines, int **bodyContLines);
|
||||
int *bodyLines, int **bodyNext);
|
||||
static void IssueSwitchJumpTable(Tcl_Interp *interp,
|
||||
CompileEnv *envPtr, int numWords,
|
||||
Tcl_Token **bodyToken, int *bodyLines,
|
||||
int **bodyContLines);
|
||||
static int IssueTryClausesInstructions(Tcl_Interp *interp,
|
||||
CompileEnv *envPtr, Tcl_Token *bodyToken,
|
||||
int numHandlers, int *matchCodes,
|
||||
@@ -138,6 +137,7 @@ TclCompileSetCmd(
|
||||
Tcl_Token *varTokenPtr, *valueTokenPtr;
|
||||
int isAssignment, isScalar, localIndex, numWords;
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
(void)cmdPtr;
|
||||
|
||||
numWords = parsePtr->numWords;
|
||||
if ((numWords != 2) && (numWords != 3)) {
|
||||
@@ -233,6 +233,7 @@ TclCompileStringCatCmd(
|
||||
Tcl_Token *wordTokenPtr;
|
||||
Tcl_Obj *obj, *folded;
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
(void)cmdPtr;
|
||||
|
||||
/* Trivial case, no arg */
|
||||
|
||||
@@ -303,6 +304,7 @@ TclCompileStringCmpCmd(
|
||||
{
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
Tcl_Token *tokenPtr;
|
||||
(void)cmdPtr;
|
||||
|
||||
/*
|
||||
* We don't support any flags; the bytecode isn't that sophisticated.
|
||||
@@ -335,6 +337,7 @@ TclCompileStringEqualCmd(
|
||||
{
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
Tcl_Token *tokenPtr;
|
||||
(void)cmdPtr;
|
||||
|
||||
/*
|
||||
* We don't support any flags; the bytecode isn't that sophisticated.
|
||||
@@ -367,6 +370,7 @@ TclCompileStringFirstCmd(
|
||||
{
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
Tcl_Token *tokenPtr;
|
||||
(void)cmdPtr;
|
||||
|
||||
/*
|
||||
* We don't support any flags; the bytecode isn't that sophisticated.
|
||||
@@ -399,6 +403,7 @@ TclCompileStringLastCmd(
|
||||
{
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
Tcl_Token *tokenPtr;
|
||||
(void)cmdPtr;
|
||||
|
||||
/*
|
||||
* We don't support any flags; the bytecode isn't that sophisticated.
|
||||
@@ -431,6 +436,7 @@ TclCompileStringIndexCmd(
|
||||
{
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
Tcl_Token *tokenPtr;
|
||||
(void)cmdPtr;
|
||||
|
||||
if (parsePtr->numWords != 3) {
|
||||
return TCL_ERROR;
|
||||
@@ -460,6 +466,7 @@ TclCompileStringInsertCmd(
|
||||
Tcl_Token *tokenPtr;
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
int idx;
|
||||
(void)cmdPtr;
|
||||
|
||||
if (parsePtr->numWords != 4) {
|
||||
return TCL_ERROR;
|
||||
@@ -694,6 +701,7 @@ TclCompileStringIsCmd(
|
||||
OP( LNOT);
|
||||
return TCL_OK;
|
||||
}
|
||||
break;
|
||||
|
||||
case STR_IS_DOUBLE: {
|
||||
int satisfied, isEmpty;
|
||||
@@ -885,6 +893,7 @@ TclCompileStringLenCmd(
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
Tcl_Token *tokenPtr;
|
||||
Tcl_Obj *objPtr;
|
||||
(void)cmdPtr;
|
||||
|
||||
if (parsePtr->numWords != 2) {
|
||||
return TCL_ERROR;
|
||||
@@ -988,6 +997,7 @@ TclCompileStringRangeCmd(
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
Tcl_Token *stringTokenPtr, *fromTokenPtr, *toTokenPtr;
|
||||
int idx1, idx2;
|
||||
(void)cmdPtr;
|
||||
|
||||
if (parsePtr->numWords != 4) {
|
||||
return TCL_ERROR;
|
||||
@@ -1064,6 +1074,7 @@ TclCompileStringReplaceCmd(
|
||||
Tcl_Token *tokenPtr, *valueTokenPtr;
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
int first, last;
|
||||
(void)cmdPtr;
|
||||
|
||||
if (parsePtr->numWords < 4 || parsePtr->numWords > 5) {
|
||||
return TCL_ERROR;
|
||||
@@ -1262,6 +1273,7 @@ TclCompileStringTrimLCmd(
|
||||
{
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
Tcl_Token *tokenPtr;
|
||||
(void)cmdPtr;
|
||||
|
||||
if (parsePtr->numWords != 2 && parsePtr->numWords != 3) {
|
||||
return TCL_ERROR;
|
||||
@@ -1290,6 +1302,7 @@ TclCompileStringTrimRCmd(
|
||||
{
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
Tcl_Token *tokenPtr;
|
||||
(void)cmdPtr;
|
||||
|
||||
if (parsePtr->numWords != 2 && parsePtr->numWords != 3) {
|
||||
return TCL_ERROR;
|
||||
@@ -1318,6 +1331,7 @@ TclCompileStringTrimCmd(
|
||||
{
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
Tcl_Token *tokenPtr;
|
||||
(void)cmdPtr;
|
||||
|
||||
if (parsePtr->numWords != 2 && parsePtr->numWords != 3) {
|
||||
return TCL_ERROR;
|
||||
@@ -1472,12 +1486,13 @@ TclCompileSubstCmd(
|
||||
Tcl_Token *wordTokenPtr = TokenAfter(parsePtr->tokenPtr);
|
||||
int code = TCL_ERROR;
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
(void)cmdPtr;
|
||||
|
||||
if (numArgs == 0) {
|
||||
return TCL_ERROR;
|
||||
}
|
||||
|
||||
objv = TclStackAlloc(interp, /*numArgs*/ numOpts * sizeof(Tcl_Obj *));
|
||||
objv = (Tcl_Obj **)TclStackAlloc(interp, /*numArgs*/ numOpts * sizeof(Tcl_Obj *));
|
||||
|
||||
for (objc = 0; objc < /*numArgs*/ numOpts; objc++) {
|
||||
objv[objc] = Tcl_NewObj();
|
||||
@@ -1816,6 +1831,7 @@ TclCompileSwitchCmd(
|
||||
int result = TCL_ERROR;
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
int *clNext = envPtr->clNext;
|
||||
(void)cmdPtr;
|
||||
|
||||
/*
|
||||
* Only handle the following versions:
|
||||
@@ -1970,10 +1986,10 @@ TclCompileSwitchCmd(
|
||||
if (maxLen < 2) {
|
||||
return TCL_ERROR;
|
||||
}
|
||||
bodyTokenArray = ckalloc(sizeof(Tcl_Token) * maxLen);
|
||||
bodyToken = ckalloc(sizeof(Tcl_Token *) * maxLen);
|
||||
bodyLines = ckalloc(sizeof(int) * maxLen);
|
||||
bodyContLines = ckalloc(sizeof(int*) * maxLen);
|
||||
bodyTokenArray = (Tcl_Token *)ckalloc(sizeof(Tcl_Token) * maxLen);
|
||||
bodyToken = (Tcl_Token **)ckalloc(sizeof(Tcl_Token *) * maxLen);
|
||||
bodyLines = (int *)ckalloc(sizeof(int) * maxLen);
|
||||
bodyContLines = (int **)ckalloc(sizeof(int*) * maxLen);
|
||||
|
||||
bline = mapPtr->loc[eclIndex].line[valueIndex+1];
|
||||
numWords = 0;
|
||||
@@ -2032,9 +2048,9 @@ TclCompileSwitchCmd(
|
||||
* Multi-word definition of patterns & actions.
|
||||
*/
|
||||
|
||||
bodyToken = ckalloc(sizeof(Tcl_Token *) * numWords);
|
||||
bodyLines = ckalloc(sizeof(int) * numWords);
|
||||
bodyContLines = ckalloc(sizeof(int*) * numWords);
|
||||
bodyToken = (Tcl_Token **)ckalloc(sizeof(Tcl_Token *) * numWords);
|
||||
bodyLines = (int *)ckalloc(sizeof(int) * numWords);
|
||||
bodyContLines = (int **)ckalloc(sizeof(int*) * numWords);
|
||||
bodyTokenArray = NULL;
|
||||
for (i=0 ; i<numWords ; i++) {
|
||||
/*
|
||||
@@ -2080,10 +2096,10 @@ TclCompileSwitchCmd(
|
||||
CompileWord(envPtr, valueTokenPtr, interp, valueIndex);
|
||||
|
||||
if (mode == Switch_Exact) {
|
||||
IssueSwitchJumpTable(interp, envPtr, valueIndex, numWords, bodyToken,
|
||||
IssueSwitchJumpTable(interp, envPtr, numWords, bodyToken,
|
||||
bodyLines, bodyContLines);
|
||||
} else {
|
||||
IssueSwitchChainedTests(interp, envPtr, mode, noCase, valueIndex,
|
||||
IssueSwitchChainedTests(interp, envPtr, mode, noCase,
|
||||
numWords, bodyToken, bodyLines, bodyContLines);
|
||||
}
|
||||
result = TCL_OK;
|
||||
@@ -2124,7 +2140,6 @@ IssueSwitchChainedTests(
|
||||
CompileEnv *envPtr, /* Holds resulting instructions. */
|
||||
int mode, /* Exact, Glob or Regexp */
|
||||
int noCase, /* Case-insensitivity flag. */
|
||||
int valueIndex, /* The value to match against. */
|
||||
int numBodyTokens, /* Number of tokens describing things the
|
||||
* switch can match against and bodies to
|
||||
* execute when the match succeeds. */
|
||||
@@ -2154,8 +2169,8 @@ IssueSwitchChainedTests(
|
||||
|
||||
contFixIndex = -1;
|
||||
contFixCount = 0;
|
||||
fixupArray = TclStackAlloc(interp, sizeof(JumpFixup) * numBodyTokens);
|
||||
fixupTargetArray = TclStackAlloc(interp, sizeof(int) * numBodyTokens);
|
||||
fixupArray = (JumpFixup *)TclStackAlloc(interp, sizeof(JumpFixup) * numBodyTokens);
|
||||
fixupTargetArray = (unsigned int *)TclStackAlloc(interp, sizeof(int) * numBodyTokens);
|
||||
memset(fixupTargetArray, 0, numBodyTokens * sizeof(int));
|
||||
fixupCount = 0;
|
||||
foundDefault = 0;
|
||||
@@ -2373,7 +2388,6 @@ static void
|
||||
IssueSwitchJumpTable(
|
||||
Tcl_Interp *interp, /* Context for compiling script bodies. */
|
||||
CompileEnv *envPtr, /* Holds resulting instructions. */
|
||||
int valueIndex, /* The value to match against. */
|
||||
int numBodyTokens, /* Number of tokens describing things the
|
||||
* switch can match against and bodies to
|
||||
* execute when the match succeeds. */
|
||||
@@ -2398,10 +2412,10 @@ IssueSwitchJumpTable(
|
||||
* Start by allocating the jump table itself, plus some workspace.
|
||||
*/
|
||||
|
||||
jtPtr = ckalloc(sizeof(JumptableInfo));
|
||||
jtPtr = (JumptableInfo *)ckalloc(sizeof(JumptableInfo));
|
||||
Tcl_InitHashTable(&jtPtr->hashTable, TCL_STRING_KEYS);
|
||||
infoIndex = TclCreateAuxData(jtPtr, &tclJumptableInfoType, envPtr);
|
||||
finalFixups = TclStackAlloc(interp, sizeof(int) * (numBodyTokens/2));
|
||||
finalFixups = (int *)TclStackAlloc(interp, sizeof(int) * (numBodyTokens/2));
|
||||
foundDefault = 0;
|
||||
mustGenerate = 1;
|
||||
|
||||
@@ -2569,8 +2583,8 @@ static ClientData
|
||||
DupJumptableInfo(
|
||||
ClientData clientData)
|
||||
{
|
||||
JumptableInfo *jtPtr = clientData;
|
||||
JumptableInfo *newJtPtr = ckalloc(sizeof(JumptableInfo));
|
||||
JumptableInfo *jtPtr = (JumptableInfo *)clientData;
|
||||
JumptableInfo *newJtPtr = (JumptableInfo *)ckalloc(sizeof(JumptableInfo));
|
||||
Tcl_HashEntry *hPtr, *newHPtr;
|
||||
Tcl_HashSearch search;
|
||||
int isNew;
|
||||
@@ -2589,7 +2603,7 @@ static void
|
||||
FreeJumptableInfo(
|
||||
ClientData clientData)
|
||||
{
|
||||
JumptableInfo *jtPtr = clientData;
|
||||
JumptableInfo *jtPtr = (JumptableInfo *)clientData;
|
||||
|
||||
Tcl_DeleteHashTable(&jtPtr->hashTable);
|
||||
ckfree(jtPtr);
|
||||
@@ -2602,15 +2616,16 @@ PrintJumptableInfo(
|
||||
ByteCode *codePtr,
|
||||
unsigned int pcOffset)
|
||||
{
|
||||
JumptableInfo *jtPtr = clientData;
|
||||
JumptableInfo *jtPtr = (JumptableInfo *)clientData;
|
||||
Tcl_HashEntry *hPtr;
|
||||
Tcl_HashSearch search;
|
||||
const char *keyPtr;
|
||||
int offset, i = 0;
|
||||
(void)codePtr;
|
||||
|
||||
hPtr = Tcl_FirstHashEntry(&jtPtr->hashTable, &search);
|
||||
for (; hPtr ; hPtr = Tcl_NextHashEntry(&search)) {
|
||||
keyPtr = Tcl_GetHashKey(&jtPtr->hashTable, hPtr);
|
||||
keyPtr = (const char *)Tcl_GetHashKey(&jtPtr->hashTable, hPtr);
|
||||
offset = PTR2INT(Tcl_GetHashValue(hPtr));
|
||||
|
||||
if (i++) {
|
||||
@@ -2631,16 +2646,18 @@ DisassembleJumptableInfo(
|
||||
ByteCode *codePtr,
|
||||
unsigned int pcOffset)
|
||||
{
|
||||
JumptableInfo *jtPtr = clientData;
|
||||
JumptableInfo *jtPtr = (JumptableInfo *)clientData;
|
||||
Tcl_Obj *mapping = Tcl_NewObj();
|
||||
Tcl_HashEntry *hPtr;
|
||||
Tcl_HashSearch search;
|
||||
const char *keyPtr;
|
||||
int offset;
|
||||
(void)codePtr;
|
||||
(void)pcOffset;
|
||||
|
||||
hPtr = Tcl_FirstHashEntry(&jtPtr->hashTable, &search);
|
||||
for (; hPtr ; hPtr = Tcl_NextHashEntry(&search)) {
|
||||
keyPtr = Tcl_GetHashKey(&jtPtr->hashTable, hPtr);
|
||||
keyPtr = (const char *)Tcl_GetHashKey(&jtPtr->hashTable, hPtr);
|
||||
offset = PTR2INT(Tcl_GetHashValue(hPtr));
|
||||
Tcl_DictObjPut(NULL, mapping, Tcl_NewStringObj(keyPtr, -1),
|
||||
Tcl_NewIntObj(offset));
|
||||
@@ -2678,6 +2695,7 @@ TclCompileTailcallCmd(
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
Tcl_Token *tokenPtr = parsePtr->tokenPtr;
|
||||
int i;
|
||||
(void)cmdPtr;
|
||||
|
||||
if (parsePtr->numWords < 2 || parsePtr->numWords > 256
|
||||
|| envPtr->procPtr == NULL) {
|
||||
@@ -2727,6 +2745,7 @@ TclCompileThrowCmd(
|
||||
Tcl_Token *codeToken, *msgToken;
|
||||
Tcl_Obj *objPtr;
|
||||
int codeKnown, codeIsList, codeIsValid, len;
|
||||
(void)cmdPtr;
|
||||
|
||||
if (numWords != 3) {
|
||||
return TCL_ERROR;
|
||||
@@ -2832,6 +2851,7 @@ TclCompileTryCmd(
|
||||
Tcl_Obj **matchClauses = NULL;
|
||||
int *matchCodes=NULL, *resultVarIndices=NULL, *optionVarIndices=NULL;
|
||||
int i;
|
||||
(void)cmdPtr;
|
||||
|
||||
if (numWords < 2) {
|
||||
return TCL_ERROR;
|
||||
@@ -2859,12 +2879,12 @@ TclCompileTryCmd(
|
||||
numHandlers = numWords >> 2;
|
||||
numWords -= numHandlers * 4;
|
||||
if (numHandlers > 0) {
|
||||
handlerTokens = TclStackAlloc(interp, sizeof(Tcl_Token*)*numHandlers);
|
||||
matchClauses = TclStackAlloc(interp, sizeof(Tcl_Obj *) * numHandlers);
|
||||
handlerTokens = (Tcl_Token**)TclStackAlloc(interp, sizeof(Tcl_Token*)*numHandlers);
|
||||
matchClauses = (Tcl_Obj **)TclStackAlloc(interp, sizeof(Tcl_Obj *) * numHandlers);
|
||||
memset(matchClauses, 0, sizeof(Tcl_Obj *) * numHandlers);
|
||||
matchCodes = TclStackAlloc(interp, sizeof(int) * numHandlers);
|
||||
resultVarIndices = TclStackAlloc(interp, sizeof(int) * numHandlers);
|
||||
optionVarIndices = TclStackAlloc(interp, sizeof(int) * numHandlers);
|
||||
matchCodes = (int *)TclStackAlloc(interp, sizeof(int) * numHandlers);
|
||||
resultVarIndices = (int *)TclStackAlloc(interp, sizeof(int) * numHandlers);
|
||||
optionVarIndices = (int *)TclStackAlloc(interp, sizeof(int) * numHandlers);
|
||||
|
||||
for (i=0 ; i<numHandlers ; i++) {
|
||||
Tcl_Obj *tmpObj, **objv;
|
||||
@@ -3125,9 +3145,9 @@ IssueTryClausesInstructions(
|
||||
* Slight overallocation, but reduces size of this function.
|
||||
*/
|
||||
|
||||
addrsToFix = TclStackAlloc(interp, sizeof(int)*numHandlers);
|
||||
forwardsToFix = TclStackAlloc(interp, sizeof(int)*numHandlers);
|
||||
noError = TclStackAlloc(interp, sizeof(int)*numHandlers);
|
||||
addrsToFix = (int *)TclStackAlloc(interp, sizeof(int)*numHandlers);
|
||||
forwardsToFix = (int *)TclStackAlloc(interp, sizeof(int)*numHandlers);
|
||||
noError = (int *)TclStackAlloc(interp, sizeof(int)*numHandlers);
|
||||
|
||||
for (i=0 ; i<numHandlers ; i++) {
|
||||
noError[i] = -1;
|
||||
@@ -3336,8 +3356,8 @@ IssueTryClausesFinallyInstructions(
|
||||
* Slight overallocation, but reduces size of this function.
|
||||
*/
|
||||
|
||||
addrsToFix = TclStackAlloc(interp, sizeof(int)*numHandlers);
|
||||
forwardsToFix = TclStackAlloc(interp, sizeof(int)*numHandlers);
|
||||
addrsToFix = (int *)TclStackAlloc(interp, sizeof(int)*numHandlers);
|
||||
forwardsToFix = (int *)TclStackAlloc(interp, sizeof(int)*numHandlers);
|
||||
|
||||
for (i=0 ; i<numHandlers ; i++) {
|
||||
int noTrapError, trapError;
|
||||
@@ -3639,6 +3659,7 @@ TclCompileUnsetCmd(
|
||||
Tcl_Token *varTokenPtr;
|
||||
int isScalar, localIndex, flags = 1, i, varCount = 0, haveFlags = 0;
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
(void)cmdPtr;
|
||||
|
||||
/* TODO: Consider support for compiling expanded args. */
|
||||
|
||||
@@ -3781,6 +3802,7 @@ TclCompileWhileCmd(
|
||||
* infinite loop. */
|
||||
Tcl_Obj *boolObj;
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
(void)cmdPtr;
|
||||
|
||||
if (parsePtr->numWords != 3) {
|
||||
return TCL_ERROR;
|
||||
@@ -3952,6 +3974,8 @@ TclCompileYieldCmd(
|
||||
* compiled. */
|
||||
CompileEnv *envPtr) /* Holds resulting instructions. */
|
||||
{
|
||||
(void)cmdPtr;
|
||||
|
||||
if (parsePtr->numWords < 1 || parsePtr->numWords > 2) {
|
||||
return TCL_ERROR;
|
||||
}
|
||||
@@ -3998,6 +4022,7 @@ TclCompileYieldToCmd(
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
Tcl_Token *tokenPtr = TokenAfter(parsePtr->tokenPtr);
|
||||
int i;
|
||||
(void)cmdPtr;
|
||||
|
||||
if (parsePtr->numWords < 2) {
|
||||
return TCL_ERROR;
|
||||
@@ -4245,6 +4270,7 @@ TclCompileInvertOpCmd(
|
||||
* compiled. */
|
||||
CompileEnv *envPtr)
|
||||
{
|
||||
(void)cmdPtr;
|
||||
return CompileUnaryOpCmd(interp, parsePtr, INST_BITNOT, envPtr);
|
||||
}
|
||||
|
||||
@@ -4256,6 +4282,7 @@ TclCompileNotOpCmd(
|
||||
* compiled. */
|
||||
CompileEnv *envPtr)
|
||||
{
|
||||
(void)cmdPtr;
|
||||
return CompileUnaryOpCmd(interp, parsePtr, INST_LNOT, envPtr);
|
||||
}
|
||||
|
||||
@@ -4267,6 +4294,7 @@ TclCompileAddOpCmd(
|
||||
* compiled. */
|
||||
CompileEnv *envPtr)
|
||||
{
|
||||
(void)cmdPtr;
|
||||
return CompileAssociativeBinaryOpCmd(interp, parsePtr, "0", INST_ADD,
|
||||
envPtr);
|
||||
}
|
||||
@@ -4279,6 +4307,7 @@ TclCompileMulOpCmd(
|
||||
* compiled. */
|
||||
CompileEnv *envPtr)
|
||||
{
|
||||
(void)cmdPtr;
|
||||
return CompileAssociativeBinaryOpCmd(interp, parsePtr, "1", INST_MULT,
|
||||
envPtr);
|
||||
}
|
||||
@@ -4291,6 +4320,7 @@ TclCompileAndOpCmd(
|
||||
* compiled. */
|
||||
CompileEnv *envPtr)
|
||||
{
|
||||
(void)cmdPtr;
|
||||
return CompileAssociativeBinaryOpCmd(interp, parsePtr, "-1", INST_BITAND,
|
||||
envPtr);
|
||||
}
|
||||
@@ -4303,6 +4333,7 @@ TclCompileOrOpCmd(
|
||||
* compiled. */
|
||||
CompileEnv *envPtr)
|
||||
{
|
||||
(void)cmdPtr;
|
||||
return CompileAssociativeBinaryOpCmd(interp, parsePtr, "0", INST_BITOR,
|
||||
envPtr);
|
||||
}
|
||||
@@ -4315,6 +4346,7 @@ TclCompileXorOpCmd(
|
||||
* compiled. */
|
||||
CompileEnv *envPtr)
|
||||
{
|
||||
(void)cmdPtr;
|
||||
return CompileAssociativeBinaryOpCmd(interp, parsePtr, "0", INST_BITXOR,
|
||||
envPtr);
|
||||
}
|
||||
@@ -4335,6 +4367,7 @@ TclCompilePowOpCmd(
|
||||
Tcl_Token *tokenPtr = parsePtr->tokenPtr;
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
int words;
|
||||
(void)cmdPtr;
|
||||
|
||||
for (words=1 ; words<parsePtr->numWords ; words++) {
|
||||
tokenPtr = TokenAfter(tokenPtr);
|
||||
@@ -4358,6 +4391,7 @@ TclCompileLshiftOpCmd(
|
||||
* compiled. */
|
||||
CompileEnv *envPtr)
|
||||
{
|
||||
(void)cmdPtr;
|
||||
return CompileStrictlyBinaryOpCmd(interp, parsePtr, INST_LSHIFT, envPtr);
|
||||
}
|
||||
|
||||
@@ -4369,6 +4403,7 @@ TclCompileRshiftOpCmd(
|
||||
* compiled. */
|
||||
CompileEnv *envPtr)
|
||||
{
|
||||
(void)cmdPtr;
|
||||
return CompileStrictlyBinaryOpCmd(interp, parsePtr, INST_RSHIFT, envPtr);
|
||||
}
|
||||
|
||||
@@ -4380,6 +4415,7 @@ TclCompileModOpCmd(
|
||||
* compiled. */
|
||||
CompileEnv *envPtr)
|
||||
{
|
||||
(void)cmdPtr;
|
||||
return CompileStrictlyBinaryOpCmd(interp, parsePtr, INST_MOD, envPtr);
|
||||
}
|
||||
|
||||
@@ -4391,6 +4427,7 @@ TclCompileNeqOpCmd(
|
||||
* compiled. */
|
||||
CompileEnv *envPtr)
|
||||
{
|
||||
(void)cmdPtr;
|
||||
return CompileStrictlyBinaryOpCmd(interp, parsePtr, INST_NEQ, envPtr);
|
||||
}
|
||||
|
||||
@@ -4402,6 +4439,7 @@ TclCompileStrneqOpCmd(
|
||||
* compiled. */
|
||||
CompileEnv *envPtr)
|
||||
{
|
||||
(void)cmdPtr;
|
||||
return CompileStrictlyBinaryOpCmd(interp, parsePtr, INST_STR_NEQ, envPtr);
|
||||
}
|
||||
|
||||
@@ -4413,6 +4451,7 @@ TclCompileInOpCmd(
|
||||
* compiled. */
|
||||
CompileEnv *envPtr)
|
||||
{
|
||||
(void)cmdPtr;
|
||||
return CompileStrictlyBinaryOpCmd(interp, parsePtr, INST_LIST_IN, envPtr);
|
||||
}
|
||||
|
||||
@@ -4424,6 +4463,7 @@ TclCompileNiOpCmd(
|
||||
* compiled. */
|
||||
CompileEnv *envPtr)
|
||||
{
|
||||
(void)cmdPtr;
|
||||
return CompileStrictlyBinaryOpCmd(interp, parsePtr, INST_LIST_NOT_IN,
|
||||
envPtr);
|
||||
}
|
||||
@@ -4436,6 +4476,7 @@ TclCompileLessOpCmd(
|
||||
* compiled. */
|
||||
CompileEnv *envPtr)
|
||||
{
|
||||
(void)cmdPtr;
|
||||
return CompileComparisonOpCmd(interp, parsePtr, INST_LT, envPtr);
|
||||
}
|
||||
|
||||
@@ -4447,6 +4488,7 @@ TclCompileLeqOpCmd(
|
||||
* compiled. */
|
||||
CompileEnv *envPtr)
|
||||
{
|
||||
(void)cmdPtr;
|
||||
return CompileComparisonOpCmd(interp, parsePtr, INST_LE, envPtr);
|
||||
}
|
||||
|
||||
@@ -4458,6 +4500,7 @@ TclCompileGreaterOpCmd(
|
||||
* compiled. */
|
||||
CompileEnv *envPtr)
|
||||
{
|
||||
(void)cmdPtr;
|
||||
return CompileComparisonOpCmd(interp, parsePtr, INST_GT, envPtr);
|
||||
}
|
||||
|
||||
@@ -4469,6 +4512,7 @@ TclCompileGeqOpCmd(
|
||||
* compiled. */
|
||||
CompileEnv *envPtr)
|
||||
{
|
||||
(void)cmdPtr;
|
||||
return CompileComparisonOpCmd(interp, parsePtr, INST_GE, envPtr);
|
||||
}
|
||||
|
||||
@@ -4480,6 +4524,7 @@ TclCompileEqOpCmd(
|
||||
* compiled. */
|
||||
CompileEnv *envPtr)
|
||||
{
|
||||
(void)cmdPtr;
|
||||
return CompileComparisonOpCmd(interp, parsePtr, INST_EQ, envPtr);
|
||||
}
|
||||
|
||||
@@ -4491,6 +4536,7 @@ TclCompileStreqOpCmd(
|
||||
* compiled. */
|
||||
CompileEnv *envPtr)
|
||||
{
|
||||
(void)cmdPtr;
|
||||
return CompileComparisonOpCmd(interp, parsePtr, INST_STR_EQ, envPtr);
|
||||
}
|
||||
|
||||
@@ -4502,6 +4548,7 @@ TclCompileStrLtOpCmd(
|
||||
* compiled. */
|
||||
CompileEnv *envPtr)
|
||||
{
|
||||
(void)cmdPtr;
|
||||
return CompileComparisonOpCmd(interp, parsePtr, INST_STR_LT, envPtr);
|
||||
}
|
||||
|
||||
@@ -4513,6 +4560,7 @@ TclCompileStrLeOpCmd(
|
||||
* compiled. */
|
||||
CompileEnv *envPtr)
|
||||
{
|
||||
(void)cmdPtr;
|
||||
return CompileComparisonOpCmd(interp, parsePtr, INST_STR_LE, envPtr);
|
||||
}
|
||||
|
||||
@@ -4524,6 +4572,7 @@ TclCompileStrGtOpCmd(
|
||||
* compiled. */
|
||||
CompileEnv *envPtr)
|
||||
{
|
||||
(void)cmdPtr;
|
||||
return CompileComparisonOpCmd(interp, parsePtr, INST_STR_GT, envPtr);
|
||||
}
|
||||
|
||||
@@ -4535,6 +4584,7 @@ TclCompileStrGeOpCmd(
|
||||
* compiled. */
|
||||
CompileEnv *envPtr)
|
||||
{
|
||||
(void)cmdPtr;
|
||||
return CompileComparisonOpCmd(interp, parsePtr, INST_STR_GE, envPtr);
|
||||
}
|
||||
|
||||
@@ -4549,6 +4599,7 @@ TclCompileMinusOpCmd(
|
||||
Tcl_Token *tokenPtr = parsePtr->tokenPtr;
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
int words;
|
||||
(void)cmdPtr;
|
||||
|
||||
/* TODO: Consider support for compiling expanded args. */
|
||||
if (parsePtr->numWords == 1) {
|
||||
@@ -4595,6 +4646,7 @@ TclCompileDivOpCmd(
|
||||
Tcl_Token *tokenPtr = parsePtr->tokenPtr;
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
int words;
|
||||
(void)cmdPtr;
|
||||
|
||||
/* TODO: Consider support for compiling expanded args. */
|
||||
if (parsePtr->numWords == 1) {
|
||||
|
||||
+16
-16
@@ -631,7 +631,7 @@ ParseExpr(
|
||||
|
||||
TclParseInit(interp, start, numBytes, parsePtr);
|
||||
|
||||
nodes = attemptckalloc(nodesAvailable * sizeof(OpNode));
|
||||
nodes = (OpNode *)attemptckalloc(nodesAvailable * sizeof(OpNode));
|
||||
if (nodes == NULL) {
|
||||
TclNewLiteralStringObj(msg, "not enough memory to parse expression");
|
||||
errCode = "NOMEM";
|
||||
@@ -675,7 +675,7 @@ ParseExpr(
|
||||
|
||||
do {
|
||||
if (size <= UINT_MAX/sizeof(OpNode)) {
|
||||
newPtr = attemptckrealloc(nodes, size * sizeof(OpNode));
|
||||
newPtr = (OpNode *)attemptckrealloc(nodes, size * sizeof(OpNode));
|
||||
}
|
||||
} while ((newPtr == NULL)
|
||||
&& ((size -= (size - nodesUsed) / 2) > nodesUsed));
|
||||
@@ -919,7 +919,7 @@ ParseExpr(
|
||||
break;
|
||||
|
||||
case SCRIPT: {
|
||||
Tcl_Parse *nestedPtr =
|
||||
Tcl_Parse *nestedPtr = (Tcl_Parse *)
|
||||
TclStackAlloc(interp, sizeof(Tcl_Parse));
|
||||
|
||||
tokenPtr = parsePtr->tokenPtr + parsePtr->numTokens;
|
||||
@@ -1838,7 +1838,7 @@ Tcl_ParseExpr(
|
||||
OpNode *opTree = NULL; /* Will point to the tree of operators. */
|
||||
Tcl_Obj *litList = Tcl_NewObj(); /* List to hold the literals. */
|
||||
Tcl_Obj *funcList = Tcl_NewObj(); /* List to hold the functon names. */
|
||||
Tcl_Parse *exprParsePtr = TclStackAlloc(interp, sizeof(Tcl_Parse));
|
||||
Tcl_Parse *exprParsePtr = (Tcl_Parse *)TclStackAlloc(interp, sizeof(Tcl_Parse));
|
||||
/* Holds the Tcl_Tokens of substitutions. */
|
||||
|
||||
if (numBytes < 0) {
|
||||
@@ -2156,7 +2156,7 @@ TclCompileExpr(
|
||||
OpNode *opTree = NULL; /* Will point to the tree of operators */
|
||||
Tcl_Obj *litList = Tcl_NewObj(); /* List to hold the literals */
|
||||
Tcl_Obj *funcList = Tcl_NewObj(); /* List to hold the functon names*/
|
||||
Tcl_Parse *parsePtr = TclStackAlloc(interp, sizeof(Tcl_Parse));
|
||||
Tcl_Parse *parsePtr = (Tcl_Parse *)TclStackAlloc(interp, sizeof(Tcl_Parse));
|
||||
/* Holds the Tcl_Tokens of substitutions */
|
||||
|
||||
int code = ParseExpr(interp, script, numBytes, &opTree, litList,
|
||||
@@ -2226,7 +2226,7 @@ ExecConstantExprTree(
|
||||
* bytecode, so there's no need to tend to TIP 280 issues.
|
||||
*/
|
||||
|
||||
envPtr = TclStackAlloc(interp, sizeof(CompileEnv));
|
||||
envPtr = (CompileEnv *)TclStackAlloc(interp, sizeof(CompileEnv));
|
||||
TclInitCompileEnv(interp, envPtr, NULL, 0, NULL, 0);
|
||||
CompileExprTree(interp, nodes, index, litObjvPtr, NULL, NULL, envPtr,
|
||||
0 /* optimize */);
|
||||
@@ -2321,13 +2321,13 @@ CompileExprTree(
|
||||
break;
|
||||
}
|
||||
case QUESTION:
|
||||
newJump = TclStackAlloc(interp, sizeof(JumpList));
|
||||
newJump = (JumpList *)TclStackAlloc(interp, sizeof(JumpList));
|
||||
newJump->next = jumpPtr;
|
||||
jumpPtr = newJump;
|
||||
TclEmitForwardJump(envPtr, TCL_FALSE_JUMP, &jumpPtr->jump);
|
||||
break;
|
||||
case COLON:
|
||||
newJump = TclStackAlloc(interp, sizeof(JumpList));
|
||||
newJump = (JumpList *)TclStackAlloc(interp, sizeof(JumpList));
|
||||
newJump->next = jumpPtr;
|
||||
jumpPtr = newJump;
|
||||
TclEmitForwardJump(envPtr, TCL_UNCONDITIONAL_JUMP,
|
||||
@@ -2340,7 +2340,7 @@ CompileExprTree(
|
||||
break;
|
||||
case AND:
|
||||
case OR:
|
||||
newJump = TclStackAlloc(interp, sizeof(JumpList));
|
||||
newJump = (JumpList *)TclStackAlloc(interp, sizeof(JumpList));
|
||||
newJump->next = jumpPtr;
|
||||
jumpPtr = newJump;
|
||||
TclEmitForwardJump(envPtr, (nodePtr->lexeme == AND)
|
||||
@@ -2573,7 +2573,7 @@ TclSingleOpCmd(
|
||||
int objc,
|
||||
Tcl_Obj *const objv[])
|
||||
{
|
||||
TclOpCmdClientData *occdPtr = clientData;
|
||||
TclOpCmdClientData *occdPtr = (TclOpCmdClientData *)clientData;
|
||||
unsigned char lexeme;
|
||||
OpNode nodes[2];
|
||||
Tcl_Obj *const *litObjv = objv + 1;
|
||||
@@ -2631,10 +2631,10 @@ TclSortingOpCmd(
|
||||
if (objc < 3) {
|
||||
Tcl_SetObjResult(interp, Tcl_NewBooleanObj(1));
|
||||
} else {
|
||||
TclOpCmdClientData *occdPtr = clientData;
|
||||
Tcl_Obj **litObjv = TclStackAlloc(interp,
|
||||
TclOpCmdClientData *occdPtr = (TclOpCmdClientData *)clientData;
|
||||
Tcl_Obj **litObjv = (Tcl_Obj **)TclStackAlloc(interp,
|
||||
2 * (objc-2) * sizeof(Tcl_Obj *));
|
||||
OpNode *nodes = TclStackAlloc(interp, 2 * (objc-2) * sizeof(OpNode));
|
||||
OpNode *nodes = (OpNode *)TclStackAlloc(interp, 2 * (objc-2) * sizeof(OpNode));
|
||||
unsigned char lexeme;
|
||||
int i, lastAnd = 1;
|
||||
Tcl_Obj *const *litObjPtrPtr = litObjv;
|
||||
@@ -2706,7 +2706,7 @@ TclVariadicOpCmd(
|
||||
int objc,
|
||||
Tcl_Obj *const objv[])
|
||||
{
|
||||
TclOpCmdClientData *occdPtr = clientData;
|
||||
TclOpCmdClientData *occdPtr = (TclOpCmdClientData *)clientData;
|
||||
unsigned char lexeme;
|
||||
int code;
|
||||
|
||||
@@ -2761,7 +2761,7 @@ TclVariadicOpCmd(
|
||||
return code;
|
||||
} else {
|
||||
Tcl_Obj *const *litObjv = objv + 1;
|
||||
OpNode *nodes = TclStackAlloc(interp, (objc-1) * sizeof(OpNode));
|
||||
OpNode *nodes = (OpNode *)TclStackAlloc(interp, (objc-1) * sizeof(OpNode));
|
||||
int i, lastOp = OT_LITERAL;
|
||||
|
||||
nodes[0].lexeme = START;
|
||||
@@ -2825,7 +2825,7 @@ TclNoIdentOpCmd(
|
||||
int objc,
|
||||
Tcl_Obj *const objv[])
|
||||
{
|
||||
TclOpCmdClientData *occdPtr = clientData;
|
||||
TclOpCmdClientData *occdPtr = (TclOpCmdClientData *)clientData;
|
||||
|
||||
if (objc < 2) {
|
||||
Tcl_WrongNumArgs(interp, 1, objv, occdPtr->expected);
|
||||
|
||||
+37
-34
@@ -712,7 +712,7 @@ static void StartExpanding(CompileEnv *envPtr);
|
||||
* commands.
|
||||
*/
|
||||
static void EnterCmdWordData(ExtCmdLoc *eclPtr, int srcOffset,
|
||||
Tcl_Token *tokenPtr, const char *cmd, int len,
|
||||
Tcl_Token *tokenPtr, const char *cmd,
|
||||
int numWords, int line, int *clNext, int **lines,
|
||||
CompileEnv *envPtr);
|
||||
static void ReleaseCmdWordData(ExtCmdLoc *eclPtr);
|
||||
@@ -797,7 +797,7 @@ TclSetByteCodeFromAny(
|
||||
#ifdef TCL_COMPILE_DEBUG
|
||||
if (!traceInitialized) {
|
||||
if (Tcl_LinkVar(interp, "tcl_traceCompile",
|
||||
(char *) &tclTraceCompile, TCL_LINK_INT) != TCL_OK) {
|
||||
&tclTraceCompile, TCL_LINK_INT) != TCL_OK) {
|
||||
Tcl_Panic("SetByteCodeFromAny: unable to create link for tcl_traceCompile variable");
|
||||
}
|
||||
traceInitialized = 1;
|
||||
@@ -965,6 +965,8 @@ DupByteCodeInternalRep(
|
||||
Tcl_Obj *srcPtr, /* Object with internal rep to copy. */
|
||||
Tcl_Obj *copyPtr) /* Object with internal rep to set. */
|
||||
{
|
||||
(void)srcPtr;
|
||||
(void)copyPtr;
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1148,7 +1150,7 @@ CleanupByteCode(
|
||||
(char *) codePtr);
|
||||
|
||||
if (hePtr) {
|
||||
ReleaseCmdWordData(Tcl_GetHashValue(hePtr));
|
||||
ReleaseCmdWordData((ExtCmdLoc *)Tcl_GetHashValue(hePtr));
|
||||
Tcl_DeleteHashEntry(hePtr);
|
||||
}
|
||||
}
|
||||
@@ -1174,11 +1176,12 @@ CleanupByteCode(
|
||||
|
||||
static int
|
||||
IsCompactibleCompileEnv(
|
||||
Tcl_Interp *interp,
|
||||
Tcl_Interp *dummy,
|
||||
CompileEnv *envPtr)
|
||||
{
|
||||
unsigned char *pc;
|
||||
int size;
|
||||
(void)dummy;
|
||||
|
||||
/*
|
||||
* Special: procedures in the '::tcl' namespace (or its children) are
|
||||
@@ -1498,7 +1501,7 @@ TclInitCompileEnv(
|
||||
* non-compiling evaluator
|
||||
*/
|
||||
|
||||
envPtr->extCmdMapPtr = ckalloc(sizeof(ExtCmdLoc));
|
||||
envPtr->extCmdMapPtr = (ExtCmdLoc *)ckalloc(sizeof(ExtCmdLoc));
|
||||
envPtr->extCmdMapPtr->loc = NULL;
|
||||
envPtr->extCmdMapPtr->nloc = 0;
|
||||
envPtr->extCmdMapPtr->nuloc = 0;
|
||||
@@ -1554,7 +1557,7 @@ TclInitCompileEnv(
|
||||
* ...) which may make change the type as well.
|
||||
*/
|
||||
|
||||
CmdFrame *ctxPtr = TclStackAlloc(interp, sizeof(CmdFrame));
|
||||
CmdFrame *ctxPtr = (CmdFrame *)TclStackAlloc(interp, sizeof(CmdFrame));
|
||||
int pc = 0;
|
||||
|
||||
*ctxPtr = *invoker;
|
||||
@@ -2065,7 +2068,7 @@ CompileCommandTokens(
|
||||
|
||||
EnterCmdWordData(eclPtr, parsePtr->commandStart - envPtr->source,
|
||||
parsePtr->tokenPtr, parsePtr->commandStart,
|
||||
parsePtr->commandSize, parsePtr->numWords, cmdLine,
|
||||
parsePtr->numWords, cmdLine,
|
||||
clNext, &wlines, envPtr);
|
||||
wlineat = eclPtr->nuloc - 1;
|
||||
|
||||
@@ -2187,7 +2190,7 @@ TclCompileScript(
|
||||
* many nested compilations (body enclosed in body) can cause abnormal
|
||||
* program termination with a stack overflow exception, bug [fec0c17d39].
|
||||
*/
|
||||
Tcl_Parse *parsePtr = ckalloc(sizeof(Tcl_Parse));
|
||||
Tcl_Parse *parsePtr = (Tcl_Parse *)ckalloc(sizeof(Tcl_Parse));
|
||||
|
||||
do {
|
||||
const char *next;
|
||||
@@ -2445,7 +2448,7 @@ TclCompileTokens(
|
||||
|
||||
if (isLiteral) {
|
||||
maxNumCL = NUM_STATIC_POS;
|
||||
clPosition = ckalloc(maxNumCL * sizeof(int));
|
||||
clPosition = (int *)ckalloc(maxNumCL * sizeof(int));
|
||||
}
|
||||
|
||||
adjust = 0;
|
||||
@@ -2486,7 +2489,7 @@ TclCompileTokens(
|
||||
|
||||
if (numCL >= maxNumCL) {
|
||||
maxNumCL *= 2;
|
||||
clPosition = ckrealloc(clPosition,
|
||||
clPosition = (int *)ckrealloc(clPosition,
|
||||
maxNumCL * sizeof(int));
|
||||
}
|
||||
clPosition[numCL] = clPos;
|
||||
@@ -2743,6 +2746,7 @@ TclCompileNoOp(
|
||||
{
|
||||
Tcl_Token *tokenPtr;
|
||||
int i;
|
||||
(void)cmdPtr;
|
||||
|
||||
tokenPtr = parsePtr->tokenPtr;
|
||||
for (i = 1; i < parsePtr->numWords; i++) {
|
||||
@@ -2860,7 +2864,7 @@ TclInitByteCode(
|
||||
namespacePtr = envPtr->iPtr->globalNsPtr;
|
||||
}
|
||||
|
||||
p = ckalloc(structureSize);
|
||||
p = (unsigned char *)ckalloc(structureSize);
|
||||
codePtr = (ByteCode *) p;
|
||||
codePtr->interpHandle = TclHandlePreserve(iPtr->handle);
|
||||
codePtr->compileEpoch = iPtr->compileEpoch;
|
||||
@@ -3073,7 +3077,7 @@ TclFindCompiledLocal(
|
||||
|
||||
if (create || (name == NULL)) {
|
||||
localVar = procPtr->numCompiledLocals;
|
||||
localPtr = ckalloc(offsetof(CompiledLocal, name) + nameBytes + 1);
|
||||
localPtr = (CompiledLocal *)ckalloc(offsetof(CompiledLocal, name) + nameBytes + 1);
|
||||
if (procPtr->firstLocalPtr == NULL) {
|
||||
procPtr->firstLocalPtr = procPtr->lastLocalPtr = localPtr;
|
||||
} else {
|
||||
@@ -3123,7 +3127,7 @@ TclExpandCodeArray(
|
||||
void *envArgPtr) /* Points to the CompileEnv whose code array
|
||||
* must be enlarged. */
|
||||
{
|
||||
CompileEnv *envPtr = envArgPtr;
|
||||
CompileEnv *envPtr = (CompileEnv *)envArgPtr;
|
||||
/* The CompileEnv containing the code array to
|
||||
* be doubled in size. */
|
||||
|
||||
@@ -3137,14 +3141,14 @@ TclExpandCodeArray(
|
||||
size_t newBytes = 2 * (envPtr->codeEnd - envPtr->codeStart);
|
||||
|
||||
if (envPtr->mallocedCodeArray) {
|
||||
envPtr->codeStart = ckrealloc(envPtr->codeStart, newBytes);
|
||||
envPtr->codeStart = (unsigned char *)ckrealloc(envPtr->codeStart, newBytes);
|
||||
} else {
|
||||
/*
|
||||
* envPtr->codeStart isn't a ckalloc'd pointer, so we must code a
|
||||
* ckrealloc equivalent for ourselves.
|
||||
*/
|
||||
|
||||
unsigned char *newPtr = ckalloc(newBytes);
|
||||
unsigned char *newPtr = (unsigned char *)ckalloc(newBytes);
|
||||
|
||||
memcpy(newPtr, envPtr->codeStart, currBytes);
|
||||
envPtr->codeStart = newPtr;
|
||||
@@ -3204,14 +3208,14 @@ EnterCmdStartData(
|
||||
size_t newBytes = newElems * sizeof(CmdLocation);
|
||||
|
||||
if (envPtr->mallocedCmdMap) {
|
||||
envPtr->cmdMapPtr = ckrealloc(envPtr->cmdMapPtr, newBytes);
|
||||
envPtr->cmdMapPtr = (CmdLocation *)ckrealloc(envPtr->cmdMapPtr, newBytes);
|
||||
} else {
|
||||
/*
|
||||
* envPtr->cmdMapPtr isn't a ckalloc'd pointer, so we must code a
|
||||
* ckrealloc equivalent for ourselves.
|
||||
*/
|
||||
|
||||
CmdLocation *newPtr = ckalloc(newBytes);
|
||||
CmdLocation *newPtr = (CmdLocation *)ckalloc(newBytes);
|
||||
|
||||
memcpy(newPtr, envPtr->cmdMapPtr, currBytes);
|
||||
envPtr->cmdMapPtr = newPtr;
|
||||
@@ -3308,7 +3312,6 @@ EnterCmdWordData(
|
||||
int srcOffset, /* Offset of first char of the command. */
|
||||
Tcl_Token *tokenPtr,
|
||||
const char *cmd,
|
||||
int len,
|
||||
int numWords,
|
||||
int line,
|
||||
int *clNext,
|
||||
@@ -3330,16 +3333,16 @@ EnterCmdWordData(
|
||||
size_t newElems = (currElems ? 2*currElems : 1);
|
||||
size_t newBytes = newElems * sizeof(ECL);
|
||||
|
||||
eclPtr->loc = ckrealloc(eclPtr->loc, newBytes);
|
||||
eclPtr->loc = (ECL *)ckrealloc(eclPtr->loc, newBytes);
|
||||
eclPtr->nloc = newElems;
|
||||
}
|
||||
|
||||
ePtr = &eclPtr->loc[eclPtr->nuloc];
|
||||
ePtr->srcOffset = srcOffset;
|
||||
ePtr->line = ckalloc(numWords * sizeof(int));
|
||||
ePtr->next = ckalloc(numWords * sizeof(int *));
|
||||
ePtr->line = (int *)ckalloc(numWords * sizeof(int));
|
||||
ePtr->next = (int **)ckalloc(numWords * sizeof(int *));
|
||||
ePtr->nline = numWords;
|
||||
wwlines = ckalloc(numWords * sizeof(int));
|
||||
wwlines = (int *)ckalloc(numWords * sizeof(int));
|
||||
|
||||
last = cmd;
|
||||
wordLine = line;
|
||||
@@ -3408,17 +3411,17 @@ TclCreateExceptRange(
|
||||
|
||||
if (envPtr->mallocedExceptArray) {
|
||||
envPtr->exceptArrayPtr =
|
||||
ckrealloc(envPtr->exceptArrayPtr, newBytes);
|
||||
(ExceptionRange *)ckrealloc(envPtr->exceptArrayPtr, newBytes);
|
||||
envPtr->exceptAuxArrayPtr =
|
||||
ckrealloc(envPtr->exceptAuxArrayPtr, newBytes2);
|
||||
(ExceptionAux *)ckrealloc(envPtr->exceptAuxArrayPtr, newBytes2);
|
||||
} else {
|
||||
/*
|
||||
* envPtr->exceptArrayPtr isn't a ckalloc'd pointer, so we must
|
||||
* code a ckrealloc equivalent for ourselves.
|
||||
*/
|
||||
|
||||
ExceptionRange *newPtr = ckalloc(newBytes);
|
||||
ExceptionAux *newPtr2 = ckalloc(newBytes2);
|
||||
ExceptionRange *newPtr = (ExceptionRange *)ckalloc(newBytes);
|
||||
ExceptionAux *newPtr2 = (ExceptionAux *)ckalloc(newBytes2);
|
||||
|
||||
memcpy(newPtr, envPtr->exceptArrayPtr, currBytes);
|
||||
memcpy(newPtr2, envPtr->exceptAuxArrayPtr, currBytes2);
|
||||
@@ -3521,11 +3524,11 @@ TclAddLoopBreakFixup(
|
||||
auxPtr->allocBreakTargets *= 2;
|
||||
auxPtr->allocBreakTargets += 2;
|
||||
if (auxPtr->breakTargets) {
|
||||
auxPtr->breakTargets = ckrealloc(auxPtr->breakTargets,
|
||||
auxPtr->breakTargets = (unsigned int *)ckrealloc(auxPtr->breakTargets,
|
||||
sizeof(int) * auxPtr->allocBreakTargets);
|
||||
} else {
|
||||
auxPtr->breakTargets =
|
||||
ckalloc(sizeof(int) * auxPtr->allocBreakTargets);
|
||||
(unsigned int *)ckalloc(sizeof(int) * auxPtr->allocBreakTargets);
|
||||
}
|
||||
}
|
||||
auxPtr->breakTargets[auxPtr->numBreakTargets - 1] = CurrentOffset(envPtr);
|
||||
@@ -3547,11 +3550,11 @@ TclAddLoopContinueFixup(
|
||||
auxPtr->allocContinueTargets *= 2;
|
||||
auxPtr->allocContinueTargets += 2;
|
||||
if (auxPtr->continueTargets) {
|
||||
auxPtr->continueTargets = ckrealloc(auxPtr->continueTargets,
|
||||
auxPtr->continueTargets = (unsigned int *)ckrealloc(auxPtr->continueTargets,
|
||||
sizeof(int) * auxPtr->allocContinueTargets);
|
||||
} else {
|
||||
auxPtr->continueTargets =
|
||||
ckalloc(sizeof(int) * auxPtr->allocContinueTargets);
|
||||
(unsigned int *)ckalloc(sizeof(int) * auxPtr->allocContinueTargets);
|
||||
}
|
||||
}
|
||||
auxPtr->continueTargets[auxPtr->numContinueTargets - 1] =
|
||||
@@ -3774,14 +3777,14 @@ TclCreateAuxData(
|
||||
|
||||
if (envPtr->mallocedAuxDataArray) {
|
||||
envPtr->auxDataArrayPtr =
|
||||
ckrealloc(envPtr->auxDataArrayPtr, newBytes);
|
||||
(AuxData *)ckrealloc(envPtr->auxDataArrayPtr, newBytes);
|
||||
} else {
|
||||
/*
|
||||
* envPtr->auxDataArrayPtr isn't a ckalloc'd pointer, so we must
|
||||
* code a ckrealloc equivalent for ourselves.
|
||||
*/
|
||||
|
||||
AuxData *newPtr = ckalloc(newBytes);
|
||||
AuxData *newPtr = (AuxData *)ckalloc(newBytes);
|
||||
|
||||
memcpy(newPtr, envPtr->auxDataArrayPtr, currBytes);
|
||||
envPtr->auxDataArrayPtr = newPtr;
|
||||
@@ -3863,14 +3866,14 @@ TclExpandJumpFixupArray(
|
||||
size_t newBytes = newElems * sizeof(JumpFixup);
|
||||
|
||||
if (fixupArrayPtr->mallocedArray) {
|
||||
fixupArrayPtr->fixup = ckrealloc(fixupArrayPtr->fixup, newBytes);
|
||||
fixupArrayPtr->fixup = (JumpFixup *)ckrealloc(fixupArrayPtr->fixup, newBytes);
|
||||
} else {
|
||||
/*
|
||||
* fixupArrayPtr->fixup isn't a ckalloc'd pointer, so we must code a
|
||||
* ckrealloc equivalent for ourselves.
|
||||
*/
|
||||
|
||||
JumpFixup *newPtr = ckalloc(newBytes);
|
||||
JumpFixup *newPtr = (JumpFixup *)ckalloc(newBytes);
|
||||
|
||||
memcpy(newPtr, fixupArrayPtr->fixup, currBytes);
|
||||
fixupArrayPtr->fixup = newPtr;
|
||||
|
||||
+8
-7
@@ -79,11 +79,11 @@ Tcl_RegisterConfig(
|
||||
Tcl_Obj *pDB, *pkgDict;
|
||||
Tcl_DString cmdName;
|
||||
const Tcl_Config *cfg;
|
||||
QCCD *cdPtr = ckalloc(sizeof(QCCD));
|
||||
QCCD *cdPtr = (QCCD *)ckalloc(sizeof(QCCD));
|
||||
|
||||
cdPtr->interp = interp;
|
||||
if (valEncoding) {
|
||||
cdPtr->encoding = ckalloc(strlen(valEncoding)+1);
|
||||
cdPtr->encoding = (char *)ckalloc(strlen(valEncoding)+1);
|
||||
strcpy(cdPtr->encoding, valEncoding);
|
||||
} else {
|
||||
cdPtr->encoding = NULL;
|
||||
@@ -199,7 +199,7 @@ QueryConfigObjCmd(
|
||||
int objc,
|
||||
struct Tcl_Obj *const *objv)
|
||||
{
|
||||
QCCD *cdPtr = clientData;
|
||||
QCCD *cdPtr = (QCCD *)clientData;
|
||||
Tcl_Obj *pkgName = cdPtr->pkg;
|
||||
Tcl_Obj *pDB, *pkgDict, *val, *listPtr;
|
||||
int n, index;
|
||||
@@ -326,7 +326,7 @@ static void
|
||||
QueryConfigDelete(
|
||||
ClientData clientData)
|
||||
{
|
||||
QCCD *cdPtr = clientData;
|
||||
QCCD *cdPtr = (QCCD *)clientData;
|
||||
Tcl_Obj *pkgName = cdPtr->pkg;
|
||||
Tcl_Obj *pDB = GetConfigDict(cdPtr->interp);
|
||||
|
||||
@@ -359,7 +359,7 @@ static Tcl_Obj *
|
||||
GetConfigDict(
|
||||
Tcl_Interp *interp)
|
||||
{
|
||||
Tcl_Obj *pDB = Tcl_GetAssocData(interp, ASSOC_KEY, NULL);
|
||||
Tcl_Obj *pDB = (Tcl_Obj *)Tcl_GetAssocData(interp, ASSOC_KEY, NULL);
|
||||
|
||||
if (pDB == NULL) {
|
||||
pDB = Tcl_NewDictObj();
|
||||
@@ -392,9 +392,10 @@ GetConfigDict(
|
||||
static void
|
||||
ConfigDictDeleteProc(
|
||||
ClientData clientData, /* Pointer to Tcl_Obj. */
|
||||
Tcl_Interp *interp) /* Interpreter being deleted. */
|
||||
Tcl_Interp *dummy) /* Interpreter being deleted. */
|
||||
{
|
||||
Tcl_Obj *pDB = clientData;
|
||||
Tcl_Obj *pDB = (Tcl_Obj *)clientData;
|
||||
(void)dummy;
|
||||
|
||||
Tcl_DecrRefCount(pDB);
|
||||
}
|
||||
|
||||
+3
-2
@@ -2744,7 +2744,7 @@ TclDatelex(
|
||||
|
||||
int
|
||||
TclClockOldscanObjCmd(
|
||||
void *clientData, /* Unused */
|
||||
void *dummy, /* Unused */
|
||||
Tcl_Interp *interp, /* Tcl interpreter */
|
||||
int objc, /* Count of paraneters */
|
||||
Tcl_Obj *const *objv) /* Parameters */
|
||||
@@ -2754,6 +2754,7 @@ TclClockOldscanObjCmd(
|
||||
DateInfo dateInfo;
|
||||
DateInfo* info = &dateInfo;
|
||||
int status;
|
||||
(void)dummy;
|
||||
|
||||
if (objc != 5) {
|
||||
Tcl_WrongNumArgs(interp, 1, objv,
|
||||
@@ -2858,7 +2859,7 @@ TclClockOldscanObjCmd(
|
||||
|
||||
if (yyHaveTime) {
|
||||
Tcl_ListObjAppendElement(interp, result, Tcl_NewIntObj((int)
|
||||
ToSeconds(yyHour, yyMinutes, yySeconds, yyMeridian)));
|
||||
ToSeconds(yyHour, yyMinutes, yySeconds, (MERIDIAN)yyMeridian)));
|
||||
} else {
|
||||
Tcl_ListObjAppendElement(interp, result, Tcl_NewObj());
|
||||
}
|
||||
|
||||
+55
-35
@@ -143,7 +143,7 @@ EXTERN Tcl_Obj * Tcl_DbNewStringObj(const char *bytes, int length,
|
||||
/* 29 */
|
||||
EXTERN Tcl_Obj * Tcl_DuplicateObj(Tcl_Obj *objPtr);
|
||||
/* 30 */
|
||||
EXTERN void TclOldFreeObj(Tcl_Obj *objPtr);
|
||||
EXTERN void TclFreeObj(Tcl_Obj *objPtr);
|
||||
/* 31 */
|
||||
EXTERN int Tcl_GetBoolean(Tcl_Interp *interp, const char *src,
|
||||
int *boolPtr);
|
||||
@@ -478,7 +478,8 @@ EXTERN Tcl_HashEntry * Tcl_FirstHashEntry(Tcl_HashTable *tablePtr,
|
||||
/* 146 */
|
||||
EXTERN int Tcl_Flush(Tcl_Channel chan);
|
||||
/* 147 */
|
||||
EXTERN void Tcl_FreeResult(Tcl_Interp *interp);
|
||||
TCL_DEPRECATED("see TIP #559. Use Tcl_ResetResult")
|
||||
void Tcl_FreeResult(Tcl_Interp *interp);
|
||||
/* 148 */
|
||||
EXTERN int Tcl_GetAlias(Tcl_Interp *interp,
|
||||
const char *slaveCmd,
|
||||
@@ -1063,9 +1064,11 @@ EXTERN int Tcl_UniCharIsUpper(int ch);
|
||||
/* 351 */
|
||||
EXTERN int Tcl_UniCharIsWordChar(int ch);
|
||||
/* 352 */
|
||||
EXTERN int Tcl_UniCharLen(const Tcl_UniChar *uniStr);
|
||||
TCL_DEPRECATED("Use Tcl_GetCharLength")
|
||||
int Tcl_UniCharLen(const Tcl_UniChar *uniStr);
|
||||
/* 353 */
|
||||
EXTERN int Tcl_UniCharNcmp(const Tcl_UniChar *ucs,
|
||||
TCL_DEPRECATED("Use Tcl_UtfNcmp")
|
||||
int Tcl_UniCharNcmp(const Tcl_UniChar *ucs,
|
||||
const Tcl_UniChar *uct,
|
||||
unsigned long numChars);
|
||||
/* 354 */
|
||||
@@ -1156,7 +1159,8 @@ Tcl_UniChar * Tcl_GetUnicode(Tcl_Obj *objPtr);
|
||||
/* 383 */
|
||||
EXTERN Tcl_Obj * Tcl_GetRange(Tcl_Obj *objPtr, int first, int last);
|
||||
/* 384 */
|
||||
EXTERN void Tcl_AppendUnicodeToObj(Tcl_Obj *objPtr,
|
||||
TCL_DEPRECATED("Use Tcl_AppendStringsToObj")
|
||||
void Tcl_AppendUnicodeToObj(Tcl_Obj *objPtr,
|
||||
const Tcl_UniChar *unicode, int length);
|
||||
/* 385 */
|
||||
EXTERN int Tcl_RegExpMatchObj(Tcl_Interp *interp,
|
||||
@@ -1250,11 +1254,13 @@ EXTERN void Tcl_ClearChannelHandlers(Tcl_Channel channel);
|
||||
/* 418 */
|
||||
EXTERN int Tcl_IsChannelExisting(const char *channelName);
|
||||
/* 419 */
|
||||
EXTERN int Tcl_UniCharNcasecmp(const Tcl_UniChar *ucs,
|
||||
TCL_DEPRECATED("Use Tcl_UtfNcasecmp")
|
||||
int Tcl_UniCharNcasecmp(const Tcl_UniChar *ucs,
|
||||
const Tcl_UniChar *uct,
|
||||
unsigned long numChars);
|
||||
/* 420 */
|
||||
EXTERN int Tcl_UniCharCaseMatch(const Tcl_UniChar *uniStr,
|
||||
TCL_DEPRECATED("Use Tcl_StringCaseMatch")
|
||||
int Tcl_UniCharCaseMatch(const Tcl_UniChar *uniStr,
|
||||
const Tcl_UniChar *uniPattern, int nocase);
|
||||
/* 421 */
|
||||
EXTERN Tcl_HashEntry * Tcl_FindHashEntry(Tcl_HashTable *tablePtr,
|
||||
@@ -1644,18 +1650,18 @@ EXTERN void Tcl_QueryTimeProc(Tcl_GetTimeProc **getProc,
|
||||
EXTERN Tcl_DriverThreadActionProc * Tcl_ChannelThreadActionProc(
|
||||
const Tcl_ChannelType *chanTypePtr);
|
||||
/* 555 */
|
||||
EXTERN Tcl_Obj * Tcl_NewBignumObj(mp_int *value);
|
||||
EXTERN Tcl_Obj * Tcl_NewBignumObj(void *value);
|
||||
/* 556 */
|
||||
EXTERN Tcl_Obj * Tcl_DbNewBignumObj(mp_int *value, const char *file,
|
||||
EXTERN Tcl_Obj * Tcl_DbNewBignumObj(void *value, const char *file,
|
||||
int line);
|
||||
/* 557 */
|
||||
EXTERN void Tcl_SetBignumObj(Tcl_Obj *obj, mp_int *value);
|
||||
EXTERN void Tcl_SetBignumObj(Tcl_Obj *obj, void *value);
|
||||
/* 558 */
|
||||
EXTERN int Tcl_GetBignumFromObj(Tcl_Interp *interp,
|
||||
Tcl_Obj *obj, mp_int *value);
|
||||
Tcl_Obj *obj, void *value);
|
||||
/* 559 */
|
||||
EXTERN int Tcl_TakeBignumFromObj(Tcl_Interp *interp,
|
||||
Tcl_Obj *obj, mp_int *value);
|
||||
Tcl_Obj *obj, void *value);
|
||||
/* 560 */
|
||||
EXTERN int Tcl_TruncateChannel(Tcl_Channel chan,
|
||||
Tcl_WideInt length);
|
||||
@@ -1674,7 +1680,7 @@ EXTERN void Tcl_SetChannelError(Tcl_Channel chan, Tcl_Obj *msg);
|
||||
EXTERN void Tcl_GetChannelError(Tcl_Channel chan, Tcl_Obj **msg);
|
||||
/* 566 */
|
||||
EXTERN int Tcl_InitBignumFromDouble(Tcl_Interp *interp,
|
||||
double initval, mp_int *toInit);
|
||||
double initval, void *toInit);
|
||||
/* 567 */
|
||||
EXTERN Tcl_Obj * Tcl_GetNamespaceUnknownHandler(Tcl_Interp *interp,
|
||||
Tcl_Namespace *nsPtr);
|
||||
@@ -1792,7 +1798,7 @@ EXTERN int Tcl_GetErrorLine(Tcl_Interp *interp);
|
||||
EXTERN void Tcl_SetErrorLine(Tcl_Interp *interp, int lineNum);
|
||||
/* 607 */
|
||||
EXTERN void Tcl_TransferResult(Tcl_Interp *sourceInterp,
|
||||
int result, Tcl_Interp *targetInterp);
|
||||
int code, Tcl_Interp *targetInterp);
|
||||
/* 608 */
|
||||
EXTERN int Tcl_InterpActive(Tcl_Interp *interp);
|
||||
/* 609 */
|
||||
@@ -1970,7 +1976,7 @@ typedef struct TclStubs {
|
||||
Tcl_Obj * (*tcl_DbNewObj) (const char *file, int line); /* 27 */
|
||||
Tcl_Obj * (*tcl_DbNewStringObj) (const char *bytes, int length, const char *file, int line); /* 28 */
|
||||
Tcl_Obj * (*tcl_DuplicateObj) (Tcl_Obj *objPtr); /* 29 */
|
||||
void (*tclOldFreeObj) (Tcl_Obj *objPtr); /* 30 */
|
||||
void (*tclFreeObj) (Tcl_Obj *objPtr); /* 30 */
|
||||
int (*tcl_GetBoolean) (Tcl_Interp *interp, const char *src, int *boolPtr); /* 31 */
|
||||
int (*tcl_GetBooleanFromObj) (Tcl_Interp *interp, Tcl_Obj *objPtr, int *boolPtr); /* 32 */
|
||||
unsigned char * (*tcl_GetByteArrayFromObj) (Tcl_Obj *objPtr, int *lengthPtr); /* 33 */
|
||||
@@ -2087,7 +2093,7 @@ typedef struct TclStubs {
|
||||
TCL_DEPRECATED_API("Don't use this function in a stub-enabled extension") void (*tcl_FindExecutable) (const char *argv0); /* 144 */
|
||||
Tcl_HashEntry * (*tcl_FirstHashEntry) (Tcl_HashTable *tablePtr, Tcl_HashSearch *searchPtr); /* 145 */
|
||||
int (*tcl_Flush) (Tcl_Channel chan); /* 146 */
|
||||
void (*tcl_FreeResult) (Tcl_Interp *interp); /* 147 */
|
||||
TCL_DEPRECATED_API("see TIP #559. Use Tcl_ResetResult") void (*tcl_FreeResult) (Tcl_Interp *interp); /* 147 */
|
||||
int (*tcl_GetAlias) (Tcl_Interp *interp, const char *slaveCmd, Tcl_Interp **targetInterpPtr, const char **targetCmdPtr, int *argcPtr, const char ***argvPtr); /* 148 */
|
||||
int (*tcl_GetAliasObj) (Tcl_Interp *interp, const char *slaveCmd, Tcl_Interp **targetInterpPtr, const char **targetCmdPtr, int *objcPtr, Tcl_Obj ***objv); /* 149 */
|
||||
ClientData (*tcl_GetAssocData) (Tcl_Interp *interp, const char *name, Tcl_InterpDeleteProc **procPtr); /* 150 */
|
||||
@@ -2300,8 +2306,8 @@ typedef struct TclStubs {
|
||||
int (*tcl_UniCharIsSpace) (int ch); /* 349 */
|
||||
int (*tcl_UniCharIsUpper) (int ch); /* 350 */
|
||||
int (*tcl_UniCharIsWordChar) (int ch); /* 351 */
|
||||
int (*tcl_UniCharLen) (const Tcl_UniChar *uniStr); /* 352 */
|
||||
int (*tcl_UniCharNcmp) (const Tcl_UniChar *ucs, const Tcl_UniChar *uct, unsigned long numChars); /* 353 */
|
||||
TCL_DEPRECATED_API("Use Tcl_GetCharLength") int (*tcl_UniCharLen) (const Tcl_UniChar *uniStr); /* 352 */
|
||||
TCL_DEPRECATED_API("Use Tcl_UtfNcmp") int (*tcl_UniCharNcmp) (const Tcl_UniChar *ucs, const Tcl_UniChar *uct, unsigned long numChars); /* 353 */
|
||||
char * (*tcl_Char16ToUtfDString) (const unsigned short *uniStr, int uniLength, Tcl_DString *dsPtr); /* 354 */
|
||||
unsigned short * (*tcl_UtfToChar16DString) (const char *src, int length, Tcl_DString *dsPtr); /* 355 */
|
||||
Tcl_RegExp (*tcl_GetRegExpFromObj) (Tcl_Interp *interp, Tcl_Obj *patObj, int flags); /* 356 */
|
||||
@@ -2332,7 +2338,7 @@ typedef struct TclStubs {
|
||||
int (*tcl_GetUniChar) (Tcl_Obj *objPtr, int index); /* 381 */
|
||||
TCL_DEPRECATED_API("No longer in use, changed to macro") Tcl_UniChar * (*tcl_GetUnicode) (Tcl_Obj *objPtr); /* 382 */
|
||||
Tcl_Obj * (*tcl_GetRange) (Tcl_Obj *objPtr, int first, int last); /* 383 */
|
||||
void (*tcl_AppendUnicodeToObj) (Tcl_Obj *objPtr, const Tcl_UniChar *unicode, int length); /* 384 */
|
||||
TCL_DEPRECATED_API("Use Tcl_AppendStringsToObj") void (*tcl_AppendUnicodeToObj) (Tcl_Obj *objPtr, const Tcl_UniChar *unicode, int length); /* 384 */
|
||||
int (*tcl_RegExpMatchObj) (Tcl_Interp *interp, Tcl_Obj *textObj, Tcl_Obj *patternObj); /* 385 */
|
||||
void (*tcl_SetNotifier) (Tcl_NotifierProcs *notifierProcPtr); /* 386 */
|
||||
Tcl_Mutex * (*tcl_GetAllocMutex) (void); /* 387 */
|
||||
@@ -2367,8 +2373,8 @@ typedef struct TclStubs {
|
||||
void (*tcl_SpliceChannel) (Tcl_Channel channel); /* 416 */
|
||||
void (*tcl_ClearChannelHandlers) (Tcl_Channel channel); /* 417 */
|
||||
int (*tcl_IsChannelExisting) (const char *channelName); /* 418 */
|
||||
int (*tcl_UniCharNcasecmp) (const Tcl_UniChar *ucs, const Tcl_UniChar *uct, unsigned long numChars); /* 419 */
|
||||
int (*tcl_UniCharCaseMatch) (const Tcl_UniChar *uniStr, const Tcl_UniChar *uniPattern, int nocase); /* 420 */
|
||||
TCL_DEPRECATED_API("Use Tcl_UtfNcasecmp") int (*tcl_UniCharNcasecmp) (const Tcl_UniChar *ucs, const Tcl_UniChar *uct, unsigned long numChars); /* 419 */
|
||||
TCL_DEPRECATED_API("Use Tcl_StringCaseMatch") int (*tcl_UniCharCaseMatch) (const Tcl_UniChar *uniStr, const Tcl_UniChar *uniPattern, int nocase); /* 420 */
|
||||
Tcl_HashEntry * (*tcl_FindHashEntry) (Tcl_HashTable *tablePtr, const void *key); /* 421 */
|
||||
Tcl_HashEntry * (*tcl_CreateHashEntry) (Tcl_HashTable *tablePtr, const void *key, int *newPtr); /* 422 */
|
||||
void (*tcl_InitCustomHashTable) (Tcl_HashTable *tablePtr, int keyType, const Tcl_HashKeyType *typePtr); /* 423 */
|
||||
@@ -2503,18 +2509,18 @@ typedef struct TclStubs {
|
||||
void (*tcl_SetTimeProc) (Tcl_GetTimeProc *getProc, Tcl_ScaleTimeProc *scaleProc, ClientData clientData); /* 552 */
|
||||
void (*tcl_QueryTimeProc) (Tcl_GetTimeProc **getProc, Tcl_ScaleTimeProc **scaleProc, ClientData *clientData); /* 553 */
|
||||
Tcl_DriverThreadActionProc * (*tcl_ChannelThreadActionProc) (const Tcl_ChannelType *chanTypePtr); /* 554 */
|
||||
Tcl_Obj * (*tcl_NewBignumObj) (mp_int *value); /* 555 */
|
||||
Tcl_Obj * (*tcl_DbNewBignumObj) (mp_int *value, const char *file, int line); /* 556 */
|
||||
void (*tcl_SetBignumObj) (Tcl_Obj *obj, mp_int *value); /* 557 */
|
||||
int (*tcl_GetBignumFromObj) (Tcl_Interp *interp, Tcl_Obj *obj, mp_int *value); /* 558 */
|
||||
int (*tcl_TakeBignumFromObj) (Tcl_Interp *interp, Tcl_Obj *obj, mp_int *value); /* 559 */
|
||||
Tcl_Obj * (*tcl_NewBignumObj) (void *value); /* 555 */
|
||||
Tcl_Obj * (*tcl_DbNewBignumObj) (void *value, const char *file, int line); /* 556 */
|
||||
void (*tcl_SetBignumObj) (Tcl_Obj *obj, void *value); /* 557 */
|
||||
int (*tcl_GetBignumFromObj) (Tcl_Interp *interp, Tcl_Obj *obj, void *value); /* 558 */
|
||||
int (*tcl_TakeBignumFromObj) (Tcl_Interp *interp, Tcl_Obj *obj, void *value); /* 559 */
|
||||
int (*tcl_TruncateChannel) (Tcl_Channel chan, Tcl_WideInt length); /* 560 */
|
||||
Tcl_DriverTruncateProc * (*tcl_ChannelTruncateProc) (const Tcl_ChannelType *chanTypePtr); /* 561 */
|
||||
void (*tcl_SetChannelErrorInterp) (Tcl_Interp *interp, Tcl_Obj *msg); /* 562 */
|
||||
void (*tcl_GetChannelErrorInterp) (Tcl_Interp *interp, Tcl_Obj **msg); /* 563 */
|
||||
void (*tcl_SetChannelError) (Tcl_Channel chan, Tcl_Obj *msg); /* 564 */
|
||||
void (*tcl_GetChannelError) (Tcl_Channel chan, Tcl_Obj **msg); /* 565 */
|
||||
int (*tcl_InitBignumFromDouble) (Tcl_Interp *interp, double initval, mp_int *toInit); /* 566 */
|
||||
int (*tcl_InitBignumFromDouble) (Tcl_Interp *interp, double initval, void *toInit); /* 566 */
|
||||
Tcl_Obj * (*tcl_GetNamespaceUnknownHandler) (Tcl_Interp *interp, Tcl_Namespace *nsPtr); /* 567 */
|
||||
int (*tcl_SetNamespaceUnknownHandler) (Tcl_Interp *interp, Tcl_Namespace *nsPtr, Tcl_Obj *handlerPtr); /* 568 */
|
||||
int (*tcl_GetEncodingFromObj) (Tcl_Interp *interp, Tcl_Obj *objPtr, Tcl_Encoding *encodingPtr); /* 569 */
|
||||
@@ -2555,7 +2561,7 @@ typedef struct TclStubs {
|
||||
int (*tcl_ParseArgsObjv) (Tcl_Interp *interp, const Tcl_ArgvInfo *argTable, int *objcPtr, Tcl_Obj *const *objv, Tcl_Obj ***remObjv); /* 604 */
|
||||
int (*tcl_GetErrorLine) (Tcl_Interp *interp); /* 605 */
|
||||
void (*tcl_SetErrorLine) (Tcl_Interp *interp, int lineNum); /* 606 */
|
||||
void (*tcl_TransferResult) (Tcl_Interp *sourceInterp, int result, Tcl_Interp *targetInterp); /* 607 */
|
||||
void (*tcl_TransferResult) (Tcl_Interp *sourceInterp, int code, Tcl_Interp *targetInterp); /* 607 */
|
||||
int (*tcl_InterpActive) (Tcl_Interp *interp); /* 608 */
|
||||
void (*tcl_BackgroundException) (Tcl_Interp *interp, int code); /* 609 */
|
||||
int (*tcl_ZlibDeflate) (Tcl_Interp *interp, int format, Tcl_Obj *data, int level, Tcl_Obj *gzipHeaderDictObj); /* 610 */
|
||||
@@ -2683,8 +2689,8 @@ extern const TclStubs *tclStubsPtr;
|
||||
(tclStubsPtr->tcl_DbNewStringObj) /* 28 */
|
||||
#define Tcl_DuplicateObj \
|
||||
(tclStubsPtr->tcl_DuplicateObj) /* 29 */
|
||||
#define TclOldFreeObj \
|
||||
(tclStubsPtr->tclOldFreeObj) /* 30 */
|
||||
#define TclFreeObj \
|
||||
(tclStubsPtr->tclFreeObj) /* 30 */
|
||||
#define Tcl_GetBoolean \
|
||||
(tclStubsPtr->tcl_GetBoolean) /* 31 */
|
||||
#define Tcl_GetBooleanFromObj \
|
||||
@@ -3951,7 +3957,6 @@ extern const TclStubs *tclStubsPtr;
|
||||
# define Tcl_MainEx Tcl_MainExW
|
||||
EXTERN void Tcl_MainExW(int argc, wchar_t **argv,
|
||||
Tcl_AppInitProc *appInitProc, Tcl_Interp *interp);
|
||||
EXTERN int TclZipfs_AppHook(int *argc, wchar_t ***argv);
|
||||
#endif
|
||||
|
||||
#undef TCL_STORAGE_CLASS
|
||||
@@ -4010,7 +4015,22 @@ extern const TclStubs *tclStubsPtr;
|
||||
#define Tcl_AddObjErrorInfo(interp, message, length) \
|
||||
Tcl_AppendObjToErrorInfo(interp, Tcl_NewStringObj(message, length))
|
||||
#ifdef TCL_NO_DEPRECATED
|
||||
#undef Tcl_FreeResult
|
||||
#undef Tcl_AppendResultVA
|
||||
#undef Tcl_AppendStringsToObjVA
|
||||
#undef Tcl_SetErrorCodeVA
|
||||
#undef Tcl_VarEvalVA
|
||||
#undef Tcl_PanicVA
|
||||
#undef Tcl_GetStringResult
|
||||
#undef Tcl_GetDefaultEncodingDir
|
||||
#undef Tcl_SetDefaultEncodingDir
|
||||
#undef Tcl_UniCharLen
|
||||
#undef Tcl_UniCharNcmp
|
||||
#undef Tcl_EvalTokens
|
||||
#undef Tcl_UniCharNcasecmp
|
||||
#undef Tcl_UniCharCaseMatch
|
||||
#undef Tcl_GetMathFuncInfo
|
||||
#undef Tcl_ListMathFuncs
|
||||
#define Tcl_GetStringResult(interp) Tcl_GetString(Tcl_GetObjResult(interp))
|
||||
#undef Tcl_Eval
|
||||
#define Tcl_Eval(interp, objPtr) \
|
||||
@@ -4038,14 +4058,14 @@ extern const TclStubs *tclStubsPtr;
|
||||
#undef Tcl_SetResult
|
||||
#define Tcl_SetResult(interp, result, freeProc) \
|
||||
do { \
|
||||
char *__result = result; \
|
||||
const char *__result = result; \
|
||||
Tcl_FreeProc *__freeProc = freeProc; \
|
||||
Tcl_SetObjResult(interp, Tcl_NewStringObj(__result, -1)); \
|
||||
if (__result != NULL && __freeProc != NULL && __freeProc != TCL_VOLATILE) { \
|
||||
if (__freeProc == TCL_DYNAMIC) { \
|
||||
ckfree(__result); \
|
||||
ckfree((char *)__result); \
|
||||
} else { \
|
||||
(*__freeProc)(__result); \
|
||||
(*__freeProc)((char *)__result); \
|
||||
} \
|
||||
} \
|
||||
} while(0)
|
||||
@@ -4110,7 +4130,7 @@ extern const TclStubs *tclStubsPtr;
|
||||
#undef Tcl_StringMatch
|
||||
#define Tcl_StringMatch(str, pattern) Tcl_StringCaseMatch((str), (pattern), 0)
|
||||
|
||||
#if TCL_UTF_MAX <= 4
|
||||
#if TCL_UTF_MAX <= 3
|
||||
# undef Tcl_UniCharToUtfDString
|
||||
# define Tcl_UniCharToUtfDString Tcl_Char16ToUtfDString
|
||||
# undef Tcl_UtfToUniCharDString
|
||||
|
||||
+84
-60
@@ -11,7 +11,7 @@
|
||||
*/
|
||||
|
||||
#include "tclInt.h"
|
||||
#include "tommath.h"
|
||||
#include "tclTomMath.h"
|
||||
#include <assert.h>
|
||||
|
||||
/*
|
||||
@@ -179,7 +179,7 @@ const Tcl_ObjType tclDictType = {
|
||||
do { \
|
||||
const Tcl_ObjIntRep *irPtr; \
|
||||
irPtr = TclFetchIntRep((objPtr), &tclDictType); \
|
||||
(dictRepPtr) = irPtr ? irPtr->twoPtrValue.ptr1 : NULL; \
|
||||
(dictRepPtr) = irPtr ? (Dict *)irPtr->twoPtrValue.ptr1 : NULL; \
|
||||
} while (0)
|
||||
|
||||
/*
|
||||
@@ -243,10 +243,11 @@ AllocChainEntry(
|
||||
Tcl_HashTable *tablePtr,
|
||||
void *keyPtr)
|
||||
{
|
||||
Tcl_Obj *objPtr = keyPtr;
|
||||
Tcl_Obj *objPtr = (Tcl_Obj *)keyPtr;
|
||||
ChainEntry *cPtr;
|
||||
(void)tablePtr;
|
||||
|
||||
cPtr = ckalloc(sizeof(ChainEntry));
|
||||
cPtr = (ChainEntry *)ckalloc(sizeof(ChainEntry));
|
||||
cPtr->entry.key.objPtr = objPtr;
|
||||
Tcl_IncrRefCount(objPtr);
|
||||
cPtr->entry.clientData = NULL;
|
||||
@@ -279,7 +280,7 @@ DeleteChainTable(
|
||||
ChainEntry *cPtr;
|
||||
|
||||
for (cPtr=dict->entryChainHead ; cPtr!=NULL ; cPtr=cPtr->nextPtr) {
|
||||
Tcl_Obj *valuePtr = Tcl_GetHashValue(&cPtr->entry);
|
||||
Tcl_Obj *valuePtr = (Tcl_Obj *)Tcl_GetHashValue(&cPtr->entry);
|
||||
|
||||
TclDecrRefCount(valuePtr);
|
||||
}
|
||||
@@ -326,7 +327,7 @@ DeleteChainEntry(
|
||||
if (cPtr == NULL) {
|
||||
return 0;
|
||||
} else {
|
||||
Tcl_Obj *valuePtr = Tcl_GetHashValue(&cPtr->entry);
|
||||
Tcl_Obj *valuePtr = (Tcl_Obj *)Tcl_GetHashValue(&cPtr->entry);
|
||||
|
||||
TclDecrRefCount(valuePtr);
|
||||
}
|
||||
@@ -377,7 +378,7 @@ DupDictInternalRep(
|
||||
Tcl_Obj *srcPtr,
|
||||
Tcl_Obj *copyPtr)
|
||||
{
|
||||
Dict *oldDict, *newDict = ckalloc(sizeof(Dict));
|
||||
Dict *oldDict, *newDict = (Dict *)ckalloc(sizeof(Dict));
|
||||
ChainEntry *cPtr;
|
||||
|
||||
DictGetIntRep(srcPtr, oldDict);
|
||||
@@ -388,8 +389,8 @@ DupDictInternalRep(
|
||||
|
||||
InitChainTable(newDict);
|
||||
for (cPtr=oldDict->entryChainHead ; cPtr!=NULL ; cPtr=cPtr->nextPtr) {
|
||||
Tcl_Obj *key = Tcl_GetHashKey(&oldDict->table, &cPtr->entry);
|
||||
Tcl_Obj *valuePtr = Tcl_GetHashValue(&cPtr->entry);
|
||||
Tcl_Obj *key = (Tcl_Obj *)Tcl_GetHashKey(&oldDict->table, &cPtr->entry);
|
||||
Tcl_Obj *valuePtr = (Tcl_Obj *)Tcl_GetHashValue(&cPtr->entry);
|
||||
int n;
|
||||
Tcl_HashEntry *hPtr = CreateChainEntry(newDict, key, &n);
|
||||
|
||||
@@ -536,7 +537,7 @@ UpdateStringOfDict(
|
||||
if (numElems <= LOCAL_SIZE) {
|
||||
flagPtr = localFlags;
|
||||
} else {
|
||||
flagPtr = ckalloc(numElems);
|
||||
flagPtr = (char *)ckalloc(numElems);
|
||||
}
|
||||
for (i=0,cPtr=dict->entryChainHead; i<numElems; i+=2,cPtr=cPtr->nextPtr) {
|
||||
/*
|
||||
@@ -545,7 +546,7 @@ UpdateStringOfDict(
|
||||
*/
|
||||
|
||||
flagPtr[i] = ( i ? TCL_DONT_QUOTE_HASH : 0 );
|
||||
keyPtr = Tcl_GetHashKey(&dict->table, &cPtr->entry);
|
||||
keyPtr = (Tcl_Obj *)Tcl_GetHashKey(&dict->table, &cPtr->entry);
|
||||
elem = TclGetStringFromObj(keyPtr, &length);
|
||||
bytesNeeded += TclScanElement(elem, length, flagPtr+i);
|
||||
if (bytesNeeded < 0) {
|
||||
@@ -553,7 +554,7 @@ UpdateStringOfDict(
|
||||
}
|
||||
|
||||
flagPtr[i+1] = TCL_DONT_QUOTE_HASH;
|
||||
valuePtr = Tcl_GetHashValue(&cPtr->entry);
|
||||
valuePtr = (Tcl_Obj *)Tcl_GetHashValue(&cPtr->entry);
|
||||
elem = TclGetStringFromObj(valuePtr, &length);
|
||||
bytesNeeded += TclScanElement(elem, length, flagPtr+i+1);
|
||||
if (bytesNeeded < 0) {
|
||||
@@ -573,13 +574,13 @@ UpdateStringOfDict(
|
||||
TclOOM(dst, bytesNeeded);
|
||||
for (i=0,cPtr=dict->entryChainHead; i<numElems; i+=2,cPtr=cPtr->nextPtr) {
|
||||
flagPtr[i] |= ( i ? TCL_DONT_QUOTE_HASH : 0 );
|
||||
keyPtr = Tcl_GetHashKey(&dict->table, &cPtr->entry);
|
||||
keyPtr = (Tcl_Obj *)Tcl_GetHashKey(&dict->table, &cPtr->entry);
|
||||
elem = TclGetStringFromObj(keyPtr, &length);
|
||||
dst += TclConvertElement(elem, length, dst, flagPtr[i]);
|
||||
*dst++ = ' ';
|
||||
|
||||
flagPtr[i+1] |= TCL_DONT_QUOTE_HASH;
|
||||
valuePtr = Tcl_GetHashValue(&cPtr->entry);
|
||||
valuePtr = (Tcl_Obj *)Tcl_GetHashValue(&cPtr->entry);
|
||||
elem = TclGetStringFromObj(valuePtr, &length);
|
||||
dst += TclConvertElement(elem, length, dst, flagPtr[i+1]);
|
||||
*dst++ = ' ';
|
||||
@@ -618,7 +619,7 @@ SetDictFromAny(
|
||||
{
|
||||
Tcl_HashEntry *hPtr;
|
||||
int isNew;
|
||||
Dict *dict = ckalloc(sizeof(Dict));
|
||||
Dict *dict = (Dict *)ckalloc(sizeof(Dict));
|
||||
|
||||
InitChainTable(dict);
|
||||
|
||||
@@ -643,7 +644,7 @@ SetDictFromAny(
|
||||
/* Store key and value in the hash table we're building. */
|
||||
hPtr = CreateChainEntry(dict, objv[i], &isNew);
|
||||
if (!isNew) {
|
||||
Tcl_Obj *discardedValue = Tcl_GetHashValue(hPtr);
|
||||
Tcl_Obj *discardedValue = (Tcl_Obj *)Tcl_GetHashValue(hPtr);
|
||||
|
||||
/*
|
||||
* Not really a well-formed dictionary as there are duplicate
|
||||
@@ -716,7 +717,7 @@ SetDictFromAny(
|
||||
/* Store key and value in the hash table we're building. */
|
||||
hPtr = CreateChainEntry(dict, keyPtr, &isNew);
|
||||
if (!isNew) {
|
||||
Tcl_Obj *discardedValue = Tcl_GetHashValue(hPtr);
|
||||
Tcl_Obj *discardedValue = (Tcl_Obj *)Tcl_GetHashValue(hPtr);
|
||||
|
||||
TclDecrRefCount(keyPtr);
|
||||
TclDecrRefCount(discardedValue);
|
||||
@@ -851,7 +852,7 @@ TclTraceDictPath(
|
||||
Tcl_IncrRefCount(tmpObj);
|
||||
Tcl_SetHashValue(hPtr, tmpObj);
|
||||
} else {
|
||||
tmpObj = Tcl_GetHashValue(hPtr);
|
||||
tmpObj = (Tcl_Obj *)Tcl_GetHashValue(hPtr);
|
||||
|
||||
DictGetIntRep(tmpObj, newDict);
|
||||
|
||||
@@ -972,7 +973,7 @@ Tcl_DictObjPut(
|
||||
DictSetIntRep(dictPtr, dict);
|
||||
Tcl_IncrRefCount(valuePtr);
|
||||
if (!isNew) {
|
||||
Tcl_Obj *oldValuePtr = Tcl_GetHashValue(hPtr);
|
||||
Tcl_Obj *oldValuePtr = (Tcl_Obj *)Tcl_GetHashValue(hPtr);
|
||||
|
||||
TclDecrRefCount(oldValuePtr);
|
||||
}
|
||||
@@ -1021,7 +1022,7 @@ Tcl_DictObjGet(
|
||||
if (hPtr == NULL) {
|
||||
*valuePtrPtr = NULL;
|
||||
} else {
|
||||
*valuePtrPtr = Tcl_GetHashValue(hPtr);
|
||||
*valuePtrPtr = (Tcl_Obj *)Tcl_GetHashValue(hPtr);
|
||||
}
|
||||
return TCL_OK;
|
||||
}
|
||||
@@ -1162,10 +1163,10 @@ Tcl_DictObjFirst(
|
||||
searchPtr->next = cPtr->nextPtr;
|
||||
dict->refCount++;
|
||||
if (keyPtrPtr != NULL) {
|
||||
*keyPtrPtr = Tcl_GetHashKey(&dict->table, &cPtr->entry);
|
||||
*keyPtrPtr = (Tcl_Obj *)Tcl_GetHashKey(&dict->table, &cPtr->entry);
|
||||
}
|
||||
if (valuePtrPtr != NULL) {
|
||||
*valuePtrPtr = Tcl_GetHashValue(&cPtr->entry);
|
||||
*valuePtrPtr = (Tcl_Obj *)Tcl_GetHashValue(&cPtr->entry);
|
||||
}
|
||||
}
|
||||
return TCL_OK;
|
||||
@@ -1228,7 +1229,7 @@ Tcl_DictObjNext(
|
||||
Tcl_Panic("concurrent dictionary modification and search");
|
||||
}
|
||||
|
||||
cPtr = searchPtr->next;
|
||||
cPtr = (ChainEntry *)searchPtr->next;
|
||||
if (cPtr == NULL) {
|
||||
Tcl_DictObjDone(searchPtr);
|
||||
*donePtr = 1;
|
||||
@@ -1238,11 +1239,11 @@ Tcl_DictObjNext(
|
||||
searchPtr->next = cPtr->nextPtr;
|
||||
*donePtr = 0;
|
||||
if (keyPtrPtr != NULL) {
|
||||
*keyPtrPtr = Tcl_GetHashKey(
|
||||
*keyPtrPtr = (Tcl_Obj *)Tcl_GetHashKey(
|
||||
&((Dict *)searchPtr->dictionaryPtr)->table, &cPtr->entry);
|
||||
}
|
||||
if (valuePtrPtr != NULL) {
|
||||
*valuePtrPtr = Tcl_GetHashValue(&cPtr->entry);
|
||||
*valuePtrPtr = (Tcl_Obj *)Tcl_GetHashValue(&cPtr->entry);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1329,7 +1330,7 @@ Tcl_DictObjPutKeyList(
|
||||
hPtr = CreateChainEntry(dict, keyv[keyc-1], &isNew);
|
||||
Tcl_IncrRefCount(valuePtr);
|
||||
if (!isNew) {
|
||||
Tcl_Obj *oldValuePtr = Tcl_GetHashValue(hPtr);
|
||||
Tcl_Obj *oldValuePtr = (Tcl_Obj *)Tcl_GetHashValue(hPtr);
|
||||
|
||||
TclDecrRefCount(oldValuePtr);
|
||||
}
|
||||
@@ -1424,7 +1425,7 @@ Tcl_NewDictObj(void)
|
||||
|
||||
TclNewObj(dictPtr);
|
||||
TclInvalidateStringRep(dictPtr);
|
||||
dict = ckalloc(sizeof(Dict));
|
||||
dict = (Dict *)ckalloc(sizeof(Dict));
|
||||
InitChainTable(dict);
|
||||
dict->epoch = 1;
|
||||
dict->chain = NULL;
|
||||
@@ -1472,7 +1473,7 @@ Tcl_DbNewDictObj(
|
||||
|
||||
TclDbNewObj(dictPtr, file, line);
|
||||
TclInvalidateStringRep(dictPtr);
|
||||
dict = ckalloc(sizeof(Dict));
|
||||
dict = (Dict *)ckalloc(sizeof(Dict));
|
||||
InitChainTable(dict);
|
||||
dict->epoch = 1;
|
||||
dict->chain = NULL;
|
||||
@@ -1480,6 +1481,8 @@ Tcl_DbNewDictObj(
|
||||
DictSetIntRep(dictPtr, dict);
|
||||
return dictPtr;
|
||||
#else /* !TCL_MEM_DEBUG */
|
||||
(void)file;
|
||||
(void)line;
|
||||
return Tcl_NewDictObj();
|
||||
#endif
|
||||
}
|
||||
@@ -1506,13 +1509,14 @@ Tcl_DbNewDictObj(
|
||||
|
||||
static int
|
||||
DictCreateCmd(
|
||||
ClientData dummy,
|
||||
ClientData dummy, /* Not used. */
|
||||
Tcl_Interp *interp,
|
||||
int objc,
|
||||
Tcl_Obj *const *objv)
|
||||
{
|
||||
Tcl_Obj *dictObj;
|
||||
int i;
|
||||
(void)dummy;
|
||||
|
||||
/*
|
||||
* Must have an even number of arguments; note that number of preceding
|
||||
@@ -1556,13 +1560,14 @@ DictCreateCmd(
|
||||
|
||||
static int
|
||||
DictGetCmd(
|
||||
ClientData dummy,
|
||||
ClientData dummy, /* Not used. */
|
||||
Tcl_Interp *interp,
|
||||
int objc,
|
||||
Tcl_Obj *const *objv)
|
||||
{
|
||||
Tcl_Obj *dictPtr, *valuePtr = NULL;
|
||||
int result;
|
||||
(void)dummy;
|
||||
|
||||
if (objc < 2) {
|
||||
Tcl_WrongNumArgs(interp, 1, objv, "dictionary ?key ...?");
|
||||
@@ -1649,7 +1654,7 @@ DictGetCmd(
|
||||
|
||||
static int
|
||||
DictGetDefCmd(
|
||||
ClientData dummy,
|
||||
ClientData dummy, /* Not used. */
|
||||
Tcl_Interp *interp,
|
||||
int objc,
|
||||
Tcl_Obj *const *objv)
|
||||
@@ -1657,6 +1662,7 @@ DictGetDefCmd(
|
||||
Tcl_Obj *dictPtr, *keyPtr, *valuePtr, *defaultPtr;
|
||||
Tcl_Obj *const *keyPath;
|
||||
int numKeys;
|
||||
(void)dummy;
|
||||
|
||||
if (objc < 4) {
|
||||
Tcl_WrongNumArgs(interp, 1, objv, "dictionary ?key ...? key default");
|
||||
@@ -1714,13 +1720,14 @@ DictGetDefCmd(
|
||||
|
||||
static int
|
||||
DictReplaceCmd(
|
||||
ClientData dummy,
|
||||
ClientData dummy, /* Not used. */
|
||||
Tcl_Interp *interp,
|
||||
int objc,
|
||||
Tcl_Obj *const *objv)
|
||||
{
|
||||
Tcl_Obj *dictPtr;
|
||||
int i;
|
||||
(void)dummy;
|
||||
|
||||
if ((objc < 2) || (objc & 1)) {
|
||||
Tcl_WrongNumArgs(interp, 1, objv, "dictionary ?key value ...?");
|
||||
@@ -1762,13 +1769,14 @@ DictReplaceCmd(
|
||||
|
||||
static int
|
||||
DictRemoveCmd(
|
||||
ClientData dummy,
|
||||
ClientData dummy, /* Not used. */
|
||||
Tcl_Interp *interp,
|
||||
int objc,
|
||||
Tcl_Obj *const *objv)
|
||||
{
|
||||
Tcl_Obj *dictPtr;
|
||||
int i;
|
||||
(void)dummy;
|
||||
|
||||
if (objc < 2) {
|
||||
Tcl_WrongNumArgs(interp, 1, objv, "dictionary ?key ...?");
|
||||
@@ -1810,7 +1818,7 @@ DictRemoveCmd(
|
||||
|
||||
static int
|
||||
DictMergeCmd(
|
||||
ClientData dummy,
|
||||
ClientData dummy, /* Not used. */
|
||||
Tcl_Interp *interp,
|
||||
int objc,
|
||||
Tcl_Obj *const *objv)
|
||||
@@ -1819,6 +1827,7 @@ DictMergeCmd(
|
||||
int allocatedDict = 0;
|
||||
int i, done;
|
||||
Tcl_DictSearch search;
|
||||
(void)dummy;
|
||||
|
||||
if (objc == 1) {
|
||||
/*
|
||||
@@ -1897,13 +1906,14 @@ DictMergeCmd(
|
||||
|
||||
static int
|
||||
DictKeysCmd(
|
||||
ClientData dummy,
|
||||
ClientData dummy, /* Not used. */
|
||||
Tcl_Interp *interp,
|
||||
int objc,
|
||||
Tcl_Obj *const *objv)
|
||||
{
|
||||
Tcl_Obj *listPtr;
|
||||
const char *pattern = NULL;
|
||||
(void)dummy;
|
||||
|
||||
if (objc!=2 && objc!=3) {
|
||||
Tcl_WrongNumArgs(interp, 1, objv, "dictionary ?pattern?");
|
||||
@@ -1976,7 +1986,7 @@ DictKeysCmd(
|
||||
|
||||
static int
|
||||
DictValuesCmd(
|
||||
ClientData dummy,
|
||||
ClientData dummy, /* Not used. */
|
||||
Tcl_Interp *interp,
|
||||
int objc,
|
||||
Tcl_Obj *const *objv)
|
||||
@@ -1985,6 +1995,7 @@ DictValuesCmd(
|
||||
Tcl_DictSearch search;
|
||||
int done;
|
||||
const char *pattern;
|
||||
(void)dummy;
|
||||
|
||||
if (objc!=2 && objc!=3) {
|
||||
Tcl_WrongNumArgs(interp, 1, objv, "dictionary ?pattern?");
|
||||
@@ -2036,12 +2047,13 @@ DictValuesCmd(
|
||||
|
||||
static int
|
||||
DictSizeCmd(
|
||||
ClientData dummy,
|
||||
ClientData dummy, /* Not used. */
|
||||
Tcl_Interp *interp,
|
||||
int objc,
|
||||
Tcl_Obj *const *objv)
|
||||
{
|
||||
int result, size;
|
||||
(void)dummy;
|
||||
|
||||
if (objc != 2) {
|
||||
Tcl_WrongNumArgs(interp, 1, objv, "dictionary");
|
||||
@@ -2074,12 +2086,13 @@ DictSizeCmd(
|
||||
|
||||
static int
|
||||
DictExistsCmd(
|
||||
ClientData dummy,
|
||||
ClientData dummy, /* Not used. */
|
||||
Tcl_Interp *interp,
|
||||
int objc,
|
||||
Tcl_Obj *const *objv)
|
||||
{
|
||||
Tcl_Obj *dictPtr, *valuePtr;
|
||||
(void)dummy;
|
||||
|
||||
if (objc < 3) {
|
||||
Tcl_WrongNumArgs(interp, 1, objv, "dictionary key ?key ...?");
|
||||
@@ -2116,13 +2129,14 @@ DictExistsCmd(
|
||||
|
||||
static int
|
||||
DictInfoCmd(
|
||||
ClientData dummy,
|
||||
ClientData dummy, /* Not used. */
|
||||
Tcl_Interp *interp,
|
||||
int objc,
|
||||
Tcl_Obj *const *objv)
|
||||
{
|
||||
Dict *dict;
|
||||
char *statsStr;
|
||||
(void)dummy;
|
||||
|
||||
if (objc != 2) {
|
||||
Tcl_WrongNumArgs(interp, 1, objv, "dictionary");
|
||||
@@ -2160,13 +2174,14 @@ DictInfoCmd(
|
||||
|
||||
static int
|
||||
DictIncrCmd(
|
||||
ClientData dummy,
|
||||
ClientData dummy, /* Not used. */
|
||||
Tcl_Interp *interp,
|
||||
int objc,
|
||||
Tcl_Obj *const *objv)
|
||||
{
|
||||
int code = TCL_OK;
|
||||
Tcl_Obj *dictPtr, *valuePtr = NULL;
|
||||
(void)dummy;
|
||||
|
||||
if (objc < 3 || objc > 4) {
|
||||
Tcl_WrongNumArgs(interp, 1, objv, "dictVarName key ?increment?");
|
||||
@@ -2280,13 +2295,14 @@ DictIncrCmd(
|
||||
|
||||
static int
|
||||
DictLappendCmd(
|
||||
ClientData dummy,
|
||||
ClientData dummy, /* Not used. */
|
||||
Tcl_Interp *interp,
|
||||
int objc,
|
||||
Tcl_Obj *const *objv)
|
||||
{
|
||||
Tcl_Obj *dictPtr, *valuePtr, *resultPtr;
|
||||
int i, allocatedDict = 0, allocatedValue = 0;
|
||||
(void)dummy;
|
||||
|
||||
if (objc < 3) {
|
||||
Tcl_WrongNumArgs(interp, 1, objv, "dictVarName key ?value ...?");
|
||||
@@ -2367,13 +2383,14 @@ DictLappendCmd(
|
||||
|
||||
static int
|
||||
DictAppendCmd(
|
||||
ClientData dummy,
|
||||
ClientData dummy, /* Not used. */
|
||||
Tcl_Interp *interp,
|
||||
int objc,
|
||||
Tcl_Obj *const *objv)
|
||||
{
|
||||
Tcl_Obj *dictPtr, *valuePtr, *resultPtr;
|
||||
int allocatedDict = 0;
|
||||
(void)dummy;
|
||||
|
||||
if (objc < 3) {
|
||||
Tcl_WrongNumArgs(interp, 1, objv, "dictVarName key ?value ...?");
|
||||
@@ -2469,7 +2486,7 @@ DictAppendCmd(
|
||||
|
||||
static int
|
||||
DictForNRCmd(
|
||||
ClientData dummy,
|
||||
ClientData dummy, /* Not used. */
|
||||
Tcl_Interp *interp,
|
||||
int objc,
|
||||
Tcl_Obj *const *objv)
|
||||
@@ -2479,6 +2496,7 @@ DictForNRCmd(
|
||||
Tcl_Obj **varv, *keyObj, *valueObj;
|
||||
Tcl_DictSearch *searchPtr;
|
||||
int varc, done;
|
||||
(void)dummy;
|
||||
|
||||
if (objc != 4) {
|
||||
Tcl_WrongNumArgs(interp, 1, objv,
|
||||
@@ -2499,7 +2517,7 @@ DictForNRCmd(
|
||||
Tcl_SetErrorCode(interp, "TCL", "SYNTAX", "dict", "for", NULL);
|
||||
return TCL_ERROR;
|
||||
}
|
||||
searchPtr = TclStackAlloc(interp, sizeof(Tcl_DictSearch));
|
||||
searchPtr = (Tcl_DictSearch *)TclStackAlloc(interp, sizeof(Tcl_DictSearch));
|
||||
if (Tcl_DictObjFirst(interp, objv[2], searchPtr, &keyObj, &valueObj,
|
||||
&done) != TCL_OK) {
|
||||
TclStackFree(interp, searchPtr);
|
||||
@@ -2569,10 +2587,10 @@ DictForLoopCallback(
|
||||
int result)
|
||||
{
|
||||
Interp *iPtr = (Interp *) interp;
|
||||
Tcl_DictSearch *searchPtr = data[0];
|
||||
Tcl_Obj *keyVarObj = data[1];
|
||||
Tcl_Obj *valueVarObj = data[2];
|
||||
Tcl_Obj *scriptObj = data[3];
|
||||
Tcl_DictSearch *searchPtr = (Tcl_DictSearch *)data[0];
|
||||
Tcl_Obj *keyVarObj = (Tcl_Obj *)data[1];
|
||||
Tcl_Obj *valueVarObj = (Tcl_Obj *)data[2];
|
||||
Tcl_Obj *scriptObj = (Tcl_Obj *)data[3];
|
||||
Tcl_Obj *keyObj, *valueObj;
|
||||
int done;
|
||||
|
||||
@@ -2664,7 +2682,7 @@ DictForLoopCallback(
|
||||
|
||||
static int
|
||||
DictMapNRCmd(
|
||||
ClientData dummy,
|
||||
ClientData dummy, /* Not used. */
|
||||
Tcl_Interp *interp,
|
||||
int objc,
|
||||
Tcl_Obj *const *objv)
|
||||
@@ -2673,6 +2691,7 @@ DictMapNRCmd(
|
||||
Tcl_Obj **varv, *keyObj, *valueObj;
|
||||
DictMapStorage *storagePtr;
|
||||
int varc, done;
|
||||
(void)dummy;
|
||||
|
||||
if (objc != 4) {
|
||||
Tcl_WrongNumArgs(interp, 1, objv,
|
||||
@@ -2693,7 +2712,7 @@ DictMapNRCmd(
|
||||
Tcl_SetErrorCode(interp, "TCL", "SYNTAX", "dict", "map", NULL);
|
||||
return TCL_ERROR;
|
||||
}
|
||||
storagePtr = TclStackAlloc(interp, sizeof(DictMapStorage));
|
||||
storagePtr = (DictMapStorage *)TclStackAlloc(interp, sizeof(DictMapStorage));
|
||||
if (Tcl_DictObjFirst(interp, objv[2], &storagePtr->search, &keyObj,
|
||||
&valueObj, &done) != TCL_OK) {
|
||||
TclStackFree(interp, storagePtr);
|
||||
@@ -2773,7 +2792,7 @@ DictMapLoopCallback(
|
||||
int result)
|
||||
{
|
||||
Interp *iPtr = (Interp *) interp;
|
||||
DictMapStorage *storagePtr = data[0];
|
||||
DictMapStorage *storagePtr = (DictMapStorage *)data[0];
|
||||
Tcl_Obj *keyObj, *valueObj;
|
||||
int done;
|
||||
|
||||
@@ -2876,13 +2895,14 @@ DictMapLoopCallback(
|
||||
|
||||
static int
|
||||
DictSetCmd(
|
||||
ClientData dummy,
|
||||
ClientData dummy, /* Not used. */
|
||||
Tcl_Interp *interp,
|
||||
int objc,
|
||||
Tcl_Obj *const *objv)
|
||||
{
|
||||
Tcl_Obj *dictPtr, *resultPtr;
|
||||
int result, allocatedDict = 0;
|
||||
(void)dummy;
|
||||
|
||||
if (objc < 4) {
|
||||
Tcl_WrongNumArgs(interp, 1, objv, "dictVarName key ?key ...? value");
|
||||
@@ -2936,13 +2956,14 @@ DictSetCmd(
|
||||
|
||||
static int
|
||||
DictUnsetCmd(
|
||||
ClientData dummy,
|
||||
ClientData dummy, /* Not used. */
|
||||
Tcl_Interp *interp,
|
||||
int objc,
|
||||
Tcl_Obj *const *objv)
|
||||
{
|
||||
Tcl_Obj *dictPtr, *resultPtr;
|
||||
int result, allocatedDict = 0;
|
||||
(void)dummy;
|
||||
|
||||
if (objc < 3) {
|
||||
Tcl_WrongNumArgs(interp, 1, objv, "dictVarName key ?key ...?");
|
||||
@@ -2995,7 +3016,7 @@ DictUnsetCmd(
|
||||
|
||||
static int
|
||||
DictFilterCmd(
|
||||
ClientData dummy,
|
||||
ClientData dummy, /* Not used. */
|
||||
Tcl_Interp *interp,
|
||||
int objc,
|
||||
Tcl_Obj *const *objv)
|
||||
@@ -3012,6 +3033,7 @@ DictFilterCmd(
|
||||
Tcl_DictSearch search;
|
||||
int index, varc, done, result, satisfied;
|
||||
const char *pattern;
|
||||
(void)dummy;
|
||||
|
||||
if (objc < 3) {
|
||||
Tcl_WrongNumArgs(interp, 1, objv, "dictionary filterType ?arg ...?");
|
||||
@@ -3288,6 +3310,7 @@ DictUpdateCmd(
|
||||
Interp *iPtr = (Interp *) interp;
|
||||
Tcl_Obj *dictPtr, *objPtr;
|
||||
int i, dummy;
|
||||
(void)clientData;
|
||||
|
||||
if (objc < 5 || !(objc & 1)) {
|
||||
Tcl_WrongNumArgs(interp, 1, objv,
|
||||
@@ -3341,8 +3364,8 @@ FinalizeDictUpdate(
|
||||
Tcl_Obj *dictPtr, *objPtr, **objv;
|
||||
Tcl_InterpState state;
|
||||
int i, objc;
|
||||
Tcl_Obj *varName = data[0];
|
||||
Tcl_Obj *argsObj = data[1];
|
||||
Tcl_Obj *varName = (Tcl_Obj *)data[0];
|
||||
Tcl_Obj *argsObj = (Tcl_Obj *)data[1];
|
||||
|
||||
/*
|
||||
* ErrorInfo handling.
|
||||
@@ -3438,13 +3461,14 @@ FinalizeDictUpdate(
|
||||
|
||||
static int
|
||||
DictWithCmd(
|
||||
ClientData dummy,
|
||||
ClientData dummy, /* Not used. */
|
||||
Tcl_Interp *interp,
|
||||
int objc,
|
||||
Tcl_Obj *const *objv)
|
||||
{
|
||||
Interp *iPtr = (Interp *) interp;
|
||||
Tcl_Obj *dictPtr, *keysPtr, *pathPtr;
|
||||
(void)dummy;
|
||||
|
||||
if (objc < 3) {
|
||||
Tcl_WrongNumArgs(interp, 1, objv, "dictVarName ?key ...? script");
|
||||
@@ -3492,9 +3516,9 @@ FinalizeDictWith(
|
||||
Tcl_Obj **pathv;
|
||||
int pathc;
|
||||
Tcl_InterpState state;
|
||||
Tcl_Obj *varName = data[0];
|
||||
Tcl_Obj *keysPtr = data[1];
|
||||
Tcl_Obj *pathPtr = data[2];
|
||||
Tcl_Obj *varName = (Tcl_Obj *)data[0];
|
||||
Tcl_Obj *keysPtr = (Tcl_Obj *)data[1];
|
||||
Tcl_Obj *pathPtr = (Tcl_Obj *)data[2];
|
||||
Var *varPtr, *arrayPtr;
|
||||
|
||||
if (result == TCL_ERROR) {
|
||||
|
||||
@@ -23,8 +23,7 @@
|
||||
|
||||
static Tcl_Obj * DisassembleByteCodeAsDicts(Tcl_Interp *interp,
|
||||
Tcl_Obj *objPtr);
|
||||
static Tcl_Obj * DisassembleByteCodeObj(Tcl_Interp *interp,
|
||||
Tcl_Obj *objPtr);
|
||||
static Tcl_Obj * DisassembleByteCodeObj(Tcl_Obj *objPtr);
|
||||
static int FormatInstruction(ByteCode *codePtr,
|
||||
const unsigned char *pc, Tcl_Obj *bufferObj);
|
||||
static void GetLocationInformation(Proc *procPtr,
|
||||
@@ -135,7 +134,7 @@ TclPrintByteCodeObj(
|
||||
Tcl_Interp *interp, /* Used only for getting location info. */
|
||||
Tcl_Obj *objPtr) /* The bytecode object to disassemble. */
|
||||
{
|
||||
Tcl_Obj *bufPtr = DisassembleByteCodeObj(interp, objPtr);
|
||||
Tcl_Obj *bufPtr = DisassembleByteCodeObj(objPtr);
|
||||
|
||||
fprintf(stdout, "\n%s", TclGetString(bufPtr));
|
||||
Tcl_DecrRefCount(bufPtr);
|
||||
@@ -251,7 +250,6 @@ TclPrintSource(
|
||||
|
||||
static Tcl_Obj *
|
||||
DisassembleByteCodeObj(
|
||||
Tcl_Interp *interp,
|
||||
Tcl_Obj *objPtr) /* The bytecode object to disassemble. */
|
||||
{
|
||||
ByteCode *codePtr;
|
||||
@@ -903,7 +901,7 @@ PrintSourceToObj(
|
||||
i += 2;
|
||||
continue;
|
||||
default:
|
||||
#if TCL_UTF_MAX > 4
|
||||
#if TCL_UTF_MAX > 3
|
||||
if (ch > 0xffff) {
|
||||
Tcl_AppendPrintfToObj(appendObj, "\\U%08x", ch);
|
||||
i += 10;
|
||||
@@ -952,8 +950,7 @@ PrintSourceToObj(
|
||||
|
||||
static Tcl_Obj *
|
||||
DisassembleByteCodeAsDicts(
|
||||
Tcl_Interp *interp, /* Used for looking up the CmdFrame for the
|
||||
* procedure, if one exists. */
|
||||
Tcl_Interp *dummy, /* Not used. */
|
||||
Tcl_Obj *objPtr) /* The bytecode-holding value to take apart */
|
||||
{
|
||||
ByteCode *codePtr;
|
||||
@@ -962,6 +959,7 @@ DisassembleByteCodeAsDicts(
|
||||
unsigned char *pc, *opnd, *codeOffPtr, *codeLenPtr, *srcOffPtr, *srcLenPtr;
|
||||
int codeOffset, codeLength, sourceOffset, sourceLength;
|
||||
int i, val, line;
|
||||
(void)dummy;
|
||||
|
||||
ByteCodeGetIntRep(objPtr, &tclByteCodeType, codePtr);
|
||||
|
||||
@@ -1577,7 +1575,7 @@ Tcl_DisassembleObjCmd(
|
||||
TclGetString(objv[3]), NULL);
|
||||
return TCL_ERROR;
|
||||
}
|
||||
procPtr = TclOOGetProcFromMethod(Tcl_GetHashValue(hPtr));
|
||||
procPtr = TclOOGetProcFromMethod((Method *)Tcl_GetHashValue(hPtr));
|
||||
if (procPtr == NULL) {
|
||||
Tcl_SetObjResult(interp, Tcl_NewStringObj(
|
||||
"body not available for this kind of method", -1));
|
||||
@@ -1627,7 +1625,7 @@ Tcl_DisassembleObjCmd(
|
||||
DisassembleByteCodeAsDicts(interp, codeObjPtr));
|
||||
} else {
|
||||
Tcl_SetObjResult(interp,
|
||||
DisassembleByteCodeObj(interp, codeObjPtr));
|
||||
DisassembleByteCodeObj(codeObjPtr));
|
||||
}
|
||||
return TCL_OK;
|
||||
}
|
||||
|
||||
+148
-132
@@ -83,7 +83,7 @@ typedef struct {
|
||||
} TableEncodingData;
|
||||
|
||||
/*
|
||||
* The following structures is the clientData for a dynamically-loaded,
|
||||
* Each of the following structures is the clientData for a dynamically-loaded
|
||||
* escape-driven encoding that is itself comprised of other simpler encodings.
|
||||
* An example is "iso-2022-jp", which uses escape sequences to switch between
|
||||
* ascii, jis0208, jis0212, gb2312, and ksc5601. Note that "escape-driven"
|
||||
@@ -117,8 +117,8 @@ typedef struct {
|
||||
* 0. */
|
||||
int numSubTables; /* Length of following array. */
|
||||
EscapeSubTable subTables[1];/* Information about each EscapeSubTable used
|
||||
* by this encoding type. The actual size will
|
||||
* be as large as necessary to hold all
|
||||
* by this encoding type. The actual size is
|
||||
* as large as necessary to hold all
|
||||
* EscapeSubTables. */
|
||||
} EscapeEncodingData;
|
||||
|
||||
@@ -156,7 +156,7 @@ static ProcessGlobalValue encodingFileMap = {
|
||||
* A list of directories making up the "library path". Historically this
|
||||
* search path has served many uses, but the only one remaining is a base for
|
||||
* the encodingSearchPath above. If the application does not explicitly set
|
||||
* the encodingSearchPath, then it will be initialized by appending /encoding
|
||||
* the encodingSearchPath, then it is initialized by appending /encoding
|
||||
* to each directory in this "libraryPath".
|
||||
*/
|
||||
|
||||
@@ -177,7 +177,7 @@ TCL_DECLARE_MUTEX(encodingMutex)
|
||||
/*
|
||||
* The following are used to hold the default and current system encodings.
|
||||
* If NULL is passed to one of the conversion routines, the current setting of
|
||||
* the system encoding will be used to perform the conversion.
|
||||
* the system encoding is used to perform the conversion.
|
||||
*/
|
||||
|
||||
static Tcl_Encoding defaultEncoding = NULL;
|
||||
@@ -296,7 +296,7 @@ static const Tcl_ObjType encodingType = {
|
||||
do { \
|
||||
const Tcl_ObjIntRep *irPtr; \
|
||||
irPtr = TclFetchIntRep ((objPtr), &encodingType); \
|
||||
(encoding) = irPtr ? irPtr->twoPtrValue.ptr1 : NULL; \
|
||||
(encoding) = irPtr ? (Tcl_Encoding)irPtr->twoPtrValue.ptr1 : NULL; \
|
||||
} while (0)
|
||||
|
||||
|
||||
@@ -451,9 +451,8 @@ TclGetLibraryPath(void)
|
||||
* Keeps the per-thread copy of the library path current with changes to
|
||||
* the global copy.
|
||||
*
|
||||
* NOTE: this routine returns void, so there's no way to report the error
|
||||
* that searchPath is not a valid list. In that case, this routine will
|
||||
* silently do nothing.
|
||||
* Since the result of this routine is void, if searchPath is not a valid
|
||||
* list this routine silently does nothing.
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
@@ -475,17 +474,16 @@ TclSetLibraryPath(
|
||||
*
|
||||
* FillEncodingFileMap --
|
||||
*
|
||||
* Called to bring the encoding file map in sync with the current value
|
||||
* Called to update the encoding file map with the current value
|
||||
* of the encoding search path.
|
||||
*
|
||||
* Scan the directories on the encoding search path, find the *.enc
|
||||
* files, and store the found pathnames in a map associated with the
|
||||
* encoding name.
|
||||
* Finds *.end files in the directories on the encoding search path and
|
||||
* stores the found pathnames in a map associated with the encoding name.
|
||||
*
|
||||
* In particular, if $dir is on the encoding search path, and the file
|
||||
* $dir/foo.enc is found, then store a "foo" -> $dir entry in the map.
|
||||
* Later, any need for the "foo" encoding will quickly * be able to
|
||||
* construct the $dir/foo.enc pathname for reading the encoding data.
|
||||
* If $dir is on the encoding search path and the file $dir/foo.enc is
|
||||
* found, stores a "foo" -> $dir entry in the map. if the "foo" encoding
|
||||
* is needed later, the $dir/foo.enc name can be quickly constructed in
|
||||
* order to read the encoding data.
|
||||
*
|
||||
* Results:
|
||||
* None.
|
||||
@@ -584,9 +582,9 @@ TclInitEncodingSubsystem(void)
|
||||
Tcl_MutexUnlock(&encodingMutex);
|
||||
|
||||
/*
|
||||
* Create a few initial encodings. Note that the UTF-8 to UTF-8
|
||||
* translation is not a no-op, because it will turn a stream of improperly
|
||||
* formed UTF-8 into a properly formed stream.
|
||||
* Create a few initial encodings. UTF-8 to UTF-8 translation is not a
|
||||
* no-op because it turns a stream of improperly formed UTF-8 into a
|
||||
* properly formed stream.
|
||||
*/
|
||||
|
||||
type.encodingName = NULL;
|
||||
@@ -624,13 +622,13 @@ TclInitEncodingSubsystem(void)
|
||||
type.freeProc = NULL;
|
||||
type.nullSize = 2;
|
||||
type.encodingName = "utf-16le";
|
||||
type.clientData = INT2PTR(1);;
|
||||
type.clientData = INT2PTR(1);
|
||||
Tcl_CreateEncoding(&type);
|
||||
type.encodingName = "utf-16be";
|
||||
type.clientData = INT2PTR(0);
|
||||
Tcl_CreateEncoding(&type);
|
||||
type.encodingName = "utf-16";
|
||||
type.clientData = INT2PTR(isLe.c);;
|
||||
type.clientData = INT2PTR(isLe.c);
|
||||
Tcl_CreateEncoding(&type);
|
||||
|
||||
#ifndef TCL_NO_DEPRECATED
|
||||
@@ -645,14 +643,14 @@ TclInitEncodingSubsystem(void)
|
||||
* code to duplicate the structure of a table encoding here.
|
||||
*/
|
||||
|
||||
dataPtr = ckalloc(sizeof(TableEncodingData));
|
||||
dataPtr = (TableEncodingData *)ckalloc(sizeof(TableEncodingData));
|
||||
memset(dataPtr, 0, sizeof(TableEncodingData));
|
||||
dataPtr->fallback = '?';
|
||||
|
||||
size = 256*(sizeof(unsigned short *) + sizeof(unsigned short));
|
||||
dataPtr->toUnicode = ckalloc(size);
|
||||
dataPtr->toUnicode = (unsigned short **)ckalloc(size);
|
||||
memset(dataPtr->toUnicode, 0, size);
|
||||
dataPtr->fromUnicode = ckalloc(size);
|
||||
dataPtr->fromUnicode = (unsigned short **)ckalloc(size);
|
||||
memset(dataPtr->fromUnicode, 0, size);
|
||||
|
||||
dataPtr->toUnicode[0] = (unsigned short *) (dataPtr->toUnicode + 256);
|
||||
@@ -718,7 +716,7 @@ TclFinalizeEncodingSubsystem(void)
|
||||
* cleaned up.
|
||||
*/
|
||||
|
||||
FreeEncoding(Tcl_GetHashValue(hPtr));
|
||||
FreeEncoding((Tcl_Encoding)Tcl_GetHashValue(hPtr));
|
||||
hPtr = Tcl_FirstHashEntry(&encodingTable, &search);
|
||||
}
|
||||
|
||||
@@ -806,11 +804,7 @@ Tcl_SetDefaultEncodingDir(
|
||||
* interp was NULL.
|
||||
*
|
||||
* Side effects:
|
||||
* The new encoding type is entered into a table visible to all
|
||||
* interpreters, keyed off the encoding's name. For each call to this
|
||||
* function, there should eventually be a call to Tcl_FreeEncoding, so
|
||||
* that the database can be cleaned up when encodings aren't needed
|
||||
* anymore.
|
||||
* LoadEncodingFile is called if necessary.
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -833,7 +827,7 @@ Tcl_GetEncoding(
|
||||
|
||||
hPtr = Tcl_FindHashEntry(&encodingTable, name);
|
||||
if (hPtr != NULL) {
|
||||
encodingPtr = Tcl_GetHashValue(hPtr);
|
||||
encodingPtr = (Encoding *)Tcl_GetHashValue(hPtr);
|
||||
encodingPtr->refCount++;
|
||||
Tcl_MutexUnlock(&encodingMutex);
|
||||
return (Tcl_Encoding) encodingPtr;
|
||||
@@ -848,15 +842,15 @@ Tcl_GetEncoding(
|
||||
*
|
||||
* Tcl_FreeEncoding --
|
||||
*
|
||||
* This function is called to release an encoding allocated by
|
||||
* Tcl_CreateEncoding() or Tcl_GetEncoding().
|
||||
* Releases an encoding allocated by Tcl_CreateEncoding() or
|
||||
* Tcl_GetEncoding().
|
||||
*
|
||||
* Results:
|
||||
* None.
|
||||
*
|
||||
* Side effects:
|
||||
* The reference count associated with the encoding is decremented and
|
||||
* the encoding may be deleted if nothing is using it anymore.
|
||||
* the encoding is deleted if nothing is using it anymore.
|
||||
*
|
||||
*---------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -875,13 +869,14 @@ Tcl_FreeEncoding(
|
||||
*
|
||||
* FreeEncoding --
|
||||
*
|
||||
* This function is called to release an encoding by functions that
|
||||
* already have the encodingMutex.
|
||||
* Decrements the reference count of an encoding. The caller must hold
|
||||
* encodingMutes.
|
||||
*
|
||||
* Results:
|
||||
* None.
|
||||
*
|
||||
* Side effects:
|
||||
* Releases the resource for an encoding if it is now unused.
|
||||
* The reference count associated with the encoding is decremented and
|
||||
* the encoding may be deleted if nothing is using it anymore.
|
||||
*
|
||||
@@ -977,7 +972,7 @@ Tcl_GetEncodingNames(
|
||||
Tcl_MutexLock(&encodingMutex);
|
||||
for (hPtr = Tcl_FirstHashEntry(&encodingTable, &search); hPtr != NULL;
|
||||
hPtr = Tcl_NextHashEntry(&search)) {
|
||||
Encoding *encodingPtr = Tcl_GetHashValue(hPtr);
|
||||
Encoding *encodingPtr = (Encoding *)Tcl_GetHashValue(hPtr);
|
||||
|
||||
Tcl_CreateHashEntry(&table,
|
||||
Tcl_NewStringObj(encodingPtr->name, -1), &dummy);
|
||||
@@ -1069,23 +1064,22 @@ Tcl_SetSystemEncoding(
|
||||
*
|
||||
* Tcl_CreateEncoding --
|
||||
*
|
||||
* This function is called to define a new encoding and the functions
|
||||
* that are used to convert between the specified encoding and Unicode.
|
||||
* Defines a new encoding, along with the functions that are used to
|
||||
* convert to and from Unicode.
|
||||
*
|
||||
* Results:
|
||||
* Returns a token that represents the encoding. If an encoding with the
|
||||
* same name already existed, the old encoding token remains valid and
|
||||
* continues to behave as it used to, and will eventually be garbage
|
||||
* collected when the last reference to it goes away. Any subsequent
|
||||
* calls to Tcl_GetEncoding with the specified name will retrieve the
|
||||
* most recent encoding token.
|
||||
* continues to behave as it used to, and is eventually garbage collected
|
||||
* when the last reference to it goes away. Any subsequent calls to
|
||||
* Tcl_GetEncoding with the specified name retrieve the most recent
|
||||
* encoding token.
|
||||
*
|
||||
* Side effects:
|
||||
* The new encoding type is entered into a table visible to all
|
||||
* interpreters, keyed off the encoding's name. For each call to this
|
||||
* function, there should eventually be a call to Tcl_FreeEncoding, so
|
||||
* that the database can be cleaned up when encodings aren't needed
|
||||
* anymore.
|
||||
* A new record having the name of the encoding is entered into a table of
|
||||
* encodings visible to all interpreters. For each call to this function,
|
||||
* there should eventually be a call to Tcl_FreeEncoding, which cleans
|
||||
* deletes the record in the table when an encoding is no longer needed.
|
||||
*
|
||||
*---------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -1095,7 +1089,7 @@ Tcl_CreateEncoding(
|
||||
const Tcl_EncodingType *typePtr)
|
||||
/* The encoding type. */
|
||||
{
|
||||
Encoding *encodingPtr = ckalloc(sizeof(Encoding));
|
||||
Encoding *encodingPtr = (Encoding *)ckalloc(sizeof(Encoding));
|
||||
encodingPtr->name = NULL;
|
||||
encodingPtr->toUtfProc = typePtr->toUtfProc;
|
||||
encodingPtr->fromUtfProc = typePtr->fromUtfProc;
|
||||
@@ -1123,11 +1117,11 @@ Tcl_CreateEncoding(
|
||||
* reference goes away.
|
||||
*/
|
||||
|
||||
Encoding *replaceMe = Tcl_GetHashValue(hPtr);
|
||||
Encoding *replaceMe = (Encoding *)Tcl_GetHashValue(hPtr);
|
||||
replaceMe->hPtr = NULL;
|
||||
}
|
||||
|
||||
name = ckalloc(strlen(typePtr->encodingName) + 1);
|
||||
name = (char *)ckalloc(strlen(typePtr->encodingName) + 1);
|
||||
encodingPtr->name = strcpy(name, typePtr->encodingName);
|
||||
encodingPtr->hPtr = hPtr;
|
||||
Tcl_SetHashValue(hPtr, encodingPtr);
|
||||
@@ -1232,7 +1226,7 @@ Tcl_ExternalToUtfDString(
|
||||
|
||||
int
|
||||
Tcl_ExternalToUtf(
|
||||
Tcl_Interp *interp, /* Interp for error return, if not NULL. */
|
||||
Tcl_Interp *dummy, /* Interp for error return, if not NULL. */
|
||||
Tcl_Encoding encoding, /* The encoding for the source string, or NULL
|
||||
* for the default system encoding. */
|
||||
const char *src, /* Source string in specified encoding. */
|
||||
@@ -1266,6 +1260,7 @@ Tcl_ExternalToUtf(
|
||||
int charLimited = (flags & TCL_ENCODING_CHAR_LIMIT) && dstCharsPtr;
|
||||
int maxChars = INT_MAX;
|
||||
Tcl_EncodingState state;
|
||||
(void)dummy;
|
||||
|
||||
if (encoding == NULL) {
|
||||
encoding = systemEncoding;
|
||||
@@ -1332,10 +1327,9 @@ Tcl_ExternalToUtf(
|
||||
*
|
||||
* Tcl_UtfToExternalDString --
|
||||
*
|
||||
* Convert a source buffer from UTF-8 into the specified encoding. If any
|
||||
* Convert a source buffer from UTF-8 to the specified encoding. If any
|
||||
* of the bytes in the source buffer are invalid or cannot be represented
|
||||
* in the target encoding, a default fallback character will be
|
||||
* substituted.
|
||||
* in the target encoding, a default fallback character is substituted.
|
||||
*
|
||||
* Results:
|
||||
* The converted bytes are stored in the DString, which is then NULL
|
||||
@@ -1424,7 +1418,7 @@ Tcl_UtfToExternalDString(
|
||||
|
||||
int
|
||||
Tcl_UtfToExternal(
|
||||
Tcl_Interp *interp, /* Interp for error return, if not NULL. */
|
||||
Tcl_Interp *dummy, /* Interp for error return, if not NULL. */
|
||||
Tcl_Encoding encoding, /* The encoding for the converted string, or
|
||||
* NULL for the default system encoding. */
|
||||
const char *src, /* Source string in UTF-8. */
|
||||
@@ -1455,6 +1449,7 @@ Tcl_UtfToExternal(
|
||||
const Encoding *encodingPtr;
|
||||
int result, srcRead, dstWrote, dstChars;
|
||||
Tcl_EncodingState state;
|
||||
(void)dummy;
|
||||
|
||||
if (encoding == NULL) {
|
||||
encoding = systemEncoding;
|
||||
@@ -1515,7 +1510,7 @@ Tcl_FindExecutable(
|
||||
const char *argv0) /* The value of the application's argv[0]
|
||||
* (native). */
|
||||
{
|
||||
TclInitSubsystems();
|
||||
Tcl_InitSubsystems();
|
||||
TclpSetInitialEncodings();
|
||||
TclpFindExecutable(argv0);
|
||||
}
|
||||
@@ -1646,13 +1641,13 @@ OpenEncodingFileChannel(
|
||||
* the data.
|
||||
*
|
||||
* Results:
|
||||
* The return value is the newly loaded Encoding, or NULL if the file
|
||||
* didn't exist of was in the incorrect format. If NULL was returned, an
|
||||
* error message is left in interp's result object, unless interp was
|
||||
* NULL.
|
||||
* The return value is the newly loaded Tcl_Encoding or NULL if the file
|
||||
* didn't exist or could not be processed. If NULL is returned and interp
|
||||
* is not NULL, an error message is left in interp's result object.
|
||||
*
|
||||
* Side effects:
|
||||
* File read from disk.
|
||||
* A corresponding encoding file might be read from persistent storage, in
|
||||
* which case LoadTableEncoding is called.
|
||||
*
|
||||
*---------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -1660,8 +1655,8 @@ OpenEncodingFileChannel(
|
||||
static Tcl_Encoding
|
||||
LoadEncodingFile(
|
||||
Tcl_Interp *interp, /* Interp for error reporting, if not NULL. */
|
||||
const char *name) /* The name of the encoding file on disk and
|
||||
* also the name for new encoding. */
|
||||
const char *name) /* The name of both the encoding file
|
||||
* and the new encoding. */
|
||||
{
|
||||
Tcl_Channel chan = NULL;
|
||||
Tcl_Encoding encoding = NULL;
|
||||
@@ -1715,27 +1710,27 @@ LoadEncodingFile(
|
||||
*
|
||||
* LoadTableEncoding --
|
||||
*
|
||||
* Helper function for LoadEncodingTable(). Loads a table to that
|
||||
* converts between Unicode and some other encoding and creates an
|
||||
* encoding (using a TableEncoding structure) from that information.
|
||||
* Helper function for LoadEncodingFile(). Creates a Tcl_EncodingType
|
||||
* structure along with its corresponding TableEncodingData structure, and
|
||||
* passes it to Tcl_Createncoding.
|
||||
*
|
||||
* File contains binary data, but begins with a marker to indicate
|
||||
* byte-ordering, so that same binary file can be read on either endian
|
||||
* platforms.
|
||||
* The file contains binary data but begins with a marker to indicate
|
||||
* byte-ordering so a single binary file can be read on big or
|
||||
* little-endian systems.
|
||||
*
|
||||
* Results:
|
||||
* The return value is the new encoding, or NULL if the encoding could
|
||||
* not be created (because the file contained invalid data).
|
||||
* Returns the new Tcl_Encoding, or NULL if it could could
|
||||
* not be created because the file contained invalid data.
|
||||
*
|
||||
* Side effects:
|
||||
* None.
|
||||
* See Tcl_CreateEncoding().
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
static Tcl_Encoding
|
||||
LoadTableEncoding(
|
||||
const char *name, /* Name for new encoding. */
|
||||
const char *name, /* Name of the new encoding. */
|
||||
int type, /* Type of encoding (ENCODING_?????). */
|
||||
Tcl_Channel chan) /* File containing new encoding. */
|
||||
{
|
||||
@@ -1795,7 +1790,7 @@ LoadTableEncoding(
|
||||
#undef PAGESIZE
|
||||
#define PAGESIZE (256 * sizeof(unsigned short))
|
||||
|
||||
dataPtr = ckalloc(sizeof(TableEncodingData));
|
||||
dataPtr = (TableEncodingData *)ckalloc(sizeof(TableEncodingData));
|
||||
memset(dataPtr, 0, sizeof(TableEncodingData));
|
||||
|
||||
dataPtr->fallback = fallback;
|
||||
@@ -1807,7 +1802,7 @@ LoadTableEncoding(
|
||||
*/
|
||||
|
||||
size = 256 * sizeof(unsigned short *) + numPages * PAGESIZE;
|
||||
dataPtr->toUnicode = ckalloc(size);
|
||||
dataPtr->toUnicode = (unsigned short **)ckalloc(size);
|
||||
memset(dataPtr->toUnicode, 0, size);
|
||||
pageMemPtr = (unsigned short *) (dataPtr->toUnicode + 256);
|
||||
|
||||
@@ -1852,10 +1847,10 @@ LoadTableEncoding(
|
||||
}
|
||||
|
||||
/*
|
||||
* Invert toUnicode array to produce the fromUnicode array. Performs a
|
||||
* Invert the toUnicode array to produce the fromUnicode array. Performs a
|
||||
* single malloc to get the memory for the array and all the pages needed
|
||||
* by the array. While reading in the toUnicode array, we remembered what
|
||||
* pages that would be needed for the fromUnicode array.
|
||||
* by the array. While reading in the toUnicode array remember what
|
||||
* pages are needed for the fromUnicode array.
|
||||
*/
|
||||
|
||||
if (symbol) {
|
||||
@@ -1868,7 +1863,7 @@ LoadTableEncoding(
|
||||
}
|
||||
}
|
||||
size = 256 * sizeof(unsigned short *) + numPages * PAGESIZE;
|
||||
dataPtr->fromUnicode = ckalloc(size);
|
||||
dataPtr->fromUnicode = (unsigned short **)ckalloc(size);
|
||||
memset(dataPtr->fromUnicode, 0, size);
|
||||
pageMemPtr = (unsigned short *) (dataPtr->fromUnicode + 256);
|
||||
|
||||
@@ -1894,26 +1889,26 @@ LoadTableEncoding(
|
||||
if (type == ENCODING_MULTIBYTE) {
|
||||
/*
|
||||
* If multibyte encodings don't have a backslash character, define
|
||||
* one. Otherwise, on Windows, native file names won't work because
|
||||
* the backslash in the file name will map to the unknown character
|
||||
* one. Otherwise, on Windows, native file names don't work because
|
||||
* the backslash in the file name maps to the unknown character
|
||||
* (question mark) when converting from UTF-8 to external encoding.
|
||||
*/
|
||||
|
||||
if (dataPtr->fromUnicode[0] != NULL) {
|
||||
if (dataPtr->fromUnicode[0]['\\'] == '\0') {
|
||||
dataPtr->fromUnicode[0]['\\'] = '\\';
|
||||
if (dataPtr->fromUnicode[0][(int)'\\'] == '\0') {
|
||||
dataPtr->fromUnicode[0][(int)'\\'] = '\\';
|
||||
}
|
||||
}
|
||||
}
|
||||
if (symbol) {
|
||||
/*
|
||||
* Make a special symbol encoding that not only maps the symbol
|
||||
* characters from their Unicode code points down into page 0, but
|
||||
* also ensure that the characters on page 0 map to themselves. This
|
||||
* is so that a symbol font can be used to display a simple string
|
||||
* like "abcd" and have alpha, beta, chi, delta show up, rather than
|
||||
* have "unknown" chars show up because strictly speaking the symbol
|
||||
* font doesn't have glyphs for those low ASCII chars.
|
||||
* Make a special symbol encoding that maps each symbol character from
|
||||
* its Unicode code point down into page 0, and also ensure that each
|
||||
* characters on page 0 maps to itself so that a symbol font can be
|
||||
* used to display a simple string like "abcd" and have alpha, beta,
|
||||
* chi, delta show up, rather than have "unknown" chars show up because
|
||||
* strictly speaking the symbol font doesn't have glyphs for those low
|
||||
* ASCII chars.
|
||||
*/
|
||||
|
||||
page = dataPtr->fromUnicode[0];
|
||||
@@ -1960,7 +1955,7 @@ LoadTableEncoding(
|
||||
}
|
||||
|
||||
/*
|
||||
* Read lines from the encoding until EOF.
|
||||
* Read lines until EOF.
|
||||
*/
|
||||
|
||||
for (TclDStringClear(&lineString);
|
||||
@@ -2037,7 +2032,7 @@ LoadTableEncoding(
|
||||
|
||||
static Tcl_Encoding
|
||||
LoadEscapeEncoding(
|
||||
const char *name, /* Name for new encoding. */
|
||||
const char *name, /* Name of the new encoding. */
|
||||
Tcl_Channel chan) /* File containing new encoding. */
|
||||
{
|
||||
int i;
|
||||
@@ -2106,7 +2101,7 @@ LoadEscapeEncoding(
|
||||
|
||||
size = sizeof(EscapeEncodingData) - sizeof(EscapeSubTable)
|
||||
+ Tcl_DStringLength(&escapeData);
|
||||
dataPtr = ckalloc(size);
|
||||
dataPtr = (EscapeEncodingData *)ckalloc(size);
|
||||
dataPtr->initLen = strlen(init);
|
||||
memcpy(dataPtr->init, init, dataPtr->initLen + 1);
|
||||
dataPtr->finalLen = strlen(final);
|
||||
@@ -2185,6 +2180,8 @@ BinaryProc(
|
||||
* output buffer. */
|
||||
{
|
||||
int result;
|
||||
(void)clientData;
|
||||
(void)statePtr;
|
||||
|
||||
result = TCL_OK;
|
||||
dstLen -= TCL_UTF_MAX - 1;
|
||||
@@ -2209,7 +2206,7 @@ BinaryProc(
|
||||
/*
|
||||
*-------------------------------------------------------------------------
|
||||
*
|
||||
* UtfExtToUtfIntProc --
|
||||
* UtfIntToUtfExtProc --
|
||||
*
|
||||
* Convert from UTF-8 to UTF-8. While converting null-bytes from the
|
||||
* Tcl's internal representation (0xc0, 0x80) to the official
|
||||
@@ -2350,12 +2347,13 @@ UtfToUtfProc(
|
||||
* output buffer. */
|
||||
int pureNullMode) /* Convert embedded nulls from internal
|
||||
* representation to real null-bytes or vice
|
||||
* versa. */
|
||||
* versa. Also combine or separate surrogate pairs */
|
||||
{
|
||||
const char *srcStart, *srcEnd, *srcClose;
|
||||
const char *dstStart, *dstEnd;
|
||||
int result, numChars, charLimit = INT_MAX;
|
||||
Tcl_UniChar *chPtr = (Tcl_UniChar *) statePtr;
|
||||
(void)clientData;
|
||||
|
||||
if (flags & TCL_ENCODING_START) {
|
||||
*statePtr = 0;
|
||||
@@ -2366,7 +2364,7 @@ UtfToUtfProc(
|
||||
srcEnd = src + srcLen;
|
||||
srcClose = srcEnd;
|
||||
if ((flags & TCL_ENCODING_END) == 0) {
|
||||
srcClose -= TCL_UTF_MAX;
|
||||
srcClose -= 6;
|
||||
}
|
||||
if (flags & TCL_ENCODING_CHAR_LIMIT) {
|
||||
charLimit = *dstCharsPtr;
|
||||
@@ -2415,15 +2413,22 @@ UtfToUtfProc(
|
||||
src += 1;
|
||||
dst += Tcl_UniCharToUtf(*chPtr, dst);
|
||||
} else {
|
||||
int len = TclUtfToUniChar(src, chPtr);
|
||||
src += len;
|
||||
dst += Tcl_UniCharToUtf(*chPtr, dst);
|
||||
#if TCL_UTF_MAX <= 4
|
||||
if ((*chPtr >= 0xD800) && (len < 3)) {
|
||||
src += TclUtfToUniChar(src + len, chPtr);
|
||||
src += TclUtfToUniChar(src, chPtr);
|
||||
if ((*chPtr | 0x7FF) == 0xDFFF) {
|
||||
/* A surrogate character is detected, handle especially */
|
||||
Tcl_UniChar low = *chPtr;
|
||||
size_t len = (src <= srcEnd-3) ? Tcl_UtfToUniChar(src, &low) : 0;
|
||||
if (((low | 0x3FF) != 0xDFFF) || (*chPtr & 0x400)) {
|
||||
*dst++ = (char) (((*chPtr >> 12) | 0xE0) & 0xEF);
|
||||
*dst++ = (char) (((*chPtr >> 6) | 0x80) & 0xBF);
|
||||
*dst++ = (char) ((*chPtr | 0x80) & 0xBF);
|
||||
continue;
|
||||
}
|
||||
src += len;
|
||||
dst += Tcl_UniCharToUtf(*chPtr, dst);
|
||||
*chPtr = low;
|
||||
}
|
||||
#endif
|
||||
dst += Tcl_UniCharToUtf(*chPtr, dst);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2480,15 +2485,22 @@ Utf16ToUtfProc(
|
||||
const char *dstEnd, *dstStart;
|
||||
int result, numChars, charLimit = INT_MAX;
|
||||
unsigned short ch;
|
||||
(void)statePtr;
|
||||
|
||||
if (flags & TCL_ENCODING_CHAR_LIMIT) {
|
||||
charLimit = *dstCharsPtr;
|
||||
}
|
||||
result = TCL_OK;
|
||||
if ((srcLen % sizeof(unsigned short)) != 0) {
|
||||
|
||||
/* check alignment with utf-16 (2 == sizeof(UTF-16)) */
|
||||
if ((srcLen % 2) != 0) {
|
||||
result = TCL_CONVERT_MULTIBYTE;
|
||||
srcLen /= sizeof(unsigned short);
|
||||
srcLen *= sizeof(unsigned short);
|
||||
srcLen--;
|
||||
}
|
||||
/* If last code point is a high surrogate, we cannot handle that yet */
|
||||
if ((srcLen >= 2) && ((src[srcLen - (clientData?1:2)] & 0xFC) == 0xD8)) {
|
||||
result = TCL_CONVERT_MULTIBYTE;
|
||||
srcLen-= 2;
|
||||
}
|
||||
|
||||
srcStart = src;
|
||||
@@ -2609,7 +2621,7 @@ UtfToUtf16Proc(
|
||||
*/
|
||||
|
||||
if (clientData) {
|
||||
#if TCL_UTF_MAX > 4
|
||||
#if TCL_UTF_MAX > 3
|
||||
if (*chPtr <= 0xFFFF) {
|
||||
*dst++ = (*chPtr & 0xFF);
|
||||
*dst++ = (*chPtr >> 8);
|
||||
@@ -2624,7 +2636,7 @@ UtfToUtf16Proc(
|
||||
*dst++ = (*chPtr >> 8);
|
||||
#endif
|
||||
} else {
|
||||
#if TCL_UTF_MAX > 4
|
||||
#if TCL_UTF_MAX > 3
|
||||
if (*chPtr <= 0xFFFF) {
|
||||
*dst++ = (*chPtr >> 8);
|
||||
*dst++ = (*chPtr & 0xFF);
|
||||
@@ -2691,10 +2703,11 @@ UtfToUcs2Proc(
|
||||
{
|
||||
const char *srcStart, *srcEnd, *srcClose, *dstStart, *dstEnd;
|
||||
int result, numChars;
|
||||
#if TCL_UTF_MAX <= 4
|
||||
#if TCL_UTF_MAX <= 3
|
||||
int len;
|
||||
#endif
|
||||
Tcl_UniChar ch = 0;
|
||||
(void)statePtr;
|
||||
|
||||
srcStart = src;
|
||||
srcEnd = src + srcLen;
|
||||
@@ -2721,7 +2734,7 @@ UtfToUcs2Proc(
|
||||
result = TCL_CONVERT_NOSPACE;
|
||||
break;
|
||||
}
|
||||
#if TCL_UTF_MAX <= 4
|
||||
#if TCL_UTF_MAX <= 3
|
||||
src += (len = TclUtfToUniChar(src, &ch));
|
||||
if ((ch >= 0xD800) && (len < 3)) {
|
||||
src += TclUtfToUniChar(src, &ch);
|
||||
@@ -2804,7 +2817,8 @@ TableToUtfProc(
|
||||
Tcl_UniChar ch = 0;
|
||||
const unsigned short *const *toUnicode;
|
||||
const unsigned short *pageZero;
|
||||
TableEncodingData *dataPtr = clientData;
|
||||
TableEncodingData *dataPtr = (TableEncodingData *)clientData;
|
||||
(void)statePtr;
|
||||
|
||||
if (flags & TCL_ENCODING_CHAR_LIMIT) {
|
||||
charLimit = *dstCharsPtr;
|
||||
@@ -2915,8 +2929,9 @@ TableFromUtfProc(
|
||||
const char *dstStart, *dstEnd, *prefixBytes;
|
||||
Tcl_UniChar ch = 0;
|
||||
int result, len, word, numChars;
|
||||
TableEncodingData *dataPtr = clientData;
|
||||
TableEncodingData *dataPtr = (TableEncodingData *)clientData;
|
||||
const unsigned short *const *fromUnicode;
|
||||
(void)statePtr;
|
||||
|
||||
result = TCL_OK;
|
||||
|
||||
@@ -2945,7 +2960,7 @@ TableFromUtfProc(
|
||||
}
|
||||
len = TclUtfToUniChar(src, &ch);
|
||||
|
||||
#if TCL_UTF_MAX > 4
|
||||
#if TCL_UTF_MAX > 3
|
||||
/*
|
||||
* This prevents a crash condition. More evaluation is required for
|
||||
* full support of int Tcl_UniChar. [Bug 1004065]
|
||||
@@ -3039,6 +3054,8 @@ Iso88591ToUtfProc(
|
||||
const char *srcStart, *srcEnd;
|
||||
const char *dstEnd, *dstStart;
|
||||
int result, numChars, charLimit = INT_MAX;
|
||||
(void)clientData;
|
||||
(void)statePtr;
|
||||
|
||||
if (flags & TCL_ENCODING_CHAR_LIMIT) {
|
||||
charLimit = *dstCharsPtr;
|
||||
@@ -3122,10 +3139,10 @@ Iso88591FromUtfProc(
|
||||
{
|
||||
const char *srcStart, *srcEnd, *srcClose;
|
||||
const char *dstStart, *dstEnd;
|
||||
int result, numChars;
|
||||
int result = TCL_OK, numChars;
|
||||
Tcl_UniChar ch = 0;
|
||||
|
||||
result = TCL_OK;
|
||||
(void)clientData;
|
||||
(void)statePtr;
|
||||
|
||||
srcStart = src;
|
||||
srcEnd = src + srcLen;
|
||||
@@ -3156,7 +3173,7 @@ Iso88591FromUtfProc(
|
||||
*/
|
||||
|
||||
if (ch > 0xff
|
||||
#if TCL_UTF_MAX <= 4
|
||||
#if TCL_UTF_MAX <= 3
|
||||
|| ((ch >= 0xD800) && (len < 3))
|
||||
#endif
|
||||
) {
|
||||
@@ -3164,7 +3181,7 @@ Iso88591FromUtfProc(
|
||||
result = TCL_CONVERT_UNKNOWN;
|
||||
break;
|
||||
}
|
||||
#if TCL_UTF_MAX <= 4
|
||||
#if TCL_UTF_MAX <= 3
|
||||
if ((ch >= 0xD800) && (len < 3)) len = 4;
|
||||
#endif
|
||||
/*
|
||||
@@ -3210,7 +3227,7 @@ TableFreeProc(
|
||||
ClientData clientData) /* TableEncodingData that specifies
|
||||
* encoding. */
|
||||
{
|
||||
TableEncodingData *dataPtr = clientData;
|
||||
TableEncodingData *dataPtr = (TableEncodingData *)clientData;
|
||||
|
||||
/*
|
||||
* Make sure we aren't freeing twice on shutdown. [Bug 219314]
|
||||
@@ -3268,7 +3285,7 @@ EscapeToUtfProc(
|
||||
* correspond to the bytes stored in the
|
||||
* output buffer. */
|
||||
{
|
||||
EscapeEncodingData *dataPtr = clientData;
|
||||
EscapeEncodingData *dataPtr = (EscapeEncodingData *)clientData;
|
||||
const char *prefixBytes, *tablePrefixBytes, *srcStart, *srcEnd;
|
||||
const unsigned short *const *tableToUnicode;
|
||||
const Encoding *encodingPtr;
|
||||
@@ -3404,7 +3421,7 @@ EscapeToUtfProc(
|
||||
TableEncodingData *tableDataPtr;
|
||||
|
||||
encodingPtr = GetTableEncoding(dataPtr, state);
|
||||
tableDataPtr = encodingPtr->clientData;
|
||||
tableDataPtr = (TableEncodingData *)encodingPtr->clientData;
|
||||
tablePrefixBytes = tableDataPtr->prefixBytes;
|
||||
tableToUnicode = (const unsigned short *const*)
|
||||
tableDataPtr->toUnicode;
|
||||
@@ -3482,7 +3499,7 @@ EscapeFromUtfProc(
|
||||
* correspond to the bytes stored in the
|
||||
* output buffer. */
|
||||
{
|
||||
EscapeEncodingData *dataPtr = clientData;
|
||||
EscapeEncodingData *dataPtr = (EscapeEncodingData *)clientData;
|
||||
const Encoding *encodingPtr;
|
||||
const char *srcStart, *srcEnd, *srcClose;
|
||||
const char *dstStart, *dstEnd;
|
||||
@@ -3523,7 +3540,7 @@ EscapeFromUtfProc(
|
||||
}
|
||||
|
||||
encodingPtr = GetTableEncoding(dataPtr, state);
|
||||
tableDataPtr = encodingPtr->clientData;
|
||||
tableDataPtr = (const TableEncodingData *)encodingPtr->clientData;
|
||||
tablePrefixBytes = tableDataPtr->prefixBytes;
|
||||
tableFromUnicode = (const unsigned short *const *)
|
||||
tableDataPtr->fromUnicode;
|
||||
@@ -3551,7 +3568,7 @@ EscapeFromUtfProc(
|
||||
oldState = state;
|
||||
for (state = 0; state < dataPtr->numSubTables; state++) {
|
||||
encodingPtr = GetTableEncoding(dataPtr, state);
|
||||
tableDataPtr = encodingPtr->clientData;
|
||||
tableDataPtr = (const TableEncodingData *)encodingPtr->clientData;
|
||||
word = tableDataPtr->fromUnicode[(ch >> 8)][ch & 0xff];
|
||||
if (word != 0) {
|
||||
break;
|
||||
@@ -3565,7 +3582,7 @@ EscapeFromUtfProc(
|
||||
break;
|
||||
}
|
||||
encodingPtr = GetTableEncoding(dataPtr, state);
|
||||
tableDataPtr = encodingPtr->clientData;
|
||||
tableDataPtr = (const TableEncodingData *)encodingPtr->clientData;
|
||||
word = tableDataPtr->fallback;
|
||||
}
|
||||
|
||||
@@ -3655,14 +3672,13 @@ EscapeFromUtfProc(
|
||||
*
|
||||
* EscapeFreeProc --
|
||||
*
|
||||
* This function is invoked when an EscapeEncodingData encoding is
|
||||
* deleted. It deletes the memory used by the encoding.
|
||||
* Frees resources used by the encoding.
|
||||
*
|
||||
* Results:
|
||||
* None.
|
||||
*
|
||||
* Side effects:
|
||||
* Memory freed.
|
||||
* Memory is freed.
|
||||
*
|
||||
*---------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -3672,7 +3688,7 @@ EscapeFreeProc(
|
||||
ClientData clientData) /* EscapeEncodingData that specifies
|
||||
* encoding. */
|
||||
{
|
||||
EscapeEncodingData *dataPtr = clientData;
|
||||
EscapeEncodingData *dataPtr = (EscapeEncodingData *)clientData;
|
||||
EscapeSubTable *subTablePtr;
|
||||
int i;
|
||||
|
||||
@@ -3837,7 +3853,7 @@ InitializeEncodingSearchPath(
|
||||
bytes = TclGetString(searchPathObj);
|
||||
|
||||
*lengthPtr = searchPathObj->length;
|
||||
*valuePtr = ckalloc(*lengthPtr + 1);
|
||||
*valuePtr = (char *)ckalloc(*lengthPtr + 1);
|
||||
memcpy(*valuePtr, bytes, *lengthPtr + 1);
|
||||
Tcl_DecrRefCount(searchPathObj);
|
||||
}
|
||||
|
||||
+32
-29
@@ -96,7 +96,7 @@ static const Tcl_ObjType ensembleCmdType = {
|
||||
do { \
|
||||
const Tcl_ObjIntRep *irPtr; \
|
||||
irPtr = TclFetchIntRep((objPtr), &ensembleCmdType); \
|
||||
(ecRepPtr) = irPtr ? irPtr->twoPtrValue.ptr1 : NULL; \
|
||||
(ecRepPtr) = irPtr ? (EnsembleCmdRep *)irPtr->twoPtrValue.ptr1 : NULL; \
|
||||
} while (0)
|
||||
|
||||
/*
|
||||
@@ -151,7 +151,7 @@ NewNsObj(
|
||||
|
||||
int
|
||||
TclNamespaceEnsembleCmd(
|
||||
ClientData dummy,
|
||||
ClientData dummy, /* Not used. */
|
||||
Tcl_Interp *interp,
|
||||
int objc,
|
||||
Tcl_Obj *const objv[])
|
||||
@@ -164,6 +164,7 @@ TclNamespaceEnsembleCmd(
|
||||
Tcl_Obj *listObj;
|
||||
const char *simpleName;
|
||||
int index, done;
|
||||
(void)dummy;
|
||||
|
||||
if (nsPtr == NULL || nsPtr->flags & NS_DYING) {
|
||||
if (!Tcl_InterpDeleted(interp)) {
|
||||
@@ -675,7 +676,7 @@ TclCreateEnsembleInNs(
|
||||
EnsembleConfig *ensemblePtr;
|
||||
Tcl_Command token;
|
||||
|
||||
ensemblePtr = ckalloc(sizeof(EnsembleConfig));
|
||||
ensemblePtr = (EnsembleConfig *)ckalloc(sizeof(EnsembleConfig));
|
||||
token = TclNRCreateCommandInNs(interp, name,
|
||||
(Tcl_Namespace *) nameNsPtr, TclEnsembleImplementationCmd,
|
||||
NsEnsembleImplementationCmdNR, ensemblePtr, DeleteEnsembleConfig);
|
||||
@@ -798,7 +799,7 @@ Tcl_SetEnsembleSubcommandList(
|
||||
}
|
||||
}
|
||||
|
||||
ensemblePtr = cmdPtr->objClientData;
|
||||
ensemblePtr = (EnsembleConfig *)cmdPtr->objClientData;
|
||||
oldList = ensemblePtr->subcmdList;
|
||||
ensemblePtr->subcmdList = subcmdList;
|
||||
if (subcmdList != NULL) {
|
||||
@@ -874,7 +875,7 @@ Tcl_SetEnsembleParameterList(
|
||||
}
|
||||
}
|
||||
|
||||
ensemblePtr = cmdPtr->objClientData;
|
||||
ensemblePtr = (EnsembleConfig *)cmdPtr->objClientData;
|
||||
oldList = ensemblePtr->parameterList;
|
||||
ensemblePtr->parameterList = paramList;
|
||||
if (paramList != NULL) {
|
||||
@@ -974,7 +975,7 @@ Tcl_SetEnsembleMappingDict(
|
||||
}
|
||||
}
|
||||
|
||||
ensemblePtr = cmdPtr->objClientData;
|
||||
ensemblePtr = (EnsembleConfig *)cmdPtr->objClientData;
|
||||
oldDict = ensemblePtr->subcommandDict;
|
||||
ensemblePtr->subcommandDict = mapDict;
|
||||
if (mapDict != NULL) {
|
||||
@@ -1049,7 +1050,7 @@ Tcl_SetEnsembleUnknownHandler(
|
||||
}
|
||||
}
|
||||
|
||||
ensemblePtr = cmdPtr->objClientData;
|
||||
ensemblePtr = (EnsembleConfig *)cmdPtr->objClientData;
|
||||
oldList = ensemblePtr->unknownHandler;
|
||||
ensemblePtr->unknownHandler = unknownList;
|
||||
if (unknownList != NULL) {
|
||||
@@ -1105,7 +1106,7 @@ Tcl_SetEnsembleFlags(
|
||||
return TCL_ERROR;
|
||||
}
|
||||
|
||||
ensemblePtr = cmdPtr->objClientData;
|
||||
ensemblePtr = (EnsembleConfig *)cmdPtr->objClientData;
|
||||
wasCompiled = ensemblePtr->flags & ENSEMBLE_COMPILE;
|
||||
|
||||
/*
|
||||
@@ -1183,7 +1184,7 @@ Tcl_GetEnsembleSubcommandList(
|
||||
return TCL_ERROR;
|
||||
}
|
||||
|
||||
ensemblePtr = cmdPtr->objClientData;
|
||||
ensemblePtr = (EnsembleConfig *)cmdPtr->objClientData;
|
||||
*subcmdListPtr = ensemblePtr->subcmdList;
|
||||
return TCL_OK;
|
||||
}
|
||||
@@ -1225,7 +1226,7 @@ Tcl_GetEnsembleParameterList(
|
||||
return TCL_ERROR;
|
||||
}
|
||||
|
||||
ensemblePtr = cmdPtr->objClientData;
|
||||
ensemblePtr = (EnsembleConfig *)cmdPtr->objClientData;
|
||||
*paramListPtr = ensemblePtr->parameterList;
|
||||
return TCL_OK;
|
||||
}
|
||||
@@ -1267,7 +1268,7 @@ Tcl_GetEnsembleMappingDict(
|
||||
return TCL_ERROR;
|
||||
}
|
||||
|
||||
ensemblePtr = cmdPtr->objClientData;
|
||||
ensemblePtr = (EnsembleConfig *)cmdPtr->objClientData;
|
||||
*mapDictPtr = ensemblePtr->subcommandDict;
|
||||
return TCL_OK;
|
||||
}
|
||||
@@ -1308,7 +1309,7 @@ Tcl_GetEnsembleUnknownHandler(
|
||||
return TCL_ERROR;
|
||||
}
|
||||
|
||||
ensemblePtr = cmdPtr->objClientData;
|
||||
ensemblePtr = (EnsembleConfig *)cmdPtr->objClientData;
|
||||
*unknownListPtr = ensemblePtr->unknownHandler;
|
||||
return TCL_OK;
|
||||
}
|
||||
@@ -1349,7 +1350,7 @@ Tcl_GetEnsembleFlags(
|
||||
return TCL_ERROR;
|
||||
}
|
||||
|
||||
ensemblePtr = cmdPtr->objClientData;
|
||||
ensemblePtr = (EnsembleConfig *)cmdPtr->objClientData;
|
||||
*flagsPtr = ensemblePtr->flags;
|
||||
return TCL_OK;
|
||||
}
|
||||
@@ -1390,7 +1391,7 @@ Tcl_GetEnsembleNamespace(
|
||||
return TCL_ERROR;
|
||||
}
|
||||
|
||||
ensemblePtr = cmdPtr->objClientData;
|
||||
ensemblePtr = (EnsembleConfig *)cmdPtr->objClientData;
|
||||
*namespacePtrPtr = (Tcl_Namespace *) ensemblePtr->nsPtr;
|
||||
return TCL_OK;
|
||||
}
|
||||
@@ -1690,7 +1691,7 @@ NsEnsembleImplementationCmdNR(
|
||||
int objc,
|
||||
Tcl_Obj *const objv[])
|
||||
{
|
||||
EnsembleConfig *ensemblePtr = clientData;
|
||||
EnsembleConfig *ensemblePtr = (EnsembleConfig *)clientData;
|
||||
/* The ensemble itself. */
|
||||
Tcl_Obj *prefixObj; /* An object containing the prefix words of
|
||||
* the command that implements the
|
||||
@@ -1763,7 +1764,7 @@ NsEnsembleImplementationCmdNR(
|
||||
if (ensembleCmd) {
|
||||
if (ensembleCmd->epoch == ensemblePtr->epoch &&
|
||||
ensembleCmd->token == (Command *)ensemblePtr->token) {
|
||||
prefixObj = Tcl_GetHashValue(ensembleCmd->hPtr);
|
||||
prefixObj = (Tcl_Obj *)Tcl_GetHashValue(ensembleCmd->hPtr);
|
||||
Tcl_IncrRefCount(prefixObj);
|
||||
if (ensembleCmd->fix) {
|
||||
TclSpellFix(interp, objv, objc, subIdx, subObj, ensembleCmd->fix);
|
||||
@@ -1866,7 +1867,7 @@ NsEnsembleImplementationCmdNR(
|
||||
TclSpellFix(interp, objv, objc, subIdx, subObj, fix);
|
||||
}
|
||||
|
||||
prefixObj = Tcl_GetHashValue(hPtr);
|
||||
prefixObj = (Tcl_Obj *)Tcl_GetHashValue(hPtr);
|
||||
Tcl_IncrRefCount(prefixObj);
|
||||
runResultingSubcommand:
|
||||
|
||||
@@ -1987,10 +1988,11 @@ NsEnsembleImplementationCmdNR(
|
||||
|
||||
int
|
||||
TclClearRootEnsemble(
|
||||
ClientData data[],
|
||||
ClientData dummy[],
|
||||
Tcl_Interp *interp,
|
||||
int result)
|
||||
{
|
||||
(void)dummy;
|
||||
TclResetRewriteEnsemble(interp, 1);
|
||||
return result;
|
||||
}
|
||||
@@ -2094,11 +2096,12 @@ TclResetRewriteEnsemble(
|
||||
static int
|
||||
FreeER(
|
||||
ClientData data[],
|
||||
Tcl_Interp *interp,
|
||||
Tcl_Interp *dummy,
|
||||
int result)
|
||||
{
|
||||
Tcl_Obj **tmp = (Tcl_Obj **) data[0];
|
||||
Tcl_Obj **store = (Tcl_Obj **) data[1];
|
||||
(void)dummy;
|
||||
|
||||
ckfree(store);
|
||||
ckfree(tmp);
|
||||
@@ -2176,9 +2179,9 @@ TclSpellFix(
|
||||
if (search[0] == NULL) {
|
||||
store = (Tcl_Obj **) search[2];
|
||||
} else {
|
||||
Tcl_Obj **tmp = ckalloc(3 * sizeof(Tcl_Obj *));
|
||||
Tcl_Obj **tmp = (Tcl_Obj **)ckalloc(3 * sizeof(Tcl_Obj *));
|
||||
|
||||
store = ckalloc(size * sizeof(Tcl_Obj *));
|
||||
store = (Tcl_Obj **)ckalloc(size * sizeof(Tcl_Obj *));
|
||||
memcpy(store, iPtr->ensembleRewrite.sourceObjs,
|
||||
size * sizeof(Tcl_Obj *));
|
||||
|
||||
@@ -2418,7 +2421,7 @@ MakeCachedEnsembleCommand(
|
||||
* our own.
|
||||
*/
|
||||
|
||||
ensembleCmd = ckalloc(sizeof(EnsembleCmdRep));
|
||||
ensembleCmd = (EnsembleCmdRep *)ckalloc(sizeof(EnsembleCmdRep));
|
||||
ECRSetIntRep(objPtr, ensembleCmd);
|
||||
}
|
||||
|
||||
@@ -2467,7 +2470,7 @@ ClearTable(
|
||||
Tcl_HashEntry *hPtr = Tcl_FirstHashEntry(hash, &search);
|
||||
|
||||
while (hPtr != NULL) {
|
||||
Tcl_Obj *prefixObj = Tcl_GetHashValue(hPtr);
|
||||
Tcl_Obj *prefixObj = (Tcl_Obj *)Tcl_GetHashValue(hPtr);
|
||||
Tcl_DecrRefCount(prefixObj);
|
||||
hPtr = Tcl_NextHashEntry(&search);
|
||||
}
|
||||
@@ -2480,7 +2483,7 @@ static void
|
||||
DeleteEnsembleConfig(
|
||||
ClientData clientData)
|
||||
{
|
||||
EnsembleConfig *ensemblePtr = clientData;
|
||||
EnsembleConfig *ensemblePtr = (EnsembleConfig *)clientData;
|
||||
Namespace *nsPtr = ensemblePtr->nsPtr;
|
||||
|
||||
/*
|
||||
@@ -2691,7 +2694,7 @@ BuildEnsembleConfig(
|
||||
hPtr = Tcl_FirstHashEntry(&ensemblePtr->nsPtr->cmdTable, &search);
|
||||
for (; hPtr!= NULL ; hPtr=Tcl_NextHashEntry(&search)) {
|
||||
char *nsCmdName = /* Name of command in namespace. */
|
||||
Tcl_GetHashKey(&ensemblePtr->nsPtr->cmdTable, hPtr);
|
||||
(char *)Tcl_GetHashKey(&ensemblePtr->nsPtr->cmdTable, hPtr);
|
||||
|
||||
for (i=0 ; i<ensemblePtr->nsPtr->numExportPatterns ; i++) {
|
||||
if (Tcl_StringMatch(nsCmdName,
|
||||
@@ -2740,7 +2743,7 @@ BuildEnsembleConfig(
|
||||
*/
|
||||
|
||||
ensemblePtr->subcommandArrayPtr =
|
||||
ckalloc(sizeof(char *) * hash->numEntries);
|
||||
(char **)ckalloc(sizeof(char *) * hash->numEntries);
|
||||
|
||||
/*
|
||||
* Fill array from both ends as this makes us less likely to end up with
|
||||
@@ -2764,12 +2767,12 @@ BuildEnsembleConfig(
|
||||
j = hash->numEntries;
|
||||
hPtr = Tcl_FirstHashEntry(hash, &search);
|
||||
while (hPtr != NULL) {
|
||||
ensemblePtr->subcommandArrayPtr[i++] = Tcl_GetHashKey(hash, hPtr);
|
||||
ensemblePtr->subcommandArrayPtr[i++] = (char *)Tcl_GetHashKey(hash, hPtr);
|
||||
hPtr = Tcl_NextHashEntry(&search);
|
||||
if (hPtr == NULL) {
|
||||
break;
|
||||
}
|
||||
ensemblePtr->subcommandArrayPtr[--j] = Tcl_GetHashKey(hash, hPtr);
|
||||
ensemblePtr->subcommandArrayPtr[--j] = (char *)Tcl_GetHashKey(hash, hPtr);
|
||||
hPtr = Tcl_NextHashEntry(&search);
|
||||
}
|
||||
if (hash->numEntries > 1) {
|
||||
@@ -2861,7 +2864,7 @@ DupEnsembleCmdRep(
|
||||
Tcl_Obj *copyPtr)
|
||||
{
|
||||
EnsembleCmdRep *ensembleCmd;
|
||||
EnsembleCmdRep *ensembleCopy = ckalloc(sizeof(EnsembleCmdRep));
|
||||
EnsembleCmdRep *ensembleCopy = (EnsembleCmdRep *)ckalloc(sizeof(EnsembleCmdRep));
|
||||
|
||||
ECRGetIntRep(objPtr, ensembleCmd);
|
||||
ECRSetIntRep(copyPtr, ensembleCopy);
|
||||
|
||||
+12
-11
@@ -123,7 +123,7 @@ TclSetupEnv(
|
||||
char *p2;
|
||||
|
||||
p1 = Tcl_ExternalToUtfDString(NULL, environ[i], -1, &envString);
|
||||
p2 = strchr(p1, '=');
|
||||
p2 = (char *)strchr(p1, '=');
|
||||
if (p2 == NULL) {
|
||||
/*
|
||||
* This condition seem to happen occasionally under some
|
||||
@@ -172,7 +172,7 @@ TclSetupEnv(
|
||||
|
||||
for (hPtr=Tcl_FirstHashEntry(&namesHash, &search); hPtr!=NULL;
|
||||
hPtr=Tcl_NextHashEntry(&search)) {
|
||||
Tcl_Obj *elemName = Tcl_GetHashValue(hPtr);
|
||||
Tcl_Obj *elemName = (Tcl_Obj *)Tcl_GetHashValue(hPtr);
|
||||
|
||||
TclObjUnsetVar2(interp, varNamePtr, elemName, TCL_GLOBAL_ONLY);
|
||||
}
|
||||
@@ -239,7 +239,7 @@ TclSetEnv(
|
||||
*/
|
||||
|
||||
if ((env.ourEnviron != environ) || (length+2 > env.ourEnvironSize)) {
|
||||
char **newEnviron = ckalloc((length + 5) * sizeof(char *));
|
||||
char **newEnviron = (char **)ckalloc((length + 5) * sizeof(char *));
|
||||
|
||||
memcpy(newEnviron, environ, length * sizeof(char *));
|
||||
if ((env.ourEnvironSize != 0) && (env.ourEnviron != NULL)) {
|
||||
@@ -283,7 +283,7 @@ TclSetEnv(
|
||||
*/
|
||||
|
||||
valueLength = strlen(value);
|
||||
p = ckalloc(nameLength + valueLength + 2);
|
||||
p = (char *)ckalloc(nameLength + valueLength + 2);
|
||||
memcpy(p, name, nameLength);
|
||||
p[nameLength] = '=';
|
||||
memcpy(p+nameLength+1, value, valueLength+1);
|
||||
@@ -293,7 +293,7 @@ TclSetEnv(
|
||||
* Copy the native string to heap memory.
|
||||
*/
|
||||
|
||||
p = ckrealloc(p, Tcl_DStringLength(&envString) + 1);
|
||||
p = (char *)ckrealloc(p, Tcl_DStringLength(&envString) + 1);
|
||||
memcpy(p, p2, Tcl_DStringLength(&envString) + 1);
|
||||
Tcl_DStringFree(&envString);
|
||||
|
||||
@@ -379,7 +379,7 @@ Tcl_PutEnv(
|
||||
*/
|
||||
|
||||
name = Tcl_ExternalToUtfDString(NULL, assignment, -1, &nameString);
|
||||
value = strchr(name, '=');
|
||||
value = (char *)strchr(name, '=');
|
||||
|
||||
if ((value != NULL) && (value != name)) {
|
||||
value[0] = '\0';
|
||||
@@ -454,18 +454,18 @@ TclUnsetEnv(
|
||||
*/
|
||||
|
||||
#if defined(_WIN32)
|
||||
string = ckalloc(length + 2);
|
||||
string = (char *)ckalloc(length + 2);
|
||||
memcpy(string, name, length);
|
||||
string[length] = '=';
|
||||
string[length+1] = '\0';
|
||||
#else
|
||||
string = ckalloc(length + 1);
|
||||
string = (char *)ckalloc(length + 1);
|
||||
memcpy(string, name, length);
|
||||
string[length] = '\0';
|
||||
#endif /* _WIN32 */
|
||||
|
||||
Tcl_UtfToExternalDString(NULL, string, -1, &envString);
|
||||
string = ckrealloc(string, Tcl_DStringLength(&envString) + 1);
|
||||
string = (char *)ckrealloc(string, Tcl_DStringLength(&envString) + 1);
|
||||
memcpy(string, Tcl_DStringValue(&envString),
|
||||
Tcl_DStringLength(&envString)+1);
|
||||
Tcl_DStringFree(&envString);
|
||||
@@ -579,7 +579,7 @@ TclGetEnv(
|
||||
/* ARGSUSED */
|
||||
static char *
|
||||
EnvTraceProc(
|
||||
ClientData clientData, /* Not used. */
|
||||
ClientData dummy, /* Not used. */
|
||||
Tcl_Interp *interp, /* Interpreter whose "env" variable is being
|
||||
* modified. */
|
||||
const char *name1, /* Better be "env". */
|
||||
@@ -587,6 +587,7 @@ EnvTraceProc(
|
||||
* whole array is being deleted (UTF-8). */
|
||||
int flags) /* Indicates what's happening. */
|
||||
{
|
||||
(void)dummy;
|
||||
/*
|
||||
* For array traces, let TclSetupEnv do all the work.
|
||||
*/
|
||||
@@ -701,7 +702,7 @@ ReplaceString(
|
||||
|
||||
const int growth = 5;
|
||||
|
||||
env.cache = ckrealloc(env.cache,
|
||||
env.cache = (char **)ckrealloc(env.cache,
|
||||
(env.cacheSize + growth) * sizeof(char *));
|
||||
env.cache[env.cacheSize] = newStr;
|
||||
(void) memset(env.cache+env.cacheSize+1, 0,
|
||||
|
||||
+48
-43
@@ -55,7 +55,7 @@ typedef struct {
|
||||
|
||||
typedef struct ExitHandler {
|
||||
Tcl_ExitProc *proc; /* Function to call when process exits. */
|
||||
ClientData clientData; /* One word of information to pass to proc. */
|
||||
void *clientData; /* One word of information to pass to proc. */
|
||||
struct ExitHandler *nextPtr;/* Next in list of all exit handlers for this
|
||||
* application, or NULL for end of list. */
|
||||
} ExitHandler;
|
||||
@@ -103,19 +103,19 @@ static Tcl_ThreadDataKey dataKey;
|
||||
#if TCL_THREADS
|
||||
typedef struct {
|
||||
Tcl_ThreadCreateProc *proc; /* Main() function of the thread */
|
||||
ClientData clientData; /* The one argument to Main() */
|
||||
void *clientData; /* The one argument to Main() */
|
||||
} ThreadClientData;
|
||||
static Tcl_ThreadCreateType NewThreadProc(ClientData clientData);
|
||||
static Tcl_ThreadCreateType NewThreadProc(void *clientData);
|
||||
#endif /* TCL_THREADS */
|
||||
|
||||
/*
|
||||
* Prototypes for functions referenced only in this file:
|
||||
*/
|
||||
|
||||
static void BgErrorDeleteProc(ClientData clientData,
|
||||
static void BgErrorDeleteProc(void *clientData,
|
||||
Tcl_Interp *interp);
|
||||
static void HandleBgErrors(ClientData clientData);
|
||||
static char * VwaitVarProc(ClientData clientData,
|
||||
static void HandleBgErrors(void *clientData);
|
||||
static char * VwaitVarProc(void *clientData,
|
||||
Tcl_Interp *interp, const char *name1,
|
||||
const char *name2, int flags);
|
||||
static void InvokeExitHandlers(void);
|
||||
@@ -163,7 +163,7 @@ Tcl_BackgroundException(
|
||||
return;
|
||||
}
|
||||
|
||||
errPtr = ckalloc(sizeof(BgError));
|
||||
errPtr = (BgError*)ckalloc(sizeof(BgError));
|
||||
errPtr->errorMsg = Tcl_GetObjResult(interp);
|
||||
Tcl_IncrRefCount(errPtr->errorMsg);
|
||||
errPtr->returnOpts = Tcl_GetReturnOptions(interp, code);
|
||||
@@ -171,7 +171,7 @@ Tcl_BackgroundException(
|
||||
errPtr->nextPtr = NULL;
|
||||
|
||||
(void) TclGetBgErrorHandler(interp);
|
||||
assocPtr = Tcl_GetAssocData(interp, "tclBgError", NULL);
|
||||
assocPtr = (ErrAssocData *)Tcl_GetAssocData(interp, "tclBgError", NULL);
|
||||
if (assocPtr->firstBgPtr == NULL) {
|
||||
assocPtr->firstBgPtr = errPtr;
|
||||
Tcl_DoWhenIdle(HandleBgErrors, assocPtr);
|
||||
@@ -201,9 +201,9 @@ Tcl_BackgroundException(
|
||||
|
||||
static void
|
||||
HandleBgErrors(
|
||||
ClientData clientData) /* Pointer to ErrAssocData structure. */
|
||||
void *clientData) /* Pointer to ErrAssocData structure. */
|
||||
{
|
||||
ErrAssocData *assocPtr = clientData;
|
||||
ErrAssocData *assocPtr = (ErrAssocData *)clientData;
|
||||
Tcl_Interp *interp = assocPtr->interp;
|
||||
BgError *errPtr;
|
||||
|
||||
@@ -230,7 +230,7 @@ HandleBgErrors(
|
||||
errPtr = assocPtr->firstBgPtr;
|
||||
|
||||
Tcl_ListObjGetElements(NULL, copyObj, &prefixObjc, &prefixObjv);
|
||||
tempObjv = ckalloc((prefixObjc+2) * sizeof(Tcl_Obj *));
|
||||
tempObjv = (Tcl_Obj**)ckalloc((prefixObjc+2) * sizeof(Tcl_Obj *));
|
||||
memcpy(tempObjv, prefixObjv, prefixObjc*sizeof(Tcl_Obj *));
|
||||
tempObjv[prefixObjc] = errPtr->errorMsg;
|
||||
tempObjv[prefixObjc+1] = errPtr->returnOpts;
|
||||
@@ -311,7 +311,7 @@ HandleBgErrors(
|
||||
|
||||
int
|
||||
TclDefaultBgErrorHandlerObjCmd(
|
||||
ClientData dummy, /* Not used. */
|
||||
void *dummy, /* Not used. */
|
||||
Tcl_Interp *interp, /* Current interpreter. */
|
||||
int objc, /* Number of arguments. */
|
||||
Tcl_Obj *const objv[]) /* Argument objects. */
|
||||
@@ -320,6 +320,7 @@ TclDefaultBgErrorHandlerObjCmd(
|
||||
Tcl_Obj *tempObjv[2];
|
||||
int result, code, level;
|
||||
Tcl_InterpState saved;
|
||||
(void)dummy;
|
||||
|
||||
if (objc != 3) {
|
||||
Tcl_WrongNumArgs(interp, 1, objv, "msg options");
|
||||
@@ -518,7 +519,7 @@ TclSetBgErrorHandler(
|
||||
Tcl_Interp *interp,
|
||||
Tcl_Obj *cmdPrefix)
|
||||
{
|
||||
ErrAssocData *assocPtr = Tcl_GetAssocData(interp, "tclBgError", NULL);
|
||||
ErrAssocData *assocPtr = (ErrAssocData *)Tcl_GetAssocData(interp, "tclBgError", NULL);
|
||||
|
||||
if (cmdPrefix == NULL) {
|
||||
Tcl_Panic("TclSetBgErrorHandler: NULL cmdPrefix argument");
|
||||
@@ -528,7 +529,7 @@ TclSetBgErrorHandler(
|
||||
* First access: initialize.
|
||||
*/
|
||||
|
||||
assocPtr = ckalloc(sizeof(ErrAssocData));
|
||||
assocPtr = (ErrAssocData*)ckalloc(sizeof(ErrAssocData));
|
||||
assocPtr->interp = interp;
|
||||
assocPtr->cmdPrefix = NULL;
|
||||
assocPtr->firstBgPtr = NULL;
|
||||
@@ -563,14 +564,14 @@ Tcl_Obj *
|
||||
TclGetBgErrorHandler(
|
||||
Tcl_Interp *interp)
|
||||
{
|
||||
ErrAssocData *assocPtr = Tcl_GetAssocData(interp, "tclBgError", NULL);
|
||||
ErrAssocData *assocPtr = (ErrAssocData *)Tcl_GetAssocData(interp, "tclBgError", NULL);
|
||||
|
||||
if (assocPtr == NULL) {
|
||||
Tcl_Obj *bgerrorObj;
|
||||
|
||||
TclNewLiteralStringObj(bgerrorObj, "::tcl::Bgerror");
|
||||
TclSetBgErrorHandler(interp, bgerrorObj);
|
||||
assocPtr = Tcl_GetAssocData(interp, "tclBgError", NULL);
|
||||
assocPtr = (ErrAssocData *)Tcl_GetAssocData(interp, "tclBgError", NULL);
|
||||
}
|
||||
return assocPtr->cmdPrefix;
|
||||
}
|
||||
@@ -596,11 +597,12 @@ TclGetBgErrorHandler(
|
||||
|
||||
static void
|
||||
BgErrorDeleteProc(
|
||||
ClientData clientData, /* Pointer to ErrAssocData structure. */
|
||||
Tcl_Interp *interp) /* Interpreter being deleted. */
|
||||
void *clientData, /* Pointer to ErrAssocData structure. */
|
||||
Tcl_Interp *dummy) /* Interpreter being deleted. */
|
||||
{
|
||||
ErrAssocData *assocPtr = clientData;
|
||||
ErrAssocData *assocPtr = (ErrAssocData *)clientData;
|
||||
BgError *errPtr;
|
||||
(void)dummy;
|
||||
|
||||
while (assocPtr->firstBgPtr != NULL) {
|
||||
errPtr = assocPtr->firstBgPtr;
|
||||
@@ -635,9 +637,9 @@ BgErrorDeleteProc(
|
||||
void
|
||||
Tcl_CreateExitHandler(
|
||||
Tcl_ExitProc *proc, /* Function to invoke. */
|
||||
ClientData clientData) /* Arbitrary value to pass to proc. */
|
||||
void *clientData) /* Arbitrary value to pass to proc. */
|
||||
{
|
||||
ExitHandler *exitPtr = ckalloc(sizeof(ExitHandler));
|
||||
ExitHandler *exitPtr = (ExitHandler*)ckalloc(sizeof(ExitHandler));
|
||||
|
||||
exitPtr->proc = proc;
|
||||
exitPtr->clientData = clientData;
|
||||
@@ -668,9 +670,9 @@ Tcl_CreateExitHandler(
|
||||
void
|
||||
TclCreateLateExitHandler(
|
||||
Tcl_ExitProc *proc, /* Function to invoke. */
|
||||
ClientData clientData) /* Arbitrary value to pass to proc. */
|
||||
void *clientData) /* Arbitrary value to pass to proc. */
|
||||
{
|
||||
ExitHandler *exitPtr = ckalloc(sizeof(ExitHandler));
|
||||
ExitHandler *exitPtr = (ExitHandler*)ckalloc(sizeof(ExitHandler));
|
||||
|
||||
exitPtr->proc = proc;
|
||||
exitPtr->clientData = clientData;
|
||||
@@ -701,7 +703,7 @@ TclCreateLateExitHandler(
|
||||
void
|
||||
Tcl_DeleteExitHandler(
|
||||
Tcl_ExitProc *proc, /* Function that was previously registered. */
|
||||
ClientData clientData) /* Arbitrary value to pass to proc. */
|
||||
void *clientData) /* Arbitrary value to pass to proc. */
|
||||
{
|
||||
ExitHandler *exitPtr, *prevPtr;
|
||||
|
||||
@@ -744,7 +746,7 @@ Tcl_DeleteExitHandler(
|
||||
void
|
||||
TclDeleteLateExitHandler(
|
||||
Tcl_ExitProc *proc, /* Function that was previously registered. */
|
||||
ClientData clientData) /* Arbitrary value to pass to proc. */
|
||||
void *clientData) /* Arbitrary value to pass to proc. */
|
||||
{
|
||||
ExitHandler *exitPtr, *prevPtr;
|
||||
|
||||
@@ -787,12 +789,12 @@ TclDeleteLateExitHandler(
|
||||
void
|
||||
Tcl_CreateThreadExitHandler(
|
||||
Tcl_ExitProc *proc, /* Function to invoke. */
|
||||
ClientData clientData) /* Arbitrary value to pass to proc. */
|
||||
void *clientData) /* Arbitrary value to pass to proc. */
|
||||
{
|
||||
ExitHandler *exitPtr;
|
||||
ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey);
|
||||
|
||||
exitPtr = ckalloc(sizeof(ExitHandler));
|
||||
exitPtr = (ExitHandler*)ckalloc(sizeof(ExitHandler));
|
||||
exitPtr->proc = proc;
|
||||
exitPtr->clientData = clientData;
|
||||
exitPtr->nextPtr = tsdPtr->firstExitPtr;
|
||||
@@ -820,7 +822,7 @@ Tcl_CreateThreadExitHandler(
|
||||
void
|
||||
Tcl_DeleteThreadExitHandler(
|
||||
Tcl_ExitProc *proc, /* Function that was previously registered. */
|
||||
ClientData clientData) /* Arbitrary value to pass to proc. */
|
||||
void *clientData) /* Arbitrary value to pass to proc. */
|
||||
{
|
||||
ExitHandler *exitPtr, *prevPtr;
|
||||
ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey);
|
||||
@@ -1002,7 +1004,7 @@ Tcl_Exit(
|
||||
/*
|
||||
*-------------------------------------------------------------------------
|
||||
*
|
||||
* TclInitSubsystems --
|
||||
* Tcl_InitSubsystems --
|
||||
*
|
||||
* Initialize various subsytems in Tcl. This should be called the first
|
||||
* time an interp is created, or before any of the subsystems are used.
|
||||
@@ -1025,10 +1027,10 @@ Tcl_Exit(
|
||||
*/
|
||||
|
||||
void
|
||||
TclInitSubsystems(void)
|
||||
Tcl_InitSubsystems(void)
|
||||
{
|
||||
if (inExit != 0) {
|
||||
Tcl_Panic("TclInitSubsystems called while exiting");
|
||||
Tcl_Panic("Tcl_InitSubsystems called while exiting");
|
||||
}
|
||||
|
||||
if (subsystemsInitialized == 0) {
|
||||
@@ -1296,7 +1298,7 @@ FinalizeThread(
|
||||
* initialized already.
|
||||
*/
|
||||
|
||||
tsdPtr = TclThreadDataKeyGet(&dataKey);
|
||||
tsdPtr = (ThreadSpecificData*)TclThreadDataKeyGet(&dataKey);
|
||||
if (tsdPtr != NULL) {
|
||||
tsdPtr->inExit = 1;
|
||||
|
||||
@@ -1371,7 +1373,7 @@ TclInExit(void)
|
||||
int
|
||||
TclInThreadExit(void)
|
||||
{
|
||||
ThreadSpecificData *tsdPtr = TclThreadDataKeyGet(&dataKey);
|
||||
ThreadSpecificData *tsdPtr = (ThreadSpecificData *)TclThreadDataKeyGet(&dataKey);
|
||||
|
||||
if (tsdPtr == NULL) {
|
||||
return 0;
|
||||
@@ -1399,13 +1401,14 @@ TclInThreadExit(void)
|
||||
/* ARGSUSED */
|
||||
int
|
||||
Tcl_VwaitObjCmd(
|
||||
ClientData clientData, /* Not used. */
|
||||
void *dummy, /* Not used. */
|
||||
Tcl_Interp *interp, /* Current interpreter. */
|
||||
int objc, /* Number of arguments. */
|
||||
Tcl_Obj *const objv[]) /* Argument objects. */
|
||||
{
|
||||
int done, foundEvent;
|
||||
const char *nameString;
|
||||
(void)dummy;
|
||||
|
||||
if (objc != 2) {
|
||||
Tcl_WrongNumArgs(interp, 1, objv, "name");
|
||||
@@ -1463,16 +1466,17 @@ Tcl_VwaitObjCmd(
|
||||
/* ARGSUSED */
|
||||
static char *
|
||||
VwaitVarProc(
|
||||
ClientData clientData, /* Pointer to integer to set to 1. */
|
||||
void *clientData, /* Pointer to integer to set to 1. */
|
||||
Tcl_Interp *interp, /* Interpreter containing variable. */
|
||||
const char *name1, /* Name of variable. */
|
||||
const char *name2, /* Second part of variable name. */
|
||||
int flags) /* Information about what happened. */
|
||||
{
|
||||
int *donePtr = clientData;
|
||||
int *donePtr = (int *)clientData;
|
||||
(void)flags;
|
||||
|
||||
*donePtr = 1;
|
||||
Tcl_UntraceVar(interp, name1, TCL_TRACE_WRITES|TCL_TRACE_UNSETS,
|
||||
Tcl_UntraceVar2(interp, name1, name2, TCL_TRACE_WRITES|TCL_TRACE_UNSETS,
|
||||
VwaitVarProc, clientData);
|
||||
return NULL;
|
||||
}
|
||||
@@ -1497,7 +1501,7 @@ VwaitVarProc(
|
||||
/* ARGSUSED */
|
||||
int
|
||||
Tcl_UpdateObjCmd(
|
||||
ClientData clientData, /* Not used. */
|
||||
void *dummy, /* Not used. */
|
||||
Tcl_Interp *interp, /* Current interpreter. */
|
||||
int objc, /* Number of arguments. */
|
||||
Tcl_Obj *const objv[]) /* Argument objects. */
|
||||
@@ -1506,6 +1510,7 @@ Tcl_UpdateObjCmd(
|
||||
int flags = 0; /* Initialized to avoid compiler warning. */
|
||||
static const char *const updateOptions[] = {"idletasks", NULL};
|
||||
enum updateOptions {OPT_IDLETASKS};
|
||||
(void)dummy;
|
||||
|
||||
if (objc == 1) {
|
||||
flags = TCL_ALL_EVENTS|TCL_DONT_WAIT;
|
||||
@@ -1565,10 +1570,10 @@ Tcl_UpdateObjCmd(
|
||||
|
||||
static Tcl_ThreadCreateType
|
||||
NewThreadProc(
|
||||
ClientData clientData)
|
||||
void *clientData)
|
||||
{
|
||||
ThreadClientData *cdPtr = clientData;
|
||||
ClientData threadClientData;
|
||||
ThreadClientData *cdPtr = (ThreadClientData *)clientData;
|
||||
void *threadClientData;
|
||||
Tcl_ThreadCreateProc *threadProc;
|
||||
|
||||
threadProc = cdPtr->proc;
|
||||
@@ -1604,13 +1609,13 @@ int
|
||||
Tcl_CreateThread(
|
||||
Tcl_ThreadId *idPtr, /* Return, the ID of the thread */
|
||||
Tcl_ThreadCreateProc *proc, /* Main() function of the thread */
|
||||
ClientData clientData, /* The one argument to Main() */
|
||||
void *clientData, /* The one argument to Main() */
|
||||
int stackSize, /* Size of stack for the new thread */
|
||||
int flags) /* Flags controlling behaviour of the new
|
||||
* thread. */
|
||||
{
|
||||
#if TCL_THREADS
|
||||
ThreadClientData *cdPtr = ckalloc(sizeof(ThreadClientData));
|
||||
ThreadClientData *cdPtr = (ThreadClientData *)ckalloc(sizeof(ThreadClientData));
|
||||
int result;
|
||||
|
||||
cdPtr->proc = proc;
|
||||
|
||||
+221
-108
@@ -18,7 +18,7 @@
|
||||
#include "tclInt.h"
|
||||
#include "tclCompile.h"
|
||||
#include "tclOOInt.h"
|
||||
#include "tommath.h"
|
||||
#include "tclTomMath.h"
|
||||
#include <math.h>
|
||||
#include <assert.h>
|
||||
|
||||
@@ -202,7 +202,7 @@ typedef struct TEBCdata {
|
||||
#define POP_TAUX_OBJ() \
|
||||
do { \
|
||||
tmpPtr = auxObjList; \
|
||||
auxObjList = tmpPtr->internalRep.twoPtrValue.ptr1; \
|
||||
auxObjList = (Tcl_Obj *)tmpPtr->internalRep.twoPtrValue.ptr1; \
|
||||
Tcl_DecrRefCount(tmpPtr); \
|
||||
} while (0)
|
||||
|
||||
@@ -317,12 +317,16 @@ VarHashCreateVar(
|
||||
switch (*pc) { \
|
||||
case INST_JUMP_FALSE1: \
|
||||
NEXT_INST_F(((condition)? 2 : TclGetInt1AtPtr(pc+1)), (cleanup), 0); \
|
||||
break; \
|
||||
case INST_JUMP_TRUE1: \
|
||||
NEXT_INST_F(((condition)? TclGetInt1AtPtr(pc+1) : 2), (cleanup), 0); \
|
||||
break; \
|
||||
case INST_JUMP_FALSE4: \
|
||||
NEXT_INST_F(((condition)? 5 : TclGetInt4AtPtr(pc+1)), (cleanup), 0); \
|
||||
break; \
|
||||
case INST_JUMP_TRUE4: \
|
||||
NEXT_INST_F(((condition)? TclGetInt4AtPtr(pc+1) : 5), (cleanup), 0); \
|
||||
break; \
|
||||
default: \
|
||||
if ((condition) < 0) { \
|
||||
TclNewIntObj(objResultPtr, -1); \
|
||||
@@ -330,6 +334,7 @@ VarHashCreateVar(
|
||||
objResultPtr = TCONST((condition) > 0); \
|
||||
} \
|
||||
NEXT_INST_F(0, (cleanup), 1); \
|
||||
break; \
|
||||
} \
|
||||
} while (0)
|
||||
#define JUMP_PEEPHOLE_V(condition, pcAdjustment, cleanup) \
|
||||
@@ -338,12 +343,16 @@ VarHashCreateVar(
|
||||
switch (*pc) { \
|
||||
case INST_JUMP_FALSE1: \
|
||||
NEXT_INST_V(((condition)? 2 : TclGetInt1AtPtr(pc+1)), (cleanup), 0); \
|
||||
break; \
|
||||
case INST_JUMP_TRUE1: \
|
||||
NEXT_INST_V(((condition)? TclGetInt1AtPtr(pc+1) : 2), (cleanup), 0); \
|
||||
break; \
|
||||
case INST_JUMP_FALSE4: \
|
||||
NEXT_INST_V(((condition)? 5 : TclGetInt4AtPtr(pc+1)), (cleanup), 0); \
|
||||
break; \
|
||||
case INST_JUMP_TRUE4: \
|
||||
NEXT_INST_V(((condition)? TclGetInt4AtPtr(pc+1) : 5), (cleanup), 0); \
|
||||
break; \
|
||||
default: \
|
||||
if ((condition) < 0) { \
|
||||
TclNewIntObj(objResultPtr, -1); \
|
||||
@@ -351,6 +360,7 @@ VarHashCreateVar(
|
||||
objResultPtr = TCONST((condition) > 0); \
|
||||
} \
|
||||
NEXT_INST_V(0, (cleanup), 1); \
|
||||
break; \
|
||||
} \
|
||||
} while (0)
|
||||
#else /* TCL_COMPILE_DEBUG */
|
||||
@@ -652,6 +662,7 @@ static const size_t Exp64ValueSize = sizeof(Exp64Value) / sizeof(Tcl_WideInt);
|
||||
#define DIVIDED_BY_ZERO ((Tcl_Obj *) -1)
|
||||
#define EXPONENT_OF_ZERO ((Tcl_Obj *) -2)
|
||||
#define GENERAL_ARITHMETIC_ERROR ((Tcl_Obj *) -3)
|
||||
#define OUT_OF_MEMORY ((Tcl_Obj *) -4)
|
||||
|
||||
/*
|
||||
* Declarations for local procedures to this file:
|
||||
@@ -758,11 +769,11 @@ ReleaseDictIterator(
|
||||
* that we were holding.
|
||||
*/
|
||||
|
||||
searchPtr = irPtr->twoPtrValue.ptr1;
|
||||
searchPtr = (Tcl_DictSearch *)irPtr->twoPtrValue.ptr1;
|
||||
Tcl_DictObjDone(searchPtr);
|
||||
ckfree(searchPtr);
|
||||
|
||||
dictPtr = irPtr->twoPtrValue.ptr2;
|
||||
dictPtr = (Tcl_Obj *)irPtr->twoPtrValue.ptr2;
|
||||
TclDecrRefCount(dictPtr);
|
||||
}
|
||||
|
||||
@@ -794,12 +805,14 @@ InitByteCodeExecution(
|
||||
* instruction tracing. */
|
||||
{
|
||||
#ifdef TCL_COMPILE_DEBUG
|
||||
if (Tcl_LinkVar(interp, "tcl_traceExec", (char *) &tclTraceExec,
|
||||
if (Tcl_LinkVar(interp, "tcl_traceExec", &tclTraceExec,
|
||||
TCL_LINK_INT) != TCL_OK) {
|
||||
Tcl_Panic("InitByteCodeExecution: can't create link for tcl_traceExec variable");
|
||||
}
|
||||
#endif
|
||||
#ifdef TCL_COMPILE_STATS
|
||||
#ifndef TCL_COMPILE_STATS
|
||||
(void)interp;
|
||||
#else
|
||||
Tcl_CreateObjCommand(interp, "evalstats", EvalStatsCmd, NULL, NULL);
|
||||
#endif /* TCL_COMPILE_STATS */
|
||||
}
|
||||
@@ -833,8 +846,8 @@ TclCreateExecEnv(
|
||||
int size) /* The initial stack size, in number of words
|
||||
* [sizeof(Tcl_Obj*)] */
|
||||
{
|
||||
ExecEnv *eePtr = ckalloc(sizeof(ExecEnv));
|
||||
ExecStack *esPtr = ckalloc(sizeof(ExecStack)
|
||||
ExecEnv *eePtr = (ExecEnv *)ckalloc(sizeof(ExecEnv));
|
||||
ExecStack *esPtr = (ExecStack *)ckalloc(sizeof(ExecStack)
|
||||
+ (size_t) (size-1) * sizeof(Tcl_Obj *));
|
||||
|
||||
eePtr->execStackPtr = esPtr;
|
||||
@@ -1103,7 +1116,7 @@ GrowEvaluationStack(
|
||||
newBytes = sizeof(ExecStack) + (newElems-1) * sizeof(Tcl_Obj *);
|
||||
|
||||
oldPtr = esPtr;
|
||||
esPtr = ckalloc(newBytes);
|
||||
esPtr = (ExecStack *)ckalloc(newBytes);
|
||||
|
||||
oldPtr->nextPtr = esPtr;
|
||||
esPtr->prevPtr = oldPtr;
|
||||
@@ -1345,11 +1358,13 @@ Tcl_ExprObj(
|
||||
static int
|
||||
CopyCallback(
|
||||
ClientData data[],
|
||||
Tcl_Interp *interp,
|
||||
Tcl_Interp *dummy,
|
||||
int result)
|
||||
{
|
||||
Tcl_Obj **resultPtrPtr = data[0];
|
||||
Tcl_Obj *resultPtr = data[1];
|
||||
Tcl_Obj **resultPtrPtr = (Tcl_Obj **)data[0];
|
||||
Tcl_Obj *resultPtr = (Tcl_Obj *)data[1];
|
||||
(void)dummy;
|
||||
(void)dummy;
|
||||
|
||||
if (result == TCL_OK) {
|
||||
*resultPtrPtr = resultPtr;
|
||||
@@ -1406,8 +1421,8 @@ ExprObjCallback(
|
||||
Tcl_Interp *interp,
|
||||
int result)
|
||||
{
|
||||
Tcl_InterpState state = data[0];
|
||||
Tcl_Obj *resultPtr = data[1];
|
||||
Tcl_InterpState state = (Tcl_InterpState)data[0];
|
||||
Tcl_Obj *resultPtr = (Tcl_Obj *)data[1];
|
||||
|
||||
if (result == TCL_OK) {
|
||||
TclSetDuplicateObj(resultPtr, Tcl_GetObjResult(interp));
|
||||
@@ -1543,6 +1558,8 @@ DupExprCodeInternalRep(
|
||||
Tcl_Obj *srcPtr,
|
||||
Tcl_Obj *copyPtr)
|
||||
{
|
||||
(void)srcPtr;
|
||||
(void)copyPtr;
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1693,9 +1710,9 @@ TclCompileObj(
|
||||
return codePtr;
|
||||
}
|
||||
|
||||
eclPtr = Tcl_GetHashValue(hePtr);
|
||||
eclPtr = (ExtCmdLoc *)Tcl_GetHashValue(hePtr);
|
||||
redo = 0;
|
||||
ctxCopyPtr = TclStackAlloc(interp, sizeof(CmdFrame));
|
||||
ctxCopyPtr = (CmdFrame *)TclStackAlloc(interp, sizeof(CmdFrame));
|
||||
*ctxCopyPtr = *invoker;
|
||||
|
||||
if (invoker->type == TCL_LOCATION_BC) {
|
||||
@@ -1791,6 +1808,7 @@ TclIncrObj(
|
||||
ClientData ptr1, ptr2;
|
||||
int type1, type2;
|
||||
mp_int value, incr;
|
||||
mp_err err;
|
||||
|
||||
if (Tcl_IsShared(valuePtr)) {
|
||||
Tcl_Panic("%s called with shared object", "TclIncrObj");
|
||||
@@ -1849,8 +1867,11 @@ TclIncrObj(
|
||||
|
||||
Tcl_TakeBignumFromObj(interp, valuePtr, &value);
|
||||
Tcl_GetBignumFromObj(interp, incrPtr, &incr);
|
||||
mp_add(&value, &incr, &value);
|
||||
err = mp_add(&value, &incr, &value);
|
||||
mp_clear(&incr);
|
||||
if (err != MP_OKAY) {
|
||||
return TCL_ERROR;
|
||||
}
|
||||
Tcl_SetBignumObj(valuePtr, &value);
|
||||
return TCL_OK;
|
||||
}
|
||||
@@ -2046,7 +2067,7 @@ TEBCresume(
|
||||
* used too frequently
|
||||
*/
|
||||
|
||||
TEBCdata *TD = data[0];
|
||||
TEBCdata *TD = (TEBCdata *)data[0];
|
||||
#define auxObjList (TD->auxObjList)
|
||||
#define catchTop (TD->catchTop)
|
||||
#define codePtr (TD->codePtr)
|
||||
@@ -2058,7 +2079,7 @@ TEBCresume(
|
||||
|
||||
Tcl_Obj **tosPtr; /* Cached pointer to top of evaluation
|
||||
* stack. */
|
||||
const unsigned char *pc = data[1];
|
||||
const unsigned char *pc = (const unsigned char *)data[1];
|
||||
/* The current program counter. */
|
||||
unsigned char inst; /* The currently running instruction */
|
||||
|
||||
@@ -2079,7 +2100,7 @@ TEBCresume(
|
||||
*/
|
||||
|
||||
Tcl_Obj *objPtr, *valuePtr, *value2Ptr, *part1Ptr, *part2Ptr, *tmpPtr;
|
||||
Tcl_Obj **objv;
|
||||
Tcl_Obj **objv = NULL;
|
||||
int objc = 0;
|
||||
int opnd, length, pcAdjustment;
|
||||
Var *varPtr, *arrayPtr;
|
||||
@@ -2571,23 +2592,27 @@ TEBCresume(
|
||||
objResultPtr = codePtr->objArrayPtr[TclGetUInt4AtPtr(pc+1)];
|
||||
TRACE_WITH_OBJ(("%u => ", TclGetUInt4AtPtr(pc+1)), objResultPtr);
|
||||
NEXT_INST_F(5, 0, 1);
|
||||
break;
|
||||
|
||||
case INST_POP:
|
||||
TRACE_WITH_OBJ(("=> discarding "), OBJ_AT_TOS);
|
||||
objPtr = POP_OBJECT();
|
||||
TclDecrRefCount(objPtr);
|
||||
NEXT_INST_F(1, 0, 0);
|
||||
break;
|
||||
|
||||
case INST_DUP:
|
||||
objResultPtr = OBJ_AT_TOS;
|
||||
TRACE_WITH_OBJ(("=> "), objResultPtr);
|
||||
NEXT_INST_F(1, 0, 1);
|
||||
break;
|
||||
|
||||
case INST_OVER:
|
||||
opnd = TclGetUInt4AtPtr(pc+1);
|
||||
objResultPtr = OBJ_AT_DEPTH(opnd);
|
||||
TRACE_WITH_OBJ(("%u => ", opnd), objResultPtr);
|
||||
NEXT_INST_F(5, 0, 1);
|
||||
break;
|
||||
|
||||
case INST_REVERSE: {
|
||||
Tcl_Obj **a, **b;
|
||||
@@ -2604,6 +2629,7 @@ TEBCresume(
|
||||
TRACE(("%u => OK\n", opnd));
|
||||
NEXT_INST_F(5, 0, 0);
|
||||
}
|
||||
break;
|
||||
|
||||
case INST_STR_CONCAT1:
|
||||
|
||||
@@ -2617,6 +2643,7 @@ TEBCresume(
|
||||
|
||||
TRACE_WITH_OBJ(("%u => ", opnd), objResultPtr);
|
||||
NEXT_INST_V(2, opnd, 1);
|
||||
break;
|
||||
|
||||
case INST_CONCAT_STK:
|
||||
/*
|
||||
@@ -2628,6 +2655,7 @@ TEBCresume(
|
||||
objResultPtr = Tcl_ConcatObj(opnd, &OBJ_AT_DEPTH(opnd-1));
|
||||
TRACE_WITH_OBJ(("%u => ", opnd), objResultPtr);
|
||||
NEXT_INST_V(5, opnd, 1);
|
||||
break;
|
||||
|
||||
case INST_EXPAND_START:
|
||||
/*
|
||||
@@ -2649,6 +2677,7 @@ TEBCresume(
|
||||
PUSH_TAUX_OBJ(objPtr);
|
||||
TRACE(("=> mark depth as %d\n", (int) CURR_DEPTH));
|
||||
NEXT_INST_F(1, 0, 0);
|
||||
break;
|
||||
|
||||
case INST_EXPAND_DROP:
|
||||
/*
|
||||
@@ -2727,6 +2756,7 @@ TEBCresume(
|
||||
Tcl_DecrRefCount(objPtr);
|
||||
NEXT_INST_F(5, 0, 0);
|
||||
}
|
||||
break;
|
||||
|
||||
case INST_EXPR_STK: {
|
||||
ByteCode *newCodePtr;
|
||||
@@ -2774,6 +2804,7 @@ TEBCresume(
|
||||
|
||||
TclNewObj(objResultPtr);
|
||||
NEXT_INST_F(1, 0, 1);
|
||||
break;
|
||||
|
||||
case INST_INVOKE_STK4:
|
||||
objc = TclGetUInt4AtPtr(pc+1);
|
||||
@@ -4025,6 +4056,7 @@ TEBCresume(
|
||||
}
|
||||
NEXT_INST_F(5, 0, 0);
|
||||
}
|
||||
break;
|
||||
|
||||
/*
|
||||
* End of INST_UNSET instructions.
|
||||
@@ -4242,6 +4274,7 @@ TEBCresume(
|
||||
TRACE_APPEND(("link made\n"));
|
||||
NEXT_INST_F(5, 1, 0);
|
||||
}
|
||||
break;
|
||||
|
||||
/*
|
||||
* End of variable linking instructions.
|
||||
@@ -4253,6 +4286,7 @@ TEBCresume(
|
||||
TRACE(("%d => new pc %u\n", opnd,
|
||||
(unsigned)(pc + opnd - codePtr->codeStart)));
|
||||
NEXT_INST_F(opnd, 0, 0);
|
||||
break;
|
||||
|
||||
case INST_JUMP4:
|
||||
opnd = TclGetInt4AtPtr(pc+1);
|
||||
@@ -4315,6 +4349,7 @@ TEBCresume(
|
||||
#endif
|
||||
NEXT_INST_F(jmpOffset[b], 1, 0);
|
||||
}
|
||||
break;
|
||||
|
||||
case INST_JUMP_TABLE: {
|
||||
Tcl_HashEntry *hPtr;
|
||||
@@ -4340,6 +4375,7 @@ TEBCresume(
|
||||
NEXT_INST_F(5, 1, 0);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
/*
|
||||
* These two instructions are now redundant: the complete logic of the LOR
|
||||
@@ -4384,6 +4420,7 @@ TEBCresume(
|
||||
TRACE(("%.20s %.20s => %d\n", O2S(valuePtr),O2S(value2Ptr),iResult));
|
||||
NEXT_INST_F(1, 2, 1);
|
||||
}
|
||||
break;
|
||||
|
||||
/*
|
||||
* -----------------------------------------------------------------
|
||||
@@ -4402,6 +4439,7 @@ TEBCresume(
|
||||
TRACE_WITH_OBJ(("=> "), objResultPtr);
|
||||
NEXT_INST_F(1, 0, 1);
|
||||
}
|
||||
break;
|
||||
case INST_COROUTINE_NAME: {
|
||||
CoroutineData *corPtr = iPtr->execEnvPtr->corPtr;
|
||||
|
||||
@@ -4413,10 +4451,12 @@ TEBCresume(
|
||||
TRACE_WITH_OBJ(("=> "), objResultPtr);
|
||||
NEXT_INST_F(1, 0, 1);
|
||||
}
|
||||
break;
|
||||
case INST_INFO_LEVEL_NUM:
|
||||
TclNewIntObj(objResultPtr, iPtr->varFramePtr->level);
|
||||
TRACE_WITH_OBJ(("=> "), objResultPtr);
|
||||
NEXT_INST_F(1, 0, 1);
|
||||
break;
|
||||
case INST_INFO_LEVEL_ARGS: {
|
||||
int level;
|
||||
CallFrame *framePtr = iPtr->varFramePtr;
|
||||
@@ -4507,7 +4547,7 @@ TEBCresume(
|
||||
CACHE_STACK_INFO();
|
||||
goto gotError;
|
||||
}
|
||||
contextPtr = framePtr->clientData;
|
||||
contextPtr = (CallContext *)framePtr->clientData;
|
||||
|
||||
/*
|
||||
* Call out to get the name; it's expensive to compute but cached.
|
||||
@@ -4535,7 +4575,7 @@ TEBCresume(
|
||||
CACHE_STACK_INFO();
|
||||
goto gotError;
|
||||
}
|
||||
contextPtr = framePtr->clientData;
|
||||
contextPtr = (CallContext *)framePtr->clientData;
|
||||
|
||||
oPtr = (Object *) Tcl_GetObjectFromObj(interp, valuePtr);
|
||||
if (oPtr == NULL) {
|
||||
@@ -4634,7 +4674,7 @@ TEBCresume(
|
||||
CACHE_STACK_INFO();
|
||||
goto gotError;
|
||||
}
|
||||
contextPtr = framePtr->clientData;
|
||||
contextPtr = (CallContext *)framePtr->clientData;
|
||||
|
||||
newDepth = contextPtr->index + 1;
|
||||
if (newDepth >= contextPtr->callPtr->numChain) {
|
||||
@@ -5838,6 +5878,7 @@ TEBCresume(
|
||||
wResult = w1 - w2*wResult;
|
||||
goto wideResultOfArithmetic;
|
||||
}
|
||||
break;
|
||||
|
||||
case INST_RSHIFT:
|
||||
if (w2 < 0) {
|
||||
@@ -5886,6 +5927,7 @@ TEBCresume(
|
||||
wResult = w1 >> ((int) w2);
|
||||
goto wideResultOfArithmetic;
|
||||
}
|
||||
break;
|
||||
|
||||
case INST_LSHIFT:
|
||||
if (w2 < 0) {
|
||||
@@ -6075,6 +6117,7 @@ TEBCresume(
|
||||
TclSetIntObj(valuePtr, wResult);
|
||||
TRACE(("%s\n", O2S(valuePtr)));
|
||||
NEXT_INST_F(1, 1, 0);
|
||||
break;
|
||||
|
||||
case INST_DIV:
|
||||
if (w2 == 0) {
|
||||
@@ -6132,6 +6175,9 @@ TEBCresume(
|
||||
} else if (objResultPtr == GENERAL_ARITHMETIC_ERROR) {
|
||||
TRACE_ERROR(interp);
|
||||
goto gotError;
|
||||
} else if (objResultPtr == OUT_OF_MEMORY) {
|
||||
TRACE_APPEND(("OUT OF MEMORY\n"));
|
||||
goto outOfMemory;
|
||||
} else if (objResultPtr == NULL) {
|
||||
TRACE_APPEND(("%s\n", O2S(valuePtr)));
|
||||
NEXT_INST_F(1, 1, 0);
|
||||
@@ -6214,6 +6260,7 @@ TEBCresume(
|
||||
/* -NaN => NaN */
|
||||
TRACE_APPEND(("%s\n", O2S(valuePtr)));
|
||||
NEXT_INST_F(1, 0, 0);
|
||||
break;
|
||||
case TCL_NUMBER_INT:
|
||||
w1 = *((const Tcl_WideInt *) ptr1);
|
||||
if (w1 != WIDE_MIN) {
|
||||
@@ -6322,6 +6369,7 @@ TEBCresume(
|
||||
TRACE_APPEND(("numeric, same Tcl_Obj\n"));
|
||||
NEXT_INST_F(1, 0, 0);
|
||||
}
|
||||
break;
|
||||
|
||||
/*
|
||||
* End of numeric operator instructions.
|
||||
@@ -6338,6 +6386,7 @@ TEBCresume(
|
||||
}
|
||||
TRACE_WITH_OBJ(("\"%.30s\" => ", O2S(valuePtr)), objResultPtr);
|
||||
NEXT_INST_F(1, 0, 1);
|
||||
break;
|
||||
|
||||
case INST_BREAK:
|
||||
/*
|
||||
@@ -6378,7 +6427,7 @@ TEBCresume(
|
||||
*/
|
||||
|
||||
opnd = TclGetUInt4AtPtr(pc+1);
|
||||
infoPtr = codePtr->auxDataArrayPtr[opnd].clientData;
|
||||
infoPtr = (ForeachInfo *)codePtr->auxDataArrayPtr[opnd].clientData;
|
||||
iterTmpIndex = infoPtr->loopCtTemp;
|
||||
iterVarPtr = LOCAL(iterTmpIndex);
|
||||
oldValuePtr = iterVarPtr->value.objPtr;
|
||||
@@ -6412,7 +6461,7 @@ TEBCresume(
|
||||
|
||||
opnd = TclGetUInt4AtPtr(pc+1);
|
||||
TRACE(("%u => ", opnd));
|
||||
infoPtr = codePtr->auxDataArrayPtr[opnd].clientData;
|
||||
infoPtr = (ForeachInfo *)codePtr->auxDataArrayPtr[opnd].clientData;
|
||||
numLists = infoPtr->numLists;
|
||||
|
||||
/*
|
||||
@@ -6542,7 +6591,7 @@ TEBCresume(
|
||||
*/
|
||||
|
||||
opnd = TclGetUInt4AtPtr(pc+1);
|
||||
infoPtr = codePtr->auxDataArrayPtr[opnd].clientData;
|
||||
infoPtr = (ForeachInfo *)codePtr->auxDataArrayPtr[opnd].clientData;
|
||||
numLists = infoPtr->numLists;
|
||||
TRACE(("%u => ", opnd));
|
||||
|
||||
@@ -6610,7 +6659,7 @@ TEBCresume(
|
||||
*/
|
||||
|
||||
tmpPtr = OBJ_AT_TOS;
|
||||
infoPtr = tmpPtr->internalRep.twoPtrValue.ptr1;
|
||||
infoPtr = (ForeachInfo *)tmpPtr->internalRep.twoPtrValue.ptr1;
|
||||
numLists = infoPtr->numLists;
|
||||
TRACE(("=> "));
|
||||
|
||||
@@ -6694,7 +6743,7 @@ TEBCresume(
|
||||
case INST_FOREACH_END:
|
||||
/* THIS INSTRUCTION IS ONLY CALLED AS A BREAK TARGET */
|
||||
tmpPtr = OBJ_AT_TOS;
|
||||
infoPtr = tmpPtr->internalRep.twoPtrValue.ptr1;
|
||||
infoPtr = (ForeachInfo *)tmpPtr->internalRep.twoPtrValue.ptr1;
|
||||
numLists = infoPtr->numLists;
|
||||
TRACE(("=> loop terminated\n"));
|
||||
NEXT_INST_V(1, numLists+2, 0);
|
||||
@@ -6711,7 +6760,7 @@ TEBCresume(
|
||||
*/
|
||||
|
||||
tmpPtr = OBJ_AT_DEPTH(1);
|
||||
infoPtr = tmpPtr->internalRep.twoPtrValue.ptr1;
|
||||
infoPtr = (ForeachInfo *)tmpPtr->internalRep.twoPtrValue.ptr1;
|
||||
numLists = infoPtr->numLists;
|
||||
TRACE_APPEND(("=> appending to list at depth %d\n", 3 + numLists));
|
||||
|
||||
@@ -6719,6 +6768,7 @@ TEBCresume(
|
||||
Tcl_ListObjAppendElement(NULL, objPtr, OBJ_AT_TOS);
|
||||
NEXT_INST_F(1, 1, 0);
|
||||
}
|
||||
break;
|
||||
|
||||
case INST_BEGIN_CATCH4:
|
||||
/*
|
||||
@@ -6732,6 +6782,7 @@ TEBCresume(
|
||||
TclGetUInt4AtPtr(pc+1), (int) (catchTop - initCatchTop - 1),
|
||||
(int) CURR_DEPTH));
|
||||
NEXT_INST_F(5, 0, 0);
|
||||
break;
|
||||
|
||||
case INST_END_CATCH:
|
||||
catchTop--;
|
||||
@@ -6741,6 +6792,7 @@ TEBCresume(
|
||||
result = TCL_OK;
|
||||
TRACE(("=> catchTop=%d\n", (int) (catchTop - initCatchTop - 1)));
|
||||
NEXT_INST_F(1, 0, 0);
|
||||
break;
|
||||
|
||||
case INST_PUSH_RESULT:
|
||||
objResultPtr = Tcl_GetObjResult(interp);
|
||||
@@ -6754,11 +6806,13 @@ TEBCresume(
|
||||
Tcl_IncrRefCount(objPtr);
|
||||
iPtr->objResultPtr = objPtr;
|
||||
NEXT_INST_F(1, 0, -1);
|
||||
break;
|
||||
|
||||
case INST_PUSH_RETURN_CODE:
|
||||
TclNewIntObj(objResultPtr, result);
|
||||
TRACE(("=> %u\n", result));
|
||||
NEXT_INST_F(1, 0, 1);
|
||||
break;
|
||||
|
||||
case INST_PUSH_RETURN_OPTIONS:
|
||||
DECACHE_STACK_INFO();
|
||||
@@ -6766,6 +6820,7 @@ TEBCresume(
|
||||
CACHE_STACK_INFO();
|
||||
TRACE_WITH_OBJ(("=> "), objResultPtr);
|
||||
NEXT_INST_F(1, 0, 1);
|
||||
break;
|
||||
|
||||
case INST_RETURN_CODE_BRANCH: {
|
||||
int code;
|
||||
@@ -6805,6 +6860,7 @@ TEBCresume(
|
||||
}
|
||||
TRACE_APPEND(("OK\n"));
|
||||
NEXT_INST_F(1, 1, 0);
|
||||
break;
|
||||
|
||||
case INST_DICT_EXISTS: {
|
||||
int found;
|
||||
@@ -7151,7 +7207,7 @@ TEBCresume(
|
||||
opnd = TclGetUInt4AtPtr(pc+1);
|
||||
TRACE(("%u => ", opnd));
|
||||
dictPtr = POP_OBJECT();
|
||||
searchPtr = ckalloc(sizeof(Tcl_DictSearch));
|
||||
searchPtr = (Tcl_DictSearch *)ckalloc(sizeof(Tcl_DictSearch));
|
||||
if (Tcl_DictObjFirst(interp, dictPtr, searchPtr, &keyPtr,
|
||||
&valuePtr, &done) != TCL_OK) {
|
||||
|
||||
@@ -7193,7 +7249,7 @@ TEBCresume(
|
||||
|
||||
if (statePtr &&
|
||||
(irPtr = TclFetchIntRep(statePtr, &dictIteratorType))) {
|
||||
searchPtr = irPtr->twoPtrValue.ptr1;
|
||||
searchPtr = (Tcl_DictSearch *)irPtr->twoPtrValue.ptr1;
|
||||
Tcl_DictObjNext(searchPtr, &keyPtr, &valuePtr, &done);
|
||||
} else {
|
||||
Tcl_Panic("mis-issued dictNext!");
|
||||
@@ -7225,7 +7281,7 @@ TEBCresume(
|
||||
opnd2 = TclGetUInt4AtPtr(pc+5);
|
||||
TRACE(("%u => ", opnd));
|
||||
varPtr = LOCAL(opnd);
|
||||
duiPtr = codePtr->auxDataArrayPtr[opnd2].clientData;
|
||||
duiPtr = (DictUpdateInfo *)codePtr->auxDataArrayPtr[opnd2].clientData;
|
||||
while (TclIsVarLink(varPtr)) {
|
||||
varPtr = varPtr->value.linkPtr;
|
||||
}
|
||||
@@ -7285,7 +7341,7 @@ TEBCresume(
|
||||
opnd2 = TclGetUInt4AtPtr(pc+5);
|
||||
TRACE(("%u => ", opnd));
|
||||
varPtr = LOCAL(opnd);
|
||||
duiPtr = codePtr->auxDataArrayPtr[opnd2].clientData;
|
||||
duiPtr = (DictUpdateInfo *)codePtr->auxDataArrayPtr[opnd2].clientData;
|
||||
while (TclIsVarLink(varPtr)) {
|
||||
varPtr = varPtr->value.linkPtr;
|
||||
}
|
||||
@@ -7428,6 +7484,7 @@ TEBCresume(
|
||||
TRACE_APPEND(("OK\n"));
|
||||
NEXT_INST_F(5, 2, 0);
|
||||
}
|
||||
break;
|
||||
|
||||
/*
|
||||
* End of dictionary-related instructions.
|
||||
@@ -7465,6 +7522,7 @@ TEBCresume(
|
||||
TRACE_WITH_OBJ(("=> "), objResultPtr);
|
||||
NEXT_INST_F(2, 0, 1);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
Tcl_Panic("TclNRExecuteByteCode: unrecognized opCode %u", *pc);
|
||||
@@ -7572,6 +7630,13 @@ TEBCresume(
|
||||
CACHE_STACK_INFO();
|
||||
goto gotError;
|
||||
|
||||
outOfMemory:
|
||||
Tcl_SetObjResult(interp, Tcl_NewStringObj("out of memory", -1));
|
||||
DECACHE_STACK_INFO();
|
||||
Tcl_SetErrorCode(interp, "ARITH", "OUTOFMEMORY", "out of memory", NULL);
|
||||
CACHE_STACK_INFO();
|
||||
goto gotError;
|
||||
|
||||
/*
|
||||
* Exponentiation of zero by negative number in an expression. Control
|
||||
* only reaches this point by "goto exponOfZero".
|
||||
@@ -7817,13 +7882,13 @@ FinalizeOONext(
|
||||
int result)
|
||||
{
|
||||
Interp *iPtr = (Interp *) interp;
|
||||
CallContext *contextPtr = data[1];
|
||||
CallContext *contextPtr = (CallContext *)data[1];
|
||||
|
||||
/*
|
||||
* Reset the variable lookup frame.
|
||||
*/
|
||||
|
||||
iPtr->varFramePtr = data[0];
|
||||
iPtr->varFramePtr = (CallFrame *)data[0];
|
||||
|
||||
/*
|
||||
* Restore the call chain context index as we've finished the inner invoke
|
||||
@@ -7843,13 +7908,13 @@ FinalizeOONextFilter(
|
||||
int result)
|
||||
{
|
||||
Interp *iPtr = (Interp *) interp;
|
||||
CallContext *contextPtr = data[1];
|
||||
CallContext *contextPtr = (CallContext *)data[1];
|
||||
|
||||
/*
|
||||
* Reset the variable lookup frame.
|
||||
*/
|
||||
|
||||
iPtr->varFramePtr = data[0];
|
||||
iPtr->varFramePtr = (CallFrame *)data[0];
|
||||
|
||||
/*
|
||||
* Restore the call chain context index as we've finished the inner invoke
|
||||
@@ -8011,6 +8076,7 @@ ExecuteExtendedBinaryMathOp(
|
||||
Tcl_Obj *objResultPtr;
|
||||
int invalid, zero;
|
||||
long shift;
|
||||
mp_err err;
|
||||
|
||||
(void) GetNumberFromObj(NULL, valuePtr, &ptr1, &type1);
|
||||
(void) GetNumberFromObj(NULL, value2Ptr, &ptr2, &type2);
|
||||
@@ -8067,14 +8133,19 @@ ExecuteExtendedBinaryMathOp(
|
||||
Tcl_TakeBignumFromObj(NULL, value2Ptr, &big2);
|
||||
|
||||
/* TODO: internals intrusion */
|
||||
if ((w1 > ((Tcl_WideInt) 0)) ^ (big2.sign == MP_ZPOS)) {
|
||||
if ((w1 > ((Tcl_WideInt) 0)) ^ !mp_isneg(&big2)) {
|
||||
/*
|
||||
* Arguments are opposite sign; remainder is sum.
|
||||
*/
|
||||
|
||||
TclInitBignumFromWideInt(&big1, w1);
|
||||
mp_add(&big2, &big1, &big2);
|
||||
mp_clear(&big1);
|
||||
err = mp_init_i64(&big1, w1);
|
||||
if (err == MP_OKAY) {
|
||||
err = mp_add(&big2, &big1, &big2);
|
||||
mp_clear(&big1);
|
||||
}
|
||||
if (err != MP_OKAY) {
|
||||
return OUT_OF_MEMORY;
|
||||
}
|
||||
BIG_RESULT(&big2);
|
||||
}
|
||||
|
||||
@@ -8087,21 +8158,27 @@ ExecuteExtendedBinaryMathOp(
|
||||
}
|
||||
Tcl_GetBignumFromObj(NULL, valuePtr, &big1);
|
||||
Tcl_GetBignumFromObj(NULL, value2Ptr, &big2);
|
||||
mp_init(&bigResult);
|
||||
mp_init(&bigRemainder);
|
||||
mp_div(&big1, &big2, &bigResult, &bigRemainder);
|
||||
if ((bigRemainder.used != 0) && (bigRemainder.sign != big2.sign)) {
|
||||
err = mp_init_multi(&bigResult, &bigRemainder, NULL);
|
||||
if (err == MP_OKAY) {
|
||||
err = mp_div(&big1, &big2, &bigResult, &bigRemainder);
|
||||
}
|
||||
if ((err == MP_OKAY) && !mp_iszero(&bigRemainder) && (bigRemainder.sign != big2.sign)) {
|
||||
/*
|
||||
* Convert to Tcl's integer division rules.
|
||||
*/
|
||||
|
||||
mp_sub_d(&bigResult, 1, &bigResult);
|
||||
mp_add(&bigRemainder, &big2, &bigRemainder);
|
||||
if ((mp_sub_d(&bigResult, 1, &bigResult) != MP_OKAY)
|
||||
|| (mp_add(&bigRemainder, &big2, &bigRemainder) != MP_OKAY)) {
|
||||
return OUT_OF_MEMORY;
|
||||
}
|
||||
}
|
||||
mp_copy(&bigRemainder, &bigResult);
|
||||
err = mp_copy(&bigRemainder, &bigResult);
|
||||
mp_clear(&bigRemainder);
|
||||
mp_clear(&big1);
|
||||
mp_clear(&big2);
|
||||
if (err != MP_OKAY) {
|
||||
return OUT_OF_MEMORY;
|
||||
}
|
||||
BIG_RESULT(&bigResult);
|
||||
|
||||
case INST_LSHIFT:
|
||||
@@ -8116,7 +8193,7 @@ ExecuteExtendedBinaryMathOp(
|
||||
break;
|
||||
case TCL_NUMBER_BIG:
|
||||
Tcl_TakeBignumFromObj(NULL, value2Ptr, &big2);
|
||||
invalid = big2.sign != MP_ZPOS;
|
||||
invalid = mp_isneg(&big2);
|
||||
mp_clear(&big2);
|
||||
break;
|
||||
default:
|
||||
@@ -8195,7 +8272,7 @@ ExecuteExtendedBinaryMathOp(
|
||||
break;
|
||||
case TCL_NUMBER_BIG:
|
||||
Tcl_TakeBignumFromObj(NULL, valuePtr, &big1);
|
||||
zero = (big1.sign == MP_ZPOS);
|
||||
zero = !mp_isneg(&big1);
|
||||
mp_clear(&big1);
|
||||
break;
|
||||
default:
|
||||
@@ -8227,11 +8304,16 @@ ExecuteExtendedBinaryMathOp(
|
||||
|
||||
Tcl_TakeBignumFromObj(NULL, valuePtr, &big1);
|
||||
|
||||
mp_init(&bigResult);
|
||||
if (opcode == INST_LSHIFT) {
|
||||
mp_mul_2d(&big1, shift, &bigResult);
|
||||
} else {
|
||||
mp_signed_rsh(&big1, shift, &bigResult);
|
||||
err = mp_init(&bigResult);
|
||||
if (err == MP_OKAY) {
|
||||
if (opcode == INST_LSHIFT) {
|
||||
err = mp_mul_2d(&big1, shift, &bigResult);
|
||||
} else {
|
||||
err = mp_signed_rsh(&big1, shift, &bigResult);
|
||||
}
|
||||
}
|
||||
if (err != MP_OKAY) {
|
||||
return OUT_OF_MEMORY;
|
||||
}
|
||||
mp_clear(&big1);
|
||||
BIG_RESULT(&bigResult);
|
||||
@@ -8244,20 +8326,25 @@ ExecuteExtendedBinaryMathOp(
|
||||
Tcl_TakeBignumFromObj(NULL, valuePtr, &big1);
|
||||
Tcl_TakeBignumFromObj(NULL, value2Ptr, &big2);
|
||||
|
||||
mp_init(&bigResult);
|
||||
err = mp_init(&bigResult);
|
||||
|
||||
switch (opcode) {
|
||||
case INST_BITAND:
|
||||
mp_and(&big1, &big2, &bigResult);
|
||||
break;
|
||||
if (err == MP_OKAY) {
|
||||
switch (opcode) {
|
||||
case INST_BITAND:
|
||||
err = mp_and(&big1, &big2, &bigResult);
|
||||
break;
|
||||
|
||||
case INST_BITOR:
|
||||
mp_or(&big1, &big2, &bigResult);
|
||||
break;
|
||||
case INST_BITOR:
|
||||
err = mp_or(&big1, &big2, &bigResult);
|
||||
break;
|
||||
|
||||
case INST_BITXOR:
|
||||
mp_xor(&big1, &big2, &bigResult);
|
||||
break;
|
||||
case INST_BITXOR:
|
||||
err = mp_xor(&big1, &big2, &bigResult);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (err != MP_OKAY) {
|
||||
return OUT_OF_MEMORY;
|
||||
}
|
||||
|
||||
mp_clear(&big1);
|
||||
@@ -8319,9 +8406,9 @@ ExecuteExtendedBinaryMathOp(
|
||||
oddExponent = (int) (w2 & (Tcl_WideInt)1);
|
||||
} else {
|
||||
Tcl_TakeBignumFromObj(NULL, value2Ptr, &big2);
|
||||
negativeExponent = big2.sign != MP_ZPOS;
|
||||
mp_mod_2d(&big2, 1, &big2);
|
||||
oddExponent = big2.used != 0;
|
||||
negativeExponent = mp_isneg(&big2);
|
||||
err = mp_mod_2d(&big2, 1, &big2);
|
||||
oddExponent = (err == MP_OKAY) && !mp_iszero(&big2);
|
||||
mp_clear(&big2);
|
||||
}
|
||||
|
||||
@@ -8478,8 +8565,13 @@ ExecuteExtendedBinaryMathOp(
|
||||
return GENERAL_ARITHMETIC_ERROR;
|
||||
}
|
||||
Tcl_TakeBignumFromObj(NULL, valuePtr, &big1);
|
||||
mp_init(&bigResult);
|
||||
mp_expt_d(&big1, (mp_digit)w2, &bigResult);
|
||||
err = mp_init(&bigResult);
|
||||
if (err == MP_OKAY) {
|
||||
err = mp_expt_u32(&big1, (unsigned int)w2, &bigResult);
|
||||
}
|
||||
if (err != MP_OKAY) {
|
||||
return OUT_OF_MEMORY;
|
||||
}
|
||||
mp_clear(&big1);
|
||||
BIG_RESULT(&bigResult);
|
||||
}
|
||||
@@ -8626,38 +8718,44 @@ ExecuteExtendedBinaryMathOp(
|
||||
overflowBasic:
|
||||
Tcl_TakeBignumFromObj(NULL, valuePtr, &big1);
|
||||
Tcl_TakeBignumFromObj(NULL, value2Ptr, &big2);
|
||||
mp_init(&bigResult);
|
||||
err = mp_init(&bigResult);
|
||||
if (err == MP_OKAY) {
|
||||
switch (opcode) {
|
||||
case INST_ADD:
|
||||
mp_add(&big1, &big2, &bigResult);
|
||||
break;
|
||||
err = mp_add(&big1, &big2, &bigResult);
|
||||
break;
|
||||
case INST_SUB:
|
||||
mp_sub(&big1, &big2, &bigResult);
|
||||
break;
|
||||
err = mp_sub(&big1, &big2, &bigResult);
|
||||
break;
|
||||
case INST_MULT:
|
||||
mp_mul(&big1, &big2, &bigResult);
|
||||
break;
|
||||
err = mp_mul(&big1, &big2, &bigResult);
|
||||
break;
|
||||
case INST_DIV:
|
||||
if (big2.used == 0) {
|
||||
mp_clear(&big1);
|
||||
mp_clear(&big2);
|
||||
mp_clear(&bigResult);
|
||||
return DIVIDED_BY_ZERO;
|
||||
}
|
||||
mp_init(&bigRemainder);
|
||||
mp_div(&big1, &big2, &bigResult, &bigRemainder);
|
||||
/* TODO: internals intrusion */
|
||||
if ((bigRemainder.used != 0)
|
||||
&& (bigRemainder.sign != big2.sign)) {
|
||||
/*
|
||||
* Convert to Tcl's integer division rules.
|
||||
*/
|
||||
if (mp_iszero(&big2)) {
|
||||
mp_clear(&big1);
|
||||
mp_clear(&big2);
|
||||
mp_clear(&bigResult);
|
||||
return DIVIDED_BY_ZERO;
|
||||
}
|
||||
err = mp_init(&bigRemainder);
|
||||
if (err == MP_OKAY) {
|
||||
err = mp_div(&big1, &big2, &bigResult, &bigRemainder);
|
||||
}
|
||||
/* TODO: internals intrusion */
|
||||
if (!mp_iszero(&bigRemainder)
|
||||
&& (bigRemainder.sign != big2.sign)) {
|
||||
/*
|
||||
* Convert to Tcl's integer division rules.
|
||||
*/
|
||||
|
||||
mp_sub_d(&bigResult, 1, &bigResult);
|
||||
mp_add(&bigRemainder, &big2, &bigRemainder);
|
||||
err = mp_sub_d(&bigResult, 1, &bigResult);
|
||||
if (err == MP_OKAY) {
|
||||
err = mp_add(&bigRemainder, &big2, &bigRemainder);
|
||||
}
|
||||
}
|
||||
mp_clear(&bigRemainder);
|
||||
break;
|
||||
}
|
||||
mp_clear(&bigRemainder);
|
||||
break;
|
||||
}
|
||||
mp_clear(&big1);
|
||||
mp_clear(&big2);
|
||||
@@ -8678,6 +8776,7 @@ ExecuteExtendedUnaryMathOp(
|
||||
Tcl_WideInt w;
|
||||
mp_int big;
|
||||
Tcl_Obj *objResultPtr;
|
||||
mp_err err = MP_OKAY;
|
||||
|
||||
(void) GetNumberFromObj(NULL, valuePtr, &ptr, &type);
|
||||
|
||||
@@ -8689,8 +8788,13 @@ ExecuteExtendedUnaryMathOp(
|
||||
}
|
||||
Tcl_TakeBignumFromObj(NULL, valuePtr, &big);
|
||||
/* ~a = - a - 1 */
|
||||
mp_neg(&big, &big);
|
||||
mp_sub_d(&big, 1, &big);
|
||||
err = mp_neg(&big, &big);
|
||||
if (err == MP_OKAY) {
|
||||
err = mp_sub_d(&big, 1, &big);
|
||||
}
|
||||
if (err != MP_OKAY) {
|
||||
return OUT_OF_MEMORY;
|
||||
}
|
||||
BIG_RESULT(&big);
|
||||
case INST_UMINUS:
|
||||
switch (type) {
|
||||
@@ -8701,12 +8805,18 @@ ExecuteExtendedUnaryMathOp(
|
||||
if (w != WIDE_MIN) {
|
||||
WIDE_RESULT(-w);
|
||||
}
|
||||
TclInitBignumFromWideInt(&big, w);
|
||||
err = mp_init_i64(&big, w);
|
||||
if (err != MP_OKAY) {
|
||||
return OUT_OF_MEMORY;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
Tcl_TakeBignumFromObj(NULL, valuePtr, &big);
|
||||
}
|
||||
mp_neg(&big, &big);
|
||||
err = mp_neg(&big, &big);
|
||||
if (err != MP_OKAY) {
|
||||
return OUT_OF_MEMORY;
|
||||
}
|
||||
BIG_RESULT(&big);
|
||||
}
|
||||
|
||||
@@ -8794,7 +8904,7 @@ TclCompareTwoNumbers(
|
||||
goto wideCompare;
|
||||
case TCL_NUMBER_BIG:
|
||||
Tcl_TakeBignumFromObj(NULL, value2Ptr, &big2);
|
||||
if (big2.sign != MP_ZPOS) {
|
||||
if (mp_isneg(&big2)) {
|
||||
compare = MP_GT;
|
||||
} else {
|
||||
compare = MP_LT;
|
||||
@@ -8802,6 +8912,7 @@ TclCompareTwoNumbers(
|
||||
mp_clear(&big2);
|
||||
return compare;
|
||||
}
|
||||
break;
|
||||
|
||||
case TCL_NUMBER_DOUBLE:
|
||||
d1 = *((const double *)ptr1);
|
||||
@@ -8831,7 +8942,7 @@ TclCompareTwoNumbers(
|
||||
}
|
||||
Tcl_TakeBignumFromObj(NULL, value2Ptr, &big2);
|
||||
if ((d1 < (double)WIDE_MAX) && (d1 > (double)WIDE_MIN)) {
|
||||
if (big2.sign != MP_ZPOS) {
|
||||
if (mp_isneg(&big2)) {
|
||||
compare = MP_GT;
|
||||
} else {
|
||||
compare = MP_LT;
|
||||
@@ -8848,6 +8959,7 @@ TclCompareTwoNumbers(
|
||||
Tcl_InitBignumFromDouble(NULL, d1, &big1);
|
||||
goto bigCompare;
|
||||
}
|
||||
break;
|
||||
|
||||
case TCL_NUMBER_BIG:
|
||||
Tcl_TakeBignumFromObj(NULL, valuePtr, &big1);
|
||||
@@ -8884,10 +8996,11 @@ TclCompareTwoNumbers(
|
||||
mp_clear(&big2);
|
||||
return compare;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
Tcl_Panic("unexpected number type");
|
||||
return TCL_ERROR;
|
||||
}
|
||||
return TCL_ERROR;
|
||||
}
|
||||
|
||||
#ifdef TCL_COMPILE_DEBUG
|
||||
@@ -9056,12 +9169,12 @@ IllegalExprOperandType(
|
||||
ClientData ptr;
|
||||
int type;
|
||||
const unsigned char opcode = *pc;
|
||||
const char *description, *operator = "unknown";
|
||||
const char *description, *op = "unknown";
|
||||
|
||||
if (opcode == INST_EXPON) {
|
||||
operator = "**";
|
||||
op = "**";
|
||||
} else if (opcode <= INST_LNOT) {
|
||||
operator = operatorStrings[opcode - INST_LOR];
|
||||
op = operatorStrings[opcode - INST_LOR];
|
||||
}
|
||||
|
||||
if (GetNumberFromObj(NULL, opndPtr, &ptr, &type) != TCL_OK) {
|
||||
@@ -9085,7 +9198,7 @@ IllegalExprOperandType(
|
||||
}
|
||||
|
||||
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
|
||||
"can't use %s as operand of \"%s\"", description, operator));
|
||||
"can't use %s as operand of \"%s\"", description, op));
|
||||
Tcl_SetErrorCode(interp, "ARITH", "DOMAIN", description, NULL);
|
||||
}
|
||||
|
||||
@@ -9172,7 +9285,7 @@ TclGetSrcInfoForPc(
|
||||
}
|
||||
|
||||
srcOffset = cfPtr->cmd - codePtr->source;
|
||||
eclPtr = Tcl_GetHashValue(hePtr);
|
||||
eclPtr = (ExtCmdLoc *)Tcl_GetHashValue(hePtr);
|
||||
|
||||
for (i=0; i < eclPtr->nuloc; i++) {
|
||||
if (eclPtr->loc[i].srcOffset == srcOffset) {
|
||||
|
||||
+18
-9
@@ -47,12 +47,13 @@ static int FileForceOption(Tcl_Interp *interp,
|
||||
|
||||
int
|
||||
TclFileRenameCmd(
|
||||
ClientData clientData, /* Unused */
|
||||
ClientData dummy, /* Unused */
|
||||
Tcl_Interp *interp, /* Interp for error reporting or recursive
|
||||
* calls in the case of a tricky rename. */
|
||||
int objc, /* Number of arguments. */
|
||||
Tcl_Obj *const objv[]) /* Argument strings passed to Tcl_FileCmd. */
|
||||
{
|
||||
(void)dummy;
|
||||
return FileCopyRename(interp, objc, objv, 0);
|
||||
}
|
||||
|
||||
@@ -76,12 +77,13 @@ TclFileRenameCmd(
|
||||
|
||||
int
|
||||
TclFileCopyCmd(
|
||||
ClientData clientData, /* Unused */
|
||||
ClientData dummy, /* Unused */
|
||||
Tcl_Interp *interp, /* Used for error reporting or recursive calls
|
||||
* in the case of a tricky copy. */
|
||||
int objc, /* Number of arguments. */
|
||||
Tcl_Obj *const objv[]) /* Argument strings passed to Tcl_FileCmd. */
|
||||
{
|
||||
(void)dummy;
|
||||
return FileCopyRename(interp, objc, objv, 1);
|
||||
}
|
||||
|
||||
@@ -214,7 +216,7 @@ FileCopyRename(
|
||||
|
||||
int
|
||||
TclFileMakeDirsCmd(
|
||||
ClientData clientData, /* Unused */
|
||||
ClientData dummy, /* Unused */
|
||||
Tcl_Interp *interp, /* Used for error reporting. */
|
||||
int objc, /* Number of arguments */
|
||||
Tcl_Obj *const objv[]) /* Argument strings passed to Tcl_FileCmd. */
|
||||
@@ -224,6 +226,7 @@ TclFileMakeDirsCmd(
|
||||
Tcl_Obj *split = NULL;
|
||||
Tcl_Obj *target = NULL;
|
||||
Tcl_StatBuf statBuf;
|
||||
(void)dummy;
|
||||
|
||||
result = TCL_OK;
|
||||
for (i = 1; i < objc; i++) {
|
||||
@@ -338,7 +341,7 @@ TclFileMakeDirsCmd(
|
||||
|
||||
int
|
||||
TclFileDeleteCmd(
|
||||
ClientData clientData, /* Unused */
|
||||
ClientData dummy, /* Unused */
|
||||
Tcl_Interp *interp, /* Used for error reporting */
|
||||
int objc, /* Number of arguments */
|
||||
Tcl_Obj *const objv[]) /* Argument strings passed to Tcl_FileCmd. */
|
||||
@@ -346,6 +349,7 @@ TclFileDeleteCmd(
|
||||
int i, force, result;
|
||||
Tcl_Obj *errfile;
|
||||
Tcl_Obj *errorBuffer = NULL;
|
||||
(void)dummy;
|
||||
|
||||
i = FileForceOption(interp, objc - 1, objv + 1, &force);
|
||||
if (i < 0) {
|
||||
@@ -946,7 +950,7 @@ FileBasename(
|
||||
|
||||
int
|
||||
TclFileAttrsCmd(
|
||||
ClientData clientData, /* Unused */
|
||||
ClientData dummy, /* Unused */
|
||||
Tcl_Interp *interp, /* The interpreter for error reporting. */
|
||||
int objc, /* Number of command line arguments. */
|
||||
Tcl_Obj *const objv[]) /* The command line objects. */
|
||||
@@ -957,6 +961,7 @@ TclFileAttrsCmd(
|
||||
Tcl_Obj *objStrings = NULL;
|
||||
int numObjStrings = -1;
|
||||
Tcl_Obj *filePtr;
|
||||
(void)dummy;
|
||||
|
||||
if (objc < 2) {
|
||||
Tcl_WrongNumArgs(interp, 1, objv, "name ?-option value ...?");
|
||||
@@ -1162,13 +1167,14 @@ TclFileAttrsCmd(
|
||||
|
||||
int
|
||||
TclFileLinkCmd(
|
||||
ClientData clientData,
|
||||
ClientData dummy,
|
||||
Tcl_Interp *interp,
|
||||
int objc,
|
||||
Tcl_Obj *const objv[])
|
||||
{
|
||||
Tcl_Obj *contents;
|
||||
int index;
|
||||
(void)dummy;
|
||||
|
||||
if (objc < 2 || objc > 4) {
|
||||
Tcl_WrongNumArgs(interp, 1, objv, "?-linktype? linkname ?target?");
|
||||
@@ -1313,12 +1319,13 @@ TclFileLinkCmd(
|
||||
|
||||
int
|
||||
TclFileReadLinkCmd(
|
||||
ClientData clientData,
|
||||
ClientData dummy,
|
||||
Tcl_Interp *interp,
|
||||
int objc,
|
||||
Tcl_Obj *const objv[])
|
||||
{
|
||||
Tcl_Obj *contents;
|
||||
(void)dummy;
|
||||
|
||||
if (objc != 2) {
|
||||
Tcl_WrongNumArgs(interp, 1, objv, "name");
|
||||
@@ -1364,7 +1371,7 @@ TclFileReadLinkCmd(
|
||||
|
||||
int
|
||||
TclFileTemporaryCmd(
|
||||
ClientData clientData,
|
||||
ClientData dummy,
|
||||
Tcl_Interp *interp,
|
||||
int objc,
|
||||
Tcl_Obj *const objv[])
|
||||
@@ -1378,6 +1385,7 @@ TclFileTemporaryCmd(
|
||||
/* Pieces of template. Each piece is NULL if
|
||||
* it is omitted. The platform temporary file
|
||||
* engine might ignore some pieces. */
|
||||
(void)dummy;
|
||||
|
||||
if (objc < 1 || objc > 3) {
|
||||
Tcl_WrongNumArgs(interp, 1, objv, "?nameVar? ?template?");
|
||||
@@ -1523,7 +1531,7 @@ TclFileTemporaryCmd(
|
||||
|
||||
int
|
||||
TclFileTempDirCmd(
|
||||
ClientData clientData,
|
||||
ClientData dummy,
|
||||
Tcl_Interp *interp,
|
||||
int objc,
|
||||
Tcl_Obj *const objv[])
|
||||
@@ -1534,6 +1542,7 @@ TclFileTempDirCmd(
|
||||
/* Pieces of template. Each piece is NULL if
|
||||
* it is omitted. The platform temporary file
|
||||
* engine might ignore some pieces. */
|
||||
(void)dummy;
|
||||
|
||||
if (objc < 1 || objc > 2) {
|
||||
Tcl_WrongNumArgs(interp, 1, objv, "?template?");
|
||||
|
||||
@@ -587,7 +587,7 @@ Tcl_SplitPath(
|
||||
* plus the argv pointers and the terminating NULL pointer.
|
||||
*/
|
||||
|
||||
*argvPtr = ckalloc((((*argcPtr) + 1) * sizeof(char *)) + size);
|
||||
*argvPtr = (const char **)ckalloc((((*argcPtr) + 1) * sizeof(char *)) + size);
|
||||
|
||||
/*
|
||||
* Position p after the last argv pointer and copy the contents of the
|
||||
@@ -821,7 +821,7 @@ Tcl_FSJoinToPath(
|
||||
return TclJoinPath(2, pair, 0);
|
||||
} else {
|
||||
int elemc = objc + 1;
|
||||
Tcl_Obj *ret, **elemv = ckalloc(elemc*sizeof(Tcl_Obj *));
|
||||
Tcl_Obj *ret, **elemv = (Tcl_Obj**)ckalloc(elemc*sizeof(Tcl_Obj *));
|
||||
|
||||
elemv[0] = pathPtr;
|
||||
memcpy(elemv+1, objv, objc*sizeof(Tcl_Obj *));
|
||||
@@ -1241,6 +1241,7 @@ Tcl_GlobObjCmd(
|
||||
};
|
||||
enum pathDirOptions {PATH_NONE = -1 , PATH_GENERAL = 0, PATH_DIR = 1};
|
||||
Tcl_GlobTypeData *globTypes = NULL;
|
||||
(void)dummy;
|
||||
|
||||
globFlags = 0;
|
||||
join = 0;
|
||||
@@ -1449,7 +1450,7 @@ Tcl_GlobObjCmd(
|
||||
if (length <= 0) {
|
||||
goto skipTypes;
|
||||
}
|
||||
globTypes = TclStackAlloc(interp, sizeof(Tcl_GlobTypeData));
|
||||
globTypes = (Tcl_GlobTypeData *)TclStackAlloc(interp, sizeof(Tcl_GlobTypeData));
|
||||
globTypes->type = 0;
|
||||
globTypes->perm = 0;
|
||||
globTypes->macType = NULL;
|
||||
@@ -1680,9 +1681,8 @@ Tcl_GlobObjCmd(
|
||||
*
|
||||
* TclGlob --
|
||||
*
|
||||
* This procedure prepares arguments for the DoGlob call. It sets the
|
||||
* separator string based on the platform, performs * tilde substitution,
|
||||
* and calls DoGlob.
|
||||
* Sets the separator string based on the platform, performs tilde
|
||||
* substitution, and calls DoGlob.
|
||||
*
|
||||
* The interpreter's result, on entry to this function, must be a valid
|
||||
* Tcl list (e.g. it could be empty), since we will lappend any new
|
||||
@@ -2523,7 +2523,7 @@ DoGlob(
|
||||
Tcl_StatBuf *
|
||||
Tcl_AllocStatBuf(void)
|
||||
{
|
||||
return ckalloc(sizeof(Tcl_StatBuf));
|
||||
return (Tcl_StatBuf *)ckalloc(sizeof(Tcl_StatBuf));
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -2641,6 +2641,7 @@ Tcl_GetBlockSizeFromStat(
|
||||
#ifdef HAVE_STRUCT_STAT_ST_BLKSIZE
|
||||
return statPtr->st_blksize;
|
||||
#else
|
||||
(void)statPtr;
|
||||
/*
|
||||
* Not a great guess, but will do...
|
||||
*/
|
||||
|
||||
@@ -960,7 +960,7 @@ TclDatelex(
|
||||
|
||||
int
|
||||
TclClockOldscanObjCmd(
|
||||
void *clientData, /* Unused */
|
||||
void *dummy, /* Unused */
|
||||
Tcl_Interp *interp, /* Tcl interpreter */
|
||||
int objc, /* Count of paraneters */
|
||||
Tcl_Obj *const *objv) /* Parameters */
|
||||
@@ -970,6 +970,7 @@ TclClockOldscanObjCmd(
|
||||
DateInfo dateInfo;
|
||||
DateInfo* info = &dateInfo;
|
||||
int status;
|
||||
(void)dummy;
|
||||
|
||||
if (objc != 5) {
|
||||
Tcl_WrongNumArgs(interp, 1, objv,
|
||||
@@ -1074,7 +1075,7 @@ TclClockOldscanObjCmd(
|
||||
|
||||
if (yyHaveTime) {
|
||||
Tcl_ListObjAppendElement(interp, result, Tcl_NewIntObj((int)
|
||||
ToSeconds(yyHour, yyMinutes, yySeconds, yyMeridian)));
|
||||
ToSeconds(yyHour, yyMinutes, yySeconds, (MERIDIAN)yyMeridian)));
|
||||
} else {
|
||||
Tcl_ListObjAppendElement(interp, result, Tcl_NewObj());
|
||||
}
|
||||
|
||||
+20
-13
@@ -219,7 +219,7 @@ Tcl_FindHashEntry(
|
||||
Tcl_HashTable *tablePtr, /* Table in which to lookup entry. */
|
||||
const void *key) /* Key to use to find matching entry. */
|
||||
{
|
||||
return (*((tablePtr)->findProc))(tablePtr, key);
|
||||
return (*((tablePtr)->findProc))(tablePtr, (const char *)key);
|
||||
}
|
||||
|
||||
static Tcl_HashEntry *
|
||||
@@ -260,7 +260,7 @@ Tcl_CreateHashEntry(
|
||||
int *newPtr) /* Store info here telling whether a new entry
|
||||
* was created. */
|
||||
{
|
||||
return (*((tablePtr)->createProc))(tablePtr, key, newPtr);
|
||||
return (*((tablePtr)->createProc))(tablePtr, (const char *)key, newPtr);
|
||||
}
|
||||
|
||||
static Tcl_HashEntry *
|
||||
@@ -348,7 +348,7 @@ CreateHashEntry(
|
||||
if (typePtr->allocEntryProc) {
|
||||
hPtr = typePtr->allocEntryProc(tablePtr, (void *) key);
|
||||
} else {
|
||||
hPtr = ckalloc(sizeof(Tcl_HashEntry));
|
||||
hPtr = (Tcl_HashEntry *)ckalloc(sizeof(Tcl_HashEntry));
|
||||
hPtr->key.oneWordValue = (char *) key;
|
||||
hPtr->clientData = 0;
|
||||
}
|
||||
@@ -648,7 +648,7 @@ Tcl_HashStats(
|
||||
* Print out the histogram and a few other pieces of information.
|
||||
*/
|
||||
|
||||
result = ckalloc((NUM_COUNTERS * 60) + 300);
|
||||
result = (char *)ckalloc((NUM_COUNTERS * 60) + 300);
|
||||
sprintf(result, "%d entries in table, %d buckets\n",
|
||||
tablePtr->numEntries, tablePtr->numBuckets);
|
||||
p = result + strlen(result);
|
||||
@@ -697,7 +697,7 @@ AllocArrayEntry(
|
||||
if (size < sizeof(Tcl_HashEntry)) {
|
||||
size = sizeof(Tcl_HashEntry);
|
||||
}
|
||||
hPtr = ckalloc(size);
|
||||
hPtr = (Tcl_HashEntry *)ckalloc(size);
|
||||
|
||||
for (iPtr1 = array, iPtr2 = hPtr->key.words;
|
||||
count > 0; count--, iPtr1++, iPtr2++) {
|
||||
@@ -770,14 +770,14 @@ HashArrayKey(
|
||||
void *keyPtr) /* Key from which to compute hash value. */
|
||||
{
|
||||
const int *array = (const int *) keyPtr;
|
||||
unsigned int result;
|
||||
TCL_HASH_TYPE result;
|
||||
int count;
|
||||
|
||||
for (result = 0, count = tablePtr->keyType; count > 0;
|
||||
count--, array++) {
|
||||
result += *array;
|
||||
}
|
||||
return (TCL_HASH_TYPE) result;
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -803,13 +803,14 @@ AllocStringEntry(
|
||||
{
|
||||
const char *string = (const char *) keyPtr;
|
||||
Tcl_HashEntry *hPtr;
|
||||
unsigned int size, allocsize;
|
||||
size_t size, allocsize;
|
||||
(void)tablePtr;
|
||||
|
||||
allocsize = size = strlen(string) + 1;
|
||||
if (size < sizeof(hPtr->key)) {
|
||||
allocsize = sizeof(hPtr->key);
|
||||
}
|
||||
hPtr = ckalloc(offsetof(Tcl_HashEntry, key) + allocsize);
|
||||
hPtr = (Tcl_HashEntry *)ckalloc(offsetof(Tcl_HashEntry, key) + allocsize);
|
||||
memset(hPtr, 0, sizeof(Tcl_HashEntry) + allocsize - sizeof(hPtr->key));
|
||||
memcpy(hPtr->key.string, string, size);
|
||||
hPtr->clientData = 0;
|
||||
@@ -866,9 +867,10 @@ HashStringKey(
|
||||
Tcl_HashTable *tablePtr, /* Hash table. */
|
||||
void *keyPtr) /* Key from which to compute hash value. */
|
||||
{
|
||||
const char *string = keyPtr;
|
||||
unsigned int result;
|
||||
const char *string = (const char *)keyPtr;
|
||||
TCL_HASH_TYPE result;
|
||||
char c;
|
||||
(void)tablePtr;
|
||||
|
||||
/*
|
||||
* I tried a zillion different hash functions and asked many other people
|
||||
@@ -907,7 +909,7 @@ HashStringKey(
|
||||
result += (result << 3) + UCHAR(c);
|
||||
}
|
||||
}
|
||||
return (TCL_HASH_TYPE) result;
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -933,6 +935,8 @@ BogusFind(
|
||||
Tcl_HashTable *tablePtr, /* Table in which to lookup entry. */
|
||||
const char *key) /* Key to use to find matching entry. */
|
||||
{
|
||||
(void)tablePtr;
|
||||
(void)key;
|
||||
Tcl_Panic("called %s on deleted table", "Tcl_FindHashEntry");
|
||||
return NULL;
|
||||
}
|
||||
@@ -963,6 +967,9 @@ BogusCreate(
|
||||
int *newPtr) /* Store info here telling whether a new entry
|
||||
* was created. */
|
||||
{
|
||||
(void)tablePtr;
|
||||
(void)key;
|
||||
(void)newPtr;
|
||||
Tcl_Panic("called %s on deleted table", "Tcl_CreateHashEntry");
|
||||
return NULL;
|
||||
}
|
||||
@@ -1023,7 +1030,7 @@ RebuildTable(
|
||||
tablePtr->numBuckets * sizeof(Tcl_HashEntry *), 0);
|
||||
} else {
|
||||
tablePtr->buckets =
|
||||
ckalloc(tablePtr->numBuckets * sizeof(Tcl_HashEntry *));
|
||||
(Tcl_HashEntry **)ckalloc(tablePtr->numBuckets * sizeof(Tcl_HashEntry *));
|
||||
}
|
||||
for (count = tablePtr->numBuckets, newChainPtr = tablePtr->buckets;
|
||||
count > 0; count--, newChainPtr++) {
|
||||
|
||||
@@ -130,14 +130,14 @@ Tcl_RecordAndEvalObj(
|
||||
int result, call = 1;
|
||||
Tcl_CmdInfo info;
|
||||
HistoryObjs *histObjsPtr =
|
||||
Tcl_GetAssocData(interp, HISTORY_OBJS_KEY, NULL);
|
||||
(HistoryObjs *)Tcl_GetAssocData(interp, HISTORY_OBJS_KEY, NULL);
|
||||
|
||||
/*
|
||||
* Create the references to the [::history add] command if necessary.
|
||||
*/
|
||||
|
||||
if (histObjsPtr == NULL) {
|
||||
histObjsPtr = ckalloc(sizeof(HistoryObjs));
|
||||
histObjsPtr = (HistoryObjs *)ckalloc(sizeof(HistoryObjs));
|
||||
TclNewLiteralStringObj(histObjsPtr->historyObj, "::history");
|
||||
TclNewLiteralStringObj(histObjsPtr->addObj, "add");
|
||||
Tcl_IncrRefCount(histObjsPtr->historyObj);
|
||||
@@ -211,9 +211,10 @@ Tcl_RecordAndEvalObj(
|
||||
static void
|
||||
DeleteHistoryObjs(
|
||||
ClientData clientData,
|
||||
Tcl_Interp *interp)
|
||||
Tcl_Interp *dummy)
|
||||
{
|
||||
HistoryObjs *histObjsPtr = clientData;
|
||||
HistoryObjs *histObjsPtr = (HistoryObjs *)clientData;
|
||||
(void)dummy;
|
||||
|
||||
TclDecrRefCount(histObjsPtr->historyObj);
|
||||
TclDecrRefCount(histObjsPtr->addObj);
|
||||
|
||||
+70
-105
@@ -200,12 +200,10 @@ static int FilterInputBytes(Channel *chanPtr,
|
||||
static int FlushChannel(Tcl_Interp *interp, Channel *chanPtr,
|
||||
int calledFromAsyncFlush);
|
||||
static int TclGetsObjBinary(Tcl_Channel chan, Tcl_Obj *objPtr);
|
||||
static Tcl_Encoding GetBinaryEncoding();
|
||||
static Tcl_Encoding GetBinaryEncoding(void);
|
||||
static void FreeBinaryEncoding(ClientData clientData);
|
||||
static Tcl_HashTable * GetChannelTable(Tcl_Interp *interp);
|
||||
static int GetInput(Channel *chanPtr);
|
||||
static int HaveVersion(const Tcl_ChannelType *typePtr,
|
||||
Tcl_ChannelTypeVersion minimumVersion);
|
||||
static void PeekAhead(Channel *chanPtr, char **dstEndPtr,
|
||||
GetsState *gsPtr);
|
||||
static int ReadBytes(ChannelState *statePtr, Tcl_Obj *objPtr,
|
||||
@@ -350,7 +348,7 @@ static const Tcl_ObjType chanObjType = {
|
||||
do { \
|
||||
const Tcl_ObjIntRep *irPtr; \
|
||||
irPtr = TclFetchIntRep((objPtr), &chanObjType); \
|
||||
(resPtr) = irPtr ? irPtr->twoPtrValue.ptr1 : NULL; \
|
||||
(resPtr) = irPtr ? (ResolvedChanName *)irPtr->twoPtrValue.ptr1 : NULL; \
|
||||
} while (0)
|
||||
|
||||
#define BUSY_STATE(st, fl) \
|
||||
@@ -492,9 +490,8 @@ ChanSeek(
|
||||
* type and non-NULL.
|
||||
*/
|
||||
|
||||
if (HaveVersion(chanPtr->typePtr, TCL_CHANNEL_VERSION_3) &&
|
||||
chanPtr->typePtr->wideSeekProc != NULL) {
|
||||
return chanPtr->typePtr->wideSeekProc(chanPtr->instanceData,
|
||||
if (Tcl_ChannelWideSeekProc(chanPtr->typePtr) != NULL) {
|
||||
return Tcl_ChannelWideSeekProc(chanPtr->typePtr)(chanPtr->instanceData,
|
||||
offset, mode, errnoPtr);
|
||||
}
|
||||
|
||||
@@ -503,7 +500,7 @@ ChanSeek(
|
||||
return -1;
|
||||
}
|
||||
|
||||
return chanPtr->typePtr->seekProc(chanPtr->instanceData,
|
||||
return Tcl_ChannelSeekProc(chanPtr->typePtr)(chanPtr->instanceData,
|
||||
offset, mode, errnoPtr);
|
||||
}
|
||||
|
||||
@@ -860,7 +857,7 @@ Tcl_CreateCloseHandler(
|
||||
ChannelState *statePtr = ((Channel *) chan)->state;
|
||||
CloseCallback *cbPtr;
|
||||
|
||||
cbPtr = ckalloc(sizeof(CloseCallback));
|
||||
cbPtr = (CloseCallback *)ckalloc(sizeof(CloseCallback));
|
||||
cbPtr->proc = proc;
|
||||
cbPtr->clientData = clientData;
|
||||
|
||||
@@ -939,9 +936,9 @@ GetChannelTable(
|
||||
Tcl_HashTable *hTblPtr; /* Hash table of channels. */
|
||||
Tcl_Channel stdinChan, stdoutChan, stderrChan;
|
||||
|
||||
hTblPtr = Tcl_GetAssocData(interp, "tclIO", NULL);
|
||||
hTblPtr = (Tcl_HashTable *)Tcl_GetAssocData(interp, "tclIO", NULL);
|
||||
if (hTblPtr == NULL) {
|
||||
hTblPtr = ckalloc(sizeof(Tcl_HashTable));
|
||||
hTblPtr = (Tcl_HashTable *)ckalloc(sizeof(Tcl_HashTable));
|
||||
Tcl_InitHashTable(hTblPtr, TCL_STRING_KEYS);
|
||||
Tcl_SetAssocData(interp, "tclIO",
|
||||
(Tcl_InterpDeleteProc *) DeleteChannelTable, hTblPtr);
|
||||
@@ -1009,10 +1006,10 @@ DeleteChannelTable(
|
||||
* refcount reaches zero.
|
||||
*/
|
||||
|
||||
hTblPtr = clientData;
|
||||
hTblPtr = (Tcl_HashTable *)clientData;
|
||||
for (hPtr = Tcl_FirstHashEntry(hTblPtr, &hSearch); hPtr != NULL;
|
||||
hPtr = Tcl_FirstHashEntry(hTblPtr, &hSearch)) {
|
||||
chanPtr = Tcl_GetHashValue(hPtr);
|
||||
chanPtr = (Channel *)Tcl_GetHashValue(hPtr);
|
||||
statePtr = chanPtr->state;
|
||||
|
||||
/*
|
||||
@@ -1379,7 +1376,7 @@ DetachChannel(
|
||||
statePtr = chanPtr->state;
|
||||
|
||||
if (interp != NULL) {
|
||||
hTblPtr = Tcl_GetAssocData(interp, "tclIO", NULL);
|
||||
hTblPtr = (Tcl_HashTable *)Tcl_GetAssocData(interp, "tclIO", NULL);
|
||||
if (hTblPtr == NULL) {
|
||||
return TCL_ERROR;
|
||||
}
|
||||
@@ -1482,7 +1479,7 @@ Tcl_GetChannel(
|
||||
* compensate where necessary to retrieve the topmost channel again.
|
||||
*/
|
||||
|
||||
chanPtr = Tcl_GetHashValue(hPtr);
|
||||
chanPtr = (Channel *)Tcl_GetHashValue(hPtr);
|
||||
chanPtr = chanPtr->state->bottomChanPtr;
|
||||
if (modePtr != NULL) {
|
||||
*modePtr = chanPtr->state->flags & (TCL_READABLE|TCL_WRITABLE);
|
||||
@@ -1526,6 +1523,7 @@ TclGetChannelFromObj(
|
||||
ChannelState *statePtr;
|
||||
ResolvedChanName *resPtr = NULL;
|
||||
Tcl_Channel chan;
|
||||
(void)flags;
|
||||
|
||||
if (interp == NULL) {
|
||||
return TCL_ERROR;
|
||||
@@ -1649,8 +1647,8 @@ Tcl_CreateChannel(
|
||||
* assignments to 0/NULL below.
|
||||
*/
|
||||
|
||||
chanPtr = ckalloc(sizeof(Channel));
|
||||
statePtr = ckalloc(sizeof(ChannelState));
|
||||
chanPtr = (Channel *)ckalloc(sizeof(Channel));
|
||||
statePtr = (ChannelState *)ckalloc(sizeof(ChannelState));
|
||||
chanPtr->state = statePtr;
|
||||
|
||||
chanPtr->instanceData = instanceData;
|
||||
@@ -1669,10 +1667,10 @@ Tcl_CreateChannel(
|
||||
* later.
|
||||
*/
|
||||
|
||||
tmp = ckalloc((len < 7) ? 7 : len);
|
||||
tmp = (char *)ckalloc((len < 7) ? 7 : len);
|
||||
strcpy(tmp, chanName);
|
||||
} else {
|
||||
tmp = ckalloc(7);
|
||||
tmp = (char *)ckalloc(7);
|
||||
tmp[0] = '\0';
|
||||
}
|
||||
statePtr->channelName = tmp;
|
||||
@@ -1945,7 +1943,7 @@ Tcl_StackChannel(
|
||||
statePtr->inQueueTail = NULL;
|
||||
}
|
||||
|
||||
chanPtr = ckalloc(sizeof(Channel));
|
||||
chanPtr = (Channel *)ckalloc(sizeof(Channel));
|
||||
|
||||
/*
|
||||
* Save some of the current state into the new structure, reinitialize the
|
||||
@@ -2474,7 +2472,7 @@ AllocChannelBuffer(
|
||||
int n;
|
||||
|
||||
n = length + CHANNELBUFFER_HEADER_SIZE + BUFFER_PADDING + BUFFER_PADDING;
|
||||
bufPtr = ckalloc(n);
|
||||
bufPtr = (ChannelBuffer *)ckalloc(n);
|
||||
bufPtr->nextAdded = BUFFER_PADDING;
|
||||
bufPtr->nextRemoved = BUFFER_PADDING;
|
||||
bufPtr->bufLength = length + BUFFER_PADDING;
|
||||
@@ -2927,7 +2925,7 @@ FlushChannel(
|
||||
* there is some kind failure in the writable event machinery.
|
||||
*
|
||||
* The tls extension indeed suffers from flaws in its channel
|
||||
* event mgmt. See http://core.tcl.tk/tcl/info/c31ca233ca.
|
||||
* event mgmt. See https://core.tcl-lang.org/tcl/info/c31ca233ca.
|
||||
* Until that patch is broadly distributed, disable the
|
||||
* assertion checking here, so that programs using Tcl and
|
||||
* tls can be debugged.
|
||||
@@ -4215,7 +4213,7 @@ WillWrite(
|
||||
{
|
||||
int inputBuffered;
|
||||
|
||||
if ((chanPtr->typePtr->seekProc != NULL) &&
|
||||
if ((Tcl_ChannelSeekProc(chanPtr->typePtr) != NULL) &&
|
||||
((inputBuffered = Tcl_InputBuffered((Tcl_Channel) chanPtr)) > 0)){
|
||||
int ignore;
|
||||
|
||||
@@ -4237,7 +4235,7 @@ WillRead(
|
||||
Tcl_SetErrno(EINVAL);
|
||||
return -1;
|
||||
}
|
||||
if ((chanPtr->typePtr->seekProc != NULL)
|
||||
if ((Tcl_ChannelSeekProc(chanPtr->typePtr) != NULL)
|
||||
&& (Tcl_OutputBuffered((Tcl_Channel) chanPtr) > 0)) {
|
||||
/*
|
||||
* CAVEAT - The assumption here is that FlushChannel() will push out
|
||||
@@ -4301,7 +4299,7 @@ Write(
|
||||
|
||||
if (GotFlag(statePtr, CHANNEL_LINEBUFFERED)
|
||||
|| (statePtr->outputTranslation != TCL_TRANSLATE_LF)) {
|
||||
nextNewLine = memchr(src, '\n', srcLen);
|
||||
nextNewLine = (char *)memchr(src, '\n', srcLen);
|
||||
}
|
||||
|
||||
while (srcLen + saved + endEncoding > 0) {
|
||||
@@ -4399,7 +4397,7 @@ Write(
|
||||
total += dstWrote;
|
||||
dst += dstWrote;
|
||||
dstLen -= dstWrote;
|
||||
nextNewLine = memchr(src, '\n', srcLen);
|
||||
nextNewLine = (char *)memchr(src, '\n', srcLen);
|
||||
needNlFlush = 1;
|
||||
}
|
||||
|
||||
@@ -4712,14 +4710,14 @@ Tcl_GetsObj(
|
||||
* Skip the raw bytes that make up the '\n'.
|
||||
*/
|
||||
|
||||
char tmp[TCL_UTF_MAX];
|
||||
int rawRead;
|
||||
char tmp[TCL_UTF_MAX];
|
||||
|
||||
bufPtr = gs.bufPtr;
|
||||
Tcl_ExternalToUtf(NULL, gs.encoding, RemovePoint(bufPtr),
|
||||
gs.rawRead, statePtr->inputEncodingFlags
|
||||
| TCL_ENCODING_NO_TERMINATE, &gs.state, tmp,
|
||||
TCL_UTF_MAX, &rawRead, NULL, NULL);
|
||||
sizeof(tmp), &rawRead, NULL, NULL);
|
||||
bufPtr->nextRemoved += rawRead;
|
||||
gs.rawRead -= rawRead;
|
||||
gs.bytesWrote--;
|
||||
@@ -5201,6 +5199,7 @@ FreeBinaryEncoding(
|
||||
ClientData dummy) /* Not used */
|
||||
{
|
||||
ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey);
|
||||
(void)dummy;
|
||||
|
||||
if (tsdPtr->binaryEncoding != NULL) {
|
||||
Tcl_FreeEncoding(tsdPtr->binaryEncoding);
|
||||
@@ -6265,8 +6264,8 @@ ReadChars(
|
||||
*/
|
||||
|
||||
if (code != TCL_OK) {
|
||||
char buffer[TCL_UTF_MAX + 1];
|
||||
int read, decoded, count;
|
||||
char buffer[TCL_UTF_MAX + 1];
|
||||
|
||||
/*
|
||||
* Didn't get everything the buffer could offer
|
||||
@@ -6282,7 +6281,7 @@ ReadChars(
|
||||
|
||||
Tcl_ExternalToUtf(NULL, encoding, src, srcLen,
|
||||
(statePtr->inputEncodingFlags | TCL_ENCODING_NO_TERMINATE),
|
||||
&statePtr->inputEncodingState, buffer, TCL_UTF_MAX + 1,
|
||||
&statePtr->inputEncodingState, buffer, sizeof(buffer),
|
||||
&read, &decoded, &count);
|
||||
|
||||
if (count == 2) {
|
||||
@@ -6506,7 +6505,7 @@ TranslateInputEOL(
|
||||
* created by the presence of the input eof char.
|
||||
*/
|
||||
|
||||
if ((eof = memchr(srcStart, inEofChar, srcLen))) {
|
||||
if ((eof = (const char *)memchr(srcStart, inEofChar, srcLen))) {
|
||||
srcLen = eof - srcStart;
|
||||
}
|
||||
}
|
||||
@@ -6521,7 +6520,7 @@ TranslateInputEOL(
|
||||
char *dst = dstStart;
|
||||
char *dstEnd = dstStart + srcLen;
|
||||
|
||||
while ((dst = memchr(dst, '\r', dstEnd - dst))) {
|
||||
while ((dst = (char *)memchr(dst, '\r', dstEnd - dst))) {
|
||||
*dst++ = '\n';
|
||||
}
|
||||
}
|
||||
@@ -6532,7 +6531,7 @@ TranslateInputEOL(
|
||||
char *dst = dstStart;
|
||||
int lesser = (dstLen < srcLen) ? dstLen : srcLen;
|
||||
|
||||
while ((crFound = memchr(src, '\r', lesser))) {
|
||||
while ((crFound = (const char *)memchr(src, '\r', lesser))) {
|
||||
int numBytes = crFound - src;
|
||||
memmove(dst, src, numBytes);
|
||||
|
||||
@@ -6572,7 +6571,7 @@ TranslateInputEOL(
|
||||
ResetFlag(statePtr, INPUT_SAW_CR);
|
||||
}
|
||||
lesser = (dstLen < srcLen) ? dstLen : srcLen;
|
||||
while ((crFound = memchr(src, '\r', lesser))) {
|
||||
while ((crFound = (const char *)memchr(src, '\r', lesser))) {
|
||||
int numBytes = crFound - src;
|
||||
memmove(dst, src, numBytes);
|
||||
|
||||
@@ -6997,7 +6996,7 @@ Tcl_Seek(
|
||||
* defined. This means that the channel does not support seeking.
|
||||
*/
|
||||
|
||||
if (chanPtr->typePtr->seekProc == NULL) {
|
||||
if (Tcl_ChannelSeekProc(chanPtr->typePtr) == NULL) {
|
||||
Tcl_SetErrno(EINVAL);
|
||||
return -1;
|
||||
}
|
||||
@@ -7161,7 +7160,7 @@ Tcl_Tell(
|
||||
* defined. This means that the channel does not support seeking.
|
||||
*/
|
||||
|
||||
if (chanPtr->typePtr->seekProc == NULL) {
|
||||
if (Tcl_ChannelSeekProc(chanPtr->typePtr) == NULL) {
|
||||
Tcl_SetErrno(EINVAL);
|
||||
return -1;
|
||||
}
|
||||
@@ -8544,7 +8543,7 @@ static void
|
||||
ChannelTimerProc(
|
||||
ClientData clientData)
|
||||
{
|
||||
Channel *chanPtr = clientData;
|
||||
Channel *chanPtr = (Channel *)clientData;
|
||||
ChannelState *statePtr = chanPtr->state;
|
||||
/* State info for channel */
|
||||
|
||||
@@ -8632,7 +8631,7 @@ Tcl_CreateChannelHandler(
|
||||
}
|
||||
}
|
||||
if (chPtr == NULL) {
|
||||
chPtr = ckalloc(sizeof(ChannelHandler));
|
||||
chPtr = (ChannelHandler *)ckalloc(sizeof(ChannelHandler));
|
||||
chPtr->mask = 0;
|
||||
chPtr->proc = proc;
|
||||
chPtr->clientData = clientData;
|
||||
@@ -8844,7 +8843,7 @@ CreateScriptRecord(
|
||||
makeCH = (esPtr == NULL);
|
||||
|
||||
if (makeCH) {
|
||||
esPtr = ckalloc(sizeof(EventScriptRecord));
|
||||
esPtr = (EventScriptRecord *)ckalloc(sizeof(EventScriptRecord));
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -8900,7 +8899,7 @@ TclChannelEventScriptInvoker(
|
||||
* in. */
|
||||
int result; /* Result of call to eval script. */
|
||||
|
||||
esPtr = clientData;
|
||||
esPtr = (EventScriptRecord *)clientData;
|
||||
chanPtr = esPtr->chanPtr;
|
||||
mask = esPtr->mask;
|
||||
interp = esPtr->interp;
|
||||
@@ -8955,7 +8954,7 @@ TclChannelEventScriptInvoker(
|
||||
/* ARGSUSED */
|
||||
int
|
||||
Tcl_FileEventObjCmd(
|
||||
ClientData clientData, /* Not used. */
|
||||
ClientData dummy, /* Not used. */
|
||||
Tcl_Interp *interp, /* Interpreter in which the channel for which
|
||||
* to create the handler is found. */
|
||||
int objc, /* Number of arguments. */
|
||||
@@ -8969,6 +8968,7 @@ Tcl_FileEventObjCmd(
|
||||
int mask;
|
||||
static const char *const modeOptions[] = {"readable", "writable", NULL};
|
||||
static const int maskArray[] = {TCL_READABLE, TCL_WRITABLE};
|
||||
(void)dummy;
|
||||
|
||||
if ((objc != 3) && (objc != 4)) {
|
||||
Tcl_WrongNumArgs(interp, 1, objv, "channelId event ?script?");
|
||||
@@ -9054,7 +9054,7 @@ ZeroTransferTimerProc(
|
||||
/* calling CopyData with mask==0 still implies immediate invocation of the
|
||||
* -command callback, and completion of the fcopy.
|
||||
*/
|
||||
CopyData(clientData, 0);
|
||||
CopyData((CopyState *)clientData, 0);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -9174,7 +9174,7 @@ TclCopyChannel(
|
||||
* completed.
|
||||
*/
|
||||
|
||||
csPtr = ckalloc(sizeof(CopyState) + !moveBytes * inStatePtr->bufSize);
|
||||
csPtr = (CopyState *)ckalloc(sizeof(CopyState) + !moveBytes * inStatePtr->bufSize);
|
||||
csPtr->bufSize = !moveBytes * inStatePtr->bufSize;
|
||||
csPtr->readPtr = inPtr;
|
||||
csPtr->writePtr = outPtr;
|
||||
@@ -10032,7 +10032,7 @@ CopyEventProc(
|
||||
ClientData clientData,
|
||||
int mask)
|
||||
{
|
||||
(void) CopyData(clientData, mask);
|
||||
(void) CopyData((CopyState *)clientData, mask);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -10365,7 +10365,7 @@ Tcl_IsChannelRegistered(
|
||||
chanPtr = ((Channel *) chan)->state->bottomChanPtr;
|
||||
statePtr = chanPtr->state;
|
||||
|
||||
hTblPtr = Tcl_GetAssocData(interp, "tclIO", NULL);
|
||||
hTblPtr = (Tcl_HashTable *)Tcl_GetAssocData(interp, "tclIO", NULL);
|
||||
if (hTblPtr == NULL) {
|
||||
return 0;
|
||||
}
|
||||
@@ -10499,49 +10499,15 @@ Tcl_ChannelVersion(
|
||||
const Tcl_ChannelType *chanTypePtr)
|
||||
/* Pointer to channel type. */
|
||||
{
|
||||
if (chanTypePtr->version == TCL_CHANNEL_VERSION_2) {
|
||||
return TCL_CHANNEL_VERSION_2;
|
||||
} else if (chanTypePtr->version == TCL_CHANNEL_VERSION_3) {
|
||||
return TCL_CHANNEL_VERSION_3;
|
||||
} else if (chanTypePtr->version == TCL_CHANNEL_VERSION_4) {
|
||||
return TCL_CHANNEL_VERSION_4;
|
||||
} else if (chanTypePtr->version == TCL_CHANNEL_VERSION_5) {
|
||||
return TCL_CHANNEL_VERSION_5;
|
||||
} else {
|
||||
if ((chanTypePtr->version < TCL_CHANNEL_VERSION_2)
|
||||
|| (chanTypePtr->version > TCL_CHANNEL_VERSION_5)) {
|
||||
/*
|
||||
* In <v2 channel versions, the version field is occupied by the
|
||||
* Tcl_DriverBlockModeProc
|
||||
*/
|
||||
|
||||
return TCL_CHANNEL_VERSION_1;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
* HaveVersion --
|
||||
*
|
||||
* Return whether a channel type is (at least) of a given version.
|
||||
*
|
||||
* Results:
|
||||
* True if the minimum version is exceeded by the version actually
|
||||
* present.
|
||||
*
|
||||
* Side effects:
|
||||
* None.
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
static int
|
||||
HaveVersion(
|
||||
const Tcl_ChannelType *chanTypePtr,
|
||||
Tcl_ChannelTypeVersion minimumVersion)
|
||||
{
|
||||
Tcl_ChannelTypeVersion actualVersion = Tcl_ChannelVersion(chanTypePtr);
|
||||
|
||||
return (PTR2INT(actualVersion)) >= (PTR2INT(minimumVersion));
|
||||
return chanTypePtr->version;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -10564,15 +10530,14 @@ Tcl_ChannelBlockModeProc(
|
||||
const Tcl_ChannelType *chanTypePtr)
|
||||
/* Pointer to channel type. */
|
||||
{
|
||||
if (HaveVersion(chanTypePtr, TCL_CHANNEL_VERSION_2)) {
|
||||
return chanTypePtr->blockModeProc;
|
||||
if (Tcl_ChannelVersion(chanTypePtr) < TCL_CHANNEL_VERSION_2) {
|
||||
/*
|
||||
* The v1 structure had the blockModeProc in a different place.
|
||||
*/
|
||||
return (Tcl_DriverBlockModeProc *) chanTypePtr->version;
|
||||
}
|
||||
|
||||
/*
|
||||
* The v1 structure had the blockModeProc in a different place.
|
||||
*/
|
||||
|
||||
return (Tcl_DriverBlockModeProc *) chanTypePtr->version;
|
||||
return chanTypePtr->blockModeProc;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -10812,10 +10777,10 @@ Tcl_ChannelFlushProc(
|
||||
const Tcl_ChannelType *chanTypePtr)
|
||||
/* Pointer to channel type. */
|
||||
{
|
||||
if (HaveVersion(chanTypePtr, TCL_CHANNEL_VERSION_2)) {
|
||||
return chanTypePtr->flushProc;
|
||||
if (Tcl_ChannelVersion(chanTypePtr) < TCL_CHANNEL_VERSION_2) {
|
||||
return NULL;
|
||||
}
|
||||
return NULL;
|
||||
return chanTypePtr->flushProc;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -10839,10 +10804,10 @@ Tcl_ChannelHandlerProc(
|
||||
const Tcl_ChannelType *chanTypePtr)
|
||||
/* Pointer to channel type. */
|
||||
{
|
||||
if (HaveVersion(chanTypePtr, TCL_CHANNEL_VERSION_2)) {
|
||||
return chanTypePtr->handlerProc;
|
||||
if (Tcl_ChannelVersion(chanTypePtr) < TCL_CHANNEL_VERSION_2) {
|
||||
return NULL;
|
||||
}
|
||||
return NULL;
|
||||
return chanTypePtr->handlerProc;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -10866,10 +10831,10 @@ Tcl_ChannelWideSeekProc(
|
||||
const Tcl_ChannelType *chanTypePtr)
|
||||
/* Pointer to channel type. */
|
||||
{
|
||||
if (HaveVersion(chanTypePtr, TCL_CHANNEL_VERSION_3)) {
|
||||
return chanTypePtr->wideSeekProc;
|
||||
if (Tcl_ChannelVersion(chanTypePtr) < TCL_CHANNEL_VERSION_3) {
|
||||
return NULL;
|
||||
}
|
||||
return NULL;
|
||||
return chanTypePtr->wideSeekProc;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -10894,10 +10859,10 @@ Tcl_ChannelThreadActionProc(
|
||||
const Tcl_ChannelType *chanTypePtr)
|
||||
/* Pointer to channel type. */
|
||||
{
|
||||
if (HaveVersion(chanTypePtr, TCL_CHANNEL_VERSION_4)) {
|
||||
return chanTypePtr->threadActionProc;
|
||||
if (Tcl_ChannelVersion(chanTypePtr) < TCL_CHANNEL_VERSION_4) {
|
||||
return NULL;
|
||||
}
|
||||
return NULL;
|
||||
return chanTypePtr->threadActionProc;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -11074,7 +11039,7 @@ FixLevelCode(
|
||||
lcn += 2;
|
||||
}
|
||||
|
||||
lvn = ckalloc(lcn * sizeof(Tcl_Obj *));
|
||||
lvn = (Tcl_Obj **)ckalloc(lcn * sizeof(Tcl_Obj *));
|
||||
|
||||
/*
|
||||
* New level/code information is spliced into the first occurence of
|
||||
@@ -11209,10 +11174,10 @@ Tcl_ChannelTruncateProc(
|
||||
const Tcl_ChannelType *chanTypePtr)
|
||||
/* Pointer to channel type. */
|
||||
{
|
||||
if (HaveVersion(chanTypePtr, TCL_CHANNEL_VERSION_5)) {
|
||||
return chanTypePtr->truncateProc;
|
||||
if (Tcl_ChannelVersion(chanTypePtr) < TCL_CHANNEL_VERSION_5) {
|
||||
return NULL;
|
||||
}
|
||||
return NULL;
|
||||
return chanTypePtr->truncateProc;
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
+42
-22
@@ -71,9 +71,10 @@ static void UnregisterTcpServerInterpCleanupProc(
|
||||
|
||||
static void
|
||||
FinalizeIOCmdTSD(
|
||||
ClientData clientData) /* Not used. */
|
||||
ClientData dummy) /* Not used. */
|
||||
{
|
||||
ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey);
|
||||
(void)dummy;
|
||||
|
||||
if (tsdPtr->stdoutObjPtr != NULL) {
|
||||
Tcl_DecrRefCount(tsdPtr->stdoutObjPtr);
|
||||
@@ -113,6 +114,7 @@ Tcl_PutsObjCmd(
|
||||
int newline; /* Add a newline at end? */
|
||||
int result; /* Result of puts operation. */
|
||||
int mode; /* Mode in which channel is opened. */
|
||||
(void)dummy;
|
||||
|
||||
switch (objc) {
|
||||
case 2: /* [puts $x] */
|
||||
@@ -237,6 +239,7 @@ Tcl_FlushObjCmd(
|
||||
Tcl_Obj *chanObjPtr;
|
||||
Tcl_Channel chan; /* The channel to flush on. */
|
||||
int mode;
|
||||
(void)dummy;
|
||||
|
||||
if (objc != 2) {
|
||||
Tcl_WrongNumArgs(interp, 1, objv, "channelId");
|
||||
@@ -304,6 +307,7 @@ Tcl_GetsObjCmd(
|
||||
int mode; /* Mode in which channel is opened. */
|
||||
Tcl_Obj *linePtr, *chanObjPtr;
|
||||
int code = TCL_OK;
|
||||
(void)dummy;
|
||||
|
||||
if ((objc != 2) && (objc != 3)) {
|
||||
Tcl_WrongNumArgs(interp, 1, objv, "channelId ?varName?");
|
||||
@@ -390,6 +394,7 @@ Tcl_ReadObjCmd(
|
||||
int charactersRead; /* How many characters were read? */
|
||||
int mode; /* Mode in which channel is opened. */
|
||||
Tcl_Obj *resultPtr, *chanObjPtr;
|
||||
(void)dummy;
|
||||
|
||||
if ((objc != 2) && (objc != 3)) {
|
||||
Interp *iPtr;
|
||||
@@ -523,7 +528,7 @@ Tcl_ReadObjCmd(
|
||||
/* ARGSUSED */
|
||||
int
|
||||
Tcl_SeekObjCmd(
|
||||
ClientData clientData, /* Not used. */
|
||||
ClientData dummy, /* Not used. */
|
||||
Tcl_Interp *interp, /* Current interpreter. */
|
||||
int objc, /* Number of arguments. */
|
||||
Tcl_Obj *const objv[]) /* Argument objects. */
|
||||
@@ -537,6 +542,7 @@ Tcl_SeekObjCmd(
|
||||
"start", "current", "end", NULL
|
||||
};
|
||||
static const int modeArray[] = {SEEK_SET, SEEK_CUR, SEEK_END};
|
||||
(void)dummy;
|
||||
|
||||
if ((objc != 3) && (objc != 4)) {
|
||||
Tcl_WrongNumArgs(interp, 1, objv, "channelId offset ?origin?");
|
||||
@@ -599,7 +605,7 @@ Tcl_SeekObjCmd(
|
||||
/* ARGSUSED */
|
||||
int
|
||||
Tcl_TellObjCmd(
|
||||
ClientData clientData, /* Not used. */
|
||||
ClientData dummy, /* Not used. */
|
||||
Tcl_Interp *interp, /* Current interpreter. */
|
||||
int objc, /* Number of arguments. */
|
||||
Tcl_Obj *const objv[]) /* Argument objects. */
|
||||
@@ -607,6 +613,7 @@ Tcl_TellObjCmd(
|
||||
Tcl_Channel chan; /* The channel to tell on. */
|
||||
Tcl_WideInt newLoc;
|
||||
int code;
|
||||
(void)dummy;
|
||||
|
||||
if (objc != 2) {
|
||||
Tcl_WrongNumArgs(interp, 1, objv, "channelId");
|
||||
@@ -662,7 +669,7 @@ Tcl_TellObjCmd(
|
||||
/* ARGSUSED */
|
||||
int
|
||||
Tcl_CloseObjCmd(
|
||||
ClientData clientData, /* Not used. */
|
||||
ClientData dummy, /* Not used. */
|
||||
Tcl_Interp *interp, /* Current interpreter. */
|
||||
int objc, /* Number of arguments. */
|
||||
Tcl_Obj *const objv[]) /* Argument objects. */
|
||||
@@ -672,6 +679,7 @@ Tcl_CloseObjCmd(
|
||||
"read", "write", NULL
|
||||
};
|
||||
static const int dirArray[] = {TCL_CLOSE_READ, TCL_CLOSE_WRITE};
|
||||
(void)dummy;
|
||||
|
||||
if ((objc != 2) && (objc != 3)) {
|
||||
Tcl_WrongNumArgs(interp, 1, objv, "channelId ?direction?");
|
||||
@@ -711,7 +719,7 @@ Tcl_CloseObjCmd(
|
||||
/*
|
||||
* Special handling is needed if and only if the channel mode supports
|
||||
* more than the direction to close. Because if the close the last
|
||||
* direction suppported we can and will go through the regular
|
||||
* direction supported we can and will go through the regular
|
||||
* process.
|
||||
*/
|
||||
|
||||
@@ -771,7 +779,7 @@ Tcl_CloseObjCmd(
|
||||
/* ARGSUSED */
|
||||
int
|
||||
Tcl_FconfigureObjCmd(
|
||||
ClientData clientData, /* Not used. */
|
||||
ClientData dummy, /* Not used. */
|
||||
Tcl_Interp *interp, /* Current interpreter. */
|
||||
int objc, /* Number of arguments. */
|
||||
Tcl_Obj *const objv[]) /* Argument objects. */
|
||||
@@ -779,6 +787,7 @@ Tcl_FconfigureObjCmd(
|
||||
const char *optionName, *valueName;
|
||||
Tcl_Channel chan; /* The channel to set a mode on. */
|
||||
int i; /* Iterate over arg-value pairs. */
|
||||
(void)dummy;
|
||||
|
||||
if ((objc < 2) || (((objc % 2) == 1) && (objc != 3))) {
|
||||
Tcl_WrongNumArgs(interp, 1, objv, "channelId ?-option value ...?");
|
||||
@@ -847,12 +856,13 @@ Tcl_FconfigureObjCmd(
|
||||
/* ARGSUSED */
|
||||
int
|
||||
Tcl_EofObjCmd(
|
||||
ClientData unused, /* Not used. */
|
||||
ClientData dummy, /* Not used. */
|
||||
Tcl_Interp *interp, /* Current interpreter. */
|
||||
int objc, /* Number of arguments. */
|
||||
Tcl_Obj *const objv[]) /* Argument objects. */
|
||||
{
|
||||
Tcl_Channel chan;
|
||||
(void)dummy;
|
||||
|
||||
if (objc != 2) {
|
||||
Tcl_WrongNumArgs(interp, 1, objv, "channelId");
|
||||
@@ -905,6 +915,7 @@ Tcl_ExecObjCmd(
|
||||
enum options {
|
||||
EXEC_IGNORESTDERR, EXEC_KEEPNEWLINE, EXEC_LAST
|
||||
};
|
||||
(void)dummy;
|
||||
|
||||
/*
|
||||
* Check for any leading option arguments.
|
||||
@@ -952,7 +963,7 @@ Tcl_ExecObjCmd(
|
||||
*/
|
||||
|
||||
argc = objc - skip;
|
||||
argv = TclStackAlloc(interp, (argc + 1) * sizeof(char *));
|
||||
argv = (const char **)TclStackAlloc(interp, (argc + 1) * sizeof(char *));
|
||||
|
||||
/*
|
||||
* Copy the string conversions of each (post option) object into the
|
||||
@@ -1055,13 +1066,14 @@ Tcl_ExecObjCmd(
|
||||
/* ARGSUSED */
|
||||
int
|
||||
Tcl_FblockedObjCmd(
|
||||
ClientData unused, /* Not used. */
|
||||
ClientData dummy, /* Not used. */
|
||||
Tcl_Interp *interp, /* Current interpreter. */
|
||||
int objc, /* Number of arguments. */
|
||||
Tcl_Obj *const objv[]) /* Argument objects. */
|
||||
{
|
||||
Tcl_Channel chan;
|
||||
int mode;
|
||||
(void)dummy;
|
||||
|
||||
if (objc != 2) {
|
||||
Tcl_WrongNumArgs(interp, 1, objv, "channelId");
|
||||
@@ -1102,7 +1114,7 @@ Tcl_FblockedObjCmd(
|
||||
/* ARGSUSED */
|
||||
int
|
||||
Tcl_OpenObjCmd(
|
||||
ClientData notUsed, /* Not used. */
|
||||
ClientData dummy, /* Not used. */
|
||||
Tcl_Interp *interp, /* Current interpreter. */
|
||||
int objc, /* Number of arguments. */
|
||||
Tcl_Obj *const objv[]) /* Argument objects. */
|
||||
@@ -1110,6 +1122,7 @@ Tcl_OpenObjCmd(
|
||||
int pipeline, prot;
|
||||
const char *modeString, *what;
|
||||
Tcl_Channel chan;
|
||||
(void)dummy;
|
||||
|
||||
if ((objc < 2) || (objc > 4)) {
|
||||
Tcl_WrongNumArgs(interp, 1, objv, "fileName ?access? ?permissions?");
|
||||
@@ -1228,15 +1241,16 @@ static void
|
||||
TcpAcceptCallbacksDeleteProc(
|
||||
ClientData clientData, /* Data which was passed when the assocdata
|
||||
* was registered. */
|
||||
Tcl_Interp *interp) /* Interpreter being deleted - not used. */
|
||||
Tcl_Interp *dummy) /* Interpreter being deleted - not used. */
|
||||
{
|
||||
Tcl_HashTable *hTblPtr = clientData;
|
||||
Tcl_HashTable *hTblPtr = (Tcl_HashTable *)clientData;
|
||||
Tcl_HashEntry *hPtr;
|
||||
Tcl_HashSearch hSearch;
|
||||
(void)dummy;
|
||||
|
||||
for (hPtr = Tcl_FirstHashEntry(hTblPtr, &hSearch);
|
||||
hPtr != NULL; hPtr = Tcl_NextHashEntry(&hSearch)) {
|
||||
AcceptCallback *acceptCallbackPtr = Tcl_GetHashValue(hPtr);
|
||||
AcceptCallback *acceptCallbackPtr = (AcceptCallback *)Tcl_GetHashValue(hPtr);
|
||||
|
||||
acceptCallbackPtr->interp = NULL;
|
||||
}
|
||||
@@ -1278,10 +1292,10 @@ RegisterTcpServerInterpCleanup(
|
||||
Tcl_HashEntry *hPtr; /* Entry for this record. */
|
||||
int isNew; /* Is the entry new? */
|
||||
|
||||
hTblPtr = Tcl_GetAssocData(interp, "tclTCPAcceptCallbacks", NULL);
|
||||
hTblPtr = (Tcl_HashTable *)Tcl_GetAssocData(interp, "tclTCPAcceptCallbacks", NULL);
|
||||
|
||||
if (hTblPtr == NULL) {
|
||||
hTblPtr = ckalloc(sizeof(Tcl_HashTable));
|
||||
hTblPtr = (Tcl_HashTable *)ckalloc(sizeof(Tcl_HashTable));
|
||||
Tcl_InitHashTable(hTblPtr, TCL_ONE_WORD_KEYS);
|
||||
Tcl_SetAssocData(interp, "tclTCPAcceptCallbacks",
|
||||
TcpAcceptCallbacksDeleteProc, hTblPtr);
|
||||
@@ -1324,7 +1338,7 @@ UnregisterTcpServerInterpCleanupProc(
|
||||
Tcl_HashTable *hTblPtr;
|
||||
Tcl_HashEntry *hPtr;
|
||||
|
||||
hTblPtr = Tcl_GetAssocData(interp, "tclTCPAcceptCallbacks", NULL);
|
||||
hTblPtr = (Tcl_HashTable *)Tcl_GetAssocData(interp, "tclTCPAcceptCallbacks", NULL);
|
||||
if (hTblPtr == NULL) {
|
||||
return;
|
||||
}
|
||||
@@ -1362,7 +1376,7 @@ AcceptCallbackProc(
|
||||
char *address, /* Address of client that was accepted. */
|
||||
int port) /* Port of client that was accepted. */
|
||||
{
|
||||
AcceptCallback *acceptCallbackPtr = callbackData;
|
||||
AcceptCallback *acceptCallbackPtr = (AcceptCallback *)callbackData;
|
||||
|
||||
/*
|
||||
* Check if the callback is still valid; the interpreter may have gone
|
||||
@@ -1448,7 +1462,7 @@ TcpServerCloseProc(
|
||||
ClientData callbackData) /* The data passed in the call to
|
||||
* Tcl_CreateCloseHandler. */
|
||||
{
|
||||
AcceptCallback *acceptCallbackPtr = callbackData;
|
||||
AcceptCallback *acceptCallbackPtr = (AcceptCallback *)callbackData;
|
||||
/* The actual data. */
|
||||
|
||||
if (acceptCallbackPtr->interp != NULL) {
|
||||
@@ -1478,7 +1492,7 @@ TcpServerCloseProc(
|
||||
|
||||
int
|
||||
Tcl_SocketObjCmd(
|
||||
ClientData notUsed, /* Not used. */
|
||||
ClientData dummy, /* Not used. */
|
||||
Tcl_Interp *interp, /* Current interpreter. */
|
||||
int objc, /* Number of arguments. */
|
||||
Tcl_Obj *const objv[]) /* Argument objects. */
|
||||
@@ -1497,6 +1511,7 @@ Tcl_SocketObjCmd(
|
||||
const char *host, *port, *myaddr = NULL;
|
||||
Tcl_Obj *script = NULL;
|
||||
Tcl_Channel chan;
|
||||
(void)dummy;
|
||||
|
||||
if (TclpHasSockets(interp) != TCL_OK) {
|
||||
return TCL_ERROR;
|
||||
@@ -1652,7 +1667,7 @@ Tcl_SocketObjCmd(
|
||||
port = TclGetString(objv[a]);
|
||||
|
||||
if (server) {
|
||||
AcceptCallback *acceptCallbackPtr = ckalloc(sizeof(AcceptCallback));
|
||||
AcceptCallback *acceptCallbackPtr = (AcceptCallback *)ckalloc(sizeof(AcceptCallback));
|
||||
|
||||
Tcl_IncrRefCount(script);
|
||||
acceptCallbackPtr->script = script;
|
||||
@@ -1731,6 +1746,7 @@ Tcl_FcopyObjCmd(
|
||||
Tcl_Obj *cmdPtr;
|
||||
static const char *const switches[] = { "-size", "-command", NULL };
|
||||
enum { FcopySize, FcopyCommand };
|
||||
(void)dummy;
|
||||
|
||||
if ((objc < 3) || (objc > 7) || (objc == 4) || (objc == 6)) {
|
||||
Tcl_WrongNumArgs(interp, 1, objv,
|
||||
@@ -1816,7 +1832,7 @@ Tcl_FcopyObjCmd(
|
||||
/* ARGSUSED */
|
||||
static int
|
||||
ChanPendingObjCmd(
|
||||
ClientData unused, /* Not used. */
|
||||
ClientData dummy, /* Not used. */
|
||||
Tcl_Interp *interp, /* Current interpreter. */
|
||||
int objc, /* Number of arguments. */
|
||||
Tcl_Obj *const objv[]) /* Argument objects. */
|
||||
@@ -1825,6 +1841,7 @@ ChanPendingObjCmd(
|
||||
int index, mode;
|
||||
static const char *const options[] = {"input", "output", NULL};
|
||||
enum options {PENDING_INPUT, PENDING_OUTPUT};
|
||||
(void)dummy;
|
||||
|
||||
if (objc != 3) {
|
||||
Tcl_WrongNumArgs(interp, 1, objv, "mode channelId");
|
||||
@@ -1885,6 +1902,7 @@ ChanTruncateObjCmd(
|
||||
{
|
||||
Tcl_Channel chan;
|
||||
Tcl_WideInt length;
|
||||
(void)dummy;
|
||||
|
||||
if ((objc < 2) || (objc > 3)) {
|
||||
Tcl_WrongNumArgs(interp, 1, objv, "channelId ?length?");
|
||||
@@ -1959,6 +1977,7 @@ ChanPipeObjCmd(
|
||||
Tcl_Channel rchan, wchan;
|
||||
const char *channelNames[2];
|
||||
Tcl_Obj *resultPtr;
|
||||
(void)dummy;
|
||||
|
||||
if (objc != 1) {
|
||||
Tcl_WrongNumArgs(interp, 1, objv, "");
|
||||
@@ -2002,11 +2021,12 @@ ChanPipeObjCmd(
|
||||
|
||||
int
|
||||
TclChannelNamesCmd(
|
||||
ClientData clientData,
|
||||
ClientData dummy,
|
||||
Tcl_Interp *interp,
|
||||
int objc,
|
||||
Tcl_Obj *const objv[])
|
||||
{
|
||||
(void)dummy;
|
||||
if (objc < 1 || objc > 2) {
|
||||
Tcl_WrongNumArgs(interp, 1, objv, "?pattern?");
|
||||
return TCL_ERROR;
|
||||
|
||||
+15
-15
@@ -287,7 +287,7 @@ TclChannelTransform(
|
||||
* regime of the underlying channel and to use the same for us too.
|
||||
*/
|
||||
|
||||
dataPtr = ckalloc(sizeof(TransformChannelData));
|
||||
dataPtr = (TransformChannelData *)ckalloc(sizeof(TransformChannelData));
|
||||
|
||||
dataPtr->refCount = 1;
|
||||
Tcl_DStringInit(&ds);
|
||||
@@ -503,7 +503,7 @@ TransformBlockModeProc(
|
||||
ClientData instanceData, /* State of transformation. */
|
||||
int mode) /* New blocking mode. */
|
||||
{
|
||||
TransformChannelData *dataPtr = instanceData;
|
||||
TransformChannelData *dataPtr = (TransformChannelData *)instanceData;
|
||||
|
||||
if (mode == TCL_MODE_NONBLOCKING) {
|
||||
dataPtr->flags |= CHANNEL_ASYNC;
|
||||
@@ -535,7 +535,7 @@ TransformCloseProc(
|
||||
ClientData instanceData,
|
||||
Tcl_Interp *interp)
|
||||
{
|
||||
TransformChannelData *dataPtr = instanceData;
|
||||
TransformChannelData *dataPtr = (TransformChannelData *)instanceData;
|
||||
|
||||
/*
|
||||
* Important: In this procedure 'dataPtr->self' already points to the
|
||||
@@ -616,7 +616,7 @@ TransformInputProc(
|
||||
int toRead,
|
||||
int *errorCodePtr)
|
||||
{
|
||||
TransformChannelData *dataPtr = instanceData;
|
||||
TransformChannelData *dataPtr = (TransformChannelData *)instanceData;
|
||||
int gotBytes, read, copied;
|
||||
Tcl_Channel downChan;
|
||||
|
||||
@@ -783,7 +783,7 @@ TransformOutputProc(
|
||||
int toWrite,
|
||||
int *errorCodePtr)
|
||||
{
|
||||
TransformChannelData *dataPtr = instanceData;
|
||||
TransformChannelData *dataPtr = (TransformChannelData *)instanceData;
|
||||
|
||||
/*
|
||||
* Should assert(dataPtr->mode & TCL_WRITABLE);
|
||||
@@ -835,7 +835,7 @@ TransformSeekProc(
|
||||
int mode, /* How to move. */
|
||||
int *errorCodePtr) /* Location of error flag. */
|
||||
{
|
||||
TransformChannelData *dataPtr = instanceData;
|
||||
TransformChannelData *dataPtr = (TransformChannelData *)instanceData;
|
||||
Tcl_Channel parent = Tcl_GetStackedChannel(dataPtr->self);
|
||||
const Tcl_ChannelType *parentType = Tcl_GetChannelType(parent);
|
||||
Tcl_DriverSeekProc *parentSeekProc = Tcl_ChannelSeekProc(parentType);
|
||||
@@ -902,7 +902,7 @@ TransformWideSeekProc(
|
||||
int mode, /* How to move. */
|
||||
int *errorCodePtr) /* Location of error flag. */
|
||||
{
|
||||
TransformChannelData *dataPtr = instanceData;
|
||||
TransformChannelData *dataPtr = (TransformChannelData *)instanceData;
|
||||
Tcl_Channel parent = Tcl_GetStackedChannel(dataPtr->self);
|
||||
const Tcl_ChannelType *parentType = Tcl_GetChannelType(parent);
|
||||
Tcl_DriverSeekProc *parentSeekProc = Tcl_ChannelSeekProc(parentType);
|
||||
@@ -994,7 +994,7 @@ TransformSetOptionProc(
|
||||
const char *optionName,
|
||||
const char *value)
|
||||
{
|
||||
TransformChannelData *dataPtr = instanceData;
|
||||
TransformChannelData *dataPtr = (TransformChannelData *)instanceData;
|
||||
Tcl_Channel downChan = Tcl_GetStackedChannel(dataPtr->self);
|
||||
Tcl_DriverSetOptionProc *setOptionProc;
|
||||
|
||||
@@ -1032,7 +1032,7 @@ TransformGetOptionProc(
|
||||
const char *optionName,
|
||||
Tcl_DString *dsPtr)
|
||||
{
|
||||
TransformChannelData *dataPtr = instanceData;
|
||||
TransformChannelData *dataPtr = (TransformChannelData *)instanceData;
|
||||
Tcl_Channel downChan = Tcl_GetStackedChannel(dataPtr->self);
|
||||
Tcl_DriverGetOptionProc *getOptionProc;
|
||||
|
||||
@@ -1078,7 +1078,7 @@ TransformWatchProc(
|
||||
ClientData instanceData, /* Channel to watch. */
|
||||
int mask) /* Events of interest. */
|
||||
{
|
||||
TransformChannelData *dataPtr = instanceData;
|
||||
TransformChannelData *dataPtr = (TransformChannelData *)instanceData;
|
||||
Tcl_Channel downChan;
|
||||
|
||||
/*
|
||||
@@ -1157,7 +1157,7 @@ TransformGetFileHandleProc(
|
||||
int direction, /* Direction of interest. */
|
||||
ClientData *handlePtr) /* Place to store the handle into. */
|
||||
{
|
||||
TransformChannelData *dataPtr = instanceData;
|
||||
TransformChannelData *dataPtr = (TransformChannelData *)instanceData;
|
||||
|
||||
/*
|
||||
* Return the handle belonging to parent channel. IOW, pass the request
|
||||
@@ -1191,7 +1191,7 @@ TransformNotifyProc(
|
||||
* transformation. */
|
||||
int mask) /* The mask of occuring events. */
|
||||
{
|
||||
TransformChannelData *dataPtr = clientData;
|
||||
TransformChannelData *dataPtr = (TransformChannelData *)clientData;
|
||||
|
||||
/*
|
||||
* An event occured in the underlying channel. This transformation doesn't
|
||||
@@ -1234,7 +1234,7 @@ static void
|
||||
TransformChannelHandlerTimer(
|
||||
ClientData clientData) /* Transformation to query. */
|
||||
{
|
||||
TransformChannelData *dataPtr = clientData;
|
||||
TransformChannelData *dataPtr = (TransformChannelData *)clientData;
|
||||
|
||||
dataPtr->timer = NULL;
|
||||
if (!(dataPtr->watchMask&TCL_READABLE) || ResultEmpty(&dataPtr->result)) {
|
||||
@@ -1416,10 +1416,10 @@ ResultAdd(
|
||||
|
||||
if (r->allocated == 0) {
|
||||
r->allocated = toWrite + INCREMENT;
|
||||
r->buf = ckalloc(r->allocated);
|
||||
r->buf = (unsigned char *)ckalloc(r->allocated);
|
||||
} else {
|
||||
r->allocated += toWrite + INCREMENT;
|
||||
r->buf = ckrealloc(r->buf, r->allocated);
|
||||
r->buf = (unsigned char *)ckrealloc(r->buf, r->allocated);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+41
-36
@@ -492,7 +492,7 @@ static const char *msg_dstlost = "-code 1 -level 0 -errorcode NONE -errorinfo
|
||||
|
||||
int
|
||||
TclChanCreateObjCmd(
|
||||
ClientData clientData,
|
||||
ClientData dummy,
|
||||
Tcl_Interp *interp,
|
||||
int objc,
|
||||
Tcl_Obj *const *objv)
|
||||
@@ -518,6 +518,7 @@ TclChanCreateObjCmd(
|
||||
* this interp. */
|
||||
Tcl_HashEntry *hPtr; /* Entry in the above map */
|
||||
int isNew; /* Placeholder. */
|
||||
(void)dummy;
|
||||
|
||||
/*
|
||||
* Syntax: chan create MODE CMDPREFIX
|
||||
@@ -681,7 +682,7 @@ TclChanCreateObjCmd(
|
||||
* as the actual channel type.
|
||||
*/
|
||||
|
||||
Tcl_ChannelType *clonePtr = ckalloc(sizeof(Tcl_ChannelType));
|
||||
Tcl_ChannelType *clonePtr = (Tcl_ChannelType *)ckalloc(sizeof(Tcl_ChannelType));
|
||||
|
||||
memcpy(clonePtr, &tclRChannelType, sizeof(Tcl_ChannelType));
|
||||
|
||||
@@ -781,6 +782,7 @@ ReflectEventRun(
|
||||
*/
|
||||
|
||||
ReflectEvent *e = (ReflectEvent *) ev;
|
||||
(void)flags;
|
||||
|
||||
Tcl_NotifyChannel(e->rcPtr->chan, e->events);
|
||||
return 1;
|
||||
@@ -809,7 +811,7 @@ ReflectEventDelete(
|
||||
|
||||
int
|
||||
TclChanPostEventObjCmd(
|
||||
ClientData clientData,
|
||||
ClientData dummy,
|
||||
Tcl_Interp *interp,
|
||||
int objc,
|
||||
Tcl_Obj *const *objv)
|
||||
@@ -838,6 +840,7 @@ TclChanPostEventObjCmd(
|
||||
ReflectedChannelMap *rcmPtr;/* Map of reflected channels with handlers in
|
||||
* this interp. */
|
||||
Tcl_HashEntry *hPtr; /* Entry in the above map */
|
||||
(void)dummy;
|
||||
|
||||
/*
|
||||
* Number of arguments...
|
||||
@@ -882,7 +885,7 @@ TclChanPostEventObjCmd(
|
||||
* have gone seriously haywire.
|
||||
*/
|
||||
|
||||
chan = Tcl_GetHashValue(hPtr);
|
||||
chan = (Tcl_Channel)Tcl_GetHashValue(hPtr);
|
||||
chanTypePtr = Tcl_GetChannelType(chan);
|
||||
|
||||
/*
|
||||
@@ -898,7 +901,7 @@ TclChanPostEventObjCmd(
|
||||
Tcl_Panic("TclChanPostEventObjCmd: channel is not a reflected channel");
|
||||
}
|
||||
|
||||
rcPtr = Tcl_GetChannelInstanceData(chan);
|
||||
rcPtr = (ReflectedChannel *)Tcl_GetChannelInstanceData(chan);
|
||||
|
||||
if (rcPtr->interp != interp) {
|
||||
Tcl_Panic("TclChanPostEventObjCmd: postevent accepted for call from outside interpreter");
|
||||
@@ -945,7 +948,7 @@ TclChanPostEventObjCmd(
|
||||
}
|
||||
#if TCL_THREADS
|
||||
} else {
|
||||
ReflectEvent *ev = ckalloc(sizeof(ReflectEvent));
|
||||
ReflectEvent *ev = (ReflectEvent *)ckalloc(sizeof(ReflectEvent));
|
||||
|
||||
ev->header.proc = ReflectEventRun;
|
||||
ev->events = events;
|
||||
@@ -994,7 +997,7 @@ static void
|
||||
TimerRunRead(
|
||||
ClientData clientData)
|
||||
{
|
||||
ReflectedChannel *rcPtr = clientData;
|
||||
ReflectedChannel *rcPtr = (ReflectedChannel *)clientData;
|
||||
rcPtr->readTimer = NULL;
|
||||
Tcl_NotifyChannel(rcPtr->chan, TCL_READABLE);
|
||||
}
|
||||
@@ -1003,7 +1006,7 @@ static void
|
||||
TimerRunWrite(
|
||||
ClientData clientData)
|
||||
{
|
||||
ReflectedChannel *rcPtr = clientData;
|
||||
ReflectedChannel *rcPtr = (ReflectedChannel *)clientData;
|
||||
rcPtr->writeTimer = NULL;
|
||||
Tcl_NotifyChannel(rcPtr->chan, TCL_WRITABLE);
|
||||
}
|
||||
@@ -1152,7 +1155,7 @@ ReflectClose(
|
||||
ClientData clientData,
|
||||
Tcl_Interp *interp)
|
||||
{
|
||||
ReflectedChannel *rcPtr = clientData;
|
||||
ReflectedChannel *rcPtr = (ReflectedChannel *)clientData;
|
||||
int result; /* Result code for 'close' */
|
||||
Tcl_Obj *resObj; /* Result data for 'close' */
|
||||
ReflectedChannelMap *rcmPtr;/* Map of reflected channels with handlers in
|
||||
@@ -1309,7 +1312,7 @@ ReflectInput(
|
||||
int toRead,
|
||||
int *errorCodePtr)
|
||||
{
|
||||
ReflectedChannel *rcPtr = clientData;
|
||||
ReflectedChannel *rcPtr = (ReflectedChannel *)clientData;
|
||||
Tcl_Obj *toReadObj;
|
||||
int bytec; /* Number of returned bytes */
|
||||
unsigned char *bytev; /* Array of returned bytes */
|
||||
@@ -1416,7 +1419,7 @@ ReflectOutput(
|
||||
int toWrite,
|
||||
int *errorCodePtr)
|
||||
{
|
||||
ReflectedChannel *rcPtr = clientData;
|
||||
ReflectedChannel *rcPtr = (ReflectedChannel *)clientData;
|
||||
Tcl_Obj *bufObj;
|
||||
Tcl_Obj *resObj; /* Result data for 'write' */
|
||||
int written;
|
||||
@@ -1545,7 +1548,7 @@ ReflectSeekWide(
|
||||
int seekMode,
|
||||
int *errorCodePtr)
|
||||
{
|
||||
ReflectedChannel *rcPtr = clientData;
|
||||
ReflectedChannel *rcPtr = (ReflectedChannel *)clientData;
|
||||
Tcl_Obj *offObj, *baseObj;
|
||||
Tcl_Obj *resObj; /* Result for 'seek' */
|
||||
Tcl_WideInt newLoc;
|
||||
@@ -1654,7 +1657,7 @@ ReflectWatch(
|
||||
ClientData clientData,
|
||||
int mask)
|
||||
{
|
||||
ReflectedChannel *rcPtr = clientData;
|
||||
ReflectedChannel *rcPtr = (ReflectedChannel *)clientData;
|
||||
Tcl_Obj *maskObj;
|
||||
|
||||
/*
|
||||
@@ -1726,7 +1729,7 @@ ReflectBlock(
|
||||
ClientData clientData,
|
||||
int nonblocking)
|
||||
{
|
||||
ReflectedChannel *rcPtr = clientData;
|
||||
ReflectedChannel *rcPtr = (ReflectedChannel *)clientData;
|
||||
Tcl_Obj *blockObj;
|
||||
int errorNum; /* EINVAL or EOK (success). */
|
||||
Tcl_Obj *resObj; /* Result data for 'blocking' */
|
||||
@@ -1793,7 +1796,7 @@ ReflectThread(
|
||||
ClientData clientData,
|
||||
int action)
|
||||
{
|
||||
ReflectedChannel *rcPtr = clientData;
|
||||
ReflectedChannel *rcPtr = (ReflectedChannel *)clientData;
|
||||
|
||||
switch (action) {
|
||||
case TCL_CHANNEL_THREAD_INSERT:
|
||||
@@ -1832,7 +1835,7 @@ ReflectSetOption(
|
||||
const char *optionName, /* Name of requested option */
|
||||
const char *newValue) /* The new value */
|
||||
{
|
||||
ReflectedChannel *rcPtr = clientData;
|
||||
ReflectedChannel *rcPtr = (ReflectedChannel *)clientData;
|
||||
Tcl_Obj *optionObj, *valueObj;
|
||||
int result; /* Result code for 'configure' */
|
||||
Tcl_Obj *resObj; /* Result data for 'configure' */
|
||||
@@ -1909,7 +1912,7 @@ ReflectGetOption(
|
||||
* The bypass functions are not required.
|
||||
*/
|
||||
|
||||
ReflectedChannel *rcPtr = clientData;
|
||||
ReflectedChannel *rcPtr = (ReflectedChannel *)clientData;
|
||||
Tcl_Obj *optionObj;
|
||||
Tcl_Obj *resObj; /* Result data for 'configure' */
|
||||
int listc, result = TCL_OK;
|
||||
@@ -1922,7 +1925,7 @@ ReflectGetOption(
|
||||
|
||||
#if TCL_THREADS
|
||||
if (rcPtr->thread != Tcl_GetCurrentThread()) {
|
||||
int opcode;
|
||||
ForwardedOperation opcode;
|
||||
ForwardParam p;
|
||||
|
||||
p.getOpt.name = optionName;
|
||||
@@ -2174,9 +2177,9 @@ NewReflectedChannel(
|
||||
Tcl_Obj *handleObj)
|
||||
{
|
||||
ReflectedChannel *rcPtr;
|
||||
MethodName mn = METH_BLOCKING;
|
||||
int mn = 0;
|
||||
|
||||
rcPtr = ckalloc(sizeof(ReflectedChannel));
|
||||
rcPtr = (ReflectedChannel *)ckalloc(sizeof(ReflectedChannel));
|
||||
|
||||
/* rcPtr->chan: Assigned by caller. Dummy data here. */
|
||||
|
||||
@@ -2195,7 +2198,7 @@ NewReflectedChannel(
|
||||
rcPtr->cmd = TclListObjCopy(NULL, cmdpfxObj);
|
||||
Tcl_IncrRefCount(rcPtr->cmd);
|
||||
rcPtr->methods = Tcl_NewListObj(METH_WRITE + 1, NULL);
|
||||
while (mn <= METH_WRITE) {
|
||||
while (mn <= (int)METH_WRITE) {
|
||||
Tcl_ListObjAppendElement(NULL, rcPtr->methods,
|
||||
Tcl_NewStringObj(methodNames[mn++], -1));
|
||||
}
|
||||
@@ -2496,10 +2499,10 @@ static ReflectedChannelMap *
|
||||
GetReflectedChannelMap(
|
||||
Tcl_Interp *interp)
|
||||
{
|
||||
ReflectedChannelMap *rcmPtr = Tcl_GetAssocData(interp, RCMKEY, NULL);
|
||||
ReflectedChannelMap *rcmPtr = (ReflectedChannelMap *)Tcl_GetAssocData(interp, RCMKEY, NULL);
|
||||
|
||||
if (rcmPtr == NULL) {
|
||||
rcmPtr = ckalloc(sizeof(ReflectedChannelMap));
|
||||
rcmPtr = (ReflectedChannelMap *)ckalloc(sizeof(ReflectedChannelMap));
|
||||
Tcl_InitHashTable(&rcmPtr->map, TCL_STRING_KEYS);
|
||||
Tcl_SetAssocData(interp, RCMKEY,
|
||||
(Tcl_InterpDeleteProc *) DeleteReflectedChannelMap, rcmPtr);
|
||||
@@ -2554,7 +2557,7 @@ DeleteReflectedChannelMap(
|
||||
ClientData clientData, /* The per-interpreter data structure. */
|
||||
Tcl_Interp *interp) /* The interpreter being deleted. */
|
||||
{
|
||||
ReflectedChannelMap *rcmPtr = clientData;
|
||||
ReflectedChannelMap *rcmPtr = (ReflectedChannelMap *)clientData;
|
||||
/* The map */
|
||||
Tcl_HashSearch hSearch; /* Search variable. */
|
||||
Tcl_HashEntry *hPtr; /* Search variable. */
|
||||
@@ -2581,8 +2584,8 @@ DeleteReflectedChannelMap(
|
||||
for (hPtr = Tcl_FirstHashEntry(&rcmPtr->map, &hSearch);
|
||||
hPtr != NULL;
|
||||
hPtr = Tcl_FirstHashEntry(&rcmPtr->map, &hSearch)) {
|
||||
chan = Tcl_GetHashValue(hPtr);
|
||||
rcPtr = Tcl_GetChannelInstanceData(chan);
|
||||
chan = (Tcl_Channel)Tcl_GetHashValue(hPtr);
|
||||
rcPtr = (ReflectedChannel *)Tcl_GetChannelInstanceData(chan);
|
||||
|
||||
MarkDead(rcPtr);
|
||||
Tcl_DeleteHashEntry(hPtr);
|
||||
@@ -2659,8 +2662,8 @@ DeleteReflectedChannelMap(
|
||||
for (hPtr = Tcl_FirstHashEntry(&rcmPtr->map, &hSearch);
|
||||
hPtr != NULL;
|
||||
hPtr = Tcl_NextHashEntry(&hSearch)) {
|
||||
chan = Tcl_GetHashValue(hPtr);
|
||||
rcPtr = Tcl_GetChannelInstanceData(chan);
|
||||
chan = (Tcl_Channel)Tcl_GetHashValue(hPtr);
|
||||
rcPtr = (ReflectedChannel *)Tcl_GetChannelInstanceData(chan);
|
||||
|
||||
if (rcPtr->interp != interp) {
|
||||
/*
|
||||
@@ -2700,7 +2703,7 @@ GetThreadReflectedChannelMap(void)
|
||||
ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey);
|
||||
|
||||
if (!tsdPtr->rcmPtr) {
|
||||
tsdPtr->rcmPtr = ckalloc(sizeof(ReflectedChannelMap));
|
||||
tsdPtr->rcmPtr = (ReflectedChannelMap *)ckalloc(sizeof(ReflectedChannelMap));
|
||||
Tcl_InitHashTable(&tsdPtr->rcmPtr->map, TCL_STRING_KEYS);
|
||||
Tcl_CreateThreadExitHandler(DeleteThreadReflectedChannelMap, NULL);
|
||||
}
|
||||
@@ -2728,13 +2731,14 @@ GetThreadReflectedChannelMap(void)
|
||||
|
||||
static void
|
||||
DeleteThreadReflectedChannelMap(
|
||||
ClientData clientData) /* The per-thread data structure. */
|
||||
ClientData dummy) /* The per-thread data structure. */
|
||||
{
|
||||
Tcl_HashSearch hSearch; /* Search variable. */
|
||||
Tcl_HashEntry *hPtr; /* Search variable. */
|
||||
Tcl_ThreadId self = Tcl_GetCurrentThread();
|
||||
ReflectedChannelMap *rcmPtr; /* The map */
|
||||
ForwardingResult *resultPtr;
|
||||
(void)dummy;
|
||||
|
||||
/*
|
||||
* The origin thread for one or more reflected channels is gone.
|
||||
@@ -2817,8 +2821,8 @@ DeleteThreadReflectedChannelMap(
|
||||
for (hPtr = Tcl_FirstHashEntry(&rcmPtr->map, &hSearch);
|
||||
hPtr != NULL;
|
||||
hPtr = Tcl_FirstHashEntry(&rcmPtr->map, &hSearch)) {
|
||||
Tcl_Channel chan = Tcl_GetHashValue(hPtr);
|
||||
ReflectedChannel *rcPtr = Tcl_GetChannelInstanceData(chan);
|
||||
Tcl_Channel chan = (Tcl_Channel)Tcl_GetHashValue(hPtr);
|
||||
ReflectedChannel *rcPtr = (ReflectedChannel *)Tcl_GetChannelInstanceData(chan);
|
||||
|
||||
MarkDead(rcPtr);
|
||||
Tcl_DeleteHashEntry(hPtr);
|
||||
@@ -2863,8 +2867,8 @@ ForwardOpToHandlerThread(
|
||||
* Create and initialize the event and data structures.
|
||||
*/
|
||||
|
||||
evPtr = ckalloc(sizeof(ForwardingEvent));
|
||||
resultPtr = ckalloc(sizeof(ForwardingResult));
|
||||
evPtr = (ForwardingEvent *)ckalloc(sizeof(ForwardingEvent));
|
||||
resultPtr = (ForwardingResult *)ckalloc(sizeof(ForwardingResult));
|
||||
|
||||
evPtr->event.proc = ForwardProc;
|
||||
evPtr->resultPtr = resultPtr;
|
||||
@@ -2981,6 +2985,7 @@ ForwardProc(
|
||||
ReflectedChannelMap *rcmPtr;/* Map of reflected channels with handlers in
|
||||
* this interp. */
|
||||
Tcl_HashEntry *hPtr; /* Entry in the above map */
|
||||
(void)mask;
|
||||
|
||||
/*
|
||||
* Ignore the event if no one is waiting for its result anymore.
|
||||
@@ -3241,7 +3246,7 @@ ForwardProc(
|
||||
* Odd number of elements is wrong. [x].
|
||||
*/
|
||||
|
||||
char *buf = ckalloc(200);
|
||||
char *buf = (char *)ckalloc(200);
|
||||
sprintf(buf,
|
||||
"{Expected list with even number of elements, got %d %s instead}",
|
||||
listc, (listc == 1 ? "element" : "elements"));
|
||||
@@ -3298,7 +3303,7 @@ static void
|
||||
SrcExitProc(
|
||||
ClientData clientData)
|
||||
{
|
||||
ForwardingEvent *evPtr = clientData;
|
||||
ForwardingEvent *evPtr = (ForwardingEvent *)clientData;
|
||||
ForwardingResult *resultPtr;
|
||||
ForwardParam *paramPtr;
|
||||
|
||||
|
||||
+38
-65
@@ -27,10 +27,6 @@
|
||||
#define EOK 0
|
||||
#endif
|
||||
|
||||
/* DUPLICATE of HaveVersion() in tclIO.c // TODO - MODULE_SCOPE */
|
||||
static int HaveVersion(const Tcl_ChannelType *typePtr,
|
||||
Tcl_ChannelTypeVersion minimumVersion);
|
||||
|
||||
/*
|
||||
* Signatures of all functions used in the C layer of the reflection.
|
||||
*/
|
||||
@@ -501,7 +497,7 @@ static int TransformLimit(ReflectedTransform *rtPtr,
|
||||
|
||||
int
|
||||
TclChanPushObjCmd(
|
||||
ClientData clientData,
|
||||
ClientData dummy,
|
||||
Tcl_Interp *interp,
|
||||
int objc,
|
||||
Tcl_Obj *const *objv)
|
||||
@@ -528,6 +524,7 @@ TclChanPushObjCmd(
|
||||
* in this interp. */
|
||||
Tcl_HashEntry *hPtr; /* Entry in the above map */
|
||||
int isNew; /* Placeholder. */
|
||||
(void)dummy;
|
||||
|
||||
/*
|
||||
* Syntax: chan push CHANNEL CMDPREFIX
|
||||
@@ -746,7 +743,7 @@ TclChanPushObjCmd(
|
||||
|
||||
int
|
||||
TclChanPopObjCmd(
|
||||
ClientData clientData,
|
||||
ClientData dummy,
|
||||
Tcl_Interp *interp,
|
||||
int objc,
|
||||
Tcl_Obj *const *objv)
|
||||
@@ -764,6 +761,7 @@ TclChanPopObjCmd(
|
||||
const char *chanId; /* Tcl level channel handle */
|
||||
Tcl_Channel chan; /* Channel associated to the handle */
|
||||
int mode; /* Channel r/w mode */
|
||||
(void)dummy;
|
||||
|
||||
/*
|
||||
* Number of arguments...
|
||||
@@ -885,7 +883,7 @@ ReflectClose(
|
||||
ClientData clientData,
|
||||
Tcl_Interp *interp)
|
||||
{
|
||||
ReflectedTransform *rtPtr = clientData;
|
||||
ReflectedTransform *rtPtr = (ReflectedTransform *)clientData;
|
||||
int errorCode, errorCodeSet = 0;
|
||||
int result = TCL_OK; /* Result code for 'close' */
|
||||
Tcl_Obj *resObj; /* Result data for 'close' */
|
||||
@@ -1061,7 +1059,7 @@ ReflectInput(
|
||||
int toRead,
|
||||
int *errorCodePtr)
|
||||
{
|
||||
ReflectedTransform *rtPtr = clientData;
|
||||
ReflectedTransform *rtPtr = (ReflectedTransform *)clientData;
|
||||
int gotBytes, copied, readBytes;
|
||||
Tcl_Obj *bufObj;
|
||||
|
||||
@@ -1254,7 +1252,7 @@ ReflectOutput(
|
||||
int toWrite,
|
||||
int *errorCodePtr)
|
||||
{
|
||||
ReflectedTransform *rtPtr = clientData;
|
||||
ReflectedTransform *rtPtr = (ReflectedTransform *)clientData;
|
||||
|
||||
/*
|
||||
* The following check can be done before thread redirection, because we
|
||||
@@ -1327,7 +1325,7 @@ ReflectSeekWide(
|
||||
int seekMode,
|
||||
int *errorCodePtr)
|
||||
{
|
||||
ReflectedTransform *rtPtr = clientData;
|
||||
ReflectedTransform *rtPtr = (ReflectedTransform *)clientData;
|
||||
Channel *parent = (Channel *) rtPtr->parent;
|
||||
Tcl_WideInt curPos; /* Position on the device. */
|
||||
|
||||
@@ -1386,15 +1384,14 @@ ReflectSeekWide(
|
||||
* non-NULL...
|
||||
*/
|
||||
|
||||
if (HaveVersion(parent->typePtr, TCL_CHANNEL_VERSION_3) &&
|
||||
parent->typePtr->wideSeekProc != NULL) {
|
||||
curPos = parent->typePtr->wideSeekProc(parent->instanceData, offset,
|
||||
if (Tcl_ChannelWideSeekProc(parent->typePtr) != NULL) {
|
||||
curPos = Tcl_ChannelWideSeekProc(parent->typePtr)(parent->instanceData, offset,
|
||||
seekMode, errorCodePtr);
|
||||
} else if (offset < LONG_MIN || offset > LONG_MAX) {
|
||||
*errorCodePtr = EOVERFLOW;
|
||||
curPos = -1;
|
||||
} else {
|
||||
curPos = parent->typePtr->seekProc(
|
||||
curPos = Tcl_ChannelSeekProc(parent->typePtr)(
|
||||
parent->instanceData, offset, seekMode,
|
||||
errorCodePtr);
|
||||
}
|
||||
@@ -1447,7 +1444,7 @@ ReflectWatch(
|
||||
ClientData clientData,
|
||||
int mask)
|
||||
{
|
||||
ReflectedTransform *rtPtr = clientData;
|
||||
ReflectedTransform *rtPtr = (ReflectedTransform *)clientData;
|
||||
Tcl_DriverWatchProc *watchProc;
|
||||
|
||||
watchProc = Tcl_ChannelWatchProc(Tcl_GetChannelType(rtPtr->parent));
|
||||
@@ -1498,7 +1495,7 @@ ReflectBlock(
|
||||
ClientData clientData,
|
||||
int nonblocking)
|
||||
{
|
||||
ReflectedTransform *rtPtr = clientData;
|
||||
ReflectedTransform *rtPtr = (ReflectedTransform *)clientData;
|
||||
|
||||
/*
|
||||
* Transformations simply record the blocking mode in their C level
|
||||
@@ -1533,7 +1530,7 @@ ReflectSetOption(
|
||||
const char *optionName, /* Name of requested option */
|
||||
const char *newValue) /* The new value */
|
||||
{
|
||||
ReflectedTransform *rtPtr = clientData;
|
||||
ReflectedTransform *rtPtr = (ReflectedTransform *)clientData;
|
||||
|
||||
/*
|
||||
* Transformations have no options. Thus the call is passed down unchanged
|
||||
@@ -1575,7 +1572,7 @@ ReflectGetOption(
|
||||
const char *optionName, /* Name of reuqested option */
|
||||
Tcl_DString *dsPtr) /* String to place the result into */
|
||||
{
|
||||
ReflectedTransform *rtPtr = clientData;
|
||||
ReflectedTransform *rtPtr = (ReflectedTransform *)clientData;
|
||||
|
||||
/*
|
||||
* Transformations have no options. Thus the call is passed down unchanged
|
||||
@@ -1623,7 +1620,7 @@ ReflectHandle(
|
||||
int direction,
|
||||
ClientData *handlePtr)
|
||||
{
|
||||
ReflectedTransform *rtPtr = clientData;
|
||||
ReflectedTransform *rtPtr = (ReflectedTransform *)clientData;
|
||||
|
||||
/*
|
||||
* Transformations have no handle of their own. As such we simply query
|
||||
@@ -1658,7 +1655,7 @@ ReflectNotify(
|
||||
ClientData clientData,
|
||||
int mask)
|
||||
{
|
||||
ReflectedTransform *rtPtr = clientData;
|
||||
ReflectedTransform *rtPtr = (ReflectedTransform *)clientData;
|
||||
|
||||
/*
|
||||
* An event occured in the underlying channel.
|
||||
@@ -1758,8 +1755,9 @@ NewReflectedTransform(
|
||||
int listc;
|
||||
Tcl_Obj **listv;
|
||||
int i;
|
||||
(void)mode;
|
||||
|
||||
rtPtr = ckalloc(sizeof(ReflectedTransform));
|
||||
rtPtr = (ReflectedTransform *)ckalloc(sizeof(ReflectedTransform));
|
||||
|
||||
/* rtPtr->chan: Assigned by caller. Dummy data here. */
|
||||
/* rtPtr->methods: Assigned by caller. Dummy data here. */
|
||||
@@ -1806,7 +1804,7 @@ NewReflectedTransform(
|
||||
*/
|
||||
|
||||
rtPtr->argc = listc + 2;
|
||||
rtPtr->argv = ckalloc(sizeof(Tcl_Obj *) * (listc+4));
|
||||
rtPtr->argv = (Tcl_Obj **)ckalloc(sizeof(Tcl_Obj *) * (listc+4));
|
||||
|
||||
/*
|
||||
* Duplicate object references.
|
||||
@@ -2111,10 +2109,10 @@ static ReflectedTransformMap *
|
||||
GetReflectedTransformMap(
|
||||
Tcl_Interp *interp)
|
||||
{
|
||||
ReflectedTransformMap *rtmPtr = Tcl_GetAssocData(interp, RTMKEY, NULL);
|
||||
ReflectedTransformMap *rtmPtr = (ReflectedTransformMap *)Tcl_GetAssocData(interp, RTMKEY, NULL);
|
||||
|
||||
if (rtmPtr == NULL) {
|
||||
rtmPtr = ckalloc(sizeof(ReflectedTransformMap));
|
||||
rtmPtr = (ReflectedTransformMap *)ckalloc(sizeof(ReflectedTransformMap));
|
||||
Tcl_InitHashTable(&rtmPtr->map, TCL_STRING_KEYS);
|
||||
Tcl_SetAssocData(interp, RTMKEY,
|
||||
(Tcl_InterpDeleteProc *) DeleteReflectedTransformMap, rtmPtr);
|
||||
@@ -2169,11 +2167,11 @@ DeleteReflectedTransformMap(
|
||||
* this interp.
|
||||
*/
|
||||
|
||||
rtmPtr = clientData;
|
||||
rtmPtr = (ReflectedTransformMap *)clientData;
|
||||
for (hPtr = Tcl_FirstHashEntry(&rtmPtr->map, &hSearch);
|
||||
hPtr != NULL;
|
||||
hPtr = Tcl_FirstHashEntry(&rtmPtr->map, &hSearch)) {
|
||||
rtPtr = Tcl_GetHashValue(hPtr);
|
||||
rtPtr = (ReflectedTransform *)Tcl_GetHashValue(hPtr);
|
||||
|
||||
rtPtr->dead = 1;
|
||||
Tcl_DeleteHashEntry(hPtr);
|
||||
@@ -2197,7 +2195,7 @@ DeleteReflectedTransformMap(
|
||||
for (hPtr = Tcl_FirstHashEntry(&rtmPtr->map, &hSearch);
|
||||
hPtr != NULL;
|
||||
hPtr = Tcl_NextHashEntry(&hSearch)) {
|
||||
rtPtr = Tcl_GetHashValue(hPtr);
|
||||
rtPtr = (ReflectedTransform *)Tcl_GetHashValue(hPtr);
|
||||
|
||||
if (rtPtr->interp != interp) {
|
||||
/*
|
||||
@@ -2277,7 +2275,7 @@ GetThreadReflectedTransformMap(void)
|
||||
ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey);
|
||||
|
||||
if (!tsdPtr->rtmPtr) {
|
||||
tsdPtr->rtmPtr = ckalloc(sizeof(ReflectedTransformMap));
|
||||
tsdPtr->rtmPtr = (ReflectedTransformMap *)ckalloc(sizeof(ReflectedTransformMap));
|
||||
Tcl_InitHashTable(&tsdPtr->rtmPtr->map, TCL_STRING_KEYS);
|
||||
Tcl_CreateThreadExitHandler(DeleteThreadReflectedTransformMap, NULL);
|
||||
}
|
||||
@@ -2305,13 +2303,14 @@ GetThreadReflectedTransformMap(void)
|
||||
|
||||
static void
|
||||
DeleteThreadReflectedTransformMap(
|
||||
ClientData clientData) /* The per-thread data structure. */
|
||||
ClientData dummy) /* The per-thread data structure. */
|
||||
{
|
||||
Tcl_HashSearch hSearch; /* Search variable. */
|
||||
Tcl_HashEntry *hPtr; /* Search variable. */
|
||||
Tcl_ThreadId self = Tcl_GetCurrentThread();
|
||||
ReflectedTransformMap *rtmPtr; /* The map */
|
||||
ForwardingResult *resultPtr;
|
||||
(void)dummy;
|
||||
|
||||
/*
|
||||
* The origin thread for one or more reflected channels is gone.
|
||||
@@ -2329,7 +2328,7 @@ DeleteThreadReflectedTransformMap(
|
||||
for (hPtr = Tcl_FirstHashEntry(&rtmPtr->map, &hSearch);
|
||||
hPtr != NULL;
|
||||
hPtr = Tcl_FirstHashEntry(&rtmPtr->map, &hSearch)) {
|
||||
ReflectedTransform *rtPtr = Tcl_GetHashValue(hPtr);
|
||||
ReflectedTransform *rtPtr = (ReflectedTransform *)Tcl_GetHashValue(hPtr);
|
||||
|
||||
rtPtr->dead = 1;
|
||||
FreeReflectedTransformArgs(rtPtr);
|
||||
@@ -2412,8 +2411,8 @@ ForwardOpToOwnerThread(
|
||||
* Create and initialize the event and data structures.
|
||||
*/
|
||||
|
||||
evPtr = ckalloc(sizeof(ForwardingEvent));
|
||||
resultPtr = ckalloc(sizeof(ForwardingResult));
|
||||
evPtr = (ForwardingEvent *)ckalloc(sizeof(ForwardingEvent));
|
||||
resultPtr = (ForwardingResult *)ckalloc(sizeof(ForwardingResult));
|
||||
|
||||
evPtr->event.proc = ForwardProc;
|
||||
evPtr->resultPtr = resultPtr;
|
||||
@@ -2524,6 +2523,7 @@ ForwardProc(
|
||||
/* Map of reflected channels with handlers in
|
||||
* this interp. */
|
||||
Tcl_HashEntry *hPtr; /* Entry in the above map */
|
||||
(void)mask;
|
||||
|
||||
/*
|
||||
* Ignore the event if no one is waiting for its result anymore.
|
||||
@@ -2606,7 +2606,7 @@ ForwardProc(
|
||||
paramPtr->transform.size = bytec;
|
||||
|
||||
if (bytec > 0) {
|
||||
paramPtr->transform.buf = ckalloc(bytec);
|
||||
paramPtr->transform.buf = (char *)ckalloc(bytec);
|
||||
memcpy(paramPtr->transform.buf, bytev, bytec);
|
||||
} else {
|
||||
paramPtr->transform.buf = NULL;
|
||||
@@ -2640,7 +2640,7 @@ ForwardProc(
|
||||
paramPtr->transform.size = bytec;
|
||||
|
||||
if (bytec > 0) {
|
||||
paramPtr->transform.buf = ckalloc(bytec);
|
||||
paramPtr->transform.buf = (char *)ckalloc(bytec);
|
||||
memcpy(paramPtr->transform.buf, bytev, bytec);
|
||||
} else {
|
||||
paramPtr->transform.buf = NULL;
|
||||
@@ -2669,7 +2669,7 @@ ForwardProc(
|
||||
paramPtr->transform.size = bytec;
|
||||
|
||||
if (bytec > 0) {
|
||||
paramPtr->transform.buf = ckalloc(bytec);
|
||||
paramPtr->transform.buf = (char *)ckalloc(bytec);
|
||||
memcpy(paramPtr->transform.buf, bytev, bytec);
|
||||
} else {
|
||||
paramPtr->transform.buf = NULL;
|
||||
@@ -2696,7 +2696,7 @@ ForwardProc(
|
||||
paramPtr->transform.size = bytec;
|
||||
|
||||
if (bytec > 0) {
|
||||
paramPtr->transform.buf = ckalloc(bytec);
|
||||
paramPtr->transform.buf = (char *)ckalloc(bytec);
|
||||
memcpy(paramPtr->transform.buf, bytev, bytec);
|
||||
} else {
|
||||
paramPtr->transform.buf = NULL;
|
||||
@@ -2756,7 +2756,7 @@ static void
|
||||
SrcExitProc(
|
||||
ClientData clientData)
|
||||
{
|
||||
ForwardingEvent *evPtr = clientData;
|
||||
ForwardingEvent *evPtr = (ForwardingEvent *)clientData;
|
||||
ForwardingResult *resultPtr;
|
||||
ForwardParam *paramPtr;
|
||||
|
||||
@@ -2896,7 +2896,7 @@ static void
|
||||
TimerRun(
|
||||
ClientData clientData)
|
||||
{
|
||||
ReflectedTransform *rtPtr = clientData;
|
||||
ReflectedTransform *rtPtr = (ReflectedTransform *)clientData;
|
||||
|
||||
rtPtr->timer = NULL;
|
||||
Tcl_NotifyChannel(rtPtr->chan, TCL_READABLE);
|
||||
@@ -3390,33 +3390,6 @@ TransformLimit(
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* DUPLICATE of HaveVersion() in tclIO.c
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
* HaveVersion --
|
||||
*
|
||||
* Return whether a channel type is (at least) of a given version.
|
||||
*
|
||||
* Results:
|
||||
* True if the minimum version is exceeded by the version actually
|
||||
* present.
|
||||
*
|
||||
* Side effects:
|
||||
* None.
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
static int
|
||||
HaveVersion(
|
||||
const Tcl_ChannelType *chanTypePtr,
|
||||
Tcl_ChannelTypeVersion minimumVersion)
|
||||
{
|
||||
Tcl_ChannelTypeVersion actualVersion = Tcl_ChannelVersion(chanTypePtr);
|
||||
|
||||
return PTR2INT(actualVersion) >= PTR2INT(minimumVersion);
|
||||
}
|
||||
|
||||
/*
|
||||
* Local Variables:
|
||||
* mode: c
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user