10 |
|
#include "holo.h" |
11 |
|
|
12 |
|
#ifndef CACHESIZE |
13 |
< |
#ifdef BIGMEM |
14 |
< |
#define CACHESIZE 17 /* default cache size (Mbytes, 0==inf) */ |
15 |
< |
#else |
13 |
> |
#ifdef SMLMEM |
14 |
|
#define CACHESIZE 5 |
15 |
+ |
#else |
16 |
+ |
#define CACHESIZE 17 /* default cache size (Mbytes, 0==inf) */ |
17 |
|
#endif |
18 |
|
#endif |
19 |
|
#ifndef FREEBEAMS |
66 |
|
register HOLO *hp; |
67 |
|
int n; |
68 |
|
/* copy grid to temporary header */ |
69 |
< |
bcopy((char *)hproto, (char *)&hdhead, sizeof(HDGRID)); |
69 |
> |
bcopy((void *)hproto, (void *)&hdhead, sizeof(HDGRID)); |
70 |
|
/* compute grid vectors and sizes */ |
71 |
|
hdcompgrid(&hdhead); |
72 |
|
/* allocate header with directory */ |
81 |
|
free((void *)hp); |
82 |
|
return(NULL); |
83 |
|
} |
84 |
< |
bzero((char *)hp->bl, (nbeams(hp)+1)*sizeof(BEAM *)+sizeof(BEAM)); |
84 |
> |
bzero((void *)hp->bl, (nbeams(hp)+1)*sizeof(BEAM *)+sizeof(BEAM)); |
85 |
|
hp->bl[0] = (BEAM *)(hp->bl+nbeams(hp)+1); /* set blglob(hp) */ |
86 |
|
hp->fd = -1; |
87 |
|
hp->dirty = 0; |
88 |
|
hp->priv = NULL; |
89 |
|
/* clear beam directory */ |
90 |
< |
bzero((char *)hp->bi, (nbeams(hp)+1)*sizeof(BEAMI)); |
90 |
> |
bzero((void *)hp->bi, (nbeams(hp)+1)*sizeof(BEAMI)); |
91 |
|
return(hp); /* all is well */ |
92 |
|
} |
93 |
|
|
101 |
|
register char *newp; |
102 |
|
/* call malloc/realloc */ |
103 |
|
if (ptr == NULL) newp = (char *)malloc(siz); |
104 |
< |
else newp = (char *)realloc(ptr, siz); |
104 |
> |
else newp = (char *)realloc((void *)ptr, siz); |
105 |
|
/* check success */ |
106 |
|
if (newp == NULL && rout != NULL) { |
107 |
|
hdfreecache(25, NULL); /* free some memory */ |
123 |
|
if (fd >= nhdfragls) { |
124 |
|
hdfragl = (struct fraglist *)hdrealloc((char *)hdfragl, |
125 |
|
(fd+1)*sizeof(struct fraglist), "hdattach"); |
126 |
< |
bzero((char *)(hdfragl+nhdfragls), |
126 |
> |
bzero((void *)(hdfragl+nhdfragls), |
127 |
|
(fd+1-nhdfragls)*sizeof(struct fraglist)); |
128 |
|
nhdfragls = fd+1; |
129 |
|
} |
429 |
|
hdfreefrag(hp, i); /* relinquish old fragment */ |
430 |
|
p = hdbray(hp->bl[i]) + hp->bl[i]->nrm; |
431 |
|
hp->bl[i]->nrm += nr; /* update in-core structure */ |
432 |
< |
bzero((char *)p, nr*sizeof(RAYVAL)); |
432 |
> |
bzero((void *)p, nr*sizeof(RAYVAL)); |
433 |
|
blglob(hp)->tick = hp->bl[i]->tick = hdclock++; /* update LRU clock */ |
434 |
|
return(p); /* point to new rays */ |
435 |
|
} |
499 |
|
if (hb[i].h==NULL || hb[i].b<1 | hb[i].b>nbeams(hb[i].h)) |
500 |
|
error(CONSISTENCY, "bad beam in hdloadbeams"); |
501 |
|
/* sort list for optimal access */ |
502 |
< |
qsort((char *)hb, n, sizeof(HDBEAMI), hdfilord); |
502 |
> |
qsort((void *)hb, n, sizeof(HDBEAMI), hdfilord); |
503 |
|
bytesloaded = 0; /* run through loaded beams */ |
504 |
|
for ( ; n && (bp = hb->h->bl[hb->b]) != NULL; n--, hb++) { |
505 |
|
bp->tick = hdclock; /* preempt swap */ |
569 |
|
if (f->fi == NULL) |
570 |
|
newp = (BEAMI *)malloc((j+FRAGBLK)*sizeof(BEAMI)); |
571 |
|
else |
572 |
< |
newp = (BEAMI *)realloc((char *)f->fi, |
572 |
> |
newp = (BEAMI *)realloc((void *)f->fi, |
573 |
|
(j+FRAGBLK)*sizeof(BEAMI)); |
574 |
|
if (newp == NULL) { |
575 |
|
f->nfrags--; /* graceful failure */ |