From: szy Date: Wed, 26 Mar 2014 12:49:44 +0000 (+0400) Subject: 0024535: Bad type cast in TDocStd_Document::Update() X-Git-Tag: V6_8_0_beta~453 X-Git-Url: http://git.dev.opencascade.org/gitweb/?a=commitdiff_plain;h=2cb0e21313a4ad2201621ff006a9ad0ad4d5e552;p=occt-copy.git 0024535: Bad type cast in TDocStd_Document::Update() Eliminating of GCC compiler warning on breakage of C pointer aliasing rules. --- diff --git a/src/TDocStd/TDocStd_Document.cxx b/src/TDocStd/TDocStd_Document.cxx index 29822a3ba0..0247be6c36 100644 --- a/src/TDocStd/TDocStd_Document.cxx +++ b/src/TDocStd/TDocStd_Document.cxx @@ -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 (aModifContext); + if (CC->ModifiedReferences() || !IsUpToDate(aReferenceIdentifier)) { TCollection_AsciiString aDocEntry(aReferenceIdentifier); UpdateReferences(aDocEntry); SetIsUpToDate(aReferenceIdentifier);