38 |
|
long nexpected = (long)ncp->res.xr * ncp->res.yr; |
39 |
|
|
40 |
|
if (ncp->inpfmt[0]) { |
41 |
< |
if (strcasestr(ncp->inpfmt, "ascii") != NULL) |
41 |
> |
if (strstr(ncp->inpfmt, "ascii") != NULL) |
42 |
|
ncp->format = 'a'; |
43 |
< |
else if (strcasestr(ncp->inpfmt, "float") != NULL) |
43 |
> |
else if (strstr(ncp->inpfmt, "float") != NULL) |
44 |
|
ncp->format = 'f'; |
45 |
< |
else if (strcasestr(ncp->inpfmt, "double") != NULL) |
45 |
> |
else if (strstr(ncp->inpfmt, "double") != NULL) |
46 |
|
ncp->format = 'd'; |
47 |
|
else { |
48 |
|
fputs(ncp->inpname, stderr); |
65 |
|
#ifdef SMLFLT |
66 |
|
case 'f': |
67 |
|
ok = (getbinary(nrm, sizeof(*nrm), 3, ncp->finp) == 3); |
68 |
+ |
if (ncp->swapped) |
69 |
+ |
swap32((char *)nrm, 3); |
70 |
|
break; |
71 |
|
case 'd': { |
72 |
< |
double nrmd[3]; |
73 |
< |
ok = (getbinary(nrmd, sizeof(*nrmd), |
74 |
< |
3, ncp->finp) == 3); |
75 |
< |
if (ok) VCOPY(nrm, nrmd); |
76 |
< |
} |
77 |
< |
break; |
72 |
> |
double nrmd[3]; |
73 |
> |
ok = (getbinary(nrmd, sizeof(*nrmd), |
74 |
> |
3, ncp->finp) == 3); |
75 |
> |
if (ncp->swapped) |
76 |
> |
swap64((char *)nrmd, 3); |
77 |
> |
if (ok) VCOPY(nrm, nrmd); |
78 |
> |
} break; |
79 |
|
#else |
80 |
|
case 'f': { |
81 |
< |
float nrmf[3]; |
82 |
< |
ok = (getbinary(nrmf, sizeof(*nrmf), |
83 |
< |
3, ncp->finp) == 3); |
84 |
< |
if (ok) VCOPY(nrm, nrmf); |
85 |
< |
} |
86 |
< |
break; |
81 |
> |
float nrmf[3]; |
82 |
> |
ok = (getbinary(nrmf, sizeof(*nrmf), |
83 |
> |
3, ncp->finp) == 3); |
84 |
> |
if (ncp->swapped) |
85 |
> |
swap32((char *)nrmf, 3); |
86 |
> |
if (ok) VCOPY(nrm, nrmf); |
87 |
> |
} break; |
88 |
|
case 'd': |
89 |
|
ok = (getbinary(nrm, sizeof(*nrm), 3, ncp->finp) == 3); |
90 |
+ |
if (ncp->swapped) |
91 |
+ |
swap64((char *)nrm, 3); |
92 |
|
break; |
93 |
|
#endif |
94 |
|
} |