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

Comparing ray/src/cv/ies2rad.c (file contents):
Revision 2.23 by schorsch, Sat Nov 15 13:29:23 2003 UTC vs.
Revision 2.27 by greg, Sat Aug 1 23:27:04 2015 UTC

# Line 76 | Line 76 | int    filerev = FIRSTREV;
76                                          /* photometric types */
77   #define PM_C            1
78   #define PM_B            2
79 + #define PM_A            3
80                                          /* unit types */
81   #define U_FEET          1
82   #define U_METERS        2
# Line 338 | Line 339 | initlamps(void)                                /* set up lamps */
339  
340   char *
341   stradd(                 /* add a string at dst */
342 <        register char   *dst,
343 <        register char   *src,
342 >        char    *dst,
343 >        char    *src,
344          int     sep
345   )
346   {
# Line 391 | Line 392 | libname(               /* return library relative name */
392  
393   char *
394   filename(                       /* get final component of pathname */
395 <        register char   *path
395 >        char    *path
396   )
397   {
398 <        register char   *cp;
398 >        char    *cp;
399  
400          for (cp = path; *path; path++)
401                  if (ISDIRSEP(*path))
# Line 408 | Line 409 | filetrunc(                             /* truncate filename at end of path */
409          char    *path
410   )
411   {
412 <        register char   *p1, *p2;
412 >        char    *p1, *p2;
413  
414          for (p1 = p2 = path; *p2; p2++)
415                  if (ISDIRSEP(*p2))
# Line 425 | Line 426 | tailtrunc(                             /* truncate tail of filename */
426          char    *name
427   )
428   {
429 <        register char   *p1, *p2;
429 >        char    *p1, *p2;
430  
431          for (p1 = filename(name); *p1 == '.'; p1++)
432                  ;
# Line 444 | Line 445 | blanktrunc(                            /* truncate spaces at end of line */
445          char    *s
446   )
447   {
448 <        register char   *cp;
448 >        char    *cp;
449  
450          for (cp = s; *cp; cp++)
451                  ;
# Line 456 | Line 457 | blanktrunc(                            /* truncate spaces at end of line */
457  
458   int
459   k_match(                        /* header line matches keyword? */
460 <        register char   *kwd,
461 <        register char   *hdl
460 >        char    *kwd,
461 >        char    *hdl
462   )
463   {
464 <        if (!*hdl++ == '[')
464 >        if (*hdl++ != '[')
465                  return(0);
466          while (islower(*hdl) ? toupper(*hdl) == *kwd++ : *hdl == *kwd++)
467                  if (!*hdl++)
# Line 471 | Line 472 | k_match(                       /* header line matches keyword? */
472  
473   char *
474   keyargs(                                /* return keyword arguments */
475 <        register char   *hdl
475 >        char    *hdl
476   )
477   {
478          while (*hdl && *hdl++ != ']')
# Line 487 | Line 488 | putheader(                             /* print header */
488          FILE    *out
489   )
490   {
491 <        register int    i;
491 >        int     i;
492          
493          putc('#', out);
494          for (i = 0; i < gargc; i++) {
# Line 699 | Line 700 | dosource(      /* create source and distribution */
700                  fprintf(stderr, "dosource: bad lamp specification\n");
701                  return(-1);
702          }
703 +        if (pmtype != PM_C && pmtype != PM_B) {
704 +                fprintf(stderr, "dosource: unsupported photometric type (%d)\n",
705 +                                pmtype);
706 +                return(-1);
707 +        }
708          sinf->mult = multiplier*mult*bfactor*pfactor;
709          if (nangles[0] < 2 || nangles[1] < 1) {
710                  fprintf(stderr, "dosource: too few measured angles\n");
# Line 736 | Line 742 | dosource(      /* create source and distribution */
742                  fprintf(out, "7 ");
743          else
744                  fprintf(out, "5 ");
745 <        dolower = (bounds[0][0] < 90.);
746 <        doupper = (bounds[0][1] > 90.);
745 >        dolower = (bounds[0][0] < 90.-FTINY);
746 >        doupper = (bounds[0][1] > 90.+FTINY);
747          dosides = (doupper & dolower && sinf->h > MINDIM);
748          fprintf(out, "%s %s source.cal ",
749                          sinf->type==SPHERE ? "corr" :
# Line 750 | Line 756 | dosource(      /* create source and distribution */
756                  else
757                          fprintf(out, "srcB_horiz ");
758                  fprintf(out, "srcB_vert ");
759 <        } else /* pmtype == PM_A */ {
759 >        } else /* pmtype == PM_C */ {
760                  if (nangles[1] >= 2) {
761                          d1 = bounds[1][1] - bounds[1][0];
762                          if (d1 <= 90.+FTINY)
# Line 828 | Line 834 | putsource( /* put out source */
834  
835   int
836   makeshape(              /* make source shape */
837 <        register SRCINFO        *shp,
837 >        SRCINFO *shp,
838          double  width,
839          double  length,
840          double  height
# Line 897 | Line 903 | putrectsrc(            /* rectangular source */
903  
904   void
905   putsides(                       /* put out sides of box */
906 <        register SRCINFO        *shp,
906 >        SRCINFO *shp,
907          FILE    *fp,
908          char    *mod,
909          char    *name
# Line 933 | Line 939 | putrect(       /* put out a rectangle */
939  
940   void
941   putpoint(                               /* put out a point */
942 <        register SRCINFO        *shp,
942 >        SRCINFO *shp,
943          FILE    *fp,
944          int     p
945   )
# Line 949 | Line 955 | putpoint(                              /* put out a point */
955  
956   void
957   putdisksrc(             /* put out a disk source */
958 <        register SRCINFO        *shp,
958 >        SRCINFO *shp,
959          FILE    *fp,
960          char    *mod,
961          char    *name,
# Line 974 | Line 980 | putdisksrc(            /* put out a disk source */
980  
981   void
982   putcyl(                 /* put out a cylinder */
983 <        register SRCINFO        *shp,
983 >        SRCINFO *shp,
984          FILE    *fp,
985          char    *mod,
986          char    *name
# Line 1012 | Line 1018 | cvdata(                /* convert data */
1018   )
1019   {
1020          double  *pt[4];
1021 <        register int    i, j;
1021 >        int     i, j;
1022          double  val;
1023          int     total;
1024  
# Line 1070 | Line 1076 | cvdata(                /* convert data */
1076  
1077   char *
1078   getword(                        /* scan a word from fp */
1079 <        register FILE   *fp
1079 >        FILE    *fp
1080   )
1081   {
1082          static char     wrd[RMAXWORD];
1083 <        register char   *cp;
1084 <        register int    c;
1083 >        char    *cp;
1084 >        int     c;
1085  
1086          while (isspace(c=getc(fp)))
1087                  ;
# Line 1123 | Line 1129 | cvtflt(                        /* convert a word to a double */
1129   int
1130   cvgeometry(
1131          char    *inpname,
1132 <        register SRCINFO        *sinf,
1132 >        SRCINFO *sinf,
1133          char    *outname,
1134          FILE    *outfp                  /* close output file upon return */
1135   )
1136   {
1137          char    buf[256];
1138 <        register char   *cp;
1138 >        char    *cp;
1139  
1140          if (inpname == NULL || !inpname[0]) {   /* no geometry file */
1141                  fclose(outfp);
# Line 1139 | Line 1145 | cvgeometry(
1145          strcpy(buf, "mgf2rad ");                /* build mgf2rad command */
1146          cp = buf+8;
1147          if (!FEQ(sinf->mult, 1.0)) {
1148 <                sprintf(cp, "-m %f ", sinf->mult);
1148 >                sprintf(cp, "-e %f ", sinf->mult);
1149                  cp += strlen(cp);
1150          }
1151          sprintf(cp, "-g %f %s ",

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines