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

Comparing ray/src/cv/thf2rad.c (file contents):
Revision 2.7 by schorsch, Sun Jul 27 22:12:02 2003 UTC vs.
Revision 2.8 by schorsch, Sat Nov 15 17:54:06 2003 UTC

# Line 9 | Line 9 | static const char      RCSid[] = "$Id$";
9   *      12/21/88
10   */
11  
12 #include <stdio.h>
12   #include <stdlib.h>
13 + #include <stdio.h>
14 + #include <string.h>
15   #include <math.h>
16  
17   #define MAXSTR          128             /* maximum string or id length */
# Line 22 | Line 23 | typedef struct {
23  
24   double  rad = 0.0;                      /* line radius */
25  
26 + static void thf2rad(char *name, char *file);
27 + static int cvobject(char *name, char *file, FILE *fp);
28 + static void header(int ac, char **av);
29 + static void point(char *mat, char *nam, POINT *pos);
30 + static void line(char *mat, char *nam, POINT *p1, POINT *p2);
31 + static void loc(POINT *p);
32 + static void readerr(char *file, char *err);
33  
34 < main(argc, argv)
35 < int     argc;
36 < char    *argv[];
34 >
35 > int
36 > main(
37 >        int     argc,
38 >        char    *argv[]
39 > )
40   {
41          char    *name = NULL;
42          int     an;
# Line 57 | Line 68 | char   *argv[];
68   }
69  
70  
71 < thf2rad(name, file)             /* convert things file */
72 < char    *name, *file;
71 > void
72 > thf2rad(                /* convert things file */
73 >        char    *name,
74 >        char    *file
75 > )
76   {
77          char    nambuf[MAXSTR];
78          register char   *cp;
# Line 87 | Line 101 | char   *name, *file;
101   }
102  
103  
104 < cvobject(name, file, fp)        /* convert next object in things file */
105 < char    *name, *file;
106 < FILE    *fp;
104 > int
105 > cvobject(       /* convert next object in things file */
106 >        char    *name,
107 >        char    *file,
108 >        FILE    *fp
109 > )
110   {
111          static POINT    parr[MAXPTS];
112          static unsigned char    haspt[MAXPTS/8];
# Line 155 | Line 172 | FILE   *fp;
172   }
173  
174  
175 < header(ac, av)                  /* print header */
176 < int     ac;
177 < char    **av;
175 > void
176 > header(                 /* print header */
177 >        int     ac,
178 >        char    **av
179 > )
180   {
181          putchar('#');
182          while (ac--) {
# Line 168 | Line 187 | char   **av;
187   }
188  
189  
190 < point(mat, nam, pos)            /* print point */
191 < char    *mat, *nam;
192 < POINT   *pos;
190 > void
191 > point(          /* print point */
192 >        char    *mat,
193 >        char    *nam,
194 >        POINT   *pos
195 > )
196   {
197          if (rad <= 0.0)
198                  return;
# Line 181 | Line 203 | POINT  *pos;
203   }
204  
205  
206 < line(mat, nam, p1, p2)          /* print line */
207 < char    *mat, *nam;
208 < POINT   *p1, *p2;
206 > void
207 > line(           /* print line */
208 >        char    *mat,
209 >        char    *nam,
210 >        POINT   *p1,
211 >        POINT   *p2
212 > )
213   {
214          if (rad <= 0.0)
215                  return;
# Line 195 | Line 221 | POINT  *p1, *p2;
221   }
222  
223  
224 < loc(p)                          /* print location */
225 < register POINT  *p;
224 > void
225 > loc(                            /* print location */
226 >        register POINT  *p
227 > )
228   {
229          printf("\t%14.8g\t%14.8g\t%14.8g\n", p->x, p->y, p->z);
230   }
231  
232  
233 < readerr(file, err)              /* print read error and exit */
234 < char    *file, *err;
233 > void
234 > readerr(                /* print read error and exit */
235 >        char    *file,
236 >        char    *err
237 > )
238   {
239          fprintf(stderr, "%s: %s\n", file, err);
240          exit(1);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines