diff --git a/ebml/EbmlElement.h b/ebml/EbmlElement.h index 9f7dca19..39101782 100644 --- a/ebml/EbmlElement.h +++ b/ebml/EbmlElement.h @@ -600,7 +600,7 @@ class EBML_DLL_API EbmlElement { private: std::size_t HeadSize() const { - return EBML_ID_LENGTH((const EbmlId&)*this) + CodedSizeLength(Size, SizeLength, bSizeIsFinite); + return EBML_ID_LENGTH(static_cast(*this)) + CodedSizeLength(Size, SizeLength, bSizeIsFinite); } /// return the size of the head, on reading/writing std::uint64_t Size; ///< the size of the data to write diff --git a/src/EbmlElement.cpp b/src/EbmlElement.cpp index 1ee77c2a..833f4378 100644 --- a/src/EbmlElement.cpp +++ b/src/EbmlElement.cpp @@ -514,7 +514,7 @@ filepos_t EbmlElement::MakeRenderHead(IOCallback & output, bool bKeepPosition) std::array FinalHead; // Class D + 64 bits coded size std::size_t FinalHeadSize; - FinalHeadSize = EBML_ID_LENGTH((const EbmlId&)*this); + FinalHeadSize = EBML_ID_LENGTH(static_cast(*this)); EbmlId(*this).Fill(FinalHead.data()); const unsigned int CodedSize = CodedSizeLength(Size, SizeLength, bSizeIsFinite);