13 |
|
#include "ray.h" |
14 |
|
#include "source.h" |
15 |
|
#include "ambient.h" |
16 |
+ |
#include "rpaint.h" |
17 |
|
#include "random.h" |
18 |
|
#include "paths.h" |
19 |
|
#include "view.h" |
42 |
|
extern int psample; /* pixel sample size */ |
43 |
|
extern double maxdiff; /* max. sample difference */ |
44 |
|
|
45 |
< |
void onsig(); |
46 |
< |
void sigdie(); |
47 |
< |
void printdefaults(); |
45 |
> |
static void onsig(int signo); |
46 |
> |
static void sigdie(int signo, char *msg); |
47 |
> |
static void printdefaults(void); |
48 |
|
|
49 |
|
|
50 |
|
int |
51 |
< |
main(argc, argv) |
51 |
< |
int argc; |
52 |
< |
char *argv[]; |
51 |
> |
main(int argc, char *argv[]) |
52 |
|
{ |
53 |
|
#define check(ol,al) if (argv[i][ol] || \ |
54 |
|
badarg(argc-i-1,argv+i+1,al)) \ |
219 |
|
badopt: |
220 |
|
sprintf(errmsg, "command line error at '%s'", argv[i]); |
221 |
|
error(USER, errmsg); |
222 |
+ |
return 1; /* pro forma return */ |
223 |
|
|
224 |
|
#undef check |
225 |
|
#undef bool |
227 |
|
|
228 |
|
|
229 |
|
void |
230 |
< |
wputs(s) /* warning output function */ |
231 |
< |
char *s; |
230 |
> |
wputs( /* warning output function */ |
231 |
> |
char *s |
232 |
> |
) |
233 |
|
{ |
234 |
|
int lasterrno = errno; |
235 |
|
eputs(s); |
238 |
|
|
239 |
|
|
240 |
|
void |
241 |
< |
eputs(s) /* put string to stderr */ |
242 |
< |
register char *s; |
241 |
> |
eputs( /* put string to stderr */ |
242 |
> |
register char *s |
243 |
> |
) |
244 |
|
{ |
245 |
|
static int midline = 0; |
246 |
|
|
258 |
|
} |
259 |
|
|
260 |
|
|
261 |
< |
void |
262 |
< |
onsig(signo) /* fatal signal */ |
263 |
< |
int signo; |
261 |
> |
static void |
262 |
> |
onsig( /* fatal signal */ |
263 |
> |
int signo |
264 |
> |
) |
265 |
|
{ |
266 |
|
static int gotsig = 0; |
267 |
|
|
277 |
|
} |
278 |
|
|
279 |
|
|
280 |
< |
void |
281 |
< |
sigdie(signo, msg) /* set fatal signal */ |
282 |
< |
int signo; |
283 |
< |
char *msg; |
280 |
> |
static void |
281 |
> |
sigdie( /* set fatal signal */ |
282 |
> |
int signo, |
283 |
> |
char *msg |
284 |
> |
) |
285 |
|
{ |
286 |
|
if (signal(signo, onsig) == SIG_IGN) |
287 |
|
signal(signo, SIG_IGN); |
289 |
|
} |
290 |
|
|
291 |
|
|
292 |
< |
void |
293 |
< |
printdefaults() /* print default values to stdout */ |
292 |
> |
static void |
293 |
> |
printdefaults(void) /* print default values to stdout */ |
294 |
|
{ |
291 |
– |
register char *cp; |
292 |
– |
|
295 |
|
printf(greyscale ? "-b+\t\t\t\t# greyscale on\n" : |
296 |
|
"-b-\t\t\t\t# greyscale off\n"); |
297 |
|
printf("-vt%c\t\t\t\t# view type %s\n", ourview.type, |