From: Yann Collet Date: Wed, 5 Dec 2018 00:59:26 +0000 (-0800) Subject: write the switch()case: differently X-Git-Tag: v1.3.8~33^2~9 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4b5a4f02d74d8492c5dc15133fab423290b96266;p=thirdparty%2Fzstd.git write the switch()case: differently so that it please both compilers which warn for dead code after the switch and compilers which do not detect that all branches terminate. --- diff --git a/lib/decompress/zstd_decompress.c b/lib/decompress/zstd_decompress.c index d2cd8a302..c4cd66c84 100644 --- a/lib/decompress/zstd_decompress.c +++ b/lib/decompress/zstd_decompress.c @@ -1269,11 +1269,8 @@ ZSTD_bounds ZSTD_dParam_getBounds(ZSTD_dParameter dParam) bounds.upperBound = (int)ZSTD_f_zstd1_magicless; ZSTD_STATIC_ASSERT(ZSTD_f_zstd1 < ZSTD_f_zstd1_magicless); return bounds; - default: - bounds.error = ERROR(parameter_unsupported); - return bounds; + default:; } - assert(0); bounds.error = ERROR(parameter_unsupported); return bounds; } @@ -1307,10 +1304,8 @@ size_t ZSTD_DCtx_setParameter(ZSTD_DCtx* dctx, ZSTD_dParameter dParam, int value CHECK_DBOUNDS(ZSTD_d_format, value); dctx->format = (ZSTD_format_e)value; return 0; - default: - return ERROR(parameter_unsupported); + default:; } - assert(0); /* should be unreachable */ return ERROR(parameter_unsupported); }