diff options
Diffstat (limited to 'apps/codecs/libmad/synth.c')
-rw-r--r-- | apps/codecs/libmad/synth.c | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/apps/codecs/libmad/synth.c b/apps/codecs/libmad/synth.c index 2da8f64db7..8f535ec62a 100644 --- a/apps/codecs/libmad/synth.c +++ b/apps/codecs/libmad/synth.c | |||
@@ -30,6 +30,20 @@ | |||
30 | # include "synth.h" | 30 | # include "synth.h" |
31 | 31 | ||
32 | /* | 32 | /* |
33 | * This is a slightly painful workaround to silence a warning that happens | ||
34 | * with 4.1 if the const is used and with <= 4.0 if the const is not used. | ||
35 | * So in a bright future when we are >= 4.1 only we can remove this kludge | ||
36 | * again. | ||
37 | */ | ||
38 | #if ((__GNUC__ < 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ < 1))) | ||
39 | /* before gcc 4.1 */ | ||
40 | #define CONST_TO_CONST_STRUCT_FIELD const | ||
41 | #else | ||
42 | /* after and including gcc 4.1 */ | ||
43 | #define CONST_TO_CONST_STRUCT_FIELD | ||
44 | #endif | ||
45 | |||
46 | /* | ||
33 | * NAME: synth->init() | 47 | * NAME: synth->init() |
34 | * DESCRIPTION: initialize synth struct | 48 | * DESCRIPTION: initialize synth struct |
35 | */ | 49 | */ |
@@ -825,7 +839,7 @@ void synth_full(struct mad_synth *synth, struct mad_frame const *frame, | |||
825 | int p; | 839 | int p; |
826 | unsigned int phase, ch, s, sb; | 840 | unsigned int phase, ch, s, sb; |
827 | mad_fixed_t *pcm, (*filter)[2][2][16][8]; | 841 | mad_fixed_t *pcm, (*filter)[2][2][16][8]; |
828 | mad_fixed_t const (*sbsample)[36][32]; | 842 | mad_fixed_t CONST_TO_CONST_STRUCT_FIELD (*sbsample)[36][32]; |
829 | mad_fixed_t (*fe)[8], (*fx)[8], (*fo)[8]; | 843 | mad_fixed_t (*fe)[8], (*fx)[8], (*fo)[8]; |
830 | mad_fixed_t const (*D0ptr)[32], *ptr; | 844 | mad_fixed_t const (*D0ptr)[32], *ptr; |
831 | mad_fixed_t const (*D1ptr)[32]; | 845 | mad_fixed_t const (*D1ptr)[32]; |
@@ -1033,7 +1047,7 @@ void synth_half(struct mad_synth *synth, struct mad_frame const *frame, | |||
1033 | { | 1047 | { |
1034 | unsigned int phase, ch, s, sb, pe, po; | 1048 | unsigned int phase, ch, s, sb, pe, po; |
1035 | mad_fixed_t *pcm1, *pcm2, (*filter)[2][2][16][8]; | 1049 | mad_fixed_t *pcm1, *pcm2, (*filter)[2][2][16][8]; |
1036 | mad_fixed_t const (*sbsample)[36][32]; | 1050 | mad_fixed_t CONST_TO_CONST_STRUCT_FIELD (*sbsample)[36][32]; |
1037 | register mad_fixed_t (*fe)[8], (*fx)[8], (*fo)[8]; | 1051 | register mad_fixed_t (*fe)[8], (*fx)[8], (*fo)[8]; |
1038 | register mad_fixed_t const (*Dptr)[32], *ptr; | 1052 | register mad_fixed_t const (*Dptr)[32], *ptr; |
1039 | register mad_fixed64hi_t hi; | 1053 | register mad_fixed64hi_t hi; |