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
#include "BaseImporter.h"
#include "irrXMLWrapper.h"
#include "OgreParsingUtils.h"
#include <vector>
namespace Assimp
{
namespace Ogre

View File

@ -46,7 +46,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <sstream>
#include "OgreImporter.h"
#include "irrXMLWrapper.h"
#include "TinyFormatter.h"
using namespace std;
@ -195,8 +194,8 @@ aiMaterial* OgreImporter::ReadMaterial(const std::string &pFile, Assimp::IOSyste
if (linePart == partTechnique)
{
string techniqueName = Trim(SkipLine(ss));
ReadTechnique(techniqueName, ss, material);
string techniqueName = SkipLine(ss);
ReadTechnique(Trim(techniqueName), ss, 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.
if (linePart == partPass)
{
string passName = Trim(SkipLine(ss));
ReadPass(passName, ss, material);
string passName = SkipLine(ss);
ReadPass(Trim(passName), ss, material);
}
}
return true;
@ -374,8 +373,8 @@ bool OgreImporter::ReadPass(const std::string &passName, stringstream &ss, aiMat
}
else if (linePart == partTextureUnit)
{
string textureUnitName = Trim(SkipLine(ss));
ReadTextureUnit(textureUnitName, ss, material);
string textureUnitName = SkipLine(ss);
ReadTextureUnit(Trim(textureUnitName), ss, material);
}
}
return true;

View File

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