summaryrefslogtreecommitdiffstats
path: root/Demo
diff options
context:
space:
mode:
authorThomas Wouters <thomas@python.org>2000-07-22 19:25:51 (GMT)
committerThomas Wouters <thomas@python.org>2000-07-22 19:25:51 (GMT)
commit7889010731eec703eda68fb32b6805c65e3f1cbf (patch)
tree2ef252eeade1d3aae02fc8b881c9e6a0c5bb1e42 /Demo
parent23c9e0024af99379ae517b016b874d57127e9a97 (diff)
downloadcpython-7889010731eec703eda68fb32b6805c65e3f1cbf.zip
cpython-7889010731eec703eda68fb32b6805c65e3f1cbf.tar.gz
cpython-7889010731eec703eda68fb32b6805c65e3f1cbf.tar.bz2
Miscelaneous ANSIfications. I'm assuming here 'main' should take (int,
char**) and return an int even on PC platforms. If not, please fix PC/utils/makesrc.c ;-P
Diffstat (limited to 'Demo')
-rw-r--r--Demo/embed/demo.c13
-rw-r--r--Demo/pysvr/pysvr.c10
2 files changed, 10 insertions, 13 deletions
diff --git a/Demo/embed/demo.c b/Demo/embed/demo.c
index 579ba07..26df355 100644
--- a/Demo/embed/demo.c
+++ b/Demo/embed/demo.c
@@ -2,11 +2,9 @@
#include "Python.h"
-void initxyzzy(); /* Forward */
+void initxyzzy(void); /* Forward */
-main(argc, argv)
- int argc;
- char **argv;
+main(int argc, char **argv)
{
/* Pass argv[0] to the Python interpreter */
Py_SetProgramName(argv[0]);
@@ -46,10 +44,9 @@ main(argc, argv)
/* A static module */
+/* 'self' is not used */
static PyObject *
-xyzzy_foo(self, args)
- PyObject *self; /* Not used */
- PyObject *args;
+xyzzy_foo(PyObject *self, PyObjecT *args)
{
if (!PyArg_ParseTuple(args, ""))
return NULL;
@@ -62,7 +59,7 @@ static PyMethodDef xyzzy_methods[] = {
};
void
-initxyzzy()
+initxyzzy(void)
{
PyImport_AddModule("xyzzy");
Py_InitModule("xyzzy", xyzzy_methods);
diff --git a/Demo/pysvr/pysvr.c b/Demo/pysvr/pysvr.c
index 995a7ca..d7d755c 100644
--- a/Demo/pysvr/pysvr.c
+++ b/Demo/pysvr/pysvr.c
@@ -34,7 +34,7 @@ extern int Py_VerboseFlag;
extern int optind;
extern char *optarg;
-extern int getopt();
+extern int getopt(int, char **, char *);
struct workorder {
int conn;
@@ -97,7 +97,7 @@ main(int argc, char **argv)
static char usage_line[] = "usage: %s [port]\n";
static void
-usage()
+usage(void)
{
fprintf(stderr, usage_line, progname);
exit(2);
@@ -220,7 +220,7 @@ static PyInterpreterState *the_interp;
static PyObject *the_builtins;
static void
-init_python()
+init_python(void)
{
if (gtstate)
return;
@@ -268,7 +268,7 @@ service_thread(struct workorder *work)
}
static void
-oprogname()
+oprogname(void)
{
int save = errno;
fprintf(stderr, "%s: ", progname);
@@ -364,7 +364,7 @@ run_command(char *buffer, PyObject *globals)
}
static void
-ps()
+ps(void)
{
char buffer[100];
sprintf(buffer, "ps -l -p %d </dev/null | tail +2l\n", getpid());