dahdi: Fix 'void *' pointer arithmetic warnings.

(closes issue #15927)
Reported by: Max Khon
Patches:
      dahdi_echocan2.diff uploaded by Max Khon (license 884)
      void2.diff uploaded by Max Khon (license 884)

Signed-off-by: Kinsey Moore <kmoore@digium.com>
Signed-off-by: Shaun Ruffell <sruffell@digium.com>

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9420 a0bf4364-ded3-4de4-8d8a-66a801d63aff
This commit is contained in:
Kinsey Moore 2010-09-29 21:32:55 +00:00 committed by Shaun Ruffell
parent d802a2738d
commit b0185d1e84
3 changed files with 11 additions and 11 deletions

View File

@ -3067,7 +3067,7 @@ static int ioctl_load_zone(unsigned long data)
return -ENOMEM; return -ENOMEM;
} }
ptr += sizeof(*z); ptr = (char *) ptr + sizeof(*z);
space -= sizeof(*z); space -= sizeof(*z);
dahdi_copy_string(z->name, work->th.name, sizeof(z->name)); dahdi_copy_string(z->name, work->th.name, sizeof(z->name));
@ -3109,7 +3109,7 @@ static int ioctl_load_zone(unsigned long data)
t = work->samples[x] = ptr; t = work->samples[x] = ptr;
space -= sizeof(*t); space -= sizeof(*t);
ptr += sizeof(*t); ptr = (char *) ptr + sizeof(*t);
/* Remember which sample is work->next */ /* Remember which sample is work->next */
work->next[x] = work->td.next; work->next[x] = work->td.next;

View File

@ -266,7 +266,7 @@ static inline short get_cc_s(echo_can_cb_s *cb, int pos)
static inline void init_cc(struct ec_pvt *pvt, int N, int maxy, int maxu) static inline void init_cc(struct ec_pvt *pvt, int N, int maxy, int maxu)
{ {
void *ptr = pvt; char *ptr = (char *) pvt;
unsigned long tmp; unsigned long tmp;
/* Double-word align past end of state */ /* Double-word align past end of state */
@ -281,9 +281,9 @@ static inline void init_cc(struct ec_pvt *pvt, int N, int maxy, int maxu)
pvt->beta2_i = DEFAULT_BETA1_I; pvt->beta2_i = DEFAULT_BETA1_I;
/* Allocate coefficient memory */ /* Allocate coefficient memory */
pvt->a_i = ptr; pvt->a_i = (int *) ptr;
ptr += (sizeof(int) * pvt->N_d); ptr += (sizeof(int) * pvt->N_d);
pvt->a_s = ptr; pvt->a_s = (short *) ptr;
ptr += (sizeof(short) * pvt->N_d); ptr += (sizeof(short) * pvt->N_d);
/* Reset Y circular buffer (short version) */ /* Reset Y circular buffer (short version) */

View File

@ -307,7 +307,7 @@ static inline short get_cc_s(echo_can_cb_s *cb, int pos)
static inline void init_cc(struct ec_pvt *pvt, int N, int maxy, int maxu) static inline void init_cc(struct ec_pvt *pvt, int N, int maxy, int maxu)
{ {
void *ptr = pvt; char *ptr = (char *) pvt;
unsigned long tmp; unsigned long tmp;
/* Double-word align past end of state */ /* Double-word align past end of state */
@ -322,15 +322,15 @@ static inline void init_cc(struct ec_pvt *pvt, int N, int maxy, int maxu)
pvt->beta2_i = DEFAULT_BETA1_I; pvt->beta2_i = DEFAULT_BETA1_I;
/* Allocate coefficient memory */ /* Allocate coefficient memory */
pvt->a_i = ptr; pvt->a_i = (int *) ptr;
ptr += (sizeof(int) * pvt->N_d); ptr += (sizeof(int) * pvt->N_d);
pvt->a_s = ptr; pvt->a_s = (short *) ptr;
ptr += (sizeof(short) * pvt->N_d); ptr += (sizeof(short) * pvt->N_d);
/* Allocate backup memory */ /* Allocate backup memory */
pvt->b_i = ptr; pvt->b_i = (int *) ptr;
ptr += (sizeof(int) * pvt->N_d); ptr += (sizeof(int) * pvt->N_d);
pvt->c_i = ptr; pvt->c_i = (int *) ptr;
ptr += (sizeof(int) * pvt->N_d); ptr += (sizeof(int) * pvt->N_d);
/* Reset Y circular buffer (short version) */ /* Reset Y circular buffer (short version) */
@ -387,7 +387,7 @@ static void echo_can_free(struct dahdi_chan *chan, struct dahdi_echocan_state *e
} }
#ifdef DC_NORMALIZE #ifdef DC_NORMALIZE
short inline dc_removal(int *dc_estimate, short samp) static inline short dc_removal(int *dc_estimate, short samp)
{ {
*dc_estimate += ((((int)samp << 15) - *dc_estimate) >> 9); *dc_estimate += ((((int)samp << 15) - *dc_estimate) >> 9);
return samp - (*dc_estimate >> 15); return samp - (*dc_estimate >> 15);