[svn-commits] sruffell: linux/trunk r9420 - /linux/trunk/drivers/dahdi/
SVN commits to the Digium repositories
svn-commits at lists.digium.com
Wed Sep 29 16:33:00 CDT 2010
Author: sruffell
Date: Wed Sep 29 16:32:55 2010
New Revision: 9420
URL: http://svnview.digium.com/svn/dahdi?view=rev&rev=9420
Log:
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 at digium.com>
Signed-off-by: Shaun Ruffell <sruffell at digium.com>
Modified:
linux/trunk/drivers/dahdi/dahdi-base.c
linux/trunk/drivers/dahdi/dahdi_echocan_kb1.c
linux/trunk/drivers/dahdi/dahdi_echocan_mg2.c
Modified: linux/trunk/drivers/dahdi/dahdi-base.c
URL: http://svnview.digium.com/svn/dahdi/linux/trunk/drivers/dahdi/dahdi-base.c?view=diff&rev=9420&r1=9419&r2=9420
==============================================================================
--- linux/trunk/drivers/dahdi/dahdi-base.c (original)
+++ linux/trunk/drivers/dahdi/dahdi-base.c Wed Sep 29 16:32:55 2010
@@ -3067,7 +3067,7 @@
return -ENOMEM;
}
- ptr += sizeof(*z);
+ ptr = (char *) ptr + sizeof(*z);
space -= sizeof(*z);
dahdi_copy_string(z->name, work->th.name, sizeof(z->name));
@@ -3109,7 +3109,7 @@
t = work->samples[x] = ptr;
space -= sizeof(*t);
- ptr += sizeof(*t);
+ ptr = (char *) ptr + sizeof(*t);
/* Remember which sample is work->next */
work->next[x] = work->td.next;
Modified: linux/trunk/drivers/dahdi/dahdi_echocan_kb1.c
URL: http://svnview.digium.com/svn/dahdi/linux/trunk/drivers/dahdi/dahdi_echocan_kb1.c?view=diff&rev=9420&r1=9419&r2=9420
==============================================================================
--- linux/trunk/drivers/dahdi/dahdi_echocan_kb1.c (original)
+++ linux/trunk/drivers/dahdi/dahdi_echocan_kb1.c Wed Sep 29 16:32:55 2010
@@ -266,7 +266,7 @@
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;
/* Double-word align past end of state */
@@ -281,9 +281,9 @@
pvt->beta2_i = DEFAULT_BETA1_I;
/* Allocate coefficient memory */
- pvt->a_i = ptr;
+ pvt->a_i = (int *) ptr;
ptr += (sizeof(int) * pvt->N_d);
- pvt->a_s = ptr;
+ pvt->a_s = (short *) ptr;
ptr += (sizeof(short) * pvt->N_d);
/* Reset Y circular buffer (short version) */
Modified: linux/trunk/drivers/dahdi/dahdi_echocan_mg2.c
URL: http://svnview.digium.com/svn/dahdi/linux/trunk/drivers/dahdi/dahdi_echocan_mg2.c?view=diff&rev=9420&r1=9419&r2=9420
==============================================================================
--- linux/trunk/drivers/dahdi/dahdi_echocan_mg2.c (original)
+++ linux/trunk/drivers/dahdi/dahdi_echocan_mg2.c Wed Sep 29 16:32:55 2010
@@ -307,7 +307,7 @@
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;
/* Double-word align past end of state */
@@ -322,15 +322,15 @@
pvt->beta2_i = DEFAULT_BETA1_I;
/* Allocate coefficient memory */
- pvt->a_i = ptr;
+ pvt->a_i = (int *) ptr;
ptr += (sizeof(int) * pvt->N_d);
- pvt->a_s = ptr;
+ pvt->a_s = (short *) ptr;
ptr += (sizeof(short) * pvt->N_d);
/* Allocate backup memory */
- pvt->b_i = ptr;
+ pvt->b_i = (int *) ptr;
ptr += (sizeof(int) * pvt->N_d);
- pvt->c_i = ptr;
+ pvt->c_i = (int *) ptr;
ptr += (sizeof(int) * pvt->N_d);
/* Reset Y circular buffer (short version) */
@@ -387,7 +387,7 @@
}
#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);
return samp - (*dc_estimate >> 15);
More information about the svn-commits
mailing list