Browse Source

fixed crc32c on 64bit platforms (fixes crc errors)

git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-merge-1.4.x@745 152afb58-edef-0310-8abb-c4023f1b3aa9
svn/tags/lighttpd-1.4.6
Jan Kneschke 16 years ago
parent
commit
aab12c7582
  1. 8
      src/crc32.c
  2. 3
      src/crc32.h

8
src/crc32.c

@ -70,11 +70,9 @@ static const unsigned int crc_c[256] = {
};
unsigned long
generate_crc32c(char *buffer, size_t length)
{
unsigned int i;
unsigned long crc32 = ~0L;
uint32_t generate_crc32c(char *buffer, size_t length) {
size_t i;
uint32_t crc32 = ~0L;
for (i = 0; i < length; i++){
CRC32C(crc32, (unsigned char)buffer[i]);

3
src/crc32.h

@ -2,7 +2,8 @@
#define __crc32cr_table_h__
#include <sys/types.h>
#include <stdint.h>
unsigned long generate_crc32c(char *string, size_t length);
uint32_t generate_crc32c(char *string, size_t length);
#endif

Loading…
Cancel
Save