44 |
|
} |
45 |
|
|
46 |
|
|
47 |
< |
SRCREC * |
47 |
> |
int |
48 |
|
newsource() /* allocate new source in our array */ |
49 |
|
{ |
50 |
|
if (nsources == 0) |
53 |
|
source = (SRCREC *)realloc((char *)source, |
54 |
|
(unsigned)(nsources+1)*sizeof(SRCREC)); |
55 |
|
if (source == NULL) |
56 |
< |
return(NULL); |
56 |
> |
return(-1); |
57 |
|
source[nsources].sflags = 0; |
58 |
|
source[nsources].nhits = 1; |
59 |
|
source[nsources].ntests = 2; /* initial hit probability = 1/2 */ |
60 |
< |
return(&source[nsources++]); |
60 |
> |
return(nsources++); |
61 |
|
} |
62 |
|
|
63 |
|
|
180 |
|
ocent[i] += VERTEX(f,j)[i]; |
181 |
|
ocent[i] /= (double)f->nv; |
182 |
|
} |
183 |
+ |
if (f->area == 0.) |
184 |
+ |
return(0.); |
185 |
|
maxrad2 = 0.; |
186 |
|
for (j = 0; j < f->nv; j++) { |
187 |
|
d2 = dist2(VERTEX(f,j), ocent); |