mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
ANSI-fication of the SGI modules (note that svmodule.c and sgimodule.c
have already been checked in) UNTESTED!
This commit is contained in:
parent
10723347c6
commit
6a85027a97
7 changed files with 769 additions and 2295 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue