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.29 by greg, Mon Jun 4 18:53:09 2018 UTC vs.
Revision 2.30 by greg, Mon Jun 4 23:05:34 2018 UTC

# Line 92 | Line 92 | static const char      RCSid[] = "$Id$";
92   /* Since 1991, LM-63 files have begun with the magic keyword IESNA */
93   #define MAGICID         "IESNA"
94   #define LMAGICID        5
95 + /* But newer files start with IESNA:LM-63- */
96 + #define MAGICID2        "IESNA:LM-63-"
97 + #define LMAGICID2       12
98   /* ies2rad supports the 1986, 1991, and 1995 versions of
99   * LM-63. FIRSTREV describes the first version; LASTREV describes the
100   * 1995 version. */
# Line 840 | Line 843 | ies2rad(               /* convert IES file */
843                          continue;
844                  /* increment the header line count, and check for the
845                   * "TILT=" line that terminates the header */
846 <                if (!lineno++ && strncmp(buf, MAGICID, LMAGICID) == 0) {
847 <                        /* This code doesn't work for LM-63-95 and
848 <                         * LM-63-02 files and will instead default to
849 <                         * LM-63-86. */
850 <                        filerev = atoi(buf+LMAGICID);
846 >                if (!lineno++) {        /* first line may be magic */
847 >                        if (!strncmp(buf, MAGICID2, LMAGICID2))
848 >                                filerev = atoi(buf+LMAGICID2) - 1900;
849 >                        else if (!strncmp(buf, MAGICID, LMAGICID))
850 >                                filerev = atoi(buf+LMAGICID);
851                          if (filerev < FIRSTREV)
852                                  filerev = FIRSTREV;
853                          else if (filerev > LASTREV)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines