97 |
|
|
98 |
|
static int |
99 |
|
holheadline( /* check holodeck header line */ |
100 |
< |
register char *s, |
100 |
> |
char *s, |
101 |
|
void *vhf |
102 |
|
) |
103 |
|
{ |
137 |
|
off_t nextloc; |
138 |
|
int n; |
139 |
|
/* open holodeck file */ |
140 |
< |
if ((fp = fopen(fname, append ? "r+" : "r")) == NULL) { |
140 |
> |
if ((fp = fopen(fname, append ? "rb+" : "rb")) == NULL) { |
141 |
|
sprintf(errmsg, "cannot open \"%s\" for %s", fname, |
142 |
|
append ? "appending" : "reading"); |
143 |
|
error(SYSTEM, errmsg); |
174 |
|
) |
175 |
|
{ |
176 |
|
int sn, bi, n; |
177 |
< |
register HOLO *hp; |
177 |
> |
HOLO *hp; |
178 |
|
GCOORD gc[2]; |
179 |
|
uby8 rr[2][2]; |
180 |
|
BEAM *bp; |
181 |
|
double d0, d1; |
182 |
|
unsigned dc; |
183 |
< |
register RAYVAL *rv; |
183 |
> |
RAYVAL *rv; |
184 |
|
/* check each output section */ |
185 |
|
for (sn = noutsects; sn--; ) { |
186 |
|
hp = hdlist[sn]; |
223 |
|
const void *b2p |
224 |
|
) |
225 |
|
{ |
226 |
< |
register off_t pdif = beamdir[*(int*)b1p].fo - beamdir[*(int*)b2p].fo; |
226 |
> |
off_t pdif = beamdir[*(int*)b1p].fo - beamdir[*(int*)b2p].fo; |
227 |
|
|
228 |
|
if (pdif > 0L) return(1); |
229 |
|
if (pdif < 0L) return(-1); |
241 |
|
FVECT ro, rd; |
242 |
|
double d; |
243 |
|
int i; |
244 |
< |
register int k; |
245 |
< |
register BEAM *bp; |
244 |
> |
int k; |
245 |
> |
BEAM *bp; |
246 |
|
/* sort based on file position */ |
247 |
|
beamdir = hp->bi; |
248 |
|
qsort((char *)bq, nb, sizeof(*bq), bpcmp); |
334 |
|
double aftd; |
335 |
|
COLOR ctmp; |
336 |
|
int j; |
337 |
< |
register int i; |
337 |
> |
int i; |
338 |
|
/* open files */ |
339 |
< |
if ((pfp = fopen(pcf, "r")) == NULL) { |
339 |
> |
if ((pfp = fopen(pcf, "rb")) == NULL) { |
340 |
|
sprintf(errmsg, "cannot open picture file \"%s\"", pcf); |
341 |
|
error(SYSTEM, pcf); |
342 |
|
} |
344 |
|
sprintf(errmsg, "cannot open depth file \"%s\"", zbf); |
345 |
|
error(SYSTEM, pcf); |
346 |
|
} |
347 |
+ |
SET_FD_BINARY(zfd); |
348 |
|
/* load picture header */ |
349 |
|
phd.vw = stdview; |
350 |
|
phd.expos = 1.0; |
393 |
|
} |
394 |
|
if (eshft) /* shift exposure */ |
395 |
|
shiftcolrs(cscn, i, eshft); |
396 |
< |
i *= sizeof(float); /* read depth */ |
397 |
< |
if (read(zfd, (char *)zscn, i) != i) { |
396 |
> |
/* read depth */ |
397 |
> |
if (read(zfd, zscn, i*sizeof(float)) != i*sizeof(float)) { |
398 |
|
sprintf(errmsg, "error reading depth file \"%s\"", zbf); |
399 |
|
error(USER, errmsg); |
400 |
|
} |
401 |
< |
for (i = scanlen(&prs); i--; ) { /* do each pixel */ |
401 |
> |
while (i--) { /* process each pixel */ |
402 |
|
if (zscn[i] <= 0.0) |
403 |
|
continue; /* illegal depth */ |
404 |
|
pix2loc(vl, &prs, i, j); |
428 |
|
|
429 |
|
void |
430 |
|
eputs( /* put error message to stderr */ |
431 |
< |
register char *s |
431 |
> |
char *s |
432 |
|
) |
433 |
|
{ |
434 |
|
static int midline = 0; |