From 1fdf96848ead448bb142519bc626aa027a81d802 Mon Sep 17 00:00:00 2001 From: Martin Piatka Date: Thu, 26 Feb 2026 10:57:26 +0100 Subject: [PATCH] crypt/crc: Remove unused functions --- src/crypto/crc.h | 2 -- src/crypto/crc_32.c | 52 --------------------------------------------- 2 files changed, 54 deletions(-) diff --git a/src/crypto/crc.h b/src/crypto/crc.h index e6c3fc4e5..f264669df 100644 --- a/src/crypto/crc.h +++ b/src/crypto/crc.h @@ -9,7 +9,6 @@ #include #include #else -#include #include /* For size_t */ #include #endif @@ -26,7 +25,6 @@ extern "C" { ^ ((uint8_t)octet)) & 0xff] ^ ((crc) >> 8)) uint32_t updateCRC32(unsigned char ch, uint32_t crc); -bool crc32file(char *name, uint32_t *crc, long *charcnt); uint32_t crc32buf(const char *buf, size_t len); diff --git a/src/crypto/crc_32.c b/src/crypto/crc_32.c index 93ea7d6df..803afa2bd 100644 --- a/src/crypto/crc_32.c +++ b/src/crypto/crc_32.c @@ -115,40 +115,6 @@ uint32_t updateCRC32(unsigned char ch, uint32_t crc) return UPDC32(ch, crc); } -bool crc32file(char *name, uint32_t *crc, long *charcnt) -{ - register FILE *fin; - register uint32_t oldcrc32; - register int c; - - oldcrc32 = 0xFFFFFFFF; *charcnt = 0; -#ifdef MSDOS - if ((fin=fopen(name, "rb"))==NULL) -#else - if ((fin=fopen(name, "r"))==NULL) -#endif - { - perror(name); - return false; - } - while ((c=getc(fin))!=EOF) - { - ++*charcnt; - oldcrc32 = UPDC32(c, oldcrc32); - } - - if (ferror(fin)) - { - perror(name); - *charcnt = -1; - } - fclose(fin); - - *crc = oldcrc32 = ~oldcrc32; - - return true; -} - uint32_t crc32buf_with_oldcrc(const char *buf, size_t len, uint32_t old_crc) { register uint32_t oldcrc32; @@ -167,21 +133,3 @@ uint32_t crc32buf(const char *buf, size_t len) { return crc32buf_with_oldcrc(buf, len, 0); } - -#ifdef TEST - -main(int argc, char *argv[]) -{ - uint32_t crc; - long charcnt; - register errors = 0; - - while(--argc > 0) - { - errors |= crc32file(*++argv, &crc, &charcnt); - printf("%08lX %7ld %s\n", crc, charcnt, *argv); - } - return(errors != 0); -} - -#endif /* TEST */