ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/common/cone.c
(Generate patch)

Comparing ray/src/common/cone.c (file contents):
Revision 2.9 by schorsch, Sun Jul 27 22:12:01 2003 UTC vs.
Revision 2.10 by greg, Thu Apr 21 00:40:35 2016 UTC

# Line 41 | Line 41 | static const char      RCSid[] = "$Id$";
41  
42  
43   CONE *
44 < getcone(o, getxf)                       /* get cone structure */
45 < register OBJREC  *o;
46 < int  getxf;
44 > getcone(                                /* get cone structure */
45 >        OBJREC  *o,
46 >        int  getxf
47 > )
48   {
49          int  sgn0, sgn1;
50 <        register CONE  *co;
50 >        CONE  *co;
51  
52          if ((co = (CONE *)o->os) == NULL) {
53  
# Line 120 | Line 121 | int  getxf;
121                          co->ad[2] = CO_P1(co)[2] - CO_P0(co)[2];
122                  }
123                  co->al = normalize(co->ad);
124 <                if (co->al == 0.0)
125 <                        objerror(o, USER, "zero orientation");
124 >                if (co->al == 0.0) {
125 >                        objerror(o, WARNING, "unknown orientation");
126 >                        free(co);
127 >                        return(NULL);
128 >                }
129                                          /* compute axis and side lengths */
130                  if (o->otype == OBJ_RING) {
131                          co->al = 0.0;
# Line 142 | Line 146 | int  getxf;
146   argcerr:
147          objerror(o, USER, "bad # arguments");
148   raderr:
149 <        objerror(o, USER, "illegal radii");
150 <        return NULL; /* pro forma return */
149 >        objerror(o, WARNING, "illegal radii");
150 >        free(co);
151 >        return(NULL);
152   }
153  
154  
155   void
156 < freecone(o)                     /* free memory associated with cone */
152 < OBJREC  *o;
156 > freecone(OBJREC *o)             /* free memory associated with cone */
157   {
158 <        register CONE  *co = (CONE *)o->os;
158 >        CONE  *co = (CONE *)o->os;
159  
160          if (co == NULL)
161                  return;
# Line 163 | Line 167 | OBJREC  *o;
167  
168  
169   void
170 < conexform(co)                   /* get cone transformation matrix */
167 < register CONE  *co;
170 > conexform(CONE *co)                     /* get cone transformation matrix */
171   {
172          MAT4  m4;
173 <        register double  d;
174 <        register int  i;
173 >        double  d;
174 >        int  i;
175  
176          co->tm = (RREAL (*)[4])malloc(sizeof(MAT4));
177          if (co->tm == NULL)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines