From c392c1bed4a443b3c0f7c7fa31176e2878a462c4 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Fri, 9 Feb 2024 14:25:32 -0800 Subject: [PATCH] use C++ casting in macros Signed-off-by: Rosen Penev --- ebml/EbmlElement.h | 2 +- src/EbmlElement.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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);