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

ANSI-fication

üst 3707efef
...@@ -119,9 +119,7 @@ static int reverse_order; ...@@ -119,9 +119,7 @@ static int reverse_order;
* *
*/ */
static void static void
addlongimgtag(dptr, xsize, ysize) addlongimgtag(Py_UInt32 *dptr, int xsize, int ysize)
Py_UInt32 *dptr;
int xsize, ysize;
{ {
dptr = dptr + (xsize * ysize); dptr = dptr + (xsize * ysize);
dptr[0] = 0x12345678; dptr[0] = 0x12345678;
...@@ -137,8 +135,7 @@ addlongimgtag(dptr, xsize, ysize) ...@@ -137,8 +135,7 @@ addlongimgtag(dptr, xsize, ysize)
* *
*/ */
static unsigned short static unsigned short
getshort(inf) getshort(FILE *inf)
FILE *inf;
{ {
unsigned char buf[2]; unsigned char buf[2];
...@@ -147,8 +144,7 @@ getshort(inf) ...@@ -147,8 +144,7 @@ getshort(inf)
} }
static Py_UInt32 static Py_UInt32
getlong(inf) getlong(FILE *inf)
FILE *inf;
{ {
unsigned char buf[4]; unsigned char buf[4];
...@@ -157,9 +153,7 @@ getlong(inf) ...@@ -157,9 +153,7 @@ getlong(inf)
} }
static void static void
putshort(outf, val) putshort(FILE *outf, unsigned short val)
FILE *outf;
unsigned short val;
{ {
unsigned char buf[2]; unsigned char buf[2];
...@@ -169,9 +163,7 @@ putshort(outf, val) ...@@ -169,9 +163,7 @@ putshort(outf, val)
} }
static int static int
putlong(outf, val) putlong(FILE *outf, Py_UInt32 val)
FILE *outf;
Py_UInt32 val;
{ {
unsigned char buf[4]; unsigned char buf[4];
...@@ -183,9 +175,7 @@ putlong(outf, val) ...@@ -183,9 +175,7 @@ putlong(outf, val)
} }
static void static void
readheader(inf, image) readheader(FILE *inf, IMAGE *image)
FILE *inf;
IMAGE *image;
{ {
memset(image ,0, sizeof(IMAGE)); memset(image ,0, sizeof(IMAGE));
image->imagic = getshort(inf); image->imagic = getshort(inf);
...@@ -197,9 +187,7 @@ readheader(inf, image) ...@@ -197,9 +187,7 @@ readheader(inf, image)
} }
static int static int
writeheader(outf, image) writeheader(FILE *outf, IMAGE *image)
FILE *outf;
IMAGE *image;
{ {
IMAGE t; IMAGE t;
...@@ -219,10 +207,7 @@ writeheader(outf, image) ...@@ -219,10 +207,7 @@ writeheader(outf, image)
} }
static int static int
writetab(outf, tab, len) writetab(FILE *outf, /*unsigned*/ Py_Int32 *tab, int len)
FILE *outf;
/*unsigned*/ Py_Int32 *tab;
int len;
{ {
int r = 0; int r = 0;
...@@ -234,10 +219,7 @@ writetab(outf, tab, len) ...@@ -234,10 +219,7 @@ writetab(outf, tab, len)
} }
static void static void
readtab(inf, tab, len) readtab(FILE *inf, /*unsigned*/ Py_Int32 *tab, int len)
FILE *inf;
/*unsigned*/ Py_Int32 *tab;
int len;
{ {
while(len) { while(len) {
*tab++ = getlong(inf); *tab++ = getlong(inf);
...@@ -251,8 +233,7 @@ readtab(inf, tab, len) ...@@ -251,8 +233,7 @@ readtab(inf, tab, len)
* *
*/ */
static PyObject * static PyObject *
sizeofimage(self, args) sizeofimage(PyObject *self, PyObject *args)
PyObject *self, *args;
{ {
char *name; char *name;
IMAGE image; IMAGE image;
...@@ -283,8 +264,7 @@ sizeofimage(self, args) ...@@ -283,8 +264,7 @@ sizeofimage(self, args)
* *
*/ */
static PyObject * static PyObject *
longimagedata(self, args) longimagedata(PyObject *self, PyObject *args)
PyObject *self, *args;
{ {
char *name; char *name;
unsigned char *base, *lptr; unsigned char *base, *lptr;
...@@ -465,9 +445,7 @@ longimagedata(self, args) ...@@ -465,9 +445,7 @@ longimagedata(self, args)
/* static utility functions for longimagedata */ /* static utility functions for longimagedata */
static void static void
interleaverow(lptr, cptr, z, n) interleaverow(unsigned char *lptr, unsigned char *cptr, int z, int n)
unsigned char *lptr, *cptr;
int z, n;
{ {
lptr += z; lptr += z;
while (n--) { while (n--) {
...@@ -477,9 +455,7 @@ interleaverow(lptr, cptr, z, n) ...@@ -477,9 +455,7 @@ interleaverow(lptr, cptr, z, n)
} }
static void static void
copybw(lptr, n) copybw(Py_Int32 *lptr, int n)
Py_Int32 *lptr;
int n;
{ {
while (n >= 8) { while (n >= 8) {
lptr[0] = 0xff000000 + (0x010101 * (lptr[0] & 0xff)); lptr[0] = 0xff000000 + (0x010101 * (lptr[0] & 0xff));
...@@ -500,8 +476,7 @@ copybw(lptr, n) ...@@ -500,8 +476,7 @@ copybw(lptr, n)
} }
static void static void
setalpha(lptr, n) setalpha(unsigned char *lptr, int n)
unsigned char *lptr;
{ {
while (n >= 8) { while (n >= 8) {
lptr[0 * 4] = 0xff; lptr[0 * 4] = 0xff;
...@@ -522,9 +497,7 @@ setalpha(lptr, n) ...@@ -522,9 +497,7 @@ setalpha(lptr, n)
} }
static void static void
expandrow(optr, iptr, z) expandrow(unsigned char *optr, unsigned char *iptr, int z)
unsigned char *optr, *iptr;
int z;
{ {
unsigned char pixel, count; unsigned char pixel, count;
...@@ -586,8 +559,7 @@ expandrow(optr, iptr, z) ...@@ -586,8 +559,7 @@ expandrow(optr, iptr, z)
* *
*/ */
static PyObject * static PyObject *
longstoimage(self, args) longstoimage(PyObject *self, PyObject *args)
PyObject *self, *args;
{ {
unsigned char *lptr; unsigned char *lptr;
char *name; char *name;
...@@ -687,9 +659,7 @@ longstoimage(self, args) ...@@ -687,9 +659,7 @@ longstoimage(self, args)
/* static utility functions for longstoimage */ /* static utility functions for longstoimage */
static void static void
lumrow(rgbptr, lumptr, n) lumrow(unsigned char *rgbptr, unsigned char *lumptr, int n)
unsigned char *rgbptr, *lumptr;
int n;
{ {
lumptr += CHANOFFSET(0); lumptr += CHANOFFSET(0);
while (n--) { while (n--) {
...@@ -702,9 +672,7 @@ lumrow(rgbptr, lumptr, n) ...@@ -702,9 +672,7 @@ lumrow(rgbptr, lumptr, n)
} }
static int static int
compressrow(lbuf, rlebuf, z, cnt) compressrow(unsigned char *lbuf, unsigned char *rlebuf, int z, int cnt)
unsigned char *lbuf, *rlebuf;
int z, cnt;
{ {
unsigned char *iptr, *ibufend, *sptr, *optr; unsigned char *iptr, *ibufend, *sptr, *optr;
short todo, cc; short todo, cc;
...@@ -765,9 +733,7 @@ compressrow(lbuf, rlebuf, z, cnt) ...@@ -765,9 +733,7 @@ compressrow(lbuf, rlebuf, z, cnt)
} }
static PyObject * static PyObject *
ttob(self, args) ttob(PyObject *self, PyObject *args)
PyObject *self;
PyObject *args;
{ {
int order, oldorder; int order, oldorder;
......
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