From 84b3c5da84829bff2d89bcdc4351ab451a332ce8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stig=20Bj=C3=B8rlykke?= Date: Wed, 31 Aug 2011 11:47:27 +0000 Subject: Make lookup functions for accessing crc32c_table and crc32_ccitt_table. svn path=/trunk/; revision=38817 --- wsutil/crc32.h | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'wsutil/crc32.h') diff --git a/wsutil/crc32.h b/wsutil/crc32.h index f69dba6ebf..d77a9d64cf 100644 --- a/wsutil/crc32.h +++ b/wsutil/crc32.h @@ -41,9 +41,10 @@ extern "C" { ((crc32c_value & 0x0000ff00) << 8) | \ ((crc32c_value & 0x000000ff) << 24)) -#define CRC32C(c,d) (c=(c>>8)^crc32c_table[(c^(d))&0xFF]) +#define CRC32C(c,d) (c=(c>>8)^crc32c_table_lookup((c^(d))&0xFF)) -WS_VAR_IMPORT const guint32 crc32c_table[256]; +guint32 crc32c_table_lookup (guchar pos); +guint32 crc32_ccitt_table_lookup (guchar pos); /** Compute CRC32C checksum of a buffer of data. @param buf The buffer containing the data. @@ -52,8 +53,6 @@ WS_VAR_IMPORT const guint32 crc32c_table[256]; @return The CRC32C checksum. */ extern guint32 crc32c_calculate(const void *buf, int len, guint32 crc); -WS_VAR_IMPORT const guint32 crc32_ccitt_table[256]; - /** Compute CRC32 CCITT checksum of a buffer of data. @param buf The buffer containing the data. @param len The number of bytes to include in the computation. -- cgit v1.2.1