riched20: Write-strings warnings fix

Andrew Talbot Andrew.Talbot at talbotville.com
Fri Jul 21 15:05:00 CDT 2006


The string members of the FINDTEXT and FINDTEXTEX structS are declared
constant in the SDK.
---
Changelog:
    riched20: Write-strings warnings fix.

diff -urN a/dlls/riched20/editor.c b/dlls/riched20/editor.c
--- a/dlls/riched20/editor.c	2006-07-17 17:19:54.000000000 +0100
+++ b/dlls/riched20/editor.c	2006-07-21 20:47:27.000000000 +0100
@@ -2675,7 +2675,7 @@
 int ME_AutoURLDetect(ME_TextEditor *editor, WCHAR curChar) 
 {
   struct prefix_s {
-    char *text;
+    const char *text;
     int length;
   } prefixes[12] = {
     {"http:", 5},
diff -urN a/dlls/riched20/tests/editor.c b/dlls/riched20/tests/editor.c
--- a/dlls/riched20/tests/editor.c	2006-06-16 14:20:20.000000000 +0100
+++ b/dlls/riched20/tests/editor.c	2006-07-21 20:47:27.000000000 +0100
@@ -44,7 +44,7 @@
 struct find_s {
   int start;
   int end;
-  char *needle;
+  const char *needle;
   int flags;
   int expected_loc;
   int _todo_wine;
@@ -565,7 +565,7 @@
 static void test_EM_AUTOURLDETECT(void)
 {
   struct urls_s {
-    char *text;
+    const char *text;
     int is_url;
   } urls[12] = {
     {"winehq.org", 0},
diff -urN a/include/richedit.h b/include/richedit.h
--- a/include/richedit.h	2006-05-25 10:18:24.000000000 +0100
+++ b/include/richedit.h	2006-07-21 20:47:27.000000000 +0100
@@ -434,25 +434,25 @@
 
 typedef struct _findtextA {
     CHARRANGE  chrg;
-    LPSTR      lpstrText;
+    LPCSTR      lpstrText;
 } FINDTEXTA;
 
 typedef struct _findtextW {
     CHARRANGE  chrg;
-    LPWSTR     lpstrText;
+    LPCWSTR     lpstrText;
 } FINDTEXTW;
 
 DECL_WINELIB_TYPE_AW(FINDTEXT)
 
 typedef struct _findtextexA {
     CHARRANGE  chrg;
-    LPSTR      lpstrText;
+    LPCSTR      lpstrText;
     CHARRANGE  chrgText;
 } FINDTEXTEXA;
 
 typedef struct _findtextexW {
     CHARRANGE  chrg;
-    LPWSTR     lpstrText;
+    LPCWSTR     lpstrText;
     CHARRANGE  chrgText;
 } FINDTEXTEXW;
 



More information about the wine-patches mailing list