changeset 22000:f7c209352770

get rid of void pointer arithmetic, as spotted by ICC Original thread: date: Jan 25, 2007 5:01 PM subject: Re: [MPlayer-dev-eng] [PATCH] get rid of *void pointer arithemtic in libvo/fastmemcpy.h
author gpoirier
date Fri, 26 Jan 2007 09:07:55 +0000
parents fa7a341f967b
children 2934974c366a
files libvo/fastmemcpy.h
diffstat 1 files changed, 9 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/libvo/fastmemcpy.h	Thu Jan 25 18:06:21 2007 +0000
+++ b/libvo/fastmemcpy.h	Fri Jan 26 09:07:55 2007 +0000
@@ -7,6 +7,7 @@
 #if defined(HAVE_MMX) || defined(HAVE_MMX2) || defined(HAVE_3DNOW) \
 /*    || defined(HAVE_SSE) || defined(HAVE_SSE2) */
 #include <stddef.h>
+#include <inttypes.h>
 
 extern void * fast_memcpy(void * to, const void * from, size_t len);
 extern void * mem2agpcpy(void * to, const void * from, size_t len);
@@ -28,8 +29,8 @@
 	if(dstStride == srcStride)
 	{
 		if (srcStride < 0) {
-	    		src += (height-1)*srcStride;
-	    		dst += (height-1)*dstStride;
+	    		src = (uint8_t*)src + (height-1)*srcStride;
+	    		dst = (uint8_t*)dst + (height-1)*dstStride;
 	    		srcStride = -srcStride;
 		}
 
@@ -40,8 +41,8 @@
 		for(i=0; i<height; i++)
 		{
 			mem2agpcpy(dst, src, bytesPerLine);
-			src+= srcStride;
-			dst+= dstStride;
+			src = (uint8_t*)src + srcStride;
+			dst = (uint8_t*)dst + dstStride;
 		}
 	}
 
@@ -56,8 +57,8 @@
 	if(dstStride == srcStride)
 	{
 		if (srcStride < 0) {
-	    		src += (height-1)*srcStride;
-	    		dst += (height-1)*dstStride;
+	    		src = (uint8_t*)src + (height-1)*srcStride;
+	    		dst = (uint8_t*)dst + (height-1)*dstStride;
 	    		srcStride = -srcStride;
 		}
 
@@ -68,8 +69,8 @@
 		for(i=0; i<height; i++)
 		{
 			memcpy(dst, src, bytesPerLine);
-			src+= srcStride;
-			dst+= dstStride;
+			src = (uint8_t*)src + srcStride;
+			dst = (uint8_t*)dst + dstStride;
 		}
 	}