more const in format detection
BaseImporter::SearchFileHeaderForToken() expected a pointer to a non-const token list. This was probably an oversight, as nobody would realistically expect the function to change the list. Furthermore, it prevented token lists from being compiled to read-only memory, in some cases even causing the compiler to generate thread-safe initialization. The list is now const and all callers declare their token lists static const, thus compiling them to read-only memory.
This commit is contained in:
@@ -155,7 +155,7 @@ void BaseImporter::GetExtensionList(std::set<std::string> &extensions) {
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
/*static*/ bool BaseImporter::SearchFileHeaderForToken(IOSystem *pIOHandler,
|
||||
const std::string &pFile,
|
||||
const char **tokens,
|
||||
const char * const *tokens,
|
||||
unsigned int numTokens,
|
||||
unsigned int searchBytes /* = 200 */,
|
||||
bool tokensSol /* false */,
|
||||
|
||||
Reference in New Issue
Block a user