diff options
author | jani@a88-113-38-195.elisa-laajakaista.fi <> | 2007-05-24 13:24:36 +0300 |
---|---|---|
committer | jani@a88-113-38-195.elisa-laajakaista.fi <> | 2007-05-24 13:24:36 +0300 |
commit | fc3b3a0a864fd142f65bbd5ff611d2f09041a258 (patch) | |
tree | 94027c861a0c3fd6ad62c4bee7ae5f7b1088f056 /mysys/checksum.c | |
parent | 2ff938d21c596d1769076d2703b22120d2cf8336 (diff) | |
parent | 088e2395f1833f16c2ea3f7405f604165b4aa2cc (diff) | |
download | mariadb-git-fc3b3a0a864fd142f65bbd5ff611d2f09041a258.tar.gz |
Merge jamppa@bk-internal.mysql.com:/home/bk/mysql-5.1
into a88-113-38-195.elisa-laajakaista.fi:/home/my/bk/mysql-5.1-marvel
Diffstat (limited to 'mysys/checksum.c')
-rw-r--r-- | mysys/checksum.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/mysys/checksum.c b/mysys/checksum.c index 09e9c5b3730..4f86f6845f0 100644 --- a/mysys/checksum.c +++ b/mysys/checksum.c @@ -15,7 +15,8 @@ #include <my_global.h> -#include "my_sys.h" +#include <my_sys.h> +#include <zlib.h> /* Calculate a long checksum for a memoryblock. @@ -27,15 +28,15 @@ length length of the block */ -ha_checksum my_checksum(ha_checksum crc, const byte *pos, uint length) +ha_checksum my_checksum(ha_checksum crc, const uchar *pos, size_t length) { #ifdef NOT_USED - const byte *end=pos+length; + const uchar *end=pos+length; for ( ; pos != end ; pos++) crc=((crc << 8) + *((uchar*) pos)) + (crc >> (8*sizeof(ha_checksum)-8)); return crc; #else - return (ha_checksum)crc32((uint)crc, (const uchar *)pos, length); + return (ha_checksum)crc32((uint)crc, pos, length); #endif } |