From fa15494ab8638f0a9d2e7b160514b5062cccf715 Mon Sep 17 00:00:00 2001 From: Nils Wallménius Date: Sat, 17 Jul 2010 10:57:40 +0000 Subject: libwma: void pointer voodoo to get rid ov strict aliasing warnings git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27463 a1c6a512-1295-4272-9138-f99709370657 --- apps/codecs/libwma/wmadec.h | 4 ++-- apps/codecs/libwma/wmadeci.c | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) (limited to 'apps/codecs') diff --git a/apps/codecs/libwma/wmadec.h b/apps/codecs/libwma/wmadec.h index 1f08e653cf..ec295fa472 100644 --- a/apps/codecs/libwma/wmadec.h +++ b/apps/codecs/libwma/wmadec.h @@ -147,8 +147,8 @@ typedef struct WMADecodeContext fixed32 noise_mult; /* XXX: suppress that and integrate it in the noise array */ /* lsp_to_curve tables */ fixed32 lsp_cos_table[BLOCK_MAX_SIZE]; - fixed32 *lsp_pow_m_table1; - fixed32 *lsp_pow_m_table2; + void *lsp_pow_m_table1; + void *lsp_pow_m_table2; /* State of current superframe decoding */ int bit_offset; diff --git a/apps/codecs/libwma/wmadeci.c b/apps/codecs/libwma/wmadeci.c index 8172e33783..bd085080d8 100644 --- a/apps/codecs/libwma/wmadeci.c +++ b/apps/codecs/libwma/wmadeci.c @@ -587,8 +587,8 @@ static inline fixed32 pow_m1_4(WMADecodeContext *s, fixed32 x) m = (u.v >> (23 - LSP_POW_BITS)) & ((1 << LSP_POW_BITS) - 1); /* build interpolation scale: 1 <= t < 2. */ t.v = ((u.v << LSP_POW_BITS) & ((1 << 23) - 1)) | (127 << 23); - a = s->lsp_pow_m_table1[m]; - b = s->lsp_pow_m_table2[m]; + a = ((fixed32*)s->lsp_pow_m_table1)[m]; + b = ((fixed32*)s->lsp_pow_m_table2)[m]; /* lsp_pow_e_table contains 32.32 format */ /* TODO: Since we're unlikely have value that cover the whole @@ -617,16 +617,16 @@ static void wma_lsp_to_curve_init(WMADecodeContext *s, int frame_len) b = itofix32(1); int ix = 0; - s->lsp_pow_m_table1 = (fixed32*)&vlcbuf3[0]; - s->lsp_pow_m_table2 = (fixed32*)&vlcbuf3[VLCBUF3SIZE]; + s->lsp_pow_m_table1 = &vlcbuf3[0]; + s->lsp_pow_m_table2 = &vlcbuf3[VLCBUF3SIZE]; /*double check this later*/ for(i=(1 << LSP_POW_BITS) - 1;i>=0;i--) { m = (1 << LSP_POW_BITS) + i; a = pow_a_table[ix++]<<4; - s->lsp_pow_m_table1[i] = 2 * a - b; - s->lsp_pow_m_table2[i] = b - a; + ((fixed32*)s->lsp_pow_m_table1)[i] = 2 * a - b; + ((fixed32*)s->lsp_pow_m_table2)[i] = b - a; b = a; } -- cgit v1.2.3