--- ray/src/rt/data.c 2004/01/02 11:43:42 2.26 +++ ray/src/rt/data.c 2009/05/12 16:37:53 2.29 @@ -1,5 +1,5 @@ #ifndef lint -static const char RCSid[] = "$Id: data.c,v 2.26 2004/01/02 11:43:42 schorsch Exp $"; +static const char RCSid[] = "$Id: data.c,v 2.29 2009/05/12 16:37:53 greg Exp $"; #endif /* * data.c - routines dealing with interpolated data. @@ -10,17 +10,19 @@ static const char RCSid[] = "$Id: data.c,v 2.26 2004/0 #include #include "platform.h" +#include "paths.h" #include "standard.h" #include "color.h" #include "resolu.h" +#include "view.h" #include "data.h" /* picture memory usage before warning */ #ifndef PSIZWARN #ifdef SMLMEM -#define PSIZWARN 1500000 +#define PSIZWARN 3000000 #else -#define PSIZWARN 5000000 +#define PSIZWARN 10000000 #endif #endif @@ -36,9 +38,10 @@ static DATARRAY *dtab[TABSIZ]; /* data array list */ static gethfunc headaspect; -DATARRAY * -getdata(dname) /* get data array dname */ -char *dname; +extern DATARRAY * +getdata( /* get data array dname */ + char *dname +) { char *dfname; FILE *fp; @@ -136,6 +139,7 @@ scanerr: sprintf(errmsg, "%s in data file \"%s\"", feof(fp) ? "unexpected EOF" : "bad format", dfname); error(USER, errmsg); + return NULL; /* pro forma return */ } @@ -155,9 +159,10 @@ headaspect( /* check string for aspect ratio */ } -DATARRAY * -getpict(pname) /* get picture pname */ -char *pname; +extern DATARRAY * +getpict( /* get picture pname */ + char *pname +) { double inpaspect; char *pfname; @@ -213,8 +218,8 @@ char *pname; i = ns*sl*sizeof(COLR); #if PSIZWARN if (i > PSIZWARN) { /* memory warning */ - sprintf(errmsg, "picture file \"%s\" using %d bytes of memory", - pname, i); + sprintf(errmsg, "picture file \"%s\" using %.1f MB of memory", + pname, i*(1.0/(1024*1024))); error(WARNING, errmsg); } #endif @@ -249,12 +254,14 @@ memerr: readerr: sprintf(errmsg, "bad picture file \"%s\"", pfname); error(USER, errmsg); + return NULL; /* pro forma return */ } -void -freedata(dta) /* release data array reference */ -DATARRAY *dta; +extern void +freedata( /* release data array reference */ + DATARRAY *dta +) { DATARRAY head; int hval, nents; @@ -288,10 +295,11 @@ DATARRAY *dta; } -double -datavalue(dp, pt) /* interpolate data value at a point */ -register DATARRAY *dp; -double *pt; +extern double +datavalue( /* interpolate data value at a point */ + register DATARRAY *dp, + double *pt +) { DATARRAY sd; int asize;