diff --git a/code/AssetLib/AMF/AMFImporter.cpp b/code/AssetLib/AMF/AMFImporter.cpp index 88a38b827..9a9ab94ca 100644 --- a/code/AssetLib/AMF/AMFImporter.cpp +++ b/code/AssetLib/AMF/AMFImporter.cpp @@ -511,7 +511,7 @@ bool AMFImporter::CanRead(const std::string &pFile, IOSystem *pIOHandler, bool p } if (extension.empty() || pCheckSig) { - const char *tokens[] = { "" }; + static const char * const tokens[] = { "" }; return SearchFileHeaderForToken(pIOHandler, pFile, tokens, 1); } else { /// @todo Read and validate first header chunk? diff --git a/code/AssetLib/OpenGEX/OpenGEXImporter.cpp b/code/AssetLib/OpenGEX/OpenGEXImporter.cpp index 05507944e..0f224ea28 100644 --- a/code/AssetLib/OpenGEX/OpenGEXImporter.cpp +++ b/code/AssetLib/OpenGEX/OpenGEXImporter.cpp @@ -299,8 +299,8 @@ bool OpenGEXImporter::CanRead(const std::string &file, IOSystem *pIOHandler, boo if (!checkSig) { canRead = SimpleExtensionCheck(file, "ogex"); } else { - static const char *token[] = { "Metric", "GeometryNode", "VertexArray (attrib", "IndexArray" }; - canRead = BaseImporter::SearchFileHeaderForToken(pIOHandler, file, token, 4); + static const char * const token[] = { "Metric", "GeometryNode", "VertexArray (attrib", "IndexArray" }; + canRead = SearchFileHeaderForToken(pIOHandler, file, token, 4); } return canRead; diff --git a/code/AssetLib/Ply/PlyLoader.cpp b/code/AssetLib/Ply/PlyLoader.cpp index 93d48bcbf..b58ef1ef2 100644 --- a/code/AssetLib/Ply/PlyLoader.cpp +++ b/code/AssetLib/Ply/PlyLoader.cpp @@ -111,7 +111,7 @@ bool PLYImporter::CanRead(const std::string &pFile, IOSystem *pIOHandler, bool c if (!pIOHandler) { return true; } - static const char *tokens[] = { + static const char * const tokens[] = { "ply" }; return SearchFileHeaderForToken(pIOHandler, pFile, tokens, 1); diff --git a/code/AssetLib/Q3D/Q3DLoader.cpp b/code/AssetLib/Q3D/Q3DLoader.cpp index f81026547..fe8541a5d 100644 --- a/code/AssetLib/Q3D/Q3DLoader.cpp +++ b/code/AssetLib/Q3D/Q3DLoader.cpp @@ -92,7 +92,7 @@ bool Q3DImporter::CanRead(const std::string &pFile, IOSystem *pIOHandler, bool c else if (!extension.length() || checkSig) { if (!pIOHandler) return true; - const char *tokens[] = { "quick3Do", "quick3Ds" }; + static const char * const tokens[] = { "quick3Do", "quick3Ds" }; return SearchFileHeaderForToken(pIOHandler, pFile, tokens, 2); } return false; diff --git a/code/AssetLib/STL/STLLoader.cpp b/code/AssetLib/STL/STLLoader.cpp index 8cfe63e0d..4d23b93e2 100644 --- a/code/AssetLib/STL/STLLoader.cpp +++ b/code/AssetLib/STL/STLLoader.cpp @@ -150,7 +150,7 @@ bool STLImporter::CanRead(const std::string &pFile, IOSystem *pIOHandler, bool c if (!pIOHandler) { return true; } - const char *tokens[] = { "STL", "solid" }; + static const char * const tokens[] = { "STL", "solid" }; return SearchFileHeaderForToken(pIOHandler, pFile, tokens, 2); } diff --git a/code/AssetLib/Terragen/TerragenLoader.cpp b/code/AssetLib/Terragen/TerragenLoader.cpp index e0bdbf026..9a6e7fa24 100644 --- a/code/AssetLib/Terragen/TerragenLoader.cpp +++ b/code/AssetLib/Terragen/TerragenLoader.cpp @@ -93,7 +93,7 @@ bool TerragenImporter::CanRead(const std::string &pFile, IOSystem *pIOHandler, b return true; } - const char *tokens[] = { "terragen" }; + static const char * const tokens[] = { "terragen" }; return SearchFileHeaderForToken(pIOHandler, pFile, tokens, 1); } diff --git a/code/AssetLib/XGL/XGLLoader.cpp b/code/AssetLib/XGL/XGLLoader.cpp index bbfa31829..c3341af5e 100644 --- a/code/AssetLib/XGL/XGLLoader.cpp +++ b/code/AssetLib/XGL/XGLLoader.cpp @@ -118,7 +118,7 @@ bool XGLImporter::CanRead(const std::string &pFile, IOSystem *pIOHandler, bool c } else if (extension == "xml" || checkSig) { ai_assert(pIOHandler != NULL); - const char *tokens[] = { "", "", "" }; + static const char * const tokens[] = { "", "", "" }; return SearchFileHeaderForToken(pIOHandler, pFile, tokens, 3); } return false; diff --git a/code/Common/BaseImporter.cpp b/code/Common/BaseImporter.cpp index 0f41e9e65..fa6cac938 100644 --- a/code/Common/BaseImporter.cpp +++ b/code/Common/BaseImporter.cpp @@ -155,7 +155,7 @@ void BaseImporter::GetExtensionList(std::set &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 */, diff --git a/include/assimp/BaseImporter.h b/include/assimp/BaseImporter.h index 54b5daac1..656e0f165 100644 --- a/include/assimp/BaseImporter.h +++ b/include/assimp/BaseImporter.h @@ -259,7 +259,7 @@ public: // static utilities static bool SearchFileHeaderForToken( IOSystem *pIOSystem, const std::string &file, - const char **tokens, + const char * const *tokens, unsigned int numTokens, unsigned int searchBytes = 200, bool tokensSol = false,