Merge pull request #658 from asuessenbach/len

Extend set of strings ignored in attribute <len>
This commit is contained in:
Andreas Süßenbach 2020-07-02 18:30:17 +02:00 committed by GitHub
commit 44ce354d8f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2798,8 +2798,8 @@ void VulkanHppGenerator::appendFunctionHeaderArgumentEnhancedVector( std::string
// otherwise, use our ArrayProxy // otherwise, use our ArrayProxy
bool isConst = ( param.type.prefix.find( "const" ) != std::string::npos ); bool isConst = ( param.type.prefix.find( "const" ) != std::string::npos );
str += optionalBegin + "ArrayProxy<" + str += optionalBegin + "ArrayProxy<" +
( isTemplateParam ? ( isConst ? "const T" : "T" ) : stripPostfix( param.type.compose(), "*" ) ) + "> const &" + ( isTemplateParam ? ( isConst ? "const T" : "T" ) : stripPostfix( param.type.compose(), "*" ) ) +
optionalEnd + strippedParameterName; "> const &" + optionalEnd + strippedParameterName;
} }
} }
@ -3792,7 +3792,8 @@ void VulkanHppGenerator::appendStructSetter( std::string & str
std::set<std::string> ignoreLens = { "null-terminated", std::set<std::string> ignoreLens = { "null-terminated",
R"(latexmath:[\lceil{\mathit{rasterizationSamples} \over 32}\rceil])", R"(latexmath:[\lceil{\mathit{rasterizationSamples} \over 32}\rceil])",
"2*VK_UUID_SIZE" }; "2*VK_UUID_SIZE",
"2*ename:VK_UUID_SIZE" };
if ( !member.len.empty() && ( ignoreLens.find( member.len[0] ) == ignoreLens.end() ) ) if ( !member.len.empty() && ( ignoreLens.find( member.len[0] ) == ignoreLens.end() ) )
{ {
assert( member.name.front() == 'p' ); assert( member.name.front() == 'p' );
@ -6496,7 +6497,7 @@ void VulkanHppGenerator::readStructMember( tinyxml2::XMLElement const * element,
std::find_if( members.begin(), members.end(), [&len]( MemberData const & md ) { return ( md.name == len ); } ); std::find_if( members.begin(), members.end(), [&len]( MemberData const & md ) { return ( md.name == len ); } );
check( ( len == "null-terminated" ) || ( len == R"(latexmath:[\textrm{codeSize} \over 4])" ) || check( ( len == "null-terminated" ) || ( len == R"(latexmath:[\textrm{codeSize} \over 4])" ) ||
( len == R"(latexmath:[\lceil{\mathit{rasterizationSamples} \over 32}\rceil])" ) || ( len == R"(latexmath:[\lceil{\mathit{rasterizationSamples} \over 32}\rceil])" ) ||
( len == "2*VK_UUID_SIZE" ) || ( lenMember != members.end() ), ( len == "2*VK_UUID_SIZE" ) || ( len == "2*ename:VK_UUID_SIZE" ) || ( lenMember != members.end() ),
line, line,
"member attribute <len> holds unknown value <" + len + ">" ); "member attribute <len> holds unknown value <" + len + ">" );
if ( lenMember != members.end() ) if ( lenMember != members.end() )
@ -6507,7 +6508,7 @@ void VulkanHppGenerator::readStructMember( tinyxml2::XMLElement const * element,
} }
if ( 1 < memberData.len.size() ) if ( 1 < memberData.len.size() )
{ {
check( memberData.len[1] == "null-terminated", check( ( memberData.len[1] == "1" ) || ( memberData.len[1] == "null-terminated" ),
line, line,
"member attribute <len> holds unknown second value <" + memberData.len[1] + ">" ); "member attribute <len> holds unknown second value <" + memberData.len[1] + ">" );
} }