Get rid of warnings on GCC4.4 with -wall

git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@541 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
This commit is contained in:
aramis_acg
2010-02-06 23:52:41 +00:00
parent 7dcbff5d5c
commit 17326515d4
33 changed files with 206 additions and 125 deletions

View File

@@ -118,19 +118,32 @@ bool IOSystem::ComparePaths (const char* one, const char* second) const
return !ASSIMP_stricmp(one,second);
}
// this should be sufficient for all platforms :D -- not really :->
#define PATHLIMIT 4096
// maximum path length
// XXX http://insanecoding.blogspot.com/2007/11/pathmax-simply-isnt.html
#ifdef PATH_MAX
# define PATHLIMIT PATH_MAX
#else
# define PATHLIMIT 4096
#endif
// ------------------------------------------------------------------------------------------------
// Convert a relative path into an absolute path
inline void MakeAbsolutePath (const char* in, char* _out)
{
ai_assert(in & _out);
char* ret;
#ifdef _WIN32
::_fullpath(_out, in,PATHLIMIT);
ret = ::_fullpath(_out, in,PATHLIMIT);
#else
// use realpath
realpath(in, _out);
#endif
// use realpath
ret = realpath(in, _out);
#endif
if(!ret) {
// preserve the input path, maybe someone else is able to fix
// the path before it is accessed (e.g. our file system filter)
DefaultLogger::get()->warn("Invalid path: "+std::string(in));
strcpy(_out,in);
}
}
// ------------------------------------------------------------------------------------------------