--- ray/src/hd/holo.c 2003/02/22 02:07:24 3.17 +++ ray/src/hd/holo.c 2003/07/27 22:12:02 3.20 @@ -1,5 +1,5 @@ #ifndef lint -static const char RCSid[] = "$Id: holo.c,v 3.17 2003/02/22 02:07:24 greg Exp $"; +static const char RCSid[] = "$Id: holo.c,v 3.20 2003/07/27 22:12:02 schorsch Exp $"; #endif /* * Routines for converting holodeck coordinates, etc. @@ -35,7 +35,7 @@ register HOLO *hp; for (i = 0; i < 3; i++) { fcross(hp->wg[i], hp->xv[(i+1)%3], hp->xv[(i+2)%3]); d = DOT(hp->wg[i],hp->xv[i]); - if (d <= FTINY & d >= -FTINY) + if ((d <= FTINY) & (d >= -FTINY)) error(USER, "degenerate holodeck section"); d = hp->grid[i] / d; hp->wg[i][0] *= d; hp->wg[i][1] *= d; hp->wg[i][2] *= d; @@ -63,9 +63,9 @@ register int i; int n2, reverse; GCOORD g2[2]; /* check range */ - if (i < 1 | i > nbeams(hp)) + if ((i < 1) | (i > nbeams(hp))) return(0); - if (reverse = i >= hp->wi[5]) + if ( (reverse = i >= hp->wi[5]) ) i -= hp->wi[5] - 1; for (j = 0; j < 5; j++) /* find w0 */ if (hp->wi[j+1] > i) @@ -90,9 +90,9 @@ register int i; gc[1].i[1] = i / hp->grid[hdwg0[gc[1].w]]; gc[1].i[0] = i - gc[1].i[1]*hp->grid[hdwg0[gc[1].w]]; if (reverse) { - copystruct(g2, gc+1); - copystruct(gc+1, gc); - copystruct(gc, g2); + *g2 = *(gc+1); + *(gc+1) = *gc; + *gc = *g2; } return(1); /* we're done */ } @@ -107,13 +107,13 @@ register GCOORD gc[2]; int reverse; register int i, j; /* check ordering and limits */ - if (reverse = gc[0].w > gc[1].w) { - copystruct(g2, gc+1); - copystruct(g2+1, gc); + if ( (reverse = gc[0].w > gc[1].w) ) { + *g2 = *(gc+1); + *(g2+1) = *gc; gc = g2; } else if (gc[0].w == gc[1].w) return(0); - if (gc[0].w < 0 | gc[1].w > 5) + if ((gc[0].w < 0) | (gc[1].w > 5)) return(0); i = 0; /* compute index */ for (j = gc[0].w+1; j < gc[1].w; j++) @@ -134,7 +134,7 @@ register FVECT cp[4]; /* returned (may be passed as FV register HOLO *hp; register GCOORD *gc; { - register FLOAT *v; + register RREAL *v; double d; /* compute common component */ VCOPY(cp[0], hp->orig); @@ -263,7 +263,7 @@ FVECT ro, rd; /* normalization of rd affects distance { FVECT p[2], vt; double d, t0, t1, d0, d1; - register FLOAT *v; + register RREAL *v; register int i; /* first, intersect walls */ gc[0].w = gc[1].w = -1; @@ -296,7 +296,7 @@ FVECT ro, rd; /* normalization of rd affects distance } } } - if (gc[0].w < 0 | gc[1].w < 0) /* paranoid check */ + if ((gc[0].w < 0) | (gc[1].w < 0)) /* paranoid check */ return(FHUGE); /* compute intersections */ VSUM(p[0], ro, rd, t0);