v1/v2: EBML_SEM_INFO() is not necessary anymore with EBML_CTX_IDX_INFO()

v2: clean EbmlSemantic

git-svn-id: https://matroska.svn.sourceforge.net/svnroot/matroska/trunk/libebml@96 a6f86f6d-0131-4f8e-9e7b-e335508773d5
This commit is contained in:
Steve Lhomme 2010-04-09 10:06:35 +00:00
parent 1fdcc6ae21
commit aab35dacc9
2 changed files with 4 additions and 6 deletions

View File

@ -193,7 +193,6 @@ extern const EbmlSemanticContext Context_EbmlGlobal;
#define EBML_INFO_CONTEXT(cb) (cb).GetContext()
#define EBML_SEM_UNIQUE(s) (s).IsUnique()
#define EBML_SEM_INFO(s) (const EbmlCallbacks &)(s)
#define EBML_SEM_ID(s) ((const EbmlCallbacks &)(s)).ClassId()
#define EBML_SEM_CONTEXT(s) ((const EbmlCallbacks &)(s)).GetContext()
#define EBML_SEM_CREATE(s) (s).Create()
@ -227,7 +226,6 @@ extern const EbmlSemanticContext Context_EbmlGlobal;
#define EBML_INFO_CONTEXT(cb) (cb).Context
#define EBML_SEM_UNIQUE(s) (s).Unique
#define EBML_SEM_INFO(s) (s).GetCallbacks
#define EBML_SEM_ID(s) (s).GetCallbacks.GlobalId
#define EBML_SEM_CONTEXT(s) (s).GetCallbacks.Context
#define EBML_SEM_CREATE(s) (s).Create()

View File

@ -203,10 +203,10 @@ bool EbmlMaster::CheckMandatory() const
unsigned int EltIdx;
for (EltIdx = 0; EltIdx < EBML_CTX_SIZE(Context); EltIdx++) {
if (EBML_CTX_IDX(Context,EltIdx).IsMandatory()) {
if (FindElt(EBML_SEM_INFO(EBML_CTX_IDX(Context,EltIdx))) == NULL) {
if (FindElt(EBML_CTX_IDX_INFO(Context,EltIdx)) == NULL) {
#if defined(_DEBUG) || defined(DEBUG)
// you are missing this Mandatory element
// const char * MissingName = EBML_INFO_NAME(EBML_SEM_INFO(EBML_CTX_IDX(Context,EltIdx)));
// const char * MissingName = EBML_INFO_NAME(EBML_CTX_IDX_INFO(Context,EltIdx));
#endif // DEBUG
return false;
}
@ -245,10 +245,10 @@ std::vector<std::string> EbmlMaster::FindAllMissingElements()
unsigned int EltIdx;
for (EltIdx = 0; EltIdx < EBML_CTX_SIZE(Context); EltIdx++) {
if (EBML_CTX_IDX(Context,EltIdx).IsMandatory()) {
if (FindElt(EBML_SEM_INFO(EBML_CTX_IDX(Context,EltIdx))) == NULL) {
if (FindElt(EBML_CTX_IDX_INFO(Context,EltIdx)) == NULL) {
std::string missingElement;
missingElement = "Missing element \"";
missingElement.append(EBML_INFO_NAME(EBML_SEM_INFO(EBML_CTX_IDX(Context,EltIdx))));
missingElement.append(EBML_INFO_NAME(EBML_CTX_IDX_INFO(Context,EltIdx)));
missingElement.append("\" in EbmlMaster \"");
missingElement.append(EBML_INFO_NAME(*EBML_CTX_MASTER(Context)));
missingElement.append("\"");