System : System : Introduce compiler warning 4456 with fixes

This commit is contained in:
Magne Sjaastad 2018-09-25 07:37:40 +02:00
parent 09d7349475
commit f61b82dd35
9 changed files with 31 additions and 36 deletions

View File

@ -2155,20 +2155,22 @@ void RiaApplication::addCommandObject(RimCommandObject* commandObject)
//--------------------------------------------------------------------------------------------------
void RiaApplication::executeCommandObjects()
{
std::list< RimCommandObject* >::iterator it = m_commandQueue.begin();
while (it != m_commandQueue.end())
{
RimCommandObject* toBeRemoved = *it;
if (!toBeRemoved->isAsyncronous())
std::list<RimCommandObject*>::iterator it = m_commandQueue.begin();
while (it != m_commandQueue.end())
{
toBeRemoved->redo();
RimCommandObject* toBeRemoved = *it;
if (!toBeRemoved->isAsyncronous())
{
toBeRemoved->redo();
++it;
m_commandQueue.remove(toBeRemoved);
}
else
{
++it;
++it;
m_commandQueue.remove(toBeRemoved);
}
else
{
++it;
}
}
}

View File

@ -291,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")
set_target_properties(ResInsight PROPERTIES COMPILE_FLAGS "/W4 /wd4190 /wd4100 /wd4127 /wd4505 /wd4245")
endif()
#############################################################################

View File

@ -246,8 +246,8 @@ void RifReaderEclipseRft::cellIndices(const RifEclipseRftAddress& rftAddress, st
int i, j, k;
ecl_rft_node_iget_ijk(node, cellIdx, &i, &j, &k);
caf::VecIjk index( (size_t)i, (size_t)j, (size_t)k );
indices->push_back(index);
caf::VecIjk ijk( (size_t)i, (size_t)j, (size_t)k );
indices->push_back(ijk);
}
}

View File

