Andrew Talbot : riched20: Sign-compare warnings fix.
Alexandre Julliard
julliard at winehq.org
Thu Nov 6 08:25:58 CST 2008
Module: wine
Branch: master
Commit: affc6e029c793bd1f204793b6476dc77c17c1c5a
URL: http://source.winehq.org/git/wine.git/?a=commit;h=affc6e029c793bd1f204793b6476dc77c17c1c5a
Author: Andrew Talbot <andrew.talbot at talbotville.com>
Date: Wed Nov 5 20:48:37 2008 +0000
riched20: Sign-compare warnings fix.
---
dlls/riched20/editor.c | 8 ++++----
dlls/riched20/reader.c | 2 +-
dlls/riched20/writer.c | 10 +++++-----
3 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/dlls/riched20/editor.c b/dlls/riched20/editor.c
index 29aa577..2e44663 100644
--- a/dlls/riched20/editor.c
+++ b/dlls/riched20/editor.c
@@ -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))
{
diff --git a/dlls/riched20/reader.c b/dlls/riched20/reader.c
index 7ad9d81..0e0d9a0 100644
--- a/dlls/riched20/reader.c
+++ b/dlls/riched20/reader.c
@@ -2326,7 +2326,7 @@ void LookupInit(void)
void LookupCleanup(void)
{
- int i;
+ unsigned int i;
for (i=0; i<RTF_KEY_COUNT*2; i++)
{
diff --git a/dlls/riched20/writer.c b/dlls/riched20/writer.c
index 109ada1..98bb9d3 100644
--- a/dlls/riched20/writer.c
+++ b/dlls/riched20/writer.c
@@ -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");
More information about the wine-cvs
mailing list