Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | Stop generating string rep of dict when converting to list. |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | core-8-5-branch |
Files: | files | file ages | folders |
SHA1: |
746b228680c5817d5515c9ca543aa321 |
User & Date: | dgp 2011-05-05 16:35:00 |
Context
2011-05-05
| ||
16:53 | Tolerate NULL interps more completely. check-in: e7adc1255d user: dgp tags: core-8-5-branch | |
16:35 | Stop generating string rep of dict when converting to list. check-in: 746b228680 user: dgp tags: core-8-5-branch | |
2011-05-03
| ||
19:07 | Tighten Tcl_SplitList(). check-in: eeab23b73b user: dgp tags: core-8-5-branch | |
Changes
Changes to ChangeLog.
1 2 3 4 5 6 7 | 2011-05-03 Don Porter <[email protected]> * generic/tclUtil.c: Tighten Tcl_SplitList(). * generic/tclListObj.c: Tighten SetListFromAny(). * generic/tclDictObj.c: Tighten SetDictFromAny(). 2011-05-02 Don Porter <[email protected]> | > > > > > | 1 2 3 4 5 6 7 8 9 10 11 12 | 2011-05-05 Don Porter <[email protected]> * generic/tclListObj.c: Stop generating string rep of dict when converting to list. 2011-05-03 Don Porter <[email protected]> * generic/tclUtil.c: Tighten Tcl_SplitList(). * generic/tclListObj.c: Tighten SetListFromAny(). * generic/tclDictObj.c: Tighten SetDictFromAny(). 2011-05-02 Don Porter <[email protected]> |
︙ | ︙ |
Changes to generic/tclListObj.c.
︙ | ︙ | |||
585 586 587 588 589 590 591 | if (Tcl_IsShared(listPtr)) { Tcl_Panic("%s called with shared object", "Tcl_ListObjAppendElement"); } if (listPtr->typePtr != &tclListType) { int result, length; | > > > | > | 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 | if (Tcl_IsShared(listPtr)) { Tcl_Panic("%s called with shared object", "Tcl_ListObjAppendElement"); } if (listPtr->typePtr != &tclListType) { int result, length; if (listPtr->typePtr == &tclDictType) { (void) Tcl_DictObjSize(NULL, listPtr, &length); } else { (void) TclGetStringFromObj(listPtr, &length); } if (!length) { Tcl_SetListObj(listPtr, 1, &objPtr); return TCL_OK; } result = SetListFromAny(interp, listPtr); if (result != TCL_OK) { |
︙ | ︙ | |||
696 697 698 699 700 701 702 | Tcl_Obj **objPtrPtr) /* The resulting Tcl_Obj* is stored here. */ { register List *listRepPtr; if (listPtr->typePtr != &tclListType) { int result, length; | > > > | > | 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 | Tcl_Obj **objPtrPtr) /* The resulting Tcl_Obj* is stored here. */ { register List *listRepPtr; if (listPtr->typePtr != &tclListType) { int result, length; if (listPtr->typePtr == &tclDictType) { (void) Tcl_DictObjSize(NULL, listPtr, &length); } else { (void) TclGetStringFromObj(listPtr, &length); } if (!length) { *objPtrPtr = NULL; return TCL_OK; } result = SetListFromAny(interp, listPtr); if (result != TCL_OK) { |
︙ | ︙ | |||
751 752 753 754 755 756 757 | register int *intPtr) /* The resulting int is stored here. */ { register List *listRepPtr; if (listPtr->typePtr != &tclListType) { int result, length; | > > > > > > > > > > > > | > | 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 | register int *intPtr) /* The resulting int is stored here. */ { register List *listRepPtr; if (listPtr->typePtr != &tclListType) { int result, length; if (listPtr->typePtr == &tclDictType) { (void) Tcl_DictObjSize(NULL, listPtr, &length); /* * It's tempting to just report 2*length as the list length * of this dict, but arguably that's false since the max sizes * for dicts and lists are not the same, so some dicts don't * actually convert to lists, and it's good to get that error * back from the SetListFromAny() call below instead of a false * indication we can treat the value as a list. ([llength $val] * often used as a "listiness" test) */ } else { (void) TclGetStringFromObj(listPtr, &length); } if (!length) { *intPtr = 0; return TCL_OK; } result = SetListFromAny(interp, listPtr); if (result != TCL_OK) { |
︙ | ︙ | |||
826 827 828 829 830 831 832 | if (Tcl_IsShared(listPtr)) { Tcl_Panic("%s called with shared object", "Tcl_ListObjReplace"); } if (listPtr->typePtr != &tclListType) { int length; | > > > | > | 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 | if (Tcl_IsShared(listPtr)) { Tcl_Panic("%s called with shared object", "Tcl_ListObjReplace"); } if (listPtr->typePtr != &tclListType) { int length; if (listPtr->typePtr == &tclDictType) { (void) Tcl_DictObjSize(NULL, listPtr, &length); } else { (void) TclGetStringFromObj(listPtr, &length); } if (!length) { if (objc) { Tcl_SetListObj(listPtr, objc, NULL); } else { return TCL_OK; } } else { |
︙ | ︙ | |||
1522 1523 1524 1525 1526 1527 1528 | if (Tcl_IsShared(listPtr)) { Tcl_Panic("%s called with shared object", "TclListObjSetElement"); } if (listPtr->typePtr != &tclListType) { int length, result; | > > > | > | 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 | if (Tcl_IsShared(listPtr)) { Tcl_Panic("%s called with shared object", "TclListObjSetElement"); } if (listPtr->typePtr != &tclListType) { int length, result; if (listPtr->typePtr == &tclDictType) { (void) Tcl_DictObjSize(NULL, listPtr, &length); } else { (void) TclGetStringFromObj(listPtr, &length); } if (!length) { Tcl_SetObjResult(interp, Tcl_NewStringObj("list index out of range", -1)); return TCL_ERROR; } result = SetListFromAny(interp, listPtr); if (result != TCL_OK) { |
︙ | ︙ |