--- ray/src/common/face.c 1989/07/28 14:27:44 1.3 +++ ray/src/common/face.c 1992/10/02 16:02:20 2.2 @@ -1,4 +1,4 @@ -/* Copyright (c) 1986 Regents of the University of California */ +/* Copyright (c) 1991 Regents of the University of California */ #ifndef lint static char SCCSid[] = "$SunId$ LBL"; @@ -34,7 +34,6 @@ FACE * getface(o) /* get arguments for a face */ OBJREC *o; { - double fabs(); double d1; int badvert; FVECT v1, v2, v3; @@ -84,7 +83,7 @@ OBJREC *o; badvert += fabs(d1 - f->offset/i) > VERTEPS; f->offset += d1; } - f->offset /= f->nv; + f->offset /= (double)f->nv; if (badvert) objerror(o, WARNING, "non-planar vertex"); /* find axis */ @@ -99,6 +98,8 @@ OBJREC *o; freeface(o) /* free memory associated with face */ OBJREC *o; { + if (o->os == NULL) + return; free(o->os); o->os = NULL; } @@ -111,7 +112,7 @@ FACE *f; int ncross, n; double x, y; register int xi, yi; - register double *p0, *p1; + register FLOAT *p0, *p1; xi = (f->ax+1)%3; yi = (f->ax+2)%3;