Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump contrib/utf8cpp from 60c490b to 2ad9957 #269

Open
wants to merge 43 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
856547b
Fix Q1 MDL group frame loading, e.g. Q1 progs/flame2.mdl
Garux Apr 5, 2021
83c0dce
Merge branch 'master' into Q1MDLgroup
kimkulling Apr 14, 2021
c776924
fix -Waddress-of-packed-member
Garux May 30, 2021
3b56544
Merge branch 'Q1MDLgroup' of https://github.com/Garux/assimp into Q1M…
Garux May 30, 2021
93edbe8
Use Safe Constants Idioms for ObjFileParser::DEFAULT_MATERIAL.
Sep 10, 2021
5895c0c
more const in format detection
Sep 11, 2021
1eb0d18
Including <exception>
sadiki0 Sep 15, 2021
8c84afa
Merge branch 'master' into const-tokens
krishty Sep 15, 2021
79f3368
Merge branch 'master' into static
mahiuchun Sep 17, 2021
95d1232
Merge pull request #4083 from markoffline/patch-1
kimkulling Sep 20, 2021
e6543cb
Merge branch 'master' into static
mahiuchun Sep 20, 2021
4fd7330
Merge pull request #4076 from mahiuchun/static
kimkulling Sep 21, 2021
fb5b5e9
Fix possible nullptr dereferencing in material parsing
kimkulling Sep 21, 2021
590307d
Merge pull request #4085 from assimp/kimkulling-issue_3442
kimkulling Sep 21, 2021
95263b2
Update ObjTools.h
kimkulling Sep 21, 2021
d286aad
Merge pull request #4086 from assimp/kimkulling-obj_refactorings
kimkulling Sep 21, 2021
6cb6a6a
Merge branch 'master' into const-tokens
kimkulling Sep 24, 2021
96e2f1c
Merge pull request #4078 from krishty/const-tokens
kimkulling Sep 24, 2021
1f76b2e
Merge branch 'master' into Q1MDLgroup
kimkulling Oct 1, 2021
2f5a311
Merge pull request #3743 from Garux/Q1MDLgroup
kimkulling Oct 1, 2021
ac6b898
Add support for normal maps, the classic way
kimkulling Oct 1, 2021
3e4cca4
Merge pull request #4106 from assimp/kimkulling-issues-3726
kimkulling Oct 1, 2021
ae951fb
Fix aiString length in aiProcess_EmbedTextures
davidepi Oct 2, 2021
babf3b8
Merge pull request #4108 from davidepi/fix-aistring-embedtextures
kimkulling Oct 4, 2021
da53c38
contrib/zip is now a submodule
krishty Oct 6, 2021
89b20df
contrib/utf8cpp is now a submodule
krishty Oct 6, 2021
ff2b527
Visual C++: warnings are no longer treated as errors
krishty Oct 6, 2021
4e8ca06
fixed contrib/utf8cpp at version 2.3.6 from 2018 to test dependabot
krishty Oct 7, 2021
bf40207
added dependabot configuration
krishty Oct 7, 2021
e5085ec
fixed dependabot configuration error
krishty Oct 7, 2021
d7ae8ee
added dependabot configuration
krishty Oct 7, 2021
826be54
contrib/unzip is now a submodule
krishty Oct 7, 2021
025be78
contrib/rapidjson is now a submodule
krishty Oct 7, 2021
15d2258
fixed contrib/zip at version 0.1.15
krishty Oct 7, 2021
b8c4e0e
contrib/poly2tri is now a submodule
krishty Oct 7, 2021
88152b3
contrib/openddlparser is now a submodule
krishty Oct 7, 2021
a50d3e4
contrib/draco is now a submodule
krishty Oct 8, 2021
1e95572
contrib/android-cmake is now a submodule
krishty Oct 8, 2021
7d2a63f
contrib/googletest is now a submodule
krishty Oct 8, 2021
13dfc0d
contrib/pugixml is now a submodule
krishty Oct 8, 2021
b0b635e
Merge branch 'dependencies-as-submodules'
krishty Oct 8, 2021
a754b43
allowing more dependency updates
krishty Oct 8, 2021
de4fd7d
Bump contrib/utf8cpp from `60c490b` to `2ad9957`
dependabot[bot] Jan 16, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
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.
  • Loading branch information
Krishty committed Sep 11, 2021
commit 5895c0c22cc88763c016de821d2da2da7f4fd5dd
2 changes: 1 addition & 1 deletion code/AssetLib/AMF/AMFImporter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -511,7 +511,7 @@ bool AMFImporter::CanRead(const std::string &pFile, IOSystem *pIOHandler, bool p
}

if (extension.empty() || pCheckSig) {
const char *tokens[] = { "<amf" };
static const char * const tokens[] = { "<amf" };
return SearchFileHeaderForToken(pIOHandler, pFile, tokens, 1);
}

