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

Comparing ray/src/util/rcollate.c (file contents):
Revision 2.37 by greg, Fri Jan 15 17:22:23 2021 UTC vs.
Revision 2.39 by greg, Thu Mar 3 03:55:13 2022 UTC

# Line 87 | Line 87 | load_stream(MEMLOAD *mp, FILE *fp)
87          return(mp->len > 0);
88   }
89  
90 + #if defined(_WIN32) || defined(_WIN64)
91 +                                /* too difficult to fix this */
92 + #define load_file       load_stream
93 + #else
94   /* load a file into memory */
95   static int
96   load_file(MEMLOAD *mp, FILE *fp)
97   {
98          int     fd;
99          off_t   skip, flen, fpos;
96
97 #if defined(_WIN32) || defined(_WIN64)
98                                /* too difficult to fix this */
99        return load_stream(mp, fp);
100 #endif
100          if (mp == NULL)
101                  return(-1);
102          mp->mapped = NULL;
# Line 112 | Line 111 | load_file(MEMLOAD *mp, FILE *fp)
111                  return((int)(flen - skip));
112          mp->len = (size_t)(flen - skip);
113   #ifdef MAP_FILE
114 <        if (mp->len > 1L<<20) {         /* map file if > 1 MByte */
114 >        if (mp->len >= 1L<<20) {        /* map file if >= 1 MByte */
115                  mp->mapped = mmap(NULL, flen, PROT_READ, MAP_PRIVATE, fd, 0);
116                  if (mp->mapped != MAP_FAILED) {
117                          mp->base = (char *)mp->mapped + skip;
# Line 138 | Line 137 | load_file(MEMLOAD *mp, FILE *fp)
137          }
138          return(1);
139   }
140 + #endif
141  
142   /* free a record index */
143   #define free_records(rp)        free(rp)
# Line 456 | Line 456 | do_reorder(const MEMLOAD *mp)
456          if (o_header) {                         /* finish header? */
457                  printf("NROWS=%d\n", no_rows);
458                  printf("NCOLS=%d\n", no_columns);
459 +                fputformat(fmtid, stdout);
460                  fputc('\n', stdout);
461          }
462                                                  /* reorder records */
# Line 500 | Line 501 | do_resize(FILE *fp)
501                          printf("NROWS=%d\n", no_rows);
502                  if (no_columns > 0)
503                          printf("NCOLS=%d\n", no_columns);
504 +                fputformat(fmtid, stdout);
505                  fputc('\n', stdout);
506          }
507                                                  /* sanity checks */
# Line 728 | Line 730 | main(int argc, char *argv[])
730                          newheader("RADIANCE", stdout);
731                  printargs(a, argv, stdout);
732                  printf("NCOMP=%d\n", n_comp);
731                fputformat(fmtid, stdout);
733          }
734          if (transpose | check | (outLevels > 1) || (o_header && no_rows <= 0)) {
735                  MEMLOAD myMem;                  /* need to map into memory */

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines