--- ray/src/rt/p_func.c 1991/11/25 09:50:57 2.2 +++ ray/src/rt/p_func.c 2004/03/30 16:13:01 2.7 @@ -1,18 +1,15 @@ -/* Copyright (c) 1991 Regents of the University of California */ - #ifndef lint -static char SCCSid[] = "$SunId$ LBL"; +static const char RCSid[] = "$Id: p_func.c,v 2.7 2004/03/30 16:13:01 schorsch Exp $"; #endif - /* * p_func.c - routine for procedural patterns. - * - * 4/8/86 */ -#include "ray.h" +#include "copyright.h" +#include "ray.h" #include "func.h" +#include "rtotypes.h" /* * A procedural pattern can either be a brightness or a @@ -37,9 +34,11 @@ static char SCCSid[] = "$SunId$ LBL"; */ -p_bfunc(m, r) /* compute brightness pattern */ -OBJREC *m; -RAY *r; +extern int +p_bfunc( /* compute brightness pattern */ + OBJREC *m, + RAY *r +) { double bval; register MFUNC *mf; @@ -50,17 +49,20 @@ RAY *r; setfunc(m, r); errno = 0; bval = evalue(mf->ep[0]); - if (errno) { + if (errno == EDOM || errno == ERANGE) { objerror(m, WARNING, "compute error"); - return; + return(0); } scalecolor(r->pcol, bval); + return(0); } -p_cfunc(m, r) /* compute color pattern */ -OBJREC *m; -RAY *r; +extern int +p_cfunc( /* compute color pattern */ + OBJREC *m, + RAY *r +) { COLOR cval; register MFUNC *mf; @@ -73,9 +75,10 @@ RAY *r; setcolor(cval, evalue(mf->ep[0]), evalue(mf->ep[1]), evalue(mf->ep[2])); - if (errno) { + if (errno == EDOM || errno == ERANGE) { objerror(m, WARNING, "compute error"); - return; + return(0); } multcolor(r->pcol, cval); + return(0); }