Expand Down
2 changes: 1 addition & 1 deletion code/AssetLib/ASE/ASELoader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ bool ASEImporter::CanRead(const std::string &pFile, IOSystem *pIOHandler, bool c
}

if ((!extension.length() || cs) && pIOHandler) {
const char *tokens[] = { "*3dsmax_asciiexport" };
static const char * const tokens[] = { "*3dsmax_asciiexport" };
return SearchFileHeaderForToken(pIOHandler, pFile, tokens, 1);
}
return false;
Expand Down
2 changes: 1 addition & 1 deletion code/AssetLib/BVH/BVHLoader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ bool BVHLoader::CanRead(const std::string &pFile, IOSystem *pIOHandler, bool cs)
return true;

if ((!extension.length() || cs) && pIOHandler) {
const char *tokens[] = { "HIERARCHY" };
static const char * const tokens[] = { "HIERARCHY" };
return SearchFileHeaderForToken(pIOHandler, pFile, tokens, 1);
}
return false;
Expand Down
4 changes: 2 additions & 2 deletions code/AssetLib/Blender/BlenderLoader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,8 @@ BlenderImporter::~BlenderImporter() {
delete modifier_cache;
}

static const char *Tokens[] = { "BLENDER" };
static const char *TokensForSearch[] = { "blender" };
static const char * const Tokens[] = { "BLENDER" };
static const char * const TokensForSearch[] = { "blender" };

// ------------------------------------------------------------------------------------------------
// Returns whether the class can handle the format of the given file.
Expand Down
2 changes: 1 addition & 1 deletion code/AssetLib/COB/COBLoader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ bool COBImporter::CanRead(const std::string &pFile, IOSystem *pIOHandler, bool c
}

