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

Comparing ray/src/util/cmatrix.c (file contents):
Revision 2.38 by greg, Tue Nov 21 01:30:20 2023 UTC vs.
Revision 2.41 by greg, Sat Apr 19 17:12:59 2025 UTC

# Line 15 | Line 15 | static const char RCSid[] = "$Id$";
15   #include "paths.h"
16   #include "resolu.h"
17  
18 const char      stdin_name[] = "<stdin>";
19
20 const char      *cm_fmt_id[] = {
21                        "unknown", COLRFMT, CIEFMT, SPECFMT,
22                        "float", "ascii", "double"
23                };
24
25 const int       cm_elem_size[] = {
26                        0, 4, 4, 0, 3*sizeof(float), 0, 3*sizeof(double)
27                };
28
18   /* Allocate a color coefficient matrix */
19   CMATRIX *
20   cm_alloc(int nrows, int ncols)
# Line 96 | Line 85 | get_cminfo(char *s, void *p)
85          char    fmt[MAXFMTLEN];
86          int     i;
87  
88 <        if (!strncmp(s, "NCOMP=", 6) && atoi(s+6) != 3) {
88 >        if (isncomp(s) && ncompval(s) != 3) {
89                  ip->err = "unexpected # components (must be 3)";
90                  return(-1);
91          }
# Line 495 | Line 484 | cm_write(const CMATRIX *cm, int dtype, FILE *fp)
484  
485          if (!cm)
486                  return(0);
487 + #ifdef getc_unlocked
488 +        flockfile(fp);
489 + #endif
490          mp = cm->cmem;
491          switch (dtype) {
492          case DTascii:
# Line 546 | Line 538 | cm_write(const CMATRIX *cm, int dtype, FILE *fp)
538                  fputs("Unsupported data type in cm_write()!\n", stderr);
539                  return(0);
540          }
541 + #ifdef getc_unlocked
542 +        funlockfile(fp);
543 + #endif
544          return(fflush(fp) == 0);
545   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines