riched20: Remove superflous casts.

This commit is contained in:
Michael Stefaniuc 2008-11-03 22:36:03 +01:00 committed by Alexandre Julliard
parent c9a10b32b4
commit 90024d03b2
4 changed files with 9 additions and 9 deletions

View File

@ -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';

View File

@ -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);

View File

@ -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));

View File

@ -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);