riched20: Sign-compare warnings fix.

This commit is contained in:
Andrew Talbot 2008-11-05 20:48:37 +00:00 committed by Alexandre Julliard
parent 609a3998f7
commit affc6e029c
3 changed files with 10 additions and 10 deletions

View File

@ -3203,7 +3203,7 @@ static LRESULT RichEditWndProc_common(HWND hWnd, UINT msg, WPARAM wParam,
if (unicode)
{
memcpy((LPWSTR)lParam, bufferW, wParam * sizeof(WCHAR));
if (lstrlenW(bufferW) >= wParam) rc = 0;
if (strlenW(bufferW) >= wParam) rc = 0;
}
else
{
@ -3338,7 +3338,7 @@ static LRESULT RichEditWndProc_common(HWND hWnd, UINT msg, WPARAM wParam,
{
if (run && (run->member.run.nFlags & MERF_ENDPARA))
{
unsigned int i;
int i;
/* Write as many \r as encoded in end-of-paragraph, space allowing */
for (i = 0; i < run->member.run.nCR && nCharsLeft > 0; i++, nCharsLeft--)
{
@ -4650,7 +4650,7 @@ BOOL ME_IsCandidateAnURL(ME_TextEditor *editor, int sel_min, int sel_max)
};
LPWSTR bufferW = NULL;
WCHAR bufW[32];
int i;
unsigned int i;
if (sel_max == -1) sel_max = ME_GetTextLength(editor);
assert(sel_min <= sel_max);
@ -4660,7 +4660,7 @@ BOOL ME_IsCandidateAnURL(ME_TextEditor *editor, int sel_min, int sel_max)
if (bufferW == NULL) {
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, lstrlenA(prefixes[i].text)), 0);
MultiByteToWideChar(CP_ACP, 0, prefixes[i].text, -1, bufW, 32);
if (!lstrcmpW(bufW, bufferW))
{

View File

@ -2326,7 +2326,7 @@ void LookupInit(void)
void LookupCleanup(void)
{
int i;
unsigned int i;
for (i=0; i<RTF_KEY_COUNT*2; i++)
{

View File

@ -201,7 +201,7 @@ ME_StreamOutRTFFontAndColorTbl(ME_OutStream *pStream, ME_DisplayItem *pFirstRun,
{
ME_DisplayItem *item = pFirstRun;
ME_FontTableItem *table = pStream->fonttbl;
int i;
unsigned int i;
ME_DisplayItem *pLastPara = ME_GetParagraph(pLastRun);
ME_DisplayItem *pCell = NULL;
@ -264,7 +264,7 @@ ME_StreamOutRTFFontAndColorTbl(ME_OutStream *pStream, ME_DisplayItem *pFirstRun,
{
if (borders[i]->width > 0)
{
int j;
unsigned int j;
COLORREF crColor = borders[i]->colorRef;
for (j = 1; j < pStream->nColorTblLen; j++)
if (pStream->colortbl[j] == crColor)
@ -348,7 +348,7 @@ ME_StreamOutRTFTableProps(ME_TextEditor *editor, ME_OutStream *pStream,
{
if (borders[i]->width)
{
int j;
unsigned int j;
COLORREF crColor = borders[i]->colorRef;
sprintf(props + strlen(props), "\\clbrdr%c", sideChar[i]);
sprintf(props + strlen(props), "\\brdrs");
@ -380,7 +380,7 @@ ME_StreamOutRTFTableProps(ME_TextEditor *editor, ME_OutStream *pStream,
{
if (borders[i]->width)
{
int j;
unsigned int j;
COLORREF crColor = borders[i]->colorRef;
sprintf(props + strlen(props), "\\trbrdr%c", sideChar[i]);
sprintf(props + strlen(props), "\\brdrs");
@ -555,7 +555,7 @@ static BOOL
ME_StreamOutRTFCharProps(ME_OutStream *pStream, CHARFORMAT2W *fmt)
{
char props[STREAMOUT_BUFFER_SIZE] = "";
int i;
unsigned int i;
if (fmt->dwMask & CFM_ALLCAPS && fmt->dwEffects & CFE_ALLCAPS)
strcat(props, "\\caps");