110 |
|
lastin = -1; /* flag full sort */ |
111 |
|
break; |
112 |
|
} |
113 |
< |
/* sort updated list */ |
114 |
< |
sortcomplist(); |
113 |
> |
if (lastin < 0) /* sort updated list */ |
114 |
> |
sortcomplist(); |
115 |
|
return; /* no display */ |
116 |
|
default: |
117 |
|
error(CONSISTENCY, "bundle_set called with unknown operation"); |
121 |
|
if (clist[i].nr > n) |
122 |
|
n = clist[i].nr; |
123 |
|
p = (PACKHEAD *)malloc(sizeof(PACKHEAD) + n*sizeof(RAYVAL)); |
124 |
< |
/* now, display what we can */ |
124 |
> |
if (p == NULL) |
125 |
> |
goto memerr; |
126 |
> |
/* display what we have */ |
127 |
|
for (i = 0; i < nents; i++) |
128 |
< |
if (clist[i].nr > 0 && |
127 |
< |
(b = hdgetbeam(hdlist[clist[i].hd], clist[i].bi)) != NULL) { |
128 |
> |
if ((b = hdgetbeam(hdlist[clist[i].hd], clist[i].bi)) != NULL) { |
129 |
|
bcopy((char *)hdbray(b), (char *)(p+1), |
130 |
|
(p->nr=b->nrm)*sizeof(RAYVAL)); |
131 |
|
disp_packet((PACKET *)p); |
205 |
|
int lseg[2][3]; |
206 |
|
double frac; |
207 |
|
register int k; |
208 |
+ |
/* free old list */ |
209 |
+ |
if (complen > 0) |
210 |
+ |
free((char *)complist); |
211 |
|
/* allocate beam list */ |
212 |
|
complen = 0; |
213 |
|
for (j = 0; hdlist[j] != NULL; j++) |
270 |
|
|
271 |
|
/* empty queue */ |
272 |
|
done_packets(flush_queue()); |
273 |
< |
if (complen <= 0) /* check to see if there even is a list */ |
273 |
> |
if (complen <= 0) /* check to see if there is even a list */ |
274 |
|
return; |
275 |
|
if (lastin < 0) /* flag to sort entire list */ |
276 |
|
qsort((char *)complist, complen, sizeof(PACKHEAD), beamcmp); |