Module: wine Branch: master Commit: ed93ed9a08f6281e62439e3c826cb3875a1b336e URL: http://source.winehq.org/git/wine.git/?a=commit;h=ed93ed9a08f6281e62439e3c82...
Author: Andrew Talbot andrew.talbot@talbotville.com Date: Mon Aug 13 22:41:55 2007 +0100
riched20: Constify some variables.
---
dlls/riched20/editor.h | 16 ++++++++-------- dlls/riched20/paint.c | 6 +++--- dlls/riched20/para.c | 14 +++++++------- 3 files changed, 18 insertions(+), 18 deletions(-)
diff --git a/dlls/riched20/editor.h b/dlls/riched20/editor.h index 09083ce..ef8c9cd 100644 --- a/dlls/riched20/editor.h +++ b/dlls/riched20/editor.h @@ -226,24 +226,24 @@ void ME_MakeFirstParagraph(HDC hDC, ME_TextBuffer *editor); ME_DisplayItem *ME_SplitParagraph(ME_TextEditor *editor, ME_DisplayItem *rp, ME_Style *style); ME_DisplayItem *ME_JoinParagraphs(ME_TextEditor *editor, ME_DisplayItem *tp); void ME_DumpParaStyle(ME_Paragraph *s); -void ME_DumpParaStyleToBuf(PARAFORMAT2 *pFmt, char buf[2048]); -void ME_SetParaFormat(ME_TextEditor *editor, ME_DisplayItem *para, PARAFORMAT2 *pFmt); -void ME_SetSelectionParaFormat(ME_TextEditor *editor, PARAFORMAT2 *pFmt); -void ME_GetParaFormat(ME_TextEditor *editor, ME_DisplayItem *para, PARAFORMAT2 *pFmt); +void ME_DumpParaStyleToBuf(const PARAFORMAT2 *pFmt, char buf[2048]); +void ME_SetParaFormat(ME_TextEditor *editor, ME_DisplayItem *para, const PARAFORMAT2 *pFmt); +void ME_SetSelectionParaFormat(ME_TextEditor *editor, const PARAFORMAT2 *pFmt); +void ME_GetParaFormat(ME_TextEditor *editor, const ME_DisplayItem *para, PARAFORMAT2 *pFmt); void ME_GetSelectionParaFormat(ME_TextEditor *editor, PARAFORMAT2 *pFmt); /* marks from first up to (but not including) last */ -void ME_MarkForWrapping(ME_TextEditor *editor, ME_DisplayItem *first, ME_DisplayItem *last); -void ME_MarkForPainting(ME_TextEditor *editor, ME_DisplayItem *first, ME_DisplayItem *last); +void ME_MarkForWrapping(ME_TextEditor *editor, ME_DisplayItem *first, const ME_DisplayItem *last); +void ME_MarkForPainting(ME_TextEditor *editor, ME_DisplayItem *first, const ME_DisplayItem *last); void ME_MarkAllForWrapping(ME_TextEditor *editor);
/* paint.c */ -void ME_PaintContent(ME_TextEditor *editor, HDC hDC, BOOL bOnlyNew, RECT *rcUpdate); +void ME_PaintContent(ME_TextEditor *editor, HDC hDC, BOOL bOnlyNew, const RECT *rcUpdate); void ME_Repaint(ME_TextEditor *editor); void ME_RewrapRepaint(ME_TextEditor *editor); void ME_UpdateRepaint(ME_TextEditor *editor); void ME_DrawParagraph(ME_Context *c, ME_DisplayItem *paragraph); void ME_EnsureVisible(ME_TextEditor *editor, ME_DisplayItem *pRun); -COLORREF ME_GetBackColor(ME_TextEditor *editor); +COLORREF ME_GetBackColor(const ME_TextEditor *editor); void ME_InvalidateSelection(ME_TextEditor *editor); void ME_QueueInvalidateFromCursor(ME_TextEditor *editor, int nCursor); BOOL ME_SetZoom(ME_TextEditor *editor, int numerator, int denominator); diff --git a/dlls/riched20/paint.c b/dlls/riched20/paint.c index 63a0c4c..676543e 100644 --- a/dlls/riched20/paint.c +++ b/dlls/riched20/paint.c @@ -23,7 +23,7 @@
WINE_DEFAULT_DEBUG_CHANNEL(richedit);
-void ME_PaintContent(ME_TextEditor *editor, HDC hDC, BOOL bOnlyNew, RECT *rcUpdate) { +void ME_PaintContent(ME_TextEditor *editor, HDC hDC, BOOL bOnlyNew, const RECT *rcUpdate) { ME_DisplayItem *item; ME_Context c; int yoffset; @@ -196,7 +196,7 @@ static void ME_DrawTextWithStyle(ME_Context *c, int x, int y, LPCWSTR szText, in ME_UnselectStyleFont(c->editor, hDC, s, hOldFont); }
-static void ME_DebugWrite(HDC hDC, POINT *pt, WCHAR *szText) { +static void ME_DebugWrite(HDC hDC, const POINT *pt, LPCWSTR szText) { int align = SetTextAlign(hDC, TA_LEFT|TA_TOP); HGDIOBJ hFont = SelectObject(hDC, GetStockObject(DEFAULT_GUI_FONT)); COLORREF color = SetTextColor(hDC, RGB(128,128,128)); @@ -276,7 +276,7 @@ static void ME_DrawRun(ME_Context *c, int x, int y, ME_DisplayItem *rundi, ME_Pa } }
-COLORREF ME_GetBackColor(ME_TextEditor *editor) +COLORREF ME_GetBackColor(const ME_TextEditor *editor) { /* Looks like I was seriously confused return GetSysColor((GetWindowLong(editor->hWnd, GWL_STYLE) & ES_READONLY) ? COLOR_3DFACE: COLOR_WINDOW); diff --git a/dlls/riched20/para.c b/dlls/riched20/para.c index 1774957..a1f6261 100644 --- a/dlls/riched20/para.c +++ b/dlls/riched20/para.c @@ -83,7 +83,7 @@ void ME_MarkAllForWrapping(ME_TextEditor *editor) ME_MarkForWrapping(editor, editor->pBuffer->pFirst->member.para.next_para, editor->pBuffer->pLast); }
-void ME_MarkForWrapping(ME_TextEditor *editor, ME_DisplayItem *first, ME_DisplayItem *last) +void ME_MarkForWrapping(ME_TextEditor *editor, ME_DisplayItem *first, const ME_DisplayItem *last) { while(first != last) { @@ -92,7 +92,7 @@ void ME_MarkForWrapping(ME_TextEditor *editor, ME_DisplayItem *first, ME_Display } }
-void ME_MarkForPainting(ME_TextEditor *editor, ME_DisplayItem *first, ME_DisplayItem *last) +void ME_MarkForPainting(ME_TextEditor *editor, ME_DisplayItem *first, const ME_DisplayItem *last) { while(first != last) { @@ -277,12 +277,12 @@ ME_DisplayItem *ME_GetParagraph(ME_DisplayItem *item) { return ME_FindItemBackOrHere(item, diParagraph); }
-static void ME_DumpStyleEffect(char **p, const char *name, PARAFORMAT2 *fmt, int mask) +static void ME_DumpStyleEffect(char **p, const char *name, const PARAFORMAT2 *fmt, int mask) { *p += sprintf(*p, "%-22s%s\n", name, (fmt->dwMask & mask) ? ((fmt->wEffects & mask) ? "yes" : "no") : "N/A"); }
-void ME_DumpParaStyleToBuf(PARAFORMAT2 *pFmt, char buf[2048]) +void ME_DumpParaStyleToBuf(const PARAFORMAT2 *pFmt, char buf[2048]) { /* FIXME only PARAFORMAT styles implemented */ char *p; @@ -318,7 +318,7 @@ void ME_DumpParaStyleToBuf(PARAFORMAT2 *pFmt, char buf[2048]) ME_DumpStyleEffect(&p, "Page break before:", pFmt, PFM_PAGEBREAKBEFORE); }
-void ME_SetParaFormat(ME_TextEditor *editor, ME_DisplayItem *para, PARAFORMAT2 *pFmt) +void ME_SetParaFormat(ME_TextEditor *editor, ME_DisplayItem *para, const PARAFORMAT2 *pFmt) { PARAFORMAT2 copy; assert(sizeof(*para->member.para.pFmt) == sizeof(PARAFORMAT2)); @@ -372,7 +372,7 @@ ME_GetSelectionParas(ME_TextEditor *editor, ME_DisplayItem **para, ME_DisplayIte }
-void ME_SetSelectionParaFormat(ME_TextEditor *editor, PARAFORMAT2 *pFmt) +void ME_SetSelectionParaFormat(ME_TextEditor *editor, const PARAFORMAT2 *pFmt) { ME_DisplayItem *para, *para_end;
@@ -386,7 +386,7 @@ void ME_SetSelectionParaFormat(ME_TextEditor *editor, PARAFORMAT2 *pFmt) } while(1); }
-void ME_GetParaFormat(ME_TextEditor *editor, ME_DisplayItem *para, PARAFORMAT2 *pFmt) +void ME_GetParaFormat(ME_TextEditor *editor, const ME_DisplayItem *para, PARAFORMAT2 *pFmt) { if (pFmt->cbSize >= sizeof(PARAFORMAT2)) {