[PATCH 7/9] glx: warning fixes

Daniel Stone daniel at fooishbar.org
Thu Dec 30 18:00:35 PST 2010


From: Adam Jackson <ajax at redhat.com>

render2.c: In function ‘__glXDisp_Map2d’:
render2.c:127: warning: ‘u1’ may be used uninitialized in this function
render2.c: In function ‘__glXDisp_Map1d’:
render2.c:90: warning: ‘u1’ may be used uninitialized in this function

Signed-off-by: Adam Jackson <ajax at redhat.com>
Reviewed-by: Daniel Stone <daniel at fooishbar.org>
---
 glx/unpack.h             |    2 +-
 hw/dmx/glxProxy/unpack.h |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

v2: Took Keith's advice and changed memcpy to memmove, as well as the DMX
    glxproxy equivalent; turns out every single user was doing overlapping
    memcpys. -daniels

diff --git a/glx/unpack.h b/glx/unpack.h
index a4e6d7e..738e79d 100644
--- a/glx/unpack.h
+++ b/glx/unpack.h
@@ -47,7 +47,7 @@
 ** Fetch a double from potentially unaligned memory.
 */
 #ifdef __GLX_ALIGN64
-#define __GLX_MEM_COPY(dst,src,n)	if (src != NULL && dst != NULL) memcpy(dst,src,n)
+#define __GLX_MEM_COPY(dst,src,n)	memmove(dst,src,n)
 #define __GLX_GET_DOUBLE(dst,src)	__GLX_MEM_COPY(&dst,src,8)
 #else
 #define __GLX_GET_DOUBLE(dst,src)	(dst) = *((GLdouble*)(src))
diff --git a/hw/dmx/glxProxy/unpack.h b/hw/dmx/glxProxy/unpack.h
index f34b6fd..f4a9572 100644
--- a/hw/dmx/glxProxy/unpack.h
+++ b/hw/dmx/glxProxy/unpack.h
@@ -43,7 +43,7 @@
 ** Fetch a double from potentially unaligned memory.
 */
 #ifdef __GLX_ALIGN64
-#define __GLX_MEM_COPY(dst,src,n)	memcpy(dst,src,n)
+#define __GLX_MEM_COPY(dst,src,n)	memmove(dst,src,n)
 #define __GLX_GET_DOUBLE(dst,src)	__GLX_MEM_COPY(&dst,src,8)
 #else
 #define __GLX_GET_DOUBLE(dst,src)	(dst) = *((GLdouble*)(src))
-- 
1.7.2.3



More information about the xorg-devel mailing list