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

Comparing ray/src/ot/getbbox.c (file contents):
Revision 2.2 by greg, Thu Dec 19 15:06:44 1991 UTC vs.
Revision 2.6 by schorsch, Sat Mar 27 12:41:45 2004 UTC

# Line 1 | Line 1
1 /* Copyright (c) 1991 Regents of the University of California */
2
1   #ifndef lint
2 < static char SCCSid[] = "$SunId$ LBL";
2 > static const char       RCSid[] = "$Id$";
3   #endif
6
4   /*
5   *  getbbox.c - compute bounding box for scene files
6   *
# Line 11 | Line 8 | static char SCCSid[] = "$SunId$ LBL";
8   */
9  
10   #include  "standard.h"
14
11   #include  "octree.h"
16
12   #include  "object.h"
13 + #include  "oconv.h"
14  
19 #ifndef  DEFPATH
20 #define  DEFPATH        ":/usr/local/lib/ray"
21 #endif
22
15   char  *progname;                        /* argv[0] */
16  
25 char  *libpath;                         /* library search path */
26
17   int  nowarn = 0;                        /* supress warnings? */
18  
19 < int  (*addobjnotify[])() = {NULL};      /* new object notifier functions */
19 > void  (*addobjnotify[])() = {NULL};     /* new object notifier functions */
20  
21   FVECT  bbmin, bbmax;                    /* bounding box */
22  
23 < addobject(o)                    /* add object to bounding box */
24 < OBJREC  *o;
23 > static void addobject(OBJREC    *o);
24 >
25 >
26 >
27 > static void
28 > addobject(                      /* add object to bounding box */
29 >        OBJREC  *o
30 > )
31   {
32          add2bbox(o, bbmin, bbmax);
33   }
34  
35  
36 < main(argc, argv)                /* read object files and compute bounds */
37 < int  argc;
38 < char  **argv;
36 > int
37 > main(           /* read object files and compute bounds */
38 >        int  argc,
39 >        char  **argv
40 > )
41   {
42          extern char  *getenv();
43          int  nohead = 0;
# Line 47 | Line 45 | char  **argv;
45  
46          progname = argv[0];
47  
50        if ((libpath = getenv("RAYPATH")) == NULL)
51                libpath = DEFPATH;
52
48          for (i = 1; i < argc && argv[i][0] == '-'; i++) {
49                  switch (argv[i][1]) {
50                  case 'w':
# Line 66 | Line 61 | char  **argv;
61          bbmax[0] = bbmax[1] = bbmax[2] = -FHUGE;
62                                                  /* read input */
63          if (i >= argc)
64 <                readobj(NULL, addobject);
64 >                readobj2(NULL, addobject);
65          else
66                  for ( ; i < argc; i++)
67                          if (!strcmp(argv[i], "-"))      /* from stdin */
68 <                                readobj(NULL, addobject);
68 >                                readobj2(NULL, addobject);
69                          else                            /* from file */
70 <                                readobj(argv[i], addobject);
70 >                                readobj2(argv[i], addobject);
71                                                  /* print bounding box */
72          if (!nohead)
73                  printf(
74 < "      xmin      xmax      ymin      ymax      zmin      zmax\n");
74 > "     xmin      xmax      ymin      ymax      zmin      zmax\n");
75  
76          printf("%9g %9g %9g %9g %9g %9g\n", bbmin[0], bbmax[0],
77                          bbmin[1], bbmax[1], bbmin[2], bbmax[2]);
78          quit(0);
79 +        return 0; /* pro forma return */
80   }
81  
82  
83 < quit(code)                              /* exit program */
84 < int  code;
83 > void
84 > quit(                           /* exit program */
85 >        int  code
86 > )
87   {
88          exit(code);
89   }
90  
91  
92 < cputs()                                 /* interactive error */
92 > void
93 > cputs(void)                                     /* interactive error */
94   {
95          /* referenced, but not used */
96   }
97  
98  
99 < wputs(s)                                /* warning message */
100 < char  *s;
99 > void
100 > wputs(                          /* warning message */
101 >        char  *s
102 > )
103   {
104          if (!nowarn)
105                  eputs(s);
106   }
107  
108  
109 < eputs(s)                                /* put string to stderr */
110 < register char  *s;
109 > void
110 > eputs(                          /* put string to stderr */
111 >        register char  *s
112 > )
113   {
114          static int  inln = 0;
115  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines