You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by rl...@apache.org on 2017/06/14 21:34:26 UTC

svn commit: r1798774 - /xerces/c/trunk/src/xercesc/internal/XMLReader.cpp

Author: rleigh
Date: Wed Jun 14 21:34:25 2017
New Revision: 1798774

URL: http://svn.apache.org/viewvc?rev=1798774&view=rev
Log:
xercesc: XMLReader: Suppress cast alignment warnings

Modified:
    xerces/c/trunk/src/xercesc/internal/XMLReader.cpp

Modified: xerces/c/trunk/src/xercesc/internal/XMLReader.cpp
URL: http://svn.apache.org/viewvc/xerces/c/trunk/src/xercesc/internal/XMLReader.cpp?rev=1798774&r1=1798773&r2=1798774&view=diff
==============================================================================
--- xerces/c/trunk/src/xercesc/internal/XMLReader.cpp (original)
+++ xerces/c/trunk/src/xercesc/internal/XMLReader.cpp Wed Jun 14 21:34:25 2017
@@ -258,7 +258,7 @@ XMLReader::XMLReader(const  XMLCh* const
             if (fRawBytesAvail < 2)
                 break;
 
-            const UTF16Ch* asUTF16 = (const UTF16Ch*)&fRawByteBuf[fRawBufIndex];
+            const UTF16Ch* asUTF16 = reinterpret_cast<const UTF16Ch*>(&fRawByteBuf[fRawBufIndex]);
             if ((*asUTF16 == chUnicodeMarker) || (*asUTF16 == chSwappedUnicodeMarker))
             {
                 fRawBufIndex += sizeof(UTF16Ch);
@@ -1438,7 +1438,7 @@ void XMLReader::doInitDecode()
             }
 
             // Look at the raw buffer as UCS4 chars
-            const UCS4Ch* asUCS = (const UCS4Ch*)fRawByteBuf;
+            const UCS4Ch* asUCS = reinterpret_cast<const UCS4Ch*>(fRawByteBuf);
 
             while (fRawBufIndex < fRawBytesAvail)
             {
@@ -1561,7 +1561,7 @@ void XMLReader::doInitDecode()
                 break;
 
             XMLSize_t postBOMIndex = 0;
-            const UTF16Ch* asUTF16 = (const UTF16Ch*)&fRawByteBuf[fRawBufIndex];
+            const UTF16Ch* asUTF16 = reinterpret_cast<const UTF16Ch*>(&fRawByteBuf[fRawBufIndex]);
             if ((*asUTF16 == chUnicodeMarker) || (*asUTF16 == chSwappedUnicodeMarker))
             {
                 fRawBufIndex += sizeof(UTF16Ch);



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