From 86fd81fc07a8647c62a167496912fa5f707eecde Mon Sep 17 00:00:00 2001 From: Tzafrir Cohen Date: Thu, 21 Jan 2010 11:53:55 +0200 Subject: use explicit union instead of typedef --- drivers/staging/echo/fir.h | 16 ++++++++-------- drivers/staging/echo/mmx.h | 8 ++++---- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/drivers/staging/echo/fir.h b/drivers/staging/echo/fir.h index 007ac8a..092df08 100644 --- a/drivers/staging/echo/fir.h +++ b/drivers/staging/echo/fir.h @@ -152,14 +152,14 @@ static inline int16_t fir16(struct fir16_state_t *fir, int16_t sample) int32_t y; #if defined(USE_MMX) int i; - mmx_t *mmx_coeffs; - mmx_t *mmx_hist; + union mmx_t *mmx_coeffs; + union mmx_t *mmx_hist; fir->history[fir->curr_pos] = sample; fir->history[fir->curr_pos + fir->taps] = sample; - mmx_coeffs = (mmx_t *) fir->coeffs; - mmx_hist = (mmx_t *) & fir->history[fir->curr_pos]; + mmx_coeffs = (union mmx_t *) fir->coeffs; + mmx_hist = (union mmx_t *) & fir->history[fir->curr_pos]; i = fir->taps; pxor_r2r(mm4, mm4); /* 8 samples per iteration, so the filter must be a multiple of 8 long. */ @@ -183,14 +183,14 @@ static inline int16_t fir16(struct fir16_state_t *fir, int16_t sample) emms(); #elif defined(USE_SSE2) int i; - xmm_t *xmm_coeffs; - xmm_t *xmm_hist; + union xmm_t *xmm_coeffs; + union xmm_t *xmm_hist; fir->history[fir->curr_pos] = sample; fir->history[fir->curr_pos + fir->taps] = sample; - xmm_coeffs = (xmm_t *) fir->coeffs; - xmm_hist = (xmm_t *) & fir->history[fir->curr_pos]; + xmm_coeffs = (union xmm_t *) fir->coeffs; + xmm_hist = (union xmm_t *) & fir->history[fir->curr_pos]; i = fir->taps; pxor_r2r(xmm4, xmm4); /* 16 samples per iteration, so the filter must be a multiple of 16 long. */ diff --git a/drivers/staging/echo/mmx.h b/drivers/staging/echo/mmx.h index b5a3964..ffbf72b 100644 --- a/drivers/staging/echo/mmx.h +++ b/drivers/staging/echo/mmx.h @@ -27,7 +27,7 @@ * values by ULL, lest they be truncated by the compiler) */ -typedef union { +union mmx_t { long long q; /* Quadword (64-bit) value */ unsigned long long uq; /* Unsigned Quadword */ int d[2]; /* 2 Doubleword (32-bit) values */ @@ -37,12 +37,12 @@ typedef union { char b[8]; /* 8 Byte (8-bit) values */ unsigned char ub[8]; /* 8 Unsigned Byte */ float s[2]; /* Single-precision (32-bit) value */ -} mmx_t; /* On an 8-byte (64-bit) boundary */ +}; /* On an 8-byte (64-bit) boundary */ /* SSE registers */ -typedef union { +union xmm_t { char b[16]; -} xmm_t; +}; #define mmx_i2r(op,imm,reg) \ -- cgit v1.2.3