27 |
|
/* system materials & geometry */ |
28 |
|
const char *mgf_geometry = NULL; |
29 |
|
/* comment list */ |
30 |
< |
#define MAXCOMM 30 |
30 |
> |
#define MAXCOMM 80 |
31 |
|
const char *commlist[MAXCOMM]; |
32 |
|
int ncomm = 0; |
33 |
|
/* angle bases */ |
417 |
|
return -1; |
418 |
|
} |
419 |
|
|
420 |
< |
/* Filter Klems angle basis, factoring out incident projected solid angle */ |
420 |
> |
/* Filter Klems angle data, factoring out incident projected solid angle */ |
421 |
|
static int |
422 |
|
filter_klems_matrix(FILE *fp) |
423 |
|
{ |
424 |
|
const char *bn = klems_basis_name[angle_basis]; |
425 |
< |
int i, j, n = nabases; |
425 |
> |
int i, j, c, n = nabases; |
426 |
|
/* get angle basis */ |
427 |
|
while (n-- > 0) |
428 |
|
if (!strcasecmp(bn, abase_list[n].name)) |
434 |
|
const double corr = 1./io_getohm(i, &abase_list[n]); |
435 |
|
for (j = 0; j < abase_list[n].nangles; j++) { |
436 |
|
double d; |
437 |
< |
if (fscanf(fp, "%lf", &d) != 1) |
437 |
> |
if (fscanf(fp, "%lf ", &d) != 1) |
438 |
|
return 0; |
439 |
+ |
if ((c = getc(fp)) != ',') |
440 |
+ |
ungetc(c, fp); |
441 |
|
if (d < -1e-3) { |
442 |
|
fputs("Negative BSDF data!\n", stderr); |
443 |
|
return 0; |
446 |
|
} |
447 |
|
fputc('\n', stdout); |
448 |
|
} |
449 |
< |
while ((i = getc(fp)) != EOF) |
450 |
< |
if (!isspace(i)) { |
449 |
> |
while ((c = getc(fp)) != EOF) |
450 |
> |
if (!isspace(c)) { |
451 |
|
fputs("Unexpected data past EOF\n", stderr); |
452 |
|
return 0; |
453 |
|
} |
819 |
|
argv[0]); |
820 |
|
return 1; |
821 |
|
} |
822 |
< |
if (strchr(argv[++i], '>') != NULL) { |
822 |
> |
if (strstr(argv[++i], "-->") != NULL) { |
823 |
|
fprintf(stderr, "%s: illegal character in comment\n", |
824 |
|
argv[0]); |
825 |
|
return 1; |