[DDraw] Add an assert to ease debugging

Lionel Ulmer lionel.ulmer at free.fr
Sun Oct 9 06:11:29 CDT 2005


As the function 'DD_STRUCT_COPY_BYSIZE' does not work properly when both
pointers are equal (case which should never happen anyway), add an assert to
be sure that this really never happens.

This can help tracing down strange bugs (like the one we got with
EnumAttachedSurfaces for which I just sent a patch).

Changelog:
 - add an assert if both arguments to DD_STRUCT_COPY_BYSIZE are equal

      Lionel

-- 
		 Lionel Ulmer - http://www.bbrox.org/
-------------- next part --------------
Index: dlls/ddraw/ddraw_private.h
===================================================================
RCS file: /home/wine/wine/dlls/ddraw/ddraw_private.h,v
retrieving revision 1.49
diff -u -r1.49 ddraw_private.h
--- dlls/ddraw/ddraw_private.h	24 Jul 2005 16:17:29 -0000	1.49
+++ dlls/ddraw/ddraw_private.h	9 Oct 2005 11:08:35 -0000
@@ -46,6 +46,7 @@
 	    	DWORD __size = (to)->dwSize;		\
 	    	DWORD __copysize = __size;		\
 	    	DWORD __resetsize = __size;		\
+		assert(to != from);                     \
 	        if (__resetsize > sizeof(*to))		\
 		    __resetsize = sizeof(*to);		\
 	    	memset(to,0,__resetsize);               \


More information about the wine-patches mailing list