=?UTF-8?Q?Fr=C3=A9d=C3=A9ric=20Delanoy=20?=: riched20: Use BOOL type where appropriate.
Alexandre Julliard
julliard at winehq.org
Wed Mar 19 14:46:56 CDT 2014
Module: wine
Branch: master
Commit: 5f88ba5b616ddc47c31c089f6a1ef2ad28db1505
URL: http://source.winehq.org/git/wine.git/?a=commit;h=5f88ba5b616ddc47c31c089f6a1ef2ad28db1505
Author: Frédéric Delanoy <frederic.delanoy at gmail.com>
Date: Wed Mar 19 09:14:53 2014 +0100
riched20: Use BOOL type where appropriate.
---
dlls/riched20/caret.c | 13 ++++++-------
dlls/riched20/editor.c | 10 +++++-----
dlls/riched20/reader.c | 16 ++++++++--------
dlls/riched20/rtf.h | 2 +-
4 files changed, 20 insertions(+), 21 deletions(-)
diff --git a/dlls/riched20/caret.c b/dlls/riched20/caret.c
index e510033..90b30a2 100644
--- a/dlls/riched20/caret.c
+++ b/dlls/riched20/caret.c
@@ -904,7 +904,7 @@ static ME_DisplayItem* ME_FindPixelPosInTableRow(int x, int y,
}
static BOOL ME_FindRunInRow(ME_TextEditor *editor, ME_DisplayItem *pRow,
- int x, ME_Cursor *cursor, int *pbCaretAtEnd)
+ int x, ME_Cursor *cursor, BOOL *pbCaretAtEnd)
{
ME_DisplayItem *pNext, *pLastRun;
ME_Row *row = &pRow->member.row;
@@ -964,7 +964,7 @@ static BOOL ME_FindPixelPos(ME_TextEditor *editor, int x, int y,
y -= editor->rcFormat.top;
if (is_eol)
- *is_eol = 0;
+ *is_eol = FALSE;
/* find paragraph */
for (; p != editor->pBuffer->pLast; p = p->member.para.next_para)
@@ -1109,8 +1109,7 @@ static void ME_ExtendAnchorSelection(ME_TextEditor *editor)
void ME_LButtonDown(ME_TextEditor *editor, int x, int y, int clickNum)
{
ME_Cursor tmp_cursor;
- int is_selection = 0;
- BOOL is_shift;
+ BOOL is_selection = FALSE, is_shift;
editor->nUDArrowX = -1;
@@ -1535,14 +1534,14 @@ ME_ArrowKey(ME_TextEditor *editor, int nVKey, BOOL extend, BOOL ctrl)
ME_CheckCharOffsets(editor);
switch(nVKey) {
case VK_LEFT:
- editor->bCaretAtEnd = 0;
+ editor->bCaretAtEnd = FALSE;
if (ctrl)
success = ME_MoveCursorWords(editor, &tmp_curs, -1);
else
success = ME_MoveCursorChars(editor, &tmp_curs, -1);
break;
case VK_RIGHT:
- editor->bCaretAtEnd = 0;
+ editor->bCaretAtEnd = FALSE;
if (ctrl)
success = ME_MoveCursorWords(editor, &tmp_curs, +1);
else
@@ -1565,7 +1564,7 @@ ME_ArrowKey(ME_TextEditor *editor, int nVKey, BOOL extend, BOOL ctrl)
ME_ArrowCtrlHome(editor, &tmp_curs);
else
ME_ArrowHome(editor, &tmp_curs);
- editor->bCaretAtEnd = 0;
+ editor->bCaretAtEnd = FALSE;
break;
}
case VK_END:
diff --git a/dlls/riched20/editor.c b/dlls/riched20/editor.c
index e419bf6..d38d28e 100644
--- a/dlls/riched20/editor.c
+++ b/dlls/riched20/editor.c
@@ -1633,7 +1633,7 @@ static LRESULT ME_StreamIn(ME_TextEditor *editor, DWORD format, EDITSTREAM *stre
ME_Cursor linebreakCursor = *selEnd;
ME_MoveCursorChars(editor, &linebreakCursor, -linebreakSize);
- ME_GetTextW(editor, lastchar, 2, &linebreakCursor, linebreakSize, 0);
+ ME_GetTextW(editor, lastchar, 2, &linebreakCursor, linebreakSize, FALSE);
if (lastchar[0] == '\r' && (lastchar[1] == '\n' || lastchar[1] == '\0')) {
ME_InternalDeleteText(editor, &linebreakCursor, linebreakSize, FALSE);
}
@@ -2003,12 +2003,12 @@ static int ME_GetTextRange(ME_TextEditor *editor, WCHAR *strText,
{
if (!strText) return 0;
if (unicode) {
- return ME_GetTextW(editor, strText, INT_MAX, start, nLen, 0);
+ return ME_GetTextW(editor, strText, INT_MAX, start, nLen, FALSE);
} else {
int nChars;
WCHAR *p = ALLOC_N_OBJ(WCHAR, nLen+1);
if (!p) return 0;
- nChars = ME_GetTextW(editor, p, nLen, start, nLen, 0);
+ nChars = ME_GetTextW(editor, p, nLen, start, nLen, FALSE);
WideCharToMultiByte(CP_ACP, 0, p, nChars+1, (char *)strText,
nLen+1, NULL, NULL);
FREE_OBJ(p);
@@ -4702,7 +4702,7 @@ int ME_GetTextW(ME_TextEditor *editor, WCHAR *buffer, int buflen,
int nLen;
/* bCRLF flag is only honored in 2.0 and up. 1.0 must always return text verbatim */
- if (editor->bEmulateVersion10) bCRLF = 0;
+ if (editor->bEmulateVersion10) bCRLF = FALSE;
pRun = start->pRun;
assert(pRun);
@@ -4987,7 +4987,7 @@ static BOOL ME_IsCandidateAnURL(ME_TextEditor *editor, const ME_Cursor *start, i
WCHAR bufferW[MAX_PREFIX_LEN + 1];
unsigned int i;
- ME_GetTextW(editor, bufferW, MAX_PREFIX_LEN, start, nChars, 0);
+ ME_GetTextW(editor, bufferW, MAX_PREFIX_LEN, start, nChars, FALSE);
for (i = 0; i < sizeof(prefixes) / sizeof(*prefixes); i++)
{
if (nChars < prefixes[i].length) continue;
diff --git a/dlls/riched20/reader.c b/dlls/riched20/reader.c
index f7459ab..09b711a 100644
--- a/dlls/riched20/reader.c
+++ b/dlls/riched20/reader.c
@@ -256,7 +256,7 @@ void RTFInit(RTF_Info *info)
info->rtfLineNum = 0;
info->rtfLinePos = 0;
info->prevChar = EOF;
- info->bumpLine = 0;
+ info->bumpLine = FALSE;
info->dwCPOutputCount = 0;
if (!info->cpOutputBuffer)
@@ -722,7 +722,7 @@ static void _RTFGetToken2(RTF_Info *info)
static int GetChar(RTF_Info *info)
{
int c;
- int oldBumpLine;
+ BOOL oldBumpLine;
if ((c = _RTFGetChar(info)) != EOF)
{
@@ -730,16 +730,16 @@ static int GetChar(RTF_Info *info)
info->rtfTextBuf[info->rtfTextLen] = '\0';
}
if (info->prevChar == EOF)
- info->bumpLine = 1;
- oldBumpLine = info->bumpLine; /* non-zero if prev char was line ending */
- info->bumpLine = 0;
+ info->bumpLine = TRUE;
+ oldBumpLine = info->bumpLine; /* TRUE if prev char was line ending */
+ info->bumpLine = FALSE;
if (c == '\r')
- info->bumpLine = 1;
+ info->bumpLine = TRUE;
else if (c == '\n')
{
- info->bumpLine = 1;
+ info->bumpLine = TRUE;
if (info->prevChar == '\r') /* oops, previous \r wasn't */
- oldBumpLine = 0; /* really a line ending */
+ oldBumpLine = FALSE; /* really a line ending */
}
++info->rtfLinePos;
if (oldBumpLine) /* were we supposed to increment the */
diff --git a/dlls/riched20/rtf.h b/dlls/riched20/rtf.h
index 9f3822f..064ba60 100644
--- a/dlls/riched20/rtf.h
+++ b/dlls/riched20/rtf.h
@@ -1139,7 +1139,7 @@ struct _RTF_Info {
char *pushedTextBuf;
int prevChar;
- int bumpLine;
+ BOOL bumpLine;
/* Document-wide attributes */
RTFFont *fontList; /* these lists MUST be */
More information about the wine-cvs
mailing list