From 85860340889b733b89e4ff6c24abddda4591298a Mon Sep 17 00:00:00 2001 From: Steve Lhomme Date: Mon, 18 Dec 2023 08:12:26 +0100 Subject: [PATCH] initialize each class EbmlCallbacks as a constexpr --- ebml/EbmlElement.h | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/ebml/EbmlElement.h b/ebml/EbmlElement.h index edccbb3c..352d1464 100644 --- a/ebml/EbmlElement.h +++ b/ebml/EbmlElement.h @@ -104,29 +104,29 @@ extern const EbmlSemanticContext Context_EbmlGlobal; #define DEFINE_xxx_MASTER(x,id,idl,parent,name,global) \ constexpr EbmlId Id_##x (id, idl); \ constexpr EbmlSemanticContext Context_##x = EbmlSemanticContext(countof(ContextList_##x), ContextList_##x, &Context_##parent, global, &EBML_INFO(x)); \ - const EbmlCallbacks x::ClassInfos(x::Create, Id_##x, name, Context_##x); \ + constexpr EbmlCallbacks x::ClassInfos(x::Create, Id_##x, name, Context_##x); \ x::x() :EbmlMaster(Context_##x) {} #define DEFINE_xxx_MASTER_CONS(x,id,idl,parent,name,global) \ constexpr EbmlId Id_##x (id, idl); \ constexpr EbmlSemanticContext Context_##x = EbmlSemanticContext(countof(ContextList_##x), ContextList_##x, &Context_##parent, global, &EBML_INFO(x)); \ - const EbmlCallbacks x::ClassInfos(x::Create, Id_##x, name, Context_##x); + constexpr EbmlCallbacks x::ClassInfos(x::Create, Id_##x, name, Context_##x); #define DEFINE_xxx_MASTER_ORPHAN(x,id,idl,name,global) \ constexpr EbmlId Id_##x (id, idl); \ constexpr EbmlSemanticContext Context_##x = EbmlSemanticContext(countof(ContextList_##x), ContextList_##x, nullptr, global, &EBML_INFO(x)); \ - const EbmlCallbacks x::ClassInfos(x::Create, Id_##x, name, Context_##x); \ + constexpr EbmlCallbacks x::ClassInfos(x::Create, Id_##x, name, Context_##x); \ #define DEFINE_xxx_CLASS(x,id,idl,parent,name,global) \ constexpr EbmlId Id_##x (id, idl); \ constexpr EbmlSemanticContext Context_##x = EbmlSemanticContext(0, nullptr, &Context_##parent, global, &EBML_INFO(x)); \ - const EbmlCallbacks x::ClassInfos(x::Create, Id_##x, name, Context_##x); \ + constexpr EbmlCallbacks x::ClassInfos(x::Create, Id_##x, name, Context_##x); \ x::x() {} #define DEFINE_xxx_CLASS_CONS(x,id,idl,parent,name,global) \ constexpr EbmlId Id_##x (id, idl); \ constexpr EbmlSemanticContext Context_##x = EbmlSemanticContext(0, nullptr, &Context_##parent, global, &EBML_INFO(x)); \ - const EbmlCallbacks x::ClassInfos(x::Create, Id_##x, name, Context_##x); + constexpr EbmlCallbacks x::ClassInfos(x::Create, Id_##x, name, Context_##x); #define DEFINE_xxx_UINTEGER_DEF(x,id,idl,parent,name,global,defval) \ constexpr EbmlId Id_##x (id, idl); \ @@ -137,29 +137,29 @@ extern const EbmlSemanticContext Context_EbmlGlobal; #define DEFINE_xxx_SINTEGER_DEF(x,id,idl,parent,name,global,defval) \ constexpr EbmlId Id_##x (id, idl); \ constexpr EbmlSemanticContext Context_##x = EbmlSemanticContext(0, nullptr, &Context_##parent, global, &EBML_INFO(x)); \ - const EbmlCallbacks x::ClassInfos(x::Create, Id_##x, name, Context_##x); \ + constexpr EbmlCallbacks x::ClassInfos(x::Create, Id_##x, name, Context_##x); \ x::x() :EbmlSInteger(defval) {} #define DEFINE_xxx_STRING_DEF(x,id,idl,parent,name,global,defval) \ constexpr EbmlId Id_##x (id, idl); \ constexpr EbmlSemanticContext Context_##x = EbmlSemanticContext(0, nullptr, &Context_##parent, global, &EBML_INFO(x)); \ - const EbmlCallbacks x::ClassInfos(x::Create, Id_##x, name, Context_##x); \ + constexpr EbmlCallbacks x::ClassInfos(x::Create, Id_##x, name, Context_##x); \ x::x() :EbmlString(defval) {} #define DEFINE_xxx_FLOAT_DEF(x,id,idl,parent,name,global,defval) \ constexpr EbmlId Id_##x (id, idl); \ constexpr EbmlSemanticContext Context_##x = EbmlSemanticContext(0, nullptr, &Context_##parent, global, &EBML_INFO(x)); \ - const EbmlCallbacks x::ClassInfos(x::Create, Id_##x, name, Context_##x); \ + constexpr EbmlCallbacks x::ClassInfos(x::Create, Id_##x, name, Context_##x); \ x::x() :EbmlFloat(defval) {} #define DEFINE_xxx_CLASS_GLOBAL(x,id,idl,name,global) \ constexpr EbmlId Id_##x (id, idl); \ - const EbmlCallbacks x::ClassInfos(x::Create, Id_##x, name, Context_EbmlGlobal); \ + constexpr EbmlCallbacks x::ClassInfos(x::Create, Id_##x, name, Context_EbmlGlobal); \ #define DEFINE_xxx_CLASS_ORPHAN(x,id,idl,name,global) \ constexpr EbmlId Id_##x (id, idl); \ constexpr EbmlSemanticContext Context_##x = EbmlSemanticContext(0, nullptr, nullptr, global, nullptr); \ - const EbmlCallbacks x::ClassInfos(x::Create, Id_##x, name, Context_##x); \ + constexpr EbmlCallbacks x::ClassInfos(x::Create, Id_##x, name, Context_##x); \ #define DEFINE_EBML_CONTEXT(x) DEFINE_xxx_CONTEXT(x,GetEbmlGlobal_Context) #define DEFINE_EBML_MASTER(x,id,idl,parent,name) DEFINE_xxx_MASTER(x,id,idl,parent,name,GetEbmlGlobal_Context)