Remove four useless checks in dlls/gdi32/enhmetafile.c (RESEND)

Gerald Pfeifer gerald at pfeifer.com
Fri Nov 16 18:01:46 CST 2007


One of the really uncontested ones, I think. ;-)

---------- Forwarded message ----------
From: Gerald Pfeifer <gerald at pfeifer.com>
To:  <wine-patches at winehq.org>
Date: Thu, 1 Nov 2007 16:10:03 +0100 (CET)
Subject: Remove four useless checks in dlls/gdi32/enhmetafile.c

The members of EMRCREATEDIBPATTERNBRUSHPT are of type DWORD, so
comparing them for >= 0 is a noop which always evaluates to true.

Gerald

ChangeLog:
Remove four unnecessary comparisions of DWORD variables for >= 0.

Index: dlls/gdi32/enhmetafile.c
===================================================================
RCS file: /home/wine/wine/dlls/gdi32/enhmetafile.c,v
retrieving revision 1.6
diff -u -3 -p -r1.6 enhmetafile.c
--- dlls/gdi32/enhmetafile.c	3 Aug 2007 13:06:43 -0000	1.6
+++ dlls/gdi32/enhmetafile.c	1 Nov 2007 15:07:22 -0000
@@ -1670,9 +1670,7 @@ BOOL WINAPI PlayEnhMetaFileRecord(
         LPVOID lpPackedStruct;
 
         /* check that offsets and data are contained within the record */
-        if ( !( (lpCreate->cbBmi>=0) && (lpCreate->cbBits>=0) &&
-                (lpCreate->offBmi>=0) && (lpCreate->offBits>=0) &&
-                ((lpCreate->offBmi +lpCreate->cbBmi ) <= mr->nSize) &&
+        if ( !( ((lpCreate->offBmi +lpCreate->cbBmi ) <= mr->nSize) &&
                 ((lpCreate->offBits+lpCreate->cbBits) <= mr->nSize) ) )
         {
             ERR("Invalid EMR_CREATEDIBPATTERNBRUSHPT record\n");



More information about the wine-patches mailing list