Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Changes In Branch bug-39f6304c2e Through [a4e62ef88d] Excluding Merge-Ins
This is equivalent to a diff from 3fe8ec5fd6 to a4e62ef88d
|
2017-01-27
| ||
| 14:31 | Some code cleanup: More internal use of size_t, less type casts (because of this). No functional cha... check-in: 0867ec3f75 user: jan.nijtmans tags: trunk | |
| 10:11 | Slightly better implementation: re-use the function SetInvalidRealFromAny() in the double/float hand... check-in: 86e7f474f3 user: jan.nijtmans tags: bug-39f6304c2e | |
|
2017-01-26
| ||
| 11:49 | Extend booleans to accept "+" and "-" as valid representation. And extend Tcl_LinkVar to accept bool... check-in: a4e62ef88d user: jan.nijtmans tags: bug-39f6304c2e | |
|
2017-01-25
| ||
| 12:50 | Convert Tcl_SetResult() to a macro check-in: 36aa4f35f8 user: jan.nijtmans tags: novem | |
| 12:22 | If TCL_NO_DEPRECATED is defined, remove the "case" statement, and use much less interp->result. Impl... check-in: 3fe8ec5fd6 user: jan.nijtmans tags: trunk | |
|
2017-01-20
| ||
| 16:21 | Fix [39f6304c2e90549c209cd11a7920dc9921b9f48e|39f6304c2e] follow-up: Make Tcl_LinkVar toleranto to t... check-in: a1398bebc9 user: jan.nijtmans tags: trunk | |
|
2016-12-22
| ||
| 10:26 | Merge trunk. Implement sequences like "0x", "0b" and "0o" as well. And also the "." for doubles and ... check-in: 8b14191fae user: jan.nijtmans tags: bug-39f6304c2e | |
Changes to doc/GetInt.3.
| ︙ | |||
85 86 87 88 89 90 91 | 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 | - + - + | initial sequence of digits should take one of the forms that \fBTcl_GetInt\fR supports, described above. The use of .QW \fB,\fR as a decimal point is not supported nor should any other sort of inter-digit separator be present. .PP \fBTcl_GetBoolean\fR expects \fIsrc\fR to specify a boolean |
Changes to generic/tclGet.c.
| ︙ | |||
121 122 123 124 125 126 127 | 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 | - + |
*----------------------------------------------------------------------
*/
int
Tcl_GetBoolean(
Tcl_Interp *interp, /* Interpreter used for error reporting. */
const char *src, /* String containing one of the boolean values
|
| ︙ |
Changes to generic/tclLink.c.
| ︙ | |||
63 64 65 66 67 68 69 | 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 | - + | /* * Forward references to functions defined later in this file: */ static char * LinkTraceProc(ClientData clientData,Tcl_Interp *interp, const char *name1, const char *name2, int flags); static Tcl_Obj * ObjValue(Link *linkPtr); |
| ︙ | |||
380 381 382 383 384 385 386 | 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 | - + - + - + - + |
return (char *) "internal error: linked variable couldn't be read";
}
switch (linkPtr->type) {
case TCL_LINK_INT:
if (Tcl_GetIntFromObj(NULL, valueObj, &linkPtr->lastValue.i)
!= TCL_OK) {
|
| ︙ | |||
437 438 439 440 441 442 443 | 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 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 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 | - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + |
}
LinkedVar(int) = linkPtr->lastValue.i;
break;
case TCL_LINK_CHAR:
if (Tcl_GetIntFromObj(NULL, valueObj, &valueInt) != TCL_OK
|| valueInt < SCHAR_MIN || valueInt > SCHAR_MAX) {
|
| ︙ | |||
684 685 686 687 688 689 690 | 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 | - - - + + - + |
NULL, /* dupIntRepProc */
NULL, /* updateStringProc */
SetInvalidRealFromAny /* setFromAnyProc */
};
static int
SetInvalidRealFromAny(Tcl_Interp *interp, Tcl_Obj *objPtr) {
|
| ︙ | |||
716 717 718 719 720 721 722 | 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 | - - - - + + + + - + - - + - - - - - + + - + - + - - - + + + + + + + + - + |
}
}
return TCL_ERROR;
}
/*
|
Changes to generic/tclObj.c.
| ︙ | |||
2000 2001 2002 2003 2004 2005 2006 | 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 | - + - + + |
return TCL_ERROR;
}
static int
ParseBoolean(
register Tcl_Obj *objPtr) /* The object to parse/convert. */
{
|
| ︙ | |||
2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 | 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 | + + + + + + + + + + + + |
}
return TCL_ERROR;
case '1':
if (length == 1) {
newBool = 1;
goto numericBoolean;
}
return TCL_ERROR;
case '-':
if (length == 1) {
newBool = 0;
goto goodBoolean;
}
return TCL_ERROR;
case '+':
if (length == 1) {
newBool = 1;
goto goodBoolean;
}
return TCL_ERROR;
}
/*
* Force to lower case for case-insensitive detection. Filter out known
* invalid characters at the same time.
*/
|
| ︙ | |||
2078 2079 2080 2081 2082 2083 2084 | 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 | - - - - - + + - - + + |
case 'f':
if (strncmp(lowerCase, "false", (size_t) length) == 0) {
newBool = 0;
goto goodBoolean;
}
return TCL_ERROR;
case 'o':
|
| ︙ |
Changes to tests/link.test.
| ︙ | |||
63 64 65 66 67 68 69 | 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 | - + - + |
} -result {465 -10.5 1 abcdef 135135 79 161 8000 40000 -1073628482 34543 567890 1.0987653732299805 357357357357 | 0o0721 -10.5 true abcdef 135135 79 161 8000 40000 0xc001babe 34543 567890 1.0987654321 357357357357}
test link-2.2 {writing bad values into variables} -setup {
testlink delete
} -constraints {testlink} -body {
testlink set 43 1.23 4 - 56785678 64 250 30000 60000 0xbeefbabe 12321 32123 3.25 1231231234
testlink create 1 1 1 1 1 1 1 1 1 1 1 1 1 1
list [catch {set int 09a} msg] $msg $int
|
| ︙ | |||
305 306 307 308 309 310 311 | 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 | - + |
proc x {} {
upvar int y
set y abc
}
testlink create 1 1 1 1 1 1 1 1 1 1 1 1 1 1
testlink set -4 {} {} {} {} {} {} {} {} {} {} {} {} {}
list [catch x msg] $msg $int
|
| ︙ | |||
338 339 340 341 342 343 344 | 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 | - + |
proc x {} {
upvar wide y
set y abc
}
testlink create 1 1 1 1 1 1 1 1 1 1 1 1 1 1
testlink set -4 16.3 1 {} 778899 {} {} {} {} {} {} {} {} {}
list [catch x msg] $msg $wide
|
| ︙ |