aboutsummaryrefslogtreecommitdiff
path: root/src/listobject.c
diff options
context:
space:
mode:
authorSkip Montanaro <[email protected]>2021-02-16 20:26:50 -0600
committerSkip Montanaro <[email protected]>2021-02-16 20:26:50 -0600
commit7fed00c4f5e75001d2ac06c76ed24db6a82869f1 (patch)
tree3a4908633a3a26da34f63cc6f0288288ea54c1d0 /src/listobject.c
parentc0f170462209484074470d693af44c65e5a252ac (diff)
downloadpython-0.9.1-patched-QoL-7fed00c4f5e75001d2ac06c76ed24db6a82869f1.tar.xz
python-0.9.1-patched-QoL-7fed00c4f5e75001d2ac06c76ed24db6a82869f1.zip
reapply patches
Diffstat (limited to 'src/listobject.c')
-rw-r--r--src/listobject.c43
1 files changed, 22 insertions, 21 deletions
diff --git a/src/listobject.c b/src/listobject.c
index 02192a1..8af37b6 100644
--- a/src/listobject.c
+++ b/src/listobject.c
@@ -4,10 +4,10 @@ Netherlands.
All Rights Reserved
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
+Permission to use, copy, modify, and distribute this software and its
+documentation for any purpose and without fee is hereby granted,
provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
+both that copyright notice and this permission notice appear in
supporting documentation, and that the names of Stichting Mathematisch
Centrum or CWI not be used in advertising or publicity pertaining to
distribution of the software without specific, written prior permission.
@@ -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;