Commit ac31f322 authored by deuce's avatar deuce
Browse files

Rename sbbs_crc32() to crc32i() and insert a new first argument as the

initial seed.  Macro crc32(b,j) to crc32i(-1,b,j)
parent abe74320
......@@ -78,9 +78,9 @@ long crc32tbl[]={ /* CRC polynomial 0xedb88320 */
/* Pass len of 0 to auto-determine ASCIIZ string length */
/* or non-zero for arbitrary binary data */
/****************************************************************************/
unsigned long sbbs_crc32(char *buf, unsigned long len)
unsigned long crc32i(unsigned long crc, char *buf, unsigned long len)
{
unsigned long l,crc=0xffffffff;
unsigned long l;
if(len==0 && buf!=NULL)
len=strlen(buf);
......
......@@ -46,7 +46,7 @@ extern "C" {
extern long crc32tbl[];
unsigned long sbbs_crc32(char* buf, unsigned long len);
unsigned long crc32i(unsigned long crc, char* buf, unsigned long len);
unsigned long fcrc32(FILE* fp, unsigned long len);
#ifdef __cplusplus
......@@ -54,6 +54,6 @@ unsigned long fcrc32(FILE* fp, unsigned long len);
#endif
#define ucrc32(ch,crc) (crc32tbl[(crc^(ch))&0xff]^(crc>>8))
#define crc32(x,y) sbbs_crc32(x,y)
#define crc32(x,y) crc32i(-1,x,y)
#endif /* Don't add anything after this line */
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment