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 ).
5 * copyright (c) 2001 Michael Niedermayer
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License along
18 * with this program; if not, write to the Free Software Foundation, Inc.,
19 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
25 // FIXME: No checks but it is just for debugging so who cares ;)
27 int main(int argc
, char **argv
)
34 printf("compare <file1> <file2>\n");
38 f0
= fopen(argv
[1], "rb");
39 f1
= fopen(argv
[2], "rb");
47 int e0
= fread(&c0
, 2, 1, f0
);
48 int e1
= fread(&c1
, 2, 1, f1
);
51 if(e0
==0 && e1
==0) break;
54 printf("FATAL error, files have different size!\n");
61 printf("FATAL error, too large a difference found (%d)!\n", d
);
71 printf("%d (+/-1)differences found\n", dif
);