aboutsummaryrefslogtreecommitdiff
path: root/src/liblzma/check/crc32_small.c
diff options
context:
space:
mode:
authorLasse Collin <lasse.collin@tukaani.org>2009-02-08 18:24:50 +0200
committerLasse Collin <lasse.collin@tukaani.org>2009-02-08 18:24:50 +0200
commit0e27028d74c5c7a8e036ae2a9b8cecb0ac79d3a6 (patch)
treeda1e0548876b37f0100390e36593097b6fc99c20 /src/liblzma/check/crc32_small.c
parentMake "xz --force" to write to terminal as the error (diff)
downloadxz-0e27028d74c5c7a8e036ae2a9b8cecb0ac79d3a6.tar.xz
Add a separate internal function to initialize the CRC32
table, which is used also by LZ encoder. This was needed because calling lzma_crc32() and ignoring the result is a no-op due to lzma_attr_pure.
Diffstat (limited to '')
-rw-r--r--src/liblzma/check/crc32_small.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/liblzma/check/crc32_small.c b/src/liblzma/check/crc32_small.c
index b10bbd37..8507436b 100644
--- a/src/liblzma/check/crc32_small.c
+++ b/src/liblzma/check/crc32_small.c
@@ -38,10 +38,18 @@ crc32_init(void)
}
+extern void
+lzma_crc32_init(void)
+{
+ mythread_once(crc32_init);
+ return;
+}
+
+
extern LZMA_API(uint32_t)
lzma_crc32(const uint8_t *buf, size_t size, uint32_t crc)
{
- mythread_once(crc32_init);
+ lzma_crc32_init();
crc = ~crc;