--- ray/src/util/ranimove.c 2016/03/06 01:13:18 3.16 +++ ray/src/util/ranimove.c 2020/07/20 15:54:29 3.19 @@ -1,5 +1,5 @@ #ifndef lint -static const char RCSid[] = "$Id: ranimove.c,v 3.16 2016/03/06 01:13:18 schorsch Exp $"; +static const char RCSid[] = "$Id: ranimove.c,v 3.19 2020/07/20 15:54:29 greg Exp $"; #endif /* * Radiance object animation program @@ -170,7 +170,7 @@ userr: void eputs( /* put string to stderr */ - register char *s + char *s ) { static int midline = 0; @@ -190,11 +190,12 @@ eputs( /* put string to stderr */ void -quit(ec) /* make sure exit is called */ -int ec; +quit(int ec) /* make sure exit is called */ { if (ray_pnprocs > 0) /* close children if any */ - ray_pclose(0); + ray_pclose(0); + else if (ray_pnprocs < 0) + _exit(ec); /* avoid flush in child */ exit(ec); } @@ -350,7 +351,7 @@ setrendparams( /* set global rendering parameters */ av[ac=0] = NULL; /* load options from file, first */ if (optf != NULL && *optf) { - ac = wordfile(av, optf); + ac = wordfile(av, 1024, optf); if (ac < 0) { sprintf(errmsg, "cannot load options file \"%s\"", optf); @@ -359,7 +360,7 @@ setrendparams( /* set global rendering parameters */ } /* then from options string */ if (qval != NULL && qval[0] == '-') - ac += wordstring(av+ac, qval); + ac += wordstring(av+ac, 1024-ac, qval); /* restore default parameters */ ray_restore(NULL); @@ -392,8 +393,8 @@ getradfile( /* run rad and get needed variables */ { static short mvar[] = {OCONV,OCTREEF,RESOLUTION,EXPOSURE,-1}; char combuf[256]; - register int i; - register char *cp; + int i; + char *cp; char *pippt = NULL; /* create rad command */ strcpy(lorendoptf, "ranim0.opt"); @@ -469,7 +470,7 @@ animate(void) /* run through animation */ } -extern VIEW * +VIEW * getview( /* get view number n */ int n ) @@ -504,7 +505,7 @@ getview( /* get view number n */ viewnum = 0; } if (n < 0) { /* get next view */ - register int c = getc(viewfp); + int c = getc(viewfp); if (c == EOF) return(NULL); /* that's it */ ungetc(c, viewfp); @@ -533,7 +534,7 @@ countviews(void) /* count views in view file */ } -extern char * +char * getexp( /* get exposure for nth frame */ int n ) @@ -542,7 +543,7 @@ getexp( /* get exposure for nth frame */ static char expval[32]; static FILE *expfp = NULL; static int curfrm = 0; - register char *cp; + char *cp; if (n == 0) { /* signal to close file */ if (expfp != NULL) { @@ -592,7 +593,7 @@ formerr: } -extern double +double expspec_val( /* get exposure value from spec. */ char *s ) @@ -609,7 +610,7 @@ expspec_val( /* get exposure value from spec. */ } -extern char * +char * getoctspec( /* get octree for the given frame */ int n ) @@ -666,11 +667,11 @@ getoctspec( /* get octree for the given frame */ static char * getobjname( /* get fully qualified object name */ - register struct ObjMove *om + struct ObjMove *om ) { static char objName[512]; - register char *cp = objName; + char *cp = objName; strcpy(cp, om->name); while (om->parent >= 0) { @@ -685,7 +686,7 @@ getobjname( /* get fully qualified object name */ static char * getxf( /* get total transform for object */ - register struct ObjMove *om, + struct ObjMove *om, int n ) { @@ -698,7 +699,7 @@ getxf( /* get total transform for object */ char *av[64]; int ac; int i; - register char *cp; + char *cp; /* get parent transform, first */ if (om->parent >= 0) xfp = getxf(&obj_move[om->parent], n); @@ -806,7 +807,7 @@ getxf( /* get total transform for object */ } -extern int +int getmove( /* find matching move object */ OBJECT obj ) @@ -815,7 +816,7 @@ getmove( /* find matching move object */ static OBJECT lasto = OVOID; char *onm, *objnm; int len, len2; - register int i; + int i; if (obj == OVOID) return(-1); @@ -840,7 +841,7 @@ getmove( /* find matching move object */ } -extern double +double obj_prio( /* return priority for object */ OBJECT obj ) @@ -891,7 +892,7 @@ gettimeofday(struct timeval *tp, void *dummy) #endif -extern double +double getTime(void) /* get current time (CPU or real) */ { struct timeval time_now;