--- ray/src/gen/mksource.c 2007/08/24 04:41:36 2.5 +++ ray/src/gen/mksource.c 2014/03/06 00:42:21 2.8 @@ -1,5 +1,5 @@ #ifndef lint -static const char RCSid[] = "$Id: mksource.c,v 2.5 2007/08/24 04:41:36 greg Exp $"; +static const char RCSid[] = "$Id: mksource.c,v 2.8 2014/03/06 00:42:21 greg Exp $"; #endif /* * Generate distant sources corresponding to the given environment map @@ -242,11 +242,11 @@ get_ehisto(const TRITREE *node, long exphisto[256]) double get_threshold(const TRITREE *tree) { + long samptotal = 0; long exphisto[256]; - long samptotal; int i; /* compute sample histogram */ - memset((void *)exphisto, 0, sizeof(exphisto)); + memset(exphisto, 0, sizeof(exphisto)); for (i = 0; i < NTRUNKBR; i++) get_ehisto(&tree->kid[i], exphisto); /* use 98th percentile */ @@ -355,7 +355,7 @@ claimlight(COLOR intens, TRITREE *node, FVECT cent, do if (remaining) return; /* consolidate empties */ - free((void *)node->kid); node->kid = NULL; + free(node->kid); node->kid = NULL; copycolr(node->val, blkclr); node->sd = node->gdv[0]; /* doesn't really matter */ } @@ -387,7 +387,7 @@ getlost(LOSTLIGHT **llp, COLOR intens, FVECT cent, dou if (fdir2diff(thisp->sd,cent) <= maxr2) { LOSTLIGHT *mynext = thisp->next; addcolor(intens, thisp->intens); - free((void *)thisp); + free(thisp); lastp->next = mynext; } else lastp = thisp; @@ -457,7 +457,7 @@ mksources(TRITREE *samptree, double thresh, double max thisethresh); if (normalize(vsum) == .0) break; - movedist = acos(DOT(vsum,curcent)); + movedist = Acos(DOT(vsum,curcent)); if (movedist > growstep) { VSUB(vsum, vsum, curcent); movedist = growstep/VLEN(vsum);