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

Comparing ray/src/gen/replmarks.c (file contents):
Revision 2.8 by schorsch, Mon Oct 27 10:27:25 2003 UTC vs.
Revision 2.9 by schorsch, Sun Nov 16 10:29:38 2003 UTC

# Line 13 | Line 13 | static const char RCSid[] = "$Id";
13   #include <stdio.h>
14  
15   #include "platform.h"
16 + #include "rtio.h"
17   #include "rtprocess.h"
18   #include "fvect.h"
19  
# Line 45 | Line 46 | int    expand;                 /* expand commands? */
46  
47   char    *progname;
48  
49 + static void convert(char *name, FILE *fin);
50 + static void cvcomm(char *fname, FILE *fin);
51 + static void cvobject(char *fname, FILE *fin);
52 + static void replace(char *fname, struct mrkr *m, char *mark, FILE *fin);
53 + static int edgecmp(const void *e1, const void *e2);
54 + static int buildxf(char *xf, double markscale, FILE *fin);
55 + static int addrot(char *xf, FVECT xp, FVECT yp, FVECT zp);
56  
57 < main(argc, argv)
58 < int     argc;
59 < char    *argv[];
57 >
58 > int
59 > main(
60 >        int     argc,
61 >        char    *argv[]
62 > )
63   {
64          FILE    *fp;
65          int     i, j;
# Line 108 | Line 119 | char   *argv[];
119                          convert(argv[i], fp);
120                          fclose(fp);
121                  }
122 <        exit(0);
122 >        return 0;
123   userr:
124          fprintf(stderr,
125   "Usage: %s [-e][-s size][-m modout] {-x objfile|-i octree} modname .. [file ..]\n",
126                  progname);
127 <        exit(1);
127 >        return 1;
128   }
129  
130  
131 < convert(name, fin)              /* replace marks in a stream */
132 < char    *name;
133 < register FILE   *fin;
131 > void
132 > convert(                /* replace marks in a stream */
133 >        char    *name,
134 >        register FILE   *fin
135 > )
136   {
137          register int    c;
138  
# Line 144 | Line 157 | register FILE  *fin;
157   }
158  
159  
160 < cvcomm(fname, fin)              /* convert a command */
161 < char    *fname;
162 < FILE    *fin;
160 > void
161 > cvcomm(         /* convert a command */
162 >        char    *fname,
163 >        FILE    *fin
164 > )
165   {
166          FILE    *pin;
167          char    buf[512], *fgetline();
# Line 166 | Line 181 | FILE   *fin;
181   }
182  
183  
184 < cvobject(fname, fin)            /* convert an object */
185 < char    *fname;
186 < FILE    *fin;
184 > void
185 > cvobject(               /* convert an object */
186 >        char    *fname,
187 >        FILE    *fin
188 > )
189   {
190          extern char     *fgetword();
191          char    buf[128], typ[16], nam[128];
# Line 211 | Line 228 | readerr:
228   }
229  
230  
231 < replace(fname, m, mark, fin)            /* replace marker */
232 < char    *fname;
233 < register struct mrkr    *m;
234 < char    *mark;
235 < FILE    *fin;
231 > void
232 > replace(                /* replace marker */
233 >        char    *fname,
234 >        register struct mrkr    *m,
235 >        char    *mark,
236 >        FILE    *fin
237 > )
238   {
239          int     n;
240          char    buf[256];
# Line 248 | Line 267 | badxf:
267   }
268  
269  
270 < edgecmp(e1, e2)                 /* compare two edges, descending order */
271 < EDGE    *e1, *e2;
270 > int
271 > edgecmp(                        /* compare two edges, descending order */
272 >        const void *e1,
273 >        const void *e2
274 > )
275   {
276 <        if (e1->len2 > e2->len2)
276 >        if (((EDGE*)e1)->len2 > ((EDGE*)e2)->len2)
277                  return(-1);
278 <        if (e1->len2 < e2->len2)
278 >        if (((EDGE*)e1)->len2 < ((EDGE*)e2)->len2)
279                  return(1);
280          return(0);
281   }
282  
283  
284   int
285 < buildxf(xf, markscale, fin)             /* build transform for marker */
286 < register char   *xf;
287 < double  markscale;
288 < FILE    *fin;
285 > buildxf(                /* build transform for marker */
286 >        register char   *xf,
287 >        double  markscale,
288 >        FILE    *fin
289 > )
290   {
291          static FVECT    vlist[MAXVERT];
292          static EDGE     elist[MAXVERT];
# Line 341 | Line 364 | FILE   *fin;
364   }
365  
366  
367 < addrot(xf, xp, yp, zp)          /* compute rotation (x,y,z) => (xp,yp,zp) */
368 < register char   *xf;
369 < FVECT   xp, yp, zp;
367 > int
368 > addrot(         /* compute rotation (x,y,z) => (xp,yp,zp) */
369 >        register char   *xf,
370 >        FVECT xp,
371 >        FVECT yp,
372 >        FVECT zp
373 > )
374   {
375          int     n;
376          double  theta;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines