152 |
|
|
153 |
|
static int |
154 |
|
getint2( /* get a 2-byte positive integer */ |
155 |
< |
register FILE *fp |
155 |
> |
FILE *fp |
156 |
|
) |
157 |
|
{ |
158 |
< |
register int b1, b2; |
158 |
> |
int b1, b2; |
159 |
|
|
160 |
|
if ((b1 = getc(fp)) == EOF || (b2 = getc(fp)) == EOF) |
161 |
|
quiterr("read error"); |
166 |
|
|
167 |
|
static void |
168 |
|
putint2( /* put a 2-byte positive integer */ |
169 |
< |
register int i, |
170 |
< |
register FILE *fp |
169 |
> |
int i, |
170 |
> |
FILE *fp |
171 |
|
) |
172 |
|
{ |
173 |
|
putc(i&0xff, fp); |
189 |
|
|
190 |
|
|
191 |
|
void |
192 |
< |
eputs(s) |
193 |
< |
char *s; |
192 |
> |
eputs(const char *s) |
193 |
|
{ |
194 |
|
fputs(s, stderr); |
195 |
|
} |
196 |
|
|
197 |
|
|
198 |
|
void |
199 |
< |
quit(code) |
201 |
< |
int code; |
199 |
> |
quit(int code) |
200 |
|
{ |
201 |
|
exit(code); |
202 |
|
} |
206 |
|
getthead( /* read header from input */ |
207 |
|
struct hdStruct *hp, |
208 |
|
char *ip, |
209 |
< |
register FILE *fp |
209 |
> |
FILE *fp |
210 |
|
) |
211 |
|
{ |
212 |
|
int nidbytes; |
241 |
|
putthead( /* write header to output */ |
242 |
|
struct hdStruct *hp, |
243 |
|
char *ip, |
244 |
< |
register FILE *fp |
244 |
> |
FILE *fp |
245 |
|
) |
246 |
|
{ |
247 |
|
if (ip != NULL) |
269 |
|
|
270 |
|
static int |
271 |
|
getrhead( /* load RADIANCE input file header */ |
272 |
< |
register struct hdStruct *h, |
272 |
> |
struct hdStruct *h, |
273 |
|
FILE *fp |
274 |
|
) |
275 |
|
{ |
310 |
|
} map; |
311 |
|
COLR ctab[256]; |
312 |
|
COLR *scanline; |
313 |
< |
register int i, j; |
313 |
> |
int i, j; |
314 |
|
|
315 |
|
/* get color table */ |
316 |
|
if ((hp->CMapBits==24 ? fread((char *)(map.c3+hp->mapOrig), |
357 |
|
) |
358 |
|
{ |
359 |
|
long fpos; |
360 |
< |
register int y; |
360 |
> |
int y; |
361 |
|
|
362 |
|
setcolrgam(gamv); |
363 |
|
fpos = ftell(stdin); |
406 |
|
) |
407 |
|
{ |
408 |
|
int y; |
409 |
< |
register uby8 *dp; |
410 |
< |
register int x; |
409 |
> |
uby8 *dp; |
410 |
> |
int x; |
411 |
|
|
412 |
|
setcolrgam(gamv); |
413 |
|
dp = tarData+xmax*ymax;; |
441 |
|
FILE *fp |
442 |
|
) |
443 |
|
{ |
444 |
< |
register int i, j; |
444 |
> |
int i, j; |
445 |
|
|
446 |
|
for (i = 0; i < h->mapLength; i++) /* write color map */ |
447 |
|
for (j = 2; j >= 0; j--) |
462 |
|
FILE *fp |
463 |
|
) |
464 |
|
{ |
465 |
< |
register int cnt, c; |
466 |
< |
register uby8 *dp; |
465 |
> |
int cnt, c; |
466 |
> |
uby8 *dp; |
467 |
|
|
468 |
|
if (h->dataType == IM_CMAP) { /* uncompressed */ |
469 |
|
if (fread((char *)data,h->x*sizeof(uby8),h->y,fp) != h->y) |