Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Changes In Branch lset-index Excluding Merge-Ins
This is equivalent to a diff from d3d2b49204 to 69c8d35a07
2020-02-21
| ||
08:52 | Merge 8.6 check-in: 10d8a95829 user: jan.nijtmans tags: core-8-branch | |
2020-02-19
| ||
20:18 | Merge 8.7 (this makes Travis build pass again) check-in: 8a48c3a5d0 user: jan.nijtmans tags: dgp-review | |
10:31 | Handle endValue < -1. Improve documentation of new behavior. Leaf check-in: 69c8d35a07 user: jan.nijtmans tags: lset-index | |
2020-02-18
| ||
12:32 | Handle invalid "lset" arguments better. Restrict Tcl_GetIntForIndex() index results between -1 (nega... check-in: 0245735b8a user: jan.nijtmans tags: lset-index | |
2020-02-13
| ||
22:06 | Merge 8.7 check-in: c59e305ca6 user: jan.nijtmans tags: cplusplus | |
2020-02-12
| ||
13:26 | Merge 8.7 Closed-Leaf check-in: ba5fe2748a user: jan.nijtmans tags: unicode-13 | |
13:25 | Merge 8.7 check-in: 1df476859c user: jan.nijtmans tags: death-to-dbgx | |
13:25 | Merge 8.7 Closed-Leaf check-in: 6a19552cea user: jan.nijtmans tags: deprecate-channel-type-1-4 | |
13:24 | Merge 8.7 check-in: eea71a4ef7 user: jan.nijtmans tags: tip-558 | |
13:19 | Merge 8.7 check-in: 7deb4251a7 user: jan.nijtmans tags: trunk | |
13:18 | Merge 8.6 check-in: d3d2b49204 user: jan.nijtmans tags: core-8-branch | |
13:12 | Fix travis build, due to the change of Windows image. check-in: 113bf3a18d user: jan.nijtmans tags: core-8-6-branch | |
2020-02-05
| ||
16:41 | merge-mark check-in: 8047caf34f user: jan.nijtmans tags: core-8-branch | |
Changes to doc/lset.n.
︙ | |||
47 48 49 50 51 52 53 | 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 | - - + + - + | interpreter; however, variable substitution and command substitution do not occur. The command constructs a new list in which the designated element is replaced with \fInewValue\fR. This new list is stored in the variable \fIvarName\fR, and is also the return value from the \fBlset\fR command. .PP |
︙ | |||
75 76 77 78 79 80 81 | 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 | - - - - - - + + + + - - - + | .PP .CS \fBlset\fR a {1 2} newValue .CE .PP replaces element 2 of sublist 1 with \fInewValue\fR. .PP |
︙ |
Changes to generic/tclInt.h.
︙ | |||
2507 2508 2509 2510 2511 2512 2513 | 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 | - + - + - + | #define TclGetIntFromObj(interp, objPtr, intPtr) \ (((objPtr)->typePtr == &tclIntType \ && (objPtr)->internalRep.wideValue >= (Tcl_WideInt)(INT_MIN) \ && (objPtr)->internalRep.wideValue <= (Tcl_WideInt)(INT_MAX)) \ ? ((*(intPtr) = (int)(objPtr)->internalRep.wideValue), TCL_OK) \ : Tcl_GetIntFromObj((interp), (objPtr), (intPtr))) #define TclGetIntForIndexM(interp, objPtr, endValue, idxPtr) \ |
︙ |
Changes to generic/tclListObj.c.
︙ | |||
1598 1599 1600 1601 1602 1603 1604 | 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 | - - - - - - - - - - - - - - - + - + + + | /* ...the index we're trying to use isn't an index at all. */ result = TCL_ERROR; indexArray++; break; } indexArray++; |
︙ | |||
1728 1729 1730 1731 1732 1733 1734 | 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 | + - + + + + + | * proper list - or something convertible to one - above). */ len = -1; TclListObjLength(NULL, subListPtr, &len); if (valuePtr == NULL) { Tcl_ListObjReplace(NULL, subListPtr, index, 1, 0, NULL); TclInvalidateStringRep(subListPtr); |
︙ |
Changes to generic/tclUtil.c.
︙ | |||
3884 3885 3886 3887 3888 3889 3890 3891 3892 3893 3894 3895 3896 3897 | 3884 3885 3886 3887 3888 3889 3890 3891 3892 3893 3894 3895 3896 3897 3898 3899 | + + | Tcl_WideInt wide; if (GetWideForIndex(interp, objPtr, endValue, &wide) == TCL_ERROR) { return TCL_ERROR; } if (wide < 0) { *indexPtr = -1; } else if ((wide > endValue) && (endValue >= -1)) { *indexPtr = endValue + 1; } else if (wide > INT_MAX) { *indexPtr = INT_MAX; } else { *indexPtr = (int) wide; } return TCL_OK; } |
︙ |
Changes to tests/lpop.test.
︙ | |||
22 23 24 25 26 27 28 | 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 47 48 49 50 51 52 53 54 55 | - + - - + + - - + + - + - + - + | test lpop-1.2 {error conditions} -returnCodes error -body { lpop no 0 } -result {can't read "no": no such variable} test lpop-1.3 {error conditions} -returnCodes error -body { set no "x {}x" lpop no } -result {list element in braces followed by "x" instead of space} |
︙ |
Changes to tests/lset.test.
︙ | |||
93 94 95 96 97 98 99 | 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 | - + - + - + - + - + - + - + - + - + - + | } msg] $msg } {1 {bad index "2a2": must be integer?[+-]integer? or end?[+-]integer?}} test lset-4.3 {lset, not compiled, 3 args, index out of range} testevalex { set a {x y z} list [catch { testevalex {lset a [list -1] w} } msg] $msg |
︙ | |||
277 278 279 280 281 282 283 | 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 | - + - + - + - + - + - + - + - + - + - + | test lset-8.4 {lset, not compiled, bad second index} testevalex { set a {{b c} {d e}} list [catch {testevalex {lset a {0 2a2} f}} msg] $msg } {1 {bad index "2a2": must be integer?[+-]integer? or end?[+-]integer?}} test lset-8.5 {lset, not compiled, second index out of range} testevalex { set a {{b c} {d e} {f g}} list [catch {testevalex {lset a 2 -1 h}} msg] $msg |
︙ | |||
400 401 402 403 404 405 406 | 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 | - + - + | list [testevalex {lset a $a {gag me}}] $a } {{{{{{gag me}}}} 0 0 0} {{{{{gag me}}}} 0 0 0}} test lset-14.1 {lset, not compiled, list args, is string rep preserved?} testevalex { set a { { 1 2 } { 3 4 } } catch { testevalex {lset a {1 5} 5} } list $a [lindex $a 1] |
︙ |
Changes to tests/lsetComp.test.
︙ | |||
215 216 217 218 219 220 221 | 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 | - + - + | } "0 {{1 2} {3 5}}" test lsetComp-2.8 {lset, compiled, list of args, error } { evalInProc { set x { {1 2} {3 4} } lset x {1 5} 5 } |
︙ | |||
408 409 410 411 412 413 414 | 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 | - + - + | } "0 {{1 2} {3 5}}" test lsetComp-3.8 {lset, compiled, flat args, error } { evalInProc { set x { {1 2} {3 4} } lset x 1 5 5 } |