--- ray/src/hd/rhpict.c 1999/03/09 15:10:26 3.7 +++ ray/src/hd/rhpict.c 2003/06/30 14:59:12 3.11 @@ -1,16 +1,14 @@ -/* Copyright (c) 1999 Silicon Graphics, Inc. */ - #ifndef lint -static char SCCSid[] = "$SunId$ SGI"; +static const char RCSid[] = "$Id: rhpict.c,v 3.11 2003/06/30 14:59:12 schorsch Exp $"; #endif - /* * Radiance holodeck picture generator */ +#include + #include "rholo.h" #include "view.h" -#include "resolu.h" char *progname; /* our program name */ char *hdkfile; /* holodeck file name */ @@ -147,7 +145,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); @@ -184,7 +182,7 @@ int nb; } hdloadbeams(bil, nb, pixBeam); pixFinish(randfrac); - free((char *)bil); + free((void *)bil); } @@ -223,9 +221,9 @@ int fn; /* write resolution (standard order) */ fprtresolu(hres, vres, stdout); /* prepare image buffers */ - bzero((char *)mypixel, hres*vres*sizeof(COLOR)); - bzero((char *)myweight, hres*vres*sizeof(float)); - bzero((char *)mydepth, hres*vres*sizeof(float)); + memset((char *)mypixel, '\0', hres*vres*sizeof(COLOR)); + memset((char *)myweight, '\0', hres*vres*sizeof(float)); + memset((char *)mydepth, '\0', hres*vres*sizeof(float)); } @@ -233,8 +231,8 @@ int endpicture() /* finish and write out pixels */ { int lastr = -1, nunrend = 0; - int4 lastp, lastrp; - register int4 p; + int32 lastp, lastrp; + register int32 p; register double d; /* compute final pixel values */ for (p = hres*vres; p--; ) { @@ -264,11 +262,10 @@ endpicture() /* finish and write out pixels */ initialize() /* initialize holodeck and buffers */ { - extern long ftell(); int fd; FILE *fp; int n; - int4 nextloc; + int32 nextloc; /* open holodeck file */ if ((fp = fopen(hdkfile, "r")) == NULL) { sprintf(errmsg, "cannot open \"%s\" for reading", hdkfile); @@ -286,7 +283,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); } @@ -299,6 +296,7 @@ initialize() /* initialize holodeck and buffers */ } +void eputs(s) /* put error message to stderr */ register char *s; {