aboutsummaryrefslogtreecommitdiff
path: root/src/liblzma/common/stream_decoder_mt.c
diff options
context:
space:
mode:
authorLasse Collin <lasse.collin@tukaani.org>2023-01-12 03:19:59 +0200
committerJia Tan <jiat0218@gmail.com>2023-02-03 21:09:42 +0800
commit6671d0fe46b77f0fafce860836b7a12dc3cda14a (patch)
treeb904eddfcab8a056f6c232dae363e27b1ab40ddd /src/liblzma/common/stream_decoder_mt.c
parentFix warnings from clang -Wdocumentation. (diff)
downloadxz-6671d0fe46b77f0fafce860836b7a12dc3cda14a.tar.xz
liblzma: Silence warnings from clang -Wconditional-uninitialized.
This is similar to 2ce4f36f179a81d0c6e182a409f363df759d1ad0. The actual initialization of the variables is done inside mythread_sync() macro. Clang doesn't seem to see that the initialization code inside the macro is always executed.
Diffstat (limited to 'src/liblzma/common/stream_decoder_mt.c')
-rw-r--r--src/liblzma/common/stream_decoder_mt.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/liblzma/common/stream_decoder_mt.c b/src/liblzma/common/stream_decoder_mt.c
index fd5cd7fd..b8ba4d39 100644
--- a/src/liblzma/common/stream_decoder_mt.c
+++ b/src/liblzma/common/stream_decoder_mt.c
@@ -1358,9 +1358,11 @@ stream_decode_mt(void *coder_ptr, const lzma_allocator *allocator,
// values after we read these as those changes can only be
// towards more favorable conditions (less memory in use,
// more in cache).
- uint64_t mem_in_use;
- uint64_t mem_cached;
- struct worker_thread *thr = NULL; // Init to silence warning.
+ //
+ // These are initalized to silence warnings.
+ uint64_t mem_in_use = 0;
+ uint64_t mem_cached = 0;
+ struct worker_thread *thr = NULL;
mythread_sync(coder->mutex) {
mem_in_use = coder->mem_in_use;