--- ray/src/hd/rhpict.c 1999/03/09 14:55:53 3.6 +++ ray/src/hd/rhpict.c 2003/02/22 02:07:25 3.8 @@ -1,19 +1,17 @@ -/* Copyright (c) 1999 Silicon Graphics, Inc. */ - #ifndef lint -static char SCCSid[] = "$SunId$ SGI"; +static const char RCSid[] = "$Id: rhpict.c,v 3.8 2003/02/22 02:07:25 greg Exp $"; #endif - /* * Radiance holodeck picture generator */ #include "rholo.h" #include "view.h" -#include "resolu.h" char *progname; /* our program name */ char *hdkfile; /* holodeck file name */ +char gargc; /* global argc */ +char **gargv; /* global argv */ VIEW myview = STDVIEW; /* current output view */ int xres = 512, yres = 512; /* max. horizontal and vertical resolution */ @@ -37,6 +35,7 @@ char *argv[]; { int i, rval; + gargc = argc; gargv = argv; progname = argv[0]; /* get arguments */ for (i = 1; i < argc && argv[i][0] == '-'; i++) { rval = getviewopt(&myview, argc-i, argv+i); @@ -144,7 +143,7 @@ int fn; /* render image */ if (blist.nb > 0) { render_frame(blist.bl, blist.nb); - free((char *)blist.bl); + free((void *)blist.bl); } else { sprintf(errmsg, "no section visible in frame %d", fn); error(WARNING, errmsg); @@ -181,7 +180,7 @@ int nb; } hdloadbeams(bil, nb, pixBeam); pixFinish(randfrac); - free((char *)bil); + free((void *)bil); } @@ -205,7 +204,7 @@ int fn; /* write header */ newheader("RADIANCE", stdout); printf("SOFTWARE= %s\n", VersionID); - printf("%s %s\n", progname, hdkfile); + printargs(gargc, gargv, stdout); if (fn) printf("FRAME=%d\n", fn); fputs(VIEWSTR, stdout); @@ -283,7 +282,7 @@ initialize() /* initialize holodeck and buffers */ fd = dup(fileno(fp)); /* dup file descriptor */ fclose(fp); /* done with stdio */ for (n = 0; nextloc > 0L; n++) { /* initialize each section */ - lseek(fd, (long)nextloc, 0); + lseek(fd, (off_t)nextloc, 0); read(fd, (char *)&nextloc, sizeof(nextloc)); hdinit(fd, NULL); } @@ -296,6 +295,7 @@ initialize() /* initialize holodeck and buffers */ } +void eputs(s) /* put error message to stderr */ register char *s; {