1 // File written by Michael Niedermayer and it is under GPL.
2 // Simple file compare program, it finds the number of rounding errors
3 // and dies if there is too large an error ( ABS(a-b)>1 ).
8 // FIXME: No checks but it is just for debugging so who cares ;)
10 int main(int argc
, char **argv
)
17 printf("compare <file1> <file2>\n");
21 f0
= fopen(argv
[1], "rb");
22 f1
= fopen(argv
[2], "rb");
30 int e0
= fread(&c0
, 2, 1, f0
);
31 int e1
= fread(&c1
, 2, 1, f1
);
34 if(e0
==0 && e1
==0) break;
37 printf("FATAL error, files have different size!\n");
44 printf("FATAL error, too large a difference found (%d)!\n", d
);
54 printf("%d (+/-1)differences found\n", dif
);