1 // File written by Michael Niedermayer and its under GPL
2 // simple file compare program, it finds the number of rounding errors
3 // and dies if there is a larger error ( ABS(a-b)>1 )
7 // FIXME no checks but its just for debuging so who cares ;)
9 int main(int argc
, char **argv
)
16 printf("compare <file1> <file2>\n");
20 f0
= fopen(argv
[1], "rb");
21 f1
= fopen(argv
[2], "rb");
29 int e0
= fread(&c0
, 2, 1, f0
);
30 int e1
= fread(&c1
, 2, 1, f1
);
33 if(e0
==0 && e1
==0) break;
36 printf("FATAL error, files have different size!\n");
43 printf("FATAL error, too large differnce found (%d)!\n", d
);
53 printf("%d (+/-1)differences found\n", dif
);