Try fix travis ci produced build errors on gcc and clang.

pull/266/head
Jonne Nauha 2014-05-02 01:38:13 +03:00
parent 409c2cf332
commit dcf6002bed
3 changed files with 21 additions and 10 deletions

View File

@ -5,11 +5,8 @@
#ifndef ASSIMP_BUILD_NO_OGRE_IMPORTER #ifndef ASSIMP_BUILD_NO_OGRE_IMPORTER
#include "BaseImporter.h" #include "BaseImporter.h"
#include "irrXMLWrapper.h"
#include "OgreParsingUtils.h" #include "OgreParsingUtils.h"
#include <vector>
namespace Assimp namespace Assimp
{ {
namespace Ogre namespace Ogre

View File

@ -46,7 +46,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <sstream> #include <sstream>
#include "OgreImporter.h" #include "OgreImporter.h"
#include "irrXMLWrapper.h"
#include "TinyFormatter.h" #include "TinyFormatter.h"
using namespace std; using namespace std;
@ -195,8 +194,8 @@ aiMaterial* OgreImporter::ReadMaterial(const std::string &pFile, Assimp::IOSyste
if (linePart == partTechnique) if (linePart == partTechnique)
{ {
string techniqueName = Trim(SkipLine(ss)); string techniqueName = SkipLine(ss);
ReadTechnique(techniqueName, ss, material); ReadTechnique(Trim(techniqueName), ss, material);
} }
// Read informations from a custom material // Read informations from a custom material
@ -315,8 +314,8 @@ bool OgreImporter::ReadTechnique(const std::string &techniqueName, stringstream
/// @todo Techniques have other attributes than just passes. /// @todo Techniques have other attributes than just passes.
if (linePart == partPass) if (linePart == partPass)
{ {
string passName = Trim(SkipLine(ss)); string passName = SkipLine(ss);
ReadPass(passName, ss, material); ReadPass(Trim(passName), ss, material);
} }
} }
return true; return true;
@ -374,8 +373,8 @@ bool OgreImporter::ReadPass(const std::string &passName, stringstream &ss, aiMat
} }
else if (linePart == partTextureUnit) else if (linePart == partTextureUnit)
{ {
string textureUnitName = Trim(SkipLine(ss)); string textureUnitName = SkipLine(ss);
ReadTextureUnit(textureUnitName, ss, material); ReadTextureUnit(Trim(textureUnitName), ss, material);
} }
} }
return true; return true;

View File

@ -33,7 +33,10 @@ inline int GetAttribute<int>(const XmlReader* reader, const std::string &name)
if (value) if (value)
return atoi(value); return atoi(value);
else else
{
ThrowAttibuteError(reader, name); ThrowAttibuteError(reader, name);
return 0;
}
} }
template<> template<>
@ -43,7 +46,10 @@ inline unsigned int GetAttribute<unsigned int>(const XmlReader* reader, const st
if (value) if (value)
return static_cast<unsigned int>(atoi(value)); ///< @todo Find a better way... return static_cast<unsigned int>(atoi(value)); ///< @todo Find a better way...
else else
{
ThrowAttibuteError(reader, name); ThrowAttibuteError(reader, name);
return 0;
}
} }
template<> template<>
@ -53,7 +59,10 @@ inline float GetAttribute<float>(const XmlReader* reader, const std::string &nam
if (value) if (value)
return fast_atof(value); return fast_atof(value);
else else
{
ThrowAttibuteError(reader, name); ThrowAttibuteError(reader, name);
return 0.f;
}
} }
template<> template<>
@ -63,7 +72,10 @@ inline std::string GetAttribute<std::string>(const XmlReader* reader, const std:
if (value) if (value)
return std::string(value); return std::string(value);
else else
{
ThrowAttibuteError(reader, name); ThrowAttibuteError(reader, name);
return "";
}
} }
template<> template<>
@ -75,7 +87,10 @@ inline bool GetAttribute<bool>(const XmlReader* reader, const std::string &name)
else if (ASSIMP_stricmp(value, "false") == 0) else if (ASSIMP_stricmp(value, "false") == 0)
return false; return false;
else else
{
ThrowAttibuteError(reader, name, "Boolean value is expected to be 'true' or 'false', encountered '" + value + "'"); ThrowAttibuteError(reader, name, "Boolean value is expected to be 'true' or 'false', encountered '" + value + "'");
return false;
}
} }
inline bool NextNode(XmlReader* reader) inline bool NextNode(XmlReader* reader)