MCPcopy Create free account
hub / github.com/carbonengine/trinity / AllocateNameWithPrefix

Method AllocateNameWithPrefix

shadercompiler/ParserState.cpp:905–917  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

903}
904
905InlineString ParserState::AllocateNameWithPrefix( const char* prefix )
906{
907 const char* format = "__%s_%04i";
908 size_t len = strlen( format ) - 2 + strlen( prefix ) + 1;
909 char* newName = new char[len];
910#if _WIN32
911 sprintf_s( newName, len, format, prefix, m_strings.size() );
912#else
913 snprintf( newName, len, format, prefix, m_strings.size() );
914#endif
915 m_strings.push_back( newName );
916 return MakeInlineString( newName, newName + len - 1 );
917}
918
919InlineString ParserState::AllocateNameWithPrefix( const InlineString& prefix )
920{

Callers 3

CollectGlobalsFunction · 0.80
NewStructMemberFunction · 0.80
PatchShaderFunction · 0.80

Calls 3

MakeInlineStringFunction · 0.85
sizeMethod · 0.80
ToStringFunction · 0.70

Tested by

no test coverage detected