ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/cal/tabfunc.c
(Generate patch)

Comparing ray/src/cal/tabfunc.c (file contents):
Revision 1.2 by schorsch, Sun Jun 8 12:03:09 2003 UTC vs.
Revision 1.5 by schorsch, Sun Jul 27 22:12:01 2003 UTC

# Line 12 | Line 12 | static const char      RCSid[] = "$Id$";
12   #include <string.h>
13   #include <math.h>
14   #include <ctype.h>
15 < #ifdef _WIN32
16 < #include <process.h> /* getpid() */
17 < #else
18 < #include <sys/types.h>
19 < #include <unistd.h>
20 < #endif
15 > #include <sys/types.h>
16  
17 < #include "standard.h"
18 < #include "platform.h"
17 > #include "rtprocess.h" /* getpid() */
18 > #include "rtmath.h"
19 > #include "rtio.h"
20  
21   #define  isdelim(c)     (isspace(c) || (c)==',')
22  
23   #define  MAXTAB         1024            /* maximum number of data rows */
24   #define  MAXLINE        4096            /* maximum line width (characters) */
29 /*#define  FLOAT                float   */      /* real type (precision) */
25   #define  OUTFMT         "%.7g"          /* output format conversion string */
26  
27   int     interpolate = 0;
# Line 34 | Line 29 | char   *progname;
29   char    **func;
30   int     nfuncs;
31  
32 < FLOAT   abscissa[MAXTAB];               /* independent values (first column) */
33 < FLOAT   (*ordinate)[MAXTAB];            /* dependent values (other columns) */
32 > RREAL   abscissa[MAXTAB];               /* independent values (first column) */
33 > RREAL   (*ordinate)[MAXTAB];            /* dependent values (other columns) */
34   int     tabsize = 0;                    /* final table size (number of rows) */
35   char    locID[16];                      /* local identifier (for uniqueness) */
36  
# Line 43 | Line 38 | char   locID[16];                      /* local identifier (for uniqueness)
38  
39   static void load_data(FILE *fp);
40   static void print_funcs(char *xe);
41 < static void putlist(register FLOAT *av, int al, register int pos);
41 > static void putlist(register RREAL *av, int al, register int pos);
42   static char * absc_exp(void);
43  
44   int
# Line 68 | Line 63 | char   **argv
63          }
64          func = argv;
65          nfuncs = argc;
66 <        ordinate = (FLOAT (*)[MAXTAB])malloc(nfuncs*MAXTAB*sizeof(FLOAT));
66 >        ordinate = (RREAL (*)[MAXTAB])malloc(nfuncs*MAXTAB*sizeof(RREAL));
67          if (ordinate == NULL) {
68                  fprintf(stderr, "%s: not enough memory\n", progname);
69                  exit(1);
# Line 192 | Line 187 | char   *xe
187  
188          xelen = strlen(xe);
189          for (i = 0; i < nfuncs; i++) {
190 <                if (func[i][0] == '\0' | func[i][0] == '0')
190 >                if ((func[i][0] == '\0') | (func[i][0] == '0'))
191                          continue;
192                  if (interpolate) {
193                          printf("%s`%s(i):select(i,", func[i], locID);
# Line 212 | Line 207 | char   *xe
207  
208   static void
209   putlist(                /* put out array of values */
210 < register FLOAT  *av,
210 > register RREAL  *av,
211   int     al,
212   register int    pos
213   )

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines