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-c4023f1b3aa9svn/tags/lighttpd-1.4.6
parent
4b60920e80
commit
aab12c7582
|
@ -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]);
|
||||
|
|
|
@ -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…
Reference in New Issue