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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to