0024535: Bad type cast in TDocStd_Document::Update()
authorszy <szy@opencascade.com>
Wed, 26 Mar 2014 12:49:44 +0000 (16:49 +0400)
committerbugmaster <bugmaster@opencascade.com>
Fri, 28 Mar 2014 11:55:25 +0000 (15:55 +0400)
Eliminating of GCC compiler warning on breakage of C pointer aliasing rules.

src/TDocStd/TDocStd_Document.cxx

index 29822a3..0247be6 100644 (file)
@@ -224,8 +224,8 @@ void TDocStd_Document::Update(const Handle(CDM_Document)& /*aToDocument*/,
                               const Standard_Integer aReferenceIdentifier,
                               const Standard_Address aModifContext) 
 {
-  const TDocStd_Context CC = *((TDocStd_Context *)&aModifContext);
-  if (CC.ModifiedReferences() || !IsUpToDate(aReferenceIdentifier)) {
+  const TDocStd_Context* CC = static_cast<TDocStd_Context*> (aModifContext);
+  if (CC->ModifiedReferences() || !IsUpToDate(aReferenceIdentifier)) {
     TCollection_AsciiString aDocEntry(aReferenceIdentifier);
     UpdateReferences(aDocEntry);
     SetIsUpToDate(aReferenceIdentifier);