--- ray/src/ot/sphere.c 1991/05/22 17:01:43 1.3 +++ ray/src/ot/sphere.c 2016/04/20 18:51:35 2.6 @@ -1,9 +1,6 @@ -/* Copyright (c) 1986 Regents of the University of California */ - #ifndef lint -static char SCCSid[] = "$SunId$ LBL"; +static const char RCSid[] = "$Id: sphere.c,v 2.6 2016/04/20 18:51:35 greg Exp $"; #endif - /* * sphere.c - routines for creating octrees for spheres. * @@ -53,14 +50,16 @@ static char SCCSid[] = "$SunId$ LBL"; */ -o_sphere(o, cu) /* determine if sphere intersects cube */ -OBJREC *o; -register CUBE *cu; +int +o_sphere( /* determine if sphere intersects cube */ + OBJREC *o, + CUBE *cu +) { FVECT v1; double d1, d2; - register double *fa; - register int i; + RREAL *fa; + int i; #define cent fa #define rad fa[3] /* get arguments */ @@ -72,8 +71,10 @@ register CUBE *cu; o->otype = o->otype == OBJ_SPHERE ? OBJ_BUBBLE : OBJ_SPHERE; rad = -rad; - } else if (rad <= FTINY) - objerror(o, USER, "zero radius"); + } else if (rad <= FTINY) { + objerror(o, WARNING, "zero radius"); + return(O_MISS); + } d1 = ROOT3/2.0 * cu->cusize; /* bounding radius for cube */