diff options
| author | Skip Montanaro <[email protected]> | 2021-02-16 15:31:55 -0600 |
|---|---|---|
| committer | Skip Montanaro <[email protected]> | 2021-02-16 15:31:55 -0600 |
| commit | b23fc484036e2c492b048a5701ae0b8a93d422ae (patch) | |
| tree | 14797fa54795bcf891c51d8e0208dbd2eea7ae7d /src/listobject.c | |
| parent | c7fc95b5c60eb8e2c18ecb2dad35af0d14aee920 (diff) | |
| download | python-0.9.1-patched-QoL-b23fc484036e2c492b048a5701ae0b8a93d422ae.tar.xz python-0.9.1-patched-QoL-b23fc484036e2c492b048a5701ae0b8a93d422ae.zip | |
The changes I needed to get it to build
Diffstat (limited to 'src/listobject.c')
| -rw-r--r-- | src/listobject.c | 37 |
1 files changed, 19 insertions, 18 deletions
diff --git a/src/listobject.c b/src/listobject.c index be1382c..9a32eac 100644 --- a/src/listobject.c +++ b/src/listobject.c @@ -25,6 +25,7 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. /* List object implementation */ #include "allobjects.h" +#include "modsupport.h" object * newlistobject(size) @@ -319,24 +320,6 @@ list_concat(a, bb) } static int -list_ass_item(a, i, v) - listobject *a; - int i; - object *v; -{ - if (i < 0 || i >= a->ob_size) { - err_setstr(IndexError, "list assignment index out of range"); - return -1; - } - if (v == NULL) - return list_ass_slice(a, i, i+1, v); - INCREF(v); - DECREF(a->ob_item[i]); - a->ob_item[i] = v; - return 0; -} - -static int list_ass_slice(a, ilow, ihigh, v) listobject *a; int ilow, ihigh; @@ -400,6 +383,24 @@ list_ass_slice(a, ilow, ihigh, v) #undef b } +static int +list_ass_item(a, i, v) + listobject *a; + int i; + object *v; +{ + if (i < 0 || i >= a->ob_size) { + err_setstr(IndexError, "list assignment index out of range"); + return -1; + } + if (v == NULL) + return list_ass_slice(a, i, i+1, v); + INCREF(v); + DECREF(a->ob_item[i]); + a->ob_item[i] = v; + return 0; +} + static object * ins(self, where, v) listobject *self; |
