Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
| Comment: | More of the same: Space before tab is extremely unlikely to be correct indentation pattern. |
|---|---|
| Timelines: | family | ancestors | descendants | both | trunk | main |
| Files: | files | file ages | folders |
| SHA3-256: |
9ffd7855661ca409b531379d30f50726 |
| User & Date: | jan.nijtmans 2024-06-05 13:10:11.006 |
| Original Comment: | Backport from 9.0: Space before tab is an extremely unlikely to be correct indentation pattern. Add some more of the same |
References
|
2024-08-29
| ||
| 08:40 | Merge [9ffd7855661ca409]: More of the same: Space before tab is extremely unlikely to be correct ind... check-in: 12c6b8b472 user: pooryorick tags: unchained, INCOMPATIBLE_LICENSE | |
Context
|
2024-08-29
| ||
| 08:40 | Merge [9ffd7855661ca409]: More of the same: Space before tab is extremely unlikely to be correct ind... check-in: 12c6b8b472 user: pooryorick tags: unchained, INCOMPATIBLE_LICENSE | |
|
2024-06-05
| ||
| 14:12 | A clearer way of writing what parity options are available check-in: ae52f61f0c user: dkf tags: trunk, main | |
| 13:10 | More of the same: Space before tab is extremely unlikely to be correct indentation pattern. check-in: 9ffd785566 user: jan.nijtmans tags: trunk, main | |
|
2024-06-04
| ||
| 15:54 | Make function definitions have right argument style check-in: e8d1ca599f user: dkf tags: trunk, main | |
Changes
Changes to compat/fake-rfc2553.c.
| ︙ | ︙ | |||
39 40 41 42 43 44 45 |
TCL_DECLARE_MUTEX(netdbMutex)
#ifndef HAVE_GETNAMEINFO
#ifndef HAVE_STRLCPY
static size_t
strlcpy(char *dst, const char *src, size_t siz)
{
| | | | | | | | | | | | | | | | | | | | | 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 |
TCL_DECLARE_MUTEX(netdbMutex)
#ifndef HAVE_GETNAMEINFO
#ifndef HAVE_STRLCPY
static size_t
strlcpy(char *dst, const char *src, size_t siz)
{
char *d = dst;
const char *s = src;
size_t n = siz;
/* Copy as many bytes as will fit */
if (n != 0 && --n != 0) {
do {
if ((*d++ = *s++) == 0)
break;
} while (--n != 0);
}
/* Not enough room in dst, add NUL and traverse rest of src */
if (n == 0) {
if (siz != 0)
*d = '\0'; /* NUL-terminate dst */
while (*s++)
;
}
return(s - src - 1); /* count does not include NUL */
}
#endif
int fake_getnameinfo(const struct sockaddr *sa, size_t salen, char *host,
size_t hostlen, char *serv, size_t servlen, int flags)
{
struct sockaddr_in *sin = (struct sockaddr_in *)sa;
struct hostent *hp;
char tmpserv[16];
(void)salen;
if (sa->sa_family != AF_UNSPEC && sa->sa_family != AF_INET)
|
| ︙ | ︙ |
Changes to generic/regc_color.c.
| ︙ | ︙ | |||
426 427 428 429 430 431 432 |
return sco;
}
/*
- subrange - allocate new subcolors to this range of chrs, fill in arcs
^ static void subrange(struct vars *, pchr, pchr, struct state *,
| | | 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 |
return sco;
}
/*
- subrange - allocate new subcolors to this range of chrs, fill in arcs
^ static void subrange(struct vars *, pchr, pchr, struct state *,
^ struct state *);
*/
static void
subrange(
struct vars *v,
pchr from,
pchr to,
struct state *lp,
|
| ︙ | ︙ | |||
685 686 687 688 689 690 691 |
a->colorchain = NULL; /* paranoia */
a->colorchainRev = NULL;
}
/*
- rainbow - add arcs of all full colors (but one) between specified states
^ static void rainbow(struct nfa *, struct colormap *, int, pcolor,
| | | 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 |
a->colorchain = NULL; /* paranoia */
a->colorchainRev = NULL;
}
/*
- rainbow - add arcs of all full colors (but one) between specified states
^ static void rainbow(struct nfa *, struct colormap *, int, pcolor,
^ struct state *, struct state *);
*/
static void
rainbow(
struct nfa *nfa,
struct colormap *cm,
int type,
pcolor but, /* COLORLESS if no exceptions */
|
| ︙ | ︙ | |||
712 713 714 715 716 717 718 |
}
}
/*
- colorcomplement - add arcs of complementary colors
* The calling sequence ought to be reconciled with cloneouts().
^ static void colorcomplement(struct nfa *, struct colormap *, int,
| | | 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 |
}
}
/*
- colorcomplement - add arcs of complementary colors
* The calling sequence ought to be reconciled with cloneouts().
^ static void colorcomplement(struct nfa *, struct colormap *, int,
^ struct state *, struct state *, struct state *);
*/
static void
colorcomplement(
struct nfa *nfa,
struct colormap *cm,
int type,
struct state *of, /* complements of this guy's PLAIN outarcs */
|
| ︙ | ︙ |
Changes to generic/regc_locale.c.
| ︙ | ︙ | |||
1183 1184 1185 1186 1187 1188 1189 |
}
for (i=0 ; i<NUM_UPPER_CHAR ; i++) {
addchr(cv, upperCharTable[i]);
}
}
break;
case CC_PRINT:
| | | | | | | | | | | | | | | | | | | | 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 |
}
for (i=0 ; i<NUM_UPPER_CHAR ; i++) {
addchr(cv, upperCharTable[i]);
}
}
break;
case CC_PRINT:
cv = getcvec(v, NUM_SPACE_CHAR + NUM_GRAPH_CHAR, NUM_SPACE_RANGE + NUM_GRAPH_RANGE - 1);
if (cv) {
for (i=1 ; i<NUM_SPACE_RANGE ; i++) {
addrange(cv, spaceRangeTable[i].start,
spaceRangeTable[i].end);
}
for (i=0 ; i<NUM_SPACE_CHAR ; i++) {
addchr(cv, spaceCharTable[i]);
}
for (i=0 ; i<NUM_GRAPH_RANGE ; i++) {
addrange(cv, graphRangeTable[i].start,
graphRangeTable[i].end);
}
for (i=0 ; i<NUM_GRAPH_CHAR ; i++) {
addchr(cv, graphCharTable[i]);
}
}
break;
case CC_GRAPH:
cv = getcvec(v, NUM_GRAPH_CHAR, NUM_GRAPH_RANGE);
if (cv) {
for (i=0 ; i<NUM_GRAPH_RANGE ; i++) {
addrange(cv, graphRangeTable[i].start,
graphRangeTable[i].end);
}
|
| ︙ | ︙ |
Changes to generic/regc_nfa.c.
| ︙ | ︙ | |||
566 567 568 569 570 571 572 |
}
return NULL;
}
/*
- cparc - allocate a new arc within an NFA, copying details from old one
^ static void cparc(struct nfa *, struct arc *, struct state *,
| | | 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 |
}
return NULL;
}
/*
- cparc - allocate a new arc within an NFA, copying details from old one
^ static void cparc(struct nfa *, struct arc *, struct state *,
^ struct state *);
*/
static void
cparc(
struct nfa *nfa,
struct arc *oa,
struct state *from,
struct state *to)
|
| ︙ | ︙ | |||
637 638 639 640 641 642 643 |
const struct arc *bb = *((const struct arc * const *) b);
/* we check the fields in the order they are most likely to be different */
if (aa->from->no < bb->from->no) {
return -1;
}
if (aa->from->no > bb->from->no) {
| | | | | | | 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 |
const struct arc *bb = *((const struct arc * const *) b);
/* we check the fields in the order they are most likely to be different */
if (aa->from->no < bb->from->no) {
return -1;
}
if (aa->from->no > bb->from->no) {
return 1;
}
if (aa->co < bb->co) {
return -1;
}
if (aa->co > bb->co) {
return 1;
}
if (aa->type < bb->type) {
return -1;
}
if (aa->type > bb->type) {
return 1;
}
return 0;
}
/*
* sortouts - sort the out arcs of a state by to/color/type
*/
|
| ︙ | ︙ | |||
1114 1115 1116 1117 1118 1119 1120 |
/* With not too many arcs, just do them one at a time */
struct arc *a;
for (a = oldState->outs; a != NULL; a = a->outchain) {
cparc(nfa, a, newState, a->to);
}
} else {
| | | 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 |
/* With not too many arcs, just do them one at a time */
struct arc *a;
for (a = oldState->outs; a != NULL; a = a->outchain) {
cparc(nfa, a, newState, a->to);
}
} else {
/*
* With many arcs, use a sort-merge approach. Note that createarc()
* will put new arcs onto the front of newState's chain, so it does
* not break our walk through the sorted part of the chain.
*/
struct arc *oa;
struct arc *na;
|
| ︙ | ︙ | |||
1173 1174 1175 1176 1177 1178 1179 |
}
}
}
/*
- cloneouts - copy out arcs of a state to another state pair, modifying type
^ static void cloneouts(struct nfa *, struct state *, struct state *,
| | | 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 |
}
}
}
/*
- cloneouts - copy out arcs of a state to another state pair, modifying type
^ static void cloneouts(struct nfa *, struct state *, struct state *,
^ struct state *, int);
*/
static void
cloneouts(
struct nfa *nfa,
struct state *old,
struct state *from,
struct state *to,
|
| ︙ | ︙ | |||
1263 1264 1265 1266 1267 1268 1269 | /* - dupnfa - duplicate sub-NFA * Another recursive traversal, this time using tmp to point to duplicates as * well as mark already-seen states. (You knew there was a reason why it's a * state pointer, didn't you? :-)) ^ static void dupnfa(struct nfa *, struct state *, struct state *, | | | 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 |
/*
- dupnfa - duplicate sub-NFA
* Another recursive traversal, this time using tmp to point to duplicates as
* well as mark already-seen states. (You knew there was a reason why it's a
* state pointer, didn't you? :-))
^ static void dupnfa(struct nfa *, struct state *, struct state *,
^ struct state *, struct state *);
*/
static void
dupnfa(
struct nfa *nfa,
struct state *start, /* duplicate of subNFA starting here */
struct state *stop, /* and stopping here */
struct state *from, /* stringing duplicate from here */
|
| ︙ | ︙ | |||
1595 1596 1597 1598 1599 1600 1601 |
s = newstate(nfa);
if (NISERR()) {
return 0;
}
s->tmp = *intermediates;
*intermediates = s;
}
| | | | | 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 |
s = newstate(nfa);
if (NISERR()) {
return 0;
}
s->tmp = *intermediates;
*intermediates = s;
}
cparc(nfa, con, a->from, s);
cparc(nfa, a, s, to);
freearc(nfa, a);
break;
default:
assert(NOTREACHED);
break;
}
}
/*
|
| ︙ | ︙ | |||
1775 1776 1777 1778 1779 1780 1781 |
if (NISERR()) {
return 0;
}
s->tmp = *intermediates;
*intermediates = s;
}
cparc(nfa, con, s, a->to);
| | | | | 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 |
if (NISERR()) {
return 0;
}
s->tmp = *intermediates;
*intermediates = s;
}
cparc(nfa, con, s, a->to);
cparc(nfa, a, from, s);
freearc(nfa, a);
break;
default:
assert(NOTREACHED);
break;
}
}
/*
|
| ︙ | ︙ | |||
2017 2018 2019 2020 2021 2022 2023 |
/* Add s2's original inarcs to arcarray[], but ignore empties */
for (a = inarcsorig[s2->no]; a != NULL; a = a->inchain) {
if (a->type != EMPTY) {
arcarray[arccount++] = a;
}
}
| | | | | | | 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 |
/* Add s2's original inarcs to arcarray[], but ignore empties */
for (a = inarcsorig[s2->no]; a != NULL; a = a->inchain) {
if (a->type != EMPTY) {
arcarray[arccount++] = a;
}
}
/* Reset the tmp fields as we walk back */
nexts = s2->tmp;
s2->tmp = NULL;
}
s->tmp = NULL;
assert(arccount <= totalinarcs);
/* Remember how many original inarcs this state has */
prevnins = s->nins;
/* Add non-duplicate inarcs to target state */
mergeins(nfa, s, arcarray, arccount);
|
| ︙ | ︙ | |||
2181 2182 2183 2184 2185 2186 2187 |
for (a = s->outs; a != NULL && !NISERR(); a = nexta) {
nexta = a->outchain;
if (isconstraintarc(a)) {
if (a->to == s) {
freearc(nfa, a);
} else {
hasconstraints = 1;
| | | | | | 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 |
for (a = s->outs; a != NULL && !NISERR(); a = nexta) {
nexta = a->outchain;
if (isconstraintarc(a)) {
if (a->to == s) {
freearc(nfa, a);
} else {
hasconstraints = 1;
}
}
}
/* If we removed all the outarcs, the state is useless. */
if (s->nouts == 0 && !s->flag) {
dropstate(nfa, s);
}
}
/* Nothing to do if no remaining constraint arcs */
if (NISERR() || !hasconstraints) {
return;
}
|
| ︙ | ︙ | |||
2231 2232 2233 2234 2235 2236 2237 |
s->tmp = NULL;
if ((s->nins == 0 || s->nouts == 0) && !s->flag) {
dropstate(nfa, s);
}
}
if (f != NULL) {
| | | 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 |
s->tmp = NULL;
if ((s->nins == 0 || s->nouts == 0) && !s->flag) {
dropstate(nfa, s);
}
}
if (f != NULL) {
dumpnfa(nfa, f);
}
}
/*
* findconstraintloop - recursively find a loop of constraint arcs
*
* If we find a loop, break it by calling breakconstraintloop(), then
|
| ︙ | ︙ | |||
2721 2722 2723 2724 2725 2726 2727 |
}
nfa->nstates = n;
}
/*
- markreachable - recursive marking of reachable states
^ static void markreachable(struct nfa *, struct state *, struct state *,
| | | 2721 2722 2723 2724 2725 2726 2727 2728 2729 2730 2731 2732 2733 2734 2735 |
}
nfa->nstates = n;
}
/*
- markreachable - recursive marking of reachable states
^ static void markreachable(struct nfa *, struct state *, struct state *,
^ struct state *);
*/
static void
markreachable(
struct nfa *nfa,
struct state *s,
struct state *okay, /* consider only states with this mark */
struct state *mark) /* the value to mark with */
|
| ︙ | ︙ | |||
2745 2746 2747 2748 2749 2750 2751 |
markreachable(nfa, a->to, okay, mark);
}
}
/*
- markcanreach - recursive marking of states which can reach here
^ static void markcanreach(struct nfa *, struct state *, struct state *,
| | | 2745 2746 2747 2748 2749 2750 2751 2752 2753 2754 2755 2756 2757 2758 2759 |
markreachable(nfa, a->to, okay, mark);
}
}
/*
- markcanreach - recursive marking of states which can reach here
^ static void markcanreach(struct nfa *, struct state *, struct state *,
^ struct state *);
*/
static void
markcanreach(
struct nfa *nfa,
struct state *s,
struct state *okay, /* consider only states with this mark */
struct state *mark) /* the value to mark with */
|
| ︙ | ︙ |
Changes to generic/regcomp.c.
| ︙ | ︙ | |||
640 641 642 643 644 645 646 | /* - parse - parse an RE * This is actually just the top level, which parses a bunch of branches tied * together with '|'. They appear in the tree as the left children of a chain * of '|' subres. ^ static struct subre *parse(struct vars *, int, int, struct state *, | | | 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 |
/*
- parse - parse an RE
* This is actually just the top level, which parses a bunch of branches tied
* together with '|'. They appear in the tree as the left children of a chain
* of '|' subres.
^ static struct subre *parse(struct vars *, int, int, struct state *,
^ struct state *);
*/
static struct subre *
parse(
struct vars *v,
int stopper, /* EOS or ')' */
int type, /* LACON (lookahead subRE) or PLAIN */
struct state *init, /* initial state */
|
| ︙ | ︙ | |||
722 723 724 725 726 727 728 | /* - parsebranch - parse one branch of an RE * This mostly manages concatenation, working closely with parseqatom(). * Concatenated things are bundled up as much as possible, with separate * ',' nodes introduced only when necessary due to substructure. ^ static struct subre *parsebranch(struct vars *, int, int, struct state *, | | | 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 |
/*
- parsebranch - parse one branch of an RE
* This mostly manages concatenation, working closely with parseqatom().
* Concatenated things are bundled up as much as possible, with separate
* ',' nodes introduced only when necessary due to substructure.
^ static struct subre *parsebranch(struct vars *, int, int, struct state *,
^ struct state *, int);
*/
static struct subre *
parsebranch(
struct vars *v,
int stopper, /* EOS or ')' */
int type, /* LACON (lookahead subRE) or PLAIN */
struct state *left, /* leftmost state */
|
| ︙ | ︙ | |||
771 772 773 774 775 776 777 | /* - parseqatom - parse one quantified atom or constraint of an RE * The bookkeeping near the end cooperates very closely with parsebranch(); in * particular, it contains a recursion that can involve parsing the rest of * the branch, making this function's name somewhat inaccurate. ^ static void parseqatom(struct vars *, int, int, struct state *, | | | 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 |
/*
- parseqatom - parse one quantified atom or constraint of an RE
* The bookkeeping near the end cooperates very closely with parsebranch(); in
* particular, it contains a recursion that can involve parsing the rest of
* the branch, making this function's name somewhat inaccurate.
^ static void parseqatom(struct vars *, int, int, struct state *,
^ struct state *, struct subre *);
*/
static void
parseqatom(
struct vars *v,
int stopper, /* EOS or ')' */
int type, /* LACON (lookahead subRE) or PLAIN */
struct state *lp, /* left state to hang it on */
|
| ︙ | ︙ | |||
1645 1646 1647 1648 1649 1650 1651 |
dovec(v, allcases(v, c), lp, rp);
}
/*
- dovec - fill in arcs for each element of a cvec
^ static void dovec(struct vars *, struct cvec *, struct state *,
| | | 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 |
dovec(v, allcases(v, c), lp, rp);
}
/*
- dovec - fill in arcs for each element of a cvec
^ static void dovec(struct vars *, struct cvec *, struct state *,
^ struct state *);
*/
static void
dovec(
struct vars *v,
struct cvec *cv,
struct state *lp,
struct state *rp)
|
| ︙ | ︙ |
Changes to generic/rege_dfa.c.
| ︙ | ︙ | |||
155 156 157 158 159 160 161 |
return NULL;
}
/*
- shortest - shortest-preferred matching engine
^ static chr *shortest(struct vars *, struct dfa *, chr *, chr *, chr *,
| | | 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 |
return NULL;
}
/*
- shortest - shortest-preferred matching engine
^ static chr *shortest(struct vars *, struct dfa *, chr *, chr *, chr *,
^ chr **, int *);
*/
static chr * /* endpoint, or NULL */
shortest(
struct vars *const v,
struct dfa *const d,
chr *const start, /* where the match should start */
chr *const min, /* match must end at or after here */
|
| ︙ | ︙ | |||
304 305 306 307 308 309 310 |
}
return nopr;
}
/*
- newDFA - set up a fresh DFA
^ static struct dfa *newDFA(struct vars *, struct cnfa *,
| | | 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 |
}
return nopr;
}
/*
- newDFA - set up a fresh DFA
^ static struct dfa *newDFA(struct vars *, struct cnfa *,
^ struct colormap *, struct smalldfa *);
*/
static struct dfa *
newDFA(
struct vars *const v,
struct cnfa *const cnfa,
struct colormap *const cm,
struct smalldfa *sml) /* preallocated space, may be NULL */
|
| ︙ | ︙ | |||
473 474 475 476 477 478 479 |
d->lastnopr = NULL;
return ss;
}
/*
- miss - handle a cache miss
^ static struct sset *miss(struct vars *, struct dfa *, struct sset *,
| | | 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 |
d->lastnopr = NULL;
return ss;
}
/*
- miss - handle a cache miss
^ static struct sset *miss(struct vars *, struct dfa *, struct sset *,
^ pcolor, chr *, chr *);
*/
static struct sset * /* NULL if goes to empty set */
miss(
struct vars *const v, /* used only for debug flags */
struct dfa *const d,
struct sset *const css,
const pcolor co,
|
| ︙ | ︙ |
Changes to generic/tclDate.c.
| ︙ | ︙ | |||
2645 2646 2647 2648 2649 2650 2651 |
/* ignore spaces at begin */
yyInput = bypassSpaces(yyInput);
/* parse */
status = yyparse(info);
if (status == 1) {
| | | 2645 2646 2647 2648 2649 2650 2651 2652 2653 2654 2655 2656 2657 2658 2659 |
/* ignore spaces at begin */
yyInput = bypassSpaces(yyInput);
/* parse */
status = yyparse(info);
if (status == 1) {
const char *msg = NULL;
if (info->errFlags & CLF_HAVEDATE) {
msg = "more than one date in string";
} else if (info->errFlags & CLF_TIME) {
msg = "more than one time of day in string";
} else if (info->errFlags & CLF_ZONE) {
msg = "more than one time zone in string";
} else if (info->errFlags & CLF_DAYOFWEEK) {
|
| ︙ | ︙ |
Changes to generic/tclGetDate.y.
| ︙ | ︙ | |||
1021 1022 1023 1024 1025 1026 1027 |
/* ignore spaces at begin */
yyInput = bypassSpaces(yyInput);
/* parse */
status = yyparse(info);
if (status == 1) {
| | | 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 |
/* ignore spaces at begin */
yyInput = bypassSpaces(yyInput);
/* parse */
status = yyparse(info);
if (status == 1) {
const char *msg = NULL;
if (info->errFlags & CLF_HAVEDATE) {
msg = "more than one date in string";
} else if (info->errFlags & CLF_TIME) {
msg = "more than one time of day in string";
} else if (info->errFlags & CLF_ZONE) {
msg = "more than one time zone in string";
} else if (info->errFlags & CLF_DAYOFWEEK) {
|
| ︙ | ︙ |
Changes to generic/tclScan.c.
| ︙ | ︙ | |||
364 365 366 367 368 369 370 |
Tcl_SetObjResult(
interp,
Tcl_ObjPrintf("specified field width %" TCL_LL_MODIFIER
"u exceeds limit %" TCL_SIZE_MODIFIER "d.",
ull,
(Tcl_Size)TCL_SIZE_MAX-1));
Tcl_SetErrorCode(
| | | 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 |
Tcl_SetObjResult(
interp,
Tcl_ObjPrintf("specified field width %" TCL_LL_MODIFIER
"u exceeds limit %" TCL_SIZE_MODIFIER "d.",
ull,
(Tcl_Size)TCL_SIZE_MAX-1));
Tcl_SetErrorCode(
interp, "TCL", "FORMAT", "WIDTHLIMIT", (char *)NULL);
goto error;
}
flags |= SCAN_WIDTH;
format += TclUtfToUniChar(format, &ch);
}
/*
|
| ︙ | ︙ |
Changes to generic/tclTest.c.
| ︙ | ︙ | |||
2066 2067 2068 2069 2070 2071 2072 | * UtfTransformFn -- * * Implements a direct call into Tcl_UtfToExternal and Tcl_ExternalToUtf * as otherwise there is no script level command that directly exercises * these functions (i/o command cannot test all combinations) * The arguments at the script level are roughly those of the above * functions: | | | 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 | * UtfTransformFn -- * * Implements a direct call into Tcl_UtfToExternal and Tcl_ExternalToUtf * as otherwise there is no script level command that directly exercises * these functions (i/o command cannot test all combinations) * The arguments at the script level are roughly those of the above * functions: * encodingname srcbytes flags state dstlen ?srcreadvar? ?dstwrotevar? ?dstcharsvar? * * Results: * TCL_OK or TCL_ERROR. This any errors running the test, NOT the * result of Tcl_UtfToExternal or Tcl_ExternalToUtf. * * Side effects: * |
| ︙ | ︙ | |||
3750 3751 3752 3753 3754 3755 3756 |
if (arg[1] != 'r') {
goto wrongArgs;
}
readonly = TCL_LINK_READ_ONLY;
i++;
}
if (Tcl_GetIndexFromObj(interp, objv[i++], LinkType, "type", 0,
| | | | 3750 3751 3752 3753 3754 3755 3756 3757 3758 3759 3760 3761 3762 3763 3764 3765 3766 3767 3768 3769 3770 3771 3772 3773 3774 3775 3776 3777 3778 3779 |
if (arg[1] != 'r') {
goto wrongArgs;
}
readonly = TCL_LINK_READ_ONLY;
i++;
}
if (Tcl_GetIndexFromObj(interp, objv[i++], LinkType, "type", 0,
&typeIndex) != TCL_OK) {
return TCL_ERROR;
}
if (Tcl_GetIntFromObj(interp, objv[i++], &size) == TCL_ERROR) {
Tcl_SetObjResult(interp, Tcl_NewStringObj("wrong size value", -1));
return TCL_ERROR;
}
name = Tcl_GetString(objv[i++]);
/*
* If no address is given request one in the underlying function
*/
if (i < objc) {
if (Tcl_GetWideIntFromObj(interp, objv[i], &addr) == TCL_ERROR) {
Tcl_SetObjResult(interp, Tcl_NewStringObj(
"wrong address value", -1));
return TCL_ERROR;
}
} else {
addr = 0;
}
return Tcl_LinkArray(interp, name, INT2PTR(addr),
|
| ︙ | ︙ | |||
8527 8528 8529 8530 8531 8532 8533 |
TCL_UNUSED(Tcl_Interp *),
const char *name,
TCL_UNUSED(Tcl_Size) /* length */,
TCL_UNUSED(Tcl_Namespace *),
Tcl_ResolvedVarInfo **rPtr)
{
if (*name == 'T') {
| | | | | | | | | | 8527 8528 8529 8530 8531 8532 8533 8534 8535 8536 8537 8538 8539 8540 8541 8542 8543 8544 8545 8546 8547 8548 8549 |
TCL_UNUSED(Tcl_Interp *),
const char *name,
TCL_UNUSED(Tcl_Size) /* length */,
TCL_UNUSED(Tcl_Namespace *),
Tcl_ResolvedVarInfo **rPtr)
{
if (*name == 'T') {
MyResolvedVarInfo *resVarInfo = (MyResolvedVarInfo *)Tcl_Alloc(sizeof(MyResolvedVarInfo));
resVarInfo->vInfo.fetchProc = MyCompiledVarFetch;
resVarInfo->vInfo.deleteProc = MyCompiledVarFree;
resVarInfo->var = NULL;
resVarInfo->nameObj = Tcl_NewStringObj(name, -1);
Tcl_IncrRefCount(resVarInfo->nameObj);
*rPtr = &resVarInfo->vInfo;
return TCL_OK;
}
return TCL_CONTINUE;
}
static int
TestInterpResolverCmd(
TCL_UNUSED(void *),
|
| ︙ | ︙ | |||
8652 8653 8654 8655 8656 8657 8658 |
/*
* The bug trigger. Repeating the command but:
* - we are calling apply with a lambda that is a list (as BEFORE),
* BUT
* - The body of the lambda (lambdaObjs[1]) ALREADY has internal
* representation of ByteCode and thus will not be compiled again
*/
| | < | 8652 8653 8654 8655 8656 8657 8658 8659 8660 8661 8662 8663 8664 8665 8666 |
/*
* The bug trigger. Repeating the command but:
* - we are calling apply with a lambda that is a list (as BEFORE),
* BUT
* - The body of the lambda (lambdaObjs[1]) ALREADY has internal
* representation of ByteCode and thus will not be compiled again
*/
evalObjs[1] = lambdaObj; /* lambdaObj already has a ref count so no need for IncrRef */
result = Tcl_EvalObjv(interp, 2, evalObjs, TCL_EVAL_GLOBAL);
Tcl_DecrRefCount(evalObjs[0]);
Tcl_DecrRefCount(lambdaObj);
return result;
}
|
| ︙ | ︙ |
Changes to generic/tclThreadTest.c.
| ︙ | ︙ | |||
981 982 983 984 985 986 987 |
* Since Tcl_CancelEval can be safely called from any thread,
* we do it now.
*/
Tcl_MutexUnlock(&threadMutex);
Tcl_ResetResult(interp);
return Tcl_CancelEval(tsdPtr->interp,
| | | 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 |
* Since Tcl_CancelEval can be safely called from any thread,
* we do it now.
*/
Tcl_MutexUnlock(&threadMutex);
Tcl_ResetResult(interp);
return Tcl_CancelEval(tsdPtr->interp,
(result != NULL) ? Tcl_NewStringObj(result, -1) : NULL, 0, flags);
}
/*
*------------------------------------------------------------------------
*
* ThreadEventProc --
*
|
| ︙ | ︙ |
Changes to library/auto.tcl.
| ︙ | ︙ | |||
41 42 43 44 45 46 47 | # tcl_findLibrary -- # # This is a utility for extensions that searches for a library directory # using a canonical searching algorithm. A side effect is to source the # initialization script and set a global library variable. # # Arguments: | | | 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 |
# tcl_findLibrary --
#
# This is a utility for extensions that searches for a library directory
# using a canonical searching algorithm. A side effect is to source the
# initialization script and set a global library variable.
#
# Arguments:
# basename Prefix of the directory name, (e.g., "tk")
# version Version number of the package, (e.g., "8.0")
# patch Patchlevel of the package, (e.g., "8.0.3")
# initScript Initialization script to source (e.g., tk.tcl)
# enVarName environment variable to honor (e.g., TK_LIBRARY)
# varName Global variable to set when done (e.g., tk_library)
proc tcl_findLibrary {basename version patch initScript enVarName varName} {
|
| ︙ | ︙ | |||
126 127 128 129 130 131 132 |
} elseif {[zipfs exists [file join $mountpoint $initScript]]} {
lappend dirs [file join $mountpoint $initScript]
set found 1
break
} else {
catch {zipfs unmount $mountpoint}
}
| | | 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 |
} elseif {[zipfs exists [file join $mountpoint $initScript]]} {
lappend dirs [file join $mountpoint $initScript]
set found 1
break
} else {
catch {zipfs unmount $mountpoint}
}
}
}
}
}
# 2. In the package script directory registered within the
# configuration of the package itself.
|
| ︙ | ︙ | |||
476 477 478 479 480 481 482 | # # This procedure allows extensions to register their own commands with the # auto_mkindex facility. For example, a package like [incr Tcl] might # register a "class" command so that class definitions could be added to a # "tclIndex" file for auto-loading. # # Arguments: | | | | | | 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 |
#
# This procedure allows extensions to register their own commands with the
# auto_mkindex facility. For example, a package like [incr Tcl] might
# register a "class" command so that class definitions could be added to a
# "tclIndex" file for auto-loading.
#
# Arguments:
# name Name of command recognized in Tcl files.
# arglist Argument list for command.
# body Implementation of command to handle indexing.
proc auto_mkindex_parser::command {name arglist body} {
hook [list auto_mkindex_parser::commandInit $name $arglist $body]
}
# auto_mkindex_parser::commandInit --
#
# This does the actual work set up by auto_mkindex_parser::command. This is
# called when the interpreter used by the parser is created.
#
# Arguments:
# name Name of command recognized in Tcl files.
# arglist Argument list for command.
# body Implementation of command to handle indexing.
proc auto_mkindex_parser::commandInit {name arglist body} {
variable parser
set ns [namespace qualifiers $name]
set tail [namespace tail $name]
if {$ns eq ""} {
|
| ︙ | ︙ |
Changes to library/clock.tcl.
| ︙ | ︙ | |||
136 137 138 139 140 141 142 |
}
LOCALE_TIME_FORMAT {%H:%M:%S}
LOCALE_YEAR_FORMAT {%EC%Ey}
MONTHS_ABBREV {
Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec
}
MONTHS_FULL {
| | | | | 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 |
}
LOCALE_TIME_FORMAT {%H:%M:%S}
LOCALE_YEAR_FORMAT {%EC%Ey}
MONTHS_ABBREV {
Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec
}
MONTHS_FULL {
January February March
April May June
July August September
October November December
}
PM {pm}
TIME_FORMAT {%H:%M:%S}
TIME_FORMAT_12 {%I:%M:%S %P}
TIME_FORMAT_24 {%H:%M}
TIME_FORMAT_24_SECS {%H:%M:%S}
|
| ︙ | ︙ | |||
288 289 290 291 292 293 294 |
# Translation table to map Windows TZI onto cities, so that the Olson
# rules can apply. In some cases the mapping is ambiguous, so it's wise
# to specify $::env(TCL_TZ) rather than simply depending on the system
# time zone.
# The keys are long lists of values obtained from the time zone
# information in the Registry. In order, the list elements are:
| | | 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 |
# Translation table to map Windows TZI onto cities, so that the Olson
# rules can apply. In some cases the mapping is ambiguous, so it's wise
# to specify $::env(TCL_TZ) rather than simply depending on the system
# time zone.
# The keys are long lists of values obtained from the time zone
# information in the Registry. In order, the list elements are:
# Bias StandardBias DaylightBias
# StandardDate.wYear StandardDate.wMonth StandardDate.wDayOfWeek
# StandardDate.wDay StandardDate.wHour StandardDate.wMinute
# StandardDate.wSecond StandardDate.wMilliseconds
# DaylightDate.wYear DaylightDate.wMonth DaylightDate.wDayOfWeek
# DaylightDate.wDay DaylightDate.wHour DaylightDate.wMinute
# DaylightDate.wSecond DaylightDate.wMilliseconds
# The values are the names of time zones where those rules apply. There
|
| ︙ | ︙ | |||
335 336 337 338 339 340 341 |
{-3600 0 3600 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0} :Atlantic/Cape_Verde
{0 0 3600 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0} :UTC
{0 0 3600 0 10 0 5 2 0 0 0 0 3 0 5 1 0 0 0} :Europe/London
{3600 0 3600 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0} :Africa/Kinshasa
{3600 0 3600 0 10 0 5 3 0 0 0 0 3 0 5 2 0 0 0} :CET
{7200 0 3600 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0} :Africa/Harare
{7200 0 3600 0 9 4 5 23 59 59 0 0 4 4 5 23 59 59 0}
| | | 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 |
{-3600 0 3600 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0} :Atlantic/Cape_Verde
{0 0 3600 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0} :UTC
{0 0 3600 0 10 0 5 2 0 0 0 0 3 0 5 1 0 0 0} :Europe/London
{3600 0 3600 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0} :Africa/Kinshasa
{3600 0 3600 0 10 0 5 3 0 0 0 0 3 0 5 2 0 0 0} :CET
{7200 0 3600 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0} :Africa/Harare
{7200 0 3600 0 9 4 5 23 59 59 0 0 4 4 5 23 59 59 0}
:Africa/Cairo
{7200 0 3600 0 10 0 5 4 0 0 0 0 3 0 5 3 0 0 0} :Europe/Helsinki
{7200 0 3600 0 9 0 3 2 0 0 0 0 3 5 5 2 0 0 0} :Asia/Jerusalem
{7200 0 3600 0 9 0 5 1 0 0 0 0 3 0 5 0 0 0 0} :Europe/Bucharest
{7200 0 3600 0 10 0 5 3 0 0 0 0 3 0 5 2 0 0 0} :Europe/Athens
{7200 0 3600 0 9 5 5 1 0 0 0 0 3 4 5 0 0 0 0} :Asia/Amman
{7200 0 3600 0 10 6 5 23 59 59 999 0 3 0 5 0 0 0 0}
:Asia/Beirut
|
| ︙ | ︙ | |||
476 477 478 479 480 481 482 |
]
# Caches
variable LocFmtMap [dict create]; # Dictionary with localized format maps
variable TimeZoneBad [dict create]; # Dictionary whose keys are time zone
| | | | 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 |
]
# Caches
variable LocFmtMap [dict create]; # Dictionary with localized format maps
variable TimeZoneBad [dict create]; # Dictionary whose keys are time zone
# names and whose values are 1 if
# the time zone is unknown and 0
# if it is known.
variable TZData; # Array whose keys are time zone names
# and whose values are lists of quads
# comprising start time, UTC offset,
# Daylight Saving Time indicator, and
# time zone abbreviation.
variable mcLocales [dict create]; # Dictionary with loaded locales
|
| ︙ | ︙ | |||
514 515 516 517 518 519 520 |
variable mcMergedCat
switch -- $loc system {
set loc [GetSystemLocale]
} current {
set loc [mclocale]
}
if {$loc ne {}} {
| | | 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 |
variable mcMergedCat
switch -- $loc system {
set loc [GetSystemLocale]
} current {
set loc [mclocale]
}
if {$loc ne {}} {
set loc [string tolower $loc]
}
# try to retrieve now if already available:
if {[dict exists $mcMergedCat $loc]} {
return [dict get $mcMergedCat $loc]
}
|
| ︙ | ︙ | |||
647 648 649 650 651 652 653 |
# Side effects:
# Does [mclocale]. If necessary, loades the designated locale's files.
#
#----------------------------------------------------------------------
proc ::tcl::clock::EnterLocale { locale } {
switch -- $locale system {
| | | 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 |
# Side effects:
# Does [mclocale]. If necessary, loades the designated locale's files.
#
#----------------------------------------------------------------------
proc ::tcl::clock::EnterLocale { locale } {
switch -- $locale system {
set locale [GetSystemLocale]
} current {
set locale [mclocale]
}
# Select the locale, eventually load it
mcpackagelocale set $locale
return $locale
}
|
| ︙ | ︙ | |||
997 998 999 1000 1001 1002 1003 |
if {
[catch {
LoadTimeZoneFile [string range $timezone 1 end]
}] && [catch {
LoadZoneinfoFile [string range $timezone 1 end]
}]
} then {
| | | 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 |
if {
[catch {
LoadTimeZoneFile [string range $timezone 1 end]
}] && [catch {
LoadZoneinfoFile [string range $timezone 1 end]
}]
} then {
dict set TimeZoneBad $timezone 1
return -code error \
-errorcode [list CLOCK badTimeZone $timezone] \
"time zone \"$timezone\" not found"
}
} elseif { ![catch {ParsePosixTimeZone $timezone} tzfields] } {
# This looks like a POSIX time zone - try to process it
|
| ︙ | ︙ |
Changes to library/history.tcl.
| ︙ | ︙ | |||
85 86 87 88 89 90 91 | # Add an item to the history, and optionally eval it at the global scope # # Parameters: # event the command to add # exec (optional) a substring of "exec" causes the command to # be evaled. # Results: | | | 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 |
# Add an item to the history, and optionally eval it at the global scope
#
# Parameters:
# event the command to add
# exec (optional) a substring of "exec" causes the command to
# be evaled.
# Results:
# If executing, then the results of the command are returned
#
# Side Effects:
# Adds to the history list
proc ::tcl::HistAdd {event {exec {}}} {
variable history
|
| ︙ | ︙ |
Changes to library/http/http.tcl.
| ︙ | ︙ | |||
2445 2446 2447 2448 2449 2450 2451 |
# later, OR https handshake error, which may be discovered as late as
# the "flush" command above...
Log "WARNING - if testing, pay special attention to this\
case (GI) which is seldom executed - token $token"
if {[info exists state(reusing)] && $state(reusing)} {
# The socket was closed at the server end, and closed at
# this end by http::CheckEof.
| | | 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 |
# later, OR https handshake error, which may be discovered as late as
# the "flush" command above...
Log "WARNING - if testing, pay special attention to this\
case (GI) which is seldom executed - token $token"
if {[info exists state(reusing)] && $state(reusing)} {
# The socket was closed at the server end, and closed at
# this end by http::CheckEof.
if {[TestForReplay $token write $err a]} {
return
} else {
Finish $token {failed to re-use socket}
}
# else:
# This is NOT a persistent socket that has been closed since its
|
| ︙ | ︙ | |||
3392 3393 3394 3395 3396 3397 3398 | # This callback is made when an asynchronous connection completes. # # Arguments # token The token returned from http::geturl # # Side Effects # Sets the status of the connection, which unblocks | | | 3392 3393 3394 3395 3396 3397 3398 3399 3400 3401 3402 3403 3404 3405 3406 |
# This callback is made when an asynchronous connection completes.
#
# Arguments
# token The token returned from http::geturl
#
# Side Effects
# Sets the status of the connection, which unblocks
# the waiting geturl call
proc http::Connect {token proto phost srvurl} {
variable $token
upvar 0 $token state
set tk [namespace tail $token]
if {[catch {eof $state(sock)} tmp] || $tmp} {
|
| ︙ | ︙ | |||
4921 4922 4923 4924 4925 4926 4927 |
catch {chan event $chan readable {}}
return
}
}
}
# http::SplitCommaSeparatedFieldValue --
| | | | 4921 4922 4923 4924 4925 4926 4927 4928 4929 4930 4931 4932 4933 4934 4935 4936 4937 4938 4939 4940 4941 4942 4943 4944 4945 4946 4947 4948 4949 4950 4951 4952 |
catch {chan event $chan readable {}}
return
}
}
}
# http::SplitCommaSeparatedFieldValue --
# Return the individual values of a comma-separated field value.
#
# Arguments:
# fieldValue Comma-separated header field value.
#
# Results:
# List of values.
proc http::SplitCommaSeparatedFieldValue {fieldValue} {
set r {}
foreach el [split $fieldValue ,] {
lappend r [string trim $el]
}
return $r
}
# http::GetFieldValue --
# Return the value of a header field.
#
# Arguments:
# headers Headers key-value list
# fieldName Name of header field whose value to return.
#
# Results:
# The value of the fieldName header field
|
| ︙ | ︙ |
Changes to library/opt/optparse.tcl.
| ︙ | ︙ | |||
807 808 809 810 811 812 813 |
return -code error [OptOptUsage $item]
}
}
}
# Auto magic lazy type determination
proc OptGuessType {arg} {
| | | 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 |
return -code error [OptOptUsage $item]
}
}
}
# Auto magic lazy type determination
proc OptGuessType {arg} {
if { $arg == "true" || $arg == "false" } {
return boolean
}
if {[string is integer -strict $arg]} {
return int
}
if {[string is double -strict $arg]} {
return float
|
| ︙ | ︙ |
Changes to library/package.tcl.
| ︙ | ︙ | |||
500 501 502 503 504 505 506 |
# $file was not readable; silently ignore
continue
} on error msg {
if {[regexp {version conflict for package} $msg]} {
# In case of version conflict, silently ignore
continue
}
| | | 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 |
# $file was not readable; silently ignore
continue
} on error msg {
if {[regexp {version conflict for package} $msg]} {
# In case of version conflict, silently ignore
continue
}
tclLog "error reading package index file $file: $msg"
} on ok {} {
set procdDirs($dir) 1
}
}
}
}
set dir [lindex $use_path end]
|
| ︙ | ︙ | |||
608 609 610 611 612 613 614 |
try {
::tcl::Pkg::source $file
} trap {POSIX EACCES} {} {
# $file was not readable; silently ignore
continue
} on error msg {
if {[regexp {version conflict for package} $msg]} {
| | | 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 |
try {
::tcl::Pkg::source $file
} trap {POSIX EACCES} {} {
# $file was not readable; silently ignore
continue
} on error msg {
if {[regexp {version conflict for package} $msg]} {
# In case of version conflict, silently ignore
continue
}
tclLog "error reading package index file $file: $msg"
} on ok {} {
set procdDirs($dir) 1
}
}
|
| ︙ | ︙ |
Changes to library/platform/shell.tcl.
| ︙ | ︙ | |||
159 160 161 162 163 164 165 |
set maxtries 10
set access [list RDWR CREAT EXCL TRUNC]
set permission 0600
set channel ""
set checked_dir_writable 0
set mypid [pid]
for {set i 0} {$i < $maxtries} {incr i} {
| | | | | | | | | | | | | | | | | | | | | | | | 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 |
set maxtries 10
set access [list RDWR CREAT EXCL TRUNC]
set permission 0600
set channel ""
set checked_dir_writable 0
set mypid [pid]
for {set i 0} {$i < $maxtries} {incr i} {
set newname $prefix
for {set j 0} {$j < $nrand_chars} {incr j} {
append newname [string index $chars \
[expr {int(rand()*62)}]]
}
set newname [file join $tmpdir $newname]
if {[file exists $newname]} {
after 1
} else {
if {[catch {open $newname $access $permission} channel]} {
if {!$checked_dir_writable} {
set dirname [file dirname $newname]
if {![file writable $dirname]} {
return -code error "Directory $dirname is not writable"
}
set checked_dir_writable 1
}
} else {
# Success
close $channel
return [file normalize $newname]
}
}
}
if {$channel ne ""} {
return -code error "Failed to open a temporary file: $channel"
} else {
return -code error "Failed to find an unused temporary file name"
}
}
proc ::platform::shell::DIR {} {
# This code is copied out of Tcllib's fileutil package.
# (TempDir/tempdir)
|
| ︙ | ︙ |
Changes to library/tcltest/tcltest.tcl.
| ︙ | ︙ | |||
511 512 513 514 515 516 517 |
return -code error $msg
} else {
set Option($option) $msg
}
unset $varName
}
namespace eval [namespace current] \
| | | 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 |
return -code error $msg
} else {
set Option($option) $msg
}
unset $varName
}
namespace eval [namespace current] \
[list upvar 0 Option($option) $varName]
# Workaround for Bug (now Feature Request) 572889. Grrrr....
# Track all the variables tied to options
lappend OptionControlledVariables $varName
# Later, set auto-configure read traces on all
# of them, since a single trace on Option does not work.
proc $varName {{value {}}} [subst -nocommands {
if {[llength [info level 0]] == 2} {
|
| ︙ | ︙ | |||
1910 1911 1912 1913 1914 1915 1916 | # previously registered by a call to [customMatch]. # The strings exact, glob, and regexp are preregistered # by the tcltest package. Default value is exact. # # Arguments: # name - Name of test, in the form foo-1.2. # description - Short textual description of the test, to | | | 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 | # previously registered by a call to [customMatch]. # The strings exact, glob, and regexp are preregistered # by the tcltest package. Default value is exact. # # Arguments: # name - Name of test, in the form foo-1.2. # description - Short textual description of the test, to # help humans understand what it does. # # Results: # None. # # Side effects: # Just about anything is possible depending on the test. # |
| ︙ | ︙ | |||
2124 2125 2126 2127 2128 2129 2130 |
set errorFailure 1
}
}
# check if the answer matched the expected answer
# Only check if we ran the body of the test (no setup failure)
if {!$processTest} {
| | | 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 |
set errorFailure 1
}
}
# check if the answer matched the expected answer
# Only check if we ran the body of the test (no setup failure)
if {!$processTest} {
set scriptFailure 0
} elseif {$setupFailure || $codeFailure} {
set scriptFailure 0
} elseif {[set scriptCompare [catch {
CompareStrings $actualAnswer $result $match
} scriptMatch]] == 0} {
set scriptFailure [expr {!$scriptMatch}]
} else {
|
| ︙ | ︙ |
Changes to tools/index.tcl.
| ︙ | ︙ | |||
10 11 12 13 14 15 16 | # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # Global variables used by these scripts: # # state - state variable that controls action of text proc. # # topics - array indexed by (package,section,topic) with value | | | | | 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # Global variables used by these scripts: # # state - state variable that controls action of text proc. # # topics - array indexed by (package,section,topic) with value # of topic ID. # # keywords - array indexed by keyword string with value of topic ID. # # curID - current topic ID, starts at 0 and is incremented for # each new topic file. # # curPkg - current package name (e.g. Tcl). # # curSect - current section title (e.g. "Tcl Built-In Commands"). # # getPackages -- |
| ︙ | ︙ |
Changes to tools/makeTestCases.tcl.
| ︙ | ︙ | |||
211 212 213 214 215 216 217 |
proc testcases2 { f2 } {
listYears startOfYear
# Define the roman numerals
set roman {
| | | | 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 |
proc testcases2 { f2 } {
listYears startOfYear
# Define the roman numerals
set roman {
? i ii iii iv v vi vii viii ix
x xi xii xiii xiv xv xvi xvii xviii xix
xx xxi xxii xxiii xxiv xxv xxvi xxvii xxviii xxix
xxx xxxi xxxii xxxiii xxxiv xxxv xxxvi xxxvii xxxviii xxxix
xl xli xlii xliii xliv xlv xlvi xlvii xlviii xlix
l li lii liii liv lv lvi lvii lviii lix
lx lxi lxii lxiii lxiv lxv lxvi lxvii lxviii lxix
lxx lxxi lxxii lxxiii lxxiv lxxv lxxvi lxxvii lxxviii lxxix
lxxx lxxxi lxxxii lxxxiii lxxxiv lxxxv lxxxvi lxxxvii lxxxviii lxxxix
xc xci xcii xciii xciv xcv xcvi xcvii xcviii xcix
c
}
set romanc {
? c cc ccc cd d dc dcc dccc cm
m mc mcc mccc mcd md mdc mdcc mdccc mcm
mm mmc mmcc mmccc mmcd mmd mmdc mmdcc mmdccc mmcm
mmm mmmc mmmcc mmmccc mmmcd mmmd mmmdc mmmdcc mmmdccc mmmcm
}
# Names of the months
|
| ︙ | ︙ |
Changes to tools/tclOOScript.tcl.
1 2 | # tclOOScript.h -- # | | | | | 1 2 3 4 5 6 7 8 9 10 11 12 | # tclOOScript.h -- # # This file contains support scripts for TclOO. They are defined here so # that the code can be definitely run even in safe interpreters; TclOO's # core setup is safe. # # Copyright © 2012-2019 Donal K. Fellows # Copyright © 2013 Andreas Kupries # Copyright © 2017 Gerald Lester # # See the file "license.terms" for information on usage and redistribution of # this file, and for a DISCLAIMER OF ALL WARRANTIES. |
| ︙ | ︙ |
Changes to tools/tcltk-man2html.tcl.
| ︙ | ︙ | |||
606 607 608 609 610 611 612 |
wide() mathfunc
packagens pkg::create
pkgMkIndex pkg_mkIndex
pkg_mkIndex pkg_mkIndex
Tcl_Obj Tcl_NewObj
Tcl_ObjType Tcl_RegisterObjType
Tcl_OpenFileChannelProc Tcl_FSOpenFileChannel
| | | | 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 |
wide() mathfunc
packagens pkg::create
pkgMkIndex pkg_mkIndex
pkg_mkIndex pkg_mkIndex
Tcl_Obj Tcl_NewObj
Tcl_ObjType Tcl_RegisterObjType
Tcl_OpenFileChannelProc Tcl_FSOpenFileChannel
errorinfo env
errorcode env
tcl_pkgpath env
Tcl_Command Tcl_CreateObjCommand
Tcl_CmdProc Tcl_CreateObjCommand
Tcl_CmdDeleteProc Tcl_CreateObjCommand
Tcl_ObjCmdProc Tcl_CreateObjCommand
Tcl_Channel Tcl_OpenFileChannel
Tcl_WideInt Tcl_NewIntObj
|
| ︙ | ︙ |
Changes to unix/Makefile.in.
1 2 3 4 5 6 | # # This file is a Makefile for Tcl. If it has the name "Makefile.in" then it is # a template for a Makefile; to generate the actual Makefile, run # "./configure", which is a configuration script generated by the "autoconf" # program (constructs like "@foo@" will get replaced in the actual Makefile. | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 | # # This file is a Makefile for Tcl. If it has the name "Makefile.in" then it is # a template for a Makefile; to generate the actual Makefile, run # "./configure", which is a configuration script generated by the "autoconf" # program (constructs like "@foo@" will get replaced in the actual Makefile. VERSION = @TCL_VERSION@ MAJOR_VERSION = @TCL_MAJOR_VERSION@ MINOR_VERSION = @TCL_MINOR_VERSION@ PATCH_LEVEL = @TCL_PATCH_LEVEL@ #-------------------------------------------------------------------------- # Things you can change to personalize the Makefile for your own site (you can # make these changes in either Makefile.in or Makefile, but changes to |
| ︙ | ︙ |
Changes to unix/configure.
| ︙ | ︙ | |||
5792 5793 5794 5795 5796 5797 5798 |
# AIX requires the _r compiler when gcc isn't being used
case "${CC}" in
*_r|*_r\ *)
# ok ...
;;
*)
# Make sure only first arg gets _r
| | | 5792 5793 5794 5795 5796 5797 5798 5799 5800 5801 5802 5803 5804 5805 5806 |
# AIX requires the _r compiler when gcc isn't being used
case "${CC}" in
*_r|*_r\ *)
# ok ...
;;
*)
# Make sure only first arg gets _r
CC=`echo "$CC" | sed -e 's/^\([^ ]*\)/\1_r/'`
;;
esac
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: Using $CC for compiling with threads" >&5
printf "%s\n" "Using $CC for compiling with threads" >&6; }
fi
LIBS="$LIBS -lc"
|
| ︙ | ︙ | |||
10012 10013 10014 10015 10016 10017 10018 |
#include <sys/types.h>
#include <sys/socket.h>
int
main (void)
{
| | | 10012 10013 10014 10015 10016 10017 10018 10019 10020 10021 10022 10023 10024 10025 10026 |
#include <sys/types.h>
#include <sys/socket.h>
int
main (void)
{
socklen_t foo;
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"
then :
|
| ︙ | ︙ |
Changes to unix/configure.ac.
| ︙ | ︙ | |||
400 401 402 403 404 405 406 |
AC_TYPE_UID_T
AC_CACHE_CHECK([for socklen_t], tcl_cv_type_socklen_t, [
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#include <sys/types.h>
#include <sys/socket.h>
]], [[
| | | 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 |
AC_TYPE_UID_T
AC_CACHE_CHECK([for socklen_t], tcl_cv_type_socklen_t, [
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#include <sys/types.h>
#include <sys/socket.h>
]], [[
socklen_t foo;
]])],[tcl_cv_type_socklen_t=yes],[tcl_cv_type_socklen_t=no])])
if test $tcl_cv_type_socklen_t = no; then
AC_DEFINE(socklen_t, int, [Define as int if socklen_t is not available])
fi
AC_CHECK_TYPES([intptr_t, uintptr_t],,,[[
#include <stdint.h>
|
| ︙ | ︙ |
Changes to unix/dltest/embtest.c.
| ︙ | ︙ | |||
30 31 32 33 34 35 36 |
printf("Tcl_FindExecutable gives version %s\n", version);
}
if (tclStubsPtr == NULL) {
printf("ERROR: Tcl_FindExecutable does not initialize the stub table\n");
exitcode = 1;
}
if (!exitcode) {
| | | 30 31 32 33 34 35 36 37 38 39 40 |
printf("Tcl_FindExecutable gives version %s\n", version);
}
if (tclStubsPtr == NULL) {
printf("ERROR: Tcl_FindExecutable does not initialize the stub table\n");
exitcode = 1;
}
if (!exitcode) {
printf("All OK!\n");
}
return exitcode;
}
|
Changes to unix/tcl.m4.
| ︙ | ︙ | |||
986 987 988 989 990 991 992 |
# AIX requires the _r compiler when gcc isn't being used
case "${CC}" in
*_r|*_r\ *)
# ok ...
;;
*)
# Make sure only first arg gets _r
| | | 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 |
# AIX requires the _r compiler when gcc isn't being used
case "${CC}" in
*_r|*_r\ *)
# ok ...
;;
*)
# Make sure only first arg gets _r
CC=`echo "$CC" | sed -e 's/^\([[^ ]]*\)/\1_r/'`
;;
esac
AC_MSG_RESULT([Using $CC for compiling with threads])
])
LIBS="$LIBS -lc"
SHLIB_CFLAGS=""
SHLIB_SUFFIX=".so"
|
| ︙ | ︙ |
Changes to unix/tclUnixTest.c.
| ︙ | ︙ | |||
545 546 547 548 549 550 551 | * * Signal handler for the alarm command. * * Results: * None. * * Side effects: | | | | 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 |
*
* Signal handler for the alarm command.
*
* Results:
* None.
*
* Side effects:
* Calls the Tcl Async handler.
*
*----------------------------------------------------------------------
*/
static void
AlarmHandler(
TCL_UNUSED(int) /*signum*/)
{
gotsig = "1";
}
/*
*----------------------------------------------------------------------
*
* TestgotsigCmd --
*
* Verify the signal was handled after the testalarm command.
*
* Results:
* None.
*
* Side Effects:
* Resets the value of gotsig back to '0'.
*
|
| ︙ | ︙ |
Changes to win/Makefile.in.
| ︙ | ︙ | |||
75 76 77 78 79 80 81 | # The default switches for optimization or debugging CFLAGS_DEBUG = @CFLAGS_DEBUG@ CFLAGS_OPTIMIZE = @CFLAGS_OPTIMIZE@ # To change the compiler switches, for example to change from optimization to # debugging symbols, change the following line: | | | | | | 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 | # The default switches for optimization or debugging CFLAGS_DEBUG = @CFLAGS_DEBUG@ CFLAGS_OPTIMIZE = @CFLAGS_OPTIMIZE@ # To change the compiler switches, for example to change from optimization to # debugging symbols, change the following line: #CFLAGS = $(CFLAGS_DEBUG) #CFLAGS = $(CFLAGS_OPTIMIZE) #CFLAGS = $(CFLAGS_DEBUG) $(CFLAGS_OPTIMIZE) CFLAGS = @CFLAGS@ @CFLAGS_DEFAULT@ -DMP_FIXED_CUTOFFS -D__USE_MINGW_ANSI_STDIO=0 # To compile without backward compatibility and deprecated code uncomment the # following NO_DEPRECATED_FLAGS = #NO_DEPRECATED_FLAGS = -DTCL_NO_DEPRECATED # To enable compilation debugging reverse the comment characters on one of the |
| ︙ | ︙ | |||
158 159 160 161 162 163 164 |
package ifneeded dde 1.4.5 [list load ${DDE_DLL_FILE}];\
package ifneeded registry 1.3.7 [list load ${REG_DLL_FILE}]
TEST_LOAD_FACILITIES = package ifneeded tcl::test ${VERSION}@TCL_PATCH_LEVEL@ [list load ${TEST_DLL_FILE} Tcltest];\
$(TEST_LOAD_PRMS)
ZLIB_DLL_FILE = zlib1.dll
TOMMATH_DLL_FILE = libtommath.dll
| | | 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 |
package ifneeded dde 1.4.5 [list load ${DDE_DLL_FILE}];\
package ifneeded registry 1.3.7 [list load ${REG_DLL_FILE}]
TEST_LOAD_FACILITIES = package ifneeded tcl::test ${VERSION}@TCL_PATCH_LEVEL@ [list load ${TEST_DLL_FILE} Tcltest];\
$(TEST_LOAD_PRMS)
ZLIB_DLL_FILE = zlib1.dll
TOMMATH_DLL_FILE = libtommath.dll
SHARED_LIBRARIES = $(TCL_DLL_FILE) @ZLIB_DLL_FILE@ @TOMMATH_DLL_FILE@
STATIC_LIBRARIES = $(TCL_LIB_FILE)
TCLSH = tclsh$(VER)${EXESUFFIX}
WINE = @WINE@
CAT32 = cat32$(EXEEXT)
# For cross-compiled builds, TCL_EXE is the name of a tclsh executable that is
|
| ︙ | ︙ |
Changes to win/makefile.vc.
| ︙ | ︙ | |||
53 54 55 56 57 58 59 | # # Basic macros and options usable on the commandline (see rules.vc for more info): # OPTS=nomsvcrt,noembed,nothreads,pdbs,profile,static,symbols,thrdalloc,unchecked,none # Sets special options for the core. The default is for none. # Any combination of the above may be used (comma separated). # 'none' will over-ride everything to nothing. # | | | 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 | # # Basic macros and options usable on the commandline (see rules.vc for more info): # OPTS=nomsvcrt,noembed,nothreads,pdbs,profile,static,symbols,thrdalloc,unchecked,none # Sets special options for the core. The default is for none. # Any combination of the above may be used (comma separated). # 'none' will over-ride everything to nothing. # # noembed = Without this option, the Tcl core library scripts # are embedded into the executable if "static" is # specified in OPTS, or into the DLL otherwise. If # "noembed" is specified, the scripts are not embedded # but copied to the installation target (as in 8.6). # nomsvcrt = Affects the static option only to switch it from # using msvcrt(d) as the C runtime [by default] to # libcmt(d). This is useful for static embedding |
| ︙ | ︙ |
Changes to win/rules.vc.
| ︙ | ︙ | |||
1244 1245 1246 1247 1248 1249 1250 | !if $(TK_MAJOR_VERSION) == 8 TKSTUBLIBNAME = tkstub$(TK_VERSION).lib !else TKSTUBLIBNAME = tkstub.lib !endif !if $(DOING_TK) | | | 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 | !if $(TK_MAJOR_VERSION) == 8 TKSTUBLIBNAME = tkstub$(TK_VERSION).lib !else TKSTUBLIBNAME = tkstub.lib !endif !if $(DOING_TK) WISH = $(OUT_DIR)\$(WISHNAME) TKSTUBLIB = $(OUT_DIR)\$(TKSTUBLIBNAME) TKIMPLIB = $(OUT_DIR)\$(TKIMPLIBNAME) TKLIB = $(OUT_DIR)\$(TKLIBNAME) TK_INCLUDES = -I"$(WIN_DIR)" -I"$(GENERICDIR)" TKSCRIPTZIP = $(OUT_DIR)\$(TKSCRIPTZIPNAME) !else # effectively NEED_TK |
| ︙ | ︙ |
Changes to win/tcl.rc.
| ︙ | ︙ | |||
15 16 17 18 19 20 21 | #define SUFFIX SUFFIX_DEBUG LANGUAGE 0x9, 0x1 /* LANG_ENGLISH, SUBLANG_DEFAULT */ VS_VERSION_INFO VERSIONINFO | | | | | | | | | 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
#define SUFFIX SUFFIX_DEBUG
LANGUAGE 0x9, 0x1 /* LANG_ENGLISH, SUBLANG_DEFAULT */
VS_VERSION_INFO VERSIONINFO
FILEVERSION TCL_MAJOR_VERSION,TCL_MINOR_VERSION,TCL_RELEASE_LEVEL,TCL_RELEASE_SERIAL
PRODUCTVERSION TCL_MAJOR_VERSION,TCL_MINOR_VERSION,TCL_RELEASE_LEVEL,TCL_RELEASE_SERIAL
FILEFLAGSMASK 0x3fL
#ifdef DEBUG
FILEFLAGS VS_FF_DEBUG
#else
FILEFLAGS 0x0L
#endif
FILEOS VOS__WINDOWS32
FILETYPE VFT_DLL
FILESUBTYPE 0x0L
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904b0" /* LANG_ENGLISH/SUBLANG_ENGLISH_US, Unicode CP */
BEGIN
VALUE "FileDescription", "Tcl DLL\0"
VALUE "OriginalFilename", "tcl" STRINGIFY(TCL_MAJOR_VERSION) STRINGIFY(TCL_MINOR_VERSION) SUFFIX ".dll\0"
|
| ︙ | ︙ |
Changes to win/tclsh.rc.
| ︙ | ︙ | |||
22 23 24 25 26 27 28 | #define SUFFIX SUFFIX_STATIC SUFFIX_DEBUG LANGUAGE 0x9, 0x1 /* LANG_ENGLISH, SUBLANG_DEFAULT */ VS_VERSION_INFO VERSIONINFO | | | | | | | | | 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
#define SUFFIX SUFFIX_STATIC SUFFIX_DEBUG
LANGUAGE 0x9, 0x1 /* LANG_ENGLISH, SUBLANG_DEFAULT */
VS_VERSION_INFO VERSIONINFO
FILEVERSION TCL_MAJOR_VERSION,TCL_MINOR_VERSION,TCL_RELEASE_LEVEL,TCL_RELEASE_SERIAL
PRODUCTVERSION TCL_MAJOR_VERSION,TCL_MINOR_VERSION,TCL_RELEASE_LEVEL,TCL_RELEASE_SERIAL
FILEFLAGSMASK 0x3fL
#ifdef DEBUG
FILEFLAGS VS_FF_DEBUG
#else
FILEFLAGS 0x0L
#endif
FILEOS VOS__WINDOWS32
FILETYPE VFT_APP
FILESUBTYPE 0x0L
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904b0"
BEGIN
VALUE "FileDescription", "Tclsh Application\0"
VALUE "OriginalFilename", "tclsh" STRINGIFY(TCL_MAJOR_VERSION) STRINGIFY(TCL_MINOR_VERSION) SUFFIX ".exe\0"
|
| ︙ | ︙ |
Changes to win/tcltest.rc.
| ︙ | ︙ | |||
22 23 24 25 26 27 28 | #define SUFFIX SUFFIX_STATIC SUFFIX_DEBUG LANGUAGE 0x9, 0x1 /* LANG_ENGLISH, SUBLANG_DEFAULT */ VS_VERSION_INFO VERSIONINFO | | | | | | | | | 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
#define SUFFIX SUFFIX_STATIC SUFFIX_DEBUG
LANGUAGE 0x9, 0x1 /* LANG_ENGLISH, SUBLANG_DEFAULT */
VS_VERSION_INFO VERSIONINFO
FILEVERSION TCL_MAJOR_VERSION,TCL_MINOR_VERSION,TCL_RELEASE_LEVEL,TCL_RELEASE_SERIAL
PRODUCTVERSION TCL_MAJOR_VERSION,TCL_MINOR_VERSION,TCL_RELEASE_LEVEL,TCL_RELEASE_SERIAL
FILEFLAGSMASK 0x3fL
#ifdef DEBUG
FILEFLAGS VS_FF_DEBUG
#else
FILEFLAGS 0x0L
#endif
FILEOS VOS__WINDOWS32
FILETYPE VFT_APP
FILESUBTYPE 0x0L
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904b0"
BEGIN
VALUE "FileDescription", "Tcltest Application\0"
VALUE "OriginalFilename", "tcltest" STRINGIFY(TCL_MAJOR_VERSION) STRINGIFY(TCL_MINOR_VERSION) SUFFIX ".exe\0"
|
| ︙ | ︙ |