Merge remote-tracking branch 'BenLubar/win64-warnings' into develop

develop
lethosor 2017-08-07 13:51:18 -04:00
commit 5c33fcccbd
2 changed files with 7 additions and 5 deletions

@ -58,6 +58,8 @@ distribution.
#pragma warning( disable: 4482)
// nonstandard extension used: 'extern' before template explicit instantiation
#pragma warning( disable: 4231)
// ignore warnings about putting a vector index into an int
#pragma warning( disable: 4267)
#endif
#endif

@ -53,7 +53,7 @@ using namespace DFHack;
bool Filesystem::chdir (std::string path)
{
return !(bool)::chdir(path.c_str());
return ::chdir(path.c_str()) == 0;
}
std::string Filesystem::getcwd ()
@ -79,7 +79,7 @@ bool Filesystem::mkdir (std::string path)
fail = ::mkdir(path.c_str(), S_IRUSR | S_IWUSR | S_IXUSR | S_IRGRP |
S_IWGRP | S_IXGRP | S_IROTH | S_IXOTH);
#endif
return !(bool)fail;
return fail == 0;
}
bool Filesystem::rmdir (std::string path)
@ -90,7 +90,7 @@ bool Filesystem::rmdir (std::string path)
#else
fail = ::rmdir(path.c_str());
#endif
return !(bool)fail;
return fail == 0;
}
#ifdef _WIN32
@ -116,13 +116,13 @@ _filetype mode2type (mode_t mode) {
bool Filesystem::stat (std::string path, STAT_STRUCT &info)
{
return !(bool)(STAT_FUNC(path.c_str(), &info));
return (STAT_FUNC(path.c_str(), &info)) == 0;
}
bool Filesystem::exists (std::string path)
{
STAT_STRUCT info;
return (bool)Filesystem::stat(path, info);
return Filesystem::stat(path, info);
}
_filetype Filesystem::filetype (std::string path)