Michael Stefaniuc : riched20: Remove superflous casts.

Alexandre Julliard julliard at winehq.org
Tue Nov 4 07:29:15 CST 2008


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

Author: Michael Stefaniuc <mstefani at redhat.de>
Date:   Mon Nov  3 22:36:03 2008 +0100

riched20: Remove superflous casts.

---

 dlls/riched20/clipboard.c |    4 ++--
 dlls/riched20/editor.c    |   10 +++++-----
 dlls/riched20/para.c      |    2 +-
 dlls/riched20/string.c    |    2 +-
 4 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/dlls/riched20/clipboard.c b/dlls/riched20/clipboard.c
index ce986ed..b26222d 100644
--- a/dlls/riched20/clipboard.c
+++ b/dlls/riched20/clipboard.c
@@ -334,7 +334,7 @@ static HGLOBAL get_unicode_text(ME_TextEditor *editor, const CHARRANGE *lpchrg)
     pars = ME_CountParagraphsBetween(editor, lpchrg->cpMin, lpchrg->cpMax);
     len = lpchrg->cpMax-lpchrg->cpMin;
     ret = GlobalAlloc(GMEM_MOVEABLE, sizeof(WCHAR)*(len+pars+1));
-    data = (WCHAR *)GlobalLock(ret);
+    data = GlobalLock(ret);
     len = ME_GetTextW(editor, data, lpchrg->cpMin, len, TRUE);
     data[len] = 0;
     GlobalUnlock(ret);
@@ -359,7 +359,7 @@ static DWORD CALLBACK ME_AppendToHGLOBAL(DWORD_PTR dwCookie, LPBYTE lpBuff, LONG
         int nNewSize = (((nMaxSize+cb+1)|0x1FFFF)+1) & 0xFFFE0000;
         pData->hData = GlobalReAlloc(pData->hData, nNewSize, 0);
     }
-    pDest = (BYTE *)GlobalLock(pData->hData);
+    pDest = GlobalLock(pData->hData);
     memcpy(pDest + pData->nLength, lpBuff, cb);
     pData->nLength += cb;
     pDest[pData->nLength] = '\0';
diff --git a/dlls/riched20/editor.c b/dlls/riched20/editor.c
index ce754b9..29aa577 100644
--- a/dlls/riched20/editor.c
+++ b/dlls/riched20/editor.c
@@ -1952,7 +1952,7 @@ static DWORD CALLBACK ME_ReadFromHGLOBALUnicode(DWORD_PTR dwCookie, LPBYTE lpBuf
 
   cb = cb >> 1;
   pDest = (WORD *)lpBuff;
-  pSrc = (WORD *)GlobalLock(pData->hData);
+  pSrc = GlobalLock(pData->hData);
   for (i = 0; i<cb && pSrc[pData->nLength+i]; i++) {
     pDest[i] = pSrc[pData->nLength+i];
   }
@@ -1969,7 +1969,7 @@ static DWORD CALLBACK ME_ReadFromHGLOBALRTF(DWORD_PTR dwCookie, LPBYTE lpBuff, L
   BYTE *pSrc, *pDest;
 
   pDest = lpBuff;
-  pSrc = (BYTE *)GlobalLock(pData->hData);
+  pSrc = GlobalLock(pData->hData);
   for (i = 0; i<cb && pSrc[pData->nLength+i]; i++) {
     pDest[i] = pSrc[pData->nLength+i];
   }
@@ -4332,7 +4332,7 @@ static BOOL ME_RegisterEditorClass(HINSTANCE hInstance)
   wcW.hInstance = NULL; /* hInstance would register DLL-local class */
   wcW.hIcon = NULL;
   wcW.hCursor = LoadCursorW(NULL, MAKEINTRESOURCEW(IDC_IBEAM));
-  wcW.hbrBackground = (HBRUSH)GetStockObject(NULL_BRUSH);
+  wcW.hbrBackground = GetStockObject(NULL_BRUSH);
   wcW.lpszMenuName = NULL;
 
   if (is_version_nt())
@@ -4358,7 +4358,7 @@ static BOOL ME_RegisterEditorClass(HINSTANCE hInstance)
   wcA.hInstance = NULL; /* hInstance would register DLL-local class */
   wcA.hIcon = NULL;
   wcA.hCursor = LoadCursorW(NULL, MAKEINTRESOURCEW(IDC_IBEAM));
-  wcA.hbrBackground = (HBRUSH)GetStockObject(NULL_BRUSH);
+  wcA.hbrBackground = GetStockObject(NULL_BRUSH);
   wcA.lpszMenuName = NULL;
   wcA.lpszClassName = "RichEdit20A";
   if (!RegisterClassA(&wcA)) return FALSE;
@@ -4658,7 +4658,7 @@ BOOL ME_IsCandidateAnURL(ME_TextEditor *editor, int sel_min, int sel_max)
   {
     if (sel_max - sel_min < prefixes[i].length) continue;
     if (bufferW == NULL) {
-      bufferW = (LPWSTR)heap_alloc((sel_max - sel_min + 1) * sizeof(WCHAR));
+      bufferW = heap_alloc((sel_max - sel_min + 1) * sizeof(WCHAR));
     }
     ME_GetTextW(editor, bufferW, sel_min, min(sel_max - sel_min, strlen(prefixes[i].text)), 0);
     MultiByteToWideChar(CP_ACP, 0, prefixes[i].text, -1, bufW, 32);
diff --git a/dlls/riched20/para.c b/dlls/riched20/para.c
index 565e323..9cf4d97 100644
--- a/dlls/riched20/para.c
+++ b/dlls/riched20/para.c
@@ -38,7 +38,7 @@ void ME_MakeFirstParagraph(ME_TextEditor *editor)
 
   ME_InitContext(&c, editor, GetDC(editor->hWnd));
 
-  hf = (HFONT)GetStockObject(SYSTEM_FONT);
+  hf = GetStockObject(SYSTEM_FONT);
   assert(hf);
   GetObjectW(hf, sizeof(LOGFONTW), &lf);
   ZeroMemory(&cf, sizeof(cf));
diff --git a/dlls/riched20/string.c b/dlls/riched20/string.c
index 7da521c..4a5d590 100644
--- a/dlls/riched20/string.c
+++ b/dlls/riched20/string.c
@@ -342,7 +342,7 @@ ME_CallWordBreakProc(ME_TextEditor *editor, ME_String *str, INT start, INT code)
     int result;
     int buffer_size = WideCharToMultiByte(CP_ACP, 0, str->szData, str->nLen,
                                           NULL, 0, NULL, NULL);
-    char *buffer = (char*)heap_alloc(buffer_size);
+    char *buffer = heap_alloc(buffer_size);
     WideCharToMultiByte(CP_ACP, 0, str->szData, str->nLen,
                         buffer, buffer_size, NULL, NULL);
     result = editor->pfnWordBreak(str->szData, start, str->nLen, code);




More information about the wine-cvs mailing list