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 |
|
|
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; |
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; |
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) |