[PATCH] decoder/speex: fix constness in debug mode

HG changeset patch

User “Yann E. MORIN” <@Yann_E_MORIN>

Date 1416250944 -3600

Mon Nov 17 20:02:24 2014 +0100

Node ID 2c38a5638b844eab5a034f0d7030bb38d324ae2b

Parent 719dade417459099778dd42fb62238503d60dbbd

decoder/speex: fix constness in debug mode

When in debug mode (–enable-debug), the speex decoder fails to
build, because of improper constness of the speex ‘mode’ pointer:

speex.c: In function ‘process_header’:
speex.c:140:10: error: assignment discards ‘const’ qualifier from pointer target type [-Werror]
mode = speex_mode_list[header.mode];

See one of the many full logs at (toward the end):

Fix that by properly setting the constness of the ‘mode’ pointer.

Signed-off-by: “Yann E. MORIN” <@Yann_E_MORIN>

diff --git a/decoders/speex.c b/decoders/speex.c
— a/decoders/speex.c
+++ b/decoders/speex.c
@@ -124,7 +124,7 @@

static int process_header(speex_t *speex, Sound_Sample *sample)

  • SpeexMode *mode;
  • const SpeexMode *mode;
    SpeexHeader *hptr;
    SpeexHeader header;
    int enh_enabled = SPEEX_USE_PERCEPTUAL_ENHANCER;