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$ |
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); |
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); |