From 8ef73796af32bed34c6cbce6b4255e793e395ac5 Mon Sep 17 00:00:00 2001 From: Steve Lhomme Date: Sat, 13 Jan 2024 14:59:29 +0100 Subject: [PATCH] define EbmlCrc32 as binary class with a length of 4 --- ebml/EbmlCrc32.h | 3 +-- ebml/EbmlElement.h | 1 + 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ebml/EbmlCrc32.h b/ebml/EbmlCrc32.h index 58946f2b..8cfc30cc 100644 --- a/ebml/EbmlCrc32.h +++ b/ebml/EbmlCrc32.h @@ -17,9 +17,8 @@ namespace libebml { -DECLARE_EBML_BINARY(EbmlCrc32) +DECLARE_EBML_BINARY_LENGTH(EbmlCrc32, 4) public: - bool ValidateSize() const override {return GetSize() == 4;} filepos_t RenderData(IOCallback & output, bool bForceRender, ShouldWrite writeFilter = WriteSkipDefault) override; filepos_t ReadData(IOCallback & input, ScopeMode ReadFully = SCOPE_ALL_DATA) override; // filepos_t UpdateSize(ShouldWrite writeFilter = WriteSkipDefault); diff --git a/ebml/EbmlElement.h b/ebml/EbmlElement.h index 60ad4906..82bda924 100644 --- a/ebml/EbmlElement.h +++ b/ebml/EbmlElement.h @@ -228,6 +228,7 @@ class DllApi x : public BaseClass { \ #define DECLARE_EBML_UINTEGER_DEF(x) DECLARE_xxx_UINTEGER_DEF(x,EBML_DLL_API) #define DECLARE_EBML_STRING_DEF(x) DECLARE_xxx_STRING_DEF( x,EBML_DLL_API) #define DECLARE_EBML_BINARY(x) DECLARE_xxx_BINARY( x,EBML_DLL_API) +#define DECLARE_EBML_BINARY_LENGTH(x,len) DECLARE_xxx_BINARY_LENGTH(x,len,EBML_DLL_API) #define EBML_CONCRETE_CLASS(Type) \ public: \