riched20: Remove superflous casts.
This commit is contained in:
parent
c9a10b32b4
commit
90024d03b2
|
@ -334,7 +334,7 @@ static HGLOBAL get_unicode_text(ME_TextEditor *editor, const CHARRANGE *lpchrg)
|
||||||
pars = ME_CountParagraphsBetween(editor, lpchrg->cpMin, lpchrg->cpMax);
|
pars = ME_CountParagraphsBetween(editor, lpchrg->cpMin, lpchrg->cpMax);
|
||||||
len = lpchrg->cpMax-lpchrg->cpMin;
|
len = lpchrg->cpMax-lpchrg->cpMin;
|
||||||
ret = GlobalAlloc(GMEM_MOVEABLE, sizeof(WCHAR)*(len+pars+1));
|
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);
|
len = ME_GetTextW(editor, data, lpchrg->cpMin, len, TRUE);
|
||||||
data[len] = 0;
|
data[len] = 0;
|
||||||
GlobalUnlock(ret);
|
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;
|
int nNewSize = (((nMaxSize+cb+1)|0x1FFFF)+1) & 0xFFFE0000;
|
||||||
pData->hData = GlobalReAlloc(pData->hData, nNewSize, 0);
|
pData->hData = GlobalReAlloc(pData->hData, nNewSize, 0);
|
||||||
}
|
}
|
||||||
pDest = (BYTE *)GlobalLock(pData->hData);
|
pDest = GlobalLock(pData->hData);
|
||||||
memcpy(pDest + pData->nLength, lpBuff, cb);
|
memcpy(pDest + pData->nLength, lpBuff, cb);
|
||||||
pData->nLength += cb;
|
pData->nLength += cb;
|
||||||
pDest[pData->nLength] = '\0';
|
pDest[pData->nLength] = '\0';
|
||||||
|
|
|
@ -1952,7 +1952,7 @@ static DWORD CALLBACK ME_ReadFromHGLOBALUnicode(DWORD_PTR dwCookie, LPBYTE lpBuf
|
||||||
|
|
||||||
cb = cb >> 1;
|
cb = cb >> 1;
|
||||||
pDest = (WORD *)lpBuff;
|
pDest = (WORD *)lpBuff;
|
||||||
pSrc = (WORD *)GlobalLock(pData->hData);
|
pSrc = GlobalLock(pData->hData);
|
||||||
for (i = 0; i<cb && pSrc[pData->nLength+i]; i++) {
|
for (i = 0; i<cb && pSrc[pData->nLength+i]; i++) {
|
||||||
pDest[i] = pSrc[pData->nLength+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;
|
BYTE *pSrc, *pDest;
|
||||||
|
|
||||||
pDest = lpBuff;
|
pDest = lpBuff;
|
||||||
pSrc = (BYTE *)GlobalLock(pData->hData);
|
pSrc = GlobalLock(pData->hData);
|
||||||
for (i = 0; i<cb && pSrc[pData->nLength+i]; i++) {
|
for (i = 0; i<cb && pSrc[pData->nLength+i]; i++) {
|
||||||
pDest[i] = pSrc[pData->nLength+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.hInstance = NULL; /* hInstance would register DLL-local class */
|
||||||
wcW.hIcon = NULL;
|
wcW.hIcon = NULL;
|
||||||
wcW.hCursor = LoadCursorW(NULL, MAKEINTRESOURCEW(IDC_IBEAM));
|
wcW.hCursor = LoadCursorW(NULL, MAKEINTRESOURCEW(IDC_IBEAM));
|
||||||
wcW.hbrBackground = (HBRUSH)GetStockObject(NULL_BRUSH);
|
wcW.hbrBackground = GetStockObject(NULL_BRUSH);
|
||||||
wcW.lpszMenuName = NULL;
|
wcW.lpszMenuName = NULL;
|
||||||
|
|
||||||
if (is_version_nt())
|
if (is_version_nt())
|
||||||
|
@ -4358,7 +4358,7 @@ static BOOL ME_RegisterEditorClass(HINSTANCE hInstance)
|
||||||
wcA.hInstance = NULL; /* hInstance would register DLL-local class */
|
wcA.hInstance = NULL; /* hInstance would register DLL-local class */
|
||||||
wcA.hIcon = NULL;
|
wcA.hIcon = NULL;
|
||||||
wcA.hCursor = LoadCursorW(NULL, MAKEINTRESOURCEW(IDC_IBEAM));
|
wcA.hCursor = LoadCursorW(NULL, MAKEINTRESOURCEW(IDC_IBEAM));
|
||||||
wcA.hbrBackground = (HBRUSH)GetStockObject(NULL_BRUSH);
|
wcA.hbrBackground = GetStockObject(NULL_BRUSH);
|
||||||
wcA.lpszMenuName = NULL;
|
wcA.lpszMenuName = NULL;
|
||||||
wcA.lpszClassName = "RichEdit20A";
|
wcA.lpszClassName = "RichEdit20A";
|
||||||
if (!RegisterClassA(&wcA)) return FALSE;
|
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 (sel_max - sel_min < prefixes[i].length) continue;
|
||||||
if (bufferW == NULL) {
|
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);
|
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);
|
MultiByteToWideChar(CP_ACP, 0, prefixes[i].text, -1, bufW, 32);
|
||||||
|
|
|
@ -38,7 +38,7 @@ void ME_MakeFirstParagraph(ME_TextEditor *editor)
|
||||||
|
|
||||||
ME_InitContext(&c, editor, GetDC(editor->hWnd));
|
ME_InitContext(&c, editor, GetDC(editor->hWnd));
|
||||||
|
|
||||||
hf = (HFONT)GetStockObject(SYSTEM_FONT);
|
hf = GetStockObject(SYSTEM_FONT);
|
||||||
assert(hf);
|
assert(hf);
|
||||||
GetObjectW(hf, sizeof(LOGFONTW), &lf);
|
GetObjectW(hf, sizeof(LOGFONTW), &lf);
|
||||||
ZeroMemory(&cf, sizeof(cf));
|
ZeroMemory(&cf, sizeof(cf));
|
||||||
|
|
|
@ -342,7 +342,7 @@ ME_CallWordBreakProc(ME_TextEditor *editor, ME_String *str, INT start, INT code)
|
||||||
int result;
|
int result;
|
||||||
int buffer_size = WideCharToMultiByte(CP_ACP, 0, str->szData, str->nLen,
|
int buffer_size = WideCharToMultiByte(CP_ACP, 0, str->szData, str->nLen,
|
||||||
NULL, 0, NULL, NULL);
|
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,
|
WideCharToMultiByte(CP_ACP, 0, str->szData, str->nLen,
|
||||||
buffer, buffer_size, NULL, NULL);
|
buffer, buffer_size, NULL, NULL);
|
||||||
result = editor->pfnWordBreak(str->szData, start, str->nLen, code);
|
result = editor->pfnWordBreak(str->szData, start, str->nLen, code);
|
||||||
|
|
Loading…
Reference in New Issue