Commit 286da3b4 authored by Peter Schneider-Kamp's avatar Peter Schneider-Kamp

ANSI-fying

added excplicit node * parameter to termvalid argument in
validate_two_chain_ops of parsermodule.c (as proposed by fred)
parent 41c36ffe
...@@ -265,7 +265,6 @@ Sleep(int milli) ...@@ -265,7 +265,6 @@ Sleep(int milli)
{ {
/* XXX Too bad if you don't have select(). */ /* XXX Too bad if you don't have select(). */
struct timeval t; struct timeval t;
double frac;
t.tv_sec = milli/1000; t.tv_sec = milli/1000;
t.tv_usec = (milli%1000) * 1000; t.tv_usec = (milli%1000) * 1000;
select(0, (fd_set *)0, (fd_set *)0, (fd_set *)0, &t); select(0, (fd_set *)0, (fd_set *)0, (fd_set *)0, &t);
...@@ -1503,7 +1502,6 @@ static PyObject * ...@@ -1503,7 +1502,6 @@ static PyObject *
Tkapp_DeleteFileHandler(PyObject *self, PyObject *args) Tkapp_DeleteFileHandler(PyObject *self, PyObject *args)
{ {
PyObject *file; PyObject *file;
FileHandler_ClientData *data;
int tfile; int tfile;
if (!PyArg_ParseTuple(args, "O:deletefilehandler", &file)) if (!PyArg_ParseTuple(args, "O:deletefilehandler", &file))
......
...@@ -47,8 +47,7 @@ newmd5object() ...@@ -47,8 +47,7 @@ newmd5object()
/* MD5 methods */ /* MD5 methods */
static void static void
md5_dealloc(md5p) md5_dealloc(md5object *md5p)
md5object *md5p;
{ {
PyObject_Del(md5p); PyObject_Del(md5p);
} }
...@@ -57,9 +56,7 @@ md5_dealloc(md5p) ...@@ -57,9 +56,7 @@ md5_dealloc(md5p)
/* MD5 methods-as-attributes */ /* MD5 methods-as-attributes */
static PyObject * static PyObject *
md5_update(self, args) md5_update(md5object *self, PyObject *args)
md5object *self;
PyObject *args;
{ {
unsigned char *cp; unsigned char *cp;
int len; int len;
...@@ -82,9 +79,7 @@ arguments."; ...@@ -82,9 +79,7 @@ arguments.";
static PyObject * static PyObject *
md5_digest(self, args) md5_digest(md5object *self, PyObject *args)
md5object *self;
PyObject *args;
{ {
MD5_CTX mdContext; MD5_CTX mdContext;
...@@ -109,9 +104,7 @@ including null bytes."; ...@@ -109,9 +104,7 @@ including null bytes.";
static PyObject * static PyObject *
md5_copy(self, args) md5_copy(md5object *self, PyObject *args)
md5object *self;
PyObject *args;
{ {
md5object *md5p; md5object *md5p;
...@@ -140,9 +133,7 @@ static PyMethodDef md5_methods[] = { ...@@ -140,9 +133,7 @@ static PyMethodDef md5_methods[] = {
}; };
static PyObject * static PyObject *
md5_getattr(self, name) md5_getattr(md5object *self, char *name)
md5object *self;
char *name;
{ {
return Py_FindMethod(md5_methods, (PyObject *)self, name); return Py_FindMethod(md5_methods, (PyObject *)self, name);
} }
...@@ -208,9 +199,7 @@ statichere PyTypeObject MD5type = { ...@@ -208,9 +199,7 @@ statichere PyTypeObject MD5type = {
/* MD5 functions */ /* MD5 functions */
static PyObject * static PyObject *
MD5_new(self, args) MD5_new(PyObject *self, PyObject *args)
PyObject *self;
PyObject *args;
{ {
md5object *md5p; md5object *md5p;
unsigned char *cp = NULL; unsigned char *cp = NULL;
......
...@@ -477,9 +477,7 @@ parser_methods[] = { ...@@ -477,9 +477,7 @@ parser_methods[] = {
static PyObject* static PyObject*
parser_getattr(self, name) parser_getattr(PyObject *self, char *name)
PyObject *self;
char *name;
{ {
return (Py_FindMethod(parser_methods, self, name)); return (Py_FindMethod(parser_methods, self, name));
} }
...@@ -491,8 +489,7 @@ parser_getattr(self, name) ...@@ -491,8 +489,7 @@ parser_getattr(self, name)
* *
*/ */
static void static void
err_string(message) err_string(char *message)
char *message;
{ {
PyErr_SetString(parser_error, message); PyErr_SetString(parser_error, message);
} }
...@@ -1632,8 +1629,7 @@ validate_for(node *tree) ...@@ -1632,8 +1629,7 @@ validate_for(node *tree)
* *
*/ */
static int static int
validate_try(tree) validate_try(node *tree)
node *tree;
{ {
int nch = NCH(tree); int nch = NCH(tree);
int pos = 3; int pos = 3;
...@@ -1882,11 +1878,7 @@ validate_and_expr(node *tree) ...@@ -1882,11 +1878,7 @@ validate_and_expr(node *tree)
static int static int
validate_chain_two_ops(tree, termvalid, op1, op2) validate_chain_two_ops(node *tree, int (*termvalid)(node *), int op1, int op2)
node *tree;
int (*termvalid)();
int op1;
int op2;
{ {
int pos = 1; int pos = 1;
int nch = NCH(tree); int nch = NCH(tree);
......
...@@ -48,11 +48,7 @@ sv_error() ...@@ -48,11 +48,7 @@ sv_error()
} }
static PyObject * static PyObject *
svc_conversion(self, args, function, factor) svc_conversion(captureobject *self, PyObject *args, void (*function)(), float factor)
captureobject *self;
PyObject *args;
void (*function)();
float factor;
{ {
PyObject *output; PyObject *output;
int invert; int invert;
...@@ -84,9 +80,7 @@ svc_conversion(self, args, function, factor) ...@@ -84,9 +80,7 @@ svc_conversion(self, args, function, factor)
* Compression Library 4:2:2 Duplicate Chroma format. * Compression Library 4:2:2 Duplicate Chroma format.
*/ */
static PyObject * static PyObject *
svc_YUVtoYUV422DC(self, args) svc_YUVtoYUV422DC(captureobject *self, PyObject *args)
captureobject *self;
PyObject *args;
{ {
if (self->ob_info.format != SV_YUV411_FRAMES) { if (self->ob_info.format != SV_YUV411_FRAMES) {
PyErr_SetString(SvError, "data has bad format"); PyErr_SetString(SvError, "data has bad format");
...@@ -96,9 +90,7 @@ svc_YUVtoYUV422DC(self, args) ...@@ -96,9 +90,7 @@ svc_YUVtoYUV422DC(self, args)
} }
static PyObject * static PyObject *
svc_YUVtoYUV422DC_quarter(self, args) svc_YUVtoYUV422DC_quarter(captureobject *self, PyObject *args)
captureobject *self;
PyObject *args;
{ {
if (self->ob_info.format != SV_YUV411_FRAMES) { if (self->ob_info.format != SV_YUV411_FRAMES) {
PyErr_SetString(SvError, "data has bad format"); PyErr_SetString(SvError, "data has bad format");
...@@ -109,9 +101,7 @@ svc_YUVtoYUV422DC_quarter(self, args) ...@@ -109,9 +101,7 @@ svc_YUVtoYUV422DC_quarter(self, args)
} }
static PyObject * static PyObject *
svc_YUVtoYUV422DC_sixteenth(self, args) svc_YUVtoYUV422DC_sixteenth(captureobject *self, PyObject *args)
captureobject *self;
PyObject *args;
{ {
if (self->ob_info.format != SV_YUV411_FRAMES) { if (self->ob_info.format != SV_YUV411_FRAMES) {
PyErr_SetString(SvError, "data has bad format"); PyErr_SetString(SvError, "data has bad format");
...@@ -122,9 +112,7 @@ svc_YUVtoYUV422DC_sixteenth(self, args) ...@@ -122,9 +112,7 @@ svc_YUVtoYUV422DC_sixteenth(self, args)
} }
static PyObject * static PyObject *
svc_YUVtoRGB(self, args) svc_YUVtoRGB(captureobject *self, PyObject *args)
captureobject *self;
PyObject *args;
{ {
switch (self->ob_info.format) { switch (self->ob_info.format) {
case SV_YUV411_FRAMES: case SV_YUV411_FRAMES:
...@@ -138,9 +126,7 @@ svc_YUVtoRGB(self, args) ...@@ -138,9 +126,7 @@ svc_YUVtoRGB(self, args)
} }
static PyObject * static PyObject *
svc_RGB8toRGB32(self, args) svc_RGB8toRGB32(captureobject *self, PyObject *args)
captureobject *self;
PyObject *args;
{ {
if (self->ob_info.format != SV_RGB8_FRAMES) { if (self->ob_info.format != SV_RGB8_FRAMES) {
PyErr_SetString(SvError, "data has bad format"); PyErr_SetString(SvError, "data has bad format");
...@@ -150,9 +136,7 @@ svc_RGB8toRGB32(self, args) ...@@ -150,9 +136,7 @@ svc_RGB8toRGB32(self, args)
} }
static PyObject * static PyObject *
svc_InterleaveFields(self, args) svc_InterleaveFields(captureobject *self, PyObject *args)
captureobject *self;
PyObject *args;
{ {
if (self->ob_info.format != SV_RGB8_FRAMES) { if (self->ob_info.format != SV_RGB8_FRAMES) {
PyErr_SetString(SvError, "data has bad format"); PyErr_SetString(SvError, "data has bad format");
...@@ -162,9 +146,7 @@ svc_InterleaveFields(self, args) ...@@ -162,9 +146,7 @@ svc_InterleaveFields(self, args)
} }
static PyObject * static PyObject *
svc_GetFields(self, args) svc_GetFields(captureobject *self, PyObject *args)
captureobject *self;
PyObject *args;
{ {
PyObject *f1 = NULL; PyObject *f1 = NULL;
PyObject *f2 = NULL; PyObject *f2 = NULL;
...@@ -194,9 +176,7 @@ svc_GetFields(self, args) ...@@ -194,9 +176,7 @@ svc_GetFields(self, args)
} }
static PyObject * static PyObject *
svc_UnlockCaptureData(self, args) svc_UnlockCaptureData(captureobject *self, PyObject *args)
captureobject *self;
PyObject *args;
{ {
if (!PyArg_Parse(args, "")) if (!PyArg_Parse(args, ""))
return NULL; return NULL;
...@@ -219,9 +199,7 @@ svc_UnlockCaptureData(self, args) ...@@ -219,9 +199,7 @@ svc_UnlockCaptureData(self, args)
#include <gl.h> #include <gl.h>
static PyObject * static PyObject *
svc_lrectwrite(self, args) svc_lrectwrite(captureobject *self, PyObject *args)
captureobject *self;
PyObject *args;
{ {
Screencoord x1, x2, y1, y2; Screencoord x1, x2, y1, y2;
...@@ -236,9 +214,7 @@ svc_lrectwrite(self, args) ...@@ -236,9 +214,7 @@ svc_lrectwrite(self, args)
#endif #endif
static PyObject * static PyObject *
svc_writefile(self, args) svc_writefile(captureobject *self, PyObject *args)
captureobject *self;
PyObject *args;
{ {
PyObject *file; PyObject *file;
int size; int size;
...@@ -267,9 +243,7 @@ svc_writefile(self, args) ...@@ -267,9 +243,7 @@ svc_writefile(self, args)
} }
static PyObject * static PyObject *
svc_FindVisibleRegion(self, args) svc_FindVisibleRegion(captureobject *self, PyObject *args)
captureobject *self;
PyObject *args;
{ {
void *visible; void *visible;
int width; int width;
...@@ -308,8 +282,7 @@ static PyMethodDef capture_methods[] = { ...@@ -308,8 +282,7 @@ static PyMethodDef capture_methods[] = {
}; };
static void static void
capture_dealloc(self) capture_dealloc(captureobject *self)
captureobject *self;
{ {
if (self->ob_capture != NULL) { if (self->ob_capture != NULL) {
if (self->ob_mustunlock) if (self->ob_mustunlock)
...@@ -323,9 +296,7 @@ capture_dealloc(self) ...@@ -323,9 +296,7 @@ capture_dealloc(self)
} }
static PyObject * static PyObject *
capture_getattr(self, name) capture_getattr(svobject *self, char *name)
svobject *self;
char *name;
{ {
return Py_FindMethod(capture_methods, (PyObject *)self, name); return Py_FindMethod(capture_methods, (PyObject *)self, name);
} }
...@@ -346,10 +317,7 @@ PyTypeObject Capturetype = { ...@@ -346,10 +317,7 @@ PyTypeObject Capturetype = {
}; };
static PyObject * static PyObject *
newcaptureobject(self, ptr, mustunlock) newcaptureobject(svobject *self, void *ptr, int mustunlock)
svobject *self;
void *ptr;
int mustunlock;
{ {
captureobject *p; captureobject *p;
...@@ -365,9 +333,7 @@ newcaptureobject(self, ptr, mustunlock) ...@@ -365,9 +333,7 @@ newcaptureobject(self, ptr, mustunlock)
} }
static PyObject * static PyObject *
sv_GetCaptureData(self, args) sv_GetCaptureData(svobject *self, PyObject *args)
svobject *self;
PyObject *args;
{ {
void *ptr; void *ptr;
long fieldID; long fieldID;
...@@ -393,9 +359,7 @@ sv_GetCaptureData(self, args) ...@@ -393,9 +359,7 @@ sv_GetCaptureData(self, args)
} }
static PyObject * static PyObject *
sv_BindGLWindow(self, args) sv_BindGLWindow(svobject *self, PyObject *args)
svobject *self;
PyObject *args;
{ {
long wid; long wid;
int mode; int mode;
...@@ -411,9 +375,7 @@ sv_BindGLWindow(self, args) ...@@ -411,9 +375,7 @@ sv_BindGLWindow(self, args)
} }
static PyObject * static PyObject *
sv_EndContinuousCapture(self, args) sv_EndContinuousCapture(svobject *self, PyObject *args)
svobject *self;
PyObject *args;
{ {
if (!PyArg_Parse(args, "")) if (!PyArg_Parse(args, ""))
...@@ -427,9 +389,7 @@ sv_EndContinuousCapture(self, args) ...@@ -427,9 +389,7 @@ sv_EndContinuousCapture(self, args)
} }
static PyObject * static PyObject *
sv_IsVideoDisplayed(self, args) sv_IsVideoDisplayed(svobject *self, PyObject *args)
svobject *self;
PyObject *args;
{ {
int v; int v;
...@@ -444,9 +404,7 @@ sv_IsVideoDisplayed(self, args) ...@@ -444,9 +404,7 @@ sv_IsVideoDisplayed(self, args)
} }
static PyObject * static PyObject *
sv_OutputOffset(self, args) sv_OutputOffset(svobject *self, PyObject *args)
svobject *self;
PyObject *args;
{ {
int x_offset; int x_offset;
int y_offset; int y_offset;
...@@ -462,9 +420,7 @@ sv_OutputOffset(self, args) ...@@ -462,9 +420,7 @@ sv_OutputOffset(self, args)
} }
static PyObject * static PyObject *
sv_PutFrame(self, args) sv_PutFrame(svobject *self, PyObject *args)
svobject *self;
PyObject *args;
{ {
char *buffer; char *buffer;
...@@ -479,9 +435,7 @@ sv_PutFrame(self, args) ...@@ -479,9 +435,7 @@ sv_PutFrame(self, args)
} }
static PyObject * static PyObject *
sv_QuerySize(self, args) sv_QuerySize(svobject *self, PyObject *args)
svobject *self;
PyObject *args;
{ {
int w; int w;
int h; int h;
...@@ -498,9 +452,7 @@ sv_QuerySize(self, args) ...@@ -498,9 +452,7 @@ sv_QuerySize(self, args)
} }
static PyObject * static PyObject *
sv_SetSize(self, args) sv_SetSize(svobject *self, PyObject *args)
svobject *self;
PyObject *args;
{ {
int w; int w;
int h; int h;
...@@ -516,9 +468,7 @@ sv_SetSize(self, args) ...@@ -516,9 +468,7 @@ sv_SetSize(self, args)
} }
static PyObject * static PyObject *
sv_SetStdDefaults(self, args) sv_SetStdDefaults(svobject *self, PyObject *args)
svobject *self;
PyObject *args;
{ {
if (!PyArg_Parse(args, "")) if (!PyArg_Parse(args, ""))
...@@ -532,9 +482,7 @@ sv_SetStdDefaults(self, args) ...@@ -532,9 +482,7 @@ sv_SetStdDefaults(self, args)
} }
static PyObject * static PyObject *
sv_UseExclusive(self, args) sv_UseExclusive(svobject *self, PyObject *args)
svobject *self;
PyObject *args;
{ {
boolean onoff; boolean onoff;
int mode; int mode;
...@@ -550,9 +498,7 @@ sv_UseExclusive(self, args) ...@@ -550,9 +498,7 @@ sv_UseExclusive(self, args)
} }
static PyObject * static PyObject *
sv_WindowOffset(self, args) sv_WindowOffset(svobject *self, PyObject *args)
svobject *self;
PyObject *args;
{ {
int x_offset; int x_offset;
int y_offset; int y_offset;
...@@ -568,9 +514,7 @@ sv_WindowOffset(self, args) ...@@ -568,9 +514,7 @@ sv_WindowOffset(self, args)
} }
static PyObject * static PyObject *
sv_CaptureBurst(self, args) sv_CaptureBurst(svobject *self, PyObject *args)
svobject *self;
PyObject *args;
{ {
int bytes, i; int bytes, i;
svCaptureInfo info; svCaptureInfo info;
...@@ -661,9 +605,7 @@ sv_CaptureBurst(self, args) ...@@ -661,9 +605,7 @@ sv_CaptureBurst(self, args)
} }
static PyObject * static PyObject *
sv_CaptureOneFrame(self, args) sv_CaptureOneFrame(svobject *self, PyObject *args)
svobject *self;
PyObject *args;
{ {
svCaptureInfo info; svCaptureInfo info;
int format, width, height; int format, width, height;
...@@ -703,9 +645,7 @@ sv_CaptureOneFrame(self, args) ...@@ -703,9 +645,7 @@ sv_CaptureOneFrame(self, args)
} }
static PyObject * static PyObject *
sv_InitContinuousCapture(self, args) sv_InitContinuousCapture(svobject *self, PyObject *args)
svobject *self;
PyObject *args;
{ {
svCaptureInfo info; svCaptureInfo info;
...@@ -724,9 +664,7 @@ sv_InitContinuousCapture(self, args) ...@@ -724,9 +664,7 @@ sv_InitContinuousCapture(self, args)
} }
static PyObject * static PyObject *
sv_LoadMap(self, args) sv_LoadMap(svobject *self, PyObject *args)
svobject *self;
PyObject *args;
{ {
PyObject *rgb; PyObject *rgb;
PyObject *res = NULL; PyObject *res = NULL;
...@@ -787,9 +725,7 @@ sv_LoadMap(self, args) ...@@ -787,9 +725,7 @@ sv_LoadMap(self, args)
} }
static PyObject * static PyObject *
sv_CloseVideo(self, args) sv_CloseVideo(svobject *self, PyObject *args)
svobject *self;
PyObject *args;
{ {
if (!PyArg_Parse(args, "")) if (!PyArg_Parse(args, ""))
return NULL; return NULL;
...@@ -803,11 +739,8 @@ sv_CloseVideo(self, args) ...@@ -803,11 +739,8 @@ sv_CloseVideo(self, args)
} }
static PyObject * static PyObject *
doParams(self, args, func, modified) doParams(svobject *self, PyObject *args,
svobject *self; int (*func)(SV_nodeP, long *, int), int modified)
PyObject *args;
int (*func)(SV_nodeP, long *, int);
int modified;
{ {
PyObject *list; PyObject *list;
PyObject *res = NULL; PyObject *res = NULL;
...@@ -869,22 +802,19 @@ doParams(self, args, func, modified) ...@@ -869,22 +802,19 @@ doParams(self, args, func, modified)
} }
static PyObject * static PyObject *
sv_GetParam(self, args) sv_GetParam(PyObject *self, PyObject *args)
PyObject *self, *args;
{ {
return doParams(self, args, svGetParam, 1); return doParams(self, args, svGetParam, 1);
} }
static PyObject * static PyObject *
sv_GetParamRange(self, args) sv_GetParamRange(PyObject *self, PyObject *args)
PyObject *self, *args;
{ {
return doParams(self, args, svGetParamRange, 1); return doParams(self, args, svGetParamRange, 1);
} }
static PyObject * static PyObject *
sv_SetParam(self, args) sv_SetParam(PyObject *self, PyObject *args)
PyObject *self, *args;
{ {
return doParams(self, args, svSetParam, 0); return doParams(self, args, svSetParam, 0);
} }
...@@ -913,11 +843,8 @@ static PyMethodDef svideo_methods[] = { ...@@ -913,11 +843,8 @@ static PyMethodDef svideo_methods[] = {
}; };
static PyObject * static PyObject *
sv_conversion(self, args, function, inputfactor, factor) sv_conversion(PyObject *self, PyObject *args, void (*function)(),
PyObject *self, *args; int inputfactor, float factor)
void (*function)();
int inputfactor;
float factor;
{ {
int invert, width, height, inputlength; int invert, width, height, inputlength;
char *input, *str; char *input, *str;
...@@ -947,29 +874,25 @@ sv_conversion(self, args, function, inputfactor, factor) ...@@ -947,29 +874,25 @@ sv_conversion(self, args, function, inputfactor, factor)
} }
static PyObject * static PyObject *
sv_InterleaveFields(self, args) sv_InterleaveFields(PyObject *self, PyObject *args)
PyObject *self, *args;
{ {
return sv_conversion(self, args, svInterleaveFields, 1, 1.0); return sv_conversion(self, args, svInterleaveFields, 1, 1.0);
} }
static PyObject * static PyObject *
sv_RGB8toRGB32(self, args) sv_RGB8toRGB32(PyObject *self, PyObject *args)
PyObject *self, *args;
{ {
return sv_conversion(self, args, svRGB8toRGB32, 1, (float) sizeof(long)); return sv_conversion(self, args, svRGB8toRGB32, 1, (float) sizeof(long));
} }
static PyObject * static PyObject *
sv_YUVtoRGB(self, args) sv_YUVtoRGB(PyObject *self, PyObject *args)
PyObject *self, *args;
{ {
return sv_conversion(self, args, svYUVtoRGB, 2, (float) sizeof(long)); return sv_conversion(self, args, svYUVtoRGB, 2, (float) sizeof(long));
} }
static void static void
svideo_dealloc(self) svideo_dealloc(svobject *self)
svobject *self;
{ {
if (self->ob_svideo != NULL) if (self->ob_svideo != NULL)
(void) svCloseVideo(self->ob_svideo); (void) svCloseVideo(self->ob_svideo);
...@@ -977,9 +900,7 @@ svideo_dealloc(self) ...@@ -977,9 +900,7 @@ svideo_dealloc(self)
} }
static PyObject * static PyObject *
svideo_getattr(self, name) svideo_getattr(svobject *self, char *name)
svobject *self;
char *name;
{ {
return Py_FindMethod(svideo_methods, (PyObject *)self, name); return Py_FindMethod(svideo_methods, (PyObject *)self, name);
} }
...@@ -1000,8 +921,7 @@ PyTypeObject Svtype = { ...@@ -1000,8 +921,7 @@ PyTypeObject Svtype = {
}; };
static PyObject * static PyObject *
newsvobject(svp) newsvobject(SV_nodeP svp)
SV_nodeP svp;
{ {
svobject *p; svobject *p;
...@@ -1018,8 +938,7 @@ newsvobject(svp) ...@@ -1018,8 +938,7 @@ newsvobject(svp)
} }
static PyObject * static PyObject *
sv_OpenVideo(self, args) sv_OpenVideo(PyObject *self, PyObject *args)
PyObject *self, *args;
{ {
SV_nodeP svp; SV_nodeP svp;
......
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