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

Comparing ray/src/util/ranimove.c (file contents):
Revision 3.17 by greg, Mon Mar 21 19:06:08 2016 UTC vs.
Revision 3.24 by greg, Sat Jun 7 05:09:46 2025 UTC

# Line 21 | Line 21 | static const char RCSid[] = "$Id$";
21   #include <string.h>
22  
23   #include "platform.h"
24 #include "paths.h"
24   #include "ranimove.h"
25 + #include "func.h"
26  
27   int             NVARS = NV_INIT; /* total number of variables */
28  
# Line 82 | Line 82 | main(
82          int     explicate = 0;
83          char    *cfname;
84          int     i;
85 <
86 <        progname = argv[0];                     /* get arguments */
85 >                                                /* set global progname */
86 >        fixargv0(argv[0]);
87 >                                                /* initialize calcomp */
88 >        initfunc();
89          gargc = argc;
90          gargv = argv;
91          for (i = 1; i < argc && argv[i][0] == '-'; i++)
# Line 170 | Line 172 | userr:
172  
173   void
174   eputs(                          /* put string to stderr */
175 <        register char  *s
175 >        const char  *s
176   )
177   {
178          static int  midline = 0;
# Line 190 | Line 192 | eputs(                         /* put string to stderr */
192  
193  
194   void
195 < quit(ec)                        /* make sure exit is called */
194 < int     ec;
195 > quit(int ec)                    /* make sure exit is called */
196   {
197          if (ray_pnprocs > 0)    /* close children if any */
198 <                ray_pclose(0);          
198 >                ray_pclose(0);
199 >        else if (ray_pnprocs < 0)
200 >                _exit(ec);      /* avoid flush in child */
201          exit(ec);
202   }
203  
# Line 392 | Line 395 | getradfile(            /* run rad and get needed variables */
395   {
396          static short    mvar[] = {OCONV,OCTREEF,RESOLUTION,EXPOSURE,-1};
397          char    combuf[256];
398 <        register int    i;
399 <        register char   *cp;
398 >        int     i;
399 >        char    *cp;
400          char    *pippt = NULL;
401                                          /* create rad command */
402          strcpy(lorendoptf, "ranim0.opt");
# Line 469 | Line 472 | animate(void)                  /* run through animation */
472   }
473  
474  
475 < extern VIEW *
475 > VIEW *
476   getview(                        /* get view number n */
477          int     n
478   )
# Line 504 | Line 507 | getview(                       /* get view number n */
507                  viewnum = 0;
508          }
509          if (n < 0) {                            /* get next view */
510 <                register int    c = getc(viewfp);
510 >                int     c = getc(viewfp);
511                  if (c == EOF)
512                          return(NULL);                   /* that's it */
513                  ungetc(c, viewfp);
# Line 533 | Line 536 | countviews(void)                       /* count views in view file */
536   }
537  
538  
539 < extern char *
539 > char *
540   getexp(                 /* get exposure for nth frame */
541          int     n
542   )
543   {
541        extern char     *fskip();
544          static char     expval[32];
545          static FILE     *expfp = NULL;
546          static int      curfrm = 0;
547 <        register char   *cp;
547 >        char    *cp;
548  
549          if (n == 0) {                           /* signal to close file */
550                  if (expfp != NULL) {
# Line 592 | Line 594 | formerr:
594   }
595  
596  
597 < extern double
597 > double
598   expspec_val(                    /* get exposure value from spec. */
599          char    *s
600   )
# Line 609 | Line 611 | expspec_val(                   /* get exposure value from spec. */
611   }
612  
613  
614 < extern char *
614 > char *
615   getoctspec(                     /* get octree for the given frame */
616          int     n
617   )
# Line 666 | Line 668 | getoctspec(                    /* get octree for the given frame */
668  
669   static char *
670   getobjname(                     /* get fully qualified object name */
671 <        register struct ObjMove *om
671 >        struct ObjMove  *om
672   )
673   {
674          static char     objName[512];
675 <        register char   *cp = objName;
675 >        char    *cp = objName;
676          
677          strcpy(cp, om->name);
678          while (om->parent >= 0) {
# Line 685 | Line 687 | getobjname(                    /* get fully qualified object name */
687  
688   static char *
689   getxf(                  /* get total transform for object */
690 <        register struct ObjMove *om,
690 >        struct ObjMove  *om,
691          int     n
692   )
693   {
# Line 698 | Line 700 | getxf(                 /* get total transform for object */
700          char            *av[64];
701          int             ac;
702          int             i;
703 <        register char   *cp;
703 >        char    *cp;
704                                          /* get parent transform, first */
705          if (om->parent >= 0)
706                  xfp = getxf(&obj_move[om->parent], n);
# Line 806 | Line 808 | getxf(                 /* get total transform for object */
808   }
809  
810  
811 < extern int
811 > int
812   getmove(                                /* find matching move object */
813          OBJECT  obj
814   )
# Line 815 | Line 817 | getmove(                               /* find matching move object */
817          static OBJECT   lasto = OVOID;
818          char    *onm, *objnm;
819          int     len, len2;
820 <        register int    i;
820 >        int     i;
821  
822          if (obj == OVOID)
823                  return(-1);
# Line 840 | Line 842 | getmove(                               /* find matching move object */
842   }
843  
844  
845 < extern double
845 > double
846   obj_prio(                       /* return priority for object */
847          OBJECT  obj
848   )
# Line 891 | Line 893 | gettimeofday(struct timeval *tp, void *dummy)
893  
894   #endif
895  
896 < extern double
896 > double
897   getTime(void)                   /* get current time (CPU or real) */
898   {
899          struct timeval  time_now;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines