History

avcodec/pcm-dvdenc: Mark unreachable default cases as unreachable

Fixes a Clang warning when asserts are disabled: "variable 'quant' is used uninitialized whenever switch default is taken [-Wsometimes-uninitialized]"

Andreas Rheinhardt committed 5 years ago

Commit fc520cc1 parent 7a273571 file · +3 −2Browse files

Unified · Split

libavcodec/pcm-dvdenc.c+3−2
@@ -19,6 +19,7 @@ · 18 unmodified lines
1919 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
2020 */
2121
22+#include "libavutil/avassert.h"
2223 #include "libavutil/channel_layout.h"
2324 #include "avcodec.h"
2425 #include "bytestream.h"
@@ -45,7 +46,7 @@ static av_cold int pcm_dvd_encode_init(AVCodecContext *avctx) · 20 unmodified lines
4546 freq = 1;
4647 break;
4748 default:
48− av_assert1(0);
49+ av_unreachable("Already checked via CODEC_SAMPLERATES");
4950 }
5051
5152 switch (avctx->sample_fmt) {
@@ -58,7 +59,7 @@ static av_cold int pcm_dvd_encode_init(AVCodecContext *avctx) · 6 unmodified lines
5859 quant = 2;
5960 break;
6061 default:
61− av_assert1(0);
62+ av_unreachable("Already checked via CODEC_SAMPLEFMTS");
6263 }
6364
6465 avctx->bits_per_coded_sample = 16 + quant * 4;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t