Downgrade missing attribute "type" in enums in video.xml from error to warning (#1792)

This commit is contained in:
Andreas Süßenbach 2024-02-06 13:17:39 +01:00 committed by GitHub
parent 1b6ea3c295
commit a3ecb02131
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 1017 additions and 4 deletions

View File

@ -406,11 +406,11 @@ void VideoHppGenerator::readEnums( tinyxml2::XMLElement const * element )
{ {
int line = element->GetLineNum(); int line = element->GetLineNum();
std::map<std::string, std::string> attributes = getAttributes( element ); std::map<std::string, std::string> attributes = getAttributes( element );
checkAttributes( line, attributes, { { "name", {} }, { "type", { "enum" } } }, {} ); checkAttributes( line, attributes, { { "name", {} } }, { { "type", { "enum" } } } );
std::vector<tinyxml2::XMLElement const *> children = getChildElements( element ); std::vector<tinyxml2::XMLElement const *> children = getChildElements( element );
checkElements( line, children, { { "enum", {} } }, { "comment" } ); checkElements( line, children, { { "enum", {} } }, { "comment" } );
std::string name, type; std::string name;
for ( auto const & attribute : attributes ) for ( auto const & attribute : attributes )
{ {
if ( attribute.first == "name" ) if ( attribute.first == "name" )
@ -419,7 +419,8 @@ void VideoHppGenerator::readEnums( tinyxml2::XMLElement const * element )
} }
else if ( attribute.first == "type" ) else if ( attribute.first == "type" )
{ {
type = attribute.second; assert( !name.empty() );
checkForError( attribute.second == "enum", line, "unknown type <" + attribute.second + "> for enum <" + name + ">" );
} }
} }

File diff suppressed because it is too large Load Diff