Bugfix : Removed some unnecessary const_casts. ( merged from GitHub, thanks to Riku Palomäki ).

git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@1223 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
pull/5/head
kimmi 2012-03-20 21:11:05 +00:00
parent fa71305e07
commit d17071746d
4 changed files with 7 additions and 7 deletions

View File

@ -525,7 +525,7 @@ void BatchLoader::LoadAll()
DefaultLogger::get()->info("File: " + (*it).file);
}
data->pImporter->ReadFile((*it).file,pp);
(*it).scene = const_cast<aiScene*>(data->pImporter->GetOrphanedScene());
(*it).scene = data->pImporter->GetOrphanedScene();
(*it).loaded = true;
DefaultLogger::get()->info("%%% END EXTERNAL FILE %%%");

View File

@ -230,13 +230,13 @@ void ColladaLoader::ResolveNodeInstances( const ColladaParser& pParser, const Co
{
// find the corresponding node in the library
const ColladaParser::NodeLibrary::const_iterator itt = pParser.mNodeLibrary.find((*it).mNode);
Collada::Node* nd = itt == pParser.mNodeLibrary.end() ? NULL : (*itt).second;
const Collada::Node* nd = itt == pParser.mNodeLibrary.end() ? NULL : (*itt).second;
// FIX for http://sourceforge.net/tracker/?func=detail&aid=3054873&group_id=226462&atid=1067632
// need to check for both name and ID to catch all. To avoid breaking valid files,
// the workaround is only enabled when the first attempt to resolve the node has failed.
if (!nd) {
nd = const_cast<Collada::Node*>(FindNode(pParser.mRootNode,(*it).mNode));
nd = FindNode(pParser.mRootNode,(*it).mNode);
}
if (!nd)
DefaultLogger::get()->error("Collada: Unable to resolve reference to instanced node " + (*it).mNode);

View File

@ -155,7 +155,7 @@ void IFCImporter::InternReadFile( const std::string& pFile,
}
boost::scoped_ptr<STEP::DB> db(STEP::ReadFileHeader(stream));
const STEP::HeaderInfo& head = const_cast<const STEP::DB&>(*db).GetHeader();
const STEP::HeaderInfo& head = static_cast<const STEP::DB&>(*db).GetHeader();
if(!head.fileSchema.size() || head.fileSchema.substr(0,3) != "IFC") {
ThrowException("Unrecognized file schema: " + head.fileSchema);

View File

@ -63,9 +63,9 @@ void MDLImporter::SearchPalette(const unsigned char** pszColorMap)
{
if (pcStream->FileSize() >= 768)
{
szColorMap = new unsigned char[256*3];
pcStream->Read(const_cast<unsigned char*>(szColorMap),256*3,1);
unsigned char* colorMap = new unsigned char[256*3];
szColorMap = colorMap;
pcStream->Read(colorMap,256*3,1);
DefaultLogger::get()->info("Found valid colormap.lmp in directory. "
"It will be used to decode embedded textures in palletized formats.");
}