From: Carl Woffenden Date: Fri, 3 Apr 2020 09:55:29 +0000 (+0200) Subject: Fixes decompressor when using -Wshorten-64-to-32 (#2062) X-Git-Tag: v1.4.5^2~70 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7202184ee0f6aaf859bb76364e9372453fb53298;p=thirdparty%2Fzstd.git Fixes decompressor when using -Wshorten-64-to-32 (#2062) Spotted on iOS when building with `-Wshorten-64-to-32` (since `__builtin_expect` returns a `long`). --- diff --git a/lib/decompress/huf_decompress.c b/lib/decompress/huf_decompress.c index 6cf9c4fdd..a2478b4c7 100644 --- a/lib/decompress/huf_decompress.c +++ b/lib/decompress/huf_decompress.c @@ -835,7 +835,7 @@ HUF_decompress4X2_usingDTable_internal_body( HUF_DECODE_SYMBOLX2_0(op2, &bitD2); HUF_DECODE_SYMBOLX2_0(op3, &bitD3); HUF_DECODE_SYMBOLX2_0(op4, &bitD4); - endSignal = LIKELY( + endSignal = (U32)LIKELY( (BIT_reloadDStreamFast(&bitD1) == BIT_DStream_unfinished) & (BIT_reloadDStreamFast(&bitD2) == BIT_DStream_unfinished) & (BIT_reloadDStreamFast(&bitD3) == BIT_DStream_unfinished)