Michael Stefaniuc : gdi32: Remove some superfluous casts.

Alexandre Julliard julliard at winehq.org
Tue Nov 25 07:21:35 CST 2008


Module: wine
Branch: master
Commit: ec1c9492b07474aedfa8aa51d7953c10c8ab3d63
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=ec1c9492b07474aedfa8aa51d7953c10c8ab3d63

Author: Michael Stefaniuc <mstefani at redhat.de>
Date:   Tue Nov 25 10:14:23 2008 +0100

gdi32: Remove some superfluous casts.

---

 dlls/gdi32/brush.c        |    4 ++--
 dlls/gdi32/gdi16.c        |    6 +++---
 dlls/gdi32/metafile16.c   |    4 ++--
 dlls/gdi32/printdrv16.c   |    2 +-
 dlls/gdi32/tests/bitmap.c |    4 ++--
 5 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/dlls/gdi32/brush.c b/dlls/gdi32/brush.c
index 1f81c00..f7920df 100644
--- a/dlls/gdi32/brush.c
+++ b/dlls/gdi32/brush.c
@@ -73,7 +73,7 @@ static HGLOBAL16 dib_copy(const BITMAPINFO *info, UINT coloruse)
     {
         return 0;
     }
-    newInfo = (BITMAPINFO *) GlobalLock16( hmem );
+    newInfo = GlobalLock16( hmem );
     memcpy( newInfo, info, size );
     GlobalUnlock16( hmem );
     return hmem;
@@ -134,7 +134,7 @@ HBRUSH WINAPI CreateBrushIndirect( const LOGBRUSH * brush )
             HGLOBAL h = (HGLOBAL)ptr->logbrush.lbHatch;
 
             ptr->logbrush.lbStyle = BS_DIBPATTERN;
-            if (!(bmi = (BITMAPINFO *)GlobalLock( h ))) goto error;
+            if (!(bmi = GlobalLock( h ))) goto error;
             ptr->logbrush.lbHatch = dib_copy( bmi, ptr->logbrush.lbColor);
             GlobalUnlock( h );
             if (!ptr->logbrush.lbHatch) goto error;
diff --git a/dlls/gdi32/gdi16.c b/dlls/gdi32/gdi16.c
index 31c0ffc..a1bbe1c 100644
--- a/dlls/gdi32/gdi16.c
+++ b/dlls/gdi32/gdi16.c
@@ -752,7 +752,7 @@ INT16 WINAPI Escape16( HDC16 hdc, INT16 escape, INT16 in_count, SEGPTR in_data,
     case DRAWPATTERNRECT:
     {
         DRAWPATRECT pr;
-        DRAWPATRECT16 *pr16 = (DRAWPATRECT16*)MapSL(in_data);
+        DRAWPATRECT16 *pr16 = MapSL(in_data);
 
         pr.ptPosition.x = pr16->ptPosition.x;
         pr.ptPosition.y = pr16->ptPosition.y;
@@ -1770,9 +1770,9 @@ void WINAPI PlayMetaFileRecord16( HDC16 hdc, HANDLETABLE16 *ht, METARECORD *mr,
     HANDLETABLE *ht32 = HeapAlloc( GetProcessHeap(), 0, handles * sizeof(*ht32) );
     unsigned int i;
 
-    for (i = 0; i < handles; i++) ht32->objectHandle[i] = (HGDIOBJ)(ULONG_PTR)ht->objectHandle[i];
+    for (i = 0; i < handles; i++) ht32->objectHandle[i] = HGDIOBJ_32(ht->objectHandle[i]);
     PlayMetaFileRecord( HDC_32(hdc), ht32, mr, handles );
-    for (i = 0; i < handles; i++) ht->objectHandle[i] = LOWORD(ht32->objectHandle[i]);
+    for (i = 0; i < handles; i++) ht->objectHandle[i] = HGDIOBJ_16(ht32->objectHandle[i]);
     HeapFree( GetProcessHeap(), 0, ht32 );
 }
 
diff --git a/dlls/gdi32/metafile16.c b/dlls/gdi32/metafile16.c
index 9da9325..a8e8ca6 100644
--- a/dlls/gdi32/metafile16.c
+++ b/dlls/gdi32/metafile16.c
@@ -244,7 +244,7 @@ BOOL16 WINAPI EnumMetaFile16( HDC16 hdc16, HMETAFILE16 hmf,
     SelectObject(hdc, hPen);
     SelectObject(hdc, hFont);
 
-    ht = (HANDLETABLE16 *)GlobalLock16(hHT);
+    ht = GlobalLock16(hHT);
 
     /* free objects in handle table */
     for(i = 0; i < mh->mtNoObjects; i++)
@@ -309,5 +309,5 @@ HMETAFILE16 WINAPI SetMetaFileBitsBetter16( HMETAFILE16 hMeta )
 {
     if( IsValidMetaFile16( hMeta ) )
         return GlobalReAlloc16( hMeta, 0, GMEM_SHARE | GMEM_NODISCARD | GMEM_MODIFY);
-    return (HMETAFILE16)0;
+    return 0;
 }
diff --git a/dlls/gdi32/printdrv16.c b/dlls/gdi32/printdrv16.c
index bcf2065..03043c1 100644
--- a/dlls/gdi32/printdrv16.c
+++ b/dlls/gdi32/printdrv16.c
@@ -357,7 +357,7 @@ static int CreateSpoolFile(LPCSTR pszOutput)
             signal( SIGPIPE, SIG_DFL );
             signal( SIGCHLD, SIG_DFL );
 
-            execl("/bin/sh", "/bin/sh", "-c", psCmdP, (char*)0);
+            execl("/bin/sh", "/bin/sh", "-c", psCmdP, NULL);
             _exit(1);
 
         }
diff --git a/dlls/gdi32/tests/bitmap.c b/dlls/gdi32/tests/bitmap.c
index 0b41f19..a47dc38 100644
--- a/dlls/gdi32/tests/bitmap.c
+++ b/dlls/gdi32/tests/bitmap.c
@@ -2212,11 +2212,11 @@ static void test_clipping(void)
 
     bmpDst = CreateDIBSection( hdcDst, &bmpinfo, DIB_RGB_COLORS, &bits, NULL, 0 );
     ok(bmpDst != NULL, "Couldn't create destination bitmap\n");
-    oldDst = (HBITMAP)SelectObject( hdcDst, bmpDst );
+    oldDst = SelectObject( hdcDst, bmpDst );
 
     bmpSrc = CreateDIBSection( hdcSrc, &bmpinfo, DIB_RGB_COLORS, &bits, NULL, 0 );
     ok(bmpSrc != NULL, "Couldn't create source bitmap\n");
-    oldSrc = (HBITMAP)SelectObject( hdcSrc, bmpSrc );
+    oldSrc = SelectObject( hdcSrc, bmpSrc );
 
     result = BitBlt( hdcDst, 0, 0, 100, 100, hdcSrc, 100, 100, SRCCOPY );
     ok(result, "BitBlt failed\n");




More information about the wine-cvs mailing list