--- ray/src/common/colrops.c 2003/07/27 22:12:01 2.10 +++ ray/src/common/colrops.c 2011/05/20 02:06:38 2.12 @@ -1,5 +1,5 @@ #ifndef lint -static const char RCSid[] = "$Id: colrops.c,v 2.10 2003/07/27 22:12:01 schorsch Exp $"; +static const char RCSid[] = "$Id: colrops.c,v 2.12 2011/05/20 02:06:38 greg Exp $"; #endif /* * Integer operations on COLR scanlines @@ -9,27 +9,28 @@ static const char RCSid[] = "$Id: colrops.c,v 2.10 200 #include #include + +#include "rtmisc.h" #include "color.h" -extern char *bmalloc(); #define MAXGSHIFT 31 /* maximum shift for gamma table */ -static BYTE *g_mant = NULL, *g_nexp = NULL; +static uby8 *g_mant = NULL, *g_nexp = NULL; -static BYTE (*g_bval)[256] = NULL; +static uby8 (*g_bval)[256] = NULL; int setcolrcor(f, a2) /* set brightness correction */ -double (*f)(); +double (*f)(double,double); double a2; { double mult; register int i, j; /* allocate tables */ if (g_bval == NULL && (g_bval = - (BYTE (*)[256])bmalloc((MAXGSHIFT+1)*256)) == NULL) + (uby8 (*)[256])bmalloc((MAXGSHIFT+1)*256)) == NULL) return(-1); /* compute colr -> gamb mapping */ mult = 1.0/256.0; @@ -44,15 +45,15 @@ double a2; int setcolrinv(f, a2) /* set inverse brightness correction */ -double (*f)(); +double (*f)(double,double); double a2; { double mult; register int i, j; /* allocate tables */ - if (g_mant == NULL && (g_mant = (BYTE *)bmalloc(256)) == NULL) + if (g_mant == NULL && (g_mant = (uby8 *)bmalloc(256)) == NULL) return(-1); - if (g_nexp == NULL && (g_nexp = (BYTE *)bmalloc(256)) == NULL) + if (g_nexp == NULL && (g_nexp = (uby8 *)bmalloc(256)) == NULL) return(-1); /* compute gamb -> colr mapping */ i = 0;