Remove four useless checks in dlls/gdi32/enhmetafile.c
Gerald Pfeifer
gerald at pfeifer.com
Thu Nov 1 10:10:03 CDT 2007
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