else if ((!extension.length() || checkSig) && pIOHandler) {
const char *tokens[] = { "Caligary" };
static const char * const tokens[] = { "Caligary" };
return SearchFileHeaderForToken(pIOHandler, pFile, tokens, 1);
}
return false;
Expand Down
2 changes: 1 addition & 1 deletion code/AssetLib/CSM/CSMLoader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ bool CSMImporter::CanRead( const std::string& pFile, IOSystem* pIOHandler, bool
return true;

if ((checkSig || !extension.length()) && pIOHandler) {
const char* tokens[] = {"$Filename"};
static const char * const tokens[] = {"$Filename"};
return SearchFileHeaderForToken(pIOHandler,pFile,tokens,1);
}
return false;
Expand Down
2 changes: 1 addition & 1 deletion code/AssetLib/Collada/ColladaLoader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ bool ColladaLoader::CanRead(const std::string &pFile, IOSystem *pIOHandler, bool
if (nullptr == pIOHandler) {
return true;
}
static const char* tokens[] = {
static const char * const tokens[] = {
"<collada"
};
return SearchFileHeaderForToken(pIOHandler, pFile, tokens, 1);
Expand Down
4 changes: 2 additions & 2 deletions code/AssetLib/DXF/DXFLoader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,8 @@ bool DXFImporter::CanRead( const std::string& filename, IOSystem* pIOHandler, bo
}

if ( extension.empty() || checkSig ) {
const char *pTokens[] = { "SECTION", "HEADER", "ENDSEC", "BLOCKS" };
return BaseImporter::SearchFileHeaderForToken(pIOHandler, filename, pTokens, 4, 32 );
static const char * const pTokens[] = { "SECTION", "HEADER", "ENDSEC", "BLOCKS" };
return SearchFileHeaderForToken(pIOHandler, filename, pTokens, 4, 32 );
}

return false;
Expand Down
2 changes: 1 addition & 1 deletion code/AssetLib/FBX/FBXImporter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ bool FBXImporter::CanRead(const std::string &pFile, IOSystem *pIOHandler, bool c

else if ((!extension.length() || checkSig) && pIOHandler) {
// at least ASCII-FBX files usually have a 'FBX' somewhere in their head
const char *tokens[] = { "fbx" };
static const char * const tokens[] = { "fbx" };
return SearchFileHeaderForToken(pIOHandler, pFile, tokens, 1);
}
return false;
Expand Down
5 changes: 2 additions & 3 deletions code/AssetLib/IFC/IFCLoader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,8 @@ bool IFCImporter::CanRead(const std::string &pFile, IOSystem *pIOHandler, bool c
// note: this is the common identification for STEP-encoded files, so
// it is only unambiguous as long as we don't support any further
// file formats with STEP as their encoding.
const char *tokens[] = { "ISO-10303-21" };
const bool found(SearchFileHeaderForToken(pIOHandler, pFile, tokens, 1));
return found;
static const char * const tokens[] = { "ISO-10303-21" };
return SearchFileHeaderForToken(pIOHandler, pFile, tokens, 1);
}
return false;
}
Expand Down
2 changes: 1 addition & 1 deletion code/AssetLib/Irr/IRRLoader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ bool IRRImporter::CanRead(const std::string &pFile, IOSystem *pIOHandler, bool c
if (nullptr == pIOHandler) {
return true;
}
const char *tokens[] = { "irr_scene" };
static const char * const tokens[] = { "irr_scene" };
return SearchFileHeaderForToken(pIOHandler, pFile, tokens, 1);
}

Expand Down
2 changes: 1 addition & 1 deletion code/AssetLib/Irr/IRRMeshLoader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ bool IRRMeshImporter::CanRead(const std::string &pFile, IOSystem *pIOHandler, bo
* must return true here.
*/
if (!pIOHandler) return true;
const char *tokens[] = { "irrmesh" };
static const char * const tokens[] = { "irrmesh" };
return SearchFileHeaderForToken(pIOHandler, pFile, tokens, 1);
}
return false;
Expand Down
2 changes: 1 addition & 1 deletion code/AssetLib/MD5/MD5Loader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ bool MD5Importer::CanRead(const std::string &pFile, IOSystem *pIOHandler, bool c
if (!pIOHandler) {
return true;
}
const char *tokens[] = { "MD5Version" };
static const char * const tokens[] = { "MD5Version" };
return SearchFileHeaderForToken(pIOHandler, pFile, tokens, 1);
}

Expand Down
4 changes: 2 additions & 2 deletions code/AssetLib/MMD/MMDImporter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@ bool MMDImporter::CanRead(const std::string &pFile, IOSystem *pIOHandler,
return SimpleExtensionCheck(pFile, "pmx");
} else {
// Check file Header
static const char *pTokens[] = { "PMX " };
return BaseImporter::SearchFileHeaderForToken(pIOHandler, pFile, pTokens, 1);
static const char * const pTokens[] = { "PMX " };
return SearchFileHeaderForToken(pIOHandler, pFile, pTokens, 1);
}
}

Expand Down
2 changes: 1 addition & 1 deletion code/AssetLib/MS3D/MS3DLoader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ bool MS3DImporter::CanRead( const std::string& pFile, IOSystem* pIOHandler, bool
if (!pIOHandler) {
return true;
}
const char* tokens[] = {"MS3D000000"};
static const char * const tokens[] = {"MS3D000000"};
return SearchFileHeaderForToken(pIOHandler,pFile,tokens,1);
}
return false;
Expand Down
2 changes: 1 addition & 1 deletion code/AssetLib/NDO/NDOLoader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ bool NDOImporter::CanRead( const std::string& pFile, IOSystem* pIOHandler, bool
return true;

if ((checkSig || !extension.length()) && pIOHandler) {
const char* tokens[] = {"nendo"};
static const char * const tokens[] = {"nendo"};
return SearchFileHeaderForToken(pIOHandler,pFile,tokens,1,5);
}
return false;
Expand Down
2 changes: 1 addition & 1 deletion code/AssetLib/OFF/OFFLoader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ bool OFFImporter::CanRead( const std::string& pFile, IOSystem* pIOHandler, bool
else if (!extension.length() || checkSig)
{
if (!pIOHandler)return true;
const char* tokens[] = {"off"};
static const char * const tokens[] = {"off"};
return SearchFileHeaderForToken(pIOHandler,pFile,tokens,1,3);
}
return false;
Expand Down
2 changes: 1 addition & 1 deletion code/AssetLib/Ogre/OgreImporter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ bool OgreImporter::CanRead(const std::string &pFile, Assimp::IOSystem *pIOHandle
}

if (EndsWith(pFile, ".mesh.xml", false)) {
const char *tokens[] = { "<mesh>" };
static const char * const tokens[] = { "<mesh>" };
return SearchFileHeaderForToken(pIOHandler, pFile, tokens, 1);
} else {
/// @todo Read and validate first header chunk?
Expand Down
4 changes: 2 additions & 2 deletions code/AssetLib/OpenGEX/OpenGEXImporter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion code/AssetLib/Ply/PlyLoader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion code/AssetLib/Q3D/Q3DLoader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion code/AssetLib/STL/STLLoader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
2 changes: 1 addition & 1 deletion code/AssetLib/Terragen/TerragenLoader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
2 changes: 1 addition & 1 deletion code/AssetLib/XGL/XGLLoader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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[] = { "<world>", "<World>", "<WORLD>" };
static const char * const tokens[] = { "<world>", "<World>", "<WORLD>" };
return SearchFileHeaderForToken(pIOHandler, pFile, tokens, 3);
}
return false;
Expand Down
2 changes: 1 addition & 1 deletion code/Common/BaseImporter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 */,
Expand Down
2 changes: 1 addition & 1 deletion include/assimp/BaseImporter.h
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ class ASSIMP_API BaseImporter {
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,
Expand Down