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
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 */20 */
21 21
22#include "libavutil/avassert.h"
22#include "libavutil/channel_layout.h"23#include "libavutil/channel_layout.h"
23#include "avcodec.h"24#include "avcodec.h"
24#include "bytestream.h"25#include "bytestream.h"
@@ -45,7 +46,7 @@ static av_cold int pcm_dvd_encode_init(AVCodecContext *avctx) · 20 unmodified lines
45 freq = 1;46 freq = 1;
46 break;47 break;
47 default:48 default:
48 av_assert1(0);49 av_unreachable("Already checked via CODEC_SAMPLERATES");
49 }50 }
50 51
51 switch (avctx->sample_fmt) {52 switch (avctx->sample_fmt) {
@@ -58,7 +59,7 @@ static av_cold int pcm_dvd_encode_init(AVCodecContext *avctx) · 6 unmodified lines
58 quant = 2;59 quant = 2;
59 break;60 break;
60 default:61 default:
61 av_assert1(0);62 av_unreachable("Already checked via CODEC_SAMPLEFMTS");
62 }63 }
63 64
64 avctx->bits_per_coded_sample = 16 + quant * 4;65 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