summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1990-12-20 15:06:42 (GMT)
committerGuido van Rossum <guido@python.org>1990-12-20 15:06:42 (GMT)
commit3f5da24ea304e674a9abbdcffc4d671e32aa70f1 (patch)
treee932e31cb9381f40b7c87c377638216c043b5cfc /Modules
parent226d79eb4a776dd54c9e4544b17deaf928bcef3a (diff)
downloadcpython-3f5da24ea304e674a9abbdcffc4d671e32aa70f1.zip
cpython-3f5da24ea304e674a9abbdcffc4d671e32aa70f1.tar.gz
cpython-3f5da24ea304e674a9abbdcffc4d671e32aa70f1.tar.bz2
"Compiling" version
Diffstat (limited to 'Modules')
-rw-r--r--Modules/cgen.py4
-rw-r--r--Modules/cstubs15
-rw-r--r--Modules/mathmodule.c15
-rw-r--r--Modules/posixmodule.c22
-rw-r--r--Modules/stdwinmodule.c15
-rw-r--r--Modules/timemodule.c19
6 files changed, 20 insertions, 70 deletions
diff --git a/Modules/cgen.py b/Modules/cgen.py
index 0cdeaa6..1e345d1 100644
--- a/Modules/cgen.py
+++ b/Modules/cgen.py
@@ -33,8 +33,8 @@ digits = '0123456789'
#
def getnum(s):
n = ''
- while s[:1] in digits:
- n = n + s[:1]
+ while s and s[0] in digits:
+ n = n + s[0]
s = s[1:]
return n, s
diff --git a/Modules/cstubs b/Modules/cstubs
index f0f5ade..88a77bc 100644
--- a/Modules/cstubs
+++ b/Modules/cstubs
@@ -25,24 +25,13 @@ Each definition must be contained on one line:
N*retval
*/
-#include <stdio.h>
#include <gl.h>
#include <device.h>
-#include "PROTO.h"
-#include "object.h"
-#include "intobject.h"
-#include "floatobject.h"
-#include "listobject.h"
-#include "tupleobject.h"
-#include "dictobject.h"
-#include "methodobject.h"
-#include "moduleobject.h"
-#include "objimpl.h"
+
+#include "allobjects.h"
#include "import.h"
-#include "sigtype.h"
#include "modsupport.h"
#include "cgensupport.h"
-#include "errors.h"
/*
Some stubs are too complicated for the stub generator.
diff --git a/Modules/mathmodule.c b/Modules/mathmodule.c
index 218658f..e811088 100644
--- a/Modules/mathmodule.c
+++ b/Modules/mathmodule.c
@@ -1,20 +1,11 @@
/* Math module -- standard C math library functions, pi and e */
-#include <stdio.h>
-#include <math.h>
+#include "allobjects.h"
-#include "PROTO.h"
-#include "object.h"
-#include "intobject.h"
-#include "tupleobject.h"
-#include "floatobject.h"
-#include "dictobject.h"
-#include "methodobject.h"
-#include "moduleobject.h"
-#include "objimpl.h"
-#include "import.h"
#include "modsupport.h"
+#include <math.h>
+
static int
getdoublearg(args, px)
register object *args;
diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c
index c2166dc..ea0ac6c 100644
--- a/Modules/posixmodule.c
+++ b/Modules/posixmodule.c
@@ -1,6 +1,5 @@
/* POSIX module implementation */
-#include <stdio.h>
#include <signal.h>
#include <string.h>
#include <setjmp.h>
@@ -14,20 +13,8 @@
#include <sys/dir.h>
#endif
-#include "PROTO.h"
-#include "object.h"
-#include "intobject.h"
-#include "stringobject.h"
-#include "tupleobject.h"
-#include "listobject.h"
-#include "dictobject.h"
-#include "methodobject.h"
-#include "moduleobject.h"
-#include "objimpl.h"
-#include "import.h"
-#include "sigtype.h"
+#include "allobjects.h"
#include "modsupport.h"
-#include "errors.h"
extern char *strerror PROTO((int));
@@ -140,7 +127,6 @@ posix_do_stat(self, args, statfunc)
v = newtupleobject(10);
if (v == NULL)
return NULL;
- errno = 0;
#define SET(i, st_member) settupleitem(v, i, newintobject((long)st.st_member))
SET(0, st_mode);
SET(1, st_ino);
@@ -153,9 +139,9 @@ posix_do_stat(self, args, statfunc)
SET(8, st_mtime);
SET(9, st_ctime);
#undef SET
- if (errno != 0) {
+ if (err_occurred()) {
DECREF(v);
- return err_nomem();
+ return NULL;
}
return v;
}
@@ -335,6 +321,8 @@ posix_utimes(self, args)
#ifdef NO_GETCWD
+#include "errno.h"
+
/* Quick hack to get posix.getcwd() working for pure BSD 4.3 */
/* XXX This assumes MAXPATHLEN = 1024 !!! */
diff --git a/Modules/stdwinmodule.c b/Modules/stdwinmodule.c
index cae07cf..da511ec 100644
--- a/Modules/stdwinmodule.c
+++ b/Modules/stdwinmodule.c
@@ -38,22 +38,11 @@
XXX more?
*/
-#include <stdio.h>
-#include "stdwin.h"
+#include "allobjects.h"
-#include "PROTO.h"
-#include "object.h"
-#include "intobject.h"
-#include "stringobject.h"
-#include "tupleobject.h"
-#include "dictobject.h"
-#include "methodobject.h"
-#include "moduleobject.h"
-#include "objimpl.h"
-#include "import.h"
#include "modsupport.h"
-#include "errors.h"
+#include "stdwin.h"
/* Window and menu object types declared here because of forward references */
diff --git a/Modules/timemodule.c b/Modules/timemodule.c
index 334b2d3..28d4ff7 100644
--- a/Modules/timemodule.c
+++ b/Modules/timemodule.c
@@ -1,6 +1,11 @@
/* Time module */
-#include <stdio.h>
+#include "allobjects.h"
+
+#include "modsupport.h"
+
+#include "sigtype.h"
+
#include <signal.h>
#include <setjmp.h>
@@ -11,18 +16,6 @@ typedef unsigned long time_t;
extern time_t time();
#endif /* !__STDC__ */
-#include "PROTO.h"
-#include "object.h"
-#include "intobject.h"
-#include "dictobject.h"
-#include "methodobject.h"
-#include "moduleobject.h"
-#include "objimpl.h"
-#include "import.h"
-#include "sigtype.h"
-#include "modsupport.h"
-#include "errors.h"
-
/* Time methods */