--- ray/src/common/color.c 2003/04/07 15:43:08 2.11 +++ ray/src/common/color.c 2004/09/14 02:53:50 2.15 @@ -1,5 +1,5 @@ #ifndef lint -static const char RCSid[] = "$Id: color.c,v 2.11 2003/04/07 15:43:08 greg Exp $"; +static const char RCSid[] = "$Id: color.c,v 2.15 2004/09/14 02:53:50 greg Exp $"; #endif /* * color.c - routines for color calculations. @@ -17,6 +17,13 @@ static const char RCSid[] = "$Id: color.c,v 2.11 2003/ #include "color.h" +#ifdef getc_unlocked /* avoid horrendous overhead of flockfile */ +#undef getc +#undef putc +#define getc getc_unlocked +#define putc putc_unlocked +#endif + #define MINELEN 8 /* minimum scanline length for encoding */ #define MAXELEN 0x7fff /* maximum scanline length for encoding */ #define MINRUN 4 /* minimum run length */ @@ -31,7 +38,7 @@ unsigned int len; if (len > tempbuflen) { if (tempbuflen > 0) - tempbuf = (char *)realloc(tempbuf, len); + tempbuf = (char *)realloc((void *)tempbuf, len); else tempbuf = (char *)malloc(len); tempbuflen = tempbuf==NULL ? 0 : len; @@ -49,7 +56,7 @@ register FILE *fp; register int i, j, beg, cnt = 1; int c2; - if (len < MINELEN | len > MAXELEN) /* OOBs, write out flat */ + if ((len < MINELEN) | (len > MAXELEN)) /* OOBs, write out flat */ return(fwrite((char *)scanline,sizeof(COLR),len,fp) - len); /* put magic header */ putc(2, fp); @@ -139,7 +146,7 @@ register FILE *fp; register int i, j; int code, val; /* determine scanline type */ - if (len < MINELEN | len > MAXELEN) + if ((len < MINELEN) | (len > MAXELEN)) return(oldreadcolrs(scanline, len, fp)); if ((i = getc(fp)) == EOF) return(-1);