riched20: Constify some variables

Andrew Talbot andrew.talbot at talbotville.com
Mon Aug 13 16:41:55 CDT 2007


Changelog:
    riched20: Constify some variables.

diff -urN a/dlls/riched20/editor.h b/dlls/riched20/editor.h
--- a/dlls/riched20/editor.h	2007-08-13 17:54:18.000000000 +0100
+++ b/dlls/riched20/editor.h	2007-08-13 22:15:30.000000000 +0100
@@ -226,24 +226,24 @@
 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 -urN a/dlls/riched20/paint.c b/dlls/riched20/paint.c
--- a/dlls/riched20/paint.c	2007-01-24 12:20:06.000000000 +0000
+++ b/dlls/riched20/paint.c	2007-08-13 21:58:03.000000000 +0100
@@ -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 @@
   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 @@
     }
 }
 
-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 -urN a/dlls/riched20/para.c b/dlls/riched20/para.c
--- a/dlls/riched20/para.c	2006-08-07 19:15:56.000000000 +0100
+++ b/dlls/riched20/para.c	2007-08-13 21:58:40.000000000 +0100
@@ -83,7 +83,7 @@
   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_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 @@
   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 @@
   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 @@
 }
 
 
-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 @@
   } 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))
   {



More information about the wine-patches mailing list