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

Comparing ray/src/common/header.c (file contents):
Revision 2.41 by greg, Thu Mar 3 03:55:12 2022 UTC vs.
Revision 2.47 by greg, Mon Mar 14 22:57:24 2022 UTC

# Line 31 | Line 31 | static const char      RCSid[] = "$Id$";
31  
32   #include  "tiff.h"      /* for int32 */
33   #include  "rtio.h"
34 + #include  "color.h"
35   #include  "resolu.h"
36  
37   #define  MAXLINE        2048
# Line 214 | Line 215 | fputformat(            /* put out a format value */
215          fputs(FMTSTR, fp);
216          fputs(s, fp);
217                          /* pad to align binary type for mmap() */
218 <        if (!strcmp(s, "float"))
218 >        if (globmatch(PICFMT, s))
219 >                align = 0;      /* not needed for picture data */
220 >        else if (!strncmp("float", s, 5))
221 >                align = sizeof(float);
222 >        else if (!strncmp("double", s, 6))
223 >                align = sizeof(double);
224 >        else if (!strncmp("16-bit", s, 6))
225 >                align = 2;
226 >        else if (!strncmp("32-bit", s, 6))
227                  align = 4;
228 <        else if (!strcmp(s, "double"))
228 >        else if (!strncmp("64-bit", s, 6))
229                  align = 8;
230          if (align) {
231                  long    pos = ftell(fp);
# Line 354 | Line 363 | globmatch(                     /* check for match of s against pattern p
363                          while (*s++);
364                          return(0);
365                  case '[':                       /* character set */
366 <                        setmatch = *s == *++p;
366 >                        setmatch = (*s == *++p);
367                          if (!*p)
368                                  return(0);
369                          while (*++p != ']') {
370                                  if (!*p)
371                                          return(0);
372                                  if (*p == '-') {
373 <                                        setmatch += (p[-1] <= *s && *s <= p[1]);
373 >                                        setmatch += (p[-1] <= *s) & (*s <= p[1]);
374                                          if (!*++p)
375                                                  break;
376                                  } else
# Line 372 | Line 381 | globmatch(                     /* check for match of s against pattern p
381                          s++;
382                          break;
383                  case '\\':                      /* literal next */
384 <                        p++;
384 >                        if (!*++p)
385 >                                return(0);
386                  /* fall through */
387                  default:                        /* normal character */
388                          if (*p != *s)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines