| 1 |
– |
/* Copyright (c) 1998 Silicon Graphics, Inc. */ |
| 2 |
– |
|
| 3 |
– |
#ifndef lint |
| 4 |
– |
static char SCCSid[] = "$SunId$ SGI"; |
| 5 |
– |
#endif |
| 6 |
– |
|
| 1 |
|
/* |
| 2 |
|
* Routines for tracking beam compuatations |
| 3 |
|
*/ |
| 56 |
|
int nents; |
| 57 |
|
{ |
| 58 |
|
int oldnr; |
| 59 |
+ |
register HDBEAMI *hb; |
| 60 |
|
register int i, n; |
| 61 |
|
/* look for common members */ |
| 62 |
|
for (n = 0; n < nents; n++) { |
| 112 |
|
/* what can't we satisfy? */ |
| 113 |
|
for (n = 0; n < nents && clist[n].nr > clist[n].nc; n++) |
| 114 |
|
; |
| 115 |
< |
if (op == BS_ADJ) |
| 116 |
< |
nents = n; |
| 115 |
> |
if (op == BS_ADJ) { /* don't regenerate adjusted beams */ |
| 116 |
> |
for (i = n; i < nents && clist[i].nr > 0; i++) |
| 117 |
> |
; |
| 118 |
> |
nents = i; |
| 119 |
> |
} |
| 120 |
|
if (n) { /* allocate space for merged list */ |
| 121 |
|
PACKHEAD *newlist; |
| 122 |
|
newlist = (PACKHEAD *)malloc( |
| 138 |
|
default: |
| 139 |
|
error(CONSISTENCY, "bundle_set called with unknown operation"); |
| 140 |
|
} |
| 141 |
< |
if (outdev != NULL) { /* load and display beams we have */ |
| 142 |
< |
register HDBEAMI *hb; |
| 143 |
< |
|
| 144 |
< |
hb = (HDBEAMI *)malloc(nents*sizeof(HDBEAMI)); |
| 145 |
< |
for (i = 0; i < nents; i++) { |
| 146 |
< |
hb[i].h = hdlist[clist[i].hd]; |
| 147 |
< |
hb[i].b = clist[i].bi; |
| 150 |
< |
} |
| 151 |
< |
hdloadbeams(hb, nents, dispbeam); |
| 152 |
< |
free((char *)hb); |
| 141 |
> |
if (outdev == NULL) /* nothing to display? */ |
| 142 |
> |
return; |
| 143 |
> |
/* load and display beams we have */ |
| 144 |
> |
hb = (HDBEAMI *)malloc(nents*sizeof(HDBEAMI)); |
| 145 |
> |
for (i = 0; i < nents; i++) { |
| 146 |
> |
hb[i].h = hdlist[clist[i].hd]; |
| 147 |
> |
hb[i].b = clist[i].bi; |
| 148 |
|
} |
| 149 |
+ |
hdloadbeams(hb, nents, dispbeam); |
| 150 |
+ |
free((char *)hb); |
| 151 |
|
return; |
| 152 |
|
memerr: |
| 153 |
|
error(SYSTEM, "out of memory in bundle_set"); |