aboutsummaryrefslogtreecommitdiff
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
parentc0f170462209484074470d693af44c65e5a252ac (diff)
downloadpython-0.9.1-patched-QoL-7fed00c4f5e75001d2ac06c76ed24db6a82869f1.tar.xz
python-0.9.1-patched-QoL-7fed00c4f5e75001d2ac06c76ed24db6a82869f1.zip
reapply patches
-rw-r--r--src/Makefile21
-rw-r--r--src/allobjects.h1
-rw-r--r--src/import.c2
-rw-r--r--src/listobject.c43
-rw-r--r--src/malloc.h5
-rw-r--r--src/modsupport.h2
-rw-r--r--src/patchlevel.h2
-rw-r--r--src/regexpmodule.c14
8 files changed, 50 insertions, 40 deletions
diff --git a/src/Makefile b/src/Makefile
index e07d1c8..29d05ef 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -1,17 +1,17 @@
# /***********************************************************
# Copyright 1991 by Stichting Mathematisch Centrum, Amsterdam, The
# 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.
-#
+#
# STICHTING MATHEMATISCH CENTRUM DISCLAIMS ALL WARRANTIES WITH REGARD TO
# THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
# FITNESS, IN NO EVENT SHALL STICHTING MATHEMATISCH CENTRUM BE LIABLE
@@ -19,7 +19,7 @@
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
# OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-#
+#
# ******************************************************************/
# Makefile for Python
@@ -84,8 +84,8 @@ PYTHONPATH= .:/usr/local/lib/python:/ufs/guido/lib/python
# is missing in most systems I have encountered, so it is turned on
# in the Makefile. Turn it off if your system doesn't have sys_errlist.)
-STRERROR_SRC= strerror.c
-STRERROR_OBJ= strerror.o
+# STRERROR_SRC= strerror.c
+# STRERROR_OBJ= strerror.o
# If your BSD system does not have a fmod() function in the library,
# uncomment the following two lines to use one I wrote.
@@ -256,7 +256,7 @@ STRERROR_OBJ= strerror.o
# Uncomment the following block to use the GL option.
#GL_USE = -DUSE_GL
-#GL_LIBDEPS=
+#GL_LIBDEPS=
#GL_LIBS= -lgl_s
#GL_SRC = glmodule.c cgensupport.c
#GL_OBJ = glmodule.o cgensupport.o
@@ -493,4 +493,3 @@ glmodule.c: cstubs cgen
#graminit.c graminit.h: Grammar python_gen
# python_gen Grammar
-
diff --git a/src/allobjects.h b/src/allobjects.h
index 1540adc..e4c0c1d 100644
--- a/src/allobjects.h
+++ b/src/allobjects.h
@@ -26,6 +26,7 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#include <stdio.h>
#include <string.h>
+#include <stdlib.h>
#include "PROTO.h"
diff --git a/src/import.c b/src/import.c
index 2744df0..f2d9d4e 100644
--- a/src/import.c
+++ b/src/import.c
@@ -167,6 +167,8 @@ load_module(name)
return m;
}
+static int init_builtin(char *name);
+
object *
import_module(name)
char *name;
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;
diff --git a/src/malloc.h b/src/malloc.h
index 4ed5f08..0f64349 100644
--- a/src/malloc.h
+++ b/src/malloc.h
@@ -36,6 +36,11 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#define HAVE_STDLIB
#endif
+#ifdef __STDC__
+#define ANY void
+#define HAVE_STDLIB
+#endif
+
#ifndef ANY
#define ANY char
#endif
diff --git a/src/modsupport.h b/src/modsupport.h
index 016220f..0862b6d 100644
--- a/src/modsupport.h
+++ b/src/modsupport.h
@@ -25,3 +25,5 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
/* Module support interface */
extern object *initmodule PROTO((char *, struct methodlist *));
+extern int getintarg(object *v, int *a);
+extern void fatal(char *msg);
diff --git a/src/patchlevel.h b/src/patchlevel.h
index d00491f..110c86f 100644
--- a/src/patchlevel.h
+++ b/src/patchlevel.h
@@ -1 +1 @@
-1
+#define PATCHLEVEL 1
diff --git a/src/regexpmodule.c b/src/regexpmodule.c
index fa54cd7..5fd9973 100644
--- a/src/regexpmodule.c
+++ b/src/regexpmodule.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.
@@ -30,7 +30,7 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#include "regexp.h"
-static object *RegexpError; /* Exception */
+static object *RegexpError; /* Exception */
typedef struct {
OB_HEAD
@@ -38,7 +38,7 @@ typedef struct {
regexp *re_prog; /* The compiled regular expression */
} regexpobject;
-extern typeobject Regexptype; /* Really static, forward */
+static typeobject Regexptype;
static regexpobject *
newregexpobject(string, prog)
@@ -180,10 +180,10 @@ static struct methodlist regexp_global_methods[] = {
initregexp()
{
object *m, *d;
-
+
m = initmodule("regexp", regexp_global_methods);
d = getmoduledict(m);
-
+
/* Initialize regexp.error exception */
RegexpError = newstringobject("regexp.error");
if (RegexpError == NULL || dictinsert(d, "error", RegexpError) != 0)