[svn-commits] sruffell: branch linux/2.4 r9664 - /linux/branches/2.4/drivers/dahdi/

SVN commits to the Digium repositories svn-commits at lists.digium.com
Thu Jan 20 23:28:55 CST 2011


Author: sruffell
Date: Thu Jan 20 23:28:50 2011
New Revision: 9664

URL: http://svnview.digium.com/svn/dahdi?view=rev&rev=9664
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>

Origin: http://svnview.digium.com/svn/dahdi?view=rev&rev=9420

Modified:
    linux/branches/2.4/drivers/dahdi/dahdi-base.c
    linux/branches/2.4/drivers/dahdi/dahdi_echocan_kb1.c
    linux/branches/2.4/drivers/dahdi/dahdi_echocan_mg2.c

Modified: linux/branches/2.4/drivers/dahdi/dahdi-base.c
URL: http://svnview.digium.com/svn/dahdi/linux/branches/2.4/drivers/dahdi/dahdi-base.c?view=diff&rev=9664&r1=9663&r2=9664
==============================================================================
--- linux/branches/2.4/drivers/dahdi/dahdi-base.c (original)
+++ linux/branches/2.4/drivers/dahdi/dahdi-base.c Thu Jan 20 23:28:50 2011
@@ -3093,7 +3093,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));
@@ -3135,7 +3135,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/branches/2.4/drivers/dahdi/dahdi_echocan_kb1.c
URL: http://svnview.digium.com/svn/dahdi/linux/branches/2.4/drivers/dahdi/dahdi_echocan_kb1.c?view=diff&rev=9664&r1=9663&r2=9664
==============================================================================
--- linux/branches/2.4/drivers/dahdi/dahdi_echocan_kb1.c (original)
+++ linux/branches/2.4/drivers/dahdi/dahdi_echocan_kb1.c Thu Jan 20 23:28:50 2011
@@ -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/branches/2.4/drivers/dahdi/dahdi_echocan_mg2.c
URL: http://svnview.digium.com/svn/dahdi/linux/branches/2.4/drivers/dahdi/dahdi_echocan_mg2.c?view=diff&rev=9664&r1=9663&r2=9664
==============================================================================
--- linux/branches/2.4/drivers/dahdi/dahdi_echocan_mg2.c (original)
+++ linux/branches/2.4/drivers/dahdi/dahdi_echocan_mg2.c Thu Jan 20 23:28:50 2011
@@ -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