1 |
– |
/* Copyright (c) 1992 Regents of the University of California */ |
2 |
– |
|
1 |
|
#ifndef lint |
2 |
< |
static char SCCSid[] = "$SunId$ LBL"; |
2 |
> |
static const char RCSid[] = "$Id$"; |
3 |
|
#endif |
6 |
– |
|
4 |
|
/* Convert an Radiance image to APPLE pict format. |
5 |
|
* |
6 |
|
* Orginally Iris to PICT by Paul Haeberli - 1990 |
18 |
|
|
19 |
|
#include <stdio.h> |
20 |
|
#include <math.h> |
21 |
< |
#ifdef MSDOS |
25 |
< |
#include <fcntl.h> |
26 |
< |
#endif |
21 |
> |
#include <time.h> |
22 |
|
|
23 |
+ |
#include "platform.h" |
24 |
|
#include "pict.h" |
25 |
|
#include "color.h" |
26 |
|
#include "resolu.h" |
27 |
|
|
32 |
– |
extern char *malloc(); |
33 |
– |
|
28 |
|
int outbytes; /* This had better be 32 bits! */ |
29 |
|
char *progname; |
30 |
|
int verbose = 0; |
95 |
|
int xsize, ysize; |
96 |
|
int i, picsize; |
97 |
|
int ssizepos, lsizepos; |
98 |
< |
#ifdef MSDOS |
99 |
< |
extern int _fmode; |
100 |
< |
_fmode = O_BINARY; |
107 |
< |
setmode(fileno(stdin), O_BINARY); |
108 |
< |
setmode(fileno(stdout), O_BINARY); |
109 |
< |
#endif |
98 |
> |
SET_DEFAULT_BINARY(); |
99 |
> |
SET_FILE_BINARY(stdin); |
100 |
> |
SET_FILE_BINARY(stdout); |
101 |
|
progname = argv[0]; |
102 |
|
|
103 |
|
for (i = 1; i < argc ; i++) |
215 |
|
int nbytes, rowbytes; |
216 |
|
char *cbuf, *pbuf; |
217 |
|
|
218 |
< |
cbuf = malloc(4 * xsize); |
218 |
> |
cbuf = (char *)malloc(4 * xsize); |
219 |
|
|
220 |
|
if (cbuf == NULL) { |
221 |
|
fprintf(stderr, "%s: not enough memory\n", progname); |
222 |
|
exit(1); |
223 |
|
} |
224 |
|
|
225 |
< |
pbuf = malloc(4 * xsize); |
225 |
> |
pbuf = (char *)malloc(4 * xsize); |
226 |
|
|
227 |
|
if (pbuf == NULL) { |
228 |
|
fprintf(stderr, "%s: not enough memory\n", progname); |