System : Introduce compiler warning C4458 with fixes

This commit is contained in:
Magne Sjaastad 2018-09-24 21:32:58 +02:00
parent 4009d4d63b
commit b2d055db63
7 changed files with 21 additions and 26 deletions

View File

@ -283,7 +283,6 @@ if (MSVC)
# The following warnings are supposed to be used in ResInsight, but temporarily disabled to avoid too much noise
# warning C4245: 'return': conversion from 'int' to 'size_t', signed/unsigned mismatch
# warning C4456: declaration of 'sourceInfo' hides previous local declaration
# warning C4458: declaration of 'name' hides class member
# The following warning is generated over 800 times from a qwt header only using VS2015
# Disabling temporarily
@ -292,7 +291,7 @@ if (MSVC)
# If possible, the following command is supposed to be the final target
# set_target_properties(ResInsight PROPERTIES COMPILE_FLAGS "/W4 /wd4190 /wd4100 /wd4127")
set_target_properties(ResInsight PROPERTIES COMPILE_FLAGS "/W4 /wd4190 /wd4100 /wd4127 /wd4505 /wd4245 /wd4456 /wd4458")
set_target_properties(ResInsight PROPERTIES COMPILE_FLAGS "/W4 /wd4190 /wd4100 /wd4127 /wd4505 /wd4245 /wd4456")
endif()
#############################################################################

View File

@ -526,19 +526,18 @@ RifReaderEclipseRft* RimEclipseResultCase::rftReader()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimEclipseResultCase::setGridFileName(const QString& caseFileName)
void RimEclipseResultCase::setGridFileName(const QString& fileName)
{
this->caseFileName = caseFileName;
this->caseFileName = fileName;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimEclipseResultCase::setCaseInfo(const QString& userDescription, const QString& caseFileName)
void RimEclipseResultCase::setCaseInfo(const QString& userDescription, const QString& fileName)
{
this->caseUserDescription = userDescription;
this->caseFileName = caseFileName;
this->caseFileName = fileName;
RimProject* proj = RiaApplication::instance()->project();
proj->assignCaseIdToCase(this);

View File

@ -41,8 +41,8 @@ public:
RimEclipseResultCase();
virtual ~RimEclipseResultCase();
void setGridFileName(const QString& caseFileName);
void setCaseInfo(const QString& userDescription, const QString& caseFileName);
void setGridFileName(const QString& fileName);
void setCaseInfo(const QString& userDescription, const QString& fileName);
void setSourSimFileName(const QString& fileName);
bool hasSourSimFile();

View File

@ -428,14 +428,14 @@ bool RimProject::isProjectFileVersionEqualOrOlderThan(const QString& otherProjec
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimProject::setProjectFileNameAndUpdateDependencies(const QString& fileName)
void RimProject::setProjectFileNameAndUpdateDependencies(const QString& projectFileName)
{
// Extract the filename of the project file when it was saved
QString oldProjectFileName = this->fileName;
// Replace with the new actual filename
this->fileName = fileName;
this->fileName = projectFileName;
QFileInfo fileInfo(fileName);
QFileInfo fileInfo(projectFileName);
QString newProjectPath = fileInfo.path();
QFileInfo fileInfoOld(oldProjectFileName);
@ -738,12 +738,12 @@ void RimProject::scheduleCreateDisplayModelAndRedrawAllViews()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimProject::allOilFields(std::vector<RimOilField*>& oilFields) const
void RimProject::allOilFields(std::vector<RimOilField*>& allOilFields) const
{
oilFields.clear();
allOilFields.clear();
for (const auto& oilField : this->oilFields)
{
oilFields.push_back(oilField);
allOilFields.push_back(oilField);
}
}
@ -986,10 +986,10 @@ std::vector<RimGeoMechCase*> RimProject::geoMechCases() const
std::vector<RimFractureTemplateCollection*> RimProject::allFractureTemplateCollections() const
{
std::vector<RimFractureTemplateCollection*> templColls;
std::vector<RimOilField*> oilFields;
std::vector<RimOilField*> rimOilFields;
allOilFields(oilFields);
for (RimOilField* oilField : oilFields)
allOilFields(rimOilFields);
for (RimOilField* oilField : rimOilFields)
{
templColls.push_back(oilField->fractureDefinitionCollection());
}
@ -1002,9 +1002,6 @@ std::vector<RimFractureTemplateCollection*> RimProject::allFractureTemplateColle
std::vector<RimFractureTemplate*> RimProject::allFractureTemplates() const
{
std::vector<RimFractureTemplate*> templates;
std::vector<RimOilField*> oilFields;
allOilFields(oilFields);
for (RimFractureTemplateCollection* templColl : allFractureTemplateCollections())
{
for (RimFractureTemplate* templ : templColl->fractureTemplates())

View File

@ -101,7 +101,7 @@ public:
bool isProjectFileVersionEqualOrOlderThan(const QString& otherProjectFileVersion) const;
void close();
void setProjectFileNameAndUpdateDependencies(const QString& fileName);
void setProjectFileNameAndUpdateDependencies(const QString& projectFileName);
void assignCaseIdToCase(RimCase* reservoirCase);
void assignIdToCaseGroup(RimIdenticalGridCaseGroup* caseGroup);
@ -120,7 +120,7 @@ public:
void computeUtmAreaOfInterest();
void allOilFields(std::vector<RimOilField*>& oilFields) const;
void allOilFields(std::vector<RimOilField*>& allOilFields) const;
RimOilField* activeOilField();
const RimOilField* activeOilField() const;

View File

@ -302,9 +302,9 @@ void RimWellPathCollection::readAndAddWellPaths(std::vector<RimFileWellPath*>& w
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellPathCollection::addWellPaths(const std::vector<RimWellPath*> wellPaths)
void RimWellPathCollection::addWellPaths(const std::vector<RimWellPath*> incomingWellPaths)
{
for(const auto& wellPath : wellPaths)
for(const auto& wellPath : incomingWellPaths)
{
this->wellPaths.push_back(wellPath);
}

View File

@ -101,7 +101,7 @@ public:
RimWellPath* wellPathByName(const QString& wellPathName) const;
RimWellPath* tryFindMatchingWellPath(const QString& wellName) const;
void addWellPaths(const std::vector<RimWellPath*> wellPaths);
void addWellPaths(const std::vector<RimWellPath*> incomingWellPaths);
RimWellLogFile* addWellLogs(const QStringList& filePaths);
void addWellPathFormations(const QStringList& filePaths);