You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by am...@apache.org on 2006/01/10 17:31:01 UTC

svn commit: r367675 - in /xerces/c/branches/xerces-2.7/src/xercesc/dom/impl: DOMAttrImpl.cpp DOMElementNSImpl.cpp

Author: amassari
Date: Tue Jan 10 08:30:46 2006
New Revision: 367675

URL: http://svn.apache.org/viewcvs?rev=367675&view=rev
Log:
gcc 4.0.x seems to optimize the two consecutive casts, generating the wrong pointer

Modified:
    xerces/c/branches/xerces-2.7/src/xercesc/dom/impl/DOMAttrImpl.cpp
    xerces/c/branches/xerces-2.7/src/xercesc/dom/impl/DOMElementNSImpl.cpp

Modified: xerces/c/branches/xerces-2.7/src/xercesc/dom/impl/DOMAttrImpl.cpp
URL: http://svn.apache.org/viewcvs/xerces/c/branches/xerces-2.7/src/xercesc/dom/impl/DOMAttrImpl.cpp?rev=367675&r1=367674&r2=367675&view=diff
==============================================================================
--- xerces/c/branches/xerces-2.7/src/xercesc/dom/impl/DOMAttrImpl.cpp (original)
+++ xerces/c/branches/xerces-2.7/src/xercesc/dom/impl/DOMAttrImpl.cpp Tue Jan 10 08:30:46 2006
@@ -308,7 +308,11 @@
 DOMNode * DOMAttrImpl::getInterface(const XMLCh* feature)
 {
     if(XMLString::equals(feature, XMLUni::fgXercescInterfacePSVITypeInfo))
-        return (DOMNode*)(DOMPSVITypeInfo*)fSchemaType;
+    {
+        // go through a temp variable, as gcc 4.0.x computes the wrong offset if presented with two consecutive casts
+        const DOMPSVITypeInfo* pTmp=fSchemaType;
+        return (DOMNode*)pTmp;
+    }
     return fNode.getInterface(feature); 
 }
 

Modified: xerces/c/branches/xerces-2.7/src/xercesc/dom/impl/DOMElementNSImpl.cpp
URL: http://svn.apache.org/viewcvs/xerces/c/branches/xerces-2.7/src/xercesc/dom/impl/DOMElementNSImpl.cpp?rev=367675&r1=367674&r2=367675&view=diff
==============================================================================
--- xerces/c/branches/xerces-2.7/src/xercesc/dom/impl/DOMElementNSImpl.cpp (original)
+++ xerces/c/branches/xerces-2.7/src/xercesc/dom/impl/DOMElementNSImpl.cpp Tue Jan 10 08:30:46 2006
@@ -265,7 +265,11 @@
 DOMNode * DOMElementNSImpl::getInterface(const XMLCh* feature)
 {
     if(XMLString::equals(feature, XMLUni::fgXercescInterfacePSVITypeInfo))
-        return (DOMNode*)(DOMPSVITypeInfo*)fSchemaType;
+    {
+        // go through a temp variable, as gcc 4.0.x computes the wrong offset if presented with two consecutive casts
+        const DOMPSVITypeInfo* pTmp=fSchemaType;
+        return (DOMNode*)pTmp;
+    }
     return DOMElementImpl::getInterface(feature);
 }
 



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@xerces.apache.org
For additional commands, e-mail: commits-help@xerces.apache.org