--- ray/src/gen/mkillum2.c 1994/01/07 14:51:46 2.6 +++ ray/src/gen/mkillum2.c 2003/06/30 14:59:11 2.11 @@ -1,19 +1,15 @@ -/* Copyright (c) 1991 Regents of the University of California */ - #ifndef lint -static char SCCSid[] = "$SunId$ LBL"; +static const char RCSid[] = "$Id: mkillum2.c,v 2.11 2003/06/30 14:59:11 schorsch Exp $"; #endif - /* * Routines to do the actual calculation for mkillum */ -#include "mkillum.h" +#include +#include "mkillum.h" #include "face.h" - #include "cone.h" - #include "random.h" @@ -118,7 +114,7 @@ char *nm; objerror(ob, WARNING, "bad aspect"); rt->nrays = 0; freeface(ob); - free((char *)distarr); + free((void *)distarr); o_default(ob, il, rt, nm); return; } @@ -137,7 +133,7 @@ char *nm; printobj(il->altmat, ob); /* clean up */ freeface(ob); - free((char *)distarr); + free((void *)distarr); #undef MAXMISS } @@ -163,8 +159,8 @@ char *nm; nalt = nazi = 1; else { n = 4.*PI * il->sampdens; - nalt = sqrt(n/PI) + .5; - nazi = PI*nalt + .5; + nalt = sqrt(2./PI*n) + .5; + nazi = PI/2.*nalt + .5; } n = nalt*nazi; distarr = (float *)calloc(n, 3*sizeof(float)); @@ -207,7 +203,7 @@ char *nm; } else printobj(il->altmat, ob); /* clean up */ - free((char *)distarr); + free((void *)distarr); } @@ -276,7 +272,7 @@ char *nm; printobj(il->altmat, ob); /* clean up */ freecone(ob); - free((char *)distarr); + free((void *)distarr); } @@ -303,12 +299,12 @@ register struct rtproc *rt; if (rt->nrays <= 0) return; - bzero(rt->buf+6*rt->nrays, 6*sizeof(float)); + memset(rt->buf+6*rt->nrays, '\0', 6*sizeof(float)); errno = 0; - if ( process(rt->pd, (char *)rt->buf, (char *)rt->buf, - 3*sizeof(float)*rt->nrays, + if ( process(&(rt->pd), (char *)rt->buf, (char *)rt->buf, + 3*sizeof(float)*(rt->nrays+1), 6*sizeof(float)*(rt->nrays+1)) < - 3*sizeof(float)*rt->nrays ) + 3*sizeof(float)*(rt->nrays+1) ) error(SYSTEM, "error reading from rtrace process"); i = rt->nrays; while (i--) {