From: Jens Axboe Date: Wed, 11 Jun 2008 18:44:57 +0000 (+0200) Subject: crc32 is uint32_t, not unsigned long X-Git-Tag: fio-1.22-rc1~29 X-Git-Url: https://git.kernel.dk/?p=fio.git;a=commitdiff_plain;h=13ddcb169f28e87e493f49887c7b06050d008c9c crc32 is uint32_t, not unsigned long Signed-off-by: Jens Axboe --- diff --git a/crc/crc32.c b/crc/crc32.c index ba6cc065..4afed1af 100644 --- a/crc/crc32.c +++ b/crc/crc32.c @@ -15,9 +15,10 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#include #include "crc32.h" -static const unsigned long crctab[256] = { +static const uint32_t crctab[256] = { 0x0, 0x04C11DB7, 0x09823B6E, 0x0D4326D9, 0x130476DC, 0x17C56B6B, 0x1A864DB2, 0x1E475005, 0x2608EDB8, 0x22C9F00F, 0x2F8AD6D6, @@ -72,10 +73,10 @@ static const unsigned long crctab[256] = { 0xA2F33668, 0xBCB4666D, 0xB8757BDA, 0xB5365D03, 0xB1F740B4 }; -unsigned long crc32(const void *buffer, unsigned long length) +uint32_t crc32(const void *buffer, unsigned long length) { const unsigned char *cp = (const unsigned char *) buffer; - unsigned long crc = 0; + uint32_t crc = 0; while (length--) crc = (crc << 8) ^ crctab[((crc >> 24) ^ *(cp++)) & 0xFF]; diff --git a/crc/crc32.h b/crc/crc32.h index b7e5eee1..d59a5607 100644 --- a/crc/crc32.h +++ b/crc/crc32.h @@ -18,6 +18,6 @@ #ifndef CRC32_H #define CRC32_H -extern unsigned long crc32(const void * const, unsigned long); +extern uint32_t crc32(const void * const, unsigned long); #endif