aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLasse Collin <lasse.collin@tukaani.org>2023-01-12 05:38:48 +0200
committerLasse Collin <lasse.collin@tukaani.org>2023-01-12 05:38:48 +0200
commit31c21c734b7c7d7428a3da7402a2cb7bc2587339 (patch)
treeec758c5624a30826c7313d48b27aab6dcc39f3f4
parentliblzma: Silence a warning from -Wsign-conversion in a 32-bit build. (diff)
downloadxz-31c21c734b7c7d7428a3da7402a2cb7bc2587339.tar.xz
liblzma: Silence another warning from -Wsign-conversion in a 32-bit build.
It doesn't warn on a 64-bit system because truncating a ptrdiff_t (signed long) to uint32_t is diagnosed under -Wconversion by GCC and -Wshorten-64-to-32 by Clang.
-rw-r--r--src/liblzma/lz/lz_encoder_mf.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/liblzma/lz/lz_encoder_mf.c b/src/liblzma/lz/lz_encoder_mf.c
index f20316f0..1fdc2d79 100644
--- a/src/liblzma/lz/lz_encoder_mf.c
+++ b/src/liblzma/lz/lz_encoder_mf.c
@@ -220,10 +220,11 @@ move_pending(lzma_mf *mf)
/// of matches found.
#define call_find(func, len_best) \
do { \
- matches_count = func(len_limit, pos, cur, cur_match, mf->depth, \
- mf->son, mf->cyclic_pos, mf->cyclic_size, \
+ matches_count = (uint32_t)(func(len_limit, pos, cur, cur_match, \
+ mf->depth, mf->son, \
+ mf->cyclic_pos, mf->cyclic_size, \
matches + matches_count, len_best) \
- - matches; \
+ - matches); \
move_pos(mf); \
return matches_count; \
} while (0)