@ -628,9 +628,6 @@ void RimEclipseView::updateCurrentTimeStep()
if (this->showInactiveCells())
{
std::vector<size_t> gridIndices;
this->indicesToVisibleGrids(&gridIndices);
if (this->rangeFilterCollection()->hasActiveFilters() ) // Wells not considered, because we do not have a INACTIVE_WELL_CELLS group yet.
{
m_reservoirGridPartManager->appendStaticGeometryPartsToModel(frameParts.p(), RANGE_FILTERED_INACTIVE, gridIndices);
@ -1189,7 +1186,7 @@ void RimEclipseView::syncronizeWellsWithResults()
{
if (!(m_eclipseCase && m_eclipseCase->eclipseCaseData()) ) return;
cvf::Collection<RigSimWellData> simWellData = m_eclipseCase->eclipseCaseData()->wellResults();
cvf::Collection<RigSimWellData> wellResults = m_eclipseCase->eclipseCaseData()->wellResults();
std::vector<caf::PdmPointer<RimSimWellInView> > newWells;
@ -1205,20 +1202,20 @@ void RimEclipseView::syncronizeWellsWithResults()
// Find corresponding well from well result, or create a new
for (size_t wIdx = 0; wIdx < simWellData.size(); ++wIdx)
for (size_t wIdx = 0; wIdx < wellResults.size(); ++wIdx)
{
RimSimWellInView* well = this->wellCollection()->findWell(simWellData[wIdx]->m_wellName);
RimSimWellInView* well = this->wellCollection()->findWell(wellResults[wIdx]->m_wellName);
if (!well)
{
well = new RimSimWellInView;
well->name = simWellData[wIdx]->m_wellName;
well->name = wellResults[wIdx]->m_wellName;
isAnyWellCreated = true;
}
newWells.push_back(well);
well->setSimWellData(simWellData[wIdx].p(), wIdx);
well->setSimWellData(wellResults[wIdx].p(), wIdx);
}
// Delete all wells that does not have a result

View File

@ -236,8 +236,6 @@ void RimIdenticalGridCaseGroup::loadMainCaseAndActiveCellInfo()
// for all cases
{
RiaDefines::PorosityModelType poroModel = RiaDefines::MATRIX_MODEL;
std::vector<RigEclipseTimeStepInfo> timeStepInfos = rigCaseData->results(poroModel)->timeStepInfos(0);
const std::vector<RigEclipseResultInfo> resultInfos = rigCaseData->results(poroModel)->infoForEachResultIndex();
@ -259,7 +257,7 @@ void RimIdenticalGridCaseGroup::loadMainCaseAndActiveCellInfo()
size_t scalarResultIndex = cellResultsStorage->findScalarResultIndex(resultType, resultName);
if (scalarResultIndex == cvf::UNDEFINED_SIZE_T)
{
size_t scalarResultIndex = cellResultsStorage->findOrCreateScalarResultIndex(resultType, resultName, needsToBeStored);
scalarResultIndex = cellResultsStorage->findOrCreateScalarResultIndex(resultType, resultName, needsToBeStored);
if (mustBeCalculated) cellResultsStorage->setMustBeCalculated(scalarResultIndex);

View File

@ -236,7 +236,6 @@ void RigEclipseToStimPlanCellTransmissibilityCalculator::calculateStimPlanCellsM
if (polygonsForStimPlanCellInEclipseCell.empty()) continue;
double area;
std::vector<double> areaOfFractureParts;
double length;
std::vector<double> lengthXareaOfFractureParts;
@ -246,8 +245,8 @@ void RigEclipseToStimPlanCellTransmissibilityCalculator::calculateStimPlanCellsM
for (const std::vector<cvf::Vec3d>& fracturePartPolygon : polygonsForStimPlanCellInEclipseCell)
{
areaVector = cvf::GeometryTools::polygonAreaNormal3D(fracturePartPolygon);
area = areaVector.length();
areaVector = cvf::GeometryTools::polygonAreaNormal3D(fracturePartPolygon);
double area = areaVector.length();
areaOfFractureParts.push_back(area);
length = RigCellGeometryTools::polygonLengthInLocalXdirWeightedByArea(fracturePartPolygon);

View File

@ -269,10 +269,10 @@ RigFlowDiagTimeStepResult RigFlowDiagSolverInterface::calculate(size_t timeStepI
QString gridFileName = m_eclipseCase->gridFileName();
if ( !RifEclipseOutputFileTools::findSiblingFilesWithSameBaseName(gridFileName, &m_filesWithSameBaseName) ) return result;
QString restartFileName = RifEclipseOutputFileTools::firstFileNameOfType(m_filesWithSameBaseName, ECL_UNIFIED_RESTART_FILE);
if ( !restartFileName.isEmpty() )
QString firstRestartFileName = RifEclipseOutputFileTools::firstFileNameOfType(m_filesWithSameBaseName, ECL_UNIFIED_RESTART_FILE);
if ( !firstRestartFileName.isEmpty() )
{
m_opmFlowDiagStaticData->m_unifiedRestartData.reset(new Opm::ECLRestartData(Opm::ECLRestartData(restartFileName.toStdString())));
m_opmFlowDiagStaticData->m_unifiedRestartData.reset(new Opm::ECLRestartData(Opm::ECLRestartData(firstRestartFileName.toStdString())));
m_opmFlowDiagStaticData->m_hasUnifiedRestartFile = true;
}
else
@ -291,7 +291,7 @@ RigFlowDiagTimeStepResult RigFlowDiagSolverInterface::calculate(size_t timeStepI
restartFileNames.sort(); // To make sure they are sorted in increasing *.X000N order. Hack. Should probably be actual time stored on file.
m_opmFlowDiagStaticData->m_hasUnifiedRestartFile = false;
for (auto restartFileName : restartFileNames)
for (const auto& restartFileName : restartFileNames)
{
m_opmFlowDiagStaticData->m_singleRestartDataTimeSteps.push_back(Opm::ECLRestartData(restartFileName.toStdString()));
}

View File

@ -201,7 +201,6 @@ GeometryTools::IntersectionStatus inPlaneLineIntersect(
if (length12 < EPS )
{
cvf::Vec3d p34(x4-x3, y4-y3, 0);
*x = x1;
*y = y1;
*fractionAlongLine1 = 1;

View File

@ -136,10 +136,10 @@ RimEclipseCase* RiaSocketServer::findReservoir(int caseId)
if (currCaseId < 0)
{
RimEclipseView* riv = dynamic_cast<RimEclipseView*>(RiaApplication::instance()->activeReservoirView());
if (riv)
RimEclipseView* eclipseView = dynamic_cast<RimEclipseView*>(RiaApplication::instance()->activeReservoirView());
if (eclipseView)
{
return riv->eclipseCase();
return eclipseView->eclipseCase();
}
// If the active mdi window is different from an Eclipse view, search through available mdi windows to find the last activated