Kaydet (Commit) c4bc0e08 authored tarafından Peter Schneider-Kamp's avatar Peter Schneider-Kamp

ANSI-fication

üst 0659b4af
...@@ -29,8 +29,7 @@ staticforward PyTypeObject Dltype; ...@@ -29,8 +29,7 @@ staticforward PyTypeObject Dltype;
static PyObject *Dlerror; static PyObject *Dlerror;
static PyObject * static PyObject *
newdlobject(handle) newdlobject(PyUnivPtr *handle)
PyUnivPtr *handle;
{ {
dlobject *xp; dlobject *xp;
xp = PyObject_New(dlobject, &Dltype); xp = PyObject_New(dlobject, &Dltype);
...@@ -41,8 +40,7 @@ newdlobject(handle) ...@@ -41,8 +40,7 @@ newdlobject(handle)
} }
static void static void
dl_dealloc(xp) dl_dealloc(dlobject *xp)
dlobject *xp;
{ {
if (xp->dl_handle != NULL) if (xp->dl_handle != NULL)
dlclose(xp->dl_handle); dlclose(xp->dl_handle);
...@@ -50,9 +48,7 @@ dl_dealloc(xp) ...@@ -50,9 +48,7 @@ dl_dealloc(xp)
} }
static PyObject * static PyObject *
dl_close(xp, args) dl_close(dlobject *xp, PyObject *args)
dlobject *xp;
PyObject *args;
{ {
if (!PyArg_Parse(args, "")) if (!PyArg_Parse(args, ""))
return NULL; return NULL;
...@@ -65,9 +61,7 @@ dl_close(xp, args) ...@@ -65,9 +61,7 @@ dl_close(xp, args)
} }
static PyObject * static PyObject *
dl_sym(xp, args) dl_sym(dlobject *xp, PyObject *args)
dlobject *xp;
PyObject *args;
{ {
char *name; char *name;
PyUnivPtr *func; PyUnivPtr *func;
...@@ -82,9 +76,7 @@ dl_sym(xp, args) ...@@ -82,9 +76,7 @@ dl_sym(xp, args)
} }
static PyObject * static PyObject *
dl_call(xp, args) dl_call(dlobject *xp, PyObject *args)
dlobject *xp;
PyObject *args; /* (varargs) */
{ {
PyObject *name; PyObject *name;
long (*func)(); long (*func)();
...@@ -141,9 +133,7 @@ static PyMethodDef dlobject_methods[] = { ...@@ -141,9 +133,7 @@ static PyMethodDef dlobject_methods[] = {
}; };
static PyObject * static PyObject *
dl_getattr(xp, name) dl_getattr(dlobject *xp, char *name)
dlobject *xp;
char *name;
{ {
return Py_FindMethod(dlobject_methods, (PyObject *)xp, name); return Py_FindMethod(dlobject_methods, (PyObject *)xp, name);
} }
...@@ -169,9 +159,7 @@ static PyTypeObject Dltype = { ...@@ -169,9 +159,7 @@ static PyTypeObject Dltype = {
}; };
static PyObject * static PyObject *
dl_open(self, args) dl_open(PyObject *self, PyObject *args)
PyObject *self;
PyObject *args;
{ {
char *name; char *name;
int mode; int mode;
......
...@@ -17,9 +17,7 @@ static char new_instance_doc[] = ...@@ -17,9 +17,7 @@ static char new_instance_doc[] =
"Create an instance object from (CLASS, DICT) without calling its __init__()."; "Create an instance object from (CLASS, DICT) without calling its __init__().";
static PyObject * static PyObject *
new_instance(unused, args) new_instance(PyObject* unused, PyObject* args)
PyObject* unused;
PyObject* args;
{ {
PyObject* klass; PyObject* klass;
PyObject *dict; PyObject *dict;
...@@ -43,9 +41,7 @@ static char new_im_doc[] = ...@@ -43,9 +41,7 @@ static char new_im_doc[] =
"Create a instance method object from (FUNCTION, INSTANCE, CLASS)."; "Create a instance method object from (FUNCTION, INSTANCE, CLASS).";
static PyObject * static PyObject *
new_instancemethod(unused, args) new_instancemethod(PyObject* unused, PyObject* args)
PyObject* unused;
PyObject* args;
{ {
PyObject* func; PyObject* func;
PyObject* self; PyObject* self;
...@@ -75,9 +71,7 @@ static char new_function_doc[] = ...@@ -75,9 +71,7 @@ static char new_function_doc[] =
"Create a function object from (CODE, GLOBALS, [NAME, ARGDEFS])."; "Create a function object from (CODE, GLOBALS, [NAME, ARGDEFS]).";
static PyObject * static PyObject *
new_function(unused, args) new_function(PyObject* unused, PyObject* args)
PyObject* unused;
PyObject* args;
{ {
PyObject* code; PyObject* code;
PyObject* globals; PyObject* globals;
...@@ -114,9 +108,7 @@ static char new_code_doc[] = ...@@ -114,9 +108,7 @@ static char new_code_doc[] =
"Create a code object from (ARGCOUNT, NLOCALS, STACKSIZE, FLAGS, CODESTRING, CONSTANTS, NAMES, VARNAMES, FILENAME, NAME, FIRSTLINENO, LNOTAB)."; "Create a code object from (ARGCOUNT, NLOCALS, STACKSIZE, FLAGS, CODESTRING, CONSTANTS, NAMES, VARNAMES, FILENAME, NAME, FIRSTLINENO, LNOTAB).";
static PyObject * static PyObject *
new_code(unused, args) new_code(PyObject* unused, PyObject* args)
PyObject* unused;
PyObject* args;
{ {
int argcount; int argcount;
int nlocals; int nlocals;
...@@ -162,9 +154,7 @@ static char new_module_doc[] = ...@@ -162,9 +154,7 @@ static char new_module_doc[] =
"Create a module object from (NAME)."; "Create a module object from (NAME).";
static PyObject * static PyObject *
new_module(unused, args) new_module(PyObject* unused, PyObject* args)
PyObject* unused;
PyObject* args;
{ {
char *name; char *name;
...@@ -177,9 +167,7 @@ static char new_class_doc[] = ...@@ -177,9 +167,7 @@ static char new_class_doc[] =
"Create a class object from (NAME, BASE_CLASSES, DICT)."; "Create a class object from (NAME, BASE_CLASSES, DICT).";
static PyObject * static PyObject *
new_class(unused, args) new_class(PyObject* unused, PyObject* args)
PyObject* unused;
PyObject* args;
{ {
PyObject * name; PyObject * name;
PyObject * classes; PyObject * classes;
......
...@@ -37,8 +37,7 @@ staticforward PyTypeObject Xxo_Type; ...@@ -37,8 +37,7 @@ staticforward PyTypeObject Xxo_Type;
#define XxoObject_Check(v) ((v)->ob_type == &Xxo_Type) #define XxoObject_Check(v) ((v)->ob_type == &Xxo_Type)
static XxoObject * static XxoObject *
newXxoObject(arg) newXxoObject(PyObject *arg)
PyObject *arg;
{ {
XxoObject *self; XxoObject *self;
self = PyObject_New(XxoObject, &Xxo_Type); self = PyObject_New(XxoObject, &Xxo_Type);
...@@ -51,17 +50,14 @@ newXxoObject(arg) ...@@ -51,17 +50,14 @@ newXxoObject(arg)
/* Xxo methods */ /* Xxo methods */
static void static void
Xxo_dealloc(self) Xxo_dealloc(XxoObject *self)
XxoObject *self;
{ {
Py_XDECREF(self->x_attr); Py_XDECREF(self->x_attr);
PyObject_Del(self); PyObject_Del(self);
} }
static PyObject * static PyObject *
Xxo_demo(self, args) Xxo_demo(XxoObject *self, PyObject *args)
XxoObject *self;
PyObject *args;
{ {
if (!PyArg_ParseTuple(args, ":demo")) if (!PyArg_ParseTuple(args, ":demo"))
return NULL; return NULL;
...@@ -75,9 +71,7 @@ static PyMethodDef Xxo_methods[] = { ...@@ -75,9 +71,7 @@ static PyMethodDef Xxo_methods[] = {
}; };
static PyObject * static PyObject *
Xxo_getattr(self, name) Xxo_getattr(XxoObject *self, char *name)
XxoObject *self;
char *name;
{ {
if (self->x_attr != NULL) { if (self->x_attr != NULL) {
PyObject *v = PyDict_GetItemString(self->x_attr, name); PyObject *v = PyDict_GetItemString(self->x_attr, name);
...@@ -90,10 +84,7 @@ Xxo_getattr(self, name) ...@@ -90,10 +84,7 @@ Xxo_getattr(self, name)
} }
static int static int
Xxo_setattr(self, name, v) Xxo_setattr(XxoObject *self, char *name, PyObject *v)
XxoObject *self;
char *name;
PyObject *v;
{ {
if (self->x_attr == NULL) { if (self->x_attr == NULL) {
self->x_attr = PyDict_New(); self->x_attr = PyDict_New();
...@@ -136,9 +127,7 @@ statichere PyTypeObject Xxo_Type = { ...@@ -136,9 +127,7 @@ statichere PyTypeObject Xxo_Type = {
/* Function of two integers returning integer */ /* Function of two integers returning integer */
static PyObject * static PyObject *
xx_foo(self, args) xx_foo(PyObject *self, PyObject *args)
PyObject *self; /* Not used */
PyObject *args;
{ {
long i, j; long i, j;
long res; long res;
...@@ -152,9 +141,7 @@ xx_foo(self, args) ...@@ -152,9 +141,7 @@ xx_foo(self, args)
/* Function of no arguments returning new Xxo object */ /* Function of no arguments returning new Xxo object */
static PyObject * static PyObject *
xx_new(self, args) xx_new(PyObject *self, PyObject *args)
PyObject *self; /* Not used */
PyObject *args;
{ {
XxoObject *rv; XxoObject *rv;
...@@ -169,9 +156,7 @@ xx_new(self, args) ...@@ -169,9 +156,7 @@ xx_new(self, args)
/* Example with subtle bug from extensions manual ("Thin Ice"). */ /* Example with subtle bug from extensions manual ("Thin Ice"). */
static PyObject * static PyObject *
xx_bug(self, args) xx_bug(PyObject *self, PyObject *args)
PyObject *self;
PyObject *args;
{ {
PyObject *list, *item; PyObject *list, *item;
...@@ -192,9 +177,7 @@ xx_bug(self, args) ...@@ -192,9 +177,7 @@ xx_bug(self, args)
/* Test bad format character */ /* Test bad format character */
static PyObject * static PyObject *
xx_roj(self, args) xx_roj(PyObject *self, PyObject *args)
PyObject *self; /* Not used */
PyObject *args;
{ {
PyObject *a; PyObject *a;
long b; long b;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment