| 12 |
|
#include "otypes.h" |
| 13 |
|
#include "source.h" |
| 14 |
|
|
| 15 |
– |
char *shm_boundary = NULL; /* boundary of shared memory */ |
| 16 |
– |
|
| 15 |
|
CUBE thescene; /* our scene */ |
| 16 |
|
OBJECT nsceneobjs; /* number of objects in our scene */ |
| 17 |
|
|
| 18 |
|
int dimlist[MAXDIM]; /* sampling dimensions */ |
| 19 |
|
int ndims = 0; /* number of sampling dimensions */ |
| 20 |
< |
int samplendx = 0; /* index for this sample */ |
| 20 |
> |
unsigned long samplendx = 0; /* index for this sample */ |
| 21 |
|
|
| 22 |
|
void (*trace)() = NULL; /* trace call (NULL before rcinit) */ |
| 23 |
|
|
| 91 |
|
MODCONT * |
| 92 |
|
addmodifier(char *modn, char *outf, char *prms, char *binv, int bincnt) |
| 93 |
|
{ |
| 94 |
< |
LUENT *lep = lu_find(&modconttab,modn); |
| 95 |
< |
MODCONT *mp; |
| 96 |
< |
EPNODE *ebinv; |
| 97 |
< |
int i; |
| 98 |
< |
|
| 94 |
> |
static int lastNCS = 0; |
| 95 |
> |
LUENT *lep = lu_find(&modconttab,modn); |
| 96 |
> |
MODCONT *mp; |
| 97 |
> |
EPNODE *ebinv; |
| 98 |
> |
int i; |
| 99 |
> |
|
| 100 |
> |
if (!lastNCS) |
| 101 |
> |
lastNCS = NCSAMP; |
| 102 |
> |
else if (NCSAMP != lastNCS) |
| 103 |
> |
error(INTERNAL, |
| 104 |
> |
"number of spectral samples must be set before first modifier"); |
| 105 |
|
if (lep->data != NULL) { |
| 106 |
|
sprintf(errmsg, "duplicate modifier '%s'", modn); |
| 107 |
|
error(USER, errmsg); |
| 117 |
|
else |
| 118 |
|
modname = (char **)realloc(modname, modasiz*sizeof(char *)); |
| 119 |
|
if (modname == NULL) |
| 120 |
< |
error(SYSTEM, "Out of memory in addmodifier()"); |
| 120 |
> |
error(SYSTEM, "out of memory in addmodifier()"); |
| 121 |
|
} |
| 122 |
|
modname[nmods++] = modn; /* XXX assumes static string */ |
| 123 |
|
lep->key = modn; /* XXX assumes static string */ |
| 230 |
|
if (nproc > MAXPROCESS) |
| 231 |
|
sprintf(errmsg, "too many processes requested -- reducing to %d", |
| 232 |
|
nproc = MAXPROCESS); |
| 233 |
< |
if (nproc > 1) { |
| 234 |
< |
preload_objs(); /* preload auxiliary data */ |
| 231 |
< |
/* set shared memory boundary */ |
| 232 |
< |
shm_boundary = strcpy((char *)malloc(16), "SHM_BOUNDARY"); |
| 233 |
< |
} |
| 233 |
> |
if (nproc > 1) |
| 234 |
> |
cow_memshare(); /* preload auxiliary data */ |
| 235 |
|
trace = trace_contrib; /* set up trace call-back */ |
| 236 |
|
for (i = 0; i < nsources; i++) /* tracing to sources as well */ |
| 237 |
|
source[i].sflags |= SFOLLOW; |