riched20: Constify some variables

Andrew Talbot andrew.talbot at talbotville.com
Thu Aug 16 15:57:12 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-16 18:06:27.000000000 +0100
+++ b/dlls/riched20/editor.h	2007-08-16 20:51:17.000000000 +0100
@@ -71,8 +71,8 @@
 void ME_CopyToCF2W(CHARFORMAT2W *to, CHARFORMAT2W *from);
 CHARFORMAT2W *ME_ToCFAny(CHARFORMAT2W *to, CHARFORMAT2W *from);
 void ME_CopyToCFAny(CHARFORMAT2W *to, CHARFORMAT2W *from);
-void ME_CopyCharFormat(CHARFORMAT2W *pDest, CHARFORMAT2W *pSrc); /* only works with 2W structs */
-void ME_CharFormatFromLogFont(HDC hDC, LOGFONTW *lf, CHARFORMAT2W *fmt); /* ditto */
+void ME_CopyCharFormat(CHARFORMAT2W *pDest, const CHARFORMAT2W *pSrc); /* only works with 2W structs */
+void ME_CharFormatFromLogFont(HDC hDC, const LOGFONTW *lf, CHARFORMAT2W *fmt); /* ditto */
 
 /* list.c */
 void ME_InsertBefore(ME_DisplayItem *diWhere, ME_DisplayItem *diWhat);
@@ -213,7 +213,7 @@
 /* wrap.c */
 void ME_PrepareParagraphForWrapping(ME_Context *c, ME_DisplayItem *tp);
 ME_DisplayItem *ME_MakeRow(int height, int baseline, int width);
-void ME_InsertRowStart(ME_WrapContext *wc, ME_DisplayItem *pEnd);
+void ME_InsertRowStart(ME_WrapContext *wc, const ME_DisplayItem *pEnd);
 void ME_WrapTextParagraph(ME_Context *c, ME_DisplayItem *tp);
 BOOL ME_WrapMarkedParagraphs(ME_TextEditor *editor);
 void ME_InvalidateMarkedParagraphs(ME_TextEditor *editor);
@@ -268,7 +268,7 @@
 void ME_DestroyEditor(ME_TextEditor *editor);
 void ME_SendOldNotify(ME_TextEditor *editor, int nCode);
 void ME_LinkNotify(ME_TextEditor *editor, UINT msg, WPARAM wParam, LPARAM lParam);
-ME_UndoItem *ME_AddUndoItem(ME_TextEditor *editor, ME_DIType type, ME_DisplayItem *di);
+ME_UndoItem *ME_AddUndoItem(ME_TextEditor *editor, ME_DIType type, const ME_DisplayItem *pdi);
 void ME_CommitUndo(ME_TextEditor *editor);
 void ME_Undo(ME_TextEditor *editor);
 void ME_Redo(ME_TextEditor *editor);
diff -urN a/dlls/riched20/style.c b/dlls/riched20/style.c
--- a/dlls/riched20/style.c	2007-01-24 12:20:06.000000000 +0000
+++ b/dlls/riched20/style.c	2007-08-16 20:54:22.000000000 +0100
@@ -181,7 +181,7 @@
   return s;
 }
 
-void ME_CopyCharFormat(CHARFORMAT2W *pDest, CHARFORMAT2W *pSrc)
+void ME_CopyCharFormat(CHARFORMAT2W *pDest, const CHARFORMAT2W *pSrc)
 {
   /* using this with non-2W structs is forbidden */
   assert(pSrc->cbSize == sizeof(CHARFORMAT2W));
@@ -189,7 +189,7 @@
   CopyMemory(pDest, pSrc, sizeof(CHARFORMAT2W));
 }
 
-static void ME_DumpStyleEffect(char **p, const char *name, CHARFORMAT2W *fmt, int mask)
+static void ME_DumpStyleEffect(char **p, const char *name, const CHARFORMAT2W *fmt, int mask)
 {
   *p += sprintf(*p, "%-22s%s\n", name, (fmt->dwMask & mask) ? ((fmt->dwEffects & mask) ? "YES" : "no") : "N/A");
 }
@@ -253,7 +253,7 @@
 
 
 static void
-ME_LogFontFromStyle(HDC hDC, LOGFONTW *lf, ME_Style *s, int nZoomNumerator, int nZoomDenominator)
+ME_LogFontFromStyle(HDC hDC, LOGFONTW *lf, const ME_Style *s, int nZoomNumerator, int nZoomDenominator)
 {
   int rx, ry;
   rx = GetDeviceCaps(hDC, LOGPIXELSX);
@@ -286,10 +286,10 @@
   lf->lfCharSet = s->fmt.bCharSet;
 }
 
