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.16 by schorsch, Sun Mar 6 01:13:18 2016 UTC vs.
Revision 3.22 by greg, Wed Apr 23 02:35:26 2025 UTC

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

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines