CRC modernisation

This commit is contained in:
Arvid Norlander 2022-09-29 18:57:39 +02:00
parent 02673a9850
commit f980b8a9a9
No known key found for this signature in database
GPG Key ID: E824A8E5D8D29AA0
3 changed files with 12 additions and 7 deletions

8
crc/.gitignore vendored Normal file
View File

@ -0,0 +1,8 @@
arc.c
binhex.c
ccitt.c
ccitt32.c
kermit.c
libcrc.a
makecrc
zip.c

View File

@ -109,10 +109,7 @@ int poly, init, swapped, bits;
}
(void)fprintf(fd, "};\n");
(void)fprintf(fd, "\n");
(void)fprintf(fd, "unsigned long %s_updcrc(icrc, icp, icnt)\n", name);
(void)fprintf(fd, " unsigned long icrc;\n");
(void)fprintf(fd, " unsigned char *icp;\n");
(void)fprintf(fd, " int icnt;\n");
(void)fprintf(fd, "unsigned long %s_updcrc(unsigned long icrc, unsigned char *icp, int icnt)\n", name);
(void)fprintf(fd, "{\n");
if(bits == 16) {
(void)fprintf(fd, "#define M1 0xff\n");

View File

@ -4,9 +4,9 @@ extern unsigned long arc_crcinit;
extern unsigned long binhex_crcinit;
extern unsigned long zip_crcinit;
extern unsigned long arc_updcrc();
extern unsigned long binhex_updcrc();
extern unsigned long zip_updcrc();
extern unsigned long arc_updcrc(unsigned long icrc, unsigned char *icp, int icnt);
extern unsigned long binhex_updcrc(unsigned long icrc, unsigned char *icp, int icnt);
extern unsigned long zip_updcrc(unsigned long icrc, unsigned char *icp, int icnt);
extern unsigned long crcinit;
extern unsigned long (*updcrc)();