Michael Stefaniuc : winex11.drv: Remove superfluous pointer casts.

Alexandre Julliard julliard at winehq.org
Mon Jan 19 08:58:31 CST 2009


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

Author: Michael Stefaniuc <mstefani at redhat.de>
Date:   Mon Jan 19 10:23:40 2009 +0100

winex11.drv: Remove superfluous pointer casts.

---

 dlls/winex11.drv/dib.c      |    8 ++++----
 dlls/winex11.drv/ime.c      |    2 +-
 dlls/winex11.drv/init.c     |    2 +-
 dlls/winex11.drv/opengl.c   |   14 +++++++-------
 dlls/winex11.drv/x11ddraw.c |    4 ++--
 dlls/winex11.drv/xdnd.c     |    6 +++---
 dlls/winex11.drv/xfont.c    |    2 +-
 dlls/winex11.drv/xim.c      |    4 ++--
 dlls/winex11.drv/xrender.c  |    2 +-
 9 files changed, 22 insertions(+), 22 deletions(-)

diff --git a/dlls/winex11.drv/dib.c b/dlls/winex11.drv/dib.c
index 6a0b5c1..4af4336 100644
--- a/dlls/winex11.drv/dib.c
+++ b/dlls/winex11.drv/dib.c
@@ -352,7 +352,7 @@ static int *X11DRV_DIB_GenColorMap( X11DRV_PDEVICE *physDev, int *colorMapping,
     {
         if (quads)
         {
-            const RGBQUAD * rgb = (const RGBQUAD *)colorPtr;
+            const RGBQUAD * rgb = colorPtr;
 
             if (depth == 1)  /* Monochrome */
             {
@@ -376,7 +376,7 @@ static int *X11DRV_DIB_GenColorMap( X11DRV_PDEVICE *physDev, int *colorMapping,
         }
         else
         {
-            const RGBTRIPLE * rgb = (const RGBTRIPLE *)colorPtr;
+            const RGBTRIPLE * rgb = colorPtr;
 
             if (depth == 1)  /* Monochrome */
             {
@@ -401,7 +401,7 @@ static int *X11DRV_DIB_GenColorMap( X11DRV_PDEVICE *physDev, int *colorMapping,
     }
     else  /* DIB_PAL_COLORS */
     {
-        const WORD * index = (const WORD *)colorPtr;
+        const WORD * index = colorPtr;
 
         for (i = start; i < end; i++, index++)
             colorMapping[i] = X11DRV_PALETTE_ToPhysical( physDev, PALETTEINDEX(*index) );
@@ -4102,7 +4102,7 @@ INT CDECL X11DRV_GetDIBits( X11DRV_PDEVICE *physDev, HBITMAP hbitmap, UINT start
               int num_colors = 1 << descr.infoBpp, i;
               RGBQUAD *rgb;
               COLORREF colref;
-              WORD *index = (WORD*)colorPtr;
+              WORD *index = colorPtr;
               descr.colorMap = rgb = HeapAlloc(GetProcessHeap(), 0, num_colors * sizeof(RGBQUAD));
               for(i = 0; i < num_colors; i++, rgb++, index++) {
                   colref = X11DRV_PALETTE_ToLogical(X11DRV_PALETTE_ToPhysical(physDev, PALETTEINDEX(*index)));
diff --git a/dlls/winex11.drv/ime.c b/dlls/winex11.drv/ime.c
index 6ca3f9e..87d4faa 100644
--- a/dlls/winex11.drv/ime.c
+++ b/dlls/winex11.drv/ime.c
@@ -109,7 +109,7 @@ static LPINPUTCONTEXT LockRealIMC(HIMC hIMC)
 {
     HIMC real_imc = RealIMC(hIMC);
     if (real_imc)
-        return (LPINPUTCONTEXT)ImmLockIMC(real_imc);
+        return ImmLockIMC(real_imc);
     else
         return NULL;
 }
diff --git a/dlls/winex11.drv/init.c b/dlls/winex11.drv/init.c
index 8b7aca0..480486f 100644
--- a/dlls/winex11.drv/init.c
+++ b/dlls/winex11.drv/init.c
@@ -334,7 +334,7 @@ INT CDECL X11DRV_ExtEscape( X11DRV_PDEVICE *physDev, INT escape, INT in_count, L
             case X11DRV_SET_DRAWABLE:
                 if (in_count >= sizeof(struct x11drv_escape_set_drawable))
                 {
-                    const struct x11drv_escape_set_drawable *data = (const struct x11drv_escape_set_drawable *)in_data;
+                    const struct x11drv_escape_set_drawable *data = in_data;
                     if(physDev->xrender) X11DRV_XRender_UpdateDrawable( physDev );
                     physDev->dc_rect = data->dc_rect;
                     physDev->drawable = data->drawable;
diff --git a/dlls/winex11.drv/opengl.c b/dlls/winex11.drv/opengl.c
index 5d34fad..2aa5afa 100644
--- a/dlls/winex11.drv/opengl.c
+++ b/dlls/winex11.drv/opengl.c
@@ -1923,7 +1923,7 @@ static BOOL internal_wglUseFontBitmaps(HDC hdc, DWORD first, DWORD count, DWORD
          if (GetGlyphOutline_ptr(hdc, glyph, GGO_BITMAP, &gm, size, bitmap, NULL) == GDI_ERROR) goto error;
          if (TRACE_ON(wgl)) {
              unsigned int height, width, bitmask;
-             unsigned char *bitmap_ = (unsigned char *) bitmap;
+             unsigned char *bitmap_ = bitmap;
 
              TRACE("  - bbox : %d x %d\n", gm.gmBlackBoxX, gm.gmBlackBoxY);
              TRACE("  - origin : (%d , %d)\n", gm.gmptGlyphOrigin.x, gm.gmptGlyphOrigin.y);
@@ -2374,7 +2374,7 @@ create_failed:
  */
 static GLboolean WINAPI X11DRV_wglDestroyPbufferARB(HPBUFFERARB hPbuffer)
 {
-    Wine_GLPBuffer* object = (Wine_GLPBuffer*) hPbuffer;
+    Wine_GLPBuffer* object = hPbuffer;
     TRACE("(%p)\n", hPbuffer);
     if (NULL == object) {
         SetLastError(ERROR_INVALID_HANDLE);
@@ -2397,7 +2397,7 @@ static GLboolean WINAPI X11DRV_wglDestroyPbufferARB(HPBUFFERARB hPbuffer)
  */
 HDC CDECL X11DRV_wglGetPbufferDCARB(X11DRV_PDEVICE *physDev, HPBUFFERARB hPbuffer)
 {
-    Wine_GLPBuffer* object = (Wine_GLPBuffer*) hPbuffer;
+    Wine_GLPBuffer* object = hPbuffer;
     if (NULL == object) {
         SetLastError(ERROR_INVALID_HANDLE);
         return NULL;
@@ -2421,7 +2421,7 @@ HDC CDECL X11DRV_wglGetPbufferDCARB(X11DRV_PDEVICE *physDev, HPBUFFERARB hPbuffe
  */
 static GLboolean WINAPI X11DRV_wglQueryPbufferARB(HPBUFFERARB hPbuffer, int iAttribute, int *piValue)
 {
-    Wine_GLPBuffer* object = (Wine_GLPBuffer*) hPbuffer;
+    Wine_GLPBuffer* object = hPbuffer;
     TRACE("(%p, 0x%x, %p)\n", hPbuffer, iAttribute, piValue);
     if (NULL == object) {
         SetLastError(ERROR_INVALID_HANDLE);
@@ -2564,7 +2564,7 @@ static int WINAPI X11DRV_wglReleasePbufferDCARB(HPBUFFERARB hPbuffer, HDC hdc)
  */
 static GLboolean WINAPI X11DRV_wglSetPbufferAttribARB(HPBUFFERARB hPbuffer, const int *piAttribList)
 {
-    Wine_GLPBuffer* object = (Wine_GLPBuffer*) hPbuffer;
+    Wine_GLPBuffer* object = hPbuffer;
     GLboolean ret = GL_FALSE;
 
     WARN("(%p, %p): alpha-testing, report any problem\n", hPbuffer, piAttribList);
@@ -2956,7 +2956,7 @@ static GLboolean WINAPI X11DRV_wglGetPixelFormatAttribfvARB(HDC hdc, int iPixelF
  */
 static GLboolean WINAPI X11DRV_wglBindTexImageARB(HPBUFFERARB hPbuffer, int iBuffer)
 {
-    Wine_GLPBuffer* object = (Wine_GLPBuffer*) hPbuffer;
+    Wine_GLPBuffer* object = hPbuffer;
     GLboolean ret = GL_FALSE;
 
     TRACE("(%p, %d)\n", hPbuffer, iBuffer);
@@ -3051,7 +3051,7 @@ static GLboolean WINAPI X11DRV_wglBindTexImageARB(HPBUFFERARB hPbuffer, int iBuf
  */
 static GLboolean WINAPI X11DRV_wglReleaseTexImageARB(HPBUFFERARB hPbuffer, int iBuffer)
 {
-    Wine_GLPBuffer* object = (Wine_GLPBuffer*) hPbuffer;
+    Wine_GLPBuffer* object = hPbuffer;
     GLboolean ret = GL_FALSE;
 
     TRACE("(%p, %d)\n", hPbuffer, iBuffer);
diff --git a/dlls/winex11.drv/x11ddraw.c b/dlls/winex11.drv/x11ddraw.c
index 223659f..ae5e865 100644
--- a/dlls/winex11.drv/x11ddraw.c
+++ b/dlls/winex11.drv/x11ddraw.c
@@ -375,7 +375,7 @@ INT X11DRV_DCICommand(INT cbInput, const DCICMD *lpCmd, LPVOID lpOutData)
     return TRUE;
   case DDVERSIONINFO:
     {
-      LPDDVERSIONDATA lpVer = (LPDDVERSIONDATA)lpOutData;
+      LPDDVERSIONDATA lpVer = lpOutData;
       ddraw_ver = lpCmd->dwParam1;
       if (!lpVer) break;
       /* well, whatever... the DDK says so */
@@ -396,7 +396,7 @@ INT X11DRV_DCICommand(INT cbInput, const DCICMD *lpCmd, LPVOID lpOutData)
     return TRUE;
   case DDCREATEDRIVEROBJECT:
     {
-      LPDWORD lpInstance = (LPDWORD)lpOutData;
+      LPDWORD lpInstance = lpOutData;
 
       /* FIXME: get x11drv's hInstance */
       X11DRV_Settings_CreateDriver(&hal_info);
diff --git a/dlls/winex11.drv/xdnd.c b/dlls/winex11.drv/xdnd.c
index 1422578..954284f 100644
--- a/dlls/winex11.drv/xdnd.c
+++ b/dlls/winex11.drv/xdnd.c
@@ -355,7 +355,7 @@ static int X11DRV_XDND_MapFormat(unsigned int property, unsigned char *data, int
  */
 static int X11DRV_XDND_DeconstructTextURIList(int property, void* data, int len)
 {
-    char *uriList = (char*) data;
+    char *uriList = data;
     char *uri;
     WCHAR *path;
 
@@ -444,7 +444,7 @@ static int X11DRV_XDND_DeconstructTextPlain(int property, void* data, int len)
     char* dostext;
 
     /* Always supply plain text */
-    X11DRV_XDND_UnixToDos(&dostext, (char*)data, len);
+    X11DRV_XDND_UnixToDos(&dostext, data, len);
     X11DRV_XDND_InsertXDNDData(property, CF_TEXT, dostext, strlen(dostext));
 
     TRACE("CF_TEXT (%d): %s\n", CF_TEXT, dostext);
@@ -494,7 +494,7 @@ static void X11DRV_XDND_SendDropFiles(HWND hwnd)
 
     if (current != NULL)
     {
-        DROPFILES *lpDrop = (DROPFILES*) current->data;
+        DROPFILES *lpDrop = current->data;
 
         if (lpDrop)
         {
diff --git a/dlls/winex11.drv/xfont.c b/dlls/winex11.drv/xfont.c
index 16d7406..16409c5 100644
--- a/dlls/winex11.drv/xfont.c
+++ b/dlls/winex11.drv/xfont.c
@@ -421,7 +421,7 @@ static UINT16   __lfCheckSum( const LOGFONT16 *plf )
 static UINT16   __genericCheckSum( const void *ptr, int size )
 {
    unsigned int checksum = 0;
-   const char *p = (const char *)ptr;
+   const char *p = ptr;
    while (size-- > 0)
      checksum ^= (checksum << 3) + (checksum >> 29) + *p++;
 
diff --git a/dlls/winex11.drv/xim.c b/dlls/winex11.drv/xim.c
index 7c3c9d1..5c30d5b 100644
--- a/dlls/winex11.drv/xim.c
+++ b/dlls/winex11.drv/xim.c
@@ -154,7 +154,7 @@ static BOOL X11DRV_ImmSetInternalString(DWORD dwIndex, DWORD dwOffset,
             }
         }
 
-        rc = IME_SetCompositionString(SCS_SETSTR, (LPWSTR)CompositionString,
+        rc = IME_SetCompositionString(SCS_SETSTR, CompositionString,
                                       dwCompStringLength, NULL, 0);
     }
     else if ((dwIndex == GCS_RESULTSTR) && (lpComp) && (dwCompLen))
@@ -165,7 +165,7 @@ static BOOL X11DRV_ImmSetInternalString(DWORD dwIndex, DWORD dwOffset,
         ResultString= HeapAlloc(GetProcessHeap(),0,byte_length);
         memcpy(ResultString,lpComp,byte_length);
 
-        rc = IME_SetCompositionString(SCS_SETSTR, (LPWSTR)ResultString,
+        rc = IME_SetCompositionString(SCS_SETSTR, ResultString,
                                      dwResultStringSize, NULL, 0);
 
         IME_NotifyIME( NI_COMPOSITIONSTR, CPS_COMPLETE, 0);
diff --git a/dlls/winex11.drv/xrender.c b/dlls/winex11.drv/xrender.c
index 596d9f0..fd405be 100644
--- a/dlls/winex11.drv/xrender.c
+++ b/dlls/winex11.drv/xrender.c
@@ -1081,7 +1081,7 @@ static void SmoothGlyphGray(XImage *image, int x, int y, void *bitmap, XGlyphInf
     width = gi->width;
     height = gi->height;
 
-    maskLine = (unsigned char *) bitmap;
+    maskLine = bitmap;
     maskStride = (width + 3) & ~3;
 
     ExamineBitfield (image->red_mask, &r_shift, &r_len);




More information about the wine-cvs mailing list