diff --git a/lib/legacy/zstd_v01.c b/lib/legacy/zstd_v01.c index ad3c9330e..29e875713 100644 --- a/lib/legacy/zstd_v01.c +++ b/lib/legacy/zstd_v01.c @@ -430,7 +430,7 @@ static unsigned FSE_isError(size_t code) { return (code > (size_t)(-FSE_ERROR_ma static short FSE_abs(short a) { - return a<0? -a : a; + return a<0? (short)-a : a; } diff --git a/lib/legacy/zstd_v03.c b/lib/legacy/zstd_v03.c index 7d82db666..50fa87cf3 100644 --- a/lib/legacy/zstd_v03.c +++ b/lib/legacy/zstd_v03.c @@ -1111,7 +1111,7 @@ static unsigned FSE_isError(size_t code) { return ERR_isError(code); } ****************************************************************/ static short FSE_abs(short a) { - return a<0 ? -a : a; + return a<0 ? (short)-a : a; } static size_t FSE_readNCount (short* normalizedCounter, unsigned* maxSVPtr, unsigned* tableLogPtr, diff --git a/lib/legacy/zstd_v04.c b/lib/legacy/zstd_v04.c index 0da316c15..31c205258 100644 --- a/lib/legacy/zstd_v04.c +++ b/lib/legacy/zstd_v04.c @@ -1094,7 +1094,7 @@ static unsigned FSE_isError(size_t code) { return ERR_isError(code); } ****************************************************************/ static short FSE_abs(short a) { - return a<0 ? -a : a; + return a<0 ? (short)-a : a; } static size_t FSE_readNCount (short* normalizedCounter, unsigned* maxSVPtr, unsigned* tableLogPtr, diff --git a/lib/legacy/zstd_v05.c b/lib/legacy/zstd_v05.c index 7a3af4214..e1efca597 100644 --- a/lib/legacy/zstd_v05.c +++ b/lib/legacy/zstd_v05.c @@ -1224,7 +1224,7 @@ const char* FSEv05_getErrorName(size_t code) { return ERR_getErrorName(code); } /*-************************************************************** * FSEv05 NCount encoding-decoding ****************************************************************/ -static short FSEv05_abs(short a) { return a<0 ? -a : a; } +static short FSEv05_abs(short a) { return a<0 ? (short)-a : a; } size_t FSEv05_readNCount (short* normalizedCounter, unsigned* maxSVPtr, unsigned* tableLogPtr, diff --git a/lib/legacy/zstd_v06.c b/lib/legacy/zstd_v06.c index 88a39e2a0..fb8c14df9 100644 --- a/lib/legacy/zstd_v06.c +++ b/lib/legacy/zstd_v06.c @@ -1202,7 +1202,7 @@ static unsigned HUFv06_isError(size_t code) { return ERR_isError(code); } /*-************************************************************** * FSE NCount encoding-decoding ****************************************************************/ -static short FSEv06_abs(short a) { return a<0 ? -a : a; } +static short FSEv06_abs(short a) { return a<0 ? (short)-a : a; } size_t FSEv06_readNCount (short* normalizedCounter, unsigned* maxSVPtr, unsigned* tableLogPtr, const void* headerBuffer, size_t hbSize)