From da4da9b4d7ca69f9a8a82a002c85f5e7acd2afd6 Mon Sep 17 00:00:00 2001 From: Steve Lhomme Date: Fri, 29 Dec 2023 11:36:21 +0100 Subject: [PATCH] merge DEFINE_xxx_CLASS_GLOBAL into DEFINE_xxx_CLASS_ORPHAN They have exactly the same defintion and shouldn't differ in the future. --- ebml/EbmlElement.h | 6 ------ src/EbmlCrc32.cpp | 2 +- src/EbmlVoid.cpp | 2 +- 3 files changed, 2 insertions(+), 8 deletions(-) diff --git a/ebml/EbmlElement.h b/ebml/EbmlElement.h index 867da76d..73886e7f 100644 --- a/ebml/EbmlElement.h +++ b/ebml/EbmlElement.h @@ -139,11 +139,6 @@ class EbmlElement; const EbmlCallbacksDefault x::ClassInfos(x::Create, Id_##x, static_cast(defval), name, Context_##x); \ x::x() :EbmlFloat(x::ClassInfos) {} -#define DEFINE_xxx_CLASS_GLOBAL(x,id,idl,name,global) \ - constexpr EbmlId Id_##x (id, idl); \ - constexpr EbmlSemanticContext EmptyContext_##x = EbmlSemanticContext(0, nullptr, nullptr, global, nullptr); \ - const EbmlCallbacks x::ClassInfos(x::Create, Id_##x, false, name, EmptyContext_##x); \ - #define DEFINE_xxx_CLASS_ORPHAN(x,id,idl,name,global) \ constexpr const EbmlId Id_##x (id, idl); \ const EbmlSemanticContext Context_##x = EbmlSemanticContext(0, nullptr, nullptr, global, nullptr); \ @@ -152,7 +147,6 @@ class EbmlElement; #define DEFINE_EBML_CONTEXT(x) DEFINE_xxx_CONTEXT(x,GetEbmlGlobal_Context) #define DEFINE_EBML_MASTER(x,id,idl,parent,infinite,name) DEFINE_xxx_MASTER(x,id,idl,parent,infinite,name,GetEbmlGlobal_Context) #define DEFINE_EBML_MASTER_ORPHAN(x,id,idl,infinite,name) DEFINE_xxx_MASTER_ORPHAN(x,id,idl,infinite,name,GetEbmlGlobal_Context) -#define DEFINE_EBML_CLASS_GLOBAL(x,id,idl,name) DEFINE_xxx_CLASS_GLOBAL(x,id,idl,name,GetEbmlGlobal_Context) #define DEFINE_EBML_CLASS_ORPHAN(x,id,idl,name) DEFINE_xxx_CLASS_ORPHAN(x,id,idl,name,GetEbmlGlobal_Context) #define DEFINE_EBML_UINTEGER_DEF(x,id,idl,parent,name,val) DEFINE_xxx_UINTEGER_DEF(x,id,idl,parent,name,GetEbmlGlobal_Context,val) #define DEFINE_EBML_STRING(x,id,idl,parent,name) DEFINE_xxx_STRING(x,id,idl,parent,name,GetEbmlGlobal_Context) diff --git a/src/EbmlCrc32.cpp b/src/EbmlCrc32.cpp index 9ab25509..a86f4b2b 100644 --- a/src/EbmlCrc32.cpp +++ b/src/EbmlCrc32.cpp @@ -26,7 +26,7 @@ static constexpr std::uint32_t CRC32_NEGL = 0xffffffffL; namespace libebml { -DEFINE_EBML_CLASS_GLOBAL(EbmlCrc32, 0xBF, 1, "EBMLCrc32\0ratamadabapa") +DEFINE_EBML_CLASS_ORPHAN(EbmlCrc32, 0xBF, 1, "EBMLCrc32\0ratamadabapa") static constexpr std::array s_tab { #ifdef WORDS_BIGENDIAN diff --git a/src/EbmlVoid.cpp b/src/EbmlVoid.cpp index a599d5d7..0b3221ed 100644 --- a/src/EbmlVoid.cpp +++ b/src/EbmlVoid.cpp @@ -10,7 +10,7 @@ namespace libebml { -DEFINE_EBML_CLASS_GLOBAL(EbmlVoid, 0xEC, 1, "EBMLVoid") +DEFINE_EBML_CLASS_ORPHAN(EbmlVoid, 0xEC, 1, "EBMLVoid") EbmlVoid::EbmlVoid() :EbmlBinary(EbmlVoid::ClassInfos)