diff options
author | stig <stig@f5534014-38df-0310-8fa8-9805f1628bb7> | 2011-08-31 11:47:27 +0000 |
---|---|---|
committer | stig <stig@f5534014-38df-0310-8fa8-9805f1628bb7> | 2011-08-31 11:47:27 +0000 |
commit | 830f7978077048b20c2b88b5f6cf4a1c3aef7f56 (patch) | |
tree | dcba77617a427261533eace98c505c5cfc198a33 /wsutil/crc32.h | |
parent | 47860613400348191fbfc9690147c58283e5e90c (diff) |
Make lookup functions for accessing crc32c_table and crc32_ccitt_table.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@38817 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'wsutil/crc32.h')
-rw-r--r-- | wsutil/crc32.h | 7 |
1 files changed, 3 insertions, 4 deletions
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. |