--- ray/src/ot/getbbox.c 1991/12/19 15:06:44 2.2 +++ ray/src/ot/getbbox.c 2004/03/27 12:41:45 2.6 @@ -1,9 +1,6 @@ -/* Copyright (c) 1991 Regents of the University of California */ - #ifndef lint -static char SCCSid[] = "$SunId$ LBL"; +static const char RCSid[] = "$Id: getbbox.c,v 2.6 2004/03/27 12:41:45 schorsch Exp $"; #endif - /* * getbbox.c - compute bounding box for scene files * @@ -11,35 +8,36 @@ static char SCCSid[] = "$SunId$ LBL"; */ #include "standard.h" - #include "octree.h" - #include "object.h" +#include "oconv.h" -#ifndef DEFPATH -#define DEFPATH ":/usr/local/lib/ray" -#endif - char *progname; /* argv[0] */ -char *libpath; /* library search path */ - int nowarn = 0; /* supress warnings? */ -int (*addobjnotify[])() = {NULL}; /* new object notifier functions */ +void (*addobjnotify[])() = {NULL}; /* new object notifier functions */ FVECT bbmin, bbmax; /* bounding box */ -addobject(o) /* add object to bounding box */ -OBJREC *o; +static void addobject(OBJREC *o); + + + +static void +addobject( /* add object to bounding box */ + OBJREC *o +) { add2bbox(o, bbmin, bbmax); } -main(argc, argv) /* read object files and compute bounds */ -int argc; -char **argv; +int +main( /* read object files and compute bounds */ + int argc, + char **argv +) { extern char *getenv(); int nohead = 0; @@ -47,9 +45,6 @@ char **argv; progname = argv[0]; - if ((libpath = getenv("RAYPATH")) == NULL) - libpath = DEFPATH; - for (i = 1; i < argc && argv[i][0] == '-'; i++) { switch (argv[i][1]) { case 'w': @@ -66,47 +61,55 @@ char **argv; bbmax[0] = bbmax[1] = bbmax[2] = -FHUGE; /* read input */ if (i >= argc) - readobj(NULL, addobject); + readobj2(NULL, addobject); else for ( ; i < argc; i++) if (!strcmp(argv[i], "-")) /* from stdin */ - readobj(NULL, addobject); + readobj2(NULL, addobject); else /* from file */ - readobj(argv[i], addobject); + readobj2(argv[i], addobject); /* print bounding box */ if (!nohead) printf( -" xmin xmax ymin ymax zmin zmax\n"); +" xmin xmax ymin ymax zmin zmax\n"); printf("%9g %9g %9g %9g %9g %9g\n", bbmin[0], bbmax[0], bbmin[1], bbmax[1], bbmin[2], bbmax[2]); quit(0); + return 0; /* pro forma return */ } -quit(code) /* exit program */ -int code; +void +quit( /* exit program */ + int code +) { exit(code); } -cputs() /* interactive error */ +void +cputs(void) /* interactive error */ { /* referenced, but not used */ } -wputs(s) /* warning message */ -char *s; +void +wputs( /* warning message */ + char *s +) { if (!nowarn) eputs(s); } -eputs(s) /* put string to stderr */ -register char *s; +void +eputs( /* put string to stderr */ + register char *s +) { static int inln = 0;