X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;f=sshcrc.c;h=a993e98b716533b895d7a768faa80b51506bcca5;hb=510f49e405e71ba5c97875e7a019364e1ef5fac9;hp=702d7a08233b081d2880b8c24c88b052c6ddb069;hpb=834537752950251d2e3c3f7cf949de70fe15a20a;p=PuTTY.git diff --git a/sshcrc.c b/sshcrc.c index 702d7a08..a993e98b 100644 --- a/sshcrc.c +++ b/sshcrc.c @@ -76,12 +76,12 @@ * * - Compile with no special #defines. Will generate a table * that's already initialised at compile time, and one function - * crc32(buf,len) that uses it. Normal usage. + * crc32_compute(buf,len) that uses it. Normal usage. * * - Compile with INITFUNC defined. Will generate an uninitialised - * array as the table, and as well as crc32(buf,len) it will - * also generate void crc32_init(void) which sets up the table - * at run time. Useful if binary size is important. + * array as the table, and as well as crc32_compute(buf,len) it + * will also generate void crc32_init(void) which sets up the + * table at run time. Useful if binary size is important. * * - Compile with GENPROGRAM defined. Will create a standalone * program that does the initialisation and outputs the table as @@ -198,12 +198,11 @@ static const unsigned long crc32_table[256] = { #ifdef GENPROGRAM int main(void) { - unsigned long crcword; int i; crc32_init(); for (i = 0; i < 256; i++) { - printf("%s0x%08XL%s", + printf("%s0x%08lXL%s", (i % 4 == 0 ? " " : " "), crc32_table[i], (i % 4 == 3 ? (i == 255 ? "\n" : ",\n") : ",")); @@ -224,7 +223,7 @@ unsigned long crc32_update(unsigned long crcword, const void *buf, size_t len) return crcword; } -unsigned long crc32(const void *buf, size_t len) +unsigned long crc32_compute(const void *buf, size_t len) { return crc32_update(0L, buf, len); }