--- ray/src/hd/viewbeams.c 2003/06/20 00:25:49 3.4 +++ ray/src/hd/viewbeams.c 2004/01/01 11:21:55 3.7 @@ -1,10 +1,12 @@ #ifndef lint -static const char RCSid[] = "$Id: viewbeams.c,v 3.4 2003/06/20 00:25:49 greg Exp $"; +static const char RCSid[] = "$Id: viewbeams.c,v 3.7 2004/01/01 11:21:55 schorsch Exp $"; #endif /* * Convert view to beam list. */ +#include + #include "rholo.h" #include "view.h" #include "random.h" @@ -24,9 +26,12 @@ static const char RCSid[] = "$Id: viewbeams.c,v 3.4 20 static BEAMLIST blist; -static -add2blist(hd, bi, nr) /* add to beam sample list */ -int hd, bi, nr; +static void +add2blist( /* add to beam sample list */ + int hd, + int bi, + int nr +) { register int i; @@ -46,11 +51,13 @@ int hd, bi, nr; } -int16 * -viewbeams(vp, hr, vr, blp) /* convert view into sections/beams */ -VIEW *vp; -int hr, vr; -BEAMLIST *blp; +extern int16 * +viewbeams( /* convert view into sections/beams */ + VIEW *vp, + int hr, + int vr, + BEAMLIST *blp +) { static int16 sectlist[HDMAX+1]; int16 sectarr[MINRES+1][MINRES+1]; @@ -61,7 +68,7 @@ BEAMLIST *blp; int v; register int h, hd; /* clear section flags */ - bzero((char *)sectlist, sizeof(sectlist)); + memset((char *)sectlist, '\0', sizeof(sectlist)); /* identify view sections */ for (v = 0; v <= MINRES; v++) for (h = 0; h <= MINRES; h++) { @@ -138,15 +145,16 @@ loopexit: /* add samples */ add2blist(hd, hdbindex(hdlist[hd],gc), sampquant); } - copystruct(blp, &blist); /* transfer beam list */ + *blp = blist; /* transfer beam list */ return(sectlist); /* all done! */ } -int -nextview(vp, fp) /* get next view from fp */ -VIEW *vp; -FILE *fp; +extern int +nextview( /* get next view from fp */ + VIEW *vp, + FILE *fp +) { char linebuf[256];