diff options
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 } |