Mikhail Maroukhine : msxml3: Fix compiler warnings with flag -Wcast-qual.

Alexandre Julliard julliard at winehq.org
Mon Mar 29 09:57:55 CDT 2010


Module: wine
Branch: master
Commit: 88cca2cf765b38dd762ff180804e02efd805fc7a
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=88cca2cf765b38dd762ff180804e02efd805fc7a

Author: Mikhail Maroukhine <mikolg at yandex.ru>
Date:   Sat Mar 27 21:19:45 2010 +0600

msxml3: Fix compiler warnings with flag -Wcast-qual.

---

 dlls/msxml3/dispex.c |    4 ++--
 dlls/msxml3/main.c   |    2 +-
 dlls/msxml3/node.c   |   16 ++++++++--------
 3 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/dlls/msxml3/dispex.c b/dlls/msxml3/dispex.c
index 529f9a4..09b71fe 100644
--- a/dlls/msxml3/dispex.c
+++ b/dlls/msxml3/dispex.c
@@ -196,12 +196,12 @@ static void add_func_info(dispex_data_t *data, DWORD *size, tid_t tid, DISPID id
 
 static int dispid_cmp(const void *p1, const void *p2)
 {
-    return ((func_info_t*)p1)->id - ((func_info_t*)p2)->id;
+    return ((const func_info_t*)p1)->id - ((const func_info_t*)p2)->id;
 }
 
 static int func_name_cmp(const void *p1, const void *p2)
 {
-    return strcmpiW((*(func_info_t**)p1)->name, (*(func_info_t**)p2)->name);
+    return strcmpiW((*(func_info_t* const*)p1)->name, (*(func_info_t* const*)p2)->name);
 }
 
 static dispex_data_t *preprocess_dispex_data(DispatchEx *This)
diff --git a/dlls/msxml3/main.c b/dlls/msxml3/main.c
index 9b1eb82..60b0cbd 100644
--- a/dlls/msxml3/main.c
+++ b/dlls/msxml3/main.c
@@ -62,7 +62,7 @@ static int wineXmlMatchCallback (char const * filename)
 
 static void *wineXmlOpenCallback (char const * filename)
 {
-    BSTR sFilename = bstr_from_xmlChar( (xmlChar*)filename);
+    BSTR sFilename = bstr_from_xmlChar( (const xmlChar*)filename);
     HANDLE hFile;
 
     TRACE("%s\n", debugstr_w(sFilename));
diff --git a/dlls/msxml3/node.c b/dlls/msxml3/node.c
index b05f06e..500fb94 100644
--- a/dlls/msxml3/node.c
+++ b/dlls/msxml3/node.c
@@ -1190,8 +1190,8 @@ static HRESULT WINAPI xmlnode_get_dataType(
     switch ( This->node->type )
     {
     case XML_ELEMENT_NODE:
-        pVal = xmlGetNsProp(This->node, (xmlChar*)"dt",
-                            (xmlChar*)"urn:schemas-microsoft-com:datatypes");
+        pVal = xmlGetNsProp(This->node, (const xmlChar*)"dt",
+                            (const xmlChar*)"urn:schemas-microsoft-com:datatypes");
         if (pVal)
         {
             V_VT(dataTypeName) = VT_BSTR;
@@ -1260,20 +1260,20 @@ static HRESULT WINAPI xmlnode_put_dataType(
         xmlAttrPtr pAttr = NULL;
         xmlChar* str = xmlChar_from_wchar(dataTypeName);
 
-        pAttr = xmlHasNsProp(This->node, (xmlChar*)"dt",
-                            (xmlChar*)"urn:schemas-microsoft-com:datatypes");
+        pAttr = xmlHasNsProp(This->node, (const xmlChar*)"dt",
+                            (const xmlChar*)"urn:schemas-microsoft-com:datatypes");
         if (pAttr)
         {
-            pAttr = xmlSetNsProp(This->node, pAttr->ns, (xmlChar*)"dt", str);
+            pAttr = xmlSetNsProp(This->node, pAttr->ns, (const xmlChar*)"dt", str);
 
             hr = S_OK;
         }
         else
         {
-            pNS = xmlNewNs(This->node, (xmlChar*)"urn:schemas-microsoft-com:datatypes", (xmlChar*)"dt");
+            pNS = xmlNewNs(This->node, (const xmlChar*)"urn:schemas-microsoft-com:datatypes", (const xmlChar*)"dt");
             if(pNS)
             {
-                pAttr = xmlNewNsProp(This->node, pNS, (xmlChar*)"dt", str);
+                pAttr = xmlNewNsProp(This->node, pNS, (const xmlChar*)"dt", str);
                 if(pAttr)
                 {
                     xmlAddChild(This->node, (xmlNodePtr)pAttr);
@@ -1402,7 +1402,7 @@ static HRESULT WINAPI xmlnode_get_xml(
 
             /* Attribute Nodes return a space in front of their name */
             pContent = xmlBufferContent(pXmlBuf);
-            if( ((char*)pContent)[0] == ' ')
+            if( ((const char*)pContent)[0] == ' ')
                 bstrContent = bstr_from_xmlChar(pContent+1);
             else
                 bstrContent = bstr_from_xmlChar(pContent);




More information about the wine-cvs mailing list