-void ME_CharFormatFromLogFont(HDC hDC, LOGFONTW *lf, CHARFORMAT2W *fmt)
+void ME_CharFormatFromLogFont(HDC hDC, const LOGFONTW *lf, CHARFORMAT2W *fmt)
 {
   int rx, ry;
-  
+
   ME_InitCharFormat2W(fmt);
   rx = GetDeviceCaps(hDC, LOGPIXELSX);
   ry = GetDeviceCaps(hDC, LOGPIXELSY);
@@ -308,7 +308,7 @@
   fmt->bCharSet = lf->lfCharSet;
 }
 
-static BOOL ME_IsFontEqual(LOGFONTW *p1, LOGFONTW *p2)
+static BOOL ME_IsFontEqual(const LOGFONTW *p1, const LOGFONTW *p2)
 {
   if (memcmp(p1, p2, sizeof(LOGFONTW)-sizeof(p1->lfFaceName)))
     return FALSE;
diff -urN a/dlls/riched20/undo.c b/dlls/riched20/undo.c
--- a/dlls/riched20/undo.c	2007-01-24 12:20:06.000000000 +0000
+++ b/dlls/riched20/undo.c	2007-08-16 20:51:26.000000000 +0100
@@ -48,7 +48,7 @@
   } 
 }
 
-ME_UndoItem *ME_AddUndoItem(ME_TextEditor *editor, ME_DIType type, ME_DisplayItem *pdi) {
+ME_UndoItem *ME_AddUndoItem(ME_TextEditor *editor, ME_DIType type, const ME_DisplayItem *pdi) {
   if (editor->nUndoMode == umIgnore)
     return NULL;
   else if (editor->nUndoLimit == 0)
diff -urN a/dlls/riched20/wrap.c b/dlls/riched20/wrap.c
--- a/dlls/riched20/wrap.c	2007-08-16 18:06:28.000000000 +0100
+++ b/dlls/riched20/wrap.c	2007-08-16 21:08:30.000000000 +0100
@@ -51,7 +51,7 @@
   wc->pt.x = 0;
 }
 
-void ME_InsertRowStart(ME_WrapContext *wc, ME_DisplayItem *pEnd)
+void ME_InsertRowStart(ME_WrapContext *wc, const ME_DisplayItem *pEnd)
 {
   ME_DisplayItem *p, *row, *para;
   int ascent = 0, descent = 0, width=0, shift = 0, align = 0;
diff -urN a/dlls/riched20/writer.c b/dlls/riched20/writer.c
--- a/dlls/riched20/writer.c	2006-11-29 13:26:33.000000000 +0000
+++ b/dlls/riched20/writer.c	2007-08-16 21:19:52.000000000 +0100
@@ -25,7 +25,7 @@
 
 
 static BOOL
-ME_StreamOutRTFText(ME_OutStream *pStream, WCHAR *text, LONG nChars);
+ME_StreamOutRTFText(ME_OutStream *pStream, const WCHAR *text, LONG nChars);
 
 
 static ME_OutStream*
@@ -192,7 +192,7 @@
 
 
 static BOOL
-ME_StreamOutRTFFontAndColorTbl(ME_OutStream *pStream, ME_DisplayItem *pFirstRun, ME_DisplayItem *pLastRun)
+ME_StreamOutRTFFontAndColorTbl(ME_OutStream *pStream, ME_DisplayItem *pFirstRun, const ME_DisplayItem *pLastRun)
 {
   ME_DisplayItem *item = pFirstRun;
   ME_FontTableItem *table = pStream->fonttbl;
@@ -282,7 +282,7 @@
 
 
 static BOOL
-ME_StreamOutRTFParaProps(ME_OutStream *pStream, ME_DisplayItem *para)
+ME_StreamOutRTFParaProps(ME_OutStream *pStream, const ME_DisplayItem *para)
 {
   PARAFORMAT2 *fmt = para->member.para.pFmt;
   char props[STREAMOUT_BUFFER_SIZE] = "";
@@ -579,7 +579,7 @@
 
 
 static BOOL
-ME_StreamOutRTFText(ME_OutStream *pStream, WCHAR *text, LONG nChars)
+ME_StreamOutRTFText(ME_OutStream *pStream, const WCHAR *text, LONG nChars)
 {
   char buffer[STREAMOUT_BUFFER_SIZE];
   int pos = 0;



More information about the wine-patches mailing list