Michael Karcher : msxml3: Specialize attach_xmlnode to XML documents.
Module: wine Branch: master Commit: 1c49bc83ae4630dba9b5a86c37042c34859160c4 URL: http://source.winehq.org/git/wine.git/?a=commit;h=1c49bc83ae4630dba9b5a86c37... Author: Michael Karcher <wine(a)mkarcher.dialup.fu-berlin.de> Date: Sat Nov 29 10:52:06 2008 +0100 msxml3: Specialize attach_xmlnode to XML documents. attach_xmlnode is only used to attach XML document nodes, and a cast is needed on each call. Rename it to attach_xmldoc, change the parameter type to move the cast at one point into the function. --- dlls/msxml3/domdoc.c | 18 +++++++++--------- 1 files changed, 9 insertions(+), 9 deletions(-) diff --git a/dlls/msxml3/domdoc.c b/dlls/msxml3/domdoc.c index f5b7aff..860cd60 100644 --- a/dlls/msxml3/domdoc.c +++ b/dlls/msxml3/domdoc.c @@ -209,14 +209,14 @@ HRESULT xmldoc_remove_orphan(xmlDocPtr doc, xmlNodePtr node) return S_FALSE; } -static void attach_xmlnode( IXMLDOMNode *node, xmlNodePtr xml ) +static void attach_xmldoc( IXMLDOMNode *node, xmlDocPtr xml ) { xmlnode *This = impl_from_IXMLDOMNode( node ); if(This->node) xmldoc_release(This->node->doc); - This->node = xml; + This->node = (xmlNodePtr) xml; if(This->node) xmldoc_add_ref(This->node->doc); @@ -345,7 +345,7 @@ static HRESULT WINAPI xmldoc_IPersistStream_Load( } xmldoc->_private = create_priv(); - attach_xmlnode( This->node, (xmlNodePtr)xmldoc ); + attach_xmldoc( This->node, xmldoc ); return S_OK; } @@ -1324,7 +1324,7 @@ static HRESULT domdoc_onDataAvailable(void *obj, char *ptr, DWORD len) xmldoc = doparse( ptr, len ); if(xmldoc) { xmldoc->_private = create_priv(); - attach_xmlnode(This->node, (xmlNodePtr) xmldoc); + attach_xmldoc(This->node, xmldoc); } return S_OK; @@ -1364,7 +1364,7 @@ static HRESULT WINAPI domdoc_load( assert( This->node ); - attach_xmlnode(This->node, NULL); + attach_xmldoc(This->node, NULL); switch( V_VT(&xmlSource) ) { @@ -1379,7 +1379,7 @@ static HRESULT WINAPI domdoc_load( { domdoc *newDoc = impl_from_IXMLDOMDocument2( pNewDoc ); xmldoc = xmlCopyDoc(get_doc(newDoc), 1); - attach_xmlnode(This->node, (xmlNodePtr) xmldoc); + attach_xmldoc(This->node, xmldoc); *isSuccessful = VARIANT_TRUE; @@ -1440,7 +1440,7 @@ static HRESULT WINAPI domdoc_load( if(!filename || FAILED(hr)) { xmldoc = xmlNewDoc(NULL); xmldoc->_private = create_priv(); - attach_xmlnode(This->node, (xmlNodePtr) xmldoc); + attach_xmldoc(This->node, xmldoc); hr = S_FALSE; } @@ -1549,7 +1549,7 @@ static HRESULT WINAPI domdoc_loadXML( assert ( This->node ); - attach_xmlnode( This->node, NULL ); + attach_xmldoc( This->node, NULL ); if ( isSuccessful ) { @@ -1572,7 +1572,7 @@ static HRESULT WINAPI domdoc_loadXML( xmldoc = xmlNewDoc(NULL); xmldoc->_private = create_priv(); - attach_xmlnode( This->node, (xmlNodePtr) xmldoc ); + attach_xmldoc( This->node, xmldoc ); return hr; }
participants (1)
-
Alexandre Julliard