From eb5f968c455276ba2d13e5b44edadef1294d5ab5 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 5 Aug 2003 21:14:15 +0200 Subject: table checksum background: my_checksum() mysys function NISAM checksum code moved from mysys to isam/ - it's obsolete MyISAM checksum code moved to mysys table's checksum accessible from sql layer SHOW TABLE STATUS shows checksum (WL#646) code cleanup include/my_sys.h: table checksum background: my_checksum() mysys function include/myisam.h: table checksum background: my_checksum() mysys function MyISAM checksum code moved to mysys isam/isamchk.c: table checksum background: NISAM checksum code moved from mysys to isam/ - it's obsolete isam/isamdef.h: table checksum background: NISAM checksum code moved from mysys to isam/ - it's obsolete isam/open.c: table checksum background: NISAM checksum code moved from mysys to isam/ - it's obsolete isam/pack_isam.c: table checksum background: NISAM checksum code moved from mysys to isam/ - it's obsolete myisam/mi_checksum.c: table checksum background: my_checksum() mysys function MyISAM checksum code moved to mysys mysys/checksum.c: table checksum background: my_checksum() mysys function MyISAM checksum code moved to mysys sql/ha_myisam.cc: table checksum background: table's checksum accessible from sql layer sql/ha_myisam.h: table checksum background: table's checksum accessible from sql layer sql/handler.h: table checksum background: table's checksum accessible from sql layer code cleanup sql/sql_lex.h: table checksum background: table's checksum accessible from sql layer code cleanup sql/sql_select.cc: warning removed sql/sql_show.cc: SHOW TABLE STATUS shows checksum (WL#646) sql/sql_yacc.yy: cleanup (DROP TABLES syntax added as a side effect :)) --- mysys/checksum.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) (limited to 'mysys/checksum.c') diff --git a/mysys/checksum.c b/mysys/checksum.c index 1dd135c7ad9..2ae139b81c3 100644 --- a/mysys/checksum.c +++ b/mysys/checksum.c @@ -19,19 +19,20 @@ #include "my_sys.h" /* - Calculate a long checksum for a memoryblock. Used to verify pack_isam - + Calculate a long checksum for a memoryblock. + SYNOPSIS - checksum() - mem Pointer to memory block - count Count of bytes + my_checksum() + crc start value for crc + pos pointer to memory block + length length of the block */ -ulong checksum(const byte *mem, uint count) +ha_checksum my_checksum(ha_checksum crc, const byte *pos, uint length) { - ulong crc; - for (crc= 0; count-- ; mem++) - crc= ((crc << 1) + *((uchar*) mem)) + - test(crc & ((ulong) 1L << (8*sizeof(ulong)-1))); + const byte *end=pos+length; + for ( ; pos != end ; pos++) + crc=((crc << 8) + *((uchar*) pos)) + (crc >> (8*sizeof(ha_checksum)-8)); return crc; } + -- cgit v1.2.1