summaryrefslogtreecommitdiffstats
path: root/Source/cmDependsFortran.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/cmDependsFortran.cxx')
-rw-r--r--Source/cmDependsFortran.cxx19
1 files changed, 10 insertions, 9 deletions
diff --git a/Source/cmDependsFortran.cxx b/Source/cmDependsFortran.cxx
index 4608b5a..c57b558 100644
--- a/Source/cmDependsFortran.cxx
+++ b/Source/cmDependsFortran.cxx
@@ -53,7 +53,7 @@ public:
};
cmDependsFortran::cmDependsFortran()
- : Internal(0)
+ : Internal(CM_NULLPTR)
{
}
@@ -91,8 +91,9 @@ cmDependsFortran::~cmDependsFortran()
}
bool cmDependsFortran::WriteDependencies(const std::set<std::string>& sources,
- const std::string& obj, std::ostream&,
- std::ostream&)
+ const std::string& obj,
+ std::ostream& /*makeDepends*/,
+ std::ostream& /*internalDepends*/)
{
// Make sure this is a scanning instance.
if (sources.empty() || sources.begin()->empty()) {
@@ -520,7 +521,8 @@ bool cmDependsFortran::CopyModule(const std::vector<std::string>& args)
}
}
return true;
- } else if (cmSystemTools::FileExists(mod_lower.c_str(), true)) {
+ }
+ if (cmSystemTools::FileExists(mod_lower.c_str(), true)) {
if (cmDependsFortran::ModulesDiffer(mod_lower.c_str(), stamp.c_str(),
compilerId.c_str())) {
if (!cmSystemTools::CopyFileAlways(mod_lower, stamp)) {
@@ -633,8 +635,8 @@ bool cmDependsFortran::ModulesDiffer(const char* modFile,
cmsys::ifstream finModFile(modFile, std::ios::in | std::ios::binary);
cmsys::ifstream finStampFile(stampFile, std::ios::in | std::ios::binary);
#else
- cmsys::ifstream finModFile(modFile, std::ios::in);
- cmsys::ifstream finStampFile(stampFile, std::ios::in);
+ cmsys::ifstream finModFile(modFile);
+ cmsys::ifstream finStampFile(stampFile);
#endif
if (!finModFile || !finStampFile) {
// At least one of the files does not exist. The modules differ.
@@ -654,10 +656,9 @@ bool cmDependsFortran::ModulesDiffer(const char* modFile,
// but also do not include a date so we can fall through to
// compare them without skipping any prefix.
unsigned char hdr[2];
- bool okay =
- finModFile.read(reinterpret_cast<char*>(hdr), 2) ? true : false;
+ bool okay = !finModFile.read(reinterpret_cast<char*>(hdr), 2).fail();
finModFile.seekg(0);
- if (!(okay && hdr[0] == 0x1f && hdr[1] == 0x8b)) {
+ if (!okay || hdr[0] != 0x1f || hdr[1] != 0x8b) {
const char seq[1] = { '\n' };
const int seqlen = 1;