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

Comparing ray/src/rt/pmapdump.c (file contents):
Revision 2.15 by rschregle, Wed Aug 14 18:02:11 2019 UTC vs.
Revision 2.18 by rschregle, Thu Feb 18 17:08:50 2021 UTC

# Line 9 | Line 9 | static const char RCSid[] = "$Id$";
9  
10     Roland Schregle (roland.schregle@{hslu.ch, gmail.com})
11     (c) Fraunhofer Institute for Solar Energy Systems,
12 +       supported by the German Research Foundation
13 +       (DFG LU-204/10-2, "Fassadenintegrierte Regelsysteme FARESYS")
14     (c) Lucerne University of Applied Sciences and Arts,
15 <       supported by the Swiss National Science Foundation (SNSF, #147053)
15 >       supported by the Swiss National Science Foundation
16 >       (SNSF #147053, "Daylight Redirecting Components")
17 >   (c) Tokyo University of Science,
18 >       supported by the JSPS Grants-in-Aid for Scientific Research
19 >       (KAKENHI JP19KK0115, "Three-Dimensional Light Flow")  
20     ======================================================================
21    
22     $Id$
# Line 215 | Line 221 | int main (int argc, char** argv)
221              fputc('\n', stdout);
222           }
223        }
218      
219      /* Get number of photons */
220      pm.numPhotons = getint(sizeof(pm.numPhotons), pmapFile);
224  
225 +      /* Get number of photons as fixed size, which possibly results in
226 +       * padding of MSB with 0 on some platforms.  Unlike sizeof() however,
227 +       * this ensures portability since this value may span 32 or 64 bits
228 +       * depending on platform.  */
229 +      pm.numPhotons = getint(PMAP_LONGSIZE, pmapFile);      
230 +
231        /* Skip avg photon flux */
232        for (j = 0; j < 3; j++)
233           getflt(pmapFile);
# Line 270 | Line 279 | int main (int argc, char** argv)
279   #ifdef PMAP_OOC
280        /* Open leaf file with filename derived from pmap, replace pmapFile
281         * (which is currently the node file) */
282 <      strncpy(leafFname, argv [arg], 1024);
283 <      strncat(leafFname, PMAP_OOC_LEAFSUFFIX, 1024);
282 >      strncpy(leafFname, argv [arg], sizeof(leafFname) - 1);
283 >      strncat(leafFname, PMAP_OOC_LEAFSUFFIX, sizeof(leafFname) - 1);
284        fclose(pmapFile);
285        if (!(pmapFile = fopen(leafFname, "rb"))) {
286           sprintf(errmsg, "cannot open leaf file %s", leafFname);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines