99 |
|
const char stdin_name[] = "<stdin>"; |
100 |
|
const char *f1name=NULL, *f2name=NULL; |
101 |
|
FILE *f1in=NULL, *f2in=NULL; |
102 |
+ |
int f1swap=0, f2swap=0; |
103 |
|
|
104 |
|
/* running real differences */ |
105 |
|
double diff2sum = 0; |
326 |
|
adv_linecnt(htp); /* side-effect is to count lines */ |
327 |
|
if (!isalpha(*val)) /* key must start line */ |
328 |
|
return(0); |
329 |
+ |
/* check if we need to swap binary data */ |
330 |
+ |
if ((n = isbigendian(val)) >= 0) { |
331 |
+ |
if (nativebigendian() == n) |
332 |
+ |
return(0); |
333 |
+ |
f1swap += (htp == &hdr1); |
334 |
+ |
f2swap += (htp == &hdr2); |
335 |
+ |
return(0); |
336 |
+ |
} |
337 |
|
key = val++; |
338 |
|
while (*val && !isspace(*val) & (*val != '=')) |
339 |
|
val++; |
831 |
|
if (!getbinary(&f2, sizeof(f2), 1, f2in)) |
832 |
|
goto badeof; |
833 |
|
++nread; |
834 |
+ |
if (f1swap) swap32((char *)&f1, 1); |
835 |
+ |
if (f2swap) swap32((char *)&f2, 1); |
836 |
|
if (real_check(f1, f2)) |
837 |
|
continue; |
838 |
|
if (report != REP_QUIET) |
863 |
|
if (!getbinary(&f2, sizeof(f2), 1, f2in)) |
864 |
|
goto badeof; |
865 |
|
++nread; |
866 |
+ |
if (f1swap) swap64((char *)&f1, 1); |
867 |
+ |
if (f2swap) swap64((char *)&f2, 1); |
868 |
|
if (real_check(f1, f2)) |
869 |
|
continue; |
870 |
|
if (report != REP_QUIET) |