Commit 6a85027a authored by Peter Schneider-Kamp's avatar Peter Schneider-Kamp

ANSI-fication of the SGI modules (note that svmodule.c and sgimodule.c

have already been checked in)

UNTESTED!
parent 10723347
This diff is collapsed.
......@@ -25,9 +25,7 @@ typedef struct {
static PyObject *CdError; /* exception cd.error */
static PyObject *
CD_allowremoval(self, args)
cdplayerobject *self;
PyObject *args;
CD_allowremoval(cdplayerobject *self, PyObject *args)
{
if (!PyArg_ParseTuple(args, ":allowremoval"))
return NULL;
......@@ -39,9 +37,7 @@ CD_allowremoval(self, args)
}
static PyObject *
CD_preventremoval(self, args)
cdplayerobject *self;
PyObject *args;
CD_preventremoval(cdplayerobject *self, PyObject *args)
{
if (!PyArg_ParseTuple(args, ":preventremoval"))
return NULL;
......@@ -53,9 +49,7 @@ CD_preventremoval(self, args)
}
static PyObject *
CD_bestreadsize(self, args)
cdplayerobject *self;
PyObject *args;
CD_bestreadsize(cdplayerobject *self, PyObject *args)
{
if (!PyArg_ParseTuple(args, ":bestreadsize"))
return NULL;
......@@ -64,9 +58,7 @@ CD_bestreadsize(self, args)
}
static PyObject *
CD_close(self, args)
cdplayerobject *self;
PyObject *args;
CD_close(cdplayerobject *self, PyObject *args)
{
if (!PyArg_ParseTuple(args, ":close"))
return NULL;
......@@ -82,9 +74,7 @@ CD_close(self, args)
}
static PyObject *
CD_eject(self, args)
cdplayerobject *self;
PyObject *args;
CD_eject(cdplayerobject *self, PyObject *args)
{
CDSTATUS status;
......@@ -105,9 +95,7 @@ CD_eject(self, args)
}
static PyObject *
CD_getstatus(self, args)
cdplayerobject *self;
PyObject *args;
CD_getstatus(cdplayerobject *self, PyObject *args)
{
CDSTATUS status;
......@@ -128,9 +116,7 @@ CD_getstatus(self, args)
}
static PyObject *
CD_gettrackinfo(self, args)
cdplayerobject *self;
PyObject *args;
CD_gettrackinfo(cdplayerobject *self, PyObject *args)
{
int track;
CDTRACKINFO info;
......@@ -154,9 +140,7 @@ CD_gettrackinfo(self, args)
}
static PyObject *
CD_msftoblock(self, args)
cdplayerobject *self;
PyObject *args;
CD_msftoblock(cdplayerobject *self, PyObject *args)
{
int min, sec, frame;
......@@ -168,9 +152,7 @@ CD_msftoblock(self, args)
}
static PyObject *
CD_play(self, args)
cdplayerobject *self;
PyObject *args;
CD_play(cdplayerobject *self, PyObject *args)
{
int start, play;
CDSTATUS status;
......@@ -192,9 +174,7 @@ CD_play(self, args)
}
static PyObject *
CD_playabs(self, args)
cdplayerobject *self;
PyObject *args;
CD_playabs(cdplayerobject *self, PyObject *args)
{
int min, sec, frame, play;
CDSTATUS status;
......@@ -216,9 +196,7 @@ CD_playabs(self, args)
}
static PyObject *
CD_playtrack(self, args)
cdplayerobject *self;
PyObject *args;
CD_playtrack(cdplayerobject *self, PyObject *args)
{
int start, play;
CDSTATUS status;
......@@ -240,9 +218,7 @@ CD_playtrack(self, args)
}
static PyObject *
CD_playtrackabs(self, args)
cdplayerobject *self;
PyObject *args;
CD_playtrackabs(cdplayerobject *self, PyObject *args)
{
int track, min, sec, frame, play;
CDSTATUS status;
......@@ -265,9 +241,7 @@ CD_playtrackabs(self, args)
}
static PyObject *
CD_readda(self, args)
cdplayerobject *self;
PyObject *args;
CD_readda(cdplayerobject *self, PyObject *args)
{
int numframes, n;
PyObject *result;
......@@ -294,9 +268,7 @@ CD_readda(self, args)
}
static PyObject *
CD_seek(self, args)
cdplayerobject *self;
PyObject *args;
CD_seek(cdplayerobject *self, PyObject *args)
{
int min, sec, frame;
long PyTryBlock;
......@@ -314,9 +286,7 @@ CD_seek(self, args)
}
static PyObject *
CD_seektrack(self, args)
cdplayerobject *self;
PyObject *args;
CD_seektrack(cdplayerobject *self, PyObject *args)
{
int track;
long PyTryBlock;
......@@ -334,9 +304,7 @@ CD_seektrack(self, args)
}
static PyObject *
CD_seekblock(self, args)
cdplayerobject *self;
PyObject *args;
CD_seekblock(cdplayerobject *self, PyObject *args)
{
unsigned long PyTryBlock;
......@@ -353,9 +321,7 @@ CD_seekblock(self, args)
}
static PyObject *
CD_stop(self, args)
cdplayerobject *self;
PyObject *args;
CD_stop(cdplayerobject *self, PyObject *args)
{
CDSTATUS status;
......@@ -376,9 +342,7 @@ CD_stop(self, args)
}
static PyObject *
CD_togglepause(self, args)
cdplayerobject *self;
PyObject *args;
CD_togglepause(cdplayerobject *self, PyObject *args)
{
CDSTATUS status;
......@@ -421,8 +385,7 @@ static PyMethodDef cdplayer_methods[] = {
};
static void
cdplayer_dealloc(self)
cdplayerobject *self;
cdplayer_dealloc(cdplayerobject *self)
{
if (self->ob_cdplayer != NULL)
CDclose(self->ob_cdplayer);
......@@ -430,9 +393,7 @@ cdplayer_dealloc(self)
}
static PyObject *
cdplayer_getattr(self, name)
cdplayerobject *self;
char *name;
cdplayer_getattr(cdplayerobject *self, char *name)
{
if (self->ob_cdplayer == NULL) {
PyErr_SetString(PyExc_RuntimeError, "no player active");
......@@ -457,8 +418,7 @@ PyTypeObject CdPlayertype = {
};
static PyObject *
newcdplayerobject(cdp)
CDPLAYER *cdp;
newcdplayerobject(CDPLAYER *cdp)
{
cdplayerobject *p;
......@@ -470,8 +430,7 @@ newcdplayerobject(cdp)
}
static PyObject *
CD_open(self, args)
PyObject *self, *args;
CD_open(PyObject *self, PyObject *args)
{
char *dev, *direction;
CDPLAYER *cdp;
......@@ -504,10 +463,7 @@ typedef struct {
} cdparserobject;
static void
CD_callback(arg, type, data)
void *arg;
CDDATATYPES type;
void *data;
CD_callback(void *arg, CDDATATYPES type, void *data)
{
PyObject *result, *args, *v = NULL;
char *p;
......@@ -578,9 +534,7 @@ CD_callback(arg, type, data)
}
static PyObject *
CD_deleteparser(self, args)
cdparserobject *self;
PyObject *args;
CD_deleteparser(cdparserobject *self, PyObject *args)
{
int i;
......@@ -603,9 +557,7 @@ CD_deleteparser(self, args)
}
static PyObject *
CD_parseframe(self, args)
cdparserobject *self;
PyObject *args;
CD_parseframe(cdparserobject *self, PyObject *args)
{
char *cdfp;
int length;
......@@ -633,9 +585,7 @@ CD_parseframe(self, args)
}
static PyObject *
CD_removecallback(self, args)
cdparserobject *self;
PyObject *args;
CD_removecallback(cdparserobject *self, PyObject *args)
{
int type;
......@@ -660,9 +610,7 @@ CD_removecallback(self, args)
}
static PyObject *
CD_resetparser(self, args)
cdparserobject *self;
PyObject *args;
CD_resetparser(cdparserobject *self, PyObject *args)
{
if (!PyArg_ParseTuple(args, ":resetparser"))
return NULL;
......@@ -674,9 +622,7 @@ CD_resetparser(self, args)
}
static PyObject *
CD_addcallback(self, args)
cdparserobject *self;
PyObject *args;
CD_addcallback(cdparserobject *self, PyObject *args)
{
int type;
PyObject *func, *funcarg;
......@@ -728,8 +674,7 @@ static PyMethodDef cdparser_methods[] = {
};
static void
cdparser_dealloc(self)
cdparserobject *self;
cdparser_dealloc(cdparserobject *self)
{
int i;
......@@ -744,9 +689,7 @@ cdparser_dealloc(self)
}
static PyObject *
cdparser_getattr(self, name)
cdparserobject *self;
char *name;
cdparser_getattr(cdparserobject *self, char *name)
{
if (self->ob_cdparser == NULL) {
PyErr_SetString(PyExc_RuntimeError, "no parser active");
......@@ -772,8 +715,7 @@ PyTypeObject CdParsertype = {
};
static PyObject *
newcdparserobject(cdp)
CDPARSER *cdp;
newcdparserobject(CDPARSER *cdp)
{
cdparserobject *p;
int i;
......@@ -790,8 +732,7 @@ newcdparserobject(cdp)
}
static PyObject *
CD_createparser(self, args)
PyObject *self, *args;
CD_createparser(PyObject *self, PyObject *args)
{
CDPARSER *cdp;
......@@ -807,8 +748,7 @@ CD_createparser(self, args)
}
static PyObject *
CD_msftoframe(self, args)
PyObject *self, *args;
CD_msftoframe(PyObject *self, PyObject *args)
{
int min, sec, frame;
......
......@@ -20,10 +20,7 @@ redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
one argument. */
int
PyArg_GetObject(args, nargs, i, p_arg)
register PyObject *args;
int nargs, i;
PyObject **p_arg;
PyArg_GetObject(register PyObject *args, int nargs, int i, PyObject **p_arg)
{
if (nargs != 1) {
if (args == NULL || !PyTuple_Check(args) ||
......@@ -43,10 +40,7 @@ PyArg_GetObject(args, nargs, i, p_arg)
}
int
PyArg_GetLong(args, nargs, i, p_arg)
register PyObject *args;
int nargs, i;
long *p_arg;
PyArg_GetLong(register PyObject *args, int nargs, int i, long *p_arg)
{
if (nargs != 1) {
if (args == NULL || !PyTuple_Check(args) ||
......@@ -64,10 +58,7 @@ PyArg_GetLong(args, nargs, i, p_arg)
}
int
PyArg_GetShort(args, nargs, i, p_arg)
register PyObject *args;
int nargs, i;
short *p_arg;
PyArg_GetShort(register PyObject *args, int nargs, int i, short *p_arg)
{
long x;
if (!PyArg_GetLong(args, nargs, i, &x))
......@@ -77,9 +68,7 @@ PyArg_GetShort(args, nargs, i, p_arg)
}
static int
extractdouble(v, p_arg)
register PyObject *v;
double *p_arg;
extractdouble(register PyObject *v, double *p_arg)
{
if (v == NULL) {
/* Fall through to error return at end of function */
......@@ -100,9 +89,7 @@ extractdouble(v, p_arg)
}
static int
extractfloat(v, p_arg)
register PyObject *v;
float *p_arg;
extractfloat(register PyObject *v, float *p_arg)
{
if (v == NULL) {
/* Fall through to error return at end of function */
......@@ -123,10 +110,7 @@ extractfloat(v, p_arg)
}
int
PyArg_GetFloat(args, nargs, i, p_arg)
register PyObject *args;
int nargs, i;
float *p_arg;
PyArg_GetFloat(register PyObject *args, int nargs, int i, float *p_arg)
{
PyObject *v;
float x;
......@@ -139,10 +123,7 @@ PyArg_GetFloat(args, nargs, i, p_arg)
}
int
PyArg_GetString(args, nargs, i, p_arg)
PyObject *args;
int nargs, i;
string *p_arg;
PyArg_GetString(PyObject *args, int nargs, int i, string *p_arg)
{
PyObject *v;
if (!PyArg_GetObject(args, nargs, i, &v))
......@@ -155,10 +136,7 @@ PyArg_GetString(args, nargs, i, p_arg)
}
int
PyArg_GetChar(args, nargs, i, p_arg)
PyObject *args;
int nargs, i;
char *p_arg;
PyArg_GetChar(PyObject *args, int nargs, int i, char *p_arg)
{
string x;
if (!PyArg_GetString(args, nargs, i, &x))
......@@ -172,10 +150,7 @@ PyArg_GetChar(args, nargs, i, p_arg)
}
int
PyArg_GetLongArraySize(args, nargs, i, p_arg)
PyObject *args;
int nargs, i;
long *p_arg;
PyArg_GetLongArraySize(PyObject *args, int nargs, int i, long *p_arg)
{
PyObject *v;
if (!PyArg_GetObject(args, nargs, i, &v))
......@@ -192,10 +167,7 @@ PyArg_GetLongArraySize(args, nargs, i, p_arg)
}
int
PyArg_GetShortArraySize(args, nargs, i, p_arg)
PyObject *args;
int nargs, i;
short *p_arg;
PyArg_GetShortArraySize(PyObject *args, int nargs, int i, short *p_arg)
{
long x;
if (!PyArg_GetLongArraySize(args, nargs, i, &x))
......@@ -207,11 +179,7 @@ PyArg_GetShortArraySize(args, nargs, i, p_arg)
/* XXX The following four are too similar. Should share more code. */
int
PyArg_GetLongArray(args, nargs, i, n, p_arg)
PyObject *args;
int nargs, i;
int n;
long *p_arg; /* [n] */
PyArg_GetLongArray(PyObject *args, int nargs, int i, int n, long *p_arg)
{
PyObject *v, *w;
if (!PyArg_GetObject(args, nargs, i, &v))
......@@ -248,11 +216,7 @@ PyArg_GetLongArray(args, nargs, i, n, p_arg)
}
int
PyArg_GetShortArray(args, nargs, i, n, p_arg)
PyObject *args;
int nargs, i;
int n;
short *p_arg; /* [n] */
PyArg_GetShortArray(PyObject *args, int nargs, int i, int n, short *p_arg)
{
PyObject *v, *w;
if (!PyArg_GetObject(args, nargs, i, &v))
......@@ -289,11 +253,7 @@ PyArg_GetShortArray(args, nargs, i, n, p_arg)
}
int
PyArg_GetDoubleArray(args, nargs, i, n, p_arg)
PyObject *args;
int nargs, i;
int n;
double *p_arg; /* [n] */
PyArg_GetDoubleArray(PyObject *args, int nargs, int i, int n, double *p_arg)
{
PyObject *v, *w;
if (!PyArg_GetObject(args, nargs, i, &v))
......@@ -326,11 +286,7 @@ PyArg_GetDoubleArray(args, nargs, i, n, p_arg)
}
int
PyArg_GetFloatArray(args, nargs, i, n, p_arg)
PyObject *args;
int nargs, i;
int n;
float *p_arg; /* [n] */
PyArg_GetFloatArray(PyObject *args, int nargs, int i, int n, float *p_arg)
{
PyObject *v, *w;
if (!PyArg_GetObject(args, nargs, i, &v))
......
This diff is collapsed.
......@@ -29,8 +29,7 @@ staticforward PyTypeObject Fhtype;
#define is_fhobject(v) ((v)->ob_type == &Fhtype)
static PyObject *
newfhobject(fh)
fmfonthandle fh;
newfhobject(fmfonthandle fh)
{
fhobject *fhp;
if (fh == NULL) {
......@@ -48,9 +47,7 @@ newfhobject(fh)
/* Font Handle methods */
static PyObject *
fh_scalefont(self, args)
fhobject *self;
PyObject *args;
fh_scalefont(fhobject *self, PyObject *args)
{
double size;
if (!PyArg_Parse(args, "d", &size))
......@@ -61,9 +58,7 @@ PyObject *args;
/* XXX fmmakefont */
static PyObject *
fh_setfont(self, args)
fhobject *self;
PyObject *args;
fh_setfont(fhobject *self, PyObject *args)
{
if (!PyArg_NoArgs(args))
return NULL;
......@@ -73,9 +68,7 @@ PyObject *args;
}
static PyObject *
fh_getfontname(self, args)
fhobject *self;
PyObject *args;
fh_getfontname(fhobject *self, PyObject *args)
{
char fontname[256];
int len;
......@@ -90,9 +83,7 @@ PyObject *args;
}
static PyObject *
fh_getcomment(self, args)
fhobject *self;
PyObject *args;
fh_getcomment(fhobject *self, PyObject *args)
{
char comment[256];
int len;
......@@ -107,9 +98,7 @@ PyObject *args;
}
static PyObject *
fh_getfontinfo(self, args)
fhobject *self;
PyObject *args;
fh_getfontinfo(fhobject *self, PyObject *args)
{
fmfontinfo info;
if (!PyArg_NoArgs(args))
......@@ -131,17 +120,13 @@ PyObject *args;
#if 0
static PyObject *
fh_getwholemetrics(self, args)
fhobject *self;
PyObject *args;
fh_getwholemetrics(fhobject *self, PyObject *args)
{
}
#endif
static PyObject *
fh_getstrwidth(self, args)
fhobject *self;
PyObject *args;
fh_getstrwidth(fhobject *self, PyObject *args)
{
char *str;
if (!PyArg_Parse(args, "s", &str))
......@@ -163,16 +148,13 @@ static PyMethodDef fh_methods[] = {
};
static PyObject *
fh_getattr(fhp, name)
fhobject *fhp;
char *name;
fh_getattr(fhobject *fhp, char *name)
{
return Py_FindMethod(fh_methods, (PyObject *)fhp, name);
}
static void
fh_dealloc(fhp)
fhobject *fhp;
fh_dealloc(fhobject *fhp)
{
fmfreefont(fhp->fh_fh);
PyObject_Del(fhp);
......@@ -197,8 +179,7 @@ static PyTypeObject Fhtype = {
/* Font Manager functions */
static PyObject *
fm_init(self, args)
PyObject *self, *args;
fm_init(PyObject *self, *args)
{
if (!PyArg_NoArgs(args))
return NULL;
......@@ -208,8 +189,7 @@ fm_init(self, args)
}
static PyObject *
fm_findfont(self, args)
PyObject *self, *args;
fm_findfont(PyObject *self, *args)
{
char *str;
if (!PyArg_Parse(args, "s", &str))
......@@ -218,8 +198,7 @@ fm_findfont(self, args)
}
static PyObject *
fm_prstr(self, args)
PyObject *self, *args;
fm_prstr(PyObject *self, *args)
{
char *str;
if (!PyArg_Parse(args, "s", &str))
......@@ -234,8 +213,7 @@ fm_prstr(self, args)
static PyObject *fontlist;
static void
clientproc(fontname)
char *fontname;
clientproc(char *fontname)
{
int err;
PyObject *v;
......@@ -255,8 +233,7 @@ clientproc(fontname)
}
static PyObject *
fm_enumerate(self, args)
PyObject *self, *args;
fm_enumerate(PyObject *self, PyObject *args)
{
PyObject *res;
if (!PyArg_NoArgs(args))
......@@ -271,8 +248,7 @@ fm_enumerate(self, args)
}
static PyObject *
fm_setpath(self, args)
PyObject *self, *args;
fm_setpath(PyObject *self, PyObject *args)
{
char *str;
if (!PyArg_Parse(args, "s", &str))
......@@ -283,8 +259,7 @@ fm_setpath(self, args)
}
static PyObject *
fm_fontpath(self, args)
PyObject *self, *args;
fm_fontpath(PyObject *self, *args)
{
if (!PyArg_NoArgs(args))
return NULL;
......
This diff is collapsed.
......@@ -46,8 +46,7 @@ static int error_called;
/* The error handler */
static void
imgfile_error(str)
char *str;
imgfile_error(char *str)
{
PyErr_SetString(ImgfileError, str);
error_called = 1;
......@@ -59,8 +58,7 @@ imgfile_error(str)
Make sure we raise an exception if we fail. */
static IMAGE *
imgfile_open(fname)
char *fname;
imgfile_open(char *fname)
{
IMAGE *image;
i_seterror(imgfile_error);
......@@ -81,9 +79,7 @@ imgfile_open(fname)
}
static PyObject *
imgfile_ttob(self, args)
PyObject *self;
PyObject *args;
imgfile_ttob(PyObject *self, PyObject *args)
{
int newval;
PyObject *rv;
......@@ -96,9 +92,7 @@ PyObject *args;
}
static PyObject *
imgfile_read(self, args)
PyObject *self;
PyObject *args;
imgfile_read(PyObject *self, PyObject *args)
{
char *fname;
PyObject *rv;
......@@ -190,9 +184,7 @@ static long *glob_datap;
static int glob_width, glob_z, glob_ysize;
static void
xs_get(buf, y)
short *buf;
int y;
xs_get(short *buf, int y)
{
if (top_to_bottom)
getrow(glob_image, buf, (glob_ysize-1-y), glob_z);
......@@ -201,9 +193,7 @@ int y;
}
static void
xs_put_c(buf, y)
short *buf;
int y;
xs_put_c(short *buf, int y)
{
char *datap = (char *)glob_datap + y*glob_width;
int width = glob_width;
......@@ -213,9 +203,7 @@ int y;
}
static void
xs_put_0(buf, y)
short *buf;
int y;
xs_put_0(short *buf, int y)
{
long *datap = glob_datap + y*glob_width;
int width = glob_width;
......@@ -224,9 +212,7 @@ int y;
*datap++ = (*buf++) & 0xff;
}
static void
xs_put_12(buf, y)
short *buf;
int y;
xs_put_12(short *buf, int y)
{
long *datap = glob_datap + y*glob_width;
int width = glob_width;
......@@ -236,13 +222,8 @@ int y;
}
static void
xscale(image, xsize, ysize, zsize, datap, xnew, ynew, fmode, blur)
IMAGE *image;
int xsize, ysize, zsize;
long *datap;
int xnew, ynew;
int fmode;
double blur;
xscale(IMAGE *image, int xsize, int ysize, int zsize,
long *datap, int xnew, int ynew, int fmode, double blur)
{
glob_image = image;
glob_datap = datap;
......@@ -267,9 +248,7 @@ double blur;
static PyObject *
imgfile_readscaled(self, args)
PyObject *self;
PyObject *args;
imgfile_readscaled(PyObject *self, PyObject *args)
{
char *fname;
PyObject *rv;
......@@ -415,9 +394,7 @@ PyObject *args;
}
static PyObject *
imgfile_getsizes(self, args)
PyObject *self;
PyObject *args;
imgfile_getsizes(PyObject *self, PyObject *args)
{
char *fname;
PyObject *rv;
......@@ -434,9 +411,7 @@ PyObject *args;
}
static PyObject *
imgfile_write(self, args)
PyObject *self;
PyObject *args;
imgfile_write(PyObject *self, PyObject *args)
{
IMAGE *image;
char *fname;
......
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