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